| 403 | void set_vert(RwIm2DVertex& vert, F32 x, F32 y, F32 u, F32 v, iColor_tag c); |
| 404 | |
| 405 | void tex_render(const basic_rect<F32>& src, const basic_rect<F32>& dst, |
| 406 | const basic_rect<F32>& clip, iColor_tag color) |
| 407 | { |
| 408 | basic_rect<F32> r = dst; |
| 409 | basic_rect<F32> rt = src; |
| 410 | |
| 411 | clip.clip(r, rt); |
| 412 | |
| 413 | if (r.empty()) |
| 414 | { |
| 415 | return; |
| 416 | } |
| 417 | |
| 418 | if (vert_buffer_used == VERT_BUFFER_SIZE) |
| 419 | { |
| 420 | RwIm2DRenderPrimitive(rwPRIMTYPETRILIST, vert_buffer, VERT_BUFFER_SIZE); |
| 421 | vert_buffer_used = 0; |
| 422 | } |
| 423 | |
| 424 | RwIm2DVertex* vert = &vert_buffer[vert_buffer_used]; |
| 425 | |
| 426 | r.scale(640.0f, 480.0f); |
| 427 | |
| 428 | set_vert(vert[0], r.x, r.y, rt.x, rt.y, color); |
| 429 | set_vert(vert[1], r.x, r.y + r.h, rt.x, rt.y + rt.h, color); |
| 430 | set_vert(vert[2], r.x + r.w, r.y, rt.x + rt.w, rt.y, color); |
| 431 | |
| 432 | vert[3] = vert[2]; |
| 433 | vert[4] = vert[1]; |
| 434 | |
| 435 | set_vert(vert[5], r.x + r.w, r.y + r.h, rt.x + rt.w, rt.y + rt.h, color); |
| 436 | |
| 437 | vert_buffer_used += 6; |
| 438 | } |
| 439 | } // namespace |
| 440 | |
| 441 | namespace |
no test coverage detected