Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions Core/GameEngine/Include/GameClient/View.h
Original file line number Diff line number Diff line change
Expand Up @@ -331,5 +331,56 @@ class ViewLocation
}
};

// TheSuperHackers @feature bobtista 31/01/2026
// View that does nothing. Used for Headless Mode.
class ViewDummy : public View
Comment thread
greptile-apps[bot] marked this conversation as resolved.
Comment thread
greptile-apps[bot] marked this conversation as resolved.
Comment thread
greptile-apps[bot] marked this conversation as resolved.
{
public:
virtual Drawable *pickDrawable( const ICoord2D *screen, Bool forceAttack, PickType pickType )
Comment thread
xezon marked this conversation as resolved.
Outdated
{
return nullptr;
}
virtual Int iterateDrawablesInRegion( IRegion2D *screenRegion, Bool (*callback)( Drawable *draw, void *userData ), void *userData )
{
return 0;
}
virtual void forceRedraw()
{
}
virtual const Coord3D& get3DCameraPosition() const
{
static Coord3D zero = {0,0,0};
return zero;
}
virtual WorldToScreenReturn worldToScreenTriReturn(const Coord3D *w, ICoord2D *s )
{
return WTS_INVALID;
}
virtual void screenToWorld( const ICoord2D *s, Coord3D *w )
{
}
virtual void screenToTerrain( const ICoord2D *screen, Coord3D *world )
Comment thread
xezon marked this conversation as resolved.
Outdated
{
}
virtual void screenToWorldAtZ( const ICoord2D *s, Coord3D *w, Real z )
{
}
virtual void drawView( void )
{
}
virtual void updateView(void)
{
}
virtual void stepView()
{
}
virtual void setGuardBandBias( const Coord2D *gb )
{
}
Comment thread
greptile-apps[bot] marked this conversation as resolved.
Outdated

// TheSuperHackers @bugfix bobtista 03/02/2026 Do not override View::xfer(). The base
Comment thread
bobtista marked this conversation as resolved.
Outdated
// implementation must run to serialize valid view state for save file compatibility.
};
Comment thread
greptile-apps[bot] marked this conversation as resolved.

// EXTERNALS //////////////////////////////////////////////////////////////////////////////////////
extern View *TheTacticalView; ///< the main tactical interface to the game world
6 changes: 3 additions & 3 deletions Generals/Code/GameEngine/Source/GameClient/InGameUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1337,17 +1337,17 @@ void InGameUI::init()
been moved to where all the other translators are attached in game client */

// create the tactical view
if (TheDisplay)
TheTacticalView = createView();
Comment thread
greptile-apps[bot] marked this conversation as resolved.
Outdated
Comment thread
xezon marked this conversation as resolved.
Outdated
if (TheTacticalView && TheDisplay)
{
TheTacticalView = createView();
TheTacticalView->init();
TheDisplay->attachView( TheTacticalView );

// make the tactical display the full screen width and height
TheTacticalView->setWidth( TheDisplay->getWidth() );
TheTacticalView->setHeight( TheDisplay->getHeight() );
TheTacticalView->setDefaultView(0.0f, 0.0f, 1.0f);
}
Comment thread
greptile-apps[bot] marked this conversation as resolved.
TheTacticalView->setDefaultView(0.0f, 0.0f, 1.0f);

/** @todo this may be the wrong place to create the sidebar, but for now
this is where it lives */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
// SYSTEM INCLUDES ////////////////////////////////////////////////////////////

// USER INCLUDES //////////////////////////////////////////////////////////////
#include "Common/GlobalData.h"
#include "GameClient/InGameUI.h"
#include "GameClient/View.h"
#include "W3DDevice/GameClient/W3DView.h"
Expand Down Expand Up @@ -69,7 +70,11 @@ class W3DInGameUI : public InGameUI
protected:

/// factory for views
Comment thread
greptile-apps[bot] marked this conversation as resolved.
virtual View *createView() { return NEW W3DView; }
// TheSuperHackers @fix bobtista 31/01/2026 Return dummy in headless mode
virtual View *createView()
Comment thread
xezon marked this conversation as resolved.
Outdated
{
return TheGlobalData->m_headless ? static_cast<View*>(NEW ViewDummy) : NEW W3DView;
Comment thread
greptile-apps[bot] marked this conversation as resolved.
Outdated
}

virtual void drawSelectionRegion(); ///< draw the selection region on screen
virtual void drawMoveHints( View *view ); ///< draw move hint visual feedback
Expand Down
6 changes: 3 additions & 3 deletions GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1367,17 +1367,17 @@ void InGameUI::init()
been moved to where all the other translators are attached in game client */

// create the tactical view
if (TheDisplay)
TheTacticalView = createView();
if (TheTacticalView && TheDisplay)
{
TheTacticalView = createView();
TheTacticalView->init();
TheDisplay->attachView( TheTacticalView );

// make the tactical display the full screen width and height
TheTacticalView->setWidth( TheDisplay->getWidth() );
TheTacticalView->setHeight( TheDisplay->getHeight() );
TheTacticalView->setDefaultView(0.0f, 0.0f, 1.0f);
}
TheTacticalView->setDefaultView(0.0f, 0.0f, 1.0f);

/** @todo this may be the wrong place to create the sidebar, but for now
this is where it lives */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
// SYSTEM INCLUDES ////////////////////////////////////////////////////////////

// USER INCLUDES //////////////////////////////////////////////////////////////
#include "Common/GlobalData.h"
#include "GameClient/InGameUI.h"
#include "GameClient/View.h"
#include "W3DDevice/GameClient/W3DView.h"
Expand Down Expand Up @@ -69,7 +70,11 @@ class W3DInGameUI : public InGameUI
protected:

/// factory for views
virtual View *createView() { return NEW W3DView; }
// TheSuperHackers @fix bobtista 31/01/2026 Return dummy in headless mode
virtual View *createView()
{
return TheGlobalData->m_headless ? static_cast<View*>(NEW ViewDummy) : NEW W3DView;
Comment thread
greptile-apps[bot] marked this conversation as resolved.
Outdated
}

virtual void drawSelectionRegion(); ///< draw the selection region on screen
virtual void drawMoveHints( View *view ); ///< draw move hint visual feedback
Expand Down
Loading