CHAMBER: Renames in input.h and invent.h

This commit is contained in:
Eugene Sandulenko committed 2023-02-19 23:51:30 +01:00
1 parent 7672a5632e
commit 505459a8a3
9 files changed
+66 -66

No files matched your search

+1 -1
View File
@@ -150,7 +150,7 @@ void switchToTextMode(void) {
}
void waitVBlank(void) {
PollInput();
pollInput();
g_system->delayMillis(10);
}
+1 -1
View File
@@ -196,7 +196,7 @@ void promptWait(void) {
cursor_anim_ticks = ticks;
showPromptAnim();
}
PollInputButtonsOnly();
pollInputButtonsOnly();
if (g_vm->_shouldQuit)
break;
+17 -17
View File
@@ -55,7 +55,7 @@ byte accell_countdown;
uint16 accelleration = 1;
byte mouseButtons = 0;
void PollDiscrete(void);
void pollDiscrete(void);
byte ChamberEngine::readKeyboardChar() {
Common::Event event;
@@ -81,10 +81,10 @@ byte ChamberEngine::readKeyboardChar() {
}
}
void ClearKeyboard(void) {
void clearKeyboard(void) {
}
void SetInputButtons(byte keys) {
void setInputButtons(byte keys) {
if (keys & 2)
right_button = ~0;
if (keys & 1)
@@ -93,13 +93,13 @@ void SetInputButtons(byte keys) {
buttons_repeat = keys;
}
byte PollMouse(void) {
PollInput();
byte pollMouse(void) {
pollInput();
return buttons;
}
byte PollKeyboard(void) {
byte pollKeyboard(void) {
byte direction = key_direction;
if (direction && direction == key_direction_old) {
if (++accell_countdown == 10) {
@@ -142,7 +142,7 @@ byte PollKeyboard(void) {
/*
Show game exit confirmation dialog and get user's input
*/
int16 AskQuitGame(void) {
int16 askQuitGame(void) {
/*EU version comes without requited text string*/
if (g_vm->getLanguage() != Common::EN_USA)
return 0;
@@ -181,11 +181,11 @@ int16 AskQuitGame(void) {
return quit;
}
void PollInputButtonsOnly() {
PollInput();
void pollInputButtonsOnly() {
pollInput();
}
void PollInput(void) {
void pollInput(void) {
Common::Event event;
while (g_system->getEventManager()->pollEvent(event)) {
switch (event.type) {
@@ -194,7 +194,7 @@ void PollInput(void) {
mouseButtons |= 1;
else if (event.kbd.keycode == Common::KEYCODE_ESCAPE) {
if (g_vm->getLanguage() == Common::EN_USA) {
if (AskQuitGame() != 0)
if (askQuitGame() != 0)
g_vm->_shouldQuit = true;
}
}
@@ -236,16 +236,16 @@ void PollInput(void) {
}
}
SetInputButtons(mouseButtons);
setInputButtons(mouseButtons);
}
void ProcessInput(void) {
PollInput();
void processInput(void) {
pollInput();
updateCursor();
drawCursor(frontbuffer);
}
void KeyboardIsr() {
void keyboardIsr() {
warning("STUB: KeyboardIsr()");
#if 0
byte scan, strobe;
@@ -290,11 +290,11 @@ void KeyboardIsr() {
#endif
}
void InitInput(void) {
void initInput(void) {
have_mouse = 1;
}
void UninitInput(void) {
void uninitInput(void) {
}
} // End of namespace Chamber
+12 -12
View File
@@ -34,21 +34,21 @@ extern volatile byte key_direction;
extern volatile byte key_code;
extern byte key_held;
byte ReadKeyboardChar(void);
void ClearKeyboard(void);
byte GetKeyScan(void);
byte readKeyboardChar(void);
void clearKeyboard(void);
byte getKeyScan(void);
byte PollMouse(uint16 *curs_x, uint8 *curs_y);
byte PollKeyboard(void);
void SetInputButtons(byte keys);
byte pollMouse(uint16 *curs_x, uint8 *curs_y);
byte pollKeyboard(void);
void setInputButtons(byte keys);
void PollInput(void);
void ProcessInput(void);
void PollInputButtonsOnly(void);
void ResetInput(void);
void pollInput(void);
void processInput(void);
void pollInputButtonsOnly(void);
void resetInput(void);
void InitInput(void);
void UninitInput(void);
void initInput(void);
void uninitInput(void);
} // End of namespace Chamber
+7 -7
View File
@@ -71,7 +71,7 @@ byte inv_bgcolor = 0; /*TODO: pass this as param?*/
Filter items and put them inventory box, then draw it if non-empty
filtermask/filtervalue specify area (in high 8 bits) and flags (in lower 8 bits)
*/
void DrawInventoryBox(uint16 filtermask, uint16 filtervalue) {
void drawInventoryBox(uint16 filtermask, uint16 filtervalue) {
int16 i;
byte count = 0;
for (i = 0; i < MAX_INV_ITEMS; i++) {
@@ -92,7 +92,7 @@ void DrawInventoryBox(uint16 filtermask, uint16 filtervalue) {
inv_count = count;
}
void CheckInventoryItemHover(byte count) {
void checkInventoryItemHover(byte count) {
int16 i;
for (i = 0; i < count; i++) {
if (IsCursorInRect((rect_t *)&inventory_spots[i])) {
@@ -110,16 +110,16 @@ void CheckInventoryItemHover(byte count) {
the_command = 0;
}
void OpenInventory(uint16 filtermask, uint16 filtervalue) {
void openInventory(uint16 filtermask, uint16 filtervalue) {
the_command = 0;
cga_BackupImageReal(cga_CalcXY_p(232 / 4, 56), 64 / 4, 64);
DrawInventoryBox(filtermask, filtervalue);
drawInventoryBox(filtermask, filtervalue);
if (inv_count != 0) {
selectCursor(CURSOR_FINGER);
ProcessInput();
processInput();
do {
PollInput();
CheckInventoryItemHover(inv_count);
pollInput();
checkInventoryItemHover(inv_count);
if (command_hint != last_command_hint)
DrawCommandHint();
DrawHintsAndCursor(frontbuffer);
+2 -2
View File
@@ -28,9 +28,9 @@ namespace Chamber {
extern byte inv_count;
extern byte inv_bgcolor;
void DrawInventoryBox(uint16 filtermask, uint16 filtervalue);
void drawInventoryBox(uint16 filtermask, uint16 filtervalue);
void OpenInventory(uint16 filtermask, uint16 filtervalue);
void openInventory(uint16 filtermask, uint16 filtervalue);
} // End of namespace Chamber
+8 -8
View File
@@ -109,7 +109,7 @@ void GameLoop(byte *target) {
CleanupDroppedItems();
/* Get player input */
PollInput();
pollInput();
if (g_vm->_shouldQuit)
return;
@@ -169,7 +169,7 @@ process:
RefreshSpritesData();
RunCommand();
BlitSpritesToBackBuffer();
ProcessInput();
processInput();
DrawSpots(target);
} else {
/*Player action*/
@@ -183,7 +183,7 @@ process:
ResetAllPersons();
}
BlitSpritesToBackBuffer();
ProcessInput();
processInput();
DrawSpots(target);
}
}
@@ -250,14 +250,14 @@ Common::Error ChamberEngine::run() {
ExitGame();
/* Wait for a keypress and show the language selection screen */
ClearKeyboard();
clearKeyboard();
readKeyboardChar();
if (_shouldQuit)
return Common::kNoError;
cga_BackBufferToRealFull();
ClearKeyboard();
clearKeyboard();
/* Wait for a valid language choice */
do {
@@ -289,7 +289,7 @@ Common::Error ChamberEngine::run() {
ExitGame();
/* Detect/Initialize input device */
InitInput();
initInput();
/* Load graphics resources */
while (!LoadFond() || !LoadSpritesData() || !LoadPersData())
@@ -345,7 +345,7 @@ Common::Error ChamberEngine::run() {
BlitSpritesToBackBuffer();
/* Initialize cursor backup */
ProcessInput();
processInput();
#ifdef DEBUG_ENDING
script_byte_vars.game_paused = 5;
@@ -359,7 +359,7 @@ Common::Error ChamberEngine::run() {
/*TODO: the following code is never executed since GameLoop is infinite (or the whole game is restarted) */
/* Release hardware */
UninitInput();
uninitInput();
ExitGame();
+7 -7
View File
@@ -55,7 +55,7 @@ struct {
/*Handle keyboard keys in actions menu (to cycle through choices with directional keys)*/
byte PollKeyboardInActionsMenu(void) {
PollInput();
pollInput();
if (!(key_direction & 0xF)) {
key_held = 0;
return key_code;
@@ -78,8 +78,8 @@ byte PollKeyboardInActionsMenu(void) {
}
/*Handle player input in actions menu*/
void PollInputInActionsMenu(void) {
PollInput();
void pollInputInActionsMenu(void) {
pollInput();
}
/*Draw actions menu and process its choices*/
@@ -135,12 +135,12 @@ void ActionsMenu(byte **pinfo) {
DrawSpriteN(1, act_dot_rects[i].sx, act_dot_rects[i].sy, CGA_SCREENBUFFER);
selectCursor(CURSOR_FINGER);
ProcessInput();
processInput();
choice = 0;
act_dot_rects_cur = act_dot_rects;
do {
PollInputInActionsMenu();
pollInputInActionsMenu();
for (choice = 0; choice < numchoices; choice++) {
if (IsCursorInRect(&act_dot_rects[choice]))
@@ -181,9 +181,9 @@ void ActionsMenu(byte **pinfo) {
/*TODO: maybe rename to SpotsLoop*/
void MenuLoop(byte spotmask, byte spotvalue) {
ProcessInput();
processInput();
do {
PollInput();
pollInput();
CheckHotspots(spotmask, spotvalue);
if (object_hint != last_object_hint)
DrawObjectHint();
+11 -11
View File
@@ -144,7 +144,7 @@ uint16 SCR_1_AspirantItemTrade(void) {
for (;;) {
inv_bgcolor = 0xFF;
OpenInventory(0xFE, ITEMFLG_OWNED);
openInventory(0xFE, ITEMFLG_OWNED);
if (inv_count == 0) {
the_command = 0xC1BC;
@@ -229,7 +229,7 @@ uint16 SCR_2_RudeAspirantTrade(void) {
for (;;) {
inv_bgcolor = 0xFF;
OpenInventory(0xFE, ITEMFLG_OWNED);
openInventory(0xFE, ITEMFLG_OWNED);
if (inv_count == 0) {
the_command = 0xC1C5;
@@ -2607,7 +2607,7 @@ uint16 SCR_51_SkullTraderItemTrade(void) {
old_script = script_ptr;
inv_bgcolor = 0xFF;
OpenInventory(0xFF, ITEMFLG_OWNED);
openInventory(0xFF, ITEMFLG_OWNED);
status = 1;
if (inv_count != 0) {
@@ -2620,7 +2620,7 @@ uint16 SCR_51_SkullTraderItemTrade(void) {
((item_t *)(script_vars[ScrPool3_CurrentItem]))->flags = 0;
OpenInventory(0xFF, ITEMFLG_TRADER);
openInventory(0xFF, ITEMFLG_TRADER);
status = 4;
if (the_command != 0) {
@@ -2893,7 +2893,7 @@ void TheEnd(void) {
script_byte_vars.zone_index = 135;
do {
PollInputButtonsOnly();
pollInputButtonsOnly();
}
while(buttons == 0);
@@ -3212,7 +3212,7 @@ Open room's items inventory
uint16 CMD_1_RoomObjects(void) {
updateUndrawCursor(CGA_SCREENBUFFER);
inv_bgcolor = 0xAA;
OpenInventory((0xFF << 8) | ITEMFLG_ROOM, (script_byte_vars.zone_area << 8) | ITEMFLG_ROOM);
openInventory((0xFF << 8) | ITEMFLG_ROOM, (script_byte_vars.zone_area << 8) | ITEMFLG_ROOM);
return ScriptRerun;
}
@@ -3222,9 +3222,9 @@ Open Psi Powers menu
uint16 CMD_2_PsiPowers(void) {
/*Psi powers bar*/
BackupAndShowSprite(3, 280 / 4, 40);
ProcessInput();
processInput();
do {
PollInput();
pollInput();
selectCursor(CURSOR_FINGER);
CheckPsiCommandHover();
if (command_hint != 100)
@@ -3244,7 +3244,7 @@ Open normal inventory box
uint16 CMD_3_Posessions(void) {
updateUndrawCursor(CGA_SCREENBUFFER);
inv_bgcolor = 0x55;
OpenInventory(ITEMFLG_OWNED, ITEMFLG_OWNED);
openInventory(ITEMFLG_OWNED, ITEMFLG_OWNED);
return ScriptRerun;
}
@@ -3274,7 +3274,7 @@ uint16 CMD_4_EnergyLevel(void) {
IFGM_PlaySample(28);
AnimPortrait(1, anim, 10);
AnimPortrait(1, anim + 14, 10);
PollInputButtonsOnly();
pollInputButtonsOnly();
} while (buttons == 0);
popDirtyRects(DirtyRectSprite);
@@ -3357,7 +3357,7 @@ uint16 CMD_8_Timer(void) {
cga_PrintChar((minutes & 1) ? 26 : 0, CGA_SCREENBUFFER); /*colon*/
cga_PrintChar(minutes / (60 * 10) + 16, CGA_SCREENBUFFER);
cga_PrintChar(minutes / 60 + 16, CGA_SCREENBUFFER);
PollInputButtonsOnly();
pollInputButtonsOnly();
} while (buttons == 0);
popDirtyRects(DirtyRectSprite);