mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
fixed padsimple event some glwindow cleanup
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1940 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -408,6 +408,7 @@ void LoadConfig()
|
|||||||
file.Get(SectionName, controlNames[x],
|
file.Get(SectionName, controlNames[x],
|
||||||
&key, (i==0)?defaultKeyForControl[x]:0);
|
&key, (i==0)?defaultKeyForControl[x]:0);
|
||||||
|
|
||||||
|
if (i == g_PADInitialize.padNumber && pad[i].bAttached)
|
||||||
registerKey(i, x, (sf::Key::Code)key);
|
registerKey(i, x, (sf::Key::Code)key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,8 +21,8 @@
|
|||||||
#endif
|
#endif
|
||||||
enum OGL_Props {
|
enum OGL_Props {
|
||||||
OGL_FULLSCREEN,
|
OGL_FULLSCREEN,
|
||||||
OGL_STRETCHTOFIT,
|
|
||||||
OGL_KEEPRATIO,
|
OGL_KEEPRATIO,
|
||||||
|
OGL_HIDECURSOR,
|
||||||
OGL_PROP_COUNT
|
OGL_PROP_COUNT
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -33,6 +33,8 @@ struct res {
|
|||||||
|
|
||||||
class GLWindow {
|
class GLWindow {
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
// TODO: what is xmax and ymax? do we need [xy]render?
|
||||||
u32 xWin, yWin; // windows size
|
u32 xWin, yWin; // windows size
|
||||||
int xOffset, yOffset; // offset in window
|
int xOffset, yOffset; // offset in window
|
||||||
float xMax, yMax; // ???
|
float xMax, yMax; // ???
|
||||||
@ -45,7 +47,6 @@ protected:
|
|||||||
EventHandler* eventHandler;
|
EventHandler* eventHandler;
|
||||||
res origRes, currFullRes, currWinRes;
|
res origRes, currFullRes, currWinRes;
|
||||||
std::vector<res> fullResolutions;
|
std::vector<res> fullResolutions;
|
||||||
std::vector<res> winResolutions;
|
|
||||||
virtual void SetRender(u32 x, u32 y) {
|
virtual void SetRender(u32 x, u32 y) {
|
||||||
xRender = x;
|
xRender = x;
|
||||||
yRender = y;
|
yRender = y;
|
||||||
@ -67,16 +68,10 @@ public:
|
|||||||
|
|
||||||
float FactorX = 640.0f / (float)GetXwin();
|
float FactorX = 640.0f / (float)GetXwin();
|
||||||
float FactorY = 480.0f / (float)GetYwin();
|
float FactorY = 480.0f / (float)GetYwin();
|
||||||
float Max = (FactorX < FactorY) ? FactorX : FactorY;
|
// float Max = (FactorX < FactorY) ? FactorX : FactorY;
|
||||||
|
|
||||||
if(GetProperty(OGL_STRETCHTOFIT)) {
|
|
||||||
SetMax(1.0f / FactorX, 1.0f / FactorY);
|
SetMax(1.0f / FactorX, 1.0f / FactorY);
|
||||||
SetOffset(0,0);
|
SetOffset(0,0);
|
||||||
} else {
|
|
||||||
SetMax(1.0f / Max, 1.0f / Max);
|
|
||||||
SetOffset((int)((GetXwin() - (640 * GetXmax())) / 2),
|
|
||||||
(int)((GetYwin() - (480 * GetYmax())) / 2));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetEventHandler(EventHandler *eh) { eventHandler = eh;}
|
void SetEventHandler(EventHandler *eh) { eventHandler = eh;}
|
||||||
@ -121,8 +116,8 @@ public:
|
|||||||
&currWinRes.x, &currWinRes.y);
|
&currWinRes.x, &currWinRes.y);
|
||||||
|
|
||||||
SetProperty(OGL_FULLSCREEN, g_Config.bFullscreen);
|
SetProperty(OGL_FULLSCREEN, g_Config.bFullscreen);
|
||||||
SetProperty(OGL_STRETCHTOFIT, g_Config.bFullscreen);
|
SetProperty(OGL_KEEPRATIO, g_Config.bKeepAR);
|
||||||
SetProperty(OGL_KEEPRATIO, g_Config.bFullscreen);
|
SetProperty(OGL_HIDECURSOR, g_Config.bHideCursor);
|
||||||
|
|
||||||
updateDim();
|
updateDim();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user