From 6a47974b369baa25b40c49e54aea56ed65217935 Mon Sep 17 00:00:00 2001
From: xezon <4720891+xezon@users.noreply.github.com>
Date: Tue, 22 Apr 2025 19:13:45 +0200
Subject: [PATCH] [CORE] Move DebugWindow tool to Core
---
Core/Tools/CMakeLists.txt | 2 +-
Core/Tools/DebugWindow/CMakeLists.txt | 28 +++
.../Tools/DebugWindow/DebugWindow.cpp | 0
.../Tools/DebugWindow/DebugWindow.def | 0
.../Tools/DebugWindow/DebugWindow.h | 0
.../Tools/DebugWindow/DebugWindow.rc | 0
.../Tools/DebugWindow/DebugWindowDialog.cpp | 0
.../Tools/DebugWindow/DebugWindowDialog.h | 0
.../Tools/DebugWindow/DebugWindowExport.h | 0
.../Tools/DebugWindow/Resource.h | 0
.../Tools/DebugWindow/StdAfx.cpp | 0
.../Code => Core}/Tools/DebugWindow/StdAfx.h | 0
.../Tools/DebugWindow/post-build.bat | 0
.../Tools/DebugWindow/res/DebugWindow.rc2 | 0
Generals/Code/Tools/CMakeLists.txt | 1 -
.../Code/Tools/DebugWindow/CMakeLists.txt | 29 ---
.../Code/Tools/DebugWindow/DebugWindow.cpp | 228 ------------------
Generals/Code/Tools/DebugWindow/DebugWindow.h | 72 ------
.../Tools/DebugWindow/DebugWindowDialog.cpp | 226 -----------------
.../Tools/DebugWindow/DebugWindowDialog.h | 82 -------
.../Tools/DebugWindow/DebugWindowExport.h | 52 ----
Generals/Code/Tools/DebugWindow/Resource.h | 26 --
Generals/Code/Tools/DebugWindow/StdAfx.cpp | 26 --
Generals/Code/Tools/DebugWindow/StdAfx.h | 65 -----
GeneralsMD/Code/Tools/CMakeLists.txt | 1 -
.../Code/Tools/DebugWindow/CMakeLists.txt | 29 ---
.../Code/Tools/DebugWindow/DebugWindow.def | 6 -
.../Code/Tools/DebugWindow/DebugWindow.rc | 177 --------------
.../Code/Tools/DebugWindow/post-build.bat | 1 -
.../Tools/DebugWindow/res/DebugWindow.rc2 | 13 -
30 files changed, 29 insertions(+), 1035 deletions(-)
create mode 100644 Core/Tools/DebugWindow/CMakeLists.txt
rename {GeneralsMD/Code => Core}/Tools/DebugWindow/DebugWindow.cpp (100%)
rename {Generals/Code => Core}/Tools/DebugWindow/DebugWindow.def (100%)
rename {GeneralsMD/Code => Core}/Tools/DebugWindow/DebugWindow.h (100%)
rename {Generals/Code => Core}/Tools/DebugWindow/DebugWindow.rc (100%)
rename {GeneralsMD/Code => Core}/Tools/DebugWindow/DebugWindowDialog.cpp (100%)
rename {GeneralsMD/Code => Core}/Tools/DebugWindow/DebugWindowDialog.h (100%)
rename {GeneralsMD/Code => Core}/Tools/DebugWindow/DebugWindowExport.h (100%)
rename {GeneralsMD/Code => Core}/Tools/DebugWindow/Resource.h (100%)
rename {GeneralsMD/Code => Core}/Tools/DebugWindow/StdAfx.cpp (100%)
rename {GeneralsMD/Code => Core}/Tools/DebugWindow/StdAfx.h (100%)
rename {Generals/Code => Core}/Tools/DebugWindow/post-build.bat (100%)
rename {Generals/Code => Core}/Tools/DebugWindow/res/DebugWindow.rc2 (100%)
delete mode 100644 Generals/Code/Tools/DebugWindow/CMakeLists.txt
delete mode 100644 Generals/Code/Tools/DebugWindow/DebugWindow.cpp
delete mode 100644 Generals/Code/Tools/DebugWindow/DebugWindow.h
delete mode 100644 Generals/Code/Tools/DebugWindow/DebugWindowDialog.cpp
delete mode 100644 Generals/Code/Tools/DebugWindow/DebugWindowDialog.h
delete mode 100644 Generals/Code/Tools/DebugWindow/DebugWindowExport.h
delete mode 100644 Generals/Code/Tools/DebugWindow/Resource.h
delete mode 100644 Generals/Code/Tools/DebugWindow/StdAfx.cpp
delete mode 100644 Generals/Code/Tools/DebugWindow/StdAfx.h
delete mode 100644 GeneralsMD/Code/Tools/DebugWindow/CMakeLists.txt
delete mode 100644 GeneralsMD/Code/Tools/DebugWindow/DebugWindow.def
delete mode 100644 GeneralsMD/Code/Tools/DebugWindow/DebugWindow.rc
delete mode 100644 GeneralsMD/Code/Tools/DebugWindow/post-build.bat
delete mode 100644 GeneralsMD/Code/Tools/DebugWindow/res/DebugWindow.rc2
diff --git a/Core/Tools/CMakeLists.txt b/Core/Tools/CMakeLists.txt
index 55b529f0d2e..20270f8ce2a 100644
--- a/Core/Tools/CMakeLists.txt
+++ b/Core/Tools/CMakeLists.txt
@@ -2,7 +2,7 @@
# Build useful tool binaries.
if(RTS_BUILD_CORE_TOOLS)
- # TODO: add subdirectory...
+ add_subdirectory(DebugWindow)
endif()
# Build less useful tool/test binaries.
diff --git a/Core/Tools/DebugWindow/CMakeLists.txt b/Core/Tools/DebugWindow/CMakeLists.txt
new file mode 100644
index 00000000000..d6514ca8ada
--- /dev/null
+++ b/Core/Tools/DebugWindow/CMakeLists.txt
@@ -0,0 +1,28 @@
+set(DEBUGWINDOW_SRC
+ "DebugWindow.cpp"
+ "DebugWindow.h"
+ "DebugWindowDialog.cpp"
+ "DebugWindowDialog.h"
+ "DebugWindowExport.h"
+ "StdAfx.cpp"
+ "StdAfx.h"
+)
+
+add_library(core_debugwindow SHARED)
+
+target_sources(core_debugwindow PRIVATE ${DEBUGWINDOW_SRC})
+
+target_link_libraries(core_debugwindow PRIVATE
+ core_config
+)
+
+if(WIN32 OR "${CMAKE_SYSTEM}" MATCHES "Windows")
+ target_compile_definitions(core_debugwindow PRIVATE _AFXDLL)
+ target_sources(core_debugwindow PRIVATE
+ DebugWindow.rc
+ DebugWindow.def
+ )
+ set_target_properties(core_debugwindow PROPERTIES OUTPUT_NAME DebugWindow)
+else()
+ set_target_properties(core_debugwindow PROPERTIES OUTPUT_NAME debugwindow)
+endif()
diff --git a/GeneralsMD/Code/Tools/DebugWindow/DebugWindow.cpp b/Core/Tools/DebugWindow/DebugWindow.cpp
similarity index 100%
rename from GeneralsMD/Code/Tools/DebugWindow/DebugWindow.cpp
rename to Core/Tools/DebugWindow/DebugWindow.cpp
diff --git a/Generals/Code/Tools/DebugWindow/DebugWindow.def b/Core/Tools/DebugWindow/DebugWindow.def
similarity index 100%
rename from Generals/Code/Tools/DebugWindow/DebugWindow.def
rename to Core/Tools/DebugWindow/DebugWindow.def
diff --git a/GeneralsMD/Code/Tools/DebugWindow/DebugWindow.h b/Core/Tools/DebugWindow/DebugWindow.h
similarity index 100%
rename from GeneralsMD/Code/Tools/DebugWindow/DebugWindow.h
rename to Core/Tools/DebugWindow/DebugWindow.h
diff --git a/Generals/Code/Tools/DebugWindow/DebugWindow.rc b/Core/Tools/DebugWindow/DebugWindow.rc
similarity index 100%
rename from Generals/Code/Tools/DebugWindow/DebugWindow.rc
rename to Core/Tools/DebugWindow/DebugWindow.rc
diff --git a/GeneralsMD/Code/Tools/DebugWindow/DebugWindowDialog.cpp b/Core/Tools/DebugWindow/DebugWindowDialog.cpp
similarity index 100%
rename from GeneralsMD/Code/Tools/DebugWindow/DebugWindowDialog.cpp
rename to Core/Tools/DebugWindow/DebugWindowDialog.cpp
diff --git a/GeneralsMD/Code/Tools/DebugWindow/DebugWindowDialog.h b/Core/Tools/DebugWindow/DebugWindowDialog.h
similarity index 100%
rename from GeneralsMD/Code/Tools/DebugWindow/DebugWindowDialog.h
rename to Core/Tools/DebugWindow/DebugWindowDialog.h
diff --git a/GeneralsMD/Code/Tools/DebugWindow/DebugWindowExport.h b/Core/Tools/DebugWindow/DebugWindowExport.h
similarity index 100%
rename from GeneralsMD/Code/Tools/DebugWindow/DebugWindowExport.h
rename to Core/Tools/DebugWindow/DebugWindowExport.h
diff --git a/GeneralsMD/Code/Tools/DebugWindow/Resource.h b/Core/Tools/DebugWindow/Resource.h
similarity index 100%
rename from GeneralsMD/Code/Tools/DebugWindow/Resource.h
rename to Core/Tools/DebugWindow/Resource.h
diff --git a/GeneralsMD/Code/Tools/DebugWindow/StdAfx.cpp b/Core/Tools/DebugWindow/StdAfx.cpp
similarity index 100%
rename from GeneralsMD/Code/Tools/DebugWindow/StdAfx.cpp
rename to Core/Tools/DebugWindow/StdAfx.cpp
diff --git a/GeneralsMD/Code/Tools/DebugWindow/StdAfx.h b/Core/Tools/DebugWindow/StdAfx.h
similarity index 100%
rename from GeneralsMD/Code/Tools/DebugWindow/StdAfx.h
rename to Core/Tools/DebugWindow/StdAfx.h
diff --git a/Generals/Code/Tools/DebugWindow/post-build.bat b/Core/Tools/DebugWindow/post-build.bat
similarity index 100%
rename from Generals/Code/Tools/DebugWindow/post-build.bat
rename to Core/Tools/DebugWindow/post-build.bat
diff --git a/Generals/Code/Tools/DebugWindow/res/DebugWindow.rc2 b/Core/Tools/DebugWindow/res/DebugWindow.rc2
similarity index 100%
rename from Generals/Code/Tools/DebugWindow/res/DebugWindow.rc2
rename to Core/Tools/DebugWindow/res/DebugWindow.rc2
diff --git a/Generals/Code/Tools/CMakeLists.txt b/Generals/Code/Tools/CMakeLists.txt
index 9fd5dc30331..0abdb299a54 100644
--- a/Generals/Code/Tools/CMakeLists.txt
+++ b/Generals/Code/Tools/CMakeLists.txt
@@ -2,7 +2,6 @@
# Build useful tool binaries.
if(RTS_BUILD_GENERALS_TOOLS)
- add_subdirectory(DebugWindow)
add_subdirectory(GUIEdit)
add_subdirectory(ImagePacker)
add_subdirectory(MapCacheBuilder)
diff --git a/Generals/Code/Tools/DebugWindow/CMakeLists.txt b/Generals/Code/Tools/DebugWindow/CMakeLists.txt
deleted file mode 100644
index 6ae53af6d39..00000000000
--- a/Generals/Code/Tools/DebugWindow/CMakeLists.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-set(DEBUGWINDOW_SRC
- "DebugWindow.cpp"
- "DebugWindow.h"
- "DebugWindowDialog.cpp"
- "DebugWindowDialog.h"
- "DebugWindowExport.h"
- "StdAfx.cpp"
- "StdAfx.h"
-)
-
-add_library(g_debugwindow SHARED)
-set_target_properties(g_debugwindow PROPERTIES OUTPUT_NAME debugwindow)
-
-target_sources(g_debugwindow PRIVATE ${DEBUGWINDOW_SRC})
-
-target_link_libraries(g_debugwindow PRIVATE
- core_config
-)
-
-if(WIN32 OR "${CMAKE_SYSTEM}" MATCHES "Windows")
- target_compile_definitions(g_debugwindow PRIVATE _AFXDLL)
- target_sources(g_debugwindow PRIVATE
- DebugWindow.rc
- DebugWindow.def
- )
- set_target_properties(g_debugwindow PROPERTIES OUTPUT_NAME DebugWindow)
-else()
- set_target_properties(g_debugwindow PROPERTIES OUTPUT_NAME debugwindow)
-endif()
diff --git a/Generals/Code/Tools/DebugWindow/DebugWindow.cpp b/Generals/Code/Tools/DebugWindow/DebugWindow.cpp
deleted file mode 100644
index e2f8655b829..00000000000
--- a/Generals/Code/Tools/DebugWindow/DebugWindow.cpp
+++ /dev/null
@@ -1,228 +0,0 @@
-/*
-** Command & Conquer Generals(tm)
-** Copyright 2025 Electronic Arts Inc.
-**
-** This program is free software: you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation, either version 3 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program. If not, see .
-*/
-
-// DebugWindow.cpp : Defines the initialization routines for the DLL.
-//
-
-#include "StdAfx.h"
-#include "DebugWindow.h"
-#include "DebugWindowDialog.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-//
-// Note!
-//
-// If this DLL is dynamically linked against the MFC
-// DLLs, any functions exported from this DLL which
-// call into MFC must have the AFX_MANAGE_STATE macro
-// added at the very beginning of the function.
-//
-// For example:
-//
-// extern "C" BOOL PASCAL EXPORT ExportedFunction()
-// {
-// AFX_MANAGE_STATE(AfxGetStaticModuleState());
-// // normal function body here
-// }
-//
-// It is very important that this macro appear in each
-// function, prior to any calls into MFC. This means that
-// it must appear as the first statement within the
-// function, even before any object variable declarations
-// as their constructors may generate calls into the MFC
-// DLL.
-//
-// Please see MFC Technical Notes 33 and 58 for additional
-// details.
-//
-
-/////////////////////////////////////////////////////////////////////////////
-// CDebugWindowApp
-
-BEGIN_MESSAGE_MAP(CDebugWindowApp, CWinApp)
- //{{AFX_MSG_MAP(CDebugWindowApp)
- // NOTE - the ClassWizard will add and remove mapping macros here.
- // DO NOT EDIT what you see in these blocks of generated code!
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// CDebugWindowApp construction
-
-CDebugWindowApp::CDebugWindowApp()
-{
- AfxInitialize(true);
- AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
- m_DialogWindow = NULL;
-}
-
-DebugWindowDialog* CDebugWindowApp::GetDialogWindow(void)
-{
- return m_DialogWindow;
-}
-
-void CDebugWindowApp::SetDialogWindow(DebugWindowDialog* pWnd)
-{
- m_DialogWindow = pWnd;
-}
-
-CDebugWindowApp::~CDebugWindowApp()
-{
-}
-
-
-/////////////////////////////////////////////////////////////////////////////
-// The one and only CDebugWindowApp object
-
-CDebugWindowApp theApp;
-
-void __declspec(dllexport) CreateDebugDialog(void)
-{
- AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
-
- DebugWindowDialog* tmpWnd;
- tmpWnd = new DebugWindowDialog;
- tmpWnd->Create(DebugWindowDialog::IDD);
- tmpWnd->SetWindowPos(NULL, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOZORDER);
- tmpWnd->ShowWindow(SW_SHOW);
- if (tmpWnd->GetMainWndHWND()) {
- SetFocus(tmpWnd->GetMainWndHWND());
- }
-
- theApp.SetDialogWindow(tmpWnd);
-}
-
-void __declspec(dllexport) DestroyDebugDialog(void)
-{
- AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
- DebugWindowDialog* tmpWnd = theApp.GetDialogWindow();
-
- if (tmpWnd) {
- tmpWnd->DestroyWindow();
- delete tmpWnd;
- theApp.SetDialogWindow(NULL);
- }
-
-}
-
-bool __declspec(dllexport) CanAppContinue(void)
-{
- AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
-
- DebugWindowDialog* pDbg;
- pDbg = theApp.GetDialogWindow();
- if (!pDbg) {
- return true;
- }
-
- return pDbg->CanProceed();
-}
-
-void __declspec(dllexport) ForceAppContinue(void)
-{
- AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
-
- DebugWindowDialog* pDbg;
- pDbg = theApp.GetDialogWindow();
- if (!pDbg) {
- return;
- }
-
- pDbg->ForceContinue();
-}
-
-bool __declspec(dllexport) RunAppFast(void)
-{
- AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
-
- DebugWindowDialog* pDbg;
- pDbg = theApp.GetDialogWindow();
- if (!pDbg) {
- return true;
- }
-
- return pDbg->RunAppFast();
-}
-
-void __declspec(dllexport) AppendMessage(const char* messageToPass)
-{
- AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
-
- DebugWindowDialog* pDbg;
- pDbg = theApp.GetDialogWindow();
-
- if (pDbg) {
- pDbg->AppendMessage(messageToPass);
- }
-}
-
-void __declspec(dllexport) SetFrameNumber(int frameNumber)
-{
- AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
-
- DebugWindowDialog* pDbg;
- pDbg = theApp.GetDialogWindow();
-
- if (pDbg) {
- pDbg->SetFrameNumber(frameNumber);
- }
-}
-
-
-void __declspec(dllexport) AppendMessageAndPause(const char* messageToPass)
-{
- AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
- DebugWindowDialog* pDbg;
- pDbg = theApp.GetDialogWindow();
-
- if (pDbg) {
- pDbg->AppendMessage(messageToPass);
- pDbg->ForcePause();
- }
-}
-
-
-void __declspec(dllexport) AdjustVariable(const char* variable, const char* value)
-{
- AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
-
- DebugWindowDialog* pDbg;
- pDbg = theApp.GetDialogWindow();
-
- if (pDbg) {
- pDbg->AdjustVariable(variable, value);
- }
-}
-
-void __declspec(dllexport) AdjustVariableAndPause(const char* variable, const char* value)
-{
- AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
-
- DebugWindowDialog* pDbg;
- pDbg = theApp.GetDialogWindow();
-
- if (pDbg) {
- pDbg->AdjustVariable(variable, value);
- pDbg->ForcePause();
- }
-}
\ No newline at end of file
diff --git a/Generals/Code/Tools/DebugWindow/DebugWindow.h b/Generals/Code/Tools/DebugWindow/DebugWindow.h
deleted file mode 100644
index 9a455974871..00000000000
--- a/Generals/Code/Tools/DebugWindow/DebugWindow.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
-** Command & Conquer Generals(tm)
-** Copyright 2025 Electronic Arts Inc.
-**
-** This program is free software: you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation, either version 3 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program. If not, see .
-*/
-
-// DebugWindow.h : main header file for the DEBUGWINDOW DLL
-//
-
-#if !defined(AFX_DEBUGWINDOW_H__018E1800_6E59_4527_BA0C_8731EBF22953__INCLUDED_)
-#define AFX_DEBUGWINDOW_H__018E1800_6E59_4527_BA0C_8731EBF22953__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#ifndef __AFXWIN_H__
- #error include 'stdafx.h' before including this file for PCH
-#endif
-
-#include "Resource.h" // main symbols
-#include "DebugWindowExport.h"
-/////////////////////////////////////////////////////////////////////////////
-// CDebugWindowApp
-// See DebugWindow.cpp for the implementation of this class
-//
-
-class DebugWindowDialog;
-
-class CDebugWindowApp : public CWinApp
-{
- public:
- CDebugWindowApp();
- ~CDebugWindowApp();
- DebugWindowDialog* GetDialogWindow(void);
- void SetDialogWindow(DebugWindowDialog* pWnd);
-
- protected:
- DebugWindowDialog* m_DialogWindow;
-
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CDebugWindowApp)
- //}}AFX_VIRTUAL
-
- //{{AFX_MSG(CDebugWindowApp)
- // NOTE - the ClassWizard will add and remove member functions here.
- // DO NOT EDIT what you see in these blocks of generated code !
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-};
-
-
-/////////////////////////////////////////////////////////////////////////////
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_DEBUGWINDOW_H__018E1800_6E59_4527_BA0C_8731EBF22953__INCLUDED_)
diff --git a/Generals/Code/Tools/DebugWindow/DebugWindowDialog.cpp b/Generals/Code/Tools/DebugWindow/DebugWindowDialog.cpp
deleted file mode 100644
index 9383e8d0779..00000000000
--- a/Generals/Code/Tools/DebugWindow/DebugWindowDialog.cpp
+++ /dev/null
@@ -1,226 +0,0 @@
-/*
-** Command & Conquer Generals(tm)
-** Copyright 2025 Electronic Arts Inc.
-**
-** This program is free software: you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation, either version 3 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program. If not, see .
-*/
-
-#include "StdAfx.h"
-#include "DebugWindowDialog.h"
-
-DebugWindowDialog::DebugWindowDialog(UINT nIDTemplate, CWnd* pParentWnd) :
- CDialog(nIDTemplate, pParentWnd)
-{
- mStepping = false;
- mRunFast = false;
- mNumberOfStepsAllowed = -1;
- mMainWndHWND = ::FindWindow(NULL, "Command & Conquer: Generals");
-}
-
-int DebugWindowDialog::OnCreate(LPCREATESTRUCT lpCreateStruct)
-{
- return CDialog::OnCreate(lpCreateStruct);
-}
-
-HWND DebugWindowDialog::GetMainWndHWND(void)
-{
- return mMainWndHWND;
-}
-
-void DebugWindowDialog::ForcePause(void)
-{
- mNumberOfStepsAllowed = 0;
- _UpdatePauseButton();
-}
-
-void DebugWindowDialog::ForceContinue(void)
-{
- mNumberOfStepsAllowed = -1;
- _UpdatePauseButton();
-}
-
-void DebugWindowDialog::OnPause()
-{
- if (mNumberOfStepsAllowed < 0) {
- mNumberOfStepsAllowed = 0;
- } else {
- mNumberOfStepsAllowed = -1;
- }
- _UpdatePauseButton();
-}
-
-void DebugWindowDialog::OnStep()
-{
- mStepping = true;
- mNumberOfStepsAllowed = 1;
- _UpdatePauseButton();
-}
-
-void DebugWindowDialog::OnRunFast()
-{
- CButton *pButton = (CButton*)GetDlgItem(IDC_RUN_FAST);
- mRunFast = pButton->GetCheck() == 1;
-}
-
-void DebugWindowDialog::OnStepTen()
-{
- mStepping = true;
- mNumberOfStepsAllowed = 10;
- _UpdatePauseButton();
-}
-
-void DebugWindowDialog::OnClearWindows()
-{
- mMessages.clear();
- mVariables.clear();
- _RebuildMesgString();
- _RebuildVarsString();
-}
-
-bool DebugWindowDialog::CanProceed(void)
-{
- if (mNumberOfStepsAllowed < 0) {
- return true;
- } else if (mNumberOfStepsAllowed == 0) {
- if (mStepping) {
- mStepping = false;
- _UpdatePauseButton();
- }
- return false;
- }
-
- --mNumberOfStepsAllowed;
- return true;
-}
-
-bool DebugWindowDialog::RunAppFast(void)
-{
- return mRunFast;
-}
-
-void DebugWindowDialog::AppendMessage(const std::string& messageToAppend)
-{
- mMessages.push_back(messageToAppend);
- _RebuildMesgString();
-}
-
-void DebugWindowDialog::AdjustVariable(const std::string& varName, const std::string& varValue)
-{
- for (VecPairStringIt it = mVariables.begin(); it != mVariables.end(); it++) {
- if (it->first == varName) {
- it->second = varValue;
- _RebuildVarsString();
- return;
- }
- }
-
- PairString newPair;
- newPair.first = varName;
- newPair.second = varValue;
- mVariables.push_back(newPair);
-
- _RebuildVarsString();
-}
-
-void DebugWindowDialog::SetFrameNumber(int frameNumber)
-{
- static int numDigits;
- numDigits = frameNumber / 10 + 2; // 1 for 1 additional digit, 1 for \0
-
- mFrameNumber.resize(numDigits);
- sprintf(&mFrameNumber[0], "%d", frameNumber);
-
- CWnd *pWnd = GetDlgItem(IDC_FrameNumber);
- if (pWnd) {
- pWnd->SetWindowText(mFrameNumber.c_str());
- }
-}
-
-void DebugWindowDialog::_RebuildVarsString(void)
-{
- int cursorPosBeg, cursorPosEnd;
- ((CEdit*)GetDlgItem(IDC_Variables))->GetSel(cursorPosBeg, cursorPosEnd);
- mVariablesString = "";
-
- for (VecPairStringIt it = mVariables.begin(); it != mVariables.end(); it++) {
- mVariablesString += it->first;
- mVariablesString += " = ";
- mVariablesString += it->second;
- mVariablesString += "\r\n";
- }
-
-
-
- // Push the new string
- mVariablesDisplayString = mVariablesString.c_str();
- GetDlgItem(IDC_Variables)->SetWindowText(mVariablesDisplayString);
- ((CEdit*)GetDlgItem(IDC_Variables))->GetSel(cursorPosBeg, cursorPosEnd);
-}
-
-void DebugWindowDialog::_RebuildMesgString(void)
-{
- mMessagesString = "";
-
- for (VecStringIt it = mMessages.begin(); it != mMessages.end(); it++) {
- mMessagesString += (*it);
- mMessagesString += "\r\n";
- }
-
- // Push the new string
- mMessagesDisplayString = mMessagesString.c_str();
- GetDlgItem(IDC_Messages)->SetWindowText(mMessagesDisplayString);
- ((CEdit*)GetDlgItem(IDC_Messages))->SetSel(mMessagesString.length(), mMessagesString.length(), false);
-}
-
-void DebugWindowDialog::_UpdatePauseButton(void)
-{
- // huh huh huhuh he said pButt
- CButton* pButt = (CButton*) GetDlgItem(IDC_Pause);
-
- if (!pButt) {
- return;
- }
-
- // The state should of the button should reflect !mNumberOfStepsAllowed
- pButt->SetCheck((mNumberOfStepsAllowed ? FALSE : TRUE));
-}
-
-
-void DebugWindowDialog::OnClose()
-{
- ShowWindow(SW_MINIMIZE);
-}
-
-void DebugWindowDialog::OnSize(UINT nType, int cx, int cy)
-{
- CDialog::OnSize(nType, cx, cy);
- if (nType == SIZE_MINIMIZED) {
- if (mMainWndHWND) {
- ::SetFocus(mMainWndHWND);
- }
- }
-}
-
-
-
-BEGIN_MESSAGE_MAP(DebugWindowDialog, CDialog)
- ON_WM_CREATE( )
- ON_BN_CLICKED(IDC_Pause, OnPause)
- ON_BN_CLICKED(IDC_Step, OnStep)
- ON_BN_CLICKED(IDC_RUN_FAST, OnRunFast)
- ON_BN_CLICKED(IDC_StepTen, OnStepTen)
- ON_BN_CLICKED(IDC_ClearWindows, OnClearWindows)
- ON_WM_CLOSE()
- ON_WM_SIZE()
-END_MESSAGE_MAP()
\ No newline at end of file
diff --git a/Generals/Code/Tools/DebugWindow/DebugWindowDialog.h b/Generals/Code/Tools/DebugWindow/DebugWindowDialog.h
deleted file mode 100644
index a3040d0481a..00000000000
--- a/Generals/Code/Tools/DebugWindow/DebugWindowDialog.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
-** Command & Conquer Generals(tm)
-** Copyright 2025 Electronic Arts Inc.
-**
-** This program is free software: you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation, either version 3 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program. If not, see .
-*/
-
-
-#include "Resource.h"
-#include