mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-29 17:54:50 +01:00
Move ttf_sdlport.c to C++
This commit is contained in:
committed by
Michael Steenbeek
parent
5fa86b603c
commit
3df60e5acd
@@ -642,7 +642,7 @@ static FT_Error Load_Glyph(TTF_Font* font, uint16 ch, c_glyph* cached, int want)
|
||||
if (((want & CACHED_BITMAP) && !(cached->stored & CACHED_BITMAP)) ||
|
||||
((want & CACHED_PIXMAP) && !(cached->stored & CACHED_PIXMAP))) {
|
||||
int mono = (want & CACHED_BITMAP);
|
||||
int i;
|
||||
unsigned int i;
|
||||
FT_Bitmap* src;
|
||||
FT_Bitmap* dst;
|
||||
FT_Glyph bitmap_glyph = NULL;
|
||||
@@ -740,7 +740,7 @@ static FT_Error Load_Glyph(TTF_Font* font, uint16 ch, c_glyph* cached, int want)
|
||||
if (mono) {
|
||||
unsigned char *srcp = src->buffer + soffset;
|
||||
unsigned char *dstp = dst->buffer + doffset;
|
||||
int j;
|
||||
unsigned int j;
|
||||
if (src->pixel_mode == FT_PIXEL_MODE_MONO) {
|
||||
for (j = 0; j < src->width; j += 8) {
|
||||
unsigned char c = *srcp++;
|
||||
@@ -801,7 +801,7 @@ static FT_Error Load_Glyph(TTF_Font* font, uint16 ch, c_glyph* cached, int want)
|
||||
unsigned char *srcp = src->buffer + soffset;
|
||||
unsigned char *dstp = dst->buffer + doffset;
|
||||
unsigned char c;
|
||||
int j, k;
|
||||
unsigned int j, k;
|
||||
for (j = 0; j < src->width; j += 8) {
|
||||
c = *srcp++;
|
||||
for (k = 0; k < 8; ++k) {
|
||||
@@ -819,7 +819,7 @@ static FT_Error Load_Glyph(TTF_Font* font, uint16 ch, c_glyph* cached, int want)
|
||||
unsigned char *srcp = src->buffer + soffset;
|
||||
unsigned char *dstp = dst->buffer + doffset;
|
||||
unsigned char c;
|
||||
int j, k;
|
||||
unsigned int j, k;
|
||||
for (j = 0; j < src->width; j += 4) {
|
||||
c = *srcp++;
|
||||
for (k = 0; k < 4; ++k) {
|
||||
@@ -837,7 +837,7 @@ static FT_Error Load_Glyph(TTF_Font* font, uint16 ch, c_glyph* cached, int want)
|
||||
unsigned char *srcp = src->buffer + soffset;
|
||||
unsigned char *dstp = dst->buffer + doffset;
|
||||
unsigned char c;
|
||||
int j, k;
|
||||
unsigned int j, k;
|
||||
for (j = 0; j < src->width; j += 2) {
|
||||
c = *srcp++;
|
||||
for (k = 0; k < 2; ++k) {
|
||||
@@ -1172,7 +1172,7 @@ TTFSurface *TTF_RenderUTF8_Solid(TTF_Font *font,
|
||||
uint8* src;
|
||||
uint8* dst;
|
||||
uint8 *dst_check;
|
||||
int row, col;
|
||||
unsigned int row, col;
|
||||
c_glyph *glyph;
|
||||
|
||||
FT_Bitmap *current;
|
||||
@@ -1190,7 +1190,7 @@ TTFSurface *TTF_RenderUTF8_Solid(TTF_Font *font,
|
||||
}
|
||||
|
||||
/* Create the target surface */
|
||||
textbuf = calloc(1, sizeof(TTFSurface));
|
||||
textbuf = (TTFSurface *)calloc(1, sizeof(TTFSurface));
|
||||
if (textbuf == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
@@ -1245,10 +1245,10 @@ TTFSurface *TTF_RenderUTF8_Solid(TTF_Font *font,
|
||||
for (row = 0; row < current->rows; ++row) {
|
||||
/* Make sure we don't go either over, or under the
|
||||
* limit */
|
||||
if (row + glyph->yoffset < 0) {
|
||||
if ((signed)row + glyph->yoffset < 0) {
|
||||
continue;
|
||||
}
|
||||
if (row + glyph->yoffset >= textbuf->h) {
|
||||
if ((signed)row + glyph->yoffset >= textbuf->h) {
|
||||
continue;
|
||||
}
|
||||
dst = (uint8*)textbuf->pixels +
|
||||
@@ -1293,7 +1293,7 @@ TTFSurface *TTF_RenderUTF8_Shaded(TTF_Font *font,
|
||||
uint8* src;
|
||||
uint8* dst;
|
||||
uint8* dst_check;
|
||||
int row, col;
|
||||
unsigned int row, col;
|
||||
FT_Bitmap* current;
|
||||
c_glyph *glyph;
|
||||
FT_Error error;
|
||||
@@ -1311,7 +1311,7 @@ TTFSurface *TTF_RenderUTF8_Shaded(TTF_Font *font,
|
||||
}
|
||||
|
||||
/* Create the target surface */
|
||||
textbuf = calloc(1, sizeof(TTFSurface));
|
||||
textbuf = (TTFSurface *)calloc(1, sizeof(TTFSurface));
|
||||
if (textbuf == NULL)
|
||||
{
|
||||
return NULL;
|
||||
@@ -1378,11 +1378,11 @@ TTFSurface *TTF_RenderUTF8_Shaded(TTF_Font *font,
|
||||
{
|
||||
/* Make sure we don't go either over, or under the
|
||||
* limit */
|
||||
if (row + glyph->yoffset < 0)
|
||||
if ((signed)row + glyph->yoffset < 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (row + glyph->yoffset >= textbuf->h)
|
||||
if ((signed)row + glyph->yoffset >= textbuf->h)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
Reference in New Issue
Block a user