zephr/game: various fixes and improvements

- zephr: handle newlines in text
- fix(zephr): don't overflow color channels bytes when multiplying
  colors
- fix(zephr): don't fallback to UI_CONSTRAINT_FIXED when setting the x
  or y constraint to UI_CONSTRAINT_RELATIVE_PIXELS
- game: added how to play dialog
- game: ability to start a new game
This commit is contained in:
2023-12-29 15:12:43 +02:00
parent 31f22a4ba7
commit e543b5f882
8 changed files with 322 additions and 223 deletions
+3 -3
View File
@@ -77,9 +77,9 @@ void apply_translation(Matrix4x4 *matrix, Vec2f pos) {
Color mult_color(Color color, float amount) {
Color result = color;
result.r = CORE_CLAMP((u8)((float)result.r * amount), 0, 255);
result.g = CORE_CLAMP((u8)((float)result.g * amount), 0, 255);
result.b = CORE_CLAMP((u8)((float)result.b * amount), 0, 255);
result.r = CORE_CLAMP((i32)((float)result.r * amount), 0, 255);
result.g = CORE_CLAMP((i32)((float)result.g * amount), 0, 255);
result.b = CORE_CLAMP((i32)((float)result.b * amount), 0, 255);
return result;
}