1
0
Fork 0
mirror of https://github.com/k4zmu2a/SpaceCadetPinball.git synced 2024-12-22 20:06:22 +01:00

winmain v2.

FuncStats doc.
This commit is contained in:
oz 2020-11-07 18:41:14 +03:00
parent 7db64ae1c6
commit a925b6137f
19 changed files with 126 additions and 22 deletions

BIN
FuncStats.xlsx Normal file

Binary file not shown.

View file

@ -4,3 +4,7 @@
void Sound::Enable(int a1, int a2, int a3)
{
}
void Sound::nullsub_1(int a1, int a2, int a3)
{
}

View file

@ -1,6 +1,7 @@
#pragma once
class Sound
{public:
{
public:
static void Enable(int a1, int a2, int a3);
static void nullsub_1(int a1, int a2, int a3);
};

View file

@ -155,6 +155,7 @@
<ItemGroup>
<ClInclude Include="DatParser.h" />
<ClInclude Include="fullscrn.h" />
<ClInclude Include="gdrv.h" />
<ClInclude Include="loader.h" />
<ClInclude Include="memory.h" />
<ClInclude Include="objlist_class.h" />
@ -203,6 +204,7 @@
<ItemGroup>
<ClCompile Include="DatParser.cpp" />
<ClCompile Include="fullscrn.cpp" />
<ClCompile Include="gdrv.cpp" />
<ClCompile Include="loader.cpp" />
<ClCompile Include="memory.cpp" />
<ClCompile Include="objlist_class.cpp" />

View file

@ -159,6 +159,9 @@
<ClInclude Include="fullscrn.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="gdrv.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="pch.cpp">
@ -296,6 +299,9 @@
<ClCompile Include="fullscrn.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="gdrv.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<Natvis Include="NatvisFile.natvis" />

View file

@ -1,2 +1,8 @@
#include "pch.h"
#include "TTextBox.h"
int TTextBox::Message(int a2, float a3)
{
return 0;
}

View file

@ -1,11 +1,13 @@
#pragma once
#include "TPinballComponent.h"
class TTextBox :
public TPinballComponent
public TPinballComponent
{
public:
TTextBox(TPinballTable* table, int groupIndex) : TPinballComponent(table, groupIndex, false)
{
}
};
int Message(int a2, float a3) override;
};

View file

@ -157,3 +157,8 @@ void fullscrn::GetWindowCenter()
if (MenuEnabled)
yDest -= GetSystemMetrics(15);
}
void fullscrn::force_redraw()
{
BYTE1(fullscrn_flag1) |= 0x80u;
}

View file

@ -17,6 +17,7 @@ public:
static int trick;
static int set_screen_mode(int isFullscreen);
static void force_redraw();
private :
static int MenuEnabled;
static HMENU MenuHandle;

View file

@ -0,0 +1,6 @@
#include "pch.h"
#include "gdrv.h"
void gdrv::get_focus()
{
}

7
SpaceCadetPinball/gdrv.h Normal file
View file

@ -0,0 +1,7 @@
#pragma once
class gdrv
{
public:
static void get_focus();
};

View file

@ -17,3 +17,8 @@ void pb::firsttime_setup()
render::update();
render::blit = 1;
}
void pb::paint()
{
render::paint();
}

View file

@ -6,6 +6,7 @@ class pb
public:
static void reset_table();
static void firsttime_setup();
static void paint();
private:
static TPinballTable* MainTable;
};

View file

@ -6,3 +6,11 @@ int render::blit = 0;
void render::update()
{
}
void render::paint()
{
/*render_paint_balls();
gdrv_blat((int)&vscreen, xDest, yDest);
render_unpaint_balls();*/
}

View file

@ -4,5 +4,6 @@ class render
public:
static int blit;
static void update();
static void paint();
};

View file

@ -5,6 +5,11 @@
#include "partman.h"
int score::init()
{
return 1;
}
scoreStruct* score::create(LPCSTR fieldName, int renderBgBmp)
{
scoreStruct* score = (scoreStruct*)memory::allocate(sizeof(scoreStruct));

View file

@ -1,6 +1,6 @@
#pragma once
struct scoreStruct
struct scoreStruct
{
int Unknown1;
int Unknown2;
@ -24,7 +24,7 @@ struct scoreStruct
class score
{
public:
static int init();
static scoreStruct* create(LPCSTR fieldName, int renderBgBmp);
static scoreStruct* dup(scoreStruct* score, int scoreIndex);
};

View file

@ -7,16 +7,16 @@
#include "options.h"
#include "pb.h"
int iFrostUniqueMsg, return_value = 0, bQuit = 0;
int check_expiration_date()
{
return 0;
}
int winmain::iFrostUniqueMsg, winmain::return_value = 0, winmain::bQuit = 0;
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
{
memory::init(winmain_memalloc_failure);
return winmain::WinMain(hInstance, hPrevInstance, lpCmdLine, nShowCmd);
}
int winmain::WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
{
memory::init(memalloc_failure);
++memory::critical_allocation;
auto optionsRegPath = pinball::get_rc_string(165, 0);
options::path_init(optionsRegPath);
@ -97,7 +97,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
if (check_expiration_date())
return 0;
INITCOMMONCONTROLSEX picce{};
INITCOMMONCONTROLSEX picce;
picce.dwSize = 8;
picce.dwICC = 5885;
InitCommonControlsEx(&picce);
@ -157,7 +157,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
MSG wndMessage{};
while (timeGetTime() >= startTime && timeGetTime() - startTime < 2000)
PeekMessageA(&wndMessage, pinball::hwnd_frame, 0, 0, 1u);
while (true)
{
if (!ProcessWindowMessages() || bQuit)
@ -168,12 +168,12 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
return return_value;
}
LRESULT CALLBACK message_handler(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
LRESULT CALLBACK winmain::message_handler(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
{
return DefWindowProcA(hWnd, Msg, wParam, lParam);
}
int ProcessWindowMessages()
int winmain::ProcessWindowMessages()
{
MSG Msg{}; // [esp+8h] [ebp-1Ch]
@ -202,7 +202,7 @@ int ProcessWindowMessages()
return 1;
}
void winmain_memalloc_failure()
void winmain::memalloc_failure()
{
/*midi_music_stop();
Sound_Close();
@ -212,3 +212,36 @@ void winmain_memalloc_failure()
MessageBoxA(nullptr, text, caption, 0x2030u);
_exit(1);
}
int winmain::check_expiration_date()
{
return 0;
}
HDC winmain::_BeginPaint(HWND hWnd, LPPAINTSTRUCT lpPaint)
{
HDC context = BeginPaint(hWnd, lpPaint);
if (hWnd && GetLayout(context) & 1)
SetLayout(context, 0);
return context;
}
HDC winmain::_GetDC(HWND hWnd)
{
HDC context = GetDC(hWnd);
if (hWnd && GetLayout(context) & 1)
SetLayout(context, 0);
return context;
}
int winmain::a_dialog(HINSTANCE hInstance, HWND hWnd)
{
char appName[100];
char szOtherStuff[100];
lstrcpyA(appName, pinball::get_rc_string(38, 0));
lstrcpyA(szOtherStuff, pinball::get_rc_string(102, 0));
auto icon = LoadIconA(hInstance, "ICON_1");
return ShellAboutA(hWnd, appName, szOtherStuff, icon);
}

View file

@ -1,6 +1,17 @@
#pragma once
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd);
static void winmain_memalloc_failure();
static LRESULT CALLBACK message_handler(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
int ProcessWindowMessages();
class winmain
{
public:
static int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd);
static LRESULT CALLBACK message_handler(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
static void memalloc_failure();
static int ProcessWindowMessages();
static int check_expiration_date();
static HDC _GetDC(HWND hWnd);
static int a_dialog(HINSTANCE hInstance, HWND hWnd);
private:
static int iFrostUniqueMsg, return_value , bQuit;
static HDC _BeginPaint(HWND hWnd, LPPAINTSTRUCT lpPaint);
};