Fixed slice index not being passed correctly. It was normalized instead of pass as an integer value.
This commit is setup for testing the texture array slices, it shouldn't be shipped to users.
This commit is contained in:
parent
bd7dac90ac
commit
9b927bd410
|
@ -162,10 +162,7 @@ ft__bad_rect_pack_next(Bad_Rect_Pack *pack, Vec2_i32 dim){
|
|||
}
|
||||
|
||||
// NOTE(simon, 28/02/24): We are now sure that the character will fit.
|
||||
|
||||
if ( pack->current_line_h < dim.y ) {
|
||||
pack->current_line_h = dim.y;
|
||||
}
|
||||
pack->current_line_h = Max(pack->current_line_h, dim.y);
|
||||
|
||||
result = pack->p;
|
||||
pack->p.x += dim.x;
|
||||
|
@ -322,7 +319,8 @@ ft__font_make_face(Arena *arena, Face_Description *description, f32 scale_factor
|
|||
white.data = white_data;
|
||||
|
||||
Bad_Rect_Pack pack = {};
|
||||
ft__bad_rect_pack_init(&pack, V2i32(1024, 1024));
|
||||
// ft__bad_rect_pack_init(&pack, V2i32(1024, 1024));
|
||||
ft__bad_rect_pack_init(&pack, V2i32(128, 128));
|
||||
ft__glyph_bounds_store_uv_raw(ft__bad_rect_pack_next(&pack, white.dim), white.dim, &face->white);
|
||||
for (u16 i = 0; i < index_count; i += 1){
|
||||
Vec2_i32 dim = glyph_bitmaps[i].dim;
|
||||
|
@ -333,13 +331,6 @@ ft__font_make_face(Arena *arena, Face_Description *description, f32 scale_factor
|
|||
Texture_Kind texture_kind = TextureKind_Mono;
|
||||
u32 texture = graphics_get_texture(pack.dim, texture_kind);
|
||||
|
||||
/* NOTE simon (06/01/25): This assumes that every platforms don't use 0 as a valid texture id.
|
||||
This is valid for OpenGL and the DX11 implementaion. Someone needs to check the MAC versions. */
|
||||
if (texture != 0 ){
|
||||
|
||||
face->texture_kind = texture_kind;
|
||||
face->texture = texture;
|
||||
|
||||
Vec3_f32 texture_dim = V3f32(pack.dim);
|
||||
face->texture_dim = texture_dim;
|
||||
|
||||
|
@ -362,7 +353,9 @@ ft__font_make_face(Arena *arena, Face_Description *description, f32 scale_factor
|
|||
face->bounds[i].uv.y1 = (face->bounds[i].uv.y0 + face->bounds[i].uv.y1)/texture_dim.y;
|
||||
face->bounds[i].uv.x0 = face->bounds[i].uv.x0/texture_dim.x;
|
||||
face->bounds[i].uv.y0 = face->bounds[i].uv.y0/texture_dim.y;
|
||||
#if 0
|
||||
face->bounds[i].w /= texture_dim.z;
|
||||
#endif
|
||||
}
|
||||
|
||||
{
|
||||
|
@ -391,11 +384,6 @@ ft__font_make_face(Arena *arena, Face_Description *description, f32 scale_factor
|
|||
26*met->normal_uppercase_advance +
|
||||
10*met->decimal_digit_advance)/62.f;
|
||||
}
|
||||
|
||||
} else {
|
||||
pop_array(arena, Face, 1);
|
||||
face = 0;
|
||||
}
|
||||
}
|
||||
|
||||
FT_Done_FreeType(ft);
|
||||
|
|
Loading…
Reference in New Issue