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");
|
pugi::xml_node cfg = parent.append_child("inputConfig");
|
||||||
|
|
||||||
if(mDeviceId == DEVICE_KEYBOARD)
|
if(mDeviceId == DEVICE_KEYBOARD)
|
||||||
|
{
|
||||||
cfg.append_attribute("type") = "keyboard";
|
cfg.append_attribute("type") = "keyboard";
|
||||||
else
|
}else{
|
||||||
cfg.append_attribute("type") = "joystick";
|
cfg.append_attribute("type") = "joystick";
|
||||||
|
cfg.append_attribute("deviceName") = SDL_JoystickName(mDeviceId);
|
||||||
|
}
|
||||||
|
|
||||||
typedef std::map<std::string, Input>::iterator it_type;
|
typedef std::map<std::string, Input>::iterator it_type;
|
||||||
for(it_type iterator = mNameMap.begin(); iterator != mNameMap.end(); iterator++)
|
for(it_type iterator = mNameMap.begin(); iterator != mNameMap.end(); iterator++)
|
||||||
|
|
|
@ -196,7 +196,7 @@ void InputManager::loadConfig()
|
||||||
}else if(type == "joystick")
|
}else if(type == "joystick")
|
||||||
{
|
{
|
||||||
bool found = false;
|
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++)
|
for(int i = 0; i < mNumJoysticks; i++)
|
||||||
{
|
{
|
||||||
if(SDL_JoystickName(i) == devName)
|
if(SDL_JoystickName(i) == devName)
|
||||||
|
|
|
@ -17,6 +17,10 @@ namespace Renderer
|
||||||
bool init(int w, int h);
|
bool init(int w, int h);
|
||||||
void deinit();
|
void deinit();
|
||||||
|
|
||||||
|
//just takes care of default font init/deinit right now
|
||||||
|
void onInit();
|
||||||
|
void onDeinit();
|
||||||
|
|
||||||
unsigned int getScreenWidth();
|
unsigned int getScreenWidth();
|
||||||
unsigned int getScreenHeight();
|
unsigned int getScreenHeight();
|
||||||
|
|
||||||
|
|
|
@ -7,3 +7,22 @@
|
||||||
#ifdef _DESKTOP_
|
#ifdef _DESKTOP_
|
||||||
#include "Renderer_init_sdlgl.cpp"
|
#include "Renderer_init_sdlgl.cpp"
|
||||||
#endif
|
#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_BLUE_SIZE, 8);
|
||||||
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16);
|
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16);
|
||||||
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
|
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)
|
if(sdlScreen == NULL)
|
||||||
{
|
{
|
||||||
|
@ -80,22 +80,14 @@ namespace Renderer
|
||||||
glOrtho(0, display_width, display_height, 0, -1.0, 1.0);
|
glOrtho(0, display_width, display_height, 0, -1.0, 1.0);
|
||||||
glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
|
glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
|
||||||
|
|
||||||
//initialize fonts
|
onInit();
|
||||||
for(int i = 0; i < (int)FONT_SIZE_COUNT; i++)
|
|
||||||
{
|
|
||||||
getDefaultFont((FontSize)i)->init();
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void deinit()
|
void deinit()
|
||||||
{
|
{
|
||||||
//deinitialize fonts
|
onDeinit();
|
||||||
for(int i = 0; i < (int)FONT_SIZE_COUNT; i++)
|
|
||||||
{
|
|
||||||
getDefaultFont((FontSize)i)->deinit();
|
|
||||||
}
|
|
||||||
|
|
||||||
destroySurface();
|
destroySurface();
|
||||||
}
|
}
|
||||||
|
|
|
@ -320,6 +320,8 @@ GuiGameList* GuiGameList::create(Window* window)
|
||||||
|
|
||||||
void GuiGameList::update(int deltaTime)
|
void GuiGameList::update(int deltaTime)
|
||||||
{
|
{
|
||||||
mImageAnimation->update(deltaTime);
|
if(mDetailed)
|
||||||
|
mImageAnimation->update(deltaTime);
|
||||||
|
|
||||||
mList->update(deltaTime);
|
mList->update(deltaTime);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue