mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-02-16 20:15:38 +00:00
Fixed a bug with skipping over unicode characters.
This commit is contained in:
parent
9901a07fb6
commit
0468e64396
|
@ -1,5 +1,5 @@
|
|||
CC=g++
|
||||
CFLAGS=-c -Wall -I/usr/include/freetype2 -I/usr/include/SDL -I/usr/include -D_DESKTOP_
|
||||
CFLAGS=-c -Wall -I/usr/include/freetype2 -I/usr/include/SDL -I/usr/include -D_DESKTOP_ -g
|
||||
LDFLAGS=-lGL -lfreetype -lSDL -lboost_system -lboost_filesystem -lfreeimage
|
||||
SRCSOURCES=main.cpp Renderer.cpp Renderer_init.cpp Font.cpp Renderer_draw_gl.cpp GuiComponent.cpp InputManager.cpp SystemData.cpp GameData.cpp FolderData.cpp XMLReader.cpp MathExp.cpp components/GuiGameList.cpp components/GuiInputConfig.cpp components/GuiImage.cpp components/GuiMenu.cpp components/GuiTheme.cpp pugiXML/pugixml.cpp
|
||||
SOURCES=$(addprefix src/,$(SRCSOURCES))
|
||||
|
|
|
@ -36,7 +36,7 @@ EmulationStation will return once your system's command terminates (i.e. your em
|
|||
gamelist.xml
|
||||
============
|
||||
|
||||
If a file named gamelist.xml is found in the root of a system's search directory, it will be parsed and the detailed GuiGameList will be used. This means you can define images, descriptions, and different names for files.
|
||||
If a file named gamelist.xml is found in the root of a system's search directory, it will be parsed and the detailed GuiGameList will be used. This means you can define images, descriptions, and different names for files. Note that only standard ASCII characters are supported (if you see a weird [X] symbol, you're probably using unicode!).
|
||||
Images will be automatically resized to fit within the left column of the screen. Smaller images will load faster, so try to keep your resolution low.
|
||||
An example gamelist.xml:
|
||||
```
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
September 16
|
||||
-Fixed a bug with skipping over unicode characters. [X] will be displayed if the character is not standard ASCII (characters 32 to 127).
|
||||
|
||||
September 15
|
||||
-Added <listOffsetX>, <listTextOffsetX>, and <gameImageOffsetY> theme tags. See THEMES.md for details.
|
||||
-Fixed a bug causing gamelists to be read incorrectly.
|
||||
|
|
|
@ -199,7 +199,7 @@ void Font::drawText(std::string text, int startx, int starty, int color)
|
|||
unsigned char letter = text[i];
|
||||
|
||||
if(letter < 32 || letter >= 128)
|
||||
continue;
|
||||
letter = 127; //print [X] if character is not standard ASCII
|
||||
|
||||
points[p].pos0x = x; points[p].pos0y = y + charData[letter].texH - charData[letter].bearingY;
|
||||
points[p].pos1x = x + charData[letter].texW; points[p].pos1y = y - charData[letter].bearingY;
|
||||
|
|
|
@ -8,12 +8,6 @@
|
|||
namespace Renderer {
|
||||
bool loadedFonts = false;
|
||||
|
||||
//defined and set in Renderer_init_rpi.cpp
|
||||
extern unsigned int display_width;
|
||||
extern unsigned int display_height;
|
||||
unsigned int getScreenWidth() { return display_width; }
|
||||
unsigned int getScreenHeight() { return display_height; }
|
||||
|
||||
void setColor4bArray(GLubyte* array, int color)
|
||||
{
|
||||
array[0] = (color & 0x00ff0000) / 0x10000;
|
||||
|
@ -63,7 +57,7 @@ namespace Renderer {
|
|||
Font* fonts[3] = {NULL, NULL, NULL};
|
||||
void loadFonts()
|
||||
{
|
||||
std::cout << "loading fonts\n";
|
||||
std::cout << "loading fonts...";
|
||||
|
||||
std::string fontPath = "LinLibertine_R.ttf";
|
||||
|
||||
|
@ -85,10 +79,14 @@ namespace Renderer {
|
|||
}
|
||||
|
||||
loadedFonts = true;
|
||||
|
||||
std::cout << "done\n";
|
||||
}
|
||||
|
||||
void unloadFonts()
|
||||
{
|
||||
std::cout << "unloading fonts...";
|
||||
|
||||
for(unsigned int i = 0; i < 3; i++)
|
||||
{
|
||||
delete fonts[i];
|
||||
|
@ -96,6 +94,8 @@ namespace Renderer {
|
|||
}
|
||||
|
||||
loadedFonts = false;
|
||||
|
||||
std::cout << "done.\n";
|
||||
}
|
||||
|
||||
Font* getFont(FontSize size)
|
||||
|
|
|
@ -19,10 +19,12 @@ namespace Renderer
|
|||
unsigned int display_width = 0;
|
||||
unsigned int display_height = 0;
|
||||
|
||||
unsigned int getScreenWidth() { return display_width; }
|
||||
unsigned int getScreenHeight() { return display_height; }
|
||||
|
||||
bool createSurface() //unsigned int display_width, unsigned int display_height)
|
||||
{
|
||||
std::cout << "Creating surface...\n";
|
||||
|
||||
std::cout << "Creating surface...";
|
||||
|
||||
DISPMANX_ELEMENT_HANDLE_T dispman_element;
|
||||
DISPMANX_DISPLAY_HANDLE_T dispman_display;
|
||||
|
@ -97,7 +99,7 @@ namespace Renderer
|
|||
}
|
||||
}
|
||||
|
||||
std::cout << "Display size is " << display_width << "x" << display_height << ".\n";
|
||||
std::cout << display_width << "x" << display_height << "...";
|
||||
|
||||
|
||||
dst_rect.x = 0; dst_rect.y = 0;
|
||||
|
@ -133,7 +135,7 @@ namespace Renderer
|
|||
}
|
||||
|
||||
|
||||
std::cout << "Success!\n";
|
||||
std::cout << "success!\n";
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -8,13 +8,17 @@
|
|||
|
||||
namespace Renderer
|
||||
{
|
||||
unsigned int display_width = 0, display_height = 0;
|
||||
unsigned int display_width = 0;
|
||||
unsigned int display_height = 0;
|
||||
|
||||
unsigned int getScreenWidth() { return display_width; }
|
||||
unsigned int getScreenHeight() { return display_height; }
|
||||
|
||||
SDL_Surface* sdlScreen = NULL;
|
||||
|
||||
bool createSurface() //unsigned int display_width, unsigned int display_height)
|
||||
{
|
||||
std::cout << "Creating surface...\n";
|
||||
std::cout << "Creating surface...";
|
||||
|
||||
if(SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK) != 0)
|
||||
{
|
||||
|
@ -27,7 +31,7 @@ namespace Renderer
|
|||
SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8);
|
||||
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16);
|
||||
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
|
||||
sdlScreen = SDL_SetVideoMode(display_width, display_height, 16, SDL_OPENGL | SDL_FULLSCREEN);
|
||||
sdlScreen = SDL_SetVideoMode(display_width, display_height, 16, SDL_OPENGL); //SDL_FULLSCREEN
|
||||
|
||||
if(sdlScreen == NULL)
|
||||
{
|
||||
|
@ -44,7 +48,7 @@ namespace Renderer
|
|||
display_width = sdlScreen->w;
|
||||
display_height = sdlScreen->h;
|
||||
|
||||
std::cout << "Success!\n";
|
||||
std::cout << "success!\n";
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue