diff --git a/CMakeLists.txt b/CMakeLists.txt index a0601210c..a3f2a20b1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -372,6 +372,8 @@ add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/projects/CxbxLoader") add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/projects/CxbxEmulator") +add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/projects/CxbxGUI") + # Issues with compile (the same with develop branch) and # for some reason did not put the files into virtual folder? # Might need to put the list in the source folder for workaround fix. @@ -401,6 +403,6 @@ if(${CMAKE_GENERATOR} MATCHES "Visual Studio ([^9]|[9][0-9])") endif() # Cxbx-Reloaded project with third-party libraries -set_target_properties(cxbx CxbxLoader CxbxEmulator subhook XbSymbolDatabase libtommath libtomcrypt +set_target_properties(cxbx CxbxGUI CxbxLoader CxbxEmulator subhook XbSymbolDatabase libtommath libtomcrypt PROPERTIES FOLDER Cxbx-Reloaded ) diff --git a/projects/CxbxGUI/CMakeLists.txt b/projects/CxbxGUI/CMakeLists.txt new file mode 100644 index 000000000..b90741e17 --- /dev/null +++ b/projects/CxbxGUI/CMakeLists.txt @@ -0,0 +1,152 @@ +cmake_minimum_required (VERSION 3.12) +project(CxbxGUI) + +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_STANDARD 17) + +# Suppress extra stuff from generated solution +set(CMAKE_SUPPRESS_REGENERATION true) + +include_directories( + "${CXBXR_ROOT_DIR}/src" + "${CXBXR_ROOT_DIR}/src/common" + "${CXBXR_ROOT_DIR}/src/common/Win32" + "${CXBXR_ROOT_DIR}/import/OpenXDK/include" + "${CXBXR_ROOT_DIR}/import/XbSymbolDatabase" + "${CXBXR_ROOT_DIR}/import/simpleini" + "${CXBXR_ROOT_DIR}/import/DirectX9/include" + "${CXBXR_ROOT_DIR}/import/libtommath" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/headers" +) + +link_directories( + "${CXBXR_ROOT_DIR}/import/DirectX9/lib" +) + +if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") + add_compile_definitions( + _CRT_SECURE_NO_WARNINGS + # Windows 7 minimum requirement + _WIN32_WINNT=0x0601 + + LTM_DESC + USE_LTM + LTC_NO_TEST + LTC_NO_CIPHERS + LTC_NO_HASHES + LTC_NO_MACS + LTC_NO_PRNGS + LTC_NO_MISC + LTC_NO_PROTOTYPES + ) + add_compile_options( + /EHs + /MP + /GF + /arch:SSE2 + ) +endif() + +add_compile_definitions(NOMINMAX +) + +file (GLOB RESOURCES + + "${CXBXR_ROOT_DIR}/CONTRIBUTORS" + "${CXBXR_ROOT_DIR}/COPYING" + "${CXBXR_ROOT_DIR}/README.md" + "${CXBXR_ROOT_DIR}/src/gui/resource/.editorconfig" + "${CXBXR_ROOT_DIR}/src/gui/resource/CxbxGUI.rc" + "${CXBXR_ROOT_DIR}/src/gui/resource/Cxbx-R.ico" + "${CXBXR_ROOT_DIR}/src/gui/resource/resource.h" + "${CXBXR_ROOT_DIR}/src/gui/resource/stdafx.h" + "${CXBXR_ROOT_DIR}/src/gui/resource/targetver.h" + "${CXBXR_ROOT_DIR}/src/gui/resource/Logo.bmp" + "${CXBXR_ROOT_DIR}/src/gui/resource/Logo-License-CC4.bmp" + "${CXBXR_ROOT_DIR}/src/.editorconfig" +) + +source_group(TREE ${CXBXR_ROOT_DIR}/src PREFIX header FILES + ${CXBXR_HEADER_GUIv1} + ${CXBXR_HEADER_COMMON} + "${CXBXR_ROOT_DIR}/src/gui/CxbxGUI.h" +) + +source_group(TREE ${CXBXR_ROOT_DIR}/src PREFIX source FILES + ${CXBXR_SOURCE_GUIv1} + ${CXBXR_SOURCE_COMMON} + "${CXBXR_ROOT_DIR}/src/gui/CxbxGUI.cpp" + "${CXBXR_ROOT_DIR}/src/gui/stdafx.cpp" +) + +source_group(TREE ${CXBXR_ROOT_DIR} FILES ${RESOURCES}) + +add_executable(CxbxGUI WIN32 ${RESOURCES} +# ${CXBXR_HEADER_GUIv1} +# ${CXBXR_HEADER_COMMON} +# ${CXBXR_SOURCE_GUIv1} +# ${CXBXR_SOURCE_COMMON} + ${CXBXR_GIT_VERSION_H} + "${CXBXR_ROOT_DIR}/src/gui/CxbxGUI.h" + "${CXBXR_ROOT_DIR}/src/gui/CxbxGUI.cpp" + "${CXBXR_ROOT_DIR}/src/gui/stdafx.cpp" +) + +# Link and compile flags +if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") + + set_target_properties(CxbxGUI PROPERTIES + LINK_FLAGS " + /INCREMENTAL:NO + /LARGEADDRESSAWARE + /SAFESEH:NO + /NODEFAULTLIB:libcmt + " + LINK_FLAGS_RELEASE " + /LTCG + " + ) + + # Set optimization options for release build + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} + /Zi + /Ob2 + /Oi + /Ot + /GL + + /GS- + /Gy + /Qpar + " + ) +endif() + +# Windows libraries +set(WINS_LIB + legacy_stdio_definitions + d3d9 + dinput8 + dxguid + odbc32 + odbccp32 + Shlwapi + dxerr9 + ws2_32 + dsound + winmm + ddraw + d3dx9 + dbghelp + comctl32 + XINPUT9_1_0 +) + +target_link_libraries(CxbxGUI + PUBLIC XbSymbolDatabase + libtomcrypt + + ${WINS_LIB} +) + +add_dependencies(CxbxGUI CxbxEmulator cxbxr-debugger) diff --git a/projects/cxbx/CMakeLists.txt b/projects/cxbx/CMakeLists.txt index 706ba283d..d88349a27 100644 --- a/projects/cxbx/CMakeLists.txt +++ b/projects/cxbx/CMakeLists.txt @@ -72,11 +72,11 @@ file (GLOB RESOURCES "${CXBXR_ROOT_DIR}/CONTRIBUTORS" "${CXBXR_ROOT_DIR}/COPYING" "${CXBXR_ROOT_DIR}/README.md" - "${CXBXR_ROOT_DIR}/resource/.editorconfig" - "${CXBXR_ROOT_DIR}/resource/Cxbx.rc" - "${CXBXR_ROOT_DIR}/resource/Cxbx-R.ico" - "${CXBXR_ROOT_DIR}/resource/Logo.bmp" - "${CXBXR_ROOT_DIR}/resource/Logo-License-CC4.bmp" + "${CXBXR_ROOT_DIR}/src/gui/resource/.editorconfig" + "${CXBXR_ROOT_DIR}/src/gui/resource/Cxbx.rc" + "${CXBXR_ROOT_DIR}/src/gui/resource/Cxbx-R.ico" + "${CXBXR_ROOT_DIR}/src/gui/resource/Logo.bmp" + "${CXBXR_ROOT_DIR}/src/gui/resource/Logo-License-CC4.bmp" "${CXBXR_ROOT_DIR}/src/.editorconfig" ) diff --git a/src/CxbxDebugger/CMakeLists.txt b/src/CxbxDebugger/CMakeLists.txt index d002bec2b..e6572101c 100644 --- a/src/CxbxDebugger/CMakeLists.txt +++ b/src/CxbxDebugger/CMakeLists.txt @@ -119,7 +119,7 @@ add_executable(cxbxr-debugger WIN32 ${SOURCES} #Test WIN32 like cxbx does if doe set_target_properties(cxbxr-debugger PROPERTIES VS_DOTNET_REFERENCES "Microsoft.CSharp;System;System.Core;System.Data;System.Data.DataSetExtensions;System.Deployment;System.Drawing;System.Windows;System.Windows.Forms;System.Xml;System.Xml.Linq;System.Net.Http" - VS_GLOBAL_ApplicationIcon "${CXBXR_ROOT_DIR}/resource/Cxbx-R.ico" + VS_GLOBAL_ApplicationIcon "${CXBXR_ROOT_DIR}/src/gui/resource/Cxbx-R.ico" VS_GLOBAL_ROOTNAMESPACE "CxbxDebugger" diff --git a/src/common/input/Button.cpp b/src/common/input/Button.cpp index 4088a65b6..ad218af3a 100644 --- a/src/common/input/Button.cpp +++ b/src/common/input/Button.cpp @@ -28,7 +28,7 @@ #include "Button.h" #include "InputWindow.h" #include "layout_xbox_controller.h" // TODO: Needs a better fix for custom input device support. -#include "..\..\gui\ResCxbx.h" +#include "gui/resource/ResCxbx.h" void Button::EnableButton(bool enable) const diff --git a/src/common/input/EmuDevice.cpp b/src/common/input/EmuDevice.cpp index 5eab25daa..2b109e928 100644 --- a/src/common/input/EmuDevice.cpp +++ b/src/common/input/EmuDevice.cpp @@ -28,7 +28,7 @@ #include"Button.h" #include "InputManager.h" #include "layout_xbox_controller.h" -#include "..\..\gui\ResCxbx.h" +#include "gui/resource/ResCxbx.h" EmuDevice::EmuDevice(int type, HWND hwnd) diff --git a/src/common/input/InputWindow.cpp b/src/common/input/InputWindow.cpp index 41b3de712..80326f010 100644 --- a/src/common/input/InputWindow.cpp +++ b/src/common/input/InputWindow.cpp @@ -26,7 +26,7 @@ // ****************************************************************** #include "InputWindow.h" -#include "..\..\gui\ResCxbx.h" +#include "gui/resource/ResCxbx.h" #include "common\IPCHybrid.hpp" #include "EmuShared.h" #include diff --git a/src/common/input/layout_xbox_controller.h b/src/common/input/layout_xbox_controller.h index 5278de997..d60a5e233 100644 --- a/src/common/input/layout_xbox_controller.h +++ b/src/common/input/layout_xbox_controller.h @@ -28,7 +28,7 @@ #pragma once #ifndef CXBXR_EMU_EXPORTS -#include "gui/ResCxbx.h" +#include "gui/resource/ResCxbx.h" static int button_xbox_ctrl_id[XBOX_CTRL_NUM_BUTTONS] = { IDC_SET_DPAD_UP, diff --git a/src/common/win32/IPCWindows.cpp b/src/common/win32/IPCWindows.cpp index 1f491b25d..19eb2b681 100644 --- a/src/common/win32/IPCWindows.cpp +++ b/src/common/win32/IPCWindows.cpp @@ -31,7 +31,7 @@ #include "Cxbx.h" #include "core\kernel\init\CxbxKrnl.h" -#include "gui\ResCxbx.h" +#include "gui/resource/ResCxbx.h" #include "common\IPCHybrid.hpp" #include "EmuShared.h" diff --git a/src/core/hle/D3D8/Direct3D9/Direct3D9.cpp b/src/core/hle/D3D8/Direct3D9/Direct3D9.cpp index 0b6ae7412..e8ae724c3 100644 --- a/src/core/hle/D3D8/Direct3D9/Direct3D9.cpp +++ b/src/core/hle/D3D8/Direct3D9/Direct3D9.cpp @@ -55,7 +55,7 @@ namespace xboxkrnl #include "..\XbD3D8Logging.h" #include "core\hle\Intercept.hpp" // for bLLE_GPU #include "devices\video\nv2a.h" // For GET_MASK, NV_PGRAPH_CONTROL_0, PUSH_METHOD -#include "gui\ResCxbx.h" +#include "gui/resource/ResCxbx.h" #include "RenderStates.h" #include "TextureStates.h" #include "WalkIndexBuffer.h" diff --git a/src/core/kernel/init/CxbxKrnl.cpp b/src/core/kernel/init/CxbxKrnl.cpp index 266543511..834066917 100644 --- a/src/core/kernel/init/CxbxKrnl.cpp +++ b/src/core/kernel/init/CxbxKrnl.cpp @@ -34,7 +34,7 @@ namespace xboxkrnl #include }; -#include "gui\ResCxbx.h" +#include "gui/resource/ResCxbx.h" #include "core\kernel\init\CxbxKrnl.h" #include "common\xbdm\CxbxXbdm.h" // For Cxbx_LibXbdmThunkTable #include "CxbxVersion.h" diff --git a/src/gui/CxbxGUI.cpp b/src/gui/CxbxGUI.cpp new file mode 100644 index 000000000..cbb2bde3b --- /dev/null +++ b/src/gui/CxbxGUI.cpp @@ -0,0 +1,180 @@ +// CxbxGUI.cpp : Defines the entry point for the application. +// + +#include "stdafx.h" +#include "CxbxGUI.h" + +#define MAX_LOADSTRING 100 + +// Global Variables: +HINSTANCE hInst; // current instance +WCHAR szTitle[MAX_LOADSTRING]; // The title bar text +WCHAR szWindowClass[MAX_LOADSTRING]; // the main window class name + +// Forward declarations of functions included in this code module: +ATOM MyRegisterClass(HINSTANCE hInstance); +BOOL InitInstance(HINSTANCE, int); +LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); +INT_PTR CALLBACK About(HWND, UINT, WPARAM, LPARAM); + +int APIENTRY wWinMain(_In_ HINSTANCE hInstance, + _In_opt_ HINSTANCE hPrevInstance, + _In_ LPWSTR lpCmdLine, + _In_ int nCmdShow) +{ + UNREFERENCED_PARAMETER(hPrevInstance); + UNREFERENCED_PARAMETER(lpCmdLine); + + // TODO: Place code here. + + // Initialize global strings + LoadStringW(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING); + LoadStringW(hInstance, IDC_CXBXGUI, szWindowClass, MAX_LOADSTRING); + MyRegisterClass(hInstance); + + // Perform application initialization: + if (!InitInstance (hInstance, nCmdShow)) + { + return FALSE; + } + + HACCEL hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_CXBXGUI)); + + MSG msg; + + // Main message loop: + while (GetMessage(&msg, nullptr, 0, 0)) + { + if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) + { + TranslateMessage(&msg); + DispatchMessage(&msg); + } + } + + return (int) msg.wParam; +} + + + +// +// FUNCTION: MyRegisterClass() +// +// PURPOSE: Registers the window class. +// +ATOM MyRegisterClass(HINSTANCE hInstance) +{ + WNDCLASSEXW wcex; + + wcex.cbSize = sizeof(WNDCLASSEX); + + wcex.style = CS_HREDRAW | CS_VREDRAW; + wcex.lpfnWndProc = WndProc; + wcex.cbClsExtra = 0; + wcex.cbWndExtra = 0; + wcex.hInstance = hInstance; + wcex.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_CXBXGUI)); + wcex.hCursor = LoadCursor(nullptr, IDC_ARROW); + wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); + wcex.lpszMenuName = MAKEINTRESOURCEW(IDC_CXBXGUI); + wcex.lpszClassName = szWindowClass; + wcex.hIconSm = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_SMALL)); + + return RegisterClassExW(&wcex); +} + +// +// FUNCTION: InitInstance(HINSTANCE, int) +// +// PURPOSE: Saves instance handle and creates main window +// +// COMMENTS: +// +// In this function, we save the instance handle in a global variable and +// create and display the main program window. +// +BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) +{ + hInst = hInstance; // Store instance handle in our global variable + + HWND hWnd = CreateWindowW(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW, + CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, nullptr, nullptr, hInstance, nullptr); + + if (!hWnd) + { + return FALSE; + } + + ShowWindow(hWnd, nCmdShow); + UpdateWindow(hWnd); + + return TRUE; +} + +// +// FUNCTION: WndProc(HWND, UINT, WPARAM, LPARAM) +// +// PURPOSE: Processes messages for the main window. +// +// WM_COMMAND - process the application menu +// WM_PAINT - Paint the main window +// WM_DESTROY - post a quit message and return +// +// +LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) +{ + switch (message) + { + case WM_COMMAND: + { + int wmId = LOWORD(wParam); + // Parse the menu selections: + switch (wmId) + { + case IDM_ABOUT: + DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About); + break; + case IDM_EXIT: + DestroyWindow(hWnd); + break; + default: + return DefWindowProc(hWnd, message, wParam, lParam); + } + } + break; + case WM_PAINT: + { + PAINTSTRUCT ps; + HDC hdc = BeginPaint(hWnd, &ps); + // TODO: Add any drawing code that uses hdc here... + EndPaint(hWnd, &ps); + } + break; + case WM_DESTROY: + PostQuitMessage(0); + break; + default: + return DefWindowProc(hWnd, message, wParam, lParam); + } + return 0; +} + +// Message handler for about box. +INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) +{ + UNREFERENCED_PARAMETER(lParam); + switch (message) + { + case WM_INITDIALOG: + return (INT_PTR)TRUE; + + case WM_COMMAND: + if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL) + { + EndDialog(hDlg, LOWORD(wParam)); + return (INT_PTR)TRUE; + } + break; + } + return (INT_PTR)FALSE; +} diff --git a/src/gui/CxbxGUI.h b/src/gui/CxbxGUI.h new file mode 100644 index 000000000..466b4b071 --- /dev/null +++ b/src/gui/CxbxGUI.h @@ -0,0 +1,3 @@ +#pragma once + +#include "resource/resource.h" diff --git a/src/gui/DlgAbout.cpp b/src/gui/DlgAbout.cpp index e8f9d572a..cc9363572 100644 --- a/src/gui/DlgAbout.cpp +++ b/src/gui/DlgAbout.cpp @@ -29,7 +29,7 @@ #include "CxbxVersion.h" #include "DlgAbout.h" -#include "ResCxbx.h" +#include "resource/ResCxbx.h" #include "common\util\CxbxUtil.h" #include diff --git a/src/gui/DlgAudioConfig.cpp b/src/gui/DlgAudioConfig.cpp index 1cc4a98ff..8c323f255 100644 --- a/src/gui/DlgAudioConfig.cpp +++ b/src/gui/DlgAudioConfig.cpp @@ -28,7 +28,7 @@ #include "common\Settings.hpp" // for g_Settings #include "DlgAudioConfig.h" -#include "ResCxbx.h" +#include "resource/ResCxbx.h" #include diff --git a/src/gui/DlgDukeControllerConfig.cpp b/src/gui/DlgDukeControllerConfig.cpp index 13ae0fe7c..65eb9ac47 100644 --- a/src/gui/DlgDukeControllerConfig.cpp +++ b/src/gui/DlgDukeControllerConfig.cpp @@ -26,7 +26,7 @@ // ****************************************************************** #include "Windows.h" -#include "ResCxbx.h" +#include "resource/ResCxbx.h" #include "input\InputWindow.h" #include "gui\DlgInputConfig.h" diff --git a/src/gui/DlgEepromConfig.cpp b/src/gui/DlgEepromConfig.cpp index 1f7964881..96013edb4 100644 --- a/src/gui/DlgEepromConfig.cpp +++ b/src/gui/DlgEepromConfig.cpp @@ -30,7 +30,7 @@ #include "EmuEEPROM.h" // For EEPROMInfo, EEPROMInfos #include "core\kernel\init\CxbxKrnl.h" #include "DlgEepromConfig.h" -#include "ResCxbx.h" +#include "resource/ResCxbx.h" #include diff --git a/src/gui/DlgInputConfig.cpp b/src/gui/DlgInputConfig.cpp index dc340e10b..29575b6e6 100644 --- a/src/gui/DlgInputConfig.cpp +++ b/src/gui/DlgInputConfig.cpp @@ -27,7 +27,7 @@ #include "windows.h" #include "DlgDukeControllerConfig.h" -#include "ResCxbx.h" +#include "resource/ResCxbx.h" #include "input\InputManager.h" #include "Logging.h" #include "Settings.hpp" diff --git a/src/gui/DlgLoggingConfig.cpp b/src/gui/DlgLoggingConfig.cpp index 679c31d54..233b7577d 100644 --- a/src/gui/DlgLoggingConfig.cpp +++ b/src/gui/DlgLoggingConfig.cpp @@ -26,7 +26,7 @@ #include "Logging.h" #include "EmuShared.h" #include "DlgLoggingConfig.h" -#include "ResCxbx.h" +#include "resource/ResCxbx.h" #include "common\IPCHybrid.hpp" diff --git a/src/gui/DlgNetworkConfig.cpp b/src/gui/DlgNetworkConfig.cpp index 680cf1b9f..2b4b99d80 100644 --- a/src/gui/DlgNetworkConfig.cpp +++ b/src/gui/DlgNetworkConfig.cpp @@ -29,7 +29,7 @@ #include "EmuShared.h" #include "DlgNetworkConfig.h" -#include "ResCxbx.h" +#include "resource/ResCxbx.h" #include diff --git a/src/gui/DlgVideoConfig.cpp b/src/gui/DlgVideoConfig.cpp index fefb0d18e..69eacf54b 100644 --- a/src/gui/DlgVideoConfig.cpp +++ b/src/gui/DlgVideoConfig.cpp @@ -31,7 +31,7 @@ #include "common\Settings.hpp" // for g_Settings #include "DlgVideoConfig.h" -#include "ResCxbx.h" +#include "resource/ResCxbx.h" #include "core\hle\D3D8\Direct3D9\Direct3D9.h" // For IDirect3D diff --git a/src/gui/Wnd.cpp b/src/gui/Wnd.cpp index 24186788b..d66e71b09 100644 --- a/src/gui/Wnd.cpp +++ b/src/gui/Wnd.cpp @@ -25,7 +25,7 @@ // * // ****************************************************************** #include "Wnd.h" -#include "ResCxbx.h" +#include "resource/ResCxbx.h" // ****************************************************************** // * constructor diff --git a/src/gui/WndMain.cpp b/src/gui/WndMain.cpp index 76cfe91bf..dd7dbc159 100644 --- a/src/gui/WndMain.cpp +++ b/src/gui/WndMain.cpp @@ -45,7 +45,7 @@ #include "common\Settings.hpp" #include "core\kernel\init\CxbxKrnl.h" // For CxbxConvertArgToString and CxbxExec -#include "ResCxbx.h" +#include "resource/ResCxbx.h" #include "CxbxVersion.h" #include "Shlwapi.h" diff --git a/resource/.editorconfig b/src/gui/resource/.editorconfig similarity index 100% rename from resource/.editorconfig rename to src/gui/resource/.editorconfig diff --git a/resource/Cxbx-R.ico b/src/gui/resource/Cxbx-R.ico similarity index 100% rename from resource/Cxbx-R.ico rename to src/gui/resource/Cxbx-R.ico diff --git a/resource/Cxbx.rc b/src/gui/resource/Cxbx.rc similarity index 98% rename from resource/Cxbx.rc rename to src/gui/resource/Cxbx.rc index 71592116d..bd16a4b27 100644 --- a/resource/Cxbx.rc +++ b/src/gui/resource/Cxbx.rc @@ -1,6 +1,6 @@ // Microsoft Visual C++ generated resource script. // -#include "..\src\gui\ResCxbx.h" +#include "ResCxbx.h" #define APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// diff --git a/src/gui/resource/CxbxGUI.rc b/src/gui/resource/CxbxGUI.rc new file mode 100644 index 000000000..92eeeb037 --- /dev/null +++ b/src/gui/resource/CxbxGUI.rc @@ -0,0 +1,148 @@ +//Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#ifndef APSTUDIO_INVOKED +#include "../targetver.h" +#endif +#define APSTUDIO_HIDDEN_SYMBOLS +#include "windows.h" +#undef APSTUDIO_HIDDEN_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE 9, 1 + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. + +IDI_CXBXGUI ICON "Cxbx-R.ico" + +///////////////////////////////////////////////////////////////////////////// +// +// Menu +// + +IDC_CXBXGUI MENU +BEGIN + POPUP "&File" + BEGIN + MENUITEM "E&xit", IDM_EXIT + END + POPUP "&Help" + BEGIN + MENUITEM "&About ...", IDM_ABOUT + END +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Accelerator +// + +IDC_CXBXGUI ACCELERATORS +BEGIN + "?", IDM_ABOUT, ASCII, ALT + "/", IDM_ABOUT, ASCII, ALT +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_ABOUTBOX DIALOGEX 0, 0, 170, 62 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "About CxbxGUI" +FONT 8, "MS Shell Dlg" +BEGIN + ICON IDR_MAINFRAME,IDC_STATIC,14,14,21,20 + LTEXT "CxbxGUI, Version 1.0",IDC_STATIC,42,14,114,8,SS_NOPREFIX + LTEXT "Copyright (C) 2019",IDC_STATIC,42,26,114,8 + DEFPUSHBUTTON "OK",IDOK,113,41,50,14,WS_GROUP +END + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO +BEGIN + IDD_ABOUTBOX, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 163 + TOPMARGIN, 7 + BOTTOMMARGIN, 55 + END +END +#endif // APSTUDIO_INVOKED + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#ifndef APSTUDIO_INVOKED\r\n" + "#include ""targetver.h""\r\n" + "#endif\r\n" + "#define APSTUDIO_HIDDEN_SYMBOLS\r\n" + "#include ""windows.h""\r\n" + "#undef APSTUDIO_HIDDEN_SYMBOLS\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE +BEGIN + IDC_CXBXGUI "CXBXGUI" + IDS_APP_TITLE "CxbxGUI" +END + +#endif +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED diff --git a/resource/Icon-License-CC4.svg b/src/gui/resource/Icon-License-CC4.svg similarity index 100% rename from resource/Icon-License-CC4.svg rename to src/gui/resource/Icon-License-CC4.svg diff --git a/resource/Logo-License-CC4.bmp b/src/gui/resource/Logo-License-CC4.bmp similarity index 100% rename from resource/Logo-License-CC4.bmp rename to src/gui/resource/Logo-License-CC4.bmp diff --git a/resource/Logo-License-CC4.svg b/src/gui/resource/Logo-License-CC4.svg similarity index 100% rename from resource/Logo-License-CC4.svg rename to src/gui/resource/Logo-License-CC4.svg diff --git a/resource/Logo.bmp b/src/gui/resource/Logo.bmp similarity index 100% rename from resource/Logo.bmp rename to src/gui/resource/Logo.bmp diff --git a/src/gui/ResCxbx.h b/src/gui/resource/ResCxbx.h similarity index 100% rename from src/gui/ResCxbx.h rename to src/gui/resource/ResCxbx.h diff --git a/src/gui/resource/resource.h b/src/gui/resource/resource.h new file mode 100644 index 000000000..a11a8af61 --- /dev/null +++ b/src/gui/resource/resource.h @@ -0,0 +1,31 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by CxbxGUI.rc +// + +#define IDS_APP_TITLE 103 + +#define IDR_MAINFRAME 128 +#define IDD_CXBXGUI_DIALOG 102 +#define IDD_ABOUTBOX 103 +#define IDM_ABOUT 104 +#define IDM_EXIT 105 +#define IDI_CXBXGUI 107 +#define IDI_SMALL 108 +#define IDC_CXBXGUI 109 +#define IDC_MYICON 2 +#ifndef IDC_STATIC +#define IDC_STATIC -1 +#endif +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS + +#define _APS_NO_MFC 130 +#define _APS_NEXT_RESOURCE_VALUE 129 +#define _APS_NEXT_COMMAND_VALUE 32771 +#define _APS_NEXT_CONTROL_VALUE 1000 +#define _APS_NEXT_SYMED_VALUE 110 +#endif +#endif diff --git a/src/gui/stdafx.cpp b/src/gui/stdafx.cpp new file mode 100644 index 000000000..ed67f97f8 --- /dev/null +++ b/src/gui/stdafx.cpp @@ -0,0 +1,8 @@ +// stdafx.cpp : source file that includes just the standard includes +// CxbxGUI.pch will be the pre-compiled header +// stdafx.obj will contain the pre-compiled type information + +#include "stdafx.h" + +// TODO: reference any additional headers you need in STDAFX.H +// and not in this file diff --git a/src/gui/stdafx.h b/src/gui/stdafx.h new file mode 100644 index 000000000..de0dfa3cd --- /dev/null +++ b/src/gui/stdafx.h @@ -0,0 +1,21 @@ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#pragma once + +#include "targetver.h" + +#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers +// Windows Header Files: +#include + +// C RunTime Header Files +#include +#include +#include +#include + + +// TODO: reference additional headers your program requires here diff --git a/src/gui/targetver.h b/src/gui/targetver.h new file mode 100644 index 000000000..90e767bfc --- /dev/null +++ b/src/gui/targetver.h @@ -0,0 +1,8 @@ +#pragma once + +// Including SDKDDKVer.h defines the highest available Windows platform. + +// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and +// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. + +#include diff --git a/src/vsbc/DlgVirtualSBCFeedback.cpp b/src/vsbc/DlgVirtualSBCFeedback.cpp index 62085737f..95f512897 100644 --- a/src/vsbc/DlgVirtualSBCFeedback.cpp +++ b/src/vsbc/DlgVirtualSBCFeedback.cpp @@ -30,7 +30,7 @@ #include "Winuser.h" #include "Windowsx.h" #include "Commctrl.h" -#include "../gui/ResCxbx.h" +#include "../gui/resource/ResCxbx.h" #include