Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Core/GameEngine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ set(GAMEENGINE_SRC
# Include/GameLogic/ObjectScriptStatusBits.h
# Include/GameLogic/ObjectTypes.h
# Include/GameLogic/PartitionManager.h
# Include/GameLogic/PolygonTrigger.h
Include/GameLogic/PolygonTrigger.h
# Include/GameLogic/Powers.h
Include/GameLogic/RankInfo.h
# Include/GameLogic/ScriptActions.h
Expand Down Expand Up @@ -851,7 +851,7 @@ set(GAMEENGINE_SRC
# Source/GameLogic/AI/AITNGuard.cpp
# Source/GameLogic/AI/Squad.cpp
# Source/GameLogic/AI/TurretAI.cpp
# Source/GameLogic/Map/PolygonTrigger.cpp
Source/GameLogic/Map/PolygonTrigger.cpp
# Source/GameLogic/Map/SidesList.cpp
# Source/GameLogic/Map/TerrainLogic.cpp
# Source/GameLogic/Object/Armor.cpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,12 +186,14 @@ Bool PolygonTrigger::ParsePolygonTriggersDataChunk(DataChunkInput &file, DataChu
loc.z = file.readInt();
pTrig->addPoint(loc);
}
#if RTS_ZEROHOUR
if (numPoints<2) {
DEBUG_LOG(("Deleting polygon trigger '%s' with %d points.",
pTrig->getTriggerName().str(), numPoints));
deleteInstance(pTrig);
continue;
}
#endif
if (pPrevTrig) {
pPrevTrig->setNextPoly(pTrig);
} else {
Expand Down Expand Up @@ -239,7 +241,11 @@ Bool PolygonTrigger::ParsePolygonTriggersDataChunk(DataChunkInput &file, DataChu
*/
void PolygonTrigger::WritePolygonTriggersDataChunk(DataChunkOutput &chunkWriter)
{
#if RTS_GENERALS
chunkWriter.openDataChunk("PolygonTriggers", K_TRIGGERS_VERSION_3);
#else
chunkWriter.openDataChunk("PolygonTriggers", K_TRIGGERS_VERSION_4);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs to be behind RTS_ZEROHOUR guards

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in #3024. Both writer implementations now use RETAIL_COMPATIBLE_WORLDBUILDER && RTS_GENERALS: Generals writes version 3 by default, while Zero Hour and non-compatible Generals builds write version 4.

#endif

PolygonTrigger *pTrig;
Int count = 0;
Expand All @@ -249,7 +255,9 @@ void PolygonTrigger::WritePolygonTriggersDataChunk(DataChunkOutput &chunkWriter)
chunkWriter.writeInt(count);
for (pTrig=PolygonTrigger::getFirstPolygonTrigger(); pTrig; pTrig = pTrig->getNext()) {
chunkWriter.writeAsciiString(pTrig->getTriggerName());
#if RTS_ZEROHOUR
chunkWriter.writeAsciiString(pTrig->getLayerName());

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs to be behind RTS_ZEROHOUR guards

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated alongside the version selection. layerName is written only when the version 4 branch is selected, using !(RETAIL_COMPATIBLE_WORLDBUILDER && RTS_GENERALS) in both games.

#endif
chunkWriter.writeInt(pTrig->getID());
chunkWriter.writeByte(pTrig->isWaterArea());
chunkWriter.writeByte(pTrig->isRiver());
Expand Down
4 changes: 2 additions & 2 deletions Generals/Code/GameEngine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ set(GAMEENGINE_SRC
Include/GameLogic/ObjectScriptStatusBits.h
Include/GameLogic/ObjectTypes.h
Include/GameLogic/PartitionManager.h
Include/GameLogic/PolygonTrigger.h
# Include/GameLogic/PolygonTrigger.h
Include/GameLogic/Powers.h
# Include/GameLogic/RankInfo.h
Include/GameLogic/ScriptActions.h
Expand Down Expand Up @@ -787,7 +787,7 @@ set(GAMEENGINE_SRC
Source/GameLogic/AI/AITNGuard.cpp
Source/GameLogic/AI/Squad.cpp
Source/GameLogic/AI/TurretAI.cpp
Source/GameLogic/Map/PolygonTrigger.cpp
# Source/GameLogic/Map/PolygonTrigger.cpp
Source/GameLogic/Map/SidesList.cpp
Source/GameLogic/Map/TerrainLogic.cpp
Source/GameLogic/Object/Armor.cpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
#define K_TRIGGERS_VERSION_1 1
#define K_TRIGGERS_VERSION_2 2 // Added m_isWaterArea
#define K_TRIGGERS_VERSION_3 3 // Added m_isRiver & m_riverStart
#define K_TRIGGERS_VERSION_4 4 // Added layer name.
#define K_LIGHTING_VERSION_1 1
#define K_LIGHTING_VERSION_2 2 // Added 2 additional global lights for objects.
#define K_LIGHTING_VERSION_3 3 // Added 2 additional global lights for terrain.
Expand Down
5 changes: 5 additions & 0 deletions Generals/Code/GameEngine/Include/Common/ThingTemplate.h
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,7 @@ class ThingTemplate : public Overridable

// Only Object can ask this. Everyone else should ask the Object. In fact, you really should ask the Object everything.
Real friend_getVisionRange() const { return m_visionRange; } ///< get vision range
Real friend_calcVisionRange() const { return m_visionRange; } ///< get vision range
Real friend_getShroudClearingRange() const { return m_shroudClearingRange; } ///< get vision range for Shroud ONLY (Design requested split)

// This function is only for use by the AIUpdateModuleData::parseLocomotorSet function.
Expand Down Expand Up @@ -505,6 +506,8 @@ class ThingTemplate : public Overridable
const AudioEventRTS *getSoundPromotedHero() const { return getAudio(TTAUDIO_soundPromotedHero); }
const AudioEventRTS *getSoundFalling() const { return getAudio(TTAUDIO_soundFalling); }

Bool hasSoundAmbient() const { return hasAudio(TTAUDIO_soundAmbient); }

const AudioEventRTS *getPerUnitSound(const AsciiString& soundName) const;
const FXList* getPerUnitFX(const AsciiString& fxName) const;

Expand Down Expand Up @@ -610,6 +613,8 @@ class ThingTemplate : public Overridable

AsciiString getUpgradeCameoName( Int n)const{ return m_upgradeCameoUpgradeNames[n]; }

const WeaponTemplateSetVector& getWeaponTemplateSets() const {return m_weaponTemplateSets;}

protected:

//
Expand Down
74 changes: 74 additions & 0 deletions Generals/Code/GameEngine/Include/Common/WellKnownKeys.h
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,80 @@ DEFINE_KEY(objectGrantUpgrade)
*/
DEFINE_KEY(uniqueID)

/**
Which: MapObject Properties
Type: AsciiString
Usage: What ambient sound does this object have attached to it?
Missing means "Use the default sound for object type from INI"
Blank means "No ambient sound"
*/
DEFINE_KEY(objectSoundAmbient)

/**
Which: MapObject Properties
Type: Bool
Usage: Does the ambient sound have customized flags & properties? Blank or false - use INI parameters for sound
*/
DEFINE_KEY(objectSoundAmbientCustomized)

/**
Which: MapObject Properties
Type: Bool
Usage: Does the ambient sound start off playing?
Blank -- use default of true for looping sounds, false for non-looping sounds
*/
DEFINE_KEY(objectSoundAmbientEnabled)

/**
Which: MapObject Properties
Type: Bool
Usage: Does the ambient sound loop? Blank -- use default for sound
*/
DEFINE_KEY(objectSoundAmbientLooping)

/**
Which: MapObject Properties
Type: Int
Usage: How many times does the sound loop (0 = forever)? Blank - use default for sound
*/
DEFINE_KEY(objectSoundAmbientLoopCount)

/**
Which: MapObject Properties
Type: Real
Usage: Minimum volume of sound. Blank - use default for sound
*/
DEFINE_KEY(objectSoundAmbientMinVolume)

/**
Which: MapObject Properties
Type: Real
Usage: Base volume of sound. Blank - use default for sound
*/
DEFINE_KEY(objectSoundAmbientVolume)

/**
Which: MapObject Properties
Type: Real
Usage: Minimum range of sound. Within this area, sound plays at full volume. Blank - use default for sound
*/
DEFINE_KEY(objectSoundAmbientMinRange)

/**
Which: MapObject Properties
Type: Real
Usage: Maximum range of sound. Sound drops to zero at this range Blank - use default for sound
*/
DEFINE_KEY(objectSoundAmbientMaxRange)

/**
Which: MapObject Properties
Type: Int
Usage: Priority of sound using the enum AudioPriority Blank - use default for sound
*/
DEFINE_KEY(objectSoundAmbientPriority)



// ---------------------------------------------------------------------------------------
// well-known keys in Player dicts.
Expand Down
140 changes: 0 additions & 140 deletions Generals/Code/GameEngine/Include/GameLogic/PolygonTrigger.h

This file was deleted.

Loading