|
12 | 12 |
|
13 | 13 | #include "SDL_rect.h"
|
14 | 14 | #include "base-gauge.h"
|
| 15 | +#include "misc.h" |
15 | 16 | #include "sdl-colors.h"
|
16 | 17 | #include "view.h"
|
17 | 18 |
|
@@ -232,22 +233,25 @@ int base_gauge_blit_texture(BaseGauge *self, RenderContext *ctx,
|
232 | 233 | // printf("After clipping: ");
|
233 | 234 | // SDLExt_RectDump(&fdst);
|
234 | 235 | #endif
|
235 |
| - GPU_Rect *dst_rectf, *src_rectf; |
236 | 236 | float x,y;
|
237 | 237 |
|
238 |
| - dst_rectf = &rectf(&fdst); |
239 |
| - |
240 | 238 | if(!srcrect){
|
241 |
| - x = src->w/2.0 + dst_rectf->x; |
242 |
| - y = src->h/2.0 + dst_rectf->y; |
243 |
| - src_rectf = NULL; |
| 239 | + x = src->w/2.0 + fdst.x; |
| 240 | + y = src->h/2.0 + fdst.y; |
244 | 241 | }else{
|
245 |
| - x = srcrect->w/2.0 + dst_rectf->x; |
246 |
| - y = srcrect->h/2.0 + dst_rectf->y; |
247 |
| - src_rectf = &rectf(srcrect); |
| 242 | + x = srcrect->w/2.0 + fdst.x; |
| 243 | + y = srcrect->h/2.0 + fdst.y; |
248 | 244 | }
|
249 |
| - |
250 |
| - GPU_Blit(src, src_rectf, ctx->target.target, x, y); |
| 245 | +#if 0 |
| 246 | + printf( |
| 247 | + "GPU_Blit from %p {.x:%0.2f, .y:%0.2f, .w:%0.2f, .h:%0.2f} to %p x:%0.2f y:%0.2f\n", |
| 248 | + src, |
| 249 | + src_rectf->x,src_rectf->y, |
| 250 | + src_rectf->w,src_rectf->h, |
| 251 | + ctx->target.target, x, y |
| 252 | + ); |
| 253 | +#endif |
| 254 | + GPU_Blit(src, srcrect ? &rectf(srcrect) : NULL, ctx->target.target, x, y); |
251 | 255 | return 0;
|
252 | 256 | }
|
253 | 257 |
|
|
0 commit comments