(#450) Use fmimf fmaxf

master
rexim 2019-12-29 01:31:13 +07:00
parent 14f8206f5e
commit 804b47c4ea
2 changed files with 5 additions and 7 deletions

View File

@ -86,7 +86,7 @@ int platforms_render(const Platforms *platforms,
Rect world_viewport = camera_view_port(camera);
Rect viewport = camera_view_port_screen(camera);
if (rects_overlap(
camera_rect(
camera,
@ -96,12 +96,12 @@ int platforms_render(const Platforms *platforms,
camera,
text_pos) == false) {
if (platform_rect.w > text_rect.w){
text_pos.x = MAX(float, MIN(float, world_viewport.x, platform_rect.x + platform_rect.w - text_rect.w),
platform_rect.x);
text_pos.x = fmaxf(fminf(world_viewport.x, platform_rect.x + platform_rect.w - text_rect.w),
platform_rect.x);
}
if (platform_rect.h > text_rect.h){
text_pos.y = MAX(float, MIN(float, world_viewport.y, platform_rect.y + platform_rect.h - text_rect.h),
platform_rect.y);
text_pos.y = fmaxf(fminf(world_viewport.y, platform_rect.y + platform_rect.h - text_rect.h),
platform_rect.y);
}
}

View File

@ -9,7 +9,6 @@
return a > b ? a : b; \
} \
MAX_INSTANCE(float)
MAX_INSTANCE(int64_t)
MAX_INSTANCE(size_t)
#define MAX(type, a, b) max_##type(a, b)
@ -20,7 +19,6 @@ MAX_INSTANCE(size_t)
return a < b ? a : b; \
} \
MIN_INSTANCE(float)
MIN_INSTANCE(int64_t)
MIN_INSTANCE(size_t)
#define MIN(type, a, b) min_##type(a, b)