diff --git a/Cxbx.dsp b/Cxbx.dsp index 9e9a7d514..8b4af123b 100644 --- a/Cxbx.dsp +++ b/Cxbx.dsp @@ -145,10 +145,6 @@ SOURCE=.\Include\Cxbx.h # End Source File # Begin Source File -SOURCE=.\Resource\CxbxRes.h -# End Source File -# Begin Source File - SOURCE=.\Include\Win32\Cxbx\EmuExe.h # End Source File # Begin Source File diff --git a/Source/Core/Exe.cpp b/Source/Core/Exe.cpp index 21a465240..ba8e5fff9 100644 --- a/Source/Core/Exe.cpp +++ b/Source/Core/Exe.cpp @@ -33,8 +33,8 @@ // ****************************************************************** #include "Cxbx.h" -#include #include +#include // ****************************************************************** // * constructor diff --git a/Source/Win32/Cxbx/EmuExe.cpp b/Source/Win32/Cxbx/EmuExe.cpp index 4d3efa868..b70f6a96b 100644 --- a/Source/Win32/Cxbx/EmuExe.cpp +++ b/Source/Win32/Cxbx/EmuExe.cpp @@ -32,20 +32,12 @@ // * // ****************************************************************** #include "Cxbx.h" - #include "EmuExe.h" #include "Prolog.h" #include "EmuX.h" -using namespace win32; -// ****************************************************************** -// * prevent name collisions -// ****************************************************************** -namespace win32 -{ - #include -} +using namespace win32; // ****************************************************************** // * constructor diff --git a/Source/Win32/Cxbx/WinMain.cpp b/Source/Win32/Cxbx/WinMain.cpp index 42788450f..645e38bd3 100644 --- a/Source/Win32/Cxbx/WinMain.cpp +++ b/Source/Win32/Cxbx/WinMain.cpp @@ -43,28 +43,25 @@ // ****************************************************************** int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { - WndMain *caustik = new WndMain(hInstance); + WndMain *MainWindow = new WndMain(hInstance); - if(__argc > 1) - { - while(!caustik->isCreated() && caustik->ProcessMessages()) - Sleep(10); - - if(caustik->GetError() == 0) - { - caustik->OpenXbe(__argv[1]); - - caustik->StartEmulation(true); - } - } - - while(caustik->GetError() == 0 && caustik->ProcessMessages()) + while(!MainWindow->isCreated() && MainWindow->ProcessMessages()) Sleep(10); - if(caustik->GetError() != 0) - MessageBox(NULL, caustik->GetError(), "Cxbx", MB_OK); + if(__argc > 1 && MainWindow->GetError() == 0) + { + MainWindow->OpenXbe(__argv[1]); - delete caustik; + MainWindow->StartEmulation(true); + } + + while(MainWindow->GetError() == 0 && MainWindow->ProcessMessages()) + Sleep(10); + + if(MainWindow->GetError() != 0) + MessageBox(NULL, MainWindow->GetError(), "Cxbx", MB_OK); + + delete MainWindow; return 0; } \ No newline at end of file diff --git a/Source/Win32/Cxbx/WndAbout.cpp b/Source/Win32/Cxbx/WndAbout.cpp index f7188fdfd..0beeabf25 100644 --- a/Source/Win32/Cxbx/WndAbout.cpp +++ b/Source/Win32/Cxbx/WndAbout.cpp @@ -36,9 +36,9 @@ #include "ResCxbx.h" -// ****************************************************************** -// * constructor -// ****************************************************************** +// ****************************************************************** +// * constructor +// ****************************************************************** WndAbout::WndAbout(HINSTANCE x_hInstance, HWND x_parent) : Wnd(x_hInstance) { m_classname = "WndAbout"; @@ -47,9 +47,9 @@ WndAbout::WndAbout(HINSTANCE x_hInstance, HWND x_parent) : Wnd(x_hInstance) m_w = 285; m_h = 180; - // ****************************************************************** - // * center to parent - // ****************************************************************** + // ****************************************************************** + // * center to parent + // ****************************************************************** { RECT rect; @@ -107,35 +107,32 @@ LRESULT CALLBACK WndAbout::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l HDC hDC = GetDC(hwnd); - // ****************************************************************** - // * draw window - // ****************************************************************** + HGDIOBJ OrgObj = SelectObject(hDC, m_hFont); + + // ****************************************************************** + // * draw bottom URL bar + // ****************************************************************** { - HGDIOBJ OrgObj = SelectObject(hDC, m_hFont); + SetBkColor(hDC, GetSysColor(COLOR_HIGHLIGHT)); - // ****************************************************************** - // * draw bottom URL bar - // ****************************************************************** - { - SetBkColor(hDC, GetSysColor(COLOR_HIGHLIGHT)); + SetTextColor(hDC, GetSysColor(COLOR_HIGHLIGHTTEXT)); - SetTextColor(hDC, GetSysColor(COLOR_HIGHLIGHTTEXT)); + char buffer[] = " Contact the author : caustik@caustik.com"; - char buffer[] = " Contact the author : caustik@caustik.com"; + RECT rect = {0, 134, 280, 148}; - RECT rect = {0, 134, 280, 148}; - - ExtTextOut(hDC, 0, 134, ETO_OPAQUE, &rect, buffer, strlen(buffer), 0); - } - - // ****************************************************************** - // * draw bitmap - // ****************************************************************** - BitBlt(hDC, 2, 4, 275, 125, m_BackDC, 0, 0, SRCCOPY); - - SelectObject(hDC, OrgObj); + ExtTextOut(hDC, 0, 134, ETO_OPAQUE, &rect, buffer, strlen(buffer), 0); } + // ****************************************************************** + // * draw bitmap + // ****************************************************************** + { + BitBlt(hDC, 2, 4, 275, 125, m_BackDC, 0, 0, SRCCOPY); + } + + SelectObject(hDC, OrgObj); + if(hDC != NULL) ReleaseDC(hwnd, hDC);