Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix RFont.h MSVC compilation errors #8

Merged
merged 1 commit into from
Dec 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions RFont.h
Original file line number Diff line number Diff line change
Expand Up @@ -477,8 +477,8 @@ void RFont_init(size_t width, size_t height) {
RFont_render_init();
#endif

RFont_verts = RFONT_MALLOC(sizeof(float) * RFONT_INIT_VERTS);
RFont_tcoords = RFONT_MALLOC(sizeof(float) * RFONT_INIT_VERTS);
RFont_verts = (float*)RFONT_MALLOC(sizeof(float) * RFONT_INIT_VERTS);
RFont_tcoords = (float*)RFONT_MALLOC(sizeof(float) * RFONT_INIT_VERTS);
}

#ifndef RFONT_NO_STDIO
Expand Down Expand Up @@ -552,7 +552,7 @@ decode utf8 character to codepoint
inline static u32 RFont_decode_utf8(u32* state, u32* codep, u32 byte);

static u32 RFont_decode_utf8(u32* state, u32* codep, u32 byte) {
static const uint8_t utf8d[] = {
static const u8 utf8d[] = {
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 00..1f
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 20..3f
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 40..5f
Expand All @@ -569,7 +569,7 @@ static u32 RFont_decode_utf8(u32* state, u32* codep, u32 byte) {
1,3,1,1,1,1,1,3,1,3,1,1,1,1,1,1,1,3,1,1,1,1,1,1,1,1,1,1,1,1,1,1, // s7..s8
};

uint32_t type = utf8d[byte];
u32 type = utf8d[byte];

*codep = (*state != RFONT_UTF8_ACCEPT) ?
(byte & 0x3fu) | (*codep << 6) :
Expand Down Expand Up @@ -681,7 +681,7 @@ RFont_area RFont_text_area_len(RFont_font* font, const char* text, size_t len, u
for (str = (char*)text; (len == 0 || (size_t)(str - text) < len) && *str; str++) {
if (*str == '\n') {
if (y == stopNL)
return (RFont_area){(u32)x, y * size};
return (RFont_area){(u32)x, (u32)y * size};

y++;
x = 0;
Expand Down Expand Up @@ -814,14 +814,14 @@ RFont_area RFont_draw_text_len(RFont_font* font, const char* text, size_t len, f
return (RFont_area){(u32)(x - startX), (u32)(y - startY) + (-font->descent * scale)};
}

#if !defined(RFONT_NO_OPENGL) && !defined(RFONT_NO_GRAPHICS)

#ifndef __APPLE__
#include <GL/gl.h>
#else
#include <OpenGL/gl.h>
#endif

#if !defined(RFONT_NO_OPENGL) && !defined(RFONT_NO_GRAPHICS)

#if !defined(RFONT_RENDER_LEGACY) && !defined(RFONT_RENDER_RGL)
#define GL_GLEXT_PROTOTYPES
#endif
Expand Down
Loading