mirror of
https://github.com/isledecomp/isle.git
synced 2026-02-02 21:21:16 +00:00
WinMain 99%
This commit is contained in:
parent
344fcf48ad
commit
435ac977a1
109
ISLE/isle.h
109
ISLE/isle.h
@ -88,7 +88,6 @@ class Isle
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
extern LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
extern LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
||||||
|
|
||||||
// OFFSET: ISLE 0x4023e0
|
// OFFSET: ISLE 0x4023e0
|
||||||
@ -210,64 +209,70 @@ inline MxResult Isle::SetupWindow(HINSTANCE hInstance, LPSTR lpCmdLine)
|
|||||||
// OFFSET: ISLE 0x402c20
|
// OFFSET: ISLE 0x402c20
|
||||||
inline void Isle::Tick(BOOL sleepIfNotNextFrame)
|
inline void Isle::Tick(BOOL sleepIfNotNextFrame)
|
||||||
{
|
{
|
||||||
if (this->m_windowActive) {
|
if (!this->m_windowActive) {
|
||||||
if (!Lego()) return;
|
Sleep(0);
|
||||||
if (!TickleManager()) return;
|
return;
|
||||||
if (!Timer()) return;
|
}
|
||||||
|
|
||||||
long currentTime = Timer()->GetRealTime();
|
if (!Lego()) return;
|
||||||
if (currentTime < g_lastFrameTime) {
|
if (!TickleManager()) return;
|
||||||
g_lastFrameTime = -this->m_frameDelta;
|
if (!Timer()) return;
|
||||||
|
|
||||||
|
long currentTime = Timer()->GetRealTime();
|
||||||
|
if (currentTime < g_lastFrameTime) {
|
||||||
|
g_lastFrameTime = -this->m_frameDelta;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this->m_frameDelta + g_lastFrameTime < currentTime) {
|
||||||
|
if (!Lego()->vtable40()) {
|
||||||
|
TickleManager()->Tickle();
|
||||||
}
|
}
|
||||||
if (this->m_frameDelta + g_lastFrameTime < currentTime) {
|
g_lastFrameTime = currentTime;
|
||||||
if (!Lego()->vtable40()) {
|
|
||||||
TickleManager()->Tickle();
|
|
||||||
}
|
|
||||||
g_lastFrameTime = currentTime;
|
|
||||||
|
|
||||||
if (g_startupDelay == 0) {
|
if (g_startupDelay == 0) {
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
g_startupDelay--;
|
|
||||||
if (g_startupDelay != 0) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
LegoOmni::GetInstance()->CreateBackgroundAudio();
|
|
||||||
BackgroundAudioManager()->Enable(this->m_useMusic);
|
|
||||||
|
|
||||||
MxStreamController *stream = Streamer()->Open("\\lego\\scripts\\isle\\isle", 0);
|
|
||||||
MxDSAction ds;
|
|
||||||
|
|
||||||
if (!stream) {
|
|
||||||
stream = Streamer()->Open("\\lego\\scripts\\nocd", 0);
|
|
||||||
if (!stream) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
ds.SetAtomId(stream->atom);
|
|
||||||
ds.SetUnknown24(-1);
|
|
||||||
ds.SetUnknown1c(0);
|
|
||||||
VideoManager()->EnableFullScreenMovie(TRUE, TRUE);
|
|
||||||
|
|
||||||
if (Start(&ds) != SUCCESS) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
ds.SetAtomId(stream->atom);
|
|
||||||
ds.SetUnknown24(-1);
|
|
||||||
ds.SetUnknown1c(0);
|
|
||||||
if (Start(&ds) != SUCCESS) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this->m_gameStarted = 1;
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (sleepIfNotNextFrame == 0) return;
|
|
||||||
|
g_startupDelay--;
|
||||||
|
if (g_startupDelay != 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
LegoOmni::GetInstance()->CreateBackgroundAudio();
|
||||||
|
BackgroundAudioManager()->Enable(this->m_useMusic);
|
||||||
|
|
||||||
|
MxStreamController *stream = Streamer()->Open("\\lego\\scripts\\isle\\isle", 0);
|
||||||
|
MxDSAction ds;
|
||||||
|
|
||||||
|
if (!stream) {
|
||||||
|
stream = Streamer()->Open("\\lego\\scripts\\nocd", 0);
|
||||||
|
if (!stream) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ds.SetAtomId(stream->atom);
|
||||||
|
ds.SetUnknown24(-1);
|
||||||
|
ds.SetUnknown1c(0);
|
||||||
|
VideoManager()->EnableFullScreenMovie(TRUE, TRUE);
|
||||||
|
|
||||||
|
if (Start(&ds) != SUCCESS) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ds.SetAtomId(stream->atom);
|
||||||
|
ds.SetUnknown24(-1);
|
||||||
|
ds.SetUnknown1c(0);
|
||||||
|
if (Start(&ds) != SUCCESS) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this->m_gameStarted = 1;
|
||||||
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (sleepIfNotNextFrame == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
Sleep(0);
|
Sleep(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user