mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-01-29 12:40:01 +01:00
graphics/gldrawmethods: Fix compilation
Was probably broken by ff27d69424
Signed-off-by: Nick Renieris <velocityra@gmail.com>
This commit is contained in:
parent
3db7feaeff
commit
c08b333909
@ -1,5 +1,6 @@
|
||||
#include "../data/font.h"
|
||||
#include <cmath>
|
||||
#include <cstring>
|
||||
|
||||
int PIXELMETHODS_CLASS::drawtext_outline(int x, int y, String s, int r, int g, int b, int a)
|
||||
{
|
||||
@ -15,15 +16,15 @@ int PIXELMETHODS_CLASS::drawtext_outline(int x, int y, String s, int r, int g, i
|
||||
int PIXELMETHODS_CLASS::drawtext(int x, int y, String str, int r, int g, int b, int a)
|
||||
{
|
||||
bool invert = false;
|
||||
if(!strlen(s))
|
||||
if(str.size() == 0)
|
||||
return 0;
|
||||
int oR = r, oG = g, oB = b;
|
||||
int width, height;
|
||||
Graphics::textsize(s, width, height);
|
||||
Graphics::textsize(str, width, height);
|
||||
VideoBuffer texture(width, height);
|
||||
int characterX = 0, characterY = 0;
|
||||
int startX = characterX;
|
||||
String::value_type *s = str.c_str();
|
||||
const String::value_type *s = str.c_str();
|
||||
for (; *s; s++)
|
||||
{
|
||||
if (*s == '\n')
|
||||
@ -131,7 +132,7 @@ int PIXELMETHODS_CLASS::drawtext(int x, int y, String str, int r, int g, int b,
|
||||
|
||||
int PIXELMETHODS_CLASS::drawchar(int x, int y, String::value_type c, int r, int g, int b, int a)
|
||||
{
|
||||
unsigned char *rp = font_data + font_ptrs[c];
|
||||
const unsigned char *rp = font_data + font_ptrs[c];
|
||||
int w = *(rp++);
|
||||
VideoBuffer texture(w, FONT_H);
|
||||
texture.SetCharacter(0, 0, c, r, g, b, a);
|
||||
@ -160,7 +161,7 @@ int PIXELMETHODS_CLASS::drawchar(int x, int y, String::value_type c, int r, int
|
||||
|
||||
int PIXELMETHODS_CLASS::addchar(int x, int y, String::value_type c, int r, int g, int b, int a)
|
||||
{
|
||||
unsigned char *rp = font_data + font_ptrs[c];
|
||||
const unsigned char *rp = font_data + font_ptrs[c];
|
||||
int w = *(rp++);
|
||||
VideoBuffer texture(w, FONT_H);
|
||||
texture.AddCharacter(0, 0, c, r, g, b, a);
|
||||
|
Loading…
x
Reference in New Issue
Block a user