Fixed display function in fxcg50.
This commit is contained in:
parent
a753f697a1
commit
b5185d103c
|
|
@ -33,12 +33,29 @@ inline int display_update(void)
|
||||||
|
|
||||||
inline int display_draw_texture(texture_t *texture, const rect_t *src_rect, const rect_t *dst_rect, bool flip)
|
inline int display_draw_texture(texture_t *texture, const rect_t *src_rect, const rect_t *dst_rect, bool flip)
|
||||||
{
|
{
|
||||||
dsubimage_rgb16_effect((int)dst_rect->x, (int)dst_rect->y, texture, (int)src_rect->x, (int)src_rect->y, (int)src_rect->w, (int)src_rect->h, flip ? IMAGE_HFLIP : DIMAGE_NONE);
|
rect_t display_rect;
|
||||||
|
if(dst_rect) display_rect = (rect_t) {
|
||||||
|
.x = (dst_rect->x - game.camera.view_rect.x) * (DISPLAY_WIDTH / game.camera.view_rect.w),
|
||||||
|
.y = (dst_rect->y - game.camera.view_rect.y) * (DISPLAY_HEIGHT / game.camera.view_rect.h),
|
||||||
|
.w = dst_rect->w * (DISPLAY_WIDTH / game.camera.view_rect.w),
|
||||||
|
.h = dst_rect->h * (DISPLAY_HEIGHT / game.camera.view_rect.h)
|
||||||
|
};
|
||||||
|
|
||||||
|
dsubimage_rgb16_effect(dst_rect ? display_rect.x : 0, dst_rect ? display_rect.y : 0, texture, (int)src_rect->x, (int)src_rect->y, (int)src_rect->w, (int)src_rect->h, flip ? IMAGE_HFLIP : DIMAGE_NONE);
|
||||||
|
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline int display_draw_frect(const frect_t *frect, unsigned int r, unsigned int g, unsigned int b, unsigned int a)
|
inline int display_draw_frect(const frect_t *frect, unsigned int r, unsigned int g, unsigned int b, unsigned int a)
|
||||||
{
|
{
|
||||||
drect((int)frect->x, (int)frect->y, (int)(frect->x + frect->w), (int)(frect->y + frect->h), (r >> 3 ) | (g >> 2) | (g >> 3));
|
rect_t display_rect = {
|
||||||
|
.x = (frect->x - game.camera.view_rect.x) * (DISPLAY_WIDTH / game.camera.view_rect.w),
|
||||||
|
.y = (frect->y - game.camera.view_rect.y) * (DISPLAY_HEIGHT / game.camera.view_rect.h),
|
||||||
|
.w = frect->w * (DISPLAY_WIDTH / game.camera.view_rect.w),
|
||||||
|
.h = frect->h * (DISPLAY_HEIGHT / game.camera.view_rect.h)
|
||||||
|
};
|
||||||
|
|
||||||
|
drect_border(display_rect.x, display_rect.y, (display_rect.x + display_rect.w), (display_rect.y + display_rect.h), C_NONE, 1, a ? C_RGB(r, g, b) : C_NONE);
|
||||||
|
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue