Remove int v2 type, change V2i to cast i32 to f32

Mixing and matching V2 int and float types in the code creates too much
necessary work when an integer implementation has to interact with float
implementation. Let V2i create the cast for us and use floats for all
vector operations since they are mostly mathematic.
This commit is contained in:
2016-07-17 23:45:59 +10:00
parent 2745a8e25a
commit 7971b10b74
7 changed files with 44 additions and 59 deletions
+1 -1
View File
@@ -184,7 +184,7 @@ void renderer_string(Renderer *const renderer, v4 cameraBounds,
// NOTE(doyle): Atlas packs fonts tightly, so offset the codepoint
// to its actual atlas index, i.e. we skip the first 31 glyphs
i32 codepoint = string[i];
i32 relativeIndex = codepoint - font->codepointRange.x;
i32 relativeIndex = CAST(i32)(codepoint - font->codepointRange.x);
CharMetrics charMetric = font->charMetrics[relativeIndex];
pos.y = baseline - (scale * charMetric.offset.y);