void PollControls (void) { id0_unsigned_t buttons; IN_ReadControl(0,&control); if (MousePresent) { // (REFKEEN) Minor difference from vanilla Catacomb buttons = BE_ST_GetEmuMouseButtons(); BE_ST_GetEmuAccuMouseMotion(&mousexmove, &mouseymove); #if 0 Mouse(MButtons); buttons = _BX; Mouse(MDelta); mousexmove = _CX; mouseymove = _DX; #endif if (buttons&1) control.button0 = 1; if (buttons&2) control.button1 = 1; } if (Keyboard[sc_V] || Keyboard[sc_Tab]) running = true; else running = false; }
void ViewMap (void) { id0_boolean_t button0held; viewtype = actoratview; button0held = false; maporgx = player->tilex - VIEWTILEX/2; if (maporgx<0) maporgx = 0; maporgy = player->tiley - VIEWTILEY/2; if (maporgy<0) maporgy = 0; do { // // let user pan around // IN_ReadControl(0,&control); if (control.xaxis == -1 && maporgx>0) maporgx--; if (control.xaxis == 1 && maporgx<mapwidth-VIEWTILEX) maporgx++; if (control.yaxis == -1 && maporgy>0) maporgy--; if (control.yaxis == 1 && maporgy<mapheight-VIEWTILEY) maporgy++; if (control.button0 && !button0held) { button0held = true; // REFKEEN - Make this C++ friendly if (viewtype == lastview-1) viewtype = mapview; else viewtype = (viewtypeenum)(viewtype + 1); #if 0 viewtype++; if (viewtype==lastview) viewtype = mapview; #endif } if (!control.button0) button0held = false; OverheadRefresh (); BE_ST_ShortSleep(); } while (!Keyboard[sc_Escape]); IN_ClearKeysDown (); DrawPlayScreen (); }
id0_int_t WaitOrKey (id0_int_t vbls) { while (vbls--) { IN_ReadControl(0,&c); // get player input if (LastScan || c.button0 || c.button1) { IN_ClearKeysDown (); return 1; } VW_WaitVBL(1); } return 0; }
void DemoLoop (void) { ///////////////////////////////////////////////////////////////////////////// // main game cycle ///////////////////////////////////////////////////////////////////////////// displayofs = bufferofs = 0; VW_Bar (0,0,320,200,0); VW_SetScreen(0,0); // // Read in all the graphic images needed for the title sequence // VW_WaitVBL(1); IN_ReadControl(0,&control); // set EASYMODE // if (BE_Cross_strcasecmp(id0_argv[2], "1") == 0) EASYMODEON = true; else EASYMODEON = false; // restore game // if (BE_Cross_strcasecmp(id0_argv[3], "1") == 0) { VW_FadeOut(); bufferofs = displayofs = 0; VW_Bar(0,0,320,200,0); if (GE_LoadGame()) { loadedgame = true; playstate = ex_loadedgame; Keyboard[sc_Enter] = true; VW_Bar(0,0,320,200,0); ColoredPalette(); } VW_Bar(0,0,320,200,0); VW_FadeIn(); } // Play a game // restartgame = gd_Normal; NewGame(); GameLoop(); }
void PollControls (void) { id0_unsigned_t buttons; IN_ReadControl(0,&c); if (MousePresent) { buttons = BE_ST_GetMouseButtons(); BE_ST_GetMouseDelta(&mousexmove, &mouseymove); #if 0 Mouse(MButtons); buttons = _BX; Mouse(MDelta); mousexmove = _CX; mouseymove = _DX; #endif if (buttons&1) c.button0 = 1; if (buttons&2) c.button1 = 1; } if (Controls[0]==ctrl_Joystick) { if (c.x>120 || c.x <-120 || c.y>120 || c.y<-120) running = true; else running = false; if (c.x>-48 && c.x<48) slowturn = true; else slowturn = false; } else { if (Keyboard[sc_RShift]) running = true; else running = false; if (c.button0) slowturn = true; else slowturn = false; } }
void ViewMap (void) { boolean button0held; viewtype = actoratview; button0held = false; maporgx = player->tilex - VIEWTILEX/2; if (maporgx<0) maporgx = 0; maporgy = player->tiley - VIEWTILEY/2; if (maporgy<0) maporgy = 0; do { // // let user pan around // IN_ReadControl(0,&control); if (control.xaxis == -1 && maporgx>0) maporgx--; if (control.xaxis == 1 && maporgx<mapwidth-VIEWTILEX) maporgx++; if (control.yaxis == -1 && maporgy>0) maporgy--; if (control.yaxis == 1 && maporgy<mapheight-VIEWTILEY) maporgy++; if (control.button0 && !button0held) { button0held = true; viewtype++; if (viewtype==lastview) viewtype = mapview; } if (!control.button0) button0held = false; OverheadRefresh (); } while (!Keyboard[sc_Escape]); IN_ClearKeysDown (); DrawPlayScreen (); }