Initial commit of Command & Conquer Generals and Command & Conquer Generals Zero Hour source code.

This commit is contained in:
LFeenanEA 2025-02-27 17:34:39 +00:00
parent 2e338c00cb
commit 3d0ee53a05
No known key found for this signature in database
GPG key ID: C6EBE8C2EA08F7E0
6072 changed files with 2283311 additions and 0 deletions

View file

@ -0,0 +1,48 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
// AutoEdgeOutTool.h
// Texture tiling tools for worldbuilder.
// Author: John Ahlquist, April 2001
#pragma once
#ifndef AUTOEDGEOUTTOOL_H
#define AUTOEDGEOUTTOOL_H
#include "Tool.h"
class WorldHeightMapEdit;
/*************************************************************************/
/** AutoEdgeOutTool
Does the BlendEdgesOut tool operation.
***************************************************************************/
/// Blend edges out tool.
class AutoEdgeOutTool : public Tool
{
public:
AutoEdgeOutTool(void);
~AutoEdgeOutTool(void);
public:
/// Perform tool on mouse down.
virtual void mouseDown(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
virtual void activate(); ///< Become the current tool.
};
#endif //TOOL_H

View file

@ -0,0 +1,78 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
#if !defined(AFX_BASEBUILDPROPS_H__71A01D97_E81A_45F8_982D_57D83E5342DF__INCLUDED_)
#define AFX_BASEBUILDPROPS_H__71A01D97_E81A_45F8_982D_57D83E5342DF__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// BaseBuildProps.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// BaseBuildProps dialog
class BaseBuildProps : public CDialog
{
// Construction
public:
BaseBuildProps(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(BaseBuildProps)
enum { IDD = IDD_BASE_BUILDING_PROPS };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(BaseBuildProps)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(BaseBuildProps)
virtual BOOL OnInitDialog();
virtual void OnOK();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
AsciiString m_name;
AsciiString m_script;
Int m_health;
Bool m_unsellable;
public:
void setProps(AsciiString name, AsciiString script, Int health, Bool unsellable);
AsciiString getName(void) {return m_name;}
AsciiString getScript(void) {return m_script;}
Int getHealth(void) {return m_health;}
Bool getUnsellable(void) {return m_unsellable;}
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_BASEBUILDPROPS_H__71A01D97_E81A_45F8_982D_57D83E5342DF__INCLUDED_)

View file

@ -0,0 +1,52 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
// BlendEdgeTool.h
// Texture tiling tools for worldbuilder.
// Author: John Ahlquist, April 2001
#pragma once
#ifndef BLEND_EDGE_TOOL_H
#define BLEND_EDGE_TOOL_H
#include "Tool.h"
class WorldHeightMapEdit;
/*************************************************************************/
/** BlendEdgeTool
Does the BlendEdgesOut tool operation.
***************************************************************************/
/// Blend edges out tool.
class BlendEdgeTool : public Tool
{
protected:
Coord3D m_downPt;
public:
BlendEdgeTool(void);
~BlendEdgeTool(void);
public:
/// Perform tool on mouse down.
virtual void mouseDown(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
virtual void mouseUp(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
};
#endif //TOOL_H

View file

@ -0,0 +1,92 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
#if !defined(AFX_BlendMaterial_H__D3FF66C5_711D_4DAC_8A29_5EAAB5C3A23E__INCLUDED_)
#define AFX_BlendMaterial_H__D3FF66C5_711D_4DAC_8A29_5EAAB5C3A23E__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// BlendMaterial.h : header file
//
#include "WBPopupSlider.h"
#include "TerrainSwatches.h"
#include "OptionsPanel.h"
class WorldHeightMapEdit;
/////////////////////////////////////////////////////////////////////////////
// BlendMaterial dialog
class BlendMaterial : public COptionsPanel
{
// Construction
public:
BlendMaterial(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(BlendMaterial)
enum { IDD = IDD_BLEND_MATERIAL };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(BlendMaterial)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
virtual void OnOK(){return;}; ///< Modeless dialogs don't OK, so eat this for modeless.
virtual void OnCancel(){return;}; ///< Modeless dialogs don't close on ESC, so eat this for modeless.
virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
//}}AFX_VIRTUAL
// Implementation
protected:
enum {MIN_TILE_SIZE=2, MAX_TILE_SIZE = 100};
// Generated message map functions
//{{AFX_MSG(BlendMaterial)
virtual BOOL OnInitDialog();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
protected:
static BlendMaterial *m_staticThis;
Bool m_updating;
static Int m_currentBlendTexture;
CTreeCtrl m_terrainTreeView;
protected:
void updateTextures(void);
void addTerrain(const char *pPath, Int terrainNdx, HTREEITEM parent);
HTREEITEM findOrAdd(HTREEITEM parent, char *pLabel);
public:
static Int getBlendTexClass(void) {return m_currentBlendTexture;}
static void setBlendTexClass(Int texClass);
public:
Bool setTerrainTreeViewSelection(HTREEITEM parent, Int selection);
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_BlendMaterial_H__D3FF66C5_711D_4DAC_8A29_5EAAB5C3A23E__INCLUDED_)

View file

@ -0,0 +1,47 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "Tool.h"
class BorderTool : public Tool
{
protected:
enum ModificationType { MOD_TYPE_INVALID, MOD_TYPE_UP, MOD_TYPE_FREE, MOD_TYPE_RIGHT };
Bool m_mouseDown;
Bool m_addingNewBorder;
Int m_modifyBorderNdx;
ModificationType m_modificationType;
public:
BorderTool();
~BorderTool();
Int getToolID(void) {return m_toolID;}
virtual void setCursor(void);
virtual void activate();
virtual void deactivate();
virtual Bool followsTerrain(void) { return false; }
virtual void mouseMoved(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
virtual void mouseDown(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
virtual void mouseUp(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
};

View file

@ -0,0 +1,69 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
// BrushTool.h
// Texture tiling tools for worldbuilder.
// Author: John Ahlquist, April 2001
#pragma once
#ifndef BRUSHTOOL_H
#define BRUSHTOOL_H
#include "Tool.h"
class WorldHeightMapEdit;
/*************************************************************************/
/** BrushTool
Does the Height Brush tool operation.
***************************************************************************/
/// Height brush tool.
class BrushTool : public Tool
{
protected:
WorldHeightMapEdit *m_htMapEditCopy; ///< ref counted.
WorldHeightMapEdit *m_htMapFeatherCopy; ///< ref counted.
static Int m_brushWidth;
static Int m_brushFeather;
static Bool m_brushSquare;
static Int m_brushHeight;
public:
BrushTool(void);
~BrushTool(void);
public:
static Int getWidth(void) {return m_brushWidth;}; ///<Returns width.
static Int getFeather(void) {return m_brushFeather;}; ///<Returns feather.
static Int getHeight(void) {return m_brushHeight;}; ///<Returns height.
static void setWidth(Int width);
static void setFeather(Int feather);
static void setHeight(Int height);
public:
virtual void mouseDown(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
virtual void mouseUp(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
virtual void mouseMoved(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
virtual WorldHeightMapEdit *getHeightMap(void) {return m_htMapEditCopy;};
virtual void activate(); ///< Become the current tool.
virtual Bool followsTerrain(void) {return false;};
};
#endif //BRUSHTOOL_H

View file

@ -0,0 +1,113 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
#if !defined(AFX_BuildList_H__D3FF66C5_7107_4DAC_8A29_5EBAB5C3A24E__INCLUDED_)
#define AFX_BuildList_H__D3FF66C5_7107_4DAC_8A29_5EBAB5C3A24E__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// BuildList.h : header file
//
#include "TerrainSwatches.h"
#include "OptionsPanel.h"
#include "WBPopupSlider.h"
#include "Common/AsciiString.h"
class WorldHeightMapEdit;
class BuildListInfo;
/////////////////////////////////////////////////////////////////////////////
// BuildList dialog
class BuildList : public COptionsPanel, public PopupSliderOwner
{
// Construction
public:
BuildList(CWnd* pParent = NULL); ///< standard constructor
~BuildList(void); ///< standard destructor
enum { NAME_MAX_LEN = 64 };
// Dialog Data
//{{AFX_DATA(BuildList)
enum { IDD = IDD_BUILD_LIST_PANEL };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(BuildList)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
virtual void OnOK(){return;}; ///< Modeless dialogs don't OK, so eat this for modeless.
virtual void OnCancel(){return;}; ///< Modeless dialogs don't close on ESC, so eat this for modeless.
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(BuildList)
virtual BOOL OnInitDialog();
afx_msg void OnSelchangeSidesCombo();
afx_msg void OnMoveUp();
afx_msg void OnMoveDown();
afx_msg void OnAddBuilding();
afx_msg void OnSelchangeBuildList();
afx_msg void OnAlreadyBuild();
afx_msg void OnDeleteBuilding();
afx_msg void OnSelendokRebuilds();
afx_msg void OnEditchangeRebuilds();
afx_msg void OnDblclkBuildList();
afx_msg void OnChangeZOffset();
afx_msg void OnChangeAngle();
afx_msg void OnExport();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
protected:
Int m_curSide;
Int m_curBuildList;
WBPopupSliderButton m_heightSlider;
WBPopupSliderButton m_angleSlider;
Real m_angle;
Real m_height;
static BuildList *m_staticThis;
static Bool m_updating;
protected:
void loadSides(void);
void updateCurSide(void);
public:
static void addBuilding(Coord3D loc, Real angle, AsciiString name);
static void update(void) {if (m_staticThis) m_staticThis->loadSides();};
static void setSelectedBuildList(BuildListInfo *pInfo);
virtual void GetPopSliderInfo(const long sliderID, long *pMin, long *pMax, long *pLineSize, long *pInitial);
virtual void PopSliderChanged(const long sliderID, long theVal);
virtual void PopSliderFinished(const long sliderID, long theVal);
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_BuildList_H__D3FF66C5_711D_4DAC_8A29_5EAAB5C3A23E__INCLUDED_)

View file

@ -0,0 +1,83 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
// BuildListTool.h
// Build list tool for worldbuilder.
// Author: John Ahlquist, Nov 2001
#pragma once
#ifndef BUILDLISTTOOL_H
#define BUILDLISTTOOL_H
#include "Tool.h"
#include "Common/AsciiString.h"
#include "PickUnitDialog.h"
class WorldHeightMapEdit;
class BuildListInfo;
/*************************************************************************/
/** BuildListTool
Does the add item to build list tool operation.
***************************************************************************/
class BuildListTool : public Tool
{
protected:
CPoint m_downPt2d;
Coord3D m_downPt3d;
Coord3D m_prevPt3d;
BuildListInfo *m_curObject;
Bool m_moving; ///< True if we are drag moving an object.
Bool m_rotating; ///< True if we are rotating an object.
Bool m_mouseUpRotate;///< True if we are over the "rotate" hotspot.
HCURSOR m_rotateCursor;
Bool m_mouseUpMove;///< True if we are over the "move" hotspot.
HCURSOR m_moveCursor;
HCURSOR m_pointerCursor;
PickUnitDialog m_pickBuildingDlg;
Bool m_created;
static PickUnitDialog *m_static_pickBuildingDlg;
static Bool m_isActive;
public:
BuildListTool(void);
~BuildListTool(void);
private:
void createWindow(void);
Bool isDoingAdd(void);
public:
static void addBuilding(void);
static Bool isActive(void) {return m_isActive;};
public:
/// Perform tool on mouse down.
virtual void mouseDown(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
virtual void mouseUp(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
virtual void mouseMoved(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
virtual void setCursor(void);
virtual void activate(); ///< Become the current tool.
virtual void deactivate(); ///< Become not the current tool.
};
#endif //TOOL_H

View file

@ -0,0 +1,43 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
#include "Common/AsciiString.h"
class TeamsInfo;
class SidesList;
#pragma once
class CFixTeamOwnerDialog : public CDialog
{
public:
enum { IDD = IDD_CHANGE_TEAM_OWNER };
CFixTeamOwnerDialog( TeamsInfo *ti, SidesList *sideList, UINT nIDTemplate = CFixTeamOwnerDialog::IDD, CWnd* pParentWnd = NULL );
AsciiString getSelectedOwner();
Bool pickedValidTeam() { return m_pickedValidTeam; }
protected:
virtual BOOL OnInitDialog();
afx_msg void OnOK();
DECLARE_MESSAGE_MAP()
protected:
Bool m_pickedValidTeam;
AsciiString m_selectedOwner;
TeamsInfo *m_ti;
SidesList *m_sl;
};

View file

@ -0,0 +1,393 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
// CUndoable.h
// Class to handle undo/redo.
// Author: John Ahlquist, April 2001
#pragma once
#ifndef CUNDOABLE_H
#define CUNDOABLE_H
#include "Lib\BaseType.h"
#include "../../gameengine/include/common/MapObject.h"
#include "../../gameengine/include/common/GameCommon.h"
#include "../../gameengine/include/GameLogic/SidesList.h"
#include "RefCount.h"
#include <vector>
class PolygonTrigger;
class BuildListInfo;
/*************************************************************************
** Undoable
***************************************************************************/
/// Base command class for all undoable commands. Just the virtual shell.
class Undoable : public RefCountClass
{
protected:
Undoable *mNext;
public:
Undoable(void);
~Undoable(void);
public:
virtual void Do(void)=0; ///< pure virtual.
virtual void Undo(void)=0;///< pure virtual.
virtual void Redo(void);
void LinkNext(Undoable *pNext);
Undoable *GetNext(void) {return mNext;};
};
class CWorldBuilderDoc;
class WorldHeightMapEdit;
class MapObject;
/*************************************************************************
** CWBDocUndoable
***************************************************************************/
/// Command that saves & restores entire height map.
/** An undoable that actually undoes something. Saves and restores the
entire height map. */
class WBDocUndoable : public Undoable
{
protected:
CWorldBuilderDoc *mPDoc; ///< Not ref counted. This undoable should be in a list attached to the doc anyway.
WorldHeightMapEdit *mPNewHeightMapData; ///< ref counted.
WorldHeightMapEdit *mPOldHeightMapData; ///< ref counted.
Bool m_offsetObjects; ///< If true, apply m_objOffset.
Coord3D m_objOffset; ///< Offset to adjust all objects.
public:
WBDocUndoable(CWorldBuilderDoc *pDoc, WorldHeightMapEdit *pNewHtMap, Coord3D *pObjOffset = NULL);
// destructor.
~WBDocUndoable(void);
virtual void Do(void);
virtual void Undo(void);
virtual void Redo(void);
};
/// AddObjectUndoable
/** An undoable that actually undoes something. Adds an object
to the height map. If it is a linked list, adds all objects. */
class AddObjectUndoable : public Undoable
{
protected:
CWorldBuilderDoc *m_pDoc; ///< Not ref counted. This undoable should be in a list attached to the doc anyway.
MapObject *m_objectToAdd;
Int m_numObjects;
Bool m_addedToList;
public:
AddObjectUndoable(CWorldBuilderDoc *pDoc, MapObject *pObjectToAdd);
// destructor.
~AddObjectUndoable(void);
virtual void Do(void);
virtual void Undo(void);
};
/// ModifyObjectUndoable
/** An undoable that actually undoes something. Modifies an object's
location and angle. */
// Helper class
class MoveInfo
{
public:
MoveInfo(MapObject *pObjToMove);
~MoveInfo();
void DoMove(CWorldBuilderDoc *pDoc);
void UndoMove(CWorldBuilderDoc *pDoc);
void SetOffset(CWorldBuilderDoc *pDoc, Real x, Real y);
void SetZOffset(CWorldBuilderDoc *pDoc, Real z);
void RotateTo(CWorldBuilderDoc *pDoc, Real angle);
void SetThingTemplate(CWorldBuilderDoc *pDoc, const ThingTemplate* thing);
void SetName(CWorldBuilderDoc *pDoc, AsciiString name);
public:
MapObject *m_objectToModify;
MoveInfo *m_next;
Real m_newAngle;
Real m_oldAngle;
Coord3D m_newLocation;
Coord3D m_oldLocation;
const ThingTemplate* m_oldThing;
const ThingTemplate* m_newThing;
AsciiString m_oldName;
AsciiString m_newName;
};
class ModifyObjectUndoable : public Undoable
{
protected:
CWorldBuilderDoc* m_pDoc; ///< Not ref counted. This undoable should be in a list attached to the doc anyway.
MoveInfo* m_moveList;
Bool m_inval;
public:
ModifyObjectUndoable(CWorldBuilderDoc *pDoc);
// destructor.
~ModifyObjectUndoable(void);
virtual void Do(void);
virtual void Undo(void);
virtual void Redo(void);
void SetOffset(Real x, Real y);
void SetZOffset(Real z);
void RotateTo(Real angle);
void SetThingTemplate(const ThingTemplate* thing);
void SetName(AsciiString name);
};
/// ModifyFlagsUndoable
/** An undoable that actually undoes something. Modifies an object's
flags. */
// Helper class
class FlagsInfo
{
public:
FlagsInfo(MapObject *pObjToMove, Int flagMask, Int flagValue );
~FlagsInfo();
void DoFlags(CWorldBuilderDoc *pDoc);
void UndoFlags(CWorldBuilderDoc *pDoc);
public:
MapObject *m_objectToModify;
FlagsInfo *m_next;
Int m_flagMask;
Int m_newValue;
Int m_oldValue;
};
class ModifyFlagsUndoable : public Undoable
{
protected:
CWorldBuilderDoc *m_pDoc; ///< Not ref counted. This undoable should be in a list attached to the doc anyway.
FlagsInfo *m_flagsList;
public:
ModifyFlagsUndoable(CWorldBuilderDoc *pDoc, Int flagMask, Int flagValue);
// destructor.
~ModifyFlagsUndoable(void);
virtual void Do(void);
virtual void Undo(void);
virtual void Redo(void);
};
class SidesListUndoable : public Undoable
{
protected:
SidesList m_old, m_new;
CWorldBuilderDoc *m_pDoc; ///< Not ref counted. This undoable should be in a list attached to the doc anyway.
public:
SidesListUndoable(const SidesList& newSL, CWorldBuilderDoc *pDoc);
~SidesListUndoable(void);
virtual void Do(void);
virtual void Undo(void);
};
class DictItemUndoable : public Undoable
{
protected:
Int m_numDictsToModify;
std::vector<Dict*> m_dictToModify;
std::vector<Dict> m_oldDictData;
Dict m_newDictData;
CWorldBuilderDoc *m_pDoc;
Bool m_inval;
NameKeyType m_key;
public:
static Dict buildSingleItemDict(AsciiString k, Dict::DataType t, AsciiString v);
// if you want to just add/modify/remove a single dict item, pass the item's key.
// if you want to substitute the entire contents of the new dict, pass NAMEKEY_INVALID.
DictItemUndoable(Dict **d, Dict data, NameKeyType key, Int dictsToModify = 1, CWorldBuilderDoc *pDoc = NULL, Bool inval = false);
// destructor.
~DictItemUndoable(void);
virtual void Do(void);
virtual void Undo(void);
};
/// DeleteObjectUndoable
/** An undoable that actually undoes something. Deletes an object. */
// Helper class
class DeleteInfo
{
public:
DeleteInfo(MapObject *pObjToDelete);
~DeleteInfo(void);
void DoDelete(WorldHeightMapEdit *pMap);
void UndoDelete(WorldHeightMapEdit *pMap);
public:
Bool m_didDelete;
MapObject *m_objectToDelete;
MapObject *m_priorObject;
DeleteInfo *m_next;
};
class DeleteObjectUndoable : public Undoable
{
protected:
CWorldBuilderDoc *m_pDoc; ///< Not ref counted. This undoable should be in a list attached to the doc anyway.
DeleteInfo *m_deleteList;
public:
DeleteObjectUndoable(CWorldBuilderDoc *pDoc);
// destructor.
~DeleteObjectUndoable(void);
virtual void Do(void);
virtual void Undo(void);
};
/// AddPolygonUndoable
/** An undoable that actually undoes something. Adds a polygon. */
class AddPolygonUndoable : public Undoable
{
protected:
PolygonTrigger *m_trigger;
Bool m_isTriggerInList;
public:
AddPolygonUndoable( PolygonTrigger *pTrig);
// destructor.
~AddPolygonUndoable(void);
virtual void Do(void);
virtual void Undo(void);
};
/// AddPolygonPointUndoable
/** An undoable that actually undoes something. Adds a polygon. */
class AddPolygonPointUndoable : public Undoable
{
protected:
PolygonTrigger *m_trigger;
ICoord3D m_point;
public:
AddPolygonPointUndoable(PolygonTrigger *pTrig, ICoord3D pt);
// destructor.
~AddPolygonPointUndoable(void);
virtual void Do(void);
virtual void Undo(void);
};
/// ModifyPolygonPointUndoable
/** An undoable that actually undoes something. Modifys a polygon. */
class ModifyPolygonPointUndoable : public Undoable
{
protected:
PolygonTrigger *m_trigger;
Int m_pointIndex;
ICoord3D m_point;
ICoord3D m_savPoint;
public:
ModifyPolygonPointUndoable(PolygonTrigger *pTrig, Int ndx);
// destructor.
~ModifyPolygonPointUndoable(void);
virtual void Do(void);
virtual void Undo(void);
};
/// MovePolygonUndoable
/** An undoable that actually undoes something. Moves a polygon. */
class MovePolygonUndoable : public Undoable
{
protected:
PolygonTrigger *m_trigger;
ICoord3D m_point;
ICoord3D m_offset;
public:
MovePolygonUndoable(PolygonTrigger *pTrig);
// destructor.
~MovePolygonUndoable(void);
virtual void Do(void);
virtual void Undo(void);
void SetOffset(const ICoord3D &offset);
PolygonTrigger *getTrigger(void) {return m_trigger;}
};
/// InsertPolygonPointUndoable
/** An undoable that actually undoes something. Inserts a polygon point. */
class InsertPolygonPointUndoable : public Undoable
{
protected:
PolygonTrigger *m_trigger;
Int m_pointIndex;
ICoord3D m_point;
public:
InsertPolygonPointUndoable(PolygonTrigger *pTrig, ICoord3D pt, Int ndx);
// destructor.
~InsertPolygonPointUndoable(void);
virtual void Do(void);
virtual void Undo(void);
};
/// DeletePolygonPointUndoable
/** An undoable that actually undoes something. Deletes a polygon point. */
class DeletePolygonPointUndoable : public Undoable
{
protected:
PolygonTrigger *m_trigger;
Int m_pointIndex;
ICoord3D m_point;
public:
DeletePolygonPointUndoable(PolygonTrigger *pTrig, Int ndx);
// destructor.
~DeletePolygonPointUndoable(void);
virtual void Do(void);
virtual void Undo(void);
};
/// DeletePolygonUndoable
/** An undoable that actually undoes something. Deletes a polygon. */
class DeletePolygonUndoable : public Undoable
{
protected:
PolygonTrigger *m_trigger;
Bool m_isTriggerInList;
public:
DeletePolygonUndoable(PolygonTrigger *pTrig);
// destructor.
~DeletePolygonUndoable(void);
virtual void Do(void);
virtual void Undo(void);
};
#endif //CUNDOABLE_H

View file

@ -0,0 +1,92 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
#if !defined(AFX_CAMERAOPTIONS_H__4EF4F775_1290_47AE_817F_9340BA3A898C__INCLUDED_)
#define AFX_CAMERAOPTIONS_H__4EF4F775_1290_47AE_817F_9340BA3A898C__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// CameraOptions.h : header file
//
#define CAMERA_OPTIONS_PANEL_SECTION "CameraOptionsWindow"
#include "WBPopupSlider.h"
/////////////////////////////////////////////////////////////////////////////
// CameraOptions dialog
class CameraOptions : public CDialog, public PopupSliderOwner
{
// Construction
public:
CameraOptions(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CameraOptions)
enum { IDD = IDD_CAMERA_OPTIONS };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CameraOptions)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CameraOptions)
afx_msg void OnCameraReset();
afx_msg void OnMove(int x, int y);
virtual BOOL OnInitDialog();
afx_msg void OnChangePitchEdit();
afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
protected:
void putInt( Int ctrlID, Int val );
void putReal( Int ctrlID, Real val );
void putAsciiString( Int ctrlID, AsciiString val );
BOOL getReal( Int ctrlID, Real *rVal );
void stuffValuesIntoFields( void );
void applyCameraPitch( Real pitch );
WBPopupSliderButton m_pitchPopup;
Bool m_updating;
public: // popup slider interface.
virtual void GetPopSliderInfo(const long sliderID, long *pMin, long *pMax, long *pLineSize, long *pInitial);
virtual void PopSliderChanged(const long sliderID, long theVal);
virtual void PopSliderFinished(const long sliderID, long theVal);
public:
void update( void );
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_CAMERAOPTIONS_H__4EF4F775_1290_47AE_817F_9340BA3A898C__INCLUDED_)

View file

@ -0,0 +1,69 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
#if !defined(AFX_CELLWIDTH_H__E4023BA4_28DE_11D5_8CE0_00010297BBAC__INCLUDED_)
#define AFX_CELLWIDTH_H__E4023BA4_28DE_11D5_8CE0_00010297BBAC__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// CellWidth.h : header file
//
/////////////////////////////////////////////////////////////////////////////
/// CellWidth modal dialog to set the cell width.
class CellWidth : public CDialog
{
// Construction
public:
CellWidth(int cellWidth, CWnd* pParent = NULL); // standard constructor
int GetCellWidth(void) {return mCellWidth;};
// Dialog Data
//{{AFX_DATA(CellWidth)
enum { IDD = IDD_CellWidth };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CellWidth)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
virtual void OnOK();
//}}AFX_VIRTUAL
// Implementation
protected:
int mCellWidth;
protected:
// Generated message map functions
//{{AFX_MSG(CellWidth)
virtual BOOL OnInitDialog();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_CELLWIDTH_H__E4023BA4_28DE_11D5_8CE0_00010297BBAC__INCLUDED_)

View file

@ -0,0 +1,90 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
#if !defined(AFX_ContourOptions_H__7B56E24C_582E_4530_A451_873397C8852D__INCLUDED_)
#define AFX_ContourOptions_H__7B56E24C_582E_4530_A451_873397C8852D__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ContourOptions.h : header file
//
/////////////////////////////////////////////////////////////////////////////
/// ContourOptions modeless (floating) dialog - allows entry and display of brush width and feather.
class ContourOptions : public CDialog
{
// Construction
public:
enum {MIN_CONTOUR_STEP=1,
MAX_CONTOUR_STEP=10,
MIN_CONTOUR_OFFSET=-10,
MAX_CONTOUR_OFFSET=+10,
MIN_WIDTH=1,
MAX_WIDTH=6};
ContourOptions(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(ContourOptions)
enum { IDD = IDD_CONTOUR_OPTIONS };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(ContourOptions)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(ContourOptions)
virtual BOOL OnInitDialog();
afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
afx_msg void OnShowContours();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
protected:
static Int m_contourStep; ///< current contour step in the ui.
static Int m_contourOffset; ///< current contour offset in the ui.
static Int m_contourWidth; ///< current contour offset in the ui.
Bool m_updating; ///<true if the ui is updating itself.
CSliderCtrl m_contourStepSlider; ///< Feather slider control.
CSliderCtrl m_contourOffsetSlider; ///< Brush width slider control.
CSliderCtrl m_contourWidthSlider; ///< Brush width slider control.
public:
static Int getContourWidth(void) {return m_contourWidth;}; ///<Returns width.
static Int getContourOffset(void) {return m_contourOffset;}; ///<Returns offset.
static Int getContourStep(void) {return m_contourStep;}; ///<Returns step.
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_ContourOptions_H__6B56E20C_582E_4030_A251_879097C8853C__INCLUDED_)

View file

@ -0,0 +1,175 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
#ifndef __DRAW_OBJECT_H_
#define __DRAW_OBJECT_H_
#include "always.h"
#include "rendobj.h"
#include "w3d_file.h"
#include "dx8vertexbuffer.h"
#include "dx8indexbuffer.h"
#include "shader.h"
#include "vertmaterial.h"
#include "Lib/BaseType.h"
#include "Common/AsciiString.h"
// The draw objects draw a circle of diameter 1.0 cells.
#define THE_RADIUS (0.8f*MAP_XY_FACTOR)
class MeshClass;
class PolygonTrigger;
class WaterRenderObjClass;
//
// DrawObject: Draws 3d feedback for tools & objects.
//
//
class DrawObject : public RenderObjClass
{
public:
DrawObject(void);
DrawObject(const DrawObject & src);
DrawObject & operator = (const DrawObject &);
~DrawObject(void);
/////////////////////////////////////////////////////////////////////////////
// Render Object Interface
/////////////////////////////////////////////////////////////////////////////
virtual RenderObjClass * Clone(void) const;
virtual int Class_ID(void) const;
virtual void Render(RenderInfoClass & rinfo);
// virtual void Special_Render(SpecialRenderInfoClass & rinfo);
// virtual void Set_Transform(const Matrix3D &m);
// virtual void Set_Position(const Vector3 &v);
//TODO: MW: do these later - only needed for collision detection
virtual Bool Cast_Ray(RayCollisionTestClass & raytest);
// virtual Bool Cast_AABox(AABoxCollisionTestClass & boxtest);
// virtual Bool Cast_OBBox(OBBoxCollisionTestClass & boxtest);
// virtual Bool Intersect_AABox(AABoxIntersectionTestClass & boxtest);
// virtual Bool Intersect_OBBox(OBBoxIntersectionTestClass & boxtest);
virtual void Get_Obj_Space_Bounding_Sphere(SphereClass & sphere) const;
virtual void Get_Obj_Space_Bounding_Box(AABoxClass & aabox) const;
// virtual int Get_Num_Polys(void) const;
// virtual const char * Get_Name(void) const;
// virtual void Set_Name(const char * name);
// unsigned int Get_Flags(void) { return Flags; }
// void Set_Flags(unsigned int flags) { Flags = flags; }
// void Set_Flag(unsigned int flag, Bool onoff) { Flags &= (~flag); if (onoff) Flags |= flag; }
Int freeMapResources(void);
void setDrawObjects(Bool val, Bool waypoints, Bool poly) { m_drawObjects = val; m_drawWaypoints=waypoints; m_drawPolygonAreas = poly;}
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)
{ m_squareFeedback = square; m_brushWidth=width;
m_meshFeedback = false; m_brushFeatherWidth = featherWidth;}
static void disableFeedback(void) {m_disableFeedback = true;};
static void enableFeedback(void) {m_disableFeedback = false;};
static Bool isFeedbackEnabled(void) { return !m_disableFeedback;};
static void setFeedbackPos(Coord3D pos);
static void setWaypointDragFeedback(const Coord3D &start, const Coord3D &end);
static void setRampFeedbackParms(const Coord3D *start, const Coord3D *end, Real rampWidth);
static void stopWaypointDragFeedback();
MeshClass *peekMesh(void) {return m_moldMesh;};
void getMeshBounds(SphereClass *pSphere) {*pSphere = m_moldMeshBounds;};
protected:
enum {MAX_RADIUS = 50, NUM_FEEDBACK_VERTEX = 201*201, NUM_FEEDBACK_INDEX = 101*101*6};
Int m_numTriangles; //dimensions of list
DX8IndexBufferClass *m_indexBuffer; ///< indices defining a object icon
ShaderClass m_shaderClass; ///< shader or rendering state for heightmap
VertexMaterialClass *m_vertexMaterialClass;
DX8VertexBufferClass *m_vertexBufferTile1; ///< First vertex buffer.
DX8VertexBufferClass *m_vertexBufferTile2; ///< Second vertex buffer.
DX8VertexBufferClass *m_vertexBufferWater; ///< Vertex buffer for the water plane.
DX8IndexBufferClass *m_indexWater; ///< indices defining a triangle strip for the water on terrain
Int m_waterVertexCount;
WaterRenderObjClass *m_waterDrawObject;
Bool m_drawObjects;
Bool m_drawWaypoints;
Bool m_drawPolygonAreas;
DX8VertexBufferClass *m_vertexFeedback; ///< Vertex buffer for brush feedback.
DX8IndexBufferClass *m_indexFeedback; ///< indices defining a triangle strip for the feedback on terrain
Int m_feedbackIndexCount;
Int m_feedbackVertexCount;
AsciiString m_curMeshModelName; ///< Model name of m_moldMesh.
MeshClass *m_moldMesh; ///< W3D mesh model for the mold.
SphereClass m_moldMeshBounds; ///< Bounding sphere for mold mesh.
protected: // static state vars.
static Bool m_squareFeedback; ///< True for square brush feedback, false for round.
static Int m_brushWidth; ///< Width of brush feedback.
static Int m_brushFeatherWidth; ///< Width of brush feathered feedback.
static Bool m_toolWantsFeedback; ///< True to display brush feedback.
static Bool m_disableFeedback; ///< True to disable feedback.
static Coord3D m_feedbackPoint; ///< Current brush feedback location.
static CPoint m_cellCenter; ///< Cell to show feedback from.
static Bool m_meshFeedback;
static Bool m_rampFeedback; ///< should we be showing feedback for the ramp tool?
static Bool m_boundaryFeedback;
static Bool m_ambientSoundFeedback;
static Bool m_dragWaypointFeedback; ///< True for the waypoint tool dragging.
static Coord3D m_dragWayStart;///< Start drag waypoint feedback.
static Coord3D m_dragWayEnd; ///< End drag waypoint.
static Coord3D m_rampStartPoint; ///< Beginning ramp point
static Coord3D m_rampEndPoint; ///< End ramp point
static Real m_rampWidth;
protected:
int initData(void);
Int updateVB(DX8VertexBufferClass *vertexBufferTile, Int color, Bool doArrow, Bool doDiamond);
void updatePolygonVB(PolygonTrigger *pTrig, Bool selected, Bool isOpen);
void updateFeedbackVB(void);
void updateMeshVB(void);
void updateRampVB(void);
void updateWaypointVB(void);
void updateForWater(void);
void updateBoundaryVB(void);
void updateAmbientSoundVB(void);
};
void BuildRectFromSegmentAndWidth(const Coord3D* b, const Coord3D* t, Real width,
Coord3D* outBL, Coord3D* outTL, Coord3D* outBR, Coord3D* outTR);
#endif // end __DRAW_OBJECT_H_

View file

@ -0,0 +1,84 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
#if !defined(AFX_EditAction_H__64465BA2_AD81_4EFD_BAB4_93F66C90ECD1__INCLUDED_)
#define AFX_EditAction_H__64465BA2_AD81_4EFD_BAB4_93F66C90ECD1__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// EditAction.h : header file
//
class ScriptAction;
class SidesList;
/////////////////////////////////////////////////////////////////////////////
// EditAction dialog
class EditAction : public CDialog
{
// Construction
public:
EditAction(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(EditAction)
enum { IDD = IDD_ScriptAction };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(EditAction)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
//}}AFX_VIRTUAL
// Implementation
public:
void setAction(ScriptAction *pAction) {m_action = pAction;}
protected:
void formatScriptActionText(Int parmNdx);
protected:
ScriptAction *m_action;
Bool m_updating;
Bool m_modifiedTextColor;
CRichEditCtrl m_myEditCtrl;
CHARRANGE m_curLinkChrg;
Int m_curEditParameter;
protected:
// Generated message map functions
//{{AFX_MSG(EditAction)
virtual BOOL OnInitDialog();
afx_msg void OnSelchangeScriptActionType();
afx_msg void OnTimer(UINT nIDEvent);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_EditAction_H__64465BA2_AD81_4EFD_BAB4_93F66C90ECD1__INCLUDED_)

View file

@ -0,0 +1,83 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
#if !defined(AFX_EDITCONDITION_H__64465BA2_AD81_4EFD_BAB4_93F66C90ECD1__INCLUDED_)
#define AFX_EDITCONDITION_H__64465BA2_AD81_4EFD_BAB4_93F66C90ECD1__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// EditCondition.h : header file
//
class Condition;
class SidesList;
/////////////////////////////////////////////////////////////////////////////
// EditCondition dialog
class EditCondition : public CDialog
{
// Construction
public:
EditCondition(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(EditCondition)
enum { IDD = IDD_ScriptCondition };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(EditCondition)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
//}}AFX_VIRTUAL
// Implementation
public:
void setCondition(Condition *pCond) {m_condition = pCond;}
protected:
void formatConditionText(Int parmNdx);
protected:
Condition *m_condition;
Bool m_updating;
Bool m_modifiedTextColor;
CRichEditCtrl m_myEditCtrl;
CHARRANGE m_curLinkChrg;
Int m_curEditParameter;
protected:
// Generated message map functions
//{{AFX_MSG(EditCondition)
virtual BOOL OnInitDialog();
afx_msg void OnSelchangeConditionType();
afx_msg void OnTimer(UINT nIDEvent);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_EDITCONDITION_H__64465BA2_AD81_4EFD_BAB4_93F66C90ECD1__INCLUDED_)

View file

@ -0,0 +1,76 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
#if !defined(AFX_EDITCOORDPARAMETER_H__465E4002_6405_47E3_97BA_D46A8C108600__INCLUDED_)
#define AFX_EDITCOORDPARAMETER_H__465E4002_6405_47E3_97BA_D46A8C108600__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// EditCoordParameter.h : header file
//
#include "GameLogic/Scripts.h"
class SidesList;
/////////////////////////////////////////////////////////////////////////////
// EditCoordParameter dialog
class EditCoordParameter : public CDialog
{
friend class EditParameter;
// Construction
public:
EditCoordParameter(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(EditCoordParameter)
enum { IDD = IDD_EDIT_COORD_PARAMETER };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(EditCoordParameter)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
protected:
Parameter *m_parameter;
Coord3D m_coord;
protected:
// Generated message map functions
//{{AFX_MSG(EditCoordParameter)
virtual BOOL OnInitDialog();
virtual void OnOK();
virtual void OnCancel();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_EDITCOORDPARAMETER_H__465E4002_6405_47E3_97BA_D46A8C108600__INCLUDED_)

View file

@ -0,0 +1,69 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
#if !defined(AFX_EDITGROUP_H__712F9978_4300_4625_9364_39E903FA3284__INCLUDED_)
#define AFX_EDITGROUP_H__712F9978_4300_4625_9364_39E903FA3284__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// EditGroup.h : header file
//
class ScriptGroup;
/////////////////////////////////////////////////////////////////////////////
// EditGroup dialog
class EditGroup : public CDialog
{
// Construction
public:
EditGroup(ScriptGroup *pGroup, CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(EditGroup)
enum { IDD = IDD_EDIT_GROUP };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(EditGroup)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
ScriptGroup *m_scriptGroup;
protected:
// Generated message map functions
//{{AFX_MSG(EditGroup)
virtual void OnOK();
virtual BOOL OnInitDialog();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_EDITGROUP_H__712F9978_4300_4625_9364_39E903FA3284__INCLUDED_)

View file

@ -0,0 +1,79 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
#if !defined(AFX_EDITOBJPARAMETER_H__465E4002_6405_47E3_97BA_D46A8C108600__INCLUDED_)
#define AFX_EDITOBJPARAMETER_H__465E4002_6405_47E3_97BA_D46A8C108600__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// EditObjectParameter.h : header file
//
#include "GameLogic/Scripts.h"
class SidesList;
/////////////////////////////////////////////////////////////////////////////
// EditObjectParameter dialog
class EditObjectParameter : public CDialog
{
friend class EditParameter;
// Construction
public:
EditObjectParameter(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(EditObjectParameter)
enum { IDD = IDD_EDIT_OBJECT_PARAMETER };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(EditObjectParameter)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
HTREEITEM findOrAdd(HTREEITEM parent, const char *pLabel);
void addObject( const ThingTemplate *thingTemplate );
void addObjectLists( );
protected:
Parameter *m_parameter;
CTreeCtrl m_objectTreeView;
protected:
// Generated message map functions
//{{AFX_MSG(EditObjectParameter)
virtual BOOL OnInitDialog();
virtual void OnOK();
virtual void OnCancel();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_EDITOBJPARAMETER_H__465E4002_6405_47E3_97BA_D46A8C108600__INCLUDED_)

View file

@ -0,0 +1,133 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
#if !defined(AFX_EDITPARAMETER_H__465E4002_6405_47E3_97BA_D46A8C108600__INCLUDED_)
#define AFX_EDITPARAMETER_H__465E4002_6405_47E3_97BA_D46A8C108600__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// EditParameter.h : header file
//
#include "GameLogic/Scripts.h"
#include "Common\SubsystemInterface.h"
class SidesList;
/////////////////////////////////////////////////////////////////////////////
// EditParameter dialog
class EditParameter : public CDialog
{
// Construction
public:
EditParameter(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(EditParameter)
enum { IDD = IDD_EDIT_PARAMETER };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(EditParameter)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
public:
static Int edit( Parameter *pParm, AsciiString unitName = AsciiString::TheEmptyString );
static AsciiString getWarningText(Parameter *pParm);
static AsciiString getInfoText(Parameter *pParm);
static void setCurSidesList(SidesList *sidesListP) {m_sidesListP = sidesListP;};
static Bool loadScripts(CComboBox *pCombo, Bool subr, AsciiString match = AsciiString::TheEmptyString);
static Bool loadWaypoints(CComboBox *pCombo, AsciiString match = AsciiString::TheEmptyString);
static Bool loadTransports(CComboBox *pCombo, AsciiString match = AsciiString::TheEmptyString);
static Bool loadObjectTypeList(CComboBox *pCombo, std::vector<AsciiString> *strings = NULL, AsciiString match = AsciiString::TheEmptyString);
protected:
static Bool loadSides(CComboBox *pCombo, AsciiString match = AsciiString::TheEmptyString);
static Bool loadTriggerAreas(CComboBox *pCombo, AsciiString match = AsciiString::TheEmptyString);
static Bool loadCommandButtons(CComboBox *pCombo, AsciiString match = AsciiString::TheEmptyString);
static Bool loadFontNames(CComboBox *pCombo, AsciiString match = AsciiString::TheEmptyString);
static void readFontFile( char *filename );
static Bool loadTeams(CComboBox *pCombo, AsciiString match = AsciiString::TheEmptyString);
static Bool loadTeamOrUnit(CComboBox *pCombo, AsciiString match = AsciiString::TheEmptyString);
static Bool loadUnits(CComboBox *pCombo, AsciiString match = AsciiString::TheEmptyString);
static Bool loadBridges(CComboBox *pCombo, AsciiString match = AsciiString::TheEmptyString);
static Bool loadObjectType(CComboBox *pCombo, AsciiString match = AsciiString::TheEmptyString);
static Bool loadAudioType(Parameter::ParameterType comboType, CComboBox *pCombo, AsciiString match = AsciiString::TheEmptyString);
static Bool loadMovies(CComboBox *pCombo, AsciiString match = AsciiString::TheEmptyString);
static Bool getMovieComment(AsciiString match, AsciiString& outCommentFromINI);
static Bool loadSpecialPowers(CComboBox *pCombo, AsciiString match = AsciiString::TheEmptyString);
static Bool loadSciences(CComboBox *pCombo, AsciiString match = AsciiString::TheEmptyString);
static Bool loadScienceAvailabilities(CComboBox *pCombo, AsciiString match = AsciiString::TheEmptyString);
static Bool loadUpgrades(CComboBox *pCombo, AsciiString match = AsciiString::TheEmptyString);
static Bool loadAbilities( CComboBox *pCombo, AsciiString match = AsciiString::TheEmptyString );
static Bool loadAllAbilities( CComboBox *pCombo, AsciiString match = AsciiString::TheEmptyString );
static Bool loadWaypointPaths(CComboBox *pCombo, AsciiString match= AsciiString::TheEmptyString);
static Bool loadObjectFlags(CComboBox *pCombo, AsciiString match= AsciiString::TheEmptyString);
static Bool loadAttackPrioritySets(CComboBox *pCombo, AsciiString match = AsciiString::TheEmptyString);
static AsciiString loadLocalizedText(CComboBox *pCombo, AsciiString isStringInTable = AsciiString::TheEmptyString);
static Bool loadAttackSetParameter(Script *pScr, CComboBox *pCombo, AsciiString match);
static Bool loadCreateUnitParameter(Script *pScr, CComboBox *pCombo, AsciiString match);
static Bool loadCreateObjectListsParameter(Script *pScr, CComboBox *pCombo, std::vector<AsciiString> *strings, AsciiString match);
static Bool loadRevealNames(CComboBox *pCombo, AsciiString match = AsciiString::TheEmptyString);
static Bool loadRevealNamesParameter(Script *pScr, CComboBox *pCombo, AsciiString match);
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);
protected:
Parameter *m_parameter;
static AsciiString m_unitName; //This is the name of the unit that this script command is dedicated to (if applicable).
AsciiString m_string;
Int m_int;
Real m_real;
static SidesList *m_sidesListP;
static AsciiString m_selectedLocalizedString;
protected:
// Generated message map functions
//{{AFX_MSG(EditParameter)
afx_msg void OnChangeEdit();
afx_msg void OnEditchangeCombo();
virtual BOOL OnInitDialog();
virtual void OnOK();
virtual void OnCancel();
afx_msg void OnPreviewSound();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_EDITPARAMETER_H__465E4002_6405_47E3_97BA_D46A8C108600__INCLUDED_)

View file

@ -0,0 +1,77 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
#if !defined(AFX_EXPORTSCRIPTSOPTIONS_H__706D8D87_E01C_431A_ADB8_DFC4CA8A8422__INCLUDED_)
#define AFX_EXPORTSCRIPTSOPTIONS_H__706D8D87_E01C_431A_ADB8_DFC4CA8A8422__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ExportScriptsOptions.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// ExportScriptsOptions dialog
class ExportScriptsOptions : public CDialog
{
// Construction
public:
ExportScriptsOptions(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(ExportScriptsOptions)
enum { IDD = IDD_EXPORT_SCRIPTS_OPTIONS };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(ExportScriptsOptions)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
static Bool m_units;
static Bool m_waypoints;
static Bool m_triggers;
static Bool m_allScripts;
public:
Bool getDoUnits(void) {return m_units;}
Bool getDoWaypoints(void) {return m_waypoints;}
Bool getDoTriggers(void) {return m_triggers;}
Bool getDoAllScripts(void) {return m_allScripts;}
protected:
// Generated message map functions
//{{AFX_MSG(ExportScriptsOptions)
virtual void OnOK();
virtual BOOL OnInitDialog();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_EXPORTSCRIPTSOPTIONS_H__706D8D87_E01C_431A_ADB8_DFC4CA8A8422__INCLUDED_)

View file

@ -0,0 +1,48 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
// EyedropperTool.h
// Texture selection tool for worldbuilder.
// Author: John Ahlquist, April 2001
#pragma once
#ifndef EYEDROPPERTOOL_H
#define EYEDROPPERTOOL_H
#include "Tool.h"
class WorldHeightMapEdit;
/*************************************************************************/
/** EyedropperTool
Does the select tile from drawing window tool operation.
***************************************************************************/
/// Select tile tool.
class EyedropperTool : public Tool
{
public:
EyedropperTool(void);
~EyedropperTool(void);
public:
/// Perform tool on mouse down.
virtual void mouseDown(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
virtual void activate(); ///< Become the current tool.
};
#endif //TOOL_H

View file

@ -0,0 +1,99 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
#if !defined(AFX_FEATHEROPTIONS_H__6B56E20C_582E_4030_A251_879097C8853C__INCLUDED_)
#define AFX_FEATHEROPTIONS_H__6B56E20C_582E_4030_A251_879097C8853C__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// brushoptions.h : header file
//
#include "WBPopupSlider.h"
#include "OptionsPanel.h"
/////////////////////////////////////////////////////////////////////////////
/// FeatherOptions modeless (floating) dialog - allows entry and display of brush width and feather.
class FeatherOptions : public COptionsPanel , public PopupSliderOwner
{
// Construction
public:
enum {MIN_FEATHER_SIZE=2,
MAX_FEATHER_SIZE=51,
MIN_RATE=1,
MAX_RATE=10,
MIN_RADIUS=1,
MAX_RADIUS=5};
FeatherOptions(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(FeatherOptions)
enum { IDD = IDD_FEATHER_OPTIONS };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(FeatherOptions)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
virtual void OnOK(){return;}; //!< Modeless dialogs don't OK, so eat this for modeless.
virtual void OnCancel(){return;}; //!< Modeless dialogs don't close on ESC, so eat this for modeless.
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(FeatherOptions)
virtual BOOL OnInitDialog();
afx_msg void OnChangeSizeEdit();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
protected:
static FeatherOptions *m_staticThis; ///< Reference to the floating panel so SetWidth and SetFeather can be static.
static Int m_currentFeather; ///< current brush width in the ui.
static Int m_currentRadius; ///< current smoothing radius value.
static Int m_currentRate; ///< current smoothing rate.
Bool m_updating; ///<true if the ui is updating itself.
WBPopupSliderButton m_featherPopup;
WBPopupSliderButton m_radiusPopup;
WBPopupSliderButton m_ratePopup;
public:
static void setFeather(Int feather);
static void setRate(Int rate);
static void setRadius(Int radius);
public:
virtual void GetPopSliderInfo(const long sliderID, long *pMin, long *pMax, long *pLineSize, long *pInitial);
virtual void PopSliderChanged(const long sliderID, long theVal);
virtual void PopSliderFinished(const long sliderID, long theVal);
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_FEATHEROPTIONS_H__6B56E20C_582E_4030_A251_879097C8853C__INCLUDED_)

View file

@ -0,0 +1,61 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
// FeatherTool.h
// Texture tiling tools for worldbuilder.
// Author: John Ahlquist, April 2001
#pragma once
#ifndef FEATHERTOOL_H
#define FEATHERTOOL_H
#include "Tool.h"
class WorldHeightMapEdit;
/**************************************************************************/
/** FeatherTool
Does the smooth height map tool operation.
***************************************************************************/
/// smooth height map tool.
class FeatherTool : public Tool
{
protected:
WorldHeightMapEdit *m_htMapEditCopy; //< ref counted.
WorldHeightMapEdit *m_htMapFeatherCopy; //< ref counted.
WorldHeightMapEdit *m_htMapRateCopy; //< ref counted.
static Int m_feather;
static Int m_rate;
static Int m_radius;
public:
FeatherTool(void);
~FeatherTool(void);
static void setFeather(Int feather);
static void setRate(Int rate);
static void setRadius(Int Radius);
public:
virtual void mouseDown(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
virtual void mouseUp(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
virtual void mouseMoved(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
virtual WorldHeightMapEdit *getHeightMap(void) {return m_htMapEditCopy;};
virtual void activate(); ///< Become the current tool.
};
#endif //FEATHERTOOL_H

View file

@ -0,0 +1,100 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
#if !defined(AFX_FenceOptions_H__D3FF66C5_7107_4DAC_8A29_5EBAB5C3A24E__INCLUDED_)
#define AFX_FenceOptions_H__D3FF66C5_7107_4DAC_8A29_5EBAB5C3A24E__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// FenceOptions.h : header file
//
#include "TerrainSwatches.h"
#include "OptionsPanel.h"
#include "Common/AsciiString.h"
class WorldHeightMapEdit;
class MapObject;
/////////////////////////////////////////////////////////////////////////////
// FenceOptions dialog
class FenceOptions : public COptionsPanel
{
// Construction
public:
FenceOptions(CWnd* pParent = NULL); ///< standard constructor
~FenceOptions(void); ///< standard destructor
enum { NAME_MAX_LEN = 64 };
// Dialog Data
//{{AFX_DATA(FenceOptions)
enum { IDD = IDD_FENCE_OPTIONS };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(FenceOptions)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
virtual void OnOK(){return;}; ///< Modeless dialogs don't OK, so eat this for modeless.
virtual void OnCancel(){return;}; ///< Modeless dialogs don't close on ESC, so eat this for modeless.
virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(FenceOptions)
virtual BOOL OnInitDialog();
afx_msg void OnChangeFenceSpacingEdit();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
protected:
static FenceOptions *m_staticThis;
static Bool m_updating;
static Int m_currentObjectIndex;
static Real m_fenceSpacing;
static Real m_fenceOffset;
CTreeCtrl m_objectTreeView;
MapObject *m_objectsList;
Bool m_customSpacing;
protected:
void addObject( MapObject *mapObject, const char *pPath, const char *name,
Int objectNdx, HTREEITEM parent );
HTREEITEM findOrAdd(HTREEITEM parent, const char *pLabel);
Bool setObjectTreeViewSelection(HTREEITEM parent, Int selection);
void updateObjectOptions();
public:
static void update(void);
static Bool hasSelectedObject(void);
static Real getFenceSpacing(void) {return m_fenceSpacing;}
static Real getFenceOffset(void) {return m_fenceOffset;}
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_FenceOptions_H__D3FF66C5_711D_4DAC_8A29_5EAAB5C3A23E__INCLUDED_)

View file

@ -0,0 +1,62 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
// FenceTool.h
// Texture tiling tools for worldbuilder.
// Author: John Ahlquist, April 2001
#pragma once
#ifndef FenceTool_H
#define FenceTool_H
#include "Tool.h"
class WorldHeightMapEdit;
class MapObject;
class Vector3;
/*************************************************************************/
/** FenceTool
Does the fence tool operation.
***************************************************************************/
class FenceTool : public Tool
{
protected:
CPoint m_downPt2d;
Coord3D m_downPt3d;
MapObject *m_mapObjectList;
Real m_curObjectWidth;
Real m_curObjectOffset;
Int m_objectCount;
public:
FenceTool(void);
~FenceTool(void);
protected:
void updateMapObjectList(Coord3D downPt, Coord3D curPt, WbView* pView, CWorldBuilderDoc *pDoc, Bool checkPlayers);
public:
virtual void mouseDown(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
virtual void mouseUp(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
virtual void mouseMoved(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
virtual void activate(); ///< Become the current tool.
virtual void deactivate(); ///< Become not the current tool.
};
#endif //FenceTool_H

View file

@ -0,0 +1,56 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
// FloodFillTool.h
// Texture tiling tools for worldbuilder.
// Author: John Ahlquist, April 2001
#pragma once
#ifndef FloodFillTool_H
#define FloodFillTool_H
#include "Tool.h"
class WorldHeightMapEdit;
/**************************************************************************
FloodFillTool
***************************************************************************/
/// Fill area with texture tool.
class FloodFillTool : public Tool
{
public:
FloodFillTool(void);
~FloodFillTool(void);
protected:
Int m_textureClassToDraw; ///< The texture to fill with. Foreground for mousedDown, background for mouseDownRt.
HCURSOR m_cliffCursor;
static Bool m_adjustCliffTextures;
public:
virtual void mouseUp(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
virtual void activate(); ///< Become the current tool.
virtual void setCursor(void);
Bool getAdjustCliffs(void) {return m_adjustCliffTextures;}
void setAdjustCliffs(Bool val) {m_adjustCliffTextures = val;}
};
#endif //TOOL_H

View file

@ -0,0 +1,143 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
#if !defined(AFX_GLOBALLIGHTOPTIONS_H__6B56E20C_582E_4030_A251_879097C8853C__INCLUDED_)
#define AFX_GLOBALLIGHTOPTIONS_H__6B56E20C_582E_4030_A251_879097C8853C__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// GLOBALLIGHTOPTIONS.h : header file
//
#include "WBPopupSlider.h"
#include "resource.h"
#include "CButtonShowColor.h"
/////////////////////////////////////////////////////////////////////////////
/// GlobalLightOptions modeless (floating) dialog - allows entry and display of brush width and feather.
#define GLOBALLIGHT_OPTIONS_PANEL_SECTION "LightOptionsWindow"
class GlobalLightOptions : public CDialog , public PopupSliderOwner
{
// Construction
public:
enum {K_TERRAIN=1, K_OBJECTS=2, K_BOTH=3};
enum {K_SUN=0, K_ACCENT1=1, K_ACCENT2=2};
int kUIRedIDs[3];// = {IDC_RD_EDIT, IDC_RD_EDIT1, IDC_RD_EDIT2};
int kUIGreenIDs[3];// = {IDC_GD_EDIT, IDC_GD_EDIT1, IDC_GD_EDIT2};
int kUIBlueIDs[3];// = {IDC_BD_EDIT, IDC_BD_EDIT1, IDC_BD_EDIT2};
CButtonShowColor m_colorButton;
GlobalLightOptions(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(GlobalLightOptions)
enum { IDD = IDD_GLOBAL_LIGHT_OPTIONS };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(GlobalLightOptions)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(GlobalLightOptions)
virtual BOOL OnInitDialog();
afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);
afx_msg void OnMove(int x, int y);
afx_msg void OnChangeFrontBackEdit();
afx_msg void OnChangeLeftRightEdit();
afx_msg void OnChangeColorEdit();
afx_msg void OnRadioEverything();
afx_msg void OnRadioObjects();
afx_msg void OnRadioTerrain();
afx_msg void OnColorPress();
afx_msg void OnResetLights();
afx_msg void OnClose();
virtual void OnOK(){return;}; //!< Modeless dialogs don't OK, so eat this for modeless.
virtual void OnCancel(){return;}; //!< Modeless dialogs don't close on ESC, so eat this for modeless.
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
Real ComponentToPercent(Int component)
{
Real percent;
if (component >= 255) {
return 1.0;
}
if (component <= 0) {
return 0.0;
}
percent = (Real)component/255.0;
return percent;
}
Int PercentToComponent(Real percent)
{
Int component;
if (percent >= 1.0) {
return 255;
}
if (percent <= 0.0) {
return 0;
}
component = (percent * 255.0);
return component;
};
BOOL GetInt(Int ctrlID, Int *rVal);
void PutInt(Int ctrlID, Int val);
protected:
Bool m_updating; ///<true if the ui is updating itself.
WBPopupSliderButton m_frontBackPopup;
WBPopupSliderButton m_leftRightPopup;
WBPopupSliderButton m_frontBackPopupAccent1;
WBPopupSliderButton m_leftRightPopupAccent1;
WBPopupSliderButton m_frontBackPopupAccent2;
WBPopupSliderButton m_leftRightPopupAccent2;
Int m_angleAzimuth[3];
Int m_angleElevation[3];
Int m_lighting;
protected:
void applyAngle(Int lightIndex=0);
void showLightFeedback(Int lightIndex=0);
void applyColor(Int lightIndex=0);
void updateEditFields(void);
void stuffValuesIntoFields(Int lightIndex = 0);
public:
virtual void GetPopSliderInfo(const long sliderID, long *pMin, long *pMax, long *pLineSize, long *pInitial);
virtual void PopSliderChanged(const long sliderID, long theVal);
virtual void PopSliderFinished(const long sliderID, long theVal);
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_GLOBALLIGHTOPTIONS_H__6B56E20C_582E_4030_A251_879097C8853C__INCLUDED_)

View file

@ -0,0 +1,82 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
#ifndef GROVEOPTIONS_H
#define GROVEOPTIONS_H
#pragma once
#include <map>
#include <vector>
#include "worldbuilder.h"
#include "OptionsPanel.h"
#include "Common/STLTypedefs.h"
// Used to store Display names in conjunction with internal names.
typedef std::pair<AsciiString, UnicodeString> PairNameDisplayName;
typedef std::vector<PairNameDisplayName> VecPairNameDisplayName;
typedef std::vector<PairNameDisplayName>::iterator VecPairNameDisplayNameIt;
// This is a utility function useful to get a display string from a pair of AsciiString
// UnicodeStrings. It attempts to use the UnicodeString, and if that fails then turns
// to the AsciiString
// As a last resort, it returns the EmptyString.
UnicodeString GetDisplayNameFromPair(const PairNameDisplayName *pNamePair);
class GroveOptions : public COptionsPanel
{
protected:
std::vector<std::pair<Int, Int> > mVecGroup;
VecPairNameDisplayName mVecDisplayNames;
Int mNumTrees;
public:
GroveOptions(CWnd* pParent = NULL);
~GroveOptions();
void makeMain(void);
virtual BOOL OnInitDialog();
int getNumTrees(void);
int getNumType(int type);
AsciiString getTypeName(int type);
int getTotalTreePerc(void);
Bool getCanPlaceInWater(void);
Bool getCanPlaceOnCliffs(void);
protected:
void _setTreesToLists(void);
void _buildTreeList(void);
void _setDefaultRatios(void);
void _setDefaultNumTrees(void);
void _setDefaultPlacementAllowed(void);
afx_msg void _updateTreeWeights(void);
afx_msg void _updateTreeCount(void);
afx_msg void _updateGroveMakeup(void);
afx_msg void _updatePlacementAllowed(void);
virtual void OnOK();
virtual void OnClose();
DECLARE_MESSAGE_MAP()
};
extern GroveOptions *TheGroveOptions;
#endif

View file

@ -0,0 +1,66 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
// GroveTool.h
// Author: John Ahlquist, May 2001
#pragma once
#ifndef GroveTool_H
#define GroveTool_H
#include "lib/Basetype.h"
#include "Tool.h"
#include "common/MapObject.h"
class WorldHeightMapEdit;
/*************************************************************************/
/** GroveTool
Does the add a grove of trees tool operation.
***************************************************************************/
/// Add a grove of trees tool.
class GroveTool : public Tool
{
protected:
enum {HYSTERESIS = 3};
CPoint m_downPt;
Bool m_dragging;
MapObject *m_headMapObj;
protected:
void plantTree( Coord3D *pos );
void plantShrub( Coord3D *pos );
void plantGrove( Coord3D pos, Coord3D prevDir, Real baseHeight, Int level, CPoint bounds );
void _plantGroveInBox(CPoint tl, CPoint br, WbView* pView);
void addObj(Coord3D *pos, AsciiString name);
void activate();
public:
GroveTool(void);
~GroveTool(void);
public:
/// Perform tool on mouse down.
virtual void mouseDown(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
virtual void mouseUp(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
virtual void mouseMoved(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
};
#endif //TOOL_H

View file

@ -0,0 +1,58 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
// HandScrollTool.h
// Scrolling tool for worldbuilder.
// Author: John Ahlquist, May 2001
#pragma once
#ifndef HandScrollTool_H
#define HandScrollTool_H
#include "Tool.h"
/**************************************************************************
HandScrollTool
***************************************************************************/
/// Scroll tool.
class HandScrollTool : public Tool
{
public:
HandScrollTool(void);
~HandScrollTool(void);
protected:
enum {HYSTERESIS = 3};
CPoint m_prevPt2d;
CPoint m_downPt2d;
Bool m_scrolling;
UINT m_mouseDownTime; // if m_trackingMode != TRACK_NONE, tickcount when mouse went down
public:
/// Start scrolling.
virtual void mouseDown(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
/// Scroll.
virtual void mouseMoved(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
/// End scroll.
virtual void mouseUp(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
virtual void activate(); ///< Become the current tool.
virtual Bool followsTerrain(void) {return false;};
};
#endif //TOOL_H

View file

@ -0,0 +1,50 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
#pragma once
#ifndef __IMPASSABLEOPTIONS_H__
#define __IMPASSABLEOPTIONS_H__
class ImpassableOptions : public CDialog
{
public:
enum { IDD = IDD_IMPASSABLEOPTIONS };
public:
ImpassableOptions(CWnd* pParent = NULL, Real defaultSlope = 45.0f);
virtual ~ImpassableOptions();
Real GetSlopeToShow() const { return m_slopeToShow; }
Real GetDefaultSlope() const { return m_defaultSlopeToShow; }
void SetDefaultSlopeToShow(Real slopeToShow) { m_slopeToShow = slopeToShow; }
protected:
Real m_slopeToShow; // Clamped in the range of [0,90]
Real m_defaultSlopeToShow;
Bool m_showImpassableAreas;
Bool ValidateSlope(); // Returns TRUE if it was valid, FALSE if it had to adjust it.
protected:
virtual BOOL OnInitDialog();
afx_msg void OnAngleChange();
afx_msg void OnPreview();
DECLARE_MESSAGE_MAP()
};
#endif /* __IMPASSABLEOPTIONS_H__ */

View file

@ -0,0 +1,164 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
// FILE: LayersList.h
/*---------------------------------------------------------------------------*/
/* EA Pacific */
/* Confidential Information */
/* Copyright (C) 2001 - All Rights Reserved */
/* DO NOT DISTRIBUTE */
/*---------------------------------------------------------------------------*/
/* Project: RTS3 */
/* File name: LayersList.h */
/* Created: John K. McDonald, Jr., 5/10/2002 */
/* Desc: Layers List Declarations */
/* Revision History: */
/* 5/10/2002 : Initial creation */
/*---------------------------------------------------------------------------*/
#pragma once
#ifndef _H_LAYERSLIST_
#define _H_LAYERSLIST_
// INCLUDES ///////////////////////////////////////////////////////////////////
#include "Common/AsciiString.h"
#include <list>
#include <string>
// DEFINES ////////////////////////////////////////////////////////////////////
// FORWARD DECLARATIONS ///////////////////////////////////////////////////////
class MapObject;
// TYPE DEFINES ///////////////////////////////////////////////////////////////
typedef std::list<MapObject*> ListMapObjectPtr;
typedef ListMapObjectPtr::iterator ListMapObjectPtrIt;
struct Layer
{
AsciiString layerName;
ListMapObjectPtr objectsInLayer;
Bool show;
};
typedef std::list<Layer> ListLayer;
typedef ListLayer::iterator ListLayerIt;
// Class Definition for overridden Tree control that supports Right-click context sensitive menu.
class CLLTreeCtrl : public CTreeCtrl
{
public:
AsciiString getLastClickedLayer(void) { return mLastClickedLayer; }
AsciiString getLastClickedObject(void) { return mLastClickedObject; }
protected:
AsciiString mLastClickedLayer;
AsciiString mLastClickedObject;
void buildMoveMenu(CMenu* pPopup, UINT firstID);
virtual void OnRButtonDown(UINT nFlags, CPoint point);
DECLARE_MESSAGE_MAP()
};
// Class Definition
class LayersList : public CDialog
{
public:
enum { IDD = IDD_LAYERSLIST };
LayersList(UINT nIDTemplate = LayersList::IDD, CWnd *parentWnd = NULL);
virtual ~LayersList();
void resetLayers();
void addMapObjectToLayersList(IN MapObject *objToAdd, AsciiString layerToAddTo = AsciiString(TheDefaultLayerName.c_str()));
AsciiString removeMapObjectFromLayersList(IN MapObject *objToRemove);
void changeMapObjectLayer(IN MapObject *objToChange, AsciiString layerToPlaceOn);
void addLayerNamed(IN AsciiString layerToAdd);
void removeLayerNamed(IN AsciiString layerToRemove);
void changeLayerName(IN AsciiString oldLayerName, IN AsciiString newLayerName);
void mergeLayerInto(IN ListLayerIt src, IN ListLayerIt dst);
Bool isLayerHidden(IN AsciiString layerToTest);
void updateUIFromList(void);
void disableUpdates() { m_performUpdates = false; }
void enableUpdates() { m_performUpdates = true; updateUIFromList(); }
const ListLayer& GetAllLayers(void) const { return mLayers; }
static MapObject *findObjectByUID(AsciiString objectIDToFind);
protected:
AsciiString mCurrentlyEditingLabel;
ListLayer mLayers;
CLLTreeCtrl *mTree;
CImageList mImageList;
Bool m_performUpdates;
HTREEITEM findTreeLayerNamed(const AsciiString& nameToFind);
HTREEITEM findTreeObjectNamed(const AsciiString& objectToFind, HTREEITEM layerItem);
// This is a string because making it an AsciiString makes us barf on construction. :-(
static std::string TheDefaultLayerName;
static std::string TheDefaultNewLayerName;
static const std::string TheUnmutableDefaultLayerName;
// This function takes an MapObject, and does one of the following:
// 1) Return true if the MapObject can be found, and
// layerIt points to a valid layer iterator in which the MapObject was found
// MapObjectIt points to a valid MapObject iterator on the layerIts MapObjectsInLayer member
// 2) Returns false if the MapObject cannot be found.
Bool findMapObjectAndList(IN MapObject *MapObjectToFind, OUT ListLayerIt *layerIt = NULL, OUT ListMapObjectPtrIt *MapObjectIt = NULL);
// This function takes a layer name, and does one of the following:
// 1) Return true if the layer can be found, and
// layerIt points to a valid layer iterator named layerName
// 2) Returns false if the layer cannot be found.
Bool findLayerNamed(IN AsciiString layerName, OUT ListLayerIt *layerIt = NULL);
void addMapObjectToLayer(IN MapObject *objToAdd, IN ListLayerIt *layerIt);
void removeMapObjectFromLayer(IN MapObject *objToRemove, IN ListLayerIt *layerIt = NULL, IN ListMapObjectPtrIt *MapObjectIt = NULL);
protected:
virtual void OnOK();
virtual void OnCancel();
virtual BOOL OnInitDialog();
afx_msg void OnBeginEditLabel(NMHDR *pNotifyStruct, LRESULT* pResult);
afx_msg void OnEndEditLabel(NMHDR *pNotifyStruct, LRESULT* pResult);
afx_msg void OnMergeLayer(UINT commandID);
afx_msg void OnMergeObject(UINT commandID);
afx_msg void OnMergeViewSelection(UINT commandID);
afx_msg void OnNewLayer();
afx_msg void OnDeleteLayer();
afx_msg void OnHideShowLayer();
DECLARE_MESSAGE_MAP()
};
extern LayersList *TheLayersList;
#endif /* _H_LAYERSLIST_ */

View file

@ -0,0 +1,82 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
#if !defined(AFX_LightOptions_H__6B56E20C_582E_4132_A251_879097C8852C__INCLUDED_)
#define AFX_LightOptions_H__6B56E20C_582E_4132_A251_879097C8852C__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// LightOptions.h : header file
//
#include "OptionsPanel.h"
class MapObject;
/////////////////////////////////////////////////////////////////////////////
// LightOptions dialog
class LightOptions : public COptionsPanel
{
// Construction
public:
LightOptions(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(LightOptions)
enum { IDD = IDD_LIGHT_OPTIONS };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(LightOptions)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
virtual void OnOK(){return;}; //!< Modeless dialogs don't OK, so eat this for modeless.
virtual void OnCancel(){return;}; //!< Modeless dialogs don't close on ESC, so eat this for modeless.
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(LightOptions)
virtual BOOL OnInitDialog();
afx_msg void OnChangeLightEdit();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
protected:
static LightOptions *m_staticThis; ///< Reference to the floating panel so SetWidth and SetFeather can be static.
Bool m_updating; ///<true if the ui is updating itself.
protected:
void updateTheUI(void);
public:
static void update(void);
static MapObject *getSingleSelectedLight(void);
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_LightOptions_H__6B56E20C_582E_4030_A251_879097C8853C__INCLUDED_)

View file

@ -0,0 +1,159 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
// MainFrm.h : interface of the CMainFrame class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_MAINFRM_H__371EC7AB_29D3_11D5_8CE0_00010297BBAC__INCLUDED_)
#define AFX_MAINFRM_H__371EC7AB_29D3_11D5_8CE0_00010297BBAC__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "lib/BaseType.h"
#include "MyToolbar.h"
#include "BrushOptions.h"
#include "FeatherOptions.h"
#include "CellWidth.h"
#include "TerrainMaterial.h"
#include "BlendMaterial.h"
#include "MoundOptions.h"
#include "ObjectOptions.h"
#include "FenceOptions.h"
#include "RoadOptions.h"
#include "ContourOptions.h"
#include "MeshMoldOptions.h"
#include "WaypointOptions.h"
#include "WaterOptions.h"
#include "LightOptions.h"
#include "MapObjectProps.h"
#include "GroveOptions.h"
#include "RampOptions.h"
#include "GlobalLightOptions.h"
#include "CameraOptions.h"
#include "ScorchOptions.h"
#include "BuildList.h"
#define TWO_D_WINDOW_SECTION "TwoDWindow"
#define MAIN_FRAME_SECTION "MainFrame"
class LayersList;
class CMainFrame : public CFrameWnd
{
DECLARE_DYNAMIC(CMainFrame)
public:
CMainFrame();
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMainFrame)
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CMainFrame();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
static CMainFrame *GetMainFrame() { return TheMainFrame; }
void showOptionsDialog(Int dialogID);
void OnEditGloballightoptions();
void ResetWindowPositions(void);
void adjustWindowSize(void);
Bool isAutoSaving(void) {return m_autoSaving;};
void handleCameraChange(void);
protected: // control bar embedded members
CStatusBar m_wndStatusBar;
CToolBar m_wndToolBar;
CToolBar m_floatingToolBar;
BrushOptions m_brushOptions;
TerrainMaterial m_terrainMaterial;
BlendMaterial m_blendMaterial;
ObjectOptions m_objectOptions;
FenceOptions m_fenceOptions;
MapObjectProps m_mapObjectProps;
MoundOptions m_moundOptions;
RoadOptions m_roadOptions;
FeatherOptions m_featherOptions;
MeshMoldOptions m_meshMoldOptions;
WaypointOptions m_waypointOptions;
WaterOptions m_waterOptions;
LightOptions m_lightOptions;
BuildList m_buildListOptions;
GroveOptions m_groveOptions;
RampOptions m_rampOptions;
ScorchOptions m_scorchOptions;
COptionsPanel m_noOptions;
GlobalLightOptions m_globalLightOptions;
CameraOptions m_cameraOptions;
LayersList* m_layersList;
CWnd *m_curOptions;
Int m_curOptionsX;
Int m_curOptionsY;
Int m_optionsPanelWidth;
Int m_optionsPanelHeight;
Int m_globalLightOptionsWidth;
Int m_globalLightOptionsHeight;
Int m_3dViewWidth;
Bool m_autoSaving; ///< True if we are autosaving.
UINT m_hAutoSaveTimer; ///< Timer that triggers for autosave.
Bool m_autoSave; ///< If true, then do autosaves.
Int m_autoSaveInterval; ///< Time between autosaves in seconds.
static CMainFrame *TheMainFrame;
// Generated message map functions
protected:
//{{AFX_MSG(CMainFrame)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnMove(int x, int y);
afx_msg void OnViewBrushfeedback();
afx_msg void OnUpdateViewBrushfeedback(CCmdUI* pCmdUI);
afx_msg void OnDestroy();
afx_msg void OnTimer(UINT nIDEvent);
afx_msg void OnEditCameraoptions();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_MAINFRM_H__371EC7AB_29D3_11D5_8CE0_00010297BBAC__INCLUDED_)

View file

@ -0,0 +1,88 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
// FILE: MapPreview.h /////////////////////////////////////////////////
//-----------------------------------------------------------------------------
//
// Electronic Arts Pacific.
//
// Confidential Information
// Copyright (C) 2002 - All Rights Reserved
//
//-----------------------------------------------------------------------------
//
// created: Oct 2002
//
// Filename: MapPreview.h
//
// author: Chris Huybregts
//
// purpose:
//
//-----------------------------------------------------------------------------
///////////////////////////////////////////////////////////////////////////////
#pragma once
#ifndef __MAP_PREVIEW_H_
#define __MAP_PREVIEW_H_
//-----------------------------------------------------------------------------
// SYSTEM INCLUDES ////////////////////////////////////////////////////////////
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// USER INCLUDES //////////////////////////////////////////////////////////////
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// FORWARD REFERENCES /////////////////////////////////////////////////////////
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// TYPE DEFINES ///////////////////////////////////////////////////////////////
//-----------------------------------------------------------------------------
enum
{
MAP_PREVIEW_HEIGHT = 128,//256,
MAP_PREVIEW_WIDTH = 128,//256,
};
class MapPreview
{
public:
MapPreview(void );
void save( CString mapName );
private:
void interpolateColorForHeight( RGBColor *color, Real height, Real hiZ, Real midZ, Real loZ );
Bool mapPreviewToWorld(const ICoord2D *radar, Coord3D *world);
void buildMapPreviewTexture( CString tgaName );
UnsignedInt m_pixelBuffer[MAP_PREVIEW_HEIGHT][MAP_PREVIEW_WIDTH];
};
//-----------------------------------------------------------------------------
// INLINING ///////////////////////////////////////////////////////////////////
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// EXTERNALS //////////////////////////////////////////////////////////////////
//-----------------------------------------------------------------------------
#endif // __MAP_PREVIEW_H_

View file

@ -0,0 +1,69 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
#if !defined(AFX_MAPSETTINGS_H__21749744_4DF4_462C_8DD4_FEEC1003DCFE__INCLUDED_)
#define AFX_MAPSETTINGS_H__21749744_4DF4_462C_8DD4_FEEC1003DCFE__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// MapSettings.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// MapSettings dialog
class MapSettings : public CDialog
{
// Construction
public:
MapSettings(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(MapSettings)
enum { IDD = IDD_MAP_SETTINGS };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(MapSettings)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(MapSettings)
afx_msg void OnChangeMapTimeofday();
afx_msg void OnChangeMapWeather();
virtual BOOL OnInitDialog();
virtual void OnOK();
afx_msg void OnChangeMapTitle();
afx_msg void OnChangeMapCompression();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_MAPSETTINGS_H__21749744_4DF4_462C_8DD4_FEEC1003DCFE__INCLUDED_)

View file

@ -0,0 +1,118 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
#if !defined(AFX_MESHMOLDOPTIONS_H__D5E62CB9_2830_4FA1_8306_DE18DD971087__INCLUDED_)
#define AFX_MESHMOLDOPTIONS_H__D5E62CB9_2830_4FA1_8306_DE18DD971087__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// MeshMoldOptions.h : header file
//
#include "WBPopupSlider.h"
#include "OptionsPanel.h"
#include "Common/AsciiString.h"
/////////////////////////////////////////////////////////////////////////////
// MeshMoldOptions dialog
class MeshMoldOptions : public COptionsPanel , public PopupSliderOwner
{
// Construction
public:
MeshMoldOptions(CWnd* pParent = NULL); // standard constructor
enum {MIN_ANGLE=-180,
MAX_ANGLE=180,
MIN_HEIGHT=-10,
MAX_HEIGHT=256,
MIN_SCALE=1,
MAX_SCALE=200};
// Dialog Data
//{{AFX_DATA(MeshMoldOptions)
enum { IDD = IDD_MESHMOLD_OPTIONS };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(MeshMoldOptions)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
virtual BOOL OnInitDialog();
virtual void OnOK(){return;}; //!< Modeless dialogs don't OK, so eat this for modeless.
virtual void OnCancel(){return;}; //!< Modeless dialogs don't close on ESC, so eat this for modeless.
virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(MeshMoldOptions)
afx_msg void OnPreview();
afx_msg void OnApplyMesh();
afx_msg void OnChangeScaleEdit();
afx_msg void OnChangeHeightEdit();
afx_msg void OnChangeAngleEdit();
afx_msg void OnRaise();
afx_msg void OnRaiseLower();
afx_msg void OnLower();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
protected:
WBPopupSliderButton m_anglePopup;
WBPopupSliderButton m_scalePopup;
WBPopupSliderButton m_HeightPopup;
CTreeCtrl m_moldTreeView;
Bool m_updating;
AsciiString m_meshModelName;
static Real m_currentHeight;
static Real m_currentScale;
static Int m_currentAngle;
static Bool m_doingPreview;
static Bool m_raiseOnly;
static Bool m_lowerOnly;
public:
static void setScale(Real scale);
static void setHeight(Real height);
static void setAngle(Int angle);
static Real getHeight(void) {return m_currentHeight;};
static Real getScale(void) {return m_currentScale;};
static Int getAngle(void) {return m_currentAngle;};
static MeshMoldOptions *m_staticThis;
static Bool isDoingPreview(void) {return m_doingPreview;};
static Bool isRaisingOnly(void) {return m_raiseOnly;};
static Bool isLoweringOnly(void) {return m_lowerOnly;};
static AsciiString getModelName(void) {if (m_staticThis) return m_staticThis->m_meshModelName; return "";};
public: //PopupSliderOwner methods.
virtual void GetPopSliderInfo(const long sliderID, long *pMin, long *pMax, long *pLineSize, long *pInitial);
virtual void PopSliderChanged(const long sliderID, long theVal);
virtual void PopSliderFinished(const long sliderID, long theVal);
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_MESHMOLDOPTIONS_H__D5E62CB9_2830_4FA1_8306_DE18DD971087__INCLUDED_)

View file

@ -0,0 +1,70 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
// MeshMoldTool.h
// Terrain shaping tools for worldbuilder.
// Author: John Ahlquist, Oct. 2001
#pragma once
#ifndef MESHMOLDTOOL_H
#define MESHMOLDTOOL_H
#include "Tool.h"
class WorldHeightMapEdit;
/*************************************************************************/
/** MeshMoldTool
Does the Mesh Mold tool operation.
***************************************************************************/
/// Height brush tool.
class MeshMoldTool : public Tool
{
protected:
CPoint m_prevViewPt; ///< Previous tracking location in view coords.
Bool m_offsettingZ; ///< True if we are raising or lowering the mesh along z axis.
Coord3D m_prevDocPt; ///< Previous tracking location in doc coords.
static Coord3D m_toolPos; ///< Current location of the mesh on the terrain.
static Bool m_tracking; ///< True if we are tracking a mesh on screen.
static WorldHeightMapEdit *m_htMapEditCopy; ///< ref counted.
public:
MeshMoldTool(void);
~MeshMoldTool(void);
protected:
static void applyMesh(CWorldBuilderDoc *pDoc); ///< Apply the mesh to copy of terrain.
public:
static void apply(CWorldBuilderDoc *pDoc); ///< Apply the mesh to the terrain & execute undoable.
public: //Tool methods.
virtual void mouseDown(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
virtual void mouseUp(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
virtual void mouseMoved(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
virtual WorldHeightMapEdit *getHeightMap(void) {return m_htMapEditCopy;};
virtual void activate(); ///< Become the current tool.
virtual void deactivate(); ///< Become the current tool.
virtual Bool followsTerrain(void) {return false;};
public: // Methods specific to MeshMoldTool.
static void updateMeshLocation(Bool changePreview);
};
#endif //MESHMOLDTOOL_H

View file

@ -0,0 +1,104 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
#if !defined(AFX_MoundOptions_H__6B56E20C_582E_4132_A251_879097C8852C__INCLUDED_)
#define AFX_MoundOptions_H__6B56E20C_582E_4132_A251_879097C8852C__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// MoundOptions.h : header file
//
#include "WBPopupSlider.h"
#include "OptionsPanel.h"
/////////////////////////////////////////////////////////////////////////////
// MoundOptions dialog
class MoundOptions : public COptionsPanel , public PopupSliderOwner
{
// Construction
public:
enum {MIN_MOUND_HEIGHT=1,
MAX_MOUND_HEIGHT=21
};
// Construction
public:
enum {MIN_BRUSH_SIZE=1,
MAX_BRUSH_SIZE=51,
MIN_FEATHER=0,
MAX_FEATHER=20};
MoundOptions(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(MoundOptions)
enum { IDD = IDD_BRUSH_OPTIONS };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(MoundOptions)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
virtual void OnOK(){return;}; //!< Modeless dialogs don't OK, so eat this for modeless.
virtual void OnCancel(){return;}; //!< Modeless dialogs don't close on ESC, so eat this for modeless.
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(MoundOptions)
virtual BOOL OnInitDialog();
afx_msg void OnChangeFeatherEdit();
afx_msg void OnChangeSizeEdit();
afx_msg void OnChangeHeightEdit();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
protected:
static MoundOptions *m_staticThis; ///< Reference to the floating panel so SetWidth and SetFeather can be static.
static Int m_currentWidth; ///< current brush width in the ui.
static Int m_currentFeather; ///< current feather width in the ui.
static Int m_currentHeight;
Bool m_updating; ///<true if the ui is updating itself.
WBPopupSliderButton m_brushWidthPopup;
WBPopupSliderButton m_brushFeatherPopup;
WBPopupSliderButton m_brushHeightPopup;
public:
static void setWidth(Int width);
static void setFeather(Int feather);
static void setHeight(Int height);
public:
virtual void GetPopSliderInfo(const long sliderID, long *pMin, long *pMax, long *pLineSize, long *pInitial);
virtual void PopSliderChanged(const long sliderID, long theVal);
virtual void PopSliderFinished(const long sliderID, long theVal);
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_MoundOptions_H__6B56E20C_582E_4030_A251_879097C8853C__INCLUDED_)

View file

@ -0,0 +1,75 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
// MoundTool.h
// Texture tiling tools for worldbuilder.
// Author: John Ahlquist, April 2001
#pragma once
#ifndef MOUND_TOOL_H
#define MOUND_TOOL_H
#include "Tool.h"
class WorldHeightMapEdit;
/*************************************************************************
** MoundTool
***************************************************************************/
class MoundTool : public Tool
{
enum {MIN_DELAY_TIME=60}; // 60 ms minimum delay between applications.
protected:
WorldHeightMapEdit *m_htMapEditCopy; //< ref counted.
WorldHeightMapEdit *m_htMapSaveCopy; //< ref counted.
Bool m_raising; ///< True if mounding, false if digging.
Int m_lastMoveTime; ///< Last system clock time.
static Int m_moundHeight;
static Int m_brushWidth;
static Int m_brushFeather;
public:
MoundTool(void);
~MoundTool(void);
public:
static Int getMoundHeight(void) {return m_moundHeight;};
static void setMoundHeight(Int height);
static Int getWidth(void) {return m_brushWidth;}; ///<Returns width.
static Int getFeather(void) {return m_brushFeather;}; ///<Returns feather.
static void setWidth(Int width);
static void setFeather(Int feather);
public:
virtual void mouseDown(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
virtual void mouseUp(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
virtual void mouseMoved(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
virtual WorldHeightMapEdit *getHeightMap(void) {return m_htMapEditCopy;};
virtual void activate(); ///< Become the current tool.
};
/*************************************************************************
** DigTool
***************************************************************************/
class DigTool : public MoundTool
{
public:
DigTool(void);
};
#endif //MoundTool_H

View file

@ -0,0 +1,53 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
// MyToolBar.h
// Class to do custom toolbar.
// Author: John Ahlquist, April 2001
#pragma once
#ifndef MYTOOLBAR_H
#define MYTOOLBAR_H
/*************************************************************************
** CellSizeToolBar
***************************************************************************/
class CellSizeToolBar : public CDialogBar
{
protected:
static CellSizeToolBar* CellSizeToolBar::m_staticThis;
CSliderCtrl m_cellSlider;
protected:
afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
virtual LRESULT WindowProc( UINT message, WPARAM wParam, LPARAM lParam );
DECLARE_MESSAGE_MAP()
public:
~CellSizeToolBar(void);
void SetupSlider(void);
static void CellSizeChanged(Int cellSize);
};
#endif //MYTOOLBAR_H

View file

@ -0,0 +1,89 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
#if !defined(AFX_NEWHEIGHTMAP_H__239CD6A3_2919_11D5_8CE0_00010297BBAC__INCLUDED_)
#define AFX_NEWHEIGHTMAP_H__239CD6A3_2919_11D5_8CE0_00010297BBAC__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// NewHeightMap.h : header file
//
#include "Lib/BaseType.h"
typedef struct {
Int xExtent;
Int yExtent;
Int initialHeight;
Int borderWidth;
Bool forResize; ///< If for resize, then the anchor bools are set.
Bool anchorTop; ///< It can be anchor top, or anchor bottom, or neither, but not both.
Bool anchorBottom;
Bool anchorLeft; ///< It can be anchor left, or anchor right, or neither but not both.
Bool anchorRight;
} TNewHeightInfo;
/////////////////////////////////////////////////////////////////////////////
// CNewHeightMap dialog
class CNewHeightMap : public CDialog
{
// Construction
public:
CNewHeightMap(TNewHeightInfo *hiP, const char *label, CWnd* pParent = NULL); // standard constructor
void GetHeightInfo(TNewHeightInfo *hiP) {*hiP = mHeightInfo; };
// Dialog Data
//{{AFX_DATA(CNewHeightMap)
enum { IDD = IDD_NewHeightMap };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CNewHeightMap)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
virtual void OnOK();
virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
//}}AFX_VIRTUAL
// Implementation
protected:
TNewHeightInfo mHeightInfo;
const char *m_label;
protected:
Bool doAnchorButton(Int buttonID);
protected:
// Generated message map functions
//{{AFX_MSG(CNewHeightMap)
virtual BOOL OnInitDialog();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_NEWHEIGHTMAP_H__239CD6A3_2919_11D5_8CE0_00010297BBAC__INCLUDED_)

View file

@ -0,0 +1,109 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
#if !defined(AFX_ObjectOptions_H__D3FF66C5_7107_4DAC_8A29_5EBAB5C3A24E__INCLUDED_)
#define AFX_ObjectOptions_H__D3FF66C5_7107_4DAC_8A29_5EBAB5C3A24E__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ObjectOptions.h : header file
//
#include "ObjectPreview.h"
#include "OptionsPanel.h"
#include "Common/AsciiString.h"
class WorldHeightMapEdit;
class MapObject;
/////////////////////////////////////////////////////////////////////////////
// ObjectOptions dialog
class ObjectOptions : public COptionsPanel
{
// Construction
public:
ObjectOptions(CWnd* pParent = NULL); ///< standard constructor
~ObjectOptions(void); ///< standard destructor
enum { NAME_MAX_LEN = 64 };
// Dialog Data
//{{AFX_DATA(ObjectOptions)
enum { IDD = IDD_OBJECT_OPTIONS };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(ObjectOptions)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
virtual void OnOK(){return;}; ///< Modeless dialogs don't OK, so eat this for modeless.
virtual void OnCancel(){return;}; ///< Modeless dialogs don't close on ESC, so eat this for modeless.
virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(ObjectOptions)
virtual BOOL OnInitDialog();
afx_msg void OnEditchangeOwningteam();
afx_msg void OnCloseupOwningteam();
afx_msg void OnSelchangeOwningteam();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
protected:
static ObjectOptions *m_staticThis;
static Bool m_updating;
static Int m_currentObjectIndex;
static char m_currentObjectName[NAME_MAX_LEN];
static AsciiString m_curOwnerName;
CTreeCtrl m_objectTreeView;
MapObject *m_objectsList;
ObjectPreview m_objectPreview;
protected:
void addObject( MapObject *mapObject, const char *pPath,
Int objectNdx, HTREEITEM parent );
HTREEITEM findOrAdd(HTREEITEM parent, const char *pLabel);
HTREEITEM findOrDont(const char *pLabel);
HTREEITEM _FindOrDont(const char* pLabel, HTREEITEM startPoint);
Bool setObjectTreeViewSelection(HTREEITEM parent, Int selection);
void updateLabel();
static MapObject *getCurMapObject(void);
public:
static const char * getCurObjectName(void) {return m_currentObjectName;};
static MapObject *duplicateCurMapObjectForPlace(const Coord3D* loc, Real angle, Bool checkPlayers = true);
static MapObject *getObjectNamed(AsciiString name);
static Int getObjectNamedIndex(const AsciiString& name);
static void selectObject(const MapObject* pObj);
static Real getCurObjectHeight(void);
static void update();
static AsciiString getCurGdfName(void);
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_ObjectOptions_H__D3FF66C5_711D_4DAC_8A29_5EAAB5C3A23E__INCLUDED_)

View file

@ -0,0 +1,76 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
#if !defined(AFX_OBJECTPREVIEW_H__2EC47AA6_06CA_43D1_9003_15472AE76CE7__INCLUDED_)
#define AFX_OBJECTPREVIEW_H__2EC47AA6_06CA_43D1_9003_15472AE76CE7__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ObjectPreview.h : header file
//
#include "lib/BaseType.h"
/////////////////////////////////////////////////////////////////////////////
// ObjectPreview window
class ThingTemplate;
class ObjectPreview : public CWnd
{
// Construction
public:
ObjectPreview();
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(ObjectPreview)
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~ObjectPreview();
void SetThingTemplate(const ThingTemplate *tTempl);
// Generated message map functions
protected:
//{{AFX_MSG(ObjectPreview)
afx_msg void OnPaint();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
protected:
void DrawMyTexture(CDC *pDc, int top, int left, Int width, Int height, UnsignedByte *rgbData);
const ThingTemplate *m_tTempl;
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_OBJECTPREVIEW_H__2EC47AA6_06CA_43D1_9003_15472AE76CE7__INCLUDED_)

View file

@ -0,0 +1,58 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
// ObjectTool.h
// Texture tiling tools for worldbuilder.
// Author: John Ahlquist, April 2001
#pragma once
#ifndef OBJECTTOOL_H
#define OBJECTTOOL_H
#include "Tool.h"
class WorldHeightMapEdit;
/*************************************************************************/
/** ObjectTool
Does the BlendEdgesOut tool operation.
***************************************************************************/
/// Blend edges out tool.
class ObjectTool : public Tool
{
protected:
CPoint m_downPt2d;
Coord3D m_downPt3d;
public:
ObjectTool(void);
~ObjectTool(void);
public:
static Real calcAngle(Coord3D downPt, Coord3D curPt, WbView* pView);
public:
/// Perform tool on mouse down.
virtual void mouseDown(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
virtual void mouseUp(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
virtual void mouseMoved(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
virtual void activate(); ///< Become the current tool.
virtual void deactivate(); ///< Become not the current tool.
};
#endif //TOOL_H

View file

@ -0,0 +1,80 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
#if !defined(AFX_OPENMAP_H__D3FD3B43_B0B7_42F6_BB77_2380A8B9945B__INCLUDED_)
#define AFX_OPENMAP_H__D3FD3B43_B0B7_42F6_BB77_2380A8B9945B__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// OpenMap.h : header file
//
#define MAP_OPENSAVE_PANEL_SECTION "MapOpenSavePanel"
typedef struct {
CString filename;
Bool browse;
} TOpenMapInfo;
/////////////////////////////////////////////////////////////////////////////
// OpenMap dialog
class OpenMap : public CDialog
{
// Construction
public:
OpenMap(TOpenMapInfo *pInfo, CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(OpenMap)
enum { IDD = IDD_OPEN_MAP };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(OpenMap)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
TOpenMapInfo *m_pInfo;
void populateMapListbox( Bool systemMaps );
Bool m_usingSystemDir;
protected:
// Generated message map functions
//{{AFX_MSG(OpenMap)
afx_msg void OnBrowse();
afx_msg void OnSystemMaps();
afx_msg void OnUserMaps();
virtual void OnOK();
virtual BOOL OnInitDialog();
afx_msg void OnDblclkOpenList();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_OPENMAP_H__D3FD3B43_B0B7_42F6_BB77_2380A8B9945B__INCLUDED_)

View file

@ -0,0 +1,72 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
#if !defined(AFX_OPTIONSPANEL_H__CB473165_D123_42D9_AE80_32F16928E3AE__INCLUDED_)
#define AFX_OPTIONSPANEL_H__CB473165_D123_42D9_AE80_32F16928E3AE__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// OptionsPanel.h : header file
//
#include "resource.h"
#define OPTIONS_PANEL_SECTION "OptionsWindow"
/////////////////////////////////////////////////////////////////////////////
// COptionsPanel dialog
class COptionsPanel : public CDialog
{
// Construction
public:
COptionsPanel(Int dlgid = 0, CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(COptionsPanel)
enum { IDD = IDD_NO_OPTIONS };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(COptionsPanel)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(COptionsPanel)
afx_msg void OnMove(int x, int y);
afx_msg void OnEditRedo();
afx_msg void OnUpdateEditRedo(CCmdUI* pCmdUI);
afx_msg void OnEditUndo();
afx_msg void OnUpdateEditUndo(CCmdUI* pCmdUI);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_OPTIONSPANEL_H__CB473165_D123_42D9_AE80_32F16928E3AE__INCLUDED_)

View file

@ -0,0 +1,116 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
#if !defined(AFX_PICKUNITDIALOG_H__B4C16E7D_FEED_472B_95FC_496D4C9006F5__INCLUDED_)
#define AFX_PICKUNITDIALOG_H__B4C16E7D_FEED_472B_95FC_496D4C9006F5__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// PickUnitDialog.h : header file
//
#include "Common/AsciiString.h"
#include "Common/ThingSort.h"
#define BUILD_PICK_PANEL_SECTION "PickUnitWindow"
class MapObject;
class ThingTemplate;
/////////////////////////////////////////////////////////////////////////////
// PickUnitDialog dialog
class PickUnitDialog : public CDialog
{
protected:
enum { NAME_MAX_LEN = 64 };
void addObject( MapObject *mapObject, const char *pPath, Int index, HTREEITEM parent );
HTREEITEM findOrAdd(HTREEITEM parent, const char *pLabel);
Int m_currentObjectIndex;
char m_currentObjectName[NAME_MAX_LEN];
CTreeCtrl m_objectTreeView;
MapObject *m_objectsList;
Bool m_allowable[ES_NUM_SORTING_TYPES];
Bool m_factionOnly;
// Construction
public:
PickUnitDialog(CWnd* pParent = NULL); // standard constructor
PickUnitDialog(UINT id, CWnd* pParent = NULL); // standard constructor
~PickUnitDialog(void); ///< standard destructor
// Dialog Data
//{{AFX_DATA(PickUnitDialog)
enum { IDD = IDD_PICKUNIT };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(PickUnitDialog)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(PickUnitDialog)
virtual BOOL OnInitDialog();
afx_msg void OnMove(int x, int y);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
public:
AsciiString getPickedUnit(void);
Bool IsAllowableType(EditorSortingType sort, Bool isBuildable);
void SetAllowableType(EditorSortingType sort);
const ThingTemplate* getPickedThing(void);
void SetFactionOnly(Bool faction) {m_factionOnly = faction;}
void SetupAsPanel(void);
};
class ReplaceUnitDialog : public PickUnitDialog
{
public:
ReplaceUnitDialog(CWnd* pParent = NULL); // standard constructor
void setMissing(AsciiString name) {m_missingName = name;};
protected:
// Generated message map functions
//{{AFX_MSG(ReplaceUnitDialog)
virtual BOOL OnInitDialog();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
AsciiString m_missingName;
enum { IDD = IDD_REPLACEUNIT };
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_PICKUNITDIALOG_H__B4C16E7D_FEED_472B_95FC_496D4C9006F5__INCLUDED_)

View file

@ -0,0 +1,82 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
// PointerTool.h
// Texture tiling tools for worldbuilder.
// Author: John Ahlquist, April 2001
#pragma once
#ifndef POINTER_TOOL_H
#define POINTER_TOOL_H
#include "PolygonTool.h"
class WorldHeightMapEdit;
#include "../../gameengine/include/common/MapObject.h"
class ModifyObjectUndoable;
/*************************************************************************/
/** PointerTool
Does the select/move tool operation.
***************************************************************************/
/// Blend edges out tool.
class PointerTool : public PolygonTool
{
protected:
enum {HYSTERESIS = 3};
CPoint m_downPt2d;
Coord3D m_downPt3d;
MapObject *m_curObject;
Bool m_moving; ///< True if we are drag moving an object.
Bool m_rotating; ///< True if we are rotating an object.
Bool m_dragSelect; ///< True if we are drag selecting.
Bool m_doPolyTool; ///< True if we are using the polygon tool to modify a polygon triggter.
ModifyObjectUndoable *m_modifyUndoable; ///< The modify undoable that is in progress while we track the mouse.
Bool m_mouseUpRotate;///< True if we are over the "rotate" hotspot.
HCURSOR m_rotateCursor;
Bool m_mouseUpMove;///< True if we are over the "move" hotspot.
HCURSOR m_moveCursor;
protected:
void checkForPropertiesPanel(void);
public:
PointerTool(void);
~PointerTool(void);
public:
/// Clear the selection on activate or deactivate.
virtual void activate();
virtual void deactivate();
virtual void setCursor(void);
virtual void mouseDown(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
virtual void mouseMoved(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
virtual void mouseUp(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
public:
static void clearSelection(void); ///< Clears the selected objects selected flags.
static Bool allowPick(MapObject* pMapObj, WbView* pView);
};
#endif //POINTER_TOOL_H

View file

@ -0,0 +1,90 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
// PolygonTool.h
// Polygon area trigger tool for worldbuilder.
// Author: John Ahlquist, Nov. 2001
#pragma once
#ifndef POLYGONTOOL_H
#define POLYGONTOOL_H
#include "Tool.h"
class WorldHeightMapEdit;
class MapObject;
class PolygonTrigger;
class MovePolygonUndoable;
/*************************************************************************/
/** PolygonTool
Does the add/select polygon operation.
***************************************************************************/
/// Select tile tool.
class PolygonTool : public Tool
{
public:
PolygonTool(void);
~PolygonTool(void);
protected:
Coord3D m_poly_mouseDownPt;
Coord3D m_poly_unsnappedMouseDownPt;
Bool m_poly_isDraggingPoint;
Bool m_poly_justPicked;
Bool m_poly_mouseUpPlus;///< True if we are over the "Add point" hotspot.
HCURSOR m_poly_plusCursor;
Bool m_poly_mouseUpMove;///< True if we are over the "move" hotspot.
HCURSOR m_poly_moveCursor;
MovePolygonUndoable *m_poly_moveUndoable;
static Bool m_poly_isAdding;
static Int m_poly_dragPointNdx;
static Bool m_poly_isActive;
static PolygonTrigger *m_poly_curSelectedPolygon;
protected:
static Int poly_pickPoint(PolygonTrigger *pTrig, CPoint viewPt, WbView* pView);
static Int poly_getInsertIndex(PolygonTrigger *pTrig, Coord3D loc);
Bool poly_snapToPoly(Coord3D *pLoc);
static Bool poly_pickPoly(PolygonTrigger *pTrig, Coord3D pLoc, Int tolerance);
void poly_pickOnMouseDown(CPoint viewPt, WbView* pView);
void startMouseDown(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
public:
static Bool isActive(void) {return m_poly_isActive;};
static Bool deleteSelectedPolygon(void);
static Bool isSelected(PolygonTrigger *pTrig) {return (pTrig && (pTrig==m_poly_curSelectedPolygon));};
static Int getSelectedPointNdx(void) {return m_poly_dragPointNdx;};
static PolygonTrigger *pickPolygon(Coord3D loc, CPoint viewPt, WbView* pView);
static Bool isSelectedOpen(void) {return m_poly_isAdding;};
public:
/// Perform tool on mouse down.
virtual void mouseDown(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
virtual void mouseMoved(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
virtual void mouseUp(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
virtual void setCursor(void);
virtual void activate(); ///< Become the current tool.
virtual void deactivate(); ///< Become not the current tool.
};
#endif //POLYGONTOOL_H

View file

@ -0,0 +1,66 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
// FILE: RampOptions.h
/*---------------------------------------------------------------------------*/
/* EA Pacific */
/* Confidential Information */
/* Copyright (C) 2001 - All Rights Reserved */
/* DO NOT DISTRIBUTE */
/*---------------------------------------------------------------------------*/
/* Project: RTS3 */
/* File name: RampOptions.h */
/* Created: John K. McDonald, Jr., 4/23/2002 */
/* Desc: // Apply button for ramps. */
/* Revision History: */
/* 4/23/2002 : Initial creation */
/*---------------------------------------------------------------------------*/
#pragma once
#ifndef _H_RAMPOPTIONS_
#define _H_RAMPOPTIONS_
// INCLUDES ///////////////////////////////////////////////////////////////////
#include "OptionsPanel.h"
#include "Resource.h"
// DEFINES ////////////////////////////////////////////////////////////////////
// TYPE DEFINES ///////////////////////////////////////////////////////////////
// FORWARD DECLARATIONS ///////////////////////////////////////////////////////
class RampOptions : public COptionsPanel
{
Bool m_shouldApplyTheRamp;
Real m_rampWidth;
public:
enum { IDD = IDD_RAMP_OPTIONS };
RampOptions(CWnd* pParent = NULL);
virtual ~RampOptions();
Bool shouldApplyTheRamp();
Real getRampWidth() { return m_rampWidth; }
afx_msg void OnApply();
afx_msg void OnWidthChange();
DECLARE_MESSAGE_MAP()
};
extern RampOptions* TheRampOptions;
#endif /* _H_RAMPOPTIONS_ */

View file

@ -0,0 +1,69 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
// FILE: RampTool.h
/*---------------------------------------------------------------------------*/
/* EA Pacific */
/* Confidential Information */
/* Copyright (C) 2001 - All Rights Reserved */
/* DO NOT DISTRIBUTE */
/*---------------------------------------------------------------------------*/
/* Project: RTS3 */
/* File name: RampTool.h */
/* Created: John K. McDonald, Jr., 4/19/2002 */
/* Desc: // The ramp tool for the developers. */
/* Revision History: */
/* 4/19/2002 : Initial creation */
/*---------------------------------------------------------------------------*/
#pragma once
#ifndef _H_RAMPTOOL_
#define _H_RAMPTOOL_
// INCLUDES ///////////////////////////////////////////////////////////////////
#include "Tool.h"
// DEFINES ////////////////////////////////////////////////////////////////////
// TYPE DEFINES ///////////////////////////////////////////////////////////////
// FORWARD DECLARATIONS ///////////////////////////////////////////////////////
class RampTool : public Tool
{
Coord3D mStartPoint;
Coord3D mEndPoint;
Coord3D mCurvePoint;
Bool mIsMouseDown;
public:
RampTool();
virtual void activate();
virtual void deactivate(); ///< Become not the current tool.
virtual Bool followsTerrain(void);
virtual void mouseMoved(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
virtual void mouseDown(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
virtual void mouseUp(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
protected:
void drawFeedback(Coord3D* endPoint);
void applyRamp(CWorldBuilderDoc* pDoc);
};
#endif /* _H_RAMPTOOL_ */

View file

@ -0,0 +1,111 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
#if !defined(AFX_RoadOptions_H__D3FF66C5_7107_4DAC_8A29_5EBAB5C3A24E__INCLUDED_)
#define AFX_RoadOptions_H__D3FF66C5_7107_4DAC_8A29_5EBAB5C3A24E__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// RoadOptions.h : header file
//
#include "TerrainSwatches.h"
#include "OptionsPanel.h"
#include "Common/AsciiString.h"
class WorldHeightMapEdit;
/////////////////////////////////////////////////////////////////////////////
// RoadOptions dialog
class RoadOptions : public COptionsPanel
{
// Construction
public:
RoadOptions(CWnd* pParent = NULL); ///< standard constructor
~RoadOptions(void); ///< standard destructor
enum { NAME_MAX_LEN = 64 };
// Dialog Data
//{{AFX_DATA(RoadOptions)
enum { IDD = IDD_ROAD_OPTIONS };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(RoadOptions)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
virtual void OnOK(){return;}; ///< Modeless dialogs don't OK, so eat this for modeless.
virtual void OnCancel(){return;}; ///< Modeless dialogs don't close on ESC, so eat this for modeless.
virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(RoadOptions)
virtual BOOL OnInitDialog();
afx_msg void OnTightCurve();
afx_msg void OnAngled();
afx_msg void OnBroadCurve();
afx_msg void OnJoin();
afx_msg void OnApplyRoad();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
protected:
static RoadOptions *m_staticThis;
static Bool m_updating;
static Int m_currentRoadIndex;
static Int m_numberOfRoads;
static Int m_numberOfBridges;
static AsciiString m_currentRoadName;
static Bool m_angleCorners;
static Bool m_tightCurve;
static Bool m_doJoin;
CTreeCtrl m_roadTreeView;
protected:
void addRoad(char *pPath, Int objectNdx, HTREEITEM parent);
HTREEITEM findOrAdd(HTREEITEM parent, char *pLabel);
Bool findAndSelect(HTREEITEM parent, AsciiString label);
Bool setRoadTreeViewSelection(HTREEITEM parent, Int selection);
void updateLabel(void);
void ChangeRoadType(AsciiString newRoad);
void SelectConnected(void);
public:
static AsciiString getCurRoadName(void) {return m_currentRoadName;}
static Bool isBridge(void) {return (m_currentRoadIndex >= m_numberOfRoads);}
static Bool isAngled(void) {return m_angleCorners;}
static Bool isTightCurve(void) {return m_tightCurve;}
static Bool isJoin(void) {return m_doJoin;}
static void updateSelection(void);
static Bool selectionIsRoadsOnly(void);
void applyToSelection(void);
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_RoadOptions_H__D3FF66C5_711D_4DAC_8A29_5EAAB5C3A23E__INCLUDED_)

View file

@ -0,0 +1,63 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
// RoadTool.h
// Texture tiling tools for worldbuilder.
// Author: John Ahlquist, June 2001
#pragma once
#ifndef RoadTool_H
#define RoadTool_H
#include "Tool.h"
#include "W3DDevice/GameClient/WorldHeightMap.h"
class WorldHeightMapEdit;
#define ROAD_SNAP_DISTANCE (1.0f)
/*************************************************************************/
/** RoadTool
Does the Add a section of road tool operation.
***************************************************************************/
/// Road segment tool.
class RoadTool : public Tool
{
protected:
enum {HYSTERESIS = 3,
MIN_LENGTH = 4};
MapObject *m_mapObj;
private:
MapObject* RoadTool::findSegment(const Coord3D *pLoc, Coord3D *outLoc);
public:
RoadTool(void);
~RoadTool(void);
public:
static Bool snap(Coord3D *pLoc, Bool skipLast);
public:
/// Perform tool on mouse down.
virtual void mouseDown(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
virtual void mouseMoved(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
virtual void mouseUp(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
virtual void activate(); ///< Become the current tool.
};
#endif //TOOL_H

View file

@ -0,0 +1,82 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
#if !defined(AFX_SAVEMAP_H__BCE93FF1_DA04_4F63_A483_D89BF1F49E32__INCLUDED_)
#define AFX_SAVEMAP_H__BCE93FF1_DA04_4F63_A483_D89BF1F49E32__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// SaveMap.h : header file
//
#define MAP_OPENSAVE_PANEL_SECTION "MapOpenSavePanel"
typedef struct {
CString filename;
Bool browse;
Bool usingSystemDir;
} TSaveMapInfo;
/////////////////////////////////////////////////////////////////////////////
// SaveMap dialog
class SaveMap : public CDialog
{
// Construction
public:
SaveMap(TSaveMapInfo *pInfo, CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(SaveMap)
enum { IDD = IDD_SAVE_MAP };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(SaveMap)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
TSaveMapInfo *m_pInfo;
void populateMapListbox( Bool systemMaps );
Bool m_usingSystemDir;
protected:
// Generated message map functions
//{{AFX_MSG(SaveMap)
virtual void OnOK();
virtual void OnCancel();
afx_msg void OnBrowse();
afx_msg void OnSystemMaps();
afx_msg void OnUserMaps();
afx_msg void OnSelchangeSaveList();
virtual BOOL OnInitDialog();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_SAVEMAP_H__BCE93FF1_DA04_4F63_A483_D89BF1F49E32__INCLUDED_)

View file

@ -0,0 +1,97 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
#if !defined(AFX_SCORCHOPTIONS_H__33FD4D9A_2C39_4494_A4EF_A20CEC76A95D__INCLUDED_)
#define AFX_SCORCHOPTIONS_H__33FD4D9A_2C39_4494_A4EF_A20CEC76A95D__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ScorchOptions.h : header file
//
#include "WBPopupSlider.h"
#include "OptionsPanel.h"
#include "Common/Dict.h"
#include "Common/GameType.h"
class MapObject;
/////////////////////////////////////////////////////////////////////////////
// ScorchOptions dialog
class ScorchOptions : public COptionsPanel, public PopupSliderOwner
{
// Construction
public:
ScorchOptions(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(ScorchOptions)
enum { IDD = IDD_SCORCH_OPTIONS };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(ScorchOptions)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
virtual void OnOK(){return;}; //!< Modeless dialogs don't OK, so eat this for modeless.
virtual void OnCancel(){return;}; //!< Modeless dialogs don't close on ESC, so eat this for modeless.
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(ScorchOptions)
virtual BOOL OnInitDialog();
afx_msg void OnChangeScorchtype();
afx_msg void OnChangeSizeEdit();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
static MapObject *getSingleSelectedScorch(void);
void updateTheUI(void);
WBPopupSliderButton m_radiusPopup;
std::vector<Dict*> m_allSelectedDicts;
Bool m_updating; ///<true if the ui is updating itself.
static Scorches m_scorchtype;
static Real m_scorchsize;
static ScorchOptions* m_staticThis;
void changeSize(void);
void changeScorch(void);
void getAllSelectedDicts(void);
public:
static void update(void);
static Scorches getScorchType(void) {return m_scorchtype;}
static Real getScorchSize(void) {return m_scorchsize;}
virtual void GetPopSliderInfo(const long sliderID, long *pMin, long *pMax, long *pLineSize, long *pInitial);
virtual void PopSliderChanged(const long sliderID, long theVal);
virtual void PopSliderFinished(const long sliderID, long theVal);
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_SCORCHOPTIONS_H__33FD4D9A_2C39_4494_A4EF_A20CEC76A95D__INCLUDED_)

View file

@ -0,0 +1,56 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
// ScorchTool.h
// Author: Dennis Griffin, April 2002
#pragma once
#ifndef SCORCHTOOL_H
#define SCORCHTOOL_H
#include "Tool.h"
class WorldHeightMapEdit;
class MapObject;
/*************************************************************************/
/** ScorchTool
***************************************************************************/
/// Scorch tool.
class ScorchTool : public Tool
{
public:
ScorchTool(void);
~ScorchTool(void);
protected:
Coord3D m_mouseDownPt;
protected:
MapObject *pickScorch(Coord3D loc);
public:
/// Perform tool on mouse down.
virtual void mouseDown(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
virtual void mouseMoved(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
virtual void mouseUp(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
virtual void activate(); ///< Become the current tool.
virtual void deactivate(); ///< Become not the current tool.
};
#endif //SCORCHTOOL_H

View file

@ -0,0 +1,92 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
#if !defined(AFX_SCRIPTACTIONSFALSE_H__227F217F_458B_4020_B6E9_6EB25E228FD5__INCLUDED_)
#define AFX_SCRIPTACTIONSFALSE_H__227F217F_458B_4020_B6E9_6EB25E228FD5__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ScriptActionsFalse.h : header file
//
class Script;
class ScriptAction;
class SidesList;
/////////////////////////////////////////////////////////////////////////////
// ScriptActionsFalse dialog
class ScriptActionsFalse : public CPropertyPage
{
DECLARE_DYNCREATE(ScriptActionsFalse)
// Construction
public:
ScriptActionsFalse();
~ScriptActionsFalse();
// Dialog Data
//{{AFX_DATA(ScriptActionsFalse)
enum { IDD = IDD_ScriptActionsFalse };
// NOTE - ClassWizard will add data members here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_DATA
// Overrides
// ClassWizard generate virtual function overrides
//{{AFX_VIRTUAL(ScriptActionsFalse)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
public:
void setScript(Script *pScript) {m_script = pScript;}
protected:
Script *m_script; // Doesn't change.
ScriptAction *m_falseAction; // Currently selected action.
Int m_index; // Index of whatever is currently selected.
protected:
void enableUI(void);
void loadList(void);
Bool doMoveDown(void);
protected:
// Generated message map functions
//{{AFX_MSG(ScriptActionsFalse)
virtual BOOL OnInitDialog();
afx_msg void OnEditAction();
afx_msg void OnSelchangeActionList();
afx_msg void OnDblclkActionList();
afx_msg void OnNew();
afx_msg void OnDelete();
afx_msg void OnCopy();
afx_msg void OnMoveDown();
afx_msg void OnMoveUp();
afx_msg void OnChangeEditComment();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_SCRIPTACTIONSFALSE_H__227F217F_458B_4020_B6E9_6EB25E228FD5__INCLUDED_)

View file

@ -0,0 +1,92 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
#if !defined(AFX_SCRIPTACTIONSTRUE_H__D8CAEC29_8B71_461C_B1B8_DF55624330AA__INCLUDED_)
#define AFX_SCRIPTACTIONSTRUE_H__D8CAEC29_8B71_461C_B1B8_DF55624330AA__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ScriptActionsTrue.h : header file
//
class Script;
class ScriptAction;
class SidesList;
/////////////////////////////////////////////////////////////////////////////
// ScriptActionsTrue dialog
class ScriptActionsTrue : public CPropertyPage
{
DECLARE_DYNCREATE(ScriptActionsTrue)
// Construction
public:
ScriptActionsTrue();
~ScriptActionsTrue();
// Dialog Data
//{{AFX_DATA(ScriptActionsTrue)
enum { IDD = IDD_ScriptActionsTrue };
// NOTE - ClassWizard will add data members here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_DATA
// Overrides
// ClassWizard generate virtual function overrides
//{{AFX_VIRTUAL(ScriptActionsTrue)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
public:
void setScript(Script *pScript) {m_script = pScript;}
protected:
Script *m_script; // Doesn't change.
ScriptAction *m_action; // Currently selected action.
Int m_index; // Index of whatever is currently selected.
protected:
void enableUI(void);
void loadList(void);
Bool doMoveDown(void);
protected:
// Generated message map functions
//{{AFX_MSG(ScriptActionsTrue)
virtual BOOL OnInitDialog();
afx_msg void OnEditAction();
afx_msg void OnSelchangeActionList();
afx_msg void OnDblclkActionList();
afx_msg void OnNew();
afx_msg void OnDelete();
afx_msg void OnCopy();
afx_msg void OnMoveDown();
afx_msg void OnMoveUp();
afx_msg void OnChangeEditComment();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_SCRIPTACTIONSTRUE_H__D8CAEC29_8B71_461C_B1B8_DF55624330AA__INCLUDED_)

View file

@ -0,0 +1,97 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
#if !defined(AFX_ScriptConditionsDlg_H__EEFDFF65_2440_4AFE_B5D6_9E887C8C2DED__INCLUDED_)
#define AFX_ScriptConditionsDlg_H__EEFDFF65_2440_4AFE_B5D6_9E887C8C2DED__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ScriptConditionsDlg.h : header file
//
class Script;
class OrCondition;
class Condition;
class SidesList;
/////////////////////////////////////////////////////////////////////////////
// ScriptConditionsDlg dialog
class ScriptConditionsDlg : public CPropertyPage
{
DECLARE_DYNCREATE(ScriptConditionsDlg)
// Construction
public:
ScriptConditionsDlg();
~ScriptConditionsDlg();
// Dialog Data
//{{AFX_DATA(ScriptConditionsDlg)
enum { IDD = IDD_ScriptConditions };
// NOTE - ClassWizard will add data members here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_DATA
// Overrides
// ClassWizard generate virtual function overrides
//{{AFX_VIRTUAL(ScriptConditionsDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
public:
void setScript(Script *pScript) {m_script = pScript;}
protected:
Script *m_script; // Doesn't change.
OrCondition *m_orCondition; // Currently selected OR clause.
Condition *m_condition; // Currently selected condition.
Int m_index; // Index of whatever is currently selected.
protected:
void enableUI(void);
void loadList(void);
Int doMoveUp( OrCondition **outWhichNow );
Int doMoveDown( OrCondition **outWhichNow );
void setSel(OrCondition *pOr, Condition *pCond);
protected:
// Generated message map functions
//{{AFX_MSG(ScriptConditionsDlg)
virtual BOOL OnInitDialog();
afx_msg void OnEditCondition();
afx_msg void OnSelchangeConditionList();
afx_msg void OnDblclkConditionList();
afx_msg void OnOr();
afx_msg void OnNew();
afx_msg void OnDelete();
afx_msg void OnCopy();
afx_msg void OnMoveDown();
afx_msg void OnMoveUp();
afx_msg void OnChangeEditComment();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_ScriptConditionsDlg_H__EEFDFF65_2440_4AFE_B5D6_9E887C8C2DED__INCLUDED_)

View file

@ -0,0 +1,162 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
#if !defined(AFX_SCRIPTDIALOG_H__885FEF28_85F9_4556_9908_1BEC0B6E4C62__INCLUDED_)
#define AFX_SCRIPTDIALOG_H__885FEF28_85F9_4556_9908_1BEC0B6E4C62__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ScriptDialog.h : header file
//
#include "GameLogic/SidesList.h"
class ListType {
public:
enum {BOGUS_TYPE = 0, PLAYER_TYPE = 1, GROUP_TYPE, SCRIPT_IN_PLAYER_TYPE, SCRIPT_IN_GROUP_TYPE};
unsigned char m_objType; // 4 bits
unsigned char m_playerIndex; // 4 bits
unsigned short int m_groupIndex; // 12 bits
unsigned short int m_scriptIndex; // 12 bits
ListType(void) {m_objType=BOGUS_TYPE;m_playerIndex=0;m_groupIndex = 0; m_scriptIndex=0;}
Int ListToInt(void) { return((m_objType<<28)+(m_playerIndex<<24)+(m_groupIndex<<12)+m_scriptIndex);}
void IntToList(int i) {m_objType = ((i)>>28)&0x0F; m_playerIndex = ((i)>>24)&0x0F; m_groupIndex = ((i)>>12)&0x0FFF; m_scriptIndex = (i)&0x0FFF;}
};
class ScriptList;
class ScriptGroup;
class Script;
class Parameter;
/** Class Definition for overridden Tree control that
supports Right-click context sensitive menu.*/
class CSDTreeCtrl : public CTreeCtrl
{
public:
protected:
virtual void OnRButtonDown(UINT nFlags, CPoint point);
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
// ScriptDialog dialog
class ScriptDialog : public CDialog
{
// Construction
public:
ScriptDialog(CWnd* pParent = NULL); // standard constructor
~ScriptDialog(); // destructor
// Dialog Data
//{{AFX_DATA(ScriptDialog)
enum { IDD = IDD_ScriptDialog };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(ScriptDialog)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
public:
static void updateWarnings(void);
static void updateScriptWarning(Script *pScript);
/// To allow CSDTreeCtrl access to these member functions of ScriptDialog
Script *friend_getCurScript(void);
ScriptGroup *friend_getCurGroup(void);
protected:
ListType m_curSelection;
CImageList m_imageList;
SidesList m_sides;
static ScriptDialog *m_staticThis;
CSDTreeCtrl *mTree;
Bool m_draggingTreeView;
HTREEITEM m_dragItem;
MapObject *m_firstReadObject;
PolygonTrigger *m_firstTrigger;
Int m_waypointBase;
Int m_maxWaypoint;
AsciiString m_readPlayerNames[MAX_PLAYER_COUNT];
protected:
HTREEITEM addPlayer(Int playerIndx);
void addScriptList(HTREEITEM hPlayer, Int playerIndex, ScriptList *pSL);
void doDropOn(HTREEITEM hDrop, HTREEITEM hTarget);
Script *getCurScript(void);
ScriptGroup *getCurGroup(void);
void reloadPlayer(Int playerIndex, ScriptList *pSL);
HTREEITEM findItem(ListType sel, Bool failSafe = FALSE);
void insertScript(Script *pNewScript);
void scanForWaypointsAndTeams(Script *pScript, Bool doUnits, Bool doWaypoints, Bool doTriggers);
void scanParmForWaypointsAndTeams(Parameter *pParm, Bool doUnits, Bool doWaypoints, Bool doTriggers);
void updateSelection(ListType sel);
void setIconScript(HTREEITEM item);
void setIconGroup(HTREEITEM item);
Bool updateIcons(HTREEITEM hItem);
void markWaypoint(MapObject *pObj);
static Bool ParseObjectsDataChunk(DataChunkInput &file, DataChunkInfo *info, void *userData);
static Bool ParseObjectDataChunk(DataChunkInput &file, DataChunkInfo *info, void *userData);
static Bool ParsePolygonTriggersDataChunk(DataChunkInput &file, DataChunkInfo *info, void *userData);
static Bool ParseWaypointDataChunk(DataChunkInput &file, DataChunkInfo *info, void *userData);
static Bool ParseTeamsDataChunk(DataChunkInput &file, DataChunkInfo *info, void *userData);
static Bool ParsePlayersDataChunk(DataChunkInput &file, DataChunkInfo *info, void *userData);
protected:
// Generated message map functions
//{{AFX_MSG(ScriptDialog)
afx_msg void OnSelchangedScriptTree(NMHDR* pNMHDR, LRESULT* pResult);
virtual BOOL OnInitDialog();
afx_msg void OnNewFolder();
afx_msg void OnNewScript();
afx_msg void OnEditScript();
afx_msg void OnCopyScript();
afx_msg void OnDelete();
afx_msg void OnSave();
afx_msg void OnLoad();
afx_msg void OnDblclkScriptTree(NMHDR* pNMHDR, LRESULT* pResult);
virtual void OnOK();
virtual void OnCancel();
afx_msg void OnBegindragScriptTree(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnScriptActivate();
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
afx_msg void OnMove(int x, int y);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_SCRIPTDIALOG_H__885FEF28_85F9_4556_9908_1BEC0B6E4C62__INCLUDED_)

View file

@ -0,0 +1,89 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
#if !defined(AFX_SCRIPTPROPERTIES_H__CE62125B_9FAB_4EF0_A8B5_36DD5393A2B0__INCLUDED_)
#define AFX_SCRIPTPROPERTIES_H__CE62125B_9FAB_4EF0_A8B5_36DD5393A2B0__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ScriptProperties.h : header file
//
class Script;
/////////////////////////////////////////////////////////////////////////////
// ScriptProperties dialog
class ScriptProperties : public CPropertyPage
{
DECLARE_DYNCREATE(ScriptProperties)
// Construction
public:
ScriptProperties();
~ScriptProperties();
// Dialog Data
//{{AFX_DATA(ScriptProperties)
enum { IDD = IDD_ScriptProperties };
// NOTE - ClassWizard will add data members here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_DATA
// Overrides
// ClassWizard generate virtual function overrides
//{{AFX_VIRTUAL(ScriptProperties)
public:
virtual BOOL OnSetActive();
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
public:
void setScript(Script *pScript) {m_script = pScript;}
protected:
void enableControls(void);
protected:
Script *m_script;
Bool m_updating;
protected:
// Generated message map functions
//{{AFX_MSG(ScriptProperties)
afx_msg void OnChangeScriptComment();
afx_msg void OnChangeScriptName();
afx_msg void OnScriptActive();
afx_msg void OnOneShot();
afx_msg void OnEasy();
afx_msg void OnHard();
afx_msg void OnNormal();
afx_msg void OnScriptSubroutine();
afx_msg void OnEveryFrame();
afx_msg void OnEverySecond();
afx_msg void OnChangeSecondsEdit();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_SCRIPTPROPERTIES_H__CE62125B_9FAB_4EF0_A8B5_36DD5393A2B0__INCLUDED_)

View file

@ -0,0 +1,69 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
#if !defined(AFX_SELECTMACROTEXTURE_H__0AB61BFA_3A67_40CB_A38F_7067F6BA352B__INCLUDED_)
#define AFX_SELECTMACROTEXTURE_H__0AB61BFA_3A67_40CB_A38F_7067F6BA352B__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// SelectMacrotexture.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// SelectMacrotexture dialog
class SelectMacrotexture : public CDialog
{
// Construction
public:
SelectMacrotexture(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(SelectMacrotexture)
enum { IDD = IDD_MACRO_TEXTURE };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(SelectMacrotexture)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
//}}AFX_VIRTUAL
protected:
CTreeCtrl m_textureTreeView;
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(SelectMacrotexture)
virtual BOOL OnInitDialog();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_SELECTMACROTEXTURE_H__0AB61BFA_3A67_40CB_A38F_7067F6BA352B__INCLUDED_)

View file

@ -0,0 +1,75 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
#if !defined(AFX_SHADOWOPTIONS_H__25CB23E2_9E42_44D4_BE83_4B89F87746DE__INCLUDED_)
#define AFX_SHADOWOPTIONS_H__25CB23E2_9E42_44D4_BE83_4B89F87746DE__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ShadowOptions.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// ShadowOptions dialog
class ShadowOptions : public CDialog
{
// Construction
public:
ShadowOptions(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(ShadowOptions)
enum { IDD = IDD_SHADOW_OPTIONS };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(ShadowOptions)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
Real m_red;
Real m_green;
Real m_blue;
Real m_intensity;
protected:
void setShadowColor(void);
// Generated message map functions
//{{AFX_MSG(ShadowOptions)
afx_msg void OnChangeAlphaEdit();
afx_msg void OnChangeBaEdit();
afx_msg void OnChangeGaEdit();
afx_msg void OnChangeRaEdit();
virtual BOOL OnInitDialog();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_SHADOWOPTIONS_H__25CB23E2_9E42_44D4_BE83_4B89F87746DE__INCLUDED_)

View file

@ -0,0 +1,44 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
#pragma once
#ifndef __SPLASHSCREEN_H__
#define __SPLASHSCREEN_H__
class SplashScreen : public CDialog
{
protected:
CRect m_rect;
CString m_loadString;
CFont m_font;
public:
SplashScreen();
public:
void setTextOutputLocation(const CRect& rect);
void outputText(UINT nIDString);
protected:
afx_msg void OnPaint();
DECLARE_MESSAGE_MAP()
};
#endif /* __SPLASHSCREEN_H__ */

View file

@ -0,0 +1,50 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#if !defined(AFX_STDAFX_H__FBA41347_2826_11D5_8CE0_00010297BBAC__INCLUDED_)
#define AFX_STDAFX_H__FBA41347_2826_11D5_8CE0_00010297BBAC__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
// To prevent pragma errors.
#include "lib/Basetype.h"
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_STDAFX_H__FBA41347_2826_11D5_8CE0_00010297BBAC__INCLUDED_)

View file

@ -0,0 +1,84 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
#if !defined(AFX_TEAMBEHAVIOR_H__40A707E0_08CB_4544_9FF1_AF0DACAB02A6__INCLUDED_)
#define AFX_TEAMBEHAVIOR_H__40A707E0_08CB_4544_9FF1_AF0DACAB02A6__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// TeamBehavior.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// TeamBehavior dialog
class TeamBehavior : public CPropertyPage
{
// Construction
public:
TeamBehavior(); // standard constructor
// Dialog Data
//{{AFX_DATA(TeamBehavior)
enum { IDD = IDD_TeamBehavior };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(TeamBehavior)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
Dict *m_teamDict;
protected:
void setupScript(NameKeyType keyScript, int idcScript);
void updateScript(NameKeyType keyScript, int idcScript);
public:
void setTeamDict(Dict *pDict) {m_teamDict = pDict;};
protected:
// Generated message map functions
//{{AFX_MSG(TeamBehavior)
afx_msg void OnSelchangeOnCreateScript();
virtual BOOL OnInitDialog();
afx_msg void OnTransportsReturn();
afx_msg void OnAvoidThreats();
afx_msg void OnSelchangeOnEnemySighted();
afx_msg void OnSelchangeOnDestroyed();
afx_msg void OnSelchangeOnUnitDestroyed();
afx_msg void OnPerimeterDefense();
afx_msg void OnBaseDefense();
afx_msg void OnChangePercentDestroyed();
afx_msg void OnSelchangeEnemyInteractions();
afx_msg void OnSelchangeOnAllClear();
afx_msg void OnSelchangeOnIdleScript();
afx_msg void OnAttackCommonTarget();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_TEAMBEHAVIOR_H__40A707E0_08CB_4544_9FF1_AF0DACAB02A6__INCLUDED_)

View file

@ -0,0 +1,52 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
#pragma once
#ifndef __TEAMGENERIC_H__
#define __TEAMGENERIC_H__
class Dict;
class TeamGeneric : public CPropertyPage
{
public:
TeamGeneric(); // standard constructor
// Dialog Data
//{{AFX_DATA(TeamGeneric)
enum { IDD = IDD_TeamGeneric };
//}}AFX_DATA
void setTeamDict(Dict *dict) { m_teamDict = dict; }
protected:
void _fillComboBoxesWithScripts();
void _dictToScripts();
protected:
Dict *m_teamDict;
protected: // Windows Functions
virtual BOOL OnInitDialog();
afx_msg void _scriptsToDict();
afx_msg void OnScriptAdjust();
DECLARE_MESSAGE_MAP()
};
#endif

View file

@ -0,0 +1,102 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
#if !defined(AFX_TEAMIDENTITY_H__B37DB2FD_297F_4D0E_AACD_193BE30C6C85__INCLUDED_)
#define AFX_TEAMIDENTITY_H__B37DB2FD_297F_4D0E_AACD_193BE30C6C85__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// TeamIdentity.h : header file
//
class Dict;
class SidesList;
/////////////////////////////////////////////////////////////////////////////
// TeamIdentity dialog
class TeamIdentity : public CPropertyPage
{
// Construction
public:
TeamIdentity(); // standard constructor
// Dialog Data
//{{AFX_DATA(TeamIdentity)
enum { IDD = IDD_TeamIdentity };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(TeamIdentity)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
//}}AFX_VIRTUAL
protected:
Dict *m_teamDict;
SidesList *m_sides;
protected:
void loadUnitsInfo(int idcMinUnit, NameKeyType keyMinUnit,
int idcMaxUnit, NameKeyType keyMaxUnit,
int idcUnitType, NameKeyType keyUnitType);
void OnUnitTypeButton(Int idcUnitType);
public:
void setTeamDict(Dict *pDict) {m_teamDict = pDict;};
void setSidesList(SidesList *pSides) {m_sides = pSides;};
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(TeamIdentity)
virtual BOOL OnInitDialog();
afx_msg void OnAiRecruitable();
afx_msg void OnAutoReinforce();
afx_msg void OnBaseDefense();
afx_msg void OnChangeDescription();
afx_msg void OnChangeMax();
afx_msg void OnChangePriorityDecrease();
afx_msg void OnChangePriorityIncrease();
afx_msg void OnSelchangeProductionCondition();
afx_msg void OnChangeProductionPriority();
afx_msg void OnSelchangeHomeWaypoint();
afx_msg void OnUnitType1Button();
afx_msg void OnUnitType2Button();
afx_msg void OnUnitType3Button();
afx_msg void OnUnitType4Button();
afx_msg void OnUnitType5Button();
afx_msg void OnUnitType6Button();
afx_msg void OnUnitType7Button();
afx_msg void OnExecuteActions();
afx_msg void OnChangeTeamName();
afx_msg void OnTeamSingleton();
afx_msg void OnKillfocusTeamName();
afx_msg void OnSelendokTeamowner();
afx_msg void OnChangeTeamBuildFrames();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_TEAMIDENTITY_H__B37DB2FD_297F_4D0E_AACD_193BE30C6C85__INCLUDED_)

View file

@ -0,0 +1,74 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
#if !defined(AFX_TEAMREINFORCEMENT_H__29B5C0C7_10E8_4869_8B43_815422C51C24__INCLUDED_)
#define AFX_TEAMREINFORCEMENT_H__29B5C0C7_10E8_4869_8B43_815422C51C24__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// TeamReinforcement.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// TeamReinforcement dialog
class TeamReinforcement : public CPropertyPage
{
// Construction
public:
TeamReinforcement(); // standard constructor
// Dialog Data
//{{AFX_DATA(TeamReinforcement)
enum { IDD = IDD_TeamReinforcement };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(TeamReinforcement)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
Dict *m_teamDict;
public:
void setTeamDict(Dict *pDict) {m_teamDict = pDict;};
protected:
// Generated message map functions
//{{AFX_MSG(TeamReinforcement)
afx_msg void OnDeployBy();
afx_msg void OnTeamStartsFull();
afx_msg void OnSelchangeTransportCombo();
afx_msg void OnTransportsExit();
afx_msg void OnSelchangeVeterancy();
afx_msg void OnSelchangeWaypointCombo();
virtual BOOL OnInitDialog();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_TEAMREINFORCEMENT_H__29B5C0C7_10E8_4869_8B43_815422C51C24__INCLUDED_)

View file

@ -0,0 +1,117 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
#if !defined(AFX_TERRAINMATERIAL_H__D3FF66C5_711D_4DAC_8A29_5EAAB5C3A23E__INCLUDED_)
#define AFX_TERRAINMATERIAL_H__D3FF66C5_711D_4DAC_8A29_5EAAB5C3A23E__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// terrainmaterial.h : header file
//
#include "WBPopupSlider.h"
#include "TerrainSwatches.h"
#include "OptionsPanel.h"
class WorldHeightMapEdit;
/////////////////////////////////////////////////////////////////////////////
// TerrainMaterial dialog
class TerrainMaterial : public COptionsPanel, public PopupSliderOwner
{
// Construction
public:
TerrainMaterial(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(TerrainMaterial)
enum { IDD = IDD_TERRAIN_MATERIAL };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(TerrainMaterial)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
virtual void OnOK(){return;}; ///< Modeless dialogs don't OK, so eat this for modeless.
virtual void OnCancel(){return;}; ///< Modeless dialogs don't close on ESC, so eat this for modeless.
virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
//}}AFX_VIRTUAL
// Implementation
protected:
enum {MIN_TILE_SIZE=2, MAX_TILE_SIZE = 100};
// Generated message map functions
//{{AFX_MSG(TerrainMaterial)
virtual BOOL OnInitDialog();
afx_msg void OnSwapTextures();
afx_msg void OnChangeSizeEdit();
afx_msg void OnImpassable();
afx_msg void OnPassableCheck();
afx_msg void OnPassable();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
protected:
static TerrainMaterial *m_staticThis;
Bool m_updating;
static Int m_currentFgTexture;
static Int m_currentBgTexture;
CTreeCtrl m_terrainTreeView;
TerrainSwatches m_terrainSwatches;
WBPopupSliderButton m_widthPopup;
Int m_currentWidth;
static Bool m_paintingPathingInfo; // If true, we are painting passable/impassable. If false, normal texture painting.
static Bool m_paintingPassable;
protected:
void addTerrain(char *pPath, Int terrainNdx, HTREEITEM parent);
HTREEITEM findOrAdd(HTREEITEM parent, char *pLabel);
void updateLabel(void);
public:
static Int getFgTexClass(void) {return m_currentFgTexture;}
static Int getBgTexClass(void) {return m_currentBgTexture;}
static void setFgTexClass(Int texClass);
static void setBgTexClass(Int texClass);
static void updateTextures(WorldHeightMapEdit *pMap);
static void updateTextureSelection(void);
static void setToolOptions(Bool singleCell);
static void setWidth(Int width);
static Bool isPaintingPathingInfo(void) {return m_paintingPathingInfo;}
static Bool isPaintingPassable(void) {return m_paintingPassable;}
public:
Bool setTerrainTreeViewSelection(HTREEITEM parent, Int selection);
// Popup slider interface.
virtual void GetPopSliderInfo(const long sliderID, long *pMin, long *pMax, long *pLineSize, long *pInitial);
virtual void PopSliderChanged(const long sliderID, long theVal);
virtual void PopSliderFinished(const long sliderID, long theVal);
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_TERRAINMATERIAL_H__D3FF66C5_711D_4DAC_8A29_5EAAB5C3A23E__INCLUDED_)

View file

@ -0,0 +1,86 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
#if !defined(AFX_TERRAINMODAL_H__F013E9EF_2DE1_4084_97A8_5B87466535FC__INCLUDED_)
#define AFX_TERRAINMODAL_H__F013E9EF_2DE1_4084_97A8_5B87466535FC__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// TerrainModal.h : header file
//
#include "TerrainSwatches.h"
#include "common/AsciiString.h"
class WorldHeightMapEdit;
/////////////////////////////////////////////////////////////////////////////
// TerrainModal dialog
class TerrainModal : public CDialog
{
// Construction
public:
TerrainModal(AsciiString path, WorldHeightMapEdit *pMap, CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(TerrainModal)
enum { IDD = IDD_TERRAIN_MODAL };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(TerrainModal)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(TerrainModal)
virtual BOOL OnInitDialog();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
protected:
Int m_currentFgTexture;
AsciiString m_pathToReplace;
CTreeCtrl m_terrainTreeView;
TerrainSwatches m_terrainSwatches;
WorldHeightMapEdit *m_map;
protected:
void addTerrain(char *pPath, Int terrainNdx, HTREEITEM parent);
HTREEITEM findOrAdd(HTREEITEM parent, char *pLabel);
void updateLabel(void);
void updateTextures(void);
Bool setTerrainTreeViewSelection(HTREEITEM parent, Int selection);
public:
Int getNewNdx(void) {return m_currentFgTexture;};
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_TERRAINMODAL_H__F013E9EF_2DE1_4084_97A8_5B87466535FC__INCLUDED_)

View file

@ -0,0 +1,70 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
#if !defined(AFX_TERRAINSWATCHES_H__2EC47AA6_06CA_43D1_9003_15472AE76CE7__INCLUDED_)
#define AFX_TERRAINSWATCHES_H__2EC47AA6_06CA_43D1_9003_15472AE76CE7__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// TerrainSwatches.h : header file
//
#include "lib/BaseType.h"
/////////////////////////////////////////////////////////////////////////////
// TerrainSwatches window
class TerrainSwatches : public CWnd
{
// Construction
public:
TerrainSwatches();
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(TerrainSwatches)
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~TerrainSwatches();
// Generated message map functions
protected:
//{{AFX_MSG(TerrainSwatches)
afx_msg void OnPaint();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
protected:
void DrawMyTexture(CDC *pDc, int top, int left, Int width, UnsignedByte *rgbData);
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_TERRAINSWATCHES_H__2EC47AA6_06CA_43D1_9003_15472AE76CE7__INCLUDED_)

View file

@ -0,0 +1,72 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
// TileTool.h
// Texture tiling tools for worldbuilder.
// Author: John Ahlquist, April 2001
#pragma once
#ifndef TILETOOL_H
#define TILETOOL_H
#include "Tool.h"
class WorldHeightMapEdit;
/*************************************************************************
** TileTool
***************************************************************************/
class TileTool : public Tool
{
protected:
WorldHeightMapEdit *m_htMapEditCopy; //< ref counted.
Int m_textureClassToDraw;
CPoint m_prevViewPt;
public:
TileTool(void);
~TileTool(void);
public:
virtual void mouseDown(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
virtual void mouseUp(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
virtual void mouseMoved(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
virtual WorldHeightMapEdit *getHeightMap(void) {return m_htMapEditCopy;};
virtual void activate(); ///< Become the current tool.
virtual Int getWidth(void) {return 1;};
};
/*************************************************************************
** BigTileTool
***************************************************************************/
class BigTileTool : public TileTool
{
protected:
static Int m_currentWidth;
public:
virtual void activate(); ///< Become the current tool.
public:
BigTileTool(void);
static void setWidth(Int width) ;
virtual Int getWidth(void) {return m_currentWidth;};
};
#endif //TOOL_H

View file

@ -0,0 +1,93 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
// Tool.h
// Tool classes for worldbuilder.
// Author: John Ahlquist, April 2001
#pragma once
#ifndef TOOL_H
#define TOOL_H
#include "Lib\BaseType.h"
#include "Common/STLTypedefs.h"
enum TTrackingMode {
TRACK_NONE,
TRACK_L,
TRACK_M,
TRACK_R
};
#include <vector>
typedef std::vector<CPoint> VecHeightMapIndexes;
#define MAGIC_GROUND_Z (0)
//#define IS_MAGIC_GROUND(z) ((z)==MAGIC_GROUND_Z)
// for backwards compatibility with existing maps:
#define IS_MAGIC_GROUND(z) ((z)==0)
class CWorldBuilderDoc;
class CWorldBuilderView;
class WorldHeightMapEdit;
class WbView;
/*************************************************************************
** Tool
***************************************************************************/
class Tool
{
protected:
Int m_toolID; //< Tool button ui id in resource.
Int m_cursorID; //< Tool button ui id in resource.
HCURSOR m_cursor;
Int m_prevXIndex;
Int m_prevYIndex;
public:
Tool(Int toolID, Int cursorID);
virtual ~Tool(void);
public:
Int getToolID(void) {return m_toolID;}
virtual void setCursor(void);
virtual void activate(); ///< Become the current tool.
virtual void deactivate(){}; ///< Become not the current tool.
virtual Bool followsTerrain(void) {return true;}; ///< True if the tool tracks the terrain, generally false if it modifies the terrain heights.
virtual void mouseMoved(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc) {}
virtual void mouseDown(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc) {}
virtual void mouseUp(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc) {}
virtual WorldHeightMapEdit *getHeightMap(void) {return NULL;}
static Real calcRoundBlendFactor(CPoint center, Int x, Int y, Int brushWidth, Int featherWidth);
static Real calcSquareBlendFactor(CPoint center, Int x, Int y, Int brushWidth, Int featherWidth);
static void getCenterIndex(Coord3D *docLocP, Int brushWidth, CPoint *center, CWorldBuilderDoc *pDoc);
static void getAllIndexesIn(const Coord3D *bl, const Coord3D *br,
const Coord3D *tl, const Coord3D *tr,
Int widthOutside, CWorldBuilderDoc *pDoc,
VecHeightMapIndexes* allIndices);
};
#endif //TOOL_H

View file

@ -0,0 +1,106 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
#if !defined(AFX_WBFRAMEWND_H__83965AA4_8750_11D5_8CE0_00010297BBAC__INCLUDED_)
#define AFX_WBFRAMEWND_H__83965AA4_8750_11D5_8CE0_00010297BBAC__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// WBFrameWnd.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CWBFrameWnd frame
class CWBFrameWnd : public CFrameWnd
{
DECLARE_DYNCREATE(CWBFrameWnd)
protected:
CWBFrameWnd(); // protected constructor used by dynamic creation
// Attributes
public:
// Operations
public:
// Overrides
//{{AFX_VIRTUAL(CWBFrameWnd)
public:
virtual BOOL LoadFrame(UINT nIDResource,
DWORD dwDefaultStyle = WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE,
CWnd* pParentWnd = NULL,
CCreateContext* pContext = NULL);
// ClassWizard generated virtual function overrides
//}}AFX_VIRTUAL
// Implementation
protected:
virtual ~CWBFrameWnd();
// Generated message map functions
//{{AFX_MSG(CWBFrameWnd)
afx_msg void OnMove(int x, int y);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
protected:
CellSizeToolBar m_cellSizeToolBar;
};
class CWB3dFrameWnd : public CMainFrame
{
DECLARE_DYNCREATE(CWB3dFrameWnd)
protected:
CWB3dFrameWnd(); // protected constructor used by dynamic creation
// Operations
public:
// Overrides
virtual BOOL LoadFrame(UINT nIDResource,
DWORD dwDefaultStyle = WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE,
CWnd* pParentWnd = NULL,
CCreateContext* pContext = NULL);
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CWB3dFrameWnd)
public:
//}}AFX_VIRTUAL
// Implementation
protected:
virtual ~CWB3dFrameWnd();
// Generated message map functions
//{{AFX_MSG(CWB3dFrameWnd)
afx_msg void OnMove(int x, int y);
afx_msg void OnWindowPreview1024x768();
afx_msg void OnUpdateWindowPreview1024x768(CCmdUI* pCmdUI);
afx_msg void OnWindowPreview640x480();
afx_msg void OnUpdateWindowPreview640x480(CCmdUI* pCmdUI);
afx_msg void OnWindowPreview800x600();
afx_msg void OnUpdateWindowPreview800x600(CCmdUI* pCmdUI);
afx_msg void OnPaint();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_WBFRAMEWND_H__83965AA4_8750_11D5_8CE0_00010297BBAC__INCLUDED_)

View file

@ -0,0 +1,50 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
#ifndef __WBHEIGHTMAP_H_
#define __WBHEIGHTMAP_H_
#include "W3DDevice/GameClient/HeightMap.h"
class WBHeightMap : public HeightMapRenderObjClass
{
public:
WBHeightMap(void);
/////////////////////////////////////////////////////////////////////////////
// Render Object Interface (W3D methods)
/////////////////////////////////////////////////////////////////////////////
virtual void Render(RenderInfoClass & rinfo);
virtual Bool Cast_Ray(RayCollisionTestClass & raytest);
virtual Real getHeightMapHeight(Real x, Real y, Coord3D* normal); ///<return height and normal at given point
virtual Real getMaxCellHeight(Real x, Real y); ///< returns maximum height of the 4 cell corners.
void setDrawEntireMap(Bool entire) {m_drawEntireMap = entire;};
Bool getDrawEntireMap(void) {return m_drawEntireMap;};
void setFlattenHeights(Bool flat);
protected:
void flattenHeights(void);
protected:
Bool m_drawEntireMap;
Bool m_flattenHeights;
};
#endif // end __WBHEIGHTMAP_H_

View file

@ -0,0 +1,184 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
#if !defined(AFX_WBPopupSliderButton_H__8B217F41_937B_11D1_8CA3_00A024CDC039__INCLUDED_)
#define AFX_WBPopupSliderButton_H__8B217F41_937B_11D1_8CA3_00A024CDC039__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
// WBPopupSliderButton.h : header file
//
class PopupSliderOwner
{
public:
virtual void GetPopSliderInfo(const long sliderID, long *pMin, long *pMax, long *pLineSize, long *pInitial)=0;
virtual void PopSliderChanged(const long sliderID, long theVal) = 0;
virtual void PopSliderFinished(const long sliderID, long theVal) = 0;
};
/////////////////////////////////////////////////////////////////////////////
// WBPopupSliderButton window
// note: as of 990315, these things produce horizontal sliders by default!
class WBPopupSliderButton : public CButton
{
// Construction
public:
WBPopupSliderButton();
// Attributes
public:
// Operations
public:
void SetupPopSliderButton(CWnd *pParentWnd, long controlID,
PopupSliderOwner *pOwner);
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(WBPopupSliderButton)
protected:
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~WBPopupSliderButton();
// Generated message map functions
protected:
//{{AFX_MSG(WBPopupSliderButton)
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
Int m_controlID;
Int m_sliderStyle;
PopupSliderOwner *m_owner;
};
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// PopupSlider window
/*
note: PopupSlider is a self-deleting window. It cannot
be instantiated except through its New function, and once
its Create() function has been called successfully it should
not be deleted. Its PostNcDestroy method will handle that
for you.
*/
class PopupSlider : public CWnd
{
// Construction
public:
PopupSlider();
public:
/*
the New function takes care of EVERYTHING for you! It
constructs the object, calls its create method,
and starts it running
*/
static void New(CWnd* pParentWnd, long kind,
PopupSliderOwner *pSliderOwner, long sliderID);
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(PopupSlider)
public:
virtual BOOL Create(const RECT& rect, CWnd* pParentWnd);
protected:
virtual void PostNcDestroy();
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~PopupSlider();
// Generated message map functions
protected:
//{{AFX_MSG(PopupSlider)
afx_msg void OnPaint();
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
afx_msg void OnDestroy();
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
void MoveThumbUnderMouse(int xNew);
// our owner
PopupSliderOwner *mSliderOwner;
// the slider value
long m_curValue;
// setup values for the slider
long m_lineSize;
long m_lo;
long m_hi;
long m_kind;
long mSliderID;
/* the value when the slider last called "Finished"; we keep this around to
see if we need to call Finished again on NcDestroy */
long m_valOnLastFinished;
private:
Bool mDraggingThumb;
Bool mClickThrough;
CPoint mOrigPt;
Bool mSetOrigPt;
Bool mEverMoved;
// for the thumb icon
HICON mIcon;
private:
// the one and only slider windoid that should ever be open
static PopupSlider *gPopupSlider;
void GetChannelRect(CRect* rect);
void GetThumbIconRect(CRect* rect);
// the background color brush
CBrush m_brush3dFaceColor;
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_WBPopupSliderButton_H__8B217F41_937B_11D1_8CA3_00A024CDC039__INCLUDED_)

View file

@ -0,0 +1,172 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
// WHeightMapEdit.h
// Class to contain the editing functions subclass of WorldHeightMap.
// Author: John Ahlquist, April 2001
#pragma once
#ifndef WHeightMapEdit_H
#define WHeightMapEdit_H
#include "W3DDevice/GameClient/WorldHeightMap.h"
class DataChunkOutput;
class TerrainType;
// helper class
class CProcessNode
{
public:
const Int m_x, m_y;
Real m_len; ///< Length of texture coord on this node.
CProcessNode *m_next;
public:
CProcessNode(Int x, Int y):m_x(x),m_y(y),m_next(NULL),m_len(0) {};
~CProcessNode(void) { };
};
#define MAX_TILES_PER_CLASS 100
/// Struct in memory.
typedef struct
{
#ifdef _DEBUG
Int forDebugOnly_fileTextureClass;
#endif
Int numTiles;
Int width;
Bool isBlendEdgeTile;
AsciiString name;
AsciiString filePath;
AsciiString uiName;
TileData *tiles[MAX_TILES_PER_CLASS];
TerrainType *terrainType;
} TGlobalTextureClass;
#define NUM_ALPHA_TILES 8
class WorldHeightMapEdit : public WorldHeightMap
{
protected:
Bool m_warnTooManyTex; ///< warning message flag.
Bool m_warnTooManyBlend; ///< warning message flag.
// Texture classes. There is one texture class for each bitmap read in.
// A class may have more than one tile. For example, if the grass bitmap is
// 128x128, it creates 4 64x64 tiles, so the grass texture class will have 4 tiles.
static int m_numGlobalTextureClasses;
static TGlobalTextureClass m_globalTextureClasses[NUM_TEXTURE_CLASSES];
protected:
static void loadBitmap(char *path, const char *uiName);
static void loadDirectoryOfImages(char *path);
static void loadImagesFromTerrainType( TerrainType *terrain );
static void loadBaseImages(void);
Int allocateTiles(Int textureClass);
Int allocateEdgeTiles(Int textureClass);
void blendToThisClass(Int xIndex, Int yIndex, Int textureClass, Int edgeClass);
void blendSpecificTiles(Int xIndex, Int yIndex, Int srcXIndex, Int srcYIndex,
Int curTileNdx, Int blendTileNdx, Bool longDiagonal, Int edgeClass);
Int findOrCreateBlendTile(TBlendTileInfo *pBlendInfo);
Int addCliffInfo(TCliffInfo *pCliffInfo);
Int getTileIndexFromTerrainType( TerrainType *terrain );
Int getTileNdxForClass(Int xIndex, Int yIndex, Int textureClass);
Int getBlendTileNdxForClass(Int xIndex, Int yIndex, Int textureClass);
Int getTextureClassFromNdx(Int tileNdx);
void getTexClassNeighbors(Int xIndex, Int yIndex, Int textureClass, Int *pSideCount, Int *pTotalCount);
void updateForAdjacentCliffs(Int xIndex, Int yIndex,
UnsignedByte *pProcessed, TCliffInfo &cliffInfo);
Bool adjustForTiling(TCliffInfo &cliffInfo, Real textureWidth);
void updateFlatCellForAdjacentCliffs(Int xIndex, Int yIndex,
Int curTileClass, UnsignedByte *pProcessed=NULL);
public: // construction
WorldHeightMapEdit(Int xExtent, Int yExtent, UnsignedByte initialHeight, Int border); ///< create.
WorldHeightMapEdit(WorldHeightMapEdit *pThis); ///< duplicate.
WorldHeightMapEdit(ChunkInputStream *pStrm); ///< read from file.
~WorldHeightMapEdit(void); ///< destroy.
void saveToFile(DataChunkOutput &chunkWriter);
WorldHeightMapEdit *duplicate(void);
static void init(void);
static void shutdown(void);
public: /// Status methods.
void clearStatus(void) {m_warnTooManyTex = false;m_warnTooManyBlend = false;};
Bool tooManyTextures(void) {return m_warnTooManyTex;};
Bool tooManyBlends(void) {return m_warnTooManyBlend;};
Bool canFitTexture(Int textureClass); ///< Returns true if we can fit this texture.
public: // Editing methods.
static UnsignedByte *getPointerToClassTileData(Int texClass);
void blendTile(Int xIndex, Int yIndex, Int srcXIndex, Int srcYIndex, Int srcClass, Int edgeClass);
void autoBlendOut(Int xIndex, Int yIndex, Int edgeIndex = -1);
Int getTextureClass(Int xIndex, Int yIndex, Bool baseClass=false);
void setHeight(Int xIndex, Int yIndex, UnsignedByte height);
void setCliff(Int xIndex, Int yIndex, Bool impassable) {setCliffState(xIndex, yIndex, impassable);}
Bool setTileNdx(Int xIndex, Int yIndex, Int textureClass, Bool singleTile);
Bool floodFill(Int xIndex, Int yIndex, Int textureClass, Bool doReplace);
static Int getNumTexClasses(void) {return m_numGlobalTextureClasses;};
static AsciiString getTexClassName(int ndx) {return m_globalTextureClasses[ndx].name;}
static AsciiString getTexClassUiName(int ndx) ;
static Int getTexClassNumTiles(int ndx) {return m_globalTextureClasses[ndx].numTiles;}
static Int getTexClassIsBlendEdge(int ndx) {return m_globalTextureClasses[ndx].isBlendEdgeTile;}
void addObject(MapObject *pMapObj); ///< Adds a map object to the front of the list.
void removeFirstObject(void); ///< Removes the first map object from the list.
Bool isTexClassUsed(Int textureClass);
Int getFirstTile(Int textureClass);
Bool optimizeTiles(void); ///< Optimizes tile allocations.
void showTileStatusInfo(void); ///< pops up a dialog box with tile mem usage.
Bool selectDuplicates(void); ///< Selects any dupicate map objects.
Bool selectSimilar(void); ///< Selects any dupicate map objects.
Bool selectInvalidTeam(void); ///< Selects any objects with invalid teams.
Bool resize(Int newXSize, Int newYSize, Int newHeight, Int newBorder, Bool anchorTop, Bool anchorBottom,
Bool anchorLeft, Bool anchorRight, Coord3D *pObjOffset);
Bool remapTextures(void); ///< returns true if the operation had an effect.
void reloadTextures(void); ///< Reloads textures from disk.
void resetResources(void); ///< Releases textures in preparation for device reset.
Bool getRawTileData(Short tileNdx, Int width, UnsignedByte *buffer, Int bufLen);
void dbgVerifyAfterUndo(void); ///< Verifies the structures are still consistent.
Bool doCliffAdjustment(Int xIndex, Int yIndex);
Bool removeCliffMapping(void);
Int getNumBoundaries(void) const ;
void getBoundary(Int ndx, ICoord2D* border) const;
void addBoundary(ICoord2D* boundaryToAdd);
void changeBoundary(Int ndx, ICoord2D *border);
void removeLastBoundary(void);
// outNdx must not be NULL, but outHandle can be.
// outHandle: 0 means BL, 1 means TL, 2 means TR, 3 means BR
void findBoundaryNear(Coord3D *pt, float okDistance, Int *outNdx, Int *outHandle);
};
#endif

View file

@ -0,0 +1,108 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
#if !defined(AFX_WaterOptions_H__6B56E20C_582E_4132_A251_87902218852C__INCLUDED_)
#define AFX_WaterOptions_H__6B56E20C_582E_4132_A251_87902218852C__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// WaterOptions.h : header file
//
#include "WBPopupSlider.h"
#include "OptionsPanel.h"
#include "Common/WellKnownKeys.h"
class MapObject;
class PolygonTrigger;
class MovePolygonUndoable;
/////////////////////////////////////////////////////////////////////////////
// WaterOptions dialog
class WaterOptions : public COptionsPanel, public PopupSliderOwner
{
// Construction
public:
WaterOptions(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(WaterOptions)
enum { IDD = IDD_WATER_OPTIONS };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(WaterOptions)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
virtual void OnOK(){return;}; //!< Modeless dialogs don't OK, so eat this for modeless.
virtual void OnCancel(){return;}; //!< Modeless dialogs don't close on ESC, so eat this for modeless.
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(WaterOptions)
virtual BOOL OnInitDialog();
afx_msg void OnChangeWaterEdit();
afx_msg void OnChangeHeightEdit();
afx_msg void OnChangeSpacingEdit();
afx_msg void OnWaterPolygon();
afx_msg void OnMakeRiver();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
protected:
static WaterOptions *m_staticThis; ///< Reference to the floating panel so SetWidth and SetFeather can be static.
Bool m_updating; ///<true if the ui is updating itself.
static Int m_waterHeight;
WBPopupSliderButton m_waterHeightPopup;
MovePolygonUndoable *m_moveUndoable;
Int m_originalHeight;
static Int m_waterPointSpacing;
static Bool m_creatingWaterAreas; ///< True if we are creating flood fill water polygons, rather than dropping single points.
protected:
void updateTheUI(void);
void startUpdateHeight(void);
void updateHeight(void);
void endUpdateHeight(void);
PolygonTrigger *adjustCount(PolygonTrigger *trigger, Int firstPt, Int lastPt, Int desiredPointCount);
public:
static void update(void);
static void setHeight(Int height);
static Int getHeight(void) { return m_waterHeight;};
static Int getSpacing(void) { return m_waterPointSpacing;};
static Bool getCreatingWaterAreas(void) {return m_creatingWaterAreas;}
public:
virtual void GetPopSliderInfo(const long sliderID, long *pMin, long *pMax, long *pLineSize, long *pInitial);
virtual void PopSliderChanged(const long sliderID, long theVal);
virtual void PopSliderFinished(const long sliderID, long theVal);
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_WaterOptions_H__6B56E20C_582E_4030_A251_879097C8853C__INCLUDED_)

View file

@ -0,0 +1,67 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
// WaterTool.h
// Polygon area trigger tool for worldbuilder.
// Author: John Ahlquist, Nov. 2001
#pragma once
#ifndef WaterTool_H
#define WaterTool_H
#include "PolygonTool.h"
class WorldHeightMapEdit;
class MapObject;
class PolygonTrigger;
class MovePolygonUndoable;
/*************************************************************************/
/** WaterTool
Does the add/select water polygon operation.
***************************************************************************/
/// Select tile tool.
class WaterTool : public PolygonTool
{
public:
WaterTool(void);
~WaterTool(void);
protected:
static Bool m_water_isActive;
Real m_currentZ;
public:
static Bool isActive(void) {return m_water_isActive;};
public:
/// Perform tool on mouse down.
virtual void mouseDown(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
virtual void mouseMoved(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
virtual void mouseUp(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
virtual void setCursor(void);
virtual void activate(); ///< Become the current tool.
virtual void deactivate(); ///< Become not the current tool.
protected:
void fillTheArea(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
PolygonTrigger *adjustSpacing(PolygonTrigger *trigger, Real spacing);
};
#endif //WaterTool_H

View file

@ -0,0 +1,98 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
#if !defined(AFX_WaypointOptions_H__6B56E20C_582E_4132_A251_879097C8852C__INCLUDED_)
#define AFX_WaypointOptions_H__6B56E20C_582E_4132_A251_879097C8852C__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// WaypointOptions.h : header file
//
#include "OptionsPanel.h"
#include "Common/WellKnownKeys.h"
class MapObject;
class PolygonTrigger;
class MovePolygonUndoable;
/////////////////////////////////////////////////////////////////////////////
// WaypointOptions dialog
class WaypointOptions : public COptionsPanel
{
// Construction
public:
WaypointOptions(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(WaypointOptions)
enum { IDD = IDD_WAYPOINT_OPTIONS };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(WaypointOptions)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
virtual void OnOK(){return;}; //!< Modeless dialogs don't OK, so eat this for modeless.
virtual void OnCancel(){return;}; //!< Modeless dialogs don't close on ESC, so eat this for modeless.
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(WaypointOptions)
virtual BOOL OnInitDialog();
afx_msg void OnChangeWaypointnameEdit();
afx_msg void OnChangeSelectedWaypoint();
afx_msg void OnEditWaypointLocationX();
afx_msg void OnEditWaypointLocationY();
afx_msg void OnEditchangeWaypointlabel1Edit();
afx_msg void OnEditchangeWaypointlabel2Edit();
afx_msg void OnEditchangeWaypointlabel3Edit();
afx_msg void OnWaypointBidirectional();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
protected:
static WaypointOptions *m_staticThis; ///< Reference to the floating panel so SetWidth and SetFeather can be static.
Bool m_updating; ///<true if the ui is updating itself.
MovePolygonUndoable *m_moveUndoable;
Int m_originalHeight;
protected:
void updateTheUI(void);
void changeWaypointLabel(Int editControlID, NameKeyType key);
public:
static void update(void);
static MapObject *getSingleSelectedWaypoint(void);
static PolygonTrigger *getSingleSelectedPolygon(void);
static Bool isUnique(AsciiString name, MapObject* theMapObj = NULL);
static AsciiString GenerateUniqueName(Int id);
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_WaypointOptions_H__6B56E20C_582E_4030_A251_879097C8853C__INCLUDED_)

View file

@ -0,0 +1,63 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
// WaypointTool.h
// Texture selection tool for worldbuilder.
// Author: John Ahlquist, April 2001
#pragma once
#ifndef WAYPOINTTOOL_H
#define WAYPOINTTOOL_H
#include "Tool.h"
class WorldHeightMapEdit;
class MapObject;
/*************************************************************************/
/** WaypointTool
Does the add/select waypoint operation.
***************************************************************************/
/// Select tile tool.
class WaypointTool : public Tool
{
public:
WaypointTool(void);
~WaypointTool(void);
protected:
Int m_downWaypointID;
Coord3D m_mouseDownPt;
static Bool m_isActive;
protected:
MapObject *pickWaypoint(Coord3D loc);
public:
static Bool isActive(void) {return m_isActive;};
public:
/// Perform tool on mouse down.
virtual void mouseDown(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
virtual void mouseMoved(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
virtual void mouseUp(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
virtual void activate(); ///< Become the current tool.
virtual void deactivate(); ///< Become not the current tool.
};
#endif //WAYPOINTTOOL_H

View file

@ -0,0 +1,201 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
// WorldBuilder.h : main header file for the WORLDBUILDER application
//
#if !defined(AFX_WORLDBUILDER_H__FBA41345_2826_11D5_8CE0_00010297BBAC__INCLUDED_)
#define AFX_WORLDBUILDER_H__FBA41345_2826_11D5_8CE0_00010297BBAC__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#ifndef __AFXWIN_H__
#error include 'stdafx.h' before including this file for PCH
#endif
#include "resource.h" // main symbols
#include "Common/STLTypedefs.h"
#include "BrushTool.h"
#include "TileTool.h"
#include "FeatherTool.h"
#include "AutoEdgeOutTool.h"
#include "FloodFillTool.h"
#include "MoundTool.h"
#include "EyedropperTool.h"
#include "ObjectTool.h"
#include "FenceTool.h"
#include "PointerTool.h"
#include "BlendEdgeTool.h"
#include "BorderTool.h"
#include "GroveTool.h"
#include "HandScrollTool.h"
#include "RoadTool.h"
#include "MeshMoldTool.h"
#include "WaypointTool.h"
#include "PolygonTool.h"
#include "WaterTool.h"
#include "BuildListTool.h"
#include "RampTool.h"
#include "ScorchTool.h"
#include "Common/Debug.h"
/////////////////////////////////////////////////////////////////////////////
// CWorldBuilderApp:
// See WorldBuilder.cpp for the implementation of this class
//
// Force maps into a directory structure.
#define DO_MAPS_IN_DIRECTORIES 1
#define NONE_STRING "<none>"
enum {THREE_D_VIEW_WIDTH=800, THREE_D_VIEW_HEIGHT=600};
enum {MAX_OBJECTS_IN_MAP = 3000};
class CWorldBuilderApp : public CWinApp
{
public:
CWorldBuilderApp();
~CWorldBuilderApp();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CWorldBuilderApp)
public:
virtual BOOL InitInstance();
virtual int ExitInstance();
//}}AFX_VIRTUAL
// Implementation
//{{AFX_MSG(CWorldBuilderApp)
afx_msg void OnAppAbout();
afx_msg void OnResetWindows();
afx_msg void OnFileOpen();
afx_msg void OnTexturesizingMapclifftextures();
afx_msg void OnUpdateTexturesizingMapclifftextures(CCmdUI* pCmdUI);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
protected:
enum {NUM_VIEW_TOOLS=24};
Tool *m_tools[NUM_VIEW_TOOLS]; ///< array of tool pointers.
Tool *m_curTool; ///< Currently active tool.
Tool *m_selTool; ///< Normal tool. If we hit alt, curTool turns to eyedropper.
BrushTool m_brushTool; ///< Height brush tool.
TileTool m_tileTool; ///< Single texture tile tool.
BigTileTool m_bigTileTool; ///< Wide texture tile tool.
FeatherTool m_featherTool; ///< Feather the height values tool.
AutoEdgeOutTool m_autoEdgeOutTool; ///< Auto blend texture edges out tool.
FloodFillTool m_floodFillTool; ///< Flood fill tool.
MoundTool m_moundTool; ///< Add height to height values tool.
DigTool m_digTool; ///< Remove height from height values tool.
EyedropperTool m_eyedropperTool; ///< Eyedropper tool.
ObjectTool m_objectTool; ///< Add and orient object tool.
PointerTool m_pointerTool; ///< Select and move/rotate tool.
BlendEdgeTool m_blendEdgeTool; ///< Blend a single edge tool.
GroveTool m_groveTool; ///< Plant a grove of trees tool.
HandScrollTool m_handScrollTool; ///< Scroll tool.
RoadTool m_roadTool; ///< Road tool.
MeshMoldTool m_meshMoldTool; ///< Mesh shaping mold tool.
WaypointTool m_waypointTool; ///< Waypoint tool.
PolygonTool m_polygonTool; ///< Polygon tool.
WaterTool m_waterTool; ///< Water tool.
BuildListTool m_buildListTool; ///< Build List tool.
FenceTool m_fenceTool; ///< Fence tool.
RampTool m_rampTool; ///< Ramp tool.
ScorchTool m_scorchTool; ///< Scorch tool.
BorderTool m_borderTool; ///< Border tool.
Int m_lockCurTool;
AsciiString m_currentDirectory; ///< Current directory for open file.
CDocTemplate *m_3dtemplate;
MapObject *m_pasteMapObjList; ///< List of copied/cut map objects.
protected:
void deletePasteObjList(void)
{
if (m_pasteMapObjList)
m_pasteMapObjList->deleteInstance();
m_pasteMapObjList = NULL;
};
public:
CDocTemplate *Get3dTemplate() { return m_3dtemplate; }
/// Set the brush tool as the active tool.
void selectBrushTool(void) { setActiveTool(&m_brushTool); }
/// Set the pointer tool as the active tool.
void selectPointerTool(void);
/// Set the hand tool as the cur tool (but not active tool)
void selectHandToolTemp(void) { m_curTool = &m_handScrollTool; }
/// Set the tool that will be active.
void setActiveTool(Tool *newTool);
/// Sets the current directry for file opens.
void setCurrentDirectory(AsciiString dir) {m_currentDirectory = dir;};
Tool *getCurTool() { return m_curTool; }
/// Check to see if any keyboard overrides are changing the current tool.
void updateCurTool(Bool forceHand);
/// Switch to the poly tool if we aren't already.
void setPolyTool(void){ setActiveTool(&m_polygonTool); };
/// Return true if the hand scroll tool is active.
Bool isHandScroll(void) {return m_curTool == &m_handScrollTool; }
void lockCurTool() { DEBUG_ASSERTCRASH(!m_lockCurTool,("already locked")); m_lockCurTool = 1; }
void unlockCurTool() { m_lockCurTool = 0; }
Bool isCurToolLocked() { return m_lockCurTool != 0; }
/// Note - read only data - make yourself a copy.
MapObject *getMapObjPasteList(void) { return(m_pasteMapObjList);};
/// Note - the app owns this, and will delete it on close.
void setMapObjPasteList(MapObject *list) { deletePasteObjList(); m_pasteMapObjList = list; };
/// Handles command messages.
virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra,
AFX_CMDHANDLERINFO* pHandlerInfo);
};
inline CWorldBuilderApp *WbApp() { return (CWorldBuilderApp*)::AfxGetApp(); }
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_WORLDBUILDER_H__FBA41345_2826_11D5_8CE0_00010297BBAC__INCLUDED_)

View file

@ -0,0 +1,217 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
// WorldBuilderDoc.h : interface of the CWorldBuilderDoc class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_WORLDBUILDERDOC_H__FBA4134D_2826_11D5_8CE0_00010297BBAC__INCLUDED_)
#define AFX_WORLDBUILDERDOC_H__FBA4134D_2826_11D5_8CE0_00010297BBAC__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "lib/BaseType.h"
#include "Common/MapObject.h"
#include "Tool.h"
class CWorldBuilderView;
class WbView3d;
class WorldHeightMapEdit;
class Undoable;
class DataChunkInput;
struct DataChunkInfo;
#define MAX_UNDOS 15
#define MIN_CELL_SIZE 1
#define MAX_CELL_SIZE 64
class CWorldBuilderDoc : public CDocument
{
friend class COptionsPanel;
enum {MAX_WAYPOINTS=16000}; ///@todo - make it dynamic. jba.
protected: // create from serialization only
CWorldBuilderDoc();
DECLARE_DYNCREATE(CWorldBuilderDoc)
protected:
WorldHeightMapEdit *m_heightMap;
Undoable *m_undoList; ///< Head of undo/redo list.
int m_maxUndos;
int m_curRedo; ///< 0 means no redos available.
Bool m_linkCenters; ///< Flag whether the centers of the 2d and 3d views track together.
Bool m_needAutosave; ///< True if changes have been made since last autosave.
Int m_curWaypointID;
protected:
std::vector<ICoord2D> m_boundaries;
protected: // waypoint stuff.
MapObject *m_waypointTable[MAX_WAYPOINTS];
Bool m_waypointTableNeedsUpdate;
struct {
Int waypoint1;
Int waypoint2;
Bool processedFlag;
} m_waypointLinks[MAX_WAYPOINTS];
Int m_numWaypointLinks;
protected:
void updateWaypointTable(void);
void compressWaypointIds(void);
void updateLWL(MapObject *pWay, MapObject *pSrcWay);
public:
void addWaypointLink(Int waypointID1, Int waypointID2);
void removeWaypointLink(Int waypointID1, Int waypointID2);
MapObject *getWaypointByID(Int waypointID);
Int getNumWaypointLinks(void) {return m_numWaypointLinks;};
void getWaypointLink(Int ndx, Int *waypoint1, Int *waypointID2);
Bool waypointLinkExists(Int waypointID1, Int waypointID2);
Bool isWaypointLinked(MapObject *pWay);
void updateLinkedWaypointLabels(MapObject *pWay);
// Boundary stuff
Int getNumBoundaries(void) const ;
void getBoundary(Int ndx, ICoord2D* border) const;
void addBoundary(ICoord2D* boundaryToAdd);
void changeBoundary(Int ndx, ICoord2D *border);
void removeLastBoundary(void);
// outNdx must not be NULL, but outHandle can be.
// outHandle: 0 means BL, 1 means TL, 2 means TR, 3 means BR
void findBoundaryNear(Coord3D *pt, float okDistance, Int *outNdx, Int *outHandle);
static Bool ParseWaypointDataChunk(DataChunkInput &file, DataChunkInfo *info, void *userData);
Bool ParseWaypointData(DataChunkInput &file, DataChunkInfo *info, void *userData);
public: // overridden
virtual BOOL DoSave(LPCTSTR lpszPathName, BOOL bReplace = TRUE);
virtual BOOL DoFileSave();
// Attributes
public:
WorldHeightMapEdit *GetHeightMap() {return m_heightMap;}
void SetHeightMap(WorldHeightMapEdit *pMap, Bool doUpdate);
void Create2DView();
void Create3DView();
CWorldBuilderView *Get2DView();
WbView3d *Get3DView();
static CWorldBuilderDoc *GetActiveDoc();
static CWorldBuilderView *GetActive2DView();
static WbView3d *GetActive3DView();
void invalObject(MapObject *pMapObj);
void invalCell(int xIndex, int yIndex);
void updateAllViews();
void updateHeightMap(WorldHeightMap *htMap, Bool partial, const IRegion2D &partialRange);
/// Gets an xy index into the height map from a pixel location.
Bool getCellIndexFromCoord(Coord3D pt, CPoint *ndxP);
void getCoordFromCellIndex(CPoint ndx, Coord3D* pt);
/// Gets a real xy location from a pixel point.
Bool getCellPositionFromCoord(Coord3D pt, Coord3D *locP);
/// Gets all of the indices within widthOutside of the rectangle and places them into
/// allIndices
Bool getAllIndexesInRect(const Coord3D* bl, const Coord3D* br,
const Coord3D* tl, const Coord3D* tr,
Int widthOutside, VecHeightMapIndexes* allIndices);
/// Gets the arrow point location.
void getObjArrowPoint(MapObject *pObj, Coord3D *location);
void syncViewCenters(Real x, Real y);
Bool needAutoSave(void) {return m_needAutosave;};
Int getNextWaypointID(void) { return ++m_curWaypointID;};
void setNextWaypointID(Int newMax) { if (newMax>m_curWaypointID) m_curWaypointID = newMax;};
void autoSave(void);
void validate(void);
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CWorldBuilderDoc)
public:
virtual BOOL OnNewDocument();
virtual void Serialize(CArchive& ar);
virtual BOOL OnOpenDocument(LPCTSTR lpszPathName);
virtual BOOL CanCloseFrame(CFrameWnd* pFrame);
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CWorldBuilderDoc();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
void AddAndDoUndoable(Undoable *pUndo);
// Generated message map functions
protected:
//{{AFX_MSG(CWorldBuilderDoc)
afx_msg void OnEditRedo();
afx_msg void OnUpdateEditRedo(CCmdUI* pCmdUI);
afx_msg void OnEditUndo();
afx_msg void OnUpdateEditUndo(CCmdUI* pCmdUI);
afx_msg void OnTsInfo();
afx_msg void OnTsCanonical();
afx_msg void OnUpdateTsCanonical(CCmdUI* pCmdUI);
afx_msg void OnFileResize();
afx_msg void OnJumpToGame();
afx_msg void OnTsRemap();
afx_msg void OnEditLinkCenters();
afx_msg void OnUpdateEditLinkCenters(CCmdUI* pCmdUI);
afx_msg void OnViewTimeOfDay();
afx_msg void OnWindow2dwindow();
afx_msg void OnUpdateWindow2dwindow(CCmdUI* pCmdUI);
afx_msg void OnViewReloadtextures();
afx_msg void OnEditScripts();
afx_msg void OnViewHome();
afx_msg void OnTexturesizingTile4x4();
afx_msg void OnUpdateTexturesizingTile4x4(CCmdUI* pCmdUI);
afx_msg void OnTexturesizingTile6x6();
afx_msg void OnUpdateTexturesizingTile6x6(CCmdUI* pCmdUI);
afx_msg void OnTexturesizingTile8x8();
afx_msg void OnUpdateTexturesizingTile8x8(CCmdUI* pCmdUI);
afx_msg void OnDumpDocToText();
afx_msg void OnRemoveclifftexmapping();
afx_msg void OnTogglePitchAndRotation();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_WORLDBUILDERDOC_H__FBA4134D_2826_11D5_8CE0_00010297BBAC__INCLUDED_)

View file

@ -0,0 +1,165 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
// WorldBuilderView.h : interface of the CWorldBuilderView class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_WORLDBUILDERVIEW_H__FBA4134F_2826_11D5_8CE0_00010297BBAC__INCLUDED_)
#define AFX_WORLDBUILDERVIEW_H__FBA4134F_2826_11D5_8CE0_00010297BBAC__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "Lib/BaseType.h"
#include "W3DDevice/GameClient/WorldHeightMap.h"
#include "WbView.h"
//#include "WW3D_SimpleWindow.h"
#define MIN_GRID_SIZE 4
class MapObject;
class CWorldBuilderDoc;
class CWorldBuilderView : public WbView
{
protected: // create from serialization only
CWorldBuilderView();
DECLARE_DYNCREATE(CWorldBuilderView)
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CWorldBuilderView)
public:
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
protected:
virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
virtual void OnDraw(CDC* pDC);
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CWorldBuilderView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
Int m_cellSize; ///< Size of a height map cell in pixels when drawn in the 2d view.
Bool m_showContours; ///< Flag whether contours are drawn in the 2d view.
Bool m_showTexture; ///< Flag whether textures are drawn in the 2d view.
Bool mShowGrid; ///< Flag whether the gray grid is drawn in the 2d view.
Int mXScrollOffset; ///< The x offset to the upper left corner of the screen.
Int mYScrollOffset; ///< The y offset to the upper left corner of the screen.
CPoint m_scrollMin; ///< The minimum scrollbar positions.
CPoint m_scrollMax; ///< The maximum scroll bar positions.
protected:
/// Draw a texture bitmap in a rectangle in the dc.
void drawMyTexture(CDC *pDc, CRect *pRect, Int width, UnsignedByte *rgbData);
/// Get a color for a height value.
DWORD getColorForHeight(UnsignedByte ht);
/// Draw the contours for the height map in the dc.
void drawContours(CDC *pDc, CRgn *pRgn, Int minX, Int maxX, Int minY, Int maxY);
/// Compound boolean expression.
static inline Bool isBetween(Int cur, Int first, Int second) {
Bool is = false;
if (cur>=first && cur<=second) is = true;
if (cur<=first && cur>=second) is = true;
return(is);
}
/// Interpolate the point at a given height between 2 points.
void interpolate(CPoint *pt, Int ht, CPoint pt1, Int ht1, CPoint pt2, Int ht2);
/// Draw the object's icon in the dc at a given point.
void drawObjectInView(CDC *pDc, MapObject *pMapObj);
public:
/// Get the current draw size in pixels in the 2d window of one height map cell.
Int getCellSize(void) {return m_cellSize;}
/// Sets the current draw size.
void setCellSize(Int cellSize);
/// Set whether contours are drawn.
Bool getShowContours(void) {return m_showContours;}
/// Set whether contours are drawn.
void setShowContours(Bool show);
/// Update the center to match a center point from the 3d view.
void updateCenterFromMapPoint(Real x, Real y);
protected:
public:
virtual Bool viewToDocCoords(CPoint curPt, Coord3D *newPt, Bool constrain);
virtual Bool docToViewCoords(Coord3D curPt, CPoint* newPt);
/// Set the center for display.
virtual void setCenterInView(Real x, Real y);
/// the doc has changed size; readjust view as necessary.
virtual void adjustDocSize();
/// Invalidates an object. Pass NULL to inval all objects.
virtual void invalObjectInView(MapObject *pObj);
/// Invalidates the area of one height map cell in the 2d view.
virtual void invalidateCellInView(int xIndex, int yIndex);
/// Scrolls the window by this amount (doc coords).
virtual void scrollInView(Real x, Real y, Bool end);
// Generated message map functions
protected:
//{{AFX_MSG(CWorldBuilderView)
afx_msg void OnPaint();
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
afx_msg void OnShowGrid();
afx_msg void OnUpdateShowGrid(CCmdUI* pCmdUI);
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnViewShowtexture();
afx_msg void OnUpdateViewShowtexture(CCmdUI* pCmdUI);
// afx_msg void OnViewShowcontours();
// afx_msg void OnUpdateViewShowcontours(CCmdUI* pCmdUI);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_WORLDBUILDERVIEW_H__FBA4134F_2826_11D5_8CE0_00010297BBAC__INCLUDED_)

View file

@ -0,0 +1,75 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
#if !defined(AFX_ADDPLAYERDIALOG_H__96179004_35C9_436A_A302_A777E77F8F04__INCLUDED_)
#define AFX_ADDPLAYERDIALOG_H__96179004_35C9_436A_A302_A777E77F8F04__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// addplayerdialog.h : header file
//
#include "GameLogic/SidesList.h"
/////////////////////////////////////////////////////////////////////////////
// AddPlayerDialog dialog
class AddPlayerDialog : public CDialog
{
private:
AsciiString m_side;
AsciiString m_addedSide;
// Construction
public:
AddPlayerDialog(AsciiString side, CWnd* pParent = NULL); // standard constructor
AsciiString getAddedSide() { return m_addedSide; }
// Dialog Data
//{{AFX_DATA(AddPlayerDialog)
enum { IDD = IDD_ADDPLAYER };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(AddPlayerDialog)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(AddPlayerDialog)
virtual void OnOK();
virtual void OnCancel();
virtual BOOL OnInitDialog();
afx_msg void OnEditchangeCombo1();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_ADDPLAYERDIALOG_H__96179004_35C9_436A_A302_A777E77F8F04__INCLUDED_)

View file

@ -0,0 +1,101 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
#if !defined(AFX_BRUSHOPTIONS_H__6B56E20C_582E_4030_A251_879097C8853C__INCLUDED_)
#define AFX_BRUSHOPTIONS_H__6B56E20C_582E_4030_A251_879097C8853C__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// brushoptions.h : header file
//
#include "WBPopupSlider.h"
#include "OptionsPanel.h"
/////////////////////////////////////////////////////////////////////////////
/// BrushOptions modeless (floating) dialog - allows entry and display of brush width and feather.
class BrushOptions : public COptionsPanel , public PopupSliderOwner
{
// Construction
public:
enum {MIN_BRUSH_SIZE=1,
MAX_BRUSH_SIZE=51,
FREQ_BRUSH_TICKS=10,
MIN_FEATHER=0,
FREQ_FEATHER_TICKS=4,
MAX_FEATHER=20};
BrushOptions(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(BrushOptions)
enum { IDD = IDD_BRUSH_OPTIONS };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(BrushOptions)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
virtual void OnOK(){return;}; //!< Modeless dialogs don't OK, so eat this for modeless.
virtual void OnCancel(){return;}; //!< Modeless dialogs don't close on ESC, so eat this for modeless.
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(BrushOptions)
virtual BOOL OnInitDialog();
afx_msg void OnChangeFeatherEdit();
afx_msg void OnChangeSizeEdit();
afx_msg void OnChangeHeightEdit();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
protected:
static BrushOptions *m_staticThis; ///< Reference to the floating panel so SetWidth and SetFeather can be static.
static Int m_currentWidth; ///< current brush width in the ui.
static Int m_currentFeather; ///< current feather width in the ui.
static Int m_currentHeight;
Bool m_updating; ///<true if the ui is updating itself.
WBPopupSliderButton m_brushWidthPopup;
WBPopupSliderButton m_brushFeatherPopup;
WBPopupSliderButton m_brushHeightPopup;
public:
static void setWidth(Int width);
static void setFeather(Int feather);
static void setHeight(Int height);
public:
virtual void GetPopSliderInfo(const long sliderID, long *pMin, long *pMax, long *pLineSize, long *pInitial);
virtual void PopSliderChanged(const long sliderID, long theVal);
virtual void PopSliderFinished(const long sliderID, long theVal);
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_BRUSHOPTIONS_H__6B56E20C_582E_4030_A251_879097C8853C__INCLUDED_)

View file

@ -0,0 +1,64 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
#if !defined(AFX_EULADIALOG_H__9F6A134E_C2A3_425E_8485_F90B1A5F9B58__INCLUDED_)
#define AFX_EULADIALOG_H__9F6A134E_C2A3_425E_8485_F90B1A5F9B58__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// euladialog.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// EulaDialog dialog
class EulaDialog : public CDialog
{
// Construction
public:
EulaDialog(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(EulaDialog)
enum { IDD = IDD_EULA_AGREEMENT };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(EulaDialog)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(EulaDialog)
virtual BOOL OnInitDialog();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_EULADIALOG_H__9F6A134E_C2A3_425E_8485_F90B1A5F9B58__INCLUDED_)

View file

@ -0,0 +1,158 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
#if !defined(AFX_MAPOBJECTPROPS_H__44517B9E_12AB_4E2C_B49B_D6BB65C59649__INCLUDED_)
#define AFX_MAPOBJECTPROPS_H__44517B9E_12AB_4E2C_B49B_D6BB65C59649__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// mapobjectprops.h : header file
//
#include "OptionsPanel.h"
#include "Common/Dict.h"
#include "WBPopupSlider.h"
class MapObject;
class ModifyObjectUndoable;
/////////////////////////////////////////////////////////////////////////////
// External Defines
extern const char* NEUTRAL_TEAM_UI_STR;
extern const char* NEUTRAL_TEAM_INTERNAL_STR;
/////////////////////////////////////////////////////////////////////////////
// MapObjectProps dialog
class MapObjectProps : public COptionsPanel, public PopupSliderOwner
{
// Construction
public:
MapObjectProps(Dict* dictToEdit = NULL, const char* title = NULL, CWnd* pParent = NULL); // standard constructor
~MapObjectProps();
void makeMain();
// Dialog Data
//{{AFX_DATA(MapObjectProps)
enum { IDD = IDD_MAPOBJECT_PROPS };
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(MapObjectProps)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
void getAllSelectedDicts(void);
static MapObjectProps *TheMapObjectProps;
Dict* m_dictToEdit;
std::vector<Dict*> m_allSelectedDicts;
const char* m_title;
MapObject *m_selectedObject;
void updateTheUI(void);
void enableButtons();
int getSel();
WBPopupSliderButton m_heightSlider;
WBPopupSliderButton m_angleSlider;
Real m_angle;
Real m_height;
ModifyObjectUndoable *m_posUndoable;
// Generated message map functions
//{{AFX_MSG(MapObjectProps)
afx_msg void OnSelchangeProperties();
virtual BOOL OnInitDialog();
afx_msg void OnEditprop();
afx_msg void OnNewprop();
afx_msg void OnRemoveprop();
afx_msg void OnDblclkProperties();
virtual void OnOK();
virtual void OnCancel();
afx_msg void _TeamToDict(void);
afx_msg void _NameToDict(void);
afx_msg void _HealthToDict(void);
afx_msg void _EnabledToDict(void);
afx_msg void _ScriptToDict(void);
afx_msg void _IndestructibleToDict(void);
afx_msg void _UnsellableToDict(void);
afx_msg void _TargetableToDict();
afx_msg void _PoweredToDict(void);
afx_msg void _AggressivenessToDict(void);
afx_msg void _VisibilityToDict(void);
afx_msg void _VeterancyToDict(void);
afx_msg void _ShroudClearingDistanceToDict(void);
afx_msg void _RecruitableAIToDict(void);
afx_msg void _SelectableToDict(void);
afx_msg void _WeatherToDict(void);
afx_msg void _TimeToDict(void);
afx_msg void _PrebuiltUpgradesToDict(void);
afx_msg void SetZOffset(void);
afx_msg void SetAngle(void);
afx_msg void _HPsToDict();
afx_msg void _StoppingDistanceToDict(void);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
void _DictToTeam(void);
void _DictToName(void);
void _DictToHealth(void);
void _DictToHPs(void);
void _DictToEnabled(void);
void _DictToScript(void);
void _DictToDestructible(void);
void _DictToUnsellable(void);
void _DictToTargetable(void);
void _DictToPowered(void);
void _DictToAggressiveness(void);
void _DictToVisibilityRange(void);
void _DictToVeterancy(void);
void _DictToShroudClearingDistance(void);
void _DictToRecruitableAI();
void _DictToSelectable(void);
void _DictToWeather(void);
void _DictToTime(void);
void ShowZOffset(MapObject* pMapObj);
void ShowAngle(MapObject* pMapObj);
void _DictToStoppingDistance(void);
void _DictToPrebuiltUpgrades(void);
public:
virtual void GetPopSliderInfo(const long sliderID, long *pMin, long *pMax, long *pLineSize, long *pInitial);
virtual void PopSliderChanged(const long sliderID, long theVal);
virtual void PopSliderFinished(const long sliderID, long theVal);
static MapObject *getSingleSelectedMapObject(void);
static void update(void);
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_MAPOBJECTPROPS_H__44517B9E_12AB_4E2C_B49B_D6BB65C59649__INCLUDED_)

View file

@ -0,0 +1,92 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
#if !defined(AFX_PLAYERLISTDLG_H__103B4125_78ED_48A8_9DBB_289DDC6B0208__INCLUDED_)
#define AFX_PLAYERLISTDLG_H__103B4125_78ED_48A8_9DBB_289DDC6B0208__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// playerlistdlg.h : header file
//
#include "GameLogic/SidesList.h"
#include "CButtonShowColor.h"
/////////////////////////////////////////////////////////////////////////////
// PlayerListDlg dialog
class PlayerListDlg : public CDialog
{
// Construction
public:
PlayerListDlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(PlayerListDlg)
enum { IDD = IDD_PLAYERLIST };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(PlayerListDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
Int m_updating;
SidesList m_sides;
Int m_curPlayerIdx;
CButtonShowColor m_colorButton;
void updateTheUI(void);
void PopulateColorComboBox(void);
void SelectColor(RGBColor rgb);
// Generated message map functions
//{{AFX_MSG(PlayerListDlg)
afx_msg void OnNewplayer();
afx_msg void OnEditplayer();
afx_msg void OnRemoveplayer();
afx_msg void OnSelchangePlayers();
virtual BOOL OnInitDialog();
afx_msg void OnDblclkPlayers();
afx_msg void OnSelchangeAllieslist();
afx_msg void OnSelchangeEnemieslist();
virtual void OnOK();
virtual void OnCancel();
afx_msg void OnPlayeriscomputer();
afx_msg void OnEditchangePlayerfaction();
afx_msg void OnChangePlayername();
afx_msg void OnChangePlayerdisplayname();
afx_msg void OnColorPress();
afx_msg void OnSelectPlayerColor();
afx_msg void OnAddskirmishplayers();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_PLAYERLISTDLG_H__103B4125_78ED_48A8_9DBB_289DDC6B0208__INCLUDED_)

View file

@ -0,0 +1,77 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
#if !defined(AFX_PROPEDIT_H__93C02F45_592B_4CFD_A092_7445559D26EB__INCLUDED_)
#define AFX_PROPEDIT_H__93C02F45_592B_4CFD_A092_7445559D26EB__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// propedit.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// PropEdit dialog
class PropEdit : public CDialog
{
// Construction
public:
PropEdit(AsciiString* key, Dict::DataType* type, AsciiString* value, Bool valueOnly, CWnd *parent = NULL);
// Dialog Data
//{{AFX_DATA(PropEdit)
enum { IDD = IDD_PROPEDIT };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(PropEdit)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
AsciiString* m_key;
Dict::DataType* m_type;
AsciiString* m_value;
Bool m_valueOnly;
int m_updating;
void validate();
// Generated message map functions
//{{AFX_MSG(PropEdit)
afx_msg void OnChangeKeyname();
afx_msg void OnEditchangeKeytype();
afx_msg void OnCloseupKeytype();
afx_msg void OnSelchangeKeytype();
afx_msg void OnChangeValue();
virtual BOOL OnInitDialog();
afx_msg void OnPropbool();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_PROPEDIT_H__93C02F45_592B_4CFD_A092_7445559D26EB__INCLUDED_)

View file

@ -0,0 +1,101 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
#if !defined(AFX_TEAMSDIALOG_H__1410F415_1597_4EAF_AE0B_42DACDEB35B9__INCLUDED_)
#define AFX_TEAMSDIALOG_H__1410F415_1597_4EAF_AE0B_42DACDEB35B9__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// teamsdialog.h : header file
//
#include "GameLogic/SidesList.h"
/////////////////////////////////////////////////////////////////////////////
// CTeamsDialog dialog
class CTeamsDialog : public CDialog
{
// Construction
public:
CTeamsDialog(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CTeamsDialog)
enum { IDD = IDD_TEAMS_DIALOG };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CTeamsDialog)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CTeamsDialog)
virtual BOOL OnInitDialog();
virtual void OnOK();
virtual void OnCancel();
afx_msg void OnNewteam();
afx_msg void OnDeleteteam();
afx_msg void OnEditTemplate();
afx_msg void OnSelchangePlayerList();
afx_msg void OnClickTeamsList(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnDblclkTeamsList(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnCopyteam();
afx_msg void OnSelectTeamMembers();
afx_msg void OnMoveDownTeam();
afx_msg void OnMoveUpTeam();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
Int m_updating;
SidesList m_sides;
Int m_curTeam;
enum
{
REBUILD_TEAMS = 0x01,
REBUILD_OWNERS = 0x02,
REBUILD_ALLIES = 0x04,
REBUILD_NONE = 0x00,
REBUILD_ALL = 0xff
};
void updateUI(Int whatToRebuild);
void validateTeamOwners( void );
Bool isValidTeamOwner( AsciiString ownerName );
void doCorrectTeamOwnerDialog( TeamsInfo *ti );
private:
void UpdateTeamsList(void);
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_TEAMSDIALOG_H__1410F415_1597_4EAF_AE0B_42DACDEB35B9__INCLUDED_)

View file

@ -0,0 +1,249 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
#if !defined(AFX_WBVIEW_H__875234A1_8815_11D5_8CE0_00010297BBAC__INCLUDED_)
#define AFX_WBVIEW_H__875234A1_8815_11D5_8CE0_00010297BBAC__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "Lib/BaseType.h"
#include "Tool.h"
#include "Common/Debug.h"
#include "Common/ThingSort.h"
class CWorldBuilderDoc;
class BuildListInfo;
// wbview.h : header file
//
enum TPickedStatus {
PICK_NONE,
PICK_CENTER,
PICK_ARROW
};
/////////////////////////////////////////////////////////////////////////////
// WbView view
class WbView : public CView
{
protected:
WbView(); // protected constructor used by dynamic creation
DECLARE_DYNCREATE(WbView)
TTrackingMode m_trackingMode;
Vector3 m_centerPt;
void mouseDown(TTrackingMode m, CPoint viewPt);
void mouseMove(TTrackingMode m, CPoint viewPt);
void mouseUp(TTrackingMode m, CPoint viewPt);
void constrainCenterPt();
WorldHeightMapEdit *getTrackingHeightMap();
static Bool m_snapToGrid;
Bool m_showObjects; ///< Flag whether object icons are drawn in the 2d and 3d view.
Bool m_showModels; ///< Flag whether models are drawn in the 2d and 3d view.
Bool m_showNames; ///< Flag whether names are drawn in the 2d and 3d view.
Bool m_showGarrisoned;
Bool m_showWaypoints;
Bool m_showPolygonTriggers;
Bool m_showTerrain; ///< Flag whether terrain is rendered or not. (Useful for debugging)
Real m_hysteresis;
Bool m_lockAngle; ///< Reflects the ui button.
//Bool m_lockVertical; ///< Reflects the ui button.
Bool m_doLockAngle; ///< True if we are currently locking.
//Bool m_doLockVertical; ///< True if we are currently locking.
CPoint m_mouseDownPoint;
Coord3D m_mouseDownDocPoint;
// Box feedback.
RECT m_feedbackBox;
Bool m_doRectFeedback;
// Light direction feedback
Coord3D m_lightDirection[3]; //direction of all 3 lights
Bool m_doLightFeedback;
EditorSortingType m_pickConstraint;
// Attributes
public:
void doRectFeedback(Bool doFeedback, RECT &rect) {m_feedbackBox=rect;m_doRectFeedback = doFeedback;};
void doLightFeedback(Bool doFeedback, Coord3D direction, Int lightIndex) { m_doLightFeedback=doFeedback; if (m_doLightFeedback) m_lightDirection[lightIndex]=direction;}
virtual Bool viewToDocCoords(CPoint curPt, Coord3D *newPt, Bool constrained=true) { DEBUG_CRASH(("should not call")); newPt->zero(); return false; }
virtual Bool docToViewCoords(Coord3D curPt, CPoint* newPt) { DEBUG_CRASH(("should not call")); return false; }
virtual Bool viewToDocCoordZ(CPoint curPt, Coord3D *newPt, Real Z) { return viewToDocCoords(curPt, newPt, false); }
/// Set the center for display.
virtual void setCenterInView(Real x, Real y) { }
/// Update the height map in the 3d window.
virtual void updateHeightMapInView(WorldHeightMap *htMap, Bool partial, const IRegion2D &partialRange) { }
/// the doc has changed size; readjust view as necessary.
virtual void adjustDocSize() { }
/// Scrolls the window by this amount.
virtual void scrollInView(Real x, Real y, Bool end) { DEBUG_CRASH(("should not call")); }
/// Invalidates an object. Pass NULL to inval all objects.
virtual void invalObjectInView(MapObject *pObj) { }
/// Invalidates the area of one height map cell in the 2d view.
virtual void invalidateCellInView(int xIndex, int yIndex) { }
virtual void setDefaultCamera() { }
virtual void rotateCamera(Real delta) { }
virtual void pitchCamera(Real delta) { }
virtual Int getPickPixels(void) {return 4;}
virtual EditorSortingType GetPickConstraint(void) {return m_pickConstraint;}
public:
CWorldBuilderDoc *WbDoc() { return ((CWorldBuilderDoc*)GetDocument()); }
void snapPoint(Coord3D *thePt) {if (m_snapToGrid || m_lockAngle) {thePt->x = MAP_XY_FACTOR*floor(thePt->x/MAP_XY_FACTOR+0.5); thePt->y = MAP_XY_FACTOR*floor(thePt->y/MAP_XY_FACTOR+0.5);};};
virtual TPickedStatus picked(MapObject *pObj, Coord3D docPt);
virtual MapObject *picked3dObjectInView(CPoint viewPt) {return NULL;};
virtual BuildListInfo *pickedBuildObjectInView(CPoint viewPt) {return NULL;};
Bool isPolygonTriggerVisible(void) {return m_showPolygonTriggers;};
Bool isWaypointVisible(void) {return m_showWaypoints;};
Bool isNamesVisible(void) {return m_showNames;};
void setShowModels(Bool show) {m_showModels = show;}
Bool getShowModels(void) { return m_showModels;}
Bool getShowTerrain(void) { return m_showTerrain;}
void setShowGarrisoned(Bool show) {m_showGarrisoned = show;}
Bool getShowGarrisoned(void) { return m_showGarrisoned;}
virtual Bool isDoingPitch( void ) { return false; }
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(WbView)
protected:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
//}}AFX_VIRTUAL
// Implementation
protected:
virtual ~WbView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
// Generated message map functions
protected:
//{{AFX_MSG(WbView)
afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnMButtonUp(UINT nFlags, CPoint point);
afx_msg void OnMButtonDown(UINT nFlags, CPoint point);
afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
afx_msg void OnEditDelete();
afx_msg void OnEditCopy();
afx_msg void OnUpdateEditCopy(CCmdUI* pCmdUI);
afx_msg void OnEditCut();
afx_msg void OnUpdateEditCut(CCmdUI* pCmdUI);
afx_msg void OnEditPaste();
afx_msg void OnUpdateEditPaste(CCmdUI* pCmdUI);
afx_msg void OnViewSnaptogrid();
afx_msg void OnUpdateViewSnaptogrid(CCmdUI* pCmdUI);
afx_msg void OnViewShowObjects();
afx_msg void OnUpdateViewShowObjects(CCmdUI* pCmdUI);
afx_msg void OnEditSelectdup();
afx_msg void OnEditSelectsimilar();
afx_msg void OnEditSelectinvalidteam();
afx_msg void OnEditReplace();
afx_msg void OnObjectpropertiesReflectsinmirror();
afx_msg void OnLockHorizontal();
afx_msg void OnUpdateLockHorizontal(CCmdUI* pCmdUI);
afx_msg void OnLockVertical();
afx_msg void OnUpdateLockVertical(CCmdUI* pCmdUI);
afx_msg void OnEditGloballightoptions();
afx_msg void OnViewShowwaypoints();
afx_msg void OnUpdateViewShowwaypoints(CCmdUI* pCmdUI);
afx_msg void OnViewShowpolygontriggers();
afx_msg void OnUpdateViewShowpolygontriggers(CCmdUI* pCmdUI);
afx_msg void OnEditPlayerlist();
afx_msg void OnEditWorldinfo();
afx_msg void OnEditTeamlist();
afx_msg void OnUpdateObjectpropertiesReflectsinmirror(CCmdUI* pCmdUI);
afx_msg void OnPickStructures();
afx_msg void OnUpdatePickStructures(CCmdUI* pCmdUI);
afx_msg void OnPickInfantry();
afx_msg void OnUpdatePickInfantry(CCmdUI* pCmdUI);
afx_msg void OnPickVehicles();
afx_msg void OnUpdatePickVehicles(CCmdUI* pCmdUI);
afx_msg void OnPickShrubbery();
afx_msg void OnUpdatePickShrubbery(CCmdUI* pCmdUI);
afx_msg void OnPickManMade();
afx_msg void OnUpdatePickManMade(CCmdUI* pCmdUI);
afx_msg void OnPickNatural();
afx_msg void OnUpdatePickNatural(CCmdUI* pCmdUI);
afx_msg void OnPickDebris();
afx_msg void OnUpdatePickDebris(CCmdUI* pCmdUI);
afx_msg void OnPickAnything();
afx_msg void OnUpdatePickAnything(CCmdUI* pCmdUI);
afx_msg void OnPickWaypoints();
afx_msg void OnUpdatePickWaypoints(CCmdUI* pCmdUI);
afx_msg void OnPickRoads();
afx_msg void OnUpdatePickRoads(CCmdUI* pCmdUI);
afx_msg void OnPickSounds();
afx_msg void OnUpdatePickSounds(CCmdUI* pCmdUI);
afx_msg void OnShowNames();
afx_msg void OnUpdateShowNames(CCmdUI* pCmdUI);
afx_msg void OnValidationFixTeams();
afx_msg void OnShowTerrain();
afx_msg void OnUpdateShowTerrain(CCmdUI* pCmdUI);
afx_msg int OnCreate(LPCREATESTRUCT lpcs);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_WBVIEW_H__875234A1_8815_11D5_8CE0_00010297BBAC__INCLUDED_)

View file

@ -0,0 +1,308 @@
/*
** 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 <http://www.gnu.org/licenses/>.
*/
// WbView3d.h
// Class to encapsulate height map.
// Author: Steven Johnson, Aug 2001
#if !defined(AFX_WBVIEW3D_H__832D8241_87F6_11D5_8CE0_00010297BBAC__INCLUDED_)
#define AFX_WBVIEW3D_H__832D8241_87F6_11D5_8CE0_00010297BBAC__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// wbview3d.h : header file
//
#include "Lib/BaseType.h"
#include "rendobj.h"
#include "robjlist.h"
#include "WbView.h"
#include "common/gameType.h"
#include "common/GlobalData.h"
#include "common/ModelState.h"
#include "dx8wrapper.h"
//#include "GameLogic/Module/BodyModule.h" -- Yikes... not necessary to include this! (KM)
enum BodyDamageType; //Ahhhh much better!
class WorldHeightMap;
class LayerClass;
class IntersectionClass;
class W3DAssetManager;
class SkeletonSceneClass;
class CameraClass;
class WBHeightMap;
class LightClass;
class MapObject;
class DrawObject;
class CWorldBuilderView;
class BuildListInfo;
class TransRenderObj;
struct ID3DXFont;
/////////////////////////////////////////////////////////////////////////////
// WbView3d view
class WbView3d : public WbView, public DX8_CleanupHook
{
protected:
WbView3d(); // protected constructor used by dynamic creation
DECLARE_DYNCREATE(WbView3d)
// Attributes
public:
// DX8_CleanupHook methods
virtual void ReleaseResources(void); ///< Release all dx8 resources so the device can be reset.
virtual void ReAcquireResources(void); ///< Reacquire all resources after device reset.
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(WbView3d)
protected:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
//}}AFX_VIRTUAL
// Implementation
protected:
virtual ~WbView3d();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
// Generated message map functions
protected:
//{{AFX_MSG(WbView3d)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnPaint();
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);
afx_msg void OnTimer(UINT nIDEvent);
afx_msg void OnDestroy();
afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);
afx_msg void OnViewShowwireframe();
afx_msg void OnUpdateViewShowwireframe(CCmdUI* pCmdUI);
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
afx_msg void OnViewShowentire3dmap();
afx_msg void OnUpdateViewShowentire3dmap(CCmdUI* pCmdUI);
afx_msg void OnViewShowtopdownview();
afx_msg void OnUpdateViewShowtopdownview(CCmdUI* pCmdUI);
afx_msg void OnViewShowclouds();
afx_msg void OnUpdateViewShowclouds(CCmdUI* pCmdUI);
afx_msg void OnViewShowmacrotexture();
afx_msg void OnUpdateViewShowmacrotexture(CCmdUI* pCmdUI);
afx_msg void OnEditSelectmacrotexture();
afx_msg void OnLookEast();
afx_msg void OnUpdateLookEast(CCmdUI* pCmdUI);
afx_msg void OnLookNorth();
afx_msg void OnUpdateLookNorth(CCmdUI* pCmdUI);
afx_msg void OnLookSouth();
afx_msg void OnUpdateLookSouth(CCmdUI* pCmdUI);
afx_msg void OnLookWest();
afx_msg void OnUpdateLookWest(CCmdUI* pCmdUI);
afx_msg void OnViewShowshadows();
afx_msg void OnUpdateViewShowshadows(CCmdUI* pCmdUI);
afx_msg void OnViewShowSoftWater();
afx_msg void OnUpdateViewShowSoftWater(CCmdUI* pCmdUI);
afx_msg void OnViewExtraBlends();
afx_msg void OnUpdateViewShowExtraBlends(CCmdUI* pCmdUI);
afx_msg void OnEditShadows();
afx_msg void OnEditMapSettings();
afx_msg void OnViewShowimpassableareas();
afx_msg void OnUpdateViewShowimpassableareas(CCmdUI* pCmdUI);
afx_msg void OnImpassableAreaOptions();
afx_msg void OnViewPartialmapsize96x96();
afx_msg void OnUpdateViewPartialmapsize96x96(CCmdUI* pCmdUI);
afx_msg void OnViewPartialmapsize192x192();
afx_msg void OnUpdateViewPartialmapsize192x192(CCmdUI* pCmdUI);
afx_msg void OnViewPartialmapsize160x160();
afx_msg void OnUpdateViewPartialmapsize160x160(CCmdUI* pCmdUI);
afx_msg void OnViewPartialmapsize128x128();
afx_msg void OnUpdateViewPartialmapsize128x128(CCmdUI* pCmdUI);
afx_msg void OnViewShowModels();
afx_msg void OnUpdateViewShowModels(CCmdUI* pCmdUI);
afx_msg void OnViewLayersList();
afx_msg void OnUpdateViewLayersList(CCmdUI* pCmdUI);
afx_msg void OnViewGarrisoned();
afx_msg void OnUpdateViewGarrisoned(CCmdUI* pCmdUI);
afx_msg void OnViewShowMapBoundaries();
afx_msg void OnUpdateViewShowMapBoundaries(CCmdUI* pCmdUI);
afx_msg void OnViewShowAmbientSounds();
afx_msg void OnUpdateViewShowAmbientSounds(CCmdUI* pCmdUI);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
HINSTANCE m_hInst;
W3DAssetManager *m_assetManager;
SkeletonSceneClass *m_scene;
SkeletonSceneClass *m_overlayScene;
SkeletonSceneClass *m_baseBuildScene;
SkeletonSceneClass *m_transparentObjectsScene;
CameraClass *m_camera;
WBHeightMap *m_heightMapRenderObj;
RenderObjClass *m_objectToolTrackingObj;
Bool m_showObjToolTrackingObj;
AsciiString m_objectToolTrackingModelName;
Real m_mouseWheelOffset;
Real m_groundLevel;
Coord3D m_cameraOffset;
CPoint m_actualWinSize;
Real m_theta;
Real m_cameraAngle;
Real m_FXPitch;
Bool m_doPitch;
Real m_actualHeightAboveGround; // for camera tool display only
Vector3 m_cameraSource; // for camera tool display only
Vector3 m_cameraTarget; // for camera tool display only
Int m_time;
Int m_updateCount;
UINT m_timer;
DrawObject *m_drawObject;
RefRenderObjListClass m_lightList;
LayerClass *m_layer;
LayerClass *m_buildLayer;
IntersectionClass *m_intersector;
Bool m_showWireframe;
Bool m_ww3dInited;
Bool m_needToLoadRoads;
LightClass *m_globalLight[MAX_GLOBAL_LIGHTS];
RenderObjClass *m_lightFeedbackMesh[MAX_GLOBAL_LIGHTS];
Real m_buildRedMultiplier;
Real m_curTrackingZ;
Bool m_projection; ///< True if top down projection instead of "isometric" perspective.
Bool m_showEntireMap; ///< True if drawing entire map instead of cached fast subset.
Bool m_showShadows; ///< True if drawing shadows.
Bool m_firstPaint; ///< True if we haven't painted yet.
Bool m_showLayersList; ///< Flag whether the layers list is visible or not.
Bool m_showMapBoundaries; ///< Flag whether to show all the map boundaries or not
Bool m_showAmbientSounds; ///< Flag whether to show all the ambient sounds or not
ID3DXFont* m3DFont;
Int m_pickPixels;
Int m_partialMapSize;
protected:
UINT getLastDrawTime();
void init3dScene();
void initAssets();
void initWW3D();
void drawLabels(HDC hdc);
void drawLabels(void);
void shutdownWW3D();
void killTheTimer();
void render();
void setupCamera();
void updateHysteresis(void);
void updateLights();
void updateScorches();
public:
virtual Bool viewToDocCoords(CPoint curPt, Coord3D *newPt, Bool constrain=true);
virtual Bool docToViewCoords(Coord3D curPt, CPoint* newPt);
virtual void updateHeightMapInView(WorldHeightMap *htMap, Bool partial, const IRegion2D &partialRange);
/// Invalidates an object. Pass NULL to inval all objects.
virtual void invalObjectInView(MapObject *pObj);
// find the best model for an object
AsciiString getBestModelName(const ThingTemplate* tt, const ModelConditionFlags& c);
/// Invalidates an build list object.
void invalBuildListItemInView(BuildListInfo *pBuild);
/// Invalidates the area of one height map cell in the 2d view.
virtual void invalidateCellInView(int xIndex, int yIndex);
/// Scrolls the window by this amount.
virtual void scrollInView(Real x, Real y, Bool end);
virtual void setDefaultCamera();
virtual void rotateCamera(Real delta);
virtual void pitchCamera(Real delta);
void setCameraPitch(Real absolutePitch);
Real getCameraPitch(void);
Real getHeightAboveGround(void) { return m_actualHeightAboveGround; }
Vector3 getCameraSource(void) { return m_cameraSource; }
Vector3 getCameraTarget(void) { return m_cameraTarget; }
Real getCameraAngle(void) { return m_cameraAngle; }
virtual MapObject *picked3dObjectInView(CPoint viewPt);
virtual BuildListInfo *pickedBuildObjectInView(CPoint viewPt);
void removeFenceListObjects(MapObject *pObject);
void updateFenceListObjects(MapObject *pObject);
/// Removes all render objects. Call when swithing to a new map.
void resetRenderObjects();
void stepTimeOfDay(void);
void reset3dEngineDisplaySize(Int width, Int height); ///< Closes & reinitializes w3d.
void setLighting(const GlobalData::TerrainLighting *tl, Int whichLighting, Int whichLight=0);
DrawObject *getDrawObject(void) {return m_drawObject;};
AsciiString getModelNameAndScale(MapObject *pMapObj, Real *scale, BodyDamageType curDamageState);
virtual Int getPickPixels(void) {return m_pickPixels;}
virtual Bool viewToDocCoordZ(CPoint curPt, Coord3D *newPt, Real Z);
public:
// void init(CWorldBuilderView *pMainView, HINSTANCE hInstance, CWnd* parent);
void redraw();
virtual void setCenterInView(Real x, Real y);
Bool getShowTerrain();
Bool getShowWireframe();
void setObjTracking(MapObject *pMapObj, Coord3D pos, Real angle, Bool show);
void setViewLayersList(Bool showLayersList) { m_showLayersList = showLayersList; }
Bool getShowMapBoundaryFeedback(void) const { return m_showMapBoundaries; }
Bool getShowAmbientSoundsFeedback(void) const { return m_showAmbientSounds; }
void togglePitchAndRotation( void ) { m_doPitch = !m_doPitch; }
virtual Bool isDoingPitch( void ) { return m_doPitch; }
};
inline UINT WbView3d::getLastDrawTime() { return m_time; }
inline Bool WbView3d::getShowWireframe() { return m_showWireframe; }
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_WBVIEW3D_H__832D8241_87F6_11D5_8CE0_00010297BBAC__INCLUDED_)