Skip to content

Zero Hour rebuilt from EA's source: x64, Direct3D 11, VS2022/CMake, ~60 original bugs fixed, an AI that builds a base. Bring your own game.

feat(w3ddevice): classic graphics is retail's world picture

Olcay Seygan8f305569190b
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ca7b3ee62..4df847816 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -19,6 +19,7 @@ found and fixed, EA's own, not port damage.**
- A first start now opens the game EA shipped: its own textures and ground, the hard stencil shadows, the flat 2003 light, no glow, bilinear filtering, the original sound mix, health bars only on what you select or point at. The HD art stays on your disk, unmounted. Every setting this build added to the picture, the sound and the controls starts off, and each one is a box in Options.
- One click brings the other game back. Options, Graphics, untick Classic Graphics: the High preset fills in every Reforged box on the page, you can move the quality slider from there, and Accept saves it for the next start. Tick it again and the same boxes go off.
- Defaults in Options now means this game too. It used to leave every setting this build added where you had put it, so a Reforged page stayed Reforged after the click. Now it ticks Classic Graphics and puts every row back where a first start has it, the controls and the sound included. Your language, window mode and resolution stay, and unticking the box still gives you High.
+- Classic now means EA's picture in a fight too, checked side by side against the real 2003 game on this machine. Every explosion, every muzzle flash and all the black smoke this build retuned goes back to EA's own numbers under Classic: 132 effect lists and 235 particle systems stand as shipped, and the 51 particle systems this build invented draw nothing. So do the slow water, the eased hull turn, tank barrels that tilt to the target and the grade insignia on units, which return to the three chevrons, and a match opens at EA's camera height. Tick off Classic and Reforged has all of it, down to the pixel. Two players on different looks still share a match, and we ran one 3000 frames with no mismatch.
- A detail preset now means EA's detail settings. Before this, a preset in your settings file switched on team glow, water foam and 4x multisampling behind any box you could see, and not on the very first start, so the first start and the second drew different pictures. Now a Reforged setting comes on from its own line, which the menu writes when you accept.
- Smooth Motion, the blending that made units glide on a fast monitor, had no switch at all. It is a box in Options, Display, off until ticked, and a 60 Hz screen shows no difference either way.
- Already playing? Nothing in your settings file gets rewritten and every line in it still wins. A setting you never touched has no line, so it takes the new default, which for most of you means Classic on your next start. Untick Classic Graphics once and you are back. The settings can differ between players in one match: none of them reaches the game's logic.
diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/FXList.h b/GeneralsMD/Code/GameEngine/Include/GameClient/FXList.h
index 5213fbf88..b7086199c 100644
--- a/GeneralsMD/Code/GameEngine/Include/GameClient/FXList.h
+++ b/GeneralsMD/Code/GameEngine/Include/GameClient/FXList.h
@@ -256,6 +256,10 @@ public:
static void parseFXListDefinition(INI* ini);
+ /** FXListReforged.ini under Classic Graphics: the file is read, and so checksummed, like anyone's, and
+ * its blocks go nowhere. */
+ void setClassicDropsBlocks( Bool drops ) { m_classicDropsBlocks = drops; }
+
private:
// use the hashing function for Ints.
@@ -265,6 +269,8 @@ private:
FXListMap m_beforeMapOverrides; ///< a map.ini's edited lists, as they were before it
std::vector<NameKeyType> m_addedByMap; ///< names a map.ini brought
+ Bool m_classicDropsBlocks = FALSE;
+ Bool m_classicDroppedGeneralCopies = FALSE; ///< SupW_ names now answer with EA's plain list
};
diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/ParticleSys.h b/GeneralsMD/Code/GameEngine/Include/GameClient/ParticleSys.h
index 24fee4ae9..565144405 100644
--- a/GeneralsMD/Code/GameEngine/Include/GameClient/ParticleSys.h
+++ b/GeneralsMD/Code/GameEngine/Include/GameClient/ParticleSys.h
@@ -614,6 +614,16 @@ public:
* ParticleSystemInfo is a protected base, so the manager needs a way in. */
void forceSmokeBoost( const SmokeBoost &boost );
+ /** Classic Graphics: a system only the fork has, reached from data every machine loads, draws nothing. */
+ void emitNothing( void )
+ {
+ m_burstCount.setRange( 0.0f, 0.0f );
+ m_systemLifetime = 1;
+ m_slaveSystemName.clear();
+ m_attachedSystemName.clear();
+ }
+ void copyLookOf( const ParticleSystemTemplate *other ) { static_cast<ParticleSystemInfo&>( *this ) = *other; }
+
ParticleSystemTemplate( const AsciiString &name );
AsciiString getName( void ) const { return m_name; }
@@ -1005,6 +1015,7 @@ public:
ParticleSystemTemplate *findTemplate( const AsciiString &name ) const;
ParticleSystemTemplate *findParentTemplate( const AsciiString &name, int parentNum ) const;
ParticleSystemTemplate *newTemplate( const AsciiString &name );
+ Bool isClassicReadingForkSystems( void ) const { return m_classicReadingForkSystems; } ///< ParticleSystemReforged.ini going in under Classic Graphics
/// a map.ini is about to write over this template; reset() puts it back
void rememberTemplateBeforeMapINI( ParticleSystemTemplate *sysTemplate );
@@ -1113,6 +1124,7 @@ protected:
private:
TemplateMap m_templateMap; ///< a hash map of all particle system templates
+ Bool m_classicReadingForkSystems = FALSE;
std::vector< std::pair<ParticleSystemTemplate *, ParticleSystemInfo> > m_beforeMapOverrides; ///< see reset()
};
diff --git a/GeneralsMD/Code/GameEngine/Source/Common/GameEngine.cpp b/GeneralsMD/Code/GameEngine/Source/Common/GameEngine.cpp
index f3402532f..9238a12cf 100644
--- a/GeneralsMD/Code/GameEngine/Source/Common/GameEngine.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/Common/GameEngine.cpp
@@ -1208,7 +1208,9 @@ void GameEngine::init( int argc, char *argv[] )
loose copy of FXList.ini because a loose copy shadows the whole 190K shipped file: it goes
stale against every patch, it cannot be reviewed, and - since it lands in the INI CRC below -
it silently refuses every multiplayer join from a machine that does not have the same one. */
+ TheFXListStore->setClassicDropsBlocks( TheGlobalData->m_classicGraphics );
ini.load( AsciiString( "Data\\INI\\FXListReforged.ini" ), INI_LOAD_OVERWRITE, &xferCRC );
+ TheFXListStore->setClassicDropsBlocks( FALSE );
initFactionSubsystem(TheWeaponStore,"TheWeaponStore", MSGNEW("GameEngineSubsystem") WeaponStore(), &xferCRC, NULL, "Data\\INI\\Weapon.ini");
/* Weapons of the fork's own that BalanceReforged.ini hands out. It cannot add one, and borrowing
one of EA's that nothing fires broke under a mod whose Weapon.ini leaves it out (Contra's Paladin
diff --git a/GeneralsMD/Code/GameEngine/Source/Common/INI/INIParticleSys.cpp b/GeneralsMD/Code/GameEngine/Source/Common/INI/INIParticleSys.cpp
index ef940abb3..468fc9a41 100644
--- a/GeneralsMD/Code/GameEngine/Source/Common/INI/INIParticleSys.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/Common/INI/INIParticleSys.cpp
@@ -46,11 +46,18 @@ void INI::parseParticleSystemDefinition( INI* ini )
// find existing item if present
ParticleSystemTemplate *sysTemplate = const_cast<ParticleSystemTemplate*>(TheParticleSystemManager->findTemplate( name ));
- if (sysTemplate == NULL)
+ const Bool classic = TheParticleSystemManager->isClassicReadingForkSystems();
+ const Bool added = sysTemplate == NULL;
+ if (added)
{
// no item is present, create a new one
sysTemplate = TheParticleSystemManager->newTemplate( name );
}
+ else if (classic)
+ {
+ // an edit of one of EA's systems: it goes into a template nothing is made from
+ sysTemplate = TheParticleSystemManager->newTemplate( "ClassicDiscard" );
+ }
// a map's rules file edits the template every system of that name is made from
if (ini->getLoadType() == INI_LOAD_CREATE_OVERRIDES)
@@ -58,4 +65,15 @@ void INI::parseParticleSystemDefinition( INI* ini )
// parse the ini definition
ini->initFromINI( sysTemplate, sysTemplate->getFieldParse() );
+
+ // a system only the fork has stays a name a weapon or a saved game can hold, and emits nothing, unless
+ // it is a Superweapon General's copy of one of EA's: then it is that system, as he had it
+ if (classic && added)
+ {
+ const ParticleSystemTemplate *ea = name.startsWith( "SupW_" ) ? TheParticleSystemManager->findTemplate( name.str() + 5 ) : NULL;
+ if (ea)
+ sysTemplate->copyLookOf( ea );
+ else
+ sysTemplate->emitNothing();
+ }
}
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/Drawable.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/Drawable.cpp
index 697330ffe..029bb396c 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/Drawable.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/Drawable.cpp
@@ -2275,7 +2275,7 @@ void Drawable::calcPhysicsXformGround( const Locomotor *locomotor, PhysicsXformI
UnsignedInt logicFrame = TheGameLogic->getFrame();
Real logicAngle = getOrientation();
UnsignedInt gap = logicFrame - m_locoInfo->m_headingFrame;
- if (!m_locoInfo->m_headingSeeded || gap > HEADING_CATCH_UP_FRAMES || owner->isKindOf(KINDOF_AIRCRAFT))
+ if (!m_locoInfo->m_headingSeeded || gap > HEADING_CATCH_UP_FRAMES || owner->isKindOf(KINDOF_AIRCRAFT) || TheGlobalData->m_classicGraphics)
{
// first drawn, long unseen, or a taxiing jet or landed helicopter, which eases its own turn in the logic
m_locoInfo->m_headingLag = 0.0f;
@@ -4812,7 +4812,7 @@ void Drawable::drawVeterancy( const IRegion2D *healthBarRegion )
// EA's chevron for the level
const RankLadder *ladder = TheGlobalData->getRankLadder( obj->getTemplate() );
VeterancyLevel level = obj->getVeterancyLevel();
- const Image* image = ladder ? getRankInsignia( obj ) : s_veterancyImage[level];
+ const Image* image = ( ladder && !TheGlobalData->m_classicGraphics ) ? getRankInsignia( obj ) : s_veterancyImage[level];
if (!image)
return;
@@ -4846,7 +4846,7 @@ void Drawable::drawVeterancy( const IRegion2D *healthBarRegion )
// the insignia in line with the bar, just past its right end and centred on it: the ammo and
// passenger pips start from the left end, and hanging under the bar it read as part of the unit
- if( ladder )
+ if( ladder && !TheGlobalData->m_classicGraphics )
{
Int left = screenCenter.x + 2;
Int middle = screenCenter.y;
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/FXList.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/FXList.cpp
index 115a63d6f..59b6cf43c 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/FXList.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/FXList.cpp
@@ -1105,6 +1105,9 @@ const FXList *FXListStore::findFXList(const char* name) const
{
return &(*it).second;
}
+ // a Superweapon General's copy the fork's data names, which Classic dropped: EA's plain list is what he had
+ if (m_classicDroppedGeneralCopies && strncmp(name, "SupW_", 5) == 0)
+ return findFXList(name + 5);
AsciiString retailName;
return TheModNamespace.findRetailName(AsciiString(name), MODNAME_FXLIST, &retailName) ? findFXList(retailName.str()) : NULL;
}
@@ -1116,6 +1119,18 @@ const FXList *FXListStore::findFXList(const char* name) const
const char *c = ini->getNextToken();
const AsciiString name = c; // the token's buffer goes on to the next line
NameKeyType key = TheNameKeyGenerator->nameToKey(c);
+ if (TheFXListStore->m_classicDropsBlocks)
+ {
+ // EA's list stands and a name only the fork has plays nothing. An FXList is the client's
+ // business, so a Classic and a Reforged player can share a match over it.
+ if (strncmp(name.str(), "SupW_", 5) == 0)
+ TheFXListStore->m_classicDroppedGeneralCopies = TRUE;
+ else
+ TheFXListStore->m_fxmap[key];
+ FXList dropped;
+ ini->initFromINI(&dropped, TheFXListFieldParse);
+ return;
+ }
if (ini->getLoadType() == INI_LOAD_CREATE_OVERRIDES)
{
FXListStore *store = TheFXListStore;
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
index 581cf7bd1..79f993e3d 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
@@ -10478,7 +10478,7 @@ void InGameUI::updateAndDrawWorldAnimations( void )
// a grade gained floats up as its insignia, half again its health bar size, centred where the
// chevron would have been
const Real RANK_GAIN_SCALE = 1.5f;
- if( wad->m_rankOf && Drawable::drawRankInsignia( wad->m_rankOf, wad->m_rankInsignia, screen.x, screen.y - REAL_TO_INT( height * zoomScale / 2 ),
+ if( wad->m_rankOf && !TheGlobalData->m_classicGraphics && Drawable::drawRankInsignia( wad->m_rankOf, wad->m_rankInsignia, screen.x, screen.y - REAL_TO_INT( height * zoomScale / 2 ),
TRUE, RANK_GAIN_SCALE * zoomScale, GameMakeColor( 255, 255, 255, REAL_TO_INT( 255 * alpha ) ) ) )
{
++it;
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/System/ParticleSys.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/System/ParticleSys.cpp
index d36883486..5ddf225b7 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/System/ParticleSys.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/System/ParticleSys.cpp
@@ -828,7 +828,7 @@ Bool Particle::update( const ParticleUpdateContext &context )
else if (fadeFrames == 0)
fadeFrames = 1;
- if (m_lifetimeLeft <= fadeFrames)
+ if (m_lifetimeLeft <= fadeFrames && !TheGlobalData->m_classicGraphics)
{
// zero on the last frame, so isInvisible below retires it on the frame it would die anyway
const Real envelope = (Real)(m_lifetimeLeft - 1) / (Real)fadeFrames;
@@ -3898,7 +3898,9 @@ void ParticleSystemManager::init( void )
// -modfactions: each mod's systems after retail's, under its names
INI::loadModPasses( "Data\\INI\\ParticleSystem.ini", NULL );
// The fork's own systems, beside EA's 1088 rather than in a loose copy of all of them
+ m_classicReadingForkSystems = TheGlobalData && TheGlobalData->m_classicGraphics;
ini.load( AsciiString( "Data\\INI\\ParticleSystemReforged.ini" ), INI_LOAD_OVERWRITE, NULL );
+ m_classicReadingForkSystems = FALSE;
// "-particlebounce" on the command line: every system hits the terrain, using the built-in
// defaults. Without it nothing changes unless a system's INI sets GroundCollision itself.
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/View.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/View.cpp
index cff33ab03..f56d3f583 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/View.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/View.cpp
@@ -173,9 +173,9 @@ View *View::prependViewToList( View *list )
//-------------------------------------------------------------------------------------------------
/** The zoom a match opens at: START_CAMERA_HEIGHT over the ground in either interface, a little
- * inside GameData.ini's MaxCameraHeight of 310, the map default a Classic match opened at before.
- * StartAtMaxZoom opens it as far out as the wheel itself may go instead. The shell map behind the
- * menus keeps the map's framing. Here rather than in GameLogic, which calls it, because both
+ * inside GameData.ini's MaxCameraHeight of 310, the map default Classic Graphics opens at as EA's
+ * did. StartAtMaxZoom opens it as far out as the wheel itself may go instead. The shell map behind
+ * the menus keeps the map's framing. Here rather than in GameLogic, which calls it, because both
* answers are client settings. */
//-------------------------------------------------------------------------------------------------
#define START_CAMERA_HEIGHT (300.0f)
@@ -185,6 +185,8 @@ void View::setZoomToStart( Bool shellMap )
setZoomToDefault();
else if( TheGlobalData->m_startAtMaxZoom )
setZoomToMax();
+ else if( TheGlobalData->m_classicGraphics )
+ setZoomToDefault();
else
setZoomToHeight( START_CAMERA_HEIGHT );
DEBUG_LOG(( "CAMERA START height %.1f\n", getHeightAboveGround() ));
diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DLaserDraw.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DLaserDraw.cpp
index 58f72fee7..3173c3e67 100644
--- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DLaserDraw.cpp
+++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DLaserDraw.cpp
@@ -292,7 +292,7 @@ static Vector3 glowHue( Color inner, Color outer )
// widens instead, and the Direct3D 11 gain takes the lines over white (GLOW_ENABLE below).
static Real glowStrength()
{
- return TheGlobalData->m_bloomIntensity / 50.0f;
+ return TheGlobalData->m_classicGraphics ? 0.0f : TheGlobalData->m_bloomIntensity / 50.0f;
}
// The plain additive preset, opted into the Glow option's gain: EA's beam layers and the glow
diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp
index 87768fce5..6ce031281 100644
--- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp
+++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp
@@ -2262,7 +2262,7 @@ void W3DModelDraw::getRenderCostRecursive(RenderCost & rc,RenderObjClass * robj)
and a kept shadow was a building-shaped hole in the light on empty ground. */
static Bool keepsShadowInFog(const Drawable *draw)
{
- if (draw == NULL)
+ if (draw == NULL || TheGlobalData->m_classicGraphics)
return FALSE;
const Object *obj = draw->getObject();
@@ -2479,7 +2479,7 @@ void W3DModelDraw::doDrawModule(const Matrix3D* transformMtx)
// show where the enemy does not. Rooftop lamps on buildings and aircraft lights stay beams only.
s_headlightDrawn = TRUE;
if (m_hasHeadlights && !m_hideHeadlights && m_renderObject && !m_renderObject->Is_Hidden()
- && Direct3D11_Is_Active())
+ && Direct3D11_Is_Active() && !TheGlobalData->m_classicGraphics)
{
const Drawable* draw = getDrawable();
const Object* obj = draw->getObject();
@@ -2946,8 +2946,9 @@ void W3DModelDraw::handleClientTurretPositioning()
}
}
- // do turret pitch, if any
- if (tur.m_turretPitchBone != 0)
+ // do turret pitch, if any. The pitch the fork's data gave a stabilized gun is the logic's aim:
+ // under Classic Graphics the barrel stays as modelled, as EA's tanks had it
+ if (tur.m_turretPitchBone != 0 && !(TheGlobalData->m_classicGraphics && getW3DModelDrawModuleData()->m_stabilizedTurretPitch))
{
if (m_curState)
turretPitch += tur.m_turretArtPitch;
diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DProjectedShadow.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DProjectedShadow.cpp
index 7b54a91b3..3a96f6a1f 100644
--- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DProjectedShadow.cpp
+++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DProjectedShadow.cpp
@@ -1064,7 +1064,7 @@ void W3DProjectedShadowManager::queueDecal(W3DProjectedShadow *shadow, Bool sunC
same fraction, so a capped streak still starts at the shadow of the tail rather than
floating off it. */
Real stretch = 1.0f;
- if (sunCasts && heightAboveGround > DECAL_AIRBORNE_HEIGHT)
+ if (sunCasts && heightAboveGround > DECAL_AIRBORNE_HEIGHT && !TheGlobalData->m_classicGraphics)
{
const Real lift = __min((heightAboveGround - DECAL_AIRBORNE_HEIGHT) / DECAL_AIRBORNE_BLEND, 1.0f);
const Real axisLength = uVector.Length();
diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DVolumetricShadow.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DVolumetricShadow.cpp
index 1e13e0fb2..e07b22c52 100644
--- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DVolumetricShadow.cpp
+++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DVolumetricShadow.cpp
@@ -2130,11 +2130,8 @@ void W3DVolumetricShadow::Update()
//buggies from being flagged as "flying". We minimize the number of flying units because their shadow
//volumes are extruded longer to reach the lowest point on the map. Regular shadows only extend far
//enough to reach the base of the model (presumes base is already touching the ground).
- Real groundHeight;
- if (TheTerrainLogic)
- groundHeight=TheTerrainLogic->getGroundHeight(pos.X,pos.Y); //logic knows about bridges so use if available.
- else
- groundHeight=TheTerrainRenderObject->getHeightMapHeight(pos.X,pos.Y, NULL);
+ // the drawn map's copy, since this runs beside a tick; only a seismic effect moves it apart from the logic's
+ const Real groundHeight = TheTerrainRenderObject->getDrawHeight(pos.X,pos.Y);
if (fabs(pos.Z - groundHeight) >= AIRBORNE_UNIT_GROUND_DELTA)
{
Real extent = MAX_SHADOW_LENGTH_EXTRA_AIRBORNE_SCALE_FACTOR * m_robjExtent;
diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWater.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWater.cpp
index 2e48494ea..743926f06 100644
--- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWater.cpp
+++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWater.cpp
@@ -2508,7 +2508,7 @@ void WaterRenderObjClass::update( void )
updateModernWaterTextures();refreshModernWaterOpticalPolygons();updateModernWaterShore();
}
#endif
- const Real step = elapsedSec * AUTHORED_FPS * WATER_SCROLL_SPEED;
+ const Real step = elapsedSec * AUTHORED_FPS * (TheGlobalData->m_classicGraphics ? 1.0f : WATER_SCROLL_SPEED);
m_riverVOrigin += 0.002f * step;
m_riverXOffset += (Real)(0.0125*33/5000) * step;
diff --git a/GeneralsMD/Code/Tests/test_camera_behavior.inc b/GeneralsMD/Code/Tests/test_camera_behavior.inc
index 2f354ceae..54dab4c3e 100644
--- a/GeneralsMD/Code/Tests/test_camera_behavior.inc
+++ b/GeneralsMD/Code/Tests/test_camera_behavior.inc
@@ -445,8 +445,13 @@ TEST(a_match_opens_300_over_the_ground_in_both_interfaces)
{
f.global->m_mouseStyle = style ? MOUSE_STYLE_CLASSIC : MOUSE_STYLE_REFORGED;
f.global->m_startAtMaxZoom = FALSE;
+ f.global->m_classicGraphics = FALSE;
f.view.setZoomToStart(FALSE);
CHECK_NEAR(f.view.getHeightAboveGround(), 300.0f, 0.001f);
+ // Classic Graphics opens on the map's framing, as EA's did
+ f.global->m_classicGraphics = TRUE;
+ f.view.setZoomToStart(FALSE);
+ CHECK_NEAR(f.view.getHeightAboveGround(), -1.0f, 0.001f);
// the shell map behind the menus keeps its own framing
f.view.setZoomToStart(TRUE);
CHECK_NEAR(f.view.getHeightAboveGround(), -1.0f, 0.001f);
diff --git a/GeneralsMD/Code/Tests/test_gameengine.cpp b/GeneralsMD/Code/Tests/test_gameengine.cpp
index ecf923821..ae2086e3f 100644
--- a/GeneralsMD/Code/Tests/test_gameengine.cpp
+++ b/GeneralsMD/Code/Tests/test_gameengine.cpp
@@ -17353,6 +17353,31 @@ TEST(no_options_file_is_the_classic_game_with_every_added_row_off)
TheWritableGlobalData = saved;
}
+/* Classic Graphics reads FXListReforged.ini, which is what keeps the INI checksum one for both looks, and
+ keeps none of it: EA's list stands, a name only the fork has plays nothing. */
+TEST(classic_keeps_eas_fx_list_while_reading_the_forks_file)
+{
+ CHECK( bootOnce() );
+ if( TheFXListStore == NULL )
+ TheFXListStore = NEW FXListStore;
+
+ writeFile( TEST_INI, "FXList ClassicTest_Ea\r\n TerrainScorch\r\n Type = RANDOM\r\n Radius = 120\r\n End\r\nEnd\r\n" );
+ CHECK( loadIni( TEST_INI ) );
+ writeFile( TEST_INI,
+ "FXList ClassicTest_Ea\r\n TerrainScorch\r\n Type = RANDOM\r\n Radius = 30\r\n End\r\nEnd\r\n"
+ "FXList ClassicTest_Fork\r\n TerrainScorch\r\n Type = RANDOM\r\n Radius = 30\r\n End\r\nEnd\r\n"
+ "FXList SupW_ClassicTest_Ea\r\n TerrainScorch\r\n Type = RANDOM\r\n Radius = 30\r\n End\r\nEnd\r\n" );
+ TheFXListStore->setClassicDropsBlocks( TRUE );
+ CHECK( loadIni( TEST_INI ) );
+ TheFXListStore->setClassicDropsBlocks( FALSE );
+ remove( TEST_INI );
+
+ CHECK_NEAR( TheFXListStore->findFXList( "ClassicTest_Ea" )->getSplashRadius(), 120.0f, 0.01f );
+ CHECK( TheFXListStore->findFXList( "ClassicTest_Fork" ) != NULL );
+ CHECK_NEAR( TheFXListStore->findFXList( "ClassicTest_Fork" )->getSplashRadius(), 0.0f, 0.01f );
+ CHECK( TheFXListStore->findFXList( "SupW_ClassicTest_Ea" ) == TheFXListStore->findFXList( "ClassicTest_Ea" ) );
+}
+
/* The menu's Defaults puts a row on what it held before the file reached it, whatever the file says. */
TEST(an_options_row_remembers_its_value_from_before_the_file)
{
diff --git a/GeneralsMD/Code/Tools/net_check.py b/GeneralsMD/Code/Tools/net_check.py
index ade0e2d1b..a0c99b238 100644
--- a/GeneralsMD/Code/Tools/net_check.py
+++ b/GeneralsMD/Code/Tools/net_check.py
@@ -54,6 +54,8 @@ def parse_arguments() -> argparse.Namespace:
parser.add_argument("--each", default="", help="extra switches for every copy")
parser.add_argument("--slot-args", nargs=2, action="append", default=[], metavar=("SLOT", "SWITCHES"),
help="extra switches for one copy, repeatable")
+ parser.add_argument("--slot-options", nargs=2, action="append", default=[], metavar=("SLOT", "FOLDER"),
+ help="one copy's ZH_USER_DATA_DIR, for a match between two setups, repeatable")
parser.add_argument("--tag", default="net", help="log prefix; copy n logs to Run/<tag><n>_DebugLogFile.txt")
parser.add_argument("--prove", action="store_true", help="spawn on copy 0 alone at frame %d" % PROVE_FRAME)
parser.add_argument("--prove-at", default="2192 3537", help="map position for --prove")
@@ -147,7 +149,9 @@ def main() -> int:
if not 2 <= arguments.copies <= MAXIMUM_COPIES:
raise SystemExit("--copies is 2 to %d, got %d" % (MAXIMUM_COPIES, arguments.copies))
- processes = [subprocess.Popen(command_line(arguments, slot), cwd=RUN_DIRECTORY)
+ folders = {int(slot): folder for slot, folder in arguments.slot_options}
+ processes = [subprocess.Popen(command_line(arguments, slot), cwd=RUN_DIRECTORY,
+ env=dict(os.environ, ZH_USER_DATA_DIR=folders[slot]) if slot in folders else None)
for slot in range(arguments.copies)]
games = []
try: