mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
Use precompiled headers for faster build of the DebuggerWX and Dolphin projects. Fix a silly memory leak in debug text in the GL plugin.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3846 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -132,11 +132,14 @@ RasterFont::RasterFont()
|
||||
glBitmap(8, 13, 0.0f, 2.0f, 10.0f, 0.0f, rasters[i - 32]);
|
||||
glEndList();
|
||||
}
|
||||
|
||||
temp_buffer = new char[TEMP_BUFFER_SIZE];
|
||||
}
|
||||
|
||||
RasterFont::~RasterFont()
|
||||
{
|
||||
glDeleteLists(fontOffset, 128);
|
||||
delete [] temp_buffer;
|
||||
}
|
||||
|
||||
void RasterFont::printString(const char *s, double x, double y, double z)
|
||||
@ -144,10 +147,13 @@ void RasterFont::printString(const char *s, double x, double y, double z)
|
||||
int length = (int)strlen(s);
|
||||
if (!length)
|
||||
return;
|
||||
if (length >= TEMP_BUFFER_SIZE)
|
||||
length = TEMP_BUFFER_SIZE - 1;
|
||||
|
||||
// Sanitize string to avoid GL errors.
|
||||
char *s2 = new char[length + 1];
|
||||
strcpy(s2, s);
|
||||
char *s2 = temp_buffer;
|
||||
memcpy(s2, s, length);
|
||||
s2[length] = 0;
|
||||
for (int i = 0; i < length; i++) {
|
||||
if (s2[i] < 32 || s2[i] > 126)
|
||||
s2[i] = '!';
|
||||
|
@ -19,9 +19,6 @@
|
||||
#define _RASTERFONT_H_
|
||||
|
||||
class RasterFont {
|
||||
protected:
|
||||
int fontOffset;
|
||||
|
||||
public:
|
||||
RasterFont();
|
||||
~RasterFont(void);
|
||||
@ -36,6 +33,10 @@ public:
|
||||
void printCenteredString(const char *s, double y, int screen_width, double z=0.0);
|
||||
|
||||
void printMultilineText(const char *text, double x, double y, double z, int bbWidth, int bbHeight);
|
||||
private:
|
||||
int fontOffset;
|
||||
char *temp_buffer;
|
||||
enum {TEMP_BUFFER_SIZE = 64 * 1024};
|
||||
};
|
||||
|
||||
#endif // _RASTERFONT_H_
|
||||
|
Reference in New Issue
Block a user