(#450) Use fmimf fmaxf
parent
14f8206f5e
commit
804b47c4ea
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue