Rename some input functions

This commit is contained in:
Alexander Batalov 2022-10-05 10:11:47 +03:00
parent 32c7883f82
commit 9b150257fb
38 changed files with 206 additions and 206 deletions

View File

@ -2787,7 +2787,7 @@ void _object_animate()
Object* object = sad->obj; Object* object = sad->obj;
unsigned int time = _get_time(); unsigned int time = getTicks();
if (getTicksBetween(time, sad->animationTimestamp) < sad->ticksPerFrame) { if (getTicksBetween(time, sad->animationTimestamp) < sad->ticksPerFrame) {
continue; continue;
} }

View File

@ -404,7 +404,7 @@ void automapShow(bool isInGame, bool isUsingScanner)
// FIXME: There is minor bug in the interface - pressing H/L to toggle // FIXME: There is minor bug in the interface - pressing H/L to toggle
// high/low details does not update switch state. // high/low details does not update switch state.
int keyCode = _get_input(); int keyCode = inputGetInput();
switch (keyCode) { switch (keyCode) {
case KEY_TAB: case KEY_TAB:
case KEY_ESCAPE: case KEY_ESCAPE:

View File

@ -817,8 +817,8 @@ int characterEditorShow(bool isCreationMode)
int rc = -1; int rc = -1;
while (rc == -1) { while (rc == -1) {
_frame_time = _get_time(); _frame_time = getTicks();
int keyCode = _get_input(); int keyCode = inputGetInput();
convertMouseWheelToArrowKey(&keyCode); convertMouseWheelToArrowKey(&keyCode);
@ -1929,9 +1929,9 @@ static int _get_input_str(int win, int cancelKeyCode, char* text, int maxLength,
int rc = 1; int rc = 1;
while (rc == 1) { while (rc == 1) {
_frame_time = _get_time(); _frame_time = getTicks();
int keyCode = _get_input(); int keyCode = inputGetInput();
if (keyCode == cancelKeyCode) { if (keyCode == cancelKeyCode) {
rc = 0; rc = 0;
} else if (keyCode == KEY_RETURN) { } else if (keyCode == KEY_RETURN) {
@ -2255,7 +2255,7 @@ static void characterEditorDrawBigNumber(int x, int y, int flags, int value, int
if (flags & ANIMATE) { if (flags & ANIMATE) {
if (previousValue % 10 != ones) { if (previousValue % 10 != ones) {
_frame_time = _get_time(); _frame_time = getTicks();
blitBufferToBuffer(numbersGraphicBufferPtr + BIG_NUM_WIDTH * 11, blitBufferToBuffer(numbersGraphicBufferPtr + BIG_NUM_WIDTH * 11,
BIG_NUM_WIDTH, BIG_NUM_WIDTH,
BIG_NUM_HEIGHT, BIG_NUM_HEIGHT,
@ -2276,7 +2276,7 @@ static void characterEditorDrawBigNumber(int x, int y, int flags, int value, int
windowRefreshRect(windowHandle, &rect); windowRefreshRect(windowHandle, &rect);
if (previousValue / 10 != tens) { if (previousValue / 10 != tens) {
_frame_time = _get_time(); _frame_time = getTicks();
blitBufferToBuffer(numbersGraphicBufferPtr + BIG_NUM_WIDTH * 11, blitBufferToBuffer(numbersGraphicBufferPtr + BIG_NUM_WIDTH * 11,
BIG_NUM_WIDTH, BIG_NUM_WIDTH,
BIG_NUM_HEIGHT, BIG_NUM_HEIGHT,
@ -3399,12 +3399,12 @@ static int characterEditorEditAge()
} }
while (true) { while (true) {
_frame_time = _get_time(); _frame_time = getTicks();
change = 0; change = 0;
flags = 0; flags = 0;
int v32 = 0; int v32 = 0;
keyCode = _get_input(); keyCode = inputGetInput();
if (keyCode == KEY_RETURN || keyCode == 500) { if (keyCode == KEY_RETURN || keyCode == 500) {
if (keyCode != 500) { if (keyCode != 500) {
@ -3462,7 +3462,7 @@ static int characterEditorEditAge()
_repFtime = 4; _repFtime = 4;
while (true) { while (true) {
_frame_time = _get_time(); _frame_time = getTicks();
v33++; v33++;
@ -3512,7 +3512,7 @@ static int characterEditorEditAge()
; ;
} }
keyCode = _get_input(); keyCode = inputGetInput();
if (keyCode == 503 || keyCode == 504 || _game_user_wants_to_quit != 0) { if (keyCode == 503 || keyCode == 504 || _game_user_wants_to_quit != 0) {
break; break;
} }
@ -3627,9 +3627,9 @@ static void characterEditorEditGender()
_win_set_button_rest_state(btns[savedGender], 1, 0); _win_set_button_rest_state(btns[savedGender], 1, 0);
while (true) { while (true) {
_frame_time = _get_time(); _frame_time = getTicks();
int eventCode = _get_input(); int eventCode = inputGetInput();
if (eventCode == KEY_RETURN || eventCode == 500) { if (eventCode == KEY_RETURN || eventCode == 500) {
if (eventCode == KEY_RETURN) { if (eventCode == KEY_RETURN) {
@ -3692,7 +3692,7 @@ static void characterEditorAdjustPrimaryStat(int eventCode)
bool cont = true; bool cont = true;
do { do {
_frame_time = _get_time(); _frame_time = getTicks();
if (v11 <= 19.2) { if (v11 <= 19.2) {
v11++; v11++;
} }
@ -3747,7 +3747,7 @@ static void characterEditorAdjustPrimaryStat(int eventCode)
while (getTicksSince(_frame_time) < 1000 / 24) { while (getTicksSince(_frame_time) < 1000 / 24) {
} }
} }
} while (_get_input() != 518 && cont); } while (inputGetInput() != 518 && cont);
characterEditorDrawCard(); characterEditorDrawCard();
} }
@ -3854,7 +3854,7 @@ static int characterEditorShowOptions()
int rc = 0; int rc = 0;
while (rc == 0) { while (rc == 0) {
int keyCode = _get_input(); int keyCode = inputGetInput();
if (_game_user_wants_to_quit != 0) { if (_game_user_wants_to_quit != 0) {
rc = 2; rc = 2;
@ -5161,7 +5161,7 @@ static void characterEditorHandleAdjustSkillButtonPressed(int keyCode)
int repeatDelay = 0; int repeatDelay = 0;
for (;;) { for (;;) {
_frame_time = _get_time(); _frame_time = getTicks();
if (repeatDelay <= dbl_5018F0) { if (repeatDelay <= dbl_5018F0) {
repeatDelay++; repeatDelay++;
} }
@ -5244,7 +5244,7 @@ static void characterEditorHandleAdjustSkillButtonPressed(int keyCode)
} }
} }
int keyCode = _get_input(); int keyCode = inputGetInput();
if (keyCode != 522 && keyCode != 524 && rc != -1) { if (keyCode != 522 && keyCode != 524 && rc != -1) {
continue; continue;
} }
@ -5954,7 +5954,7 @@ static int perkDialogHandleInput(int count, void (*refreshProc)())
int rc = 0; int rc = 0;
while (rc == 0) { while (rc == 0) {
int keyCode = _get_input(); int keyCode = inputGetInput();
int v19 = 0; int v19 = 0;
convertMouseWheelToArrowKey(&keyCode); convertMouseWheelToArrowKey(&keyCode);
@ -6067,7 +6067,7 @@ static int perkDialogHandleInput(int count, void (*refreshProc)())
gPerkDialogPreviousCurrentLine = -2; gPerkDialogPreviousCurrentLine = -2;
do { do {
_frame_time = _get_time(); _frame_time = getTicks();
if (v19 <= dbl_5019BE) { if (v19 <= dbl_5019BE) {
v19++; v19++;
} }
@ -6099,7 +6099,7 @@ static int perkDialogHandleInput(int count, void (*refreshProc)())
while (getTicksSince(_frame_time) < 1000 / _repFtime) { while (getTicksSince(_frame_time) < 1000 / _repFtime) {
} }
} }
} while (_get_input() != 574); } while (inputGetInput() != 574);
break; break;
case 573: case 573:
@ -6108,7 +6108,7 @@ static int perkDialogHandleInput(int count, void (*refreshProc)())
if (count > 11) { if (count > 11) {
do { do {
_frame_time = _get_time(); _frame_time = getTicks();
if (v19 <= dbl_5019BE) { if (v19 <= dbl_5019BE) {
v19++; v19++;
} }
@ -6141,10 +6141,10 @@ static int perkDialogHandleInput(int count, void (*refreshProc)())
while (getTicksSince(_frame_time) < 1000 / _repFtime) { while (getTicksSince(_frame_time) < 1000 / _repFtime) {
} }
} }
} while (_get_input() != 575); } while (inputGetInput() != 575);
} else { } else {
do { do {
_frame_time = _get_time(); _frame_time = getTicks();
if (v19 <= dbl_5019BE) { if (v19 <= dbl_5019BE) {
v19++; v19++;
} }
@ -6172,7 +6172,7 @@ static int perkDialogHandleInput(int count, void (*refreshProc)())
while (getTicksSince(_frame_time) < 1000 / _repFtime) { while (getTicksSince(_frame_time) < 1000 / _repFtime) {
} }
} }
} while (_get_input() != 575); } while (inputGetInput() != 575);
} }
break; break;
case KEY_HOME: case KEY_HOME:
@ -6193,7 +6193,7 @@ static int perkDialogHandleInput(int count, void (*refreshProc)())
break; break;
default: default:
if (getTicksSince(_frame_time) > 700) { if (getTicksSince(_frame_time) > 700) {
_frame_time = _get_time(); _frame_time = getTicks();
gPerkDialogPreviousCurrentLine = -2; gPerkDialogPreviousCurrentLine = -2;
} }
break; break;

View File

@ -167,7 +167,7 @@ int characterSelectorOpen()
break; break;
} }
int keyCode = _get_input(); int keyCode = inputGetInput();
switch (keyCode) { switch (keyCode) {
case KEY_MINUS: case KEY_MINUS:

View File

@ -3141,7 +3141,7 @@ static int _combat_input()
break; break;
} }
int keyCode = _get_input(); int keyCode = inputGetInput();
if (_action_explode_running()) { if (_action_explode_running()) {
while (_combat_turn_running > 0) { while (_combat_turn_running > 0) {
_process_bk(); _process_bk();
@ -5581,7 +5581,7 @@ static int calledShotSelectHitLocation(Object* critter, int* hitLocation, int hi
int eventCode; int eventCode;
while (true) { while (true) {
eventCode = _get_input(); eventCode = inputGetInput();
if (eventCode == KEY_ESCAPE) { if (eventCode == KEY_ESCAPE) {
break; break;

View File

@ -153,7 +153,7 @@ void creditsOpen(const char* filePath, int backgroundFid, bool useReversedStyle)
unsigned char* dest = intermediateBuffer + CREDITS_WINDOW_WIDTH * CREDITS_WINDOW_HEIGHT - CREDITS_WINDOW_WIDTH + (CREDITS_WINDOW_WIDTH - v19) / 2; unsigned char* dest = intermediateBuffer + CREDITS_WINDOW_WIDTH * CREDITS_WINDOW_HEIGHT - CREDITS_WINDOW_WIDTH + (CREDITS_WINDOW_WIDTH - v19) / 2;
unsigned char* src = stringBuffer; unsigned char* src = stringBuffer;
for (int index = 0; index < lineHeight; index++) { for (int index = 0; index < lineHeight; index++) {
if (_get_input() != -1) { if (inputGetInput() != -1) {
stop = true; stop = true;
break; break;
} }
@ -178,7 +178,7 @@ void creditsOpen(const char* filePath, int backgroundFid, bool useReversedStyle)
while (getTicksSince(tick) < CREDITS_WINDOW_SCROLLING_DELAY) { while (getTicksSince(tick) < CREDITS_WINDOW_SCROLLING_DELAY) {
} }
tick = _get_time(); tick = getTicks();
windowRefresh(window); windowRefresh(window);
@ -192,7 +192,7 @@ void creditsOpen(const char* filePath, int backgroundFid, bool useReversedStyle)
if (!stop) { if (!stop) {
for (int index = 0; index < CREDITS_WINDOW_HEIGHT; index++) { for (int index = 0; index < CREDITS_WINDOW_HEIGHT; index++) {
if (_get_input() != -1) { if (inputGetInput() != -1) {
break; break;
} }
@ -216,7 +216,7 @@ void creditsOpen(const char* filePath, int backgroundFid, bool useReversedStyle)
while (getTicksSince(tick) < CREDITS_WINDOW_SCROLLING_DELAY) { while (getTicksSince(tick) < CREDITS_WINDOW_SCROLLING_DELAY) {
} }
tick = _get_time(); tick = getTicks();
windowRefresh(window); windowRefresh(window);
} }

View File

@ -222,7 +222,7 @@ void colorCycleTicker()
bool changed = false; bool changed = false;
unsigned char* palette = _getSystemPalette(); unsigned char* palette = _getSystemPalette();
unsigned int time = _get_time(); unsigned int time = getTicks();
if (getTicksBetween(time, gColorCycleTimestamp1) >= COLOR_CYCLE_PERIOD_1 * gColorCycleSpeedFactor) { if (getTicksBetween(time, gColorCycleTimestamp1) >= COLOR_CYCLE_PERIOD_1 * gColorCycleSpeedFactor) {
changed = true; changed = true;

View File

@ -498,7 +498,7 @@ int showDialogBox(const char* title, const char** body, int bodyLength, int x, i
int rc = -1; int rc = -1;
while (rc == -1) { while (rc == -1) {
int keyCode = _get_input(); int keyCode = inputGetInput();
if (keyCode == 500) { if (keyCode == 500) {
rc = 1; rc = 1;
@ -698,8 +698,8 @@ int showLoadFileDialog(char* title, char** fileList, char* dest, int fileListLen
int rc = -1; int rc = -1;
while (rc == -1) { while (rc == -1) {
unsigned int tick = _get_time(); unsigned int tick = getTicks();
int keyCode = _get_input(); int keyCode = inputGetInput();
int scrollDirection = FILE_DIALOG_SCROLL_DIRECTION_NONE; int scrollDirection = FILE_DIALOG_SCROLL_DIRECTION_NONE;
int scrollCounter = 0; int scrollCounter = 0;
bool isScrolling = false; bool isScrolling = false;
@ -808,7 +808,7 @@ int showLoadFileDialog(char* title, char** fileList, char* dest, int fileListLen
unsigned int scrollDelay = 4; unsigned int scrollDelay = 4;
doubleClickSelectedFileIndex = -2; doubleClickSelectedFileIndex = -2;
while (1) { while (1) {
unsigned int scrollTick = _get_time(); unsigned int scrollTick = getTicks();
scrollCounter += 1; scrollCounter += 1;
if ((!isScrolling && scrollCounter == 1) || (isScrolling && scrollCounter > 14.4)) { if ((!isScrolling && scrollCounter == 1) || (isScrolling && scrollCounter > 14.4)) {
isScrolling = true; isScrolling = true;
@ -860,7 +860,7 @@ int showLoadFileDialog(char* title, char** fileList, char* dest, int fileListLen
break; break;
} }
int keyCode = _get_input(); int keyCode = inputGetInput();
if (keyCode == 505 || keyCode == 503) { if (keyCode == 505 || keyCode == 503) {
break; break;
} }
@ -1085,8 +1085,8 @@ int showSaveFileDialog(char* title, char** fileList, char* dest, int fileListLen
int rc = -1; int rc = -1;
while (rc == -1) { while (rc == -1) {
unsigned int tick = _get_time(); unsigned int tick = getTicks();
int keyCode = _get_input(); int keyCode = inputGetInput();
int scrollDirection = FILE_DIALOG_SCROLL_DIRECTION_NONE; int scrollDirection = FILE_DIALOG_SCROLL_DIRECTION_NONE;
int scrollCounter = 0; int scrollCounter = 0;
bool isScrolling = false; bool isScrolling = false;
@ -1232,7 +1232,7 @@ int showSaveFileDialog(char* title, char** fileList, char* dest, int fileListLen
unsigned int scrollDelay = 4; unsigned int scrollDelay = 4;
doubleClickSelectedFileIndex = -2; doubleClickSelectedFileIndex = -2;
while (1) { while (1) {
unsigned int scrollTick = _get_time(); unsigned int scrollTick = getTicks();
scrollCounter += 1; scrollCounter += 1;
if ((!isScrolling && scrollCounter == 1) || (isScrolling && scrollCounter > 14.4)) { if ((!isScrolling && scrollCounter == 1) || (isScrolling && scrollCounter > 14.4)) {
isScrolling = true; isScrolling = true;
@ -1301,7 +1301,7 @@ int showSaveFileDialog(char* title, char** fileList, char* dest, int fileListLen
break; break;
} }
int key = _get_input(); int key = inputGetInput();
if (key == 505 || key == 503) { if (key == 505 || key == 503) {
break; break;
} }

View File

@ -394,7 +394,7 @@ int elevatorSelectLevel(int elevator, int* mapPtr, int* elevationPtr, int* tileP
bool done = false; bool done = false;
int keyCode; int keyCode;
while (!done) { while (!done) {
keyCode = _get_input(); keyCode = inputGetInput();
if (keyCode == KEY_ESCAPE) { if (keyCode == KEY_ESCAPE) {
done = true; done = true;
} }
@ -434,7 +434,7 @@ int elevatorSelectLevel(int elevator, int* mapPtr, int* elevationPtr, int* tileP
float v41 = (float)keyCode * v42; float v41 = (float)keyCode * v42;
float v44 = (float)(*elevationPtr) * v42; float v44 = (float)(*elevationPtr) * v42;
do { do {
unsigned int tick = _get_time(); unsigned int tick = getTicks();
v44 += v43; v44 += v43;
blitBufferToBuffer( blitBufferToBuffer(
_elevatorFrmImages[ELEVATOR_FRM_GAUGE].getData() + v18 * (int)v44, _elevatorFrmImages[ELEVATOR_FRM_GAUGE].getData() + v18 * (int)v44,
@ -450,7 +450,7 @@ int elevatorSelectLevel(int elevator, int* mapPtr, int* elevationPtr, int* tileP
} }
} while ((v43 <= 0.0 || v44 < v41) && (v43 > 0.0 || v44 > v41)); } while ((v43 <= 0.0 || v44 < v41) && (v43 > 0.0 || v44 > v41));
coreDelayProcessingEvents(200); inputPauseForTocks(200);
} }
} }

View File

@ -240,7 +240,7 @@ void endgamePlayMovie()
tickersAdd(_endgame_movie_bk_process); tickersAdd(_endgame_movie_bk_process);
backgroundSoundSetEndCallback(_endgame_movie_callback); backgroundSoundSetEndCallback(_endgame_movie_callback);
backgroundSoundLoad("akiss", 12, 14, 15); backgroundSoundLoad("akiss", 12, 14, 15);
coreDelayProcessingEvents(3000); inputPauseForTocks(3000);
// NOTE: Result is ignored. I guess there was some kind of switch for male // NOTE: Result is ignored. I guess there was some kind of switch for male
// vs. female ending, but it was not implemented. // vs. female ending, but it was not implemented.
@ -371,7 +371,7 @@ static void endgameEndingRenderPanningScene(int direction, const char* narratorF
windowRefresh(gEndgameEndingSlideshowWindow); windowRefresh(gEndgameEndingSlideshowWindow);
since = _get_time(); since = getTicks();
bool v14; bool v14;
double v31; double v31;
@ -411,7 +411,7 @@ static void endgameEndingRenderPanningScene(int direction, const char* narratorF
soundContinueAll(); soundContinueAll();
if (_get_input() != -1) { if (inputGetInput() != -1) {
// NOTE: Uninline. // NOTE: Uninline.
endgameEndingVoiceOverFree(); endgameEndingVoiceOverFree();
break; break;
@ -427,7 +427,7 @@ static void endgameEndingRenderPanningScene(int direction, const char* narratorF
} }
while (mouseGetEvent() != 0) { while (mouseGetEvent() != 0) {
_get_input(); inputGetInput();
} }
} }
@ -458,17 +458,17 @@ static void endgameEndingRenderStaticScene(int fid, const char* narratorFileName
paletteFadeTo(_cmap); paletteFadeTo(_cmap);
coreDelayProcessingEvents(500); inputPauseForTocks(500);
// NOTE: Uninline. // NOTE: Uninline.
endgameEndingVoiceOverReset(); endgameEndingVoiceOverReset();
unsigned int referenceTime = _get_time(); unsigned int referenceTime = getTicks();
tickersDisable(); tickersDisable();
int keyCode; int keyCode;
while (true) { while (true) {
keyCode = _get_input(); keyCode = inputGetInput();
if (keyCode != -1) { if (keyCode != -1) {
break; break;
} }
@ -499,13 +499,13 @@ static void endgameEndingRenderStaticScene(int fid, const char* narratorFileName
gEndgameEndingVoiceOverSubtitlesLoaded = false; gEndgameEndingVoiceOverSubtitlesLoaded = false;
if (keyCode == -1) { if (keyCode == -1) {
coreDelayProcessingEvents(500); inputPauseForTocks(500);
} }
paletteFadeTo(gPaletteBlack); paletteFadeTo(gPaletteBlack);
while (mouseGetEvent() != 0) { while (mouseGetEvent() != 0) {
_get_input(); inputGetInput();
} }
} }
@ -689,7 +689,7 @@ static void endgameEndingVoiceOverReset()
} }
if (gEndgameEndingVoiceOverSubtitlesLoaded) { if (gEndgameEndingVoiceOverSubtitlesLoaded) {
gEndgameEndingSubtitlesReferenceTime = _get_time(); gEndgameEndingSubtitlesReferenceTime = getTicks();
} }
} }

View File

@ -1149,11 +1149,11 @@ static void showHelp()
colorPaletteLoad("art\\intrface\\helpscrn.pal"); colorPaletteLoad("art\\intrface\\helpscrn.pal");
paletteSetEntries(_cmap); paletteSetEntries(_cmap);
while (_get_input() == -1 && _game_user_wants_to_quit == 0) { while (inputGetInput() == -1 && _game_user_wants_to_quit == 0) {
} }
while (mouseGetEvent() != 0) { while (mouseGetEvent() != 0) {
_get_input(); inputGetInput();
} }
paletteSetEntries(gPaletteBlack); paletteSetEntries(gPaletteBlack);

View File

@ -1442,7 +1442,7 @@ int gameDialogShowReview()
gameDialogReviewWindowUpdate(win, v1); gameDialogReviewWindowUpdate(win, v1);
while (true) { while (true) {
int keyCode = _get_input(); int keyCode = inputGetInput();
if (keyCode == 17 || keyCode == 24 || keyCode == 324) { if (keyCode == 17 || keyCode == 24 || keyCode == 324) {
showQuitConfirmationDialog(); showQuitConfirmationDialog();
} }
@ -1839,13 +1839,13 @@ int _gdProcess()
_gdReplyTooBig = 1; _gdReplyTooBig = 1;
} }
unsigned int tick = _get_time(); unsigned int tick = getTicks();
int pageCount = 0; int pageCount = 0;
int pageIndex = 0; int pageIndex = 0;
int pageOffsets[10]; int pageOffsets[10];
pageOffsets[0] = 0; pageOffsets[0] = 0;
for (;;) { for (;;) {
int keyCode = _get_input(); int keyCode = inputGetInput();
convertMouseWheelToArrowKey(&keyCode); convertMouseWheelToArrowKey(&keyCode);
@ -1956,7 +1956,7 @@ int _gdProcess()
break; break;
} }
tick = _get_time(); tick = getTicks();
if (dword_58F4E0) { if (dword_58F4E0) {
v18 = 1; v18 = 1;
@ -2508,7 +2508,7 @@ void gameDialogWaitForFidgetToComplete()
while (artGetFrameCount(gGameDialogFidgetFrm) > gGameDialogFidgetFrmCurrentFrame) { while (artGetFrameCount(gGameDialogFidgetFrm) > gGameDialogFidgetFrmCurrentFrame) {
if (getTicksSince(gGameDialogFidgetLastUpdateTimestamp) >= gGameDialogFidgetUpdateDelay) { if (getTicksSince(gGameDialogFidgetLastUpdateTimestamp) >= gGameDialogFidgetUpdateDelay) {
gameDialogRenderTalkingHead(gGameDialogFidgetFrm, gGameDialogFidgetFrmCurrentFrame); gameDialogRenderTalkingHead(gGameDialogFidgetFrm, gGameDialogFidgetFrmCurrentFrame);
gGameDialogFidgetLastUpdateTimestamp = _get_time(); gGameDialogFidgetLastUpdateTimestamp = getTicks();
gGameDialogFidgetFrmCurrentFrame++; gGameDialogFidgetFrmCurrentFrame++;
} }
} }
@ -2554,7 +2554,7 @@ void _gdPlayTransition(int anim)
while (frame < artGetFrameCount(headFrm)) { while (frame < artGetFrameCount(headFrm)) {
if (getTicksSince(time) >= delay) { if (getTicksSince(time) >= delay) {
gameDialogRenderTalkingHead(headFrm, frame); gameDialogRenderTalkingHead(headFrm, frame);
time = _get_time(); time = getTicks();
frame++; frame++;
} }
} }
@ -2801,7 +2801,7 @@ void gameDialogTicker()
_can_start_new_fidget = true; _can_start_new_fidget = true;
} else { } else {
gameDialogRenderTalkingHead(gGameDialogFidgetFrm, gGameDialogFidgetFrmCurrentFrame); gameDialogRenderTalkingHead(gGameDialogFidgetFrm, gGameDialogFidgetFrmCurrentFrame);
gGameDialogFidgetLastUpdateTimestamp = _get_time(); gGameDialogFidgetLastUpdateTimestamp = getTicks();
gGameDialogFidgetFrmCurrentFrame += 1; gGameDialogFidgetFrmCurrentFrame += 1;
} }
} }
@ -2901,7 +2901,7 @@ void _gdialog_scroll_subwin(int win, int a2, unsigned char* a3, unsigned char* a
v7 += 10; v7 += 10;
v9 -= 10 * (GAME_DIALOG_WINDOW_WIDTH); v9 -= 10 * (GAME_DIALOG_WINDOW_WIDTH);
tick = _get_time(); tick = getTicks();
while (getTicksSince(tick) < 33) { while (getTicksSince(tick) < 33) {
} }
} }
@ -2936,7 +2936,7 @@ void _gdialog_scroll_subwin(int win, int a2, unsigned char* a3, unsigned char* a
rect.top += 10; rect.top += 10;
tick = _get_time(); tick = getTicks();
while (getTicksSince(tick) < 33) { while (getTicksSince(tick) < 33) {
} }
} }
@ -3624,7 +3624,7 @@ void partyMemberControlWindowHandleEvents()
bool done = false; bool done = false;
while (!done) { while (!done) {
int keyCode = _get_input(); int keyCode = inputGetInput();
if (keyCode != -1) { if (keyCode != -1) {
if (keyCode == KEY_CTRL_Q || keyCode == KEY_CTRL_X || keyCode == KEY_F10) { if (keyCode == KEY_CTRL_Q || keyCode == KEY_CTRL_X || keyCode == KEY_F10) {
showQuitConfirmationDialog(); showQuitConfirmationDialog();
@ -3864,7 +3864,7 @@ void partyMemberCustomizationWindowHandleEvents()
{ {
bool done = false; bool done = false;
while (!done) { while (!done) {
unsigned int keyCode = _get_input(); unsigned int keyCode = inputGetInput();
if (keyCode != -1) { if (keyCode != -1) {
if (keyCode == KEY_CTRL_Q || keyCode == KEY_CTRL_X || keyCode == KEY_F10) { if (keyCode == KEY_CTRL_Q || keyCode == KEY_CTRL_X || keyCode == KEY_F10) {
showQuitConfirmationDialog(); showQuitConfirmationDialog();
@ -4066,7 +4066,7 @@ int _gdCustomSelect(int a1)
bool done = false; bool done = false;
unsigned int v53 = 0; unsigned int v53 = 0;
while (!done) { while (!done) {
int keyCode = _get_input(); int keyCode = inputGetInput();
if (keyCode == -1) { if (keyCode == -1) {
continue; continue;
} }
@ -4107,7 +4107,7 @@ int _gdCustomSelect(int a1)
continue; continue;
} }
unsigned int timestamp = _get_time(); unsigned int timestamp = getTicks();
if (newValue == value) { if (newValue == value) {
if (getTicksBetween(timestamp, v53) < 250) { if (getTicksBetween(timestamp, v53) < 250) {
_custom_current_selected[a1] = newValue; _custom_current_selected[a1] = newValue;

View File

@ -1019,7 +1019,7 @@ void _gmouse_handle_event(int mouseX, int mouseY, int mouseState)
_gmouse_3d_hover_test = true; _gmouse_3d_hover_test = true;
gGameMouseLastY = mouseY; gGameMouseLastY = mouseY;
gGameMouseLastX = mouseX; gGameMouseLastX = mouseX;
_gmouse_3d_last_move_time = _get_time() - 250; _gmouse_3d_last_move_time = getTicks() - 250;
} }
return; return;
} }
@ -1141,7 +1141,7 @@ void _gmouse_handle_event(int mouseX, int mouseY, int mouseState)
int v33 = mouseY; int v33 = mouseY;
int actionIndex = 0; int actionIndex = 0;
while ((mouseGetEvent() & MOUSE_EVENT_LEFT_BUTTON_UP) == 0) { while ((mouseGetEvent() & MOUSE_EVENT_LEFT_BUTTON_UP) == 0) {
_get_input(); inputGetInput();
if (_game_user_wants_to_quit != 0) { if (_game_user_wants_to_quit != 0) {
actionMenuItems[actionIndex] = 0; actionMenuItems[actionIndex] = 0;
@ -1170,7 +1170,7 @@ void _gmouse_handle_event(int mouseX, int mouseY, int mouseState)
_gmouse_3d_hover_test = false; _gmouse_3d_hover_test = false;
gGameMouseLastX = mouseX; gGameMouseLastX = mouseX;
gGameMouseLastY = mouseY; gGameMouseLastY = mouseY;
_gmouse_3d_last_move_time = _get_time(); _gmouse_3d_last_move_time = getTicks();
_mouse_set_position(mouseX, v33); _mouse_set_position(mouseX, v33);
@ -1276,7 +1276,7 @@ int gameMouseSetCursor(int cursor)
bool shouldUpdate = true; bool shouldUpdate = true;
int frame = 0; int frame = 0;
if (cursor >= FIRST_GAME_MOUSE_ANIMATED_CURSOR) { if (cursor >= FIRST_GAME_MOUSE_ANIMATED_CURSOR) {
unsigned int tick = _get_time(); unsigned int tick = getTicks();
if ((gGameMouseHexCursor->flags & OBJECT_HIDDEN) == 0) { if ((gGameMouseHexCursor->flags & OBJECT_HIDDEN) == 0) {
gameMouseObjectsHide(); gameMouseObjectsHide();
@ -1395,7 +1395,7 @@ void gameMouseSetMode(int mode)
gGameMouseMode = mode; gGameMouseMode = mode;
_gmouse_3d_hover_test = false; _gmouse_3d_hover_test = false;
_gmouse_3d_last_move_time = _get_time(); _gmouse_3d_last_move_time = getTicks();
tileWindowRefreshRect(&rect, gElevation); tileWindowRefreshRect(&rect, gElevation);
@ -1563,7 +1563,7 @@ void gameMouseObjectsShow()
} }
_gmouse_3d_hover_test = false; _gmouse_3d_hover_test = false;
_gmouse_3d_last_move_time = _get_time() - 250; _gmouse_3d_last_move_time = getTicks() - 250;
} }
// 0x44CE34 // 0x44CE34
@ -2027,7 +2027,7 @@ int gameMouseObjectsReset()
gGameMouseLastX = -1; gGameMouseLastX = -1;
gGameMouseLastY = -1; gGameMouseLastY = -1;
_gmouse_3d_hover_test = false; _gmouse_3d_hover_test = false;
_gmouse_3d_last_move_time = _get_time(); _gmouse_3d_last_move_time = getTicks();
gameMouseLoadItemHighlight(); gameMouseLoadItemHighlight();
return 0; return 0;

View File

@ -252,7 +252,7 @@ int gameMoviePlay(int movie, int flags)
int v11 = 0; int v11 = 0;
int buttons; int buttons;
do { do {
if (!_moviePlaying() || _game_user_wants_to_quit || _get_input() != -1) { if (!_moviePlaying() || _game_user_wants_to_quit || inputGetInput() != -1) {
break; break;
} }

View File

@ -117,7 +117,7 @@ static TickerListNode* gTickerListHead;
static unsigned int gTickerLastTimestamp; static unsigned int gTickerLastTimestamp;
// 0x4C8A70 // 0x4C8A70
int coreInit(int a1) int inputInit(int a1)
{ {
if (!directInputInit()) { if (!directInputInit()) {
return -1; return -1;
@ -159,7 +159,7 @@ int coreInit(int a1)
} }
// 0x4C8B40 // 0x4C8B40
void coreExit() void inputExit()
{ {
_GNW95_input_init(); _GNW95_input_init();
mouseFree(); mouseFree();
@ -175,7 +175,7 @@ void coreExit()
} }
// 0x4C8B78 // 0x4C8B78
int _get_input() int inputGetInput()
{ {
int v3; int v3;
@ -377,7 +377,7 @@ static void pauseGame()
int win = gPauseHandler(); int win = gPauseHandler();
while (_get_input() != KEY_ESCAPE) { while (inputGetInput() != KEY_ESCAPE) {
} }
gPaused = false; gPaused = false;
@ -606,24 +606,24 @@ void screenshotHandlerConfigure(int keyCode, ScreenshotHandler* handler)
} }
// 0x4C9370 // 0x4C9370
unsigned int _get_time() unsigned int getTicks()
{ {
return SDL_GetTicks(); return SDL_GetTicks();
} }
// 0x4C937C // 0x4C937C
void coreDelayProcessingEvents(unsigned int delay) void inputPauseForTocks(unsigned int delay)
{ {
// NOTE: Uninline. // NOTE: Uninline.
unsigned int start = _get_time(); unsigned int start = getTicks();
unsigned int end = _get_time(); unsigned int end = getTicks();
// NOTE: Uninline. // NOTE: Uninline.
unsigned int diff = getTicksBetween(end, start); unsigned int diff = getTicksBetween(end, start);
while (diff < delay) { while (diff < delay) {
_process_bk(); _process_bk();
end = _get_time(); end = getTicks();
// NOTE: Uninline. // NOTE: Uninline.
diff = getTicksBetween(end, start); diff = getTicksBetween(end, start);
@ -631,7 +631,7 @@ void coreDelayProcessingEvents(unsigned int delay)
} }
// 0x4C93B8 // 0x4C93B8
void coreDelay(unsigned int ms) void inputBlockForTocks(unsigned int ms)
{ {
unsigned int start = SDL_GetTicks(); unsigned int start = SDL_GetTicks();
unsigned int diff; unsigned int diff;
@ -1123,7 +1123,7 @@ void _GNW95_process_message()
if (gProgramIsActive && !keyboardIsDisabled()) { if (gProgramIsActive && !keyboardIsDisabled()) {
// NOTE: Uninline // NOTE: Uninline
int tick = _get_time(); int tick = getTicks();
for (int key = 0; key < SDL_NUM_SCANCODES; key++) { for (int key = 0; key < SDL_NUM_SCANCODES; key++) {
RepeatInfo* ptr = &(_GNW95_key_time_stamps[key]); RepeatInfo* ptr = &(_GNW95_key_time_stamps[key]);
@ -1165,7 +1165,7 @@ static void _GNW95_process_key(KeyboardData* data)
} else { } else {
RepeatInfo* ptr = &(_GNW95_key_time_stamps[data->key]); RepeatInfo* ptr = &(_GNW95_key_time_stamps[data->key]);
if (data->down == 1) { if (data->down == 1) {
ptr->tick = _get_time(); ptr->tick = getTicks();
ptr->repeatCount = 0; ptr->repeatCount = 0;
} else { } else {
ptr->tick = -1; ptr->tick = -1;

View File

@ -10,9 +10,9 @@ typedef void(TickerProc)();
typedef int(PauseHandler)(); typedef int(PauseHandler)();
typedef int(ScreenshotHandler)(int width, int height, unsigned char* buffer, unsigned char* palette); typedef int(ScreenshotHandler)(int width, int height, unsigned char* buffer, unsigned char* palette);
int coreInit(int a1); int inputInit(int a1);
void coreExit(); void inputExit();
int _get_input(); int inputGetInput();
void _process_bk(); void _process_bk();
void enqueueInputEvent(int a1); void enqueueInputEvent(int a1);
void inputEventQueueReset(); void inputEventQueueReset();
@ -25,9 +25,9 @@ void pauseHandlerConfigure(int keyCode, PauseHandler* fn);
void takeScreenshot(); void takeScreenshot();
int screenshotHandlerDefaultImpl(int width, int height, unsigned char* data, unsigned char* palette); int screenshotHandlerDefaultImpl(int width, int height, unsigned char* data, unsigned char* palette);
void screenshotHandlerConfigure(int keyCode, ScreenshotHandler* handler); void screenshotHandlerConfigure(int keyCode, ScreenshotHandler* handler);
unsigned int _get_time(); unsigned int getTicks();
void coreDelayProcessingEvents(unsigned int ms); void inputPauseForTocks(unsigned int ms);
void coreDelay(unsigned int ms); void inputBlockForTocks(unsigned int ms);
unsigned int getTicksSince(unsigned int a1); unsigned int getTicksSince(unsigned int a1);
unsigned int getTicksBetween(unsigned int a1, unsigned int a2); unsigned int getTicksBetween(unsigned int a1, unsigned int a2);
unsigned int _get_bk_time(); unsigned int _get_bk_time();

View File

@ -1366,7 +1366,7 @@ void interfaceBarEndButtonsShow(bool animated)
windowRefreshRect(gInterfaceBarWindow, &gInterfaceBarEndButtonsRect); windowRefreshRect(gInterfaceBarWindow, &gInterfaceBarEndButtonsRect);
} }
time = _get_time(); time = getTicks();
frame++; frame++;
} }
gameMouseRefresh(); gameMouseRefresh();
@ -1421,7 +1421,7 @@ void interfaceBarEndButtonsHide(bool animated)
windowRefreshRect(gInterfaceBarWindow, &gInterfaceBarEndButtonsRect); windowRefreshRect(gInterfaceBarWindow, &gInterfaceBarEndButtonsRect);
} }
time = _get_time(); time = getTicks();
frame--; frame--;
} }
gameMouseRefresh(); gameMouseRefresh();
@ -1808,7 +1808,7 @@ static void interfaceBarSwapHandsAnimatePutAwayTakeOutSequence(int previousWeapo
break; break;
} }
_get_input(); inputGetInput();
} }
gameMouseSetCursor(MOUSE_CURSOR_NONE); gameMouseSetCursor(MOUSE_CURSOR_NONE);
@ -2045,7 +2045,7 @@ static void interfaceRenderCounter(int x, int y, int previousValue, int value, i
blitBufferToBuffer(upSrc, 9, 17, 360, onesDest, 640); blitBufferToBuffer(upSrc, 9, 17, 360, onesDest, 640);
_mouse_info(); _mouse_info();
gameMouseRefresh(); gameMouseRefresh();
coreDelay(delay); inputBlockForTocks(delay);
windowRefreshRect(gInterfaceBarWindow, &numbersRect); windowRefreshRect(gInterfaceBarWindow, &numbersRect);
ones += v49; ones += v49;
@ -2054,7 +2054,7 @@ static void interfaceRenderCounter(int x, int y, int previousValue, int value, i
blitBufferToBuffer(upSrc, 9, 17, 360, tensDest, 640); blitBufferToBuffer(upSrc, 9, 17, 360, tensDest, 640);
_mouse_info(); _mouse_info();
gameMouseRefresh(); gameMouseRefresh();
coreDelay(delay); inputBlockForTocks(delay);
windowRefreshRect(gInterfaceBarWindow, &numbersRect); windowRefreshRect(gInterfaceBarWindow, &numbersRect);
tens += v49; tens += v49;
@ -2063,7 +2063,7 @@ static void interfaceRenderCounter(int x, int y, int previousValue, int value, i
blitBufferToBuffer(upSrc, 9, 17, 360, hundredsDest, 640); blitBufferToBuffer(upSrc, 9, 17, 360, hundredsDest, 640);
_mouse_info(); _mouse_info();
gameMouseRefresh(); gameMouseRefresh();
coreDelay(delay); inputBlockForTocks(delay);
windowRefreshRect(gInterfaceBarWindow, &numbersRect); windowRefreshRect(gInterfaceBarWindow, &numbersRect);
hundreds += v49; hundreds += v49;
@ -2075,19 +2075,19 @@ static void interfaceRenderCounter(int x, int y, int previousValue, int value, i
blitBufferToBuffer(downSrc, 9, 17, 360, hundredsDest, 640); blitBufferToBuffer(downSrc, 9, 17, 360, hundredsDest, 640);
_mouse_info(); _mouse_info();
gameMouseRefresh(); gameMouseRefresh();
coreDelay(delay); inputBlockForTocks(delay);
windowRefreshRect(gInterfaceBarWindow, &numbersRect); windowRefreshRect(gInterfaceBarWindow, &numbersRect);
} }
blitBufferToBuffer(downSrc, 9, 17, 360, tensDest, 640); blitBufferToBuffer(downSrc, 9, 17, 360, tensDest, 640);
coreDelay(delay); inputBlockForTocks(delay);
windowRefreshRect(gInterfaceBarWindow, &numbersRect); windowRefreshRect(gInterfaceBarWindow, &numbersRect);
} }
blitBufferToBuffer(downSrc, 9, 17, 360, onesDest, 640); blitBufferToBuffer(downSrc, 9, 17, 360, onesDest, 640);
_mouse_info(); _mouse_info();
gameMouseRefresh(); gameMouseRefresh();
coreDelay(delay); inputBlockForTocks(delay);
windowRefreshRect(gInterfaceBarWindow, &numbersRect); windowRefreshRect(gInterfaceBarWindow, &numbersRect);
previousValue += change; previousValue += change;
@ -2099,7 +2099,7 @@ static void interfaceRenderCounter(int x, int y, int previousValue, int value, i
blitBufferToBuffer(previousValue >= 0 ? plusSrc : minusSrc, 6, 17, 360, signDest, 640); blitBufferToBuffer(previousValue >= 0 ? plusSrc : minusSrc, 6, 17, 360, signDest, 640);
_mouse_info(); _mouse_info();
gameMouseRefresh(); gameMouseRefresh();
coreDelay(delay); inputBlockForTocks(delay);
windowRefreshRect(gInterfaceBarWindow, &numbersRect); windowRefreshRect(gInterfaceBarWindow, &numbersRect);
} }
} }

View File

@ -172,7 +172,7 @@ static int _busy;
// 0x4670A0 // 0x4670A0
static unsigned int _defaultTimerFunc() static unsigned int _defaultTimerFunc()
{ {
return _get_time(); return getTicks();
} }
// 0x4670B4 // 0x4670B4

View File

@ -409,7 +409,7 @@ static void _interpretFadePaletteBK(unsigned char* oldPalette, unsigned char* ne
int index; int index;
unsigned char palette[256 * 3]; unsigned char palette[256 * 3];
time = _get_time(); time = getTicks();
previousTime = time; previousTime = time;
steps = (int)duration; steps = (int)duration;
step = 0; step = 0;
@ -432,7 +432,7 @@ static void _interpretFadePaletteBK(unsigned char* oldPalette, unsigned char* ne
_process_bk(); _process_bk();
} }
time = _get_time(); time = getTicks();
delta = time - previousTime; delta = time - previousTime;
} }
} }

View File

@ -588,7 +588,7 @@ void inventoryOpen()
inventorySetCursor(INVENTORY_WINDOW_CURSOR_HAND); inventorySetCursor(INVENTORY_WINDOW_CURSOR_HAND);
for (;;) { for (;;) {
int keyCode = _get_input(); int keyCode = inputGetInput();
// SFALL: Close with 'I'. // SFALL: Close with 'I'.
if (keyCode == KEY_ESCAPE || keyCode == KEY_UPPERCASE_I || keyCode == KEY_LOWERCASE_I) { if (keyCode == KEY_ESCAPE || keyCode == KEY_UPPERCASE_I || keyCode == KEY_LOWERCASE_I) {
@ -2096,7 +2096,7 @@ static void _display_body(int fid, int inventoryWindowType)
artUnlock(handle); artUnlock(handle);
} }
gInventoryWindowDudeRotationTimestamp = _get_time(); gInventoryWindowDudeRotationTimestamp = getTicks();
} }
// 0x470A2C // 0x470A2C
@ -2351,7 +2351,7 @@ static void _inven_pickup(int keyCode, int a2)
} }
do { do {
_get_input(); inputGetInput();
_display_body(-1, INVENTORY_WINDOW_TYPE_NORMAL); _display_body(-1, INVENTORY_WINDOW_TYPE_NORMAL);
} while ((mouseGetEvent() & MOUSE_EVENT_LEFT_BUTTON_REPEAT) != 0); } while ((mouseGetEvent() & MOUSE_EVENT_LEFT_BUTTON_REPEAT) != 0);
@ -2622,7 +2622,7 @@ void inventoryOpenUseItemOn(Object* a1)
_display_body(-1, INVENTORY_WINDOW_TYPE_USE_ITEM_ON); _display_body(-1, INVENTORY_WINDOW_TYPE_USE_ITEM_ON);
int keyCode = _get_input(); int keyCode = inputGetInput();
switch (keyCode) { switch (keyCode) {
case KEY_HOME: case KEY_HOME:
_stack_offset[_curr_stack] = 0; _stack_offset[_curr_stack] = 0;
@ -3687,7 +3687,7 @@ static void inventoryWindowOpenContextMenu(int keyCode, int inventoryWindowType)
int mouseState; int mouseState;
do { do {
_get_input(); inputGetInput();
if (inventoryWindowType == INVENTORY_WINDOW_TYPE_NORMAL) { if (inventoryWindowType == INVENTORY_WINDOW_TYPE_NORMAL) {
_display_body(-1, INVENTORY_WINDOW_TYPE_NORMAL); _display_body(-1, INVENTORY_WINDOW_TYPE_NORMAL);
@ -3807,7 +3807,7 @@ static void inventoryWindowOpenContextMenu(int keyCode, int inventoryWindowType)
int menuItemIndex = 0; int menuItemIndex = 0;
int previousMouseY = y; int previousMouseY = y;
while ((mouseGetEvent() & MOUSE_EVENT_LEFT_BUTTON_UP) == 0) { while ((mouseGetEvent() & MOUSE_EVENT_LEFT_BUTTON_UP) == 0) {
_get_input(); inputGetInput();
if (inventoryWindowType == INVENTORY_WINDOW_TYPE_NORMAL) { if (inventoryWindowType == INVENTORY_WINDOW_TYPE_NORMAL) {
_display_body(-1, INVENTORY_WINDOW_TYPE_NORMAL); _display_body(-1, INVENTORY_WINDOW_TYPE_NORMAL);
@ -4207,7 +4207,7 @@ int inventoryOpenLooting(Object* a1, Object* a2)
break; break;
} }
int keyCode = _get_input(); int keyCode = inputGetInput();
if (keyCode == KEY_CTRL_Q || keyCode == KEY_CTRL_X || keyCode == KEY_F10) { if (keyCode == KEY_CTRL_Q || keyCode == KEY_CTRL_X || keyCode == KEY_F10) {
showQuitConfirmationDialog(); showQuitConfirmationDialog();
@ -4540,7 +4540,7 @@ static int _move_inventory(Object* a1, int a2, Object* a3, bool a4)
} }
do { do {
_get_input(); inputGetInput();
} while ((mouseGetEvent() & MOUSE_EVENT_LEFT_BUTTON_REPEAT) != 0); } while ((mouseGetEvent() & MOUSE_EVENT_LEFT_BUTTON_REPEAT) != 0);
if (itemInventoryFrmImage.isLocked()) { if (itemInventoryFrmImage.isLocked()) {
@ -4755,7 +4755,7 @@ static void _barter_move_inventory(Object* a1, int quantity, int a3, int a4, Obj
} }
do { do {
_get_input(); inputGetInput();
} while ((mouseGetEvent() & MOUSE_EVENT_LEFT_BUTTON_REPEAT) != 0); } while ((mouseGetEvent() & MOUSE_EVENT_LEFT_BUTTON_REPEAT) != 0);
if (itemInventoryFrmImage.isLocked()) { if (itemInventoryFrmImage.isLocked()) {
@ -4837,7 +4837,7 @@ static void _barter_move_from_table_inventory(Object* a1, int quantity, int a3,
} }
do { do {
_get_input(); inputGetInput();
} while ((mouseGetEvent() & MOUSE_EVENT_LEFT_BUTTON_REPEAT) != 0); } while ((mouseGetEvent() & MOUSE_EVENT_LEFT_BUTTON_REPEAT) != 0);
if (itemInventoryFrmImage.isLocked()) { if (itemInventoryFrmImage.isLocked()) {
@ -5051,7 +5051,7 @@ void inventoryOpenTrade(int win, Object* a2, Object* a3, Object* a4, int a5)
break; break;
} }
keyCode = _get_input(); keyCode = inputGetInput();
if (keyCode == KEY_CTRL_Q || keyCode == KEY_CTRL_X || keyCode == KEY_F10) { if (keyCode == KEY_CTRL_Q || keyCode == KEY_CTRL_X || keyCode == KEY_F10) {
showQuitConfirmationDialog(); showQuitConfirmationDialog();
} }
@ -5537,7 +5537,7 @@ static int inventoryQuantitySelect(int inventoryWindowType, Object* item, int ma
bool v5 = false; bool v5 = false;
for (;;) { for (;;) {
int keyCode = _get_input(); int keyCode = inputGetInput();
if (keyCode == KEY_ESCAPE) { if (keyCode == KEY_ESCAPE) {
inventoryQuantityWindowFree(inventoryWindowType); inventoryQuantityWindowFree(inventoryWindowType);
return -1; return -1;
@ -5561,7 +5561,7 @@ static int inventoryQuantitySelect(int inventoryWindowType, Object* item, int ma
if (value < max) { if (value < max) {
if (inventoryWindowType == INVENTORY_WINDOW_TYPE_MOVE_ITEMS) { if (inventoryWindowType == INVENTORY_WINDOW_TYPE_MOVE_ITEMS) {
if ((mouseGetEvent() & MOUSE_EVENT_LEFT_BUTTON_REPEAT) != 0) { if ((mouseGetEvent() & MOUSE_EVENT_LEFT_BUTTON_REPEAT) != 0) {
_get_time(); getTicks();
unsigned int delay = 100; unsigned int delay = 100;
while ((mouseGetEvent() & MOUSE_EVENT_LEFT_BUTTON_REPEAT) != 0) { while ((mouseGetEvent() & MOUSE_EVENT_LEFT_BUTTON_REPEAT) != 0) {
@ -5570,11 +5570,11 @@ static int inventoryQuantitySelect(int inventoryWindowType, Object* item, int ma
} }
_draw_amount(value, inventoryWindowType); _draw_amount(value, inventoryWindowType);
_get_input(); inputGetInput();
if (delay > 1) { if (delay > 1) {
delay--; delay--;
coreDelayProcessingEvents(delay); inputPauseForTocks(delay);
} }
} }
} else { } else {
@ -5594,7 +5594,7 @@ static int inventoryQuantitySelect(int inventoryWindowType, Object* item, int ma
if (value > min) { if (value > min) {
if (inventoryWindowType == INVENTORY_WINDOW_TYPE_MOVE_ITEMS) { if (inventoryWindowType == INVENTORY_WINDOW_TYPE_MOVE_ITEMS) {
if ((mouseGetEvent() & MOUSE_EVENT_LEFT_BUTTON_REPEAT) != 0) { if ((mouseGetEvent() & MOUSE_EVENT_LEFT_BUTTON_REPEAT) != 0) {
_get_time(); getTicks();
unsigned int delay = 100; unsigned int delay = 100;
while ((mouseGetEvent() & MOUSE_EVENT_LEFT_BUTTON_REPEAT) != 0) { while ((mouseGetEvent() & MOUSE_EVENT_LEFT_BUTTON_REPEAT) != 0) {
@ -5603,11 +5603,11 @@ static int inventoryQuantitySelect(int inventoryWindowType, Object* item, int ma
} }
_draw_amount(value, inventoryWindowType); _draw_amount(value, inventoryWindowType);
_get_input(); inputGetInput();
if (delay > 1) { if (delay > 1) {
delay--; delay--;
coreDelayProcessingEvents(delay); inputPauseForTocks(delay);
} }
} }
} else { } else {

View File

@ -108,7 +108,7 @@ int keyboardInit()
_kb_init_lock_status(); _kb_init_lock_status();
keyboardSetLayout(KEYBOARD_LAYOUT_QWERTY); keyboardSetLayout(KEYBOARD_LAYOUT_QWERTY);
_kb_idle_start_time = _get_time(); _kb_idle_start_time = getTicks();
return 0; return 0;
} }

View File

@ -171,7 +171,7 @@ int lipsStart()
int speechVolume = speechGetVolume(); int speechVolume = speechGetVolume();
soundSetVolume(gLipsData.sound, (int)(speechVolume * 0.69)); soundSetVolume(gLipsData.sound, (int)(speechVolume * 0.69));
_speechStartTime = _get_time(); _speechStartTime = getTicks();
if (soundPlay(gLipsData.sound) != 0) { if (soundPlay(gLipsData.sound) != 0) {
debugPrint("Failed play!\n"); debugPrint("Failed play!\n");

View File

@ -471,8 +471,8 @@ int lsgSaveGame(int mode)
int rc = -1; int rc = -1;
int v103 = -1; int v103 = -1;
while (rc == -1) { while (rc == -1) {
int tick = _get_time(); int tick = getTicks();
int keyCode = _get_input(); int keyCode = inputGetInput();
int v37 = 0; int v37 = 0;
int v102 = 0; int v102 = 0;
@ -884,8 +884,8 @@ int lsgLoadGame(int mode)
int rc = -1; int rc = -1;
while (rc == -1) { while (rc == -1) {
while (rc == -1) { while (rc == -1) {
int v37 = _get_time(); int v37 = getTicks();
int keyCode = _get_input(); int keyCode = inputGetInput();
int v39 = 0; int v39 = 0;
int v107 = 0; int v107 = 0;
int v108 = -1; int v108 = -1;
@ -986,7 +986,7 @@ int lsgLoadGame(int mode)
int v106 = 0; int v106 = 0;
int v109 = 0; int v109 = 0;
do { do {
int v45 = _get_time(); int v45 = getTicks();
int v44 = v109 + 1; int v44 = v109 + 1;
if ((v106 == 0 && v44 == 1) || (v106 == 1 && v109 > 14.4)) { if ((v106 == 0 && v44 == 1) || (v106 == 1 && v109 > 14.4)) {
@ -1048,7 +1048,7 @@ int lsgLoadGame(int mode)
while (getTicksSince(v45) < 1000 / 24) { } while (getTicksSince(v45) < 1000 / 24) { }
} }
keyCode = _get_input(); keyCode = inputGetInput();
} while (keyCode != 505 && keyCode != 503); } while (keyCode != 505 && keyCode != 503);
} else { } else {
if (v39 != 0) { if (v39 != 0) {
@ -2127,9 +2127,9 @@ static int _get_input_str2(int win, int doneKeyCode, int cancelKeyCode, char* de
int rc = 1; int rc = 1;
while (rc == 1) { while (rc == 1) {
int tick = _get_time(); int tick = getTicks();
int keyCode = _get_input(); int keyCode = inputGetInput();
if ((keyCode & 0x80000000) == 0) { if ((keyCode & 0x80000000) == 0) {
v1++; v1++;
} }

View File

@ -443,7 +443,7 @@ static void mainLoop(FpsLimiter& fpsLimiter)
while (_game_user_wants_to_quit == 0) { while (_game_user_wants_to_quit == 0) {
fpsLimiter.mark(); fpsLimiter.mark();
int keyCode = _get_input(); int keyCode = inputGetInput();
gameHandleKey(keyCode, false); gameHandleKey(keyCode, false);
scriptsHandleRequests(); scriptsHandleRequests();
@ -614,7 +614,7 @@ static void showDeath()
} }
while (mouseGetEvent() != 0) { while (mouseGetEvent() != 0) {
_get_input(); inputGetInput();
} }
keyboardReset(); keyboardReset();
@ -665,12 +665,12 @@ static void showDeath()
// SFALL: Fix the playback of the speech sound file for the death // SFALL: Fix the playback of the speech sound file for the death
// screen. // screen.
coreDelay(100); inputBlockForTocks(100);
unsigned int time = _get_time(); unsigned int time = getTicks();
int keyCode; int keyCode;
do { do {
keyCode = _get_input(); keyCode = inputGetInput();
} while (keyCode == -1 && !_main_death_voiceover_done && getTicksSince(time) < delay); } while (keyCode == -1 && !_main_death_voiceover_done && getTicksSince(time) < delay);
speechSetEndCallback(NULL); speechSetEndCallback(NULL);
@ -678,11 +678,11 @@ static void showDeath()
speechDelete(); speechDelete();
while (mouseGetEvent() != 0) { while (mouseGetEvent() != 0) {
_get_input(); inputGetInput();
} }
if (keyCode == -1) { if (keyCode == -1) {
coreDelayProcessingEvents(500); inputPauseForTocks(500);
} }
paletteFadeTo(gPaletteBlack); paletteFadeTo(gPaletteBlack);
@ -1016,13 +1016,13 @@ static int mainMenuWindowHandleEvents(FpsLimiter& fpsLimiter)
mouseShowCursor(); mouseShowCursor();
} }
unsigned int tick = _get_time(); unsigned int tick = getTicks();
int rc = -1; int rc = -1;
while (rc == -1) { while (rc == -1) {
fpsLimiter.mark(); fpsLimiter.mark();
int keyCode = _get_input(); int keyCode = inputGetInput();
for (int buttonIndex = 0; buttonIndex < MAIN_MENU_BUTTON_COUNT; buttonIndex++) { for (int buttonIndex = 0; buttonIndex < MAIN_MENU_BUTTON_COUNT; buttonIndex++) {
if (keyCode == gMainMenuButtonKeyBindings[buttonIndex] || keyCode == toupper(gMainMenuButtonKeyBindings[buttonIndex])) { if (keyCode == gMainMenuButtonKeyBindings[buttonIndex] || keyCode == toupper(gMainMenuButtonKeyBindings[buttonIndex])) {

View File

@ -590,7 +590,7 @@ int mapScroll(int dx, int dy)
return -2; return -2;
} }
gIsoWindowScrollTimestamp = _get_time(); gIsoWindowScrollTimestamp = getTicks();
int screenDx = dx * 32; int screenDx = dx * 32;
int screenDy = dy * 24; int screenDy = dy * 24;

View File

@ -145,7 +145,7 @@ int mouseInit()
gMouseCursorY = _scr_size.bottom / 2; gMouseCursorY = _scr_size.bottom / 2;
_raw_x = _scr_size.right / 2; _raw_x = _scr_size.right / 2;
_raw_y = _scr_size.bottom / 2; _raw_y = _scr_size.bottom / 2;
_mouse_idle_start_time = _get_time(); _mouse_idle_start_time = getTicks();
return 0; return 0;
} }
@ -266,7 +266,7 @@ static void _mouse_anim()
static unsigned int ticker = 0; static unsigned int ticker = 0;
if (getTicksSince(ticker) >= _mouse_speed) { if (getTicksSince(ticker) >= _mouse_speed) {
ticker = _get_time(); ticker = getTicks();
if (++_mouse_curr_frame == _mouse_num_frames) { if (++_mouse_curr_frame == _mouse_num_frames) {
_mouse_curr_frame = 0; _mouse_curr_frame = 0;
@ -466,7 +466,7 @@ void _mouse_simulate_input(int delta_x, int delta_y, int buttons)
} else { } else {
if (gMouseButtonsState == 0) { if (gMouseButtonsState == 0) {
if (!_mouse_idling) { if (!_mouse_idling) {
_mouse_idle_start_time = _get_time(); _mouse_idle_start_time = getTicks();
_mouse_idling = 1; _mouse_idling = 1;
} }
@ -489,7 +489,7 @@ void _mouse_simulate_input(int delta_x, int delta_y, int buttons)
if (getTicksSince(previousLeftButtonTimestamp) > BUTTON_REPEAT_TIME) { if (getTicksSince(previousLeftButtonTimestamp) > BUTTON_REPEAT_TIME) {
gMouseEvent |= MOUSE_EVENT_LEFT_BUTTON_DOWN; gMouseEvent |= MOUSE_EVENT_LEFT_BUTTON_DOWN;
previousLeftButtonTimestamp = _get_time(); previousLeftButtonTimestamp = getTicks();
} }
} else { } else {
gMouseEvent |= MOUSE_EVENT_LEFT_BUTTON_UP; gMouseEvent |= MOUSE_EVENT_LEFT_BUTTON_UP;
@ -497,7 +497,7 @@ void _mouse_simulate_input(int delta_x, int delta_y, int buttons)
} else { } else {
if ((buttons & 0x01) != 0) { if ((buttons & 0x01) != 0) {
gMouseEvent |= MOUSE_EVENT_LEFT_BUTTON_DOWN; gMouseEvent |= MOUSE_EVENT_LEFT_BUTTON_DOWN;
previousLeftButtonTimestamp = _get_time(); previousLeftButtonTimestamp = getTicks();
} }
} }
@ -506,7 +506,7 @@ void _mouse_simulate_input(int delta_x, int delta_y, int buttons)
gMouseEvent |= MOUSE_EVENT_RIGHT_BUTTON_REPEAT; gMouseEvent |= MOUSE_EVENT_RIGHT_BUTTON_REPEAT;
if (getTicksSince(previousRightButtonTimestamp) > BUTTON_REPEAT_TIME) { if (getTicksSince(previousRightButtonTimestamp) > BUTTON_REPEAT_TIME) {
gMouseEvent |= MOUSE_EVENT_RIGHT_BUTTON_DOWN; gMouseEvent |= MOUSE_EVENT_RIGHT_BUTTON_DOWN;
previousRightButtonTimestamp = _get_time(); previousRightButtonTimestamp = getTicks();
} }
} else { } else {
gMouseEvent |= MOUSE_EVENT_RIGHT_BUTTON_UP; gMouseEvent |= MOUSE_EVENT_RIGHT_BUTTON_UP;
@ -514,7 +514,7 @@ void _mouse_simulate_input(int delta_x, int delta_y, int buttons)
} else { } else {
if (buttons & 0x02) { if (buttons & 0x02) {
gMouseEvent |= MOUSE_EVENT_RIGHT_BUTTON_DOWN; gMouseEvent |= MOUSE_EVENT_RIGHT_BUTTON_DOWN;
previousRightButtonTimestamp = _get_time(); previousRightButtonTimestamp = getTicks();
} }
} }

View File

@ -58,7 +58,7 @@ int mouseManagerRateProviderDefaultImpl()
// 0x48525C // 0x48525C
int mouseManagerTimeProviderDefaultImpl() int mouseManagerTimeProviderDefaultImpl()
{ {
return _get_time(); return getTicks();
} }
// 0x485288 // 0x485288

View File

@ -911,7 +911,7 @@ static bool _localMovieCallback()
_movieCallback(); _movieCallback();
} }
return _get_input() != -1; return inputGetInput() != -1;
} }
// 0x487AC8 // 0x487AC8

View File

@ -471,7 +471,7 @@ int showOptionsWithInitialKeyCode(int initialKeyCode)
int rc = -1; int rc = -1;
while (rc == -1) { while (rc == -1) {
int keyCode = _get_input(); int keyCode = inputGetInput();
bool showPreferences = false; bool showPreferences = false;
if (initialKeyCode != -1) { if (initialKeyCode != -1) {
@ -823,7 +823,7 @@ int showPause(bool a1)
bool done = false; bool done = false;
while (!done) { while (!done) {
int keyCode = _get_input(); int keyCode = inputGetInput();
switch (keyCode) { switch (keyCode) {
case KEY_PLUS: case KEY_PLUS:
case KEY_EQUAL: case KEY_EQUAL:
@ -1700,7 +1700,7 @@ static int _do_prefscreen()
int rc = -1; int rc = -1;
while (rc == -1) { while (rc == -1) {
int eventCode = _get_input(); int eventCode = inputGetInput();
switch (eventCode) { switch (eventCode) {
case KEY_RETURN: case KEY_RETURN:
@ -1824,7 +1824,7 @@ static void _DoThing(int eventCode)
if (valueChanged) { if (valueChanged) {
soundPlayFile("ib3p1xx1"); soundPlayFile("ib3p1xx1");
coreDelay(70); inputBlockForTocks(70);
soundPlayFile("ib3lu1x1"); soundPlayFile("ib3lu1x1");
_UpdateThing(preferenceIndex); _UpdateThing(preferenceIndex);
windowRefresh(gPreferencesWindow); windowRefresh(gPreferencesWindow);
@ -1858,7 +1858,7 @@ static void _DoThing(int eventCode)
if (valueChanged) { if (valueChanged) {
soundPlayFile("ib2p1xx1"); soundPlayFile("ib2p1xx1");
coreDelay(70); inputBlockForTocks(70);
soundPlayFile("ib2lu1x1"); soundPlayFile("ib2lu1x1");
_UpdateThing(preferenceIndex); _UpdateThing(preferenceIndex);
windowRefresh(gPreferencesWindow); windowRefresh(gPreferencesWindow);
@ -1897,9 +1897,9 @@ static void _DoThing(int eventCode)
int sfxVolumeExample = 0; int sfxVolumeExample = 0;
int speechVolumeExample = 0; int speechVolumeExample = 0;
while (true) { while (true) {
_get_input(); inputGetInput();
int tick = _get_time(); int tick = getTicks();
mouseGetPositionInWindow(gPreferencesWindow, &x, &y); mouseGetPositionInWindow(gPreferencesWindow, &x, &y);

View File

@ -32,7 +32,7 @@ void paletteInit()
memset(gPaletteWhite, 63, 256 * 3); memset(gPaletteWhite, 63, 256 * 3);
memcpy(gPalette, _cmap, 256 * 3); memcpy(gPalette, _cmap, 256 * 3);
unsigned int tick = _get_time(); unsigned int tick = getTicks();
if (backgroundSoundIsEnabled() || speechIsEnabled()) { if (backgroundSoundIsEnabled() || speechIsEnabled()) {
colorPaletteSetTransitionCallback(soundContinueAll); colorPaletteSetTransitionCallback(soundContinueAll);
} }

View File

@ -412,10 +412,10 @@ int pipboyOpen(int intent)
} }
mouseGetPositionInWindow(gPipboyWindow, &gPipboyPreviousMouseX, &gPipboyPreviousMouseY); mouseGetPositionInWindow(gPipboyWindow, &gPipboyPreviousMouseX, &gPipboyPreviousMouseY);
gPipboyLastEventTimestamp = _get_time(); gPipboyLastEventTimestamp = getTicks();
while (true) { while (true) {
int keyCode = _get_input(); int keyCode = inputGetInput();
if (intent == PIPBOY_OPEN_INTENT_REST) { if (intent == PIPBOY_OPEN_INTENT_REST) {
keyCode = 504; keyCode = 504;
@ -425,14 +425,14 @@ int pipboyOpen(int intent)
mouseGetPositionInWindow(gPipboyWindow, &gPipboyMouseX, &gPipboyMouseY); mouseGetPositionInWindow(gPipboyWindow, &gPipboyMouseX, &gPipboyMouseY);
if (keyCode != -1 || gPipboyMouseX != gPipboyPreviousMouseX || gPipboyMouseY != gPipboyPreviousMouseY) { if (keyCode != -1 || gPipboyMouseX != gPipboyPreviousMouseX || gPipboyMouseY != gPipboyPreviousMouseY) {
gPipboyLastEventTimestamp = _get_time(); gPipboyLastEventTimestamp = getTicks();
gPipboyPreviousMouseX = gPipboyMouseX; gPipboyPreviousMouseX = gPipboyMouseX;
gPipboyPreviousMouseY = gPipboyMouseY; gPipboyPreviousMouseY = gPipboyMouseY;
} else { } else {
if (_get_time() - gPipboyLastEventTimestamp > PIPBOY_IDLE_TIMEOUT) { if (getTicks() - gPipboyLastEventTimestamp > PIPBOY_IDLE_TIMEOUT) {
pipboyRenderScreensaver(); pipboyRenderScreensaver();
gPipboyLastEventTimestamp = _get_time(); gPipboyLastEventTimestamp = getTicks();
mouseGetPositionInWindow(gPipboyWindow, &gPipboyPreviousMouseX, &gPipboyPreviousMouseY); mouseGetPositionInWindow(gPipboyWindow, &gPipboyPreviousMouseX, &gPipboyPreviousMouseY);
} }
} }
@ -906,7 +906,7 @@ static void pipboyWindowHandleStatus(int a1)
pipboyWindowRenderQuestLocationList(a1); pipboyWindowRenderQuestLocationList(a1);
pipboyWindowRenderHolodiskList(-1); pipboyWindowRenderHolodiskList(-1);
windowRefreshRect(gPipboyWindow, &gPipboyWindowContentRect); windowRefreshRect(gPipboyWindow, &gPipboyWindowContentRect);
coreDelayProcessingEvents(200); inputPauseForTocks(200);
_stat_flag = 1; _stat_flag = 1;
} else { } else {
if (gPipboyWindowHolodisksCount != 0 && gPipboyWindowHolodisksCount >= a1 && gPipboyMouseX > 429) { if (gPipboyWindowHolodisksCount != 0 && gPipboyWindowHolodisksCount >= a1 && gPipboyMouseX > 429) {
@ -936,7 +936,7 @@ static void pipboyWindowHandleStatus(int a1)
pipboyWindowRenderHolodiskList(a1); pipboyWindowRenderHolodiskList(a1);
pipboyWindowRenderQuestLocationList(-1); pipboyWindowRenderQuestLocationList(-1);
windowRefreshRect(gPipboyWindow, &gPipboyWindowContentRect); windowRefreshRect(gPipboyWindow, &gPipboyWindowContentRect);
coreDelayProcessingEvents(200); inputPauseForTocks(200);
pipboyWindowDestroyButtons(); pipboyWindowDestroyButtons();
pipboyRenderHolodiskText(); pipboyRenderHolodiskText();
pipboyWindowCreateButtons(0, 0, true); pipboyWindowCreateButtons(0, 0, true);
@ -973,7 +973,7 @@ static void pipboyWindowHandleStatus(int a1)
pipboyDrawText(text2, PIPBOY_TEXT_ALIGNMENT_RIGHT_COLUMN_CENTER, _colorTable[992]); pipboyDrawText(text2, PIPBOY_TEXT_ALIGNMENT_RIGHT_COLUMN_CENTER, _colorTable[992]);
windowRefreshRect(gPipboyWindow, &gPipboyWindowContentRect); windowRefreshRect(gPipboyWindow, &gPipboyWindowContentRect);
coreDelayProcessingEvents(200); inputPauseForTocks(200);
pipboyWindowHandleStatus(1024); pipboyWindowHandleStatus(1024);
} }
} else { } else {
@ -997,7 +997,7 @@ static void pipboyWindowHandleStatus(int a1)
pipboyDrawText(text2, PIPBOY_TEXT_ALIGNMENT_RIGHT_COLUMN_CENTER, _colorTable[992]); pipboyDrawText(text2, PIPBOY_TEXT_ALIGNMENT_RIGHT_COLUMN_CENTER, _colorTable[992]);
windowRefreshRect(gPipboyWindow, &gPipboyWindowContentRect); windowRefreshRect(gPipboyWindow, &gPipboyWindowContentRect);
coreDelayProcessingEvents(200); inputPauseForTocks(200);
_view_page += 1; _view_page += 1;
@ -1027,7 +1027,7 @@ static void pipboyWindowHandleStatus(int a1)
pipboyDrawText(text2, PIPBOY_TEXT_ALIGNMENT_RIGHT_COLUMN_CENTER, _colorTable[992]); pipboyDrawText(text2, PIPBOY_TEXT_ALIGNMENT_RIGHT_COLUMN_CENTER, _colorTable[992]);
windowRefreshRect(gPipboyWindow, &gPipboyWindowContentRect); windowRefreshRect(gPipboyWindow, &gPipboyWindowContentRect);
coreDelayProcessingEvents(200); inputPauseForTocks(200);
_view_page -= 1; _view_page -= 1;
@ -1060,7 +1060,7 @@ static void pipboyWindowHandleStatus(int a1)
pipboyDrawText(text2, PIPBOY_TEXT_ALIGNMENT_RIGHT_COLUMN_CENTER, _colorTable[992]); pipboyDrawText(text2, PIPBOY_TEXT_ALIGNMENT_RIGHT_COLUMN_CENTER, _colorTable[992]);
windowRefreshRect(gPipboyWindow, &gPipboyWindowContentRect); windowRefreshRect(gPipboyWindow, &gPipboyWindowContentRect);
coreDelayProcessingEvents(200); inputPauseForTocks(200);
if (_view_page <= 0) { if (_view_page <= 0) {
pipboyWindowHandleStatus(1024); pipboyWindowHandleStatus(1024);
@ -1078,7 +1078,7 @@ static void pipboyWindowHandleStatus(int a1)
soundPlayFile("ib1p1xx1"); soundPlayFile("ib1p1xx1");
pipboyDrawBackButton(_colorTable[32747]); pipboyDrawBackButton(_colorTable[32747]);
windowRefreshRect(gPipboyWindow, &gPipboyWindowContentRect); windowRefreshRect(gPipboyWindow, &gPipboyWindowContentRect);
coreDelayProcessingEvents(200); inputPauseForTocks(200);
pipboyWindowHandleStatus(1024); pipboyWindowHandleStatus(1024);
} }
@ -1679,7 +1679,7 @@ static void pipboyHandleVideoArchive(int a1)
fontSetCurrent(101); fontSetCurrent(101);
gPipboyLastEventTimestamp = _get_time(); gPipboyLastEventTimestamp = getTicks();
pipboyRenderVideoArchive(-1); pipboyRenderVideoArchive(-1);
} }
} }
@ -1967,7 +1967,7 @@ static bool pipboyRest(int hours, int minutes, int duration)
break; break;
} }
unsigned int start = _get_time(); unsigned int start = getTicks();
unsigned int v6 = (unsigned int)((double)v5 / v4 * ((double)minutes * 600.0) + (double)gameTime); unsigned int v6 = (unsigned int)((double)v5 / v4 * ((double)minutes * 600.0) + (double)gameTime);
unsigned int nextEventTime = queueGetNextEventTime(); unsigned int nextEventTime = queueGetNextEventTime();
@ -1987,7 +1987,7 @@ static bool pipboyRest(int hours, int minutes, int duration)
if (!rc) { if (!rc) {
gameTimeSetTime(v6); gameTimeSetTime(v6);
if (_get_input() == KEY_ESCAPE || _game_user_wants_to_quit != 0) { if (inputGetInput() == KEY_ESCAPE || _game_user_wants_to_quit != 0) {
rc = true; rc = true;
} }
@ -2024,9 +2024,9 @@ static bool pipboyRest(int hours, int minutes, int duration)
break; break;
} }
unsigned int start = _get_time(); unsigned int start = getTicks();
if (_get_input() == KEY_ESCAPE || _game_user_wants_to_quit != 0) { if (inputGetInput() == KEY_ESCAPE || _game_user_wants_to_quit != 0) {
rc = true; rc = true;
} }
@ -2237,10 +2237,10 @@ static int pipboyRenderScreensaver()
int v31 = 50; int v31 = 50;
while (true) { while (true) {
unsigned int time = _get_time(); unsigned int time = getTicks();
mouseGetPositionInWindow(gPipboyWindow, &gPipboyMouseX, &gPipboyMouseY); mouseGetPositionInWindow(gPipboyWindow, &gPipboyMouseX, &gPipboyMouseY);
if (_get_input() != -1 || gPipboyPreviousMouseX != gPipboyMouseX || gPipboyPreviousMouseY != gPipboyMouseY) { if (inputGetInput() != -1 || gPipboyPreviousMouseX != gPipboyMouseX || gPipboyPreviousMouseY != gPipboyMouseY) {
break; break;
} }

View File

@ -90,14 +90,14 @@ void selfrunPlaybackLoop(SelfrunData* selfrunData)
} }
while (gSelfrunState == SELFRUN_STATE_PLAYING) { while (gSelfrunState == SELFRUN_STATE_PLAYING) {
int keyCode = _get_input(); int keyCode = inputGetInput();
if (keyCode != selfrunData->stopKeyCode) { if (keyCode != selfrunData->stopKeyCode) {
gameHandleKey(keyCode, false); gameHandleKey(keyCode, false);
} }
} }
while (mouseGetEvent() != 0) { while (mouseGetEvent() != 0) {
_get_input(); inputGetInput();
} }
if (cursorWasHidden) { if (cursorWasHidden) {
@ -156,7 +156,7 @@ void selfrunRecordingLoop(SelfrunData* selfrunData)
bool done = false; bool done = false;
while (!done) { while (!done) {
int keyCode = _get_input(); int keyCode = inputGetInput();
if (keyCode == selfrunData->stopKeyCode) { if (keyCode == selfrunData->stopKeyCode) {
vcrStop(); vcrStop();
_game_user_wants_to_quit = 2; _game_user_wants_to_quit = 2;

View File

@ -116,7 +116,7 @@ int skilldexOpen()
int rc = -1; int rc = -1;
while (rc == -1) { while (rc == -1) {
int keyCode = _get_input(); int keyCode = inputGetInput();
// SFALL: Close with 'S'. // SFALL: Close with 'S'.
if (keyCode == KEY_ESCAPE || keyCode == KEY_UPPERCASE_S || keyCode == KEY_LOWERCASE_S || keyCode == 500 || _game_user_wants_to_quit != 0) { if (keyCode == KEY_ESCAPE || keyCode == KEY_UPPERCASE_S || keyCode == KEY_LOWERCASE_S || keyCode == 500 || _game_user_wants_to_quit != 0) {
@ -130,7 +130,7 @@ int skilldexOpen()
} }
if (rc != 0) { if (rc != 0) {
coreDelay(1000 / 9); inputBlockForTocks(1000 / 9);
} }
skilldexWindowFree(); skilldexWindowFree();

View File

@ -102,7 +102,7 @@ bool vcrRecord(const char* fileName)
_vcr_counter = 1; _vcr_counter = 1;
_vcr_buffer_index++; _vcr_buffer_index++;
_vcr_start_time = _get_time(); _vcr_start_time = getTicks();
keyboardReset(); keyboardReset();
gVcrState = VCR_STATE_RECORDING; gVcrState = VCR_STATE_RECORDING;
@ -151,7 +151,7 @@ bool vcrPlay(const char* fileName, unsigned int terminationFlags, VcrPlaybackCom
gVcrTerminateFlags = 0; gVcrTerminateFlags = 0;
_vcr_counter = 0; _vcr_counter = 0;
_vcr_time = 0; _vcr_time = 0;
_vcr_start_time = _get_time(); _vcr_start_time = getTicks();
gVcrState = VCR_STATE_PLAYING; gVcrState = VCR_STATE_PLAYING;
stru_6AD940.time = 0; stru_6AD940.time = 0;
stru_6AD940.counter = 0; stru_6AD940.counter = 0;
@ -257,7 +257,7 @@ int vcrUpdate()
mouseShowCursor(); mouseShowCursor();
keyboardReset(); keyboardReset();
gVcrTerminateFlags = gVcrRequestedTerminationFlags; gVcrTerminateFlags = gVcrRequestedTerminationFlags;
_vcr_start_time = _get_time(); _vcr_start_time = getTicks();
_vcr_counter = 0; _vcr_counter = 0;
break; break;
case VCR_ENTRY_TYPE_KEYBOARD_EVENT: case VCR_ENTRY_TYPE_KEYBOARD_EVENT:

View File

@ -491,7 +491,7 @@ bool _windowActivateRegion(const char* regionName, int a2)
// 0x4B6ED0 // 0x4B6ED0
int _getInput() int _getInput()
{ {
int keyCode = _get_input(); int keyCode = inputGetInput();
if (keyCode == KEY_CTRL_Q || keyCode == KEY_CTRL_X || keyCode == KEY_F10) { if (keyCode == KEY_CTRL_Q || keyCode == KEY_CTRL_X || keyCode == KEY_F10) {
showQuitConfirmationDialog(); showQuitConfirmationDialog();
} }

View File

@ -213,7 +213,7 @@ int windowManagerInit(VideoSystemInitProc* videoSystemInitProc, VideoSystemExitP
_GNW_debug_init(); _GNW_debug_init();
if (coreInit(a3) == -1) { if (inputInit(a3) == -1) {
return WINDOW_MANAGER_ERR_INITIALIZING_INPUT; return WINDOW_MANAGER_ERR_INITIALIZING_INPUT;
} }
@ -292,7 +292,7 @@ void windowManagerExit(void)
gVideoSystemExitProc(); gVideoSystemExitProc();
} }
coreExit(); inputExit();
_GNW_rect_exit(); _GNW_rect_exit();
textFontsExit(); textFontsExit();
_colorsClose(); _colorsClose();

View File

@ -324,7 +324,7 @@ int _win_list_select_at(const char* title, char** items, int itemsLength, ListSe
// Relative to `scrollOffset`. // Relative to `scrollOffset`.
int previousSelectedItemIndex = -1; int previousSelectedItemIndex = -1;
while (1) { while (1) {
int keyCode = _get_input(); int keyCode = inputGetInput();
int mouseX; int mouseX;
int mouseY; int mouseY;
mouseGetPosition(&mouseX, &mouseY); mouseGetPosition(&mouseX, &mouseY);
@ -662,7 +662,7 @@ int _win_msg(const char* string, int x, int y, int flags)
windowRefresh(win); windowRefresh(win);
while (_get_input() != KEY_ESCAPE) { while (inputGetInput() != KEY_ESCAPE) {
} }
windowDestroy(win); windowDestroy(win);
@ -1025,7 +1025,7 @@ int _win_input_str(int win, char* dest, int maxLength, int x, int y, int textCol
// decremented in the loop body when key is not handled. // decremented in the loop body when key is not handled.
bool isFirstKey = true; bool isFirstKey = true;
for (; cursorPos <= maxLength; cursorPos++) { for (; cursorPos <= maxLength; cursorPos++) {
int keyCode = _get_input(); int keyCode = inputGetInput();
if (keyCode != -1) { if (keyCode != -1) {
if (keyCode == KEY_ESCAPE) { if (keyCode == KEY_ESCAPE) {
dest[cursorPos] = '\0'; dest[cursorPos] = '\0';

View File

@ -2949,8 +2949,8 @@ static int wmWorldMapFunc(int a1)
int rc = 0; int rc = 0;
for (;;) { for (;;) {
int keyCode = _get_input(); int keyCode = inputGetInput();
unsigned int tick = _get_time(); unsigned int tick = getTicks();
int mouseX; int mouseX;
int mouseY; int mouseY;
@ -3272,7 +3272,7 @@ static void wmCheckGameEvents()
// 0x4C0634 // 0x4C0634
static int wmRndEncounterOccurred() static int wmRndEncounterOccurred()
{ {
unsigned int v0 = _get_time(); unsigned int v0 = getTicks();
if (getTicksBetween(v0, wmLastRndTime) < 1500) { if (getTicksBetween(v0, wmLastRndTime) < 1500) {
return 0; return 0;
} }
@ -3308,7 +3308,7 @@ static int wmRndEncounterOccurred()
return -1; return -1;
} }
coreDelay(200); inputBlockForTocks(200);
} }
wmGenData.encounterMapId = v26; wmGenData.encounterMapId = v26;
@ -3390,7 +3390,7 @@ static int wmRndEncounterOccurred()
return -1; return -1;
} }
coreDelay(200); inputBlockForTocks(200);
} }
if (wmGenData.isInCar) { if (wmGenData.isInCar) {
@ -4414,7 +4414,7 @@ static int wmInterfaceInit()
{ {
int fid; int fid;
wmLastRndTime = _get_time(); wmLastRndTime = getTicks();
// SFALL: Fix default worldmap font. // SFALL: Fix default worldmap font.
// CE: This setting affects only city names. In Sfall it's configurable via // CE: This setting affects only city names. In Sfall it's configurable via
@ -5724,7 +5724,7 @@ static int wmTownMapFunc(int* mapIdxPtr)
CityInfo* city = &(wmAreaInfoList[wmGenData.currentAreaId]); CityInfo* city = &(wmAreaInfoList[wmGenData.currentAreaId]);
for (;;) { for (;;) {
int keyCode = _get_input(); int keyCode = inputGetInput();
if (keyCode == KEY_CTRL_Q || keyCode == KEY_CTRL_X || keyCode == KEY_F10) { if (keyCode == KEY_CTRL_Q || keyCode == KEY_CTRL_X || keyCode == KEY_F10) {
showQuitConfirmationDialog(); showQuitConfirmationDialog();
} }