ogl: fix signed vs unsigned comparison warning

This commit is contained in:
degasus 2014-03-17 08:50:59 +01:00
parent 07fbb13bba
commit 25b8edd2a6

View File

@ -10,10 +10,10 @@
namespace OGL { namespace OGL {
static const u32 char_width = 8; static const int char_width = 8;
static const u32 char_height = 13; static const int char_height = 13;
static const u32 char_offset = 32; static const int char_offset = 32;
static const u32 char_count = 95; static const int char_count = 95;
const u8 rasters[char_count][char_height] = { const u8 rasters[char_count][char_height] = {
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
@ -141,11 +141,11 @@ RasterFont::RasterFont()
glActiveTexture(GL_TEXTURE0+8); glActiveTexture(GL_TEXTURE0+8);
glBindTexture(GL_TEXTURE_2D, texture); glBindTexture(GL_TEXTURE_2D, texture);
u32* texture_data = new u32[char_width*char_count*char_height]; u32* texture_data = new u32[char_width*char_count*char_height];
for (u32 y = 0; y < char_height; y++) for (int y = 0; y < char_height; y++)
{ {
for (u32 c = 0; c < char_count; c++) for (int c = 0; c < char_count; c++)
{ {
for (u32 x = 0; x < char_width; x++) for (int x = 0; x < char_width; x++)
{ {
bool pixel = (0 != (rasters[c][y] & (1<<(char_width-x-1)))); bool pixel = (0 != (rasters[c][y] & (1<<(char_width-x-1))));
texture_data[char_width*char_count*y+char_width*c+x] = pixel ? -1 : 0; texture_data[char_width*char_count*y+char_width*c+x] = pixel ? -1 : 0;