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::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 #pragma once
class Sound class Sound
{public: {
public:
static void Enable(int a1, int a2, int a3); 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> <ItemGroup>
<ClInclude Include="DatParser.h" /> <ClInclude Include="DatParser.h" />
<ClInclude Include="fullscrn.h" /> <ClInclude Include="fullscrn.h" />
<ClInclude Include="gdrv.h" />
<ClInclude Include="loader.h" /> <ClInclude Include="loader.h" />
<ClInclude Include="memory.h" /> <ClInclude Include="memory.h" />
<ClInclude Include="objlist_class.h" /> <ClInclude Include="objlist_class.h" />
@ -203,6 +204,7 @@
<ItemGroup> <ItemGroup>
<ClCompile Include="DatParser.cpp" /> <ClCompile Include="DatParser.cpp" />
<ClCompile Include="fullscrn.cpp" /> <ClCompile Include="fullscrn.cpp" />
<ClCompile Include="gdrv.cpp" />
<ClCompile Include="loader.cpp" /> <ClCompile Include="loader.cpp" />
<ClCompile Include="memory.cpp" /> <ClCompile Include="memory.cpp" />
<ClCompile Include="objlist_class.cpp" /> <ClCompile Include="objlist_class.cpp" />

View File

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

View File

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

View File

@ -1,11 +1,13 @@
#pragma once #pragma once
#include "TPinballComponent.h" #include "TPinballComponent.h"
class TTextBox : class TTextBox :
public TPinballComponent public TPinballComponent
{ {
public: public:
TTextBox(TPinballTable* table, int groupIndex) : TPinballComponent(table, groupIndex, false) 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) if (MenuEnabled)
yDest -= GetSystemMetrics(15); yDest -= GetSystemMetrics(15);
} }
void fullscrn::force_redraw()
{
BYTE1(fullscrn_flag1) |= 0x80u;
}

View File

@ -17,6 +17,7 @@ public:
static int trick; static int trick;
static int set_screen_mode(int isFullscreen); static int set_screen_mode(int isFullscreen);
static void force_redraw();
private : private :
static int MenuEnabled; static int MenuEnabled;
static HMENU MenuHandle; 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::update();
render::blit = 1; render::blit = 1;
} }
void pb::paint()
{
render::paint();
}

View File

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

View File

@ -6,3 +6,11 @@ int render::blit = 0;
void render::update() 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: public:
static int blit; static int blit;
static void update(); static void update();
static void paint();
}; };

View File

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

View File

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

View File

@ -7,16 +7,16 @@
#include "options.h" #include "options.h"
#include "pb.h" #include "pb.h"
int iFrostUniqueMsg, return_value = 0, bQuit = 0; int winmain::iFrostUniqueMsg, winmain::return_value = 0, winmain::bQuit = 0;
int check_expiration_date()
{
return 0;
}
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) 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; ++memory::critical_allocation;
auto optionsRegPath = pinball::get_rc_string(165, 0); auto optionsRegPath = pinball::get_rc_string(165, 0);
options::path_init(optionsRegPath); options::path_init(optionsRegPath);
@ -97,7 +97,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
if (check_expiration_date()) if (check_expiration_date())
return 0; return 0;
INITCOMMONCONTROLSEX picce{}; INITCOMMONCONTROLSEX picce;
picce.dwSize = 8; picce.dwSize = 8;
picce.dwICC = 5885; picce.dwICC = 5885;
InitCommonControlsEx(&picce); InitCommonControlsEx(&picce);
@ -157,7 +157,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
MSG wndMessage{}; MSG wndMessage{};
while (timeGetTime() >= startTime && timeGetTime() - startTime < 2000) while (timeGetTime() >= startTime && timeGetTime() - startTime < 2000)
PeekMessageA(&wndMessage, pinball::hwnd_frame, 0, 0, 1u); PeekMessageA(&wndMessage, pinball::hwnd_frame, 0, 0, 1u);
while (true) while (true)
{ {
if (!ProcessWindowMessages() || bQuit) if (!ProcessWindowMessages() || bQuit)
@ -168,12 +168,12 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
return return_value; 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); return DefWindowProcA(hWnd, Msg, wParam, lParam);
} }
int ProcessWindowMessages() int winmain::ProcessWindowMessages()
{ {
MSG Msg{}; // [esp+8h] [ebp-1Ch] MSG Msg{}; // [esp+8h] [ebp-1Ch]
@ -202,7 +202,7 @@ int ProcessWindowMessages()
return 1; return 1;
} }
void winmain_memalloc_failure() void winmain::memalloc_failure()
{ {
/*midi_music_stop(); /*midi_music_stop();
Sound_Close(); Sound_Close();
@ -212,3 +212,36 @@ void winmain_memalloc_failure()
MessageBoxA(nullptr, text, caption, 0x2030u); MessageBoxA(nullptr, text, caption, 0x2030u);
_exit(1); _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 #pragma once
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd); class winmain
static void winmain_memalloc_failure(); {
static LRESULT CALLBACK message_handler(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); public:
int ProcessWindowMessages(); 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);
};