From 0b267948ccd4c466378299f7bc9a5ccdf17a81f4 Mon Sep 17 00:00:00 2001 From: nakeee Date: Mon, 19 Jan 2009 21:39:53 +0000 Subject: [PATCH] fixed padsimple event some glwindow cleanup git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1940 8ced0084-cf51-0410-be5f-012b33b47a6e --- .../Plugin_PadSimpleEvnt/Src/PadSimple.cpp | 3 ++- Source/Plugins/Plugin_VideoOGL/Src/GLWindow.h | 27 ++++++++----------- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/Source/Plugins/Plugin_PadSimpleEvnt/Src/PadSimple.cpp b/Source/Plugins/Plugin_PadSimpleEvnt/Src/PadSimple.cpp index 861f0067ba..16ff010d77 100644 --- a/Source/Plugins/Plugin_PadSimpleEvnt/Src/PadSimple.cpp +++ b/Source/Plugins/Plugin_PadSimpleEvnt/Src/PadSimple.cpp @@ -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); } } } diff --git a/Source/Plugins/Plugin_VideoOGL/Src/GLWindow.h b/Source/Plugins/Plugin_VideoOGL/Src/GLWindow.h index 41e52bf346..05a1ada728 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/GLWindow.h +++ b/Source/Plugins/Plugin_VideoOGL/Src/GLWindow.h @@ -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 fullResolutions; - std::vector 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(); }