draws a scaled 2d bitmap to our buffer
| 240 | |
| 241 | // draws a scaled 2d bitmap to our buffer |
| 242 | void rend_DrawScaledBitmap(int x1, int y1, int x2, int y2, int bm, float u0, float v0, float u1, float v1, int color, |
| 243 | float *alphas) { |
| 244 | g3Point *ptr_pnts[4]; |
| 245 | g3Point pnts[4]; |
| 246 | float r, g, b; |
| 247 | if (color != -1) { |
| 248 | r = GR_COLOR_RED(color) / 255.0; |
| 249 | g = GR_COLOR_GREEN(color) / 255.0; |
| 250 | b = GR_COLOR_BLUE(color) / 255.0; |
| 251 | } |
| 252 | for (int i = 0; i < 4; i++) { |
| 253 | if (color == -1) |
| 254 | pnts[i].p3_l = 1.0; |
| 255 | else { |
| 256 | pnts[i].p3_r = r; |
| 257 | pnts[i].p3_g = g; |
| 258 | pnts[i].p3_b = b; |
| 259 | } |
| 260 | if (alphas) { |
| 261 | pnts[i].p3_a = alphas[i]; |
| 262 | } |
| 263 | |
| 264 | pnts[i].p3_z = 1.0f; |
| 265 | pnts[i].p3_flags = PF_PROJECTED; |
| 266 | } |
| 267 | |
| 268 | pnts[0].p3_sx = x1; |
| 269 | pnts[0].p3_sy = y1; |
| 270 | pnts[0].p3_u = u0; |
| 271 | pnts[0].p3_v = v0; |
| 272 | pnts[1].p3_sx = x2; |
| 273 | pnts[1].p3_sy = y1; |
| 274 | pnts[1].p3_u = u1; |
| 275 | pnts[1].p3_v = v0; |
| 276 | pnts[2].p3_sx = x2; |
| 277 | pnts[2].p3_sy = y2; |
| 278 | pnts[2].p3_u = u1; |
| 279 | pnts[2].p3_v = v1; |
| 280 | pnts[3].p3_sx = x1; |
| 281 | pnts[3].p3_sy = y2; |
| 282 | pnts[3].p3_u = u0; |
| 283 | pnts[3].p3_v = v1; |
| 284 | ptr_pnts[0] = &pnts[0]; |
| 285 | ptr_pnts[1] = &pnts[1]; |
| 286 | ptr_pnts[2] = &pnts[2]; |
| 287 | ptr_pnts[3] = &pnts[3]; |
| 288 | rend_SetTextureType(TT_LINEAR); |
| 289 | rend_DrawPolygon2D(bm, ptr_pnts, 4); |
| 290 | } |
| 291 | |
| 292 | // given a chunked bitmap, renders it. |
| 293 | void rend_DrawChunkedBitmap(chunked_bitmap *chunk, int x, int y, uint8_t alpha) { |
no test coverage detected