Skip to content

Commit

Permalink
TONY: Created dummy event loop and started work on converting RMWindo…
Browse files Browse the repository at this point in the history
…w class
  • Loading branch information
dreammaster committed May 5, 2012
1 parent aa603d5 commit 07c1369
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 587 deletions.
2 changes: 1 addition & 1 deletion engines/tony/gfxengine.cpp
Expand Up @@ -557,7 +557,7 @@ void RMGfxEngine::Init(/*HINSTANCE hInst*/) {
m_bigBuf.DrawOT();
m_bigBuf.ClearOT();
delete load;
_vm->m_wnd.GetNewFrame(*this, NULL);
_vm->_window.GetNewFrame(*this, NULL);



Expand Down
38 changes: 25 additions & 13 deletions engines/tony/tony.cpp
Expand Up @@ -23,6 +23,7 @@
#include "common/scummsys.h"
#include "common/algorithm.h"
#include "common/config-manager.h"
#include "common/events.h"
#include "common/file.h"
#include "tony/tony.h"
#include "tony/game.h"
Expand Down Expand Up @@ -66,6 +67,9 @@ Common::ErrorCode TonyEngine::Init() {
m_bDrawLocation = true;
m_startTime = g_system->getMillis();

// Initialise the graphics window
_window.Init();

// Initialise the function list
Common::fill(FuncList, FuncList + 300, (LPCUSTOMFUNCTION)NULL);

Expand Down Expand Up @@ -220,7 +224,7 @@ void TonyEngine::UnloadAllUtilSFX(void) {
void TonyEngine::InitMusic() {
int i;

_theSound.Init(/*m_wnd*/);
_theSound.Init(/*_window*/);
_theSound.SetMasterVolume(63);

for (i = 0; i < 6; i++)
Expand Down Expand Up @@ -349,7 +353,7 @@ void TonyEngine::CloseVoiceDatabase() {
}

void TonyEngine::GrabThumbnail(void) {
//m_wnd.GrabThumbnail(m_curThumbnail);
//_window.GrabThumbnail(m_curThumbnail);
warning("TODO: TonyEngine::GrabThumbnail");
}

Expand All @@ -369,8 +373,16 @@ void TonyEngine::Abort(void) {
}

void TonyEngine::Play(void) {
warning("TODO TonyEngine::Play");

// Main game loop
while (!shouldQuit() && !m_bQuitNow) {
g_system->delayMillis(50);
_window.Repaint();

Common::Event evt;
while (g_system->getEventManager()->pollEvent(evt))
;
}

#if 0
MSG msg;

Expand All @@ -388,14 +400,14 @@ void TonyEngine::Play(void) {
// Passa il buffer dall'engine alla finestra
if (!m_bPaused) {
if (!theEngine.m_bWiping)
m_wnd.GetNewFrame(theEngine, NULL);
_window.GetNewFrame(theEngine, NULL);
else
m_wnd.GetNewFrame(theEngine, &theEngine.m_rcWipeEllipse);
_window.GetNewFrame(theEngine, &theEngine.m_rcWipeEllipse);
}

// Loop minchia dei messaggi
if (PeekMessage(&msg, m_wnd, 0, 0, true)) {
if (!TranslateAccelerator(m_wnd, m_hacc, &msg)) {
if (PeekMessage(&msg, _window, 0, 0, true)) {
if (!TranslateAccelerator(_window, m_hacc, &msg)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
Expand All @@ -411,12 +423,12 @@ void TonyEngine::Close(void) {
CloseHandle(m_hEndOfFrame);
_theBoxes.Close();
_theEngine.Close();
m_wnd.Close();
_window.Close();
delete[] m_curThumbnail;
}

void TonyEngine::SwitchFullscreen(bool bFull) {
m_wnd.SwitchFullscreen(bFull);
_window.SwitchFullscreen(bFull);
_theEngine.SwitchFullscreen(bFull);
}

Expand All @@ -434,7 +446,7 @@ void TonyEngine::PauseLoop(void) {

st = GetTime();

while (m_bPaused && GetMessage(&msg,m_wnd,0,0)) {
while (m_bPaused && GetMessage(&msg,_window,0,0)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
Expand All @@ -456,9 +468,9 @@ warning("TODO: TonyEninge::Pause");
theEngine.GDIControl(m_bPaused);
if (m_bPaused) {
SetWindowText(m_wnd, "Tony Tough and the night of Roasted Moths - PAUSED");
SetWindowText(_window, "Tony Tough and the night of Roasted Moths - PAUSED");
} else {
SetWindowText(m_wnd, "Tony Tough and the night of Roasted Moths");
SetWindowText(_window, "Tony Tough and the night of Roasted Moths");
}
*/
}
Expand Down
2 changes: 1 addition & 1 deletion engines/tony/tony.h
Expand Up @@ -116,7 +116,7 @@ class TonyEngine : public Engine {

// Bounding box list manager
RMGameBoxes _theBoxes;
RMWindow m_wnd;
RMWindow _window;
RMGfxEngine _theEngine;

bool m_bQuitNow;
Expand Down

0 comments on commit 07c1369

Please sign in to comment.