mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-25 23:55:38 +00:00
Add device name to input config files.
Properly init/deinit renderer stuff in Renderer_init_rpi.cpp. Probably.
This commit is contained in:
parent
a5f4749d5d
commit
1007821ca3
|
@ -157,9 +157,12 @@ void InputConfig::writeToXML(pugi::xml_node parent)
|
|||
pugi::xml_node cfg = parent.append_child("inputConfig");
|
||||
|
||||
if(mDeviceId == DEVICE_KEYBOARD)
|
||||
{
|
||||
cfg.append_attribute("type") = "keyboard";
|
||||
else
|
||||
}else{
|
||||
cfg.append_attribute("type") = "joystick";
|
||||
cfg.append_attribute("deviceName") = SDL_JoystickName(mDeviceId);
|
||||
}
|
||||
|
||||
typedef std::map<std::string, Input>::iterator it_type;
|
||||
for(it_type iterator = mNameMap.begin(); iterator != mNameMap.end(); iterator++)
|
||||
|
|
|
@ -196,7 +196,7 @@ void InputManager::loadConfig()
|
|||
}else if(type == "joystick")
|
||||
{
|
||||
bool found = false;
|
||||
std::string devName = node.child("deviceName").text().get();
|
||||
std::string devName = node.attribute("deviceName").as_string();
|
||||
for(int i = 0; i < mNumJoysticks; i++)
|
||||
{
|
||||
if(SDL_JoystickName(i) == devName)
|
||||
|
|
|
@ -17,6 +17,10 @@ namespace Renderer
|
|||
bool init(int w, int h);
|
||||
void deinit();
|
||||
|
||||
//just takes care of default font init/deinit right now
|
||||
void onInit();
|
||||
void onDeinit();
|
||||
|
||||
unsigned int getScreenWidth();
|
||||
unsigned int getScreenHeight();
|
||||
|
||||
|
|
|
@ -7,3 +7,22 @@
|
|||
#ifdef _DESKTOP_
|
||||
#include "Renderer_init_sdlgl.cpp"
|
||||
#endif
|
||||
|
||||
namespace Renderer
|
||||
{
|
||||
void onInit()
|
||||
{
|
||||
for(int i = 0; i < (int)FONT_SIZE_COUNT; i++)
|
||||
{
|
||||
getDefaultFont((FontSize)i)->init();
|
||||
}
|
||||
}
|
||||
|
||||
void onDeinit()
|
||||
{
|
||||
for(int i = 0; i < (int)FONT_SIZE_COUNT; i++)
|
||||
{
|
||||
getDefaultFont((FontSize)i)->deinit();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -32,7 +32,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*/ | SDL_DOUBLEBUF);
|
||||
sdlScreen = SDL_SetVideoMode(display_width, display_height, 16, SDL_OPENGL | SDL_FULLSCREEN | SDL_DOUBLEBUF);
|
||||
|
||||
if(sdlScreen == NULL)
|
||||
{
|
||||
|
@ -80,22 +80,14 @@ namespace Renderer
|
|||
glOrtho(0, display_width, display_height, 0, -1.0, 1.0);
|
||||
glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
|
||||
//initialize fonts
|
||||
for(int i = 0; i < (int)FONT_SIZE_COUNT; i++)
|
||||
{
|
||||
getDefaultFont((FontSize)i)->init();
|
||||
}
|
||||
onInit();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void deinit()
|
||||
{
|
||||
//deinitialize fonts
|
||||
for(int i = 0; i < (int)FONT_SIZE_COUNT; i++)
|
||||
{
|
||||
getDefaultFont((FontSize)i)->deinit();
|
||||
}
|
||||
onDeinit();
|
||||
|
||||
destroySurface();
|
||||
}
|
||||
|
|
|
@ -320,6 +320,8 @@ GuiGameList* GuiGameList::create(Window* window)
|
|||
|
||||
void GuiGameList::update(int deltaTime)
|
||||
{
|
||||
if(mDetailed)
|
||||
mImageAnimation->update(deltaTime);
|
||||
|
||||
mList->update(deltaTime);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue