diff --git a/Core/GameEngineDevice/CMakeLists.txt b/Core/GameEngineDevice/CMakeLists.txt index 16794e4c043..830a53b2675 100644 --- a/Core/GameEngineDevice/CMakeLists.txt +++ b/Core/GameEngineDevice/CMakeLists.txt @@ -47,10 +47,10 @@ set(GAMEENGINEDEVICE_SRC # Include/W3DDevice/GameClient/W3DFileSystem.h Include/W3DDevice/GameClient/W3DGadget.h # Include/W3DDevice/GameClient/W3DGameClient.h -# Include/W3DDevice/GameClient/W3DGameFont.h -# Include/W3DDevice/GameClient/W3DGameWindow.h -# Include/W3DDevice/GameClient/W3DGameWindowManager.h -# Include/W3DDevice/GameClient/W3DGUICallbacks.h + Include/W3DDevice/GameClient/W3DGameFont.h + Include/W3DDevice/GameClient/W3DGameWindow.h + Include/W3DDevice/GameClient/W3DGameWindowManager.h + Include/W3DDevice/GameClient/W3DGUICallbacks.h # Include/W3DDevice/GameClient/W3DInGameUI.h # Include/W3DDevice/GameClient/W3DMirror.h Include/W3DDevice/GameClient/W3DMouse.h @@ -132,11 +132,11 @@ set(GAMEENGINEDEVICE_SRC Source/W3DDevice/GameClient/GUI/Gadget/W3DTextEntry.cpp Source/W3DDevice/GameClient/GUI/Gadget/W3DVerticalSlider.cpp Source/W3DDevice/GameClient/GUI/GUICallbacks/W3DControlBar.cpp -# Source/W3DDevice/GameClient/GUI/GUICallbacks/W3DMainMenu.cpp -# Source/W3DDevice/GameClient/GUI/GUICallbacks/W3DMOTD.cpp -# Source/W3DDevice/GameClient/GUI/W3DGameFont.cpp -# Source/W3DDevice/GameClient/GUI/W3DGameWindow.cpp -# Source/W3DDevice/GameClient/GUI/W3DGameWindowManager.cpp + Source/W3DDevice/GameClient/GUI/GUICallbacks/W3DMainMenu.cpp + Source/W3DDevice/GameClient/GUI/GUICallbacks/W3DMOTD.cpp + Source/W3DDevice/GameClient/GUI/W3DGameFont.cpp + Source/W3DDevice/GameClient/GUI/W3DGameWindow.cpp + Source/W3DDevice/GameClient/GUI/W3DGameWindowManager.cpp Source/W3DDevice/GameClient/HeightMap.cpp # Source/W3DDevice/GameClient/Shadow/W3DBufferManager.cpp # Source/W3DDevice/GameClient/Shadow/W3DProjectedShadow.cpp diff --git a/GeneralsMD/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DGUICallbacks.h b/Core/GameEngineDevice/Include/W3DDevice/GameClient/W3DGUICallbacks.h similarity index 100% rename from GeneralsMD/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DGUICallbacks.h rename to Core/GameEngineDevice/Include/W3DDevice/GameClient/W3DGUICallbacks.h diff --git a/GeneralsMD/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DGameFont.h b/Core/GameEngineDevice/Include/W3DDevice/GameClient/W3DGameFont.h similarity index 100% rename from GeneralsMD/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DGameFont.h rename to Core/GameEngineDevice/Include/W3DDevice/GameClient/W3DGameFont.h diff --git a/GeneralsMD/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DGameWindow.h b/Core/GameEngineDevice/Include/W3DDevice/GameClient/W3DGameWindow.h similarity index 100% rename from GeneralsMD/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DGameWindow.h rename to Core/GameEngineDevice/Include/W3DDevice/GameClient/W3DGameWindow.h diff --git a/GeneralsMD/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DGameWindowManager.h b/Core/GameEngineDevice/Include/W3DDevice/GameClient/W3DGameWindowManager.h similarity index 100% rename from GeneralsMD/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DGameWindowManager.h rename to Core/GameEngineDevice/Include/W3DDevice/GameClient/W3DGameWindowManager.h diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/GUICallbacks/W3DMOTD.cpp b/Core/GameEngineDevice/Source/W3DDevice/GameClient/GUI/GUICallbacks/W3DMOTD.cpp similarity index 100% rename from GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/GUICallbacks/W3DMOTD.cpp rename to Core/GameEngineDevice/Source/W3DDevice/GameClient/GUI/GUICallbacks/W3DMOTD.cpp diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/GUICallbacks/W3DMainMenu.cpp b/Core/GameEngineDevice/Source/W3DDevice/GameClient/GUI/GUICallbacks/W3DMainMenu.cpp similarity index 100% rename from GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/GUICallbacks/W3DMainMenu.cpp rename to Core/GameEngineDevice/Source/W3DDevice/GameClient/GUI/GUICallbacks/W3DMainMenu.cpp diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/W3DGameFont.cpp b/Core/GameEngineDevice/Source/W3DDevice/GameClient/GUI/W3DGameFont.cpp similarity index 100% rename from GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/W3DGameFont.cpp rename to Core/GameEngineDevice/Source/W3DDevice/GameClient/GUI/W3DGameFont.cpp diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/W3DGameWindow.cpp b/Core/GameEngineDevice/Source/W3DDevice/GameClient/GUI/W3DGameWindow.cpp similarity index 100% rename from GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/W3DGameWindow.cpp rename to Core/GameEngineDevice/Source/W3DDevice/GameClient/GUI/W3DGameWindow.cpp diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/W3DGameWindowManager.cpp b/Core/GameEngineDevice/Source/W3DDevice/GameClient/GUI/W3DGameWindowManager.cpp similarity index 100% rename from GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/W3DGameWindowManager.cpp rename to Core/GameEngineDevice/Source/W3DDevice/GameClient/GUI/W3DGameWindowManager.cpp diff --git a/Generals/Code/GameEngineDevice/CMakeLists.txt b/Generals/Code/GameEngineDevice/CMakeLists.txt index a0c6091420c..93ec69b7fbf 100644 --- a/Generals/Code/GameEngineDevice/CMakeLists.txt +++ b/Generals/Code/GameEngineDevice/CMakeLists.txt @@ -40,10 +40,10 @@ set(GAMEENGINEDEVICE_SRC Include/W3DDevice/GameClient/W3DFileSystem.h # Include/W3DDevice/GameClient/W3DGadget.h Include/W3DDevice/GameClient/W3DGameClient.h - Include/W3DDevice/GameClient/W3DGameFont.h - Include/W3DDevice/GameClient/W3DGameWindow.h - Include/W3DDevice/GameClient/W3DGameWindowManager.h - Include/W3DDevice/GameClient/W3DGUICallbacks.h +# Include/W3DDevice/GameClient/W3DGameFont.h +# Include/W3DDevice/GameClient/W3DGameWindow.h +# Include/W3DDevice/GameClient/W3DGameWindowManager.h +# Include/W3DDevice/GameClient/W3DGUICallbacks.h Include/W3DDevice/GameClient/W3DInGameUI.h Include/W3DDevice/GameClient/W3DMirror.h # Include/W3DDevice/GameClient/W3DMouse.h @@ -111,11 +111,11 @@ set(GAMEENGINEDEVICE_SRC # Source/W3DDevice/GameClient/GUI/Gadget/W3DTextEntry.cpp # Source/W3DDevice/GameClient/GUI/Gadget/W3DVerticalSlider.cpp # Source/W3DDevice/GameClient/GUI/GUICallbacks/W3DControlBar.cpp - Source/W3DDevice/GameClient/GUI/GUICallbacks/W3DMainMenu.cpp - Source/W3DDevice/GameClient/GUI/GUICallbacks/W3DMOTD.cpp - Source/W3DDevice/GameClient/GUI/W3DGameFont.cpp - Source/W3DDevice/GameClient/GUI/W3DGameWindow.cpp - Source/W3DDevice/GameClient/GUI/W3DGameWindowManager.cpp +# Source/W3DDevice/GameClient/GUI/GUICallbacks/W3DMainMenu.cpp +# Source/W3DDevice/GameClient/GUI/GUICallbacks/W3DMOTD.cpp +# Source/W3DDevice/GameClient/GUI/W3DGameFont.cpp +# Source/W3DDevice/GameClient/GUI/W3DGameWindow.cpp +# Source/W3DDevice/GameClient/GUI/W3DGameWindowManager.cpp # Source/W3DDevice/GameClient/HeightMap.cpp Source/W3DDevice/GameClient/Shaders/invmonochrome.nvp Source/W3DDevice/GameClient/Shaders/monochrome.nvp diff --git a/Generals/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DGUICallbacks.h b/Generals/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DGUICallbacks.h deleted file mode 100644 index d3fd1d245cb..00000000000 --- a/Generals/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DGUICallbacks.h +++ /dev/null @@ -1,66 +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 . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: W3DGUICallbacks.h //////////////////////////////////////////////////////////////////////// -// Created: Colin Day, August 2001 -// Desc: Callbacks for GUI elements that are specifically tied to -// a W3D implementation -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -class GameWindow; -class WindowLayout; -class WinInstanceData; - -// EXTERNALS ////////////////////////////////////////////////////////////////////////////////////// - -// Message of the day message window -------------------------------------------------------------- -extern void W3DLeftHUDDraw( GameWindow *window, WinInstanceData *instData ); -extern void W3DCameoMovieDraw( GameWindow *window, WinInstanceData *instData ); -extern void W3DRightHUDDraw( GameWindow *window, WinInstanceData *instData ); -extern void W3DPowerDraw( GameWindow *window, WinInstanceData *instData ); -extern void W3DMainMenuDraw( GameWindow *window, WinInstanceData *instData ); -extern void W3DMainMenuFourDraw( GameWindow *window, WinInstanceData *instData ); -extern void W3DMetalBarMenuDraw( GameWindow *window, WinInstanceData *instData ); -extern void W3DCreditsMenuDraw( GameWindow *window, WinInstanceData *instData ); -extern void W3DClockDraw( GameWindow *window, WinInstanceData *instData ); -extern void W3DMainMenuMapBorder( GameWindow *window, WinInstanceData *instData ); -extern void W3DMainMenuButtonDropShadowDraw( GameWindow *window, WinInstanceData *instData ); -extern void W3DMainMenuRandomTextDraw( GameWindow *window, WinInstanceData *instData ); -extern void W3DThinBorderDraw( GameWindow *window, WinInstanceData *instData ); -extern void W3DShellMenuSchemeDraw( GameWindow *window, WinInstanceData *instData ); - -extern void W3DCommandBarGridDraw( GameWindow *window, WinInstanceData *instData ); -extern void W3DCommandBarGenExpDraw( GameWindow *window, WinInstanceData *instData ); -extern void W3DCommandBarHelpPopupDraw( GameWindow *window, WinInstanceData *instData ); - -extern void W3DCommandBarBackgroundDraw( GameWindow *window, WinInstanceData *instData ); -extern void W3DCommandBarForegroundDraw( GameWindow *window, WinInstanceData *instData ); -extern void W3DCommandBarTopDraw( GameWindow *window, WinInstanceData *instData ); - -extern void W3DNoDraw( GameWindow *window, WinInstanceData *instData ); -extern void W3DDrawMapPreview( GameWindow *window, WinInstanceData *instData ); - -void W3DMainMenuInit( WindowLayout *layout, void *userData ); diff --git a/Generals/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DGameFont.h b/Generals/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DGameFont.h deleted file mode 100644 index 382aed134da..00000000000 --- a/Generals/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DGameFont.h +++ /dev/null @@ -1,79 +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 . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: W3DGameFont.h //////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -// -// Westwood Studios Pacific. -// -// Confidential Information -// Copyright (C) 2001 - All Rights Reserved -// -//----------------------------------------------------------------------------- -// -// Project: RTS3 -// -// File name: W3DGameFont.h -// -// Created: Colin Day, June 2001 -// -// Desc: W3D implementation for managing font definitions -// -//----------------------------------------------------------------------------- -/////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// SYSTEM INCLUDES //////////////////////////////////////////////////////////// - -// USER INCLUDES ////////////////////////////////////////////////////////////// -#include "GameClient/GameFont.h" - -// FORWARD REFERENCES ///////////////////////////////////////////////////////// - -// TYPE DEFINES /////////////////////////////////////////////////////////////// - -// W3DFontLibrary ------------------------------------------------------------- -/** Our font library that uses W3D font implementations */ -//----------------------------------------------------------------------------- -class W3DFontLibrary : public FontLibrary -{ - -public: - - W3DFontLibrary() { } - virtual ~W3DFontLibrary() override { } - -protected: - - /// load the font data pointer based on everything else we already have set - virtual Bool loadFontData( GameFont *font ) override; - /// release the font data pointer - virtual void releaseFontData( GameFont *font ) override; - -}; - -// INLINING /////////////////////////////////////////////////////////////////// - -// EXTERNALS ////////////////////////////////////////////////////////////////// diff --git a/Generals/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DGameWindow.h b/Generals/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DGameWindow.h deleted file mode 100644 index 25afd838e3b..00000000000 --- a/Generals/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DGameWindow.h +++ /dev/null @@ -1,99 +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 . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: W3DGameWindow.h ////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -// -// Westwood Studios Pacific. -// -// Confidential Information -// Copyright (C) 2001 - All Rights Reserved -// -//----------------------------------------------------------------------------- -// -// Project: RTS3 -// -// File name: W3DGameWindow.h -// -// Created: Colin Day, June 2001 -// -// Desc: W3D implementations for the game windowing system -// -//----------------------------------------------------------------------------- -/////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// SYSTEM INCLUDES //////////////////////////////////////////////////////////// - -// USER INCLUDES ////////////////////////////////////////////////////////////// -#include "GameClient/GameWindow.h" -#include "WW3D2/render2dsentence.h" - -// FORWARD REFERENCES ///////////////////////////////////////////////////////// - -// TYPE DEFINES /////////////////////////////////////////////////////////////// - -// W3DGameWindow -------------------------------------------------------------- -/** W3D implementation for a game window */ -// ---------------------------------------------------------------------------- -class W3DGameWindow : public GameWindow -{ - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE(W3DGameWindow, "W3DGameWindow") - -public: - - W3DGameWindow(); - // already defined by MPO. - //~W3DGameWindow(); - - /// draw borders for this window only, NO child windows or anything else - virtual void winDrawBorder() override; - - Int winSetPosition( Int x, Int y ); ///< set window position - virtual Int winSetText( UnicodeString newText ) override; ///< set text string - virtual void winSetFont( GameFont *font ) override; ///< set font for window - - void getTextSize( Int *width, Int *height ); ///< get size of text - void setTextLoc( Int x, Int y ); ///< set text screen coord loc - void drawText( Color color ); ///< draw text in the text renderer - -protected: - - /// helper function to draw borders - void blitBorderRect( Int x, Int y, Int width, Int height ); - - Render2DSentenceClass m_textRenderer; ///< for drawing text - ICoord2D m_textPos; ///< current text pos set in text renderer - Color m_currTextColor; ///< current color used in text renderer - Bool m_needPolyDraw; ///< TRUE need to redo the text polys - Bool m_newTextPos; ///< TRUE when our window has moved and we need a new text pos - -}; - -// INLINING /////////////////////////////////////////////////////////////////// - -// EXTERNALS ////////////////////////////////////////////////////////////////// -extern void W3DGameWinDefaultDraw( GameWindow *window, - WinInstanceData *instData ); diff --git a/Generals/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DGameWindowManager.h b/Generals/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DGameWindowManager.h deleted file mode 100644 index 952eb79b00e..00000000000 --- a/Generals/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DGameWindowManager.h +++ /dev/null @@ -1,106 +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 . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: W3DGameWindowManager.h /////////////////////////////////////////////////////////////////// -// Created: Colin Day, June 2001 -// Desc: W3D implementation specific parts for the game window manager, -// which controls all access to the game windows for the in and -// of game GUI controls and windows -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "GameClient/GameWindowManager.h" -#include "W3DDevice/GameClient/W3DGameWindow.h" -#include "W3DDevice/GameClient/W3DGadget.h" - -//------------------------------------------------------------------------------------------------- -/** W3D implementation of the game window manager which controls all windows - * and user interface controls */ -//------------------------------------------------------------------------------------------------- -class W3DGameWindowManager : public GameWindowManager -{ - -public: - - W3DGameWindowManager(); - virtual ~W3DGameWindowManager() override; - - virtual void init() override; ///< initialize the singlegon - - virtual GameWindow *allocateNewWindow() override; ///< allocate a new game window - virtual GameWinDrawFunc getDefaultDraw() override; ///< return default draw func to use - - virtual GameWinDrawFunc getPushButtonImageDrawFunc() override; - virtual GameWinDrawFunc getPushButtonDrawFunc() override; - virtual GameWinDrawFunc getCheckBoxImageDrawFunc() override; - virtual GameWinDrawFunc getCheckBoxDrawFunc() override; - virtual GameWinDrawFunc getRadioButtonImageDrawFunc() override; - virtual GameWinDrawFunc getRadioButtonDrawFunc() override; - virtual GameWinDrawFunc getTabControlImageDrawFunc() override; - virtual GameWinDrawFunc getTabControlDrawFunc() override; - virtual GameWinDrawFunc getListBoxImageDrawFunc() override; - virtual GameWinDrawFunc getListBoxDrawFunc() override; - virtual GameWinDrawFunc getComboBoxImageDrawFunc() override; - virtual GameWinDrawFunc getComboBoxDrawFunc() override; - virtual GameWinDrawFunc getHorizontalSliderImageDrawFunc() override; - virtual GameWinDrawFunc getHorizontalSliderDrawFunc() override; - virtual GameWinDrawFunc getVerticalSliderImageDrawFunc() override; - virtual GameWinDrawFunc getVerticalSliderDrawFunc() override; - virtual GameWinDrawFunc getProgressBarImageDrawFunc() override; - virtual GameWinDrawFunc getProgressBarDrawFunc() override; - virtual GameWinDrawFunc getStaticTextImageDrawFunc() override; - virtual GameWinDrawFunc getStaticTextDrawFunc() override; - virtual GameWinDrawFunc getTextEntryImageDrawFunc() override; - virtual GameWinDrawFunc getTextEntryDrawFunc() override; - -protected: - -}; - -// INLINE ////////////////////////////////////////////////////////////////////////////////////////// -inline GameWindow *W3DGameWindowManager::allocateNewWindow() { return newInstance(W3DGameWindow); } -inline GameWinDrawFunc W3DGameWindowManager::getDefaultDraw() { return W3DGameWinDefaultDraw; } -inline GameWinDrawFunc W3DGameWindowManager::getPushButtonImageDrawFunc() { return W3DGadgetPushButtonImageDraw; } -inline GameWinDrawFunc W3DGameWindowManager::getPushButtonDrawFunc() { return W3DGadgetPushButtonDraw; } -inline GameWinDrawFunc W3DGameWindowManager::getCheckBoxImageDrawFunc() { return W3DGadgetCheckBoxImageDraw; } -inline GameWinDrawFunc W3DGameWindowManager::getCheckBoxDrawFunc() { return W3DGadgetCheckBoxDraw; } -inline GameWinDrawFunc W3DGameWindowManager::getRadioButtonImageDrawFunc() { return W3DGadgetRadioButtonImageDraw; } -inline GameWinDrawFunc W3DGameWindowManager::getRadioButtonDrawFunc() { return W3DGadgetRadioButtonDraw; } -inline GameWinDrawFunc W3DGameWindowManager::getTabControlImageDrawFunc() { return W3DGadgetTabControlImageDraw; } -inline GameWinDrawFunc W3DGameWindowManager::getTabControlDrawFunc() { return W3DGadgetTabControlDraw; } -inline GameWinDrawFunc W3DGameWindowManager::getListBoxImageDrawFunc() { return W3DGadgetListBoxImageDraw; } -inline GameWinDrawFunc W3DGameWindowManager::getListBoxDrawFunc() { return W3DGadgetListBoxDraw; } -inline GameWinDrawFunc W3DGameWindowManager::getComboBoxImageDrawFunc() { return W3DGadgetComboBoxImageDraw; } -inline GameWinDrawFunc W3DGameWindowManager::getComboBoxDrawFunc() { return W3DGadgetComboBoxDraw; } -inline GameWinDrawFunc W3DGameWindowManager::getHorizontalSliderImageDrawFunc() { return W3DGadgetHorizontalSliderImageDraw; } -inline GameWinDrawFunc W3DGameWindowManager::getHorizontalSliderDrawFunc() { return W3DGadgetHorizontalSliderDraw; } -inline GameWinDrawFunc W3DGameWindowManager::getVerticalSliderImageDrawFunc() { return W3DGadgetVerticalSliderImageDraw; } -inline GameWinDrawFunc W3DGameWindowManager::getVerticalSliderDrawFunc() { return W3DGadgetVerticalSliderDraw; } -inline GameWinDrawFunc W3DGameWindowManager::getProgressBarImageDrawFunc() { return W3DGadgetProgressBarImageDraw; } -inline GameWinDrawFunc W3DGameWindowManager::getProgressBarDrawFunc() { return W3DGadgetProgressBarDraw; } -inline GameWinDrawFunc W3DGameWindowManager::getStaticTextImageDrawFunc() { return W3DGadgetStaticTextImageDraw; } -inline GameWinDrawFunc W3DGameWindowManager::getStaticTextDrawFunc() { return W3DGadgetStaticTextDraw; } -inline GameWinDrawFunc W3DGameWindowManager::getTextEntryImageDrawFunc() { return W3DGadgetTextEntryImageDraw; } -inline GameWinDrawFunc W3DGameWindowManager::getTextEntryDrawFunc() { return W3DGadgetTextEntryDraw; } diff --git a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/GUICallbacks/W3DMOTD.cpp b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/GUICallbacks/W3DMOTD.cpp deleted file mode 100644 index 5e194c35a32..00000000000 --- a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/GUICallbacks/W3DMOTD.cpp +++ /dev/null @@ -1,128 +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 . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: W3DMOTD.cpp ////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -// -// Westwood Studios Pacific. -// -// Confidential Information -// Copyright (C) 2001 - All Rights Reserved -// -//----------------------------------------------------------------------------- -// -// Project: RTS3 -// -// File name: W3DMOTD.cpp -// -// Created: Colin Day, August 2001 -// -// Desc: Message of the day -// -//----------------------------------------------------------------------------- -/////////////////////////////////////////////////////////////////////////////// - -// SYSTEM INCLUDES //////////////////////////////////////////////////////////// -#include - -// USER INCLUDES ////////////////////////////////////////////////////////////// -#include "Common/NameKeyGenerator.h" -#include "GameClient/GameWindow.h" -#include "GameClient/GameWindowManager.h" -#include "GameClient/DisplayStringManager.h" -#include "GameClient/GadgetSlider.h" - -/////////////////////////////////////////////////////////////////////////////// -// DEFINES //////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// - -// PRIVATE TYPES ////////////////////////////////////////////////////////////// - -// PRIVATE DATA /////////////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////////////////// -// PUBLIC DATA //////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// -static NameKeyType closeButtonID = NAMEKEY_INVALID; - -// PRIVATE PROTOTYPES ///////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////////////////// -// PRIVATE FUNCTIONS ////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////////////////// -// PUBLIC FUNCTIONS /////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// - -// MOTDSystem ================================================================= -/** Message of the day */ -//============================================================================= -WindowMsgHandledType MOTDSystem( GameWindow *window, UnsignedInt msg, - WindowMsgData mData1, WindowMsgData mData2 ) -{ - switch( msg ) - { - - // ------------------------------------------------------------------------ - case GWM_CREATE: - { - - // load id's needed - closeButtonID = TheNameKeyGenerator->nameToKey( "MOTD.wnd:CloseMOTD" ); - - break; - - } - - // ------------------------------------------------------------------------ - case GWM_DESTROY: - { - - break; - - } - - // ------------------------------------------------------------------------ - case GBM_SELECTED: - { - GameWindow *control = (GameWindow *)mData1; - Int controlID = control->winGetWindowId(); - - if( controlID == closeButtonID ) - window->winHide( !window->winIsHidden() ); - - break; - - } - - default: - return MSG_IGNORED; - } - - return MSG_HANDLED; - -} - - diff --git a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/GUICallbacks/W3DMainMenu.cpp b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/GUICallbacks/W3DMainMenu.cpp deleted file mode 100644 index d8119539ddb..00000000000 --- a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/GUICallbacks/W3DMainMenu.cpp +++ /dev/null @@ -1,1002 +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 . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: W3DMainMenu.cpp ///////////////////////////////////////////////// -//----------------------------------------------------------------------------- -// -// Electronic Arts Pacific. -// -// Confidential Information -// Copyright (C) 2002 - All Rights Reserved -// -//----------------------------------------------------------------------------- -// -// created: Apr 2002 -// -// Filename: W3DMainMenu.cpp -// -// author: Chris Huybregts -// -// purpose: The Draw Routine for the main menu -// -//----------------------------------------------------------------------------- -/////////////////////////////////////////////////////////////////////////////// - -//----------------------------------------------------------------------------- -// SYSTEM INCLUDES //////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -#define WIN32_LEAN_AND_MEAN -#include -#include -#include -//----------------------------------------------------------------------------- -// USER INCLUDES ////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -#include "GameClient/GameWindow.h" -#include "Lib/BaseType.h" -#include "W3DDevice/GameClient/W3DGameWindow.h" -#include "GameClient/Display.h" -#include "GameLogic/GameLogic.h" -#include "GameClient/Shell.h" -#include "GameClient/ShellMenuScheme.h" -#include "GameClient/Credits.h" - -#include "GameClient/Gadget.h" -#include "GameClient/GameWindowGlobal.h" -#include "GameClient/GameWindowManager.h" -#include "GameClient/GadgetPushButton.h" -#include "W3DDevice/GameClient/W3DDisplay.h" -#include "W3DDevice/GameClient/W3DGadget.h" - -#include "GameClient/GUICallbacks.h" - -//----------------------------------------------------------------------------- -// DEFINES //////////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- - -void drawText( GameWindow *window, WinInstanceData *instData ); -static Color BrownishColor = GameMakeColor(167,134,94,255); -static IRegion2D clipRegion; -//----------------------------------------------------------------------------- -// PUBLIC FUNCTIONS /////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- - -//----------------------------------------------------------------------------- -// PRIVATE FUNCTIONS ////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- - -static void advancePosition(GameWindow *window, const Image *image, UnsignedInt posX, UnsignedInt posY, UnsignedInt sizeX, UnsignedInt sizeY) -{ - if(!image) - return; - - static Bool goingForward = TRUE; - - ICoord2D pos, size; - if(!window) - { - pos.x = posX; - pos.y = posY; - size.x = sizeX; - size.y = sizeY; - } - else - { - window->winGetScreenPosition(&pos.x, &pos.y); - window->winGetSize(&size.x,&size.y); - } - static Int Width = size.x + image->getImageWidth(); - - static Int x = -DEFAULT_DISPLAY_WIDTH; - static Int y = pos.y - (image->getImageHeight()/2); - - static UnsignedInt m_startTime = timeGetTime(); - Int time = timeGetTime() - m_startTime; - Real percentDone = INT_TO_REAL(time) / 10000; - - if(goingForward) - { - if(percentDone >= 1) - { - y = pos.y + size.y - (image->getImageHeight()/2); - m_startTime = timeGetTime(); - goingForward = FALSE; - } - else - { - y = pos.y - (image->getImageHeight()/2); - x = (percentDone * Width) - image->getImageWidth(); - } - } - else - { - if(percentDone >= 1) - { - y = pos.y - (image->getImageHeight()/2); - m_startTime = timeGetTime(); - goingForward = TRUE; - } - else - { - y = pos.y + size.y - (image->getImageHeight()/2); - x = size.x - (percentDone * Width); - } - } - TheDisplay->drawImage(image,x, y, x + image->getImageWidth(), y + image->getImageHeight()); - -} - -void W3DShellMenuSchemeDraw( GameWindow *window, WinInstanceData *instData ) -{ - if(TheShell && TheShell->isShellActive()) - TheShell->getShellMenuSchemeManager()->draw(); -} - -void W3DMainMenuDraw( GameWindow *window, WinInstanceData *instData ) -{ - //W3DGameWinDefaultDraw( window, instData ); - - //R:83 G:78 B:52 - - static UnsignedInt color = BrownishColor; - static UnsignedInt colorDrop = GameMakeColor(38,30,21,255); - ICoord2D pos, size; - Int height = TheDisplay->getHeight(); - - window->winGetScreenPosition(&pos.x, &pos.y); - window->winGetSize(&size.x,&size.y); - - - - IRegion2D topHorizontal1 ={pos.x, pos.y, pos.x + size.x, pos.y }; - IRegion2D topHorizontal1drop ={pos.x, pos.y+1, pos.x + size.x, pos.y+1 }; - - IRegion2D topHorizontal2 ={pos.x, pos.y + Int(size.y * .1) , pos.x + size.x, pos.y + Int(size.y * .1) }; - IRegion2D topHorizontal2drop ={pos.x, pos.y + Int(size.y * .12) , pos.x + size.x, pos.y + Int(size.y * .12) }; - - IRegion2D bottomHorizontal1={pos.x, pos.y + Int(size.y * .9), pos.x + size.x, pos.y + Int(size.y * .9) }; - IRegion2D bottomHorizontal1drop={pos.x, pos.y + Int(size.y * .92), pos.x + size.x, pos.y + Int(size.y * .92) }; - - IRegion2D bottomHorizontal2= {pos.x, pos.y + size.y, pos.x + size.x, pos.y + size.y }; - IRegion2D bottomHorizontal2drop= {pos.x, pos.y + size.y + 1, pos.x + size.x, pos.y + size.y + 1 }; - - IRegion2D vertical1 ={pos.x + Int(size.x * .225), pos.y , pos.x + Int(size.x * .225), height }; - IRegion2D vertical2 ={pos.x + Int(size.x * .445), pos.y, pos.x + Int(size.x * .445), height }; - IRegion2D vertical3 ={pos.x + Int(size.x * .6662), pos.y, pos.x + Int(size.x * .6662), height }; - IRegion2D vertical4 ={pos.x + Int(size.x * .885), pos.y , pos.x + Int(size.x * .885), height }; -// static IRegion2D verticle5 ={pos.x + (size.x * .7250), pos.y + (size.y * .12), pos.x + (size.x * .7250), pos.y + (size.y * .86) }; -// static IRegion2D verticle6 ={pos.x + (size.x * .9062), pos.y + (size.y * .12), pos.x + (size.x * .9062), pos.y + (size.y * .86) }; - - - TheDisplay->drawLine(topHorizontal1.lo.x,topHorizontal1.lo.y,topHorizontal1.hi.x,topHorizontal1.hi.y,2,color); - TheDisplay->drawLine(topHorizontal1drop.lo.x,topHorizontal1drop.lo.y,topHorizontal1drop.hi.x,topHorizontal1drop.hi.y,2,colorDrop); - TheDisplay->drawLine(topHorizontal2.lo.x,topHorizontal2.lo.y,topHorizontal2.hi.x,topHorizontal2.hi.y,1,color); - TheDisplay->drawLine(topHorizontal2drop.lo.x,topHorizontal2drop.lo.y,topHorizontal2drop.hi.x,topHorizontal2drop.hi.y,1,colorDrop); - TheDisplay->drawLine(bottomHorizontal1.lo.x,bottomHorizontal1.lo.y,bottomHorizontal1.hi.x,bottomHorizontal1.hi.y,1,color); - TheDisplay->drawLine(bottomHorizontal1drop.lo.x,bottomHorizontal1drop.lo.y,bottomHorizontal1drop.hi.x,bottomHorizontal1drop.hi.y,1,colorDrop); - TheDisplay->drawLine(bottomHorizontal2.lo.x,bottomHorizontal2.lo.y,bottomHorizontal2.hi.x,bottomHorizontal2.hi.y,2,color); - TheDisplay->drawLine(bottomHorizontal2drop.lo.x,bottomHorizontal2drop.lo.y,bottomHorizontal2drop.hi.x,bottomHorizontal2drop.hi.y,2,colorDrop); - - - - TheDisplay->drawLine(vertical1.lo.x,vertical1.lo.y,vertical1.hi.x,vertical1.hi.y,3,color); - TheDisplay->drawLine(vertical2.lo.x,vertical2.lo.y,vertical2.hi.x,vertical2.hi.y,3,color); - TheDisplay->drawLine(vertical3.lo.x,vertical3.lo.y,vertical3.hi.x,vertical3.hi.y,3,color); - TheDisplay->drawLine(vertical4.lo.x,vertical4.lo.y,vertical4.hi.x,vertical4.hi.y,3,color); -// TheDisplay->drawLine(verticle5.lo.x,verticle5.lo.y,verticle5.hi.x,verticle5.hi.y,3,color); -// TheDisplay->drawLine(verticle6.lo.x,verticle6.lo.y,verticle6.hi.x,verticle6.hi.y,3,color); -// TheDisplay->drawLine(m_rightLineFromButton.lo.x,m_rightLineFromButton.lo.y,m_rightLineFromButton.hi.x,m_rightLineFromButton.hi.y,3,color1,color2); - - - - - advancePosition(nullptr, TheMappedImageCollection->findImageByName("MainMenuPulse"),pos.x,pos.y,size.x, size.y); - - //TheDisplay->drawLine(); - -} - -void W3DMainMenuFourDraw( GameWindow *window, WinInstanceData *instData ) -{ - //W3DGameWinDefaultDraw( window, instData ); - - //R:83 G:78 B:52 - - static UnsignedInt color = BrownishColor; - static UnsignedInt colorDrop = GameMakeColor(38,30,21,255); - ICoord2D pos, size; - Int height = TheDisplay->getHeight(); - - window->winGetScreenPosition(&pos.x, &pos.y); - window->winGetSize(&size.x,&size.y); - - - - IRegion2D topHorizontal1 ={pos.x, pos.y, pos.x + size.x, pos.y }; - IRegion2D topHorizontal1drop ={pos.x, pos.y+1, pos.x + size.x, pos.y+1 }; - - IRegion2D topHorizontal2 ={pos.x, pos.y + Int(size.y * .1) , pos.x + size.x, pos.y + Int(size.y * .1) }; - IRegion2D topHorizontal2drop ={pos.x, pos.y + Int(size.y * .12) , pos.x + size.x, pos.y + Int(size.y * .12) }; - - IRegion2D bottomHorizontal1={pos.x, pos.y + Int(size.y * .9), pos.x + size.x, pos.y + Int(size.y * .9) }; - IRegion2D bottomHorizontal1drop={pos.x, pos.y + Int(size.y * .92), pos.x + size.x, pos.y + Int(size.y * .92) }; - - IRegion2D bottomHorizontal2= {pos.x, pos.y + size.y, pos.x + size.x, pos.y + size.y }; - IRegion2D bottomHorizontal2drop= {pos.x, pos.y + size.y + 1, pos.x + size.x, pos.y + size.y + 1 }; - - IRegion2D vertical1 ={pos.x + Int(size.x * .295), pos.y , pos.x + Int(size.x * .295), height }; - IRegion2D vertical2 ={pos.x + Int(size.x * .59), pos.y, pos.x + Int(size.x * .59), height }; - //IRegion2D vertical3 ={pos.x + (size.x * .6662), pos.y, pos.x + (size.x * .6662), height }; - IRegion2D vertical4 ={pos.x + Int(size.x * .885), pos.y , pos.x + Int(size.x * .885), height }; -// static IRegion2D verticle5 ={pos.x + (size.x * .7250), pos.y + (size.y * .12), pos.x + (size.x * .7250), pos.y + (size.y * .86) }; -// static IRegion2D verticle6 ={pos.x + (size.x * .9062), pos.y + (size.y * .12), pos.x + (size.x * .9062), pos.y + (size.y * .86) }; - - - TheDisplay->drawLine(topHorizontal1.lo.x,topHorizontal1.lo.y,topHorizontal1.hi.x,topHorizontal1.hi.y,2,color); - TheDisplay->drawLine(topHorizontal1drop.lo.x,topHorizontal1drop.lo.y,topHorizontal1drop.hi.x,topHorizontal1drop.hi.y,2,colorDrop); - TheDisplay->drawLine(topHorizontal2.lo.x,topHorizontal2.lo.y,topHorizontal2.hi.x,topHorizontal2.hi.y,1,color); - TheDisplay->drawLine(topHorizontal2drop.lo.x,topHorizontal2drop.lo.y,topHorizontal2drop.hi.x,topHorizontal2drop.hi.y,1,colorDrop); - TheDisplay->drawLine(bottomHorizontal1.lo.x,bottomHorizontal1.lo.y,bottomHorizontal1.hi.x,bottomHorizontal1.hi.y,1,color); - TheDisplay->drawLine(bottomHorizontal1drop.lo.x,bottomHorizontal1drop.lo.y,bottomHorizontal1drop.hi.x,bottomHorizontal1drop.hi.y,1,colorDrop); - TheDisplay->drawLine(bottomHorizontal2.lo.x,bottomHorizontal2.lo.y,bottomHorizontal2.hi.x,bottomHorizontal2.hi.y,2,color); - TheDisplay->drawLine(bottomHorizontal2drop.lo.x,bottomHorizontal2drop.lo.y,bottomHorizontal2drop.hi.x,bottomHorizontal2drop.hi.y,2,colorDrop); - - - - TheDisplay->drawLine(vertical1.lo.x,vertical1.lo.y,vertical1.hi.x,vertical1.hi.y,3,color); - TheDisplay->drawLine(vertical2.lo.x,vertical2.lo.y,vertical2.hi.x,vertical2.hi.y,3,color); - //TheDisplay->drawLine(vertical3.lo.x,vertical3.lo.y,vertical3.hi.x,vertical3.hi.y,3,color); - TheDisplay->drawLine(vertical4.lo.x,vertical4.lo.y,vertical4.hi.x,vertical4.hi.y,3,color); -// TheDisplay->drawLine(verticle5.lo.x,verticle5.lo.y,verticle5.hi.x,verticle5.hi.y,3,color); -// TheDisplay->drawLine(verticle6.lo.x,verticle6.lo.y,verticle6.hi.x,verticle6.hi.y,3,color); -// TheDisplay->drawLine(m_rightLineFromButton.lo.x,m_rightLineFromButton.lo.y,m_rightLineFromButton.hi.x,m_rightLineFromButton.hi.y,3,color1,color2); - - - - - advancePosition(nullptr, TheMappedImageCollection->findImageByName("MainMenuPulse"),pos.x,pos.y,size.x, size.y); - - //TheDisplay->drawLine(); - -} - - -void W3DMetalBarMenuDraw( GameWindow *window, WinInstanceData *instData ) -{ - //ICoord2D original, size; -// TheDisplay->setClipRegion(&clipRegion); - window->winDrawBorder(); - //window->winGetScreenPosition(&original.x, &original.y); - //window->winGetSize(&size.x, &size.y); - //blitBorderRect( original.x, original.y, size.x, size.y ); - //W3DGameWinDefaultDraw( window, instData ); -// TheDisplay->enableClipping(FALSE); -} - - - //W3DGameWinDefaultDraw( window, instData ); -// -// //R:83 G:78 B:52 -// -// -//// UnsignedInt color = GameMakeColor(113,108,82,212); -// ICoord2D pos, size; -// -// window->winGetScreenPosition(&pos.x, &pos.y); -// window->winGetSize(&size.x,&size.y); -// -// const Image *image = TheMappedImageCollection->findImageByName("LogoGlow"); -// -// if(!image) -// return; -// -// Int Width = size.x + image->getImageWidth(); -// -// static Int x = pos.x - image->getImageWidth(); -// static Int y = pos.y - (image->getImageHeight()/2); -// -// static UnsignedInt m_startTime = timeGetTime(); -// Int time = timeGetTime() - m_startTime; -// Real percentDone = INT_TO_REAL(time) / 15624; -// -// if(percentDone >= 1) -// { -//// y = pos.y + size.y - (image->getImageHeight()/2) - 2; -// m_startTime = timeGetTime(); -// } -// else -// { -// x = (percentDone * Width) - image->getImageWidth(); -// } -// -// IRegion2D clip; -// clip.lo.x = pos.x; -// clip.lo.y = pos.y - image->getImageHeight(); -// clip.hi.x = pos.x + size.x; -// clip.hi.y = pos.y + size.y; -// TheDisplay->setClipRegion(&clip); -// Int alpha; -// if(percentDone > .5) -// alpha = ((1-percentDone) * 2) * 255; -// else -// alpha = ( percentDone * 2) * 255; -// -// TheDisplay->drawImage(image,x, y , x + image->getImageWidth(), y + image->getImageHeight(), GameMakeColor(255,255,255,alpha)); -// //TheDisplay->drawImage(image,x, y , x + image->getImageWidth(), y + image->getImageHeight(), GameMakeColor(255,200,250,alpha)); -// TheDisplay->enableClipping(FALSE ); -// //TheDisplay->drawLine(); -// - - -void W3DClockDraw( GameWindow *window, WinInstanceData *instData ) -{ - W3DGameWinDefaultDraw( window, instData ); - ICoord2D pos, size; - - window->winGetScreenPosition(&pos.x, &pos.y); - window->winGetSize(&size.x,&size.y); - - char datestr[256] = ""; - time_t longTime; - struct tm *curtime; - time(&longTime); - curtime = localtime(&longTime); - strftime(datestr, 256, "%H:%M:%S", curtime); - UnicodeString temp; - temp.translate(datestr); - instData->setText(temp); - - DisplayString *dString; - dString = instData->getTextDisplayString(); - - - dString->setFont(TheFontLibrary->getFont("Arial",16,0)); - - Int textWidth, textHeight; - ICoord2D textPos; - IRegion2D clockClipRegion; - // sanity - - // how much space will this text take up - dString->getSize( &textWidth, &textHeight ); - - //Init the clip region - clockClipRegion.lo.x = pos.x + 1; - clockClipRegion.lo.y = pos.y + 1; - clockClipRegion.hi.x = pos.x + size.x - 1; - clockClipRegion.hi.y = pos.y + size.y - 1; - - textPos.x = pos.x + (size.x / 2) - (textWidth / 2); - textPos.y = pos.y + (size.y / 2) - (textHeight / 2); - dString->setClipRegion(&clockClipRegion); - dString->draw( textPos.x, textPos.y, GameMakeColor(255,255,255,255), GameMakeColor(0,0,0,255) ); - - - -} - -void W3DMainMenuMapBorder( GameWindow *window, WinInstanceData *instData ) -{ - enum - { - BORDER_CORNER_SIZE = 10, - BORDER_LINE_SIZE = 20, - }; - //( Int x, Int y, Int width, Int height ) - -// save original x, y - Int x, y, width, height; - window->winGetScreenPosition(&x, &y); - window->winGetSize(&width,&height); - -// TheDisplay->setClipRegion(&clipRegion); - Int originalX = x; - Int originalY = y; - Int maxX = x + width; - Int maxY = y + height; - Int x2, y2; // used for simultaneous drawing of line pairs - Int size = 20; - Int halfSize = size / 2; - - const Image *image = nullptr; - - // Draw Horizontal Lines - // All border pieces are based on a 10 pixel offset from the centerline - y = originalY - 10; - y2 = maxY - 10; - x2 = maxX - (10 + BORDER_LINE_SIZE); - - image = TheMappedImageCollection->findImageByName("FrameCornerHorizontal"); - if(image) - { - - for( x=(originalX + 10); x <= x2; x += BORDER_LINE_SIZE ) - { - - TheDisplay->drawImage( image, - x, y, x + size, y + size ); - TheDisplay->drawImage( image, - x, y2, x + size, y2 + size ); - - } - - - x2 = maxX - BORDER_CORNER_SIZE; - - // x == place to draw remainder if any - if( (x2 - x) >= (BORDER_LINE_SIZE / 2) ) - { - - //Blit Half piece - TheDisplay->drawImage( image, - x, y, x + halfSize, y + size ); - TheDisplay->drawImage( image, - x, y2, x + halfSize, y2 + size ); - - x += (BORDER_LINE_SIZE / 2); - - } - - - // x2 - x ... must now be less than a half piece - // check for equals and if not blit an adjusted half piece border pieces have - // a two pixel repeat so we will blit one pixel over if necessary to line up - // the art, but we'll cover-up the overlap with the corners - if( x < x2 ) - { - x -= ((BORDER_LINE_SIZE / 2) - (((x2 - x) + 1) & ~1)); - - //Blit Half piece - TheDisplay->drawImage( image, - x, y, x + halfSize, y + size ); - TheDisplay->drawImage( image, - x, y2, x + halfSize, y2 + size ); - - } - } - image = TheMappedImageCollection->findImageByName("FrameCornerVertical"); - - if( image ) - { - - // Draw Vertical Lines - // All border pieces are based on a 10 pixel offset from the centerline - x = originalX - 10; - x2 = maxX - 10; - y2 = maxY - (10 + BORDER_LINE_SIZE); - - for( y=(originalY + 10); y <= y2; y += BORDER_LINE_SIZE ) - { - - TheDisplay->drawImage( image, - x, y, x + size, y + size ); - TheDisplay->drawImage( image, - x2, y, x2 + size, y + size ); - - } - - y2 = maxY - BORDER_CORNER_SIZE; - - // y == place to draw remainder if any - if( (y2 - y) >= (BORDER_LINE_SIZE / 2) ) - { - - //Blit Half piece - TheDisplay->drawImage( image, - x, y, x + size, y + halfSize ); - TheDisplay->drawImage( image, - x2, y, x2 + size, y + halfSize ); - - y += (BORDER_LINE_SIZE / 2); - } - - // y2 - y ... must now be less than a half piece - // check for equals and if not blit an adjusted half piece border pieces have - // a two pixel repeat so we will blit one pixel over if necessary to line up - // the art, but we'll cover-up the overlap with the corners - if( y < y2 ) - { - y -= ((BORDER_LINE_SIZE / 2) - (((y2 - y) + 1) & ~1)); - - //Blit Half piece - TheDisplay->drawImage( image, - x, y, x + size, y + halfSize ); - TheDisplay->drawImage( image, - x2, y, x2 + size, y + halfSize ); - - } - } - - // Draw Corners - x = originalX - BORDER_CORNER_SIZE; - y = originalY - BORDER_CORNER_SIZE; - TheDisplay->drawImage( TheMappedImageCollection->findImageByName("FrameCornerUL"), - x, y, x + size, y + size ); - x = maxX - BORDER_CORNER_SIZE; - y = originalY - BORDER_CORNER_SIZE; - TheDisplay->drawImage( TheMappedImageCollection->findImageByName("FrameCornerUR"), - x, y, x + size, y + size ); - x = originalX - BORDER_CORNER_SIZE; - y = maxY - BORDER_CORNER_SIZE; - TheDisplay->drawImage( TheMappedImageCollection->findImageByName("FrameCornerLL"), - x, y, x + size, y + size ); - x = maxX - BORDER_CORNER_SIZE; - y = maxY - BORDER_CORNER_SIZE; - TheDisplay->drawImage(TheMappedImageCollection->findImageByName("FrameCornerLR"), - x, y, x + size, y + size ); - - TheDisplay->enableClipping(FALSE); - -} - - -//Specialized drawing function for the buttons with the weird drop shadow -// W3DMainMenuButtonDropShadowDraw =============================================== -/** Draw pushbutton with user supplied images */ -//============================================================================= -void W3DMainMenuButtonDropShadowDraw( GameWindow *window, - WinInstanceData *instData ) -{ - const Image *leftImage, *rightImage, *centerImage; - ICoord2D origin, size, start, end; - Int xOffset, yOffset; - Int i; - - // get screen position and size - window->winGetScreenPosition( &origin.x, &origin.y ); - window->winGetSize( &size.x, &size.y ); - - // get image offset - xOffset = instData->m_imageOffset.x; - yOffset = instData->m_imageOffset.y; - - - // - // get pointer to image we want to draw depending on our state, - // see GadgetPushButton.h for info - // - if( BitIsSet( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) - { - - if( BitIsSet( instData->getState(), WIN_STATE_SELECTED ) ) - { - leftImage = GadgetButtonGetLeftDisabledSelectedImage( window ); - rightImage = GadgetButtonGetRightDisabledSelectedImage( window ); - centerImage = GadgetButtonGetMiddleDisabledSelectedImage( window ); - } - else - { - - leftImage = GadgetButtonGetLeftDisabledImage( window ); - rightImage = GadgetButtonGetRightDisabledImage( window ); - centerImage = GadgetButtonGetMiddleDisabledImage( window ); - - } - - } - else if( BitIsSet( instData->getState(), WIN_STATE_HILITED ) ) - { - - if( BitIsSet( instData->getState(), WIN_STATE_SELECTED ) ) - { - leftImage = GadgetButtonGetLeftHiliteSelectedImage( window ); - rightImage = GadgetButtonGetRightHiliteSelectedImage( window ); - centerImage = GadgetButtonGetMiddleHiliteSelectedImage( window ); - } - else - { - - leftImage = GadgetButtonGetLeftHiliteImage( window ); - rightImage = GadgetButtonGetRightHiliteImage( window ); - centerImage = GadgetButtonGetMiddleHiliteImage( window ); - - } - - } - else - { - - if( BitIsSet( instData->getState(), WIN_STATE_SELECTED ) ) - { - leftImage = GadgetButtonGetLeftEnabledSelectedImage( window ); - rightImage = GadgetButtonGetRightEnabledSelectedImage( window ); - centerImage = GadgetButtonGetMiddleEnabledSelectedImage( window ); - } - else - { - - leftImage = GadgetButtonGetLeftEnabledImage( window ); - rightImage = GadgetButtonGetRightEnabledImage( window ); - centerImage = GadgetButtonGetMiddleEnabledImage( window ); - - } - - } - - // sanity, we need to have these images to make it look right - if( leftImage == nullptr || rightImage == nullptr || - centerImage == nullptr ) - return; - - // get image sizes for the ends - ICoord2D leftSize, rightSize; - leftSize.x = leftImage->getImageWidth(); - leftSize.y = leftImage->getImageHeight(); - rightSize.x = rightImage->getImageWidth(); - rightSize.y = rightImage->getImageHeight(); - - // get two key points used in the end drawing - ICoord2D leftEnd, rightStart; - leftEnd.x = origin.x + leftSize.x + xOffset; - leftEnd.y = origin.y + size.y + yOffset; - rightStart.x = origin.x + size.x - rightSize.x + xOffset; - rightStart.y = origin.y + yOffset; - - // draw the center repeating bar - Int centerWidth, pieces; - - // get width we have to draw our repeating center in - centerWidth = rightStart.x - leftEnd.x; - - if( centerWidth <= 0) - { -// TheDisplay->setClipRegion(&clipRegion); - // draw left end - start.x = origin.x + xOffset; - start.y = origin.y + yOffset; - end.y = leftEnd.y; - end.x = origin.x + xOffset + size.x/2; - TheWindowManager->winDrawImage(leftImage, start.x, start.y, end.x, end.y); - - // draw right end - start.y = rightStart.y; - start.x = end.x; - end.x = origin.x + size.x; - end.y = start.y + size.y; - TheWindowManager->winDrawImage(rightImage, start.x, start.y, end.x, end.y); - } - else - { - - // how many whole repeating pieces will fit in that width - pieces = centerWidth / centerImage->getImageWidth(); - - // draw the pieces - start.x = leftEnd.x; - start.y = origin.y + yOffset; - end.y = start.y + size.y + yOffset; //centerImage->getImageHeight() + yOffset; -// TheDisplay->setClipRegion(&clipRegion); - for( i = 0; i < pieces; i++ ) - { - - end.x = start.x + centerImage->getImageWidth(); - TheWindowManager->winDrawImage( centerImage, - start.x, start.y, - end.x, end.y ); - start.x += centerImage->getImageWidth(); - - } - - // we will draw the image but clip the parts we don't want to show - IRegion2D reg; - reg.lo.x = start.x; - reg.lo.y = clipRegion.lo.y; - reg.hi.x = rightStart.x; - reg.hi.y = clipRegion.hi.y; - centerWidth = rightStart.x - start.x; - if( centerWidth > 0) - { - TheDisplay->setClipRegion(®); - end.x = start.x + centerImage->getImageWidth(); - TheWindowManager->winDrawImage( centerImage, - start.x, start.y, - end.x, end.y ); - TheDisplay->enableClipping(FALSE); - } - -// TheDisplay->setClipRegion(&clipRegion); - // draw left end - start.x = origin.x + xOffset; - start.y = origin.y + yOffset; - end = leftEnd; - TheWindowManager->winDrawImage(leftImage, start.x, start.y, end.x, end.y); - - // draw right end - start = rightStart; - end.x = start.x + rightSize.x; - end.y = start.y + size.y; - TheWindowManager->winDrawImage(rightImage, start.x, start.y, end.x, end.y); - } - - // draw the button text - if( instData->getTextLength() ) - drawText( window, instData ); - - // get window position - window->winGetScreenPosition( &start.x, &start.y ); - window->winGetSize( &size.x, &size.y ); - - - // if we have a video buffer, draw the video buffer - if ( instData->m_videoBuffer ) - { - TheDisplay->drawVideoBuffer( instData->m_videoBuffer, start.x, start.y, start.x + size.x, start.y + size.y ); - } - PushButtonData *pData = (PushButtonData *)window->winGetUserData(); - if( pData ) - { - if( pData->overlayImage ) - { - TheDisplay->drawImage( pData->overlayImage, start.x, start.y, start.x + size.x, start.y + size.y ); - } - - if( pData->drawClock ) - { - if( pData->drawClock == NORMAL_CLOCK ) - { - TheDisplay->drawRectClock(start.x, start.y, size.x, size.y, pData->percentClock,pData->colorClock); - } - else if( pData->drawClock == INVERSE_CLOCK ) - { - TheDisplay->drawRemainingRectClock( start.x, start.y, size.x, size.y, pData->percentClock,pData->colorClock ); - } - pData->drawClock = NO_CLOCK; - window->winSetUserData(pData); - } - - if( pData->drawBorder && pData->colorBorder != GAME_COLOR_UNDEFINED ) - { - TheDisplay->drawOpenRect(start.x - 1, start.y - 1, size.x + 2, size.y + 2, 1, pData->colorBorder); - } - } - -// TheDisplay->enableClipping(FALSE); -} - - -// drawButtonText ============================================================= -/** Draw button text to the screen */ -//============================================================================= -void drawText( GameWindow *window, WinInstanceData *instData ) -{ - ICoord2D origin, size, textPos; - Int width, height; - Color textColor, dropColor; - DisplayString *text = instData->getTextDisplayString(); - - // sanity - if( text == nullptr || text->getTextLength() == 0 ) - return; - - // get window position and size - window->winGetScreenPosition( &origin.x, &origin.y ); - window->winGetSize( &size.x, &size.y ); - - // set whether or not we center the wrapped text - text->setWordWrapCentered( BitIsSet( instData->getStatus(), WIN_STATUS_WRAP_CENTERED )); - text->setWordWrap(size.x); - // get the right text color - if( BitIsSet( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) - { - textColor = window->winGetDisabledTextColor(); - dropColor = window->winGetDisabledTextBorderColor(); - } - else if( BitIsSet( instData->getState(), WIN_STATE_HILITED ) ) - { - textColor = window->winGetHiliteTextColor(); - dropColor = window->winGetHiliteTextBorderColor(); - } - else - { - textColor = window->winGetEnabledTextColor(); - dropColor = window->winGetEnabledTextBorderColor(); - } - - // set our font to that of our parent if not the same - if( text->getFont() != window->winGetFont() ) - text->setFont( window->winGetFont() ); - - // get text size - text->getSize( &width, &height ); - - // where to draw - textPos.x = origin.x + (size.x / 2) - (width / 2); - textPos.y = origin.y + (size.y / 2) - (height / 2); -// text->setClipRegion(&clipRegion); - // draw it - text->draw( textPos.x, textPos.y, textColor, dropColor ); - -} - -// W3DMainMenuRandomTextDraw ================================================== -/** Specialized drawing function for the random text */ -//============================================================================= -void W3DMainMenuRandomTextDraw( GameWindow *window, WinInstanceData *instData ) -{ - TextData *tData = (TextData *)window->winGetUserData(); - Color textColor, textOutlineColor; - ICoord2D size, origin, textPos; - Int textWidth, textHeight; - IRegion2D textclipRegion; - // get window position and size - window->winGetScreenPosition( &origin.x, &origin.y ); - window->winGetSize( &size.x, &size.y ); - textColor = window->winGetDisabledTextColor(); - textOutlineColor = window->winGetDisabledTextBorderColor(); - // draw the text - - if( !(tData->text && (textColor != WIN_COLOR_UNDEFINED)) ) - return; - - DisplayString *text = tData->text; - //Init the clip region - textclipRegion.lo.x = origin.x + 1; - textclipRegion.lo.y = origin.y + 1; - textclipRegion.hi.x = origin.x + size.x - 1; - textclipRegion.hi.y = origin.y + size.y - 1; - - // how much space will this text take up - text->getSize( &textWidth, &textHeight ); - - // draw the text - textPos.x = origin.x; - textPos.y = origin.y + (size.y / 2) - (textHeight / 2); - text->setClipRegion(&textclipRegion); - text->draw( textPos.x, textPos.y, textColor, textOutlineColor ); - -} -void W3DThinBorderDraw( GameWindow *window, WinInstanceData *instData ) -{ - ICoord2D start, size; - const Image *image; - - //W3DGameWinDefaultDraw( window, instData ); -// TheDisplay->setClipRegion(&clipRegion); - window->winGetScreenPosition( &start.x, &start.y ); - window->winGetSize( &size.x, &size.y ); - image = window->winGetEnabledImage( 0 ); - - if( image ) - { - ICoord2D begin, end; - - begin.x = start.x + instData->m_imageOffset.x; - begin.y = start.y + instData->m_imageOffset.y; - end.x = begin.x + size.x; - end.y = begin.y + size.y; - TheWindowManager->winDrawImage( image, begin.x, begin.y, end.x, end.y ); - - } - // get window position - -// TheDisplay->drawOpenRect(start.x - 1, start.y - 1, size.x + 2, size.y + 2, 1, BrownishColor); - TheDisplay->enableClipping(FALSE); -} - -void W3DMainMenuInit( WindowLayout *layout, void *userData ) -{ -/* - GameWindow *parent = layout->getFirstWindow(); -// NameKeyType buttonWorldBuilderID = TheNameKeyGenerator->nameToKey( "MainMenu.wnd:ButtonWorldBuilder" ); -// GameWindow *buttonWorldBuilder = TheWindowManager->winGetWindowFromId( parent, buttonWorldBuilderID ); -// if (buttonWorldBuilder) -// buttonWorldBuilder->winSetDrawFunc(W3DMainMenuButtonDropShadowDraw); - - NameKeyType staticTextRandom1ID = TheNameKeyGenerator->nameToKey( "MainMenu.wnd:StaticTextRandom1" ); - NameKeyType staticTextRandom2ID = TheNameKeyGenerator->nameToKey( "MainMenu.wnd:StaticTextRandom2" ); - GameWindow *staticTextRandom1 = TheWindowManager->winGetWindowFromId( parent, staticTextRandom1ID); - GameWindow *staticTextRandom2 = TheWindowManager->winGetWindowFromId( parent, staticTextRandom2ID); - if (staticTextRandom1) - staticTextRandom1->winSetDrawFunc(W3DMainMenuRandomTextDraw); - if (staticTextRandom2) - staticTextRandom2->winSetDrawFunc(W3DMainMenuRandomTextDraw); - -// //NameKeyType getUpdateID = TheNameKeyGenerator->nameToKey( "MainMenu.wnd:ButtonGetUpdate" ); - NameKeyType buttonUSAID = TheNameKeyGenerator->nameToKey( "MainMenu.wnd:ButtonUSA" ); - NameKeyType buttonGLAID = TheNameKeyGenerator->nameToKey( "MainMenu.wnd:ButtonGLA" ); - NameKeyType buttonChinaID = TheNameKeyGenerator->nameToKey( "MainMenu.wnd:ButtonChina" ); - NameKeyType skirmishID = TheNameKeyGenerator->nameToKey( "MainMenu.wnd:ButtonSkirmish" ); - NameKeyType onlineID = TheNameKeyGenerator->nameToKey( "MainMenu.wnd:ButtonOnline" ); - NameKeyType networkID = TheNameKeyGenerator->nameToKey( "MainMenu.wnd:ButtonNetwork" ); - - GameWindow *button = TheWindowManager->winGetWindowFromId( parent, skirmishID ); - if (button) - button->winSetDrawFunc(W3DMainMenuButtonDropShadowDraw); - button = TheWindowManager->winGetWindowFromId( parent, onlineID ); - if (button) - button->winSetDrawFunc(W3DMainMenuButtonDropShadowDraw); - button = TheWindowManager->winGetWindowFromId( parent, networkID ); - if (button) - button->winSetDrawFunc(W3DMainMenuButtonDropShadowDraw); - -//GameWindow *getUpdate = TheWindowManager->winGetWindowFromId( parent, getUpdateID ); - // if (getUpdate) - // getUpdate->winSetDrawFunc(W3DMainMenuButtonDropShadowDraw); - - GameWindow *buttonUSA = TheWindowManager->winGetWindowFromId( parent, buttonUSAID ); - if (buttonUSA) - buttonUSA->winSetDrawFunc(W3DMainMenuButtonDropShadowDraw); - GameWindow *buttonGLA = TheWindowManager->winGetWindowFromId( parent, buttonGLAID ); - if (buttonGLA) - buttonGLA->winSetDrawFunc(W3DMainMenuButtonDropShadowDraw); - GameWindow *buttonChina = TheWindowManager->winGetWindowFromId( parent, buttonChinaID ); - if (buttonChina) - buttonChina->winSetDrawFunc(W3DMainMenuButtonDropShadowDraw); - - GameWindow *win = nullptr; - win = TheWindowManager->winGetWindowFromId(parent, TheNameKeyGenerator->nameToKey("MainMenu.wnd:ButtonMultiBack")); - if(win) - win->winSetDrawFunc(W3DMainMenuButtonDropShadowDraw); - win = TheWindowManager->winGetWindowFromId(parent, TheNameKeyGenerator->nameToKey("MainMenu.wnd:ButtonSingleBack")); - if(win) - win->winSetDrawFunc(W3DMainMenuButtonDropShadowDraw); - win = TheWindowManager->winGetWindowFromId(parent, TheNameKeyGenerator->nameToKey("MainMenu.wnd:ButtonExit")); - if(win) - win->winSetDrawFunc(W3DMainMenuButtonDropShadowDraw); - win = TheWindowManager->winGetWindowFromId(parent, TheNameKeyGenerator->nameToKey("MainMenu.wnd:ButtonOptions")); - if(win) - win->winSetDrawFunc(W3DMainMenuButtonDropShadowDraw); - win = TheWindowManager->winGetWindowFromId(parent, TheNameKeyGenerator->nameToKey("MainMenu.wnd:ButtonMultiplayer")); - if(win) - win->winSetDrawFunc(W3DMainMenuButtonDropShadowDraw); - win = TheWindowManager->winGetWindowFromId(parent, TheNameKeyGenerator->nameToKey("MainMenu.wnd:ButtonSinglePlayer")); - if(win) - win->winSetDrawFunc(W3DMainMenuButtonDropShadowDraw); - win = TheWindowManager->winGetWindowFromId(parent, TheNameKeyGenerator->nameToKey("MainMenu.wnd:ButtonReplay")); - if(win) - win->winSetDrawFunc(W3DMainMenuButtonDropShadowDraw); - win = TheWindowManager->winGetWindowFromId(parent, TheNameKeyGenerator->nameToKey("MainMenu.wnd:ButtonLoadGame")); - if(win) - win->winSetDrawFunc(W3DMainMenuButtonDropShadowDraw); - win = TheWindowManager->winGetWindowFromId(parent, TheNameKeyGenerator->nameToKey("MainMenu.wnd:ButtonLoadReplay")); - if(win) - win->winSetDrawFunc(W3DMainMenuButtonDropShadowDraw); - win = TheWindowManager->winGetWindowFromId(parent, TheNameKeyGenerator->nameToKey("MainMenu.wnd:ButtonLoadReplayBack")); - if(win) - win->winSetDrawFunc(W3DMainMenuButtonDropShadowDraw); - - win = TheWindowManager->winGetWindowFromId(parent, TheNameKeyGenerator->nameToKey("MainMenu.wnd:ButtonTRAINING")); - if(win) - win->winSetDrawFunc(W3DMainMenuButtonDropShadowDraw); - - win = TheWindowManager->winGetWindowFromId(parent, TheNameKeyGenerator->nameToKey("MainMenu.wnd:ButtonCredits")); - if(win) - win->winSetDrawFunc(W3DMainMenuButtonDropShadowDraw); - - GameWindow *clipRegionWin = TheWindowManager->winGetWindowFromId( parent, TheNameKeyGenerator->nameToKey( "MainMenu.wnd:MapBorder" )); - Int x,y,width,height; - clipRegionWin->winGetScreenPosition(&x, &y); - clipRegionWin->winGetSize(&width, &height); - clipRegion.lo.x = x - 10; - clipRegion.lo.y = y ; - clipRegion.hi.x = x + width + 10; - clipRegion.hi.y = y + height + 10; -*/ - MainMenuInit( layout, userData ); -} - -void W3DCreditsMenuDraw( GameWindow *window, WinInstanceData *instData ) -{ - TheCredits->draw(); -} diff --git a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/W3DGameFont.cpp b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/W3DGameFont.cpp deleted file mode 100644 index c90931db767..00000000000 --- a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/W3DGameFont.cpp +++ /dev/null @@ -1,124 +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 . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: W3DGameFont.cpp ////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -// -// Westwood Studios Pacific. -// -// Confidential Information -// Copyright (C) 2001 - All Rights Reserved -// -//----------------------------------------------------------------------------- -// -// Project: RTS3 -// -// File name: W3DGameFont.cpp -// -// Created: Colin Day, June 2001 -// -// Desc: W3D implementation for managing font definitions -// -//----------------------------------------------------------------------------- -/////////////////////////////////////////////////////////////////////////////// - -// SYSTEM INCLUDES //////////////////////////////////////////////////////////// -#include - -// USER INCLUDES ////////////////////////////////////////////////////////////// -#include "Common/Debug.h" -#include "W3DDevice/GameClient/W3DGameFont.h" -#include "WW3D2/ww3d.h" -#include "WW3D2/assetmgr.h" -#include "WW3D2/render2dsentence.h" -#include "GameClient/GlobalLanguage.h" - -// DEFINES //////////////////////////////////////////////////////////////////// - -// PRIVATE TYPES ////////////////////////////////////////////////////////////// - -// PRIVATE DATA /////////////////////////////////////////////////////////////// - -// PUBLIC DATA //////////////////////////////////////////////////////////////// - -// PRIVATE PROTOTYPES ///////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////////////////// -// PRIVATE FUNCTIONS ////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// - -// W3DFontLibrary::loadFontData =============================================== -/** Load a font */ -//============================================================================= -Bool W3DFontLibrary::loadFontData( GameFont *font ) -{ - // sanity - if( font == nullptr ) - return FALSE; - - const char* name = font->nameString.str(); - const Int size = font->pointSize; - const Bool bold = font->bold; - - // get the font data from the asset manager - FontCharsClass *fontChar = WW3DAssetManager::Get_Instance()->Get_FontChars( name, size, bold ); - - if( fontChar == nullptr ) - { - DEBUG_CRASH(( "Unable to find font '%s' in Asset Manager", name )); - return FALSE; - } - - // assign font data - font->fontData = fontChar; - font->height = fontChar->Get_Char_Height(); - - // load Unicode of same point size - name = TheGlobalLanguageData ? TheGlobalLanguageData->m_unicodeFontName.str() : "Arial Unicode MS"; - fontChar->AlternateUnicodeFont = WW3DAssetManager::Get_Instance()->Get_FontChars( name, size, bold ); - - return TRUE; -} - -// W3DFontLibrary::releaseFontData ============================================ -/** Release font data */ -//============================================================================= -void W3DFontLibrary::releaseFontData( GameFont *font ) -{ - - // presently we don't need to do anything because fonts are handled in - // the W3D asset manager which is all taken for of us - if (font && font->fontData) - { - if(((FontCharsClass *)(font->fontData))->AlternateUnicodeFont) - ((FontCharsClass *)(font->fontData))->AlternateUnicodeFont->Release_Ref(); - ((FontCharsClass *)(font->fontData))->Release_Ref(); - - font->fontData = nullptr; - } - -} - -// PUBLIC FUNCTIONS /////////////////////////////////////////////////////////// - diff --git a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/W3DGameWindow.cpp b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/W3DGameWindow.cpp deleted file mode 100644 index 1fea607f890..00000000000 --- a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/W3DGameWindow.cpp +++ /dev/null @@ -1,666 +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 . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: W3DGameWindow.cpp //////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -// -// Westwood Studios Pacific. -// -// Confidential Information -// Copyright (C) 2001 - All Rights Reserved -// -//----------------------------------------------------------------------------- -// -// Project: RTS3 -// -// File name: W3DGameWindow.cpp -// -// Created: Colin Day, June 2001 -// -// Desc: W3D implementation of a game window -// -//----------------------------------------------------------------------------- -/////////////////////////////////////////////////////////////////////////////// - -// SYSTEM INCLUDES //////////////////////////////////////////////////////////// -#include - -// USER INCLUDES ////////////////////////////////////////////////////////////// -#include "GameClient/Gadget.h" -#include "GameClient/GameWindowGlobal.h" -#include "W3DDevice/GameClient/W3DGameWindow.h" -#include "W3DDevice/GameClient/W3DGameWindowManager.h" -#include "W3DDevice/GameClient/W3DDisplay.h" - -// DEFINES //////////////////////////////////////////////////////////////////// -enum -{ - BORDER_CORNER_SIZE = 15, - BORDER_LINE_SIZE = 20, -}; - -// PRIVATE TYPES ////////////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////////////////// -// PRIVATE DATA /////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// -static Bool bordersInit = FALSE; -static const Image *borderPieces[NUM_BORDER_PIECES] = { nullptr }; - -// PUBLIC DATA //////////////////////////////////////////////////////////////// - -// PRIVATE PROTOTYPES ///////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////////////////// -// PRIVATE FUNCTIONS ////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// - -// initBorders ================================================================ -//============================================================================= -static void initBorders() -{ - - borderPieces[ BORDER_CORNER_UL ] = - TheMappedImageCollection->findImageByName( "BorderCornerUL" ); - - borderPieces[ BORDER_CORNER_UR ] = - TheMappedImageCollection->findImageByName( "BorderCornerUR" ); - - borderPieces[ BORDER_CORNER_LL ] = - TheMappedImageCollection->findImageByName( "BorderCornerLL" ); - - borderPieces[ BORDER_CORNER_LR ] = - TheMappedImageCollection->findImageByName( "BorderCornerLR" ); - - borderPieces[ BORDER_VERTICAL_LEFT ] = - TheMappedImageCollection->findImageByName( "BorderLeft" ); - - borderPieces[ BORDER_VERTICAL_LEFT_SHORT ] = - TheMappedImageCollection->findImageByName( "BorderLeftShort" ); - - borderPieces[ BORDER_HORIZONTAL_TOP ] = - TheMappedImageCollection->findImageByName( "BorderTop" ); - - borderPieces[ BORDER_HORIZONTAL_TOP_SHORT ] = - TheMappedImageCollection->findImageByName( "BorderTopShort" ); - - borderPieces[ BORDER_VERTICAL_RIGHT ] = - TheMappedImageCollection->findImageByName( "BorderRight" ); - - borderPieces[ BORDER_VERTICAL_RIGHT_SHORT ] = - TheMappedImageCollection->findImageByName( "BorderRightShort" ); - - borderPieces[ BORDER_HORIZONTAL_BOTTOM ] = - TheMappedImageCollection->findImageByName( "BorderBottom" ); - - borderPieces[ BORDER_HORIZONTAL_BOTTOM_SHORT ] = - TheMappedImageCollection->findImageByName( "BorderBottomShort" ); - - bordersInit = TRUE; - -} - -// W3DGameWindow::blitBorderRect ============================================== -//============================================================================= -void W3DGameWindow::blitBorderRect( Int x, Int y, Int width, Int height ) -{ - Int Offset = 15; - Int OffsetLower = 5; - // init image loc if needed - if( bordersInit == FALSE ) - initBorders(); - - // save original x, y - Int originalX = x; - Int originalY = y; - Int maxX = x + width; - Int maxY = y + height; - Int x2, y2; // used for simultaneous drawing of line pairs - Int size = 20; - Int halfSize = size / 2; - - // Draw Horizontal Lines - // All border pieces are based on a 10 pixel offset from the centerline - y = originalY - Offset; - y2 = maxY - OffsetLower; - x2 = maxX - (OffsetLower + BORDER_LINE_SIZE); - - for( x=(originalX + OffsetLower); x <= x2; x += BORDER_LINE_SIZE ) - { - - TheDisplay->drawImage( borderPieces[ BORDER_HORIZONTAL_TOP ], - x, y, x + size, y + size ); - TheDisplay->drawImage( borderPieces[ BORDER_HORIZONTAL_BOTTOM ], - x, y2, x + size, y2 + size ); - - } - - x2 = maxX - 5;//BORDER_CORNER_SIZE; - - // x == place to draw remainder if any - if( (x2 - x) >= (BORDER_LINE_SIZE / 2) ) - { - - //Blit Half piece - TheDisplay->drawImage( borderPieces[ BORDER_HORIZONTAL_TOP_SHORT ], - x, y, x + halfSize, y + size ); - TheDisplay->drawImage( borderPieces[ BORDER_HORIZONTAL_BOTTOM_SHORT ], - x, y2, x + halfSize, y2 + size ); - - x += (BORDER_LINE_SIZE / 2); - - } - - // x2 - x ... must now be less than a half piece - // check for equals and if not blit an adjusted half piece border pieces have - // a two pixel repeat so we will blit one pixel over if necessary to line up - // the art, but we'll cover-up the overlap with the corners - if( x < x2 ) - { - x -= ((BORDER_LINE_SIZE / 2) - (((x2 - x) + 1) & ~1)); - - //Blit Half piece - TheDisplay->drawImage( borderPieces[ BORDER_HORIZONTAL_TOP_SHORT ], - x, y, x + halfSize, y + size ); - TheDisplay->drawImage( borderPieces[ BORDER_HORIZONTAL_BOTTOM_SHORT ], - x, y2, x + halfSize, y2 + size ); - - } - - // Draw Vertical Lines - // All border pieces are based on a 10 pixel offset from the centerline - x = originalX - Offset; - x2 = maxX - OffsetLower; - y2 = maxY - (OffsetLower + BORDER_LINE_SIZE); - - for( y=(originalY + OffsetLower); y <= y2; y += BORDER_LINE_SIZE ) - { - - TheDisplay->drawImage( borderPieces[ BORDER_VERTICAL_LEFT ], - x, y, x + size, y + size ); - TheDisplay->drawImage( borderPieces[ BORDER_VERTICAL_RIGHT ], - x2, y, x2 + size, y + size ); - - } - - y2 = maxY - OffsetLower;//BORDER_CORNER_SIZE; - - // y == place to draw remainder if any - if( (y2 - y) >= (BORDER_LINE_SIZE / 2) ) - { - - //Blit Half piece - TheDisplay->drawImage( borderPieces[ BORDER_VERTICAL_LEFT_SHORT ], - x, y, x + size, y + halfSize ); - TheDisplay->drawImage( borderPieces[ BORDER_VERTICAL_RIGHT_SHORT ], - x2, y, x2 + size, y + halfSize ); - - y += (BORDER_LINE_SIZE / 2); - } - - // y2 - y ... must now be less than a half piece - // check for equals and if not blit an adjusted half piece border pieces have - // a two pixel repeat so we will blit one pixel over if necessary to line up - // the art, but we'll cover-up the overlap with the corners - if( y < y2 ) - { - y -= ((BORDER_LINE_SIZE / 2) - (((y2 - y) + 1) & ~1)); - - //Blit Half piece - TheDisplay->drawImage( borderPieces[ BORDER_VERTICAL_LEFT_SHORT ], - x, y, x + size, y + halfSize ); - TheDisplay->drawImage( borderPieces[ BORDER_VERTICAL_RIGHT_SHORT ], - x2, y, x2 + size, y + halfSize ); - - } - - // Draw Corners - x = originalX - BORDER_CORNER_SIZE ; - y = originalY - BORDER_CORNER_SIZE; - TheDisplay->drawImage( borderPieces[ BORDER_CORNER_UL ], - x, y, x + size, y + size ); - x = maxX - 5;//BORDER_CORNER_SIZE; - y = originalY - BORDER_CORNER_SIZE; - TheDisplay->drawImage( borderPieces[ BORDER_CORNER_UR ], - x, y, x + size, y + size ); - x = originalX - BORDER_CORNER_SIZE; - y = maxY - 5;//BORDER_CORNER_SIZE; - TheDisplay->drawImage( borderPieces[ BORDER_CORNER_LL ], - x, y, x + size, y + size ); - x = maxX - 5;//BORDER_CORNER_SIZE; - y = maxY - 5;//BORDER_CORNER_SIZE; - TheDisplay->drawImage( borderPieces[ BORDER_CORNER_LR ], - x, y, x + size, y + size ); - -} - -/////////////////////////////////////////////////////////////////////////////// -// PUBLIC FUNCTIONS /////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// - -// W3DGameWindow::W3DGameWindow =============================================== -//============================================================================= -W3DGameWindow::W3DGameWindow() -{ - - // override the default draw with our own default draw function for W3D - winSetDrawFunc( TheWindowManager->getDefaultDraw() ); - - m_textPos.x = m_textPos.y = 0; - m_currTextColor = WIN_COLOR_UNDEFINED; - m_needPolyDraw = FALSE; - m_newTextPos = FALSE; - -} - -// W3DGameWindow::~W3DGameWindow ============================================== -//============================================================================= -W3DGameWindow::~W3DGameWindow() -{ - -} - -// W3DGameWinDefaultDraw ====================================================== -/** The default redraw callback. Draws the background using either - * the drawData or the background color unless the background color - * is set to -1 indicating that default drawing is turned off. */ -//============================================================================= -void W3DGameWinDefaultDraw( GameWindow *window, WinInstanceData *instData ) -{ - Real borderWidth = 1.0f; - ICoord2D origin; - ICoord2D size; - W3DGameWindow *w3dWindow = (W3DGameWindow *)window; - - /** @todo NOTE that we're making a W3DGameWindow cast here, it seems - logical because we are in a W3D draw function so it's reasonable to assume - that we have a W3DGameWindow. However, we may want to revisit this - type of casting in the future, we have the same problems with the - ObjectModules where we cast object modules for their individual methods. - Also note that the other W3D implementations of GUI controls are making - a similar cast for their device implementation functions */ - - // get the window position in the screen coordinates - w3dWindow->winGetScreenPosition( &origin.x, &origin.y ); - - // get size of window - w3dWindow->winGetSize( &size.x, &size.y ); - - // image drawing vs color drawing - if( BitIsSet( window->winGetStatus(), WIN_STATUS_IMAGE ) ) - { - const Image *image; - - // get image - if( BitIsSet( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) - image = window->winGetDisabledImage( 0 ); - else if( BitIsSet( instData->getState(), WIN_STATE_HILITED ) ) - image = window->winGetHiliteImage( 0 ); - else - image = window->winGetEnabledImage( 0 ); - - if( image ) - { - ICoord2D start, end; - - start.x = origin.x + instData->m_imageOffset.x; - start.y = origin.y + instData->m_imageOffset.y; - end.x = start.x + size.x; - end.y = start.y + size.y; - TheWindowManager->winDrawImage( image, start.x, start.y, end.x, end.y ); - - } - - } - else - { - Color color, borderColor; - - // get colors - if( BitIsSet( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) - { - - color = window->winGetDisabledColor( 0 ); - borderColor = window->winGetDisabledBorderColor( 0 ); - - } - else if( BitIsSet( instData->getState(), WIN_STATE_HILITED ) ) - { - - color = window->winGetHiliteColor( 0 ); - borderColor = window->winGetHiliteBorderColor( 0 ); - - } - else - { - - color = window->winGetEnabledColor( 0 ); - borderColor = window->winGetEnabledBorderColor( 0 ); - - } - - // - // draw the border at the edges - // - if( borderColor != WIN_COLOR_UNDEFINED ) - TheWindowManager->winOpenRect( borderColor, borderWidth, - origin.x, origin.y, - origin.x + size.x, origin.y + size.y ); - - // draw filled background - if( color != WIN_COLOR_UNDEFINED ) - TheWindowManager->winFillRect( color, borderWidth, - origin.x + borderWidth, - origin.y + borderWidth, - origin.x + size.x - borderWidth, - origin.y + size.y - borderWidth ); - - } - - // if we have a video buffer, draw the video buffer - if ( instData->m_videoBuffer ) - { - ICoord2D pos, size; - window->winGetScreenPosition( &pos.x, &pos.y ); - window->winGetSize( &size.x, &size.y ); - - TheDisplay->drawVideoBuffer( instData->m_videoBuffer, pos.x, pos.y, pos.x + size.x, pos.y + size.y ); - } - -} - -// W3DGameWindow::winDrawBorder =============================================== -//============================================================================= -void W3DGameWindow::winDrawBorder() -{ - Bool found = FALSE; - Int originalX, originalY; - Int x, y; - Int width; - Int i, bits; - -/** @todo this WinDrawBorder is the old Nox function for drawing the borders - * on various windows and controls. We should derive classes of game - * windows for the different GUI controls and move the specific pieces of - * code that apply for those gadgets to those classes */ - - // based on window class pass different regions to real draw - - winGetScreenPosition( &originalX, &originalY ); - - for( i = 0; (i < (sizeof(UnsignedInt) * 8)) && (found == FALSE); i++ ) - { - - bits = (1 << i); - - if( m_instData.getStyle() & bits ) - { - - switch( m_instData.getStyle() & bits ) - { - case GWS_CHECK_BOX: - found = TRUE; - break; - - case GWS_ENTRY_FIELD: - { -// EntryData *e = (EntryData *)m_userData; - width = m_size.x; - - x = originalX; - y = originalY; - - // Calculate space for Label - if( m_instData.getTextLength() ) - { - Int textWidth = 0; - - TheWindowManager->winGetTextSize( m_instData.getFont(), - m_instData.getText(), - &textWidth, nullptr, 0 ); - width -= textWidth + 6; - x += textWidth + 6; - - } - -/* -// Colin: The very notion of entry width makes no sense to me since -// we already have a gadget width, and the max characters for -// an entry box so I am removing this. - // Adjust entry box if an entryWidth is provided - if( (e->entryWidth > 0) && (width > e->entryWidth) ) - { - width = e->entryWidth; - x = originalX + (m_size.x - e->entryWidth); - } -*/ - - blitBorderRect( x, y, width, m_size.y ); - - found = TRUE; - break; - } - - // Sliders may need a bar for the button - // it is assumed that the smaller size component (width, height) - // is the axis of the slider - case GWS_VERT_SLIDER: - case GWS_HORZ_SLIDER: -// blitBorderLine( originalX, originalY, window->size.x, window->size.y ); - - found = TRUE; - break; - - case GWS_SCROLL_LISTBOX: - { - ListboxData *list = (ListboxData *)m_userData; - Int sliderAdjustment = 0; - Int labelAdjustment = 0; - - if( list->scrollBar ) - { - GameWindow *child = list->slider->winGetChild(); - ICoord2D size; - - child->winGetSize( &size.x, &size.y ); - sliderAdjustment = size.y; - - } - - if( m_instData.getTextLength() ) - labelAdjustment = 4; - - blitBorderRect( (originalX - 3), - (originalY - (3 + labelAdjustment)), - (m_size.x + 3 - sliderAdjustment), - (m_size.y + 6) ); - - found = TRUE; - break; - } - - case GWS_RADIO_BUTTON: - case GWS_STATIC_TEXT: - case GWS_PROGRESS_BAR: - case GWS_PUSH_BUTTON: - case GWS_USER_WINDOW: - case GWS_TAB_CONTROL: - blitBorderRect( originalX, originalY, m_size.x, m_size.y ); - - found = TRUE; - break; - - } - - } - - } - -} - -// W3DGameWindow::winSetFont ================================================== -/** Set the font for a window */ -//============================================================================= -void W3DGameWindow::winSetFont( GameFont *font ) -{ - - if (font == nullptr) - return; - - // extending functionality - GameWindow::winSetFont( font ); - - // assign font to text renderer - m_textRenderer.Set_Font( static_cast(font->fontData) ); - - // this is a visual change - m_needPolyDraw = TRUE; - -} - -// W3DGameWindow::winSetText ================================================== -/** Set the text for window */ -//============================================================================= -Int W3DGameWindow::winSetText( UnicodeString newText ) -{ - - // extending functionality - GameWindow::winSetText( newText ); - - // rebuild the sentence in our text renderer - m_textRenderer.Build_Sentence( m_instData.getText().str(),nullptr, nullptr ); - - // this is a visual change - m_needPolyDraw = TRUE; - - return WIN_ERR_OK; - -} - -// W3DGameWindow::winSetPosition ============================================== -/** Set window position */ -//============================================================================= -Int W3DGameWindow::winSetPosition( Int x, Int y ) -{ - ICoord2D prevPos; - - // get previous position - prevPos.x = m_region.lo.x; - prevPos.y = m_region.lo.y; - - // extending functionality - GameWindow::winSetPosition( x, y ); - - // update any text position change - m_textPos.x += m_region.lo.x - prevPos.x; - m_textPos.y += m_region.lo.y - prevPos.y; - m_newTextPos = TRUE; - - return WIN_ERR_OK; - -} - -// W3DGameWindow::getTextSize ================================================= -/** Get the size of the text in our inst data */ -//============================================================================= -void W3DGameWindow::getTextSize( Int *width, Int *height ) -{ - Vector2 extents = m_textRenderer.Get_Text_Extents( m_instData.getText().str() ); - - if( width ) - *width = extents.X; - if( height ) - *height = extents.Y; - -} - -// W3DGameWindow::getTextLoc ================================================== -// Set our text rendering location */ -//============================================================================= -void W3DGameWindow::setTextLoc( Int x, Int y ) -{ - - if( m_textPos.x != x ) - { - - m_textPos.x = x; - m_newTextPos = TRUE; - - } - if( m_textPos.y != y ) - { - - m_textPos.y = y; - m_newTextPos = TRUE; - - } - -} - -// W3DGameWindow::drawText ==================================================== -/** Draw the text in our 2d sentence renderer */ -//============================================================================= -void W3DGameWindow::drawText( Color color ) -{ - Bool needDraw = FALSE; - - // if new text pos we need to redraw - if( m_newTextPos ) - { - - m_newTextPos = FALSE; - needDraw = TRUE; - - } - - // if color switch, set new color - if( m_currTextColor != color ) - { - - m_currTextColor = color; - needDraw = TRUE; - - } - - // draw the quads if needed - if( needDraw || m_needPolyDraw ) - { - UnsignedInt outline = TheWindowManager->winMakeColor( 0, 0, 0, 255 ); - - m_textRenderer.Reset_Polys(); - m_textRenderer.Set_Location( Vector2( m_textPos.x + 1, m_textPos.y + 1 ) ); - m_textRenderer.Draw_Sentence( outline ); - - m_textRenderer.Set_Location( Vector2( m_textPos.x, m_textPos.y ) ); - m_textRenderer.Draw_Sentence( m_currTextColor ); - - m_needPolyDraw = FALSE; - - } - - // do the render - m_textRenderer.Render(); - -} - diff --git a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/W3DGameWindowManager.cpp b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/W3DGameWindowManager.cpp deleted file mode 100644 index d9cd4f2a677..00000000000 --- a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/W3DGameWindowManager.cpp +++ /dev/null @@ -1,64 +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 . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: W3DGameWindowManager.cpp ///////////////////////////////////////////////////////////////// -// Created: Colin Day, June 2001 -// Desc: W3D implementation of the window manager, responsible for all -// interactions with the game windowing system for menus and -// window controls. -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#include - -#include "GameClient/Image.h" -#include "W3DDevice/GameClient/W3DGameWindowManager.h" - -/////////////////////////////////////////////////////////////////////////////////////////////////// -// PUBLIC FUNCTIONS /////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -W3DGameWindowManager::W3DGameWindowManager() -{ - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -W3DGameWindowManager::~W3DGameWindowManager() -{ - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -void W3DGameWindowManager::init() -{ - - // extend - GameWindowManager::init(); - -} - diff --git a/GeneralsMD/Code/GameEngineDevice/CMakeLists.txt b/GeneralsMD/Code/GameEngineDevice/CMakeLists.txt index 0d50b778371..af7d6afa760 100644 --- a/GeneralsMD/Code/GameEngineDevice/CMakeLists.txt +++ b/GeneralsMD/Code/GameEngineDevice/CMakeLists.txt @@ -47,10 +47,10 @@ set(GAMEENGINEDEVICE_SRC Include/W3DDevice/GameClient/W3DFileSystem.h # Include/W3DDevice/GameClient/W3DGadget.h Include/W3DDevice/GameClient/W3DGameClient.h - Include/W3DDevice/GameClient/W3DGameFont.h - Include/W3DDevice/GameClient/W3DGameWindow.h - Include/W3DDevice/GameClient/W3DGameWindowManager.h - Include/W3DDevice/GameClient/W3DGUICallbacks.h +# Include/W3DDevice/GameClient/W3DGameFont.h +# Include/W3DDevice/GameClient/W3DGameWindow.h +# Include/W3DDevice/GameClient/W3DGameWindowManager.h +# Include/W3DDevice/GameClient/W3DGUICallbacks.h Include/W3DDevice/GameClient/W3DInGameUI.h Include/W3DDevice/GameClient/W3DMirror.h # Include/W3DDevice/GameClient/W3DMouse.h @@ -130,11 +130,11 @@ set(GAMEENGINEDEVICE_SRC # Source/W3DDevice/GameClient/GUI/Gadget/W3DTextEntry.cpp # Source/W3DDevice/GameClient/GUI/Gadget/W3DVerticalSlider.cpp # Source/W3DDevice/GameClient/GUI/GUICallbacks/W3DControlBar.cpp - Source/W3DDevice/GameClient/GUI/GUICallbacks/W3DMainMenu.cpp - Source/W3DDevice/GameClient/GUI/GUICallbacks/W3DMOTD.cpp - Source/W3DDevice/GameClient/GUI/W3DGameFont.cpp - Source/W3DDevice/GameClient/GUI/W3DGameWindow.cpp - Source/W3DDevice/GameClient/GUI/W3DGameWindowManager.cpp +# Source/W3DDevice/GameClient/GUI/GUICallbacks/W3DMainMenu.cpp +# Source/W3DDevice/GameClient/GUI/GUICallbacks/W3DMOTD.cpp +# Source/W3DDevice/GameClient/GUI/W3DGameFont.cpp +# Source/W3DDevice/GameClient/GUI/W3DGameWindow.cpp +# Source/W3DDevice/GameClient/GUI/W3DGameWindowManager.cpp # Source/W3DDevice/GameClient/HeightMap.cpp Source/W3DDevice/GameClient/Shadow/W3DBufferManager.cpp Source/W3DDevice/GameClient/Shadow/W3DProjectedShadow.cpp diff --git a/scripts/cpp/unify_move_files.py b/scripts/cpp/unify_move_files.py index 9e45615c370..945b95dff75 100644 --- a/scripts/cpp/unify_move_files.py +++ b/scripts/cpp/unify_move_files.py @@ -667,6 +667,16 @@ def main(): #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/GUICallbacks/MessageBox.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/GUICallbacks/MessageBox.cpp") #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/GUICallbacks/ReplayControls.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/GUICallbacks/ReplayControls.cpp") + #unify_file(Game.ZEROHOUR, "GameEngineDevice/Include/W3DDevice/GameClient/W3DGUICallbacks.h", Game.CORE, "GameEngineDevice/Include/W3DDevice/GameClient/W3DGUICallbacks.h") + #unify_file(Game.ZEROHOUR, "GameEngineDevice/Source/W3DDevice/GameClient/GUI/GUICallbacks/W3DMainMenu.cpp", Game.CORE, "GameEngineDevice/Source/W3DDevice/GameClient/GUI/GUICallbacks/W3DMainMenu.cpp") + #unify_file(Game.ZEROHOUR, "GameEngineDevice/Source/W3DDevice/GameClient/GUI/GUICallbacks/W3DMOTD.cpp", Game.CORE, "GameEngineDevice/Source/W3DDevice/GameClient/GUI/GUICallbacks/W3DMOTD.cpp") + #unify_file(Game.ZEROHOUR, "GameEngineDevice/Include/W3DDevice/GameClient/W3DGameFont.h", Game.CORE, "GameEngineDevice/Include/W3DDevice/GameClient/W3DGameFont.h") + #unify_file(Game.ZEROHOUR, "GameEngineDevice/Source/W3DDevice/GameClient/GUI/W3DGameFont.cpp", Game.CORE, "GameEngineDevice/Source/W3DDevice/GameClient/GUI/W3DGameFont.cpp") + #unify_file(Game.ZEROHOUR, "GameEngineDevice/Include/W3DDevice/GameClient/W3DGameWindow.h", Game.CORE, "GameEngineDevice/Include/W3DDevice/GameClient/W3DGameWindow.h") + #unify_file(Game.ZEROHOUR, "GameEngineDevice/Source/W3DDevice/GameClient/GUI/W3DGameWindow.cpp", Game.CORE, "GameEngineDevice/Source/W3DDevice/GameClient/GUI/W3DGameWindow.cpp") + #unify_file(Game.ZEROHOUR, "GameEngineDevice/Include/W3DDevice/GameClient/W3DGameWindowManager.h", Game.CORE, "GameEngineDevice/Include/W3DDevice/GameClient/W3DGameWindowManager.h") + #unify_file(Game.ZEROHOUR, "GameEngineDevice/Source/W3DDevice/GameClient/GUI/W3DGameWindowManager.cpp", Game.CORE, "GameEngineDevice/Source/W3DDevice/GameClient/GUI/W3DGameWindowManager.cpp") + return