diff options
author | Clyne Sullivan <tullivan99@gmail.com> | 2016-03-04 08:45:53 -0500 |
---|---|---|
committer | Clyne Sullivan <tullivan99@gmail.com> | 2016-03-04 08:45:53 -0500 |
commit | 5fadac5d0f37f574ca160107d832d11b421ad559 (patch) | |
tree | ff9667adf7c3b8d882083a99b7176260afd25349 /src/ui.cpp | |
parent | fe5ea7fe415857f49d6630f2b0f50e1246c38eee (diff) |
entity following
Diffstat (limited to 'src/ui.cpp')
-rw-r--r-- | src/ui.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -190,7 +190,7 @@ namespace ui { void setFontSize(unsigned int size){ unsigned int i,j; - char *buf; + unsigned char *buf; fontSize=size; FT_Set_Pixel_Sizes(ftf,0,fontSize); @@ -230,7 +230,7 @@ namespace ui { * making it white-on-black. */ - buf = new char[ftf->glyph->bitmap.width * ftf->glyph->bitmap.rows * 4]; + buf = new unsigned char[ftf->glyph->bitmap.width * ftf->glyph->bitmap.rows * 4]; for(j=0;j<ftf->glyph->bitmap.width*ftf->glyph->bitmap.rows;j++){ buf[j*4 ]=255;//fontColor[0]; @@ -1084,7 +1084,8 @@ namespace ui { } void takeScreenshot(GLubyte* pixels){ - GLubyte bgr[SCREEN_WIDTH*SCREEN_HEIGHT*3]; + std::vector<GLubyte> bgr (SCREEN_WIDTH * SCREEN_HEIGHT * 3, 0); + for(uint x = 0; x < SCREEN_WIDTH*SCREEN_HEIGHT*3; x+=3){ bgr[x] = pixels[x+2]; bgr[x+1] = pixels[x+1]; |