mirror of
https://github.com/isledecomp/isle-portable.git
synced 2024-11-22 15:37:55 -05:00
added all exe resources
This commit is contained in:
parent
2520cf832d
commit
0270483b48
11 changed files with 84 additions and 55 deletions
55
app/isle.cpp
55
app/isle.cpp
|
@ -5,6 +5,7 @@
|
||||||
#include "../lib/mxdirectdraw.h"
|
#include "../lib/mxdirectdraw.h"
|
||||||
#include "../lib/mxdsaction.h"
|
#include "../lib/mxdsaction.h"
|
||||||
#include "../lib/mxomni.h"
|
#include "../lib/mxomni.h"
|
||||||
|
#include "res/resource.h"
|
||||||
|
|
||||||
RECT windowRect = {0, 0, 640, 480};
|
RECT windowRect = {0, 0, 640, 480};
|
||||||
|
|
||||||
|
@ -42,10 +43,10 @@ Isle::Isle()
|
||||||
m_videoParam.flags().Enable16Bit(MxDirectDraw::GetPrimaryBitDepth() == 16);
|
m_videoParam.flags().Enable16Bit(MxDirectDraw::GetPrimaryBitDepth() == 16);
|
||||||
|
|
||||||
m_windowHandle = NULL;
|
m_windowHandle = NULL;
|
||||||
m_cursor1 = NULL;
|
m_cursorArrow = NULL;
|
||||||
m_cursor2 = NULL;
|
m_cursorBusy = NULL;
|
||||||
m_cursor3 = NULL;
|
m_cursorNo = NULL;
|
||||||
m_cursor4 = NULL;
|
m_cursorCurrent = NULL;
|
||||||
|
|
||||||
LegoOmni::CreateInstance();
|
LegoOmni::CreateInstance();
|
||||||
}
|
}
|
||||||
|
@ -242,10 +243,10 @@ void Isle::setupVideoFlags(BOOL fullScreen, BOOL flipSurfaces, BOOL backBuffers,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL Isle::setupMediaPath()
|
BOOL Isle::setupLegoOmni()
|
||||||
{
|
{
|
||||||
char mediaPath[256];
|
char mediaPath[256];
|
||||||
GetProfileStringA("LEGO Island", "MediaPath", "", mediaPath, 0x100);
|
GetProfileStringA("LEGO Island", "MediaPath", "", mediaPath, 256);
|
||||||
|
|
||||||
MxOmniCreateParam createParam(mediaPath, (struct HWND__ *) m_windowHandle, m_videoParam, MxOmniCreateFlags());
|
MxOmniCreateParam createParam(mediaPath, (struct HWND__ *) m_windowHandle, m_videoParam, MxOmniCreateFlags());
|
||||||
|
|
||||||
|
@ -258,6 +259,26 @@ BOOL Isle::setupMediaPath()
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Isle::setupCursor(WPARAM wParam)
|
||||||
|
{
|
||||||
|
switch (wParam) {
|
||||||
|
case 0:
|
||||||
|
m_cursorCurrent = m_cursorArrow;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
m_cursorCurrent = m_cursorBusy;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
m_cursorCurrent = m_cursorNo;
|
||||||
|
break;
|
||||||
|
case 0xB:
|
||||||
|
m_cursorCurrent = NULL;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
SetCursor(m_cursorCurrent);
|
||||||
|
}
|
||||||
|
|
||||||
LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
if (!g_isle) {
|
if (!g_isle) {
|
||||||
|
@ -364,6 +385,7 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
case WM_TIMER:
|
case WM_TIMER:
|
||||||
case WM_LBUTTONDOWN:
|
case WM_LBUTTONDOWN:
|
||||||
case WM_LBUTTONUP:
|
case WM_LBUTTONUP:
|
||||||
|
case 0x5400:
|
||||||
{
|
{
|
||||||
|
|
||||||
NotificationId type = NONE;
|
NotificationId type = NONE;
|
||||||
|
@ -386,8 +408,8 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
break;
|
break;
|
||||||
case WM_SETCURSOR:
|
case WM_SETCURSOR:
|
||||||
if (g_isle) {
|
if (g_isle) {
|
||||||
HCURSOR hCursor = g_isle->m_cursor4;
|
HCURSOR hCursor = g_isle->m_cursorCurrent;
|
||||||
if (g_isle->m_cursor2 == hCursor || g_isle->m_cursor3 == hCursor || hCursor == NULL) {
|
if (hCursor == g_isle->m_cursorBusy || hCursor == g_isle->m_cursorNo || !hCursor) {
|
||||||
SetCursor(hCursor);
|
SetCursor(hCursor);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -403,8 +425,7 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
break;
|
break;
|
||||||
case 0x5400:
|
case 0x5400:
|
||||||
if (g_isle) {
|
if (g_isle) {
|
||||||
// FIXME: Untangle
|
g_isle->setupCursor(wParam);
|
||||||
//FUN_00402e80(g_isle,wParam);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -453,12 +474,12 @@ MxResult Isle::setupWindow(HINSTANCE hInstance)
|
||||||
wndclass.style = CS_HREDRAW | CS_VREDRAW;
|
wndclass.style = CS_HREDRAW | CS_VREDRAW;
|
||||||
wndclass.lpfnWndProc = WndProc;
|
wndclass.lpfnWndProc = WndProc;
|
||||||
wndclass.cbWndExtra = 0;
|
wndclass.cbWndExtra = 0;
|
||||||
wndclass.hIcon = LoadIconA(hInstance, MAKEINTRESOURCE(105));
|
wndclass.hIcon = LoadIconA(hInstance, MAKEINTRESOURCE(APP_ICON));
|
||||||
wndclass.hCursor = LoadCursorA(hInstance, MAKEINTRESOURCE(102));
|
wndclass.hCursor = LoadCursorA(hInstance, MAKEINTRESOURCE(ISLE_ARROW));
|
||||||
m_cursor4 = wndclass.hCursor;
|
m_cursorCurrent = wndclass.hCursor;
|
||||||
m_cursor1 = wndclass.hCursor;
|
m_cursorArrow = wndclass.hCursor;
|
||||||
m_cursor2 = LoadCursorA(hInstance, MAKEINTRESOURCE(104));
|
m_cursorBusy = LoadCursorA(hInstance, MAKEINTRESOURCE(ISLE_BUSY));
|
||||||
m_cursor3 = LoadCursorA(hInstance, MAKEINTRESOURCE(103));
|
m_cursorNo = LoadCursorA(hInstance, MAKEINTRESOURCE(ISLE_NO));
|
||||||
wndclass.hInstance = hInstance;
|
wndclass.hInstance = hInstance;
|
||||||
wndclass.hbrBackground = GetStockObject(BLACK_BRUSH);
|
wndclass.hbrBackground = GetStockObject(BLACK_BRUSH);
|
||||||
wndclass.lpszClassName = WNDCLASS_NAME;
|
wndclass.lpszClassName = WNDCLASS_NAME;
|
||||||
|
@ -500,7 +521,7 @@ MxResult Isle::setupWindow(HINSTANCE hInstance)
|
||||||
|
|
||||||
ShowWindow(m_windowHandle, SW_SHOWNORMAL);
|
ShowWindow(m_windowHandle, SW_SHOWNORMAL);
|
||||||
UpdateWindow(m_windowHandle);
|
UpdateWindow(m_windowHandle);
|
||||||
if (!setupMediaPath()) {
|
if (!setupLegoOmni()) {
|
||||||
return FAILURE;
|
return FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
12
app/isle.h
12
app/isle.h
|
@ -18,12 +18,14 @@ class Isle
|
||||||
|
|
||||||
void tick(BOOL sleepIfNotNextFrame);
|
void tick(BOOL sleepIfNotNextFrame);
|
||||||
|
|
||||||
BOOL setupMediaPath();
|
BOOL setupLegoOmni();
|
||||||
void loadConfig();
|
void loadConfig();
|
||||||
void setupVideoFlags(BOOL fullScreen, BOOL flipSurfaces, BOOL backBuffers,
|
void setupVideoFlags(BOOL fullScreen, BOOL flipSurfaces, BOOL backBuffers,
|
||||||
BOOL using8bit, BOOL m_using16bit, BOOL param_6, BOOL param_7,
|
BOOL using8bit, BOOL m_using16bit, BOOL param_6, BOOL param_7,
|
||||||
BOOL wideViewAngle, char *deviceId);
|
BOOL wideViewAngle, char *deviceId);
|
||||||
|
|
||||||
|
void setupCursor(WPARAM wParam);
|
||||||
|
|
||||||
//private:
|
//private:
|
||||||
|
|
||||||
// 0
|
// 0
|
||||||
|
@ -62,12 +64,12 @@ class Isle
|
||||||
BOOL m_windowActive;
|
BOOL m_windowActive;
|
||||||
HWND m_windowHandle;
|
HWND m_windowHandle;
|
||||||
BOOL m_drawCursor;
|
BOOL m_drawCursor;
|
||||||
HCURSOR m_cursor1;
|
HCURSOR m_cursorArrow;
|
||||||
|
|
||||||
// 80
|
// 80
|
||||||
HCURSOR m_cursor2;
|
HCURSOR m_cursorBusy;
|
||||||
HCURSOR m_cursor3;
|
HCURSOR m_cursorNo;
|
||||||
HCURSOR m_cursor4;
|
HCURSOR m_cursorCurrent;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,9 @@
|
||||||
|
|
||||||
BOOL findExistingInstance(void)
|
BOOL findExistingInstance(void)
|
||||||
{
|
{
|
||||||
|
// FIXME: temp
|
||||||
|
return 1;
|
||||||
|
|
||||||
HWND hWnd = FindWindowA(WNDCLASS_NAME, WINDOW_TITLE);
|
HWND hWnd = FindWindowA(WNDCLASS_NAME, WINDOW_TITLE);
|
||||||
if (hWnd) {
|
if (hWnd) {
|
||||||
if (SetForegroundWindow(hWnd)) {
|
if (SetForegroundWindow(hWnd)) {
|
||||||
|
|
BIN
app/res/arrow.cur
Normal file
BIN
app/res/arrow.cur
Normal file
Binary file not shown.
After Width: | Height: | Size: 326 B |
BIN
app/res/busy.cur
Normal file
BIN
app/res/busy.cur
Normal file
Binary file not shown.
After Width: | Height: | Size: 326 B |
BIN
app/res/isle.ico
Normal file
BIN
app/res/isle.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.5 KiB |
BIN
app/res/isle.rc
Normal file
BIN
app/res/isle.rc
Normal file
Binary file not shown.
BIN
app/res/no.cur
Normal file
BIN
app/res/no.cur
Normal file
Binary file not shown.
After Width: | Height: | Size: 326 B |
5
app/res/resource.h
Normal file
5
app/res/resource.h
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
#define ISLE_ARROW 102
|
||||||
|
#define ISLE_NO 103
|
||||||
|
#define ISLE_BUSY 104
|
||||||
|
|
||||||
|
#define APP_ICON 105
|
64
isle.mak
64
isle.mak
|
@ -32,8 +32,8 @@ NULL=nul
|
||||||
# Begin Project
|
# Begin Project
|
||||||
# PROP Target_Last_Scanned "isle - Win32 Debug"
|
# PROP Target_Last_Scanned "isle - Win32 Debug"
|
||||||
CPP=cl.exe
|
CPP=cl.exe
|
||||||
MTL=mktyplib.exe
|
|
||||||
RSC=rc.exe
|
RSC=rc.exe
|
||||||
|
MTL=mktyplib.exe
|
||||||
|
|
||||||
!IF "$(CFG)" == "isle - Win32 Release"
|
!IF "$(CFG)" == "isle - Win32 Release"
|
||||||
|
|
||||||
|
@ -55,6 +55,7 @@ ALL : "$(OUTDIR)\isle.exe"
|
||||||
CLEAN :
|
CLEAN :
|
||||||
-@erase "$(INTDIR)\define.obj"
|
-@erase "$(INTDIR)\define.obj"
|
||||||
-@erase "$(INTDIR)\isle.obj"
|
-@erase "$(INTDIR)\isle.obj"
|
||||||
|
-@erase "$(INTDIR)\isle.res"
|
||||||
-@erase "$(INTDIR)\main.obj"
|
-@erase "$(INTDIR)\main.obj"
|
||||||
-@erase "$(OUTDIR)\isle.exe"
|
-@erase "$(OUTDIR)\isle.exe"
|
||||||
|
|
||||||
|
@ -72,6 +73,7 @@ CPP_SBRS=.\.
|
||||||
MTL_PROJ=/nologo /D "NDEBUG" /win32
|
MTL_PROJ=/nologo /D "NDEBUG" /win32
|
||||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||||
|
RSC_PROJ=/l 0x409 /fo"$(INTDIR)/isle.res" /d "NDEBUG"
|
||||||
BSC32=bscmake.exe
|
BSC32=bscmake.exe
|
||||||
# ADD BASE BSC32 /nologo
|
# ADD BASE BSC32 /nologo
|
||||||
# ADD BSC32 /nologo
|
# ADD BSC32 /nologo
|
||||||
|
@ -89,6 +91,7 @@ LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
|
||||||
LINK32_OBJS= \
|
LINK32_OBJS= \
|
||||||
"$(INTDIR)\define.obj" \
|
"$(INTDIR)\define.obj" \
|
||||||
"$(INTDIR)\isle.obj" \
|
"$(INTDIR)\isle.obj" \
|
||||||
|
"$(INTDIR)\isle.res" \
|
||||||
"$(INTDIR)\main.obj"
|
"$(INTDIR)\main.obj"
|
||||||
|
|
||||||
"$(OUTDIR)\isle.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
"$(OUTDIR)\isle.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||||
|
@ -116,6 +119,7 @@ ALL : "$(OUTDIR)\isle.exe"
|
||||||
CLEAN :
|
CLEAN :
|
||||||
-@erase "$(INTDIR)\define.obj"
|
-@erase "$(INTDIR)\define.obj"
|
||||||
-@erase "$(INTDIR)\isle.obj"
|
-@erase "$(INTDIR)\isle.obj"
|
||||||
|
-@erase "$(INTDIR)\isle.res"
|
||||||
-@erase "$(INTDIR)\main.obj"
|
-@erase "$(INTDIR)\main.obj"
|
||||||
-@erase "$(INTDIR)\vc40.idb"
|
-@erase "$(INTDIR)\vc40.idb"
|
||||||
-@erase "$(INTDIR)\vc40.pdb"
|
-@erase "$(INTDIR)\vc40.pdb"
|
||||||
|
@ -137,6 +141,7 @@ CPP_SBRS=.\.
|
||||||
MTL_PROJ=/nologo /D "_DEBUG" /win32
|
MTL_PROJ=/nologo /D "_DEBUG" /win32
|
||||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||||
|
RSC_PROJ=/l 0x409 /fo"$(INTDIR)/isle.res" /d "_DEBUG"
|
||||||
BSC32=bscmake.exe
|
BSC32=bscmake.exe
|
||||||
# ADD BASE BSC32 /nologo
|
# ADD BASE BSC32 /nologo
|
||||||
# ADD BSC32 /nologo
|
# ADD BSC32 /nologo
|
||||||
|
@ -154,6 +159,7 @@ LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
|
||||||
LINK32_OBJS= \
|
LINK32_OBJS= \
|
||||||
"$(INTDIR)\define.obj" \
|
"$(INTDIR)\define.obj" \
|
||||||
"$(INTDIR)\isle.obj" \
|
"$(INTDIR)\isle.obj" \
|
||||||
|
"$(INTDIR)\isle.res" \
|
||||||
"$(INTDIR)\main.obj"
|
"$(INTDIR)\main.obj"
|
||||||
|
|
||||||
"$(OUTDIR)\isle.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
"$(OUTDIR)\isle.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||||
|
@ -213,6 +219,7 @@ SOURCE=.\app\isle.cpp
|
||||||
DEP_CPP_ISLE_=\
|
DEP_CPP_ISLE_=\
|
||||||
".\app\define.h"\
|
".\app\define.h"\
|
||||||
".\app\isle.h"\
|
".\app\isle.h"\
|
||||||
|
".\app\res\resource.h"\
|
||||||
".\lib\define.h"\
|
".\lib\define.h"\
|
||||||
".\lib\legoanimationmanager.h"\
|
".\lib\legoanimationmanager.h"\
|
||||||
".\lib\legobuildingmanager.h"\
|
".\lib\legobuildingmanager.h"\
|
||||||
|
@ -253,42 +260,33 @@ DEP_CPP_ISLE_=\
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=.\app\main.cpp
|
SOURCE=.\app\main.cpp
|
||||||
DEP_CPP_MAIN_=\
|
|
||||||
".\app\define.h"\
|
|
||||||
".\app\isle.h"\
|
|
||||||
".\lib\define.h"\
|
|
||||||
".\lib\legoanimationmanager.h"\
|
|
||||||
".\lib\legobuildingmanager.h"\
|
|
||||||
".\lib\legogamestate.h"\
|
|
||||||
".\lib\legoinputmanager.h"\
|
|
||||||
".\lib\legomodelpresenter.h"\
|
|
||||||
".\lib\legoomni.h"\
|
|
||||||
".\lib\legopartpresenter.h"\
|
|
||||||
".\lib\legoroi.h"\
|
|
||||||
".\lib\legovideomanager.h"\
|
|
||||||
".\lib\legoworldpresenter.h"\
|
|
||||||
".\lib\mxatomid.h"\
|
|
||||||
".\lib\mxbackgroundaudiomanager.h"\
|
|
||||||
".\lib\mxdsaction.h"\
|
|
||||||
".\lib\mxomnicreateflags.h"\
|
|
||||||
".\lib\mxomnicreateparam.h"\
|
|
||||||
".\lib\mxpalette.h"\
|
|
||||||
".\lib\mxrect32.h"\
|
|
||||||
".\lib\mxstreamcontroller.h"\
|
|
||||||
".\lib\mxstreamer.h"\
|
|
||||||
".\lib\mxstring.h"\
|
|
||||||
".\lib\mxticklemanager.h"\
|
|
||||||
".\lib\mxtimer.h"\
|
|
||||||
".\lib\mxtransitionmanager.h"\
|
|
||||||
".\lib\mxvariabletable.h"\
|
|
||||||
".\lib\mxvideoparam.h"\
|
|
||||||
".\lib\mxvideoparamflags.h"\
|
|
||||||
|
|
||||||
|
"$(INTDIR)\main.obj" : $(SOURCE) "$(INTDIR)"
|
||||||
"$(INTDIR)\main.obj" : $(SOURCE) $(DEP_CPP_MAIN_) "$(INTDIR)"
|
|
||||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||||
|
|
||||||
|
|
||||||
|
# End Source File
|
||||||
|
################################################################################
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\app\res\isle.rc
|
||||||
|
|
||||||
|
!IF "$(CFG)" == "isle - Win32 Release"
|
||||||
|
|
||||||
|
|
||||||
|
"$(INTDIR)\isle.res" : $(SOURCE) "$(INTDIR)"
|
||||||
|
$(RSC) /l 0x409 /fo"$(INTDIR)/isle.res" /i "app\res" /d "NDEBUG" $(SOURCE)
|
||||||
|
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "isle - Win32 Debug"
|
||||||
|
|
||||||
|
|
||||||
|
"$(INTDIR)\isle.res" : $(SOURCE) "$(INTDIR)"
|
||||||
|
$(RSC) /l 0x409 /fo"$(INTDIR)/isle.res" /i "app\res" /d "_DEBUG" $(SOURCE)
|
||||||
|
|
||||||
|
|
||||||
|
!ENDIF
|
||||||
|
|
||||||
# End Source File
|
# End Source File
|
||||||
# End Target
|
# End Target
|
||||||
# End Project
|
# End Project
|
||||||
|
|
BIN
isle.mdp
BIN
isle.mdp
Binary file not shown.
Loading…
Reference in a new issue