Index: ps/trunk/binaries/data/mods/public/art/terrains/biome-mediterranean/medit_city_tile.xml
===================================================================
--- ps/trunk/binaries/data/mods/public/art/terrains/biome-mediterranean/medit_city_tile.xml
+++ ps/trunk/binaries/data/mods/public/art/terrains/biome-mediterranean/medit_city_tile.xml
@@ -5,6 +5,6 @@
-
+
terrain_norm_spec.xml
-
\ No newline at end of file
+
Index: ps/trunk/binaries/data/mods/public/art/terrains/biome-mediterranean/medit_road_broken.xml
===================================================================
--- ps/trunk/binaries/data/mods/public/art/terrains/biome-mediterranean/medit_road_broken.xml
+++ ps/trunk/binaries/data/mods/public/art/terrains/biome-mediterranean/medit_road_broken.xml
@@ -5,6 +5,6 @@
-
+
terrain_norm_spec.xml
-
\ No newline at end of file
+
Index: ps/trunk/binaries/data/mods/public/art/terrains/biome-savanna/savanna_tile_a.xml
===================================================================
--- ps/trunk/binaries/data/mods/public/art/terrains/biome-savanna/savanna_tile_a.xml
+++ ps/trunk/binaries/data/mods/public/art/terrains/biome-savanna/savanna_tile_a.xml
@@ -5,6 +5,6 @@
-
+
terrain_norm_spec.xml
-
\ No newline at end of file
+
Index: ps/trunk/binaries/data/mods/public/art/terrains/biome-savanna/savanna_tile_a_red.xml
===================================================================
--- ps/trunk/binaries/data/mods/public/art/terrains/biome-savanna/savanna_tile_a_red.xml
+++ ps/trunk/binaries/data/mods/public/art/terrains/biome-savanna/savanna_tile_a_red.xml
@@ -5,6 +5,6 @@
-
+
terrain_norm_spec.xml
-
\ No newline at end of file
+
Index: ps/trunk/binaries/data/mods/public/art/terrains/biome-temperate/temp_road_muddy.xml
===================================================================
--- ps/trunk/binaries/data/mods/public/art/terrains/biome-temperate/temp_road_muddy.xml
+++ ps/trunk/binaries/data/mods/public/art/terrains/biome-temperate/temp_road_muddy.xml
@@ -3,6 +3,6 @@
-
+
terrain_base.xml
Index: ps/trunk/binaries/data/mods/public/art/terrains/biome-tropic/tropic_citytile_a.xml
===================================================================
--- ps/trunk/binaries/data/mods/public/art/terrains/biome-tropic/tropic_citytile_a.xml
+++ ps/trunk/binaries/data/mods/public/art/terrains/biome-tropic/tropic_citytile_a.xml
@@ -3,6 +3,6 @@
-
+
terrain_base.xml
Index: ps/trunk/binaries/data/mods/public/art/terrains/terrain.rng
===================================================================
--- ps/trunk/binaries/data/mods/public/art/terrains/terrain.rng
+++ ps/trunk/binaries/data/mods/public/art/terrains/terrain.rng
@@ -38,9 +38,6 @@
-
-
-
Index: ps/trunk/binaries/data/mods/public/art/terrains/terrain_texture.rng
===================================================================
--- ps/trunk/binaries/data/mods/public/art/terrains/terrain_texture.rng
+++ ps/trunk/binaries/data/mods/public/art/terrains/terrain_texture.rng
@@ -59,9 +59,6 @@
-
-
-
Index: ps/trunk/source/graphics/MapReader.cpp
===================================================================
--- ps/trunk/source/graphics/MapReader.cpp
+++ ps/trunk/source/graphics/MapReader.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2021 Wildfire Games.
+/* Copyright (C) 2022 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@@ -247,9 +247,11 @@
CStr texturename;
unpacker.UnpackString(texturename);
- ENSURE(CTerrainTextureManager::IsInitialised()); // we need this for the terrain properties (even when graphics are disabled)
- CTerrainTextureEntry* texentry = g_TexMan.FindTexture(texturename);
- m_TerrainTextures.push_back(texentry);
+ if(CTerrainTextureManager::IsInitialised())
+ {
+ CTerrainTextureEntry* texentry = g_TexMan.FindTexture(texturename);
+ m_TerrainTextures.push_back(texentry);
+ }
cur_terrain_tex++;
LDR_CHECK_TIMEOUT(cur_terrain_tex, num_terrain_tex);
@@ -1354,9 +1356,11 @@
while (cur_terrain_tex < num_terrain_tex)
{
- ENSURE(CTerrainTextureManager::IsInitialised()); // we need this for the terrain properties (even when graphics are disabled)
- CTerrainTextureEntry* texentry = g_TexMan.FindTexture(textureNames[cur_terrain_tex]);
- m_TerrainTextures.push_back(texentry);
+ if (CTerrainTextureManager::IsInitialised())
+ {
+ CTerrainTextureEntry* texentry = g_TexMan.FindTexture(textureNames[cur_terrain_tex]);
+ m_TerrainTextures.push_back(texentry);
+ }
cur_terrain_tex++;
}
Index: ps/trunk/source/graphics/Terrain.h
===================================================================
--- ps/trunk/source/graphics/Terrain.h
+++ ps/trunk/source/graphics/Terrain.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2021 Wildfire Games.
+/* Copyright (C) 2022 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@@ -79,8 +79,6 @@
&& (z >= GetMinZ()) && (z < GetMaxZ()));
}
- CStr8 GetMovementClass(ssize_t i, ssize_t j) const;
-
float GetVertexGroundLevel(ssize_t i, ssize_t j) const;
fixed GetVertexGroundLevelFixed(ssize_t i, ssize_t j) const;
float GetExactGroundLevel(float x, float z) const;
Index: ps/trunk/source/graphics/Terrain.cpp
===================================================================
--- ps/trunk/source/graphics/Terrain.cpp
+++ ps/trunk/source/graphics/Terrain.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2021 Wildfire Games.
+/* Copyright (C) 2022 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@@ -96,17 +96,6 @@
}
///////////////////////////////////////////////////////////////////////////////
-
-CStr8 CTerrain::GetMovementClass(ssize_t i, ssize_t j) const
-{
- CMiniPatch* tile = GetTile(i, j);
- if (tile && tile->GetTextureEntry())
- return tile->GetTextureEntry()->GetProperties().GetMovementClass();
-
- return "default";
-}
-
-///////////////////////////////////////////////////////////////////////////////
// CalcPosition: calculate the world space position of the vertex at (i,j)
// If i,j is off the map, it acts as if the edges of the terrain are extended
// outwards to infinity
Index: ps/trunk/source/graphics/TerrainProperties.h
===================================================================
--- ps/trunk/source/graphics/TerrainProperties.h
+++ ps/trunk/source/graphics/TerrainProperties.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2021 Wildfire Games.
+/* Copyright (C) 2022 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@@ -55,8 +55,6 @@
u32 m_BaseColor;
bool m_HasBaseColor;
- CStr m_MovementClass;
-
// Orientation of texture (in radians) (default pi/4 = 45 degrees)
float m_TextureAngle;
@@ -103,11 +101,6 @@
return m_TextureSize;
}
- CStr GetMovementClass() const
- {
- return m_MovementClass;
- }
-
const GroupVector &GetGroups() const
{
return m_Groups;
Index: ps/trunk/source/graphics/TerrainProperties.cpp
===================================================================
--- ps/trunk/source/graphics/TerrainProperties.cpp
+++ ps/trunk/source/graphics/TerrainProperties.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2021 Wildfire Games.
+/* Copyright (C) 2022 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@@ -35,8 +35,7 @@
m_BaseColor(0),
m_HasBaseColor(false),
m_TextureAngle((float)M_PI / 4.f),
- m_TextureSize(32.f),
- m_MovementClass("default")
+ m_TextureSize(32.f)
{
if (m_pParent)
m_Groups = m_pParent->m_Groups;
@@ -95,7 +94,6 @@
// Terrain Attribs
ATTR(mmap);
ATTR(groups);
- ATTR(movementclass);
ATTR(angle);
ATTR(size);
#undef ELMT
@@ -136,10 +134,6 @@
{
m_TextureSize = attr.Value.ToFloat();
}
- else if (attr.Name == attr_movementclass)
- {
- m_MovementClass = attr.Value;
- }
}
}
Index: ps/trunk/source/network/tests/test_Net.h
===================================================================
--- ps/trunk/source/network/tests/test_Net.h
+++ ps/trunk/source/network/tests/test_Net.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2021 Wildfire Games.
+/* Copyright (C) 2022 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@@ -44,11 +44,6 @@
TS_ASSERT_OK(g_VFS->Mount(L"cache", DataDir() / "_testcache" / "", 0, VFS_MAX_PRIORITY));
CXeromyces::Startup();
- // Need some stuff for terrain movement costs:
- // (TODO: this ought to be independent of any graphics code)
- new CTerrainTextureManager;
- g_TexMan.LoadTerrainTextures();
-
enet_initialize();
}
@@ -56,8 +51,6 @@
{
enet_deinitialize();
- delete &g_TexMan;
-
CXeromyces::Terminate();
g_VFS.reset();
DeleteDirectory(DataDir()/"_testcache");
Index: ps/trunk/source/ps/GameSetup/GameSetup.cpp
===================================================================
--- ps/trunk/source/ps/GameSetup/GameSetup.cpp
+++ ps/trunk/source/ps/GameSetup/GameSetup.cpp
@@ -435,10 +435,6 @@
ShutdownPs();
- TIMER_BEGIN(L"shutdown TexMan");
- delete &g_TexMan;
- TIMER_END(L"shutdown TexMan");
-
if (hasRenderer)
{
TIMER_BEGIN(L"shutdown Renderer");
@@ -826,10 +822,6 @@
void InitNonVisual(const CmdLineArgs& args)
{
- // Need some stuff for terrain movement costs:
- // (TODO: this ought to be independent of any graphics code)
- new CTerrainTextureManager;
- g_TexMan.LoadTerrainTextures();
Autostart(args);
}
Index: ps/trunk/source/ps/Replay.cpp
===================================================================
--- ps/trunk/source/ps/Replay.cpp
+++ ps/trunk/source/ps/Replay.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2021 Wildfire Games.
+/* Copyright (C) 2022 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@@ -248,11 +248,6 @@
if (ooslog)
g_Game->GetSimulation2()->EnableOOSLog();
- // Need some stuff for terrain movement costs:
- // (TODO: this ought to be independent of any graphics code)
- new CTerrainTextureManager;
- g_TexMan.LoadTerrainTextures();
-
// Initialise h_mgr so it doesn't crash when emitting sounds
h_mgr_init();
@@ -329,9 +324,6 @@
// it's already destructed.
g_ScriptContext.reset();
- // Clean up
- delete &g_TexMan;
-
delete &g_Profiler;
delete &g_ProfileViewer;
SAFE_DELETE(g_ScriptStatsTable);
Index: ps/trunk/source/renderer/Renderer.cpp
===================================================================
--- ps/trunk/source/renderer/Renderer.cpp
+++ ps/trunk/source/renderer/Renderer.cpp
@@ -316,6 +316,8 @@
CRenderer::~CRenderer()
{
+ delete &g_TexMan;
+
// We no longer UnloadWaterTextures here -
// that is the responsibility of the module that asked for
// them to be loaded (i.e. CGameView).
Index: ps/trunk/source/simulation2/components/CCmpUnitMotion.h
===================================================================
--- ps/trunk/source/simulation2/components/CCmpUnitMotion.h
+++ ps/trunk/source/simulation2/components/CCmpUnitMotion.h
@@ -1163,13 +1163,8 @@
basicSpeed = std::max(std::min(m_TemplateWalkSpeed, floorSpeed), basicSpeed);
}
- // Find the speed factor of the underlying terrain.
- // (We only care about the tile we start on - it doesn't matter if we're moving
- // partially onto a much slower/faster tile).
- // TODO: Terrain-dependent speeds are not currently supported.
- fixed terrainSpeed = fixed::FromInt(1);
-
- fixed maxSpeed = basicSpeed.Multiply(terrainSpeed);
+ // TODO: would be nice to support terrain-dependent speed again.
+ fixed maxSpeed = basicSpeed;
fixed timeLeft = dt;
fixed zero = fixed::Zero();
Index: ps/trunk/source/simulation2/components/tests/test_Pathfinder.h
===================================================================
--- ps/trunk/source/simulation2/components/tests/test_Pathfinder.h
+++ ps/trunk/source/simulation2/components/tests/test_Pathfinder.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2021 Wildfire Games.
+/* Copyright (C) 2022 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@@ -45,16 +45,10 @@
TS_ASSERT_OK(g_VFS->Mount(L"cache", DataDir() / "_testcache" / "", 0, VFS_MAX_PRIORITY));
CXeromyces::Startup();
-
- // Need some stuff for terrain movement costs:
- // (TODO: this ought to be independent of any graphics code)
- new CTerrainTextureManager;
- g_TexMan.LoadTerrainTextures();
}
void tearDown()
{
- delete &g_TexMan;
CXeromyces::Terminate();
g_VFS.reset();
DeleteDirectory(DataDir()/"_testcache");
Index: ps/trunk/source/simulation2/helpers/Pathfinding.h
===================================================================
--- ps/trunk/source/simulation2/helpers/Pathfinding.h
+++ ps/trunk/source/simulation2/helpers/Pathfinding.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2021 Wildfire Games.
+/* Copyright (C) 2022 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@@ -192,8 +192,7 @@
/*
* For efficient pathfinding we want to try hard to minimise the per-tile search cost,
- * so we precompute the tile passability flags and movement costs for the various different
- * types of unit.
+ * so we precompute the tile passability flags for the various different types of unit.
* We also want to minimise memory usage (there can easily be 100K tiles so we don't want
* to store many bytes for each).
*
Index: ps/trunk/source/simulation2/tests/test_Serializer.h
===================================================================
--- ps/trunk/source/simulation2/tests/test_Serializer.h
+++ ps/trunk/source/simulation2/tests/test_Serializer.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2021 Wildfire Games.
+/* Copyright (C) 2022 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@@ -885,11 +885,6 @@
TS_ASSERT_OK(g_VFS->Mount(L"", DataDir() / "mods" / "public" / "", VFS_MOUNT_MUST_EXIST));
TS_ASSERT_OK(g_VFS->Mount(L"cache", DataDir() / "_testcache" / "", 0, VFS_MAX_PRIORITY));
- // Need some stuff for terrain movement costs:
- // (TODO: this ought to be independent of any graphics code)
- new CTerrainTextureManager;
- g_TexMan.LoadTerrainTextures();
-
CTerrain terrain;
CSimulation2 sim2(NULL, g_ScriptContext, &terrain);
@@ -938,7 +933,6 @@
debug_printf("# time = %f (%f/%d)\n", t/reps, t, (int)reps);
// Shut down the world
- delete &g_TexMan;
g_VFS.reset();
DeleteDirectory(DataDir()/"_testcache");
CXeromyces::Terminate();