diff options
author | Max Horn | 2004-09-28 20:19:37 +0000 |
---|---|---|
committer | Max Horn | 2004-09-28 20:19:37 +0000 |
commit | ce8c99bf62838099142aa79f2935e64639aa5571 (patch) | |
tree | 5a2ea91139133878cdffab8ed86033fbf5448ea9 /backends/PalmOS | |
parent | 6a50ba2308c6a9fc3eb733f310c87ed279b565ed (diff) | |
download | scummvm-rg350-ce8c99bf62838099142aa79f2935e64639aa5571.tar.gz scummvm-rg350-ce8c99bf62838099142aa79f2935e64639aa5571.tar.bz2 scummvm-rg350-ce8c99bf62838099142aa79f2935e64639aa5571.zip |
Rename remaining OSystem methods to match our coding guidelines
svn-id: r15332
Diffstat (limited to 'backends/PalmOS')
-rw-r--r-- | backends/PalmOS/Src/cd_default.cpp | 14 | ||||
-rw-r--r-- | backends/PalmOS/Src/cd_msa.cpp | 6 | ||||
-rw-r--r-- | backends/PalmOS/Src/cd_pockettunes.cpp | 8 | ||||
-rw-r--r-- | backends/PalmOS/Src/palm.cpp | 10 | ||||
-rw-r--r-- | backends/PalmOS/Src/palm.h | 20 | ||||
-rw-r--r-- | backends/PalmOS/Src/palmevt.cpp | 114 | ||||
-rw-r--r-- | backends/PalmOS/Src/palmrdr.cpp | 2 | ||||
-rw-r--r-- | backends/PalmOS/Src/palmsave.cpp | 2 | ||||
-rw-r--r-- | backends/PalmOS/Src/palmsnd.cpp | 8 |
9 files changed, 92 insertions, 92 deletions
diff --git a/backends/PalmOS/Src/cd_default.cpp b/backends/PalmOS/Src/cd_default.cpp index f630850de3..9185a0b880 100644 --- a/backends/PalmOS/Src/cd_default.cpp +++ b/backends/PalmOS/Src/cd_default.cpp @@ -38,13 +38,13 @@ void DefaultCDPlayer::release() { } bool DefaultCDPlayer::poll() { - return (_defLoops != 0 && _sys->get_msecs() < _defTrackEndFrame); + return (_defLoops != 0 && _sys->getMillis() < _defTrackEndFrame); } void DefaultCDPlayer::update() { - // stop replay upon request of stop_cdrom() - if (_defStopTime != 0 && _sys->get_msecs() >= _defStopTime) { + // stop replay upon request of stopCD() + if (_defStopTime != 0 && _sys->getMillis() >= _defStopTime) { _defLoops = 0; _defStopTime = 0; _defTrackEndFrame = 0; @@ -52,7 +52,7 @@ void DefaultCDPlayer::update() { } // not fully played - if (_sys->get_msecs() < _defTrackEndFrame) + if (_sys->getMillis() < _defTrackEndFrame) return; if (_defLoops == 0) @@ -64,12 +64,12 @@ void DefaultCDPlayer::update() { // loop if needed if (_defLoops != 0) { - _defTrackEndFrame = _sys->get_msecs() + _defTrackLength; + _defTrackEndFrame = _sys->getMillis() + _defTrackLength; } } void DefaultCDPlayer::stop() { /* Stop CD Audio in 1/10th of a second */ - _defStopTime = _sys->get_msecs() + 100; + _defStopTime = _sys->getMillis() + 100; _defLoops = 0; return; } @@ -98,5 +98,5 @@ void DefaultCDPlayer::play(int track, int num_loops, int start_frame, int durati } // try to play the track - _defTrackEndFrame = _sys->get_msecs() + _defTrackLength; + _defTrackEndFrame = _sys->getMillis() + _defTrackLength; } diff --git a/backends/PalmOS/Src/cd_msa.cpp b/backends/PalmOS/Src/cd_msa.cpp index 8879ce8cf1..478d5f9e21 100644 --- a/backends/PalmOS/Src/cd_msa.cpp +++ b/backends/PalmOS/Src/cd_msa.cpp @@ -127,8 +127,8 @@ void MsaCDPlayer::update() { MsaPBStatus pb; MsaGetPBStatus(_msaRefNum, &pb); - // stop replay upon request of stop_cdrom() - if (_msaStopTime != 0 && _sys->get_msecs() >= _msaStopTime) { + // stop replay upon request of stopCD() + if (_msaStopTime != 0 && _sys->getMillis() >= _msaStopTime) { MsaStop(_msaRefNum, true); _msaLoops = 0; _msaStopTime = 0; @@ -174,7 +174,7 @@ void MsaCDPlayer::stop() { /* Stop CD Audio in 1/10th of a second */ if (!_isInitialized) return; - _msaStopTime = _sys->get_msecs() + 100; + _msaStopTime = _sys->getMillis() + 100; _msaLoops = 0; return; } diff --git a/backends/PalmOS/Src/cd_pockettunes.cpp b/backends/PalmOS/Src/cd_pockettunes.cpp index eca7624622..5993312b12 100644 --- a/backends/PalmOS/Src/cd_pockettunes.cpp +++ b/backends/PalmOS/Src/cd_pockettunes.cpp @@ -136,8 +136,8 @@ bool PckTunesCDPlayer::poll() { void PckTunesCDPlayer::update() { - // stop replay upon request of stop_cdrom() - if (_pckStopTime != 0 && _sys->get_msecs() >= _pckStopTime) { + // stop replay upon request of stopCD() + if (_pckStopTime != 0 && _sys->getMillis() >= _pckStopTime) { PocketTunesStop(); _pckLoops = 0; _pckStopTime = 0; @@ -146,7 +146,7 @@ void PckTunesCDPlayer::update() { } // not fully played -// if (_sys->get_msecs() < _pckTrackEndFrame) +// if (_sys->getMillis() < _pckTrackEndFrame) // return; if (getPosition(_pckTrackEndFrame) < _pckTrackEndFrame) return; @@ -174,7 +174,7 @@ void PckTunesCDPlayer::update() { } void PckTunesCDPlayer::stop() { /* Stop CD Audio in 1/10th of a second */ - _pckStopTime = _sys->get_msecs() + 100; + _pckStopTime = _sys->getMillis() + 100; _pckLoops = 0; return; } diff --git a/backends/PalmOS/Src/palm.cpp b/backends/PalmOS/Src/palm.cpp index 704d887d9d..5c3209a745 100644 --- a/backends/PalmOS/Src/palm.cpp +++ b/backends/PalmOS/Src/palm.cpp @@ -42,21 +42,21 @@ OSystem *OSystem_PALMOS::create() { return new OSystem_PALMOS(); } -uint32 OSystem_PALMOS::get_msecs() { +uint32 OSystem_PALMOS::getMillis() { uint32 ticks = TimGetTicks(); ticks *= (1000/SysTicksPerSecond()); return ticks; } -void OSystem_PALMOS::delay_msecs(uint msecs) { - UInt32 current = get_msecs(); +void OSystem_PALMOS::delayMillis(uint msecs) { + UInt32 current = getMillis(); UInt32 last = current + msecs; do { timer_handler(current); sound_handler(); - current = get_msecs(); + current = getMillis(); } while (current < last); } @@ -100,7 +100,7 @@ void OSystem_PALMOS::timer_handler(UInt32 current_msecs) { void OSystem_PALMOS::setTimerCallback(TimerProc callback, int timer) { if (callback != NULL) { _timer.duration = timer; - _timer.nextExpiry = get_msecs() + timer; + _timer.nextExpiry = getMillis() + timer; _timer.callback = callback; _timer.active = true; } else { diff --git a/backends/PalmOS/Src/palm.h b/backends/PalmOS/Src/palm.h index e2ff05f4e9..88c7d2a2a3 100644 --- a/backends/PalmOS/Src/palm.h +++ b/backends/PalmOS/Src/palm.h @@ -92,19 +92,19 @@ public: void setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, byte keycolor); // Shaking is used in SCUMM. Set current shake position. - void set_shake_pos(int shake_pos); + void setShakePos(int shake_pos); // Get the number of milliseconds since the program was started. - uint32 get_msecs(); + uint32 getMillis(); // Delay for a specified amount of milliseconds - void delay_msecs(uint msecs); + void delayMillis(uint msecs); // Get the next event. // Returns true if an event was retrieved. - bool poll_event(Event *event); + bool pollEvent(Event &event); - void SimulateArrowKeys(Event *event, Int8 iHoriz, Int8 iVert); + void SimulateArrowKeys(Event &event, Int8 iHoriz, Int8 iVert); /** @name Sound */ //@{ @@ -126,16 +126,16 @@ public: // Poll cdrom status // Returns true if cd audio is playing - bool poll_cdrom(); + bool pollCD(); // Play cdrom audio track - void play_cdrom(int track, int num_loops, int start_frame, int duration); + void playCD(int track, int num_loops, int start_frame, int duration); // Stop cdrom audio track - void stop_cdrom(); + void stopCD(); // Update cdrom audio status - void update_cdrom(); + void updateCD(); // Add a callback timer void setTimerCallback(TimerProc callback, int timer); @@ -162,7 +162,7 @@ public: void ColorToRGB(byte color, uint8 &r, uint8 &g, uint8 &b); // Savefile management - SaveFileManager *get_savefile_manager(); + SaveFileManager *getSavefileManager(); static OSystem *create(); diff --git a/backends/PalmOS/Src/palmevt.cpp b/backends/PalmOS/Src/palmevt.cpp index 80a6c33701..c8eee736f6 100644 --- a/backends/PalmOS/Src/palmevt.cpp +++ b/backends/PalmOS/Src/palmevt.cpp @@ -32,7 +32,7 @@ #define EXITDELAY (500) // delay to exit : calc button : double tap 1/500 sec -void OSystem_PALMOS::SimulateArrowKeys(Event *event, Int8 iHoriz, Int8 iVert) { +void OSystem_PALMOS::SimulateArrowKeys(Event &event, Int8 iHoriz, Int8 iVert) { Int16 x = _mouseCurState.x; Int16 y = _mouseCurState.y; Int16 slow; @@ -56,9 +56,9 @@ void OSystem_PALMOS::SimulateArrowKeys(Event *event, Int8 iHoriz, Int8 iVert) { y = (y < 0 ) ? 0 : y; y = (y >= _screenHeight ) ? _screenHeight - 1 : y; - event->event_code = EVENT_MOUSEMOVE; - event->mouse.x = x; - event->mouse.y = y; + event.event_code = EVENT_MOUSEMOVE; + event.mouse.x = x; + event.mouse.y = y; set_mouse_pos(x, y); } @@ -104,7 +104,7 @@ void OSystem_PALMOS::getCoordinates(EventPtr event, Coord *x, Coord *y) { } } -bool OSystem_PALMOS::poll_event(Event *event) { +bool OSystem_PALMOS::pollEvent(Event &event) { EventType ev; Boolean handled; UInt32 keyCurrentState; @@ -112,7 +112,7 @@ bool OSystem_PALMOS::poll_event(Event *event) { battery_handler(); sound_handler(); - timer_handler(get_msecs()); + timer_handler(getMillis()); for(;;) { EvtGetEvent(&ev, evtNoWait); @@ -126,9 +126,9 @@ bool OSystem_PALMOS::poll_event(Event *event) { Int8 sy = 0; if (keyCurrentState & _keyMouse.bitButLeft) { - event->event_code = EVENT_LBUTTONDOWN; - event->mouse.x = _mouseCurState.x; - event->mouse.y = _mouseCurState.y; + event.event_code = EVENT_LBUTTONDOWN; + event.mouse.x = _mouseCurState.x; + event.mouse.y = _mouseCurState.y; _lastKeyPressed = kLastKeyNone; return true; } @@ -145,7 +145,7 @@ bool OSystem_PALMOS::poll_event(Event *event) { SimulateArrowKeys(event, sx, sy); updateScreen(); - update_cdrom(); + updateCD(); _lastKeyPressed = kLastKeyMouse; return true; @@ -155,7 +155,7 @@ bool OSystem_PALMOS::poll_event(Event *event) { if (ev.eType == nilEvent) { // force CD update, useful when the game is paused in some cases - update_cdrom(); + updateCD(); return false; } @@ -165,10 +165,10 @@ bool OSystem_PALMOS::poll_event(Event *event) { // ESC key case vchrLaunch: _lastKeyPressed = kLastKeyNone; - event->event_code = EVENT_KEYDOWN; - event->kbd.keycode = 27; - event->kbd.ascii = 27; - event->kbd.flags = 0; + event.event_code = EVENT_KEYDOWN; + event.kbd.keycode = 27; + event.kbd.ascii = 27; + event.kbd.flags = 0; return true; // F5 = menu @@ -176,18 +176,18 @@ bool OSystem_PALMOS::poll_event(Event *event) { case vchrMenu: case vchrThumbWheelBack: // Tapwave back button _lastKeyPressed = kLastKeyNone; - event->event_code = EVENT_KEYDOWN; - event->kbd.keycode = 319; - event->kbd.ascii = 319; - event->kbd.flags = 0; + event.event_code = EVENT_KEYDOWN; + event.kbd.keycode = 319; + event.kbd.ascii = 319; + event.kbd.flags = 0; return true; case vchrCalc: if (_lastKeyPressed & kLastKeyCalc) - if ((get_msecs() - _exit_delay) <= (EXITDELAY)) - event->event_code = EVENT_QUIT; + if ((getMillis() - _exit_delay) <= (EXITDELAY)) + event.event_code = EVENT_QUIT; - _exit_delay = get_msecs(); + _exit_delay = getMillis(); _lastKeyPressed = kLastKeyCalc; return true; @@ -197,9 +197,9 @@ bool OSystem_PALMOS::poll_event(Event *event) { #ifndef DISABLE_TAPWAVE case vchrActionRight: #endif - event->event_code = EVENT_RBUTTONDOWN; - event->mouse.x = _mouseCurState.x; - event->mouse.y = _mouseCurState.y; + event.event_code = EVENT_RBUTTONDOWN; + event.mouse.x = _mouseCurState.x; + event.mouse.y = _mouseCurState.y; _lastKeyPressed = kLastKeyNone; return true; @@ -213,11 +213,11 @@ bool OSystem_PALMOS::poll_event(Event *event) { // wheel case vchrJogUp: - event->event_code = EVENT_WHEELUP; + event.event_code = EVENT_WHEELUP; return true; case vchrJogDown: - event->event_code = EVENT_WHEELDOWN; + event.event_code = EVENT_WHEELDOWN; return true; @@ -260,19 +260,19 @@ bool OSystem_PALMOS::poll_event(Event *event) { // ESC key case vchrHard2: _lastKeyPressed = kLastKeyNone; - event->event_code = EVENT_KEYDOWN; - event->kbd.keycode = 27; - event->kbd.ascii = 27; - event->kbd.flags = 0; + event.event_code = EVENT_KEYDOWN; + event.kbd.keycode = 27; + event.kbd.ascii = 27; + event.kbd.flags = 0; return true; // F5 = menu case vchrHard3: _lastKeyPressed = kLastKeyNone; - event->event_code = EVENT_KEYDOWN; - event->kbd.keycode = 319; - event->kbd.ascii = 319; - event->kbd.flags = 0; + event.event_code = EVENT_KEYDOWN; + event.kbd.keycode = 319; + event.kbd.ascii = 319; + event.kbd.flags = 0; return true; } } @@ -321,7 +321,7 @@ bool OSystem_PALMOS::poll_event(Event *event) { b = 0; } else if ((keycode == 'z' && b == KBD_CTRL) || (b == KBD_ALT && keycode == 'x')) { - event->event_code = EVENT_QUIT; + event.event_code = EVENT_QUIT; return true; } else if (keycode == 'n' && b == KBD_CTRL) { @@ -344,10 +344,10 @@ bool OSystem_PALMOS::poll_event(Event *event) { #endif } - event->event_code = EVENT_KEYDOWN; - event->kbd.keycode = keycode; - event->kbd.ascii = keycode; //(keycode>='a' && keycode<='z' && (event->kbd.flags & KBD_SHIFT) ? keycode &~ 0x20 : keycode); - event->kbd.flags = b; + event.event_code = EVENT_KEYDOWN; + event.kbd.keycode = keycode; + event.kbd.ascii = keycode; //(keycode>='a' && keycode<='z' && (event.kbd.flags & KBD_SHIFT) ? keycode &~ 0x20 : keycode); + event.kbd.flags = b; if (_lastKeyModifier) { _lastKeyModifier = MD_NONE; @@ -363,14 +363,14 @@ bool OSystem_PALMOS::poll_event(Event *event) { if (y > _screenHeight || y < 0 || x > _screenWidth || x < 0) return true; - if (_lastEvent != penMoveEvent && (abs(y - event->mouse.y) <= 2 || abs(x - event->mouse.x) <= 2)) // move only if + if (_lastEvent != penMoveEvent && (abs(y - event.mouse.y) <= 2 || abs(x - event.mouse.x) <= 2)) // move only if return true; _lastEvent = penMoveEvent; - event->event_code = EVENT_MOUSEMOVE; - event->mouse.x = x; - event->mouse.y = y; - set_mouse_pos(event->mouse.x, event->mouse.y); + event.event_code = EVENT_MOUSEMOVE; + event.mouse.x = x; + event.mouse.y = y; + set_mouse_pos(event.mouse.x, event.mouse.y); return true; case penDownEvent: @@ -387,10 +387,10 @@ bool OSystem_PALMOS::poll_event(Event *event) { _lastEvent = keyDownEvent; _lastKeyPressed = kLastKeyNone; - event->event_code = EVENT_KEYDOWN; - event->kbd.keycode = key; - event->kbd.ascii = key; - event->kbd.flags = 0; + event.event_code = EVENT_KEYDOWN; + event.kbd.keycode = key; + event.kbd.ascii = key; + event.kbd.flags = 0; return true; } } @@ -399,22 +399,22 @@ bool OSystem_PALMOS::poll_event(Event *event) { if (y > _screenHeight || y < 0 || x > _screenWidth || x < 0) return true; - event->event_code = EVENT_LBUTTONDOWN; - event->mouse.x = x; - event->mouse.y = y; - set_mouse_pos(event->mouse.x, event->mouse.y); + event.event_code = EVENT_LBUTTONDOWN; + event.mouse.x = x; + event.mouse.y = y; + set_mouse_pos(event.mouse.x, event.mouse.y); return true; case penUpEvent: getCoordinates(&ev, &x, &y); - event->event_code = EVENT_LBUTTONUP; + event.event_code = EVENT_LBUTTONUP; if (y > _screenHeight || y < 0 || x > _screenWidth || x < 0) return true; - event->mouse.x = x; - event->mouse.y = y; - set_mouse_pos(event->mouse.x, event->mouse.y); + event.mouse.x = x; + event.mouse.y = y; + set_mouse_pos(event.mouse.x, event.mouse.y); return true; default: diff --git a/backends/PalmOS/Src/palmrdr.cpp b/backends/PalmOS/Src/palmrdr.cpp index c8a002c1ce..41a86524f7 100644 --- a/backends/PalmOS/Src/palmrdr.cpp +++ b/backends/PalmOS/Src/palmrdr.cpp @@ -41,7 +41,7 @@ void OSystem_PALMOS::rumblePack(Boolean active) { } -void OSystem_PALMOS::set_shake_pos(int shake_pos) { +void OSystem_PALMOS::setShakePos(int shake_pos) { _new_shake_pos = shake_pos; if (shake_pos == 0) diff --git a/backends/PalmOS/Src/palmsave.cpp b/backends/PalmOS/Src/palmsave.cpp index c3e2825f29..291b4d9204 100644 --- a/backends/PalmOS/Src/palmsave.cpp +++ b/backends/PalmOS/Src/palmsave.cpp @@ -192,6 +192,6 @@ SaveFile *PalmSaveFileManager::makeSaveFile(const char *filename, bool saveOrLoa } // OSystem -SaveFileManager *OSystem_PALMOS::get_savefile_manager() { +SaveFileManager *OSystem_PALMOS::getSavefileManager() { return new PalmSaveFileManager(); } diff --git a/backends/PalmOS/Src/palmsnd.cpp b/backends/PalmOS/Src/palmsnd.cpp index e05203cdd6..fd433fe5b0 100644 --- a/backends/PalmOS/Src/palmsnd.cpp +++ b/backends/PalmOS/Src/palmsnd.cpp @@ -157,28 +157,28 @@ bool OSystem_PALMOS::openCD(int drive) { return false; } -void OSystem_PALMOS::stop_cdrom() { +void OSystem_PALMOS::stopCD() { if (!_cdPlayer) return; _cdPlayer->stop(); } -void OSystem_PALMOS::play_cdrom(int track, int num_loops, int start_frame, int duration) { +void OSystem_PALMOS::playCD(int track, int num_loops, int start_frame, int duration) { if (!_cdPlayer) return; _cdPlayer->play(track, num_loops, start_frame, duration); } -bool OSystem_PALMOS::poll_cdrom() { +bool OSystem_PALMOS::pollCD() { if (!_cdPlayer) return false; return _cdPlayer->poll(); } -void OSystem_PALMOS::update_cdrom() { +void OSystem_PALMOS::updateCD() { if (!_cdPlayer) return; |