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

Function ScreenPositionWindowUpdate

source/menu.cpp:3319–3337  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3317}
3318
3319static void ScreenPositionWindowUpdate(void * ptr, int x, int y)
3320{
3321 GuiButton * b = (GuiButton *)ptr;
3322 if(b->GetState() == STATE_CLICKED)
3323 {
3324 GCSettings.xshift += x;
3325 GCSettings.yshift += y;
3326
3327 if(!(GCSettings.xshift > -50 && GCSettings.xshift < 50))
3328 GCSettings.xshift = 0;
3329 if(!(GCSettings.yshift > -50 && GCSettings.yshift < 50))
3330 GCSettings.yshift = 0;
3331
3332 char shift[10];
3333 sprintf(shift, "%hd, %hd", GCSettings.xshift, GCSettings.yshift);
3334 settingText->SetText(shift);
3335 b->ResetState();
3336 }
3337}
3338
3339static void ScreenPositionWindowLeftClick(void * ptr) { ScreenPositionWindowUpdate(ptr, -1, 0); }
3340static void ScreenPositionWindowRightClick(void * ptr) { ScreenPositionWindowUpdate(ptr, +1, 0); }

Calls 3

GetStateMethod · 0.80
SetTextMethod · 0.80
ResetStateMethod · 0.45

Tested by

no test coverage detected