Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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
7 changes: 7 additions & 0 deletions Generals/Code/Tools/WorldBuilder/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ set(WORLDBUILDER_SRC
"src/RampTool.cpp"
"src/RoadOptions.cpp"
"src/RoadTool.cpp"
"src/RulerOptions.cpp"
"src/RulerTool.cpp"
"src/SaveMap.cpp"
"src/ScorchOptions.cpp"
"src/ScorchTool.cpp"
Expand All @@ -75,6 +77,7 @@ set(WORLDBUILDER_SRC
"src/TeamBehavior.cpp"
"src/TeamGeneric.cpp"
"src/TeamIdentity.cpp"
"src/TeamObjectProperties.cpp"
"src/TeamReinforcement.cpp"
"src/teamsdialog.cpp"
"src/TerrainMaterial.cpp"
Expand Down Expand Up @@ -156,6 +159,8 @@ set(WORLDBUILDER_SRC
"include/RampTool.h"
"include/RoadOptions.h"
"include/RoadTool.h"
"include/RulerOptions.h"
"include/RulerTool.h"
"include/SaveMap.h"
"include/ScorchOptions.h"
"include/ScorchTool.h"
Expand All @@ -171,6 +176,7 @@ set(WORLDBUILDER_SRC
"include/TeamBehavior.h"
"include/TeamGeneric.h"
"include/TeamIdentity.h"
"include/TeamObjectProperties.h"
"include/TeamReinforcement.h"
"include/teamsdialog.h"
"include/TerrainMaterial.h"
Expand All @@ -184,6 +190,7 @@ set(WORLDBUILDER_SRC
"include/WaypointTool.h"
"include/WBFrameWnd.h"
"include/WBHeightMap.h"
"include/WBPopupSlider.h"
"include/wbview.h"
"include/wbview3d.h"
"include/WHeightMapEdit.h"
Expand Down
2 changes: 1 addition & 1 deletion Generals/Code/Tools/WorldBuilder/include/AutoEdgeOutTool.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** Command & Conquer Generals(tm)
** Command & Conquer Generals Zero Hour(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion Generals/Code/Tools/WorldBuilder/include/BaseBuildProps.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** Command & Conquer Generals(tm)
** Command & Conquer Generals Zero Hour(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion Generals/Code/Tools/WorldBuilder/include/BlendEdgeTool.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** Command & Conquer Generals(tm)
** Command & Conquer Generals Zero Hour(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion Generals/Code/Tools/WorldBuilder/include/BlendMaterial.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** Command & Conquer Generals(tm)
** Command & Conquer Generals Zero Hour(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion Generals/Code/Tools/WorldBuilder/include/BorderTool.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** Command & Conquer Generals(tm)
** Command & Conquer Generals Zero Hour(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion Generals/Code/Tools/WorldBuilder/include/BrushTool.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** Command & Conquer Generals(tm)
** Command & Conquer Generals Zero Hour(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion Generals/Code/Tools/WorldBuilder/include/BuildList.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** Command & Conquer Generals(tm)
** Command & Conquer Generals Zero Hour(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion Generals/Code/Tools/WorldBuilder/include/BuildListTool.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** Command & Conquer Generals(tm)
** Command & Conquer Generals Zero Hour(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** Command & Conquer Generals(tm)
** Command & Conquer Generals Zero Hour(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** Command & Conquer Generals(tm)
** Command & Conquer Generals Zero Hour(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
Expand All @@ -16,6 +16,8 @@
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/



#include "Common/AsciiString.h"
class TeamsInfo;
class SidesList;
Expand Down
26 changes: 25 additions & 1 deletion Generals/Code/Tools/WorldBuilder/include/CUndoable.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** Command & Conquer Generals(tm)
** Command & Conquer Generals Zero Hour(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -384,3 +384,27 @@ class DeletePolygonUndoable : public Undoable
virtual void Do() override;
virtual void Undo() override;
};

/// MultipleUndoable
/**
* An undoable that doesn't do anything; it just consolidates a number of other
* Undoables in a single logical undo step.
*/
class MultipleUndoable : public Undoable
{
protected:
Undoable * m_undoableList; //< The head of the list of undoables, in the order they should be done. Reverse order for undoes
public:
MultipleUndoable();
// destructor.
virtual ~MultipleUndoable() override;

/** Add other undoables in the order you would want them UNdone; e.g. in the reverse order you want them done
* The MultipleUndoable object will then own the pointers.
*/
void addUndoable( Undoable * undoable );

virtual void Do() override;
virtual void Undo() override;
virtual void Redo() override;
};
4 changes: 3 additions & 1 deletion Generals/Code/Tools/WorldBuilder/include/CameraOptions.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** Command & Conquer Generals(tm)
** Command & Conquer Generals Zero Hour(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -53,6 +53,8 @@ class CameraOptions : public CDialog, public PopupSliderOwner
// Generated message map functions
//{{AFX_MSG(CameraOptions)
afx_msg void OnCameraReset();
afx_msg void OnDropWaypointButton();
afx_msg void OnCenterOnSelectedButton();
afx_msg void OnMove(int x, int y);
virtual BOOL OnInitDialog() override;
afx_msg void OnChangePitchEdit();
Expand Down
2 changes: 1 addition & 1 deletion Generals/Code/Tools/WorldBuilder/include/CellWidth.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** Command & Conquer Generals(tm)
** Command & Conquer Generals Zero Hour(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion Generals/Code/Tools/WorldBuilder/include/ContourOptions.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** Command & Conquer Generals(tm)
** Command & Conquer Generals Zero Hour(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
Expand Down
24 changes: 21 additions & 3 deletions Generals/Code/Tools/WorldBuilder/include/DrawObject.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** Command & Conquer Generals(tm)
** Command & Conquer Generals Zero Hour(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -34,6 +34,8 @@
class MeshClass;
class PolygonTrigger;
class WaterRenderObjClass;
class MapObject;
class Render2DClass;
//
// DrawObject: Draws 3d feedback for tools & objects.
//
Expand Down Expand Up @@ -77,12 +79,14 @@ class DrawObject : public RenderObjClass
// void Set_Flag(unsigned int flag, Bool onoff) { Flags &= (~flag); if (onoff) Flags |= flag; }

Int freeMapResources();
int initData();

void setDrawObjects(Bool val, Bool waypoints, Bool poly) { m_drawObjects = val; m_drawWaypoints=waypoints; m_drawPolygonAreas = poly;}
void setDrawObjects(Bool val, Bool waypoints, Bool poly, Bool bounding, Bool sight, Bool weapon, Bool sound, Bool testart, Bool letterbox) { m_drawObjects = val; m_drawWaypoints=waypoints; m_drawPolygonAreas = poly; m_drawBoundingBoxes = bounding; m_drawSightRanges = sight; m_drawWeaponRanges = weapon; m_drawSoundRanges = sound; m_drawTestArtHighlight = testart, m_drawLetterbox = letterbox;}
static void setDoBrushFeedback(Bool val) { m_toolWantsFeedback = val; m_meshFeedback=false;}
static void setDoMeshFeedback(Bool val) { m_meshFeedback = val; }
static void setDoRampFeedback(Bool val) { m_rampFeedback = val; }
static void setDoBoundaryFeedback(Bool val) { m_boundaryFeedback = val; }

static void setDoAmbientSoundFeedback(Bool val) { m_ambientSoundFeedback = val; }

static void setBrushFeedbackParms(Bool square, Int width, Int featherWidth)
Expand Down Expand Up @@ -122,6 +126,12 @@ class DrawObject : public RenderObjClass
Bool m_drawObjects;
Bool m_drawWaypoints;
Bool m_drawPolygonAreas;
Bool m_drawBoundingBoxes;
Bool m_drawSightRanges;
Bool m_drawWeaponRanges;
Bool m_drawSoundRanges;
Bool m_drawTestArtHighlight;
Bool m_drawLetterbox;

DX8VertexBufferClass *m_vertexFeedback; ///< Vertex buffer for brush feedback.
DX8IndexBufferClass *m_indexFeedback; ///< indices defining a triangle strip for the feedback on terrain
Expand All @@ -132,6 +142,8 @@ class DrawObject : public RenderObjClass

MeshClass *m_moldMesh; ///< W3D mesh model for the mold.
SphereClass m_moldMeshBounds; ///< Bounding sphere for mold mesh.
Render2DClass *m_lineRenderer; //< Used to render 2D lines for bounding boxes.
CPoint m_winSize; //< Holds the size of the window.

protected: // static state vars.
static Bool m_squareFeedback; ///< True for square brush feedback, false for round.
Expand All @@ -155,7 +167,7 @@ class DrawObject : public RenderObjClass
static Real m_rampWidth;

protected:
int initData();
void addCircleToLineRenderer( const Coord3D & center, Real radius, Real width, unsigned long color, CameraClass* camera );
Int updateVB(DX8VertexBufferClass *vertexBufferTile, Int color, Bool doArrow, Bool doDiamond);
void updatePolygonVB(PolygonTrigger *pTrig, Bool selected, Bool isOpen);
void updateFeedbackVB();
Expand All @@ -165,6 +177,12 @@ class DrawObject : public RenderObjClass
void updateForWater();
void updateBoundaryVB();
void updateAmbientSoundVB();
void updateVBWithBoundingBox(MapObject *pMapObj, CameraClass* camera);
void updateVBWithSightRange(MapObject *pMapObj, CameraClass* camera);
void updateVBWithWeaponRange(MapObject *pMapObj, CameraClass* camera);
void updateVBWithTestArtHighlight(MapObject *pMapObj, CameraClass* camera);
void updateVBWithSoundRanges(MapObject *pMapObj, CameraClass* camera);
bool worldToScreen(const Coord3D *w, ICoord2D *s, CameraClass* camera);

};

Expand Down
3 changes: 2 additions & 1 deletion Generals/Code/Tools/WorldBuilder/include/EditAction.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** Command & Conquer Generals(tm)
** Command & Conquer Generals Zero Hour(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -62,6 +62,7 @@ class EditAction : public CDialog
CRichEditCtrl m_myEditCtrl;
CHARRANGE m_curLinkChrg;
Int m_curEditParameter;
CTreeCtrl m_actionTreeView;

protected:

Expand Down
10 changes: 9 additions & 1 deletion Generals/Code/Tools/WorldBuilder/include/EditCondition.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** Command & Conquer Generals(tm)
** Command & Conquer Generals Zero Hour(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
Expand All @@ -24,6 +24,13 @@

class Condition;
class SidesList;

class CMyTreeCtrl : public CTreeCtrl
{
public:
virtual LRESULT WindowProc( UINT message, WPARAM wParam, LPARAM lParam ) override;
};

/////////////////////////////////////////////////////////////////////////////
// EditCondition dialog

Expand Down Expand Up @@ -61,6 +68,7 @@ class EditCondition : public CDialog
CRichEditCtrl m_myEditCtrl;
CHARRANGE m_curLinkChrg;
Int m_curEditParameter;
CTreeCtrl m_conditionTreeView;

protected:

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** Command & Conquer Generals(tm)
** Command & Conquer Generals Zero Hour(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion Generals/Code/Tools/WorldBuilder/include/EditGroup.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** Command & Conquer Generals(tm)
** Command & Conquer Generals Zero Hour(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** Command & Conquer Generals(tm)
** Command & Conquer Generals Zero Hour(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -44,6 +44,7 @@ friend class EditParameter;
//{{AFX_VIRTUAL(EditObjectParameter)
protected:
virtual void DoDataExchange(CDataExchange* pDX) override; // DDX/DDV support
virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult) override;
//}}AFX_VIRTUAL

// Implementation
Expand Down
18 changes: 11 additions & 7 deletions Generals/Code/Tools/WorldBuilder/include/EditParameter.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** Command & Conquer Generals(tm)
** Command & Conquer Generals Zero Hour(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -50,8 +50,8 @@ class EditParameter : public CDialog
// Implementation

public:
static Int edit( Parameter *pParm, AsciiString unitName = AsciiString::TheEmptyString );
static AsciiString getWarningText(Parameter *pParm);
static Int edit( Parameter *pParm, Int keyPressed, AsciiString unitName = AsciiString::TheEmptyString );
static AsciiString getWarningText(Parameter *pParm, Bool isAction);
static AsciiString getInfoText(Parameter *pParm);
static void setCurSidesList(SidesList *sidesListP) {m_sidesListP = sidesListP;};
static Bool loadScripts(CComboBox *pCombo, Bool subr, AsciiString match = AsciiString::TheEmptyString);
Expand Down Expand Up @@ -93,10 +93,10 @@ class EditParameter : public CDialog
static Bool loadEmoticons( CComboBox *pCombo, AsciiString match = AsciiString::TheEmptyString );
static AsciiString getCreatedUnitTemplateName(AsciiString unitName);

void loadCounters(CComboBox *pCombo);
void loadConditionParameter(Script *pScr, Parameter::ParameterType type, CComboBox *pCombo);
void loadActionParameter(Script *pScr, Parameter::ParameterType type, CComboBox *pCombo);
void loadFlags(CComboBox *pCombo);
static Bool loadCounters(CComboBox *pCombo, AsciiString match = AsciiString::TheEmptyString);
static void loadConditionParameter(Script *pScr, Parameter::ParameterType type, CComboBox *pCombo);
static Bool loadActionParameter(Script *pScr, Parameter::ParameterType type, CComboBox *pCombo, AsciiString match);
static Bool loadFlags(CComboBox *pCombo, AsciiString match = AsciiString::TheEmptyString);


protected:
Expand All @@ -106,11 +106,15 @@ class EditParameter : public CDialog
Int m_int;
Real m_real;

Int m_key; // key pressed to invoke the edit parameter dialog.

static SidesList *m_sidesListP;
static AsciiString m_selectedLocalizedString;

protected:
Bool scanReal(CEdit *pEdit, Real scale);

protected:
// Generated message map functions
//{{AFX_MSG(EditParameter)
afx_msg void OnChangeEdit();
Expand Down
Loading