given a chunked bitmap, renders it.
| 291 | |
| 292 | // given a chunked bitmap, renders it. |
| 293 | void rend_DrawChunkedBitmap(chunked_bitmap *chunk, int x, int y, uint8_t alpha) { |
| 294 | int *bm_array = chunk->bm_array; |
| 295 | int w = chunk->w; |
| 296 | int h = chunk->h; |
| 297 | int piece_w = bm_w(bm_array[0], 0); |
| 298 | int piece_h = bm_h(bm_array[0], 0); |
| 299 | int screen_w, screen_h; |
| 300 | int i, t; |
| 301 | rend_SetZBufferState(0); |
| 302 | rend_GetProjectionParameters(&screen_w, &screen_h); |
| 303 | for (i = 0; i < h; i++) { |
| 304 | for (t = 0; t < w; t++) { |
| 305 | int dx = x + (piece_w * t); |
| 306 | int dy = y + (piece_h * i); |
| 307 | int dw, dh; |
| 308 | if ((dx + piece_w) > screen_w) |
| 309 | dw = piece_w - ((dx + piece_w) - screen_w); |
| 310 | else |
| 311 | dw = piece_w; |
| 312 | if ((dy + piece_h) > screen_h) |
| 313 | dh = piece_h - ((dy + piece_h) - screen_h); |
| 314 | else |
| 315 | dh = piece_h; |
| 316 | |
| 317 | float u2 = (float)dw / (float)piece_w; |
| 318 | float v2 = (float)dh / (float)piece_h; |
| 319 | rend_DrawSimpleBitmap(bm_array[i * w + t], dx, dy); |
| 320 | } |
| 321 | } |
| 322 | rend_SetZBufferState(1); |
| 323 | } |
| 324 | |
| 325 | // given a chunked bitmap, renders it.scaled |
| 326 | void rend_DrawScaledChunkedBitmap(chunked_bitmap *chunk, int x, int y, int neww, int newh, uint8_t alpha) { |
no test coverage detected