code cleanup
This commit is contained in:
parent
92c0d7fc7b
commit
da20cd9ec2
4
Cxbx.dsp
4
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
|
||||
|
|
|
@ -33,8 +33,8 @@
|
|||
// ******************************************************************
|
||||
#include "Cxbx.h"
|
||||
|
||||
#include <memory.h>
|
||||
#include <stdio.h>
|
||||
#include <memory.h>
|
||||
|
||||
// ******************************************************************
|
||||
// * constructor
|
||||
|
|
|
@ -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 <memory.h>
|
||||
}
|
||||
using namespace win32;
|
||||
|
||||
// ******************************************************************
|
||||
// * constructor
|
||||
|
|
|
@ -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;
|
||||
}
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue