MCPcopy Create free account
hub / github.com/dborth/fceugx / ScreenZoomWindowUpdate

Function ScreenZoomWindowUpdate

source/menu.cpp:3182–3197  ·  view source on GitHub ↗

* MenuSettingsVideo ***************************************************************************/

Source from the content-addressed store, hash-verified

3180 * MenuSettingsVideo
3181 ***************************************************************************/
3182static void ScreenZoomWindowUpdate(void * ptr, float h, float v)
3183{
3184 GuiButton * b = (GuiButton *)ptr;
3185 if(b->GetState() == STATE_CLICKED)
3186 {
3187 GCSettings.zoomHor += h;
3188 GCSettings.zoomVert += v;
3189
3190 char zoom[10];
3191 sprintf(zoom, "%.2f%%", GCSettings.zoomHor*100);
3192 settingText->SetText(zoom);
3193 sprintf(zoom, "%.2f%%", GCSettings.zoomVert*100);
3194 settingText2->SetText(zoom);
3195 b->ResetState();
3196 }
3197}
3198
3199static void ScreenZoomWindowLeftClick(void * ptr) { ScreenZoomWindowUpdate(ptr, -0.01, 0); }
3200static void ScreenZoomWindowRightClick(void * ptr) { ScreenZoomWindowUpdate(ptr, +0.01, 0); }

Callers 4

ScreenZoomWindowUpClickFunction · 0.85

Calls 3

GetStateMethod · 0.80
SetTextMethod · 0.80
ResetStateMethod · 0.45

Tested by

no test coverage detected