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:
parent
c53797dc5b
commit
0b267948cc
|
@ -408,7 +408,8 @@ void LoadConfig()
|
|||
file.Get(SectionName, controlNames[x],
|
||||
&key, (i==0)?defaultKeyForControl[x]:0);
|
||||
|
||||
registerKey(i, x, (sf::Key::Code)key);
|
||||
if (i == g_PADInitialize.padNumber && pad[i].bAttached)
|
||||
registerKey(i, x, (sf::Key::Code)key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,8 +21,8 @@
|
|||
#endif
|
||||
enum OGL_Props {
|
||||
OGL_FULLSCREEN,
|
||||
OGL_STRETCHTOFIT,
|
||||
OGL_KEEPRATIO,
|
||||
OGL_HIDECURSOR,
|
||||
OGL_PROP_COUNT
|
||||
};
|
||||
|
||||
|
@ -33,6 +33,8 @@ struct res {
|
|||
|
||||
class GLWindow {
|
||||
private:
|
||||
|
||||
// TODO: what is xmax and ymax? do we need [xy]render?
|
||||
u32 xWin, yWin; // windows size
|
||||
int xOffset, yOffset; // offset in window
|
||||
float xMax, yMax; // ???
|
||||
|
@ -43,9 +45,8 @@ class GLWindow {
|
|||
protected:
|
||||
|
||||
EventHandler* eventHandler;
|
||||
res origRes, currFullRes, currWinRes;
|
||||
res origRes, currFullRes, currWinRes;
|
||||
std::vector<res> fullResolutions;
|
||||
std::vector<res> winResolutions;
|
||||
virtual void SetRender(u32 x, u32 y) {
|
||||
xRender = x;
|
||||
yRender = y;
|
||||
|
@ -64,23 +65,17 @@ public:
|
|||
SetWinSize(currFullRes.x, currFullRes.y);
|
||||
else
|
||||
SetWinSize(currWinRes.x, currWinRes.y);
|
||||
|
||||
|
||||
float FactorX = 640.0f / (float)GetXwin();
|
||||
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);
|
||||
SetOffset(0,0);
|
||||
} else {
|
||||
SetMax(1.0f / Max, 1.0f / Max);
|
||||
SetOffset((int)((GetXwin() - (640 * GetXmax())) / 2),
|
||||
(int)((GetYwin() - (480 * GetYmax())) / 2));
|
||||
}
|
||||
SetMax(1.0f / FactorX, 1.0f / FactorY);
|
||||
SetOffset(0,0);
|
||||
}
|
||||
|
||||
void SetEventHandler(EventHandler *eh) { eventHandler = eh;}
|
||||
bool GetProperty(OGL_Props prop) {return properties[prop];}
|
||||
bool GetProperty(OGL_Props prop) {return properties[prop];}
|
||||
virtual bool SetProperty(OGL_Props prop, bool value)
|
||||
{return properties[prop] = value;}
|
||||
|
||||
|
@ -121,8 +116,8 @@ public:
|
|||
&currWinRes.x, &currWinRes.y);
|
||||
|
||||
SetProperty(OGL_FULLSCREEN, g_Config.bFullscreen);
|
||||
SetProperty(OGL_STRETCHTOFIT, g_Config.bFullscreen);
|
||||
SetProperty(OGL_KEEPRATIO, g_Config.bFullscreen);
|
||||
SetProperty(OGL_KEEPRATIO, g_Config.bKeepAR);
|
||||
SetProperty(OGL_HIDECURSOR, g_Config.bHideCursor);
|
||||
|
||||
updateDim();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue