From b10fe1f2bb4f8648f6366dd987ec43733198cc27 Mon Sep 17 00:00:00 2001
From: xezon <4720891+xezon@users.noreply.github.com>
Date: Sun, 4 May 2025 17:25:24 +0200
Subject: [PATCH] [CORE] Move many unified WW3D2 library files to Core
---
Core/Libraries/Source/WWVegas/CMakeLists.txt | 6 +-
.../Source/WWVegas/WW3D2/CMakeLists.txt | 248 +++
.../WWVegas/WW3D2/DX8 Rationalizations.txt | 0
.../Source/WWVegas/WW3D2/DX8 Status.txt | 0
.../WWVegas/WW3D2/DX8ToolModifications.txt | 0
.../Source/WWVegas/WW3D2/FramGrab.cpp | 0
.../Source/WWVegas/WW3D2/MAPPERS.TXT | 0
.../WWVegas/WW3D2/RenderObjectGuide.txt | 0
.../RequiredAssets/AddProjectorGradient.tga | Bin
.../WWVegas/WW3D2/RequiredAssets/Dazzle.INI | 0
.../RequiredAssets/MultProjectorGradient.tga | Bin
.../WW3D2/RequiredAssets/ShatterAVel.tbl | Bin
.../WW3D2/RequiredAssets/ShatterPlanes0.w3d | Bin
.../WW3D2/RequiredAssets/ShatterVel.tbl | Bin
.../RequiredAssets/w3d_missing_texture.tga | Bin
.../Source/WWVegas/WW3D2/State Management.txt | 0
.../Source/WWVegas/WW3D2/aabtree.cpp | 0
.../Libraries/Source/WWVegas/WW3D2/aabtree.h | 0
.../Source/WWVegas/WW3D2/agg_def.cpp | 0
.../Libraries/Source/WWVegas/WW3D2/agg_def.h | 0
.../Source/WWVegas/WW3D2/animatedsoundmgr.cpp | 0
.../Source/WWVegas/WW3D2/animatedsoundmgr.h | 0
.../Source/WWVegas/WW3D2/assetstatus.cpp | 0
.../Source/WWVegas/WW3D2/assetstatus.h | 0
.../Source/WWVegas/WW3D2/bitmaphandler.cpp | 0
.../Source/WWVegas/WW3D2/bitmaphandler.h | 0
.../Source/WWVegas/WW3D2/bwrender.cpp | 0
.../Libraries/Source/WWVegas/WW3D2/bwrender.h | 0
.../Libraries/Source/WWVegas/WW3D2/classid.h | 0
.../Source/WWVegas/WW3D2/collect.cpp | 0
.../Libraries/Source/WWVegas/WW3D2/collect.h | 0
.../Source/WWVegas/WW3D2/colorspace.h | 0
.../Source/WWVegas/WW3D2/coltest.cpp | 0
.../Libraries/Source/WWVegas/WW3D2/coltest.h | 0
.../Libraries/Source/WWVegas/WW3D2/coltype.h | 0
.../Source/WWVegas/WW3D2/composite.cpp | 0
.../Source/WWVegas/WW3D2/composite.h | 0
.../Source/WWVegas/WW3D2/decalsys.cpp | 0
.../Libraries/Source/WWVegas/WW3D2/decalsys.h | 0
.../Source/WWVegas/WW3D2/distlod.cpp | 0
.../Libraries/Source/WWVegas/WW3D2/distlod.h | 0
.../Libraries/Source/WWVegas/WW3D2/dllist.h | 0
.../Libraries/Source/WWVegas/WW3D2/dx8list.h | 0
.../WWVegas/WW3D2/dx8polygonrenderer.cpp | 0
.../Source/WWVegas/WW3D2/dx8polygonrenderer.h | 0
.../Source/WWVegas/WW3D2/dx8webbrowser.cpp | 0
.../Source/WWVegas/WW3D2/dx8webbrowser.h | 0
.../Source/WWVegas/WW3D2/dynamesh.cpp | 0
.../Libraries/Source/WWVegas/WW3D2/dynamesh.h | 0
.../Libraries/Source/WWVegas/WW3D2/font3d.cpp | 0
.../Libraries/Source/WWVegas/WW3D2/font3d.h | 0
.../Source/WWVegas/WW3D2/formconv.cpp | 0
.../Libraries/Source/WWVegas/WW3D2/formconv.h | 0
.../Libraries/Source/WWVegas/WW3D2/framgrab.h | 0
.../Libraries/Source/WWVegas/WW3D2/hanim.cpp | 0
.../Libraries/Source/WWVegas/WW3D2/hanim.h | 0
.../Libraries/Source/WWVegas/WW3D2/hcanim.cpp | 0
.../Libraries/Source/WWVegas/WW3D2/hcanim.h | 0
.../Libraries/Source/WWVegas/WW3D2/hmdldef.H | 0
.../Source/WWVegas/WW3D2/hmdldef.cpp | 0
.../Libraries/Source/WWVegas/WW3D2/htree.cpp | 0
.../Libraries/Source/WWVegas/WW3D2/htree.h | 0
.../Source/WWVegas/WW3D2/intersec.cpp | 0
.../Libraries/Source/WWVegas/WW3D2/intersec.h | 0
.../Source/WWVegas/WW3D2/intersec.inl | 0
.../Libraries/Source/WWVegas/WW3D2/inttest.h | 0
.../Libraries/Source/WWVegas/WW3D2/layer.cpp | 0
.../Libraries/Source/WWVegas/WW3D2/layer.h | 0
.../Libraries/Source/WWVegas/WW3D2/line3d.cpp | 0
.../Libraries/Source/WWVegas/WW3D2/line3d.h | 0
.../Source/WWVegas/WW3D2/matinfo.cpp | 0
.../Libraries/Source/WWVegas/WW3D2/matinfo.h | 0
.../Source/WWVegas/WW3D2/meshdam.cpp | 0
.../Libraries/Source/WWVegas/WW3D2/meshdam.h | 0
.../Source/WWVegas/WW3D2/metalmap.cpp | 0
.../Libraries/Source/WWVegas/WW3D2/metalmap.h | 0
.../Source/WWVegas/WW3D2/missingtexture.cpp | 0
.../Source/WWVegas/WW3D2/missingtexture.h | 0
.../Libraries/Source/WWVegas/WW3D2/pivot.cpp | 0
.../Libraries/Source/WWVegas/WW3D2/pivot.h | 0
.../Source/WWVegas/WW3D2/pointgr.cpp | 0
.../Libraries/Source/WWVegas/WW3D2/pointgr.h | 0
.../Source/WWVegas/WW3D2/polyinfo.cpp | 0
.../Libraries/Source/WWVegas/WW3D2/polyinfo.h | 0
.../Source/WWVegas/WW3D2/predlod.cpp | 0
.../Libraries/Source/WWVegas/WW3D2/predlod.h | 0
.../Source/WWVegas/WW3D2/prim_anim.cpp | 0
.../Source/WWVegas/WW3D2/prim_anim.h | 0
.../Source/WWVegas/WW3D2/projector.cpp | 0
.../Source/WWVegas/WW3D2/projector.h | 0
.../Libraries/Source/WWVegas/WW3D2/proto.cpp | 0
.../Libraries/Source/WWVegas/WW3D2/proto.h | 0
.../Libraries/Source/WWVegas/WW3D2/proxy.h | 0
.../Libraries/Source/WWVegas/WW3D2/rddesc.h | 0
.../Source/WWVegas/WW3D2/render2dsentence.cpp | 0
.../Source/WWVegas/WW3D2/render2dsentence.h | 0
.../WWVegas/WW3D2/renderobjectrecycler.cpp | 0
.../WWVegas/WW3D2/renderobjectrecycler.h | 0
.../Source/WWVegas/WW3D2/rendobj.cpp | 0
.../Libraries/Source/WWVegas/WW3D2/rendobj.h | 0
.../Source/WWVegas/WW3D2/ringobj.cpp | 0
.../Libraries/Source/WWVegas/WW3D2/ringobj.h | 0
.../Libraries/Source/WWVegas/WW3D2/robjlist.h | 0
.../Source/WWVegas/WW3D2/segline.cpp | 0
.../Libraries/Source/WWVegas/WW3D2/segline.h | 0
.../Source/WWVegas/WW3D2/seglinerenderer.cpp | 0
.../Source/WWVegas/WW3D2/seglinerenderer.h | 0
.../Source/WWVegas/WW3D2/shattersystem.cpp | 0
.../Source/WWVegas/WW3D2/shattersystem.h | 0
.../Libraries/Source/WWVegas/WW3D2/snapPts.h | 0
.../Source/WWVegas/WW3D2/snappts.cpp | 0
.../Source/WWVegas/WW3D2/soundlibrarybridge.h | 0
.../Source/WWVegas/WW3D2/soundrobj.cpp | 0
.../Source/WWVegas/WW3D2/soundrobj.h | 0
.../Source/WWVegas/WW3D2/sphereobj.cpp | 0
.../Source/WWVegas/WW3D2/sphereobj.h | 0
.../Source/WWVegas/WW3D2/static_sort_list.cpp | 0
.../Source/WWVegas/WW3D2/static_sort_list.h | 0
.../Source/WWVegas/WW3D2/statistics.cpp | 0
.../Source/WWVegas/WW3D2/statistics.h | 0
.../Libraries/Source/WWVegas/WW3D2/streak.cpp | 0
.../Libraries/Source/WWVegas/WW3D2/streak.h | 0
.../Source/WWVegas/WW3D2/streakRender.cpp | 0
.../Source/WWVegas/WW3D2/streakRender.h | 0
.../Source/WWVegas/WW3D2/stripoptimizer.cpp | 0
.../Source/WWVegas/WW3D2/stripoptimizer.h | 0
.../Source/WWVegas/WW3D2/surfaceclass.cpp | 0
.../Source/WWVegas/WW3D2/surfaceclass.h | 0
.../Source/WWVegas/WW3D2/textdraw.cpp | 0
.../Libraries/Source/WWVegas/WW3D2/textdraw.h | 0
.../Source/WWVegas/WW3D2/visrasterizer.cpp | 0
.../Source/WWVegas/WW3D2/visrasterizer.h | 0
.../Source/WWVegas/WW3D2/w3d_dep.cpp | 0
.../Libraries/Source/WWVegas/WW3D2/w3d_dep.h | 0
.../Source/WWVegas/WW3D2/w3d_obsolete.h | 0
.../Source/WWVegas/WW3D2/w3d_util.cpp | 0
.../Libraries/Source/WWVegas/WW3D2/w3d_util.h | 0
.../Libraries/Source/WWVegas/WW3D2/w3derr.h | 0
.../Source/WWVegas/WW3D2/w3dexclusionlist.cpp | 0
.../Source/WWVegas/WW3D2/w3dexclusionlist.h | 0
.../Source/WWVegas/WW3D2/ww3dformat.cpp | 0
.../Source/WWVegas/WW3D2/ww3dformat.h | 0
.../Libraries/Source/WWVegas/WW3D2/ww3dids.h | 0
.../Libraries/Source/WWVegas/WW3D2/ww3dtrig.h | 0
.../Source/WWVegas/WW3D2/CMakeLists.txt | 262 ++-
.../Source/WWVegas/WW3D2/FramGrab.cpp | 191 --
.../Source/WWVegas/WW3D2/aabtree.cpp | 1236 -----------
.../Libraries/Source/WWVegas/WW3D2/aabtree.h | 354 ---
.../Source/WWVegas/WW3D2/agg_def.cpp | 894 --------
.../Libraries/Source/WWVegas/WW3D2/agg_def.h | 259 ---
.../Source/WWVegas/WW3D2/animatedsoundmgr.cpp | 566 -----
.../Source/WWVegas/WW3D2/animatedsoundmgr.h | 136 --
.../Source/WWVegas/WW3D2/bitmaphandler.cpp | 448 ----
.../Source/WWVegas/WW3D2/bitmaphandler.h | 484 -----
.../Source/WWVegas/WW3D2/bwrender.cpp | 242 ---
.../Libraries/Source/WWVegas/WW3D2/bwrender.h | 96 -
.../Libraries/Source/WWVegas/WW3D2/classid.h | 65 -
.../Source/WWVegas/WW3D2/collect.cpp | 1109 ----------
.../Libraries/Source/WWVegas/WW3D2/collect.h | 149 --
.../Source/WWVegas/WW3D2/colorspace.h | 161 --
.../Source/WWVegas/WW3D2/coltest.cpp | 375 ----
.../Libraries/Source/WWVegas/WW3D2/coltest.h | 317 ---
.../Libraries/Source/WWVegas/WW3D2/coltype.h | 94 -
.../Source/WWVegas/WW3D2/composite.cpp | 561 -----
.../Source/WWVegas/WW3D2/composite.h | 99 -
.../Source/WWVegas/WW3D2/decalsys.cpp | 489 -----
.../Libraries/Source/WWVegas/WW3D2/decalsys.h | 308 ---
.../Source/WWVegas/WW3D2/distlod.cpp | 1166 ----------
.../Libraries/Source/WWVegas/WW3D2/distlod.h | 246 ---
.../Libraries/Source/WWVegas/WW3D2/dllist.h | 211 --
.../Libraries/Source/WWVegas/WW3D2/dx8list.h | 74 -
.../WWVegas/WW3D2/dx8polygonrenderer.cpp | 115 -
.../Source/WWVegas/WW3D2/dx8polygonrenderer.h | 161 --
.../Source/WWVegas/WW3D2/dx8webbrowser.cpp | 260 ---
.../Source/WWVegas/WW3D2/dx8webbrowser.h | 93 -
.../Source/WWVegas/WW3D2/dynamesh.cpp | 835 -------
.../Libraries/Source/WWVegas/WW3D2/dynamesh.h | 582 -----
.../Libraries/Source/WWVegas/WW3D2/font3d.cpp | 429 ----
.../Libraries/Source/WWVegas/WW3D2/font3d.h | 223 --
.../Source/WWVegas/WW3D2/formconv.cpp | 252 ---
.../Libraries/Source/WWVegas/WW3D2/formconv.h | 62 -
.../Libraries/Source/WWVegas/WW3D2/framgrab.h | 117 -
.../Libraries/Source/WWVegas/WW3D2/hanim.cpp | 468 ----
.../Libraries/Source/WWVegas/WW3D2/hanim.h | 273 ---
.../Libraries/Source/WWVegas/WW3D2/hcanim.cpp | 710 ------
.../Libraries/Source/WWVegas/WW3D2/hcanim.h | 139 --
.../Libraries/Source/WWVegas/WW3D2/hmdldef.H | 112 -
.../Source/WWVegas/WW3D2/hmdldef.cpp | 257 ---
.../Libraries/Source/WWVegas/WW3D2/htree.cpp | 1231 -----------
.../Libraries/Source/WWVegas/WW3D2/htree.h | 212 --
.../Source/WWVegas/WW3D2/intersec.cpp | 444 ----
.../Libraries/Source/WWVegas/WW3D2/intersec.h | 404 ----
.../Source/WWVegas/WW3D2/intersec.inl | 1096 ----------
.../Libraries/Source/WWVegas/WW3D2/inttest.h | 256 ---
.../Libraries/Source/WWVegas/WW3D2/layer.cpp | 289 ---
.../Libraries/Source/WWVegas/WW3D2/layer.h | 100 -
.../Libraries/Source/WWVegas/WW3D2/line3d.cpp | 514 -----
.../Libraries/Source/WWVegas/WW3D2/line3d.h | 124 --
.../Source/WWVegas/WW3D2/matinfo.cpp | 429 ----
.../Libraries/Source/WWVegas/WW3D2/matinfo.h | 335 ---
.../Source/WWVegas/WW3D2/meshdam.cpp | 266 ---
.../Libraries/Source/WWVegas/WW3D2/meshdam.h | 108 -
.../Source/WWVegas/WW3D2/metalmap.cpp | 423 ----
.../Libraries/Source/WWVegas/WW3D2/metalmap.h | 121 --
.../Source/WWVegas/WW3D2/missingtexture.cpp | 711 ------
.../Source/WWVegas/WW3D2/missingtexture.h | 42 -
.../Libraries/Source/WWVegas/WW3D2/pivot.cpp | 171 --
.../Libraries/Source/WWVegas/WW3D2/pivot.h | 114 -
.../Source/WWVegas/WW3D2/pointgr.cpp | 1916 -----------------
.../Libraries/Source/WWVegas/WW3D2/pointgr.h | 242 ---
.../Source/WWVegas/WW3D2/polyinfo.cpp | 85 -
.../Libraries/Source/WWVegas/WW3D2/polyinfo.h | 94 -
.../Source/WWVegas/WW3D2/predlod.cpp | 406 ----
.../Libraries/Source/WWVegas/WW3D2/predlod.h | 86 -
.../Source/WWVegas/WW3D2/prim_anim.cpp | 40 -
.../Source/WWVegas/WW3D2/prim_anim.h | 391 ----
.../Source/WWVegas/WW3D2/projector.cpp | 236 --
.../Source/WWVegas/WW3D2/projector.h | 92 -
.../Libraries/Source/WWVegas/WW3D2/proto.cpp | 180 --
.../Libraries/Source/WWVegas/WW3D2/proto.h | 183 --
.../Libraries/Source/WWVegas/WW3D2/proxy.h | 115 -
.../Libraries/Source/WWVegas/WW3D2/rddesc.h | 172 --
.../Source/WWVegas/WW3D2/render2dsentence.cpp | 1795 ---------------
.../Source/WWVegas/WW3D2/render2dsentence.h | 276 ---
.../WWVegas/WW3D2/renderobjectrecycler.cpp | 188 --
.../WWVegas/WW3D2/renderobjectrecycler.h | 84 -
.../Source/WWVegas/WW3D2/rendobj.cpp | 1318 ------------
.../Libraries/Source/WWVegas/WW3D2/rendobj.h | 658 ------
.../Source/WWVegas/WW3D2/ringobj.cpp | 1650 --------------
.../Libraries/Source/WWVegas/WW3D2/ringobj.h | 370 ----
.../Libraries/Source/WWVegas/WW3D2/robjlist.h | 67 -
.../Source/WWVegas/WW3D2/segline.cpp | 591 -----
.../Libraries/Source/WWVegas/WW3D2/segline.h | 182 --
.../Source/WWVegas/WW3D2/seglinerenderer.cpp | 1320 ------------
.../Source/WWVegas/WW3D2/seglinerenderer.h | 212 --
.../Source/WWVegas/WW3D2/shattersystem.cpp | 1268 -----------
.../Source/WWVegas/WW3D2/shattersystem.h | 103 -
.../Libraries/Source/WWVegas/WW3D2/snapPts.h | 64 -
.../Source/WWVegas/WW3D2/snappts.cpp | 65 -
.../Source/WWVegas/WW3D2/soundlibrarybridge.h | 49 -
.../Source/WWVegas/WW3D2/soundrobj.cpp | 772 -------
.../Source/WWVegas/WW3D2/soundrobj.h | 285 ---
.../Source/WWVegas/WW3D2/sphereobj.cpp | 1754 ---------------
.../Source/WWVegas/WW3D2/sphereobj.h | 479 -----
.../Source/WWVegas/WW3D2/static_sort_list.cpp | 97 -
.../Source/WWVegas/WW3D2/static_sort_list.h | 99 -
.../Source/WWVegas/WW3D2/statistics.cpp | 394 ----
.../Source/WWVegas/WW3D2/statistics.h | 80 -
.../Libraries/Source/WWVegas/WW3D2/streak.cpp | 745 -------
.../Libraries/Source/WWVegas/WW3D2/streak.h | 220 --
.../Source/WWVegas/WW3D2/streakRender.cpp | 1425 ------------
.../Source/WWVegas/WW3D2/streakRender.h | 227 --
.../Source/WWVegas/WW3D2/stripoptimizer.cpp | 1019 ---------
.../Source/WWVegas/WW3D2/stripoptimizer.h | 48 -
.../Source/WWVegas/WW3D2/surfaceclass.cpp | 1036 ---------
.../Source/WWVegas/WW3D2/surfaceclass.h | 154 --
.../Source/WWVegas/WW3D2/textdraw.cpp | 344 ---
.../Libraries/Source/WWVegas/WW3D2/textdraw.h | 120 --
.../Source/WWVegas/WW3D2/visrasterizer.cpp | 730 -------
.../Source/WWVegas/WW3D2/visrasterizer.h | 213 --
.../Source/WWVegas/WW3D2/w3d_dep.cpp | 575 -----
.../Libraries/Source/WWVegas/WW3D2/w3d_dep.h | 54 -
.../Source/WWVegas/WW3D2/w3d_obsolete.h | 333 ---
.../Source/WWVegas/WW3D2/w3d_util.cpp | 142 --
.../Libraries/Source/WWVegas/WW3D2/w3d_util.h | 80 -
.../Libraries/Source/WWVegas/WW3D2/w3derr.h | 60 -
.../Source/WWVegas/WW3D2/w3dexclusionlist.cpp | 105 -
.../Source/WWVegas/WW3D2/w3dexclusionlist.h | 84 -
.../Source/WWVegas/WW3D2/ww3dformat.cpp | 455 ----
.../Source/WWVegas/WW3D2/ww3dformat.h | 209 --
.../Libraries/Source/WWVegas/WW3D2/ww3dids.h | 77 -
.../Libraries/Source/WWVegas/WW3D2/ww3dtrig.h | 61 -
.../Source/WWVegas/WW3D2/CMakeLists.txt | 262 ++-
.../WWVegas/WW3D2/DX8 Rationalizations.txt | 25 -
.../Source/WWVegas/WW3D2/DX8 Status.txt | 274 ---
.../WWVegas/WW3D2/DX8ToolModifications.txt | 7 -
.../Source/WWVegas/WW3D2/MAPPERS.TXT | 148 --
.../WWVegas/WW3D2/RenderObjectGuide.txt | 25 -
.../RequiredAssets/AddProjectorGradient.tga | Bin 1068 -> 0 bytes
.../WWVegas/WW3D2/RequiredAssets/Dazzle.INI | 161 --
.../RequiredAssets/MultProjectorGradient.tga | Bin 1068 -> 0 bytes
.../WW3D2/RequiredAssets/ShatterAVel.tbl | Bin 209 -> 0 bytes
.../WW3D2/RequiredAssets/ShatterPlanes0.w3d | Bin 2444 -> 0 bytes
.../WW3D2/RequiredAssets/ShatterVel.tbl | Bin 209 -> 0 bytes
.../RequiredAssets/w3d_missing_texture.tga | Bin 49196 -> 0 bytes
.../Source/WWVegas/WW3D2/State Management.txt | 173 --
.../Source/WWVegas/WW3D2/assetstatus.cpp | 115 -
.../Source/WWVegas/WW3D2/assetstatus.h | 68 -
288 files changed, 507 insertions(+), 51049 deletions(-)
create mode 100644 Core/Libraries/Source/WWVegas/WW3D2/CMakeLists.txt
rename {Generals/Code => Core}/Libraries/Source/WWVegas/WW3D2/DX8 Rationalizations.txt (100%)
rename {Generals/Code => Core}/Libraries/Source/WWVegas/WW3D2/DX8 Status.txt (100%)
rename {Generals/Code => Core}/Libraries/Source/WWVegas/WW3D2/DX8ToolModifications.txt (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/FramGrab.cpp (100%)
rename {Generals/Code => Core}/Libraries/Source/WWVegas/WW3D2/MAPPERS.TXT (100%)
rename {Generals/Code => Core}/Libraries/Source/WWVegas/WW3D2/RenderObjectGuide.txt (100%)
rename {Generals/Code => Core}/Libraries/Source/WWVegas/WW3D2/RequiredAssets/AddProjectorGradient.tga (100%)
rename {Generals/Code => Core}/Libraries/Source/WWVegas/WW3D2/RequiredAssets/Dazzle.INI (100%)
rename {Generals/Code => Core}/Libraries/Source/WWVegas/WW3D2/RequiredAssets/MultProjectorGradient.tga (100%)
rename {Generals/Code => Core}/Libraries/Source/WWVegas/WW3D2/RequiredAssets/ShatterAVel.tbl (100%)
rename {Generals/Code => Core}/Libraries/Source/WWVegas/WW3D2/RequiredAssets/ShatterPlanes0.w3d (100%)
rename {Generals/Code => Core}/Libraries/Source/WWVegas/WW3D2/RequiredAssets/ShatterVel.tbl (100%)
rename {Generals/Code => Core}/Libraries/Source/WWVegas/WW3D2/RequiredAssets/w3d_missing_texture.tga (100%)
rename {Generals/Code => Core}/Libraries/Source/WWVegas/WW3D2/State Management.txt (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/aabtree.cpp (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/aabtree.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/agg_def.cpp (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/agg_def.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/animatedsoundmgr.cpp (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/animatedsoundmgr.h (100%)
rename {Generals/Code => Core}/Libraries/Source/WWVegas/WW3D2/assetstatus.cpp (100%)
rename {Generals/Code => Core}/Libraries/Source/WWVegas/WW3D2/assetstatus.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/bitmaphandler.cpp (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/bitmaphandler.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/bwrender.cpp (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/bwrender.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/classid.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/collect.cpp (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/collect.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/colorspace.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/coltest.cpp (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/coltest.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/coltype.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/composite.cpp (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/composite.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/decalsys.cpp (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/decalsys.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/distlod.cpp (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/distlod.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/dllist.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/dx8list.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/dx8polygonrenderer.cpp (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/dx8polygonrenderer.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/dx8webbrowser.cpp (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/dx8webbrowser.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/dynamesh.cpp (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/dynamesh.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/font3d.cpp (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/font3d.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/formconv.cpp (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/formconv.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/framgrab.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/hanim.cpp (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/hanim.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/hcanim.cpp (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/hcanim.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/hmdldef.H (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/hmdldef.cpp (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/htree.cpp (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/htree.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/intersec.cpp (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/intersec.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/intersec.inl (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/inttest.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/layer.cpp (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/layer.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/line3d.cpp (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/line3d.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/matinfo.cpp (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/matinfo.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/meshdam.cpp (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/meshdam.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/metalmap.cpp (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/metalmap.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/missingtexture.cpp (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/missingtexture.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/pivot.cpp (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/pivot.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/pointgr.cpp (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/pointgr.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/polyinfo.cpp (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/polyinfo.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/predlod.cpp (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/predlod.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/prim_anim.cpp (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/prim_anim.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/projector.cpp (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/projector.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/proto.cpp (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/proto.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/proxy.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/rddesc.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/render2dsentence.cpp (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/render2dsentence.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/renderobjectrecycler.cpp (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/renderobjectrecycler.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/rendobj.cpp (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/rendobj.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/ringobj.cpp (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/ringobj.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/robjlist.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/segline.cpp (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/segline.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/seglinerenderer.cpp (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/seglinerenderer.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/shattersystem.cpp (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/shattersystem.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/snapPts.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/snappts.cpp (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/soundlibrarybridge.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/soundrobj.cpp (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/soundrobj.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/sphereobj.cpp (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/sphereobj.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/static_sort_list.cpp (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/static_sort_list.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/statistics.cpp (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/statistics.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/streak.cpp (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/streak.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/streakRender.cpp (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/streakRender.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/stripoptimizer.cpp (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/stripoptimizer.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/surfaceclass.cpp (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/surfaceclass.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/textdraw.cpp (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/textdraw.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/visrasterizer.cpp (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/visrasterizer.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/w3d_dep.cpp (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/w3d_dep.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/w3d_obsolete.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/w3d_util.cpp (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/w3d_util.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/w3derr.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/w3dexclusionlist.cpp (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/w3dexclusionlist.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/ww3dformat.cpp (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/ww3dformat.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/ww3dids.h (100%)
rename {GeneralsMD/Code => Core}/Libraries/Source/WWVegas/WW3D2/ww3dtrig.h (100%)
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/FramGrab.cpp
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/aabtree.cpp
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/aabtree.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/agg_def.cpp
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/agg_def.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/animatedsoundmgr.cpp
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/animatedsoundmgr.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/bitmaphandler.cpp
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/bitmaphandler.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/bwrender.cpp
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/bwrender.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/classid.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/collect.cpp
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/collect.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/colorspace.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/coltest.cpp
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/coltest.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/coltype.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/composite.cpp
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/composite.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/decalsys.cpp
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/decalsys.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/distlod.cpp
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/distlod.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/dllist.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8list.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8polygonrenderer.cpp
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8polygonrenderer.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8webbrowser.cpp
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8webbrowser.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/dynamesh.cpp
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/dynamesh.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/font3d.cpp
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/font3d.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/formconv.cpp
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/formconv.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/framgrab.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/hanim.cpp
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/hanim.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/hcanim.cpp
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/hcanim.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/hmdldef.H
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/hmdldef.cpp
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/htree.cpp
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/htree.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/intersec.cpp
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/intersec.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/intersec.inl
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/inttest.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/layer.cpp
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/layer.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/line3d.cpp
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/line3d.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/matinfo.cpp
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/matinfo.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/meshdam.cpp
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/meshdam.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/metalmap.cpp
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/metalmap.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/missingtexture.cpp
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/missingtexture.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/pivot.cpp
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/pivot.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/pointgr.cpp
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/pointgr.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/polyinfo.cpp
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/polyinfo.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/predlod.cpp
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/predlod.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/prim_anim.cpp
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/prim_anim.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/projector.cpp
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/projector.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/proto.cpp
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/proto.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/proxy.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/rddesc.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/render2dsentence.cpp
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/render2dsentence.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/renderobjectrecycler.cpp
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/renderobjectrecycler.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/rendobj.cpp
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/rendobj.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/ringobj.cpp
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/ringobj.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/robjlist.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/segline.cpp
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/segline.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/seglinerenderer.cpp
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/seglinerenderer.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/shattersystem.cpp
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/shattersystem.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/snapPts.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/snappts.cpp
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/soundlibrarybridge.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/soundrobj.cpp
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/soundrobj.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/sphereobj.cpp
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/sphereobj.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/static_sort_list.cpp
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/static_sort_list.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/statistics.cpp
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/statistics.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/streak.cpp
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/streak.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/streakRender.cpp
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/streakRender.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/stripoptimizer.cpp
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/stripoptimizer.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/surfaceclass.cpp
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/surfaceclass.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/textdraw.cpp
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/textdraw.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/visrasterizer.cpp
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/visrasterizer.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/w3d_dep.cpp
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/w3d_dep.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/w3d_obsolete.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/w3d_util.cpp
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/w3d_util.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/w3derr.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/w3dexclusionlist.cpp
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/w3dexclusionlist.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/ww3dformat.cpp
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/ww3dformat.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/ww3dids.h
delete mode 100644 Generals/Code/Libraries/Source/WWVegas/WW3D2/ww3dtrig.h
delete mode 100644 GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/DX8 Rationalizations.txt
delete mode 100644 GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/DX8 Status.txt
delete mode 100644 GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/DX8ToolModifications.txt
delete mode 100644 GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/MAPPERS.TXT
delete mode 100644 GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/RenderObjectGuide.txt
delete mode 100644 GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/RequiredAssets/AddProjectorGradient.tga
delete mode 100644 GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/RequiredAssets/Dazzle.INI
delete mode 100644 GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/RequiredAssets/MultProjectorGradient.tga
delete mode 100644 GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/RequiredAssets/ShatterAVel.tbl
delete mode 100644 GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/RequiredAssets/ShatterPlanes0.w3d
delete mode 100644 GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/RequiredAssets/ShatterVel.tbl
delete mode 100644 GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/RequiredAssets/w3d_missing_texture.tga
delete mode 100644 GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/State Management.txt
delete mode 100644 GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/assetstatus.cpp
delete mode 100644 GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/assetstatus.h
diff --git a/Core/Libraries/Source/WWVegas/CMakeLists.txt b/Core/Libraries/Source/WWVegas/CMakeLists.txt
index 60e58baa6ca..6c1a97bc6d9 100644
--- a/Core/Libraries/Source/WWVegas/CMakeLists.txt
+++ b/Core/Libraries/Source/WWVegas/CMakeLists.txt
@@ -16,7 +16,7 @@ target_link_libraries(core_wwcommon INTERFACE
target_include_directories(core_wwcommon INTERFACE
${CMAKE_CURRENT_SOURCE_DIR}
- # WW3D2
+ WW3D2
WWAudio
WWDebug
# WWDownload # is not added because headers are included as "WWDownload/file.h"
@@ -25,7 +25,7 @@ target_include_directories(core_wwcommon INTERFACE
WWSaveLoad
)
-# add_subdirectory(WW3D2)
+add_subdirectory(WW3D2)
add_subdirectory(WWAudio)
add_subdirectory(WWDebug)
add_subdirectory(WWDownload)
@@ -39,7 +39,7 @@ add_library(core_wwvegas INTERFACE)
target_include_directories(core_wwvegas INTERFACE
${CMAKE_CURRENT_SOURCE_DIR}
- #WW3D2
+ WW3D2
WWAudio
WWDebug
# WWDownload # is not added because headers are included as "WWDownload/file.h"
diff --git a/Core/Libraries/Source/WWVegas/WW3D2/CMakeLists.txt b/Core/Libraries/Source/WWVegas/WW3D2/CMakeLists.txt
new file mode 100644
index 00000000000..628746e29f8
--- /dev/null
+++ b/Core/Libraries/Source/WWVegas/WW3D2/CMakeLists.txt
@@ -0,0 +1,248 @@
+set(WW3D2_SRC
+ aabtree.cpp
+ aabtree.h
+ #aabtreebuilder.cpp
+ #aabtreebuilder.h
+ agg_def.cpp
+ agg_def.h
+ animatedsoundmgr.cpp
+ animatedsoundmgr.h
+ #animobj.cpp
+ #animobj.h
+ #assetmgr.cpp
+ #assetmgr.h
+ assetstatus.cpp
+ assetstatus.h
+ bitmaphandler.cpp
+ bitmaphandler.h
+ #bmp2d.cpp
+ #bmp2d.h
+ #boxrobj.cpp
+ #boxrobj.h
+ bwrender.cpp
+ bwrender.h
+ #camera.cpp
+ #camera.h
+ #classid.h # unused
+ collect.cpp
+ collect.h
+ colorspace.h
+ coltest.cpp
+ coltest.h
+ coltype.h
+ composite.cpp
+ composite.h
+ #dazzle.cpp
+ #dazzle.h
+ #ddsfile.cpp
+ #ddsfile.h
+ #decalmsh.cpp
+ #decalmsh.h
+ decalsys.cpp
+ decalsys.h
+ distlod.cpp
+ distlod.h
+ dllist.h
+ #dx8caps.cpp
+ #dx8caps.h
+ #dx8fvf.cpp
+ #dx8fvf.h
+ #dx8indexbuffer.cpp
+ #dx8indexbuffer.h
+ dx8list.h
+ dx8polygonrenderer.cpp
+ dx8polygonrenderer.h
+ #dx8renderer.cpp
+ #dx8renderer.h
+ #dx8rendererdebugger.cpp
+ #dx8rendererdebugger.h
+ #dx8texman.cpp
+ #dx8texman.h
+ #dx8vertexbuffer.cpp
+ #dx8vertexbuffer.h
+ dx8webbrowser.cpp
+ dx8webbrowser.h
+ #dx8wrapper.cpp
+ #dx8wrapper.h
+ dynamesh.cpp
+ dynamesh.h
+ font3d.cpp
+ font3d.h
+ formconv.cpp
+ formconv.h
+ FramGrab.cpp
+ framgrab.h
+ hanim.cpp
+ hanim.h
+ #hanimmgr.cpp
+ #hanimmgr.h
+ hcanim.cpp
+ hcanim.h
+ #hlod.cpp
+ #hlod.h
+ hmdldef.cpp
+ hmdldef.H
+ #hmorphanim.cpp
+ #hmorphanim.h
+ #hrawanim.cpp
+ #hrawanim.h
+ htree.cpp
+ htree.h
+ #htreemgr.cpp
+ #htreemgr.h
+ intersec.cpp
+ intersec.h
+ intersec.inl
+ inttest.h
+ layer.cpp
+ layer.h
+ #light.cpp
+ #light.h
+ #lightenvironment.cpp
+ #lightenvironment.h
+ line3d.cpp
+ line3d.h
+ #linegrp.cpp
+ #linegrp.h
+ #mapper.cpp
+ #mapper.h
+ matinfo.cpp
+ matinfo.h
+ #matpass.cpp
+ #matpass.h
+ #matrixmapper.cpp
+ #matrixmapper.h
+ #mesh.cpp
+ #mesh.h
+ #meshbuild.cpp
+ #meshbuild.h
+ meshdam.cpp
+ meshdam.h
+ #meshgeometry.cpp
+ #meshgeometry.h
+ #meshmatdesc.cpp
+ #meshmatdesc.h
+ #meshmdl.cpp
+ #meshmdl.h
+ #meshmdlio.cpp
+ metalmap.cpp
+ metalmap.h
+ missingtexture.cpp
+ missingtexture.h
+ #motchan.cpp
+ #motchan.h
+ #nullrobj.cpp
+ #nullrobj.h
+ #part_buf.cpp
+ #part_buf.h
+ #part_emt.cpp
+ #part_emt.h
+ #part_ldr.cpp
+ #part_ldr.h
+ pivot.cpp
+ pivot.h
+ pointgr.cpp
+ pointgr.h
+ polyinfo.cpp
+ polyinfo.h
+ predlod.cpp
+ predlod.h
+ prim_anim.cpp
+ prim_anim.h
+ projector.cpp
+ projector.h
+ proto.cpp
+ proto.h
+ proxy.h
+ rddesc.h
+ #render2d.cpp
+ #render2d.h
+ render2dsentence.cpp
+ render2dsentence.h
+ renderobjectrecycler.cpp
+ renderobjectrecycler.h
+ rendobj.cpp
+ rendobj.h
+ #rinfo.cpp
+ #rinfo.h
+ ringobj.cpp
+ ringobj.h
+ robjlist.h
+ #scene.cpp
+ #scene.h
+ segline.cpp
+ segline.h
+ seglinerenderer.cpp
+ seglinerenderer.h
+ #shader.cpp
+ #shader.h
+ shattersystem.cpp
+ shattersystem.h
+ #shdlib.h
+ snappts.cpp
+ snapPts.h
+ #sortingrenderer.cpp
+ #sortingrenderer.h
+ soundlibrarybridge.h
+ soundrobj.cpp
+ soundrobj.h
+ sphereobj.cpp
+ sphereobj.h
+ static_sort_list.cpp
+ static_sort_list.h
+ statistics.cpp
+ statistics.h
+ streak.cpp
+ streak.h
+ streakRender.cpp
+ streakRender.h
+ stripoptimizer.cpp
+ stripoptimizer.h
+ surfaceclass.cpp
+ surfaceclass.h
+ #texproject.cpp
+ #texproject.h
+ #textdraw.cpp # unused
+ textdraw.h
+ #texture.cpp
+ #texture.h
+ #texturefilter.cpp
+ #texturefilter.h
+ #textureloader.cpp
+ #textureloader.h
+ #texturethumbnail.cpp
+ #texturethumbnail.h
+ #vertmaterial.cpp
+ #vertmaterial.h
+ visrasterizer.cpp
+ visrasterizer.h
+ w3d_dep.cpp
+ w3d_dep.h
+ #w3d_file.h
+ w3d_obsolete.h
+ w3d_util.cpp
+ w3d_util.h
+ w3derr.h
+ w3dexclusionlist.cpp
+ w3dexclusionlist.h
+ #ww3d.cpp
+ #ww3d.h
+ ww3dformat.cpp
+ ww3dformat.h
+ ww3dids.h
+ ww3dtrig.h
+)
+
+add_library(corei_ww3d2 INTERFACE)
+
+target_sources(corei_ww3d2 INTERFACE ${WW3D2_SRC})
+
+if (NOT IS_VS6_BUILD)
+ target_link_libraries(corei_ww3d2 INTERFACE
+ comsuppw
+ )
+endif()
+
+target_link_libraries(corei_ww3d2 INTERFACE
+ core_browserengine
+)
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/DX8 Rationalizations.txt b/Core/Libraries/Source/WWVegas/WW3D2/DX8 Rationalizations.txt
similarity index 100%
rename from Generals/Code/Libraries/Source/WWVegas/WW3D2/DX8 Rationalizations.txt
rename to Core/Libraries/Source/WWVegas/WW3D2/DX8 Rationalizations.txt
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/DX8 Status.txt b/Core/Libraries/Source/WWVegas/WW3D2/DX8 Status.txt
similarity index 100%
rename from Generals/Code/Libraries/Source/WWVegas/WW3D2/DX8 Status.txt
rename to Core/Libraries/Source/WWVegas/WW3D2/DX8 Status.txt
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/DX8ToolModifications.txt b/Core/Libraries/Source/WWVegas/WW3D2/DX8ToolModifications.txt
similarity index 100%
rename from Generals/Code/Libraries/Source/WWVegas/WW3D2/DX8ToolModifications.txt
rename to Core/Libraries/Source/WWVegas/WW3D2/DX8ToolModifications.txt
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/FramGrab.cpp b/Core/Libraries/Source/WWVegas/WW3D2/FramGrab.cpp
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/FramGrab.cpp
rename to Core/Libraries/Source/WWVegas/WW3D2/FramGrab.cpp
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/MAPPERS.TXT b/Core/Libraries/Source/WWVegas/WW3D2/MAPPERS.TXT
similarity index 100%
rename from Generals/Code/Libraries/Source/WWVegas/WW3D2/MAPPERS.TXT
rename to Core/Libraries/Source/WWVegas/WW3D2/MAPPERS.TXT
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/RenderObjectGuide.txt b/Core/Libraries/Source/WWVegas/WW3D2/RenderObjectGuide.txt
similarity index 100%
rename from Generals/Code/Libraries/Source/WWVegas/WW3D2/RenderObjectGuide.txt
rename to Core/Libraries/Source/WWVegas/WW3D2/RenderObjectGuide.txt
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/RequiredAssets/AddProjectorGradient.tga b/Core/Libraries/Source/WWVegas/WW3D2/RequiredAssets/AddProjectorGradient.tga
similarity index 100%
rename from Generals/Code/Libraries/Source/WWVegas/WW3D2/RequiredAssets/AddProjectorGradient.tga
rename to Core/Libraries/Source/WWVegas/WW3D2/RequiredAssets/AddProjectorGradient.tga
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/RequiredAssets/Dazzle.INI b/Core/Libraries/Source/WWVegas/WW3D2/RequiredAssets/Dazzle.INI
similarity index 100%
rename from Generals/Code/Libraries/Source/WWVegas/WW3D2/RequiredAssets/Dazzle.INI
rename to Core/Libraries/Source/WWVegas/WW3D2/RequiredAssets/Dazzle.INI
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/RequiredAssets/MultProjectorGradient.tga b/Core/Libraries/Source/WWVegas/WW3D2/RequiredAssets/MultProjectorGradient.tga
similarity index 100%
rename from Generals/Code/Libraries/Source/WWVegas/WW3D2/RequiredAssets/MultProjectorGradient.tga
rename to Core/Libraries/Source/WWVegas/WW3D2/RequiredAssets/MultProjectorGradient.tga
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/RequiredAssets/ShatterAVel.tbl b/Core/Libraries/Source/WWVegas/WW3D2/RequiredAssets/ShatterAVel.tbl
similarity index 100%
rename from Generals/Code/Libraries/Source/WWVegas/WW3D2/RequiredAssets/ShatterAVel.tbl
rename to Core/Libraries/Source/WWVegas/WW3D2/RequiredAssets/ShatterAVel.tbl
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/RequiredAssets/ShatterPlanes0.w3d b/Core/Libraries/Source/WWVegas/WW3D2/RequiredAssets/ShatterPlanes0.w3d
similarity index 100%
rename from Generals/Code/Libraries/Source/WWVegas/WW3D2/RequiredAssets/ShatterPlanes0.w3d
rename to Core/Libraries/Source/WWVegas/WW3D2/RequiredAssets/ShatterPlanes0.w3d
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/RequiredAssets/ShatterVel.tbl b/Core/Libraries/Source/WWVegas/WW3D2/RequiredAssets/ShatterVel.tbl
similarity index 100%
rename from Generals/Code/Libraries/Source/WWVegas/WW3D2/RequiredAssets/ShatterVel.tbl
rename to Core/Libraries/Source/WWVegas/WW3D2/RequiredAssets/ShatterVel.tbl
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/RequiredAssets/w3d_missing_texture.tga b/Core/Libraries/Source/WWVegas/WW3D2/RequiredAssets/w3d_missing_texture.tga
similarity index 100%
rename from Generals/Code/Libraries/Source/WWVegas/WW3D2/RequiredAssets/w3d_missing_texture.tga
rename to Core/Libraries/Source/WWVegas/WW3D2/RequiredAssets/w3d_missing_texture.tga
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/State Management.txt b/Core/Libraries/Source/WWVegas/WW3D2/State Management.txt
similarity index 100%
rename from Generals/Code/Libraries/Source/WWVegas/WW3D2/State Management.txt
rename to Core/Libraries/Source/WWVegas/WW3D2/State Management.txt
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/aabtree.cpp b/Core/Libraries/Source/WWVegas/WW3D2/aabtree.cpp
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/aabtree.cpp
rename to Core/Libraries/Source/WWVegas/WW3D2/aabtree.cpp
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/aabtree.h b/Core/Libraries/Source/WWVegas/WW3D2/aabtree.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/aabtree.h
rename to Core/Libraries/Source/WWVegas/WW3D2/aabtree.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/agg_def.cpp b/Core/Libraries/Source/WWVegas/WW3D2/agg_def.cpp
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/agg_def.cpp
rename to Core/Libraries/Source/WWVegas/WW3D2/agg_def.cpp
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/agg_def.h b/Core/Libraries/Source/WWVegas/WW3D2/agg_def.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/agg_def.h
rename to Core/Libraries/Source/WWVegas/WW3D2/agg_def.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/animatedsoundmgr.cpp b/Core/Libraries/Source/WWVegas/WW3D2/animatedsoundmgr.cpp
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/animatedsoundmgr.cpp
rename to Core/Libraries/Source/WWVegas/WW3D2/animatedsoundmgr.cpp
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/animatedsoundmgr.h b/Core/Libraries/Source/WWVegas/WW3D2/animatedsoundmgr.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/animatedsoundmgr.h
rename to Core/Libraries/Source/WWVegas/WW3D2/animatedsoundmgr.h
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/assetstatus.cpp b/Core/Libraries/Source/WWVegas/WW3D2/assetstatus.cpp
similarity index 100%
rename from Generals/Code/Libraries/Source/WWVegas/WW3D2/assetstatus.cpp
rename to Core/Libraries/Source/WWVegas/WW3D2/assetstatus.cpp
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/assetstatus.h b/Core/Libraries/Source/WWVegas/WW3D2/assetstatus.h
similarity index 100%
rename from Generals/Code/Libraries/Source/WWVegas/WW3D2/assetstatus.h
rename to Core/Libraries/Source/WWVegas/WW3D2/assetstatus.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/bitmaphandler.cpp b/Core/Libraries/Source/WWVegas/WW3D2/bitmaphandler.cpp
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/bitmaphandler.cpp
rename to Core/Libraries/Source/WWVegas/WW3D2/bitmaphandler.cpp
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/bitmaphandler.h b/Core/Libraries/Source/WWVegas/WW3D2/bitmaphandler.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/bitmaphandler.h
rename to Core/Libraries/Source/WWVegas/WW3D2/bitmaphandler.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/bwrender.cpp b/Core/Libraries/Source/WWVegas/WW3D2/bwrender.cpp
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/bwrender.cpp
rename to Core/Libraries/Source/WWVegas/WW3D2/bwrender.cpp
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/bwrender.h b/Core/Libraries/Source/WWVegas/WW3D2/bwrender.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/bwrender.h
rename to Core/Libraries/Source/WWVegas/WW3D2/bwrender.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/classid.h b/Core/Libraries/Source/WWVegas/WW3D2/classid.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/classid.h
rename to Core/Libraries/Source/WWVegas/WW3D2/classid.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/collect.cpp b/Core/Libraries/Source/WWVegas/WW3D2/collect.cpp
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/collect.cpp
rename to Core/Libraries/Source/WWVegas/WW3D2/collect.cpp
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/collect.h b/Core/Libraries/Source/WWVegas/WW3D2/collect.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/collect.h
rename to Core/Libraries/Source/WWVegas/WW3D2/collect.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/colorspace.h b/Core/Libraries/Source/WWVegas/WW3D2/colorspace.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/colorspace.h
rename to Core/Libraries/Source/WWVegas/WW3D2/colorspace.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/coltest.cpp b/Core/Libraries/Source/WWVegas/WW3D2/coltest.cpp
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/coltest.cpp
rename to Core/Libraries/Source/WWVegas/WW3D2/coltest.cpp
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/coltest.h b/Core/Libraries/Source/WWVegas/WW3D2/coltest.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/coltest.h
rename to Core/Libraries/Source/WWVegas/WW3D2/coltest.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/coltype.h b/Core/Libraries/Source/WWVegas/WW3D2/coltype.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/coltype.h
rename to Core/Libraries/Source/WWVegas/WW3D2/coltype.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/composite.cpp b/Core/Libraries/Source/WWVegas/WW3D2/composite.cpp
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/composite.cpp
rename to Core/Libraries/Source/WWVegas/WW3D2/composite.cpp
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/composite.h b/Core/Libraries/Source/WWVegas/WW3D2/composite.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/composite.h
rename to Core/Libraries/Source/WWVegas/WW3D2/composite.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/decalsys.cpp b/Core/Libraries/Source/WWVegas/WW3D2/decalsys.cpp
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/decalsys.cpp
rename to Core/Libraries/Source/WWVegas/WW3D2/decalsys.cpp
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/decalsys.h b/Core/Libraries/Source/WWVegas/WW3D2/decalsys.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/decalsys.h
rename to Core/Libraries/Source/WWVegas/WW3D2/decalsys.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/distlod.cpp b/Core/Libraries/Source/WWVegas/WW3D2/distlod.cpp
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/distlod.cpp
rename to Core/Libraries/Source/WWVegas/WW3D2/distlod.cpp
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/distlod.h b/Core/Libraries/Source/WWVegas/WW3D2/distlod.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/distlod.h
rename to Core/Libraries/Source/WWVegas/WW3D2/distlod.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dllist.h b/Core/Libraries/Source/WWVegas/WW3D2/dllist.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dllist.h
rename to Core/Libraries/Source/WWVegas/WW3D2/dllist.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8list.h b/Core/Libraries/Source/WWVegas/WW3D2/dx8list.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8list.h
rename to Core/Libraries/Source/WWVegas/WW3D2/dx8list.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8polygonrenderer.cpp b/Core/Libraries/Source/WWVegas/WW3D2/dx8polygonrenderer.cpp
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8polygonrenderer.cpp
rename to Core/Libraries/Source/WWVegas/WW3D2/dx8polygonrenderer.cpp
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8polygonrenderer.h b/Core/Libraries/Source/WWVegas/WW3D2/dx8polygonrenderer.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8polygonrenderer.h
rename to Core/Libraries/Source/WWVegas/WW3D2/dx8polygonrenderer.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8webbrowser.cpp b/Core/Libraries/Source/WWVegas/WW3D2/dx8webbrowser.cpp
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8webbrowser.cpp
rename to Core/Libraries/Source/WWVegas/WW3D2/dx8webbrowser.cpp
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8webbrowser.h b/Core/Libraries/Source/WWVegas/WW3D2/dx8webbrowser.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8webbrowser.h
rename to Core/Libraries/Source/WWVegas/WW3D2/dx8webbrowser.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dynamesh.cpp b/Core/Libraries/Source/WWVegas/WW3D2/dynamesh.cpp
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dynamesh.cpp
rename to Core/Libraries/Source/WWVegas/WW3D2/dynamesh.cpp
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dynamesh.h b/Core/Libraries/Source/WWVegas/WW3D2/dynamesh.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dynamesh.h
rename to Core/Libraries/Source/WWVegas/WW3D2/dynamesh.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/font3d.cpp b/Core/Libraries/Source/WWVegas/WW3D2/font3d.cpp
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/font3d.cpp
rename to Core/Libraries/Source/WWVegas/WW3D2/font3d.cpp
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/font3d.h b/Core/Libraries/Source/WWVegas/WW3D2/font3d.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/font3d.h
rename to Core/Libraries/Source/WWVegas/WW3D2/font3d.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/formconv.cpp b/Core/Libraries/Source/WWVegas/WW3D2/formconv.cpp
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/formconv.cpp
rename to Core/Libraries/Source/WWVegas/WW3D2/formconv.cpp
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/formconv.h b/Core/Libraries/Source/WWVegas/WW3D2/formconv.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/formconv.h
rename to Core/Libraries/Source/WWVegas/WW3D2/formconv.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/framgrab.h b/Core/Libraries/Source/WWVegas/WW3D2/framgrab.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/framgrab.h
rename to Core/Libraries/Source/WWVegas/WW3D2/framgrab.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/hanim.cpp b/Core/Libraries/Source/WWVegas/WW3D2/hanim.cpp
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/hanim.cpp
rename to Core/Libraries/Source/WWVegas/WW3D2/hanim.cpp
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/hanim.h b/Core/Libraries/Source/WWVegas/WW3D2/hanim.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/hanim.h
rename to Core/Libraries/Source/WWVegas/WW3D2/hanim.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/hcanim.cpp b/Core/Libraries/Source/WWVegas/WW3D2/hcanim.cpp
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/hcanim.cpp
rename to Core/Libraries/Source/WWVegas/WW3D2/hcanim.cpp
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/hcanim.h b/Core/Libraries/Source/WWVegas/WW3D2/hcanim.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/hcanim.h
rename to Core/Libraries/Source/WWVegas/WW3D2/hcanim.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/hmdldef.H b/Core/Libraries/Source/WWVegas/WW3D2/hmdldef.H
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/hmdldef.H
rename to Core/Libraries/Source/WWVegas/WW3D2/hmdldef.H
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/hmdldef.cpp b/Core/Libraries/Source/WWVegas/WW3D2/hmdldef.cpp
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/hmdldef.cpp
rename to Core/Libraries/Source/WWVegas/WW3D2/hmdldef.cpp
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/htree.cpp b/Core/Libraries/Source/WWVegas/WW3D2/htree.cpp
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/htree.cpp
rename to Core/Libraries/Source/WWVegas/WW3D2/htree.cpp
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/htree.h b/Core/Libraries/Source/WWVegas/WW3D2/htree.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/htree.h
rename to Core/Libraries/Source/WWVegas/WW3D2/htree.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/intersec.cpp b/Core/Libraries/Source/WWVegas/WW3D2/intersec.cpp
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/intersec.cpp
rename to Core/Libraries/Source/WWVegas/WW3D2/intersec.cpp
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/intersec.h b/Core/Libraries/Source/WWVegas/WW3D2/intersec.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/intersec.h
rename to Core/Libraries/Source/WWVegas/WW3D2/intersec.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/intersec.inl b/Core/Libraries/Source/WWVegas/WW3D2/intersec.inl
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/intersec.inl
rename to Core/Libraries/Source/WWVegas/WW3D2/intersec.inl
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/inttest.h b/Core/Libraries/Source/WWVegas/WW3D2/inttest.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/inttest.h
rename to Core/Libraries/Source/WWVegas/WW3D2/inttest.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/layer.cpp b/Core/Libraries/Source/WWVegas/WW3D2/layer.cpp
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/layer.cpp
rename to Core/Libraries/Source/WWVegas/WW3D2/layer.cpp
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/layer.h b/Core/Libraries/Source/WWVegas/WW3D2/layer.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/layer.h
rename to Core/Libraries/Source/WWVegas/WW3D2/layer.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/line3d.cpp b/Core/Libraries/Source/WWVegas/WW3D2/line3d.cpp
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/line3d.cpp
rename to Core/Libraries/Source/WWVegas/WW3D2/line3d.cpp
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/line3d.h b/Core/Libraries/Source/WWVegas/WW3D2/line3d.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/line3d.h
rename to Core/Libraries/Source/WWVegas/WW3D2/line3d.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/matinfo.cpp b/Core/Libraries/Source/WWVegas/WW3D2/matinfo.cpp
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/matinfo.cpp
rename to Core/Libraries/Source/WWVegas/WW3D2/matinfo.cpp
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/matinfo.h b/Core/Libraries/Source/WWVegas/WW3D2/matinfo.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/matinfo.h
rename to Core/Libraries/Source/WWVegas/WW3D2/matinfo.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/meshdam.cpp b/Core/Libraries/Source/WWVegas/WW3D2/meshdam.cpp
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/meshdam.cpp
rename to Core/Libraries/Source/WWVegas/WW3D2/meshdam.cpp
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/meshdam.h b/Core/Libraries/Source/WWVegas/WW3D2/meshdam.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/meshdam.h
rename to Core/Libraries/Source/WWVegas/WW3D2/meshdam.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/metalmap.cpp b/Core/Libraries/Source/WWVegas/WW3D2/metalmap.cpp
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/metalmap.cpp
rename to Core/Libraries/Source/WWVegas/WW3D2/metalmap.cpp
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/metalmap.h b/Core/Libraries/Source/WWVegas/WW3D2/metalmap.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/metalmap.h
rename to Core/Libraries/Source/WWVegas/WW3D2/metalmap.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/missingtexture.cpp b/Core/Libraries/Source/WWVegas/WW3D2/missingtexture.cpp
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/missingtexture.cpp
rename to Core/Libraries/Source/WWVegas/WW3D2/missingtexture.cpp
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/missingtexture.h b/Core/Libraries/Source/WWVegas/WW3D2/missingtexture.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/missingtexture.h
rename to Core/Libraries/Source/WWVegas/WW3D2/missingtexture.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/pivot.cpp b/Core/Libraries/Source/WWVegas/WW3D2/pivot.cpp
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/pivot.cpp
rename to Core/Libraries/Source/WWVegas/WW3D2/pivot.cpp
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/pivot.h b/Core/Libraries/Source/WWVegas/WW3D2/pivot.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/pivot.h
rename to Core/Libraries/Source/WWVegas/WW3D2/pivot.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/pointgr.cpp b/Core/Libraries/Source/WWVegas/WW3D2/pointgr.cpp
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/pointgr.cpp
rename to Core/Libraries/Source/WWVegas/WW3D2/pointgr.cpp
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/pointgr.h b/Core/Libraries/Source/WWVegas/WW3D2/pointgr.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/pointgr.h
rename to Core/Libraries/Source/WWVegas/WW3D2/pointgr.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/polyinfo.cpp b/Core/Libraries/Source/WWVegas/WW3D2/polyinfo.cpp
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/polyinfo.cpp
rename to Core/Libraries/Source/WWVegas/WW3D2/polyinfo.cpp
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/polyinfo.h b/Core/Libraries/Source/WWVegas/WW3D2/polyinfo.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/polyinfo.h
rename to Core/Libraries/Source/WWVegas/WW3D2/polyinfo.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/predlod.cpp b/Core/Libraries/Source/WWVegas/WW3D2/predlod.cpp
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/predlod.cpp
rename to Core/Libraries/Source/WWVegas/WW3D2/predlod.cpp
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/predlod.h b/Core/Libraries/Source/WWVegas/WW3D2/predlod.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/predlod.h
rename to Core/Libraries/Source/WWVegas/WW3D2/predlod.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/prim_anim.cpp b/Core/Libraries/Source/WWVegas/WW3D2/prim_anim.cpp
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/prim_anim.cpp
rename to Core/Libraries/Source/WWVegas/WW3D2/prim_anim.cpp
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/prim_anim.h b/Core/Libraries/Source/WWVegas/WW3D2/prim_anim.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/prim_anim.h
rename to Core/Libraries/Source/WWVegas/WW3D2/prim_anim.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/projector.cpp b/Core/Libraries/Source/WWVegas/WW3D2/projector.cpp
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/projector.cpp
rename to Core/Libraries/Source/WWVegas/WW3D2/projector.cpp
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/projector.h b/Core/Libraries/Source/WWVegas/WW3D2/projector.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/projector.h
rename to Core/Libraries/Source/WWVegas/WW3D2/projector.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/proto.cpp b/Core/Libraries/Source/WWVegas/WW3D2/proto.cpp
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/proto.cpp
rename to Core/Libraries/Source/WWVegas/WW3D2/proto.cpp
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/proto.h b/Core/Libraries/Source/WWVegas/WW3D2/proto.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/proto.h
rename to Core/Libraries/Source/WWVegas/WW3D2/proto.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/proxy.h b/Core/Libraries/Source/WWVegas/WW3D2/proxy.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/proxy.h
rename to Core/Libraries/Source/WWVegas/WW3D2/proxy.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/rddesc.h b/Core/Libraries/Source/WWVegas/WW3D2/rddesc.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/rddesc.h
rename to Core/Libraries/Source/WWVegas/WW3D2/rddesc.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/render2dsentence.cpp b/Core/Libraries/Source/WWVegas/WW3D2/render2dsentence.cpp
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/render2dsentence.cpp
rename to Core/Libraries/Source/WWVegas/WW3D2/render2dsentence.cpp
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/render2dsentence.h b/Core/Libraries/Source/WWVegas/WW3D2/render2dsentence.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/render2dsentence.h
rename to Core/Libraries/Source/WWVegas/WW3D2/render2dsentence.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/renderobjectrecycler.cpp b/Core/Libraries/Source/WWVegas/WW3D2/renderobjectrecycler.cpp
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/renderobjectrecycler.cpp
rename to Core/Libraries/Source/WWVegas/WW3D2/renderobjectrecycler.cpp
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/renderobjectrecycler.h b/Core/Libraries/Source/WWVegas/WW3D2/renderobjectrecycler.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/renderobjectrecycler.h
rename to Core/Libraries/Source/WWVegas/WW3D2/renderobjectrecycler.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/rendobj.cpp b/Core/Libraries/Source/WWVegas/WW3D2/rendobj.cpp
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/rendobj.cpp
rename to Core/Libraries/Source/WWVegas/WW3D2/rendobj.cpp
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/rendobj.h b/Core/Libraries/Source/WWVegas/WW3D2/rendobj.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/rendobj.h
rename to Core/Libraries/Source/WWVegas/WW3D2/rendobj.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/ringobj.cpp b/Core/Libraries/Source/WWVegas/WW3D2/ringobj.cpp
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/ringobj.cpp
rename to Core/Libraries/Source/WWVegas/WW3D2/ringobj.cpp
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/ringobj.h b/Core/Libraries/Source/WWVegas/WW3D2/ringobj.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/ringobj.h
rename to Core/Libraries/Source/WWVegas/WW3D2/ringobj.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/robjlist.h b/Core/Libraries/Source/WWVegas/WW3D2/robjlist.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/robjlist.h
rename to Core/Libraries/Source/WWVegas/WW3D2/robjlist.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/segline.cpp b/Core/Libraries/Source/WWVegas/WW3D2/segline.cpp
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/segline.cpp
rename to Core/Libraries/Source/WWVegas/WW3D2/segline.cpp
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/segline.h b/Core/Libraries/Source/WWVegas/WW3D2/segline.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/segline.h
rename to Core/Libraries/Source/WWVegas/WW3D2/segline.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/seglinerenderer.cpp b/Core/Libraries/Source/WWVegas/WW3D2/seglinerenderer.cpp
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/seglinerenderer.cpp
rename to Core/Libraries/Source/WWVegas/WW3D2/seglinerenderer.cpp
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/seglinerenderer.h b/Core/Libraries/Source/WWVegas/WW3D2/seglinerenderer.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/seglinerenderer.h
rename to Core/Libraries/Source/WWVegas/WW3D2/seglinerenderer.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/shattersystem.cpp b/Core/Libraries/Source/WWVegas/WW3D2/shattersystem.cpp
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/shattersystem.cpp
rename to Core/Libraries/Source/WWVegas/WW3D2/shattersystem.cpp
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/shattersystem.h b/Core/Libraries/Source/WWVegas/WW3D2/shattersystem.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/shattersystem.h
rename to Core/Libraries/Source/WWVegas/WW3D2/shattersystem.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/snapPts.h b/Core/Libraries/Source/WWVegas/WW3D2/snapPts.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/snapPts.h
rename to Core/Libraries/Source/WWVegas/WW3D2/snapPts.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/snappts.cpp b/Core/Libraries/Source/WWVegas/WW3D2/snappts.cpp
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/snappts.cpp
rename to Core/Libraries/Source/WWVegas/WW3D2/snappts.cpp
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/soundlibrarybridge.h b/Core/Libraries/Source/WWVegas/WW3D2/soundlibrarybridge.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/soundlibrarybridge.h
rename to Core/Libraries/Source/WWVegas/WW3D2/soundlibrarybridge.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/soundrobj.cpp b/Core/Libraries/Source/WWVegas/WW3D2/soundrobj.cpp
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/soundrobj.cpp
rename to Core/Libraries/Source/WWVegas/WW3D2/soundrobj.cpp
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/soundrobj.h b/Core/Libraries/Source/WWVegas/WW3D2/soundrobj.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/soundrobj.h
rename to Core/Libraries/Source/WWVegas/WW3D2/soundrobj.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/sphereobj.cpp b/Core/Libraries/Source/WWVegas/WW3D2/sphereobj.cpp
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/sphereobj.cpp
rename to Core/Libraries/Source/WWVegas/WW3D2/sphereobj.cpp
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/sphereobj.h b/Core/Libraries/Source/WWVegas/WW3D2/sphereobj.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/sphereobj.h
rename to Core/Libraries/Source/WWVegas/WW3D2/sphereobj.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/static_sort_list.cpp b/Core/Libraries/Source/WWVegas/WW3D2/static_sort_list.cpp
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/static_sort_list.cpp
rename to Core/Libraries/Source/WWVegas/WW3D2/static_sort_list.cpp
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/static_sort_list.h b/Core/Libraries/Source/WWVegas/WW3D2/static_sort_list.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/static_sort_list.h
rename to Core/Libraries/Source/WWVegas/WW3D2/static_sort_list.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/statistics.cpp b/Core/Libraries/Source/WWVegas/WW3D2/statistics.cpp
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/statistics.cpp
rename to Core/Libraries/Source/WWVegas/WW3D2/statistics.cpp
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/statistics.h b/Core/Libraries/Source/WWVegas/WW3D2/statistics.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/statistics.h
rename to Core/Libraries/Source/WWVegas/WW3D2/statistics.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/streak.cpp b/Core/Libraries/Source/WWVegas/WW3D2/streak.cpp
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/streak.cpp
rename to Core/Libraries/Source/WWVegas/WW3D2/streak.cpp
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/streak.h b/Core/Libraries/Source/WWVegas/WW3D2/streak.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/streak.h
rename to Core/Libraries/Source/WWVegas/WW3D2/streak.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/streakRender.cpp b/Core/Libraries/Source/WWVegas/WW3D2/streakRender.cpp
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/streakRender.cpp
rename to Core/Libraries/Source/WWVegas/WW3D2/streakRender.cpp
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/streakRender.h b/Core/Libraries/Source/WWVegas/WW3D2/streakRender.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/streakRender.h
rename to Core/Libraries/Source/WWVegas/WW3D2/streakRender.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/stripoptimizer.cpp b/Core/Libraries/Source/WWVegas/WW3D2/stripoptimizer.cpp
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/stripoptimizer.cpp
rename to Core/Libraries/Source/WWVegas/WW3D2/stripoptimizer.cpp
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/stripoptimizer.h b/Core/Libraries/Source/WWVegas/WW3D2/stripoptimizer.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/stripoptimizer.h
rename to Core/Libraries/Source/WWVegas/WW3D2/stripoptimizer.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/surfaceclass.cpp b/Core/Libraries/Source/WWVegas/WW3D2/surfaceclass.cpp
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/surfaceclass.cpp
rename to Core/Libraries/Source/WWVegas/WW3D2/surfaceclass.cpp
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/surfaceclass.h b/Core/Libraries/Source/WWVegas/WW3D2/surfaceclass.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/surfaceclass.h
rename to Core/Libraries/Source/WWVegas/WW3D2/surfaceclass.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/textdraw.cpp b/Core/Libraries/Source/WWVegas/WW3D2/textdraw.cpp
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/textdraw.cpp
rename to Core/Libraries/Source/WWVegas/WW3D2/textdraw.cpp
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/textdraw.h b/Core/Libraries/Source/WWVegas/WW3D2/textdraw.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/textdraw.h
rename to Core/Libraries/Source/WWVegas/WW3D2/textdraw.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/visrasterizer.cpp b/Core/Libraries/Source/WWVegas/WW3D2/visrasterizer.cpp
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/visrasterizer.cpp
rename to Core/Libraries/Source/WWVegas/WW3D2/visrasterizer.cpp
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/visrasterizer.h b/Core/Libraries/Source/WWVegas/WW3D2/visrasterizer.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/visrasterizer.h
rename to Core/Libraries/Source/WWVegas/WW3D2/visrasterizer.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/w3d_dep.cpp b/Core/Libraries/Source/WWVegas/WW3D2/w3d_dep.cpp
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/w3d_dep.cpp
rename to Core/Libraries/Source/WWVegas/WW3D2/w3d_dep.cpp
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/w3d_dep.h b/Core/Libraries/Source/WWVegas/WW3D2/w3d_dep.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/w3d_dep.h
rename to Core/Libraries/Source/WWVegas/WW3D2/w3d_dep.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/w3d_obsolete.h b/Core/Libraries/Source/WWVegas/WW3D2/w3d_obsolete.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/w3d_obsolete.h
rename to Core/Libraries/Source/WWVegas/WW3D2/w3d_obsolete.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/w3d_util.cpp b/Core/Libraries/Source/WWVegas/WW3D2/w3d_util.cpp
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/w3d_util.cpp
rename to Core/Libraries/Source/WWVegas/WW3D2/w3d_util.cpp
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/w3d_util.h b/Core/Libraries/Source/WWVegas/WW3D2/w3d_util.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/w3d_util.h
rename to Core/Libraries/Source/WWVegas/WW3D2/w3d_util.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/w3derr.h b/Core/Libraries/Source/WWVegas/WW3D2/w3derr.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/w3derr.h
rename to Core/Libraries/Source/WWVegas/WW3D2/w3derr.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/w3dexclusionlist.cpp b/Core/Libraries/Source/WWVegas/WW3D2/w3dexclusionlist.cpp
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/w3dexclusionlist.cpp
rename to Core/Libraries/Source/WWVegas/WW3D2/w3dexclusionlist.cpp
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/w3dexclusionlist.h b/Core/Libraries/Source/WWVegas/WW3D2/w3dexclusionlist.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/w3dexclusionlist.h
rename to Core/Libraries/Source/WWVegas/WW3D2/w3dexclusionlist.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/ww3dformat.cpp b/Core/Libraries/Source/WWVegas/WW3D2/ww3dformat.cpp
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/ww3dformat.cpp
rename to Core/Libraries/Source/WWVegas/WW3D2/ww3dformat.cpp
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/ww3dformat.h b/Core/Libraries/Source/WWVegas/WW3D2/ww3dformat.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/ww3dformat.h
rename to Core/Libraries/Source/WWVegas/WW3D2/ww3dformat.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/ww3dids.h b/Core/Libraries/Source/WWVegas/WW3D2/ww3dids.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/ww3dids.h
rename to Core/Libraries/Source/WWVegas/WW3D2/ww3dids.h
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/ww3dtrig.h b/Core/Libraries/Source/WWVegas/WW3D2/ww3dtrig.h
similarity index 100%
rename from GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/ww3dtrig.h
rename to Core/Libraries/Source/WWVegas/WW3D2/ww3dtrig.h
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/CMakeLists.txt b/Generals/Code/Libraries/Source/WWVegas/WW3D2/CMakeLists.txt
index b6b311b9438..e4e14e3d9a8 100644
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/CMakeLists.txt
+++ b/Generals/Code/Libraries/Source/WWVegas/WW3D2/CMakeLists.txt
@@ -1,109 +1,109 @@
set(WW3D2_SRC
- aabtree.cpp
- aabtree.h
+ #aabtree.cpp
+ #aabtree.h
aabtreebuilder.cpp
aabtreebuilder.h
- agg_def.cpp
- agg_def.h
- animatedsoundmgr.cpp
- animatedsoundmgr.h
+ #agg_def.cpp
+ #agg_def.h
+ #animatedsoundmgr.cpp
+ #animatedsoundmgr.h
animobj.cpp
animobj.h
assetmgr.cpp
assetmgr.h
- assetstatus.cpp
- assetstatus.h
- bitmaphandler.cpp
- bitmaphandler.h
+ #assetstatus.cpp
+ #assetstatus.h
+ #bitmaphandler.cpp
+ #bitmaphandler.h
bmp2d.cpp
bmp2d.h
boxrobj.cpp
boxrobj.h
- bwrender.cpp
- bwrender.h
+ #bwrender.cpp
+ #bwrender.h
camera.cpp
camera.h
#classid.h
- collect.cpp
- collect.h
- colorspace.h
- coltest.cpp
- coltest.h
- coltype.h
- composite.cpp
- composite.h
+ #collect.cpp
+ #collect.h
+ #colorspace.h
+ #coltest.cpp
+ #coltest.h
+ #coltype.h
+ #composite.cpp
+ #composite.h
dazzle.cpp
dazzle.h
ddsfile.cpp
ddsfile.h
decalmsh.cpp
decalmsh.h
- decalsys.cpp
- decalsys.h
- distlod.cpp
- distlod.h
- dllist.h
+ #decalsys.cpp
+ #decalsys.h
+ #distlod.cpp
+ #distlod.h
+ #dllist.h
dx8caps.cpp
dx8caps.h
dx8fvf.cpp
dx8fvf.h
dx8indexbuffer.cpp
dx8indexbuffer.h
- dx8list.h
- dx8polygonrenderer.cpp
- dx8polygonrenderer.h
+ #dx8list.h
+ #dx8polygonrenderer.cpp
+ #dx8polygonrenderer.h
dx8renderer.cpp
dx8renderer.h
dx8texman.cpp
dx8texman.h
dx8vertexbuffer.cpp
dx8vertexbuffer.h
- dx8webbrowser.cpp
- dx8webbrowser.h
+ #dx8webbrowser.cpp
+ #dx8webbrowser.h
dx8wrapper.cpp
dx8wrapper.h
- dynamesh.cpp
- dynamesh.h
- font3d.cpp
- font3d.h
- formconv.cpp
- formconv.h
- FramGrab.cpp
- framgrab.h
- hanim.cpp
- hanim.h
+ #dynamesh.cpp
+ #dynamesh.h
+ #font3d.cpp
+ #font3d.h
+ #formconv.cpp
+ #formconv.h
+ #FramGrab.cpp
+ #framgrab.h
+ #hanim.cpp
+ #hanim.h
hanimmgr.cpp
hanimmgr.h
- hcanim.cpp
- hcanim.h
+ #hcanim.cpp
+ #hcanim.h
hlod.cpp
hlod.h
- hmdldef.cpp
- hmdldef.H
+ #hmdldef.cpp
+ #hmdldef.H
hmorphanim.cpp
hmorphanim.h
hrawanim.cpp
hrawanim.h
- htree.cpp
- htree.h
+ #htree.cpp
+ #htree.h
htreemgr.cpp
htreemgr.h
- intersec.cpp
- intersec.h
- intersec.inl
- inttest.h
- layer.cpp
- layer.h
+ #intersec.cpp
+ #intersec.h
+ #intersec.inl
+ #inttest.h
+ #layer.cpp
+ #layer.h
light.cpp
light.h
lightenvironment.cpp
lightenvironment.h
- line3d.cpp
- line3d.h
+ #line3d.cpp
+ #line3d.h
mapper.cpp
mapper.h
- matinfo.cpp
- matinfo.h
+ #matinfo.cpp
+ #matinfo.h
matpass.cpp
matpass.h
matrixmapper.cpp
@@ -112,8 +112,8 @@ set(WW3D2_SRC
mesh.h
meshbuild.cpp
meshbuild.h
- meshdam.cpp
- meshdam.h
+ #meshdam.cpp
+ #meshdam.h
meshgeometry.cpp
meshgeometry.h
meshmatdesc.cpp
@@ -121,10 +121,10 @@ set(WW3D2_SRC
meshmdl.cpp
meshmdl.h
meshmdlio.cpp
- metalmap.cpp
- metalmap.h
- missingtexture.cpp
- missingtexture.h
+ #metalmap.cpp
+ #metalmap.h
+ #missingtexture.cpp
+ #missingtexture.h
motchan.cpp
motchan.h
nullrobj.cpp
@@ -135,70 +135,70 @@ set(WW3D2_SRC
part_emt.h
part_ldr.cpp
part_ldr.h
- pivot.cpp
- pivot.h
- pointgr.cpp
- pointgr.h
- polyinfo.cpp
- polyinfo.h
- predlod.cpp
- predlod.h
- prim_anim.cpp
- prim_anim.h
- projector.cpp
- projector.h
- proto.cpp
- proto.h
- proxy.h
- rddesc.h
+ #pivot.cpp
+ #pivot.h
+ #pointgr.cpp
+ #pointgr.h
+ #polyinfo.cpp
+ #polyinfo.h
+ #predlod.cpp
+ #predlod.h
+ #prim_anim.cpp
+ #prim_anim.h
+ #projector.cpp
+ #projector.h
+ #proto.cpp
+ #proto.h
+ #proxy.h
+ #rddesc.h
render2d.cpp
render2d.h
- render2dsentence.cpp
- render2dsentence.h
- renderobjectrecycler.cpp
- renderobjectrecycler.h
- rendobj.cpp
- rendobj.h
+ #render2dsentence.cpp
+ #render2dsentence.h
+ #renderobjectrecycler.cpp
+ #renderobjectrecycler.h
+ #rendobj.cpp
+ #rendobj.h
rinfo.cpp
rinfo.h
- ringobj.cpp
- ringobj.h
- robjlist.h
+ #ringobj.cpp
+ #ringobj.h
+ #robjlist.h
scene.cpp
scene.h
- segline.cpp
- segline.h
- seglinerenderer.cpp
- seglinerenderer.h
+ #segline.cpp
+ #segline.h
+ #seglinerenderer.cpp
+ #seglinerenderer.h
shader.cpp
shader.h
- shattersystem.cpp
- shattersystem.h
- snappts.cpp
- snapPts.h
+ #shattersystem.cpp
+ #shattersystem.h
+ #snappts.cpp
+ #snapPts.h
sortingrenderer.cpp
sortingrenderer.h
- soundlibrarybridge.h
- soundrobj.cpp
- soundrobj.h
- sphereobj.cpp
- sphereobj.h
- static_sort_list.cpp
- static_sort_list.h
- statistics.cpp
- statistics.h
- streak.cpp
- streak.h
- streakRender.cpp
- streakRender.h
- stripoptimizer.cpp
- stripoptimizer.h
- surfaceclass.cpp
- surfaceclass.h
+ #soundlibrarybridge.h
+ #soundrobj.cpp
+ #soundrobj.h
+ #sphereobj.cpp
+ #sphereobj.h
+ #static_sort_list.cpp
+ #static_sort_list.h
+ #statistics.cpp
+ #statistics.h
+ #streak.cpp
+ #streak.h
+ #streakRender.cpp
+ #streakRender.h
+ #stripoptimizer.cpp
+ #stripoptimizer.h
+ #surfaceclass.cpp
+ #surfaceclass.h
texproject.cpp
texproject.h
#textdraw.cpp
- textdraw.h
+ #textdraw.h
texture.cpp
texture.h
texturefilter.cpp
@@ -209,23 +209,23 @@ set(WW3D2_SRC
texturethumbnail.h
vertmaterial.cpp
vertmaterial.h
- visrasterizer.cpp
- visrasterizer.h
- w3d_dep.cpp
- w3d_dep.h
+ #visrasterizer.cpp
+ #visrasterizer.h
+ #w3d_dep.cpp
+ #w3d_dep.h
w3d_file.h
- w3d_obsolete.h
- w3d_util.cpp
- w3d_util.h
- w3derr.h
- w3dexclusionlist.cpp
- w3dexclusionlist.h
+ #w3d_obsolete.h
+ #w3d_util.cpp
+ #w3d_util.h
+ #w3derr.h
+ #w3dexclusionlist.cpp
+ #w3dexclusionlist.h
ww3d.cpp
ww3d.h
- ww3dformat.cpp
- ww3dformat.h
- ww3dids.h
- ww3dtrig.h
+ #ww3dformat.cpp
+ #ww3dformat.h
+ #ww3dids.h
+ #ww3dtrig.h
)
add_library(g_ww3d2 STATIC)
@@ -233,13 +233,7 @@ set_target_properties(g_ww3d2 PROPERTIES OUTPUT_NAME ww3d2)
target_sources(g_ww3d2 PRIVATE ${WW3D2_SRC})
-if (NOT IS_VS6_BUILD)
- target_link_libraries(g_ww3d2 PUBLIC
- comsuppw
- )
-endif()
-
target_link_libraries(g_ww3d2 PRIVATE
- core_browserengine
+ corei_ww3d2
g_wwcommon
)
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/FramGrab.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/FramGrab.cpp
deleted file mode 100644
index 89f0aeeb2e6..00000000000
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/FramGrab.cpp
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
-** 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 .
-*/
-
-// FramGrab.cpp: implementation of the FrameGrabClass class.
-//
-//////////////////////////////////////////////////////////////////////
-
-#include "framgrab.h"
-#include
-#include
-//#include
-
-//////////////////////////////////////////////////////////////////////
-// Construction/Destruction
-//////////////////////////////////////////////////////////////////////
-
-FrameGrabClass::FrameGrabClass(const char *filename, MODE mode, int width, int height, int bitcount, float framerate)
-{
- HRESULT hr;
-
- Mode = mode;
- Filename = filename;
- FrameRate = framerate;
- Counter = 0;
-
- Stream = 0;
- AVIFile = 0;
-
- if(Mode != AVI) return;
-
- AVIFileInit(); // opens AVIFile library
-
- // find the first free file with this prefix
- int counter = 0;
- int result;
- char file[256];
- do {
- sprintf(file, "%s%d.AVI", filename, counter++);
- result = _access(file, 0);
- } while(result != -1);
-
- // Create new AVI file using AVIFileOpen.
- hr = AVIFileOpen(&AVIFile, file, OF_WRITE | OF_CREATE, NULL);
- if (hr != 0) {
- char buf[256];
- sprintf(buf, "Unable to open %s\n", Filename);
- OutputDebugString(buf);
- CleanupAVI();
- return;
- }
-
-
- // Create a stream using AVIFileCreateStream.
- AVIStreamInfo.fccType = streamtypeVIDEO;
- AVIStreamInfo.fccHandler = mmioFOURCC('M','S','V','C');
- AVIStreamInfo.dwFlags = 0;
- AVIStreamInfo.dwCaps = 0;
- AVIStreamInfo.wPriority = 0;
- AVIStreamInfo.wLanguage = 0;
- AVIStreamInfo.dwScale = 1;
- AVIStreamInfo.dwRate = (int)FrameRate;
- AVIStreamInfo.dwStart = 0;
- AVIStreamInfo.dwLength = 0;
- AVIStreamInfo.dwInitialFrames = 0;
- AVIStreamInfo.dwSuggestedBufferSize = 0;
- AVIStreamInfo.dwQuality = 0;
- AVIStreamInfo.dwSampleSize = 0;
- SetRect(&AVIStreamInfo.rcFrame, 0, 0, width, height);
- AVIStreamInfo.dwEditCount = 0;
- AVIStreamInfo.dwFormatChangeCount = 0;
- sprintf(AVIStreamInfo.szName,"G");
-
- hr = AVIFileCreateStream(AVIFile, &Stream, &AVIStreamInfo);
- if (hr != 0) {
- CleanupAVI();
- return;
- }
-
- // Set format of new stream
- BitmapInfoHeader.biWidth = width;
- BitmapInfoHeader.biHeight = height;
- BitmapInfoHeader.biBitCount = (unsigned short)bitcount;
- BitmapInfoHeader.biSizeImage = ((((UINT)BitmapInfoHeader.biBitCount * BitmapInfoHeader.biWidth + 31) & ~31) / 8) * BitmapInfoHeader.biHeight;
- BitmapInfoHeader.biSize = sizeof(BITMAPINFOHEADER); // size of structure
- BitmapInfoHeader.biPlanes = 1; // must be set to 1
- BitmapInfoHeader.biCompression = BI_RGB; // uncompressed
- BitmapInfoHeader.biXPelsPerMeter = 1; // not used
- BitmapInfoHeader.biYPelsPerMeter = 1; // not used
- BitmapInfoHeader.biClrUsed = 0; // all colors are used
- BitmapInfoHeader.biClrImportant = 0; // all colors are important
-
- hr = AVIStreamSetFormat(Stream, 0, &BitmapInfoHeader, sizeof(BitmapInfoHeader));
- if (hr != 0) {
- CleanupAVI();
- return;
- }
-
- Bitmap = (long *) GlobalAllocPtr(GMEM_MOVEABLE, BitmapInfoHeader.biSizeImage);
-}
-
-FrameGrabClass::~FrameGrabClass()
-{
- if(Mode == AVI) {
- CleanupAVI();
- }
-}
-
-void FrameGrabClass::CleanupAVI() {
- if(Bitmap != 0) { GlobalFreePtr(Bitmap); Bitmap = 0; }
- if(Stream != 0) { AVIStreamRelease(Stream); Stream = 0; }
- if(AVIFile != 0) { AVIFileRelease(AVIFile); AVIFile = 0; }
-
- AVIFileExit();
- Mode = RAW;
-}
-
-void FrameGrabClass::GrabAVI(void *BitmapPointer)
-{
- // CompressDIB(&bi, lpOld, &biNew, lpNew);
-
- // Save the compressed data using AVIStreamWrite.
- HRESULT hr = AVIStreamWrite(Stream, Counter++, 1, BitmapPointer, BitmapInfoHeader.biSizeImage, AVIIF_KEYFRAME, NULL, NULL);
- if(hr != 0) {
- char buf[256];
- sprintf(buf, "avi write error %x/%d\n", hr, hr);
- OutputDebugString(buf);
- }
-}
-
-void FrameGrabClass::GrabRawFrame(void * /*BitmapPointer*/)
-{
-
-}
-
-
-void FrameGrabClass::ConvertGrab(void *BitmapPointer)
-{
- ConvertFrame(BitmapPointer);
- Grab( Bitmap );
-}
-
-
-void FrameGrabClass::Grab(void *BitmapPointer)
-{
- if(Mode == AVI)
- GrabAVI(BitmapPointer);
- else
- GrabRawFrame(BitmapPointer);
-}
-
-
-void FrameGrabClass::ConvertFrame(void *BitmapPointer)
-{
-
- int width = BitmapInfoHeader.biWidth;
- int height = BitmapInfoHeader.biHeight;
- long *image = (long *) BitmapPointer;
-
- // copy the data, doing a vertical flip & byte re-ordering of the pixel longwords
- int y = height;
- while(y--) {
- int x = width;
- int yoffset = y * width;
- int yoffset2 = (height - y) * width;
- while(x--) {
- long *source = &image[yoffset + x];
- long *dest = &Bitmap[yoffset2 + x];
- *dest = *source;
- unsigned char *c = (unsigned char *) dest;
- c[3] = c[0];
- c[0] = c[2];
- c[2] = c[3];
- c[3] = 0;
- }
- }
-}
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/aabtree.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/aabtree.cpp
deleted file mode 100644
index 8c25f4ba3a0..00000000000
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/aabtree.cpp
+++ /dev/null
@@ -1,1236 +0,0 @@
-/*
-** 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 .
-*/
-
-/***********************************************************************************************
- *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
- ***********************************************************************************************
- * *
- * Project Name : WW3D *
- * *
- * $Archive:: /Commando/Code/ww3d2/aabtree.cpp $*
- * *
- * Author:: Greg Hjelstrom *
- * *
- * $Modtime:: 11/24/01 5:34p $*
- * *
- * $Revision:: 4 $*
- * *
- *---------------------------------------------------------------------------------------------*
- * Functions: *
- * AABTreeClass::AABTreeClass -- Constructor *
- * AABTreeClass::AABTreeClass -- Constructor *
- * AABTreeClass::AABTreeClass -- copy constructor *
- * AABTreeClass::~AABTreeClass -- Destructor *
- * AABTreeClass::operator = -- assignment operator *
- * AABTreeClass::Reset -- reset this tree, releases all allocated resources *
- * AABTreeClass::Build_Tree_Recursive -- Initializes this tree from the given builder *
- * AABTreeClass::Set_Mesh -- set the mesh pointer *
- * AABTreeClass::Generate_APT -- Generate an active poly table for the mesh *
- * AABTreeClass::Generate_OBBox_APT_Recursive -- recursively generate the apt *
- * AABTreeClass::Cast_Ray_Recursive -- Internal implementation of Cast_Ray *
- * AABTreeClass::Cast_Semi_Infinite_Axis_Aligned_Ray_Recursive -- Internal implementation *
- * AABTreeClass::Cast_AABox_Recursive -- internal implementation of Cast_AABox *
- * AABTreeClass::Cast_OBBox_Recursive -- Internal implementation of Cast_OBBox *
- * AABTreeClass::Intersect_OBBox_Recursive -- internal implementation of Intersect_OBBox *
- * AABTreeClass::Cast_Ray_To_Polys -- cast the ray to polys in the given node *
- * AABTreeClass::Cast_Semi_Infinite_Axis_Aligned_Ray_To_Polys -- cast ray to polys in the nod*
- * AABTreeClass::Cast_AABox_To_Polys -- cast aabox to polys in the given node *
- * AABTreeClass::Cast_OBBox_To_Polys -- cast obbox to polys in the given node *
- * AABTreeClass::Intersect_OBBox_With_Polys -- Test polys for intersection *
- * AABTreeClass::Update_Bounding_Boxes_Recursive -- recompute the bounding boxes *
- * AABTreeClass::Update_Min_Max -- updates min and max given a polygon index *
- * AABTreeClass::Load_W3D -- Load a W3D description of an AABTree *
- * AABTreeClass::Read_Poly_Indices -- load the polygon index array *
- * AABTreeClass::Read_Nodes -- Load the node array *
- * AABTreeClass::Generate_APT -- generate an apt from a box and viewdir *
- * AABTreeClass::Generate_OBBox_APT_Recursive -- recurse, generate the apt for a box and vie *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-
-#include "aabtree.h"
-#include "aabtreebuilder.h"
-#include "wwdebug.h"
-#include "tri.h"
-#include "meshgeometry.h"
-#include "coltest.h"
-#include "inttest.h"
-#include "colmathinlines.h"
-#include "w3d_file.h"
-#include "chunkio.h"
-
-
-
-/***********************************************************************************************
- * AABTreeClass::AABTreeClass -- Constructor *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- *=============================================================================================*/
-AABTreeClass::AABTreeClass(void) :
- NodeCount(0),
- Nodes(NULL),
- PolyCount(0),
- PolyIndices(NULL),
- Mesh(NULL)
-{
-}
-
-/***********************************************************************************************
- * AABTreeClass::AABTreeClass -- Constructor *
- * *
- * Builds an AABTree from the contents of an AABTreeBuilderClass. *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 6/19/98 GTH : Created. *
- * 5/23/2000 gth : Created. *
- *=============================================================================================*/
-AABTreeClass::AABTreeClass(AABTreeBuilderClass * builder)
-{
- NodeCount = builder->Node_Count();
- Nodes = W3DNEWARRAY AABTreeClass::CullNodeStruct[NodeCount];
-
- PolyCount = builder->Poly_Count();
- PolyIndices = W3DNEWARRAY uint32[PolyCount];
-
- int curpolyindex = 0;
- Build_Tree_Recursive(builder->Root,curpolyindex);
-}
-
-
-/***********************************************************************************************
- * AABTreeClass::AABTreeClass -- copy constructor *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 6/22/99 GTH : Created. *
- *=============================================================================================*/
-AABTreeClass::AABTreeClass(const AABTreeClass & that) :
- NodeCount(0),
- Nodes(NULL),
- PolyCount(0),
- PolyIndices(0),
- Mesh(NULL)
-{
- *this = that;
-}
-
-/***********************************************************************************************
- * AABTreeClass::~AABTreeClass -- Destructor *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 6/19/98 GTH : Created. *
- *=============================================================================================*/
-AABTreeClass::~AABTreeClass(void)
-{
- Reset();
-}
-
-/***********************************************************************************************
- * AABTreeClass::operator = -- assignment operator *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 6/22/99 GTH : Created. *
- *=============================================================================================*/
-AABTreeClass & AABTreeClass::operator = (const AABTreeClass & that)
-{
- Reset();
-
- NodeCount = that.NodeCount;
- if (NodeCount > 0) {
- Nodes = W3DNEWARRAY CullNodeStruct[NodeCount];
- memcpy(Nodes,that.Nodes,NodeCount * sizeof(CullNodeStruct));
- }
-
- PolyCount = that.PolyCount;
- if (PolyCount > 0) {
- PolyIndices = W3DNEWARRAY uint32[PolyCount];
- memcpy(PolyIndices,that.PolyIndices,PolyCount * sizeof(uint32));
- }
-
- Mesh = that.Mesh;
-
- return *this;
-}
-
-
-/***********************************************************************************************
- * AABTreeClass::Reset -- reset this tree, releases all allocated resources *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 6/22/99 GTH : Created. *
- *=============================================================================================*/
-void AABTreeClass::Reset(void)
-{
- NodeCount = 0;
- if (Nodes) {
- delete[] Nodes;
- Nodes = NULL;
- }
- PolyCount = 0;
- if (PolyIndices) {
- delete[] PolyIndices;
- PolyIndices = NULL;
- }
- if (Mesh) {
- Mesh = NULL;
- }
-}
-
-/***********************************************************************************************
- * AABTreeClass::Scale - uniform scale *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 6/17/02 Jani : Created. *
- *=============================================================================================*/
-void AABTreeClass::Scale(float f)
-{
- for (int i=0;iIndex]);
-
- newnode->Min = node->Min;
- newnode->Max = node->Max;
-
- /*
- ** If this is a non-leaf node, set up the child indices, otherwise set up the polygon indices
- */
- if (node->Front != NULL) {
-
- WWASSERT(node->Back != NULL); // if we have one child, we better have both!
- newnode->Set_Front_Child(node->Front->Index);
- newnode->Set_Back_Child(node->Back->Index);
-
- } else {
-
- newnode->Set_Poly0(curpolyindex);
- newnode->Set_Poly_Count(node->PolyCount);
-
- }
-
- /*
- ** Copy the polygon indices for this node into our array
- */
- for (int pcounter = 0; pcounter < node->PolyCount; pcounter++) {
- PolyIndices[curpolyindex++] = node->PolyIndices[pcounter];
- }
-
- /*
- ** Install the children
- */
- if (node->Front) {
- Build_Tree_Recursive(node->Front,curpolyindex);
- }
- if (node->Back) {
- Build_Tree_Recursive(node->Back,curpolyindex);
- }
-}
-
-
-/***********************************************************************************************
- * AABTreeClass::Set_Mesh -- set the mesh pointer *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 6/22/99 GTH : Created. *
- *=============================================================================================*/
-void AABTreeClass::Set_Mesh(MeshGeometryClass * mesh)
-{
- Mesh = mesh;
-}
-
-
-/***********************************************************************************************
- * AABTreeClass::Generate_APT -- Generate an active poly table for the mesh *
- * *
- * INPUT: *
- * box - oriented box to cull the mesh against (in the mesh's coordinate system!!!) *
- * apt - vector of ints to fill the apt into *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- *=============================================================================================*/
-void AABTreeClass::Generate_APT(const OBBoxClass & box,SimpleDynVecClass & apt)
-{
- OBBoxAPTContextStruct context(box,apt);
- Generate_OBBox_APT_Recursive(&(Nodes[0]),context);
-}
-
-
-
-/***********************************************************************************************
- * AABTreeClass::Generate_OBBox_APT_Recursive -- recursively generate the apt *
- * *
- * INPUT: *
- * node - current node in the recursion *
- * context - structure containing the results/current state *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 1/25/00 gth : Created. *
- *=============================================================================================*/
-void AABTreeClass::Generate_OBBox_APT_Recursive(CullNodeStruct * node,OBBoxAPTContextStruct & context)
-{
- /*
- ** Test the volume against the bounding volume of this node
- ** If it is outside, stop descending the tree.
- */
- AABoxClass nodebox;
- nodebox.Init_Min_Max(node->Min,node->Max); // NOTE: too bad we have to compute the nodebox!!!
-
- if (!CollisionMath::Intersection_Test(context.Box,nodebox)) {
- return;
- }
-
- /*
- ** If this is a leaf, test its polygons, otherwise recurse into the children
- */
- if (node->Is_Leaf()) {
-
- int polycount = node->Get_Poly_Count();
- int poly0 = node->Get_Poly0();
-
- if (polycount > 0) {
- TriClass tri;
- const Vector3 * loc = Mesh->Get_Vertex_Array();
- const TriIndex * polys = Mesh->Get_Polygon_Array();
-#if (!OPTIMIZE_PLANEEQ_RAM)
- const Vector4 * norms = Mesh->Get_Plane_Array();
-#endif
- for (int poly_counter=0; poly_counterGet_Front_Child()]),context);
- Generate_OBBox_APT_Recursive(&(Nodes[node->Get_Back_Child()]),context);
- }
-}
-
-
-/***********************************************************************************************
- * AABTreeClass::Generate_APT -- generate an apt from a box and viewdir *
- * *
- * Indices of the polys which intersect the box and are not backfacing to the given viewdir *
- * will be added to the passed in apt. *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 5/10/2001 gth : Created. *
- *=============================================================================================*/
-void AABTreeClass::Generate_APT
-(
- const OBBoxClass & box,
- const Vector3 & viewdir,
- SimpleDynVecClass & apt
-)
-{
- OBBoxRayAPTContextStruct context(box,viewdir,apt);
- Generate_OBBox_APT_Recursive(&(Nodes[0]),context);
-}
-
-
-/***********************************************************************************************
- * AABTreeClass::Generate_OBBox_APT_Recursive -- recurse, generate the apt for a box and viewd *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 5/10/2001 gth : Created. *
- *=============================================================================================*/
-void AABTreeClass::Generate_OBBox_APT_Recursive(CullNodeStruct * node, OBBoxRayAPTContextStruct & context)
-{
- /*
- ** Test the volume against the bounding volume of this node
- ** If it is outside, stop descending the tree.
- */
- AABoxClass nodebox;
- nodebox.Init_Min_Max(node->Min,node->Max); // NOTE: too bad we have to compute the nodebox!!!
-
- if (!CollisionMath::Intersection_Test(context.Box,nodebox)) {
- return;
- }
-
- /*
- ** If this is a leaf, test its polygons, otherwise recurse into the children
- */
- if (node->Is_Leaf()) {
-
- int polycount = node->Get_Poly_Count();
- int poly0 = node->Get_Poly0();
-
- if (polycount > 0) {
- TriClass tri;
- const Vector3 * loc = Mesh->Get_Vertex_Array();
- const TriIndex * polys = Mesh->Get_Polygon_Array();
-#if (!OPTIMIZE_PLANEEQ_RAM)
- const Vector4 * norms = Mesh->Get_Plane_Array();
-#endif
-
- for (int poly_counter=0; poly_counterGet_Front_Child()]),context);
- Generate_OBBox_APT_Recursive(&(Nodes[node->Get_Back_Child()]),context);
- }
-}
-
-
-/***********************************************************************************************
- * AABTreeClass::Cast_Ray_Recursive -- Internal implementation of Cast_Ray *
- * *
- * INPUT: *
- * raytest - contains all of the ray test information *
- * node - current cull node being processed *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 6/19/98 GTH : Created. *
- *=============================================================================================*/
-bool AABTreeClass::Cast_Ray_Recursive(CullNodeStruct * node,RayCollisionTestClass & raytest)
-{
- /*
- ** Cull the collision test against the bounding volume of this node
- ** If it is culled, stop descending the tree.
- */
- if (raytest.Cull(node->Min,node->Max)) {
- return false;
- }
-
- bool res = false;
- if (node->Is_Leaf()) {
-
- return Cast_Ray_To_Polys(node,raytest);
-
- } else {
-
- res = res | Cast_Ray_Recursive(&(Nodes[node->Get_Front_Child()]),raytest);
- res = res | Cast_Ray_Recursive(&(Nodes[node->Get_Back_Child()]),raytest);
-
- }
-
- return res;
-}
-
-
-/***********************************************************************************************
- * AABTreeClass::Cast_Semi_Infinite_Axis_Aligned_Ray_Recursive -- Internal implementation *
- * *
- * INPUT: *
- * node - current cull node being processed *
- * start_point - starting point *
- * axis_r - the axis along which the ray is projected *
- * axis_1, axis_2 - the other two axes *
- * direction - 0 means the ray goes toward the negative axis, 1 means positive. *
- * flags - reference bitfield for result flags (ray hit edge, start point embedded in tri, etc)*
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 8/30/00 NH : Created. *
- *=============================================================================================*/
-int AABTreeClass::Cast_Semi_Infinite_Axis_Aligned_Ray_Recursive(CullNodeStruct * node,
- const Vector3 & start_point, int axis_r, int axis_1, int axis_2, int direction,
- unsigned char & flags)
-{
- /*
- ** Cull the ray against the bounding volume of this node
- ** If it is culled, stop descending the tree.
- ** We do two main tests: a 2D test against axis1 and axis2 to see if the starting point (and
- ** hence the ray) falls within the 2D projection of the bbox, and a 1D test to see if the ray
- ** is completely above or below the bbox. The second test checks (start > max) or (start < min)
- ** depending on the direction of the ray - we do this in a branchless fashion by turning
- ** (start < min) into (-start > -min). Then we can use tables to perform the correct check.
- */
- static const float sign[2] = { -1.0f, 1.0f };
- float bounds[2], start[2];
- bounds[0] = -node->Min[axis_r];
- bounds[1] = node->Max[axis_r];
- start[0] = -start_point[axis_r];
- start[1] = start_point[axis_r];
- if ( start_point[axis_1] < node->Min[axis_1] || start_point[axis_2] < node->Min[axis_2] ||
- start_point[axis_1] > node->Max[axis_1] || start_point[axis_2] > node->Max[axis_2] ||
- start[direction] > bounds[direction] ) {
- return 0;
- }
-
- int count = 0;
- if (node->Is_Leaf()) {
-
- return Cast_Semi_Infinite_Axis_Aligned_Ray_To_Polys(node, start_point, axis_r, axis_1,
- axis_2, direction, flags);
-
- } else {
-
- count += Cast_Semi_Infinite_Axis_Aligned_Ray_Recursive(&(Nodes[node->Get_Front_Child()]),
- start_point, axis_r, axis_1, axis_2, direction, flags);
- count += Cast_Semi_Infinite_Axis_Aligned_Ray_Recursive(&(Nodes[node->Get_Back_Child()]),
- start_point, axis_r, axis_1, axis_2, direction, flags);
-
- }
-
- return count;
-}
-
-
-/***********************************************************************************************
- * AABTreeClass::Cast_AABox_Recursive -- internal implementation of Cast_AABox *
- * *
- * INPUT: *
- * boxtest - contains description of the collision operation to be performed *
- * node - current cull node being processed *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 6/19/98 GTH : Created. *
- *=============================================================================================*/
-bool AABTreeClass::Cast_AABox_Recursive(CullNodeStruct * node,AABoxCollisionTestClass & boxtest)
-{
- /*
- ** First, check the bounding box of the move against the bounding box
- ** of this tree, if they don't intersect, bail out
- */
- if (boxtest.Cull(node->Min,node->Max)) {
- return false;
- }
-
- bool res = false;
- if (node->Is_Leaf()) {
-
- return Cast_AABox_To_Polys(node,boxtest);
-
- } else {
-
- res = res | Cast_AABox_Recursive(&(Nodes[node->Get_Front_Child()]),boxtest);
- res = res | Cast_AABox_Recursive(&(Nodes[node->Get_Back_Child()]),boxtest);
-
- }
-
- return res;
-}
-
-
-/***********************************************************************************************
- * AABTreeClass::Cast_OBBox_Recursive -- Internal implementation of Cast_OBBox *
- * *
- * INPUT: *
- * boxtest - contains description of the collision test to be performed *
- * node - current cull node being processed *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 6/19/98 GTH : Created. *
- *=============================================================================================*/
-bool AABTreeClass::Cast_OBBox_Recursive(CullNodeStruct * node,OBBoxCollisionTestClass & boxtest)
-{
- /*
- ** First, check the bounding box of the move against the bounding box
- ** of this tree, if they don't intersect, bail out
- */
- if (boxtest.Cull(node->Min,node->Max)) {
- return false;
- }
-
- bool res = false;
- if (node->Is_Leaf()) {
-
- return Cast_OBBox_To_Polys(node,boxtest);
-
- } else {
-
- res = res | Cast_OBBox_Recursive(&(Nodes[node->Get_Front_Child()]),boxtest);
- res = res | Cast_OBBox_Recursive(&(Nodes[node->Get_Back_Child()]),boxtest);
-
- }
-
- return res;
-}
-
-
-/***********************************************************************************************
- * AABTreeClass::Intersect_OBBox_Recursive -- internal implementation of Intersect_OBBox *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 1/20/00 gth : Created. *
- *=============================================================================================*/
-bool AABTreeClass::Intersect_OBBox_Recursive(AABTreeClass::CullNodeStruct * node,OBBoxIntersectionTestClass & test)
-{
- /*
- ** Cull the collision test against the bounding volume of this node
- ** If it is culled, stop descending the tree.
- */
- if (test.Cull(node->Min,node->Max)) {
- return false;
- }
-
- bool res = false;
- if (node->Is_Leaf()) {
-
- return Intersect_OBBox_With_Polys(node,test);
-
- } else {
-
- res = res | Intersect_OBBox_Recursive(&(Nodes[node->Get_Front_Child()]),test);
- res = res | Intersect_OBBox_Recursive(&(Nodes[node->Get_Back_Child()]),test);
- }
-
- return res;
-}
-
-#ifdef RTS_DEBUG
-#pragma optimize("", off) // We get an odd error when using optimized in the debug.
-// All optimized seems to work. jba.
-#endif
-/***********************************************************************************************
- * AABTreeClass::Cast_Ray_To_Polys -- cast the ray to polys in the given node *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 6/19/98 GTH : Created. *
- *=============================================================================================*/
-bool AABTreeClass::Cast_Ray_To_Polys(CullNodeStruct * node,RayCollisionTestClass & raytest)
-{
- if (node->Get_Poly_Count() > 0) {
- /*
- ** Simply loop through the polys in this node, checking each for collision
- */
- TriClass tri;
-
- const Vector3 * loc = Mesh->Get_Vertex_Array();
- const TriIndex * polyverts = Mesh->Get_Polygon_Array();
-#if (!OPTIMIZE_PLANEEQ_RAM)
- const Vector4 * norms = Mesh->Get_Plane_Array();
-#endif
-
- int polyhit = -1;
- int poly0 = node->Get_Poly0();
- int polycount = node->Get_Poly_Count();
-
- for (int poly_counter=0; poly_counterStartBad) {
- return true;
- }
- }
- if (polyhit != -1) {
- raytest.Result->SurfaceType = Mesh->Get_Poly_Surface_Type (polyhit);
- return true;
- }
- }
- return false;
-}
-#ifdef RTS_DEBUG
-#pragma optimize("", on)
-#endif
-
-
-/***********************************************************************************************
- * AABTreeClass::Cast_Semi_Infinite_Axis_Aligned_Ray_To_Polys -- cast ray to polys in the node *
- * *
- * INPUT: *
- * node - current cull node being processed *
- * start_point - starting point *
- * axis_r - the axis along which the ray is projected *
- * axis_1, axis_2 - the other two axes *
- * direction - 0 means the ray goes toward the negative axis, 1 means positive. *
- * flags - reference bitfield for result flags (ray hit edge, start point embedded in tri, etc)*
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 8/30/00 NH : Created. *
- *=============================================================================================*/
-int AABTreeClass::Cast_Semi_Infinite_Axis_Aligned_Ray_To_Polys(CullNodeStruct * node,
- const Vector3 & start_point, int axis_r, int axis_1, int axis_2, int direction,
- unsigned char & flags)
-{
- int count = 0;
-
- if (node->Get_Poly_Count() > 0) {
-
- /*
- ** Simply loop through the polys in this node, checking each for collision
- */
-
- const Vector3 * loc = Mesh->Get_Vertex_Array();
- const TriIndex * polyverts = Mesh->Get_Polygon_Array();
- const Vector4 * plane = Mesh->Get_Plane_Array();
- int poly0 = node->Get_Poly0();
- int polycount = node->Get_Poly_Count();
-
- for (int poly_counter=0; poly_counter < polycount; poly_counter++) {
-
- int poly_index = PolyIndices[poly0 + poly_counter];
-
- const Vector3 &v0 = loc[ polyverts[poly_index][0] ];
- const Vector3 &v1 = loc[ polyverts[poly_index][1] ];
- const Vector3 &v2 = loc[ polyverts[poly_index][2] ];
- const Vector4 &tri_plane = plane[poly_index];
-
- // Since (int)true is defined as 1, and (int)false as 0:
- count += (unsigned int)Cast_Semi_Infinite_Axis_Aligned_Ray_To_Triangle(v0, v1, v2,
- tri_plane, start_point, axis_r, axis_1, axis_2, direction, flags);
- }
- }
-
- return count;
-}
-
-
-/***********************************************************************************************
- * AABTreeClass::Cast_AABox_To_Polys -- cast aabox to polys in the given node *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 6/19/98 GTH : Created. *
- *=============================================================================================*/
-bool AABTreeClass::Cast_AABox_To_Polys(CullNodeStruct * node,AABoxCollisionTestClass & boxtest)
-{
- if (node->Get_Poly_Count() > 0) {
- /*
- ** Simply loop through the polys in this node, checking each for collision
- */
- TriClass tri;
-
- const Vector3 * loc = Mesh->Get_Vertex_Array();
- const TriIndex * polyverts = Mesh->Get_Polygon_Array();
-#if (!OPTIMIZE_PLANEEQ_RAM)
- const Vector4 * norms = Mesh->Get_Plane_Array();
-#endif
-
- int polyhit = -1;
- int poly0 = node->Get_Poly0();
- int polycount = node->Get_Poly_Count();
-
- for (int poly_counter=0; poly_counterStartBad) {
- return true;
- }
- }
- if (polyhit != -1) {
- boxtest.Result->SurfaceType = Mesh->Get_Poly_Surface_Type (polyhit);
- return true;
- }
- }
- return false;
-}
-
-
-/***********************************************************************************************
- * AABTreeClass::Cast_OBBox_To_Polys -- cast obbox to polys in the given node *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 6/19/98 GTH : Created. *
- *=============================================================================================*/
-bool AABTreeClass::Cast_OBBox_To_Polys(CullNodeStruct * node,OBBoxCollisionTestClass & boxtest)
-{
- int polycount = node->Get_Poly_Count();
- int poly0 = node->Get_Poly0();
-
- if (polycount > 0) {
- /*
- ** Simply loop through the polys in this node, checking each for collision
- */
- TriClass tri;
-
- const Vector3 * loc = Mesh->Get_Vertex_Array();
- const TriIndex * polyverts = Mesh->Get_Polygon_Array();
-#if (!OPTIMIZE_PLANEEQ_RAM)
- const Vector4 * norms = Mesh->Get_Plane_Array();
-#endif
-
- int polyhit = -1;
-
- for (int poly_counter=0; poly_counterStartBad) {
- return true;
- }
- }
- if (polyhit != -1) {
- boxtest.Result->SurfaceType = Mesh->Get_Poly_Surface_Type (polyhit);
- return true;
- }
- }
- return false;
-
-}
-
-
-/***********************************************************************************************
- * AABTreeClass::Intersect_OBBox_With_Polys -- Test polys for intersection *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 1/20/00 gth : Created. *
- *=============================================================================================*/
-bool AABTreeClass::Intersect_OBBox_With_Polys
-(
- CullNodeStruct * node,
- OBBoxIntersectionTestClass & test
-)
-{
- int poly0 = node->Get_Poly0();
- int polycount = node->Get_Poly_Count();
-
- if (polycount > 0) {
- /*
- ** Simply loop through the polys in this node, checking each for collision
- */
- TriClass tri;
-
- const Vector3 * loc = Mesh->Get_Vertex_Array();
- const TriIndex * polyverts = Mesh->Get_Polygon_Array();
-#if (!OPTIMIZE_PLANEEQ_RAM)
- const Vector4 * norms = Mesh->Get_Plane_Array();
-#endif
-
- for (int poly_counter=0; poly_counterMin.Set(100000.0f,100000.0f,100000.0f);
- node->Max.Set(-100000.0f,-100000.0f,-100000.0f);
-
- /*
- ** Recurse to the children first
- */
- if (node->Is_Leaf() == false) {
-
- Update_Bounding_Boxes_Recursive(&(Nodes[node->Get_Front_Child()]));
- Update_Bounding_Boxes_Recursive(&(Nodes[node->Get_Back_Child()]));
-
- /*
- ** Bound our children
- */
- int front = node->Get_Front_Child();
- int back = node->Get_Back_Child();
-
- if (Nodes[front].Min.X < node->Min.X) node->Min.X = Nodes[front].Min.X;
- if (Nodes[front].Max.X > node->Max.X) node->Max.X = Nodes[front].Max.X;
-
- if (Nodes[front].Min.Y < node->Min.Y) node->Min.Y = Nodes[front].Min.Y;
- if (Nodes[front].Max.Y > node->Max.Y) node->Max.Y = Nodes[front].Max.Y;
-
- if (Nodes[front].Min.Z < node->Min.Z) node->Min.Z = Nodes[front].Min.Z;
- if (Nodes[front].Max.Z > node->Max.Z) node->Max.Z = Nodes[front].Max.Z;
-
- if (Nodes[back].Min.X < node->Min.X) node->Min.X = Nodes[back].Min.X;
- if (Nodes[back].Max.X > node->Max.X) node->Max.X = Nodes[back].Max.X;
-
- if (Nodes[back].Min.Y < node->Min.Y) node->Min.Y = Nodes[back].Min.Y;
- if (Nodes[back].Max.Y > node->Max.Y) node->Max.Y = Nodes[back].Max.Y;
-
- if (Nodes[back].Min.Z < node->Min.Z) node->Min.Z = Nodes[back].Min.Z;
- if (Nodes[back].Max.Z > node->Max.Z) node->Max.Z = Nodes[back].Max.Z;
-
- } else {
-
- /*
- ** Bound our polygons
- */
- int poly0 = node->Get_Poly0();
- int polycount = node->Get_Poly_Count();
-
- for (int poly_index = 0; poly_index < polycount; poly_index++) {
- int pi = PolyIndices[poly0 + poly_index];
- Update_Min_Max(pi,node->Min,node->Max );
- }
-
- }
-
- WWASSERT(node->Min.X != 100000.0f);
- WWASSERT(node->Min.Y != 100000.0f);
- WWASSERT(node->Min.Z != 100000.0f);
- WWASSERT(node->Max.X != -100000.0f);
- WWASSERT(node->Max.Y != -100000.0f);
- WWASSERT(node->Max.Z != -100000.0f);
-}
-
-
-/***********************************************************************************************
- * AABTreeClass::Update_Min_Max -- updates min and max given a polygon index *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 6/22/99 GTH : Created. *
- *=============================================================================================*/
-void AABTreeClass::Update_Min_Max(int poly_index,Vector3 & min,Vector3 & max)
-{
- for (int vert_index = 0; vert_index < 3; vert_index++) {
-
- const TriIndex * polyverts = Mesh->Get_Polygon_Array() + poly_index;
- const Vector3 * point = Mesh->Get_Vertex_Array() + (*polyverts)[vert_index];
-
- if (point->X < min.X) min.X = point->X;
- if (point->Y < min.Y) min.Y = point->Y;
- if (point->Z < min.Z) min.Z = point->Z;
-
- if (point->X > max.X) max.X = point->X;
- if (point->Y > max.Y) max.Y = point->Y;
- if (point->Z > max.Z) max.Z = point->Z;
- }
-}
-
-
-/***********************************************************************************************
- * AABTreeClass::Load_W3D -- Load a W3D description of an AABTree *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 5/22/2000 gth : Created. *
- *=============================================================================================*/
-void AABTreeClass::Load_W3D(ChunkLoadClass & cload)
-{
- Reset();
-
- W3dMeshAABTreeHeader header;
- cload.Open_Chunk();
- WWASSERT(cload.Cur_Chunk_ID() == W3D_CHUNK_AABTREE_HEADER);
- cload.Read(&header,sizeof(header));
- cload.Close_Chunk();
-
- NodeCount = header.NodeCount;
- PolyCount = header.PolyCount;
- Nodes = W3DNEWARRAY CullNodeStruct[NodeCount];
- PolyIndices = W3DNEWARRAY uint32[PolyCount];
-
- while (cload.Open_Chunk()) {
- switch (cload.Cur_Chunk_ID())
- {
- case W3D_CHUNK_AABTREE_POLYINDICES:
- Read_Poly_Indices(cload);
- break;
-
- case W3D_CHUNK_AABTREE_NODES:
- Read_Nodes(cload);
- break;
- }
- cload.Close_Chunk();
- }
-}
-
-
-/***********************************************************************************************
- * AABTreeClass::Read_Poly_Indices -- load the polygon index array *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 5/22/2000 gth : Created. *
- *=============================================================================================*/
-void AABTreeClass::Read_Poly_Indices(ChunkLoadClass & cload)
-{
- cload.Read(PolyIndices,sizeof(uint32) * PolyCount);
-}
-
-
-/***********************************************************************************************
- * AABTreeClass::Read_Nodes -- Load the node array *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 5/22/2000 gth : Created. *
- *=============================================================================================*/
-void AABTreeClass::Read_Nodes(ChunkLoadClass & cload)
-{
- W3dMeshAABTreeNode w3dnode;
-
- for (int i=0; i.
-*/
-
-/***********************************************************************************************
- *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
- ***********************************************************************************************
- * *
- * Project Name : WW3D *
- * *
- * $Archive:: /Commando/Code/ww3d2/aabtree.h $*
- * *
- * Org Author:: Greg Hjelstrom *
- * *
- * Author:: Kenny Mitchell *
- * *
- * $Modtime:: 6/26/02 2:58p $*
- * *
- * $Revision:: 4 $*
- * *
- *---------------------------------------------------------------------------------------------*
- * 06/26/02 KM Integrating shader system
- * Functions: *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-#if defined(_MSC_VER)
-#pragma once
-#endif
-
-#ifndef AABTREE_H
-#define AABTREE_H
-
-#include "always.h"
-#include "refcount.h"
-#include "simplevec.h"
-#include "vector3.h"
-#include "Vector3i.h"
-#include "aaplane.h"
-#include "bittype.h"
-#include "colmath.h"
-#include "wwdebug.h"
-#include "aabtreebuilder.h"
-#include "obbox.h"
-#include
-#include
-
-
-class MeshClass;
-class CameraClass;
-class RayCollisionTestClass;
-class AABoxCollisionTestClass;
-class OBBoxCollisionTestClass;
-class OBBoxIntersectionTestClass;
-class ChunkLoadClass;
-class ChunkSaveClass;
-class MeshGeometryClass;
-class OBBoxClass;
-class ChunkLoadClass;
-
-struct BoxRayAPTContextStruct;
-
-#define AABTREE_LEAF_FLAG 0x80000000
-
-
-/*
-** AABTreeClass
-** This class encapsulates an Axis-Aligned Bounding Box Tree for a mesh. This tree
-** can be used to perform hierarchical culling for collision detection. Note that
-** this class is constructed using the AABTreeBuilderClass; these two classes are
-** very tightly coupled. Pretty much the only code which needs to know about the AABTreeClass
-** is in MeshGeometryClass. I moved these out into a separate file just to reduce the
-** size of meshmdl.cpp.
-*/
-class AABTreeClass : public W3DMPO, public RefCountClass
-{
- W3DMPO_GLUE(AABTreeClass)
-public:
-
- AABTreeClass(void);
- AABTreeClass(AABTreeBuilderClass * builder);
- AABTreeClass(const AABTreeClass & that);
- ~AABTreeClass(void);
-
- void Load_W3D(ChunkLoadClass & cload);
-
- // Uniformly scale the AABTree
- void Scale(float scale);
-
- int Get_Node_Count(void) { return NodeCount; }
- int Get_Poly_Count(void) { return PolyCount; }
- int Compute_Ram_Size(void);
- void Generate_APT(const OBBoxClass & box,SimpleDynVecClass & apt);
- void Generate_APT(const OBBoxClass & box,const Vector3 & viewdir,SimpleDynVecClass & apt);
-
- bool Cast_Ray(RayCollisionTestClass & raytest);
- int Cast_Semi_Infinite_Axis_Aligned_Ray(const Vector3 & start_point,
- int axis_dir, unsigned char & flags);
- bool Cast_AABox(AABoxCollisionTestClass & boxtest);
- bool Cast_OBBox(OBBoxCollisionTestClass & boxtest);
- bool Intersect_OBBox(OBBoxIntersectionTestClass & boxtest);
-
- void Set_Mesh(MeshGeometryClass * mesh);
-
-private:
-
- AABTreeClass & operator = (const AABTreeClass & that);
-
- void Read_Poly_Indices(ChunkLoadClass & cload);
- void Read_Nodes(ChunkLoadClass & cload);
-
- void Build_Tree_Recursive(AABTreeBuilderClass::CullNodeStruct * node,int &curpolyindex);
- void Reset(void);
- void Update_Bounding_Boxes(void);
- void Update_Min_Max(int index,Vector3 & min,Vector3 & max);
-
- /*
- ** CullNodeStruct - the culling tree is built out of an array of these structures
- ** They contain the extents of an axis-aligned box, indices to children nodes,
- ** and indices into the polygon array
- ** (05/22/2000 gth - changed this structure to support either child nodes -or-
- ** a polygon array but not both at the same time. Also switched to 32bit indices
- ** so that the code doesn't become useless as quickly )
- */
- struct CullNodeStruct
- {
- Vector3 Min;
- Vector3 Max;
-
- uint32 FrontOrPoly0;
- uint32 BackOrPolyCount;
-
- // accessors
- inline bool Is_Leaf(void);
-
- inline int Get_Back_Child(void); // returns index of back child (only call for non-LEAFs!!!)
- inline int Get_Front_Child(void); // returns index of front child (only call for non-LEAFs!!!)
- inline int Get_Poly0(void); // returns index of first polygon (only call on LEAFs)
- inline int Get_Poly_Count(void); // returns polygon count (only call on LEAFs)
-
- // initialization
- inline void Set_Front_Child(uint32 index);
- inline void Set_Back_Child(uint32 index);
- inline void Set_Poly0(uint32 index);
- inline void Set_Poly_Count(uint32 count);
- };
-
- /*
- ** OBBoxAPTContextStruct - this is a temporary datastructure used in building
- ** an APT by culling the mesh to an oriented bounding box.
- */
- struct OBBoxAPTContextStruct
- {
- OBBoxAPTContextStruct(const OBBoxClass & box,SimpleDynVecClass & apt) :
- Box(box), APT(apt)
- { }
-
- OBBoxClass Box;
- SimpleDynVecClass & APT;
- };
-
- /**
- ** OBBoxRayAPTContextStruct - temporary datastructure used in building an APT
- ** by culling the mesh to a oriented box and eliminating backfaces to a ray.
- */
- struct OBBoxRayAPTContextStruct
- {
- OBBoxRayAPTContextStruct(const OBBoxClass & box,const Vector3 & viewdir,SimpleDynVecClass & apt) :
- Box(box),
- ViewVector(viewdir),
- APT(apt)
- { }
-
- OBBoxClass Box;
- Vector3 ViewVector;
- SimpleDynVecClass & APT;
- };
-
- void Generate_OBBox_APT_Recursive(CullNodeStruct * node,OBBoxAPTContextStruct & context);
- void Generate_OBBox_APT_Recursive(CullNodeStruct * node, OBBoxRayAPTContextStruct & context);
-
- bool Cast_Ray_Recursive(CullNodeStruct * node,RayCollisionTestClass & raytest);
- int Cast_Semi_Infinite_Axis_Aligned_Ray_Recursive(CullNodeStruct * node, const Vector3 & start_point,
- int axis_r, int axis_1, int axis_2, int direction, unsigned char & flags);
- bool Cast_AABox_Recursive(CullNodeStruct * node,AABoxCollisionTestClass & boxtest);
- bool Cast_OBBox_Recursive(CullNodeStruct * node,OBBoxCollisionTestClass & boxtest);
- bool Intersect_OBBox_Recursive(CullNodeStruct * node,OBBoxIntersectionTestClass & boxtest);
-
- bool Cast_Ray_To_Polys(CullNodeStruct * node,RayCollisionTestClass & raytest);
- int Cast_Semi_Infinite_Axis_Aligned_Ray_To_Polys(CullNodeStruct * node, const Vector3 & start_point,
- int axis_r, int axis_1, int axis_2, int direction, unsigned char & flags);
- bool Cast_AABox_To_Polys(CullNodeStruct * node,AABoxCollisionTestClass & boxtest);
- bool Cast_OBBox_To_Polys(CullNodeStruct * node,OBBoxCollisionTestClass & boxtest);
- bool Intersect_OBBox_With_Polys(CullNodeStruct * node,OBBoxIntersectionTestClass & boxtest);
-
- void Update_Bounding_Boxes_Recursive(CullNodeStruct * node);
-
- int NodeCount; // number of nodes in the tree
- CullNodeStruct * Nodes; // array of nodes
- int PolyCount; // number of polygons in the parent mesh (and the number of indexes in our array)
- uint32 * PolyIndices; // linear array of polygon indices, nodes index into this array
- MeshGeometryClass * Mesh; // pointer to the parent mesh (non-ref-counted; we are a member of this mesh)
-
- friend class MeshClass;
- friend class MeshGeometryClass;
- friend class AuxMeshDataClass;
- friend class AABTreeBuilderClass;
-
-};
-
-inline int AABTreeClass::Compute_Ram_Size(void)
-{
- return NodeCount * sizeof(CullNodeStruct) +
- PolyCount * sizeof(int) +
- sizeof(AABTreeClass);
-}
-
-inline bool AABTreeClass::Cast_Ray(RayCollisionTestClass & raytest)
-{
- WWASSERT(Nodes != NULL);
- return Cast_Ray_Recursive(&(Nodes[0]),raytest);
-}
-
-inline int AABTreeClass::Cast_Semi_Infinite_Axis_Aligned_Ray(const Vector3 & start_point,
- int axis_dir, unsigned char & flags)
-{
- // These tables translate between the axis_dir representation (which is an integer in which 0
- // indicates a ray along the positive x axis, 1 along the negative x axis, 2 the positive y
- // axis, 3 negative y axis, 4 positive z axis, 5 negative z axis) and a four-integer
- // representation (axis_r is the axis number - 0, 1 or 2 - of the axis along which the ray is
- // cast; axis_1 and axis_2 are the axis numbers of the other two axes; direction is 0 for
- // negative and 1 for positive direction of the ray).
- static const int axis_r[6] = { 0, 0, 1, 1, 2, 2 };
- static const int axis_1[6] = { 1, 1, 2, 2, 0, 0 };
- static const int axis_2[6] = { 2, 2, 0, 0, 1, 1 };
- static const int direction[6] = { 1, 0, 1, 0, 1, 0 };
- WWASSERT(Nodes != NULL);
- WWASSERT(axis_dir >= 0);
- WWASSERT(axis_dir < 6);
-
- // The functions called after this point will 'or' bits into this variable, so it needs to
- // be initialized here to TRI_RAYCAST_FLAG_NONE.
- flags = TRI_RAYCAST_FLAG_NONE;
-
- return Cast_Semi_Infinite_Axis_Aligned_Ray_Recursive(&(Nodes[0]), start_point,
- axis_r[axis_dir], axis_1[axis_dir], axis_2[axis_dir], direction[axis_dir], flags);
-}
-
-inline bool AABTreeClass::Cast_AABox(AABoxCollisionTestClass & boxtest)
-{
- WWASSERT(Nodes != NULL);
- return Cast_AABox_Recursive(&(Nodes[0]),boxtest);
-}
-
-inline bool AABTreeClass::Cast_OBBox(OBBoxCollisionTestClass & boxtest)
-{
- WWASSERT(Nodes != NULL);
- return Cast_OBBox_Recursive(&(Nodes[0]),boxtest);
-}
-
-inline bool AABTreeClass::Intersect_OBBox(OBBoxIntersectionTestClass & boxtest)
-{
- WWASSERT(Nodes != NULL);
- return Intersect_OBBox_Recursive(&(Nodes[0]),boxtest);
-}
-
-inline void AABTreeClass::Update_Bounding_Boxes(void)
-{
- WWASSERT(Nodes != NULL);
- Update_Bounding_Boxes_Recursive(&(Nodes[0]));
-}
-
-
-/***********************************************************************************************
-
- AABTreeClass::CullNodeStruct implementation
-
- These nodes can be either leaf nodes or non-leaf nodes. If they are leaf nodes, they
- will contain an index to their first polygon index and a polygon count. If they are
- non-leafs they will contain indices to their front and back children. Since I'm re-using
- the same variables for the child indices and the polygon indices, you have to call
- the Is_Leaf function then only call the appropriate functions. The flag indicating whether
- this node is a leaf is stored in the MSB of the FrontOrPoly0 variable. It will always
- be stripped off by these accessor functions
-
-***********************************************************************************************/
-
-inline bool AABTreeClass::CullNodeStruct::Is_Leaf(void)
-{
- return ((FrontOrPoly0 & AABTREE_LEAF_FLAG) != 0);
-}
-
-inline int AABTreeClass::CullNodeStruct::Get_Front_Child(void)
-{
- WWASSERT(!Is_Leaf());
- return FrontOrPoly0; // we shouldn't be calling this on a leaf and the leaf bit should be zero...
-}
-
-inline int AABTreeClass::CullNodeStruct::Get_Back_Child(void)
-{
- WWASSERT(!Is_Leaf());
- return BackOrPolyCount;
-}
-
-inline int AABTreeClass::CullNodeStruct::Get_Poly0(void)
-{
- WWASSERT(Is_Leaf());
- return (FrontOrPoly0 & ~AABTREE_LEAF_FLAG);
-}
-
-inline int AABTreeClass::CullNodeStruct::Get_Poly_Count(void)
-{
- WWASSERT(Is_Leaf());
- return BackOrPolyCount;
-}
-
-inline void AABTreeClass::CullNodeStruct::Set_Front_Child(uint32 index)
-{
- WWASSERT(index < 0x7FFFFFFF);
- FrontOrPoly0 = index;
-}
-
-inline void AABTreeClass::CullNodeStruct::Set_Back_Child(uint32 index)
-{
- WWASSERT(index < 0x7FFFFFFF);
- BackOrPolyCount = index;
-}
-
-inline void AABTreeClass::CullNodeStruct::Set_Poly0(uint32 index)
-{
- WWASSERT(index < 0x7FFFFFFF);
- FrontOrPoly0 = (index | AABTREE_LEAF_FLAG);
-}
-
-inline void AABTreeClass::CullNodeStruct::Set_Poly_Count(uint32 count)
-{
- WWASSERT(count < 0x7FFFFFFF);
- BackOrPolyCount = count;
-}
-
-#endif
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/agg_def.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/agg_def.cpp
deleted file mode 100644
index 4275e31188e..00000000000
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/agg_def.cpp
+++ /dev/null
@@ -1,894 +0,0 @@
-/*
-** 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 .
-*/
-
-/***********************************************************************************************
- *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
- ***********************************************************************************************
- * *
- * Project Name : WW3D *
- * *
- * $Archive:: /Commando/Code/ww3d2/agg_def.cpp $*
- * *
- * Author:: Patrick Smith
- * *
- * $Modtime:: 4/05/01 10:21a $*
- * *
- * $Revision:: 5 $*
- * *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-
-#include "agg_def.h"
-#include "htree.h"
-#include "w3derr.h"
-#include "chunkio.h"
-#include "wwdebug.h"
-#include "assetmgr.h"
-#include "matinfo.h"
-#include "texture.h"
-#include "wwstring.h"
-
-#include
-
-
-///////////////////////////////////////////////////////////////////////////////////
-//
-// Local constants
-//
-const char * const EMPTY_STRING = "";
-
-
-///////////////////////////////////////////////////////////////////////////////////
-//
-// Global variable initialization
-//
-AggregateLoaderClass _AggregateLoader;
-
-
-///////////////////////////////////////////////////////////////////////////////////
-//
-// AggregateDefClass
-//
-AggregateDefClass::AggregateDefClass (void)
- : m_pName (NULL)
-{
- // Set our member data to default settings
- ::memset (&m_Info, 0, sizeof (m_Info));
- ::memset (&m_MiscInfo, 0, sizeof (m_MiscInfo));
- m_MiscInfo.OriginalClassID = RenderObjClass::CLASSID_HLOD;
- return ;
-}
-
-
-///////////////////////////////////////////////////////////////////////////////////
-//
-// AggregateDefClass
-//
-AggregateDefClass::AggregateDefClass (const AggregateDefClass &src)
- : m_pName (NULL)
-{
- // Set our member data to default settings
- ::memset (&m_Info, 0, sizeof (m_Info));
- ::memset (&m_MiscInfo, 0, sizeof (m_MiscInfo));
- m_MiscInfo.OriginalClassID = RenderObjClass::CLASSID_HLOD;
-
- // Invoke the assignment operator
- (*this) = src;
- return ;
-}
-
-
-///////////////////////////////////////////////////////////////////////////////////
-//
-// AggregateDefClass
-//
-AggregateDefClass::AggregateDefClass (RenderObjClass &base_model)
- : m_pName (NULL)
-{
- // Set our member data to default settings
- ::memset (&m_Info, 0, sizeof (m_Info));
- ::memset (&m_MiscInfo, 0, sizeof (m_MiscInfo));
- m_MiscInfo.OriginalClassID = RenderObjClass::CLASSID_HLOD;
-
- Initialize (base_model);
- return ;
-}
-
-
-///////////////////////////////////////////////////////////////////////////////////
-//
-// ~AggregateDefClass
-//
-AggregateDefClass::~AggregateDefClass (void)
-{
- // Free the name buffer if necessary
- if (m_pName != NULL) {
-
- // free() is used because the buffer was allocated with ::_strdup().
- ::free (m_pName);
- m_pName = NULL;
- }
-
- Free_Subobject_List ();
- return ;
-}
-
-
-///////////////////////////////////////////////////////////////////////////////////
-//
-// operator=
-//
-const AggregateDefClass &
-AggregateDefClass::operator= (const AggregateDefClass &src)
-{
- int index;
-
- // Free the name buffer if necessary
- if (m_pName != NULL) {
- ::free (m_pName);
- m_pName = NULL;
- }
-
- // Start with a fresh set of data
- Free_Subobject_List ();
-
- // Copy the src object's name and info struct
- Set_Name (src.Get_Name ());
- ::memcpy (&m_Info, &src.m_Info, sizeof (m_Info));
- ::memcpy (&m_MiscInfo, &src.m_MiscInfo, sizeof (m_MiscInfo));
- m_Version = src.m_Version;
-
- // Loop through all the entries in the src object's subobj list
- for (index = 0; index < src.m_SubobjectList.Count (); index ++) {
- W3dAggregateSubobjectStruct *pinfo = src.m_SubobjectList[index];
- if (pinfo != NULL) {
-
- // Copy the src object's info for this subobj
- W3dAggregateSubobjectStruct *new_info = W3DNEW W3dAggregateSubobjectStruct;
- ::memcpy (new_info, pinfo, sizeof (W3dAggregateSubobjectStruct));
-
- // Add this subobj to our list
- m_SubobjectList.Add (new_info);
- }
- }
-
- // Return a reference to ourselves
- return *this;
-}
-
-
-///////////////////////////////////////////////////////////////////////////////////
-//
-// Free_Subobject_List
-//
-void
-AggregateDefClass::Free_Subobject_List (void)
-{
- // Delete all the stucture pointers contained in the subobject list
- for (int index = 0; index < m_SubobjectList.Count (); index ++) {
- W3dAggregateSubobjectStruct *pinfo = m_SubobjectList[index];
- if (pinfo) {
- delete pinfo;
- }
- }
-
- // Reset the lists contents
- m_SubobjectList.Delete_All ();
- return ;
-}
-
-
-///////////////////////////////////////////////////////////////////////////////////
-//
-// Create
-//
-RenderObjClass *
-AggregateDefClass::Create (void)
-{
- // Attempt to create an instance of the hierarchy
- RenderObjClass *pmodel = Create_Render_Object (m_Info.BaseModelName);
- if (pmodel != NULL) {
-
- // Perform the aggregation
- Attach_Subobjects (*pmodel);
-
- // Let the new object know what its new name and base name are.
- pmodel->Set_Name (m_pName);
- pmodel->Set_Base_Model_Name (m_Info.BaseModelName);
- pmodel->Set_Sub_Objects_Match_LOD ((m_MiscInfo.Flags & W3D_AGGREGATE_FORCE_SUB_OBJ_LOD) == W3D_AGGREGATE_FORCE_SUB_OBJ_LOD);
-
- } else {
- WWDEBUG_SAY (("Unable to load aggregate %s.\r\n", m_Info.BaseModelName));
- }
-
- // Return a pointer to the new aggregate
- return pmodel;
-}
-
-
-///////////////////////////////////////////////////////////////////////////////////
-//
-// Find_Subobject
-//
-RenderObjClass *
-AggregateDefClass::Find_Subobject
-(
- RenderObjClass &model,
- const char mesh_path[MESH_PATH_ENTRIES][MESH_PATH_ENTRY_LEN],
- const char bone_path[MESH_PATH_ENTRIES][MESH_PATH_ENTRY_LEN]
-)
-{
- RenderObjClass *parent_model = &model;
- parent_model->Add_Ref ();
-
- // Loop through all the models in our "path" until we've either failed
- // or found the exact mesh we were looking for...
- for (int index = 1;
- (mesh_path[index][0] != 0) && (parent_model != NULL);
- index ++) {
-
- // Look one level deeper into the subobject chain...
- RenderObjClass *sub_obj = NULL;
- if (bone_path[index][0] == 0) {
- sub_obj = parent_model->Get_Sub_Object_By_Name (mesh_path[index]);
- } else {
-
- int bone_index = parent_model->Get_Bone_Index (bone_path[index]);
- int subobj_count = parent_model->Get_Num_Sub_Objects_On_Bone (bone_index);
-
- // Loop through all the subobjects on this bone
- for (int subobj_index = 0; (subobj_index < subobj_count) && (sub_obj == NULL); subobj_index ++) {
-
- // Is this the subobject we were looking for?
- RenderObjClass *ptemp_obj = parent_model->Get_Sub_Object_On_Bone (subobj_index, bone_index);
- if (::lstrcmpi (ptemp_obj->Get_Name (), mesh_path[index]) == 0) {
- sub_obj = ptemp_obj;
- } else {
- REF_PTR_RELEASE (ptemp_obj);
- }
- }
- }
-
- REF_PTR_RELEASE (parent_model);
-
- // The parent for the next iteration is the subobject on this one.
- parent_model = sub_obj;
- }
-
- // Return a pointer to the subobject
- return parent_model;
-}
-
-
-///////////////////////////////////////////////////////////////////////////////////
-//
-// Attach_Subobjects
-//
-void
-AggregateDefClass::Attach_Subobjects (RenderObjClass &base_model)
-{
- // Now loop through all the subobjects and attach them to the appropriate bone
- for (int index = 0; index < m_SubobjectList.Count (); index ++) {
- W3dAggregateSubobjectStruct *psubobj_info = m_SubobjectList[index];
- if (psubobj_info != NULL) {
-
- // Now create this subobject and attach it to its bone.
- RenderObjClass *prender_obj = Create_Render_Object (psubobj_info->SubobjectName);
- if (prender_obj != NULL) {
-
- // Attach this object to the requested bone
- if (base_model.Add_Sub_Object_To_Bone (prender_obj, psubobj_info->BoneName) == false) {
- WWDEBUG_SAY (("Unable to attach %s to %s.\r\n", psubobj_info->SubobjectName, psubobj_info->BoneName));
- }
-
- // Release our hold on this pointer
- prender_obj->Release_Ref ();
- } else {
- WWDEBUG_SAY (("Unable to load aggregate subobject %s.\r\n", psubobj_info->SubobjectName));
- }
- }
- }
-
- return ;
-}
-
-
-///////////////////////////////////////////////////////////////////////////////////
-//
-// Create_Render_Object
-//
-RenderObjClass *
-AggregateDefClass::Create_Render_Object (const char *passet_name)
-{
- // Assume failure
- RenderObjClass *prender_obj = NULL;
-
- // Attempt to get an instance of the render object from the asset manager
- prender_obj = WW3DAssetManager::Get_Instance()->Create_Render_Obj (passet_name);
-
- // If we couldn't find the render object in the asset manager, then attempt to
- // load it from file
- if ((prender_obj == NULL) &&
- Load_Assets (passet_name)) {
-
- // It should be in the asset manager now, so attempt to get it again.
- prender_obj = WW3DAssetManager::Get_Instance()->Create_Render_Obj (passet_name);
- }
-
- // Return a pointer to the render object
- return prender_obj;
-}
-
-
-///////////////////////////////////////////////////////////////////////////////////
-//
-// Load_Assets
-//
-bool
-AggregateDefClass::Load_Assets (const char *passet_name)
-{
- // Assume failure
- bool retval = false;
-
- // Param OK?
- if (passet_name != NULL) {
-
- // Determine what the current working directory is
- char path[MAX_PATH];
- ::GetCurrentDirectory (sizeof (path), path);
-
- // Ensure the path is directory delimited
- if (path[::lstrlen(path)-1] != '\\') {
- ::lstrcat (path, "\\");
- }
-
- // Assume the filename is simply the "asset name" + the w3d extension
- ::lstrcat (path, passet_name);
- ::lstrcat (path, ".w3d");
-
- // If the file exists, then load it into the asset manager.
- if (::GetFileAttributes (path) != 0xFFFFFFFF) {
- retval = WW3DAssetManager::Get_Instance()->Load_3D_Assets (path);
- }
- }
-
- // Return the true/false result code
- return retval;
-}
-
-
-///////////////////////////////////////////////////////////////////////////////////
-//
-// Initialize
-//
-void
-AggregateDefClass::Initialize (RenderObjClass &base_model)
-{
- // Start with fresh lists
- Free_Subobject_List ();
-
- // Determine what the render objects original name was.
- const char *orig_model_name = base_model.Get_Base_Model_Name ();
- orig_model_name = (orig_model_name == NULL) ? base_model.Get_Name () : orig_model_name;
-
- // Record information about this base model
- ::lstrcpy (m_Info.BaseModelName, orig_model_name);
- m_Info.SubobjectCount = 0;
- m_MiscInfo.OriginalClassID = base_model.Class_ID ();
- m_MiscInfo.Flags = 0;
- m_MiscInfo.Flags |= base_model.Is_Sub_Objects_Match_LOD_Enabled () ? W3D_AGGREGATE_FORCE_SUB_OBJ_LOD : 0;
-
-
- // Pass the aggregate name along
- Set_Name (base_model.Get_Name ());
-
- // Create a new instance of the model which we can use
- // to compare with the supplied model and determine
- // which 'bones-models' and textures are new.
- RenderObjClass *pvanilla_model = (RenderObjClass *)Create_Render_Object (orig_model_name);
-
- // Build lists of changes from the delta between the original model and the provided one
- Build_Subobject_List (*pvanilla_model, base_model);
-
- // Release the model if necessary
- REF_PTR_RELEASE (pvanilla_model);
- return ;
-}
-
-
-
-///////////////////////////////////////////////////////////////////////////////////
-//
-// Build_Subobject_List
-//
-void
-AggregateDefClass::Build_Subobject_List
-(
- RenderObjClass &original_model,
- RenderObjClass &model
-)
-{
- int index;
-
- // Loop through all the bones in this render obj
- int bone_count = model.Get_Num_Bones ();
- for (int bone_index = 0; bone_index < bone_count; bone_index ++) {
- const char *pbone_name = model.Get_Bone_Name (bone_index);
-
- // Build a list of nodes that are contained in the vanilla model
- DynamicVectorClass orig_node_list;
- for (index = 0;
- index < original_model.Get_Num_Sub_Objects_On_Bone (bone_index);
- index ++) {
- RenderObjClass *psubobj = original_model.Get_Sub_Object_On_Bone (index, bone_index);
- if (psubobj != NULL) {
- orig_node_list.Add (psubobj);
- }
- }
-
- // Build a list of nodes that are contained in this bone
- DynamicVectorClass node_list;
- for (index = 0;
- index < model.Get_Num_Sub_Objects_On_Bone (bone_index);
- index ++) {
- RenderObjClass *psubobj = model.Get_Sub_Object_On_Bone (index, bone_index);
- if (psubobj != NULL) {
- node_list.Add (psubobj);
- }
- }
-
- int node_count = node_list.Count ();
- if (node_count > 0) {
-
- // Loop through the subobjects and add each one to our internal list
- W3dAggregateSubobjectStruct subobj_info = { 0 };
- for (int node_index = 0; node_index < node_count; node_index ++) {
- RenderObjClass *psubobject = node_list[node_index];
- WWASSERT (psubobject != NULL);
-
- // Is this subobject new? (i.e. not in a 'vanilla' instance?)
- const char *prototype_name = psubobject->Get_Name ();
- if (psubobject != NULL &&
- (Is_Object_In_List (prototype_name, orig_node_list) == false)) {
-
- // Add this subobject to our list
- ::lstrcpy (subobj_info.SubobjectName, prototype_name);
- ::lstrcpy (subobj_info.BoneName, pbone_name);
- Add_Subobject (subobj_info);
- m_Info.SubobjectCount ++;
-
- // Attach this render object to the 'original' model (this is done
- // so we can do texture compares later)
- RenderObjClass *prender_obj = WW3DAssetManager::Get_Instance ()->Create_Render_Obj (prototype_name);
- ((RenderObjClass &)original_model).Add_Sub_Object_To_Bone (prender_obj, pbone_name);
- REF_PTR_RELEASE (prender_obj);
- }
- }
- }
-
- // Free our hold on the render objs in the original node list
- for (index = 0; index < orig_node_list.Count (); index ++) {
- REF_PTR_RELEASE (orig_node_list[index]);
- }
- orig_node_list.Delete_All ();
-
- // Free our hold on the render objs in the node list
- for (index = 0; index < node_list.Count (); index ++) {
- REF_PTR_RELEASE (node_list[index]);
- }
- node_list.Delete_All ();
- }
-
- return ;
-}
-
-
-///////////////////////////////////////////////////////////////////////////////////
-//
-// Is_Object_In_List
-//
-bool
-AggregateDefClass::Is_Object_In_List
-(
- const char *passet_name,
- DynamicVectorClass &node_list
-)
-{
- // Assume failure
- bool retval = false;
-
- // Loop through the nodes in the list until we've found the one
- // were are looking for.
- for (int node_index = 0; (node_index < node_list.Count ()) && (retval == false); node_index ++) {
- RenderObjClass *prender_obj = node_list[node_index];
-
- // Is this the render object we were looking for?
- if (prender_obj != NULL &&
- ::lstrcmpi (prender_obj->Get_Name (), passet_name) == 0) {
- retval = true;
- }
- }
-
- // Return the true/false result code
- return retval;
-}
-
-
-///////////////////////////////////////////////////////////////////////////////////
-//
-// Load
-//
-WW3DErrorType
-AggregateDefClass::Load_W3D (ChunkLoadClass &chunk_load)
-{
- W3dTextureReplacerHeaderStruct header = { 0 };
-
-
- while (chunk_load.Open_Chunk()) {
-
- WW3DErrorType error = WW3D_ERROR_OK;
-
- switch (chunk_load.Cur_Chunk_ID()) {
-
- case W3D_CHUNK_AGGREGATE_HEADER:
- error = Read_Header(chunk_load);
- break;
-
- case W3D_CHUNK_AGGREGATE_INFO:
- error = Read_Info(chunk_load);
- break;
-
- case W3D_CHUNK_TEXTURE_REPLACER_INFO:
- if (chunk_load.Read (&header, sizeof (header)) == sizeof (header)) {
- if (header.ReplacedTexturesCount > 0) {
- WWDEBUG_SAY(("Obsolete texture replacement chunk encountered in aggregate: %s\r\n",m_pName));
- }
- }
- break;
-
- case W3D_CHUNK_AGGREGATE_CLASS_INFO:
- error = Read_Class_Info(chunk_load);
- break;
-
- default:
-
- // Unknown chunk.
- break;
- }
- chunk_load.Close_Chunk();
- if (error != WW3D_ERROR_OK) return (error);
- }
-
- return WW3D_ERROR_OK;
-}
-
-
-///////////////////////////////////////////////////////////////////////////////////
-//
-// Read_Header
-//
-WW3DErrorType
-AggregateDefClass::Read_Header (ChunkLoadClass &chunk_load)
-{
- // Assume error
- WW3DErrorType ret_val = WW3D_ERROR_LOAD_FAILED;
-
- // Is this the header chunk?
- W3dAggregateHeaderStruct header = { 0 };
- if (chunk_load.Read (&header, sizeof (header)) == sizeof (header)) {
-
- // Copy the name from the header structure
- m_pName = ::_strdup (header.Name);
- m_Version = header.Version;
-
- // Success!
- ret_val = WW3D_ERROR_OK;
- }
-
- // Return the WW3D_ERROR_TYPE return code
- return ret_val;
-}
-
-
-///////////////////////////////////////////////////////////////////////////////////
-//
-// Read_Info
-//
-WW3DErrorType
-AggregateDefClass::Read_Info (ChunkLoadClass &chunk_load)
-{
- // Assume error
- WW3DErrorType ret_val = WW3D_ERROR_LOAD_FAILED;
-
- // Read the chunk straight into our member structure
- ::memset (&m_Info, 0, sizeof (m_Info));
- if (chunk_load.Read (&m_Info, sizeof (m_Info)) == sizeof (m_Info)) {
-
- // Success!
- ret_val = WW3D_ERROR_OK;
-
- // Read all the subobjects from the file
- for (UINT isubobject = 0;
- (isubobject < m_Info.SubobjectCount) && (ret_val == WW3D_ERROR_OK);
- isubobject ++) {
-
- // Read this subobject's definition from the file
- ret_val = Read_Subobject (chunk_load);
- }
- }
-
- // Return the WW3D_ERROR_TYPE return code
- return ret_val;
-}
-
-
-///////////////////////////////////////////////////////////////////////////////////
-//
-// Read_Subobject
-//
-WW3DErrorType
-AggregateDefClass::Read_Subobject (ChunkLoadClass &chunk_load)
-{
- // Assume error
- WW3DErrorType ret_val = WW3D_ERROR_LOAD_FAILED;
-
- // Read the subobject information from the file
- W3dAggregateSubobjectStruct subobj_info = { 0 };
- if (chunk_load.Read (&subobj_info, sizeof (subobj_info)) == sizeof (subobj_info)) {
-
- // Add this subobject to our list
- Add_Subobject (subobj_info);
-
- // Success!
- ret_val = WW3D_ERROR_OK;
- }
-
- // Return the WW3D_ERROR_TYPE return code
- return ret_val;
-}
-
-
-///////////////////////////////////////////////////////////////////////////////////
-//
-// Add_Subobject
-//
-void
-AggregateDefClass::Add_Subobject (const W3dAggregateSubobjectStruct &subobj_info)
-{
- // Create a new structure and copy the contents of the src
- W3dAggregateSubobjectStruct *pnew_entry = W3DNEW W3dAggregateSubobjectStruct;
- ::lstrcpy (pnew_entry->SubobjectName, subobj_info.SubobjectName);
- ::lstrcpy (pnew_entry->BoneName, subobj_info.BoneName);
-
- // Add this new entry to the list
- m_SubobjectList.Add (pnew_entry);
- return ;
-}
-
-
-///////////////////////////////////////////////////////////////////////////////////
-//
-// Read_Class_Info
-//
-WW3DErrorType
-AggregateDefClass::Read_Class_Info (ChunkLoadClass &chunk_load)
-{
- // Assume error
- WW3DErrorType ret_val = WW3D_ERROR_LOAD_FAILED;
-
- // Read the chunk straight into our header structure
- ::memset (&m_MiscInfo, 0, sizeof (m_MiscInfo));
- if (chunk_load.Read (&m_MiscInfo, sizeof (m_MiscInfo)) == sizeof (m_MiscInfo)) {
-
- // Success!
- ret_val = WW3D_ERROR_OK;
- }
-
- // Return the WW3D_ERROR_TYPE return code
- return ret_val;
-}
-
-
-//////////////////////////////////////////////////////////////////////////////////
-//
-// Save
-//
-WW3DErrorType
-AggregateDefClass::Save_W3D (ChunkSaveClass &chunk_save)
-{
- // Assume error
- WW3DErrorType ret_val = WW3D_ERROR_SAVE_FAILED;
-
- // Begin a chunk that identifies an aggregate
- if (chunk_save.Begin_Chunk (W3D_CHUNK_AGGREGATE) == TRUE) {
-
- // Attempt to save the different sections of the aggregate definition
- if ((Save_Header (chunk_save) == WW3D_ERROR_OK) &&
- (Save_Info (chunk_save) == WW3D_ERROR_OK) &&
- (Save_Class_Info (chunk_save) == WW3D_ERROR_OK)) {
-
- // Success!
- ret_val = WW3D_ERROR_OK;
- }
-
- // Close the aggregate chunk
- chunk_save.End_Chunk ();
- }
-
- // Return the WW3D_ERROR_TYPE return code
- return ret_val;
-}
-
-
-///////////////////////////////////////////////////////////////////////////////////
-//
-// Save_Header
-//
-WW3DErrorType
-AggregateDefClass::Save_Header (ChunkSaveClass &chunk_save)
-{
- // Assume error
- WW3DErrorType ret_val = WW3D_ERROR_SAVE_FAILED;
-
- // Begin a chunk that identifies the aggregate
- if (chunk_save.Begin_Chunk (W3D_CHUNK_AGGREGATE_HEADER) == TRUE) {
-
- // Fill the header structure
- W3dAggregateHeaderStruct header = { 0 };
- header.Version = W3D_CURRENT_AGGREGATE_VERSION;
- ::lstrcpyn (header.Name, m_pName, sizeof (header.Name));
- header.Name[sizeof (header.Name) - 1] = 0;
-
- // Write the header out to the chunk
- if (chunk_save.Write (&header, sizeof (header)) == sizeof (header)) {
- // Success!
- ret_val = WW3D_ERROR_OK;
- }
-
- // End the header chunk
- chunk_save.End_Chunk ();
- }
-
- // Return the WW3D_ERROR_TYPE return code
- return ret_val;
-}
-
-
-///////////////////////////////////////////////////////////////////////////////////
-//
-// Save_Info
-//
-WW3DErrorType
-AggregateDefClass::Save_Info (ChunkSaveClass &chunk_save)
-{
- // Assume error
- WW3DErrorType ret_val = WW3D_ERROR_SAVE_FAILED;
-
- // Begin a chunk that identifies the aggregate settings
- if (chunk_save.Begin_Chunk (W3D_CHUNK_AGGREGATE_INFO) == TRUE) {
-
- // Write the settings structure out to the chunk
- if (chunk_save.Write (&m_Info, sizeof (m_Info)) == sizeof (m_Info)) {
- // Success!
- ret_val = WW3D_ERROR_OK;
-
- // Write all the subobjects to the file
- for (int isubobject = 0;
- (isubobject < m_SubobjectList.Count ()) && (ret_val == WW3D_ERROR_OK);
- isubobject ++) {
-
- // Write this object to the file
- ret_val = Save_Subobject (chunk_save, m_SubobjectList[isubobject]);
- }
- }
-
- // End the settings chunk
- chunk_save.End_Chunk ();
- }
-
- // Return the WW3D_ERROR_TYPE return code
- return ret_val;
-}
-
-
-///////////////////////////////////////////////////////////////////////////////////
-//
-// Save_Subobject
-//
-WW3DErrorType
-AggregateDefClass::Save_Subobject
-(
- ChunkSaveClass &chunk_save,
- W3dAggregateSubobjectStruct *psubobject
-)
-{
- // Assume error
- WW3DErrorType ret_val = WW3D_ERROR_SAVE_FAILED;
-
- // Write the subobj structure out to the chunk
- if (chunk_save.Write (psubobject, sizeof (W3dAggregateSubobjectStruct)) == sizeof (W3dAggregateSubobjectStruct)) {
-
- // Success!
- ret_val = WW3D_ERROR_OK;
- }
-
- // Return the WW3D_ERROR_TYPE return code
- return ret_val;
-}
-
-
-/////////////////////////////////////////////////////////////////////////////////
-//
-// Save_Class_Info
-//
-WW3DErrorType
-AggregateDefClass::Save_Class_Info (ChunkSaveClass &chunk_save)
-{
- // Assume error
- WW3DErrorType ret_val = WW3D_ERROR_SAVE_FAILED;
-
- // Begin a chunk that identifies the texture replacer header
- if (chunk_save.Begin_Chunk (W3D_CHUNK_AGGREGATE_CLASS_INFO) == TRUE) {
-
- // Write the class information structure out to the chunk
- if (chunk_save.Write (&m_MiscInfo, sizeof (m_MiscInfo)) == sizeof (m_MiscInfo)) {
-
- // Success!
- ret_val = WW3D_ERROR_OK;
- }
-
- // End the class info chunk
- chunk_save.End_Chunk ();
- }
-
- // Return the WW3D_ERROR_TYPE return code
- return ret_val;
-}
-
-
-///////////////////////////////////////////////////////////////////////////////////
-//
-// Load
-//
-PrototypeClass *
-AggregateLoaderClass::Load_W3D (ChunkLoadClass &chunk_load)
-{
- // Assume failure
- AggregatePrototypeClass *pprototype = NULL;
-
- // Create a definition object
- AggregateDefClass *pdefinition = W3DNEW AggregateDefClass;
- if (pdefinition != NULL) {
-
- // Ask the definition object to load the aggregate data
- if (pdefinition->Load_W3D (chunk_load) != WW3D_ERROR_OK) {
-
- // Error! Free the definition
- delete pdefinition;
- pdefinition = NULL;
- } else {
-
- // Success! Create a prototype from the definition
- pprototype = W3DNEW AggregatePrototypeClass (pdefinition);
- }
- }
-
- // Return a pointer to the prototype
- return pprototype;
-}
-
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/agg_def.h b/Generals/Code/Libraries/Source/WWVegas/WW3D2/agg_def.h
deleted file mode 100644
index 55f2bc3dd86..00000000000
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/agg_def.h
+++ /dev/null
@@ -1,259 +0,0 @@
-/*
-** 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 .
-*/
-
-/***********************************************************************************************
- *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
- ***********************************************************************************************
- * *
- * Project Name : WW3D *
- * *
- * $Archive:: /Commando/Code/ww3d2/agg_def.h $*
- * *
- * Author:: Patrick Smith *
- * *
- * $Modtime:: 4/05/01 9:52a $*
- * *
- * $Revision:: 2 $*
- * *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-
-#if defined(_MSC_VER)
-#pragma once
-#endif
-
-#ifndef AGGREGATE_DEF_H
-#define AGGREGATE_DEF_H
-
-#include "proto.h"
-#include "rendobj.h"
-#include "w3d_file.h"
-#include "w3derr.h"
-#include "Vector.H"
-#include "bittype.h"
-#include
-
-#ifdef _UNIX
-#include "osdep.h"
-#endif
-
-
-// Forward declarations
-class ChunkLoadClass;
-class ChunkSaveClass;
-class IndirectTextureClass;
-
-
-///////////////////////////////////////////////////////////////////////////////////
-//
-// Macros
-//
-#ifndef SAFE_FREE
-#define SAFE_FREE(pointer) \
-{ \
- if (pointer) { \
- ::free (pointer); \
- pointer = 0; \
- } \
-}
-
-#endif //SAFE_FREE
-
-
-//////////////////////////////////////////////////////////////////////////////////
-//
-// AggregateDefClass
-//
-// Description of an aggregate object. Used by the asset manager
-// to construct aggregates. An 'aggregate' is simply a 'shell' that
-// contains references to a hierarchy model and subobjects to attach to its bones.
-//
-class AggregateDefClass
-{
- public:
-
- ///////////////////////////////////////////////////////////
- //
- // Public constructors/destructors
- //
- AggregateDefClass (void);
- AggregateDefClass (RenderObjClass &base_model);
- AggregateDefClass (const AggregateDefClass &src);
- virtual ~AggregateDefClass (void);
-
-
- ///////////////////////////////////////////////////////////
- //
- // Public operators
- //
- const AggregateDefClass &operator= (const AggregateDefClass &src);
-
- ///////////////////////////////////////////////////////////
- //
- // Public methods
- //
- virtual WW3DErrorType Load_W3D (ChunkLoadClass &chunk_load);
- virtual WW3DErrorType Save_W3D (ChunkSaveClass &chunk_save);
- const char * Get_Name (void) const { return m_pName; }
- void Set_Name (const char *pname) { SAFE_FREE (m_pName); m_pName = ::_strdup (pname); }
- RenderObjClass * Create (void);
- AggregateDefClass * Clone (void) const { return W3DNEW AggregateDefClass (*this); }
-
- //
- // Public accessors
- //
- ULONG Class_ID (void) const { return m_MiscInfo.OriginalClassID; }
-
- //
- // Initialization
- //
- void Initialize (RenderObjClass &base_model);
-
- protected:
-
- ///////////////////////////////////////////////////////////
- //
- // Protected data types
- //
- typedef struct _TEXTURE_INFO
- {
- W3dTextureReplacerStruct names;
- IndirectTextureClass * pnew_texture;
-
- bool operator == (_TEXTURE_INFO &src) { return false; }
- bool operator != (_TEXTURE_INFO &src) { return true; }
- } TEXTURE_INFO;
-
-
- ///////////////////////////////////////////////////////////
- //
- // Protected methods
- //
-
- //
- // Loading methods
- //
- virtual WW3DErrorType Read_Header (ChunkLoadClass &chunk_load);
- virtual WW3DErrorType Read_Info (ChunkLoadClass &chunk_load);
- virtual WW3DErrorType Read_Subobject (ChunkLoadClass &chunk_load);
- virtual WW3DErrorType Read_Class_Info (ChunkLoadClass &chunk_load);
-
- //
- // Saving methods
- //
- virtual WW3DErrorType Save_Header (ChunkSaveClass &chunk_save);
- virtual WW3DErrorType Save_Info (ChunkSaveClass &chunk_save);
- virtual WW3DErrorType Save_Subobject (ChunkSaveClass &chunk_save, W3dAggregateSubobjectStruct *psubobject);
- virtual WW3DErrorType Save_Class_Info (ChunkSaveClass &chunk_save);
-
- //
- // Creation methods
- //
- virtual void Attach_Subobjects (RenderObjClass &base_model);
-
- //
- // Search methods
- //
- virtual RenderObjClass * Find_Subobject (RenderObjClass &model, const char mesh_path[MESH_PATH_ENTRIES][MESH_PATH_ENTRY_LEN], const char bone_path[MESH_PATH_ENTRIES][MESH_PATH_ENTRY_LEN]);
-
- //
- // Misc. methods
- //
- virtual void Free_Subobject_List (void);
- virtual void Add_Subobject (const W3dAggregateSubobjectStruct &subobj_info);
- virtual bool Load_Assets (const char *asset_name);
- virtual RenderObjClass *Create_Render_Object (const char *passet_name);
- virtual bool Is_Object_In_List (const char *passet_name, DynamicVectorClass &node_list);
-
- virtual void Build_Subobject_List (RenderObjClass &original_model, RenderObjClass &model);
-
-
- private:
-
- ///////////////////////////////////////////////////////////
- //
- // Private member data
- //
- DWORD m_Version;
- DynamicVectorClass m_SubobjectList;
- W3dAggregateInfoStruct m_Info;
- W3dAggregateMiscInfo m_MiscInfo;
- char * m_pName;
-};
-
-
-///////////////////////////////////////////////////////////////////////////////////
-//
-// AggregatePrototypeClass
-//
-class AggregatePrototypeClass : public W3DMPO, public PrototypeClass
-{
- W3DMPO_GLUE(AggregatePrototypeClass)
- public:
-
- ///////////////////////////////////////////////////////////
- //
- // Public constructors/destructors
- //
- AggregatePrototypeClass (AggregateDefClass *pdef) { m_pDefinition = pdef; }
-
- ///////////////////////////////////////////////////////////
- //
- // Public methods
- //
- virtual const char * Get_Name(void) const { return m_pDefinition->Get_Name (); }
- virtual int Get_Class_ID(void) const { return m_pDefinition->Class_ID (); }
- virtual RenderObjClass * Create (void) { return m_pDefinition->Create (); }
- virtual void DeleteSelf() { delete this; }
- virtual AggregateDefClass * Get_Definition (void) const { return m_pDefinition; }
- virtual void Set_Definition (AggregateDefClass *pdef) { m_pDefinition = pdef; }
-
- protected:
- virtual ~AggregatePrototypeClass (void) { delete m_pDefinition; }
-
- private:
-
- ///////////////////////////////////////////////////////////
- //
- // Private member data
- //
- AggregateDefClass * m_pDefinition;
-};
-
-
-///////////////////////////////////////////////////////////////////////////////////
-//
-// AggregateLoaderClass
-//
-class AggregateLoaderClass : public PrototypeLoaderClass
-{
- public:
-
- virtual int Chunk_Type (void) { return W3D_CHUNK_AGGREGATE; }
- virtual PrototypeClass * Load_W3D (ChunkLoadClass &chunk_load);
-};
-
-
-///////////////////////////////////////////////////////////////////////////////////
-//
-// Global variables
-//
-extern AggregateLoaderClass _AggregateLoader;
-
-
-#endif //__AGGREGATE_DEF_H
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/animatedsoundmgr.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/animatedsoundmgr.cpp
deleted file mode 100644
index 019a755a890..00000000000
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/animatedsoundmgr.cpp
+++ /dev/null
@@ -1,566 +0,0 @@
-/*
-** 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 .
-*/
-
-/***********************************************************************************************
- *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
- ***********************************************************************************************
- * *
- * Project Name : ww3d2 *
- * *
- * $Archive:: /Commando/Code/ww3d2/animatedsoundmgr.cpp $*
- * *
- * Author:: Patrick Smith *
- * *
- * $Modtime:: 12/13/01 6:05p $*
- * *
- * $Revision:: 2 $*
- * *
- *---------------------------------------------------------------------------------------------*
- * Functions: *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-//
-// MBL Update for CNC3 INCURSION - 10.23.2002 - Expanded param handling, Added STOP command
-//
-
-#include // stricmp()
-#include "animatedsoundmgr.h"
-#include "INI.H"
-#include "inisup.h"
-#include "ffactory.h"
-#include "WWFILE.H"
-#include
-#include "definition.h"
-#include "definitionmgr.h"
-#include "definitionclassids.h"
-#include "WWAudio.h"
-#include "AudibleSound.h"
-#include "htree.h"
-#include "hanim.h"
-#include "soundlibrarybridge.h"
-
-#include "wwdebug.h"
-
-//////////////////////////////////////////////////////////////////////
-// Static member initialization
-//////////////////////////////////////////////////////////////////////
-HashTemplateClass AnimatedSoundMgrClass::AnimationNameHash;
-DynamicVectorClass AnimatedSoundMgrClass::AnimSoundLists;
-SoundLibraryBridgeClass* AnimatedSoundMgrClass::SoundLibrary = NULL;
-
-//////////////////////////////////////////////////////////////////////
-// Local inlines
-//////////////////////////////////////////////////////////////////////
-static WWINLINE INIClass *
-Get_INI (const char *filename)
-{
- INIClass *ini = NULL;
-
- //
- // Get the file from our filefactory
- //
- FileClass *file = _TheFileFactory->Get_File (filename);
- if (file) {
-
- //
- // Create the INI object
- //
- if (file->Is_Available ()) {
- ini = new INIClass (*file);
- }
-
- //
- // Close the file
- //
- _TheFileFactory->Return_File (file);
- }
-
- return ini;
-}
-
-static int
-Build_List_From_String
-(
- const char * buffer,
- const char * delimiter,
- StringClass ** string_list
-)
-{
- int count = 0;
-
- WWASSERT (buffer != NULL);
- WWASSERT (delimiter != NULL);
- WWASSERT (string_list != NULL);
- if ((buffer != NULL) &&
- (delimiter != NULL) &&
- (string_list != NULL))
- {
- int delim_len = ::strlen (delimiter);
-
- //
- // Determine how many entries there will be in the list
- //
- const char *entry = buffer;
- for (;
- (entry != NULL) && (entry[1] != 0);
- entry = ::strstr (entry, delimiter))
- {
-
- //
- // Move past the current delimiter (if necessary)
- //
- if ((::strnicmp (entry, delimiter, delim_len) == 0) && (count > 0)) {
- entry += delim_len;
- }
-
- // Increment the count of entries
- count ++;
- }
-
- if (count > 0) {
-
- //
- // Allocate enough StringClass objects to hold all the strings in the list
- //
- (*string_list) = new StringClass[count];
-
- //
- // Parse the string and pull out its entries.
- //
- count = 0;
- for (entry = buffer;
- (entry != NULL) && (entry[1] != 0);
- entry = ::strstr (entry, delimiter))
- {
-
- //
- // Move past the current delimiter (if necessary)
- //
- if ((::strnicmp (entry, delimiter, delim_len) == 0) && (count > 0)) {
- entry += delim_len;
- }
-
- //
- // Copy this entry into its own string
- //
- StringClass entry_string = entry;
- char *delim_start = ::strstr (entry_string.Peek_Buffer(), delimiter);
- if (delim_start != NULL) {
- delim_start[0] = 0;
- }
-
- //
- // Add this entry to our list
- //
- if ((entry_string.Get_Length () > 0) || (count == 0)) {
- (*string_list)[count++] = entry_string;
- }
- }
-
- } else if (delim_len > 0) {
- count = 1;
- (*string_list) = new StringClass[count];
- (*string_list)[0] = buffer;
- }
-
- }
-
- //
- // Return the number of entries in our list
- //
- return count;
-}
-
-
-static bool
-Is_In_Param_List
-(
- StringClass *param_list,
- int param_count,
- const char *param_to_check
-)
-{
- //
- // Check incoming parameters
- //
- WWASSERT( param_list != NULL );
- if ( param_list == NULL )
- {
- return( false );
- }
- WWASSERT( param_count >= 2 );
- if ( param_count < 2 )
- {
- return( false );
- }
- WWASSERT( param_to_check != NULL );
- if ( param_to_check == NULL )
- {
- return( false );
- }
-
- //
- // Note: params 0 & 1 are fixed to frame and name...
- //
- for ( int param_index = 2; param_index < param_count; param_index ++ )
- {
- {
- StringClass string = param_list[ param_index ];
-
- // OutputDebugString( "MBL: Comparing " );
- // OutputDebugString( string.Peek_Buffer() );
- // OutputDebugString( " with " );
- // OutputDebugString( param_to_check );
- // OutputDebugString( "\n" );
-
- // if ( stricmp( string.Peek_Buffer(), param_to_check ) == 0 ) // Breaks with whitespaces
- if ( strstr( string.Peek_Buffer(), param_to_check ) != 0 )
- {
- return( true );
- }
- }
- }
-
- return( false );
-}
-
-//////////////////////////////////////////////////////////////////////
-//
-// Initialize
-//
-//////////////////////////////////////////////////////////////////////
-void
-AnimatedSoundMgrClass::Initialize (const char *ini_filename)
-{
- //
- // Don't re-initialize...
- //
- if (AnimSoundLists.Count () > 0) {
- return ;
- }
-
- const char *DEFAULT_INI_FILENAME = "w3danimsound.ini";
-
- //
- // Determine which filename to use
- //
- const char *filename_to_use = ini_filename;
- if (filename_to_use == NULL) {
- filename_to_use = DEFAULT_INI_FILENAME;
- }
-
- //
- // Get the INI file which contains the data for this viewer
- //
- INIClass *ini_file = ::Get_INI (filename_to_use);
- if (ini_file != NULL) {
-
- //
- // Loop over all the sections in the INI
- //
- List §ion_list = ini_file->Get_Section_List ();
- for ( INISection *section = section_list.First ();
- section != NULL && section->Is_Valid ();
- section = section->Next_Valid ())
- {
- //
- // Get the animation name from the section name
- //
- StringClass animation_name = section->Section;
- ::strupr (animation_name.Peek_Buffer ());
-
- // OutputDebugString( "MBL Section / animation: " );
- // OutputDebugString( animation_name.Peek_Buffer() );
- // OutputDebugString( "\n" );
-
- //
- // Allocate a sound list
- //
- ANIM_SOUND_LIST *sound_list = new ANIM_SOUND_LIST;
-
- //
- // Loop over all the entries in this section
- //
- int entry_count = ini_file->Entry_Count (section->Section);
-
- for (int entry_index = 0; entry_index < entry_count; entry_index ++) {
- StringClass value;
-
- //
- // Get the data associated with this entry
- //
- const char *entry_name = ini_file->Get_Entry (section->Section, entry_index);
-
- // OutputDebugString( " MBL Entry name: " );
- // OutputDebugString( entry_name );
- // OutputDebugString( "\n" );
-
- if (strcmp(entry_name, "BoneName") == 0) {
- ini_file->Get_String (value, section->Section, entry_name);
- sound_list->BoneName = value;
-
- // OutputDebugString( " MBL (BoneName) entry line value: " );
- // OutputDebugString( value.Peek_Buffer() );
- // OutputDebugString( "\n" );
-
- } else {
- ini_file->Get_String (value, section->Section, entry_name);
-
- // OutputDebugString( " MBL (not BoneName) entry line value: " );
- // OutputDebugString( value.Peek_Buffer() );
- // OutputDebugString( "\n" );
-
- //
- // Extract the parameters from the section
- //
- int len = value.Get_Length ();
- StringClass definition_name (len + 1, true);
- int action_frame = 0;
-
- //
- // Separate the parameters into an easy-to-handle data structure
- //
- StringClass *param_list = NULL;
- int param_count = ::Build_List_From_String (value, ",", ¶m_list);
-
- // if ((param_count >= 2) && (param_count <= 3))
- {
- action_frame = ::atoi (param_list[0]);
- definition_name = param_list[1];
- definition_name.Trim ();
-
- //
- // Tie the relevant information together and store it
- // in the list of sounds for this animation
- //
- ANIM_SOUND_INFO* sound_info = new ANIM_SOUND_INFO;
- sound_info->Frame = action_frame;
- sound_info->SoundName = definition_name;
-
- //
- // "2D" check
- //
- // if ((param_count == 3) && (atoi(param_list[2]) == 2)) {
- // sound_info->Is2D = true;
- // }
- //
- sound_info->Is2D = false;
- if ( Is_In_Param_List( param_list, param_count, "2D" ) )
- {
- sound_info->Is2D = true;
- }
-
- //
- // "STOP" check
- //
- sound_info->IsStop = false;
- if ( Is_In_Param_List( param_list, param_count, "STOP" ) )
- {
- sound_info->IsStop = true;
- }
-
- sound_list->Add_Sound_Info (sound_info);
- delete [] param_list;
- }
- }
- }
-
- if (sound_list->List.Count () != 0) {
-
- //
- // Add this sound list to our hash-table and vector-array
- //
- AnimationNameHash.Insert (animation_name, sound_list);
- AnimSoundLists.Add (sound_list);
-
- } else {
- //WWDEBUG_SAY (("AnimatedSoundMgrClass::Initialize -- No sounds added for %d!\n", animation_name.Peek_Buffer ()));
- delete sound_list;
- }
- }
-
- delete ini_file;
- }
-
- return ;
-}
-
-
-//////////////////////////////////////////////////////////////////////
-//
-// Shutdown
-//
-//////////////////////////////////////////////////////////////////////
-void
-AnimatedSoundMgrClass::Shutdown (void)
-{
- //
- // Reset the animation name hash
- //
- AnimationNameHash.Remove_All ();
-
- //
- // Free each of the sound objects
- //
- for (int index = 0; index < AnimSoundLists.Count (); index ++) {
- /*
- ANIM_SOUND_LIST* list = AnimSoundLists[index];
- for (int i = 0; i < list->Count(); i++) {
- delete (*list)[i];
- }
- */
- delete AnimSoundLists[index];
- }
-
- AnimSoundLists.Delete_All ();
- return ;
-}
-
-
-//////////////////////////////////////////////////////////////////////
-//
-// Does_Animation_Have_Embedded_Sounds
-//
-//////////////////////////////////////////////////////////////////////
-const char*
-AnimatedSoundMgrClass::Get_Embedded_Sound_Name (HAnimClass *anim)
-{
- if (anim == NULL) {
- return NULL;
- }
- ANIM_SOUND_LIST* list = Find_Sound_List (anim);
- if (list == NULL) {
- return NULL;
- }
-
- return list->BoneName.Peek_Buffer();
-}
-
-
-
-//////////////////////////////////////////////////////////////////////
-//
-// Find_Sound_List
-//
-//////////////////////////////////////////////////////////////////////
-AnimatedSoundMgrClass::ANIM_SOUND_LIST *
-AnimatedSoundMgrClass::Find_Sound_List (HAnimClass *anim)
-{
- //
- // Build the full name of the animation
- //
- StringClass full_name (0, true);
- full_name = anim->Get_Name ();
-
- //
- // Make the name uppercase
- //
- ::strupr (full_name.Peek_Buffer ());
-
- //
- // Lookup the sound list for this animation
- //
- ANIM_SOUND_LIST *retval = AnimationNameHash.Get (full_name);
- return retval;
-}
-
-
-//////////////////////////////////////////////////////////////////////
-//
-// Trigger_Sound
-//
-//////////////////////////////////////////////////////////////////////
-float
-AnimatedSoundMgrClass::Trigger_Sound
-(
- HAnimClass * anim,
- float old_frame,
- float new_frame,
- const Matrix3D & tm
-)
-{
- if ((SoundLibrary == NULL) || (anim == NULL)) {
- return old_frame;
- }
-
- float retval = old_frame;
-
-#ifndef W3D_MAX4
- //
- // Lookup the sound list for this animation
- //
- ANIM_SOUND_LIST *sound_list = Find_Sound_List (anim);
- if (sound_list != NULL) {
-
- for (int index = 0; index < sound_list->List.Count (); index ++) {
- int frame = sound_list->List[index]->Frame;
-
- //
- // Is the animation passing the frame we need?
- //
- if ((old_frame < frame) && (new_frame >= frame)) {
-
- //
- // Don't trigger the sound if its skipped too far past...
- //
- //if (WWMath::Fabs (new_frame - old_frame) < 3.0F) {
-
- //
- // Stop the audio?
- //
- if (sound_list->List[index]->IsStop == true)
- {
- //
- // Stop the audio
- //
- SoundLibrary->Stop_Playing_Audio( sound_list->List[index]->SoundName.Peek_Buffer() );
- }
- else
- {
- //
- // Play the audio
- //
- if (sound_list->List[index]->Is2D == true)
- {
- SoundLibrary->Play_2D_Audio(sound_list->List[index]->SoundName.Peek_Buffer());
- }
- else
- {
- SoundLibrary->Play_3D_Audio(sound_list->List[index]->SoundName.Peek_Buffer(), tm);
- }
- }
-
- //WWDEBUG_SAY (("Triggering Sound %d %s\n", GetTickCount (), sound_list->List[index]->SoundName));
-
- retval = frame;
-
- //}
- }
-
- }
-
- //retval = true;
- }
-#endif
-
- return retval;
-}
-
-void AnimatedSoundMgrClass::Set_Sound_Library(SoundLibraryBridgeClass* library)
-{
- SoundLibrary = library;
-}
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/animatedsoundmgr.h b/Generals/Code/Libraries/Source/WWVegas/WW3D2/animatedsoundmgr.h
deleted file mode 100644
index 4627227d38e..00000000000
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/animatedsoundmgr.h
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
-** 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 .
-*/
-
-/***********************************************************************************************
- *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
- ***********************************************************************************************
- * *
- * Project Name : ww3d2 *
- * *
- * $Archive:: /Commando/Code/ww3d2/animatedsoundmgr.h $*
- * *
- * Author:: Patrick Smith *
- * *
- * $Modtime:: 12/13/01 6:05p $*
- * *
- * $Revision:: 2 $*
- * *
- *---------------------------------------------------------------------------------------------*
- * Functions: *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-//
-// MBL Update for CNC3 INCURSION - 10.23.2002 - Expanded param handling, Added STOP command
-//
-
-#if defined(_MSC_VER)
-#pragma once
-#endif
-
-#ifndef __ANIMATEDSOUNDMGR_H
-#define __ANIMATEDSOUNDMGR_H
-
-#include "simplevec.h"
-#include "Vector.H"
-#include "hashtemplate.h"
-
-
-//////////////////////////////////////////////////////////////////////
-// Forward declarations
-//////////////////////////////////////////////////////////////////////
-class HTreeClass;
-class HAnimClass;
-class Matrix3D;
-class SoundLibraryBridgeClass;
-
-//////////////////////////////////////////////////////////////////////
-//
-// AnimatedSoundMgrClass
-//
-//////////////////////////////////////////////////////////////////////
-class AnimatedSoundMgrClass
-{
-public:
-
- ///////////////////////////////////////////////////////////////////
- // Public methods
- ///////////////////////////////////////////////////////////////////
-
- //
- // Initialization and shutdown
- //
- static void Initialize (const char *ini_filename = NULL);
- static void Shutdown (void);
-
- //
- // Sound playback
- //
- static const char* Get_Embedded_Sound_Name (HAnimClass *anim);
- static float Trigger_Sound (HAnimClass *anim, float old_frame, float new_frame, const Matrix3D &tm);
-
- // Bridges E&B code with WW3D.
- static void Set_Sound_Library(SoundLibraryBridgeClass* library);
-
-private:
-
- ///////////////////////////////////////////////////////////////////
- // Private data types
- ///////////////////////////////////////////////////////////////////
- struct AnimSoundInfo
- {
- AnimSoundInfo() : Frame(0), SoundName(), Is2D(false), IsStop(false) {}
- int Frame;
- StringClass SoundName;
- bool Is2D;
- bool IsStop;
- };
-
- typedef AnimSoundInfo ANIM_SOUND_INFO;
-
- struct AnimSoundList
- {
- AnimSoundList() : List(), BoneName("root") {}
- ~AnimSoundList()
- {
- for (int i = 0; i < List.Count(); i++) {
- delete List[i];
- }
- }
- void Add_Sound_Info(ANIM_SOUND_INFO* info) {List.Add(info);}
-
- SimpleDynVecClass List;
- StringClass BoneName;
- };
-
- typedef AnimSoundList ANIM_SOUND_LIST;
-
- ///////////////////////////////////////////////////////////////////
- // Private member data
- ///////////////////////////////////////////////////////////////////
- static HashTemplateClass AnimationNameHash;
- static DynamicVectorClass AnimSoundLists;
-
- static SoundLibraryBridgeClass* SoundLibrary;
-
- ///////////////////////////////////////////////////////////////////
- // Private methods
- ///////////////////////////////////////////////////////////////////
- static ANIM_SOUND_LIST * Find_Sound_List (HAnimClass *anim);
-};
-
-
-#endif //__ANIMATEDSOUNDMGR_H
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/bitmaphandler.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/bitmaphandler.cpp
deleted file mode 100644
index f64bc8300e2..00000000000
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/bitmaphandler.cpp
+++ /dev/null
@@ -1,448 +0,0 @@
-/*
-** 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 .
-*/
-
-#include "bitmaphandler.h"
-#include "wwdebug.h"
-#include "colorspace.h"
-
-void Bitmap_Assert(bool condition)
-{
- WWASSERT(condition);
-}
-
-void BitmapHandlerClass::Create_Mipmap_B8G8R8A8(
- unsigned char* dest_surface,
- unsigned dest_surface_pitch,
- unsigned char* src_surface,
- unsigned src_surface_pitch,
- unsigned width,
- unsigned height)
-{
- unsigned src_pitch=src_surface_pitch/4;
- for (unsigned y=0;y1 ) ? 63 : 127;
-
- switch(dest_surface_format) {
- case WW3D_FORMAT_U8V8:
- *dest_ptr++ = (unsigned char)iDu;
- *dest_ptr++ = (unsigned char)iDv;
- break;
-
- case WW3D_FORMAT_L6V5U5:
- *(unsigned short*)dest_ptr = (unsigned short)( ( (iDu>>3) & 0x1f ) << 0 );
- *(unsigned short*)dest_ptr |= (unsigned short)( ( (iDv>>3) & 0x1f ) << 5 );
- *(unsigned short*)dest_ptr |= (unsigned short)( ( ( uL>>2) & 0x3f ) << 10 );
- dest_ptr += 2;
- break;
-
- case WW3D_FORMAT_X8L8V8U8:
- *dest_ptr++ = (unsigned char)iDu;
- *dest_ptr++ = (unsigned char)iDv;
- *dest_ptr++ = (unsigned char)uL;
- *dest_ptr++ = (unsigned char)0L;
- break;
-
- default:
- WWASSERT(0); // Unknown bumpmap format
- break;
- }
-
- // Move one pixel to the left (src is 32-bpp)
- src_ptr_mid+=src_bpp;
- src_ptr_prev_line+=src_bpp;
- src_ptr_next_line+=src_bpp;
- }
- }
- return;
- }
-
- bool has_hsv_shift = hsv_shift[0]!=0.0f || hsv_shift[1]!=0.0f || hsv_shift[2]!=0.0f;
- if (src_surface_format==dest_surface_format && (src_surface_format==WW3D_FORMAT_A8R8G8B8 || src_surface_format==WW3D_FORMAT_X8R8G8B8)) {
- // One-to-one copy or scaling?
- dest_surface_pitch/=4;
- src_surface_pitch/=4;
- if (dest_surface_width==src_surface_width && dest_surface_height==src_surface_height) {
- // Generate the next mip level while copying the current surface?
- if (generate_mip_level) {
- if (dest_surface_width==1) {
- unsigned b8g8r8a8=*(unsigned*)src_surface;
- if (has_hsv_shift) Recolor(b8g8r8a8,hsv_shift);
- *(unsigned*)dest_surface=b8g8r8a8;
- }
- else {
- for (unsigned y=0;y.
-*/
-
-#if defined(_MSC_VER)
-#pragma once
-#endif
-
-#ifndef BITMAPHANDLER_H
-#define BITMAPHANDLER_H
-
-#include "always.h"
-#include "ww3dformat.h"
-#include "vector3.h"
-#include "colorspace.h"
-
-void Bitmap_Assert(bool condition);
-
-class BitmapHandlerClass
-{
-public:
- // Read pixel at given address
- WWINLINE static void Read_B8G8R8A8(
- unsigned char* argb,
- const unsigned char* src_ptr,
- WW3DFormat src_format,
- const unsigned char* palette,
- unsigned palette_bpp);
-
- // Read pixel at given address
- WWINLINE static void Read_B8G8R8A8(
- unsigned& argb,
- const unsigned char* src_ptr,
- WW3DFormat src_format,
- const unsigned char* palette,
- unsigned palette_bpp);
-
- // Read pixel from surface
- WWINLINE static void Read_B8G8R8A8(
- unsigned& argb,
- const unsigned char* src_ptr,
- WW3DFormat src_format,
- int x,
- int y,
- int width,
- int height,
- const unsigned char* palette,
- unsigned palette_bpp);
-
- WWINLINE static void Write_B8G8R8A8(
- unsigned char* dest_ptr,
- WW3DFormat dest_format,
- const unsigned char* argb);
-
- WWINLINE static void Write_B8G8R8A8(
- unsigned char* dest_ptr,
- WW3DFormat dest_format,
- const unsigned& argb);
-
- WWINLINE static void Copy_Pixel(
- unsigned char* dest_ptr,
- WW3DFormat dest_format,
- const unsigned char* src_ptr,
- WW3DFormat src_format,
- const unsigned char* palette,
- unsigned palette_bpp);
-
- WWINLINE static void Copy_Pixel(
- unsigned char* dest_ptr,
- WW3DFormat dest_format,
- const unsigned char* src_ptr,
- WW3DFormat src_format,
- const unsigned char* palette,
- unsigned palette_bpp,
- const Vector3& hsv_shift);
-
- WWINLINE static unsigned Combine_A8R8G8B8(
- unsigned bgra1,
- unsigned bgra2,
- unsigned bgra3,
- unsigned bgra4);
-
- static void Create_Mipmap_B8G8R8A8(
- unsigned char* dest_surface,
- unsigned dest_surface_pitch,
- unsigned char* src_surface,
- unsigned src_surface_pitch,
- unsigned width,
- unsigned height);
-
- static void Copy_Image_Generate_Mipmap(
- unsigned width,
- unsigned height,
- unsigned char* dest_surface,
- unsigned dest_pitch,
- WW3DFormat dest_format,
- unsigned char* src_surface,
- unsigned src_pitch,
- WW3DFormat src_format,
- unsigned char* mip_surface,
- unsigned mip_pitch,
- const Vector3& hsv_shift=Vector3(0.0f,0.0f,0.0f));
-
- static void Copy_Image(
- unsigned char* dest_surface,
- unsigned dest_surface_width,
- unsigned dest_surface_height,
- unsigned dest_surface_pitch,
- WW3DFormat dest_surface_format,
- unsigned char* src_surface,
- unsigned src_surface_width,
- unsigned src_surface_height,
- unsigned src_surface_pitch,
- WW3DFormat src_surface_format,
- const unsigned char* src_palette,
- unsigned src_palette_bpp,
- bool generate_mip_level,
- const Vector3& hsv_shift=Vector3(0.0f,0.0f,0.0f));
-
-};
-
-// ----------------------------------------------------------------------------
-//
-// Read color value of given type in BGRA (D3D) byte order. Regarless
-// of the source format the color value is converted to 32-bit format.
-//
-// ----------------------------------------------------------------------------
-
-WWINLINE void BitmapHandlerClass::Read_B8G8R8A8(
- unsigned char* argb,
- const unsigned char* src_ptr,
- WW3DFormat src_format,
- const unsigned char* palette,
- unsigned palette_bpp)
-{
- switch (src_format) {
- case WW3D_FORMAT_A8R8G8B8:
- case WW3D_FORMAT_X8R8G8B8:
- *(unsigned*)argb=*(unsigned*)src_ptr;
- break;
- case WW3D_FORMAT_R8G8B8:
- *argb++=src_ptr[0];
- *argb++=src_ptr[1];
- *argb++=src_ptr[2];
- *argb++=0xff;
- break;
- case WW3D_FORMAT_A4R4G4B4:
- {
- unsigned short tmp;
- tmp=*(unsigned short*)src_ptr;
- *argb++=((tmp&0x000f)<<4);
- *argb++=((tmp&0x00f0));
- *argb++=((tmp&0x0f00)>>4);
- *argb++=((tmp&0xf000)>>8);
- }
- break;
- case WW3D_FORMAT_A1R5G5B5:
- {
- unsigned short tmp;
- tmp=*(unsigned short*)src_ptr;
- argb[3]=tmp&0x8000 ? 0xff : 0x0;
- argb[2]=(tmp>>7)&0xf8;
- argb[1]=(tmp>>2)&0xf8;
- argb[0]=(tmp<<3)&0xf8;
- }
- break;
- case WW3D_FORMAT_R5G6B5:
- {
- unsigned short tmp;
- tmp=*(unsigned short*)src_ptr;
- argb[3]=0xff;
- argb[2]=(tmp>>8)&0xf8;
- argb[1]=(tmp>>3)&0xfc;
- argb[0]=(tmp<<3)&0xf8;
- }
- break;
- case WW3D_FORMAT_R3G3B2:
- {
- unsigned char tmp=*src_ptr;
- argb[3]=0xff;
- argb[2]=tmp&0xe0;
- argb[1]=(tmp<<3)&0xe0;
- argb[0]=(tmp<<6)&0xc0;
- }
- break;
- case WW3D_FORMAT_L8:
- {
- unsigned char tmp=*src_ptr++;
- *argb++=tmp;
- *argb++=tmp;
- *argb++=tmp;
- *argb++=0xff;
- }
- break;
- case WW3D_FORMAT_A8:
- {
- *argb++=0;
- *argb++=0;
- *argb++=0;
- *argb++=*src_ptr++;
- }
- break;
- case WW3D_FORMAT_P8:
- {
- unsigned char index=*src_ptr++;
- switch (palette_bpp) {
- case 4:
- *argb++=palette[palette_bpp*index+3];
- *argb++=palette[palette_bpp*index+2];
- *argb++=palette[palette_bpp*index+1];
- *argb++=palette[palette_bpp*index+0];
- break;
- case 3:
- *argb++=palette[palette_bpp*index+2];
- *argb++=palette[palette_bpp*index+1];
- *argb++=palette[palette_bpp*index+0];
- *argb++=0xff;
- break;
- case 2:
- case 1:
- default:
- Bitmap_Assert(0);
- break;
- }
- }
- break;
- case WW3D_FORMAT_DXT1:
- case WW3D_FORMAT_DXT2:
- case WW3D_FORMAT_DXT3:
- case WW3D_FORMAT_DXT4:
- case WW3D_FORMAT_DXT5:
- default: Bitmap_Assert(0); break;
- }
-}
-
-WWINLINE void BitmapHandlerClass::Read_B8G8R8A8(
- unsigned& argb,
- const unsigned char* src_ptr,
- WW3DFormat src_format,
- const unsigned char* palette,
- unsigned palette_bpp)
-{
- Read_B8G8R8A8((unsigned char*)&argb,src_ptr,src_format,palette,palette_bpp);
-}
-
-// Read pixel from surface
-WWINLINE void BitmapHandlerClass::Read_B8G8R8A8(
- unsigned& argb,
- const unsigned char* src_ptr,
- WW3DFormat src_format,
- int x,
- int y,
- int width,
- int height,
- const unsigned char* palette,
- unsigned palette_bpp)
-{
- if (x<0 || y<0 || x>=width || y>=height) {
- argb=0;
- return;
- }
-
- unsigned bpp=Get_Bytes_Per_Pixel(src_format);
- Read_B8G8R8A8(
- argb,
- src_ptr+bpp*x+width*bpp*y,
- src_format,
- palette,
- palette_bpp);
-}
-
-
-// ----------------------------------------------------------------------------
-//
-// Write color value of given type in BGRA (D3D) byte order. The source value
-// is always 32 bit and it is converted to defined destination format.
-//
-// ----------------------------------------------------------------------------
-
-WWINLINE void BitmapHandlerClass::Write_B8G8R8A8(
- unsigned char* dest_ptr,
- WW3DFormat dest_format,
- const unsigned char* argb)
-{
- switch (dest_format) {
- case WW3D_FORMAT_A8R8G8B8:
- case WW3D_FORMAT_X8R8G8B8:
- *(unsigned*)dest_ptr=*(unsigned*)argb;
- break;
- case WW3D_FORMAT_R8G8B8:
- *dest_ptr++=*argb++;
- *dest_ptr++=*argb++;
- *dest_ptr++=*argb++;
- break;
- case WW3D_FORMAT_A4R4G4B4:
- {
- unsigned short tmp;
- tmp=((argb[3])&0xf0)<<8;
- tmp|=((argb[2])&0xf0)<<4;
- tmp|=((argb[1])&0xf0);
- tmp|=((argb[0])&0xf0)>>4;
- *(unsigned short*)dest_ptr=tmp;
- }
- break;
- case WW3D_FORMAT_A1R5G5B5:
- {
- unsigned short tmp;
- tmp=argb[3] ? 0x8000 : 0x0;
- tmp|=((argb[2])&0xf8)<<7;
- tmp|=((argb[1])&0xf8)<<2;
- tmp|=((argb[0])&0xf8)>>3;
- *(unsigned short*)dest_ptr=tmp;
- }
- break;
- case WW3D_FORMAT_R5G6B5:
- {
- unsigned short tmp;
- tmp=((argb[2])&0xf8)<<8;
- tmp|=((argb[1])&0xfc)<<3;
- tmp|=((argb[0])&0xf8)>>3;
- *(unsigned short*)dest_ptr=tmp;
- }
- break;
- case WW3D_FORMAT_R3G3B2:
- {
- unsigned char tmp;
- tmp=((argb[2])&0xe0);
- tmp|=((argb[1])&0xe0)>>3;
- tmp|=((argb[0])&0xc0)>>6;
- *(unsigned short*)dest_ptr=tmp;
- }
- break;
- case WW3D_FORMAT_L8:
- {
- // CIE Req. 709: Y709 = 0.2125R + 0.7154G + 0.0721B
- unsigned char tmp = (unsigned char) ( (
- ((unsigned int)argb[0] * (unsigned int)0x1275) + // 0.0721B
- ((unsigned int)argb[1] * (unsigned int)0xB725) + // 0.7154G (rounded up so FF, FF, FF becomes FF)
- ((unsigned int)argb[2] * (unsigned int)0x3666) // 0.2125R
- ) >> 16);
- *dest_ptr++=tmp;
- }
- break;
- case WW3D_FORMAT_A8:
- {
- *dest_ptr++=*argb++;
- }
- break;
- case WW3D_FORMAT_DXT1:
- case WW3D_FORMAT_DXT2:
- case WW3D_FORMAT_DXT3:
- case WW3D_FORMAT_DXT4:
- case WW3D_FORMAT_DXT5:
- case WW3D_FORMAT_P8: // Paletted destination not supported
- default: Bitmap_Assert(0); break;
- }
-}
-
-WWINLINE void BitmapHandlerClass::Write_B8G8R8A8(
- unsigned char* dest_ptr,
- WW3DFormat dest_format,
- const unsigned& argb)
-{
- Write_B8G8R8A8(dest_ptr,dest_format,(unsigned char*)&argb);
-}
-
-// ----------------------------------------------------------------------------
-//
-// Copy pixel. Perform color space conversion if needed. The source and
-// destination are always D3D-style BGRA.
-//
-// ----------------------------------------------------------------------------
-
-WWINLINE void BitmapHandlerClass::Copy_Pixel(
- unsigned char* dest_ptr,
- WW3DFormat dest_format,
- const unsigned char* src_ptr,
- WW3DFormat src_format,
- const unsigned char* palette,
- unsigned palette_bpp)
-{
- // Color space conversion needed?
-
- if (dest_format==src_format) {
- switch (dest_format) {
- case WW3D_FORMAT_A8R8G8B8:
- case WW3D_FORMAT_X8R8G8B8:
- *(unsigned*)dest_ptr=*(unsigned*)src_ptr;
- break;
- case WW3D_FORMAT_R8G8B8:
- *dest_ptr++=src_ptr[0];
- *dest_ptr++=src_ptr[1];
- *dest_ptr++=src_ptr[2];
- break;
- case WW3D_FORMAT_A4R4G4B4:
- {
- unsigned short tmp=*(unsigned short*)src_ptr;
- *(unsigned short*)dest_ptr=((tmp&0x000f)<<12)|((tmp&0x00f0)<<4)|((tmp&0x0f00)>>4)|((tmp&0xf000)>>12);
- }
- break;
- case WW3D_FORMAT_A1R5G5B5:
- {
- unsigned short tmp=*(unsigned short*)src_ptr;
- *(unsigned short*)dest_ptr=((tmp&0x001f)<<11)|((tmp&0x03e0)<<1)|((tmp&0x7c00)>>9)|((tmp&0x8000)>>15);
- }
- break;
- case WW3D_FORMAT_R5G6B5:
- {
- unsigned short tmp=*(unsigned short*)src_ptr;
- *(unsigned short*)dest_ptr=((tmp&0x001f)<<11)|(tmp&0x07e0)|((tmp&0xf800)>>11);
- }
- break;
- case WW3D_FORMAT_R3G3B2:
- case WW3D_FORMAT_L8:
- case WW3D_FORMAT_A8: *dest_ptr++=*src_ptr++;
- break;
- case WW3D_FORMAT_P8: // Paletted destinations not supported
- default: Bitmap_Assert(0); break;
- }
- }
- else {
- unsigned b8g8r8a8;
- Read_B8G8R8A8(b8g8r8a8,src_ptr,src_format,palette,palette_bpp);
- Write_B8G8R8A8(dest_ptr,dest_format,b8g8r8a8);
- }
-}
-
-// ----------------------------------------------------------------------------
-//
-// Copy pixel with HSV shift. The source and destination are always D3D-style BGRA.
-//
-// ----------------------------------------------------------------------------
-
-WWINLINE void BitmapHandlerClass::Copy_Pixel(
- unsigned char* dest_ptr,
- WW3DFormat dest_format,
- const unsigned char* src_ptr,
- WW3DFormat src_format,
- const unsigned char* palette,
- unsigned palette_bpp,
- const Vector3& hsv_shift)
-{
- unsigned b8g8r8a8;
- Read_B8G8R8A8(b8g8r8a8,src_ptr,src_format,palette,palette_bpp);
- Recolor(b8g8r8a8,hsv_shift);
- Write_B8G8R8A8(dest_ptr,dest_format,b8g8r8a8);
-}
-
-WWINLINE unsigned BitmapHandlerClass::Combine_A8R8G8B8(
- unsigned bgra1,
- unsigned bgra2,
- unsigned bgra3,
- unsigned bgra4)
-{
- bgra1&=0xfcfcfcfc;
- bgra2&=0xfcfcfcfc;
- bgra3&=0xfcfcfcfc;
- bgra4&=0xfcfcfcfc;
- bgra1>>=2;
- bgra2>>=2;
- bgra3>>=2;
- bgra4>>=2;
- bgra1+=bgra2;
- bgra3+=bgra4;
- bgra1+=bgra3;
- return bgra1;
-}
-
-
-#endif
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/bwrender.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/bwrender.cpp
deleted file mode 100644
index 75fcf1ffe02..00000000000
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/bwrender.cpp
+++ /dev/null
@@ -1,242 +0,0 @@
-/*
-** 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 .
-*/
-
-/***********************************************************************************************
- *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
- ***********************************************************************************************
- * *
- * Project Name : ww3d2 *
- * *
- * $Archive:: /Commando/Code/ww3d2/bwrender.cpp $*
- * *
- * Original Author:: Jani Penttinen *
- * *
- * $Author:: Greg_h $*
- * *
- * $Modtime:: 4/04/01 10:14a $*
- * *
- * $Revision:: 2 $*
- * *
- *---------------------------------------------------------------------------------------------*
- * Functions: *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-
-#include "bwrender.h"
-#include "vp.h"
-#include
-
-
-BWRenderClass::Buffer::Buffer(unsigned char* buffer_, int scale_)
- :
- buffer(buffer_),
- scale(scale_),
- minv(3),
- maxv(scale_-3)
-{
-}
-
-BWRenderClass::Buffer::~Buffer()
-{
-}
-
-void BWRenderClass::Buffer::Set_H_Line(int start_x, int end_x, int y)
-{
- if (y=maxv || end_x=maxv) return;
- if (start_x=maxv) end_x=maxv-1;
- unsigned char* ptr=buffer+scale*y+start_x;
- int w=end_x-start_x;
- if (w) {
- ::memset(ptr,0x00,w);
-
-/* // Blurring (test)
- *(ptr-1)&=0x80;
- *(ptr-2)&=0xc0;
- *(ptr+w)&=0x80;
- *(ptr+w+1)&=0xc0;
- for (int a=0;a(vertices),
- half_scale,
- half_scale,
- count*2);
-}
-
-// --------------------------------------------------------------------
-
-static inline bool Cull(
- const Vector2& c1,
- const Vector2& c2,
- const Vector2& c3)
-{
- float x1=c2[0]-c1[0];
- float y1=c2[1]-c1[1];
- float x2=c3[0]-c1[0];
- float y2=c3[1]-c1[1];
- float r=x1*y2-x2*y1;
- if (r<0) return false;
- return true;
-}
-
-void BWRenderClass::Render_Triangle_Strip(const unsigned long* indices,int index_count)
-{
- index_count-=2;
- bool b=false;
- for (int n=0;nx_step_2) {
- float t=x_step_1;
- x_step_1=x_step_2;
- x_step_2=t;
- }
-
- while (ycnt>0) {
- pixel_buffer.Set_H_Line(WWMath::Float_To_Long(x_left),WWMath::Float_To_Long(x_right),y);
-
- x_left+=x_step_1;
- x_right+=x_step_2;
- ycnt--;
- y++;
- }
- }
- else {
- if (xcf[0]0) {
- pixel_buffer.Set_H_Line(WWMath::Float_To_Long(x_left),WWMath::Float_To_Long(x_right),y);
- x_left+=x_step_1;
- x_right+=x_step_2;
- ycnt--;
- y++;
- }
- }
-
-}
-
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/bwrender.h b/Generals/Code/Libraries/Source/WWVegas/WW3D2/bwrender.h
deleted file mode 100644
index a281b7c7f10..00000000000
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/bwrender.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
-** 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 .
-*/
-
-/***********************************************************************************************
- *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
- ***********************************************************************************************
- * *
- * Project Name : ww3d2 *
- * *
- * $Archive:: /Commando/Code/ww3d2/bwrender.h $*
- * *
- * Original Author:: Jani Penttinen *
- * *
- * $Author:: Greg_h $*
- * *
- * $Modtime:: 4/04/01 10:36a $*
- * *
- * $Revision:: 2 $*
- * *
- *---------------------------------------------------------------------------------------------*
- * Functions: *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-#if defined(_MSC_VER)
-#pragma once
-#endif
-
-#ifndef BWRENDER_H
-#define BWRENDER_H
-
-
-#include "always.h"
-#include "vector2.h"
-#include "vector3.h"
-#include "Vector3i.h"
-
-/**
-** BWRenderClass
-** This class implements a simple black-and-white triangle rasterizer which
-** can be used to generate shadow textures. It is faster than a general purpose
-** software renderer due to the fact that no z-buffering or sorting is needed and
-** texturing isn't supported.
-** (gth) 04/02/2001 - I'm going to add render-to-texture code to Renegade so this
-** class may be obsolete.
-*/
-class BWRenderClass
-{
- // Internal pixel buffer used by the triangle renderer
- // The buffer is not allocated or freed by this class.
- class Buffer
- {
- unsigned char* buffer;
- int scale;
- int minv;
- int maxv;
- public:
- Buffer(unsigned char* buffer, int scale);
- ~Buffer();
-
- void Set_H_Line(int start_x, int end_x, int y);
- void Fill(unsigned char c);
- inline int Scale() const { return scale; }
- } pixel_buffer;
-
- Vector2* vertices;
-
- void Render_Preprocessed_Triangle(Vector3& xcf,Vector3i& yci);
-
-public:
- BWRenderClass(unsigned char* buffer, int scale);
- ~BWRenderClass();
-
- void Fill(unsigned char c);
- void Set_Vertex_Locations(Vector2* vertices,int count); // Warning! Contents are modified!
- void Render_Triangles(const unsigned long* indices,int index_count);
- void Render_Triangle_Strip(const unsigned long* indices,int index_count);
-};
-
-
-#endif //BWRENDER_H
-
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/classid.h b/Generals/Code/Libraries/Source/WWVegas/WW3D2/classid.h
deleted file mode 100644
index 11e87ddcd42..00000000000
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/classid.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
-** 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 .
-*/
-
-/***************************************************************************
- *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
- ***************************************************************************
- * *
- * Project Name : Commando *
- * *
- * $Archive:: /Commando/Code/ww3d2/classid.h $*
- * *
- * $Author:: Jani_p $*
- * *
- * $Modtime:: 3/29/01 1:13a $*
- * *
- * $Revision:: 2 $*
- * *
- *-------------------------------------------------------------------------*/
-
-
-#if defined(_MSC_VER)
-#pragma once
-#endif
-
-#ifndef CLASSID_H
-#define CLASSID_H
-
-#include "always.h"
-
-/*
-** enum of all the WW3D class IDs.
-*/
-enum
-{
- ID_INDIRECT_TEXTURE_CLASS = 0x10000, // IndirectTextureClass "texture.h"
- ID_VARIABLE_TEXTURE_CLASS, // VariableTextureClass "texture.h"
- ID_FILE_LIST_TEXTURE_CLASS, // FileListTextureClass "texture.h"
- ID_RESIZEABLE_TEXTURE_INSTANCE_CLASS, // ResizeableTextureInstanceClass "texture.h"
- ID_ANIM_TEXTURE_INSTANCE_CLASS, // AnimTextureInstanceClass "texture.h"
- ID_MANUAL_ANIM_TEXTURE_INSTANCE_CLASS, // ManualAnimTextureInstanceClass "texture.h"
- ID_TIME_ANIM_TEXTURE_INSTANCE_CLASS, // TimeAnimTextureInstanceClass "texture.h"
- ID_POINT_GROUP_CLASS, // PointGroupClass "pointgr.h"
- ID_MESH_MODEL_CLASS, // MeshModelClass "mesh.cpp"
- ID_CACHED_TEXTURE_FILE_CLASS, // CachedTextureFileClass "assetmgr.cpp"
- ID_STREAMING_TEXTURE_CLASS, // StreamingTextureClass "texture.h"
- ID_STREAMING_TEXTURE_INSTANCE_CLASS, // StreamingTextureInstanceClass "texture.h"
-};
-
-
-#endif
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/collect.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/collect.cpp
deleted file mode 100644
index 619fcb371ac..00000000000
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/collect.cpp
+++ /dev/null
@@ -1,1109 +0,0 @@
-/*
-** 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 .
-*/
-
-/***********************************************************************************************
- *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
- ***********************************************************************************************
- * *
- * Project Name : WW3D *
- * *
- * $Archive:: /Commando/Code/ww3d2/collect.cpp $*
- * *
- * Author:: Greg Hjelstrom *
- * *
- * $Modtime:: 1/08/01 10:04a $*
- * *
- * $Revision:: 1 $*
- * *
- *---------------------------------------------------------------------------------------------*
- * Functions: *
- * CollectionClass::CollectionClass -- default constructor for collection render object *
- * CollectionClass::CollectionClass -- constructor for collection render object *
- * CollectionClass::CollectionClass -- copy constructor *
- * CollectionClass::CollectionClass -- assignment operator *
- * CollectionClass::~CollectionClass -- destructor *
- * CollectionClass::Clone -- virtual copy constructor *
- * CollectionClass::Free -- releases all assets in use by this collection *
- * CollectionClass::Class_ID -- returns class id for collection render objects *
- * CollectionClass::Get_Num_Polys -- returns the number of polygons in this collection *
- * CollectionClass::Render -- render this collection *
- * CollectionClass::Special_Render -- passes the special render call to all sub-objects *
- * CollectionClass::Set_Transform -- set the transform for this collection *
- * CollectionClass::Set_Position -- set the position for this collection *
- * CollectionClass::Get_Num_Sub_Objects -- returns the number of sub objects *
- * CollectionClass::Get_Sub_Object -- returns a pointer to the desired sub object *
- * CollectionClass::Add_Sub_Object -- adds another object into this collection *
- * CollectionClass::Remove_Sub_Object -- removes a sub object from this collection *
- * CollectionClass::Cast_Ray -- passes the ray test to each sub object *
- * CollectionClass::Cast_AABox -- passes the axis-aligned box test to each sub object *
- * CollectionClass::Cast_OBBox -- passes the oriented box test to each sub object *
- * CollectionClass::Intersect_AABox -- test for intersection with an AABox *
- * CollectionClass::Intersect_OBBox -- test for intersection with an OBBox *
- * CollectionClass::Get_Obj_Space_Bounding_Sphere -- returns the object space bounding spher *
- * CollectionClass::Get_Obj_Space_Bounding_Box -- returns the object-space bounding box *
- * CollectionClass::Snap_Point_Count -- returns the number of snap points in this collecion *
- * CollectionClass::Get_Snap_Point -- return the desired snap point *
- * CollectionClass::Scale -- scale the objects in this collection *
- * CollectionClass::Scale -- scale the objects in this collection *
- * CollectionClass::Update_Obj_Space_Bounding_Volumes -- recomputes the object space boundin *
- * CollectionClass::Update_Sub_Object_Transforms -- recomputes all sub object transforms *
- * CollectionLoaderClass::Load -- reads a collection from a w3d file *
- * CollectionDefClass::CollectionDefClass -- constructor *
- * CollectionDefClass::~CollectionDefClass -- destructor for collection definition *
- * CollectionDefClass::Free -- releases assets in use by a collection definition *
- * CollectionDefClass::Get_Name -- returns name of the collection *
- * CollectionDefClass::Load -- loads a collection definition from a w3d file *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-
-#include "collect.h"
-#include "chunkio.h"
-#include "camera.h"
-#include "wwdebug.h"
-#include "snapPts.h"
-#include "assetmgr.h"
-#include "ww3d.h"
-#include "w3derr.h"
-//#include "sr.hpp"
-
-
-CollectionLoaderClass _CollectionLoader;
-
-/*
-** CollectionDefClass. This is the "blueprint" for a collection object
-** The asset manager will store these until someone actually asks it to
-** create an instance of the collection object
-*/
-class CollectionDefClass
-{
-public:
-
- CollectionDefClass(void);
- ~CollectionDefClass(void);
-
- const char * Get_Name(void) const;
- WW3DErrorType Load(ChunkLoadClass & cload);
-
-protected:
-
- void Free(void);
-
- char Name[W3D_NAME_LEN];
- DynamicVectorClass ObjectNames;
- SnapPointsClass * SnapPoints;
-
- DynamicVectorClass ProxyList;
-
- friend class CollectionClass;
-};
-
-
-/*
-** CollectionPrototypeClass this is the render object prototype for
-** Collections.
-*/
-class CollectionPrototypeClass : public W3DMPO, public PrototypeClass
-{
- W3DMPO_GLUE(CollectionPrototypeClass)
-public:
- CollectionPrototypeClass(CollectionDefClass * def) { ColDef = def; WWASSERT(ColDef); }
-
- virtual const char * Get_Name(void) const { return ColDef->Get_Name(); }
- virtual int Get_Class_ID(void) const { return RenderObjClass::CLASSID_COLLECTION; }
- virtual RenderObjClass * Create(void) { return NEW_REF( CollectionClass, (*ColDef)); }
- virtual void DeleteSelf() { delete this; }
-
- CollectionDefClass * ColDef;
-
-protected:
- virtual ~CollectionPrototypeClass(void) { delete ColDef; }
-};
-
-
-/***********************************************************************************************
- * CollectionClass::CollectionClass -- default constructor for collection render object *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 23/8/00 GTH : Created. *
- *=============================================================================================*/
-CollectionClass::CollectionClass(void) :
- SnapPoints(NULL)
-{
- Update_Obj_Space_Bounding_Volumes();
-}
-
-
-/***********************************************************************************************
- * CollectionClass::CollectionClass -- constructor for collection render object *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 12/8/98 GTH : Created. *
- *=============================================================================================*/
-CollectionClass::CollectionClass(const CollectionDefClass & def) :
- SubObjects(def.ObjectNames.Count()),
- SnapPoints(NULL)
-{
- // Set our name
- Set_Name (def.Get_Name ());
-
- // create the sub objects
- SubObjects.Resize(def.ObjectNames.Count());
- for (int i=0; iCreate_Render_Obj(def.ObjectNames[i]));
- SubObjects[i]->Set_Container(this);
- }
-
- // Copy the list of placeholder objects from the definition
- ProxyList = def.ProxyList;
-
- // grab ahold of the snap points.
- SnapPoints = def.SnapPoints;
- if (SnapPoints) SnapPoints->Add_Ref();
-
- // set up our collision typeas the union of all of our sub-objects
- Update_Sub_Object_Bits();
-
- // update the object bounding volumes
- Update_Obj_Space_Bounding_Volumes();
-}
-
-
-/***********************************************************************************************
- * CollectionClass::CollectionClass -- copy constructor *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 12/8/98 GTH : Created. *
- *=============================================================================================*/
-CollectionClass::CollectionClass(const CollectionClass & src) :
- CompositeRenderObjClass(src),
- SubObjects(src.SubObjects.Count()),
- SnapPoints(NULL)
-{
- *this = src;
-}
-
-
-/***********************************************************************************************
- * CollectionClass::CollectionClass -- assignment operator *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 12/8/98 GTH : Created. *
- *=============================================================================================*/
-CollectionClass & CollectionClass::operator = (const CollectionClass & that)
-{
- if (this != &that) {
- Free();
- CompositeRenderObjClass::operator = (that);
-
- SubObjects.Resize(that.SubObjects.Count());
- for (int i=0; iClone());
- SubObjects[i]->Set_Container(this);
- }
-
- // Copy the list of placeholder objects from the definition
- ProxyList = that.ProxyList;
-
- SnapPoints = that.SnapPoints;
- if (SnapPoints) SnapPoints->Add_Ref();
-
- Update_Sub_Object_Bits();
- Update_Obj_Space_Bounding_Volumes();
- }
- return * this;
-}
-
-
-/***********************************************************************************************
- * CollectionClass::~CollectionClass -- destructor *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 12/8/98 GTH : Created. *
- *=============================================================================================*/
-CollectionClass::~CollectionClass(void)
-{
- Free();
-}
-
-
-/***********************************************************************************************
- * CollectionClass::Clone -- virtual copy constructor *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 12/8/98 GTH : Created. *
- *=============================================================================================*/
-RenderObjClass * CollectionClass::Clone(void) const
-{
- return NEW_REF( CollectionClass, (*this));
-}
-
-
-/***********************************************************************************************
- * CollectionClass::Free -- releases all assets in use by this collection *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 12/8/98 GTH : Created. *
- *=============================================================================================*/
-void CollectionClass::Free(void)
-{
- for (int i=0; iSet_Container(NULL);
- SubObjects[i]->Release_Ref();
- SubObjects[i] = NULL;
- }
- SubObjects.Delete_All();
- ProxyList.Delete_All ();
-
- REF_PTR_RELEASE(SnapPoints);
-}
-
-
-/***********************************************************************************************
- * CollectionClass::Class_ID -- returns class id for collection render objects *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 12/8/98 GTH : Created. *
- *=============================================================================================*/
-int CollectionClass::Class_ID(void) const
-{
- return RenderObjClass::CLASSID_COLLECTION;
-}
-
-
-/***********************************************************************************************
- * CollectionClass::Get_Num_Polys -- returns the number of polygons in this collection *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 12/8/98 GTH : Created. *
- *=============================================================================================*/
-int CollectionClass::Get_Num_Polys(void) const
-{
- int pcount = 0;
- for (int i=0; iGet_Num_Polys();
- }
- return pcount;
-}
-
-
-/***********************************************************************************************
- * CollectionClass::Render -- render this collection *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 12/8/98 GTH : Created. *
- *=============================================================================================*/
-void CollectionClass::Render(RenderInfoClass & rinfo)
-{
- if (Is_Not_Hidden_At_All() == false) {
- return;
- }
-
- if (Are_Sub_Object_Transforms_Dirty()) {
- Update_Sub_Object_Transforms();
- }
-
- for (int i=0; iRender(rinfo);
- }
-}
-
-
-/***********************************************************************************************
- * CollectionClass::Special_Render -- passes the special render call to all sub-objects *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 3/2/99 GTH : Created. *
- *=============================================================================================*/
-void CollectionClass::Special_Render(SpecialRenderInfoClass & rinfo)
-{
- if (Is_Not_Hidden_At_All() == false) {
- return;
- }
-
- if (Are_Sub_Object_Transforms_Dirty()) {
- Update_Sub_Object_Transforms();
- }
-
- for (int i=0; iSpecial_Render(rinfo);
- }
-}
-
-/***********************************************************************************************
- * CollectionClass::Set_Transform -- set the transform for this collection *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 12/8/98 GTH : Created. *
- *=============================================================================================*/
-void CollectionClass::Set_Transform(const Matrix3D &m)
-{
- RenderObjClass::Set_Transform(m);
- Set_Sub_Object_Transforms_Dirty(true);
-}
-
-
-/***********************************************************************************************
- * CollectionClass::Set_Position -- set the position for this collection *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 12/8/98 GTH : Created. *
- *=============================================================================================*/
-void CollectionClass::Set_Position(const Vector3 &v)
-{
- RenderObjClass::Set_Position(v);
- Set_Sub_Object_Transforms_Dirty(true);
-}
-
-
-/***********************************************************************************************
- * CollectionClass::Get_Num_Sub_Objects -- returns the number of sub objects *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 12/8/98 GTH : Created. *
- *=============================================================================================*/
-int CollectionClass::Get_Num_Sub_Objects(void) const
-{
- return SubObjects.Count();
-}
-
-
-/***********************************************************************************************
- * CollectionClass::Get_Sub_Object -- returns a pointer to the desired sub object *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 12/8/98 GTH : Created. *
- *=============================================================================================*/
-RenderObjClass * CollectionClass::Get_Sub_Object(int index) const
-{
- if (SubObjects[index]) {
- SubObjects[index]->Add_Ref();
- }
- return SubObjects[index];
-}
-
-
-/***********************************************************************************************
- * CollectionClass::Add_Sub_Object -- adds another object into this collection *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 12/8/98 GTH : Created. *
- *=============================================================================================*/
-int CollectionClass::Add_Sub_Object(RenderObjClass * subobj)
-{
- WWASSERT(subobj);
- subobj->Add_Ref();
- subobj->Set_Container(this);
- subobj->Set_Transform(Transform);
- int res = SubObjects.Add(subobj);
- Update_Sub_Object_Bits();
- Update_Obj_Space_Bounding_Volumes();
- if (Is_In_Scene()) {
- subobj->Notify_Added(Scene);
- }
- return res;
-}
-
-
-/***********************************************************************************************
- * CollectionClass::Remove_Sub_Object -- removes a sub object from this collection *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 12/8/98 GTH : Created. *
- *=============================================================================================*/
-int CollectionClass::Remove_Sub_Object(RenderObjClass * robj)
-{
- if (robj == NULL) return 0;
-
- int res = 0;
-
- Matrix3D tm = Get_Transform();
-
- for (int i=0; iNotify_Removed(Scene);
- }
- SubObjects[i]->Set_Container(NULL);
- SubObjects[i]->Set_Transform(tm);
- SubObjects[i]->Release_Ref();
- res = SubObjects.Delete(i);
- break;
- }
- }
-
- if (res != 0) {
- Update_Sub_Object_Bits();
- Update_Obj_Space_Bounding_Volumes();
- }
-
- return res;
-}
-
-
-/***********************************************************************************************
- * CollectionClass::Cast_Ray -- passes the ray test to each sub object *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 12/8/98 GTH : Created. *
- *=============================================================================================*/
-bool CollectionClass::Cast_Ray(RayCollisionTestClass & raytest)
-{
- bool res = false;
- for (int i=0; iCast_Ray(raytest);
- }
- return res;
-}
-
-
-/***********************************************************************************************
- * CollectionClass::Cast_AABox -- passes the axis-aligned box test to each sub object *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 12/8/98 GTH : Created. *
- *=============================================================================================*/
-bool CollectionClass::Cast_AABox(AABoxCollisionTestClass & boxtest)
-{
- bool res = false;
- for (int i=0; iCast_AABox(boxtest);
- }
- return res;
-}
-
-
-/***********************************************************************************************
- * CollectionClass::Cast_OBBox -- passes the oriented box test to each sub object *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 12/8/98 GTH : Created. *
- *=============================================================================================*/
-bool CollectionClass::Cast_OBBox(OBBoxCollisionTestClass & boxtest)
-{
- bool res = false;
- for (int i=0; iCast_OBBox(boxtest);
- }
- return res;
-}
-
-
-/***********************************************************************************************
- * CollectionClass::Intersect_AABox -- test for intersection with an AABox *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 1/19/00 gth : Created. *
- *=============================================================================================*/
-bool CollectionClass::Intersect_AABox(AABoxIntersectionTestClass & boxtest)
-{
- bool res = false;
- for (int i=0; iIntersect_AABox(boxtest);
- }
- return res;
-}
-
-
-/***********************************************************************************************
- * CollectionClass::Intersect_OBBox -- test for intersection with an OBBox *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 1/19/00 gth : Created. *
- *=============================================================================================*/
-bool CollectionClass::Intersect_OBBox(OBBoxIntersectionTestClass & boxtest)
-{
- bool res = false;
- for (int i=0; iIntersect_OBBox(boxtest);
- }
- return res;
-}
-
-/***********************************************************************************************
- * CollectionClass::Get_Obj_Space_Bounding_Sphere -- returns the object space bounding sphere. *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 12/8/98 GTH : Created. *
- *=============================================================================================*/
-void CollectionClass::Get_Obj_Space_Bounding_Sphere(SphereClass & sphere) const
-{
- sphere = BoundSphere;
-}
-
-
-/***********************************************************************************************
- * CollectionClass::Get_Obj_Space_Bounding_Box -- returns the object-space bounding box *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 12/8/98 GTH : Created. *
- *=============================================================================================*/
-void CollectionClass::Get_Obj_Space_Bounding_Box(AABoxClass & box) const
-{
- box = BoundBox;
-}
-
-
-/***********************************************************************************************
- * CollectionClass::Snap_Point_Count -- returns the number of snap points in this collecion *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 12/8/98 GTH : Created. *
- *=============================================================================================*/
-int CollectionClass::Snap_Point_Count(void)
-{
- if (SnapPoints) {
- return SnapPoints->Count();
- } else {
- return 0;
- }
-}
-
-
-/***********************************************************************************************
- * CollectionClass::Get_Snap_Point -- return the desired snap point *
- * *
- * This function will set the passed vector to be equal to the object space coordinates of *
- * the desired snap point. *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 12/8/98 GTH : Created. *
- *=============================================================================================*/
-void CollectionClass::Get_Snap_Point(int index,Vector3 * set)
-{
- WWASSERT(set != NULL);
- if (SnapPoints) {
- *set = (*SnapPoints)[index];
- } else {
- set->X = set->Y = set->Z = 0;
- }
-}
-
-
-/***********************************************************************************************
- * CollectionClass::Scale -- scale the objects in this collection *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 12/8/98 GTH : Created. *
- *=============================================================================================*/
-void CollectionClass::Scale(float scale)
-{
- for (int i=0; iScale(scale);
- }
-}
-
-
-/***********************************************************************************************
- * CollectionClass::Scale -- scale the objects in this collection *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 12/8/98 GTH : Created. *
- *=============================================================================================*/
-void CollectionClass::Scale(float scalex, float scaley, float scalez)
-{
- for (int i=0; iScale(scalex,scaley,scalez);
- }
-}
-
-
-/***********************************************************************************************
- * CollectionClass::Update_Obj_Space_Bounding_Volumes -- recomputes the object space bounding *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 12/8/98 GTH : Created. *
- *=============================================================================================*/
-void CollectionClass::Update_Obj_Space_Bounding_Volumes(void)
-{
- int i;
- if (SubObjects.Count() <= 0) {
- BoundSphere = SphereClass(Vector3(0,0,0),0);
- BoundBox.Center.Set(0,0,0);
- BoundBox.Extent.Set(0,0,0);
- return;
- }
-
- Matrix3D tm = Get_Transform();
- Set_Transform(Matrix3D(1));
-
- // loop through all sub-objects, combining their bounding spheres.
- BoundSphere = SubObjects[0]->Get_Bounding_Sphere();
- for (i=1; i < SubObjects.Count(); i++) {
- BoundSphere.Add_Sphere(SubObjects[i]->Get_Bounding_Sphere());
- }
-
- // loop through the sub-objects, computing a box in the root coordinate
- // system which bounds all of the meshes. Note that we've set the
- // root coordinate system to identity for this.
- MinMaxAABoxClass box(Vector3(FLT_MAX,FLT_MAX,FLT_MAX),Vector3(-FLT_MAX,-FLT_MAX,-FLT_MAX));
-
- for (i=0; i < SubObjects.Count(); i++) {
- box.Add_Box(SubObjects[i]->Get_Bounding_Box());
- }
-
- BoundBox.Init(box);
-
- Invalidate_Cached_Bounding_Volumes();
-
- // Now update the object space bounding volumes of this object's container:
- RenderObjClass *container = Get_Container();
- if (container) container->Update_Obj_Space_Bounding_Volumes();
-
- Set_Transform(tm);
-}
-
-
-/***********************************************************************************************
- * CollectionClass::Update_Sub_Object_Transforms -- recomputes all sub object transforms *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 12/8/98 GTH : Created. *
- *=============================================================================================*/
-void CollectionClass::Update_Sub_Object_Transforms(void)
-{
- RenderObjClass::Update_Sub_Object_Transforms();
- for (int i=0; iSet_Transform(Transform);
- SubObjects[i]->Update_Sub_Object_Transforms();
- }
- Set_Sub_Object_Transforms_Dirty(false);
-}
-
-
-/***********************************************************************************************
- * CollectionClass::Get_Placeholder -- Returns information about a placeholder object.
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 4/28/99 PDS : Created. *
- *=============================================================================================*/
-bool CollectionClass::Get_Proxy (int index, ProxyClass &proxy) const
-{
- bool retval = false;
-
- if (index >= 0 && index < ProxyList.Count ()) {
-
- //
- // Return the proxy information to the caller
- //
- proxy = ProxyList[index];
- retval = true;
- }
-
- return retval;
-}
-
-
-/***********************************************************************************************
- * CollectionClass::Get_Proxy_Count -- Returns the count of proxy objects in the collection.
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 4/28/99 PDS : Created. *
- *=============================================================================================*/
-int CollectionClass::Get_Proxy_Count (void) const
-{
- return ProxyList.Count ();
-}
-
-
-/***********************************************************************************************
- * CollectionDefClass::CollectionDefClass -- constructor *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 12/8/98 GTH : Created. *
- *=============================================================================================*/
-CollectionDefClass::CollectionDefClass(void)
-{
- SnapPoints = NULL;
-}
-
-
-/***********************************************************************************************
- * CollectionDefClass::~CollectionDefClass -- destructor for collection definition *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 12/8/98 GTH : Created. *
- *=============================================================================================*/
-CollectionDefClass::~CollectionDefClass(void)
-{
- Free();
-}
-
-
-/***********************************************************************************************
- * CollectionDefClass::Free -- releases assets in use by a collection definition *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 12/8/98 GTH : Created. *
- *=============================================================================================*/
-void CollectionDefClass::Free(void)
-{
- for (int i=0; i 0);
- char * name = W3DNEWARRAY char [cload.Cur_Chunk_Length()];
- cload.Read(name,cload.Cur_Chunk_Length());
- ObjectNames.Add(name);
- break;
- }
-
- case W3D_CHUNK_PLACEHOLDER:
- {
- // Read the placeholder information from the chunk
- WWASSERT(cload.Cur_Chunk_Length() > 0);
- W3dPlaceholderStruct info;
- cload.Read(&info, sizeof (info));
-
- // Read the placeholder name from the chunk
- char *name = W3DNEWARRAY char[info.name_len + 1];
- cload.Read(name, info.name_len);
- name[info.name_len] = 0;
-
- // Create a matrix from the data in the chunk
- Matrix3D transform (info.transform[0][0], info.transform[1][0], info.transform[2][0], info.transform[3][0],
- info.transform[0][1], info.transform[1][1], info.transform[2][1], info.transform[3][1],
- info.transform[0][2], info.transform[1][2], info.transform[2][2], info.transform[3][2]);
-
- // Add this placeholder to our list
- ProxyList.Add (ProxyClass (name, transform));
-
- // Free the name array
- delete [] name;
- break;
- }
-
- case W3D_CHUNK_POINTS:
- SnapPoints = NEW_REF(SnapPointsClass, ());
- SnapPoints->Load_W3D(cload);
- break;
- }
-
- cload.Close_Chunk();
- }
-
- return WW3D_ERROR_OK;
-
-Error:
-
- return WW3D_ERROR_LOAD_FAILED;
-}
-
-/***********************************************************************************************
- * CollectionLoaderClass::Load -- reads a collection from a w3d file *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 12/8/98 GTH : Created. *
- *=============================================================================================*/
-PrototypeClass * CollectionLoaderClass::Load_W3D(ChunkLoadClass & cload)
-{
- CollectionDefClass * def = W3DNEW CollectionDefClass;
-
- if (def == NULL) {
- return NULL;
- }
-
- if (def->Load(cload) != WW3D_ERROR_OK) {
-
- // load failed, delete the model and return an error
- delete def;
- return NULL;
-
- } else {
-
- // ok, accept this model!
- CollectionPrototypeClass * proto = W3DNEW CollectionPrototypeClass(def);
- return proto;
-
- }
-}
-
-
-
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/collect.h b/Generals/Code/Libraries/Source/WWVegas/WW3D2/collect.h
deleted file mode 100644
index 57d3fe87f11..00000000000
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/collect.h
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
-** 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 .
-*/
-
-/***********************************************************************************************
- *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
- ***********************************************************************************************
- * *
- * Project Name : WW3D *
- * *
- * $Archive:: /Commando/Code/ww3d2/collect.h $*
- * *
- * Author:: Greg Hjelstrom *
- * *
- * $Modtime:: 1/08/01 10:04a $*
- * *
- * $Revision:: 1 $*
- * *
- *---------------------------------------------------------------------------------------------*
- * Functions: *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-#if defined(_MSC_VER)
-#pragma once
-#endif
-
-#ifndef COLLECT_H
-#define COLLECT_H
-
-#include "rendobj.h"
-#include "composite.h"
-#include "Vector.H"
-#include "proto.h"
-#include "w3d_file.h"
-#include "wwstring.h"
-#include "proxy.h"
-
-class CollectionDefClass;
-class SnapPointsClass;
-
-
-/*
-** CollectionClass
-** This is a render object which contains a collection of render objects.
-*/
-class CollectionClass : public CompositeRenderObjClass
-{
-public:
-
- CollectionClass(void);
- CollectionClass(const CollectionDefClass & def);
- CollectionClass(const CollectionClass & src);
- CollectionClass & operator = (const CollectionClass &);
- virtual ~CollectionClass(void);
- virtual RenderObjClass * Clone(void) const;
-
- virtual int Class_ID(void) const;
- virtual int Get_Num_Polys(void) const;
-
- /////////////////////////////////////////////////////////////////////////////
- // Proxy interface
- /////////////////////////////////////////////////////////////////////////////
- virtual int Get_Proxy_Count (void) const;
- virtual bool Get_Proxy (int index, ProxyClass &proxy) const;
-
- /////////////////////////////////////////////////////////////////////////////
- // Render Object Interface - Rendering
- /////////////////////////////////////////////////////////////////////////////
- virtual void Render(RenderInfoClass & rinfo);
- virtual void Special_Render(SpecialRenderInfoClass & rinfo);
-
- /////////////////////////////////////////////////////////////////////////////
- // Render Object Interface - "Scene Graph"
- /////////////////////////////////////////////////////////////////////////////
- virtual void Set_Transform(const Matrix3D &m);
- virtual void Set_Position(const Vector3 &v);
- virtual int Get_Num_Sub_Objects(void) const;
- virtual RenderObjClass * Get_Sub_Object(int index) const;
- virtual int Add_Sub_Object(RenderObjClass * subobj);
- virtual int Remove_Sub_Object(RenderObjClass * robj);
-
- /////////////////////////////////////////////////////////////////////////////
- // Render Object Interface - Collision Detection, Ray Tracing
- /////////////////////////////////////////////////////////////////////////////
- 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);
-
- /////////////////////////////////////////////////////////////////////////////
- // Render Object Interface - Bounding Volumes
- /////////////////////////////////////////////////////////////////////////////
- virtual void Get_Obj_Space_Bounding_Sphere(SphereClass & sphere) const;
- virtual void Get_Obj_Space_Bounding_Box(AABoxClass & box) const;
-
-
- /////////////////////////////////////////////////////////////////////////////
- // Render Object Interface - Attributes, Options, Properties, etc
- /////////////////////////////////////////////////////////////////////////////
- virtual int Snap_Point_Count(void);
- virtual void Get_Snap_Point(int index,Vector3 * set);
- virtual void Scale(float scale);
- virtual void Scale(float scalex, float scaley, float scalez);
- virtual void Update_Obj_Space_Bounding_Volumes(void);
-
-protected:
-
- void Free(void);
- void Update_Sub_Object_Transforms(void);
-
- DynamicVectorClass ProxyList;
- DynamicVectorClass SubObjects;
- SnapPointsClass * SnapPoints;
-
- SphereClass BoundSphere;
- AABoxClass BoundBox;
-};
-
-
-/*
-** CollectionLoaderClass
-** Loader for collection objects
-*/
-class CollectionLoaderClass : public PrototypeLoaderClass
-{
-public:
-
- virtual int Chunk_Type(void) { return W3D_CHUNK_COLLECTION; }
- virtual PrototypeClass * Load_W3D(ChunkLoadClass & cload);
-};
-
-extern CollectionLoaderClass _CollectionLoader;
-
-#endif
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/colorspace.h b/Generals/Code/Libraries/Source/WWVegas/WW3D2/colorspace.h
deleted file mode 100644
index 65b960e1622..00000000000
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/colorspace.h
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
-** 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 .
-*/
-
-/***********************************************************************************************
- *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
- ***********************************************************************************************
- * *
- * Project Name : Colorspace *
- * *
- * $Archive:: $*
- * *
- * Original Author:: Hector Yee *
- * *
- * $Author:: $*
- * *
- * $Modtime:: $*
- * *
- * $Revision:: $*
- * *
- *---------------------------------------------------------------------------------------------*
- * Functions: *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-#if defined(_MSC_VER)
-#pragma once
-#endif
-
-#ifndef COLORSPACE_H
-#define COLORSPACE_H
-
-#include "dx8wrapper.h"
-#include
-
-void RGB_To_HSV(Vector3 &hsv,const Vector3 &rgb);
-void HSV_To_RGB(Vector3 &rgb, const Vector3 &hsv);
-void Recolor(Vector3 &rgb, const Vector3 &hsv_shift);
-
-//---------------------------------------------------------------------
-// Color Conversions
-//---------------------------------------------------------------------
-
-inline void RGB_To_HSV(Vector3 &hsv,const Vector3 &rgb)
-// modified from Foley et al. page 592
-// converts rgb[0..1] to h [0,360), s and v in [0,1]
-// negative h values are to signify undefined
-{
- float max=WWMath::Max(rgb.X,rgb.Y);
- max=WWMath::Max(max,rgb.Z);
- float min=WWMath::Min(rgb.X,rgb.Y);
- min=WWMath::Min(min,rgb.Z);
-
- // value
- hsv.Z=max;
-
- // saturation
- hsv.Y=(max!=0.0f)?((max-min)/max):0.0f;
- if (hsv.Y==0.0f) hsv.X=-1.0f;
- else
- {
- float delta=max-min;
- if (rgb.X==max)
- hsv.X=(rgb.Y-rgb.Z)/delta;
- else if (rgb.Y==max)
- hsv.X=2.0f+ (rgb.Z-rgb.X)/delta;
- else if (rgb.Z==max)
- hsv.X=4.0f+ (rgb.X-rgb.Y)/delta;
- hsv.X*=60.0f;
- if (hsv.X<0.0f) hsv.X+=360.0f;
- }
-}
-
-inline void HSV_To_RGB(Vector3 &rgb, const Vector3 &hsv)
-{
- float h=hsv.X;
- float s=hsv.Y;
- float v=hsv.Z;
-
- if (hsv.Y==0.0f) {
- rgb.Set(v,v,v);
- } else {
- float f,p,q,t;
-
- int i;
-
- if (h==360.0f) h=0.0f;
-
- h/=60.0f;
- i=WWMath::Floor(h);
- f=h-i;
- p=v*(1.0f-s);
- q=v*(1.0f-(s*f));
- t=v*(1.0f-(s*(1.0f-f)));
- switch (i) {
- case 0:
- rgb.Set(v,t,p);
- break;
- case 1:
- rgb.Set(q,v,p);
- break;
- case 2:
- rgb.Set(p,v,t);
- break;
- case 3:
- rgb.Set(p,q,v);
- break;
- case 4:
- rgb.Set(t,p,v);
- break;
- case 5:
- rgb.Set(v,p,q);
- break;
- }
- }
-}
-
-inline void Recolor(Vector3 &rgb, const Vector3 &hsv_shift)
-{
- Vector3 hsv;
- RGB_To_HSV(hsv,rgb);
-
- // If the Hue has the "undefined flag" (a negative value), this means that the color is pure
- // monochrome. In this case do not shift the hue (it is undefined) or the saturation (it is 0
- // so it cannot be decreased, and increasing it would cause the undefined hue to actually
- // become visible). In this case, we only modify the value.
- if (hsv.X<0.0f) hsv+=Vector3(0.0f,0.0f,hsv_shift.Z);
- else hsv+=hsv_shift;
-
- // angular mod
- if (hsv.X<0.0f) hsv.X+=360.0f;
- if (hsv.X>360.0f) hsv.X-=360.0f;
- // clamp saturation and value
- hsv.Y=WWMath::Clamp(hsv.Y,0.0f,1.0f);
- hsv.Z=WWMath::Clamp(hsv.Z,0.0f,1.0f);
- HSV_To_RGB(rgb,hsv);
-}
-
-inline void Recolor(unsigned& rgba, const Vector3 &hsv_shift)
-{
- Vector4 rgba_v = DX8Wrapper::Convert_Color(rgba);
- Recolor((Vector3&)rgba_v, hsv_shift);
- rgba = DX8Wrapper::Convert_Color(rgba_v);
-}
-
-
-#endif
-
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/coltest.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/coltest.cpp
deleted file mode 100644
index 3282c89e2e1..00000000000
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/coltest.cpp
+++ /dev/null
@@ -1,375 +0,0 @@
-/*
-** 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 .
-*/
-
-/***********************************************************************************************
- *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
- ***********************************************************************************************
- * *
- * Project Name : WW3D *
- * *
- * $Archive:: /Commando/Code/ww3d2/coltest.cpp $*
- * *
- * Author:: Greg Hjelstrom *
- * *
- * $Modtime:: 5/07/01 10:26a $*
- * *
- * $Revision:: 2 $*
- * *
- *---------------------------------------------------------------------------------------------*
- * Functions: *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-
-#include "coltest.h"
-
-
-AABoxCollisionTestClass::AABoxCollisionTestClass(const AABoxCollisionTestClass & that) :
- CollisionTestClass(that),
- Box(that.Box),
- Move(that.Move),
- SweepMin(that.SweepMin),
- SweepMax(that.SweepMax)
-{
-}
-
-AABoxCollisionTestClass::AABoxCollisionTestClass(const AABoxClass & aabox,const Vector3 & move,CastResultStruct * res,int collision_type) :
- CollisionTestClass(res,collision_type),
- Box(aabox),
- Move(move)
-{
- SweepMin = Box.Center - Box.Extent;
- SweepMax = Box.Center + Box.Extent;
-
- Vector3 endmin = Box.Center + move - Box.Extent;
- Vector3 endmax = Box.Center + move + Box.Extent;
-
- if (endmax.X > SweepMax.X) SweepMax.X = endmax.X;
- if (endmax.Y > SweepMax.Y) SweepMax.Y = endmax.Y;
- if (endmax.Z > SweepMax.Z) SweepMax.Z = endmax.Z;
-
- if (endmin.X < SweepMin.X) SweepMin.X = endmin.X;
- if (endmin.Y < SweepMin.Y) SweepMin.Y = endmin.Y;
- if (endmin.Z < SweepMin.Z) SweepMin.Z = endmin.Z;
-}
-
-
-bool AABoxCollisionTestClass::Cull(const AABoxClass & box)
-{
-// const float MOVE_THRESHOLD = 2.0f;
-// if (WWMath::Fabs(Move.X) + WWMath::Fabs(Move.Y) + WWMath::Fabs(Move.Z) > MOVE_THRESHOLD) {
-// CastResultStruct res;
-// return !Box.Cast_To_Box(Move,box,&res);
-// } else {
- Vector3 min_corner;
- Vector3 max_corner;
- Vector3::Subtract(box.Center,box.Extent,&min_corner);
- Vector3::Add(box.Center,box.Extent,&max_corner);
-
- if ((SweepMin.X > max_corner.X) || (SweepMax.X < min_corner.X)) {
- return true;
- }
-
- if ((SweepMin.Y > max_corner.Y) || (SweepMax.Y < min_corner.Y)) {
- return true;
- }
-
- if ((SweepMin.Z > max_corner.Z) || (SweepMax.Z < min_corner.Z)) {
- return true;
- }
- return false;
-// }
-}
-
-
-void AABoxCollisionTestClass::Rotate(ROTATION_TYPE rotation)
-{
-
-#ifndef NDEBUG
-
- int i;
- Matrix3D tm(1);
- switch(rotation) {
- case ROTATE_NONE:
- break;
- case ROTATE_Z90:
- tm = Matrix3D::RotateZ90;
- break;
- case ROTATE_Z180:
- tm = Matrix3D::RotateZ180;
- break;
- case ROTATE_Z270:
- tm = Matrix3D::RotateZ270;
- break;
- }
-
-#ifdef ALLOW_TEMPORARIES
- Vector3 realcenter = tm * Box.Center;
-#else
- Vector3 realcenter;
- tm.mulVector3(Box.Center, realcenter);
-#endif
-
- Vector3 pts[8];
- Vector3 & min = SweepMin;
- Vector3 & max = SweepMax;
-
- pts[0].Set(min.X,min.Y,min.Z);
- pts[1].Set(min.X,max.Y,min.Z);
- pts[2].Set(max.X,max.Y,min.Z);
- pts[3].Set(max.X,min.Y,min.Z);
-
- pts[4].Set(min.X,min.Y,max.Z);
- pts[5].Set(min.X,max.Y,max.Z);
- pts[6].Set(max.X,max.Y,max.Z);
- pts[7].Set(max.X,min.Y,max.Z);
-
-// for (i=0; i<8; i++) {
-// pts[i] = tm * pts[i];
-// }
- tm.mulVector3Array(pts, 8);
-
- Vector3 realmin = pts[0];
- Vector3 realmax = pts[0];
-
- for (i=1; i<8; i++) {
- if (realmin.X >= pts[i].X) realmin.X = pts[i].X;
- if (realmin.Y >= pts[i].Y) realmin.Y = pts[i].Y;
- if (realmin.Z >= pts[i].Z) realmin.Z = pts[i].Z;
-
- if (realmax.X <= pts[i].X) realmax.X = pts[i].X;
- if (realmax.Y <= pts[i].Y) realmax.Y = pts[i].Y;
- if (realmax.Z <= pts[i].Z) realmax.Z = pts[i].Z;
- }
-
-
-#endif
-
-
- // rotate the test by the desired rotation about the Z axis, special cased for
- // 90 degree rotations about Z. arbitrary rotations cause the axis aligned
- // box to not be aligned any more :-)
- float tmp,minx,miny,maxx,maxy;
- switch(rotation) {
- case ROTATE_NONE:
- break;
-
- case ROTATE_Z90:
- // rotate the center point and the move vector
- tmp = Box.Center.X; Box.Center.X = -Box.Center.Y; Box.Center.Y = tmp;
- tmp = Move.X; Move.X = -Move.Y; Move.Y = tmp;
-
- // swap x and y for the extent
- tmp = Box.Extent.X; Box.Extent.X = Box.Extent.Y; Box.Extent.Y = tmp;
-
- // update sweep bounding box
- minx = SweepMin.X; miny = SweepMin.Y; maxx = SweepMax.X; maxy = SweepMax.Y;
- SweepMin.X = -maxy;
- SweepMin.Y = minx;
- SweepMax.X = -miny;
- SweepMax.Y = maxx;
- break;
-
- case ROTATE_Z180:
- // rotate center and move vector
- Box.Center.X = -Box.Center.X;
- Box.Center.Y = -Box.Center.Y;
- Move.X = -Move.X;
- Move.Y = -Move.Y;
-
- // update min/max boxes
- minx = SweepMin.X; miny = SweepMin.Y; maxx = SweepMax.X; maxy = SweepMax.Y;
- SweepMin.X = -maxx;
- SweepMin.Y = -maxy;
- SweepMax.X = -minx;
- SweepMax.Y = -miny;
- break;
-
- case ROTATE_Z270:
- // rotate center and move.
- tmp = Box.Center.X; Box.Center.X = Box.Center.Y; Box.Center.Y = -tmp;
- tmp = Move.X; Move.X = Move.Y; Move.Y = -tmp;
-
- // update extent (x and y axis swap)
- tmp = Box.Extent.X; Box.Extent.X = Box.Extent.Y; Box.Extent.Y = tmp;
-
- // update min/max boxes
- minx = SweepMin.X; miny = SweepMin.Y; maxx = SweepMax.X; maxy = SweepMax.Y;
- SweepMin.X = miny;
- SweepMin.Y = -maxx;
- SweepMax.X = maxy;
- SweepMax.Y = -minx;
- break;
- }
-
-#ifndef NDEBUG
-
- assert((Box.Center - realcenter).Length() < 0.001f);
- assert((SweepMin - realmin).Length() < 0.001f);
- assert((SweepMax - realmax).Length() < 0.001f);
-
-#endif
-}
-
-
-void AABoxCollisionTestClass::Transform(const Matrix3D & tm)
-{
- // NOTE: this function will expand the box to enclose the rotated
- // form of the original box. In practice, this function was only
- // implemented to double-check the results of the Translate and Rotate
- // functions.
- int i;
- Vector3 tmpcenter = Box.Center;
- Vector3 tmpextent = Box.Extent;
- tm.Transform_Center_Extent_AABox(tmpcenter,tmpextent,&Box.Center,&Box.Extent);
-
- Move = tm.Rotate_Vector(Move);
-
- Vector3 pts[8];
- Vector3 & min = SweepMin;
- Vector3 & max = SweepMax;
-
- pts[0].Set(min.X,min.Y,min.Z);
- pts[1].Set(min.X,max.Y,min.Z);
- pts[2].Set(max.X,max.Y,min.Z);
- pts[3].Set(max.X,min.Y,min.Z);
-
- pts[4].Set(min.X,min.Y,max.Z);
- pts[5].Set(min.X,max.Y,max.Z);
- pts[6].Set(max.X,max.Y,max.Z);
- pts[7].Set(max.X,min.Y,max.Z);
-
-// for (i=0; i<8; i++) {
-// pts[i] = tm * pts[i];
-// }
- tm.mulVector3Array(pts, 8);
-
- Vector3 realmin = pts[0];
- Vector3 realmax = pts[0];
-
- for (i=1; i<8; i++) {
- if (realmin.X >= pts[i].X) realmin.X = pts[i].X;
- if (realmin.Y >= pts[i].Y) realmin.Y = pts[i].Y;
- if (realmin.Z >= pts[i].Z) realmin.Z = pts[i].Z;
-
- if (realmax.X <= pts[i].X) realmax.X = pts[i].X;
- if (realmax.Y <= pts[i].Y) realmax.Y = pts[i].Y;
- if (realmax.Z <= pts[i].Z) realmax.Z = pts[i].Z;
- }
-
- SweepMin = realmin;
- SweepMax = realmax;
-}
-
-
-
-OBBoxCollisionTestClass::OBBoxCollisionTestClass
-(
- const OBBoxClass & obbox,
- const Vector3 & move,
- CastResultStruct * res,
- int type
-) :
- CollisionTestClass(res,type),
- Box(obbox),
- Move(move)
-{
- Vector3 max_extent;
- max_extent.X = WWMath::Fabs(Box.Basis[0][0] * Box.Extent.X) +
- WWMath::Fabs(Box.Basis[0][1] * Box.Extent.Y) +
- WWMath::Fabs(Box.Basis[0][2] * Box.Extent.Z) + 0.01f;
-
- max_extent.Y = WWMath::Fabs(Box.Basis[1][0] * Box.Extent.X) +
- WWMath::Fabs(Box.Basis[1][1] * Box.Extent.Y) +
- WWMath::Fabs(Box.Basis[1][2] * Box.Extent.Z) + 0.01f;
-
- max_extent.Z = WWMath::Fabs(Box.Basis[2][0] * Box.Extent.X) +
- WWMath::Fabs(Box.Basis[2][1] * Box.Extent.Y) +
- WWMath::Fabs(Box.Basis[2][2] * Box.Extent.Z) + 0.01f;
-
- SweepMin = Box.Center - max_extent;
- SweepMax = Box.Center + max_extent;
-
- Vector3 endmin = Box.Center + move - max_extent;
- Vector3 endmax = Box.Center + move + max_extent;
-
- if (endmax.X > SweepMax.X) SweepMax.X = endmax.X;
- if (endmax.Y > SweepMax.Y) SweepMax.Y = endmax.Y;
- if (endmax.Z > SweepMax.Z) SweepMax.Z = endmax.Z;
-
- if (endmin.X < SweepMin.X) SweepMin.X = endmin.X;
- if (endmin.Y < SweepMin.Y) SweepMin.Y = endmin.Y;
- if (endmin.Z < SweepMin.Z) SweepMin.Z = endmin.Z;
-}
-
-OBBoxCollisionTestClass::OBBoxCollisionTestClass(const OBBoxCollisionTestClass & that) :
- CollisionTestClass(that),
- Box(that.Box),
- Move(that.Move),
- SweepMin(that.SweepMin),
- SweepMax(that.SweepMax)
-{
-}
-
-OBBoxCollisionTestClass::OBBoxCollisionTestClass
-(
- const OBBoxCollisionTestClass & that,
- const Matrix3D & tm
-) :
- CollisionTestClass(that)
-{
- tm.Transform_Min_Max_AABox(that.SweepMin,that.SweepMax,&SweepMin,&SweepMax);
- Matrix3D::Rotate_Vector(tm,that.Move,&Move);
- OBBoxClass::Transform(tm,that.Box,&Box);
-}
-
-OBBoxCollisionTestClass::OBBoxCollisionTestClass
-(
- const AABoxCollisionTestClass & that,
- const Matrix3D & tm
-) :
- CollisionTestClass(that)
-{
- tm.Transform_Min_Max_AABox(that.SweepMin,that.SweepMax,&SweepMin,&SweepMax);
- Matrix3D::Rotate_Vector(tm,that.Move,&Move);
- Matrix3D::Transform_Vector(tm,that.Box.Center,&(Box.Center));
- Box.Extent = that.Box.Extent;
- Box.Basis = tm; // copies the 3x3 rotation portion of the transform
-}
-
-
-bool OBBoxCollisionTestClass::Cull(const AABoxClass & box)
-{
- Vector3 min_corner;
- Vector3 max_corner;
- Vector3::Subtract(box.Center,box.Extent,&min_corner);
- Vector3::Add(box.Center,box.Extent,&max_corner);
-
- if ((SweepMin.X > max_corner.X) || (SweepMax.X < min_corner.X)) {
- return true;
- }
-
- if ((SweepMin.Y > max_corner.Y) || (SweepMax.Y < min_corner.Y)) {
- return true;
- }
-
- if ((SweepMin.Z > max_corner.Z) || (SweepMax.Z < min_corner.Z)) {
- return true;
- }
- return false;
-}
-
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/coltest.h b/Generals/Code/Libraries/Source/WWVegas/WW3D2/coltest.h
deleted file mode 100644
index f406ecbb086..00000000000
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/coltest.h
+++ /dev/null
@@ -1,317 +0,0 @@
-/*
-** 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 .
-*/
-
-/***********************************************************************************************
- *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
- ***********************************************************************************************
- * *
- * Project Name : WW3D *
- * *
- * $Archive:: /VSS_Sync/ww3d2/coltest.h $*
- * *
- * Org Author:: Greg Hjelstrom *
- * *
- * Author : Kenny Mitchell *
- * *
- * $Modtime:: 07/01/02 12:45p $*
- * *
- * $Revision:: 5 $*
- * *
- * 07/01/02 KM Coltype enum change to avoid MAX conflicts *
- *---------------------------------------------------------------------------------------------*
- * Functions: *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-
-#if defined(_MSC_VER)
-#pragma once
-#endif
-
-#ifndef COLTEST_H
-#define COLTEST_H
-
-#include "always.h"
-#include "castres.h"
-#include "lineseg.h"
-#include "aabox.h"
-#include "obbox.h"
-#include "tri.h"
-#include "colmath.h"
-#include "coltype.h"
-
-class RenderObjClass;
-
-
-/////////////////////////////////////////////////////////////////////////////////////////////////////////////
-// CollisionTestClass
-//
-// Each type of collision test will have an associated class which
-// ties together all of the information necessary for the test.
-// These classes also provide a perfect place to add any information
-// which can be pre-calculated.
-//
-// The base class: CollisionTestClass simply contains a pointer to
-// the user's CastResultStruct which will contain the results of
-// the collision test. I store a pointer to a result structure
-// because in some cases, new CollisionTestClasses are created in
-// the process of checking (e.g. if the test needs to be transformed
-// into another coordinate system) and I did not want to be
-// constantly copying the result structure around. So, the user
-// must allocate a result structure (usually on the stack) and keep it
-// until the CollisionTestClass is discarded.
-//
-// Every CollisionTestClass should have the following functions:
-//
-// bool Cull(const Vector3 & min,const Vector3 & max);
-// bool Cull(const AABoxClass & box);
-// bool Cast_To_Triangle(const TriClass & tri);
-//
-// These are not virtual because I don't want to pay the price of virtual function
-// calls at the point in the code where these are used. It may be possible to
-// write template functions if we use these exact function prototpyes for all
-// collision test classes though.
-//
-//
-/////////////////////////////////////////////////////////////////////////////////////////////////////////////
-class CollisionTestClass
-{
-public:
- CollisionTestClass(CastResultStruct * res,int collision_type);
- CollisionTestClass(const CollisionTestClass & that);
-
-public:
- CastResultStruct * Result;
- int CollisionType;
- RenderObjClass * CollidedRenderObj;
-};
-
-
-inline CollisionTestClass::CollisionTestClass(CastResultStruct * res,int collision_type) :
- Result(res),
- CollisionType(collision_type),
- CollidedRenderObj(NULL)
-{
-}
-
-inline CollisionTestClass::CollisionTestClass(const CollisionTestClass & that) :
- Result(that.Result),
- CollisionType(that.CollisionType),
- CollidedRenderObj(that.CollidedRenderObj)
-{
-}
-
-
-/////////////////////////////////////////////////////////////////////////////////////////////////////////////
-// RayCollisionTestClass
-//
-// Contains a linesegment to be tested and of course the inherited
-// pointer to a CollisionStruct for the result
-//
-/////////////////////////////////////////////////////////////////////////////////////////////////////////////
-class RayCollisionTestClass : public CollisionTestClass
-{
-public:
-
- RayCollisionTestClass(const LineSegClass & ray,CastResultStruct * res,int collision_type = COLL_TYPE_0,bool check_translucent=false, bool check_hidden=false);
- RayCollisionTestClass(const RayCollisionTestClass & raytest,const Matrix3D & tm);
-
- bool Cull(const Vector3 & min,const Vector3 & max);
- bool Cull(const AABoxClass & box);
- bool Cast_To_Triangle(const TriClass & tri);
-
-public:
-
- LineSegClass Ray;
- bool CheckTranslucent;
- bool CheckHidden;
-
-private:
-
- // not implemented
- RayCollisionTestClass(const RayCollisionTestClass &);
- RayCollisionTestClass & operator = (const RayCollisionTestClass &);
-
-};
-
-
-inline RayCollisionTestClass::RayCollisionTestClass(const LineSegClass & ray,CastResultStruct * res,int collision_type,bool check_translucent, bool check_hidden) :
- CollisionTestClass(res,collision_type),
- Ray(ray),
- CheckTranslucent(check_translucent),
- CheckHidden(check_hidden)
-{
-}
-
-inline RayCollisionTestClass::RayCollisionTestClass(const RayCollisionTestClass & raytest,const Matrix3D & tm) :
- CollisionTestClass(raytest),
- Ray(raytest.Ray,tm),
- CheckTranslucent(raytest.CheckTranslucent),
- CheckHidden(raytest.CheckHidden)
-{
-}
-
-inline bool RayCollisionTestClass::Cull(const Vector3 & min,const Vector3 & max)
-{
- return (CollisionMath::Overlap_Test(min,max,Ray) == CollisionMath::POS);
-}
-
-inline bool RayCollisionTestClass::Cull(const AABoxClass & box)
-{
- return (CollisionMath::Overlap_Test(box,Ray) == CollisionMath::POS);
-}
-
-inline bool RayCollisionTestClass::Cast_To_Triangle(const TriClass & tri)
-{
- return CollisionMath::Collide(Ray,tri,Result);
-}
-
-
-/////////////////////////////////////////////////////////////////////////////////////////////////////////////
-// AABoxCollisionTestClass
-//
-// Contains an Axis Aligned Box and a movement vector to be tested
-// for collision. Also adds Min and Max vectors both for the initial
-// box and for the volume swept out by the box.
-//
-/////////////////////////////////////////////////////////////////////////////////////////////////////////////
-class AABoxCollisionTestClass : public CollisionTestClass
-{
-public:
-
- AABoxCollisionTestClass(const AABoxClass & aabox,const Vector3 & move,CastResultStruct * res,int collision_type = COLL_TYPE_0);
- AABoxCollisionTestClass(const AABoxCollisionTestClass & that);
-
- enum ROTATION_TYPE
- {
- ROTATE_NONE = 0,
- ROTATE_Z90,
- ROTATE_Z180,
- ROTATE_Z270
- };
-
- bool Cull(const Vector3 & min,const Vector3 & max);
- bool Cull(const AABoxClass & box);
- bool Cast_To_Triangle(const TriClass & tri);
-
- void Translate(const Vector3 & translation);
- void Rotate(ROTATION_TYPE rotation);
- void Transform(const Matrix3D & tm);
-
-public:
-
- AABoxClass Box;
- Vector3 Move;
-
- Vector3 SweepMin;
- Vector3 SweepMax;
-
-private:
-
- // not implemented
- AABoxCollisionTestClass & operator = (const AABoxCollisionTestClass &);
-
-};
-
-
-inline void AABoxCollisionTestClass::Translate(const Vector3 & translation)
-{
- // translate the test by the desired translation vector
- Box.Center += translation;
- SweepMin += translation;
- SweepMax += translation;
-}
-
-inline bool AABoxCollisionTestClass::Cull(const Vector3 & min,const Vector3 & max)
-{
- if ((SweepMin.X > max.X) || (SweepMax.X < min.X)) {
- return true;
- }
-
- if ((SweepMin.Y > max.Y) || (SweepMax.Y < min.Y)) {
- return true;
- }
-
- if ((SweepMin.Z > max.Z) || (SweepMax.Z < min.Z)) {
- return true;
- }
- return false;
-}
-
-inline bool AABoxCollisionTestClass::Cast_To_Triangle(const TriClass & tri)
-{
- return CollisionMath::Collide(Box,Move,tri,Result);
-}
-
-
-/////////////////////////////////////////////////////////////////////////////////////////////////////////////
-// OBBoxCollisionTestClass
-//
-// Contains an Oriented Bounding Box and a movement vector to be tested
-// for collision. Also adds Min and Max vectors (axis aligned box)
-// both for the initial box and for the volume swept out by the box.
-//
-/////////////////////////////////////////////////////////////////////////////////////////////////////////////
-class OBBoxCollisionTestClass : public CollisionTestClass
-{
-public:
-
- OBBoxCollisionTestClass(const OBBoxClass & obbox,const Vector3 & move,CastResultStruct * res,int type = COLL_TYPE_0);
- OBBoxCollisionTestClass(const OBBoxCollisionTestClass & that);
- OBBoxCollisionTestClass(const OBBoxCollisionTestClass & that,const Matrix3D & tm);
- OBBoxCollisionTestClass(const AABoxCollisionTestClass & that,const Matrix3D & tm);
-
- bool Cull(const Vector3 & min,const Vector3 & max);
- bool Cull(const AABoxClass & box);
- bool Cast_To_Triangle(const TriClass & tri);
-
-public:
-
- OBBoxClass Box;
- Vector3 Move;
- Vector3 SweepMin;
- Vector3 SweepMax;
-
-private:
- // not implemented
- OBBoxCollisionTestClass & operator = (const OBBoxCollisionTestClass &);
-};
-
-
-inline bool OBBoxCollisionTestClass::Cull(const Vector3 & min,const Vector3 & max)
-{
- if ((SweepMin.X > max.X) || (SweepMax.X < min.X)) {
- return true;
- }
-
- if ((SweepMin.Y > max.Y) || (SweepMax.Y < min.Y)) {
- return true;
- }
-
- if ((SweepMin.Z > max.Z) || (SweepMax.Z < min.Z)) {
- return true;
- }
- return false;
-}
-
-inline bool OBBoxCollisionTestClass::Cast_To_Triangle(const TriClass & tri)
-{
- return CollisionMath::Collide(Box,Move,tri,Vector3(0,0,0),Result);
-}
-
-
-#endif
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/coltype.h b/Generals/Code/Libraries/Source/WWVegas/WW3D2/coltype.h
deleted file mode 100644
index 4047f469d0f..00000000000
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/coltype.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
-** 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 .
-*/
-
-/***********************************************************************************************
- *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
- ***********************************************************************************************
- * *
- * Project Name : WW3D *
- * *
- * $Archive:: /Commando/Code/ww3d2/coltype.h $*
- * *
- * Original Author:: Greg Hjelstrom *
- * *
- * Author : Kenny Mitchell *
- * *
- * $Modtime:: 07/01/02 12:45p $*
- * *
- * $Revision:: 2 $*
- * *
- * 07/01/02 KM Coltype enum change to avoid MAX conflicts *
- *---------------------------------------------------------------------------------------------*
- * Functions: *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-
-#if defined(_MSC_VER)
-#pragma once
-#endif
-
-
-#ifndef COLTYPE_H
-#define COLTYPE_H
-
-
-/////////////////////////////////////////////////////////////////////////////////////////////////////////////
-//
-// Collision 'Types'
-//
-// This enum defines the collision type bit-field that is used in render object
-// collision detection.
-//
-// The collision type field in a collision or intersection test is used as a
-// low-level collision mask. It will be 'AND'ed with the collision type of
-// the render object and will ignore the object unless the result is
-// non-zero. In Commando, we use this to implement separate collision
-// representations for "physical" collisions versus "projectile"
-// collisions. I.e. we use a very simple mesh for the character's
-// physical collision and a more complex set of meshes for checking whether
-// a bullet hits a person. This masking system is not meant to be a general
-// "collision grouping" system. You should use a higher level system for doing
-// things like making bullets ignore each other, etc.
-//
-// One more wrinkle to the system: The collision type in the render obj
-// will always have the LSB set (COLL_TYPE_ALL) so that you can always
-// do queries against every piece of geometry in a render obj if desired.
-//
-/////////////////////////////////////////////////////////////////////////////////////////////////////////////
-enum
-{
- COLL_TYPE_ALL = 0x01, // perform this test against *EVERYTHING*
- COLL_TYPE_0 = 0x02, // perform this test against type 0 collision objects
- COLL_TYPE_1 = 0x04, // perform this test against type 1 collision objects
- COLL_TYPE_2 = 0x08,
- COLL_TYPE_3 = 0x10,
- COLL_TYPE_4 = 0x20,
- COLL_TYPE_5 = 0x40,
- COLL_TYPE_6 = 0x80,
-
- COLL_TYPE_PHYSICAL = COLL_TYPE_0, // physics collisions
- COLL_TYPE_PROJECTILE = COLL_TYPE_1, // projectile collisions
- COLL_TYPE_VIS = COLL_TYPE_2, // "vis node" detection
- COLL_TYPE_CAMERA = COLL_TYPE_3, // camera collision (99% should match physical setting)
- COLL_TYPE_VEHICLE = COLL_TYPE_4, // vehicles will collide with physical and this.
-};
-
-
-
-#endif
-
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/composite.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/composite.cpp
deleted file mode 100644
index f07e78cdfaf..00000000000
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/composite.cpp
+++ /dev/null
@@ -1,561 +0,0 @@
-/*
-** 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 .
-*/
-
-/***********************************************************************************************
- *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
- ***********************************************************************************************
- * *
- * Project Name : WW3D *
- * *
- * $Archive:: /Commando/Code/ww3d2/composite.cpp $*
- * *
- * Author:: Greg Hjelstrom *
- * *
- * $Modtime:: 11/27/01 12:45a $*
- * *
- * $Revision:: 6 $*
- * *
- *---------------------------------------------------------------------------------------------*
- * Functions: *
- * CompositeRenderObjClass::CompositeRenderObjClass -- Constructor *
- * CompositeRenderObjClass::CompositeRenderObjClass -- copy constructor *
- * CompositeRenderObjClass::~CompositeRenderObjClass -- Destructor *
- * CompositeRenderObjClass::operator -- assignment operator *
- * CompositeRenderObjClass::Restart -- Recursively call Restart on all sub-objects *
- * CompositeRenderObjClass::Get_Name -- returns the name of this render object *
- * CompositeRenderObjClass::Set_Name -- sets the name of this render object *
- * CompositeRenderObjClass::Set_Base_Model_Name -- sets the "base-model-name" *
- * CompositeRenderObjClass::Get_Num_Polys -- returns the number of polys *
- * CompositeRenderObjClass::Notify_Added -- notify all sub-objects that they were added *
- * CompositeRenderObjClass::Notify_Removed -- notifies all subobjs they were removed from th *
- * CompositeRenderObjClass::Cast_Ray -- cast a ray against this object *
- * CompositeRenderObjClass::Cast_AABox -- cast a swept AABox against this object *
- * CompositeRenderObjClass::Cast_OBBox -- cast a swept OBBox against this object *
- * CompositeRenderObjClass::Intersect_AABox -- intersect this object with an AABox *
- * CompositeRenderObjClass::Intersect_OBBox -- intersect this object with an OBBox *
- * CompositeRenderObjClass::Create_Decal -- create a decal on this object *
- * CompositeRenderObjClass::Delete_Decal -- remove a logical decal from this object *
- * CompositeRenderObjClass::Update_Obj_Space_Bounding_Volumes -- updates the object-space BV *
- * CompositeRenderObjClass::Set_User_Data -- set the userdata pointer *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-
-#include "composite.h"
-#include "wwdebug.h"
-#include
-#include
-
-
-/***********************************************************************************************
- * CompositeRenderObjClass::CompositeRenderObjClass -- Constructor *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- *=============================================================================================*/
-CompositeRenderObjClass::CompositeRenderObjClass(void)
-{
-}
-
-
-/***********************************************************************************************
- * CompositeRenderObjClass::CompositeRenderObjClass -- copy constructor *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 1/26/00 gth : Created. *
- *=============================================================================================*/
-CompositeRenderObjClass::CompositeRenderObjClass(const CompositeRenderObjClass & that)
-{
- Set_Name(that.Get_Name());
- Set_Base_Model_Name(that.Get_Base_Model_Name());
-}
-
-
-/***********************************************************************************************
- * CompositeRenderObjClass::~CompositeRenderObjClass -- Destructor *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 1/26/00 gth : Created. *
- *=============================================================================================*/
-CompositeRenderObjClass::~CompositeRenderObjClass(void)
-{
-}
-
-
-/***********************************************************************************************
- * CompositeRenderObjClass::operator -- assignment operator *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 1/26/00 gth : Created. *
- *=============================================================================================*/
-CompositeRenderObjClass & CompositeRenderObjClass::operator = (const CompositeRenderObjClass & that)
-{
- Set_Name(that.Get_Name());
- Set_Base_Model_Name(that.Get_Base_Model_Name());
- return *this;
-}
-
-
-/***********************************************************************************************
- * CompositeRenderObjClass::Restart -- Recursively call Restart on all sub-objects *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 5/30/2001 gth : Created. *
- *=============================================================================================*/
-void CompositeRenderObjClass::Restart(void)
-{
- for (int ni = 0; ni < Get_Num_Sub_Objects(); ni++) {
- RenderObjClass * robj = Get_Sub_Object(ni);
- WWASSERT(robj);
- robj->Restart();
- robj->Release_Ref();
- }
-}
-
-/***********************************************************************************************
- * CompositeRenderObjClass::Get_Name -- returns the name of this render object *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 1/26/00 gth : Created. *
- *=============================================================================================*/
-const char * CompositeRenderObjClass::Get_Name(void) const
-{
- return Name;
-}
-
-
-/***********************************************************************************************
- * CompositeRenderObjClass::Set_Name -- sets the name of this render object *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 1/26/00 gth : Created. *
- *=============================================================================================*/
-void CompositeRenderObjClass::Set_Name(const char * name)
-{
- Name=name;
-}
-
-
-/***********************************************************************************************
- * CompositeRenderObjClass::Set_Base_Model_Name -- sets the "base-model-name" *
- * *
- * The base-model-name was needed by the aggregate code. Ask Patrick Smith about it :-) *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 1/26/00 gth : Created. *
- *=============================================================================================*/
-void CompositeRenderObjClass::Set_Base_Model_Name(const char *name)
-{
- // NULL is a legal value for BaseModelName. Unfortunately,
- // StringClass::operator= does not modify the string when
- // assigning NULL, so we explicitly handle that case here.
- if (name != 0) {
- BaseModelName = name;
- } else {
- BaseModelName = "";
- }
-}
-
-
-/***********************************************************************************************
- * CompositeRenderObjClass::Get_Num_Polys -- returns the number of polys *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 1/26/00 gth : Created. *
- *=============================================================================================*/
-int CompositeRenderObjClass::Get_Num_Polys(void) const
-{
- int count = 0;
- for (int ni = 0; ni < Get_Num_Sub_Objects(); ni++) {
- RenderObjClass * robj = Get_Sub_Object(ni);
- WWASSERT(robj);
- count += robj->Get_Num_Polys();
- robj->Release_Ref();
- }
- return count;
-}
-
-
-/***********************************************************************************************
- * CompositeRenderObjClass::Notify_Added -- notify all sub-objects that they were added *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 1/26/00 gth : Created. *
- *=============================================================================================*/
-void CompositeRenderObjClass::Notify_Added(SceneClass * scene)
-{
- RenderObjClass::Notify_Added(scene);
- for (int ni = 0; ni < Get_Num_Sub_Objects(); ni++) {
- RenderObjClass * robj = Get_Sub_Object(ni);
- WWASSERT(robj);
- robj->Notify_Added(scene);
- robj->Release_Ref();
- }
-}
-
-
-/***********************************************************************************************
- * CompositeRenderObjClass::Notify_Removed -- notifies all subobjs they were removed from the *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 1/26/00 gth : Created. *
- *=============================================================================================*/
-void CompositeRenderObjClass::Notify_Removed(SceneClass * scene)
-{
- for (int ni = 0; ni < Get_Num_Sub_Objects(); ni++) {
- RenderObjClass * robj = Get_Sub_Object(ni);
- WWASSERT(robj);
- robj->Notify_Removed(scene);
- robj->Release_Ref();
- }
- RenderObjClass::Notify_Removed(scene);
-}
-
-
-/***********************************************************************************************
- * CompositeRenderObjClass::Cast_Ray -- cast a ray against this object *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 1/26/00 gth : Created. *
- *=============================================================================================*/
-bool CompositeRenderObjClass::Cast_Ray(RayCollisionTestClass & raytest)
-{
- bool res = false;
- for (int i=0; iCast_Ray(raytest);
- robj->Release_Ref();
- }
- return res;
-}
-
-
-/***********************************************************************************************
- * CompositeRenderObjClass::Cast_AABox -- cast a swept AABox against this object *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 1/26/00 gth : Created. *
- *=============================================================================================*/
-bool CompositeRenderObjClass::Cast_AABox(AABoxCollisionTestClass & boxtest)
-{
- bool res = false;
- for (int i=0; iCast_AABox(boxtest);
- robj->Release_Ref();
- }
- return res;
-}
-
-
-/***********************************************************************************************
- * CompositeRenderObjClass::Cast_OBBox -- cast a swept OBBox against this object *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 1/26/00 gth : Created. *
- *=============================================================================================*/
-bool CompositeRenderObjClass::Cast_OBBox(OBBoxCollisionTestClass & boxtest)
-{
- bool res = false;
- for (int i=0; iCast_OBBox(boxtest);
- robj->Release_Ref();
- }
- return res;
-}
-
-
-/***********************************************************************************************
- * CompositeRenderObjClass::Intersect_AABox -- intersect this object with an AABox *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 1/26/00 gth : Created. *
- *=============================================================================================*/
-bool CompositeRenderObjClass::Intersect_AABox(AABoxIntersectionTestClass & boxtest)
-{
- bool res = false;
- for (int i=0; iIntersect_AABox(boxtest);
- robj->Release_Ref();
- }
- return res;
-}
-
-
-/***********************************************************************************************
- * CompositeRenderObjClass::Intersect_OBBox -- intersect this object with an OBBox *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 1/26/00 gth : Created. *
- *=============================================================================================*/
-bool CompositeRenderObjClass::Intersect_OBBox(OBBoxIntersectionTestClass & boxtest)
-{
- bool res = false;
- for (int i=0; iIntersect_OBBox(boxtest);
- robj->Release_Ref();
- }
- return res;
-}
-
-
-/***********************************************************************************************
- * CompositeRenderObjClass::Create_Decal -- create a decal on this object *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 1/26/00 gth : Created. *
- *=============================================================================================*/
-void CompositeRenderObjClass::Create_Decal(DecalGeneratorClass * generator)
-{
- for (int i=0; iCreate_Decal(generator);
- robj->Release_Ref();
- }
-}
-
-
-/***********************************************************************************************
- * CompositeRenderObjClass::Delete_Decal -- remove a logical decal from this object *
- * *
- * This internally removes all decals with the given ID. The ID comes from the generator *
- * which was used to create the decals. *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 1/26/00 gth : Created. *
- *=============================================================================================*/
-void CompositeRenderObjClass::Delete_Decal(uint32 decal_id)
-{
- for (int i=0; iDelete_Decal(decal_id);
- robj->Release_Ref();
- }
-}
-
-
-/***********************************************************************************************
- * CompositeRenderObjClass::Update_Obj_Space_Bounding_Volumes -- updates the object-space BVs *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 1/26/00 gth : Created. *
- *=============================================================================================*/
-void CompositeRenderObjClass::Update_Obj_Space_Bounding_Volumes(void)
-{
- int i;
- RenderObjClass * robj = NULL;
-
- // if we don't have any sub objects, just set default bounds
- if (Get_Num_Sub_Objects() <= 0) {
- ObjSphere.Init(Vector3(0,0,0),0);
- ObjBox.Center.Set(0,0,0);
- ObjBox.Extent.Set(0,0,0);
- return;
- }
-
-
- AABoxClass obj_aabox;
- MinMaxAABoxClass box;
- SphereClass sphere;
-
- // loop through all sub-objects, combining their object-space bounding spheres and boxes.
- robj = Get_Sub_Object(0);
- WWASSERT(robj);
- robj->Get_Obj_Space_Bounding_Sphere(ObjSphere);
- robj->Get_Obj_Space_Bounding_Box(obj_aabox);
- robj->Release_Ref();
- box.Init(obj_aabox);
-
- for (i=1; iGet_Obj_Space_Bounding_Sphere(sphere);
- robj->Get_Obj_Space_Bounding_Box(obj_aabox);
-
- ObjSphere.Add_Sphere(sphere);
- box.Add_Box(obj_aabox);
-
- robj->Release_Ref();
- }
-
- ObjBox.Init(box);
-
- Invalidate_Cached_Bounding_Volumes();
-
- // Now update the object space bounding volumes of this object's container:
- RenderObjClass *container = Get_Container();
- if (container) container->Update_Obj_Space_Bounding_Volumes();
-}
-
-/***********************************************************************************************
- * CompositeRenderObjClass::Set_User_Data -- set the userdata *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 1/26/00 gth : Created. *
- *=============================================================================================*/
-void CompositeRenderObjClass::Set_User_Data(void *value, bool recursive)
-{
- RenderObjClass::Set_User_Data(value);
- if (recursive) {
- for (int i=0; iSet_User_Data(value,recursive);
- robj->Release_Ref();
- }
- }
-}
-
-const char * CompositeRenderObjClass::Get_Base_Model_Name (void) const
-{
- if (BaseModelName.Is_Empty()) {
- return NULL;
- }
-
- return BaseModelName;
-}
\ No newline at end of file
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/composite.h b/Generals/Code/Libraries/Source/WWVegas/WW3D2/composite.h
deleted file mode 100644
index 007f01706a4..00000000000
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/composite.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
-** 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 .
-*/
-
-/***********************************************************************************************
- *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
- ***********************************************************************************************
- * *
- * Project Name : WW3D *
- * *
- * $Archive:: /Commando/Code/ww3d2/composite.h $*
- * *
- * Author:: Greg Hjelstrom *
- * *
- * $Modtime:: 11/25/01 12:25p $*
- * *
- * $Revision:: 5 $*
- * *
- *---------------------------------------------------------------------------------------------*
- * Functions: *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-
-#if defined(_MSC_VER)
-#pragma once
-#endif
-
-#ifndef COMPOSITE_H
-#define COMPOSITE_H
-
-#include "rendobj.h"
-#include "wwstring.h"
-
-/*
-** CompositeRenderObjClass
-** The sole purpose of this class is to encapsulate some of the chores that all
-** "composite" (contain sub objects) render objects have to do. Typically all
-** of the functions are implemented through the existing sub-object interface
-** so there is still no assumption on how you store/organize your sub-objects.
-*/
-class CompositeRenderObjClass : public RenderObjClass
-{
-public:
-
- CompositeRenderObjClass(void);
- CompositeRenderObjClass(const CompositeRenderObjClass & that);
- virtual ~CompositeRenderObjClass(void);
- CompositeRenderObjClass & operator = (const CompositeRenderObjClass & that);
-
- virtual void Restart(void);
-
- virtual const char * Get_Name(void) const;
- virtual void Set_Name(const char * name);
- virtual const char * Get_Base_Model_Name (void) const;
- virtual void Set_Base_Model_Name (const char *name);
- virtual int Get_Num_Polys(void) const;
- virtual void Notify_Added(SceneClass * scene);
- virtual void Notify_Removed(SceneClass * scene);
-
- 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 Create_Decal(DecalGeneratorClass * generator);
- virtual void Delete_Decal(uint32 decal_id);
-
- virtual void Get_Obj_Space_Bounding_Sphere(SphereClass & sphere) const { sphere = ObjSphere; }
- virtual void Get_Obj_Space_Bounding_Box(AABoxClass & box) const { box = ObjBox; }
- virtual void Update_Obj_Space_Bounding_Volumes(void);
-
- virtual void Set_User_Data(void *value, bool recursive = false);
-
-protected:
-
- StringClass Name; // name of the render object
- StringClass BaseModelName; // name of the original render obj (before aggregation)
- SphereClass ObjSphere; // object-space bounding sphere
- AABoxClass ObjBox; // object-space bounding box
-};
-
-
-
-#endif
\ No newline at end of file
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/decalsys.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/decalsys.cpp
deleted file mode 100644
index 581b388e902..00000000000
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/decalsys.cpp
+++ /dev/null
@@ -1,489 +0,0 @@
-/*
-** 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 .
-*/
-
-/***********************************************************************************************
- *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
- ***********************************************************************************************
- * *
- * Project Name : WW3D *
- * *
- * $Archive:: /Commando/Code/ww3d2/decalsys.cpp $*
- * *
- * Original Author:: Greg Hjelstrom *
- * *
- * $Author:: Kenny Mitchell *
- * *
- * $Modtime:: 06/26/02 4:04p $*
- * *
- * $Revision:: 8 $*
- * *
- * 06/26/02 KM Matrix name change to avoid MAX conflicts *
- *---------------------------------------------------------------------------------------------*
- * Functions: *
- * DecalSystemClass::DecalSystemClass -- Constructor *
- * DecalSystemClass::~DecalSystemClass -- Destructor *
- * DecalSystemClass::Lock_Decal_Generator -- returns a DecalGenerator *
- * DecalSystemClass::Unlock_Decal_Generator -- Destroys the decal generator *
- * DecalSystemClass::Generate_Unique_Global_Decal_Id -- Generates a unique id for a decal *
- * DecalGeneratorClass::DecalGeneratorClass -- Constructor *
- * DecalGeneratorClass::~DecalGeneratorClass -- Destructor *
- * DecalGeneratorClass::Add_Mesh -- Meshes that generate a decal should add themselves *
- * DecalGeneratorClass::Get_Mesh_List -- returns the list of meshes *
- * DecalGeneratorClass::Set_Mesh_Transform -- sets the current mesh coordinate system *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-#include "decalsys.h"
-#include "rendobj.h"
-#include "mesh.h"
-#include "decalmsh.h"
-#include "matrixmapper.h"
-#include "texture.h"
-
-
-uint32 DecalSystemClass::DecalIDGenerator = 0;
-
-
-/*
-** DecalSystemClass Implementation
-*/
-
-/***********************************************************************************************
- * DecalSystemClass::DecalSystemClass -- Constructor *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- *=============================================================================================*/
-DecalSystemClass::DecalSystemClass(void)
-{
-}
-
-
-/***********************************************************************************************
- * DecalSystemClass::~DecalSystemClass -- Destructor *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- *=============================================================================================*/
-DecalSystemClass::~DecalSystemClass(void)
-{
-}
-
-
-/***********************************************************************************************
- * DecalSystemClass::Lock_Decal_Generator -- returns a DecalGenerator *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 1/26/00 gth : Created. *
- *=============================================================================================*/
-DecalGeneratorClass * DecalSystemClass::Lock_Decal_Generator(void)
-{
- DecalGeneratorClass * gen = W3DNEW DecalGeneratorClass(Generate_Decal_Id(), this);
- return gen;
-}
-
-
-/***********************************************************************************************
- * DecalSystemClass::Unlock_Decal_Generator -- Destroys the decal generator *
- * *
- * Derived classes may take a record of the results of the generator here. Then they can *
- * put a cap on the total number of decals in the system or whatever... *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 1/26/00 gth : Created. *
- *=============================================================================================*/
-void DecalSystemClass::Unlock_Decal_Generator(DecalGeneratorClass * generator)
-{
- delete generator;
-}
-
-
-/***********************************************************************************************
- * DecalSystemClass::Generate_Unique_Global_Decal_Id -- Generates a unique id for a decal *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * Hopefully you won't use more than 4 billion decals at one time... *
- * *
- * HISTORY: *
- * 1/26/00 gth : Created. *
- *=============================================================================================*/
-uint32 DecalSystemClass::Generate_Unique_Global_Decal_Id(void)
-{
- return DecalIDGenerator++;
-}
-
-
-/*
-** DecalGeneratorClass Implementation
-*/
-
-/***********************************************************************************************
- * DecalGeneratorClass::DecalGeneratorClass -- Constructor *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 1/26/00 gth : Created. *
- *=============================================================================================*/
-DecalGeneratorClass::DecalGeneratorClass(uint32 id,DecalSystemClass * system) :
- DecalID(id),
- System(system),
- BackfaceVal(0.0f),
- ApplyToTranslucentMeshes(false),
- Material(NULL)
-{
- Material = NEW_REF(MaterialPassClass,());
-
- WWASSERT(System != NULL);
- WWASSERT(Material != NULL);
-}
-
-
-/***********************************************************************************************
- * DecalGeneratorClass::~DecalGeneratorClass -- Destructor *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 1/26/00 gth : Created. *
- *=============================================================================================*/
-DecalGeneratorClass::~DecalGeneratorClass(void)
-{
- REF_PTR_RELEASE(Material);
-}
-
-
-/***********************************************************************************************
- * DecalGeneratorClass::Add_Mesh -- Meshes that generate a decal should add themselves *
- * *
- * This adds a mesh to the internal list. All meshes that actually add a decal should add *
- * themselves to this list so that the DecalSystem can keep track of them. *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 1/26/00 gth : Created. *
- *=============================================================================================*/
-void DecalGeneratorClass::Add_Mesh(RenderObjClass * mesh)
-{
- WWASSERT(mesh->Class_ID() == RenderObjClass::CLASSID_MESH);
- MeshList.Add(mesh);
-}
-
-
-/***********************************************************************************************
- * DecalGeneratorClass::Get_Mesh_List -- returns the list of meshes *
- * *
- * This is the list of meshes which generated decals for this "logical decal" *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 1/26/00 gth : Created. *
- *=============================================================================================*/
-NonRefRenderObjListClass & DecalGeneratorClass::Get_Mesh_List(void)
-{
- return MeshList;
-}
-
-
-/***********************************************************************************************
- * DecalGeneratorClass::Set_Mesh_Transform -- sets the current mesh coordinate system *
- * *
- * The coordinate system of the mesh is needed in order to compute texture coordinates for *
- * the decal polygons. *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 1/26/00 gth : Created. *
- *=============================================================================================*/
-void DecalGeneratorClass::Set_Mesh_Transform(const Matrix3D & mesh_transform)
-{
- /*
- ** Mobj-texture = Projection * Mwrld-texture * Mobj-wrld
- */
- Matrix3D world_to_texture;
- Matrix3D tmp;
- Matrix4x4 mesh_to_texture;
-
- Transform.Get_Orthogonal_Inverse(world_to_texture);
- Matrix3D::Multiply(world_to_texture,mesh_transform,&tmp);
- Matrix4x4::Multiply(Projection,tmp,&mesh_to_texture);
-
- /*
- ** Plug the matrix and texture size into the mapper
- */
- if (WW3D::Is_Texturing_Enabled()) {
- float texsize = 64.0f;
- TextureClass * tex = Material->Peek_Texture();
- WWASSERT(tex != NULL);
- if (tex) {
-// SurfaceClass::SurfaceDescription surface_desc;
-// tex->Get_Level_Description(surface_desc);
-// texsize = surface_desc.Width;
- texsize = tex->Get_Width();
- }
-
- Mapper->Set_Texture_Transform(mesh_to_texture,texsize);
- }
-}
-
-
-/*
-** MultiFixedPoolDecalSystemClass implementation
-*/
-
-MultiFixedPoolDecalSystemClass::MultiFixedPoolDecalSystemClass(uint32 num_pools, const uint32 *pool_sizes) :
- Pools(0),
- PoolCount(num_pools),
- Generator_PoolID(0),
- Generator_SlotID(0)
-{
- if (PoolCount)
- {
- WWASSERT(pool_sizes);
- Pools = W3DNEWARRAY LogicalDecalPoolClass [PoolCount];
- }
- for (uint32 i = 0; i < PoolCount; i++) {
- assert(pool_sizes[i]);
- Pools[i].Initialize(pool_sizes[i]);
- }
-}
-
-MultiFixedPoolDecalSystemClass::MultiFixedPoolDecalSystemClass(const MultiFixedPoolDecalSystemClass & that) :
- Pools(0),
- PoolCount(that.PoolCount),
- Generator_PoolID(that.Generator_PoolID),
- Generator_SlotID(that.Generator_SlotID)
-{
- uint32 i;
-
- // Allocate arrays (we dont' copy array contents because those are mesh-specific and will be
- // filled when the state is set anyway)
- if (PoolCount) Pools = W3DNEWARRAY LogicalDecalPoolClass [PoolCount];
- for (i = 0; i < PoolCount; i++) {
- Pools[i].Initialize(that.Pools[i].Size);
- }
-}
-
-MultiFixedPoolDecalSystemClass::~MultiFixedPoolDecalSystemClass(void)
-{
- if (Pools) {
- delete [] Pools;
- Pools = 0;
- }
-}
-
-// This clears the slot in addition to locking the generator, thus preventing any decal id
-// collisions (since any decal previously in that slot will have the same id as the new one).
-DecalGeneratorClass * MultiFixedPoolDecalSystemClass::Lock_Decal_Generator(void)
-{
- Clear_Decal_Slot(Generator_PoolID, Generator_SlotID);
- return DecalSystemClass::Lock_Decal_Generator();
-}
-
-// This will register the decal in the system in the appropriate pool and slot (determined by
-// the generator's pool and slot ids), removing any decal which may have been there before.
-void MultiFixedPoolDecalSystemClass::Unlock_Decal_Generator(DecalGeneratorClass * generator)
-{
- find_logical_decal(generator->Get_Decal_ID()).Set(generator);
- DecalSystemClass::Unlock_Decal_Generator(generator);
-}
-
-// This notifies the system that a mesh which has decals on it was destroyed - therefore we
-// need to remove the mesh from our list to avoid dangling pointers.
-void MultiFixedPoolDecalSystemClass::Decal_Mesh_Destroyed(uint32 decal_id,DecalMeshClass * mesh)
-{
- // We must remove this mesh from all lists where it is present. The method is: for each
- // decal id present in the decal mesh, find the logical decal and remove the decal mesh from
- // its list.
- assert(mesh);
- MeshClass *parent = mesh->Peek_Parent();
- find_logical_decal(decal_id).MeshList.Remove(parent);
-}
-
-// Not part of the DecalSystemClass interface - this function removes any decal currently in
-// the given slot in the given pool.
-void MultiFixedPoolDecalSystemClass::Clear_Decal_Slot(uint32 pool_id, uint32 slot_id)
-{
- find_logical_decal(pool_id, slot_id).Clear(encode_decal_id(pool_id, slot_id));
-}
-
-// This one removes all decals in a given pool.
-void MultiFixedPoolDecalSystemClass::Clear_Pool(uint32 pool_id)
-{
- LogicalDecalPoolClass & pool = Pools[pool_id];
- uint32 pool_size = pool.Size;
- for (uint32 slot_id = 0; slot_id < pool_size; slot_id++) {
- pool.Array[slot_id].Clear(encode_decal_id(pool_id, slot_id));
- }
-}
-
-// And this one removes all decals in the system.
-void MultiFixedPoolDecalSystemClass::Clear_All_Decals(void)
-{
- for (uint32 pool_id = 0; pool_id < PoolCount; pool_id++) {
- LogicalDecalPoolClass & pool = Pools[pool_id];
- uint32 pool_size = pool.Size;
- for (uint32 slot_id = 0; slot_id < pool_size; slot_id++) {
- pool.Array[slot_id].Clear(encode_decal_id(pool_id, slot_id));
- }
- }
-}
-
-// Get a reference to the logical decal at the given pool and slot id (performs range checking)
-MultiFixedPoolDecalSystemClass::LogicalDecalClass & MultiFixedPoolDecalSystemClass::find_logical_decal(uint32 pool_id, uint32 slot_id)
-{
- assert(pool_id < PoolCount);
- pool_id = MIN(pool_id, PoolCount);
- LogicalDecalPoolClass & pool = Pools[pool_id];
- assert(slot_id < pool.Size);
- slot_id = MIN(slot_id, pool.Size);
- return pool.Array[slot_id];
-}
-
-// Get a reference to the logical decal with the given decal id
-MultiFixedPoolDecalSystemClass::LogicalDecalClass & MultiFixedPoolDecalSystemClass::find_logical_decal(uint32 decal_id)
-{
- uint32 pool_id, slot_id;
- decode_decal_id(decal_id, pool_id, slot_id);
- return find_logical_decal(pool_id, slot_id);
-}
-
-
-/*
-** MultiFixedPoolDecalSystemClass::LogicalDecalClass implementation
-*/
-
-MultiFixedPoolDecalSystemClass::LogicalDecalClass::LogicalDecalClass(void)
-{
-}
-
-MultiFixedPoolDecalSystemClass::LogicalDecalClass::~LogicalDecalClass(void)
-{
- // We don't need to do anything here since the mesh list will get removed automatically and
- // the decals themselves don't neccessarily need to be removed because the logical decal is.
- // (we don't hold references to the meshes in the mesh list)
-}
-
-// Sets the logical decal to the one specified by the given generator (clearing any existing
-// decal information)
-void MultiFixedPoolDecalSystemClass::LogicalDecalClass::Set(DecalGeneratorClass * generator)
-{
- Clear(generator->Get_Decal_ID());
-
- /*
- ** Copy the generators' mesh list into our mesh list
- */
- NonRefRenderObjListIterator gen_mesh_it(&(generator->Get_Mesh_List()));
- for (gen_mesh_it.First(); !gen_mesh_it.Is_Done(); gen_mesh_it.Next()) {
- MeshList.Add(gen_mesh_it.Get_Obj());
- }
-}
-
-// Just clears any existing logical decal information, leaving the decal empty.
-void MultiFixedPoolDecalSystemClass::LogicalDecalClass::Clear(uint32 decal_id)
-{
- // Remove the decal with this ID from all meshes where it appears
- NonRefRenderObjListIterator it(&MeshList);
- for (it.First(); !it.Is_Done(); it.Next()) {
- it.Get_Obj()->Delete_Decal(decal_id);
- }
-
- // Delete list
- while (!MeshList.Is_Empty()) {
- MeshList.Remove_Head();
- }
-}
-
-
-/*
-** MultiFixedPoolDecalSystemClass::LogicalDecalPoolClass implementation
-*/
-
-MultiFixedPoolDecalSystemClass::LogicalDecalPoolClass::LogicalDecalPoolClass(void) :
- Array(0),
- Size(0)
-{
-}
-
-MultiFixedPoolDecalSystemClass::LogicalDecalPoolClass::~LogicalDecalPoolClass(void)
-{
- if (Array) {
- delete [] Array;
- Array = 0;
- }
-}
-
-void MultiFixedPoolDecalSystemClass::LogicalDecalPoolClass::Initialize(uint32 size)
-{
- if (Array) {
- delete [] Array;
- Array = 0;
- }
-
- Size = size;
- assert(Size);
- Array = W3DNEWARRAY LogicalDecalClass[Size];
-}
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/decalsys.h b/Generals/Code/Libraries/Source/WWVegas/WW3D2/decalsys.h
deleted file mode 100644
index 80e9c4fd364..00000000000
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/decalsys.h
+++ /dev/null
@@ -1,308 +0,0 @@
-/*
-** 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 .
-*/
-
-/***********************************************************************************************
- *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
- ***********************************************************************************************
- * *
- * Project Name : WW3D *
- * *
- * $Archive:: /Commando/Code/ww3d2/decalsys.h $*
- * *
- * Original Author:: Greg Hjelstrom *
- * *
- * $Author:: Greg_h $*
- * *
- * $Modtime:: 6/29/01 11:30a $*
- * *
- * $Revision:: 6 $*
- * *
- *---------------------------------------------------------------------------------------------*
- * Functions: *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-#if defined(_MSC_VER)
-#pragma once
-#endif
-
-#ifndef DECALSYS_H
-#define DECALSYS_H
-
-#include "always.h"
-#include "matrix3d.h"
-#include "matrix4.h"
-#include "obbox.h"
-#include "robjlist.h"
-#include "matpass.h"
-#include "projector.h"
-
-class DecalGeneratorClass;
-class DecalMeshClass;
-
-/**
-** DecalSystemClass
-** This is a class that manages creation and destruction of decals in the system. It is
-** meant to be over-ridden for game-specific behaviors.
-**
-** Sample Code:
-** 1 - Create the generator. The system gives it a unique id and gives you a clean decal generator
-**
-** DecalGeneratorClass * gen = DecalSystem->Lock_Decal_Generator();
-** gen->Set_Transform(tm);
-** gen->Set_Projection(proj_tm);
-** gen->Set_Bounds(OBBox);
-**
-** 2 - Apply the generator to any objects that you want it to affect. It wont do anything if it
-** does not overlap any polygons in those objects
-**
-** Scene->Collect_Objects(gen->Get_Bounding_Box(),objectlist);
-** for (iterator.First(objectlist); !iterator.Is_Done(); iterator.Next()) {
-** iterator.Peek_Object()->Create_Decal(gen);
-** }
-**
-** 3 - Release the generator back to the system. At this point, the system may record which meshes
-** actually generated extra decal polygons for future removal. All of this information will be
-** tied together with the unique 'decal ID' that was assigned to the generator.
-**
-** DecalSystem->Unlock_Decal_Generator(gen);
-**
-*/
-class DecalSystemClass
-{
-public:
- DecalSystemClass(void);
- virtual ~DecalSystemClass(void);
-
- /*
- ** Create and release DecalGenerators. Note that this is the point at which the
- ** decal system can track "logical" decals. The generator will keep an internal list
- ** of all of the render objects which generated decals which you should copy if you
- ** want to track them (e.g. if you want to cap the maximum number of active decals and
- ** kill the old ones...)
- */
- virtual DecalGeneratorClass * Lock_Decal_Generator(void);
- virtual void Unlock_Decal_Generator(DecalGeneratorClass * generator);
-
- /*
- ** When a decal-mesh is destroyed, it must inform the DecalSystem. Otherwise, systems
- ** which track decals can get dangling pointers.
- */
- virtual void Decal_Mesh_Destroyed(uint32 decal_id,DecalMeshClass * mesh) { }
-
-protected:
-
- /*
- ** This generates the decal ID when a generator is created. This decal system reroutes this
- ** to Generate_Unique_Global_Decal_Id(), but other decal systems may use a different method.
- */
- virtual uint32 Generate_Decal_Id(void) { return Generate_Unique_Global_Decal_Id(); }
-
- /*
- ** Unique ID generation for decals. Not all decal systems have to use
- ** this method of generating ids. Some may wish to assign the id as the
- ** array index of the logical id or use some other aritrary method.
- */
- static uint32 Generate_Unique_Global_Decal_Id(void);
-
- static uint32 DecalIDGenerator;
-};
-
-
-/**
-** DecalGeneratorClass
-** This class encapsulates the information needed to generate a decal. It also tracks
-** what meshes actually used it to generate new decal polygons.
-*/
-class DecalGeneratorClass : public ProjectorClass
-{
-public:
-
- /*
- ** All meshes that actually generate decal polygons should register themselves in the
- ** list. Then when the decal generation is finished, this list can be copied so that
- ** we can come back to those meshes and remove the decals if we want to.
- */
- void Add_Mesh(RenderObjClass * mesh);
- NonRefRenderObjListClass & Get_Mesh_List(void);
-
- /*
- ** Decal generator parameters.
- ** see ProjectorClass for control over the coordinate system, projection, etc
- */
- uint32 Get_Decal_ID(void) { return DecalID; }
- DecalSystemClass * Peek_Decal_System(void) { return System; }
-
- /*
- ** Backface rejection thresh-hold. The dot-product between the projection vector and
- ** the normal of each polygon is taken, if the result is greater than this value the polygon
- ** is accepted into the decal. Set it to -1 if you want to accept all polygons.
- */
- void Set_Backface_Threshhold(float val) { BackfaceVal = val; }
- float Get_Backface_Threshhold(void) { return BackfaceVal; }
-
- /*
- ** Normally, decals are not generated on translucent meshes. This is due to the "floating
- ** decals" that you can get on things like trees. The user can override this behavior
- ** through the following interface.
- */
- void Apply_To_Translucent_Meshes(bool onoff) { ApplyToTranslucentMeshes = onoff; }
- bool Is_Applied_To_Translucent_Meshes(void) { return ApplyToTranslucentMeshes; }
-
- /*
- ** Material parameters: just grab a pointer the material pass and modify it.
- ** Remember to release your ref to it when you are done.
- */
- MaterialPassClass * Get_Material(void) { WWASSERT(Material != NULL); Material->Add_Ref(); return Material; }
-
- /*
- ** Decal generation support. Call Set_Mesh_Transform for the mesh you want to add
- ** a decal to. Then for each vertex, you can call 'Compute_Texture_Coordinate'
- */
- void Set_Mesh_Transform(const Matrix3D & tm);
-
-protected:
-
- DecalGeneratorClass(uint32 id,DecalSystemClass * system);
- ~DecalGeneratorClass(void);
-
- /*
- ** Logical Decal ID, DecalSystem that this generator is tied to
- */
- DecalSystemClass * System;
- uint32 DecalID; // unique ID generated by the DecalSystem
-
- /*
- ** Backface Threshhold, Translucent mesh decal enable
- */
- float BackfaceVal;
- bool ApplyToTranslucentMeshes;
-
- /*
- ** Material settings
- */
- MaterialPassClass * Material; // material settings for the decal
-
- /*
- ** Results, list of the meshes which actually generated decal polygons for this logical decal.
- */
- NonRefRenderObjListClass MeshList;
-
- friend class DecalSystemClass;
-};
-
-
-/**
-** MultiFixedPoolDecalSystemClass: This is for decal systems which use several fixed-size decal
-** pools (If more than one pool is used, it is usually to have separate pools for several
-** different classes of decals). Note that here the decal IDs are a combination of the pool and
-** slot ids. (decal ids only have to be unique within a given decal system)
-*/
-
-class MultiFixedPoolDecalSystemClass : public DecalSystemClass
-{
-
-public:
-
- MultiFixedPoolDecalSystemClass(uint32 num_pools, const uint32 *pool_sizes);
- MultiFixedPoolDecalSystemClass(const MultiFixedPoolDecalSystemClass & that);
- virtual ~MultiFixedPoolDecalSystemClass(void);
-
- // This clears the slot in addition to locking the generator, thus preventing any decal id
- // collisions (since any decal previously in that slot will have the same id as the new one).
- virtual DecalGeneratorClass * Lock_Decal_Generator(void);
-
- // This will register the decal in the system in the appropriate pool and slot (determined by
- // the generator's pool and slot ids), removing any decal which may have been there before.
- virtual void Unlock_Decal_Generator(DecalGeneratorClass * generator);
-
- // This notifies the system that a mesh which has decals on it was destroyed - therefore we
- // need to remove the mesh from our list to avoid dangling pointers.
- virtual void Decal_Mesh_Destroyed(uint32 id,DecalMeshClass * mesh);
-
- // Not part of the DecalSystemClass interface - this function removes any decal currently in
- // the given slot in the given pool.
- void Clear_Decal_Slot(uint32 pool_id, uint32 slot_id);
-
- // This one removes all decals in a given pool.
- void Clear_Pool(uint32 pool_id);
-
- // And this one removes all decals in the system.
- void Clear_All_Decals(void);
-
-protected:
-
- /*
- ** This generates the decal ID when a generator is created. This decal system generates the
- ** decal ID from a pool ID and slot ID which are part of the state of the system so someone
- ** can set them before calling Lock_Decal_Generator() (which is where this function is called).
- ** We do it this way to avoid needing to override Lock_Decal_Generator().
- */
- virtual uint32 Generate_Decal_Id(void) { return encode_decal_id(Generator_PoolID, Generator_SlotID); }
- uint32 Generator_PoolID; // These should be set before calling Lock_Decal_Generator()
- uint32 Generator_SlotID; // These should be set before calling Lock_Decal_Generator()
-
- class LogicalDecalClass;
-
- // Get a reference to the logical decal at the given pool and slot id (performs range chacking)
- LogicalDecalClass & find_logical_decal(uint32 pool_id, uint32 slot_id);
-
- // Get a reference to the logical decal with the given decal id
- LogicalDecalClass & find_logical_decal(uint32 decal_id);
-
- // The decal ids are formed so that the upper 16 bits are equal to the pool id and the lower
- // 16 bits are equal to the slot id.
- static uint32 encode_decal_id(uint32 pool_id, uint32 slot_id) { return (slot_id & 0xFFFF) | (pool_id << 16); }
- static void decode_decal_id(uint32 decal_id, uint32 & pool_id, uint32 & slot_id) { slot_id = decal_id & 0xFFFF; pool_id = decal_id >> 16; }
-
- // A class to store the meshes to which the decal has been applied (so that they can be removed when needed)
- class LogicalDecalClass
- {
- public:
- LogicalDecalClass(void);
- ~LogicalDecalClass(void);
-
- void Set(DecalGeneratorClass * generator);
-
- // Just clears any existing logical decal information, leaving the decal empty.
- void Clear(uint32 decal_id);
-
- NonRefRenderObjListClass MeshList;
- };
-
- class LogicalDecalPoolClass
- {
- public:
- LogicalDecalPoolClass(void);
- ~LogicalDecalPoolClass(void);
-
- void Initialize(uint32 size);
-
- LogicalDecalClass * Array;
- uint32 Size;
- };
-
- LogicalDecalPoolClass * Pools;
- uint32 PoolCount;
-
-};
-
-
-
-
-#endif //DECALSYS_H
-
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/distlod.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/distlod.cpp
deleted file mode 100644
index 2f096ea2c6e..00000000000
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/distlod.cpp
+++ /dev/null
@@ -1,1166 +0,0 @@
-/*
-** 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 .
-*/
-
-/***********************************************************************************************
- *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
- ***********************************************************************************************
- * *
- * Project Name : WW3D *
- * *
- * $Archive:: /Commando/Code/ww3d2/distlod.cpp $*
- * *
- * Author:: Greg Hjelstrom *
- * *
- * $Modtime:: 2/06/01 3:21p $*
- * *
- * $Revision:: 3 $*
- * *
- *---------------------------------------------------------------------------------------------*
- * Functions: *
- * DistLODDefClass -- default constructor for DistLODDefClass *
- * DistLODDefClass::DistLODDefClass -- manual constructor for DistLODDefClass *
- * DistLODDefClass::~DistLODDefClass -- destructor for DistLODDefClass *
- * DistLODDefClass::Free -- releases all memory in use by this object *
- * DistLODDefClass::Load -- initialize this object from a W3D file *
- * DistLODDefClass::read_header -- read the header from a W3D file *
- * DistLODDefClass::read_node -- read a model node description from a W3D file *
- * DistLODClass::DistLODClass -- constructor *
- * DistLODClass::DistLODClass -- copy constructor *
- * DistLODClass::~DistLODClass -- destructor *
- * DistLODClass::Free -- releases memory in use *
- * DistLODClass::Get_Name -- returns the name of this LOD object *
- * DistLODClass::Get_Num_Polys -- returns the number of polys in this model *
- * DistLODClass::Render -- Render this LOD. *
- * DistLODClass::Special_Render -- custom render function *
- * DistLODCLass::Get_Num_Sub_Objects -- returns the number of subobjects (levels of detail) *
- * DistLODClass::Get_Sub_Object -- returns pointer to the specified sub-object (LOD) *
- * DistLODCLass::Set_Transform -- sets the transform for this model *
- * DistLODClass::Set_Position -- set the position of this object *
- * DistLODClass::Set_Animation -- set the animation state of this model *
- * DistLODClass::Set_Animation -- set the animation state of this model *
- * DistLODClass::Set_Animation -- set the animation state to a blend of two anims *
- * DistLODClass::Set_Animation -- set the animation state to a combination of anims *
- * DistLODClass::Get_Num_Bones -- returns the number of bones *
- * DistLODClass::Get_Bone_Name -- returns the name of the specified bone *
- * DistLODClass::Get_Bone_Index -- returns the index of the given bone (if found) *
- * DistLODClass::Get_Bone_Transform -- returns the transform of the given bone *
- * DistLODClass::Get_Bone_Transform -- returns the transform of the given bone *
- * DistLODClass::Capture_Bone -- take control of a bone *
- * DistLODClass::Release_Bone -- release control of a bone *
- * DistLODClass::Is_Bone_Captured -- check whether the given bone is captured *
- * DistLODClass::Control_Bone -- set the transform for a captured bone *
- * DistLODClass::Cast_Ray -- cast a ray against this model *
- * DistLODClass::Cast_AABox -- perform an AABox cast against this model *
- * DistLODClass::Cast_OBBox -- perform an OBBox cast against this model *
- * DistLODCLass::Get_Num_Snap_Points -- returns number of snap points in this model *
- * DistLODClass::Get_Snap_Point -- returns the i'th snap point *
- * DistLODCLass::Scale -- scale this model; passes on to each LOD *
- * DistLODClass::Scale -- scale this model; passes on to each LOD *
- * DistLODClass::Update_LOD -- adjusts the current LOD based on the distance *
- * DistLODClass::Increment_Lod -- moves to a higher detail LOD *
- * DistLODClass::Decrement_Lod -- moves to a lower detail LOD *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-
-#include "distlod.h"
-#include "nstrdup.h"
-#include "ww3d.h"
-#include "assetmgr.h"
-#include "camera.h"
-#include "w3derr.h"
-#include "wwdebug.h"
-#include "chunkio.h"
-#include "hlod.h"
-#include "rinfo.h"
-#include "coltest.h"
-#include "inttest.h"
-
-/*
-** Loader Instance
-*/
-DistLODLoaderClass _DistLODLoader;
-
-
-RenderObjClass * DistLODPrototypeClass::Create(void)
-{
- DistLODClass * dist = NEW_REF( DistLODClass , ( *Definition ) );
-
- // Have to pull each LOD out of the DistLOD, create a copy of the name
- // and destroy the DistLOD so that the models are "containerless". Also
- // invert the order of the models in the DistLOD
- char * name = nstrdup(dist->Get_Name());
- WWASSERT(name != NULL);
-
- int count = dist->Get_Num_Sub_Objects();
- RenderObjClass ** robj = W3DNEWARRAY RenderObjClass * [count];
- int i=0;
- for (; iGet_Sub_Object(i);
- WWASSERT(robj[count - 1 - i] != NULL);
- }
- dist->Release_Ref();
-
- WWDEBUG_SAY(("OBSOLETE Dist-LOD model found! Please re-export %s!\r\n",name));
- HLodClass * hlod = NEW_REF(HLodClass , (name,robj,count));
-
- // Now, release the temporary refs and memory for the name
- for (i=0; iRelease_Ref();
- }
- free(name);
-
- return hlod;
-}
-
-/*
-** The Prototype Loader
-*/
-PrototypeClass *DistLODLoaderClass::Load_W3D( ChunkLoadClass &cload )
-{
- DistLODDefClass * pCDistLODClass = W3DNEW DistLODDefClass;
-
- if (pCDistLODClass == NULL)
- {
- return NULL;
- }
-
- if (pCDistLODClass->Load_W3D(cload) != WW3D_ERROR_OK)
- {
- // load failed, delete the model and return an error
- delete pCDistLODClass;
- return NULL;
-
- } else {
-
- // ok, accept this model!
- DistLODPrototypeClass *pCLODProto = W3DNEW DistLODPrototypeClass (pCDistLODClass);
- return pCLODProto;
- }
-}
-
-
-/***********************************************************************************************
- * DistLODDefClass -- default constructor for DistLODDefClass *
- * *
- * DistLODDefClass is a "blueprint" for constructing a DistLODClass *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- *=============================================================================================*/
-DistLODDefClass::DistLODDefClass(void) :
- Name(NULL),
- LodCount(0),
- Lods(NULL)
-{
-}
-
-
-/***********************************************************************************************
- * DistLODDefClass::DistLODDefClass -- manual constructor for DistLODDefClass *
- * *
- * This constructor allows you to create a DistLODDef Manually (and then use it to create *
- * the desired DistLODClass). The array of DistLODModelDefStructs which you pass in will *
- * only be read from so you are responsible for the memory used by them. *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 7/15/98 GTH : Created. *
- *=============================================================================================*/
-DistLODDefClass::DistLODDefClass(const char * name,int lodcount,DistLODNodeDefStruct * modeldefs) :
- Name(NULL),
- LodCount(0),
- Lods(NULL)
-{
- assert(name != NULL);
- Name = nstrdup(name);
-
- LodCount = lodcount;
- Lods = W3DNEWARRAY DistLODNodeDefStruct[LodCount];
- for (int i=0; iCreate_Render_Obj(def.Lods[i].Name);
- assert(Lods[i].Model != NULL);
- Lods[i].Model->Set_Container(this);
-
- // copy the distances
- Lods[i].ResUpDist = def.Lods[i].ResUpDist;
- Lods[i].ResDownDist = def.Lods[i].ResDownDist;
- }
-
- Update_Sub_Object_Bits();
- Update_Obj_Space_Bounding_Volumes();
-}
-
-
-/***********************************************************************************************
- * DistLODClass::DistLODClass -- copy constructor *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 3/3/99 GTH : Created. *
- *=============================================================================================*/
-DistLODClass::DistLODClass(const DistLODClass & that) :
- CompositeRenderObjClass( that )
-{
- LodCount = that.LodCount;
- CurLod = VpPushLod = that.CurLod;
-
- Lods = W3DNEWARRAY LODNodeClass[LodCount];
- for (int i=0; iClone();
- assert(Lods[i].Model != NULL);
- Lods[i].Model->Set_Container(this);
-
- // copy the distances
- Lods[i].ResUpDist = that.Lods[i].ResUpDist;
- Lods[i].ResDownDist = that.Lods[i].ResDownDist;
- }
- Update_Obj_Space_Bounding_Volumes();
-}
-
-
-/***********************************************************************************************
- * DistLODClass::~DistLODClass -- destructor *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 3/3/99 GTH : Created. *
- *=============================================================================================*/
-DistLODClass::~DistLODClass(void)
-{
- Free();
-}
-
-
-/***********************************************************************************************
- * DistLODClass::Free -- releases memory in use *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 3/3/99 GTH : Created. *
- *=============================================================================================*/
-void DistLODClass::Free(void)
-{
- if (Lods != NULL) {
- for (int i=0; iSet_Container(NULL);
- Lods[i].Model->Release_Ref();
- Lods[i].Model = NULL;
- }
- }
- delete[] Lods;
- Lods = NULL;
- }
- CurLod = 0;
- LodCount = 0;
-}
-
-
-/***********************************************************************************************
- * DistLODClass::Get_Num_Polys -- returns the number of polys in this model *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * returns the number of polys in the *current* lod. *
- * *
- * HISTORY: *
- * 3/3/99 GTH : Created. *
- *=============================================================================================*/
-int DistLODClass::Get_Num_Polys(void) const
-{
- return Lods[CurLod].Model->Get_Num_Polys();
-}
-
-
-/***********************************************************************************************
- * DistLODClass::Render -- Render this LOD. *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 3/3/99 GTH : Created. *
- *=============================================================================================*/
-void DistLODClass::Render(RenderInfoClass & rinfo)
-{
- if (Is_Not_Hidden_At_All() == false) {
- return;
- }
-
- Update_Lod(rinfo.Camera);
- Lods[CurLod].Model->Render(rinfo);
-}
-
-
-/***********************************************************************************************
- * DistLODClass::Special_Render -- custom render function *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 3/3/99 GTH : Created. *
- *=============================================================================================*/
-void DistLODClass::Special_Render(SpecialRenderInfoClass & rinfo)
-{
- Update_Lod(rinfo.Camera);
- Lods[CurLod].Model->Special_Render(rinfo);
-}
-
-
-/***********************************************************************************************
- * DistLODCLass::Get_Num_Sub_Objects -- returns the number of subobjects (levels of detail) *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 3/1/99 GTH : Created. *
- *=============================================================================================*/
-int DistLODClass::Get_Num_Sub_Objects(void) const
-{
- return LodCount;
-}
-
-
-/***********************************************************************************************
- * DistLODClass::Get_Sub_Object -- returns pointer to the specified sub-object (LOD) *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 3/1/99 GTH : Created. *
- *=============================================================================================*/
-RenderObjClass * DistLODClass::Get_Sub_Object(int index) const
-{
- assert(index >= 0);
- assert(index < LodCount);
-
- if (Lods[index].Model == NULL) {
- return NULL;
- } else {
- Lods[index].Model->Add_Ref();
- return Lods[index].Model;
- }
-}
-
-int DistLODClass::Add_Sub_Object_To_Bone(RenderObjClass * subobj,int bone_index)
-{
- // NOTE: this is broken code, a render object cannot have two containers...
- if (subobj->Class_ID() == CLASSID_DISTLOD) {
- // Add each lod of the sub object to a cooresponding model of mine
- DistLODClass * sub_lod_obj = (DistLODClass *)subobj;
- for (int i=0; i< LodCount; i++) {
- Lods[i].Model->Add_Sub_Object_To_Bone( sub_lod_obj->Lods[ MIN( i, sub_lod_obj->LodCount-1 ) ].Model, bone_index);
- }
- } else {
- Lods[0].Model->Add_Sub_Object_To_Bone( subobj, bone_index);
- }
- return 0;
-}
-
-
-/***********************************************************************************************
- * DistLODCLass::Set_Transform -- sets the transform for this model *
- * *
- * sets the transform in all LODs. *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 3/3/99 GTH : Created. *
- *=============================================================================================*/
-void DistLODClass::Set_Transform(const Matrix3D &m)
-{
- RenderObjClass::Set_Transform(m);
- for (int i=0; iSet_Transform(m);
- }
-}
-
-
-/***********************************************************************************************
- * DistLODClass::Set_Position -- set the position of this object *
- * *
- * sets the position of all lods *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 3/3/99 GTH : Created. *
- *=============================================================================================*/
-void DistLODClass::Set_Position(const Vector3 &v)
-{
- RenderObjClass::Set_Position(v);
- for (int i=0; iSet_Position(v);
- }
-}
-
-
-/***********************************************************************************************
- * DistLODClass::Set_Animation -- set the animation state of this model *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 3/3/99 GTH : Created. *
- *=============================================================================================*/
-void DistLODClass::Set_Animation( void )
-{
- for (int i=0; iSet_Animation();
- }
-}
-
-
-/***********************************************************************************************
- * DistLODClass::Set_Animation -- set the animation state of this model *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 3/3/99 GTH : Created. *
- *=============================================================================================*/
-void DistLODClass::Set_Animation( HAnimClass * motion,float frame,int mode)
-{
- for (int i=0; iSet_Animation(motion,frame,mode);
- }
-}
-
-
-/***********************************************************************************************
- * DistLODClass::Set_Animation -- set the animation state to a blend of two anims *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 3/3/99 GTH : Created. *
- *=============================================================================================*/
-void DistLODClass::Set_Animation( HAnimClass * motion0,float frame0,HAnimClass * motion1,float frame1,float percentage)
-{
- for (int i=0; iSet_Animation(motion0,frame0,motion1,frame1,percentage);
- }
-}
-
-
-/***********************************************************************************************
- * DistLODClass::Set_Animation -- set the animation state to a combination of anims *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 3/3/99 GTH : Created. *
- *=============================================================================================*/
-void DistLODClass::Set_Animation( HAnimComboClass * anim_combo)
-{
- for (int i=0; iSet_Animation( anim_combo);
- }
-}
-
-
-/***********************************************************************************************
- * DistLODClass::Peek_Animation *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 12/8/98 GTH : Created. *
- *=============================================================================================*/
-HAnimClass * DistLODClass::Peek_Animation( void )
-{
- return Lods[0].Model->Peek_Animation();
-}
-
-
-/***********************************************************************************************
- * DistLODClass::Get_Num_Bones -- returns the number of bones *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 3/3/99 GTH : Created. *
- *=============================================================================================*/
-int DistLODClass::Get_Num_Bones(void)
-{
- return Lods[0].Model->Get_Num_Bones();
-}
-
-
-/***********************************************************************************************
- * DistLODClass::Get_Bone_Name -- returns the name of the specified bone *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 3/3/99 GTH : Created. *
- *=============================================================================================*/
-const char * DistLODClass::Get_Bone_Name(int bone_index)
-{
- return Lods[0].Model->Get_Bone_Name(bone_index);
-}
-
-
-/***********************************************************************************************
- * DistLODClass::Get_Bone_Index -- returns the index of the given bone (if found) *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 3/3/99 GTH : Created. *
- *=============================================================================================*/
-int DistLODClass::Get_Bone_Index(const char * bonename)
-{
- // Highest LOD is used since lowest may be a Null3DObjClass.
- return Lods[0].Model->Get_Bone_Index(bonename);
-}
-
-
-/***********************************************************************************************
- * DistLODClass::Get_Bone_Transform -- returns the transform of the given bone *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 3/3/99 GTH : Created. *
- *=============================================================================================*/
-const Matrix3D & DistLODClass::Get_Bone_Transform(const char * bonename)
-{
- // Highest LOD is used since lowest may be a Null3DObjClass.
- return Lods[0].Model->Get_Bone_Transform(bonename);
-}
-
-
-/***********************************************************************************************
- * DistLODClass::Get_Bone_Transform -- returns the transform of the given bone *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 3/3/99 GTH : Created. *
- *=============================================================================================*/
-const Matrix3D & DistLODClass::Get_Bone_Transform(int boneindex)
-{
- // Highest LOD is used since lowest may be a Null3DObjClass.
- return Lods[0].Model->Get_Bone_Transform(boneindex);
-}
-
-
-/***********************************************************************************************
- * DistLODClass::Capture_Bone -- take control of a bone *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 3/3/99 GTH : Created. *
- *=============================================================================================*/
-void DistLODClass::Capture_Bone(int bindex)
-{
- for (int i=0; iCapture_Bone(bindex);
- }
-}
-
-
-/***********************************************************************************************
- * DistLODClass::Release_Bone -- release control of a bone *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 3/3/99 GTH : Created. *
- *=============================================================================================*/
-void DistLODClass::Release_Bone(int bindex)
-{
- for (int i=0; iRelease_Bone(bindex);
- }
-}
-
-
-/***********************************************************************************************
- * DistLODClass::Is_Bone_Captured -- check whether the given bone is captured *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 3/3/99 GTH : Created. *
- *=============================================================================================*/
-bool DistLODClass::Is_Bone_Captured(int bindex) const
-{
- // Highest LOD is used since lowest may be a Null3DObjClass.
- return Lods[0].Model->Is_Bone_Captured(bindex);
-}
-
-
-/***********************************************************************************************
- * DistLODClass::Control_Bone -- set the transform for a captured bone *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 3/3/99 GTH : Created. *
- *=============================================================================================*/
-void DistLODClass::Control_Bone(int bindex,const Matrix3D & tm,bool world_space_translation)
-{
- for (int i=0; iControl_Bone(bindex,tm,world_space_translation);
- }
-}
-
-/***********************************************************************************************
- * DistLODClass::Cast_Ray -- cast a ray against this model *
- * *
- * casts the ray against the top-level LOD *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 3/3/99 GTH : Created. *
- *=============================================================================================*/
-bool DistLODClass::Cast_Ray(RayCollisionTestClass & raytest)
-{
- if (raytest.CollisionType & Get_Collision_Type()) {
- return Lods[HIGHEST_LOD].Model->Cast_Ray(raytest);
- } else {
- return false;
- }
-}
-
-
-/***********************************************************************************************
- * DistLODClass::Cast_AABox -- perform an AABox cast against this model *
- * *
- * tests against the top-level LOD *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 3/3/99 GTH : Created. *
- *=============================================================================================*/
-bool DistLODClass::Cast_AABox(AABoxCollisionTestClass & boxtest)
-{
- if (boxtest.CollisionType & Get_Collision_Type()) {
- return Lods[HIGHEST_LOD].Model->Cast_AABox(boxtest);
- } else {
- return false;
- }
-}
-
-
-/***********************************************************************************************
- * DistLODClass::Cast_OBBox -- perform an OBBox cast against this model *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 3/1/99 GTH : Created. *
- *=============================================================================================*/
-bool DistLODClass::Cast_OBBox(OBBoxCollisionTestClass & boxtest)
-{
- if (boxtest.CollisionType & Get_Collision_Type()) {
- return Lods[HIGHEST_LOD].Model->Cast_OBBox(boxtest);
- } else {
- return false;
- }
-}
-
-
-/***********************************************************************************************
- * DistLODCLass::Get_Num_Snap_Points -- returns number of snap points in this model *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 3/1/99 GTH : Created. *
- *=============================================================================================*/
-int DistLODClass::Get_Num_Snap_Points(void)
-{
- return Lods[0].Model->Get_Num_Snap_Points();
-}
-
-
-/***********************************************************************************************
- * DistLODClass::Get_Snap_Point -- returns the i'th snap point *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 3/1/99 GTH : Created. *
- *=============================================================================================*/
-void DistLODClass::Get_Snap_Point(int index,Vector3 * set)
-{
- Lods[0].Model->Get_Snap_Point(index,set);
-}
-
-
-/***********************************************************************************************
- * DistLODCLass::Scale -- scale this model; passes on to each LOD *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 3/1/99 GTH : Created. *
- *=============================================================================================*/
-void DistLODClass::Scale(float scale)
-{
- for (int i=0; iScale(scale);
- }
-}
-
-
-/***********************************************************************************************
- * DistLODClass::Scale -- scale this model; passes on to each LOD *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 3/1/99 GTH : Created. *
- *=============================================================================================*/
-void DistLODClass::Scale(float scalex, float scaley, float scalez)
-{
- for (int i=0; iScale(scalex,scaley,scalez);
- }
-}
-
-
-/***********************************************************************************************
- * DistLODClass::Update_LOD -- adjusts the current LOD based on the distance *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 3/1/99 GTH : Created. *
- *=============================================================================================*/
-void DistLODClass::Update_Lod(const CameraClass & camera)
-{
- // evaluate the distance from the camera and select an LOD based on it.
- float dist = (
- camera.Get_Position() -
- Lods[CurLod].Model->Get_Bounding_Sphere().Center
- ).Quick_Length();
-
- if (dist < Lods[CurLod].ResUpDist) {
- Increment_Lod();
- } else if (dist > Lods[CurLod].ResDownDist) {
- Decrement_Lod();
- }
-}
-
-
-/***********************************************************************************************
- * DistLODClass::Increment_Lod -- moves to a higher detail LOD *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 3/1/99 GTH : Created. *
- *=============================================================================================*/
-void DistLODClass::Increment_Lod(void)
-{
- // TODO: change the order in which models are stored
- if (CurLod > 0) {
- if (Is_In_Scene()) {
- Lods[CurLod].Model->Notify_Removed(Scene);
- }
- CurLod--;
- if (Is_In_Scene()) {
- Lods[CurLod].Model->Notify_Added(Scene);
- }
- }
-}
-
-
-/***********************************************************************************************
- * DistLODClass::Decrement_Lod -- moves to a lower detail LOD *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 3/1/99 GTH : Created. *
- *=============================================================================================*/
-void DistLODClass::Decrement_Lod(void)
-{
- if (CurLod < LodCount - 1) {
- if (Is_In_Scene()) {
- Lods[CurLod].Model->Notify_Removed(Scene);
- }
- CurLod++;
- if (Is_In_Scene()) {
- Lods[CurLod].Model->Notify_Added(Scene);
- }
- }
-}
-
-
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/distlod.h b/Generals/Code/Libraries/Source/WWVegas/WW3D2/distlod.h
deleted file mode 100644
index a17240aa547..00000000000
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/distlod.h
+++ /dev/null
@@ -1,246 +0,0 @@
-/*
-** 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 .
-*/
-
-/***********************************************************************************************
- *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
- ***********************************************************************************************
- * *
- * Project Name : WW3D *
- * *
- * $Archive:: /Commando/Code/ww3d2/distlod.h $*
- * *
- * Author:: Greg Hjelstrom *
- * *
- * $Modtime:: 1/25/01 2:46p $*
- * *
- * $Revision:: 2 $*
- * *
- *---------------------------------------------------------------------------------------------*
- * Functions: *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-
-#if defined(_MSC_VER)
-#pragma once
-#endif
-
-#ifndef DISTLOD_H
-#define DISTLOD_H
-
-#include "proto.h"
-#include "rendobj.h"
-#include "composite.h"
-#include "w3derr.h"
-
-class ChunkLoadClass;
-struct DistLODNodeDefStruct;
-class DistLODDefClass;
-
-
-/*
-** DistLODClass
-** Distance based LOD switching. This is a simple LOD object which switches models
-** based on the pre-set distances. Note that the models are stored in order of
-** descending resolution; i.e. the highest res model will be in index 0.
-** Most functions in this class simply pass the call on to all of the LODs.
-**
-** When the level of detail is changed, the LOD which was being used must be
-** notified that it is being removed from the scene and the new LOD must be
-** notified that it is being added. This allows us to correctly handle lights
-** and particle emitters in LODs...
-*/
-class DistLODClass : public CompositeRenderObjClass
-{
-public:
-
- DistLODClass(const DistLODDefClass & desc);
- DistLODClass(const DistLODClass & that);
- virtual ~DistLODClass(void);
- virtual RenderObjClass * Clone(void) const { return W3DNEW DistLODClass(*this); }
- virtual int Class_ID(void) const { return CLASSID_DISTLOD; }
- virtual int Get_Num_Polys(void) const;
-
- /////////////////////////////////////////////////////////////////////////////
- // Render Object Interface - Rendering
- /////////////////////////////////////////////////////////////////////////////
- virtual void Render(RenderInfoClass & rinfo);
- virtual void Special_Render(SpecialRenderInfoClass & rinfo);
-
- /////////////////////////////////////////////////////////////////////////////
- // Render Object Interface - "Scene Graph"
- // Access each LOD individually through Get_Sub_Object.
- /////////////////////////////////////////////////////////////////////////////
- virtual void Set_Transform(const Matrix3D &m);
- virtual void Set_Position(const Vector3 &v);
-
- virtual int Get_Num_Sub_Objects(void) const;
- virtual RenderObjClass * Get_Sub_Object(int index) const;
-
- virtual int Add_Sub_Object_To_Bone(RenderObjClass * subobj,int bone_index);
-
- /////////////////////////////////////////////////////////////////////////////
- // Render Object Interface - Hierarchical Animation
- // Here again, these functions are passed on to all LODs. Each LOD is
- // assumed to use the same HTree (or have no HTree, this is so that LODs are
- // animation-compatible) so the bone query functions simply pass to the top
- // LOD.
- /////////////////////////////////////////////////////////////////////////////
- virtual void Set_Animation( void );
- virtual void Set_Animation( HAnimClass * motion, float frame, int anim_mode = ANIM_MODE_MANUAL);
- virtual void Set_Animation( HAnimClass * motion0,float frame0,HAnimClass * motion1,float frame1,float percentage);
- virtual void Set_Animation( HAnimComboClass * anim_combo);
- virtual HAnimClass * Peek_Animation( void );
- virtual int Get_Num_Bones(void);
- virtual const char * Get_Bone_Name(int bone_index);
- virtual int Get_Bone_Index(const char * bonename);
- virtual const Matrix3D & Get_Bone_Transform(const char * bonename);
- virtual const Matrix3D & Get_Bone_Transform(int boneindex);
- virtual void Capture_Bone(int bindex);
- virtual void Release_Bone(int bindex);
- virtual bool Is_Bone_Captured(int bindex) const;
- virtual void Control_Bone(int bindex,const Matrix3D & tm,bool world_space_translation = false);
-
- /////////////////////////////////////////////////////////////////////////////
- // Render Object Interface - Collision Detection, Ray Tracing
- // Collision tests are performed on the top-level LOD.
- /////////////////////////////////////////////////////////////////////////////
- virtual bool Cast_Ray(RayCollisionTestClass & raytest);
- virtual bool Cast_AABox(AABoxCollisionTestClass & boxtest);
- virtual bool Cast_OBBox(OBBoxCollisionTestClass & boxtest);
-
- /////////////////////////////////////////////////////////////////////////////
- // Render Object Interface - Attributes, Options, Properties, etc
- /////////////////////////////////////////////////////////////////////////////
- virtual int Get_Num_Snap_Points(void);
- virtual void Get_Snap_Point(int index,Vector3 * set);
- virtual void Scale(float scale);
- virtual void Scale(float scalex, float scaley, float scalez);
-
- /////////////////////////////////////////////////////////////////////////////
- // DistLOD Interface
- /////////////////////////////////////////////////////////////////////////////
- virtual float Get_Switch_Up_Dist(int index) const { return Lods[index].ResUpDist; }
- virtual float Get_Switch_Down_Dist(int index) const { return Lods[index].ResDownDist; }
- virtual void Set_Switch_Up_Dist(int index, float dist) { Lods[index].ResUpDist = dist; }
- virtual void Set_Switch_Down_Dist(int index, float dist) { Lods[index].ResDownDist = dist; }
-
-private:
-
- enum { HIGHEST_LOD = 0 };
-
- void Free(void);
- void Update_Lod(const CameraClass & camera);
- void Increment_Lod(void);
- void Decrement_Lod(void);
-
- struct LODNodeClass
- {
- RenderObjClass * Model;
- float ResUpDist;
- float ResDownDist;
- };
-
- int LodCount; // how many models are in this LOD object
- int CurLod; // which model is currently used for rendering
- int VpPushLod; // which model was used for the vp->push (in CurLod changes before the pop)
- LODNodeClass * Lods; // one LODNodeClass for each level
-};
-
-
-/*
-** Loaders for DistLODClass
-*/
-class DistLODLoaderClass : public PrototypeLoaderClass
-{
-public:
-
- virtual int Chunk_Type (void) { return W3D_CHUNK_LODMODEL; }
- virtual PrototypeClass * Load_W3D(ChunkLoadClass & cload);
-};
-
-/*
-** DistLODModelDefStruct
-** Describes a single model in a Distance-Based LOD Object
-*/
-struct DistLODNodeDefStruct
-{
- DistLODNodeDefStruct(void) : Name(NULL),ResDownDist(0.0f),ResUpDist(0.0f) {}
-
- char * Name;
- float ResDownDist;
- float ResUpDist;
-};
-
-/*
-** DistLODDefClass
-** Description of a Distance-Based LOD Object. These are similar
-** to the HModelDef's that are used by the asset manager to construct
-** HModels.
-*/
-class DistLODDefClass
-{
-public:
-
- DistLODDefClass(void);
- DistLODDefClass(const char * name,int lodcount,DistLODNodeDefStruct * lods);
- ~DistLODDefClass(void);
-
- WW3DErrorType Load_W3D(ChunkLoadClass & cload);
- const char * Get_Name(void) const { return Name; }
-
-private:
-
- char * Name;
-
- int LodCount;
- DistLODNodeDefStruct * Lods;
-
- void Free(void);
- bool read_header(ChunkLoadClass & cload);
- bool read_node(ChunkLoadClass & cload,DistLODNodeDefStruct * node);
-
- friend class DistLODClass;
-};
-
-/*
-** Prototype for Dist-LOD objects
-*/
-class DistLODPrototypeClass : public W3DMPO, public PrototypeClass
-{
- W3DMPO_GLUE(DistLODPrototypeClass)
-public:
- DistLODPrototypeClass( DistLODDefClass *def ) { Definition = def; }
-
- virtual const char * Get_Name(void) const { return Definition->Get_Name(); }
- virtual int Get_Class_ID(void) const { return RenderObjClass::CLASSID_DISTLOD; }
- virtual RenderObjClass * Create(void);
- virtual void DeleteSelf() { delete this; }
-
-protected:
- virtual ~DistLODPrototypeClass(void) { delete Definition; }
-
-private:
- DistLODDefClass * Definition;
-};
-
-/*
-** Instance of the loaders which the asset manager install
-*/
-extern DistLODLoaderClass _DistLODLoader;
-
-#endif
\ No newline at end of file
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/dllist.h b/Generals/Code/Libraries/Source/WWVegas/WW3D2/dllist.h
deleted file mode 100644
index 2748c17c25d..00000000000
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/dllist.h
+++ /dev/null
@@ -1,211 +0,0 @@
-/*
-** 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 .
-*/
-
-/***********************************************************************************************
- *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
- ***********************************************************************************************
- * *
- * Project Name : ww3d *
- * *
- * $Archive:: /Commando/Code/ww3d2/dllist.h $*
- * *
- * Original Author:: Jani Penttinen *
- * *
- * $Author:: Jani_p $*
- * *
- * $Modtime:: 3/21/01 6:18p $*
- * *
- * $Revision:: 11 $*
- * *
- *---------------------------------------------------------------------------------------------*
- * Functions: *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-#if defined(_MSC_VER)
-#pragma once
-#endif
-
-#ifndef DLLIST_H
-#define DLLIST_H
-
-
-template class DLNodeClass;
-
-template
-class DLListClass
-{
- friend DLNodeClass;
- DLNodeClass* head;
- DLNodeClass* tail;
-
-public:
- DLListClass() : head(0), tail(0) {}
- virtual ~DLListClass() { }
-
- void Add_Head(DLNodeClass* node);
- void Remove_Head();
- void Add_Tail(DLNodeClass* node);
- void Remove_Tail();
-
- T* Head() { return static_cast(head); }
- T* Tail() { return static_cast(tail); }
- const T* Const_Head() const { return static_cast(head); }
- const T* Const_Tail() const { return static_cast(tail); }
-};
-
-// Destroy-list will call delete for all nodes when the list is destructed. Note that the class doesn't work
-// with undeclared pointer types (destructor has to be known).
-template
-class DLDestroyListClass : public DLListClass
-{
- using DLListClass::Head;
-
-public:
- virtual ~DLDestroyListClass()
- {
- while (T* t=Head()) {
- delete t;
- }
- }
-};
-
-template
-class DLNodeClass : public W3DMPO
-{
- // nope, this is an ABC
- //W3DMPO_GLUE(DLNodeClass)
-
- friend DLListClass;
- DLNodeClass* succ;
- DLNodeClass* pred;
- DLListClass* list;
-public:
- DLNodeClass() : succ(0), pred(0), list(0) {}
- ~DLNodeClass() { Remove(); }
-
- void Insert_Before(DLNodeClass* n)
- {
- list=n->list;
- succ=n;
- pred=n->pred;
- if (n->pred) n->pred->succ=this;
- n->pred=this;
-
- if (list->head==n) {
- list->head=this;
- }
- }
-
- void Insert_After(DLNodeClass* n)
- {
- list=n->list;
- pred=n;
- succ=n->succ;
- if (n->succ) n->succ->pred=this;
- n->succ=this;
-
- if (list->tail==n) {
- list->tail=this;
- }
- }
-
- void Remove()
- {
- if (!list) return;
- if (list->Head()==this) {
- DLListClass* tmp_list=list;
- list=0;
- tmp_list->Remove_Head();
- return;
- }
- if (list->Tail()==this) {
- DLListClass* tmp_list=list;
- list=0;
- tmp_list->Remove_Tail();
- return;
- }
- if (succ) succ->pred=pred;
- if (pred) pred->succ=succ;
- list=0;
- }
-
-
- T* Succ() { return static_cast(succ); }
- T* Pred() { return static_cast(pred); }
- const T* Const_Succ() const { return static_cast(succ); }
- const T* Const_Pred() const { return static_cast(pred); }
-
- DLListClass* List() { return list; }
-};
-
-
-template
-inline void DLListClass::Add_Head(DLNodeClass* n)
-{
- n->list=this;
- if (head) {
- n->Insert_Before(head);
- head=n;
- }
- else {
- tail=n;
- head=n;
- n->succ=0;
- n->pred=0;
- }
-}
-
-template
-inline void DLListClass::Add_Tail(DLNodeClass* n)
-{
- n->list=this;
- if (tail) {
- n->Insert_After(tail);
- tail=n;
- }
- else {
- tail=n;
- head=n;
- n->succ=0;
- n->pred=0;
- }
-}
-
-template
-inline void DLListClass::Remove_Head()
-{
- if (!head) return;
- DLNodeClass* n=head;
- head=head->Succ();
- if (!head) tail=head;
- else head->pred=0;
- n->Remove();
-}
-
-template
-inline void DLListClass::Remove_Tail()
-{
- if (!tail) return;
- DLNodeClass* n=tail;
- tail=tail->Pred();
- if (!tail) head=tail;
- else tail->succ=0;
- n->Remove();
-}
-
-#endif //DLLIST_H
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8list.h b/Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8list.h
deleted file mode 100644
index 3cab7260356..00000000000
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8list.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-** 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 .
-*/
-
-/***********************************************************************************************
- *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
- ***********************************************************************************************
- * *
- * Project Name : ww3d *
- * *
- * $Archive:: /Commando/Code/ww3d2/dx8list.h $*
- * *
- * Original Author:: Greg Hjelstrom *
- * *
- * Author : Kenny Mitchell *
- * *
- * $Modtime:: 06/27/02 1:27p $*
- * *
- * $Revision:: 5 $*
- * *
- * 06/27/02 KM Texture class abstraction *
- *---------------------------------------------------------------------------------------------*
- * Functions: *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-
-#if defined(_MSC_VER)
-#pragma once
-#endif
-
-#ifndef DX8LIST_H
-#define DX8LIST_H
-
-#include "always.h"
-#include "multilist.h"
-
-
-/*
-** Here we're just typedefing some multi-lists so we don't have to write the
-** long template names.
-*/
-class DX8TextureCategoryClass;
-typedef MultiListClass TextureCategoryList;
-typedef MultiListIterator TextureCategoryListIterator;
-
-class DX8FVFCategoryContainer;
-typedef MultiListClass FVFCategoryList;
-typedef MultiListIterator FVFCategoryListIterator;
-
-class DX8PolygonRendererClass;
-typedef MultiListClass DX8PolygonRendererList;
-typedef MultiListIterator DX8PolygonRendererListIterator;
-
-class TextureTrackerClass;
-typedef MultiListClass TextureTrackerList;
-typedef MultiListIterator TextureTrackerListIterator;
-
-
-#endif //DX8LIST_H
-
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8polygonrenderer.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8polygonrenderer.cpp
deleted file mode 100644
index 7fed7750167..00000000000
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8polygonrenderer.cpp
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
-** 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 .
-*/
-
-/***********************************************************************************************
- *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
- ***********************************************************************************************
- * *
- * Project Name : ww3d *
- * *
- * $Archive:: /Commando/Code/ww3d2/dx8polygonrenderer.cpp $*
- * *
- * Original Author:: Greg Hjelstrom *
- * *
- * $Author:: Jani_p $*
- * *
- * $Modtime:: 8/22/01 6:54p $*
- * *
- * $Revision:: 11 $*
- * *
- *---------------------------------------------------------------------------------------------*
- * Functions: *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-
-
-#include "dx8polygonrenderer.h"
-#include "dx8renderer.h"
-
-
-// ----------------------------------------------------------------------------
-
-DX8PolygonRendererClass::DX8PolygonRendererClass(
- unsigned index_count_,
- MeshModelClass* mmc_,
- DX8TextureCategoryClass* tex_cat,
- unsigned vertex_offset_,
- unsigned index_offset_,
- bool strip_,
- unsigned pass_)
- :
- mmc(mmc_),
- texture_category(tex_cat),
- index_offset(index_offset_),
- vertex_offset(vertex_offset_),
- min_vertex_index(0),
- vertex_index_range(0),
- index_count(index_count_),
- strip(strip_),
- pass(pass_)
-{
- WWASSERT(index_count);
- mmc->PolygonRendererList.Add_Tail(this);
-}
-
-DX8PolygonRendererClass::DX8PolygonRendererClass(const DX8PolygonRendererClass& src,MeshModelClass* mmc_)
- :
- mmc(mmc_),
- texture_category(src.texture_category),
- index_offset(src.index_offset),
- vertex_offset(src.vertex_offset),
- min_vertex_index(src.min_vertex_index),
- vertex_index_range(src.vertex_index_range),
- index_count(src.index_count),
- strip(src.strip),
- pass(src.pass)
-{
- mmc->PolygonRendererList.Add_Tail(this);
-}
-
-DX8PolygonRendererClass::~DX8PolygonRendererClass()
-{
- if (texture_category) texture_category->Remove_Polygon_Renderer(this);
-}
-
-// ----------------------------------------------------------------------------
-
-void DX8PolygonRendererClass::Log()
-{
- StringClass work(true);
-
- work.Format(" %8d %8d %6d %6d %6d %s\n",
- index_count,
- index_count/3,
- index_offset,
- min_vertex_index,
- vertex_index_range,
- mmc->Get_Name());
-
-/* work.Format(
- " Index count: %d (%d polys) i_offset: %d min_vi: %d vi_range: %d ident: %d (%s)\n",
- index_count,
- index_count/3,
- index_offset,
- min_vertex_index,
- vertex_index_range,
- mmc->ident,
- mmc->Get_Name());
-*/ WWDEBUG_SAY((work));
-}
-
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8polygonrenderer.h b/Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8polygonrenderer.h
deleted file mode 100644
index 10200285fc1..00000000000
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8polygonrenderer.h
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
-** 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 .
-*/
-
-/***********************************************************************************************
- *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
- ***********************************************************************************************
- * *
- * Project Name : ww3d *
- * *
- * $Archive:: /Commando/Code/ww3d2/dx8polygonrenderer.h $*
- * *
- * Original Author:: Greg Hjelstrom *
- * *
- * $Author:: Jani_p $*
- * *
- * $Modtime:: 7/12/01 6:38p $*
- * *
- * $Revision:: 22 $*
- * *
- *---------------------------------------------------------------------------------------------*
- * Functions: *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-
-#if defined(_MSC_VER)
-#pragma once
-#endif
-
-#ifndef DX8_POLYGON_RENDERER_H
-#define DX8_POLYGON_RENDERER_H
-
-
-#include "always.h"
-#include "meshmdl.h"
-#include "dx8list.h"
-#include "sortingrenderer.h"
-#include "mesh.h"
-#include "dx8wrapper.h"
-
-class DX8PolygonRendererClass;
-class DX8TextureCategoryClass;
-
-
-/**
-** DX8PolygonRendererClass
-** This is a record of a batch/range of polygons to be rendered. These hang off of the DX8TextureCategoryClass's
-** and are rendered after the system installs a vertex buffer and textures in the DX8 wrapper.
-*/
-class DX8PolygonRendererClass : public MultiListObjectClass
-{
- MeshModelClass * mmc;
- DX8TextureCategoryClass * texture_category;
- unsigned index_offset; // absolute index of index 0 for our parent mesh
- unsigned vertex_offset; // absolute index of vertex 0 for our parent mesh
- unsigned index_count; // number of indices
- unsigned min_vertex_index; // relative index of the first vertex our polys reference
- unsigned vertex_index_range; // range to the last vertex our polys reference
- bool strip; // is this a strip?
- unsigned pass; // rendering pass
-
-public:
- DX8PolygonRendererClass(
- unsigned index_count,
- MeshModelClass* mmc_,
- DX8TextureCategoryClass* tex_cat,
- unsigned vertex_offset,
- unsigned index_offset,
- bool strip,
- unsigned pass);
- DX8PolygonRendererClass(const DX8PolygonRendererClass& src,MeshModelClass* mmc_);
- ~DX8PolygonRendererClass();
-
- void Render(/*const Matrix3D & tm,*/int base_vertex_offset);
- void Render_Sorted(/*const Matrix3D & tm,*/int base_vertex_offset,const SphereClass & bounding_sphere);
- void Set_Vertex_Index_Range(unsigned min_vertex_index_,unsigned vertex_index_range_);
-
- unsigned Get_Vertex_Offset(void) { return vertex_offset; }
- unsigned Get_Index_Offset(void) { return index_offset; }
- inline unsigned Get_Pass(void) { return pass; }
-
- MeshModelClass* Get_Mesh_Model_Class() { return mmc; }
- DX8TextureCategoryClass* Get_Texture_Category() { return texture_category; }
- void Set_Texture_Category(DX8TextureCategoryClass* tc) { texture_category=tc; }
-
- void Log();
-};
-
-// ----------------------------------------------------------------------------
-
-inline void DX8PolygonRendererClass::Set_Vertex_Index_Range(unsigned min_vertex_index_,unsigned vertex_index_range_)
-{
-// WWDEBUG_SAY(("Set_Vertex_Index_Range - min: %d, range: %d\n",min_vertex_index_,vertex_index_range_));
-// if (vertex_index_range_>30000) {
-// int a=0;
-// a++;
-// }
- min_vertex_index=min_vertex_index_;
- vertex_index_range=vertex_index_range_;
-}
-
-// ----------------------------------------------------------------------------
-
-inline void DX8PolygonRendererClass::Render(/*const Matrix3D & tm,*/int base_vertex_offset)
-{
-// DX8Wrapper::Set_Transform(D3DTS_WORLD,tm);
-// SNAPSHOT_SAY(("Set_Transform\n"));
- SNAPSHOT_SAY(("Set_Index_Buffer_Index_Offset(%d)\n",base_vertex_offset));
-
- DX8Wrapper::Set_Index_Buffer_Index_Offset(base_vertex_offset);
- if (strip) {
- SNAPSHOT_SAY(("Draw_Strip(%d,%d,%d,%d)\n",index_offset,index_count-2,min_vertex_index,vertex_index_range));
- DX8Wrapper::Draw_Strip(
- index_offset,
- index_count-2,
- min_vertex_index,
- vertex_index_range);
- }
- else {
- SNAPSHOT_SAY(("Draw_Triangles(%d,%d,%d,%d)\n",index_offset,index_count-2,min_vertex_index,vertex_index_range));
- DX8Wrapper::Draw_Triangles(
- index_offset,
- index_count/3,
- min_vertex_index,
- vertex_index_range);
- }
-}
-
-inline void DX8PolygonRendererClass::Render_Sorted(/*const Matrix3D & tm,*/int base_vertex_offset,const SphereClass & bounding_sphere)
-{
- WWASSERT(!strip); // Strips can't be sorted for now
-// DX8Wrapper::Set_Transform(D3DTS_WORLD,tm);
-// SNAPSHOT_SAY(("Set_Transform\n"));
- SNAPSHOT_SAY(("Set_Index_Buffer_Index_Offset(%d)\n",base_vertex_offset));
- SNAPSHOT_SAY(("Insert_Sorting_Triangles(%d,%d,%d,%d)\n",index_offset,index_count-2,min_vertex_index,vertex_index_range));
-
- DX8Wrapper::Set_Index_Buffer_Index_Offset(base_vertex_offset);
- SortingRendererClass::Insert_Triangles(
- bounding_sphere,
- index_offset,
- index_count/3,
- min_vertex_index,
- vertex_index_range);
-
-}
-
-#endif
\ No newline at end of file
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8webbrowser.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8webbrowser.cpp
deleted file mode 100644
index f806904303d..00000000000
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8webbrowser.cpp
+++ /dev/null
@@ -1,260 +0,0 @@
-/*
-** 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 .
-*/
-
-//******************************************************************************************
-//
-// Earth And Beyond
-// Copyright (c) 2002 Electronic Arts , Inc. - Westwood Studios
-//
-// File Name : dx8webbrowser.cpp
-// Description : Implementation of D3D Embedded Browser wrapper.
-// Author : Darren Schueller
-// Date of Creation : 6/4/2002
-//
-//******************************************************************************************
-// $Header: $
-//******************************************************************************************
-
-#include "dx8webbrowser.h"
-#include "ww3d.h"
-#include "dx8wrapper.h"
-
-#if ENABLE_EMBEDDED_BROWSER
-
-#if defined(_MSC_VER) && _MSC_VER < 1300
-
-// Import the Browser Type Library
-// BGC, the path for the dll file is pretty odd, no?
-// I'll leave it like this till I can figure out a
-// better way.
-#import "../../../../../Run/BrowserEngine.dll" no_namespace
-
-#else
-
-#include
-#include
-
-#include "EABrowserEngine/BrowserEngine.h"
-
-typedef _com_ptr_t<_com_IIID> IFEBrowserEngine2Ptr;
-
-#endif
-
-static IFEBrowserEngine2Ptr pBrowser = 0;
-
-HWND DX8WebBrowser::hWnd = 0;
-
-bool DX8WebBrowser::Initialize( const char* badpageurl,
- const char* loadingpageurl,
- const char* mousefilename,
- const char* mousebusyfilename)
-{
- if(pBrowser == 0)
- {
- // Initialize COM
- CoInitialize(0);
-
- // Create an instance of the browser control
- HRESULT hr = pBrowser.CreateInstance(__uuidof(FEBrowserEngine2));
-
- if(hr == REGDB_E_CLASSNOTREG)
- {
- HMODULE lib = ::LoadLibrary("BrowserEngine.DLL");
- if(lib)
- {
- FARPROC proc = ::GetProcAddress(lib,"DllRegisterServer");
- if(proc)
- {
- proc();
- // Create an instance of the browser control
- hr = pBrowser.CreateInstance(__uuidof(FEBrowserEngine2));
- }
- FreeLibrary(lib);
- }
- }
-
- // Initialize the browser.
- if(hr == S_OK)
- {
- hWnd = (HWND)WW3D::Get_Window();
- pBrowser->Initialize(reinterpret_cast(DX8Wrapper::_Get_D3D_Device8()));
-
- if(badpageurl)
- pBrowser->put_BadPageURL(_bstr_t(badpageurl));
-
- if(loadingpageurl)
- pBrowser->put_LoadingPageURL(_bstr_t(loadingpageurl));
-
- if(mousefilename)
- pBrowser->put_MouseFileName(_bstr_t(mousefilename));
-
- if(mousebusyfilename)
- pBrowser->put_MouseBusyFileName(_bstr_t(mousebusyfilename));
- }
- else
- {
- pBrowser = 0;
- return false;
- }
- }
-
- return true;
-}
-
-void DX8WebBrowser::Shutdown()
-{
- if(pBrowser)
- {
- // Shutdown the browser
- pBrowser->Shutdown();
-
- // Release the smart pointer.
- pBrowser = 0;
-
- hWnd = 0;
-
- // Shut down COM
- CoUninitialize();
- }
-}
-
-
-// ******************************************************************************************
-// * Function Name: DX8WebBrowser::Update
-// ******************************************************************************************
-// * Description: Updates the browser image surfaces by copying the bits from the browser
-// * DCs to the D3D Image surfaces.
-// *
-// * Return Type:
-// *
-// * Argument: void
-// *
-// ******************************************************************************************
-void DX8WebBrowser::Update(void)
-{
- if(pBrowser) pBrowser->D3DUpdate();
-};
-
-
-// ******************************************************************************************
-// * Function Name: DX8WebBrowser::Render
-// ******************************************************************************************
-// * Description: Draws all browsers to the back buffer.
-// *
-// * Return Type:
-// *
-// * Argument: int backbufferindex
-// *
-// ******************************************************************************************
-void DX8WebBrowser::Render(int backbufferindex)
-{
- if(pBrowser) pBrowser->D3DRender(backbufferindex);
-};
-
-// ******************************************************************************************
-// * Function Name: DX8WebBrowser::CreateBrowser
-// ******************************************************************************************
-// * Description: Creates a browser window.
-// *
-// * Return Type:
-// *
-// * Argument: const char* browsername - This is a "name" used to identify the
-// * browser instance. Multiple browsers can
-// * be created, and are referenced using this name.
-// * Argument: const char* url - The url to display.
-// * Argument: int x - The position and size of the browser (in pixels)
-// * Argument: int y
-// * Argument: int w
-// * Argument: int h
-// * Argument: int updateticks - When non-zero, this forces the browser image to get updated
-// * at the specified rate (number of milliseconds) regardless
-// * of paint messages. When this is zero (the default) the browser
-// * image is only updated whenever a paint message is received.
-// *
-// ******************************************************************************************
-void DX8WebBrowser::CreateBrowser(const char* browsername, const char* url, int x, int y, int w, int h, int updateticks, LONG options, LPDISPATCH gamedispatch)
-{
- WWDEBUG_SAY(("DX8WebBrowser::CreateBrowser - Creating browser with the name %s, url = %s, (x, y, w, h) = (%d, %d, %d, %d), update ticks = %d\n", browsername, url, x, y, h, w, updateticks));
- if(pBrowser)
- {
- _bstr_t brsname(browsername);
- pBrowser->CreateBrowser(brsname, _bstr_t(url), reinterpret_cast(hWnd), x, y, w, h, options, gamedispatch);
- pBrowser->SetUpdateRate(brsname, updateticks);
- }
-}
-
-
-// ******************************************************************************************
-// * Function Name: DX8WebBrowser::DestroyBrowser
-// ******************************************************************************************
-// * Description: Destroys the specified browser. This closes the window and releases
-// * the browser instance.
-// *
-// * Return Type:
-// *
-// * Argument: const char* browsername - The name of the browser to destroy.
-// *
-// ******************************************************************************************
-void DX8WebBrowser::DestroyBrowser(const char* browsername)
-{
- WWDEBUG_SAY(("DX8WebBrowser::DestroyBrowser - destroying browser %s\n", browsername));
- if(pBrowser)
- pBrowser->DestroyBrowser(_bstr_t(browsername));
-}
-
-
-// ******************************************************************************************
-// * Function Name: DX8WebBrowser::Is_Browser_Open
-// ******************************************************************************************
-// * Description: This function checks to see if a browser of the specified name exists and
-// * is currently open.
-// *
-// * Return Type:
-// *
-// * Argument: const char* browsername - The name of the browser to test.
-// *
-// ******************************************************************************************
-bool DX8WebBrowser::Is_Browser_Open(const char* browsername)
-{
- if(pBrowser == 0) return false;
-#if defined(_MSC_VER) && _MSC_VER < 1300
- return (pBrowser->IsOpen(_bstr_t(browsername)) != 0);
-#else
- long isOpen;
- return (pBrowser->IsOpen(_bstr_t(browsername), &isOpen) != 0);
-#endif
-}
-
-// ******************************************************************************************
-// * Function Name: DX8WebBrowser::Navigate
-// ******************************************************************************************
-// * Description: This function causes the browser to navigate to the specified page.
-// *
-// * Return Type:
-// *
-// * Argument: const char* browsername - The name of the browser to test.
-// * const char* url - The url to navigate to.
-// *
-// ******************************************************************************************
-void DX8WebBrowser::Navigate(const char* browsername, const char* url)
-{
- if(pBrowser == 0) return;
- pBrowser->Navigate(_bstr_t(browsername),_bstr_t(url));
-}
-
-#endif
\ No newline at end of file
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8webbrowser.h b/Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8webbrowser.h
deleted file mode 100644
index 82d68c35d71..00000000000
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8webbrowser.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
-** 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 .
-*/
-
-//******************************************************************************************
-//
-// Earth And Beyond
-// Copyright (c) 2002 Electronic Arts , Inc. - Westwood Studios
-//
-// File Name : dx8webbrowser.h
-// Description : Implementation of D3D Embedded Browser Wrapper
-// Author : Darren Schueller
-// Date of Creation : 6/4/2002
-//
-//******************************************************************************************
-// $Header: $
-//******************************************************************************************
-
-#ifndef DX8_WEBBROWSER_H
-#define DX8_WEBBROWSER_H
-
-#include
-#include "d3d8.h"
-
-// ***********************************
-// Set this to 0 to remove all embedded browser code.
-//
-#define ENABLE_EMBEDDED_BROWSER 1
-//
-// ***********************************
-
-#if ENABLE_EMBEDDED_BROWSER
-
-// These options must match the browser option bits defined in the BrowserEngine code.
-// Look in febrowserengine.h
-#define BROWSEROPTION_SCROLLBARS 0x0001
-#define BROWSEROPTION_3DBORDER 0x0002
-
-struct IDirect3DDevice8;
-
-/**
-** DX8WebBrowser
-**
-** DX8 interface wrapper class. This encapsulates the BrowserEngine interface.
-*/
-class DX8WebBrowser
-{
-public:
-
- static bool Initialize( const char* badpageurl = 0,
- const char* loadingpageurl = 0,
- const char* mousefilename = 0,
- const char* mousebusyfilename = 0); //Initialize the Embedded Browser
-
- static void Shutdown(void); // Shutdown the embedded browser. Will close any open browsers.
-
- static void Update(void); // Copies all browser contexts to D3D Image surfaces.
- static void Render(int backbufferindex); //Draws all browsers to the backbuffer.
-
- // Creates a browser with the specified name
- static void CreateBrowser(const char* browsername, const char* url, int x, int y, int w, int h, int updateticks = 0, LONG options = BROWSEROPTION_SCROLLBARS | BROWSEROPTION_3DBORDER, LPDISPATCH gamedispatch = 0);
-
- // Destroys the browser with the specified name
- static void DestroyBrowser(const char* browsername);
-
- // Returns true if a browser with the specified name is open.
- static bool Is_Browser_Open(const char* browsername);
-
- // Navigates the specified browser to the specified page.
- static void Navigate(const char* browsername, const char* url);
-
-private:
- // The window handle of the application. This is initialized by Initialize().
- static HWND hWnd;
-};
-
-#endif
-
-#endif
\ No newline at end of file
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/dynamesh.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/dynamesh.cpp
deleted file mode 100644
index 8cecd495f2d..00000000000
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/dynamesh.cpp
+++ /dev/null
@@ -1,835 +0,0 @@
-/*
-** 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 .
-*/
-
-/***************************************************************************
- *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
- ***************************************************************************
- * *
- * Project Name : Commando *
- * *
- * $Archive:: /Commando/Code/ww3d2/dynamesh.cpp $*
- * *
- * $Author:: Greg_h $*
- * *
- * $Modtime:: 12/03/01 4:50p $*
- * *
- * $Revision:: 25 $*
- * *
- *-------------------------------------------------------------------------*
- * Functions: *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-#include "dynamesh.h"
-#include "dx8vertexbuffer.h"
-#include "dx8indexbuffer.h"
-#include "dx8wrapper.h"
-#include "sortingrenderer.h"
-#include "rinfo.h"
-#include "camera.h"
-#include "dx8fvf.h"
-
-
-
-/*
-** DynamicMeshModel implementation
-*/
-
-DynamicMeshModel::DynamicMeshModel(unsigned int max_polys, unsigned int max_verts) :
- MeshGeometryClass(),
- DynamicMeshPNum(0),
- DynamicMeshVNum(0),
- MatDesc(NULL),
- MatInfo(NULL)
-{
- MatInfo = NEW_REF(MaterialInfoClass, ());
-
- MatDesc = W3DNEW MeshMatDescClass;
- MatDesc->Set_Polygon_Count(max_polys);
- MatDesc->Set_Vertex_Count(max_verts);
-
- Reset_Geometry(max_polys, max_verts);
-}
-
-DynamicMeshModel::DynamicMeshModel(unsigned int max_polys, unsigned int max_verts, MaterialInfoClass *mat_info) :
- MeshGeometryClass(),
- DynamicMeshPNum(0),
- DynamicMeshVNum(0),
- MatDesc(NULL),
- MatInfo(NULL)
-{
- MatInfo = mat_info;
- MatInfo->Add_Ref();
-
- MatDesc = W3DNEW MeshMatDescClass;
- MatDesc->Set_Polygon_Count(max_polys);
- MatDesc->Set_Vertex_Count(max_verts);
-
- Reset_Geometry(max_polys, max_verts);
-}
-
-DynamicMeshModel::DynamicMeshModel(const DynamicMeshModel &src) :
- MeshGeometryClass(src),
- DynamicMeshPNum(src.DynamicMeshPNum),
- DynamicMeshVNum(src.DynamicMeshVNum),
- MatDesc(NULL),
- MatInfo(NULL)
-{
- // Copy the material info structure.
- MatInfo = NEW_REF(MaterialInfoClass, (*(src.MatInfo)));
-
-
- // [SKB: Feb 21 2002 @ 11:47pm] :
- // Moved before the remapping cause I don't like referencing null.
- MatDesc = W3DNEW MeshMatDescClass;
-
- // remap!
- MaterialRemapperClass remapper(src.MatInfo, MatInfo);
- remapper.Remap_Mesh(src.MatDesc, MatDesc);
-}
-
-DynamicMeshModel::~DynamicMeshModel(void)
-{
- if (MatDesc) {
- delete MatDesc;
- MatDesc = NULL;
- }
- REF_PTR_RELEASE(MatInfo);
-}
-
-void DynamicMeshModel::Compute_Plane_Equations(void)
-{
- // Make sure the arrays are allocated before we do this
- get_vert_normals();
- Vector4 * planes = get_planes(true);
-
- // Set the poly and vertex counts to the dynamic counts, call the base class function, then
- // set them back.
- int old_poly_count = PolyCount;
- int old_vert_count = VertexCount;
- PolyCount = DynamicMeshPNum;
- VertexCount = DynamicMeshVNum;
-
- MeshGeometryClass::Compute_Plane_Equations(planes);
-
- PolyCount = old_poly_count;
- VertexCount = old_vert_count;
-}
-
-void DynamicMeshModel::Compute_Vertex_Normals(void)
-{
- // Make sure the arrays are allocated before we do this
- Vector3 * vnorms = get_vert_normals();
- get_planes(true);
-
- // Set the poly and vertex counts to the dynamic counts, call the base class function, then
- // set them back.
- int old_poly_count = PolyCount;
- int old_vert_count = VertexCount;
- PolyCount = DynamicMeshPNum;
- VertexCount = DynamicMeshVNum;
-
- MeshGeometryClass::Compute_Vertex_Normals(vnorms);
-
- PolyCount = old_poly_count;
- VertexCount = old_vert_count;
-}
-
-void DynamicMeshModel::Compute_Bounds(Vector3 * verts)
-{
- // Set the poly and vertex counts to the dynamic counts, call the base class function, then
- // set them back.
- int old_poly_count = PolyCount;
- int old_vert_count = VertexCount;
- PolyCount = DynamicMeshPNum;
- VertexCount = DynamicMeshVNum;
-
- MeshGeometryClass::Compute_Bounds(verts);
-
- PolyCount = old_poly_count;
- VertexCount = old_vert_count;
-}
-
-void DynamicMeshModel::Reset(void)
-{
- Set_Counts(0, 0);
- int polycount = Get_Polygon_Count();
- int vertcount = Get_Vertex_Count();
- Reset_Geometry(polycount, vertcount);
- MatDesc->Reset(polycount, vertcount, 1);
- REF_PTR_RELEASE(MatInfo);
- MatInfo = NEW_REF(MaterialInfoClass, ());
-}
-
-void DynamicMeshModel::Render(RenderInfoClass & rinfo)
-{
- // Process texture reductions:
-// MatInfo->Process_Texture_Reduction();
-
- unsigned buffer_type=(Get_Flag(MeshGeometryClass::SORT)&& WW3D::Is_Sorting_Enabled()) ? BUFFER_TYPE_DYNAMIC_SORTING : BUFFER_TYPE_DYNAMIC_DX8;
-
- /*
- ** Write the vertex data to the vertex buffer. We assume the FVF contains positions, normals,
- ** one texture channel, and the diffuse color channel (color0). If it does not contain all
- ** these components, the code will fail.
- */
- DynamicVBAccessClass dynamic_vb(buffer_type,dynamic_fvf_type,DynamicMeshVNum);
- const FVFInfoClass &fvf_info = dynamic_vb.FVF_Info();
-
- { // scope for lock
-
- DynamicVBAccessClass::WriteLockClass lock(&dynamic_vb);
- unsigned char *vertices = (unsigned char*)lock.Get_Formatted_Vertex_Array();
- const Vector3 *locs = Get_Vertex_Array();
- const Vector3 *normals = Get_Vertex_Normal_Array();
- const Vector2 *uvs = MatDesc->Get_UV_Array_By_Index(0, false);
- const Vector2 *uv1s = MatDesc->Get_UV_Array_By_Index(1, false);
- const unsigned *colors = MatDesc->Get_Color_Array(0, false);
- const static Vector3 default_normal(0.0f, 0.0f, 0.0f);
- const static Vector2 default_uv(0.0f, 0.0f);
- const unsigned int default_color = 0xFFFFFFFF;
- for (int i=0; i < DynamicMeshVNum; i++)
- {
- *(Vector3 *)(vertices + fvf_info.Get_Location_Offset()) = locs[i];
- *(Vector3 *)(vertices + fvf_info.Get_Normal_Offset()) = normals[i];
- if (uvs) {
- *(Vector2 *)(vertices + fvf_info.Get_Tex_Offset(0)) = uvs[i];
- } else {
- *(Vector2 *)(vertices + fvf_info.Get_Tex_Offset(0)) = default_uv;
- }
- if (uv1s) {
- *(Vector2 *)(vertices + fvf_info.Get_Tex_Offset(1)) = uv1s[i];
- } else {
- *(Vector2 *)(vertices + fvf_info.Get_Tex_Offset(1)) = default_uv;
- }
-
- if (colors) {
- *(unsigned int *)(vertices + fvf_info.Get_Diffuse_Offset()) = colors[i];
- } else {
- *(unsigned int *)(vertices + fvf_info.Get_Diffuse_Offset()) = default_color;
- }
- vertices += fvf_info.Get_FVF_Size();
- }
-
- } // end scope for lock
-
- /*
- ** Write index data to index buffers
- */
- DynamicIBAccessClass dynamic_ib(buffer_type,DynamicMeshPNum * 3);
- const TriIndex *tris = Get_Polygon_Array();
-
- { // scope for lock
-
- DynamicIBAccessClass::WriteLockClass lock(&dynamic_ib);
- unsigned short * indices = lock.Get_Index_Array();
- for (int i=0; i < DynamicMeshPNum; i++)
- {
- indices[i*3 + 0] = (unsigned short)tris[i][0];
- indices[i*3 + 1] = (unsigned short)tris[i][1];
- indices[i*3 + 2] = (unsigned short)tris[i][2];
- }
-
- } // end scope for lock
-
- /*
- ** Set vertex and index buffers
- */
- DX8Wrapper::Set_Vertex_Buffer(dynamic_vb);
- DX8Wrapper::Set_Index_Buffer(dynamic_ib,0);
-
- /*
- ** Draw dynamesh, one pass at a time
- */
- unsigned int pass_count = Get_Pass_Count();
- for (unsigned int pass = 0; pass < pass_count; pass++) {
-
- /*
- ** Set current render states (texture, vertex material, shader). Scan triangles until one
- ** of these changes, and then draw.
- */
-
- // The vertex index range used
- unsigned short min_vert_idx = DynamicMeshVNum - 1;
- unsigned short max_vert_idx = 0;
- unsigned short start_tri_idx = 0;
- unsigned short cur_tri_idx = 0;
-
- bool done = false;
- bool texture_changed = false;
- bool texture1_changed = false;
- bool material_changed = false;
- bool shader_changed = false;
-
- TextureClass **texture_array0 = NULL;
- TexBufferClass * tex_buf = MatDesc->Get_Texture_Array(pass, 0, false);
- if (tex_buf) {
- texture_array0 = tex_buf->Get_Array();
- } else {
- texture_array0 = NULL;
- }
-
- TextureClass **texture_array1 = NULL;
- TexBufferClass * tex_buf1 = MatDesc->Get_Texture_Array(pass, 1, false);
- if (tex_buf1) {
- texture_array1 = tex_buf1->Get_Array();
- } else {
- texture_array1 = NULL;
- }
-
- VertexMaterialClass **material_array = NULL;
- MatBufferClass * mat_buf = MatDesc->Get_Material_Array(pass, false);
- if (mat_buf) {
- material_array = mat_buf->Get_Array();
- } else {
- material_array = NULL;
- }
- ShaderClass *shader_array = MatDesc->Get_Shader_Array(pass, false);
-
- // Set the DX8 state to the first triangle's state
- if (texture_array0) {
- DX8Wrapper::Set_Texture(0,texture_array0[0]);
- } else {
- DX8Wrapper::Set_Texture(0,MatDesc->Peek_Single_Texture(pass, 0));
- }
-
- if (texture_array1) {
- DX8Wrapper::Set_Texture(1,texture_array1[0]);
- } else {
- DX8Wrapper::Set_Texture(1,MatDesc->Peek_Single_Texture(pass, 1));
- }
-
- if (material_array) {
- DX8Wrapper::Set_Material(material_array[tris[0].I]);
- } else {
- DX8Wrapper::Set_Material(MatDesc->Peek_Single_Material(pass));
- }
- if (shader_array) {
- DX8Wrapper::Set_Shader(shader_array[0]);
- } else {
- DX8Wrapper::Set_Shader(MatDesc->Get_Single_Shader(pass));
- }
-
- SphereClass sphere(Vector3(0.0f,0.0f,0.0f),0.0f);
- Get_Bounding_Sphere(&sphere);
-
- // If no texture, shader or material arrays for this pass just draw and go to next pass
- if (!texture_array0 && !texture_array1 && !material_array && !shader_array) {
- if (buffer_type==BUFFER_TYPE_DYNAMIC_SORTING) {
- SortingRendererClass::Insert_Triangles(sphere,0, DynamicMeshPNum, 0, DynamicMeshVNum);
- }
- else {
- DX8Wrapper::Draw_Triangles(0, DynamicMeshPNum, 0, DynamicMeshVNum);
- }
- continue;
- }
-
- while (!done) {
-
- // Add vertex indices of tri[cur_tri_idx] to min_vert_idx, max_vert_idx
- const TriIndex &tri = tris[cur_tri_idx];
- unsigned short min_idx = (unsigned short)MIN(MIN(tri.I, tri.J), tri.K);
- unsigned short max_idx = (unsigned short)MAX(MAX(tri.I, tri.J), tri.K);
- min_vert_idx = MIN(min_vert_idx, min_idx);
- max_vert_idx = MAX(max_vert_idx, max_idx);
-
- // Check the next triangle to see if the current run has ended.
- unsigned short next_tri_idx = cur_tri_idx + 1;
- done = next_tri_idx >= DynamicMeshPNum;
- if (done) {
- texture_changed = false;
- texture1_changed = false;
- material_changed = false;
- shader_changed = false;
- } else {
- texture_changed = texture_array0 && texture_array0[cur_tri_idx] != texture_array0[next_tri_idx];
- texture1_changed = texture_array1 && texture_array1[cur_tri_idx] != texture_array1[next_tri_idx];
- material_changed = material_array && material_array[tris[cur_tri_idx].I] != material_array[tris[next_tri_idx].I];
- shader_changed = shader_array && shader_array[cur_tri_idx] != shader_array[next_tri_idx];
- }
-
- // If run ends (mesh ends or state changes) draw, reset indices, set state for next run.
- if (done || texture_changed || material_changed || shader_changed) {
- if (buffer_type==BUFFER_TYPE_DYNAMIC_SORTING) {
- SortingRendererClass::Insert_Triangles(
- sphere,
- (start_tri_idx * 3),
- (1 + cur_tri_idx - start_tri_idx),
- min_vert_idx,
- 1 + max_vert_idx - min_vert_idx);
- }
- else {
- DX8Wrapper::Draw_Triangles(
- (start_tri_idx * 3),
- (1 + cur_tri_idx - start_tri_idx),
- min_vert_idx,
- 1 + max_vert_idx - min_vert_idx);
- }
- start_tri_idx = next_tri_idx;
- min_vert_idx = DynamicMeshVNum - 1;
- max_vert_idx = 0;
- if (texture_changed) DX8Wrapper::Set_Texture(0,texture_array0[next_tri_idx]);
- if (texture1_changed) DX8Wrapper::Set_Texture(1,texture_array1[next_tri_idx]);
- if (material_changed) DX8Wrapper::Set_Material(material_array[tris[next_tri_idx].I]);
- if (shader_changed) DX8Wrapper::Set_Shader(shader_array[next_tri_idx]);
- }
-
- cur_tri_idx = next_tri_idx;
-
- } // while (!done)
-
- } // for (pass)
-
-}
-
-void DynamicMeshModel::Initialize_Texture_Array(int pass, int stage, TextureClass *texture)
-{
- TexBufferClass * texlist = MatDesc->Get_Texture_Array(pass, 0, true);
- for (int lp = 0; lp < PolyCount; lp++) {
- texlist->Set_Element(lp, texture);
- }
-}
-
-void DynamicMeshModel::Initialize_Material_Array(int pass, VertexMaterialClass *vmat)
-{
- MatBufferClass * vertmatlist = MatDesc->Get_Material_Array(pass, true);
- for (int lp = 0; lp < VertexCount; lp++) {
- vertmatlist->Set_Element(lp, vmat);
- }
-}
-
-void DynamicMeshClass::Render(RenderInfoClass & rinfo)
-{
- if (Is_Not_Hidden_At_All() == false) return;
-
- // test for an empty mesh..
- if (PolyCount == 0 ) return;
-
- // If static sort lists are enabled and this mesh has a sort level, put it on the list instead
- // of rendering it.
-
- if (WW3D::Are_Static_Sort_Lists_Enabled() && SortLevel != SORT_LEVEL_NONE) {
-
- WW3D::Add_To_Static_Sort_List(this, SortLevel);
-
- } else {
-
- const FrustumClass & frustum = rinfo.Camera.Get_Frustum();
-
- if (CollisionMath::Overlap_Test(frustum, Get_Bounding_Box()) != CollisionMath::OUTSIDE) {
- DX8Wrapper::Set_Transform(D3DTS_WORLD, Transform);
- Model->Render(rinfo);
- }
- }
-}
-
-bool DynamicMeshClass::End_Vertex()
-{
- // check that we have room for a new vertex
- WWASSERT(VertCount < Model->Get_Vertex_Count());
-
- // if we are a multi-material object record the material
- int pass = Get_Pass_Count();
- while (pass--) {
- if (MultiVertexMaterial[pass]) {
- VertexMaterialClass *mat = Peek_Material_Info()->Get_Vertex_Material(VertexMaterialIdx[pass]);
- Model->Set_Material(VertCount, mat, pass);
- REF_PTR_RELEASE(mat);
- }
-
- }
-
- // if we are multi colored, record the color
- for (int color_array_index = 0; color_array_index < MAX_COLOR_ARRAYS; color_array_index++) {
- if (MultiVertexColor[color_array_index]) {
-// Vector4 * color = &((Model->Get_Color_Array(color_array_index))[VertCount]);
-// color->X = CurVertexColor[color_array_index].X;
-// color->Y = CurVertexColor[color_array_index].Y;
-// color->Z = CurVertexColor[color_array_index].Z;
-// color->W = CurVertexColor[color_array_index].W;
- unsigned * color = &((Model->Get_Color_Array(color_array_index))[VertCount]);
- *color=DX8Wrapper::Convert_Color_Clamp(CurVertexColor[color_array_index]);
- }
- }
-
- // mark this vertex as being complete
- VertCount++;
- TriVertexCount++;
-
- // if we have 3 or more vertices, add a new poly
- if (TriVertexCount >= 3) {
-
- // check that we have room for a new poly
- WWASSERT(PolyCount < Model->Get_Polygon_Count());
-
- // set vertex indices
- TriIndex *poly = &(Model->Get_Non_Const_Polygon_Array())[PolyCount];
- if (TriMode == TRI_MODE_STRIPS) {
- (*poly)[0] = VertCount-3;
- (*poly)[1] = VertCount-2;
- (*poly)[2] = VertCount-1;
-
- // for every other tri, reverse vertex order
- if (Flip_Face()) {
- (*poly)[1] = VertCount-1;
- (*poly)[2] = VertCount-2;
- }
- } else {
- (*poly)[0] = FanVertex;
- (*poly)[1] = VertCount-2;
- (*poly)[2] = VertCount-1;
- }
-
- // check each pass
- int pass = Get_Pass_Count();
- while (pass--) {
-
- // If we are multi texture
- if (MultiTexture[pass]) {
- TextureClass *tex = Peek_Material_Info()->Get_Texture(TextureIdx[pass]);
- Model->Set_Texture(PolyCount, tex, pass);
- REF_PTR_RELEASE(tex);
- }
- }
-
- // increase the count and record that we have a new material
- PolyCount++;
- Model->Set_Counts(PolyCount, VertCount);
- }
- return true;
-}
-
-/******************************************************************
-**
-** DynamicMeshClass
-**
-*******************************************************************/
-DynamicMeshClass::DynamicMeshClass(int max_poly, int max_vert) :
- Model(NULL),
- PolyCount(0),
- VertCount(0),
- TriVertexCount(0),
- FanVertex(0),
- TriMode(TRI_MODE_STRIPS),
- SortLevel(SORT_LEVEL_NONE)
-{
- int pass = MAX_PASSES;
- while (pass--) {
- MultiTexture[pass] = false;
- TextureIdx[pass] = -1;
-
- MultiVertexMaterial[pass] = false;
- VertexMaterialIdx[pass] = -1;
- }
-
- for (int color_array_index = 0; color_array_index < MAX_COLOR_ARRAYS; color_array_index++) {
- MultiVertexColor[color_array_index] = false;
- CurVertexColor[color_array_index].Set(1.0f, 1.0f, 1.0f, 1.0f);
- }
-
- Model = NEW_REF(DynamicMeshModel, (max_poly, max_vert));
-}
-
-DynamicMeshClass::DynamicMeshClass(int max_poly, int max_vert, MaterialInfoClass *mat_info) :
- Model(NULL),
- PolyCount(0),
- VertCount(0),
- TriVertexCount(0),
- FanVertex(0),
- TriMode(TRI_MODE_STRIPS),
- SortLevel(SORT_LEVEL_NONE)
-{
- int pass = MAX_PASSES;
- while (pass--) {
- MultiTexture[pass] = false;
- TextureIdx[pass] = -1;
-
- MultiVertexMaterial[pass] = false;
- VertexMaterialIdx[pass] = -1;
- }
-
- for (int color_array_index = 0; color_array_index < MAX_COLOR_ARRAYS; color_array_index++) {
- MultiVertexColor[color_array_index] = false;
- CurVertexColor[color_array_index].Set(1.0f, 1.0f, 1.0f, 1.0f);
- }
-
- Model = NEW_REF(DynamicMeshModel, (max_poly, max_vert, mat_info));
-}
-
-DynamicMeshClass::DynamicMeshClass(const DynamicMeshClass & src) :
- RenderObjClass(src),
- Model(NULL),
- PolyCount(src.PolyCount),
- VertCount(src.VertCount),
- TriVertexCount(src.TriVertexCount),
- FanVertex(src.FanVertex),
- TriMode(src.TriMode),
- SortLevel(src.SortLevel)
-{
- int pass = MAX_PASSES;
- while (pass--) {
- MultiTexture[pass] = src.MultiTexture[pass];
- TextureIdx[pass] = src.TextureIdx[pass];
-
- MultiVertexMaterial[pass] = src.MultiVertexMaterial[pass];
- VertexMaterialIdx[pass] = src.VertexMaterialIdx[pass];
-
- MultiVertexColor[pass] = src.MultiVertexColor[pass];
- CurVertexColor[pass] = src.CurVertexColor[pass];
- }
-
- for (int color_array_index = 0; color_array_index < MAX_COLOR_ARRAYS; color_array_index++) {
- MultiVertexColor[color_array_index] = src.MultiVertexColor[color_array_index];
- CurVertexColor[color_array_index] = src.CurVertexColor[color_array_index];
- }
-
- Model = NEW_REF(DynamicMeshModel, (*(src.Model)));
-}
-
-void DynamicMeshClass::Resize(int max_polys, int max_verts)
-{
- Reset();
-
- REF_PTR_RELEASE(Model);
- Model = NEW_REF(DynamicMeshModel, (max_polys, max_verts));
-
- // reset all the texture & vertex material indices
- int pass = MAX_PASSES;
- while (pass--) {
- TextureIdx[pass] = -1;
- VertexMaterialIdx[pass] = -1;
- MultiVertexMaterial[pass] = false;
- }
-}
-
-DynamicMeshClass::~DynamicMeshClass()
-{
- REF_PTR_RELEASE(Model);
-}
-
-RenderObjClass * DynamicMeshClass::Clone(void) const
-{
- return NEW_REF(DynamicMeshClass, (*this));
-}
-
-void DynamicMeshClass::Location(float x, float y, float z)
-{
- Vector3 * loc = Model->Get_Vertex_Array();
- assert(loc);
-
- loc[VertCount].X = x;
- loc[VertCount].Y = y;
- loc[VertCount].Z = z;
-}
-
-/*
-** For moving a vertex after the DynaMesh has already been created.
-*/
-void DynamicMeshClass::Move_Vertex(int index, float x, float y, float z)
-{
- Vector3 * loc = Model->Get_Vertex_Array();
- assert(loc);
- loc[index][0] = x;
- loc[index][1] = y;
- loc[index][2] = z;
-}
-
-/*
-** Get a vertex value.
-*/
-void DynamicMeshClass::Get_Vertex(int index, float &x, float &y, float &z)
-{
- Vector3 * loc = Model->Get_Vertex_Array();
- assert(loc);
- x = loc[index][0];
- y = loc[index][1];
- z = loc[index][2];
-}
-
-
-/*
-** Offset the entire mesh
-*/
-void DynamicMeshClass::Translate_Vertices(const Vector3 & offset)
-{
- Vector3 * loc = Model->Get_Vertex_Array();
- assert(loc);
- for (int i=0; i < Get_Num_Vertices(); i++) {
- loc[i].X += offset.X;
- loc[i].Y += offset.Y;
- loc[i].Z += offset.Z;
- }
-
- Set_Dirty_Bounds();
- Set_Dirty_Planes();
-}
-
-int DynamicMeshClass::Set_Vertex_Material(int idx, int pass)
-{
- assert(idx < Peek_Material_Info()->Vertex_Material_Count());
- VertexMaterialIdx[pass] = idx;
- if (!MultiVertexMaterial[pass]) {
- // WWASSERT( VertexMaterialIdx[pass] == 0);
- VertexMaterialClass *mat = Peek_Material_Info()->Get_Vertex_Material(VertexMaterialIdx[pass]);
- Model->Set_Single_Material(mat, pass);
- mat->Release_Ref();
- }
- return VertexMaterialIdx[pass];
-}
-
-int DynamicMeshClass::Set_Vertex_Material(VertexMaterialClass *material, bool dont_search, int pass)
-{
- // Check if same as the last vertex material
- if (Peek_Material_Info()->Vertex_Material_Count() && (VertexMaterialIdx[pass] != -1) && Peek_Material_Info()->Peek_Vertex_Material(VertexMaterialIdx[pass]) == material) {
- return VertexMaterialIdx[pass];
- }
-
- // if there are vertex materials in the list then we may have just jumped
- // to becoming a multi-vertex-material object. Take care of that here.
- if ((!MultiVertexMaterial[pass]) && Peek_Material_Info()->Vertex_Material_Count() && (VertexMaterialIdx[pass] != -1) && Peek_Material_Info()->Peek_Vertex_Material(VertexMaterialIdx[pass]) != material) {
-
- // allocate the array of per-vertex vertex material overrides
- VertexMaterialClass *mat = Peek_Material_Info()->Get_Vertex_Material(VertexMaterialIdx[pass]);
- Model->Initialize_Material_Array(pass, mat);
- mat->Release_Ref();
-
- // flag that we need to write the per -vertex vertex material override array
- MultiVertexMaterial[pass] = true;
- }
-
- // add the material to the material info class if we cant find it in the
- // list. if we are not supposed to search the list for it then just add
- // it.
- if (!dont_search) {
- int lp = 0, found = 0;
- for (; lp < Peek_Material_Info()->Vertex_Material_Count(); lp ++) {
- VertexMaterialClass *mat = Peek_Material_Info()->Get_Vertex_Material(lp);
- if (material == mat) {
- VertexMaterialIdx[pass] = lp;
- found = 1;
- mat->Release_Ref();
- break;
- }
- mat->Release_Ref();
- }
- if (!found) {
- Peek_Material_Info()->Add_Vertex_Material(material);
- VertexMaterialIdx[pass] = Peek_Material_Info()->Vertex_Material_Count() - 1;
- }
- } else {
- Peek_Material_Info()->Add_Vertex_Material(material);
- VertexMaterialIdx[pass] = Peek_Material_Info()->Vertex_Material_Count() - 1;
- }
-
- if (!MultiVertexMaterial[pass]) {
- Model->Set_Single_Material(Peek_Material_Info()->Peek_Vertex_Material(VertexMaterialIdx[pass]), pass);
- }
- return(VertexMaterialIdx[pass]);
-}
-
-int DynamicMeshClass::Set_Texture(int idx, int pass)
-{
- WWASSERT(idx < Peek_Material_Info()->Texture_Count());
- TextureIdx[pass] = idx;
- if (!MultiTexture[pass]) {
- TextureClass *tex = Peek_Material_Info()->Get_Texture(TextureIdx[pass]);
- Model->Set_Single_Texture(tex, pass);
- tex->Release_Ref();
- }
- return TextureIdx[pass];
-}
-
-int DynamicMeshClass::Set_Texture(TextureClass *texture, bool dont_search, int pass)
-{
- // Check if same as the last texture
- if (Peek_Material_Info()->Texture_Count() && (TextureIdx[pass] != -1) && Peek_Material_Info()->Peek_Texture(TextureIdx[pass]) == texture) {
- return TextureIdx[pass];
- }
-
- // if there are textures in the list then we may have just jumped
- // to becoming a multi-texture object. Take care of that here.
- if ((!MultiTexture[pass]) && Peek_Material_Info()->Texture_Count() && (TextureIdx[pass] != -1) && Peek_Material_Info()->Peek_Texture(TextureIdx[pass]) != texture) {
-
- // allocate the array of per polygon material over-rides
- TextureClass *tex = Peek_Material_Info()->Get_Texture(TextureIdx[pass]);
- Model->Initialize_Texture_Array(pass, 0, tex);
- tex->Release_Ref();
-
- // flag that we need to write the per polygon material overide array
- MultiTexture[pass] = true;
- }
-
- // add the material to the material info class if we cant find it in the
- // list. if we are not supposed to search the list for it then just add
- // it.
- if (!dont_search) {
- int lp = 0, found = 0;
- for (; lp < Peek_Material_Info()->Texture_Count(); lp ++) {
- TextureClass *tex = Peek_Material_Info()->Get_Texture(lp);
- if (texture == tex) {
- TextureIdx[pass] = lp;
- found = 1;
- tex->Release_Ref();
- break;
- }
- tex->Release_Ref();
- }
- if (!found) {
- Peek_Material_Info()->Add_Texture(texture);
- TextureIdx[pass] = Peek_Material_Info()->Texture_Count() - 1;
- }
- } else {
- Peek_Material_Info()->Add_Texture(texture);
- TextureIdx[pass] = Peek_Material_Info()->Texture_Count() - 1;
- }
-
- if (!MultiTexture[pass]) {
- TextureClass *tex = Peek_Material_Info()->Get_Texture(TextureIdx[pass]);
- Model->Set_Single_Texture(tex, pass);
- tex->Release_Ref();
- }
- return(TextureIdx[pass]);
-}
-
-/*
-**
-*/
-// Remap locations to match a screen
-void DynamicScreenMeshClass::Location( float x, float y, float z)
-{
- DynamicMeshClass::Location( (x * 2) - 1, Aspect - (y * 2 * Aspect), 0);
-}
-
-// For moving a vertex after the DynaMesh has already been created.
-void DynamicScreenMeshClass::Move_Vertex(int index, float x, float y, float z)
-{
- DynamicMeshClass::Move_Vertex( index, (x * 2) - 1, Aspect - (y * 2 * Aspect), 0);
-}
-
-// Set position
-void DynamicScreenMeshClass::Set_Position(const Vector3 &v)
-{
- DynamicMeshClass::Set_Position(Vector3(v.X * 2, -(v.Y * 2 * Aspect), 0));
-}
-
-void DynamicScreenMeshClass::Reset( void )
-{
- Reset_Flags();
- Reset_Mesh_Counters();
-}
-
-
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/dynamesh.h b/Generals/Code/Libraries/Source/WWVegas/WW3D2/dynamesh.h
deleted file mode 100644
index cba8c937a45..00000000000
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/dynamesh.h
+++ /dev/null
@@ -1,582 +0,0 @@
-/*
-** 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 .
-*/
-
-/***************************************************************************
- *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
- ***************************************************************************
- * *
- * Project Name : Commando *
- * *
- * $Archive:: /Commando/Code/ww3d2/dynamesh.h $*
- * *
- * $Author:: Greg_h $*
- * *
- * $Modtime:: 12/03/01 4:20p $*
- * *
- * $Revision:: 15 $*
- * *
- *-------------------------------------------------------------------------*/
-
-
-#if defined(_MSC_VER)
-#pragma once
-#endif
-
-#ifndef DYNAMESH_H
-#define DYNAMESH_H
-
-#include "meshgeometry.h"
-#include "meshmatdesc.h"
-#include "matinfo.h"
-#include "rendobj.h"
-#include "polyinfo.h"
-#include "dx8wrapper.h"
-
-class ShaderClass;
-class IntersectionClass;
-class IntersectionResultClass;
-
-/*
-** DynamicMeshModel: used for low-level rendering of DynamicMeshClass.
-** It is composed of the same two classes (one base, one embedded as
-** MeshModelClass, so many of its features are similar (see meshmdl.h)
-*/
-class DynamicMeshModel : public MeshGeometryClass
-{
- W3DMPO_GLUE(DynamicMeshModel)
-
-public:
-
- DynamicMeshModel(unsigned int max_polys, unsigned int max_verts);
- DynamicMeshModel(unsigned int max_polys, unsigned int max_verts, MaterialInfoClass *mat_info);
- DynamicMeshModel(const DynamicMeshModel &src);
- ~DynamicMeshModel(void);
-
- // Inherited from MeshGeometryClass
- virtual void Compute_Plane_Equations(void);
- virtual void Compute_Vertex_Normals(void);
- virtual void Compute_Bounds(Vector3 * verts);
-
- // Reset mesh (with existing max polygon and max vertex counts)
- void Reset(void);
-
- // Render mesh
- void Render(RenderInfoClass & rinfo);
-
- // Set current polygon and vertex counts
- void Set_Counts(int pnum, int vnum) { DynamicMeshPNum = pnum; DynamicMeshVNum = vnum; }
-
- // Access to material stuff:
- unsigned * Get_Color_Array(int color_array_index) { return MatDesc->Get_Color_Array(color_array_index); }
- Vector2 * Get_UV_Array(int uv_array_index) { return MatDesc->Get_UV_Array_By_Index(uv_array_index); }
-
- void Set_Single_Material(VertexMaterialClass * vmat, int pass=0) { MatDesc->Set_Single_Material(vmat, pass); }
- void Set_Single_Texture(TextureClass * tex, int pass=0, int stage=0) { MatDesc->Set_Single_Texture(tex, pass, stage); }
- void Set_Single_Shader(ShaderClass shader, int pass=0) { MatDesc->Set_Single_Shader(shader, pass); }
-
- void Set_Material(int vidx, VertexMaterialClass * vmat, int pass=0) { MatDesc->Set_Material(vidx, vmat, pass); }
- void Set_Shader(int pidx, ShaderClass shader, int pass=0) { MatDesc->Set_Shader(pidx, shader, pass); }
- void Set_Texture(int pidx, TextureClass * tex, int pass=0, int stage=0) { MatDesc->Set_Texture(pidx, tex, pass, stage); }
- void Set_Pass_Count(int passes) { MatDesc->Set_Pass_Count(passes); }
- int Get_Pass_Count(void) const { return MatDesc->Get_Pass_Count(); }
-
- // Create the array (if it doesn't exist), fill it with the supplied value.
- void Initialize_Texture_Array(int pass, int stage, TextureClass *texture = NULL);
- void Initialize_Material_Array(int pass, VertexMaterialClass *vmat = NULL);
-
- // Accessors to material info:
- MaterialInfoClass *Peek_Material_Info(void) { return MatInfo; }
- MaterialInfoClass *Get_Material_Info(void) { if (MatInfo) MatInfo->Add_Ref(); return MatInfo;}
- void Set_Material_Info(MaterialInfoClass *mat_info)
- {
- if (MatInfo)
- MatInfo->Release_Ref();
- WWASSERT(MatInfo != 0);
- MatInfo = mat_info;
- MatInfo->Add_Ref();
- }
-
- // New geometry accessors (non-const)
- TriIndex * Get_Non_Const_Polygon_Array(void);
- Vector3 * Get_Non_Const_Vertex_Normal_Array(void);
-
-private:
-
- // These are current counts, as opposed to those in the mesh geometry and
- // material description which are actually maximum counts.
- int DynamicMeshPNum;
- int DynamicMeshVNum;
-
- // All non-geometry properties (uvs, colors, textures, shaders, etc)
- MeshMatDescClass * MatDesc;
-
- // Lists of textures and vertex materials for ease of processing
- MaterialInfoClass * MatInfo;
-
-};
-
-/*
-** Dynamic Meshes
-*/
-class DynamicMeshClass : public RenderObjClass {
-
-public:
-
- // constructor and destructor
- DynamicMeshClass( int max_poly, int max_vert);
- DynamicMeshClass( int max_poly, int max_vert, MaterialInfoClass *mat_info);
- DynamicMeshClass( const DynamicMeshClass & src);
- virtual ~DynamicMeshClass( void);
-
- // Inherited from RenderObjClass:
- virtual RenderObjClass * Clone(void) const;
- virtual int Class_ID(void) const { return CLASSID_DYNAMESH; }
- virtual void Render(RenderInfoClass & rinfo);
-
- virtual MaterialInfoClass *Peek_Material_Info(void) { return Model->Peek_Material_Info(); }
- virtual MaterialInfoClass *Get_Material_Info(void) { return Model->Get_Material_Info(); }
- virtual void Set_Material_Info(MaterialInfoClass *mat_info) { Model->Set_Material_Info(mat_info); }
-
- // all render objects should be able to tell you how many polygons were
- // used in the making of the render object.
- virtual int Get_Num_Polys(void) const { return PolyCount; }
-
- // return the number of vertices used by this renderobject
- virtual int Get_Num_Vertices(void) const { return VertCount; }
-
- // Get and set static sort level
- virtual int Get_Sort_Level(void) const { return SortLevel; }
- virtual void Set_Sort_Level(int level) { SortLevel = level; if(level != SORT_LEVEL_NONE) Disable_Sort();}
-
- // object space bounding volumes
- virtual inline void Get_Obj_Space_Bounding_Sphere(SphereClass & sphere) const;
- virtual inline void Get_Obj_Space_Bounding_Box(AABoxClass & box) const;
-
- // Set the vertex material for the current triangle
- int Set_Vertex_Material( int idx, int pass = 0);
- int Set_Vertex_Material( VertexMaterialClass *material, bool dont_search = false, int pass = 0);
-
- // Set the number of passes for the mesh
- void Set_Pass_Count(int passes) { assert(PolyCount == 0); Model->Set_Pass_Count(passes); }
- int Get_Pass_Count() { return Model->Get_Pass_Count(); }
-
- // Set the texture for the current triangle
- int Set_Texture( int idx, int pass = 0);
- int Set_Texture( TextureClass *texture, bool dont_search = false, int pass = 0);
-
- // Set the shader for the current triangle
- int Set_Shader( const ShaderClass & shader, int pass = 0) { Model->Set_Single_Shader(shader, pass); return 0; }
-
- // set the shader, texture, and vertex material as found in the polygon info object
- void Set_Polygon_Info(const PolygonInfoClass &polyInfo, bool dont_search_texture = false, bool dont_search_vertex_material = false, int pass = 0)
- {
- // there must be a shader..
- assert(polyInfo.Peek_Shader() != 0);
- Set_Shader(* (polyInfo.Peek_Shader()), pass);
-
- assert(polyInfo.Peek_Vertex_Material() != 0);
- Set_Vertex_Material(polyInfo.Peek_Vertex_Material(), dont_search_vertex_material, pass);
-
- if (polyInfo.Peek_Texture())
- Set_Texture(polyInfo.Peek_Texture(), dont_search_texture, pass);
- }
-
- // Set vertex Color
- inline int Set_Vertex_Color(const Vector4 & color, int color_array_index = 0);
- inline int Set_Vertex_Color(const Vector3 & color, int color_array_index = 0);
-
- // reset the mesh flags
- void Reset_Flags() { Set_Dirty(); }
-
- // Flush the mesh
- void Reset_Native_Mesh() { Model->Reset(); }
-
- // reset our poly and vertex counts
- void Reset_Mesh_Counters()
- {
- Model->Set_Counts(0, 0);
- Disable_Sort();
- PolyCount = 0;
- VertCount = 0;
- }
-
- // Reset all polys and verts. Call the other reset functions directly if you do not want all
- // characteristics to be reset.
- virtual void Reset( void )
- {
- // Note that the active poly count has changed since the last render call by setting the dirty flag
- Reset_Flags();
- Reset_Native_Mesh();
- Reset_Mesh_Counters();
-
- // reset all the texture & vertex material indices
- int pass = MAX_PASSES;
- while (pass--) {
- TextureIdx[pass] = -1;
- VertexMaterialIdx[pass] = -1;
- MultiVertexMaterial[pass] = false;
- }
- }
-
- // Deletes mesh and recreates it with new max_polys and verts.
- void Resize(int max_polys, int max_verts);
-
- // Triangle creation routines
- void Begin_Tri_Strip( void ) { TriVertexCount = 0; TriMode = TRI_MODE_STRIPS; }
- void Begin_Tri_Fan( void ) { TriVertexCount = 0; TriMode = TRI_MODE_FANS; FanVertex = VertCount; }
-
- // vertex creation routines
- void Begin_Vertex( void) {}
-
- virtual void Location( float x, float y, float z);
-
- // version for speedier use in certain cases
- void Location_Inline( float x, float y, float z )
- {
- Vector3 * loc = Model->Get_Vertex_Array();
- assert(loc);
-
- loc[VertCount].X = x;
- loc[VertCount].Y = y;
- loc[VertCount].Z = z;
- }
- void Location_Inline(Vector3 &v) { Location_Inline(v.X,v.Y,v.Z); }
-
- // retrieve a reference to the vertex in the object
- // WARNING: does not validate index
- Vector3 & Get_Location(int index) {
- return Model->Get_Vertex_Array()[index];
- }
-
- void Normal( float x, float y, float z)
- {
- Vector3 * norms = Model->Get_Non_Const_Vertex_Normal_Array();
- assert(norms);
-
- norms[VertCount].X = x;
- norms[VertCount].Y = y;
- norms[VertCount].Z = z;
- }
- void Normal(Vector3 &v) { Normal(v.X,v.Y,v.Z); }
-
- // retrieve a reference to the normal vector3 in the object
- // WARNING: does not validate index
- Vector3 & Get_Normal(int index) { return Model->Get_Non_Const_Vertex_Normal_Array()[index]; }
-
- void Color(float r, float g, float b, float a, int color_array_index = 0)
- {
-// Vector4 * color = Model->Get_Color_Array(color_array_index);
- unsigned * color = Model->Get_Color_Array(color_array_index);
- assert(color);
-
- color[VertCount]=DX8Wrapper::Convert_Color_Clamp(Vector4(r,g,b,a));
-// color[VertCount].X = r;
-// color[VertCount].Y = g;
-// color[VertCount].Z = b;
-// color[VertCount].W = a;
- }
- void Color(const Vector4 &v, int color_array_index = 0) { Color(v.X, v.Y, v.Z, v.W, color_array_index); }
- void Color(unsigned v, int color_array_index=0)
- {
- unsigned * color = Model->Get_Color_Array(color_array_index);
- assert(color);
- color[VertCount]=v;
- }
-
- // retrieve a reference to a color entry in the object
- // WARNING: does not validate index
-// Vector4 & Get_Color(int index, int color_array_index = 0) { return Model->Get_Color_Array(color_array_index)[index]; }
- unsigned Get_Color(int index, int color_array_index = 0) { return Model->Get_Color_Array(color_array_index)[index]; }
-
- void UV(float u, float v, int uv_array_index = 0)
- {
- Vector2 * uv = Model->Get_UV_Array(uv_array_index);
- assert(uv);
-
- uv[VertCount].U = u;
- uv[VertCount].V = v;
- }
- void UV( Vector2 &v, int uv_array_index = 0) { UV(v.U, v.V, uv_array_index); }
- // retrieve a reference to a UV entry in the object
- // WARNING: does not validate index
- Vector2 & Get_UV(int index, int uv_array_index = 0 )
- {
- return Model->Get_UV_Array(uv_array_index)[index];
- }
-
- bool End_Vertex( void);
-
- // vertex creation shortcut, performs a begin, projected, rotated, and end
- bool Vertex(float x, float y, float z, float u, float v)
- {
- Begin_Vertex();
- Location(x, y, z);
- UV(u, v);
- return End_Vertex();
- }
-
- bool Vertex(Vector2 v)
- {
- Begin_Vertex();
- Location(v.X, v.Y, 0);
- return End_Vertex();
- }
-
- void End_Tri_Strip( void )
- {
- TriVertexCount = 0;
- }
-
- void End_Tri_Fan( void )
- {
- TriVertexCount = 0;
- }
-
- // For moving a vertex after the DynaMesh has already been created.
- virtual void Move_Vertex(int index, float x, float y, float z);
- virtual void Get_Vertex(int index, float &x, float &y, float &z);
-
- // For moving all vertices in the mesh by a fixed amount
- void Translate_Vertices(const Vector3 & offset);
-
- // For changing the color of a vertex after DynaMesh has been created.
- virtual void Change_Vertex_Color(int index, const Vector4 &color, int color_array_index)
- {
- // check if switching to multivertexcolor
- if (!MultiVertexColor[color_array_index]) {
- Switch_To_Multi_Vertex_Color(color_array_index);
- }
- CurVertexColor[color_array_index].X = color.X;
- CurVertexColor[color_array_index].Y = color.Y;
- CurVertexColor[color_array_index].Z = color.Z;
- CurVertexColor[color_array_index].W = color.W;
-// Vector4 * color_list = Model->Get_Color_Array(color_array_index);
- unsigned * color_list = Model->Get_Color_Array(color_array_index);
- color_list[index] = DX8Wrapper::Convert_Color_Clamp(color);
- }
-
-
- /*
- ** The following are a bunch of inlined functions for setting & clearing the mesh model's various flags
- */
- // dirty flags
- void Set_Dirty_Bounds(void) { Model->Set_Flag(MeshGeometryClass::DIRTY_BOUNDS, true); }
- void Clear_Dirty_Bounds(void) { Model->Set_Flag(MeshGeometryClass::DIRTY_BOUNDS, false); }
- void Set_Dirty_Planes(void) { Model->Set_Flag(MeshGeometryClass::DIRTY_PLANES, true); }
- void Clear_Dirty_Planes(void) { Model->Set_Flag(MeshGeometryClass::DIRTY_PLANES, false); }
- void Set_Dirty_Vertex_Normals(void) { Model->Set_Flag(MeshGeometryClass::DIRTY_VNORMALS, true); }
- void Clear_Dirty_Vertex_Normals(void) { Model->Set_Flag(MeshGeometryClass::DIRTY_VNORMALS, false); }
-
- // control flags
- void Disable_Sort(void) { Model->Set_Flag(MeshGeometryClass::SORT, false); }
- void Enable_Sort(void) { Model->Set_Flag(MeshGeometryClass::SORT, true); }
- bool Sort_Enabled(void) { return (Model->Get_Flag(MeshGeometryClass::SORT) != 0); }
-
- void Disable_Bounding_Box(void) { Model->Set_Flag(MeshGeometryClass::DISABLE_BOUNDING_BOX, true); }
- void Enable_Bounding_Box(void) { Model->Set_Flag(MeshGeometryClass::DISABLE_BOUNDING_BOX, false); }
- bool Test_Bounding_Box(void) { return (Model->Get_Flag(MeshGeometryClass::DISABLE_BOUNDING_BOX) == 0); }
-
- void Disable_Bounding_Sphere(void) { Model->Set_Flag(MeshGeometryClass::DISABLE_BOUNDING_SPHERE, true); }
- void Enable_Bounding_Sphere(void) { Model->Set_Flag(MeshGeometryClass::DISABLE_BOUNDING_SPHERE, false); }
- bool Test_Bounding_Sphere(void) { return (Model->Get_Flag(MeshGeometryClass::DISABLE_BOUNDING_SPHERE) == 0); }
-
- // this is called by the Reset function
- void Set_Dirty( void) { Set_Dirty_Bounds(); Set_Dirty_Planes(); Set_Dirty_Vertex_Normals(); }
-
- enum {
- MAX_COLOR_ARRAYS = MeshMatDescClass::MAX_COLOR_ARRAYS,
- MAX_PASSES = MeshMatDescClass::MAX_PASSES
- };
-
- // USER BE WARNED: This hack is only here because DynamicMeshClass does not expose all of the
- // features that DynamicMeshModel provides. It may be dangerous to modify the model behind the
- // DynamicMeshClass's back so use at your own risk!
- DynamicMeshModel * Peek_Model(void) { return Model; }
-
-protected:
-
- inline void Switch_To_Multi_Vertex_Color(int color_array_index = 0);
-
- // tells when the triangle needs to be back flipped
- virtual bool Flip_Face( void) { return (!(TriVertexCount & 1)); }
-
- // Low-level mesh object
- DynamicMeshModel * Model;
-
- int VertexMaterialIdx[MAX_PASSES];
- bool MultiVertexMaterial[MAX_PASSES];
- int TextureIdx[MAX_PASSES];
- bool MultiTexture[MAX_PASSES];
-
- Vector4 CurVertexColor[MAX_COLOR_ARRAYS];
- bool MultiVertexColor[MAX_COLOR_ARRAYS];
-
- // number of polygons in the mesh
- int PolyCount;
-
- // number of vertices in the mesh
- int VertCount;
-
- // triangle vertex number
- int TriVertexCount;
-
- // base vertex when submitting fans
- int FanVertex;
-
- // is user currently submitting strips or fans
- enum { TRI_MODE_STRIPS = 0, TRI_MODE_FANS = 1 };
- int TriMode;
-
- // The static sort level
- char SortLevel;
-};
-
-inline Vector3 * DynamicMeshModel::Get_Non_Const_Vertex_Normal_Array(void)
-{
- if (Get_Flag(DIRTY_VNORMALS)) {
- Compute_Vertex_Normals();
- }
- return get_vert_normals();
-}
-
-inline TriIndex * DynamicMeshModel::Get_Non_Const_Polygon_Array(void)
-{
- return get_polys();
-}
-
-inline void DynamicMeshClass::Get_Obj_Space_Bounding_Sphere(SphereClass & sphere) const
-{
- if (!Bounding_Volumes_Valid()) {
- Model->Compute_Bounds(NULL);
- }
- Model->Get_Bounding_Sphere(&sphere);
-}
-
-inline void DynamicMeshClass::Get_Obj_Space_Bounding_Box(AABoxClass & box) const
-{
- if (!Bounding_Volumes_Valid()) {
- Model->Compute_Bounds(NULL);
- }
- Model->Get_Bounding_Box(&box);
-}
-
-/*
-**
-*/
-void DynamicMeshClass::Switch_To_Multi_Vertex_Color(int color_array_index)
-{
-/* Vector4 * color_list = Model->Get_Color_Array(color_array_index);
- // set the proper color for all the existing vertices
- for (int lp = 0; lp < VertCount; lp++) {
- color_list[lp].X = CurVertexColor[color_array_index].X;
- color_list[lp].Y = CurVertexColor[color_array_index].Y;
- color_list[lp].Z = CurVertexColor[color_array_index].Z;
- color_list[lp].W = CurVertexColor[color_array_index].W;
- }
-*/
- unsigned * color_list = Model->Get_Color_Array(color_array_index);
- // set the proper color for all the existing vertices
- unsigned vertex_color=DX8Wrapper::Convert_Color_Clamp(CurVertexColor[color_array_index]);
- for (int lp = 0; lp < VertCount; lp++) {
- color_list[lp]=vertex_color;
- }
-
- MultiVertexColor[color_array_index] = true;
-}
-
-/*
-** Set the color of all vertices in the mesh for one color_array_index
-*/
-int DynamicMeshClass::Set_Vertex_Color(const Vector4 & color, int color_array_index)
-{
- // check if switching to multivertexcolor
- if (!MultiVertexColor[color_array_index]) {
- Switch_To_Multi_Vertex_Color(color_array_index);
- }
-
- CurVertexColor[color_array_index] = color;
- return 0;
-}
-
-int DynamicMeshClass::Set_Vertex_Color(const Vector3 & color, int color_array_index)
-{
- Set_Vertex_Color(Vector4(color.X,color.Y,color.Z,1),color_array_index);
- return 0;
-}
-
-
-/*
-** Dynamic Screen Meshes
-**
-** Same as DynamicMesh, but mapped in Screen Coordinates
-**
-** Screen -> 0,0 1,0
-** +---+
-** | |
-** +---+
-** 0,1 1,1
-**
-**
-** View -> -1,1 1,1
-** +---+
-** | |
-** +---+
-** -1,-1 1,-1
-**
-** Note: since y is inverted, it switches from right handed to left handed
-** (from counter-clockwise to clockwise), so Flip Face accounts for this
-*/
-class DynamicScreenMeshClass : public DynamicMeshClass {
-
-public:
- // constructor and destructor
- DynamicScreenMeshClass( int max_poly, int max_vert, float aspect = 1.0f ) : DynamicMeshClass( max_poly, max_vert), Aspect( aspect ) {}
- DynamicScreenMeshClass( const DynamicScreenMeshClass & src) : DynamicMeshClass(src), Aspect(src.Aspect) {}
- virtual ~DynamicScreenMeshClass( void) {}
-
- // function to clone a dynamic screen mesh class
- virtual RenderObjClass * Clone(void) const { return NEW_REF( DynamicScreenMeshClass, (*this)); }
-
- // class id of this render object
- virtual int Class_ID(void) const { return CLASSID_DYNASCREENMESH; }
-
- // Remap locations to match a screen
- virtual void Location( float x, float y, float z = 0.0f);
-
- // For moving a vertex after the DynaMesh has already been created.
- virtual void Move_Vertex(int index, float x, float y, float z = 0.0f);
-
- // Set position
- virtual void Set_Position(const Vector3 &v);
-
- virtual void Reset( void);
-
- virtual void Set_Aspect(float aspect) { Aspect=aspect; };
-
-protected:
-
- // Aspect Ratio of the virtual screen.
- // 1.0 gives a -1,-1 to 1,1 display
- // 3/4 givs a -1,-3/4 to 1,3/4 display
- float Aspect;
-
- // tells when the triangle needs to be back flipped
- virtual bool Flip_Face( void) { return !DynamicMeshClass::Flip_Face(); }
-};
-
-#endif // DYNAMESH
\ No newline at end of file
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/font3d.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/font3d.cpp
deleted file mode 100644
index 7e66b43bebf..00000000000
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/font3d.cpp
+++ /dev/null
@@ -1,429 +0,0 @@
-/*
-** 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 .
-*/
-
-/***********************************************************************************************
- *** Confidential - Westwood Studios ***
- ***********************************************************************************************
- * *
- * Project Name : Commando / G 3D Library *
- * *
- * $Archive:: /Commando/Code/ww3d2/font3d.cpp $*
- * *
- * $Org Author:: Jani_p $*
- * *
- * $Author:: Kenny_m $*
- * *
- * $Modtime:: 08/05/02 10:44a $*
- * *
- * $Revision:: 17 $*
- * *
- * 08/05/02 KM Texture class redesign
- *---------------------------------------------------------------------------------------------*
- * Functions: *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-#include "font3d.h"
-#include "assetmgr.h"
-#include "texture.h"
-#include
-#include
-#include "surfaceclass.h"
-#include "texture.h"
-#include "vector2i.h"
-
-static SurfaceClass *_surface;
-
-/***********************************************************************************************
- * *
- * Font3DDataClass::Font3DDataClass -- constructor *
- * *
- * Constructs and load a Targa font image to create a texture matetial *
- * *
- ***********************************************************************************************/
-Font3DDataClass::Font3DDataClass( const char *filename )
-{
- Texture = NULL;
- Load_Font_Image( filename);
- Name = strdup( filename);
- Name = strupr( Name);
-}
-
-
-/***********************************************************************************************
- * *
- * Font3DDataClass::~Font3DDataClass -- destructor *
- * *
- ***********************************************************************************************/
-Font3DDataClass::~Font3DDataClass(void)
-{
- if (Name != NULL) {
- free(Name);
- Name = NULL;
- }
-
- REF_PTR_RELEASE(Texture);
-}
-
-
-/***********************************************************************************************
- * *
- * FontClass::Minimize_Font_Image *
- * *
- * Rebuilds the give image to better pack characters and to insure a square power of two size *
- * Must be called AFTER Make_Proportional() so each chars minimal bounding box is known *
- * Will only create a new texture of size 128x128 or 256x256, dependent on original width *
- * *
- ***********************************************************************************************/
-SurfaceClass *Font3DDataClass::Minimize_Font_Image( SurfaceClass *surface )
-{
- SurfaceClass::SurfaceDescription sd;
-
- surface->Get_Description(sd);
-
- float current_width = sd.Width;
- float current_height = sd.Height;
-
- // determine new width make the size of the new image either 128x128 or 256x256,
- // dependent on the width of the original image
- int new_width;
- if (current_width < 256) {
- new_width = 128;
- } else {
- new_width = 256;
- }
-
- int new_height = new_width;
- // create a new 4 bit alpha image to build into
- // We dont support non-homogeneous copies just yet
- SurfaceClass *new_surface = NEW_REF(SurfaceClass,(new_width, new_height,WW3D_FORMAT_A4R4G4B4));
- //SurfaceClass *new_surface0 = NEW_REF(SurfaceClass,(new_width, new_height,sd.Format));
-
- // fill with transparent black
- new_surface->Clear();
-
- // indices for the location of each added char
- int new_x = 0;
- int new_y = 0;
-
- // for each character, copy minimum bounding area to (new_x, new_y) in the new image
- for (int char_index = 0; char_index < 256; char_index++) {
-
- // find the lop left coordinate and the height and width of the char's bounding box
- // (must convert the normalized uv tables to pixels and round off)
- int src_x = (int)(UOffsetTable[ char_index ] * current_width + 0.5);
- int src_y = (int)(VOffsetTable[ char_index ] * current_height + 0.5);
- int width = (int)(UWidthTable[ char_index ] * current_width + 0.5);
- int height = (int)(VHeight * current_height + 0.5);
-
- // if the character has any visible pixels at all...
- if (width != 0) {
-
- // if this charactger will not fit on the current line, goto the next line
- if (new_x + width > new_width) {
- new_x = 0;
- new_y += height;
-
- // if we have run out of lines, we have a problem
- // we assert because we have already modified tables for some of the chars
- if (new_y + height > new_height) {
- new_y -= height;
- WWDEBUG_SAY(( "Font doesn't fit texture 2 on char %c\n", char_index ));
- }
- }
-
- // blit from original image to new image
-
- new_surface->Copy(new_x, new_y,src_x,src_y,width,height,surface);
-
- }
-
- // update the U and V tables to show new character location
- UOffsetTable[ char_index ] = (float)(new_x) / (float)new_width;
- VOffsetTable[ char_index ] = (float)(new_y) / (float)new_width;
-
- // update width in terms of new normal image width
- UWidthTable[ char_index ] *= (float)current_width / (float)new_width;
-
- new_x += width;
- }
-
- // update height in terms of new normal image height
- VHeight *= (float)current_height / (float)new_height;
-
- // be sure the new image is SMALLER than the old image
-// assert ( (new_width * new_height) <= (current_width * current_height));
-
- // release the old surface and return the new one
- REF_PTR_RELEASE(surface);
-
- _surface = new_surface;
-
- return _surface;
-}
-
-/***********************************************************************************************
- * *
- * FontClass::Make_Proportional *
- * *
- * Modifys U and Width tables to convert a monospace font into a proportional font. Hieght *
- * remains the same. Performed by getting the current mono-space bounding box and bringing *
- * in the left and right edges to the first non-transparent ( != 0 ) pixel. Then the U and *
- * width tables are updated with the new values. The image itself is not modified unless... *
- * *
- * we complete by calling Minimize_Font_Image to shink the image & insure a power of 2 square *
- * *
- ***********************************************************************************************/
-SurfaceClass *Font3DDataClass::Make_Proportional( SurfaceClass *surface )
-{
- SurfaceClass::SurfaceDescription sd;
- surface->Get_Description(sd);
- float width = sd.Width;
- float height = sd.Height;
-
- // for each character in the font...
- for (int char_index = 0; char_index < 256; char_index++) {
-
- // find the current bounding box
- // (must convert the normalized uv tables to pixels and round off)
- int x0 = (int)(UOffsetTable[ char_index ] * width + 0.5);
- int y0 = (int)(VOffsetTable[ char_index ] * height + 0.5);
- int x1 = x0 + (int)(UWidthTable[ char_index ] * width + 0.5);
- int y1 = y0 + (int)(VHeight * height + 0.5);
-
- // find minimum bounding box by finding the minimum and maximum non-0 x pixel location
- Vector2i minb(x0,y0);
- Vector2i maxb(x1,y1);
-
- surface->FindBB(&minb,&maxb);
-
- // set the new edges
- x0 = minb.I;
- x1 = maxb.I+1;
-
- // if we didn't find ANY non-transparent pixels, the char has no width.
- if (x1 < x0) {
- x1 = x0;
- }
-
- // turn off all character after del
- if (char_index > 0x80) {
- x1 = x0;
- }
-
- // update the U and width tables
- UOffsetTable[ char_index ] = (float)x0 / width;
- UWidthTable[ char_index ] = (float)( x1 - x0 ) / width;
- CharWidthTable[ char_index ] = x1 - x0;
- }
-
- // now shink the image given the minimum char sizes
-// surface = Minimize_Font_Image( surface );
- Minimize_Font_Image( _surface );
- return NULL;
-}
-
-/***********************************************************************************************
- * *
- * Font3DDataClass::Load_Font_Image( SR_SCENE *scene, char *filename ) *
- * *
- * Loads a targa font image file, arranged as 16x16 characters, and builds u v tables to *
- * find each character. Converts the mono-space font into a proportional font, then uploads *
- * the image to the scene as a textur material. *
- * *
- ***********************************************************************************************/
-bool Font3DDataClass::Load_Font_Image( const char *filename )
-{
- // get the font surface
- SurfaceClass *surface = NEW_REF(SurfaceClass,(filename));
- WWASSERT(surface);
-
- SurfaceClass::SurfaceDescription sd;
- surface->Get_Description(sd);
-
- // If input is a font strike (strip) process it as such
- if ( sd.Width > 8 * sd.Height ) {
-
- // the height of the strike is the height of the characters
- VHeight = 1;
- CharHeight = sd.Height;
-
- int column = 0;
- int width = sd.Width;
-
-
- // for each char, find the uv start location and set the
- // mono-spaced width and height in normalized screen units
- for (int char_index = 0; char_index < 256; char_index++) {
-
- if ( char_index >= 0x7F ) {
-
- UOffsetTable[ char_index ] = 0;
- VOffsetTable[ char_index ] = 0;
- UWidthTable[ char_index ] = 0;
- CharWidthTable[ char_index ] = 0;
-
- } else {
-
- // find the first non-transparent column...
- while (( column < width ) && ( surface->Is_Transparent_Column(column) )) column++;
- int start = column;
-
- // find the first transparent column...
- while (( column < width ) && ( !surface->Is_Transparent_Column(column) )) column++;
- int end = column;
-
- if ( end <= start ) {
- WWDEBUG_SAY(( "Error Char %d start %d end %d width %d\n", char_index, start, end, width ));
- }
-
-// WWASSERT( end > start );
-
- UOffsetTable[ char_index ] = (float)start / width;
- VOffsetTable[ char_index ] = 0;
- UWidthTable[ char_index ] = (float)(end - start) / width;
- CharWidthTable[ char_index ] = end - start;
- }
-
- }
-
- // convert the just created mon-spaced font to proportional (optional)
-// surface = Make_Proportional( surface );
- _surface = surface;
- surface = NULL;
- Minimize_Font_Image( _surface );
-
- } else {
-
- // Determine the width and height of each mono spaced character in pixels
- // (assumes 16x16 array of chars)
- float font_width = sd.Width;
- float font_height = sd.Height;
- float mono_pixel_width = (font_width / 16);
- float mono_pixel_height = (font_height / 16);
-
- // for each char, find the uv start location and set the
- // mono-spaced width and height in normalized screen units
- for (int char_index = 0; char_index < 256; char_index++) {
- UOffsetTable[ char_index ] = (float)((char_index % 16) * mono_pixel_width) / font_width;
- VOffsetTable[ char_index ] = (float)((char_index / 16) * mono_pixel_height) / font_height;
- UWidthTable[ char_index ] = mono_pixel_width / font_width;
- CharWidthTable[ char_index ] = mono_pixel_width;
- }
- VHeight = mono_pixel_height / font_height;
- CharHeight = mono_pixel_height;
-
- // convert the just created mon-spaced font to proportional (optional)
-
- _surface = surface;
- surface = NULL;
- Make_Proportional( _surface );
- }
-
- // create the texture
- if ( _surface ) {
- Texture = NEW_REF(TextureClass,(_surface,MIP_LEVELS_1));
- REF_PTR_RELEASE(_surface);
- }
-
- // return SUCCESS!
- return true;
-}
-
-
-/***********************************************************************************************
- * *
- * Font3DInstanceClass::Font3DInstanceClass -- constructor *
- * *
- * Constructs and load a Targa font image to create a texture matetial *
- * *
- ***********************************************************************************************/
-Font3DInstanceClass::Font3DInstanceClass( const char *filename )
-{
- FontData = WW3DAssetManager::Get_Instance()->Get_Font3DData( filename);
- MonoSpacing = 0.0f;
- Scale = 1.0f;
- SpaceSpacing = (int)(FontData->Char_Width('H') / 2.0f);
- InterCharSpacing = 1;
- Build_Cached_Tables();
-}
-
-/***********************************************************************************************
- * *
- * Font3DInstanceClass::~Font3DInstanceClass -- destructor *
- * *
- ***********************************************************************************************/
-Font3DInstanceClass::~Font3DInstanceClass(void)
-{
- REF_PTR_RELEASE(FontData);
-}
-
-/*
-**
-*/
-void Font3DInstanceClass::Set_Mono_Spaced( void )
-{
- MonoSpacing = FontData->Char_Width('W') + 1;
- Build_Cached_Tables();
-}
-
-void Font3DInstanceClass::Build_Cached_Tables()
-{
- // Rebuild the cached tables
- for (int a=0;a<256;++a) {
- float width = (float)FontData->Char_Width(a);
- if ( a == ' ' ) {
- width = SpaceSpacing;
- }
-
- ScaledWidthTable[a] = Scale * width;
- if (MonoSpacing != 0.0f) {
- ScaledSpacingTable[a] = Scale * MonoSpacing;
- } else {
- ScaledSpacingTable[a] = Scale * (width + InterCharSpacing);
- }
- }
- ScaledHeight = floorf(Scale * (float)FontData->Char_Height('A'));
-}
-
-/***********************************************************************************************
- * *
- * Font3DInstanceClass::String_Screen_Width( char *test_str ) *
- * *
- * Finds the normalized screenspace width of a character string - useful for checking before *
- * printing to avoid overflowing the screen. * *
- ***********************************************************************************************/
-float Font3DInstanceClass::String_Width( const WCHAR *test_str )
-{
- float width = 0.0;
- for (; *test_str; test_str++) {
- width += Char_Spacing(*test_str);
- }
-
- return width;
-}
-
-float Font3DInstanceClass::String_Width( const char *test_str )
-{
- float width = 0.0;
- for (; *test_str; test_str++) {
- width += Char_Spacing(*test_str);
- }
-
- return width;
-}
-
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/font3d.h b/Generals/Code/Libraries/Source/WWVegas/WW3D2/font3d.h
deleted file mode 100644
index d1f584dec86..00000000000
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/font3d.h
+++ /dev/null
@@ -1,223 +0,0 @@
-/*
-** 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 .
-*/
-
-/***********************************************************************************************
- *** Confidential - Westwood Studios ***
- ***********************************************************************************************
- * *
- * Project Name : Commando / G 3D Library *
- * *
- * $Archive:: /Commando/Code/ww3d2/font3d.h $*
- * *
- * $Author:: Byon_g $*
- * *
- * $Modtime:: 4/05/01 2:19p $*
- * *
- * $Revision:: 4 $*
- * *
- *---------------------------------------------------------------------------------------------*/
-
-
-#if defined(_MSC_VER)
-#pragma once
-#endif
-
-#ifndef FONT3D_H
-#define FONT3D_H
-
-#include "always.h"
-#include "refcount.h"
-#include "vector4.h"
-#include "widestring.h"
-#include "rect.h"
-
-class TextureClass;
-class SurfaceClass;
-
-/******************************************************************
-**
-** Font3DDataClass
-**
-** This class provides an interface to a font texture. Once
-** created and loaded with a font, the object can return texture
-** u v coordinate for any character in the font, as well as the
-** character width for proportional fonts. Fonts are loaded as
-** 16-bit Targa files, then converted to proportional fonts by
-** finding the minimum bounding box for each chacter. The font
-** texture is then minimized to a 256x256 or 128x128 texture
-** material by re-stacking chars by thier minimum bounding box.
-**
-** During use, this class is really no more than a data table accessor
-** Only during creation is any real code run.
-**
-** Since the space char nevers needs to be drawn, do not use
-** the conventional method of acessing and drawing chars (which will
-** still work). Instead, call Get_Space_Width to determine the user-
-** settable width, and skip the drawing.
-**
-*******************************************************************/
-class Font3DDataClass : public RefCountClass {
-
-public:
-
- /*
- ** Constructor, Constructor which loads a targa file,
- ** and Destructor
- */
- Font3DDataClass( const char *filename );
- ~Font3DDataClass();
-
- // the name of the font data (used for name matching and the like.)
- char *Name;
-
- /*
- ** access character width and height in pixels (clamp char to 0.255)
- */
-
- unsigned char Char_Width( WCHAR ch = (WCHAR)'H' ) { return CharWidthTable[ch&0xFF]; }// & 0xFF]; } // No need to "& 0xff" with chars!!!
- unsigned char Char_Height( WCHAR /*ch = 'H'*/ ) { return CharHeight; }
-
- // u and v are in normalized texture space
- inline float Char_U_Offset( WCHAR ch = (WCHAR)'H') { return UOffsetTable[ch&0xFF]; }// & 0xFF]; }
- inline float Char_V_Offset( WCHAR ch = (WCHAR)'H') { return VOffsetTable[ch&0xFF]; }// & 0xFF]; }
- inline float Char_U_Width( WCHAR ch = (WCHAR)'H' ) { return UWidthTable[ch&0xFF]; }// & 0xFF]; }
- inline float Char_V_Height( WCHAR /*ch = 'H'*/) { return VHeight; }
-
- // get all four UV values as one vector4
- Vector4 Char_UV_Corners( WCHAR ch = (WCHAR)'H' )
- {
-// ch &= 0xFF;
- return Vector4( UOffsetTable[ch], VOffsetTable[ch],
- UOffsetTable[ch] + UWidthTable[ch],
- VOffsetTable[ch] + VHeight );
- }
-
- /*
- ** access texture material
- */
- TextureClass * Peek_Texture( void ) { return Texture; }
-
-private:
- /*
- ** The material (texture) which holds the font
- */
- TextureClass * Texture;
-
- /*
- ** Normalized texture page offsets for each character
- */
- float UOffsetTable[ 256 ];
- float VOffsetTable[ 256 ];
- float UWidthTable[ 256 ];
- float VHeight;
-
- unsigned char CharWidthTable[ 256 ];
- unsigned char CharHeight;
-
- /*
- ** load a targa font image (.TGA)
- */
- bool Load_Font_Image( const char *filename );
-
- /*
- ** routines to convert a mono-spaced font to a proportional
- ** font and minimize texture image size as a result
- */
- SurfaceClass *Make_Proportional( SurfaceClass *font_image );
- SurfaceClass *Minimize_Font_Image( SurfaceClass *font_image );
-
-};
-
-/******************************************************************
-**
-** Font3DInstanceClass
-**
-*******************************************************************/
-class Font3DInstanceClass : public RefCountClass {
-
-public:
- /*
- ** Constructor which creates/gets a Font3DDataClass object,
- ** and Destructor
- */
- Font3DInstanceClass( const char *filename );
- ~Font3DInstanceClass();
-
- /*
- ** access texture material
- */
- TextureClass *Peek_Texture( void ) { return FontData->Peek_Texture(); }
-
- /*
- ** The non-scaled monospace char width in pixels ( set to 0 for proportional spaced font )
- */
- void Set_Mono_Spaced( void );
- void Set_Proportional( void ) { MonoSpacing = 0; Build_Cached_Tables(); }
-
-
- /*
- ** Set the font scale (default to 1)
- ** This amount will be automatically applied to all Char_Screen_Width calls
- */
- void Set_Scale( float scale ) { Scale = scale; Build_Cached_Tables(); }
- // float Get_Scale() const { return Scale; }
-
- /*
- ** The scaled character pixel width, height, and spacing data (clamp char to 0.255)
- */
- float Char_Width( WCHAR ch ) const { return ScaledWidthTable[ch&0xFF]; }
- float Char_Spacing( WCHAR ch ) const { return ScaledSpacingTable[ch&0xFF]; }
- float Char_Height( void ) const { return ScaledHeight; }
-
-
- /*
- ** The scaled pixel width of a string; useful before printing to avoid screen overflows.
- */
- float String_Width( const WCHAR *test_str );
- float String_Width( const char *test_str );
-
- /*
- ** Char UVs
- */
- // u and v are in normalized texture space
- // inline float Char_U_Offset( WCHAR ch = (WCHAR)'H') { return FontData->Char_U_Offset( ch & 0xFF ); }
- // inline float Char_V_Offset( WCHAR ch = (WCHAR)'H') { return FontData->Char_V_Offset( ch & 0xFF ); }
- // inline float Char_U_Width( WCHAR ch = (WCHAR)'H' ) { return FontData->Char_U_Width( ch & 0xFF ); }
- // inline float Char_V_Height( WCHAR ch = (WCHAR)'H') { return FontData->Char_V_Height( ch & 0xFF ); }
- // Vector4 Char_UV_Corners( WCHAR ch = (WCHAR)'H' ) { return FontData->Char_UV_Corners( ch & 0xFF ); }
- RectClass Char_UV( WCHAR ch ) { return RectClass( FontData->Char_U_Offset(ch),
- FontData->Char_V_Offset(ch),
- FontData->Char_U_Offset(ch) + FontData->Char_U_Width(ch),
- FontData->Char_V_Offset(ch) + FontData->Char_V_Height(ch) ); }
-private:
-
- Font3DDataClass * FontData; // The font data
- float Scale; // The current scale factor
- float SpaceSpacing; // non-scaled width of space in pixels ( defaults to 1/2 'H' width )
- float InterCharSpacing; // non-scaled width between chars in pixels
- float MonoSpacing; // non-scaled monospace char width in pixels (0 for proportional)
-
- float ScaledWidthTable[256]; // scaled cache of the chars pixel widths
- float ScaledSpacingTable[256]; // scaled cache of the chars pixel spacing
- float ScaledHeight; // scaled cache of the chars pixel height
-
- void Build_Cached_Tables();
-};
-
-
-#endif
\ No newline at end of file
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/formconv.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/formconv.cpp
deleted file mode 100644
index 9c20e6b3e21..00000000000
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/formconv.cpp
+++ /dev/null
@@ -1,252 +0,0 @@
-/*
-** 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 .
-*/
-
-/***********************************************************************************************
- *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
- ***********************************************************************************************
- * *
- * Project Name : WW3D *
- * *
- * $Archive:: /Commando/Code/ww3d2/formconv.cpp $*
- * *
- * Original Author:: Nathaniel Hoffman *
- * *
- * Author : Kenny Mitchell *
- * *
- * $Modtime:: 06/27/02 1:27p $*
- * *
- * $Revision:: 3 $*
- * *
- * 06/27/02 KM Z Format support *
- *---------------------------------------------------------------------------------------------*
- * Functions: *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-#include "formconv.h"
-
-D3DFORMAT WW3DFormatToD3DFormatConversionArray[WW3D_FORMAT_COUNT] = {
- D3DFMT_UNKNOWN,
- D3DFMT_R8G8B8,
- D3DFMT_A8R8G8B8,
- D3DFMT_X8R8G8B8,
- D3DFMT_R5G6B5,
- D3DFMT_X1R5G5B5,
- D3DFMT_A1R5G5B5,
- D3DFMT_A4R4G4B4,
- D3DFMT_R3G3B2,
- D3DFMT_A8,
- D3DFMT_A8R3G3B2,
- D3DFMT_X4R4G4B4,
- D3DFMT_A8P8,
- D3DFMT_P8,
- D3DFMT_L8,
- D3DFMT_A8L8,
- D3DFMT_A4L4,
- D3DFMT_V8U8, // Bumpmap
- D3DFMT_L6V5U5, // Bumpmap
- D3DFMT_X8L8V8U8, // Bumpmap
- D3DFMT_DXT1,
- D3DFMT_DXT2,
- D3DFMT_DXT3,
- D3DFMT_DXT4,
- D3DFMT_DXT5
-};
-
-// adding depth stencil format conversion
-D3DFORMAT WW3DZFormatToD3DFormatConversionArray[WW3D_ZFORMAT_COUNT] =
-{
-#ifndef _XBOX
- D3DFMT_UNKNOWN,
- D3DFMT_D16_LOCKABLE, // 16-bit z-buffer bit depth. This is an application-lockable surface format.
- D3DFMT_D32, // 32-bit z-buffer bit depth.
- D3DFMT_D15S1, // 16-bit z-buffer bit depth where 15 bits are reserved for the depth channel and 1 bit is reserved for the stencil channel.
- D3DFMT_D24S8, // 32-bit z-buffer bit depth using 24 bits for the depth channel and 8 bits for the stencil channel.
- D3DFMT_D16, // 16-bit z-buffer bit depth.
- D3DFMT_D24X8, // 32-bit z-buffer bit depth using 24 bits for the depth channel.
- D3DFMT_D24X4S4, // 32-bit z-buffer bit depth using 24 bits for the depth channel and 4 bits for the stencil channel.
-#else
- D3DFMT_UNKNOWN,
- D3DFMT_D16_LOCKABLE, // 16-bit z-buffer bit depth. This is an application-lockable surface format.
- D3DFMT_D32, // 32-bit z-buffer bit depth.
- D3DFMT_D15S1, // 16-bit z-buffer bit depth where 15 bits are reserved for the depth channel and 1 bit is reserved for the stencil channel.
- D3DFMT_D24S8, // 32-bit z-buffer bit depth using 24 bits for the depth channel and 8 bits for the stencil channel.
- D3DFMT_D16, // 16-bit z-buffer bit depth.
- D3DFMT_D24X8, // 32-bit z-buffer bit depth using 24 bits for the depth channel.
- D3DFMT_D24X4S4, // 32-bit z-buffer bit depth using 24 bits for the depth channel and 4 bits for the stencil channel.
-
- D3DFMT_LIN_D24S8,
- D3DFMT_LIN_F24S8,
- D3DFMT_LIN_D16,
- D3DFMT_LIN_F16
-#endif
-};
-
-
-/*
-#define HIGHEST_SUPPORTED_D3DFORMAT D3DFMT_X8L8V8U8 //A4L4
-WW3DFormat D3DFormatToWW3DFormatConversionArray[HIGHEST_SUPPORTED_D3DFORMAT + 1] = {
- WW3D_FORMAT_UNKNOWN, // 0
- WW3D_FORMAT_UNKNOWN, WW3D_FORMAT_UNKNOWN, WW3D_FORMAT_UNKNOWN, WW3D_FORMAT_UNKNOWN,
- WW3D_FORMAT_UNKNOWN, WW3D_FORMAT_UNKNOWN, WW3D_FORMAT_UNKNOWN, WW3D_FORMAT_UNKNOWN,
- WW3D_FORMAT_UNKNOWN, WW3D_FORMAT_UNKNOWN, WW3D_FORMAT_UNKNOWN, WW3D_FORMAT_UNKNOWN,
- WW3D_FORMAT_UNKNOWN, WW3D_FORMAT_UNKNOWN, WW3D_FORMAT_UNKNOWN, WW3D_FORMAT_UNKNOWN,
- WW3D_FORMAT_UNKNOWN, WW3D_FORMAT_UNKNOWN, WW3D_FORMAT_UNKNOWN,
- WW3D_FORMAT_R8G8B8, // 20
- WW3D_FORMAT_A8R8G8B8,
- WW3D_FORMAT_X8R8G8B8,
- WW3D_FORMAT_R5G6B5,
- WW3D_FORMAT_X1R5G5B5,
- WW3D_FORMAT_A1R5G5B5,
- WW3D_FORMAT_A4R4G4B4,
- WW3D_FORMAT_R3G3B2,
- WW3D_FORMAT_A8,
- WW3D_FORMAT_A8R3G3B2,
- WW3D_FORMAT_X4R4G4B4, // 30
- WW3D_FORMAT_UNKNOWN, WW3D_FORMAT_UNKNOWN, WW3D_FORMAT_UNKNOWN, WW3D_FORMAT_UNKNOWN,
- WW3D_FORMAT_UNKNOWN, WW3D_FORMAT_UNKNOWN, WW3D_FORMAT_UNKNOWN, WW3D_FORMAT_UNKNOWN,
- WW3D_FORMAT_UNKNOWN,
- WW3D_FORMAT_A8P8, // 40
- WW3D_FORMAT_P8,
- WW3D_FORMAT_UNKNOWN, WW3D_FORMAT_UNKNOWN, WW3D_FORMAT_UNKNOWN, WW3D_FORMAT_UNKNOWN,
- WW3D_FORMAT_UNKNOWN, WW3D_FORMAT_UNKNOWN, WW3D_FORMAT_UNKNOWN, WW3D_FORMAT_UNKNOWN,
- WW3D_FORMAT_L8, // 50
- WW3D_FORMAT_A8L8,
- WW3D_FORMAT_A4L4
-};
-*/
-
-#ifndef _XBOX
-#define HIGHEST_SUPPORTED_D3DFORMAT D3DFMT_X8L8V8U8
-#define HIGHEST_SUPPORTED_D3DZFORMAT D3DFMT_D16
-#else
-#define HIGHEST_SUPPORTED_D3DFORMAT D3DFMT_LIN_R8G8B8A8
-#define HIGHEST_SUPPORTED_D3DZFORMAT D3DFMT_LIN_F16
-#endif
-WW3DFormat D3DFormatToWW3DFormatConversionArray[HIGHEST_SUPPORTED_D3DFORMAT + 1];
-WW3DZFormat D3DFormatToWW3DZFormatConversionArray[HIGHEST_SUPPORTED_D3DZFORMAT + 1];
-
-D3DFORMAT WW3DFormat_To_D3DFormat(WW3DFormat ww3d_format) {
- if (ww3d_format >= WW3D_FORMAT_COUNT) {
- return D3DFMT_UNKNOWN;
- } else {
- return WW3DFormatToD3DFormatConversionArray[(unsigned int)ww3d_format];
- }
-}
-
-WW3DFormat D3DFormat_To_WW3DFormat(D3DFORMAT d3d_format)
-{
- switch (d3d_format) {
- // The DXT-codes are created with FOURCC macro and thus can't be placed in the conversion table
- case D3DFMT_DXT1: return WW3D_FORMAT_DXT1;
- case D3DFMT_DXT2: return WW3D_FORMAT_DXT2;
- case D3DFMT_DXT3: return WW3D_FORMAT_DXT3;
- case D3DFMT_DXT4: return WW3D_FORMAT_DXT4;
- case D3DFMT_DXT5: return WW3D_FORMAT_DXT5;
- default:
- if (d3d_format > HIGHEST_SUPPORTED_D3DFORMAT) {
- return WW3D_FORMAT_UNKNOWN;
- } else {
- return D3DFormatToWW3DFormatConversionArray[(unsigned int)d3d_format];
- }
- break;
- }
-}
-
-//**********************************************************************************************
-//! Depth Stencil W3D to D3D format conversion
-/*! KJM
-*/
-D3DFORMAT WW3DZFormat_To_D3DFormat(WW3DZFormat ww3d_zformat)
-{
- if (ww3d_zformat >= WW3D_ZFORMAT_COUNT)
- {
- return D3DFMT_UNKNOWN;
- }
- else
- {
- return WW3DZFormatToD3DFormatConversionArray[(unsigned int)ww3d_zformat];
- }
-}
-
-//**********************************************************************************************
-//! D3D to Depth Stencil W3D format conversion
-/*! KJM
-*/
-WW3DZFormat D3DFormat_To_WW3DZFormat(D3DFORMAT d3d_format)
-{
- if (d3d_format>HIGHEST_SUPPORTED_D3DZFORMAT)
- {
- return WW3D_ZFORMAT_UNKNOWN;
- }
- else
- {
- return D3DFormatToWW3DZFormatConversionArray[(unsigned int)d3d_format];
- }
-}
-
-//**********************************************************************************************
-//! Init format conversion tables
-/*!
- * 06/27/02 KM Z Format support *
-*/
-void Init_D3D_To_WW3_Conversion()
-{
- int i=0;
- for (;i.
-*/
-
-/***********************************************************************************************
- *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
- ***********************************************************************************************
- * *
- * Project Name : WW3D *
- * *
- * $Archive:: /Commando/Code/ww3d2/formconv.h $*
- * *
- * Original Author:: Nathaniel Hoffman *
- * *
- * Author : Kenny Mitchell *
- * *
- * $Modtime:: 06/27/02 1:27p $*
- * *
- * $Revision:: 3 $*
- * *
- * 06/27/02 KM Z Format support *
- *---------------------------------------------------------------------------------------------*
- * Functions: *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-#if defined(_MSC_VER)
-#pragma once
-#endif
-
-#ifndef FORMCONV_H
-#define FORMCONV_H
-
-#include "ww3dformat.h"
-#include
-
-/*
-** This file is used for conversions between D3DFORMAT and WW3DFormat.
-*/
-
-D3DFORMAT WW3DFormat_To_D3DFormat(WW3DFormat ww3d_format);
-WW3DFormat D3DFormat_To_WW3DFormat(D3DFORMAT d3d_format);
-
-D3DFORMAT WW3DZFormat_To_D3DFormat(WW3DZFormat ww3d_zformat);
-WW3DZFormat D3DFormat_To_WW3DZFormat(D3DFORMAT d3d_format);
-
-void Init_D3D_To_WW3_Conversion();
-
-#endif
\ No newline at end of file
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/framgrab.h b/Generals/Code/Libraries/Source/WWVegas/WW3D2/framgrab.h
deleted file mode 100644
index 67a2a447391..00000000000
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/framgrab.h
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
-** 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 .
-*/
-
-/***********************************************************************************************
- *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
- ***********************************************************************************************
- * *
- * Project Name : WW3D *
- * *
- * $Archive:: /Commando/Code/ww3d2/framgrab.h $*
- * *
- * Author:: Greg Hjelstrom *
- * *
- * $Modtime:: 1/08/01 10:04a $*
- * *
- * $Revision:: 1 $*
- * *
- *---------------------------------------------------------------------------------------------*
- * Functions: *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-
-#if defined(_MSC_VER)
-#pragma once
-#endif
-
-#ifndef FRAMEGRAB_H
-#define FRAMEGRAB_H
-
-#ifndef ALWAYS_H
-#include "always.h"
-#endif
-
-#if defined (_MSC_VER)
-#pragma warning (push, 3) // (gth) system headers complain at warning level 4...
-#endif
-
-#ifndef _WINDOWS_
-#include "windows.h"
-#endif
-
-#ifndef _INC_WINDOWSX
-#include "windowsx.h"
-#endif
-
-#ifndef _INC_VFW
-#include "vfw.h"
-#endif
-
-#if defined (_MSC_VER)
-#pragma warning (pop)
-#endif
-
-// FramGrab.h: interface for the FrameGrabClass class.
-//
-//////////////////////////////////////////////////////////////////////
-
-class FrameGrabClass
-{
-public:
- enum MODE {
- RAW,
- AVI
- };
-
- // depending on which mode you select, it will produce either frames or an AVI.
- FrameGrabClass(const char *filename, MODE mode, int width, int height, int bitdepth, float framerate );
-
- virtual ~FrameGrabClass();
-
- void ConvertGrab(void *BitmapPointer);
- void Grab(void *BitmapPointer);
-
- long * GetBuffer() { return Bitmap; }
- float GetFrameRate() { return FrameRate; }
-
-protected:
- const char *Filename;
- float FrameRate;
-
- MODE Mode;
- long Counter; // used for incrementing filename cunter, etc.
-
- void GrabAVI(void *BitmapPointer);
- void GrabRawFrame(void *BitmapPointer);
-
- // avi settings
- PAVIFILE AVIFile;
- long *Bitmap;
- PAVISTREAM Stream;
- AVISTREAMINFO AVIStreamInfo;
- BITMAPINFOHEADER BitmapInfoHeader;
-
- // general purpose cleanup routine
- void CleanupAVI();
-
- // convert the SR image into AVI byte ordering
- void ConvertFrame(void *BitmapPointer);
-
-};
-
-#endif
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/hanim.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/hanim.cpp
deleted file mode 100644
index c8bf589d3da..00000000000
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/hanim.cpp
+++ /dev/null
@@ -1,468 +0,0 @@
-/*
-** 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 .
-*/
-
-/* $Header: /Commando/Code/ww3d2/hanim.cpp 3 12/13/01 7:01p Patrick $ */
-/***********************************************************************************************
- *** Confidential - Westwood Studios ***
- ***********************************************************************************************
- * *
- * Project Name : Commando / G 3D Library *
- * *
- * $Archive:: /Commando/Code/ww3d2/hanim.cpp $*
- * *
- * Author:: Greg_h *
- * *
- * $Modtime:: 12/13/01 6:54p $*
- * *
- * $Revision:: 3 $*
- * *
- *---------------------------------------------------------------------------------------------*
- * Functions: *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-
-#include "hanim.h"
-#include "assetmgr.h"
-#include "htree.h"
-#include "motchan.h"
-#include "chunkio.h"
-#include "w3d_file.h"
-#include "wwdebug.h"
-#include
-#include
-
-
-
-/*
-**
-** HAnimComboClass
-**
-**
-*/
-
-
-NamedPivotMapClass::~NamedPivotMapClass(void)
-{
-}
-
-NamedPivotMapClass::WeightInfoStruct & NamedPivotMapClass::WeightInfoStruct::operator = (WeightInfoStruct const &that)
-{
- if(Name) delete [] Name;
- assert(that.Name != 0);
- Name = nstrdup(that.Name);
- Weight = that.Weight;
- return *this;
-}
-
-// add a name & weight to the arrays
-void NamedPivotMapClass::Add(const char *Name, float Weight)
-{
- WeightInfoStruct info;
- info.Name = (char *) Name;
- info.Weight = Weight;
- WeightInfo.Add(info);
- info.Name = 0;
-}
-
-// configure the base pivot map using the specified tree
-void NamedPivotMapClass::Update_Pivot_Map(const HTreeClass *Tree)
-{
- // first, resize the base pivot map to fit the tree
- int numPivots = Tree->Num_Pivots();
-
- Resize(numPivots);
- ActiveCount = numPivots;
-
- // first, reset all weights to 1 (the default)
- while(numPivots--) {
- (*this)[numPivots] = 1.0f;
- }
-
- // for each named pivot, find the correct index and set the weight if the indicated bone is present
- // note: there is no check for redundant names
- int count = WeightInfo.Count();
- while(count--) {
- int actualPivot = Tree->Get_Bone_Index(WeightInfo[count].Name);
- if(actualPivot != -1) {
- (*this)[actualPivot] = WeightInfo[count].Weight;
- }
- }
-}
-
-/*
-**
-*/
-DEFINE_AUTO_POOL(HAnimComboDataClass,256);
-
-HAnimComboDataClass::HAnimComboDataClass(bool shared)
-: Shared(shared), HAnim(0), PivotMap(0), Frame(0), PrevFrame(0), Weight(1)
-{}
-
-
-HAnimComboDataClass::HAnimComboDataClass(const HAnimComboDataClass &src)
-: PivotMap(src.Get_Pivot_Map()),
- HAnim(src.Get_HAnim())
-{
- Shared = src.Is_Shared();
- Frame = src.Get_Frame();
- PrevFrame = src.Get_Prev_Frame();
- Weight = src.Get_Weight();
-}
-
-void HAnimComboDataClass::Copy(const HAnimComboDataClass *src)
-{
- if(src) {
- HAnim = src->Get_HAnim();
- PivotMap = src->Get_Pivot_Map();
- Frame = src->Get_Frame();
- PrevFrame = src->Get_Prev_Frame();
- Weight = src->Get_Weight();
- } else {
- HAnim = 0;
- PivotMap = 0;
- Frame = 0;
- PrevFrame = 0;
- Weight = 1;
- }
-}
-
-HAnimComboDataClass::~HAnimComboDataClass(void)
-{
- if(HAnim)
- HAnim->Release_Ref();
- if(PivotMap)
- PivotMap->Release_Ref();
-}
-
-void HAnimComboDataClass::Clear(void)
-{
- if ( HAnim != NULL ) {
- HAnim->Release_Ref();
- HAnim = NULL;
- }
-
- // not sure if the pivot map should be deleted or just have everything set to one.
- // removing it effectively sets it to one, so that's what I'm doing for now.
- if(PivotMap) {
- PivotMap->Release_Ref();
- PivotMap = NULL;
- }
-
- Frame = 0.0f;
- PrevFrame = 0.0f;
- Weight = 1.0;
- PivotMap = NULL;
-}
-
-void HAnimComboDataClass::Set_HAnim(HAnimClass *motion)
-{
- if ( motion != NULL ) {
- motion->Add_Ref();
- }
- if ( HAnim != NULL ) {
- HAnim->Release_Ref();
- }
- HAnim = motion;
-}
-
-
-void HAnimComboDataClass::Set_Pivot_Map(PivotMapClass *map)
-{
- if ( map != NULL ) {
- map->Add_Ref();
- }
- if ( PivotMap != NULL ) {
- PivotMap->Release_Ref();
- }
- PivotMap = map;
-}
-
-/*
-** This function will replace the current pivot map (if any) with another pivot map that is
-** set to 1 for only those pivot indices that actually have data.
-*/
-void HAnimComboDataClass::Build_Active_Pivot_Map(void)
-{
- if ( PivotMap != NULL ) {
- PivotMap->Release_Ref();
- }
- if(HAnim == NULL) {
- PivotMap = 0;
- return;
- }
-
- int numpivots = HAnim->Get_Num_Pivots();
- PivotMap = NEW_REF( PivotMapClass, ());
- PivotMap->Resize(numpivots);
-
- int count = 0;
- while(count < numpivots) {
- if(HAnim->Is_Node_Motion_Present(count)) {
- PivotMap->Add(1);
-
- } else {
- PivotMap->Add(0);
- }
- count++;
- }
-}
-
-/*
-** HAnimComboClass
-**
-**
-*/
-
-HAnimComboClass::HAnimComboClass(void)
-{}
-
-HAnimComboClass::HAnimComboClass( int num_animations )
-{
- HAnimComboData.Resize(num_animations);
-
- while(num_animations--) {
- HAnimComboData.Add(new HAnimComboDataClass());
- }
-}
-
-
-HAnimComboClass::~HAnimComboClass(void)
-{
- Reset();
-}
-
-
-void HAnimComboClass::Clear( void )
-{
- int numAnimations = HAnimComboData.Count();
- while ( numAnimations-- ) {
- HAnimComboDataClass *data = HAnimComboData[numAnimations];
- if(data && (! data->Is_Shared()))
- data->Clear();
- }
-}
-
-void HAnimComboClass::Reset( void )
-{
- int numAnimations = HAnimComboData.Count();
- while ( numAnimations-- ) {
- HAnimComboDataClass *data = HAnimComboData[numAnimations];
- if(data && (! data->Is_Shared())) {
- delete data;
- }
- }
- HAnimComboData.Reset_Active();
-}
-
-bool HAnimComboClass::Normalize_Weights(void)
-{
- // NOTE: This can only work if either no anims have pivot weight maps (in which case we will
- // adjust the anim weights to ensure normalization), or else if all do (in which case we will
- // adjust the pivot maps). Otherwise we do nothing and return false.
- int anim_count = Get_Num_Anims();
- if (!anim_count) return true; // Trivially succeeded
-
- // Loop over all anims. Check if all or none have pivot maps, and also calculate the minimum
- // number of pivots.
- int anim_idx = 0;
- bool all_pivot_maps = true;
- bool none_pivot_maps = true;
- int num_anim_pivots = 100000;
- for (anim_idx = 0; anim_idx < anim_count; anim_idx++ ) {
- num_anim_pivots = MIN(num_anim_pivots, Peek_Motion(anim_idx)->Get_Num_Pivots());
- bool has_pivot_map = Peek_Pivot_Weight_Map(anim_idx) != NULL;
- all_pivot_maps &= has_pivot_map;
- none_pivot_maps &= !has_pivot_map;
- }
- if ( num_anim_pivots == 100000 ) {
- num_anim_pivots = 0;
- }
-
- if (none_pivot_maps) {
-
- // Calculate total weight of all active anims, ensure it is very close to 1.
- float weight_total = 0.0f;
- for (anim_idx = 0; anim_idx < anim_count; anim_idx++ ) {
- if (Peek_Motion(anim_idx) != NULL ) {
- float weight = Get_Weight(anim_idx);
- weight_total += weight;
- }
- }
-
- // weight_total should be very close to 1. If not, normalize this pivot's weights
- if (weight_total != 0.0 && WWMath::Fabs( weight_total - 1.0 ) > WWMATH_EPSILON) {
- float oo_total = 1.0f / weight_total;
- for (anim_idx = 0; anim_idx < anim_count; anim_idx++ ) {
- if (Peek_Motion(anim_idx) != NULL ) {
- Set_Weight(anim_idx, Get_Weight(anim_idx) * oo_total);
- }
- }
- }
-
- } else {
-
- if (all_pivot_maps) {
-
- // For each pivot, calculate total weight of all active anims, ensure close to 1.
- for (int piv_idx = 1; piv_idx < num_anim_pivots; piv_idx++) {
-
- float weight_total = 0.0f;
- for (anim_idx = 0; anim_idx < anim_count; anim_idx++ ) {
- if (Peek_Motion(anim_idx) != NULL ) {
- float weight = Get_Weight(anim_idx) * (*Peek_Pivot_Weight_Map(anim_idx))[piv_idx];
- weight_total += weight;
- }
- }
-
- // weight_total should be very close to 1. If not, normalize this pivot's weights
- if (weight_total != 0.0 && WWMath::Fabs( weight_total - 1.0 ) > WWMATH_EPSILON) {
- float oo_total = 1.0f / weight_total;
- for (anim_idx = 0; anim_idx < anim_count; anim_idx++ ) {
- if (Peek_Motion(anim_idx) != NULL ) {
- PivotMapClass *pivot_map = Get_Pivot_Weight_Map(anim_idx);
- float new_weight = (*pivot_map)[piv_idx] * oo_total;
- (*pivot_map)[piv_idx] = new_weight;
- pivot_map->Release_Ref();
- }
- }
- }
-
- }
-
- } else {
- return false;
- }
- }
-
- return true;
-
-}
-
-void HAnimComboClass::Set_Motion( int index, HAnimClass *motion )
-{
- HAnimComboDataClass *data = HAnimComboData[index];
- WWASSERT(data);
-
- data->Set_HAnim(motion);
-}
-
-HAnimClass *HAnimComboClass::Get_Motion( int index )
-{
- HAnimComboDataClass *data = HAnimComboData[index];
- WWASSERT(data);
-
- HAnimClass *anim = data->Peek_HAnim();
-
- if ( anim != NULL ) {
- anim->Add_Ref();
- }
- return anim;
-}
-
-HAnimClass *HAnimComboClass::Peek_Motion( int index )
-{
- HAnimComboDataClass *data = HAnimComboData[index];
- WWASSERT(data);
-
- HAnimClass *anim = data->Peek_HAnim();
- return anim;
-}
-
-void HAnimComboClass::Set_Frame( int index, float frame )
-{
- HAnimComboDataClass *data = HAnimComboData[index];
- WWASSERT(data);
-
- data->Set_Frame(frame);
-}
-
-float HAnimComboClass::Get_Frame( int index )
-{
- HAnimComboDataClass *data = HAnimComboData[index];
- WWASSERT(data);
-
- return data->Get_Frame();
-}
-
-void HAnimComboClass::Set_Prev_Frame( int index, float frame )
-{
- HAnimComboDataClass *data = HAnimComboData[index];
- WWASSERT(data);
-
- data->Set_Prev_Frame(frame);
-}
-
-float HAnimComboClass::Get_Prev_Frame( int index )
-{
- HAnimComboDataClass *data = HAnimComboData[index];
- WWASSERT(data);
-
- return data->Get_Prev_Frame();
-}
-
-void HAnimComboClass::Set_Weight( int index, float weight )
-{
- HAnimComboDataClass *data = HAnimComboData[index];
- WWASSERT(data);
-
- data->Set_Weight(weight);
-}
-
-float HAnimComboClass::Get_Weight( int index )
-{
- HAnimComboDataClass *data = HAnimComboData[index];
- WWASSERT(data);
-
- return data->Get_Weight();
-}
-
-void HAnimComboClass::Set_Pivot_Weight_Map( int index, PivotMapClass *map )
-{
- HAnimComboDataClass *data = HAnimComboData[index];
- WWASSERT(data);
-
- data->Set_Pivot_Map(map);
-}
-
-PivotMapClass *HAnimComboClass::Get_Pivot_Weight_Map( int index )
-{
- HAnimComboDataClass *data = HAnimComboData[index];
- WWASSERT(data);
-
- return data->Get_Pivot_Map();
-}
-
-PivotMapClass *HAnimComboClass::Peek_Pivot_Weight_Map( int index )
-{
- HAnimComboDataClass *data = HAnimComboData[index];
- WWASSERT(data);
-
- return data->Peek_Pivot_Map();
-}
-
-void HAnimComboClass::Append_Anim_Combo_Data(HAnimComboDataClass * Data)
-{
- HAnimComboData.Add(Data);
-}
-
-void HAnimComboClass::Remove_Anim_Combo_Data(HAnimComboDataClass * Data)
-{
- HAnimComboData.Delete(Data);
-}
-
-
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/hanim.h b/Generals/Code/Libraries/Source/WWVegas/WW3D2/hanim.h
deleted file mode 100644
index c57f57056c6..00000000000
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/hanim.h
+++ /dev/null
@@ -1,273 +0,0 @@
-/*
-** 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 .
-*/
-
-/* $Header: /Commando/Code/ww3d2/hanim.h 3 12/13/01 7:01p Patrick $ */
-/***********************************************************************************************
- *** Confidential - Westwood Studios ***
- ***********************************************************************************************
- * *
- * Project Name : Commando / G 3D Library *
- * *
- * $Archive:: /Commando/Code/ww3d2/hanim.h $*
- * *
- * Author:: Greg_h *
- * *
- * $Modtime:: 12/13/01 6:54p $*
- * *
- * $Revision:: 3 $*
- * *
- *---------------------------------------------------------------------------------------------*
- * Functions: *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-
-#if defined(_MSC_VER)
-#pragma once
-#endif
-
-#ifndef HANIM_H
-#define HANIM_H
-
-#include "always.h"
-#include "quat.h"
-#include "refcount.h"
-#include "w3d_file.h"
-#include "hash.h"
-#include "mempool.h"
-#include
-#include
-#include
-
-struct NodeMotionStruct;
-class MotionChannelClass;
-class BitChannelClass;
-class HTreeClass;
-class ChunkLoadClass;
-class ChunkSaveClass;
-class HTreeClass;
-
-
-
-#define EMBEDDED_SOUND_BONE_INDEX_NOT_SET -1
-/**********************************************************************************
-
- HAnimClass
-
- This is the base class for all animation formats used in W3D. It
- contains the virtual interface that all animations must support.
-
-**********************************************************************************/
-class HAnimClass : public RefCountClass, public HashableClass
-{
-public:
- enum
- {
- CLASSID_UNKNOWNANIM = 0xFFFFFFFF,
- CLASSID_HRAWANIM = 0,
- CLASSID_LASTANIM = 0x0000FFFF
- };
-
- HAnimClass(void) :
- EmbeddedSoundBoneIndex (EMBEDDED_SOUND_BONE_INDEX_NOT_SET) { }
- virtual ~HAnimClass(void) { }
-
- virtual const char * Get_Name(void) const = 0;
- virtual const char * Get_HName(void) const = 0;
-
- virtual const char * Get_Key( void ) { return Get_Name(); }
-
- virtual int Get_Num_Frames(void) = 0;
- virtual float Get_Frame_Rate() = 0;
- virtual float Get_Total_Time() = 0;
-
-// virtual Vector3 Get_Translation(int pividx,float frame) = 0;
-// virtual Quaternion Get_Orientation(int pividx,float frame) = 0;
- // Jani: Changed to pass in reference of destination to avoid copying
- virtual void Get_Translation(int pividx,float frame) {} // todo: remove
- virtual void Get_Orientation(int pividx,float frame) {} // todo: remove
- virtual void Get_Translation(Vector3& translation, int pividx,float frame) const = 0;
- virtual void Get_Orientation(Quaternion& orientation, int pividx,float frame) const = 0;
- virtual void Get_Transform(Matrix3D&, int pividx, float frame) const = 0;
- virtual bool Get_Visibility(int pividx,float frame) = 0;
-
- virtual int Get_Num_Pivots(void) const = 0;
- virtual bool Is_Node_Motion_Present(int pividx) = 0;
-
- // Methods that test the presence of a certain motion channel.
- virtual bool Has_X_Translation (int pividx) { return true; }
- virtual bool Has_Y_Translation (int pividx) { return true; }
- virtual bool Has_Z_Translation (int pividx) { return true; }
- virtual bool Has_Rotation (int pividx) { return true; }
- virtual bool Has_Visibility (int pividx) { return true; }
- virtual int Class_ID(void) const { return CLASSID_UNKNOWNANIM; }
-
- // Animated sound-triggering support
- virtual bool Has_Embedded_Sounds (void) const { if (EmbeddedSoundBoneIndex < 0) return false; return true;}
- virtual void Set_Embedded_Sound_Bone_Index (int bone) { EmbeddedSoundBoneIndex = bone; }
- virtual int Get_Embedded_Sound_Bone_Index() {return EmbeddedSoundBoneIndex;}
-
-protected:
- int EmbeddedSoundBoneIndex;
-};
-
-
-/*
-** The PivotMapClass is used by the HAnimComboDataClass (sometimes) to keep track of animation
-** weights per-pivot point.
-*/
-class NamedPivotMapClass;
-
-class PivotMapClass : public DynamicVectorClass, public RefCountClass
-{
-public:
- virtual NamedPivotMapClass * As_Named_Pivot_Map() { return 0; }
-};
-
-
-/*
-** The NamedPivotMapClass allows us to create HAnimComboDataClass objects with pivot maps without
-** having to have the HAnim available. Later, when an HAnim is retrieved from the asset manager,
-** the pivot map can be updated to produce the correct map.
-*/
-class NamedPivotMapClass : public PivotMapClass
-{
-public:
- ~NamedPivotMapClass(void);
-
- virtual NamedPivotMapClass * As_Named_Pivot_Map() { return this; }
-
- // add a name & weight to the arrays
- void Add(const char *Name, float Weight);
-
- // configure the base pivot map using the specified tree
- void Update_Pivot_Map(const HTreeClass *Tree);
-
-private:
-
- // This info is packaged into a struct to minimize DynamicVectorClass overhead
- struct WeightInfoStruct {
- WeightInfoStruct() : Name(0) {}
- ~WeightInfoStruct() { if(Name) delete [] Name; }
-
- char *Name;
- float Weight;
-
- // operators required for the DynamicVectorClass
- WeightInfoStruct & operator = (WeightInfoStruct const &that);
- bool operator == (WeightInfoStruct const &that) const { return &that == this; }
- bool operator != (WeightInfoStruct const &that) const { return &that != this; }
- };
-
- DynamicVectorClass WeightInfo;
-};
-
-
-/*
-** The HAnimComboDataClass is used by the new HAnimComboClass to allow for a mix of shared/unshared data
-** which will allow us to have the anim combo refer to data whereever we wish to put it.
-*/
-class HAnimComboDataClass : public AutoPoolClass {
- public:
- HAnimComboDataClass(bool shared = false);
- HAnimComboDataClass(const HAnimComboDataClass &);
- ~HAnimComboDataClass(void);
-
- void Copy(const HAnimComboDataClass *);
-
- void Clear(void);
- void Set_HAnim(HAnimClass *motion);
- void Give_HAnim(HAnimClass *motion) { if(HAnim) HAnim->Release_Ref(); HAnim = motion; } // used for giving this object the reference
-
- void Set_Frame(float frame) { PrevFrame = Frame; Frame = frame; }
- void Set_Prev_Frame(float frame) { PrevFrame = frame; }
- void Set_Weight(float weight) { Weight = weight; }
- void Set_Pivot_Map(PivotMapClass *map);
-
-
- HAnimClass * Peek_HAnim(void) const { return HAnim; } // note: does not add reference
- HAnimClass * Get_HAnim(void) const { if(HAnim) HAnim->Add_Ref(); return HAnim; } // note: does not add reference
- float Get_Frame(void) const { return Frame; }
- float Get_Prev_Frame(void) const { return PrevFrame; }
- float Get_Weight(void) const { return Weight; }
- PivotMapClass * Peek_Pivot_Map(void) const { return PivotMap; }
- PivotMapClass * Get_Pivot_Map(void) const { if(PivotMap) PivotMap->Add_Ref(); return PivotMap; }
- bool Is_Shared(void) const { return Shared; }
-
- void Build_Active_Pivot_Map(void);
-
- private:
-
- HAnimClass *HAnim;
- float Frame;
- float PrevFrame;
- float Weight;
- PivotMapClass * PivotMap;
- bool Shared; // this is set to false when the HAnimCombo allocates it
-};
-
-/*
-** defines a combination of animations for blending/mixing
-*/
-class HAnimComboClass {
-
-public:
-
- HAnimComboClass(void);
- HAnimComboClass( int num_animations ); // allocates specified number of channels and sets then all to not-shared
- ~HAnimComboClass(void);
-
- void Clear( void ); // zeros all data
-
- void Reset( void ); // empties the dynamic vector
-
- bool Normalize_Weights(void); // Normalizes all weights (returns true if succeeded)
- int Get_Num_Anims( void ) { return HAnimComboData.Count(); }
-
- void Set_Motion( int indx, HAnimClass *motion );
- HAnimClass *Get_Motion( int indx );
- HAnimClass *Peek_Motion( int indx );
-
- void Set_Frame( int indx, float frame );
- void Set_Prev_Frame( int indx, float frame );
- float Get_Frame( int indx );
- float Get_Prev_Frame( int indx );
-
- void Set_Weight( int indx, float weight );
- float Get_Weight( int indx );
-
- void Set_Pivot_Weight_Map( int indx, PivotMapClass * map );
- PivotMapClass * Get_Pivot_Weight_Map( int indx );
- PivotMapClass * Peek_Pivot_Weight_Map( int indx );
-
-
- // add an entry to the dynamic vector
- void Append_Anim_Combo_Data(HAnimComboDataClass * AnimComboData);
-
- // remove an entry from the vector
- void Remove_Anim_Combo_Data(HAnimComboDataClass * AnimComboData);
-
- // retrieve a specific combo data
- HAnimComboDataClass * Peek_Anim_Combo_Data(int index) { return HAnimComboData[index]; }
-
-protected:
-
- DynamicVectorClass HAnimComboData;
-
-};
-
-#endif
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/hcanim.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/hcanim.cpp
deleted file mode 100644
index 04dfb8ba2cb..00000000000
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/hcanim.cpp
+++ /dev/null
@@ -1,710 +0,0 @@
-/*
-** 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 .
-*/
-
-/* $Header: /Commando/Code/ww3d2/hcanim.cpp 3 6/29/01 6:41p Jani_p $ */
-/***********************************************************************************************
- *** Confidential - Westwood Studios ***
- ***********************************************************************************************
- * *
- * Project Name : Commando / G 3D Library *
- * *
- * $Archive:: /Commando/Code/ww3d2/hcanim.cpp $*
- * *
- * Author:: Greg_h *
- * *
- * $Modtime:: 6/27/01 7:50p $*
- * *
- * $Revision:: 3 $*
- * *
- *---------------------------------------------------------------------------------------------*
- * Functions: *
- * NodeMotionStruct::NodeMotionStruct -- constructor *
- * NodeMotionStruct::~NodeMotionStruct -- destructor *
- * HCompressedAnimClass::HCompressedAnimClass -- constructor *
- * HCompressedAnimClass::~HCompressedAnimClass -- Destructor *
- * HCompressedAnimClass::Free -- De-allocates all memory in use *
- * HCompressedAnimClass::Load -- Loads hierarchy animation from a file *
- * HCompressedAnimClass::read_channel -- Reads in a single channel of motion *
- * HCompressedAnimClass::add_channel -- Adds a motion channel to the animation *
- * HCompressedAnimClass::Get_Translation -- returns the translation vector for the given fram*
- * HCompressedAnimClass::Get_Orientation -- returns a quaternion for the orientation of the p*
- * HCompressedAnimClass::read_bit_channel -- read a bit channel from the file *
- * HCompressedAnimClass::add_bit_channel -- install a bit channel into the animation *
- * HCompressedAnimClass::Get_Visibility -- return visibility state for given pivot/frame *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-
-#include "hcanim.h"
-#include "assetmgr.h"
-#include "htree.h"
-#include "motchan.h"
-#include "chunkio.h"
-#include "w3d_file.h"
-#include "wwdebug.h"
-#include
-#include
-
-
-struct NodeCompressedMotionStruct
-{
- NodeCompressedMotionStruct();
- ~NodeCompressedMotionStruct();
-
- void SetFlavor(int flavor) {Flavor = flavor;}
-
- int Flavor;
-
- union {
- struct {
- TimeCodedMotionChannelClass * X;
- TimeCodedMotionChannelClass * Y;
- TimeCodedMotionChannelClass * Z;
- TimeCodedMotionChannelClass * Q;
- } tc;
-
- struct {
- AdaptiveDeltaMotionChannelClass * X;
- AdaptiveDeltaMotionChannelClass * Y;
- AdaptiveDeltaMotionChannelClass * Z;
- AdaptiveDeltaMotionChannelClass * Q;
-
- } ad;
-
- struct {
- void * X;
- void * Y;
- void * Z;
- void * Q;
- } vd;
- };
-
-
- TimeCodedBitChannelClass * Vis;
-};
-
-/***********************************************************************************************
- * NodeCompressedMotionStruct::NodeCompressedMotionStruct -- constructor *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- *=============================================================================================*/
-NodeCompressedMotionStruct::NodeCompressedMotionStruct() :
- Vis(NULL)
-{
- vd.X = NULL;
- vd.Y = NULL;
- vd.Z = NULL;
- vd.Q = NULL;
-}
-
-
-/***********************************************************************************************
- * NodeCompressedMotionStruct::~NodeCompressedMotionStruct -- destructor *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 10/23/98 GTH : Created. *
- * 02/02/00 JGA : Compressed *
- *=============================================================================================*/
-NodeCompressedMotionStruct::~NodeCompressedMotionStruct()
-{
- // Needs to be changed to call the correct destructors
-
- switch (Flavor) {
- case ANIM_FLAVOR_TIMECODED:
- if (tc.X) delete tc.X;
- if (tc.Y) delete tc.Y;
- if (tc.Z) delete tc.Z;
- if (tc.Q) delete tc.Q;
- break;
- case ANIM_FLAVOR_ADAPTIVE_DELTA:
- if (ad.X) delete ad.X;
- if (ad.Y) delete ad.Y;
- if (ad.Z) delete ad.Z;
- if (ad.Q) delete ad.Q;
- break;
- default:
- WWASSERT(0); // unknown flavor
- break;
- }
-
- if (Vis) delete Vis;
-
-} // ~NodeCompressedMotionStruct
-
-
-/***********************************************************************************************
- * HCompressedAnimClass::HCompressedAnimClass -- constructor *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 08/11/1997 GH : Created. *
- *=============================================================================================*/
-HCompressedAnimClass::HCompressedAnimClass(void) :
- NumFrames(0),
- NumNodes(0),
- Flavor(0),
- FrameRate(0),
- NodeMotion(NULL)
-{
- memset(Name,0,W3D_NAME_LEN);
- memset(HierarchyName,0,W3D_NAME_LEN);
-}
-
-
-/***********************************************************************************************
- * HCompressedAnimClass::~HCompressedAnimClass -- Destructor *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 08/11/1997 GH : Created. *
- *=============================================================================================*/
-HCompressedAnimClass::~HCompressedAnimClass(void)
-{
- Free();
-}
-
-
-/***********************************************************************************************
- * HCompressedAnimClass::Free -- De-allocates all memory in use *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 08/11/1997 GH : Created. *
- *=============================================================================================*/
-void HCompressedAnimClass::Free(void)
-{
- if (NodeMotion != NULL) {
- delete[] NodeMotion;
- }
-}
-
-
-/***********************************************************************************************
- * HCompressedAnimClass::Load -- Loads hierarchy animation from a file *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 08/11/1997 GH : Created. *
- *=============================================================================================*/
-int HCompressedAnimClass::Load_W3D(ChunkLoadClass & cload)
-{
- int i = 0;
- /*
- ** First make sure we release any memory in use
- */
- Free();
-
- /*
- ** Open the first chunk, it should be the animation header
- */
- if (!cload.Open_Chunk()) return LOAD_ERROR;
-
- if (cload.Cur_Chunk_ID() != W3D_CHUNK_COMPRESSED_ANIMATION_HEADER) {
- // ERROR: Expected Animation Header!
- return LOAD_ERROR;
- }
-
- W3dCompressedAnimHeaderStruct aheader;
- if (cload.Read(&aheader,sizeof(W3dAnimHeaderStruct)) != sizeof(W3dAnimHeaderStruct)) {
- return LOAD_ERROR;
- }
-
- cload.Close_Chunk();
-
- strcpy(Name,aheader.HierarchyName);
- strcat(Name,".");
- strcat(Name,aheader.Name);
-
- // TSS chasing crash bug 05/26/99
- WWASSERT(HierarchyName != NULL);
- WWASSERT(aheader.HierarchyName != NULL);
- WWASSERT(sizeof(HierarchyName) >= W3D_NAME_LEN);
- strncpy(HierarchyName,aheader.HierarchyName,W3D_NAME_LEN);
-
- HTreeClass * base_pose = WW3DAssetManager::Get_Instance()->Get_HTree(HierarchyName);
- if (base_pose == NULL) {
- goto Error;
- }
- NumNodes = base_pose->Num_Pivots();
-
- NumFrames = aheader.NumFrames;
- FrameRate = aheader.FrameRate;
- Flavor = aheader.Flavor;
-
- // Just for now
- WWASSERT((Flavor == ANIM_FLAVOR_TIMECODED)||(Flavor == ANIM_FLAVOR_ADAPTIVE_DELTA));
-
- NodeMotion = W3DNEWARRAY NodeCompressedMotionStruct[ NumNodes ];
- if (NodeMotion == NULL) {
- goto Error;
- }
-
- // Initialize Flavor
- for (i=0; iGet_Pivot() < NumNodes) {
- add_channel(tc_chan);
- } else {
- // PWG 12-14-98: we have only allocated space for NumNode pivots.
- // If we have an index thats equal or higher than NumNode we are
- // gonna trash memory. Boy will we trash memory.
- // GTH 09-25-2000: print a warning and survive this error
- delete tc_chan;
- WWDEBUG_SAY(("ERROR! animation %s indexes a bone not present in the model. Please re-export!\r\n",Name));
- }
-
- break;
-
- case ANIM_FLAVOR_ADAPTIVE_DELTA:
- if (!read_channel(cload,&ad_chan)) {
- goto Error;
- }
- if (ad_chan->Get_Pivot() < NumNodes) {
- add_channel(ad_chan);
- } else {
- // PWG 12-14-98: we have only allocated space for NumNode pivots.
- // If we have an index thats equal or higher than NumNode we are
- // gonna trash memory. Boy will we trash memory.
- // GTH 09-25-2000: print a warning and survive this error
- delete ad_chan;
- WWDEBUG_SAY(("ERROR! animation %s indexes a bone not present in the model. Please re-export!\r\n",Name));
- }
- break;
- }
- break;
-
- case W3D_CHUNK_COMPRESSED_BIT_CHANNEL:
- if (!read_bit_channel(cload,&newbitchan)) {
- goto Error;
- }
- if (newbitchan->Get_Pivot() < NumNodes) {
- add_bit_channel(newbitchan);
- } else {
- // PWG 12-14-98: we have only allocated space for NumNode pivots.
- // If we have an index thats equal or higher than NumNode we are
- // gonna trash memory. Boy will we trash memory.
- // GTH 09-25-2000: print a warning and survive this error
- delete newbitchan;
- WWDEBUG_SAY(("ERROR! animation %s indexes a bone not present in the model. Please re-export!\r\n",Name));
- }
-
- break;
-
- default:
- break;
- }
- cload.Close_Chunk();
- }
-
- return OK;
-
-Error:
-
- Free();
- return LOAD_ERROR;
-
-} // Load_W3D
-
-/***********************************************************************************************
- * HCompressedAnimClass::read_channel -- Reads in a single channel of motion *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 08/11/1997 GH : Created. *
- *=============================================================================================*/
-bool HCompressedAnimClass::read_channel(ChunkLoadClass & cload,TimeCodedMotionChannelClass * * newchan)
-{
- *newchan = W3DNEW TimeCodedMotionChannelClass;
- bool result = (*newchan)->Load_W3D(cload);
-
- return result;
-
-} // read_channel
-
-bool HCompressedAnimClass::read_channel(ChunkLoadClass & cload,AdaptiveDeltaMotionChannelClass * * newchan)
-{
- *newchan = W3DNEW AdaptiveDeltaMotionChannelClass;
- bool result = (*newchan)->Load_W3D(cload);
-
- return result;
-
-} // read_channel
-
-
-/***********************************************************************************************
- * HCompressedAnimClass::add_channel -- Adds a motion channel to the animation *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 08/11/1997 GH : Created. *
- *=============================================================================================*/
-void HCompressedAnimClass::add_channel(TimeCodedMotionChannelClass * newchan)
-{
- int idx = newchan->Get_Pivot();
-
- switch (newchan->Get_Type())
- {
- case ANIM_CHANNEL_X:
- NodeMotion[idx].tc.X = newchan;
- break;
-
- case ANIM_CHANNEL_Y:
- NodeMotion[idx].tc.Y = newchan;
- break;
-
- case ANIM_CHANNEL_Z:
- NodeMotion[idx].tc.Z = newchan;
- break;
-
- case ANIM_CHANNEL_Q:
- NodeMotion[idx].tc.Q = newchan;
- break;
- }
-
-} // add_channel
-
-void HCompressedAnimClass::add_channel(AdaptiveDeltaMotionChannelClass * newchan)
-{
- int idx = newchan->Get_Pivot();
-
- switch (newchan->Get_Type())
- {
- case ANIM_CHANNEL_X:
- NodeMotion[idx].ad.X = newchan;
- break;
-
- case ANIM_CHANNEL_Y:
- NodeMotion[idx].ad.Y = newchan;
- break;
-
- case ANIM_CHANNEL_Z:
- NodeMotion[idx].ad.Z = newchan;
- break;
-
- case ANIM_CHANNEL_Q:
- NodeMotion[idx].ad.Q = newchan;
- break;
- }
-
-} // add_channel
-
-
-
-
-/***********************************************************************************************
- * HCompressedAnimClass::read_bit_channel -- read a bit channel from the file *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 1/19/98 GTH : Created. *
- *=============================================================================================*/
-bool HCompressedAnimClass::read_bit_channel(ChunkLoadClass & cload,TimeCodedBitChannelClass * * newchan)
-{
- *newchan = W3DNEW TimeCodedBitChannelClass;
- bool result = (*newchan)->Load_W3D(cload);
-
- return result;
-
-} // read_bit_channel
-
-
-/***********************************************************************************************
- * HCompressedAnimClass::add_bit_channel -- install a bit channel into the animation *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 1/19/98 GTH : Created. *
- *=============================================================================================*/
-void HCompressedAnimClass::add_bit_channel(TimeCodedBitChannelClass * newchan)
-{
- int idx = newchan->Get_Pivot();
-
- switch (newchan->Get_Type())
- {
- case BIT_CHANNEL_VIS:
- NodeMotion[idx].Vis = newchan;
- break;
- }
-}
-
-/***********************************************************************************************
- * HCompressedAnimClass::Get_Translation -- returns the translation vector for the given frame *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 08/11/1997 GH : Created. *
- *=============================================================================================*/
-void HCompressedAnimClass::Get_Translation( Vector3& trans, int pividx, float frame ) const
-{
- struct NodeCompressedMotionStruct * motion = &NodeMotion[pividx];
-
- trans=Vector3(0,0,0);
-
- switch(Flavor) {
- case ANIM_FLAVOR_TIMECODED:
- if (motion->tc.X) motion->tc.X->Get_Vector(frame, &(trans[0]));
- if (motion->tc.Y) motion->tc.Y->Get_Vector(frame, &(trans[1]));
- if (motion->tc.Z) motion->tc.Z->Get_Vector(frame, &(trans[2]));
- break;
- case ANIM_FLAVOR_ADAPTIVE_DELTA:
- if (motion->ad.X) motion->ad.X->Get_Vector(frame, &(trans[0]));
- if (motion->ad.Y) motion->ad.Y->Get_Vector(frame, &(trans[1]));
- if (motion->ad.Z) motion->ad.Z->Get_Vector(frame, &(trans[2]));
- break;
- default:
- WWASSERT(0); // unknown flavor
- break;
- }
-}
-
-/***********************************************************************************************
- * HCompressedAnimClass::Get_Orientation -- returns a quaternion for the orientation of the *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 08/11/1997 GH : Created. *
- *=============================================================================================*/
-void HCompressedAnimClass::Get_Orientation(Quaternion& q, int pividx,float frame) const
-{
- switch(Flavor) {
- case ANIM_FLAVOR_TIMECODED:
- if (NodeMotion[pividx].tc.Q) q = NodeMotion[pividx].tc.Q->Get_QuatVector(frame);
- else q.Make_Identity();
- break;
- case ANIM_FLAVOR_ADAPTIVE_DELTA:
- if (NodeMotion[pividx].ad.Q) q = NodeMotion[pividx].ad.Q->Get_QuatVector(frame);
- else q.Make_Identity();
- break;
- default:
- WWASSERT(0); // unknown flavor
- break;
- }
-} // Get_Orientation
-
-/***********************************************************************************************
- * HCompressedAnimClass::Get_Transform -- returns the transform matrix for the given frame *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 08/11/1997 GH : Created. *
- *=============================================================================================*/
-void HCompressedAnimClass::Get_Transform( Matrix3D& mtx, int pividx, float frame ) const
-{
- struct NodeCompressedMotionStruct * motion = &NodeMotion[pividx];
-
- switch(Flavor) {
- case ANIM_FLAVOR_TIMECODED:
- if (NodeMotion[pividx].tc.Q) {
- Quaternion q;
- q = NodeMotion[pividx].tc.Q->Get_QuatVector(frame);
- ::Build_Matrix3D(q,mtx);
- }
- else mtx.Make_Identity();
- if (motion->tc.X) motion->tc.X->Get_Vector(frame, &(mtx[0][3]));
- if (motion->tc.Y) motion->tc.Y->Get_Vector(frame, &(mtx[1][3]));
- if (motion->tc.Z) motion->tc.Z->Get_Vector(frame, &(mtx[2][3]));
- break;
- case ANIM_FLAVOR_ADAPTIVE_DELTA:
- if (NodeMotion[pividx].ad.Q) {
- Quaternion q;
- q = NodeMotion[pividx].ad.Q->Get_QuatVector(frame);
- ::Build_Matrix3D(q,mtx);
- }
- else mtx.Make_Identity();
-
- if (motion->ad.X) motion->ad.X->Get_Vector(frame, &(mtx[0][3]));
- if (motion->ad.Y) motion->ad.Y->Get_Vector(frame, &(mtx[1][3]));
- if (motion->ad.Z) motion->ad.Z->Get_Vector(frame, &(mtx[2][3]));
- break;
- default:
- WWASSERT(0); // unknown flavor
- break;
- }
-}
-
-/***********************************************************************************************
- * HCompressedAnimClass::Get_Visibility -- return visibility state for given pivot/frame *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 1/19/98 GTH : Created. *
- *=============================================================================================*/
-bool HCompressedAnimClass::Get_Visibility(int pividx,float frame)
-{
-
- if (NodeMotion[pividx].Vis != NULL) {
- return (NodeMotion[pividx].Vis->Get_Bit((int)frame) == 1);
- }
-
-
- // default to always visible...
- return 1;
-}
-
-
-
-/***********************************************************************************************
- * HAnimClass::Is_Node_Motion_Present -- return true if there is motion defined for this frame *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 3/23/99 EHC : Created. *
- *=============================================================================================*/
-bool HCompressedAnimClass::Is_Node_Motion_Present(int pividx)
-{
- WWASSERT((pividx >= 0) && (pividx < NumNodes));
-
- if (NodeMotion[pividx].vd.X != NULL) return true;
- if (NodeMotion[pividx].vd.Y != NULL) return true;
- if (NodeMotion[pividx].vd.Z != NULL) return true;
- if (NodeMotion[pividx].vd.Q != NULL) return true;
- if (NodeMotion[pividx].Vis != NULL) return true;
-
- return false;
-}
-
-bool HCompressedAnimClass::Has_X_Translation (int pividx)
-{
- WWASSERT((pividx >= 0) && (pividx < NumNodes));
- return NodeMotion[pividx].vd.X != NULL;
-}
-
-bool HCompressedAnimClass::Has_Y_Translation (int pividx)
-{
- WWASSERT((pividx >= 0) && (pividx < NumNodes));
- return NodeMotion[pividx].vd.Y != NULL;
-}
-
-bool HCompressedAnimClass::Has_Z_Translation (int pividx)
-{
- WWASSERT((pividx >= 0) && (pividx < NumNodes));
- return NodeMotion[pividx].vd.Z != NULL;
-}
-
-bool HCompressedAnimClass::Has_Rotation (int pividx)
-{
- WWASSERT((pividx >= 0) && (pividx < NumNodes));
- return NodeMotion[pividx].vd.Q != NULL;
-}
-
-bool HCompressedAnimClass::Has_Visibility (int pividx)
-{
- WWASSERT((pividx >= 0) && (pividx < NumNodes));
- return NodeMotion[pividx].Vis != NULL;
-}
-
-
-// eof - hcanim.cpp
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/hcanim.h b/Generals/Code/Libraries/Source/WWVegas/WW3D2/hcanim.h
deleted file mode 100644
index b3f646d197d..00000000000
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/hcanim.h
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
-** 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 .
-*/
-
-/* $Header: /Commando/Code/ww3d2/hcanim.h 2 6/29/01 6:41p Jani_p $ */
-/***********************************************************************************************
- *** Confidential - Westwood Studios ***
- ***********************************************************************************************
- * *
- * Project Name : Commando / G 3D Library *
- * *
- * $Archive:: /Commando/Code/ww3d2/hcanim.h $*
- * *
- * Author:: Greg_h *
- * *
- * $Modtime:: 6/27/01 7:35p $*
- * *
- * $Revision:: 2 $*
- * *
- *---------------------------------------------------------------------------------------------*
- * Functions: *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-
-#if defined(_MSC_VER)
-#pragma once
-#endif
-
-#ifndef HCANIM_H
-#define HCANIM_H
-
-#include "always.h"
-#include "quat.h"
-#include "refcount.h"
-#include "w3d_file.h"
-#include "SLIST.H"
-#include "Vector.H"
-#include "hanim.h"
-
-struct NodeCompressedMotionStruct;
-class TimeCodedMotionChannelClass;
-class TimeCodedBitChannelClass;
-class AdaptiveDeltaMotionChannelClass;
-class HTreeClass;
-class ChunkLoadClass;
-class ChunkSaveClass;
-
-
-/**********************************************************************************
-
- Hierarchy Compressed Animation Class
-
- Stores motion data to be applied to a HierarchyTree. Each frame
- of the motion contains deltas from the HierarchyTree's base position
- to the desired position.
-
-**********************************************************************************/
-
-class HCompressedAnimClass : public HAnimClass
-{
-
-public:
-
- enum
- {
- OK,
- LOAD_ERROR
- };
-
- HCompressedAnimClass(void);
- ~HCompressedAnimClass(void);
-
- int Load_W3D(ChunkLoadClass & cload);
-
- const char * Get_Name(void) const { return Name; }
- const char * Get_HName(void) const { return HierarchyName; }
- int Get_Num_Frames(void) { return NumFrames; }
- float Get_Frame_Rate() { return FrameRate; }
- float Get_Total_Time() { return (float)NumFrames / FrameRate; }
- int Get_Flavor() { return Flavor; }
-
-// Vector3 Get_Translation(int pividx,float frame);
-// Quaternion Get_Orientation(int pividx,float frame);
- void Get_Translation(Vector3& translation, int pividx,float frame) const;
- void Get_Orientation(Quaternion& orientation, int pividx,float frame) const;
- void Get_Transform(Matrix3D& transform, int pividx,float frame) const;
- bool Get_Visibility(int pividx,float frame);
-
- bool Is_Node_Motion_Present(int pividx);
- int Get_Num_Pivots(void) const { return NumNodes; }
-
- // Methods that test the presence of a certain motion channel.
- bool Has_X_Translation (int pividx);
- bool Has_Y_Translation (int pividx);
- bool Has_Z_Translation (int pividx);
- bool Has_Rotation (int pividx);
- bool Has_Visibility (int pividx);
-
-private:
-
- char Name[2*W3D_NAME_LEN];
- char HierarchyName[W3D_NAME_LEN];
-
- int NumFrames;
- int NumNodes;
- int Flavor;
- float FrameRate;
-
- NodeCompressedMotionStruct * NodeMotion;
-
- void Free(void);
- bool read_channel(ChunkLoadClass & cload,TimeCodedMotionChannelClass * * newchan);
- bool read_channel(ChunkLoadClass & cload,AdaptiveDeltaMotionChannelClass * * newchan);
- void add_channel(TimeCodedMotionChannelClass * newchan);
- void add_channel(AdaptiveDeltaMotionChannelClass * newchan);
-
-
- bool read_bit_channel(ChunkLoadClass & cload,TimeCodedBitChannelClass * * newchan);
- void add_bit_channel(TimeCodedBitChannelClass * newchan);
-
-};
-
-
-#endif // hcanim.h
-
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/hmdldef.H b/Generals/Code/Libraries/Source/WWVegas/WW3D2/hmdldef.H
deleted file mode 100644
index 732998476cc..00000000000
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/hmdldef.H
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
-** 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 .
-*/
-
-/***********************************************************************************************
- *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
- ***********************************************************************************************
- * *
- * Project Name : WW3D *
- * *
- * $Archive:: /Commando/Code/ww3d2/hmdldef.h $*
- * *
- * Author:: Greg_h *
- * *
- * $Modtime:: 1/08/01 10:04a $*
- * *
- * $Revision:: 1 $*
- * *
- *---------------------------------------------------------------------------------------------*
- * Functions: *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-
-#if defined(_MSC_VER)
-#pragma once
-#endif
-
-#ifndef HMDLDEF_H
-#define HMDLDEF_H
-
-#include "always.h"
-#include "w3d_file.h"
-
-class FileClass;
-class ChunkLoadClass;
-class ChunkSaveClass;
-class SnapPointsClass;
-
-/*
-** Each render object to be attached into the hierarchy model
-** will be defined by an instance of the following structure.
-** The HmdlNodeDefStruct associates a named render object with
-** an indexed pivot/bone in the hierarchy tree.
-*/
-struct HmdlNodeDefStruct
-{
- char RenderObjName[2*W3D_NAME_LEN];
- int PivotID;
-};
-
-
-/*
-** HModelDefClass
-**
-** "Hierarchy Model Definition Class"
-** This class serves as a blueprint for creating HierarchyModelClasses.
-** The asset manager stores these objects internally and uses them to
-** create instances of HierarchyModels for the user.
-*/
-class HModelDefClass
-{
-
-public:
-
- enum {
- OK,
- LOAD_ERROR
- };
-
- HModelDefClass(void);
- ~HModelDefClass(void);
-
- int Load_W3D(ChunkLoadClass & cload);
- const char * Get_Name(void) const { return Name; }
-
-private:
-
- char Name[2*W3D_NAME_LEN]; // .
- char ModelName[W3D_NAME_LEN]; // name of the model
- char BasePoseName[W3D_NAME_LEN]; // name of the base pose (hierarchy tree)
-
- int SubObjectCount;
- HmdlNodeDefStruct * SubObjects;
- SnapPointsClass * SnapPoints;
-
- void Free(void);
- bool read_header(ChunkLoadClass & cload);
- bool read_connection(ChunkLoadClass & cload,HmdlNodeDefStruct * con,bool pre30);
- bool read_mesh_connection(ChunkLoadClass & cload,int idx,bool pre30);
- bool read_collision_connection(ChunkLoadClass & cload,int idx,bool pre30);
- bool read_skin_connection(ChunkLoadClass & cload,int idx,bool pre30);
-
- // HModelClass requires intimate knowlege of us
- friend class HModelClass;
- friend class HLodClass;
-};
-
-#endif
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/hmdldef.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/hmdldef.cpp
deleted file mode 100644
index cb6caee841a..00000000000
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/hmdldef.cpp
+++ /dev/null
@@ -1,257 +0,0 @@
-/*
-** 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 .
-*/
-
-/***********************************************************************************************
- *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
- ***********************************************************************************************
- * *
- * Project Name : WW3D *
- * *
- * $Archive:: /Commando/Code/ww3d2/hmdldef.cpp $*
- * *
- * Author:: Greg_h *
- * *
- * $Modtime:: 1/08/01 10:04a $*
- * *
- * $Revision:: 1 $*
- * *
- *---------------------------------------------------------------------------------------------*
- * Functions: *
- * HModelDefClass::HModelDefClass -- Constructor *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-
-#include "hmdldef.H"
-#include
-#include
-#include "w3d_file.h"
-#include "chunkio.h"
-#include "snapPts.h"
-
-
-/***********************************************************************************************
- * HModelDefClass::HModelDefClass -- Constructor *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 12/15/97 GTH : Created. *
- *=============================================================================================*/
-HModelDefClass::HModelDefClass(void) :
- SubObjectCount(0),
- SubObjects(NULL),
- SnapPoints(NULL)
-{
-
-}
-
-/***********************************************************************************************
- * HModelDefClass::~HModelDefClass -- destructor *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 08/11/1997 GH : Created. *
- *=============================================================================================*/
-HModelDefClass::~HModelDefClass(void)
-{
- Free();
-}
-
-/***********************************************************************************************
- * HModelDefClass::Free -- de-allocate all memory in use *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 08/11/1997 GH : Created. *
- *=============================================================================================*/
-void HModelDefClass::Free(void)
-{
- if (SubObjects != NULL) {
- delete[] SubObjects;
- SubObjects = NULL;
- }
- SubObjectCount = 0;
-
- if (SnapPoints != NULL) {
- SnapPoints->Release_Ref();
- SnapPoints = NULL;
- }
-}
-
-
-/***********************************************************************************************
- * HModelDefClass::Load -- load a set of mesh connections from a file *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 08/11/1997 GH : Created. *
- *=============================================================================================*/
-int HModelDefClass::Load_W3D(ChunkLoadClass & cload)
-{
- bool pre30 = false;
- int subobjcounter = 0;
-
- Free();
-
- /*
- ** Read the first chunk, it should be the header
- */
- if (!cload.Open_Chunk()) {
- return false;
- }
-
- if (cload.Cur_Chunk_ID() != W3D_CHUNK_HMODEL_HEADER) {
- goto Error;
- }
-
- /*
- ** read in the header
- */
- W3dHModelHeaderStruct header;
- if (cload.Read(&header,sizeof(W3dHModelHeaderStruct)) != sizeof(W3dHModelHeaderStruct)) {
- goto Error;
- }
-
- cload.Close_Chunk();
-
- /*
- ** process the header info
- */
- strncpy(ModelName,header.Name,W3D_NAME_LEN);
- ModelName[W3D_NAME_LEN - 1] = 0;
- strncpy(BasePoseName,header.HierarchyName,W3D_NAME_LEN);
- BasePoseName[W3D_NAME_LEN-1] = 0;
- strcpy(Name,ModelName);
-
- /*
- ** Just allocate a node for the number of sub objects we're expecting
- */
- SubObjectCount = header.NumConnections;
- SubObjects = W3DNEWARRAY HmdlNodeDefStruct[SubObjectCount];
- if (SubObjects == NULL) {
- goto Error;
- }
-
- /*
- ** If this is pre-3.0 set a flag so that each render object's
- ** bone id will be incremented by one to account for the new
- ** root node added with version3.0 of the file format. Basically,
- ** I'm making all of the code assume that node 0 is the root and
- ** therefore, pre-3.0 files have to have it added and all of
- ** the indices adjusted
- */
- if (header.Version < W3D_MAKE_VERSION(3,0)) {
- pre30 = true;
- }
-
- /*
- ** Process the rest of the chunks
- */
- subobjcounter = 0;
-
- while (cload.Open_Chunk()) {
-
- switch (cload.Cur_Chunk_ID()) {
-
- case W3D_CHUNK_NODE:
- case W3D_CHUNK_COLLISION_NODE:
- case W3D_CHUNK_SKIN_NODE:
- if (!read_connection(cload,&(SubObjects[subobjcounter]),pre30)) {
- goto Error;
- }
- subobjcounter++;
- break;
-
- case W3D_CHUNK_POINTS:
- SnapPoints = W3DNEW SnapPointsClass;
- SnapPoints->Load_W3D(cload);
- break;
-
- default:
- break;
- }
- cload.Close_Chunk();
- }
-
- return OK;
-
-Error:
-
- return LOAD_ERROR;
-
-}
-
-
-/***********************************************************************************************
- * HModelDefClass::read_connection -- read a single connection from the file *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 08/11/1997 GH : Created. *
- * 10/22/97 GH : Check for mesh connections with PivotID=-1 *
- *=============================================================================================*/
-bool HModelDefClass::read_connection(ChunkLoadClass & cload,HmdlNodeDefStruct * node,bool pre30)
-{
-
- W3dHModelNodeStruct con;
- if (cload.Read(&con,sizeof(W3dHModelNodeStruct)) != sizeof(W3dHModelNodeStruct)) {
- return false;
- }
-
- strcpy(node->RenderObjName,ModelName);
- strcat(node->RenderObjName,".");
- strcat(node->RenderObjName,con.RenderObjName);
-
- if (pre30) {
- if (con.PivotIdx == 65535) {
- node->PivotID = 0;
- } else {
- node->PivotID = con.PivotIdx + 1;
- }
- } else {
- assert(con.PivotIdx != 65535);
- node->PivotID = con.PivotIdx;
- }
-
- return true;
-}
-
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/htree.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/htree.cpp
deleted file mode 100644
index b8dad6de2ff..00000000000
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/htree.cpp
+++ /dev/null
@@ -1,1231 +0,0 @@
-/*
-** 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 .
-*/
-
-/* $Header: /Commando/Code/ww3d2/htree.cpp 14 10/01/01 6:07p Patrick $ */
-/***********************************************************************************************
- *** Confidential - Westwood Studios ***
- ***********************************************************************************************
- * *
- * Project Name : Commando / G 3D Library *
- * *
- * $Archive:: /Commando/Code/ww3d2/htree.cpp $*
- * *
- * Author:: Greg_h *
- * *
- * $Modtime:: 10/01/01 6:06p $*
- * *
- * $Revision:: 14 $*
- * *
- *---------------------------------------------------------------------------------------------*
- * Functions: *
- * HTreeClass::HTreeClass -- constructor *
- * HTreeClass::~HTreeClass -- destructor *
- * HTreeClass::Load -- loads a hierarchy tree from a file *
- * HTreeClass::read_pivots -- reads the pivots out of a file *
- * HTreeClass::Free -- de-allocate all memory in use *
- * HTreeClass::Base_Update -- Computes the base pose transform for each pivot *
- * HTreeClass::Anim_Update -- Computes the transform for each pivot with motion *
- * HTreeClass::Blend_Update -- computes each pivot as a blend of two anims *
- * HTreeClass::Combo_Update -- compute each pivot's transform using an anim combo *
- * HTreeClass::Get_Transform -- returns the transformation for the desired pivot *
- * HTreeClass::Find_Bone -- Find a bone by name *
- * HTreeClass::Get_Bone_Name -- get the name of a bone from its index *
- * HTreeClass::Update_Parent_Need_Bits -- all "needed" children force their parents to be nee*
- * HTreeClass::HTreeClass -- copy constructor *
- * HTreeClass::Get_Parent_Index -- returns index of the parent of the given bone *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-
-#include "htree.h"
-#include "hanim.h"
-#include "hcanim.h"
-#include
-#include
-#include "wwmath.h"
-#include "chunkio.h"
-#include "w3d_file.h"
-#include "wwmemlog.h"
-#include "hrawanim.h"
-#include "motchan.h"
-
-/***********************************************************************************************
- * HTreeClass::HTreeClass -- constructor *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 08/11/1997 GH : Created. *
- *=============================================================================================*/
-HTreeClass::HTreeClass(void) :
- NumPivots(0),
- Pivot(NULL),
- ScaleFactor(1.0f)
-{
-}
-
-void HTreeClass::Init_Default(void)
-{
- Free ();
-
- NumPivots = 1;
- Pivot = MSGW3DNEWARRAY("HTreeClass::Pivot") PivotClass[NumPivots];
-
- Pivot[0].Index = 0;
- Pivot[0].Parent = NULL;
- Pivot[0].BaseTransform.Make_Identity();
- Pivot[0].Transform.Make_Identity();
- Pivot[0].IsVisible = true;
- strcpy(Pivot[0].Name,"RootTransform");
- //::strcpy (Name, "Default");
- Name[0] = 0;
- return ;
-
-
-
-}
-
-/***********************************************************************************************
- * HTreeClass::~HTreeClass -- destructor *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 08/11/1997 GH : Created. *
- *=============================================================================================*/
-HTreeClass::~HTreeClass(void)
-{
- Free();
-
-
-
-}
-
-
-/***********************************************************************************************
- * HTreeClass::HTreeClass -- copy constructor *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 3/4/98 GTH : Created. *
- *=============================================================================================*/
-HTreeClass::HTreeClass(const HTreeClass & src) :
- NumPivots(0),
- Pivot(NULL),
- ScaleFactor(1.0f)
-{
- memcpy(&Name,&src.Name,sizeof(Name));
-
- NumPivots = src.NumPivots;
- if (NumPivots > 0) {
- Pivot = MSGW3DNEWARRAY("HTreeClass::Pivot") PivotClass[NumPivots];
- }
-
- for (int pi = 0; pi < NumPivots; pi++) {
- Pivot[pi] = src.Pivot[pi];
-
- if (src.Pivot[pi].Parent != NULL) {
- Pivot[pi].Parent = &(Pivot[src.Pivot[pi].Parent->Index]);
- } else {
- Pivot[pi].Parent = NULL;
- }
- }
-
- ScaleFactor = src.ScaleFactor;
-}
-
-/***********************************************************************************************
- * HTreeClass::Load -- loads a hierarchy tree from a file *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 08/11/1997 GH : Created. *
- *=============================================================================================*/
-int HTreeClass::Load_W3D(ChunkLoadClass & cload)
-{
- Free();
-
- /*
- ** Read the first chunk, it should be the hierarchy header
- */
- if (!cload.Open_Chunk()) return LOAD_ERROR;
-
- if (cload.Cur_Chunk_ID() != W3D_CHUNK_HIERARCHY_HEADER) {
- // ERROR: Expected Hierarchy Header
- return LOAD_ERROR;
- }
-
- W3dHierarchyStruct header;
- if (cload.Read(&header,sizeof(W3dHierarchyStruct)) != sizeof(W3dHierarchyStruct)) {
- return LOAD_ERROR;
- }
-
- cload.Close_Chunk();
-
- /*
- ** Check the version, if < 3.0 add a root node for everything
- ** to attach to. The load_pivots function will also have to be
- ** notified of this.
- */
- bool pre30 = false;
- if (header.Version < W3D_MAKE_VERSION(3,0)) {
- header.NumPivots ++;
- pre30 = true;
- }
-
- /*
- ** Allocate the array of pivots
- */
- memcpy(Name,header.Name,W3D_NAME_LEN);
- NumPivots = header.NumPivots;
- if (NumPivots > 0) {
- Pivot = MSGW3DNEWARRAY("HTreeClass::Pivot") PivotClass[NumPivots];
- }
-
- /*
- ** Now, read in all of the other chunks for this hierarchy.
- */
-
- while (cload.Open_Chunk()) {
-
- switch (cload.Cur_Chunk_ID()) {
-
- case W3D_CHUNK_PIVOTS:
- if (!read_pivots(cload,pre30)) {
- goto Error;
- }
- break;
-
- default:
- // ERROR: expected W3D_CHUNK_PIVOTS!
- break;
- }
- cload.Close_Chunk();
- }
-
- return OK;
-
-Error:
-
- Free();
- return LOAD_ERROR;
-}
-
-
-/***********************************************************************************************
- * HTreeClass::read_pivots -- reads the pivots out of a file *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 08/11/1997 GH : Created. *
- *=============================================================================================*/
-bool HTreeClass::read_pivots(ChunkLoadClass & cload,bool pre30)
-{
- W3dPivotStruct piv;
- Matrix3D mtx;
-
- int first_piv = 0;
-
- /*
- ** At (w3d file format) version 3.0, I added a node for the root. Pre-3.0 htrees didn't have
- ** this so we just put one in.
- */
- if (pre30) {
- Pivot[0].Index = 0;
- Pivot[0].Parent = NULL;
- Pivot[0].BaseTransform.Make_Identity();
- Pivot[0].Transform.Make_Identity();
- Pivot[0].IsVisible = true;
- strcpy(Pivot[0].Name,"RootTransform");
- first_piv++;
- }
-
- for (int pidx=first_piv; pidx < NumPivots; pidx++) {
-
- if (cload.Read(&piv,sizeof(W3dPivotStruct)) != sizeof(W3dPivotStruct)) {
- return false;
- }
-
- memcpy(Pivot[pidx].Name,piv.Name,W3D_NAME_LEN);
- Pivot[pidx].Index = pidx;
-
- Pivot[pidx].BaseTransform.Make_Identity();
- Pivot[pidx].BaseTransform.Translate(Vector3(piv.Translation.X,piv.Translation.Y,piv.Translation.Z));
-
-#ifdef ALLOW_TEMPORARIES
- Pivot[pidx].BaseTransform =
- Pivot[pidx].BaseTransform *
- Build_Matrix3D(
- Quaternion(
- piv.Rotation.Q[0],
- piv.Rotation.Q[1],
- piv.Rotation.Q[2],
- piv.Rotation.Q[3]
- ),
- mtx
- );
-#else
- Pivot[pidx].BaseTransform.postMul(
- Build_Matrix3D(
- Quaternion(
- piv.Rotation.Q[0],
- piv.Rotation.Q[1],
- piv.Rotation.Q[2],
- piv.Rotation.Q[3]
- ),
- mtx
- )
- );
-#endif
-
- /*
- ** At version 3.0 a root node was added, this "fixes up" pre-3.0 files
- ** to have that root node
- */
- if (pre30) {
- piv.ParentIdx += 1;
- }
-
- /*
- ** Set the parent pointer. The first pivot will have a parent index
- ** of -1 (in post-3.0 files) so set its parent to NULL.
- */
- if (piv.ParentIdx == -1) {
- Pivot[pidx].Parent = NULL;
- assert(pidx == 0);
- } else {
- Pivot[pidx].Parent = &(Pivot[piv.ParentIdx]);
- }
-
- }
-
- Pivot[0].Transform.Make_Identity();
- Pivot[0].IsVisible = true;
-
- return true;
-}
-
-
-/***********************************************************************************************
- * HTreeClass::Free -- de-allocate all memory in use *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 08/11/1997 GH : Created. *
- *=============================================================================================*/
-void HTreeClass::Free(void)
-{
- if (Pivot != NULL) {
- delete[] Pivot;
- Pivot = NULL;
- }
- NumPivots = 0;
-
- // Also clean up other members:
- ScaleFactor = 1.0f;
-}
-
-
-/***********************************************************************************************
- * HTreeClass::Simple_Evaluate_Pivot -- Returns the transform of a pivot at the given frame. *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 04/13/2000 PDS : Created. *
- *=============================================================================================*/
-bool HTreeClass::Simple_Evaluate_Pivot
-(
- HAnimClass * motion,
- int pivot_index,
- float frame,
- const Matrix3D & obj_tm,
- Matrix3D * end_tm
-) const
-{
- bool retval = false;
- end_tm->Make_Identity ();
-
- if ( motion != NULL &&
- end_tm != NULL &&
- pivot_index >= 0 &&
- pivot_index < NumPivots)
- {
- //
- // Loop over the hierarchy of pivots that this pivot is
- // attached to and transform each.
- //
- for ( PivotClass *pivot = &Pivot[pivot_index];
- pivot != NULL && pivot->Parent != NULL;
- pivot = pivot->Parent)
- {
- //
- // Build a matrix that represents the animation for this pivot
- //
-
- Matrix3D anim_tm;
- motion->Get_Transform(anim_tm, pivot->Index, frame);
-
-// Quaternion q;
-// motion->Get_Orientation (q, pivot->Index, frame);
-// Matrix3D anim_tm = ::Build_Matrix3D(q);
-
- Vector3 trans;
- anim_tm.Get_Translation(&trans);
- anim_tm.Set_Translation(trans * ScaleFactor);
-
- //
- // Transform the animation transform by the 'relative-to-parent' transform.
- //
- Matrix3D curr_tm;
- Matrix3D::Multiply(pivot->BaseTransform, anim_tm, &curr_tm);
-
- //
- // Transform the return value by this transform
- //
-#ifdef ALLOW_TEMPORARIES
- Matrix3D::Multiply (curr_tm, *end_tm, end_tm);
-#else
- end_tm->preMul(curr_tm);
-#endif
- }
-
- //
- // Transform the return value by the object's transform
- //
-#ifdef ALLOW_TEMPORARIES
- Matrix3D::Multiply (obj_tm, *end_tm, end_tm);
-#else
- end_tm->preMul(obj_tm);
-#endif
-
- // Success!
- retval = true;
- }
-
- return retval;
-}
-
-
-
-/***********************************************************************************************
- * HTreeClass::Simple_Evaluate_Pivot -- Returns the transform of a pivot at the given frame. *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 04/13/2000 PDS : Created. *
- *=============================================================================================*/
-bool HTreeClass::Simple_Evaluate_Pivot
-(
- int pivot_index,
- const Matrix3D & obj_tm,
- Matrix3D * end_tm
-) const
-{
- bool retval = false;
- end_tm->Make_Identity ();
-
- if ( end_tm != NULL &&
- pivot_index >= 0 &&
- pivot_index < NumPivots)
- {
- //
- // Loop over the hierarchy of pivots that this pivot is
- // attached to and transform each.
- //
- for ( PivotClass *pivot = &Pivot[pivot_index];
- pivot != NULL && pivot->Parent != NULL;
- pivot = pivot->Parent)
- {
- //
- // Build a matrix that represents the animation for this pivot
- //
- Matrix3D anim_tm (1);
-
- //
- // Transform the animation transform by the 'relative-to-parent' transform.
- //
- Matrix3D curr_tm;
- Matrix3D::Multiply (pivot->BaseTransform, anim_tm, &curr_tm);
-
- //
- // Transform the return value by this transform
- //
- Matrix3D::Multiply (curr_tm, *end_tm, end_tm);
- }
-
- //
- // Transform the return value by the object's transform
- //
- Matrix3D::Multiply (obj_tm, *end_tm, end_tm);
- retval = true;
- }
-
- return retval;
-}
-
-
-/***********************************************************************************************
- * HTreeClass::Base_Update -- Computes the base pose transform for each pivot *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 08/11/1997 GH : Created. *
- *=============================================================================================*/
-void HTreeClass::Base_Update(const Matrix3D & root)
-{
- PivotClass *pivot;
-
- Pivot[0].Transform = root;
- Pivot[0].IsVisible = true;
-
- for (int piv_idx=1; piv_idx < NumPivots; piv_idx++) {
-
- pivot = &Pivot[piv_idx];
-
- assert(pivot->Parent != NULL);
- Matrix3D::Multiply(pivot->Parent->Transform, pivot->BaseTransform, &(pivot->Transform));
- pivot->IsVisible = 1;
-
- if (pivot->Is_Captured()) pivot->Capture_Update();
- }
-}
-
-/***********************************************************************************************
- * HTreeClass::Anim_Update -- Computes the transform for each pivot with motion *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 08/11/1997 GH : Created. *
- *=============================================================================================*/
-void HTreeClass::Anim_Update(const Matrix3D & root,HAnimClass * motion,float frame)
-{
- PivotClass *pivot;
- Matrix3D mtx;
-
- Pivot[0].Transform = root;
- Pivot[0].IsVisible = true;
-
- int num_anim_pivots = motion->Get_Num_Pivots ();
-
- for (int piv_idx=1; piv_idx < NumPivots; piv_idx++) {
- pivot = &Pivot[piv_idx];
-
- // base pose
- assert(pivot->Parent != NULL);
- Matrix3D::Multiply(pivot->Parent->Transform, pivot->BaseTransform, &(pivot->Transform));
-
- // Don't update this pivot if the HTree doesn't have animation data for it...
- if (piv_idx < num_anim_pivots) {
-
- // animation
- Vector3 trans;
- motion->Get_Translation(trans,piv_idx,frame);
- pivot->Transform.Translate(trans * ScaleFactor);
-
- Quaternion q;
- motion->Get_Orientation(q,piv_idx,frame);
- ::Build_Matrix3D(q,mtx);
-
-#ifdef ALLOW_TEMPORARIES
- pivot->Transform = pivot->Transform * mtx;
-#else
- pivot->Transform.postMul(mtx);
-#endif
-
- // visibility
- pivot->IsVisible = motion->Get_Visibility(piv_idx,frame);
- }
-
- if (pivot->Is_Captured())
- {
- pivot->Capture_Update();
- pivot->IsVisible = true;
- }
- }
-}
-
-/*Customized version of the above which excludes interpolation and assumes HRawAnimClass
-For use by 'Generals' -MW*/
-void HTreeClass::Anim_Update(const Matrix3D & root,HRawAnimClass * motion,float frame)
-{
- PivotClass *pivot,*endpivot,*lastAnimPivot;
-
- Pivot[0].Transform = root;
- Pivot[0].IsVisible = true;
-
- int num_anim_pivots = motion->Get_Num_Pivots ();
-
- //Get integer frame
- int iframe=WWMath::Float_To_Long(frame);
- if (iframe >= motion->Get_Num_Frames())
- iframe = 0;
-
- Vector3 trans;
- Quaternion q;
- Matrix3D mtx;
-
- struct NodeMotionStruct * nodeMotion = ((HRawAnimClass*)motion)->Get_Node_Motion_Array();
- nodeMotion += 1; //skip the root node
-
- pivot = &Pivot[1];
- endpivot=pivot+(NumPivots-1);
- lastAnimPivot = &Pivot[num_anim_pivots];
-
- for (int piv_idx=1; pivot < endpivot; pivot++,nodeMotion++) {
-
- // base pose
- assert(pivot->Parent != NULL);
- Matrix3D::Multiply(pivot->Parent->Transform, pivot->BaseTransform, &(pivot->Transform));
-
- // Don't update this pivot if the HTree doesn't have animation data for it...
- if (pivot < lastAnimPivot)
- {
-
- // animation
- trans.Set(0.0f,0.0f,0.0f);
- Matrix3D *xform=&pivot->Transform;
-
- if (nodeMotion->X != NULL)
- nodeMotion->X->Get_Vector(iframe,&(trans[0]));
- if (nodeMotion->Y != NULL)
- nodeMotion->Y->Get_Vector(iframe,&(trans[1]));
- if (nodeMotion->Z != NULL)
- nodeMotion->Z->Get_Vector(iframe,&(trans[2]));
-
- if (ScaleFactor == 1.0f)
- xform->Translate(trans);
- else
- xform->Translate(trans*ScaleFactor);
-
- if (nodeMotion->Q != NULL)
- { nodeMotion->Q->Get_Vector_As_Quat(iframe, q);
-#ifdef ALLOW_TEMPORARIES
- *xform = *xform * ::Build_Matrix3D(q,mtx);
-#else
- xform->postMul(::Build_Matrix3D(q,mtx));
-#endif
- }
-
- // visibility
- if (nodeMotion->Vis != NULL)
- pivot->IsVisible=(nodeMotion->Vis->Get_Bit(iframe) == 1);
- else
- pivot->IsVisible=1;
- }
-
- if (pivot->Is_Captured())
- {
- pivot->Capture_Update();
- pivot->IsVisible = true;
- }
- }
-}
-
-
-/***********************************************************************************************
- * HTreeClass::Blend_Update -- computes each pivot as a blend of two anims *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 3/4/98 GTH : Created. *
- *=============================================================================================*/
-void HTreeClass::Blend_Update
-(
- const Matrix3D & root,
- HAnimClass * motion0,
- float frame0,
- HAnimClass * motion1,
- float frame1,
- float percentage // 0.0 = motion0. 1.0 = motion1
-)
-{
- PivotClass *pivot;
- Matrix3D mtx;
-
- Pivot[0].Transform = root;
- Pivot[0].IsVisible = true;
-
- int num_anim_pivots = MIN( motion0->Get_Num_Pivots (), motion1->Get_Num_Pivots () );
-
- for (int piv_idx=1; piv_idx < NumPivots; piv_idx++) {
-
- pivot = &Pivot[piv_idx];
-
- assert(pivot->Parent != NULL);
- Matrix3D::Multiply(pivot->Parent->Transform,pivot->BaseTransform,&(pivot->Transform));
-
- if (piv_idx < num_anim_pivots) {
- // interpolated translation
- Vector3 trans0;
- motion0->Get_Translation(trans0,piv_idx,frame0);
- Vector3 trans1;
- motion1->Get_Translation(trans1,piv_idx,frame1);
- Vector3 lerped = (1.0 - percentage) * trans0 + (percentage) * trans1;
- pivot->Transform.Translate(lerped * ScaleFactor);
-
- // interpolated rotation
- Quaternion q0;
- motion0->Get_Orientation(q0,piv_idx,frame0);
- Quaternion q1;
- motion1->Get_Orientation(q1,piv_idx,frame1);
- Quaternion q;
- Fast_Slerp(q,q0,q1,percentage);
-#ifdef ALLOW_TEMPORARIES
- pivot->Transform = pivot->Transform * Build_Matrix3D(q);
-#else
- pivot->Transform.postMul(Build_Matrix3D(q,mtx));
-#endif
-
- pivot->IsVisible = (motion0->Get_Visibility(piv_idx,frame0) || motion1->Get_Visibility(piv_idx,frame1));
- }
-
- if (pivot->Is_Captured())
- {
- pivot->Capture_Update();
- pivot->IsVisible = true;
- }
- }
-}
-
-
-
-/***********************************************************************************************
- * HTreeClass::Combo_Update -- compute each pivot's transform using an anim combo *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 3/4/98 GTH : Created. *
- *=============================================================================================*/
-void HTreeClass::Combo_Update
-(
- const Matrix3D & root,
- HAnimComboClass *anim
-)
-{
- PivotClass *pivot;
- Matrix3D mtx;
-
- Pivot[0].Transform = root;
- Pivot[0].IsVisible = true;
-
- int num_anim_pivots = 100000;
- for ( int anim_num = 0; anim_num < anim->Get_Num_Anims(); anim_num++ ) {
- num_anim_pivots = MIN( num_anim_pivots, anim->Peek_Motion( anim_num )->Get_Num_Pivots() );
- }
- if ( num_anim_pivots == 100000 ) {
- num_anim_pivots = 0;
- }
-
- for (int piv_idx=1; piv_idx < NumPivots; piv_idx++) {
-
- pivot = &Pivot[piv_idx];
- assert(pivot->Parent != NULL);
- Matrix3D::Multiply(pivot->Parent->Transform,pivot->BaseTransform,&(pivot->Transform));
-
- if (piv_idx < num_anim_pivots) {
-
-#define ASSUME_NORMALIZED_ANIM_COMBO_WEIGHTS
-
- Vector3 trans(0,0,0);
- Quaternion q0;
- Quaternion q1;
-#ifndef ASSUME_NORMALIZED_ANIM_COMBO_WEIGHTS
- float last_weight = 0;
-#endif
- float weight_total = 0;
- int wcount = 0;
-
- int anim_num = 0;
- for ( ; anim_num < anim->Get_Num_Anims(); anim_num++ ) {
-
- HAnimClass *motion = anim->Get_Motion( anim_num );
-
- if ( motion != NULL ) {
-
- float frame_num = anim->Get_Frame( anim_num );
-
- PivotMapClass * pivot_map = anim->Get_Pivot_Weight_Map( anim_num );
-
- //float *pivot_map = anim->Get_Pivot_Weight_Map( anim_num );
-
- float weight = anim->Get_Weight( anim_num );
-
- if ( pivot_map != NULL ) {
- weight *= (*pivot_map)[piv_idx];
- // GREG - Pivot maps are ref counted so shouldn't we
- // release the rivot map here?
- pivot_map->Release_Ref();
- }
-
- if ( weight != 0.0 ) {
-
- wcount++;
- Vector3 temp_trans;
- motion->Get_Translation( temp_trans, piv_idx, frame_num );
- trans += weight * ScaleFactor * temp_trans;
- weight_total += weight;
-
-#ifdef ASSUME_NORMALIZED_ANIM_COMBO_WEIGHTS
- motion->Get_Orientation(q1,piv_idx, frame_num );
- if ( wcount == 1 ) {
- q0 = q1;
- } else {
- Fast_Slerp(q0, q0, q1, weight / weight_total );
- }
-#else
- q0 = q1;
- motion->Get_Orientation(q1, piv_idx, frame_num );
- last_weight = weight;
-#endif
- }
-
- motion->Release_Ref();
-
- }
- }
-
-#ifdef ASSUME_NORMALIZED_ANIM_COMBO_WEIGHTS
-
- if (weight_total != 0.0f ) {
- // SKB: Removed assert because I have a case where I don't want normalization.
- // One anim moves X, the other moves Y. Assert was just in to warn programmers.
-// WWASSERT(WWMath::Fabs( weight_total - 1.0 ) < WWMATH_EPSILON);
-
- pivot->Transform.Translate(trans);
-#ifdef ALLOW_TEMPORARIES
- pivot->Transform = pivot->Transform * Build_Matrix3D(q0);
-#else
- pivot->Transform.postMul(Build_Matrix3D(q0,mtx));
-#endif
- }
-#else
- if (( weight_total != 0.0f ) && (wcount >= 2)) {
-
- pivot->Transform.Translate( trans / weight_total );
- Quaternion q = Slerp_( q0, q1, last_weight / weight_total );
- pivot->Transform = pivot->Transform * Build_Matrix3D(q);
-
- } else if (weight_total != 0.0f) {
-
- pivot->Transform.Translate( trans / weight_total );
- pivot->Transform = pivot->Transform * Build_Matrix3D(q1);
- }
-#endif
-
- pivot->IsVisible = false;
-
- for ( anim_num = 0; (anim_num < anim->Get_Num_Anims()) && (!pivot->IsVisible); anim_num++ ) {
- HAnimClass *motion = anim->Get_Motion( anim_num );
- if ( motion != NULL ) {
- float frame_num = anim->Get_Frame( anim_num );
-
- pivot->IsVisible |= motion->Get_Visibility(piv_idx,frame_num);
-
- motion->Release_Ref();
- }
- }
- }
-
- if (pivot->Is_Captured())
- {
- pivot->Capture_Update();
- pivot->IsVisible = true;
- }
- }
-}
-
-
-/***********************************************************************************************
- * HTreeClass::Find_Bone -- Find a bone by name *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 11/4/97 GTH : Created. *
- *=============================================================================================*/
-int HTreeClass::Get_Bone_Index(const char * name) const
-{
- for (int i=0; i < NumPivots; i++) {
- if (stricmp(Pivot[i].Name,name) == 0) {
- return i;
- }
- }
- return 0;
-}
-
-
-/***********************************************************************************************
- * HTreeClass::Get_Bone_Name -- get the name of a bone from its index *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 11/4/97 GTH : Created. *
- *=============================================================================================*/
-const char * HTreeClass::Get_Bone_Name(int boneidx) const
-{
- assert(boneidx >= 0);
- assert(boneidx < NumPivots);
-
- return Pivot[boneidx].Name;
-}
-
-
-/***********************************************************************************************
- * HTreeClass::Get_Parent_Index -- returns index of the parent of the given bone *
- * *
- * INPUT: *
- * boneidx - the bone you are interested in *
- * *
- * OUTPUT: *
- * the index of that bone's parent *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 4/12/2000 gth : Created. *
- *=============================================================================================*/
-int HTreeClass::Get_Parent_Index(int boneidx) const
-{
- assert(boneidx >= 0);
- assert(boneidx < NumPivots);
-
- if (Pivot[boneidx].Parent != NULL) {
- return Pivot[boneidx].Parent->Index;
- } else {
- return 0;
- }
-}
-
-
-// Scale this HTree by a constant factor:
-void HTreeClass::Scale(float factor)
-{
- if (factor == 1.0f) return;
-
- // Scale pivot translations
- for (int i = 0; i < NumPivots; i++) {
- Matrix3D &pivot_transform = Pivot[i].BaseTransform;
- Vector3 pivot_translation;
- pivot_transform.Get_Translation(&pivot_translation);
- pivot_translation *= factor;
- pivot_transform.Set_Translation(pivot_translation);
- }
-
- // Set state used later to scale animations:
- ScaleFactor *= factor;
-}
-
-
-
-void HTreeClass::Capture_Bone(int boneindex)
-{
- assert(boneindex >= 0);
- assert(boneindex < NumPivots);
-#ifdef LAZY_CAP_MTX_ALLOC
- if (Pivot[boneindex].CapTransformPtr == NULL)
- {
- Pivot[boneindex].CapTransformPtr = MSGW3DNEW("PivotClassCaptureBoneMtx") DynamicMatrix3D;
- Pivot[boneindex].CapTransformPtr->Mat.Make_Identity();
- }
-#else
- Pivot[boneindex].IsCaptured = true;
-#endif
-}
-
-void HTreeClass::Release_Bone(int boneindex)
-{
- assert(boneindex >= 0);
- assert(boneindex < NumPivots);
-#ifdef LAZY_CAP_MTX_ALLOC
- if (Pivot[boneindex].CapTransformPtr)
- {
- delete Pivot[boneindex].CapTransformPtr;
- Pivot[boneindex].CapTransformPtr = NULL;
- }
-#else
- Pivot[boneindex].IsCaptured = false;
-#endif
-}
-
-bool HTreeClass::Is_Bone_Captured(int boneindex) const
-{
- assert(boneindex >= 0);
- assert(boneindex < NumPivots);
- return Pivot[boneindex].Is_Captured();
-}
-
-void HTreeClass::Control_Bone(int boneindex,const Matrix3D & relative_tm,bool world_space_translation)
-{
- assert(boneindex >= 0);
- assert(boneindex < NumPivots);
- assert(Pivot[boneindex].Is_Captured());
-
-#ifdef LAZY_CAP_MTX_ALLOC
- if (Pivot[boneindex].CapTransformPtr == NULL)
- return;
- Pivot[boneindex].WorldSpaceTranslation = world_space_translation;
- Pivot[boneindex].CapTransformPtr->Mat = relative_tm;
-#else
- Pivot[boneindex].WorldSpaceTranslation = world_space_translation;
- Pivot[boneindex].CapTransform = relative_tm;
-#endif
-}
-
-void HTreeClass::Get_Bone_Control(int boneindex, Matrix3D & relative_tm) const
-{
- assert(boneindex >= 0);
- assert(boneindex < NumPivots);
-
- //
- // Return the bone's control transform to the caller
- //
- if (Pivot[boneindex].IsCaptured) {
- relative_tm = Pivot[boneindex].CapTransform;
- } else {
- relative_tm.Make_Identity ();
- }
-
- return ;
-}
-
-HTreeClass * HTreeClass::Alter_Avatar_HTree( const HTreeClass *tree, Vector3 &scale)
-{
- // This is a specific list of pivot names used in the avatar meshes that we need to special case for scaling
- // The reason is due to the fact that we want to scale the avatar's bone structure with differing amount for
- // each axis, and with the T-pos of the avatar skeleton, undesirable results are caused due to the arms and hands
- // being stretched out on the Y-axis instead of the Z-axis like the rest of the bodies. Hence, the list of pivots
- // below are ones that I will special case and scale them based on the Z-axis scaling factor instead of the Y-axis
- // scaling factor.
- const char * flip_list[] = { " RIGHTFOREARM", " RIGHTHAND", " LEFTFOREARM", " LEFTHAND", "RIGHTINDEX", "RIGHTFINGERS", "RIGHTTHUMB", "LEFTINDEX", "LEFTFINGERS", "LEFTTHUMB", 0 };
-
- // Clone the new tree with the tree that is passed in
- HTreeClass * new_tree = new HTreeClass( *tree );
-
- // Go through each of the pivots and calculate and transform the pivots to match the desired scaling factor
- for(int pi = 0; pi < new_tree->NumPivots; ++pi) {
- PivotClass piv = tree->Pivot[pi];
- Vector3 adjusted_scale = scale;
-
- // If there is no parent, skip
- if(!piv.Parent) continue;
-
- // If the pivot is on the flip list, use the Z scale to scale both the Z & Y axis
- int index = 0;
- while(true) {
- if(!flip_list[index]) {
- break;
- } else if(strcmp(piv.Name, flip_list[index]) == 0) {
- adjusted_scale.Y = scale.Z;
- break;
- }
- ++index;
- }
-
- // Get the positions of the pivot and the pivot's parent in worldspace & apply the altering scale to it
- Vector3 pivot_pos = piv.Transform.Get_Translation();
- Vector3 pivot_parent_pos = piv.Parent->Transform.Get_Translation();
- pivot_pos.Scale(adjusted_scale);
- pivot_parent_pos.Scale(adjusted_scale);
-
- // Get the pivot's parent's inverse transform
- Matrix3D parent_inverse_transform;
- piv.Parent->Transform.Get_Inverse(parent_inverse_transform);
-
- // Get the new desired vector in worldspace
- Vector3 new_relative_vector = pivot_pos - pivot_parent_pos;
-
- // Rotate the new vector by the pivot's parent's inverse transform to put it in local space
- new_relative_vector = parent_inverse_transform.Rotate_Vector(new_relative_vector);
-
- // Store the final result in the new HTree
- new_tree->Pivot[pi].BaseTransform.Set_Translation( new_relative_vector );
- }
-
- return new_tree;
-}
-
-// Morph the bones on the HTree using weights from a number of other HTrees
-HTreeClass * HTreeClass::Create_Morphed( int num_morph_sources,
- const float morph_weights[],
- const HTreeClass *tree_array[] )
-{
- int i;
- assert(num_morph_sources>0);
- for(i=0;i=0.0f && morph_weights[i]<=1.0f );
- }
- for(i=0;iNumPivots == tree_array[i+1]->NumPivots );
- }
-
- // Clone the first one,
- HTreeClass * new_tree = W3DNEWARRAY HTreeClass( *tree_array[0] );
-
- // Then interpolate all the pivots translations
- for (int pi = 0; pi < new_tree->NumPivots; pi++) {
-
- Vector3 pos(0.0f,0.0f,0.0f);
- for(int nm = 0; nm < num_morph_sources; nm++) {
- pos.X += tree_array[nm]->Pivot[pi].BaseTransform.Get_Translation().X*morph_weights[nm];
- pos.Y += tree_array[nm]->Pivot[pi].BaseTransform.Get_Translation().Y*morph_weights[nm];
- pos.Z += tree_array[nm]->Pivot[pi].BaseTransform.Get_Translation().Z*morph_weights[nm];
- }
-
- new_tree->Pivot[pi].BaseTransform.Set_Translation( pos );
- }
-
- return new_tree;
-}
-
-// Create an HTree by Interpolating between others
-HTreeClass * HTreeClass::Create_Interpolated( const HTreeClass * tree_a0_b0,
- const HTreeClass * tree_a0_b1,
- const HTreeClass * tree_a1_b0,
- const HTreeClass * tree_a1_b1,
- float lerp_a, float lerp_b )
-{
- assert( tree_a0_b0->NumPivots == tree_a0_b1->NumPivots );
- assert( tree_a0_b0->NumPivots == tree_a1_b0->NumPivots );
- assert( tree_a0_b0->NumPivots == tree_a1_b1->NumPivots );
-
- // Clone the first one,
- HTreeClass * new_tree = W3DNEW HTreeClass( *tree_a0_b0 );
-
- // Then interpolate all the pivots translations
- Vector3 pos_a0, pos_a1, pos;
- for (int pi = 0; pi < new_tree->NumPivots; pi++) {
-
- Vector3::Lerp( tree_a0_b0->Pivot[pi].BaseTransform.Get_Translation(),
- tree_a0_b1->Pivot[pi].BaseTransform.Get_Translation(),
- lerp_b, &pos_a0 );
- Vector3::Lerp( tree_a1_b0->Pivot[pi].BaseTransform.Get_Translation(),
- tree_a1_b1->Pivot[pi].BaseTransform.Get_Translation(),
- lerp_b, &pos_a1 );
- Vector3::Lerp( pos_a0, pos_a1, lerp_a, &pos );
-
- new_tree->Pivot[pi].BaseTransform.Set_Translation( pos );
- }
-
- return new_tree;
-}
-
-// Create an HTree by Interpolating between others
-HTreeClass * HTreeClass::Create_Interpolated(const HTreeClass * tree_base,
- const HTreeClass * tree_a,
- const HTreeClass * tree_b,
- float a_scale, float b_scale )
-{
- WWMEMLOG(MEM_ANIMATION);
- assert( tree_base->NumPivots == tree_a->NumPivots );
- assert( tree_base->NumPivots == tree_b->NumPivots );
-
- // Clone the first one,
- HTreeClass * new_tree = W3DNEW HTreeClass( *tree_base );
-
- float a_scale_abs = WWMath::Fabs( a_scale );
- float b_scale_abs = WWMath::Fabs( b_scale );
-
- if ( a_scale_abs + b_scale_abs > 0 ) {
-
- // Then interpolate all the pivots translations
- Vector3 pos_a, pos_b, pos;
- for (int pi = 0; pi < new_tree->NumPivots; pi++) {
-
- Vector3::Lerp( tree_base->Pivot[pi].BaseTransform.Get_Translation(),
- tree_a->Pivot[pi].BaseTransform.Get_Translation(),
- a_scale, &pos_a );
- Vector3::Lerp( tree_base->Pivot[pi].BaseTransform.Get_Translation(),
- tree_b->Pivot[pi].BaseTransform.Get_Translation(),
- b_scale, &pos_b );
-
- pos = (pos_a * a_scale_abs + pos_b * b_scale_abs ) / ( a_scale_abs + b_scale_abs );
-
- new_tree->Pivot[pi].BaseTransform.Set_Translation( pos );
- }
- }
-
- return new_tree;
-}
-
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/htree.h b/Generals/Code/Libraries/Source/WWVegas/WW3D2/htree.h
deleted file mode 100644
index e022194833d..00000000000
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/htree.h
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
-** 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 .
-*/
-
-/* $Header: /Commando/Code/ww3d2/htree.h 6 10/01/01 5:55p Patrick $ */
-/***********************************************************************************************
- *** Confidential - Westwood Studios ***
- ***********************************************************************************************
- * *
- * Project Name : Commando / G 3D Library *
- * *
- * $Archive:: /Commando/Code/ww3d2/htree.h $*
- * *
- * Author:: Greg_h *
- * *
- * $Modtime:: 9/28/01 3:05p $*
- * *
- * $Revision:: 6 $*
- * *
- *---------------------------------------------------------------------------------------------*
- * Functions: *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-#if defined(_MSC_VER)
-#pragma once
-#endif
-
-#ifndef HTREE_H
-#define HTREE_H
-
-#include "always.h"
-#include "pivot.h"
-#include "quat.h"
-#include "matrix3d.h"
-#include "vector3.h"
-#include "w3d_file.h"
-#include "wwdebug.h"
-
-class HAnimClass;
-class HAnimComboClass;
-class MeshClass;
-class ChunkLoadClass;
-class ChunkSaveClass;
-class HRawAnimClass;
-
-/*
-
- HTreeClass
-
- A hierarchy of coordinate systems in an initial
- configuration. All motion data is applied to one
- of these objects. Motion is stored as deltas from
- the hierarchy tree's initial configuration.
-
- Normally, the user will probably not deal with
- HTreeClasses; they are used internally
- by the HierarchyModelClass.
-
-*/
-class HTreeClass : public W3DMPO
-{
- W3DMPO_GLUE(HTreeClass)
-public:
-
- enum
- {
- OK,
- LOAD_ERROR
- };
-
- HTreeClass(void);
- HTreeClass(const HTreeClass & src);
- ~HTreeClass(void);
-
- int Load_W3D(ChunkLoadClass & cload);
- void Init_Default(void);
-
- WWINLINE const char * Get_Name(void) const { return Name; }
- WWINLINE int Num_Pivots(void) const { return NumPivots; }
- int Get_Bone_Index(const char * name) const;
- const char * Get_Bone_Name(int boneid) const;
- int Get_Parent_Index(int bone_indx) const;
-
- void Base_Update(const Matrix3D & root);
-
- void Anim_Update( const Matrix3D & root,
- HAnimClass * motion,
- float frame);
- void Anim_Update(const Matrix3D & root,HRawAnimClass * motion,float frame);
-
- void Blend_Update( const Matrix3D & root,
- HAnimClass * motion0,
- float frame0,
- HAnimClass * motion1,
- float frame1,
- float percentage);
-
- void Combo_Update( const Matrix3D & root,
- HAnimComboClass * anim);
-
- WWINLINE const Matrix3D & Get_Transform(int pivot) const;
- WWINLINE bool Get_Visibility(int pivot) const;
-
- WWINLINE const Matrix3D & Get_Root_Transform(void) const;
-
- // User control over a bone. While a bone is captured, you can over-ride the
- // animation transform used by the bone.
- void Capture_Bone(int boneindex);
- void Release_Bone(int boneindex);
- bool Is_Bone_Captured(int boneindex) const;
- void Control_Bone(int boneindex,const Matrix3D & relative_tm,bool world_space_translation = false);
- void Get_Bone_Control(int boneindex, Matrix3D & relative_tm) const;
-
-
-
- //
- // Simple pivot evaluation methods for when the caller doesn't want
- // to update the whole animation, but needs to know the transform of
- // a pivot at a given frame.
- //
- bool Simple_Evaluate_Pivot (HAnimClass *motion, int pivot_index, float frame, const Matrix3D &obj_tm, Matrix3D *end_tm) const;
- bool Simple_Evaluate_Pivot (int pivot_index, const Matrix3D &obj_tm, Matrix3D *end_tm) const;
-
- // Scale this HTree by a constant factor:
- void Scale(float factor);
-
- // Morph the bones on the HTree based on the scale passed in
- static HTreeClass * Alter_Avatar_HTree( const HTreeClass *tree, Vector3 &scale );
-
- // Morph the bones on the HTree using weights from a number of other HTrees
- static HTreeClass * Create_Morphed( int num_morph_sources,
- const float morph_weights[],
- const HTreeClass *tree_array[] );
-
- // Create an HTree by Interpolating between others
- static HTreeClass * Create_Interpolated( const HTreeClass * tree_a0_b0,
- const HTreeClass * tree_a0_b1,
- const HTreeClass * tree_a1_b0,
- const HTreeClass * tree_a1_b1,
- float lerp_a, float lerp_b );
-
- // Create an HTree by Interpolating between others
- static HTreeClass * Create_Interpolated( const HTreeClass * tree_base,
- const HTreeClass * tree_a,
- const HTreeClass * tree_b,
- float a_scale, float b_scale );
-
-private:
-
- char Name[W3D_NAME_LEN];
- int NumPivots;
- PivotClass * Pivot;
- float ScaleFactor;
-
- void Free(void);
- bool read_pivots(ChunkLoadClass & cload,bool pre30);
-
- friend class MeshClass;
-
-
-
-};
-
-WWINLINE const Matrix3D & HTreeClass::Get_Root_Transform(void) const
-{
- return Pivot[0].Transform;
-}
-
-WWINLINE bool HTreeClass::Get_Visibility(int pivot) const
-{
- WWASSERT(pivot >= 0);
- WWASSERT(pivot < NumPivots);
- return Pivot[pivot].IsVisible;
-}
-
-/***********************************************************************************************
- * HTreeClass::Get_Transform -- returns the transformation for the desired pivot *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 08/11/1997 GH : Created. *
- *=============================================================================================*/
-WWINLINE const Matrix3D & HTreeClass::Get_Transform(int pivot) const
-{
- assert(pivot >= 0);
- assert(pivot < NumPivots);
-
- return Pivot[pivot].Transform;
-}
-
-
-
-#endif
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/intersec.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/intersec.cpp
deleted file mode 100644
index 1849b5857ab..00000000000
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/intersec.cpp
+++ /dev/null
@@ -1,444 +0,0 @@
-/*
-** 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 .
-*/
-
-/***********************************************************************************************
- *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
- ***********************************************************************************************
- * *
- * Project Name : G *
- * *
- * $Archive:: /Commando/Code/ww3d2/intersec.cpp $*
- * *
- * $Author:: Greg_h $*
- * *
- * $Modtime:: 2/06/01 5:41p $*
- * *
- * $Revision:: 3 $*
- * *
- *---------------------------------------------------------------------------------------------*
- * Functions: *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-
-
-#include "intersec.h"
-#include "camera.h"
-#include "scene.h"
-#include "intersec.inl"
-#include "Utility/CppMacros.h"
-
-
-//////////////////////////////////////////////////////////////////////
-// Construction/Destruction
-//////////////////////////////////////////////////////////////////////
-
-// these statics are used for single-threaded use of the IntersectionClass ONLY
-Vector3 IntersectionClass::_RayLocation(0,0,0);
-Vector3 IntersectionClass::_RayDirection(0,0,0);
-Vector3 IntersectionClass::_IntersectionNormal(0,0,0);
-
-
-bool IntersectionClass::Intersect_Screen_Point_RenderObject(float screen_x, float screen_y, const LayerClass &Layer, RenderObjClass *RObj, IntersectionResultClass *FinalResult)
-{
- Get_Screen_Ray(screen_x, screen_y, Layer);
- return Intersect_RenderObject(RObj, FinalResult);
-}
-
-bool IntersectionClass::Intersect_RenderObject(RenderObjClass *RObj, IntersectionResultClass *FinalResult)
-{
- if(FinalResult == 0)
- FinalResult = &Result;
-
- return RObj->Intersect(this, FinalResult);
-}
-
-// iterate through the layers of a world, front to back, returning true if/when an intersection
-// with an object occurs.
-bool IntersectionClass::Intersect_Screen_Point_Layer_Range
-(
- float screen_x,
- float screen_y,
- const LayerClass &TopLayer,
- const LayerClass &BackLayer
-)
-{
-
- // intersect from front layer to back layers. An intersection with an object
- // in any layer is assumed to be in front of any potential intersections in layers
- // below it.
-
- // find the last layer in the list
- const LayerClass *Layer = &TopLayer;
-
- // iterate through all layers in list
- while(Layer->Is_Valid()) {
- if(Intersect_Screen_Point_Layer(screen_x, screen_y, *Layer))
- return true;
-
- // if this is the back layer then that is all we need to test
- if(Layer == &BackLayer)
- return false;
-
- Layer = Layer->Next();
- }
- return false;
-}
-
-
-bool IntersectionClass::Intersect_Screen_Point_Layer(float screen_x, float screen_y, const LayerClass &Layer)
-{
- // mark this object as not intersecting yet
- Result.Intersects = false;
-
- // first, do a test to make sure the screen coords are within the rendering area for this layer.
- const ViewportClass &v = Layer.Camera->Get_Viewport();
-
- if((screen_x < v.Min.X) ||
- (screen_x > v.Max.X) ||
- (screen_y < v.Min.Y) ||
- (screen_y > v.Max.Y))
- return false;
-
- Result.Range = Layer.Camera->Get_Depth(); //scene->depth * scene->zstop;
-
- // get the ray for these screen coordinates
- Get_Screen_Ray(screen_x, screen_y, Layer);
-
- return Intersect_Layer(Layer, false);
-}
-
-bool IntersectionClass::Intersect_Layer(const LayerClass &Layer, bool Test_All)
-{
- IntersectionResultClass FinalResult;
-
- Result.Intersects = false;
-
- SceneIterator *it = Layer.Scene->Create_Iterator(!Test_All);
-
- // select the first object
- it->First();
-
- // loop through all render objects in this layer:
- while(!it->Is_Done()) {
-
- // get the render object
- RenderObjClass * robj = it->Current_Item();
- it->Next();
-
- // only intersect if it was visible or if we must test all in layer
- // Added 'Generals' code to only detect intersection on matching Collision_Type. MW
- if( robj->Get_Collision_Type() & Result.CollisionType && (Test_All || robj->Is_Really_Visible()) && robj->Intersect(this, &FinalResult)) {
- if(FinalResult.Range < Result.Range) {
- Copy_Results(&FinalResult);
- }
- }
- }
-
- Layer.Scene->Destroy_Iterator(it);
-
- return Result.Intersects;
-}
-
-
-void IntersectionClass::Append_Object_Array(
- int MaxCount,
- int &CurrentCount,
- RenderObjClass **ObjectArray,
- RenderObjClass *Object)
-{
- if(CurrentCount < MaxCount) {
- ObjectArray[CurrentCount] = Object;
- CurrentCount++;
- return;
- }
- WWDEBUG_SAY(("IntersectionClass::Append_Object_Array - Too many objects\n"));
-}
-
-// determines if specified plane-intersection point (co-planar with polygon) is within the the passed polygon.
-// If Interpolated_Normal is specified, it will interpolate the normal for the intersection point
-// note: Polygon normal MUST BE CORRECT
-
-// this will return true if the ray intersects the specified box
-// sets the point of intersection within the Request->Result.Intersection vector
-bool IntersectionClass::Intersect_Box(Vector3 &Box_Min, Vector3 &Box_Max, IntersectionResultClass *FinalResult) {
- // Fast Ray-Box Intersection, modified from code written by Andrew Woo from "Graphics Gems", Academic Press, 1990
-
- enum {
- RIGHT = 0,
- LEFT,
- MIDDLE,
- PLANE_COUNT
- };
-
- bool inside = true;
- char quadrant[PLANE_COUNT];
- int counter;
- float distance[PLANE_COUNT];
- float candidate_plane[PLANE_COUNT];
-
- REGISTER Vector3 *intersection = &FinalResult->Intersection;
-
- // Find candidate planes and determine if the ray is outside the box
- for (counter = 0; counter < PLANE_COUNT; counter++) {
- if((*RayLocation)[counter] < Box_Min[counter]) {
- quadrant[counter] = LEFT;
- candidate_plane[counter] = Box_Min[counter];
- inside = false;
- } else {
- if ((*RayLocation)[counter] > Box_Max[counter]) {
- quadrant[counter] = RIGHT;
- candidate_plane[counter] = Box_Max[counter];
- inside = false;
- } else {
- quadrant[counter] = MIDDLE;
- }
- }
- }
-
- // check to see if the ray origin is inside bounding box
- if(inside) {
- *intersection = *RayLocation;
- return FinalResult->Intersects = true;
- }
-
- // Calculate distances to candidate planes
- for (counter = 0; counter < PLANE_COUNT; counter++) {
- if ((quadrant[counter] != MIDDLE) && ((*RayDirection)[counter] != 0.0f))
- distance[counter] = (candidate_plane[counter] - (*RayLocation)[counter]) / (*RayDirection)[counter];
- else
- distance[counter] = -1.0f;
- }
-
- // get the largest of the distances for final choice of intersection
- int nearest_plane = 0;
- for (counter = 1; counter < PLANE_COUNT; counter++) {
- if (distance[nearest_plane] < distance[counter])
- nearest_plane = counter;
- }
-
- // Check to make sure the nearest plane is not behind the ray (inside box tested above)
- if (distance[nearest_plane] < 0.0f)
- return FinalResult->Intersects = false;
-
- for (counter = 0; counter < PLANE_COUNT; counter++) {
- if (nearest_plane != counter) {
- (*intersection)[counter] = (*RayLocation)[counter] + distance[nearest_plane] *(*RayDirection)[counter];
- if ((*intersection)[counter] < Box_Min[counter] || (*intersection)[counter] > Box_Max[counter])
- return FinalResult->Intersects = false;
- } else {
- (*intersection)[counter] = candidate_plane[counter];
- }
- }
- return FinalResult->Intersects = true; // ray hits box
-}
-
-
-// simply returns true if a ray hits the bounding sphere of any node in a hierarchy
-// note: Result will only contain range, not the intersection point/normal.
-bool IntersectionClass::Intersect_Hierarchy_Sphere_Quick(RenderObjClass *Hierarchy, IntersectionResultClass *FinalResult)
-{
-
- int counter = Hierarchy->Get_Num_Sub_Objects();
- while(counter--) {
- RenderObjClass *obj = Hierarchy->Get_Sub_Object(counter);
- obj->Release_Ref(); // you already own a reference to this object indirectly..
- if(obj->Intersect_Sphere_Quick(this, FinalResult))
- return true;
- }
- return false;
-}
-
-// returns true if a ray hits the bounding sphere of any node in a hierarchy
-// note: Result will contain range and the intersection point/normal.
-bool IntersectionClass::Intersect_Hierarchy_Sphere(RenderObjClass *Hierarchy, IntersectionResultClass *FinalResult) {
-
- int counter = Hierarchy->Get_Num_Sub_Objects();
- while(counter--) {
- RenderObjClass *obj = Hierarchy->Get_Sub_Object(counter);
- obj->Release_Ref(); // you already own a reference to this object indirectly..
- if(obj->Intersect_Sphere(this, FinalResult))
- return true;
- }
- return false;
-}
-
-void IntersectionClass::Append_Hierarchy_Objects(
- int MaxCount,
- int &CurrentCount,
- RenderObjClass **ObjectArray,
- RenderObjClass *Hierarchy,
- bool Test_Bounding_Sphere,
- bool Convex)
-{
- IntersectionResultClass result;
-
- // first check the bounding spheres for hits (if specified)
- int counter = Hierarchy->Get_Num_Sub_Objects();
- if(Test_Bounding_Sphere) {
- while(counter--) {
- RenderObjClass *obj = Hierarchy->Get_Sub_Object(counter);
- obj->Release_Ref(); // you already own a reference to the object indirectly
- if(obj->Intersect_Sphere_Quick(this, &result)) {
- Append_Object_Array(MaxCount, CurrentCount, ObjectArray, obj);
-// OutputDebugString("o"); // this shows one o per sphere intersection
- } else {
-// OutputDebugString("."); // this shows one . per sphere miss
- }
- }
-
- } else {
- // simply copy the pointers into the array
- while(counter--) {
- RenderObjClass *obj = Hierarchy->Get_Sub_Object(counter);
- Append_Object_Array(MaxCount, CurrentCount, ObjectArray, obj);
- obj->Release_Ref(); // you already own a reference to this object indirectly..
- }
- }
-}
-
-bool IntersectionClass::Intersect_Hierarchy(RenderObjClass *Hierarchy, IntersectionResultClass *FinalResult, bool Test_Bounding_Sphere, bool Convex ) {
-
-// OutputDebugString("\n");
-// return FinalResult->Intersects = false;
-
- RenderObjClass *candidate_objects[MAX_HIERARCHY_NODE_COUNT];
- int candidate_count = 0;
-
- Append_Hierarchy_Objects(MAX_HIERARCHY_NODE_COUNT, candidate_count, candidate_objects, Hierarchy, Test_Bounding_Sphere, Convex);
-
- // make sure there's at least one sphere hit before continuing to more expensive tests below..
- if(candidate_count == 0) {
- // OutputDebugString("/"); // no sphere intersections
- return FinalResult->Intersects = false;
- }
-
- // note: Test_Bounding_Sphere argument is false because the Append_Hierarchy_Objects will have
- // already performed that test if indicated.
- if(Intersect_Object_Array(candidate_count, candidate_objects, FinalResult, false, Convex)) {
- return true;
- }
- return false;
-}
-
-RenderObjClass *IntersectionClass::Intersect_Sub_Object(float screenx, float screeny, LayerClass &layer, RenderObjClass *robj, IntersectionResultClass *result)
-{
- if (robj->Get_Num_Sub_Objects()) {
- for (int lp = 0; lp < robj->Get_Num_Sub_Objects(); lp++) {
- RenderObjClass *sub = robj->Get_Sub_Object(lp);
- RenderObjClass *retval = Intersect_Sub_Object(screenx, screeny, layer, sub, result);
- sub->Release_Ref();
- if (retval) return retval;
- }
- }
- if (Intersect_Screen_Point_RenderObject(screenx, screeny, layer, robj, result)) {
- return robj;
- }
- return NULL;
-}
-
-// finds the intersection of the nearest object in the array.
-// This will usually be the last stage after determining potential intersections
-// using Intersect_Sphere_Quick() and adding hits to the array for this
-// more accurate test, as done in Intersect_Heirarchy().
-bool IntersectionClass::Intersect_Object_Array(
- int Object_Count,
- RenderObjClass **ObjectArray,
- IntersectionResultClass *FinalResult,
- bool Test_Bounding_Sphere,
- bool Convex
- )
-{
- IntersectionResultClass TemporaryResults[MAX_HIERARCHY_NODE_COUNT];
- assert(Object_Count <= MAX_HIERARCHY_NODE_COUNT);
- return Intersect_Object_Array(Object_Count, ObjectArray, FinalResult, TemporaryResults, Test_Bounding_Sphere, Convex);
-}
-
-bool IntersectionClass::Intersect_Object_Array(
- int Object_Count,
- RenderObjClass **ObjectArray,
- IntersectionResultClass *FinalResult,
- IntersectionResultClass *TemporaryResults,
- bool Test_Bounding_Sphere,
- bool Convex
- )
-{
- // Determine ranges for all intersections
- IntersectionClass temp(this);
- int counter = Object_Count;
- bool hit = false;
-
- // if it's a convex hierarchy (ie a control panel) then find the first hit otherwise use the more expensive exact intersection routine
- // for use with potentially concave hierarchies.
- int nearest_index = -1;
- if(ConvexTest || Convex) {
- if(Test_Bounding_Sphere) {
- while(counter--) {
- if(ObjectArray[counter]->Intersect_Sphere_Quick(this, &TemporaryResults[counter])) {
- hit = ObjectArray[counter]->Intersect(this, FinalResult);
- }
- if(hit) {
- nearest_index = counter;
- counter = 0;
- }
- }
- } else {
- while(counter--) {
- hit = ObjectArray[counter]->Intersect(this, FinalResult);
- if(hit) {
- nearest_index = counter;
- counter = 0;
- }
- }
- }
- } else {
- if(Test_Bounding_Sphere) {
- while(counter--) {
- if(ObjectArray[counter]->Intersect_Sphere_Quick(this, &TemporaryResults[counter])) {
- hit |= ObjectArray[counter]->Intersect(this, &TemporaryResults[counter]);
- }
- }
- } else {
- while(counter--) {
- hit |= ObjectArray[counter]->Intersect(this, &TemporaryResults[counter]);
- }
- }
- }
- // test to see if anything actually hit a mesh
- if( ! hit ) {
-// OutputDebugString("!"); // no mesh intersections
- return FinalResult->Intersects = false;
- }
-
- if(! (Convex || ConvexTest)) {
- // now find the nearest of the actual hits
- float nearest_range = (float) (2<<28);
- counter = Object_Count;
- while(counter--) {
- if(TemporaryResults[counter].Intersects && (nearest_range > TemporaryResults[counter].Range)) {
- nearest_index = counter;
- nearest_range = TemporaryResults[counter].Range;
- }
- }
- Copy_Results(FinalResult, &TemporaryResults[nearest_index]);
- }
-// OutputDebugString("+");
-// Debug.Print("Mesh ", Object_Array[nearest_index]);
-// Intersection_Node = candidate_indices[nearest_index];
- return true;
-}
-
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/intersec.h b/Generals/Code/Libraries/Source/WWVegas/WW3D2/intersec.h
deleted file mode 100644
index 770625ae290..00000000000
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/intersec.h
+++ /dev/null
@@ -1,404 +0,0 @@
-/*
-** 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 .
-*/
-
-/***********************************************************************************************
- *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
- ***********************************************************************************************
- * *
- * Project Name : G *
- * *
- * $Archive:: /Commando/Code/ww3d2/intersec.h $*
- * *
- * $Author:: Naty_h $*
- * *
- * $Modtime:: 3/28/01 11:29a $*
- * *
- * $Revision:: 5 $*
- * *
- *---------------------------------------------------------------------------------------------*
- * Functions: *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-/*
-
- Most of the functions of this class are inline functions and if you use them you will need
- to include .
-
- Exceptions to this are the functions most commonly used by render objects:
-
-
-
- The constructors/destructors are inline & implemented here.
-
-*/
-
-#if defined(_MSC_VER)
-#pragma once
-#endif
-
-#ifndef INTERSEC_H
-#define INTERSEC_H
-
-#include "always.h"
-#include "matrix3d.h"
-#include "layer.h"
-#include "sphere.h"
-#include "coltype.h"
-
-
-class RenderObjClass;
-typedef unsigned short POLYGONINDEX;
-
-
-/*
-**
-*/
-class IntersectionResultClass
-{
-public:
- RenderObjClass * IntersectedRenderObject;
- POLYGONINDEX IntersectedPolygon;
-
- Matrix3D ModelMatrix; // this is required for transforming mesh normals from model coords
- Vector3 ModelLocation; // ditto
- Vector3 Intersection; // location of intersection is placed here
-
- float Range; // distance from ray to point of intersection
- float Alpha, Beta; // stored for use by Process_Intersection_Results() - used to interpolate normal across a polygon
- bool Intersects; // could be in the intersection_type, but it is used in a number of bool operations
- int CollisionType; // mask for which object types to intersect with (added for 'Generals'. MW)
-
- enum INTERSECTION_TYPE {
- NONE = 0,
- GENERIC,
- POLYGON
- } IntersectionType;
-};
-
-
-class IntersectionClass
-{
- // member data
-
-public:
- enum {
- MAX_POLY_INTERSECTION_COUNT = 1000, // arbitrary size of stack array used for storing intersection results within Intersect_Mesh(). Non-recursive function.
- MAX_HIERARCHY_NODE_COUNT = 256
- };
-
- // this structure is used to store all intersections on the stack for sorting before
- // copying the nearest intersection to IntersectionClassObject->Result.
- // note: the convex intersection functions return with the first intersection results.
-
- Vector3 *RayLocation; // note: these pointers must be Set() to valid pointers by external code
- Vector3 *RayDirection;
- Vector3 *IntersectionNormal; // if non-zero then Process_Intersection_Results() will place the (perhaps vertex interpolated) surface normal here.
-
- // 2d screen coordinates for use by Intersect_Screen_Point...() routines.
- float ScreenX, ScreenY;
-
- // if true, then interpolate the normal for a polygon intersection from the vertex normals.
- // note: intersection routines below which take a FinalResult argument do not interpolate
- // the normal since they are intended to be used to find the nearest of several intersections
- // and interpolating the normal for intersections that are tossed would be wasteful.
- // If you need the normal interpolated in that case anyways then call Interpolate_Normal().
- bool InterpolateNormal;
-
- // if true, then perform potentially much faster convex intersection test which will return
- // the first valid intersection. Generally used for producing silhouettes.
- // If true, all intersections will be convex tests. If false, test mode will be determined (generally)
- // by the render object or whatever called the intersection functions and passes the Convex argument.
- bool ConvexTest;
-
- // do not consider intersections beyond this range as an intersection.
- // Note: Get_Screen_Ray sets this to scene->zstop.
- float MaxDistance;
-
- // final intersection results are contained here
- IntersectionResultClass Result;
-
- //
- // Implementation
- //
-
- // configures the member data to use the passed pointers
- inline void Set(Vector3 *location, Vector3 *direction, Vector3 *intersection_normal, bool interpolate_normal, float max_distance, bool convex_test = false)
- {
- RayLocation = location;
- RayDirection = direction;
- IntersectionNormal = intersection_normal;
- InterpolateNormal = interpolate_normal;
- MaxDistance = max_distance;
- ConvexTest = convex_test;
- }
-
-
-
- // this constructor uses static variables for the location/direction/normal variables
- // so can be only used one thread at a time unless the Set() function is used to
- // set them to private vector3's
- inline IntersectionClass()
- : ConvexTest(false)
- {
- RayLocation = &_RayLocation;
- RayDirection = &_RayDirection;
- IntersectionNormal = &_IntersectionNormal;
- Result.CollisionType=COLL_TYPE_ALL; //added for 'Generals'. MW
- }
-
-
- // This will be the most commonly used constructor
- inline IntersectionClass(Vector3 *location, Vector3 *direction, Vector3 *intersection_normal, bool interpolate_normal = false, float max_distance = WWMATH_FLOAT_MAX, bool convex_test = false)
- {
- Set(location, direction, intersection_normal, interpolate_normal, max_distance, convex_test);
- }
-
-
- virtual ~IntersectionClass() {}
-
-
- // this copy routine is used when the model coords are needed to be copied along with the other information.
- inline void Copy_Results(IntersectionResultClass *Destination, IntersectionResultClass *Source) {
- Destination->ModelMatrix = Source->ModelMatrix;
- Destination->ModelLocation = Source->ModelLocation;
- Copy_Partial_Results(Destination, Source);
- Destination->IntersectedRenderObject = Source->IntersectedRenderObject;
- }
-
-
- inline void Copy_Results(IntersectionResultClass *Source) {
- Copy_Results(&Result, Source);
- }
-
-
- // this is called only for the nearest intersection. If the request passes a Interpolated_Normal pointer then it will be calculated.
- // otherwise the results are copied into the request structure.
- // This does not copy the matrix or location members; it is intended to be used during poly testing
- // where these values are identical between results, or as a completion function for Copy_Results()
- inline void Copy_Partial_Results(IntersectionResultClass *Destination, IntersectionResultClass *Source)
- {
- Destination->IntersectedPolygon = Source->IntersectedPolygon;
- Destination->Intersection = Source->Intersection;
- Destination->Range = Source->Range;
- Destination->Alpha = Source->Alpha;
- Destination->Beta = Source->Beta;
- Destination->Intersects = true;
- Destination->IntersectionType = Source->IntersectionType;
- }
-
-
- // used for creating temporary copies
- inline IntersectionClass(IntersectionClass *source)
- {
- *this = source;
- }
-
-
- inline IntersectionClass *operator =(IntersectionClass *source)
- {
- Set(source->RayLocation, source->RayDirection, source->IntersectionNormal, source->InterpolateNormal, source->MaxDistance, source->ConvexTest);
- Copy_Results(&source->Result);
- return this;
- }
-
-
-
- // find the range to the intersection of the ray and sphere (if any)
- // note: Intersection_Request->RayDirection must be a unit vector
- // To find the actual intersection location and perhaps the intersection normal, use Intersection_Sphere() instead.
- // loosly based on code found in Graphics Gems I, p388
- // this will only set the result's range if intersection occurs; it is intended to be used as a first pass intersection test
- // before intersecting the mesh polygons itself.
- // Note: Does NOT do Max_Distance testing
- inline bool Intersect_Sphere_Quick(SphereClass &Sphere, IntersectionResultClass *FinalResult)
- {
- // make a unit vector from the ray origin to the sphere center
- Vector3 sphere_vector(Sphere.Center - *RayLocation);
-
- // get the dot product between the sphere_vector and the ray vector
- FinalResult->Alpha = Vector3::Dot_Product(sphere_vector, *RayDirection);
-
- FinalResult->Beta = Sphere.Radius * Sphere.Radius - (Vector3::Dot_Product(sphere_vector, sphere_vector) - FinalResult->Alpha * FinalResult->Alpha);
-
- if(FinalResult->Beta < 0.0f) {
- return FinalResult->Intersects = false;
- }
- return FinalResult->Intersects = true;
- }
-
-
- // this will find the intersection with the sphere and the intersection normal if needed.
- inline bool Intersect_Sphere(SphereClass &Sphere, IntersectionResultClass *FinalResult)
- {
- if(!Intersect_Sphere_Quick(Sphere, FinalResult))
- return false;
-
- // determine range to intersection based on stored alpha/beta values
- float d = sqrtf(FinalResult->Beta);
- FinalResult->Range = FinalResult->Alpha - d;
-
- if(FinalResult->Range > MaxDistance) return false;
-
- FinalResult->Intersection = *RayLocation + FinalResult->Range * (*RayDirection);
-
- if(IntersectionNormal != 0) {
- (*IntersectionNormal) = FinalResult->Intersection - Sphere.Center;
- }
- return true;
- }
-
-
- // inline declarations
- // Usage of these functions requires including intersec.inl
-
- // determine location & direction for projected screen coordinate ray
- inline void Get_Screen_Ray(float ScreenX, float ScreenY, const LayerClass &Layer);
-
- // uses the Result's range & the Ray_Direction to calculate the actual point of intersection.
- inline void Calculate_Intersection(IntersectionResultClass *Result);
-
- // interpolate the normal for a polygon intersection. Will ONLY work for polygon intersections,
- // and the Results.Intersection_Data must refer to a polygon with a valid ->mesh pointer.
- inline void Interpolate_Intersection_Normal(IntersectionResultClass *FinalResult);
-
- // various methods for performing intersections.
- inline bool Intersect_Plane(IntersectionResultClass *Result, Vector3 &Plane_Normal, Vector3 &Plane_Point);
- inline bool Intersect_Plane_Quick(IntersectionResultClass *Result, Vector3 &Plane_Normal, Vector3 &Plane_Point);
- inline bool Intersect_Polygon(IntersectionResultClass *Result, Vector3 &PolygonNormal, Vector3 &v1, Vector3 &v2, Vector3 &v3);
- inline bool Intersect_Polygon(IntersectionResultClass *Result, Vector3 &v1, Vector3 &v2, Vector3 &v3);
- inline bool Intersect_Polygon_Z(IntersectionResultClass *Result, Vector3 &PolygonNormal, Vector3 &v1, Vector3 &v2, Vector3 &v3);
-
- /*
- ** This function will fill the passed array with the set of points & uv values that represent
- ** the boolean operation of the anding of the ClipPoints with the TrianglePoints. The UV values
- ** provided for the TrianglePoints triangle are used to generate accurate UV values for any
- ** new points created by this operation.
- ** The clipped points have Z values that make them sit on the ClipPoints triangle plane.
- */
- static inline int _Intersect_Triangles_Z(
- Vector3 ClipPoints[3],
- Vector3 TrianglePoints[3],
- Vector2 UV[3],
- Vector3 ClippedPoints[6],
- Vector2 ClippedUV[6]
- );
-
- /*
- ** This function will find the z elevation for the passed Vector3 whose x/y components
- ** are defined, using the specified vertex & surface normal to determine the correct value
- */
- static inline float _Get_Z_Elevation(Vector3 &Point, Vector3 &PlanePoint, Vector3 &PlaneNormal);
-
-
- // test a 2d screen area with the intersection's screen coords, assigning a GENERIC intersection
- // to the specified object.
- inline bool Intersect_Screen_Object(IntersectionResultClass *Final_Result, Vector4 &Area, RenderObjClass *obj = 0);
-
-
- // non-inlined declarations
-
-
- // accumulates an object array for passing into Intersect_ObjectArray
- void Append_Object_Array(int MaxCount, int &CurrentCount, RenderObjClass **ObjectArray, RenderObjClass *Object);
-
- // traverses an RenderObjClass object and adds it's subobjects, potentially performing
- // a quick sphere intersection test before adding.
- void Append_Hierarchy_Objects(int MaxCount, int &CurrentCount, RenderObjClass **ObjectArray, RenderObjClass *Heirarchy, bool Test_Bounding_Spheres, bool Convex);
-
- // top level intersection routines, most store intersection results in the Intersection.Result
- // member structure and perform normal interpolation as a final step if indicated in the member data.
-
- bool Intersect_Object_Array(int ObjectCount, RenderObjClass **ObjectArray,IntersectionResultClass *FinalResult, bool Test_Bounding_Sphere, bool Convex);
- bool Intersect_Object_Array(int ObjectCount, RenderObjClass **ObjectArray,IntersectionResultClass *FinalResult, IntersectionResultClass *TemporaryResults, bool Test_Bounding_Sphere, bool Convex);
- bool Intersect_RenderObject(RenderObjClass *RObj, IntersectionResultClass *FinalResult = 0);
- bool Intersect_Screen_Point_RenderObject(float screen_x, float screen_y, const LayerClass &Layer, RenderObjClass *RObj, IntersectionResultClass *FinalResult);
-
- bool Intersect_Screen_Point_Layer_Range(float ScreenX, float ScreenY, const LayerClass &TopLayer, const LayerClass &BackLayer);
- bool Intersect_Screen_Point_Layer(float ScreenX, float ScreenY, const LayerClass &Layer);
- bool Intersect_Layer(const LayerClass &Layer, bool Test_All = true);
-
- // the various intersection routines, all of which store their intersection results
- // in the passed Intersection_Result strucuture.
- bool Intersect_Box(Vector3 &Box_Min, Vector3 &Box_Max, IntersectionResultClass *FinalResult);
- bool Intersect_Hierarchy(RenderObjClass *Hierarchy, IntersectionResultClass *FinalResult, bool Test_Bounding_Sphere = true, bool Convex = false);
- bool Intersect_Hierarchy_Sphere(RenderObjClass *Hierarchy, IntersectionResultClass *FinalResult);
- bool Intersect_Hierarchy_Sphere_Quick(RenderObjClass *Hierarchy, IntersectionResultClass *FinalResult);
-
- /*
- ** Identifies exactly what sub object of a render object is under the screen space vector
- */
- RenderObjClass *Intersect_Sub_Object(float screenx, float screeny, LayerClass &layer, RenderObjClass *robj, IntersectionResultClass *result);
-
-
- /*
- ** Functions related to determining if a 3d point is within a triangle.
- */
- static inline void _Find_Polygon_Dominant_Plane(Vector3 &Normal, int &Axis_1, int &Axis_2);
- static inline int _Largest_Normal_Index(Vector3 &v);
- static inline bool _Point_In_Polygon(IntersectionResultClass *FinalResult, Vector3 &Normal, Vector3 &loc1, Vector3 &loc2, Vector3 &loc3);
- static inline bool _Point_In_Polygon(IntersectionResultClass *FinalResult, Vector3 &loc1, Vector3 &loc2, Vector3 &loc3, int axis_1, int axis_2);
- static inline bool _Point_In_Polygon(Vector3 &Point, Vector3 &loc1, Vector3 &loc2, Vector3 &loc3, int axis_1, int axis_2,float &Alpha,float &Beta);
- static inline bool _Point_In_Polygon_Z(Vector3 &Point, Vector3 Corners[3]);
- static inline bool _Point_In_Polygon_Z(Vector3 &Point, Vector3 &Corner1, Vector3 &Corner2, Vector3 &Corner3);
-
-protected:
-
- /*
- ** Find the intersection between two lines and interpolate the UV values for the intersection.
- ** Designed for use with _Intersect_Triangles_Z.
- */
- //static inline void _Intersect_Lines_Z(Vector3 &A, Vector3 &B, Vector2 &UVStart, Vector2 &UVEnd, Vector3 &C, Vector3 &D, Vector3 ClippedPoints[6], Vector2 ClippedUV[6], int &DestIndex);
- static inline bool In_Front_Of_Line
- (
- const Vector3 & p, // point to test
- const Vector3 & e0, // point on edge
- const Vector3 & de // direction of edge
- );
-
- static inline float Intersect_Lines
- (
- const Vector3 & p0, // start of line segment
- const Vector3 & p1, // end of line segment
- const Vector3 & e0, // point on clipping edge
- const Vector3 & de // direction of clipping edge
- );
-
- static inline int Clip_Triangle_To_LineXY(
- int incount,
- Vector3 * InPoints,
- Vector2 * InUVs,
- Vector3 * OutPoints,
- Vector2 * OutUVs,
- const Vector3 & edge_point0,
- const Vector3 & edge_point1
- );
-
-
-
- inline float Plane_Z_Distance(Vector3 &PlaneNormal, Vector3 &PlanePoint);
- inline void Transform_Model_To_World_Coords(IntersectionResultClass *FinalResult);
-
- /*
- ** Static vars available for use by temporary intersection class objects.
- */
- static Vector3 _RayLocation, _RayDirection, _IntersectionNormal;
-
-};
-
-
-#endif
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/intersec.inl b/Generals/Code/Libraries/Source/WWVegas/WW3D2/intersec.inl
deleted file mode 100644
index a76df398fc4..00000000000
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/intersec.inl
+++ /dev/null
@@ -1,1096 +0,0 @@
-/*
-** 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 .
-*/
-
-
-#if defined(_MSC_VER)
-#pragma once
-#endif
-
-#ifndef INTERSEC_INL
-#define INTERSEC_INL
-
-#include "camera.h"
-
-
-/// debug code that will be tossed
-
-#ifdef DEBUG_NORMALS
-
-#include "d:/g/app/main/debug_o.h"
-
-inline bool Verify_Normal(Vector3 &Normal, Vector3 &loc1, Vector3 &loc2, Vector3 &loc3)
-{
-
- double d1 = Vector3::Dot_Product(Normal, loc1);
- double d2 = Vector3::Dot_Product(Normal, loc2);
- double d3 = Vector3::Dot_Product(Normal, loc3);
-
- double e1 = d1 - d2;
- double e2 = d2 - d3;
- double e3 = d3 - d1;
-
- if((fabs(e1) > 0.001) || (fabs(e2) > 0.001) || (fabs(e3) > 0.001)) {
- Debug.Print("----------\n");
- Debug.Print("dots", Vector3(d1,d2,d3));
- Debug.Print("err", Vector3(e1,e2,e3));
- return false;
- }
- return true;
-}
-
-inline void Verify_Normal2(Vector3 &Normal, Vector3 &loc1, Vector3 &loc2, Vector3 &loc3)
-{
- Vector3 v1 = loc2 - loc1;
- Vector3 v2 = loc3 - loc1;
- Vector3 normal = Vector3::Cross_Product(v1,v2);
- normal.Normalize();
- if(!Verify_Normal(Normal, loc1,loc2,loc3)) {
- Vector3 diff = Normal - normal;
- if(Verify_Normal(normal, loc1,loc2,loc3)) {
- Debug.Print("calculated worked.\n");
-
- }
- }
-// Normal = normal;
-}
-
-#endif
-
-//// end of debug code to toss
-
-/*
-** Determine the ray that corresponds to the specified screen coordinates with respect
-** to the camera location, direction and projection information.
-*/
-
-inline void IntersectionClass::Get_Screen_Ray(float screen_x, float screen_y, const LayerClass &Layer)
-{
-
- // copy screen coords to member data
- ScreenX = screen_x;
- ScreenY = screen_y;
-
- // extract needed pointers from the world
- CameraClass *camera = Layer.Camera;
-
- // determine the ray corresponding to the camera and distance to projection plane
- Matrix3D camera_matrix = camera->Get_Transform();
- Vector3 camera_location = camera->Get_Position();
-
- // the projected ray has the same origin as the camera
- *RayLocation = camera_location;
-
-// these 6 lines worked for SR 1.1
-// build the projected screen vector
-// float x_offset = width / (float)Scene->width; // render width in pixels divided by display width in pixels = ratio of displayed area
-// float y_offset = height / (float)Scene->height;
-// float zmod = Scene->perspective;
-// float xmod = ((ScreenX / x_offset) * width - xmid - Scene->xstart) * zmod * 16384.0f/ (Scene->axratio * 128.0f);
-// float ymod = ((ScreenY / y_offset) * height - ymid - Scene->ystart) * zmod * 16384.0f/ (Scene->ayratio * 128.0f);
-
- // determine the location of the screen coordinate in camera-model space
- const ViewportClass &viewport = camera->Get_Viewport();
-
-// float aspect = camera->Get_Aspect_Ratio();
-
- Vector2 min,max;
- camera->Get_View_Plane(min,max);
- float xscale = (max.X - min.X);
- float yscale = (max.Y - min.Y);
-
- float zmod = -1.0; // Scene->vpd; // Note: view plane distance is now always 1.0 from the camera
- float xmod = (-ScreenX + 0.5 + viewport.Min.X) * zmod * xscale;// / aspect;
- float ymod = (ScreenY - 0.5 - viewport.Min.Y) * zmod * yscale;// * aspect;
-
-// float xmod = (ScreenX - 0.5 - viewport.Min.X) * zmod / Scene->axratio;
-// float ymod = (ScreenY - 0.5 - viewport.Min.Y) * zmod / Scene->ayratio;
-
-// sr1.2
-// float xmod = (ScreenX - 0.5 - Scene->xstart) * zmod / Scene->axratio;
-// float ymod = (ScreenY - 0.5 - Scene->ystart) * zmod / Scene->ayratio;
-// sr1.1
-// float xmod = x_offset * zmod; //projection_width;
-// float ymod = y_offset * zmod; //projection_height;
-
- // transform the screen coordinates by the camera's matrix into world coordinates.
- float x = zmod * camera_matrix[0][2] + xmod * camera_matrix[0][0] + ymod * camera_matrix[0][1];
- float y = zmod * camera_matrix[1][2] + xmod * camera_matrix[1][0] + ymod * camera_matrix[1][1];
- float z = zmod * camera_matrix[2][2] + xmod * camera_matrix[2][0] + ymod * camera_matrix[2][1];
-
- RayDirection->Set(x,y,z);
- RayDirection->Normalize();
-
- // set the maximum intersection distance to the back clipping plane
- MaxDistance = camera->Get_Depth();
- //Max_Distance = Scene->zstop * Scene->depth;
-
-}
-
-/*
-** This is the Point_In_Polygon_Z low level function, optimized for use by _Intersect_Triangles_Z.
-** If it is inside, it will adjust the Z value of the point to be on the triangle plane.
-*/
-inline bool IntersectionClass::_Point_In_Polygon_Z(
- Vector3 &Point,
- Vector3 &Corner1,
- Vector3 &Corner2,
- Vector3 &Corner3
-)
-{
-// these defines could be variables if support for other axis were neccessary
-#define AXIS_1 0
-#define AXIS_2 1
-#define AXIS_3 2
-
- double u0 = Point[AXIS_1] - Corner1[AXIS_1];
- double v0 = Point[AXIS_2] - Corner1[AXIS_2];
-
- // determine the 2d vectors on the dominant plane from the first vertex to the other two
- double u1 = Corner2[AXIS_1] - Corner1[AXIS_1];
- double v1 = Corner2[AXIS_2] - Corner1[AXIS_2];
- double u2 = Corner3[AXIS_1] - Corner1[AXIS_1];
- double v2 = Corner3[AXIS_2] - Corner1[AXIS_2];
-
- double alpha, beta;
- bool intersect = false;
-
- // calculate alpha and beta as normalized (0..1) percentages across the 2d projected triangle
- // and do bounds checking (sum <= 1) to determine whether or not the triangle intersection occurs.
-
- if (u1 == 0.0f) {
- beta = u0 / u2; // beta is the percentage down the edge Corner1->Corner3
- if ((beta >= 0.0f) && (beta <= 1.0f)) { // make sure it's within the edge segment
- alpha = (v0 - beta * v2) / v1; // alpha is the percentage down the edge Corner1->Corner2
-
- // if alpha is valid & the sum of alpha & beta is <= 1 then it's within the triangle
- // note: 0.00001 added after testing an intersection of a square in the middle indicated
- // an error of 0.0000001350, apparently due to roundoff.
- intersect = ((alpha >= 0.0) && ((alpha + beta) <= 1.0));
- }
- } else {
- beta = (v0 * u1 - u0 * v1) / (v2 * u1 - u2 * v1);
- if ((beta >= 0.0) && (beta <= 1.0)) {
- alpha = (u0 - beta * u2) / u1;
- intersect = ((alpha >= 0.0) && ((alpha + beta) <= 1.0));
- }
- }
-
- // if it is inside, adjust the Z value to sit upon the triangle plane.
- if(intersect) {
- float u3 = Corner2[AXIS_3] - Corner1[AXIS_3];
- float v3 = Corner3[AXIS_3] - Corner1[AXIS_3];
-
- Point[AXIS_3] = u3 * alpha + v3 * beta + Corner1[AXIS_3];
- }
-
- return intersect;
-}
-
-/*
-** Another way to access the Point_In_Polygon function
-**
-*/
-inline bool IntersectionClass::_Point_In_Polygon_Z(
- Vector3 &Point,
- Vector3 Corners[3]
-)
-{
- return _Point_In_Polygon_Z(Point, Corners[0], Corners[1], Corners[2]);
-}
-
-/*
-** This is the general purpose Point_In_Polygon low level function. It can be called directly if you know
-** the dominant projection axes, such as in the case of 2d intersecion with heightfields.
-*/
-inline bool IntersectionClass::_Point_In_Polygon(
- Vector3 &Point,
- Vector3 &loc1,
- Vector3 &loc2,
- Vector3 &loc3,
- int axis_1,
- int axis_2,
- float &Alpha,
- float &Beta)
-{
-
- double u0 = Point[axis_1] - loc1[axis_1];
- double v0 = Point[axis_2] - loc1[axis_2];
-
- // determine the 2d vectors on the dominant plane from the first vertex to the other two
- double u1 = loc2[axis_1] - loc1[axis_1];
- double v1 = loc2[axis_2] - loc1[axis_2];
- double u2 = loc3[axis_1] - loc1[axis_1];
- double v2 = loc3[axis_2] - loc1[axis_2];
-
- double alpha, beta;
- bool intersect = false;
-
- // calculate alpha and beta as normalized (0..1) percentages across the 2d projected triangle
- // and do bounds checking (sum <= 1) to determine whether or not the triangle intersection occurs.
-
-#ifdef DEBUG_NORMALS
- bool debugmode = false;
- if(FinalResult->Alpha == 777) {
- debugmode = true;
- }
-#endif
-
- if (u1 == 0.0f) {
- Beta = beta = u0 / u2; // beta is the percentage down the edge loc1->loc3
- if ((beta >= 0.0f) && (beta <= 1.0f)) { // make sure it's within the edge segment
- Alpha = alpha = (v0 - beta * v2) / v1; // alpha is the percentage down the edge loc1->loc2
-
- // if alpha is valid & the sum of alpha & beta is <= 1 then it's within the triangle
- // note: 0.00001 added after testing an intersection of a square in the middle indicated
- // an error of 0.0000001350, apparently due to roundoff.
- intersect = ((alpha >= 0.0) && ((alpha + beta) <= 1.0));
- }
- } else {
- Beta = beta = (v0 * u1 - u0 * v1) / (v2 * u1 - u2 * v1);
- if ((beta >= 0.0) && (beta <= 1.0)) {
- Alpha = alpha = (u0 - beta * u2) / u1;
- intersect = ((alpha >= 0.0) && ((alpha + beta) <= 1.0));
- }
- }
-
-#ifdef DEBUG_NORMALS
- if(debugmode) {
- Debug.Print("Intersect", intersect);
- Debug.Print("Normal ", Normal);
- Debug.Print("Point 1", loc1);
- Debug.Print("Point 2", loc2);
- Debug.Print("Point 3", loc3);
- Debug.Print("Inter ", FinalResult->Intersection);
- Debug.Print("a/b", (float) alpha, (float) beta);
- Debug.Print("sum", (float) alpha + (float) beta);
- Debug.Print("diff", (float) (alpha - beta));
- float d1 = Vector3::Dot_Product(Normal, loc1);
- float d2 = Vector3::Dot_Product(Normal, loc2);
- float d3 = Vector3::Dot_Product(Normal, loc3);
-
- float e1 = d1 - d2;
- float e2 = d2 - d3;
- float e3 = d3 - d1;
-
- Debug.Print("dots", Vector3(d1,d2,d3));
- Debug.Print("err", Vector3(e1,e2,e3));
- }
-#endif
-
-
- return intersect;
-}
-
-/*
-** This version calls the base form using member data from the FinalResult struct for
-** some of it's arguments.
-*/
-inline bool IntersectionClass::_Point_In_Polygon(
- IntersectionResultClass *FinalResult,
- Vector3 &loc1,
- Vector3 &loc2,
- Vector3 &loc3,
- int axis_1,
- int axis_2)
-{
- return (FinalResult->Intersects = _Point_In_Polygon( FinalResult->Intersection, loc1, loc2, loc3,
- axis_1, axis_2, FinalResult->Alpha, FinalResult->Beta));
-}
-
-/*
-** This version determines the dominant plane of the 3d triangle to be point-in-poly tested
-** and then calls the next form of _Point_In_Polygon
-*/
-inline bool IntersectionClass::_Point_In_Polygon(IntersectionResultClass *FinalResult, Vector3 &Normal, Vector3 &loc1, Vector3 &loc2, Vector3 &loc3) {
-
- // first, find the dominant axis and use the plane perpendicular to it as defined by axis_1, axis_2
- int axis_1, axis_2;
- _Find_Polygon_Dominant_Plane(Normal, axis_1, axis_2);
-
- return _Point_In_Polygon(FinalResult, loc1, loc2, loc3, axis_1, axis_2);
-}
-
-
-/*
-** Determine the Z distance to the specified polygon.
-*/
-inline float IntersectionClass::Plane_Z_Distance(Vector3 &PlaneNormal, Vector3 &PlanePoint)
-{
- // do a parallel check
- float divisor = (PlaneNormal[0] *(*RayDirection)[0] + PlaneNormal[1] *(*RayDirection)[1] + PlaneNormal[2] * (*RayDirection)[2]);
- if(divisor == 0) return false; // parallel
-
- // determine distance to plane
- double d = - (PlanePoint[0] * PlaneNormal[0] + PlanePoint[1] * PlaneNormal[1] + PlanePoint[2] * PlaneNormal[2]);
-
- float value = - (d + PlaneNormal[0] * (*RayLocation)[0] + PlaneNormal[1] * (*RayLocation)[1] + PlaneNormal[2] * (*RayLocation)[2]) / divisor;
-
- return value;
-}
-
-/*
-** This function will find the z elevation for the passed Vector3 whose x/y components
-** are defined, using the specified vertex & surface normal to determine the correct value
-*/
-inline float IntersectionClass::_Get_Z_Elevation(
- Vector3 &Point,
- Vector3 &PlanePoint,
- Vector3 &PlaneNormal)
-{
-
- // do a parallel check
- if(PlaneNormal[2] == 0) return false;
-
- // determine distance to plane
- double d = - (PlanePoint[0] * PlaneNormal[0] + PlanePoint[1] * PlaneNormal[1] + PlanePoint[2] * PlaneNormal[2]);
-
- float value = - (d + PlaneNormal[0] * Point[0] + PlaneNormal[1] * Point[1] ) / PlaneNormal[2];
-
- return value;
-}
-
-/*
-** Optimized intersection test that only considers the x/y component of the intersection object
-** and will determine the intersection location down the Z axis.
-*/
-inline bool IntersectionClass::Intersect_Polygon_Z(IntersectionResultClass *Result, Vector3 &PolygonNormal, Vector3 &v1, Vector3 &v2, Vector3 &v3)
-{
-
- Result->Range = Plane_Z_Distance(PolygonNormal, v1);
- (Result->Intersection)[0] = (*RayLocation)[0];
- (Result->Intersection)[1] = (*RayLocation)[1];
- (Result->Intersection)[2] = (*RayLocation)[2] - Result->Range;
- return _Point_In_Polygon(Result, PolygonNormal, v1, v2, v3);
-}
-
-
-/*
-** Scale the normalized direction ray to the distance of intersection
-*/
-void IntersectionClass::Calculate_Intersection(IntersectionResultClass *Result)
-{
- (Result->Intersection)[0] = (*RayLocation)[0] + (*RayDirection)[0] * Result->Range;
- (Result->Intersection)[1] = (*RayLocation)[1] + (*RayDirection)[1] * Result->Range;
- (Result->Intersection)[2] = (*RayLocation)[2] + (*RayDirection)[2] * Result->Range;
-}
-
-/*
-** Plane intersection test that assumes a normalized RayDirection. Only determines if
-** plane is parallel and if not, the range to it (which may be negative or beyond MaxRange).
-** It doesn't determine point of intersection either.
-*/
-inline bool IntersectionClass::Intersect_Plane_Quick(IntersectionResultClass *Result, Vector3 &PlaneNormal, Vector3 &PlanePoint)
-{
- // do a parallel check
- float divisor = (PlaneNormal[0] *(*RayDirection)[0] + PlaneNormal[1] *(*RayDirection)[1] + PlaneNormal[2] * (*RayDirection)[2]);
- if(divisor == 0) return false; // parallel
-
- // determine distance to plane
- float d = - (PlanePoint[0] * PlaneNormal[0] + PlanePoint[1] * PlaneNormal[1] + PlanePoint[2] * PlaneNormal[2]);
- Result->Range = - (d + PlaneNormal[0] * (*RayLocation)[0] + PlaneNormal[1] * (*RayLocation)[1] + PlaneNormal[2] * (*RayLocation)[2]) / divisor;
-
- return true;
-}
-
-/*
-** Determine if the specified ray will intersect the plane; returns false for planes
-** parallel and behind ray origin.
-** Sets Range to the distance from the ray location to the intersection.
-** Note: Range is undefined if an intersection didn't occur.
-*/
-inline bool IntersectionClass::Intersect_Plane(IntersectionResultClass *Result, Vector3 &PlaneNormal, Vector3 &PlanePoint) {
-
- // normalize the ray direction
- RayDirection->Normalize();
-
- // call the quick test routine
- if(!Intersect_Plane_Quick(Result, PlaneNormal, PlanePoint)) return false;
-
- // check to make sure it's not behind the ray's origin
- if(Result->Range <= 0) return false;
-
- // check to make sure it's not beyond max distance
- if(Result->Range > MaxDistance) return false;
-
- // determine point of intersection
- Calculate_Intersection(Result);
-
- return true;
-}
-
-
-
-/*
-** Return the index of the largest normal component 0..2
-** used by Find_Triangle_Dominant_Plane()
-*/
-inline int IntersectionClass::_Largest_Normal_Index(Vector3 &v)
-{
- float x = fabsf(v[0]);
- float y = fabsf(v[1]);
- float z = fabsf(v[2]);
- if(x > y) {
- if(x > z) {
- return 0; // x > y && x > z --> x is the max
- }
- return 2; // x > y && !(x > z) --> z is the max
- }
- if(y > z)
- return 1; // x <= y && y > z --> y is the max
- return 2; // y > x && y > z --> z is the max
-}
-
-/*
-** Use the Polygon's currently defined surface normal to determine it's dominant axis.
-** Axis_1 and Axis_2 are set to the indices of the two axis that define the dominant plane.
-*/
-inline void IntersectionClass::_Find_Polygon_Dominant_Plane(Vector3 &Normal, int &Axis_1, int &Axis_2)
-{
- switch (_Largest_Normal_Index(Normal))
- {
- case 0:
- // Dominant is the X axis
- Axis_1 = 2;
- Axis_2 = 1;
- break;
- case 1:
- // Dominant is the Y axis
- Axis_1 = 2;
- Axis_2 = 0;
- break;
- case 2:
- // Dominant is the Z axis
- Axis_1 = 0;
- Axis_2 = 1;
- break;
- }
-}
-
-/*
-** Returns true if ray intersects polygon.
-** Changes passed Intersection argument to location of intersection if it occurs,
-** and sets Range to the distance from the ray location to the intersection.
-** If Interpolated_Normal is specified it will interpolate the surface normal based
-** on the vertex normals.
-*/
-inline bool IntersectionClass::Intersect_Polygon(IntersectionResultClass *Result, Vector3 &PolygonNormal, Vector3 &v1, Vector3 &v2, Vector3 &v3)
-{
- // first check to see if it hits the plane; determine plane normal and find point on plane (from a vertex)
-
-#ifdef DEBUG_NORMALS
- Verify_Normal2(PolygonNormal, v1,v2,v3);
-#endif
-
- if(Intersect_Plane(Result, PolygonNormal, v1)) {
- // then check to see if it it actually intersects the polygon.
- return _Point_In_Polygon(Result, PolygonNormal, v1, v2, v3);
- }
- // doesn't even hit the plane, return false.
- return false;
-}
-
-/*
-** This version will calc the normal for the polygon before calling
-** a lower form of Intersect_Polygon
-*/
-inline bool IntersectionClass::Intersect_Polygon(IntersectionResultClass *Result, Vector3 &v1, Vector3 &v2, Vector3 &v3)
-{
- Vector3 vec1 = v2 - v1;
- Vector3 vec2 = v3 - v1;
-#ifdef ALLOW_TEMPORARIES
- Vector3 normal = Vector3::Cross_Product(vec1, vec2);
-#else
- Vector3 normal;
- Vector3::Cross_Product(vec1, vec2, &normal);
-#endif
-
- return Intersect_Polygon(Result, normal, v1,v2,v3);
-}
-
-
-// called after Interpolate_Intersection_Normal.
-// transform the intersection and the normal from model coords into world coords
-inline void IntersectionClass::Transform_Model_To_World_Coords(IntersectionResultClass *FinalResult)
-{
-#ifdef ALLOW_TEMPORARIES
- FinalResult->Intersection = FinalResult->ModelMatrix * FinalResult->Intersection + FinalResult->ModelLocation;
- if(IntersectionNormal != 0)
- {
- Vector3 normal(*IntersectionNormal);
- *IntersectionNormal = FinalResult->ModelMatrix * normal;
- }
-#else
- FinalResult->ModelMatrix.mulVector3(FinalResult->Intersection);
- FinalResult->Intersection += FinalResult->ModelLocation;
- if(IntersectionNormal != 0)
- {
- FinalResult->ModelMatrix.mulVector3(*IntersectionNormal);
- }
-#endif
-}
-
-
-
-bool IntersectionClass::Intersect_Screen_Object( IntersectionResultClass *Final_Result,
- Vector4 &Area,
- RenderObjClass *obj)
-{
- if(Final_Result->Intersects = ((ScreenX >= Area[0]) && (ScreenX <= Area[2]) && (ScreenY >= Area[1]) && (ScreenY <= Area[3]))) {
- Final_Result->IntersectionType = IntersectionResultClass::GENERIC;
- Final_Result->IntersectedRenderObject = obj;
- Final_Result->Range = 0;
- return true;
- }
- return false;
-}
-
-
-/*
-** Determines the point of intersection, if any between the line segments AB and CD.
-** If an intersection occurs, then the UV values are interpolated along AB.
-** Disregards the Z value and considers only the X/Y data except for determining
-** the Z value of the intersection.
-** This function could be easily modified to support other axes.
-* /
-void IntersectionClass::_Intersect_Lines_Z(
- Vector3 &A,
- Vector3 &B,
- Vector2 &UVStart,
- Vector2 &UVEnd,
- Vector3 &C,
- Vector3 &D,
- Vector3 ClippedPoints[6],
- Vector2 ClippedUV[6],
- int &DestIndex)
-{
- /*
- Let A,B,C,D be 2-space position vectors. Then the directed line segments AB & CD are given by:
-
- AB=A+r(B-A), r in [0,1]
- CD=C+s(D-C), s in [0,1]
- If AB & CD intersect, then
-
- A+r(B-A)=C+s(D-C), or
-
- Ax+r(Bx-Ax)=Cx+s(Dx-Cx)
- Ay+r(By-Ay)=Cy+s(Dy-Cy) for some r,s in [0,1]
- Solving the above for r and s yields
-
- (Ay-Cy)(Dx-Cx)-(Ax-Cx)(Dy-Cy)
- r = ----------------------------- (eqn 1)
- (Bx-Ax)(Dy-Cy)-(By-Ay)(Dx-Cx)
- (Ay-Cy)(Bx-Ax)-(Ax-Cx)(By-Ay)
- s = ----------------------------- (eqn 2)
- (Bx-Ax)(Dy-Cy)-(By-Ay)(Dx-Cx)
- Let P be the position vector of the intersection point, then
-
- P=A+r(B-A) or
-
- Px=Ax+r(Bx-Ax)
- Py=Ay+r(By-Ay)
- By examining the values of r & s, you can also determine some other limiting conditions:
-
- If 0<=r<=1 & 0<=s<=1, intersection exists
- r<0 or r>1 or s<0 or s>1 line segments do not intersect
- If the denominator in eqn 1 is zero, AB & CD are parallel
-
- If the numerator in eqn 1 is also zero, AB & CD are coincident
-
- If the intersection point of the 2 lines are needed (lines in this context mean infinite lines) regardless whether the two line segments intersect, then
-
- If r>1, P is located on extension of AB
- If r<0, P is located on extension of BA
- If s>1, P is located on extension of CD
- If s<0, P is located on extension of DC
- * /
-
- // the numerator is required for all execution routes
- float numerator = (A[AXIS_2] - C[AXIS_2]) * (D[AXIS_1] - C[AXIS_1]) - (A[AXIS_1] - C[AXIS_1]) * (D[AXIS_2] - C[AXIS_2]);
-
- // if the denominator is zero, then the segments are parallel.
- float denominator = (B[AXIS_1] - A[AXIS_1]) * (D[AXIS_2] - C[AXIS_2]) - (B[AXIS_2] - A[AXIS_2]) * (D[AXIS_1] - C[AXIS_1]);
-
- // r & s are percentages through the line segment.
- float r, s;
-
- // check to see if they are parallel
- if(denominator == 0) {
-
- // check to see if they are coincident
- // a numerator of zero with a denominator of zero indicates coincident lines.
- if (numerator != 0) {
-
- // parallel, not coincident lines (and segments) do not intersect.
- return;
- }
-
- // perform special case for parallel segments
-
- // determine relative position 0..1 of C and D on one of the 1d vectors of A-B
- float len = B[AXIS_1] - A[AXIS_1];
- float cpos,dpos;
-
- // if the length of the edge on the first axis is zero, use the other axis instead.
- if(len) {
- len = 1.0 / len;
- cpos = (C[AXIS_1] - A[AXIS_1]) * len;
- dpos = (D[AXIS_1] - A[AXIS_1]) * len;
- } else {
- len = B[AXIS_2] - A[AXIS_2];
-
- // degenerate triangle test
- if(len == 0)
- return;
-
- len = 1.0 / len;
- cpos = (C[AXIS_2] - A[AXIS_2]) * len;
- dpos = (D[AXIS_2] - A[AXIS_2]) * len;
- }
-
- // check to see if there's any overlap
- // one of the two pos values must be 0>pos>1 or there is no intersection.
- // this test will ensure that cpos & dpos will not both be outside the same end of the segment.
- if(((cpos < 0) && (dpos < 0)) || ((cpos > 1) && (dpos > 1)))
- return;
-
- if(cpos < 0) {
- // C is outside, therefore D is inside or on other side.
- // use the original vertex.
- ClippedPoints[DestIndex] = A;
- ClippedUV[DestIndex++] = UVStart;
- } else if (cpos > 1) {
- // C is outside far side, therefore D is inside or on other side.
- // use the far vertex.
- ClippedPoints[DestIndex] = B;
- ClippedUV[DestIndex++] = UVEnd;
- } else {
- // C is inside.
- // Use C as the vertex, and interpolate the UV coords.
- ClippedPoints[DestIndex] = C;
- ClippedUV[DestIndex++] = (UVEnd - UVStart) * cpos + UVStart;
- }
-
- if(dpos < 0) {
- // D is outside near vertex, therefore C is inside or outside far vertex
- // use near vertex
- ClippedPoints[DestIndex] = A;
- ClippedUV[DestIndex++] = UVStart;
- } else if (dpos > 1) {
- // D is outside far vertex, therefore C is inside or outside the near vertex.
- // use the far vertex.
- ClippedPoints[DestIndex] = B;
- ClippedUV[DestIndex++] = UVEnd;
- } else {
- // D is inside.
- // Use D as the vertex, and interpolate the UV coords.
- ClippedPoints[DestIndex] = D;
- ClippedUV[DestIndex++] = (UVEnd - UVStart) * dpos + UVStart;
- }
- return;
-
- }
-
- // determine the percentage into the line segments that the intersection occurs.
- // an intersection of segments will produce r & s values between 0 & 1.
- denominator = 1.0 / denominator;
- r = numerator * denominator;
-
- numerator = (A[AXIS_2] - C[AXIS_2]) * (B[AXIS_1] - A[AXIS_1]) - (A[AXIS_1] - C[AXIS_1]) * (B[AXIS_2] - A[AXIS_2]);
- s = numerator * denominator;
-
- // determine if the line intersect within the defined segments.
- if((0.0 <= r) && (r <= 1.0) && (0.0 <= s) && (s <= 1.0)) {
-
- // they intersect.
- // determine intersection point
- Vector3 v = D - C;
-// float len = v.Length();
- ClippedPoints[DestIndex] = C + v * s;
-
- // interpolate UV values
- Vector2 uv = UVEnd - UVStart;
-// len = uv.Length();
- ClippedUV[DestIndex++] = UVStart + uv * r;
- }
-}
-
-/*
- A failed attempt to use a graphics gem vol 2 example
-
-
- // Compute a1, b1, c1, where line joining points 1 and 2
- // is "a1 x + b1 y + c1 = 0".
- float a1 = B[AXIS_2] - A[AXIS_2];
- float b1 = B[AXIS_1] - A[AXIS_1];
- float c1 = B[AXIS_2] * A[AXIS_1] - A[AXIS_1] * B[AXIS_2];
-
- // Compute r3 & r4, the sign values
- float r3 = a1 * C[AXIS_1] + b1 * C[AXIS_2] + c1;
- float r4 = a1 * D[AXIS_1] + b1 * D[AXIS_2] + c1;
-
- // Check signs of r3 and r4. If both point 3 and point 4 lie on
- // same side of line 1, the line segments do not intersect.
- if ( r3 != 0 && r4 != 0 && (((r3 < 0) && (r4 < 0)) || ((r3 > 0) && (r4 > 0)))
- return; // ( DONT_INTERSECT );
-
- // Compute a2, b2, c2
- float a2 = D[AXIS_2] - C[AXIS_2];
- float b2 = C[AXIS_1] - D[AXIS_1];
- float c2 = D[AXIS_1] * C[AXIS_2] - C[AXIS_1] * D[AXIS_2];
-
- // Compute r1 and r2
- float r1 = a2 * A[AXIS_1] + b2 * A[AXIS_2] + c2;
- float r2 = a2 * B[AXIS_1] + b2 * B[AXIS_2] + c2;
-
- // Check signs of r1 and r2. If both point 1 and point 2 lie
- // on same side of second line segment, the line segments do
- // not intersect.
- if ( r1 != 0 && r2 != 0 && (((r1 < 0) && (r2 < 0)) || ((r1 > 0) && (r2 > 0))))
- return; // ( DONT_INTERSECT );
-
- // Line segments intersect: compute intersection point.
- float denom = a1 * b2 - a2 * b1;
- if ( denom == 0 )
- return; // ( COLLINEAR );
-
- float offset = denom < 0 ? - denom * 0.5f : denom * 0.5f;
-
- // The denom/2 is to get rounding instead of truncating. It
- // is added or subtracted to the numerator, depending upon the
- // sign of the numerator.
-
- float num = b1 * c2 - b2 * c1;
- float x = ( num < 0 ? num - offset : num + offset ) / denom;
-
- num = a2 * c1 - a1 * c2;
- float y = ( num < 0 ? num - offset : num + offset ) / denom;
-
- ClippedPoints[DestIndex] = Vector3(x,y,0);
- ClippedUV[DestIndex++] = Vector3
- return; //( DO_INTERSECT ); // lines_intersect
-*/
-
-inline bool IntersectionClass::In_Front_Of_Line
-(
- const Vector3 & p, // point to test
- const Vector3 & e0, // point on edge
- const Vector3 & de // direction of edge
-)
-{
- Vector3 dp = p - e0;
- float val = de.X*dp.Y - de.Y*dp.X;
- if (val > 0.0f) {
- return true;
- }
- return false;
-}
-
-inline float IntersectionClass::Intersect_Lines
-(
- const Vector3 & p0, // start of line segment
- const Vector3 & p1, // end of line segment
- const Vector3 & e0, // point on clipping edge
- const Vector3 & de // direction of clipping edge
-)
-{
- float dpx = p1.X - p0.X;
- float dpy = p1.Y - p0.Y;
-
- float den = de.Y * dpx - de.X * dpy;
-
- if (fabs(den) > WWMATH_EPSILON) {
-
- float num = p0.Y*de.X - p0.X*de.Y + e0.X*de.Y - e0.Y*de.X;
- float t = num/den;
- if ((t >= 0.0f) && (t <= 1.0f)) {
- return t;
- }
- }
-
- return 0.0f;
-}
-
-
-#define EMIT(p,uv) OutPoints[outnum] = p; OutUVs[outnum] = uv; outnum++;
-
-
-inline int IntersectionClass::Clip_Triangle_To_LineXY(
- int incount,
- Vector3 * InPoints,
- Vector2 * InUVs,
- Vector3 * OutPoints,
- Vector2 * OutUVs,
- const Vector3 & edge_point0,
- const Vector3 & edge_point1
-)
-{
- Vector3 e0 = edge_point0;
- Vector3 de = edge_point1 - edge_point0;
-
- // number of verts output.
- int outnum = 0;
-
- // start and end verts of the current edge
- int p0,p1;
- p0 = incount-1;
-
- // intersection temporaries.
- float intersection;
- Vector3 intersection_point;
- Vector2 intersection_uv;
-
- // loop over each edge in the input polygon
- for (p1=0; p1in, emit intersection and endpoint
- intersection = Intersect_Lines(InPoints[p0], InPoints[p1], e0, de);
- intersection_point = (1.0f - intersection) * InPoints[p0] + intersection * InPoints[p1];
- intersection_uv = (1.0f - intersection) * InUVs[p0] + intersection * InUVs[p1];
- EMIT(intersection_point,intersection_uv);
- EMIT(InPoints[p1],InUVs[p1]);
- }
- } else {
-
- if (In_Front_Of_Line(InPoints[p0], e0, de)) {
-
- // edge going in->out, emit intersection
- intersection = Intersect_Lines(InPoints[p0],InPoints[p1], e0, de);
- intersection_point = (1.0f - intersection) * InPoints[p0] + intersection * InPoints[p1];
- intersection_uv = (1.0f - intersection) * InUVs[p0] + intersection * InUVs[p1];
- EMIT(intersection_point,intersection_uv);
-
- }
-
- }
-
- // move to next edge
- p0 = p1;
- }
-
- return outnum;
-}
-
-inline int IntersectionClass::_Intersect_Triangles_Z(
- Vector3 ClipPoints[3],
- Vector3 TrianglePoints[3],
- Vector2 UV[3],
- Vector3 ClippedPoints[6],
- Vector2 ClippedUV[6]
-)
-{
- int count;
- Vector3 tmp_points[6];
- Vector2 tmp_uv[6];
-
- count = Clip_Triangle_To_LineXY(3,TrianglePoints,UV,ClippedPoints,ClippedUV,ClipPoints[0],ClipPoints[1]);
- count = Clip_Triangle_To_LineXY(count,ClippedPoints,ClippedUV,tmp_points,tmp_uv,ClipPoints[1],ClipPoints[2]);
- count = Clip_Triangle_To_LineXY(count,tmp_points,tmp_uv,ClippedPoints,ClippedUV,ClipPoints[2],ClipPoints[0]);
-
- return count;
-}
-
-/*
-** This function will fill the passed array with the set of points & uv values that represent
-** the boolean operation of the anding of the ClipPoints with the TrianglePoints. The UV values
-** provided for the TrianglePoints triangle are used to generate accurate UV values for any
-** new points created by this operation.
-** This function returns the number of vertices it required to define the intersection.
-* /
-int IntersectionClass::_Intersect_Triangles_Z(
- Vector3 ClipPoints[3],
- Vector3 TrianglePoints[3],
- Vector2 UV[3],
- Vector3 ClippedPoints[6],
- Vector2 ClippedUV[6]
-)
-{
- // first, check to see if all triangle points are inside clip area
- // the point in polygon will drop any inside points to the clip triangle plane.
- bool inside[3];
-
- bool noclip;
- noclip = inside[0] = _Point_In_Polygon_Z(TrianglePoints[0], ClipPoints);
- noclip &= inside[1] = _Point_In_Polygon_Z(TrianglePoints[1], ClipPoints);
- noclip &= inside[2] = _Point_In_Polygon_Z(TrianglePoints[2], ClipPoints);
-
- // if all points are inside clip area, then copy the triangle points &
- // UV's to the destination & return 3 (the number of points in the clipped polygon).
- if(noclip) {
- ClippedPoints[0] = TrianglePoints[0];
- ClippedPoints[1] = TrianglePoints[1];
- ClippedPoints[2] = TrianglePoints[2];
- ClippedUV[0] = UV[0];
- ClippedUV[1] = UV[1];
- ClippedUV[2] = UV[2];
-
- return 3;
- }
-
- int points = 0; // number of output polygon points
-
- // not all uv triangle points are inside the clip triangle.
- // Test to see if any clip points are inside the uv triangle
- float alpha, beta;
- if(_Point_In_Polygon(ClipPoints[0], TrianglePoints[0], TrianglePoints[1], TrianglePoints[2], 0, 1, alpha, beta)) {
- ClippedPoints[points] = ClipPoints[0];
- Vector2 uv1 = UV[1] - UV[0];
- Vector2 uv2 = UV[2] - UV[0];
- ClippedUV[points++] = UV[0] + alpha * uv1 + beta * uv2;
- }
-
- if(_Point_In_Polygon(ClipPoints[1], TrianglePoints[0], TrianglePoints[1], TrianglePoints[2], 0, 1, alpha, beta)) {
- ClippedPoints[points] = ClipPoints[1];
- Vector2 uv1 = UV[1] - UV[0];
- Vector2 uv2 = UV[2] - UV[0];
- ClippedUV[points++] = UV[0] + alpha * uv1 + beta * uv2;
- }
-
- if(_Point_In_Polygon(ClipPoints[2], TrianglePoints[0], TrianglePoints[1], TrianglePoints[2], 0, 1, alpha, beta)) {
- ClippedPoints[points] = ClipPoints[2];
- Vector2 uv1 = UV[1] - UV[0];
- Vector2 uv2 = UV[2] - UV[0];
- ClippedUV[points++] = UV[0] + alpha * uv1 + beta * uv2;
- }
-
- // if all 3 clip points are inside the decal triangle then return
- if(points == 3)
- return;
-
- // The clip triangle does not fully contain the uv triangle, and the uv triangle
- // does not fully contain the clip triangle.
- // Intersect any edge which has at least one outside point with all of the clip edges.
- // First, determine which edges to test. Those points that are already clipped (by being inside)
- // are immediately copied to the clipped point & uv arrays.
-
- // these bools indicate which edges of the triangle to be clipped are to be tested.
- bool test_01 = false;
- bool test_02 = false;
- bool test_12 = false;
-
- if( inside[0] ) { ClippedPoints[points] = TrianglePoints[0]; ClippedUV[points++] = UV[0]; }
- else { test_01 = test_02 = true; }
-
- if( inside[1] ) { ClippedPoints[points] = TrianglePoints[1]; ClippedUV[points++] = UV[1]; }
- else { test_01 = test_12 = true; }
-
- if( inside[2] ) { ClippedPoints[points] = TrianglePoints[2]; ClippedUV[points++] = UV[2];}
- else { test_02 = test_12 = true; }
-
- // Now test each indicated segment.
- // Intersect_2D_Lines will interpolate the clipped UV values if an intersection occurs, and it
- // will also increment the points variable (passed as a reference).
- // Any intersections are stored in the passed ClippedPoints array.
- if(test_01) {
- _Intersect_Lines_Z( TrianglePoints[0], TrianglePoints[1],
- UV[0], UV[1],
- ClipPoints[0], ClipPoints[1],
- ClippedPoints,
- ClippedUV,
- points);
- _Intersect_Lines_Z( TrianglePoints[0], TrianglePoints[1],
- UV[0], UV[1],
- ClipPoints[0], ClipPoints[2],
- ClippedPoints,
- ClippedUV,
- points);
- _Intersect_Lines_Z( TrianglePoints[0], TrianglePoints[1],
- UV[0], UV[1],
- ClipPoints[1], ClipPoints[2],
- ClippedPoints,
- ClippedUV,
- points);
- }
- if(test_02) {
- _Intersect_Lines_Z( TrianglePoints[0], TrianglePoints[2],
- UV[0], UV[2],
- ClipPoints[0], ClipPoints[1],
- ClippedPoints,
- ClippedUV,
- points);
- _Intersect_Lines_Z( TrianglePoints[0], TrianglePoints[2],
- UV[0], UV[2],
- ClipPoints[0], ClipPoints[2],
- ClippedPoints,
- ClippedUV,
- points);
- _Intersect_Lines_Z( TrianglePoints[0], TrianglePoints[2],
- UV[0], UV[2],
- ClipPoints[1], ClipPoints[2],
- ClippedPoints,
- ClippedUV,
- points);
- }
- if(test_12) {
- _Intersect_Lines_Z( TrianglePoints[1], TrianglePoints[2],
- UV[1], UV[2],
- ClipPoints[0], ClipPoints[1],
- ClippedPoints,
- ClippedUV,
- points);
- _Intersect_Lines_Z( TrianglePoints[1], TrianglePoints[2],
- UV[1], UV[2],
- ClipPoints[0], ClipPoints[2],
- ClippedPoints,
- ClippedUV,
- points);
- _Intersect_Lines_Z( TrianglePoints[1], TrianglePoints[2],
- UV[1], UV[2],
- ClipPoints[1], ClipPoints[2],
- ClippedPoints,
- ClippedUV,
- points);
- }
-
- // If no intersections have occurred, then the triangle must be completely outside
- // the clipping area.
-/*
- // if it is determined that no intersections have occurred, then copy the clip triangle points
- // into the destination array and determine the correct UV values for the subset of the
- // triangle that was clipped.
- if(points == 0) {
- ClippedPoints[0] = ClipPoints[0];
- ClippedPoints[1] = ClipPoints[1];
- ClippedPoints[2] = ClipPoints[2];
- ClippedUV[0] = UV[0];
- ClippedUV[1] = UV[1];
- ClippedUV[2] = UV[2];
-
- return 3;
- }
-* /
- // points will be 0, 3, 4, 5 or 6
- if(!((points == 0) || (points == 3) || (points == 4) || (points == 5) || (points == 6))) {
- Debug.Print("points", points);
- return 0; //_Intersect_Triangles_Z( ClipPoints, TrianglePoints, UV, ClippedPoints, ClippedUV);
- }
-
- return points;
-
-}
-*/
-
-
-#endif
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/inttest.h b/Generals/Code/Libraries/Source/WWVegas/WW3D2/inttest.h
deleted file mode 100644
index e933eb64ce2..00000000000
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/inttest.h
+++ /dev/null
@@ -1,256 +0,0 @@
-/*
-** 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 .
-*/
-
-/***********************************************************************************************
- *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
- ***********************************************************************************************
- * *
- * Project Name : WW3D *
- * *
- * $Archive:: /Commando/Code/ww3d2/inttest.h $*
- * *
- * Original Author:: Greg Hjelstrom *
- * *
- * $Author:: Greg_h $*
- * *
- * $Modtime:: 3/14/01 9:19a $*
- * *
- * $Revision:: 2 $*
- * *
- *---------------------------------------------------------------------------------------------*
- * Functions: *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-#if defined(_MSC_VER)
-#pragma once
-#endif
-
-#ifndef INTTEST_H
-#define INTTEST_H
-
-#include "always.h"
-#include "aabox.h"
-#include "obbox.h"
-#include "tri.h"
-#include "colmath.h"
-#include "coltype.h"
-
-
-/////////////////////////////////////////////////////////////////////////////////////////////////////////////
-// IntersectionTestClass
-//
-// This is the base class for all of the 'Intersection' functions. The intersection tests are
-// purely boolean tests. The base class only contains the CollisionType of the test.
-//
-// Every IntersectionTestClass should have the following functions:
-//
-// bool Cull(const Vector3 & min,const Vector3 & max);
-// bool Cull(const AABoxClass & box);
-// bool Intersect_Triangle(const TriClass & tri);
-//
-// These are not virtual because I don't want to pay the price of virtual function
-// calls at the point in the code where these are used. It may be possible to
-// write template functions if we use these exact function prototpyes for all
-// collision test classes though.
-//
-/////////////////////////////////////////////////////////////////////////////////////////////////////////////
-class IntersectionTestClass
-{
-public:
- IntersectionTestClass(int collision_type) : CollisionType(collision_type) { }
- IntersectionTestClass(const IntersectionTestClass & that) : CollisionType(that.CollisionType) { }
-
-public:
- int CollisionType;
-};
-
-
-/////////////////////////////////////////////////////////////////////////////////////////////////////////////
-// AABoxIntersectionTestClass
-//
-// This is an intersection test which uses an Axis-Aligned Box
-//
-/////////////////////////////////////////////////////////////////////////////////////////////////////////////
-class AABoxIntersectionTestClass : public IntersectionTestClass
-{
-public:
- AABoxIntersectionTestClass(const AABoxClass & box,int collision_type) :
- IntersectionTestClass(collision_type),
- Box(box)
- {
- }
-
- AABoxIntersectionTestClass(const AABoxIntersectionTestClass & that) :
- IntersectionTestClass(that),
- Box(that.Box)
- {
- }
-
- bool Cull(const Vector3 & cull_min,const Vector3 & cull_max);
- bool Cull(const AABoxClass & cull_box);
- bool Intersect_Triangle(const TriClass & tri);
-
-public:
- AABoxClass Box; // world space aabox that we want to test with
-
-};
-
-inline bool AABoxIntersectionTestClass::Cull(const Vector3 & cull_min,const Vector3 & cull_max)
-{
- Vector3 box_min;
- Vector3::Subtract(Box.Center,Box.Extent,&box_min);
-
- Vector3 box_max;
- Vector3::Add(Box.Center,Box.Extent,&box_max);
-
- if ((box_min.X > cull_max.X) || (box_max.X < cull_min.X)) return true;
- if ((box_min.Y > cull_max.Y) || (box_max.Y < cull_min.Y)) return true;
- if ((box_min.Z > cull_max.Z) || (box_max.Z < cull_min.Z)) return true;
-
- return false;
-}
-
-inline bool AABoxIntersectionTestClass::Cull(const AABoxClass & cull_box)
-{
- Vector3 dc;
- Vector3 r;
- Vector3::Subtract(cull_box.Center,Box.Center,&dc);
- Vector3::Add(cull_box.Extent,Box.Extent,&r);
-
- if (WWMath::Fabs(dc.X) > r.X) return true;
- if (WWMath::Fabs(dc.Y) > r.Y) return true;
- if (WWMath::Fabs(dc.Z) > r.Z) return true;
-
- return false;
-}
-
-inline bool AABoxIntersectionTestClass::Intersect_Triangle(const TriClass & tri)
-{
- return CollisionMath::Intersection_Test(Box,tri);
-}
-
-
-/////////////////////////////////////////////////////////////////////////////////////////////////////////////
-// OBBoxIntersectionTestClass
-//
-// This is an intersection test which uses an Axis-Aligned Box
-//
-/////////////////////////////////////////////////////////////////////////////////////////////////////////////
-class OBBoxIntersectionTestClass : public IntersectionTestClass
-{
-public:
-
- OBBoxIntersectionTestClass(const OBBoxClass & box,int collision_type);
- OBBoxIntersectionTestClass(const OBBoxIntersectionTestClass & that);
- OBBoxIntersectionTestClass(const OBBoxIntersectionTestClass & that,const Matrix3D & tm);
- OBBoxIntersectionTestClass(const AABoxIntersectionTestClass & that,const Matrix3D & tm);
-
- bool Cull(const Vector3 & min,const Vector3 & max);
- bool Cull(const AABoxClass & box);
- bool Intersect_Triangle(const TriClass & tri);
-
-protected:
- void update_bounding_box(void);
-
-public:
- OBBoxClass Box; // world space obbox that we want to test with
- AABoxClass BoundingBox; // axis aligned w-s bounding box
-};
-
-
-inline OBBoxIntersectionTestClass::OBBoxIntersectionTestClass(const OBBoxClass & box,int collision_type) :
- IntersectionTestClass(collision_type),
- Box(box)
-{
- update_bounding_box();
-}
-
-inline OBBoxIntersectionTestClass::OBBoxIntersectionTestClass(const OBBoxIntersectionTestClass & that) :
- IntersectionTestClass(that),
- Box(that.Box)
-{
- update_bounding_box();
-}
-
-inline OBBoxIntersectionTestClass::OBBoxIntersectionTestClass
-(
- const OBBoxIntersectionTestClass & that,
- const Matrix3D & tm
-) :
- IntersectionTestClass(that)
-{
- OBBoxClass::Transform(tm,that.Box,&Box);
- update_bounding_box();
-}
-
-inline OBBoxIntersectionTestClass::OBBoxIntersectionTestClass
-(
- const AABoxIntersectionTestClass & that,
- const Matrix3D & tm
-) :
- IntersectionTestClass(that)
-{
- Matrix3D::Transform_Vector(tm,that.Box.Center,&(Box.Center));
- Box.Extent = that.Box.Extent;
- Box.Basis = tm; // copies the 3x3 rotation portion of the transform
- update_bounding_box();
-}
-
-inline bool OBBoxIntersectionTestClass::Cull(const Vector3 & cull_min,const Vector3 & cull_max)
-{
- Vector3 box_min;
- Vector3::Subtract(BoundingBox.Center,BoundingBox.Extent,&box_min);
-
- Vector3 box_max;
- Vector3::Add(BoundingBox.Center,BoundingBox.Extent,&box_max);
-
- if ((box_min.X > cull_max.X) || (box_max.X < cull_min.X)) return true;
- if ((box_min.Y > cull_max.Y) || (box_max.Y < cull_min.Y)) return true;
- if ((box_min.Z > cull_max.Z) || (box_max.Z < cull_min.Z)) return true;
-
- return false;
-}
-
-inline bool OBBoxIntersectionTestClass::Cull(const AABoxClass & cull_box)
-{
- Vector3 dc;
- Vector3 r;
- Vector3::Subtract(cull_box.Center,BoundingBox.Center,&dc);
- Vector3::Add(cull_box.Extent,BoundingBox.Extent,&r);
-
- if (WWMath::Fabs(dc.X) > r.X) return true;
- if (WWMath::Fabs(dc.Y) > r.Y) return true;
- if (WWMath::Fabs(dc.Z) > r.Z) return true;
-
- return false;
-}
-
-inline bool OBBoxIntersectionTestClass::Intersect_Triangle(const TriClass & tri)
-{
- return CollisionMath::Intersection_Test(Box,tri);
-}
-
-inline void OBBoxIntersectionTestClass::update_bounding_box(void)
-{
- BoundingBox.Center = Box.Center;
- Box.Basis.Rotate_AABox_Extent(Box.Extent,&BoundingBox.Extent);
-}
-
-
-
-#endif
\ No newline at end of file
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/layer.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/layer.cpp
deleted file mode 100644
index d4c983a0cdd..00000000000
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/layer.cpp
+++ /dev/null
@@ -1,289 +0,0 @@
-/*
-** 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 .
-*/
-
-/***********************************************************************************************
- *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
- ***********************************************************************************************
- * *
- * Project Name : WW3D *
- * *
- * $Archive:: /VSS_Sync/ww3d2/layer.cpp $*
- * *
- * $Author:: Vss_sync $*
- * *
- * $Modtime:: 8/29/01 7:29p $*
- * *
- * $Revision:: 3 $*
- * *
- *---------------------------------------------------------------------------------------------*
- * Functions: *
- * LayerClass::LayerClass -- constructor *
- * LayerClass::~LayerClass -- destructor *
- * LayerClass::Set_Scene -- Set the scene used by this layer *
- * LayerClass::Get_Scene -- get the scene being rendered by this layer *
- * LayerClass::Peek_Scene -- get the scene being rendered by this layer w/o a ref *
- * LayerClass::Set_Camera -- Set the camera being used by this layer *
- * LayerClass::Get_Camera -- get the camera being used by this layer *
- * LayerClass::LayerClass -- default constructor *
- * LC::Peek_Camera -- Get copy of camera. *
- * LC::Set -- Kinda like an assignment operator. *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-
-#include "layer.h"
-#include "scene.h"
-#include "camera.h"
-
-
-/***********************************************************************************************
- * LayerClass::LayerClass -- default constructor *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 3/27/98 GTH : Created. *
- *=============================================================================================*/
-LayerClass::LayerClass(void) :
- Scene(NULL),
- Camera(NULL),
- Clear(false),
- ClearZ(true),
- ClearColor(0,0,0)
-{
-}
-
-LayerClass::LayerClass(const LayerClass &src) :
- Scene(src.Get_Scene()),
- Camera(src.Get_Camera()),
- Clear(src.Clear),
- ClearZ(src.ClearZ),
- ClearColor(src.ClearColor)
-{
-}
-
-/***********************************************************************************************
- * LayerClass::LayerClass -- constructor *
- * *
- * simply constructs a layer class, initialized with the desired settings *
- * *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 3/27/98 GTH : Created. *
- *=============================================================================================*/
-LayerClass::LayerClass
-(
- SceneClass * scene,
- CameraClass * cam,
- bool clear,
- bool clearz,
- const Vector3 & color
-)
-{
- if (scene) scene->Add_Ref();
- Scene = scene;
-
- if (cam) cam->Add_Ref();
- Camera = cam;
-
- Clear = clear;
- ClearZ = clearz;
- ClearColor = color;
-}
-
-
-/***********************************************************************************************
- * LayerClass::~LayerClass -- destructor *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 3/27/98 GTH : Created. *
- *=============================================================================================*/
-LayerClass::~LayerClass(void)
-{
- if (Scene) {
- Scene->Release_Ref();
- Scene=0;
- }
- if (Camera) {
- Camera->Release_Ref();
- Camera=0;
- }
-}
-
-
-/***********************************************************************************************
- * LayerClass::Set_Scene -- Set the scene used by this layer *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 3/27/98 GTH : Created. *
- *=============================================================================================*/
-void LayerClass::Set_Scene(SceneClass * scene)
-{
- if (Scene) {
- Scene->Release_Ref();
- }
- Scene = scene;
- if (Scene) {
- Scene->Add_Ref();
- }
-}
-
-
-/***********************************************************************************************
- * LayerClass::Get_Scene -- get the scene being rendered by this layer *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 3/27/98 GTH : Created. *
- *=============================================================================================*/
-SceneClass * LayerClass::Get_Scene(void) const
-{
- if (Scene) {
- Scene->Add_Ref();
- }
- return Scene;
-}
-
-
-/***********************************************************************************************
- * LayerClass::Peek_Scene -- get the scene being rendered by this layer *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 3/8/99 NH : Created. *
- *=============================================================================================*/
-SceneClass * LayerClass::Peek_Scene(void) const
-{
- return Scene;
-}
-
-
-/***********************************************************************************************
- * LayerClass::Set_Camera -- Set the camera being used by this layer *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 3/27/98 GTH : Created. *
- *=============================================================================================*/
-void LayerClass::Set_Camera(CameraClass * cam)
-{
- if (Camera) {
- Camera->Release_Ref();
- }
- Camera = cam;
- if (Camera) {
- Camera->Add_Ref();
- }
-}
-
-
-/***********************************************************************************************
- * LayerClass::Get_Camera -- get the camera being used by this layer *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 3/27/98 GTH : Created. *
- *=============================================================================================*/
-CameraClass * LayerClass::Get_Camera(void) const
-{
- if (Camera) {
- Camera->Add_Ref();
- }
- return Camera;
-}
-
-
-/***********************************************************************************************
- * LC::Peek_Camera -- Get copy of camera. *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 08/14/2001 SKB : Created. *
- *=============================================================================================*/
-CameraClass * LayerClass::Peek_Camera(void) const
-{
- return Camera;
-}
-
-
-/***********************************************************************************************
- * LC::Set -- Kinda like an assignment operator. *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 08/14/2001 SKB : Created. *
- *=============================================================================================*/
-void LayerClass::Set(const LayerClass & layer)
-{
- Set_Camera(layer.Peek_Camera());
- Set_Scene(layer.Peek_Scene());
- Clear = layer.Clear;
- ClearZ = layer.ClearZ;
- ClearColor = layer.ClearColor;
-}
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/layer.h b/Generals/Code/Libraries/Source/WWVegas/WW3D2/layer.h
deleted file mode 100644
index 35af8af2839..00000000000
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/layer.h
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
-** 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 .
-*/
-
-/***********************************************************************************************
- *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
- ***********************************************************************************************
- * *
- * Project Name : WW3D *
- * *
- * $Archive:: /VSS_Sync/ww3d2/layer.h $*
- * *
- * $Author:: Vss_sync $*
- * *
- * $Modtime:: 8/29/01 7:29p $*
- * *
- * $Revision:: 2 $*
- * *
- *---------------------------------------------------------------------------------------------*
- * Functions: *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-
-#if defined(_MSC_VER)
-#pragma once
-#endif
-
-#ifndef LAYER_H
-#define LAYER_H
-
-#include "always.h"
-#include "LISTNODE.H"
-#include "vector3.h"
-
-class SceneClass;
-class CameraClass;
-
-class LayerClass;
-typedef Node LayerNodeClass;
-
-class LayerClass : public LayerNodeClass
-{
-
-public:
-
- LayerClass(void);
- LayerClass(SceneClass * s,CameraClass * c,bool clear = false,bool clearz = false,const Vector3 & color = Vector3(0,0,0));
- LayerClass(const LayerClass & src);
- ~LayerClass(void);
-
-
- /*
- ** The following functions will handle the references of the Scene and Camera
- ** objects properly.
- */
- void Set_Scene(SceneClass * scene);
- SceneClass * Get_Scene(void) const;
- SceneClass * Peek_Scene(void) const;
- void Set_Camera(CameraClass * cam);
- CameraClass * Get_Camera(void) const;
- CameraClass * Peek_Camera(void) const;
-
-
- // [SKB: Aug 14 2001 @ 1:53pm] :
- // Add a method to copy one layer to another - I would like to create an assignment
- // operator but it could break old code.
- void Set(const LayerClass & layer);
-
- /*
- ** LayerClass members are public since this is a "lightweight" class
- */
- bool Clear;
- bool ClearZ;
- Vector3 ClearColor;
-
- SceneClass * Scene;
- CameraClass * Camera;
-
-};
-
-typedef List LayerListClass;
-
-
-#endif //LAYER_H
-
-
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/line3d.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/line3d.cpp
deleted file mode 100644
index 231abe92c2e..00000000000
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/line3d.cpp
+++ /dev/null
@@ -1,514 +0,0 @@
-/*
-** 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 .
-*/
-
-/***************************************************************************
- *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
- ***************************************************************************
- * *
- * Project Name : G *
- * *
- * $Archive:: /Commando/Code/ww3d2/line3d.cpp $*
- * *
- * $Author:: Jani_p $*
- * *
- * $Modtime:: 7/05/01 4:15p $*
- * *
- * $Revision:: 11 $*
- * *
- *-------------------------------------------------------------------------*
- * Functions: *
- * Line3DClass::Line3DClass -- Constructor *
- * Line3DClass::Line3DClass -- Copy constructor. *
- * Line3DClass::operator = -- assignment operator *
- * Line3DClass::~Line3DClass -- Destructor. *
- * Line3DClass::Clone -- Creates a clone of this Line3D *
- * Line3DClass::Scale -- Scale object *
- * Line3DClass::Scale -- Scale object *
- * Line3DClass::Update_Cached_Bounding_Volumes -- update bounding vols *
- * Line3DClass::Reset -- Reset line start and end points. *
- * Line3DClass::Reset -- Reset line start and end points, and line width.*
- * Re_Color -- Reset the line color. *
- * Set_Opacity -- Reset the line opacity. *
- * Line3DClass::Render -- render the 3d line *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-#include "line3d.h"
-#include "vertmaterial.h"
-#include "shader.h"
-#include "wwdebug.h"
-#include "ww3d.h"
-#include "rinfo.h"
-#include "dx8wrapper.h"
-#include "dx8vertexbuffer.h"
-#include "dx8indexbuffer.h"
-#include "dx8fvf.h"
-
-// 12 Triangles for index buffer
-const unsigned short Indices[]=
-{
- 3,5,1,
- 7,5,3,
- 1,5,0,
- 5,4,0,
- 4,2,0,
- 4,6,2,
- 7,3,2,
- 6,7,2,
- 7,6,5,
- 5,6,4,
- 2,3,1,
- 2,1,0
-};
-
-
-/**************************************************************************
- * Line3DClass::Line3DClass -- Constructor *
- * *
- * INPUT: Vector3 start, end - start, end points of line (world coords).*
- * float width - width of line (in world units). *
- * float r, g, b - R, G, B components of line color. *
- * float opacity - opacity of line. *
- * *
- * OUTPUT: none. *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 01/15/1998 NH : Created. *
- * 04/21/1998 NH : Ported to SR 1.3. *
- * 02/16/2001 HY : Ported to DX8 *
- *========================================================================*/
-Line3DClass::Line3DClass (const Vector3 & start, const Vector3 & end,
- float width, float r, float g, float b, float opacity)
-{
- Length = (end - start).Length();
- Width = width;
-
- // Create box model with origin at start point (X is major axis).
-
- // 8 Vertices
- float halfw = Width * 0.5f;
-
- vert[0].X = 0.0f;
- vert[0].Y = -halfw;
- vert[0].Z = -halfw;
- vert[1].X = 0.0f;
- vert[1].Y = halfw;
- vert[1].Z = -halfw;
- vert[2].X = 0.0f;
- vert[2].Y = -halfw;
- vert[2].Z = halfw;
- vert[3].X = 0.0f;
- vert[3].Y = halfw;
- vert[3].Z = halfw;
- vert[4].X = Length;
- vert[4].Y = -halfw;
- vert[4].Z = -halfw;
- vert[5].X = Length;
- vert[5].Y = halfw;
- vert[5].Z = -halfw;
- vert[6].X = Length;
- vert[6].Y = -halfw;
- vert[6].Z = halfw;
- vert[7].X = Length;
- vert[7].Y = halfw;
- vert[7].Z = halfw;
-
- Color.X=r;
- Color.Y=g;
- Color.Z=b;
- Set_Opacity(opacity);
-
- // Set box transform so that the origin is at the start point and it
- // 'looks towards' the endpoint.
- Matrix3D transform(true);
- transform.Obj_Look_At(start, end, 0.0);
- Set_Transform(transform);
-}
-
-
-/**************************************************************************
- * Line3DClass::Line3DClass -- Copy constructor. *
- * *
- * INPUT: const Line3DClass & src - source to copy from. *
- * *
- * OUTPUT: none. *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 01/15/1998 NH : Created. *
- * 04/21/1998 NH : Ported to SR 1.3. *
- * 02/16/2001 HY : Ported to DX8 *
- *========================================================================*/
-Line3DClass::Line3DClass(const Line3DClass & src) :
- RenderObjClass(src),
- Length(src.Length),
- Width(src.Width),
- Shader(src.Shader),
- Color(src.Color)
-{
- for (int i=0; i<8; i++) vert[i]=src.vert[i];
-}
-
-
-/**************************************************************************
- * Line3DClass::operator = -- assignment operator *
- * *
- * INPUT: const Line3DClass & that - source to copy from. *
- * *
- * OUTPUT: Line3DClass & - result of assignment. *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 01/15/1998 NH : Created. *
- * 04/21/1998 NH : Ported to SR 1.3. *
- * 02/16/2001 HY : Ported to DX8 *
- *========================================================================*/
-Line3DClass & Line3DClass::operator = (const Line3DClass & that)
-{
- // Naty: need to add MatInfo and remapper to do this Byon
- WWASSERT(0);
-
- RenderObjClass::operator = (that);
-
- if (this != &that) {
- Length = that.Length;
- Width = that.Width;
- Shader=that.Shader;
- Color=that.Color;
- for (int i=0; i<8; i++)
- vert[i]=that.vert[i];
- }
-
- return * this;
-}
-
-
-/**************************************************************************
- * Line3DClass::~Line3DClass -- Destructor. *
- * *
- * INPUT: none. *
- * *
- * OUTPUT: none. *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 01/15/1998 NH : Created. *
- * 04/21/1998 NH : Ported to SR 1.3. *
- * 02/16/2001 HY : Ported to DX8 *
- *========================================================================*/
-Line3DClass::~Line3DClass(void)
-{
-}
-
-
-/**************************************************************************
- * Line3DClass::Clone -- Creates a clone of this Line3D *
- * *
- * INPUT: none. *
- * *
- * OUTPUT: RenderObjClass * - pointer to cloned object. *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 01/15/1998 NH : Created. *
- *========================================================================*/
-RenderObjClass * Line3DClass::Clone(void) const
-{
- return NEW_REF( Line3DClass, (*this));
-}
-
-/***********************************************************************************************
- * Line3DClass::Render -- render the 3d line *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 12/8/98 GTH : Created. *
- * 02/16/2001 HY : Ported to DX8 *
- *=============================================================================================*/
-
-void Line3DClass::Render(RenderInfoClass & rinfo)
-{
- if (Is_Not_Hidden_At_All() == false) {
- return;
- }
-
- // If static sort lists are enabled and this mesh has a sort level, put it on the list instead
- // of rendering it.
- unsigned int sort_level = (unsigned int)Get_Sort_Level();
-
- if (WW3D::Are_Static_Sort_Lists_Enabled() && sort_level != SORT_LEVEL_NONE)
- {
- WW3D::Add_To_Static_Sort_List(this, sort_level);
- return;
- }
-
- DX8Wrapper::Set_Shader(Shader);
- DX8Wrapper::Set_Texture(0,NULL);
- VertexMaterialClass *vm=VertexMaterialClass::Get_Preset(VertexMaterialClass::PRELIT_DIFFUSE);
- DX8Wrapper::Set_Material(vm);
- REF_PTR_RELEASE(vm);
-
- DX8Wrapper::Set_Transform(D3DTS_WORLD,Transform);
-
- DynamicVBAccessClass vb(BUFFER_TYPE_DYNAMIC_DX8,dynamic_fvf_type,8);
- {
- DynamicVBAccessClass::WriteLockClass Lock(&vb);
- const FVFInfoClass &fi=vb.FVF_Info();
- unsigned char *vb=(unsigned char*)Lock.Get_Formatted_Vertex_Array();
- int i;
- unsigned int color=DX8Wrapper::Convert_Color(Color);
-
- for (i=0; i<8; i++)
- {
- *(Vector3*)(vb+fi.Get_Location_Offset())=vert[i];
- *(unsigned int*)(vb+fi.Get_Diffuse_Offset())=color;
- vb+=fi.Get_FVF_Size();
- }
- }
-
- DynamicIBAccessClass ib(BUFFER_TYPE_DYNAMIC_DX8,36);
- {
- DynamicIBAccessClass::WriteLockClass Lock(&ib);
- unsigned short *mem=Lock.Get_Index_Array();
- for (int i=0; i<36; i++)
- mem[i]=Indices[i];
- }
-
- DX8Wrapper::Set_Vertex_Buffer(vb);
- DX8Wrapper::Set_Index_Buffer(ib,0);
- DX8Wrapper::Draw_Triangles(0,36/3,0,8);
-}
-
-/**************************************************************************
- * Line3DClass::Scale -- Scale object *
- * *
- * INPUT: float scale - uniform scale factor. *
- * *
- * OUTPUT: none. *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 01/27/1998 NH : Created. *
- * 04/21/1998 NH : Ported to SR 1.3. *
- * 02/16/2001 HY : Ported to DX8 *
- *========================================================================*/
-void Line3DClass::Scale(float scale)
-{
- for (int i=0; i<8; i++) vert[i]*=scale;
- Length *= scale;
- Width *= scale;
-
- Invalidate_Cached_Bounding_Volumes();
-
- // Now update the object space bounding volumes of this object's container:
- RenderObjClass *container = Get_Container();
- if (container) container->Update_Obj_Space_Bounding_Volumes();
-}
-
-
-/**************************************************************************
- * Line3DClass::Scale -- Scale object *
- * *
- * INPUT: float scalex, scaley, scalez - axis scale factors. *
- * *
- * OUTPUT: none. *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 01/27/1998 NH : Created. *
- * 04/21/1998 NH : Ported to SR 1.3. *
- * 02/16/2001 HY : Ported to DX8 *
- *========================================================================*/
-void Line3DClass::Scale(float scalex, float scaley, float scalez)
-{
- // The line width is always the same in the y and z axes (the line
- // approximates a cylinder).
- Vector3 scale(scalex,scaley,scalez);
- for (int i=0; i<8; i++) vert[i].Scale(scale);
- Length *= scalex;
- Width *= scaley;
-
- Invalidate_Cached_Bounding_Volumes();
-
- // Now update the object space bounding volumes of this object's container:
- RenderObjClass *container = Get_Container();
- if (container) container->Update_Obj_Space_Bounding_Volumes();
-}
-
-
-void Line3DClass::Get_Obj_Space_Bounding_Sphere(SphereClass & sphere) const
-{
- float half_l = Length * 0.5f;
- sphere.Center.Set(half_l, 0.0f, 0.0f);
- sphere.Radius = half_l;
-}
-
-
-void Line3DClass::Get_Obj_Space_Bounding_Box(AABoxClass & box) const
-{
- float half_l = Length * 0.5f;
- box.Center.Set(half_l, 0.0f, 0.0f);
- box.Extent.Set(half_l, 0.0f, 0.0f);
-}
-
-/**************************************************************************
- * Line3DClass::Reset -- Reset line start and end points. *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 01/19/1998 NH : Created. *
- * 04/21/1998 NH : Ported to SR 1.3. *
- *========================================================================*/
-void Line3DClass::Reset(const Vector3 & new_start, const Vector3 & new_end)
-{
- // Adjust length of line:
- float new_length = (new_end - new_start).Length();
- if (new_length == 0) {
- new_length = 0.001f; // make sure we don't have a zero length BMG
- }
- Scale((new_length / Length), 1.0f, 1.0f);
- Length = new_length;
-
- // Adjust transform of line:
- Matrix3D transform(true);
- transform.Obj_Look_At(new_start, new_end, 0.0);
- Set_Transform(transform);
-
- Invalidate_Cached_Bounding_Volumes();
-
- // Now update the object space bounding volumes of this object's container:
- RenderObjClass *container = Get_Container();
- if (container) container->Update_Obj_Space_Bounding_Volumes();
-}
-
-
-/**************************************************************************
- * Line3DClass::Reset -- Reset line start and end points, and line width. *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 01/19/1998 NH : Created. *
- * 04/21/1998 NH : Ported to SR 1.3. *
- *========================================================================*/
-void Line3DClass::Reset(const Vector3 & new_start, const Vector3 & new_end, float new_width)
-{
- // Adjust length and width of line:
- float new_length = (new_end - new_start).Length();
- if (new_length == 0) {
- new_length = 0.001f; // make sure we don't have a zero length BMG
- }
- float width_scale = new_width / Width;
- Scale((new_length / Length), width_scale, width_scale);
- Length = new_length;
- Width = new_width;
-
- // Adjust transform of line:
- Matrix3D transform(true);
- transform.Obj_Look_At(new_start, new_end, 0.0);
- Set_Transform(transform);
- Matrix3D inv;
- transform.Get_Orthogonal_Inverse(inv);
-#ifdef ALLOW_TEMPORARIES
-// Vector3 test = inv * Vector3(new_end);
-#else
-// Vector3 test;
-// inv.mulVector3(new_end, test);
-#endif
-
- Invalidate_Cached_Bounding_Volumes();
-
- // Now update the object space bounding volumes of this object's container:
- RenderObjClass *container = Get_Container();
- if (container) container->Update_Obj_Space_Bounding_Volumes();
-}
-
-
-/**************************************************************************
- * Re_Color -- Reset the line color. *
- * *
- * INPUT: float r, g, b - components of the new color. *
- * *
- * OUTPUT: none. *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 01/26/1998 NH : Created. *
- * 04/21/1998 NH : Ported to SR 1.3. *
- *========================================================================*/
-void Line3DClass::Re_Color(float r, float g, float b)
-{
- Color=Vector4(r,g,b,Color.W);
-}
-
-
-/**************************************************************************
- * Set_Opacity -- Reset the line opacity. *
- * *
- * INPUT: float opacity - new opacity. *
- * *
- * OUTPUT: none. *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 11/03/1998 NH : Created. *
- *========================================================================*/
-void Line3DClass::Set_Opacity(float opacity)
-{
- if (opacity < 1.0f)
- { Shader=ShaderClass::_PresetAlphaSolidShader;
- Set_Sort_Level(1);
- }
- else
- { Shader=ShaderClass::_PresetOpaqueSolidShader;
- Set_Sort_Level(SORT_LEVEL_NONE);
- }
- Color.W=opacity;
-}
-
-/*
-**
-*/
-int Line3DClass::Get_Num_Polys(void) const
-{
- return 12;
-}
-
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/line3d.h b/Generals/Code/Libraries/Source/WWVegas/WW3D2/line3d.h
deleted file mode 100644
index 8d601e8f6b0..00000000000
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/line3d.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
-** 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 .
-*/
-
-/***************************************************************************
- *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
- ***************************************************************************
- * *
- * Project Name : G *
- * *
- * $Archive:: /Commando/Code/ww3d2/line3d.h $*
- * *
- * $Author:: Hector_y $*
- * *
- * $Modtime:: 2/16/01 3:52p $*
- * *
- * $Revision:: 2 $*
- * *
- *-------------------------------------------------------------------------*
- * Functions: *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-#if defined(_MSC_VER)
-#pragma once
-#endif
-
-#ifndef LINE3D_H
-#define LINE3D_H
-
-#include "always.h"
-#include "rendobj.h"
-#include "vector3.h"
-#include "vector4.h"
-#include "shader.h"
-
-class VertexMaterialClass;
-class RenderInfoClass;
-
-/*
-** Line3DClass -- Render3DObject for rendering 3D line segments.
-** These are conceptually cylinders with a given width - some approximation
-** of this will be rendered. (The current approximation assumes that
-** Line3DCLass objects are unlit, therefore only the sihouette needs to be
-** approximated).
-*/
-class Line3DClass : public W3DMPO, public RenderObjClass
-{
- W3DMPO_GLUE(Line3DClass)
-
- public:
-
- Line3DClass (const Vector3 & start, const Vector3 & end, float width,
- float r, float g, float b, float opacity = 1.0f);
- Line3DClass(const Line3DClass & src);
- Line3DClass & operator = (const Line3DClass & that);
- virtual ~Line3DClass(void);
- virtual RenderObjClass * Clone(void) const;
-
- // class id of this render object
- virtual int Class_ID(void) const { return CLASSID_LINE3D; }
-
- virtual void Render(RenderInfoClass & rfinfo);
-
- // scale the 3D line symmetrically about its center.
- virtual void Scale(float scale);
- virtual void Scale(float scalex, float scaley, float scalez);
-
- // returns the number of polygons in the render object
- virtual int Get_Num_Polys(void) const;
-
- // Get the object space bounding volumes
- virtual void Get_Obj_Space_Bounding_Sphere(SphereClass & sphere) const;
- virtual void Get_Obj_Space_Bounding_Box(AABoxClass & box) const;
-
- // The following functions are unique to Line3DClass:
-
- // Reset the line start and end points
- void Reset(const Vector3 & new_start, const Vector3 & new_end);
-
- // Reset line start and end points, and the line width
- void Reset(const Vector3 & new_start, const Vector3 & new_end, float new_width);
-
- // Reset the line color
- void Re_Color(float r, float g, float b);
-
- // Reset the line opacity
- void Set_Opacity(float opacity);
-
- // For non-opaque lines, allow them to render last.
- void Set_Sort_Level(int level) { SortLevel = level; }
- int Get_Sort_Level(void) const { return SortLevel; }
-
- protected:
-
- // This is kept to facilitate changing the line endpoints.
- float Length;
-
- // This is kept to facilitate changing the line width.
- float Width;
-
- // shader
- ShaderClass Shader;
- // vertices
- Vector3 vert[8];
- // color
- Vector4 Color;
- char SortLevel;
-};
-
-#endif
\ No newline at end of file
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/matinfo.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/matinfo.cpp
deleted file mode 100644
index dc491266418..00000000000
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/matinfo.cpp
+++ /dev/null
@@ -1,429 +0,0 @@
-/*
-** 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 .
-*/
-
-/***********************************************************************************************
- *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
- ***********************************************************************************************
- * *
- * Project Name : MatInfo.h *
- * *
- * $Archive:: /Commando/Code/ww3d2/matinfo.cpp $*
- * *
- * Author:: Greg Hjelstrom *
- * *
- * $Modtime:: 6/15/01 5:50p $*
- * *
- * $Revision:: 10 $*
- * *
- *---------------------------------------------------------------------------------------------*
- * Functions: *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-
-#include "matinfo.h"
-#include "wwdebug.h"
-#include "meshmdl.h"
-#include "texture.h"
-
-MaterialInfoClass::MaterialInfoClass(void)
-{
-}
-
-MaterialInfoClass::MaterialInfoClass(const MaterialInfoClass & src)
-{
- for (int mi=0; miClone();
- VertexMaterials.Add(vmat);
- }
-
- for (int ti=0; tiAdd_Ref();
- Textures.Add(tex);
- }
-}
-
-
-MaterialInfoClass::~MaterialInfoClass(void)
-{
- Free();
-}
-
-
-MaterialInfoClass * MaterialInfoClass::Clone(void) const
-{
- return W3DNEW MaterialInfoClass(*this);
-}
-
-int MaterialInfoClass::Add_Texture(TextureClass * tex)
-{
- WWASSERT(tex != NULL);
- tex->Add_Ref();
- int index = Textures.Count();
- Textures.Add(tex);
- return index;
-}
-
-int MaterialInfoClass::Get_Texture_Index(const char * name)
-{
- for (int i=0; iGet_Texture_Name()) == 0) {
- return i;
- }
- }
- return -1;
-}
-
-TextureClass * MaterialInfoClass::Get_Texture(int index)
-{
- WWASSERT(index >= 0);
- WWASSERT(index < Textures.Count());
- Textures[index]->Add_Ref();
- return Textures[index];
-}
-
-/*
-
-void MaterialInfoClass::Set_Texture_Reduction_Factor(float trf)
-{
- for (int i = 0; i < Textures.Count(); i++) {
- Textures[i]->Set_Reduction_Factor(trf);
- }
-}
-
-
-void MaterialInfoClass::Process_Texture_Reduction(void)
-{
- for (int i = 0; i < Textures.Count(); i++) {
- Textures[i]->Process_Reduction();
- }
-}
-*/
-void MaterialInfoClass::Free(void)
-{
- int i;
-
- for (i=0; iTexture_Count() == dest->Texture_Count());
- WWASSERT(src->Vertex_Material_Count() == dest->Vertex_Material_Count());
-
- SrcMatInfo = src;
- SrcMatInfo->Add_Ref();
- DestMatInfo = dest;
- DestMatInfo->Add_Ref();
-
- if (src->Vertex_Material_Count() > 0) {
- VertexMaterialCount = src->Vertex_Material_Count();
- VertexMaterialRemaps = W3DNEWARRAY VmatRemapStruct[VertexMaterialCount];
- for (int i=0; iVertex_Material_Count(); i++) {
- VertexMaterialRemaps[i].Src = src->Peek_Vertex_Material(i);
- VertexMaterialRemaps[i].Dest = dest->Peek_Vertex_Material(i);
- }
- }
-
- if (src->Texture_Count() > 0) {
- TextureCount = src->Texture_Count();
- TextureRemaps = W3DNEWARRAY TextureRemapStruct[TextureCount];
- for (int i=0; iTexture_Count(); i++) {
- TextureRemaps[i].Src = src->Peek_Texture(i);
- TextureRemaps[i].Dest = dest->Peek_Texture(i);
- }
- }
-}
-
-MaterialRemapperClass::~MaterialRemapperClass(void)
-{
- SrcMatInfo->Release_Ref();
- DestMatInfo->Release_Ref();
-
- if (TextureRemaps) {
- delete[] TextureRemaps;
- }
- if (VertexMaterialRemaps) {
- delete[] VertexMaterialRemaps;
- }
-}
-
-TextureClass * MaterialRemapperClass::Remap_Texture(TextureClass * src)
-{
- if (src == NULL) return src;
- if (src == LastSrcTex) return LastDestTex;
- for (int i=0; iVertex_Material_Count() >= 1) {
-
- for (int pass = 0;pass < srcmeshmatdesc->Get_Pass_Count(); pass++) {
-
- if (srcmeshmatdesc->Has_Material_Array(pass)) {
-
- for (int vert_index = 0; vert_index < srcmeshmatdesc->Get_Vertex_Count(); vert_index++) {
- VertexMaterialClass * src = srcmeshmatdesc->Peek_Material(vert_index, pass);
- destmeshmatdesc->Set_Material(vert_index, Remap_Vertex_Material(src),pass);
- }
-
- } else {
-
- VertexMaterialClass * src = srcmeshmatdesc->Peek_Single_Material(pass);
- destmeshmatdesc->Set_Single_Material(Remap_Vertex_Material(src), pass);
-
- }
- }
- }
-
- /*
- ** Remap the textures if there is at least one of them
- */
- if (SrcMatInfo->Texture_Count() >= 1) {
-
- for (int pass = 0;pass < srcmeshmatdesc->Get_Pass_Count(); pass++) {
-
- for (int stage = 0; stage < MeshMatDescClass::MAX_TEX_STAGES; stage++) {
-
- if (srcmeshmatdesc->Has_Texture_Array(pass, stage)) {
-
- for (int poly_index = 0; poly_index < srcmeshmatdesc->Get_Polygon_Count(); poly_index++) {
- TextureClass * src = srcmeshmatdesc->Peek_Texture(poly_index, pass, stage);
- destmeshmatdesc->Set_Texture(poly_index, Remap_Texture(src), pass, stage);
- }
-
- } else {
-
- TextureClass * src = srcmeshmatdesc->Peek_Single_Texture(pass, stage);
- destmeshmatdesc->Set_Single_Texture(Remap_Texture(src), pass, stage);
-
- }
- }
- }
- }
-}
-
-MaterialCollectorClass::MaterialCollectorClass(void)
-{
- LastShader = ShaderClass(0xFFFFFFFF);
- LastMaterial = NULL;
- LastTexture = NULL;
-}
-
-MaterialCollectorClass::~MaterialCollectorClass(void)
-{
- Reset();
-}
-
-void MaterialCollectorClass::Collect_Materials(MeshModelClass * mesh)
-{
- for (int pass = 0;pass < mesh->Get_Pass_Count(); pass++) {
-
- // Vertex materials (either single or per vertex)
- if (mesh->Has_Material_Array(pass)) {
-
- for (int vert_index = 0;vert_index < mesh->Get_Vertex_Count(); vert_index++) {
- VertexMaterialClass * mat = mesh->Peek_Material(vert_index,pass);
- Add_Vertex_Material(mat);
- }
-
- } else {
- VertexMaterialClass * mat = mesh->Get_Single_Material(pass);
- Add_Vertex_Material(mat);
- REF_PTR_RELEASE(mat);
- }
-
-
- // Shaders (single or per poly...)
- if (mesh->Has_Shader_Array(pass)) {
- for (int poly_index=0; poly_index < mesh->Get_Polygon_Count(); poly_index++) {
- Add_Shader(mesh->Get_Shader(poly_index,pass));
- }
- } else {
- ShaderClass sh = mesh->Get_Single_Shader(pass);
- Add_Shader(sh);
- }
-
-
- // Textures per pass, per stage (either array or single...)
- for (int stage = 0; stage < MeshMatDescClass::MAX_TEX_STAGES; stage++) {
-
- if (mesh->Has_Texture_Array(pass,stage)) {
-
- for (int poly_index = 0;poly_index < mesh->Get_Polygon_Count(); poly_index++) {
- TextureClass * tex = mesh->Peek_Texture(poly_index,pass,stage);
- Add_Texture(tex);
- }
-
- } else {
-
- TextureClass * tex = mesh->Peek_Single_Texture(pass,stage);
- Add_Texture(tex);
-
- }
- }
- }
-}
-
-void MaterialCollectorClass::Reset(void)
-{
- for (int ti=0; tiAdd_Ref();
- LastTexture = tex;
-}
-
-void MaterialCollectorClass::Add_Shader(ShaderClass shader)
-{
- if (shader == LastShader) return;
- if (Find_Shader(shader) != -1) return;
- Shaders.Add(shader);
- LastShader = shader;
-}
-
-void MaterialCollectorClass::Add_Vertex_Material(VertexMaterialClass * vmat)
-{
- if (vmat == NULL) return;
- if (vmat == LastMaterial) return;
- if (Find_Vertex_Material(vmat) != -1) return;
- VertexMaterials.Add(vmat);
- vmat->Add_Ref();
- LastMaterial = vmat;
-}
-
-int MaterialCollectorClass::Get_Shader_Count(void)
-{
- return Shaders.Count();
-}
-
-int MaterialCollectorClass::Get_Vertex_Material_Count(void)
-{
- return VertexMaterials.Count();
-}
-
-int MaterialCollectorClass::Get_Texture_Count(void)
-{
- return Textures.Count();
-}
-
-ShaderClass MaterialCollectorClass::Peek_Shader(int i)
-{
- return Shaders[i];
-}
-
-TextureClass * MaterialCollectorClass::Peek_Texture(int i)
-{
- return Textures[i];
-}
-
-VertexMaterialClass * MaterialCollectorClass::Peek_Vertex_Material(int i)
-{
- return VertexMaterials[i];
-}
-
-int MaterialCollectorClass::Find_Shader(const ShaderClass & shader)
-{
- for (int si=0; si.
-*/
-
-/***********************************************************************************************
- *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
- ***********************************************************************************************
- * *
- * Project Name : WW3D *
- * *
- * $Archive:: /VSS_Sync/ww3d2/matinfo.h $*
- * *
- * Author:: Greg Hjelstrom *
- * *
- * $Modtime:: 8/29/01 7:29p $*
- * *
- * $Revision:: 11 $*
- * *
- *---------------------------------------------------------------------------------------------*
- * Functions: *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-
-#if defined(_MSC_VER)
-#pragma once
-#endif
-
-#ifndef MATINFO_H
-#define MATINFO_H
-
-#include "always.h"
-#include "wwdebug.h"
-#include "Vector.H"
-#include "vertmaterial.h"
-#include "texture.h"
-#include "shader.h"
-#ifdef _UNIX
-#include "osdep.h"
-#endif
-
-class MeshModelClass;
-class MeshMatDescClass;
-
-/***********************************************************************************************
-** MaterialInfoClass
-**
-** This class gives an interface to the "changeable" material parameters inside a
-** W3D render object. Typically, this will include things like the following:
-** - one or more textures,
-** - the vertex material used by the mesh (defines lighting properties, etc)
-**
-** Another purpose of this class is to actually hold onto a ref for each material
-** object that a mesh uses. The "per-triangle" pointer arrays are not ref counted
-** so the material info serves as a place to hold a reference to each material object
-** that the mesh is using.
-**
-***********************************************************************************************/
-class MaterialInfoClass : public W3DMPO, public RefCountClass
-{
- W3DMPO_GLUE(MaterialInfoClass)
-public:
-
- MaterialInfoClass();
- MaterialInfoClass(const MaterialInfoClass & src);
- ~MaterialInfoClass();
- MaterialInfoClass * Clone(void) const;
-
- void Reset(void) { Free(); }
- int Vertex_Material_Count(void) const { return VertexMaterials.Count(); }
- int Texture_Count(void) const { return Textures.Count(); }
-
- int Add_Vertex_Material(VertexMaterialClass * vmat);
- int Add_Texture(TextureClass * tex);
-
- int Get_Vertex_Material_Index(const char * name);
- int Get_Texture_Index(const char * name);
-
- VertexMaterialClass * Get_Vertex_Material(int index);
- VertexMaterialClass * Get_Vertex_Material(const char * name);
- VertexMaterialClass * Peek_Vertex_Material(int index);
- VertexMaterialClass * Peek_Vertex_Material(const char * name);
- void Replace_Material(int index, VertexMaterialClass *newMaterial);
- void Reset_Texture_Mappers(void);
- void Make_Vertex_Materials_Unique(void);
- bool Has_Time_Variant_Texture_Mappers(void);
-
- TextureClass * Get_Texture(int index);
- TextureClass * Get_Texture(const char * name);
- TextureClass * Peek_Texture(int index);
- TextureClass * Peek_Texture(const char * name);
- void Replace_Texture(int index, TextureClass *newTexture);
-
-// void Set_Texture_Reduction_Factor(float trf);
-// void Process_Texture_Reduction(void);
-
-private:
-
- void Free(void);
-
- DynamicVectorClass VertexMaterials;
- DynamicVectorClass Textures;
-
-};
-
-
-
-/***********************************************************************************************
-** MaterialRemapperClass
-** This class is used when we need to "remap" all of the material pointers in a mesh
-** to a new set of cloned materials. Basically, it assumes that you are going to initialize
-** it with two identical material info objects (src and dest) and then you can give it pointers
-** to materials in the "src" material info and it will give you back pointers to materials
-** in the "dest" material info class.
-**
-** This class attempts to take advantage of the fact that meshes should normally be sorted
-** with respect to their materials so we shouldn't really be doing a linear search for
-** each remap...
-**
-** Please Note: this class does not hold references to the materials and is meant only to
-** be used in a temporary fashion. Create it, do your conversion, then delete it :-)
-***********************************************************************************************/
-class MaterialRemapperClass
-{
-public:
- MaterialRemapperClass(MaterialInfoClass * src,MaterialInfoClass * dest);
- ~MaterialRemapperClass(void);
-
- TextureClass * Remap_Texture(TextureClass * src);
- VertexMaterialClass * Remap_Vertex_Material(VertexMaterialClass * src);
- void Remap_Mesh(const MeshMatDescClass * srcmeshmatdesc, MeshMatDescClass * destmeshmatdesc);
-
-private:
-
- struct VmatRemapStruct
- {
- VertexMaterialClass * Src;
- VertexMaterialClass * Dest;
- };
-
- struct TextureRemapStruct
- {
- TextureClass * Src;
- TextureClass * Dest;
- };
-
- MaterialInfoClass * SrcMatInfo;
- MaterialInfoClass * DestMatInfo;
-
- int TextureCount;
- TextureRemapStruct * TextureRemaps;
- int VertexMaterialCount;
- VmatRemapStruct * VertexMaterialRemaps;
-
- VertexMaterialClass * LastSrcVmat;
- VertexMaterialClass * LastDestVmat;
- TextureClass * LastSrcTex;
- TextureClass * LastDestTex;
-};
-
-/***********************************************************************************************
-** MaterialCollectorClass
-**
-** This class can be used to collect all of the unique instances of materials from a mesh.
-** Its original motivation is to solve a problem encountered in trying to save a mesh
-** to disk. There are arrays of pointers to vertex materials in the mesh but no record of
-** the set of unique vertex materials (all pointers could point to the same one...) Similar
-** to the remapper, it tries to take advantage of the fact that the materials and textures
-** should be in sorted order to optimize the lookups...
-**
-** NOTE: pointer comparisons are used to determine if the objects are unique. I don't
-** check whether the contents of the objects are identical. (Exporter does this, I assume
-** that if there are two separate objects, they are that way for a reason here.)
-***********************************************************************************************/
-class MaterialCollectorClass
-{
-public:
-
- MaterialCollectorClass(void);
- ~MaterialCollectorClass(void);
-
- void Reset(void);
- void Collect_Materials(MeshModelClass * mesh);
- void Add_Texture(TextureClass * tex);
- void Add_Shader(ShaderClass shader);
- void Add_Vertex_Material(VertexMaterialClass * vmat);
-
- int Get_Shader_Count(void);
- int Get_Vertex_Material_Count(void);
- int Get_Texture_Count(void);
-
- ShaderClass Peek_Shader(int i);
- TextureClass * Peek_Texture(int i);
- VertexMaterialClass * Peek_Vertex_Material(int i);
-
- int Find_Shader(const ShaderClass & shader);
- int Find_Texture(TextureClass * tex);
- int Find_Vertex_Material(VertexMaterialClass * mat);
-
-protected:
-
- DynamicVectorClass Shaders;
- DynamicVectorClass VertexMaterials;
- DynamicVectorClass Textures;
-
- ShaderClass LastShader;
- VertexMaterialClass * LastMaterial;
- TextureClass * LastTexture;
-};
-
-
-
-inline int MaterialInfoClass::Add_Vertex_Material(VertexMaterialClass * vmat)
-{
- if (vmat != NULL) {
- vmat->Add_Ref();
- }
- int index = VertexMaterials.Count();
- VertexMaterials.Add(vmat);
- return index;
-}
-
-inline int MaterialInfoClass::Get_Vertex_Material_Index(const char * name)
-{
- for (int i=0; iGet_Name()) == 0) {
- return i;
- }
- }
- return -1;
-}
-
-inline VertexMaterialClass * MaterialInfoClass::Get_Vertex_Material(int index)
-{
- WWASSERT(index >= 0);
- WWASSERT(index < VertexMaterials.Count());
- if (VertexMaterials[index]) {
- VertexMaterials[index]->Add_Ref();
- }
- return VertexMaterials[index];
-}
-
-inline VertexMaterialClass * MaterialInfoClass::Get_Vertex_Material(const char * name)
-{
- int index = Get_Vertex_Material_Index(name);
- if (index == -1) {
- return NULL;
- } else {
- return Get_Vertex_Material(index);
- }
-}
-
-inline VertexMaterialClass * MaterialInfoClass::Peek_Vertex_Material(int index)
-{
- WWASSERT(index >= 0);
- WWASSERT(index < VertexMaterials.Count());
- return VertexMaterials[index];
-}
-
-inline VertexMaterialClass * MaterialInfoClass::Peek_Vertex_Material(const char * name)
-{
- int index = Get_Vertex_Material_Index(name);
- if (index == -1) {
- return NULL;
- } else {
- return Peek_Vertex_Material(index);
- }
-}
-
-inline void MaterialInfoClass::Replace_Material(int index, VertexMaterialClass *newMaterial)
-{
- REF_PTR_SET(VertexMaterials[index],newMaterial);
-}
-
-inline void MaterialInfoClass::Reset_Texture_Mappers(void)
-{
- int vmat_count = VertexMaterials.Count();
- for (int i = 0; i < vmat_count; i++) {
- VertexMaterials[i]->Reset_Mappers();
- }
-}
-
-inline bool MaterialInfoClass::Has_Time_Variant_Texture_Mappers(void)
-{
- int vmat_count = VertexMaterials.Count();
- for (int i = 0; i < vmat_count; i++) {
- if (VertexMaterials[i]->Are_Mappers_Time_Variant()) return true;
- }
- return false;
-}
-
-inline void MaterialInfoClass::Make_Vertex_Materials_Unique(void)
-{
- int vmat_count = VertexMaterials.Count();
- for (int i = 0; i < vmat_count; i++) {
- VertexMaterials[i]->Make_Unique();
- }
-}
-
-inline TextureClass * MaterialInfoClass::Get_Texture(const char * name)
-{
- int index = Get_Texture_Index(name);
- if (index == -1) {
- return NULL;
- } else {
- return Get_Texture(index);
- }
-}
-
-inline TextureClass * MaterialInfoClass::Peek_Texture(int index)
-{
- WWASSERT(index >= 0);
- WWASSERT(index < Textures.Count());
- return Textures[index];
-}
-
-inline void MaterialInfoClass::Replace_Texture(int index, TextureClass *newTexture)
-{
- REF_PTR_SET(Textures[index],newTexture);
-}
-
-#endif // MATINFO_H
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/meshdam.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/meshdam.cpp
deleted file mode 100644
index acbb3e091cb..00000000000
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/meshdam.cpp
+++ /dev/null
@@ -1,266 +0,0 @@
-/*
-** 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 .
-*/
-
-/***********************************************************************************************
- *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
- ***********************************************************************************************
- * *
- * Project Name : WW3D *
- * *
- * $Archive:: /Commando/Code/ww3d2/meshdam.cpp $*
- * *
- * Author:: Greg_h *
- * *
- * $Modtime:: 1/08/01 10:04a $*
- * *
- * $Revision:: 1 $*
- * *
- *---------------------------------------------------------------------------------------------*
- * Functions: *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-
-#if 0
-
-
-#include "meshdam.h"
-#include "w3d_file.h"
-#include "w3derr.h"
-#include "chunkio.h"
-//#include
-
-
-/***********************************************************************************************
- * DamageClass::DamageClass -- constructor *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 10/28/1997 GH : Created. *
- *=============================================================================================*/
-DamageClass::DamageClass(void):
- DamageIndex(0),
- NumMaterials(0),
- NumVerts(0),
- NumColors(0),
- Verts(NULL),
- Colors(NULL)
-{
-}
-
-
-/***********************************************************************************************
- * DamageClass::~DamageClass -- destructor *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 10/28/1997 GH : Created. *
- *=============================================================================================*/
-DamageClass::~DamageClass(void)
-{
- if (Verts != NULL) {
- delete [] Verts;
- Verts = NULL;
- }
-
- if (Colors != NULL) {
- delete[] Colors;
- Colors = NULL;
- }
-}
-
-/***********************************************************************************************
- * DamageClass::Load -- load damage data from a W3D file *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 10/28/1997 GH : Created. *
- *=============================================================================================*/
-WW3DErrorType DamageClass::Load(ChunkLoadClass & cload,MeshModelClass * basemesh)
-{
-#if 0
- /*
- ** Open the first chunk, it should be the damage header
- */
- cload.Open_Chunk();
-
- if (cload.Cur_Chunk_ID() != W3D_CHUNK_DAMAGE_HEADER) {
- return WW3D_ERROR_LOAD_FAILED;
- }
-
- W3dMeshDamageStruct header;
- if (cload.Read(&header,sizeof(W3dMeshDamageStruct)) != sizeof(W3dMeshDamageStruct)) {
- return WW3D_ERROR_LOAD_FAILED;
- }
-
- cload.Close_Chunk();
-
- /*
- ** allocate the arrays based on the info in the header
- */
- NumVerts = header.NumDamageVerts;
- if (NumVerts > 0) {
- Verts = W3DNEWARRAY DamageVertexStruct[NumVerts];
- }
-
- NumColors = header.NumDamageColors;
- if (NumColors > 0) {
- Colors = W3DNEWARRAY DamageColorStruct[NumColors];
- }
-
- // TODO: allocate materials
-
- /*
- ** Now read in the rest of the chunks
- */
- while (1) {
-
- /*
- ** Read in the chunk header
- ** If there are no more chunks within the chunk, we are done.
- */
- if (!cload.Open_Chunk()) {
- return WW3D_ERROR_OK;
- }
-
- /*
- ** Process the chunk
- */
- int error = WW3D_ERROR_OK;
-
- switch (cload.Cur_Chunk_ID()) {
-
-// case W3D_CHUNK_DAMAGE_MATERIALS:
-// //TODO: read new set of materials
-// break;
-
- case W3D_CHUNK_DAMAGE_VERTICES:
- error = read_vertices(cload,basemesh);
- break;
-
- case W3D_CHUNK_DAMAGE_COLORS:
- error = read_colors(cload,basemesh);
- break;
-
- default:
- break;
-
- }
-
- cload.Close_Chunk();
-
- if (error != WW3D_ERROR_OK) {
- return error;
- }
- }
-#endif
-
- return WW3D_ERROR_OK;
-}
-
-/***********************************************************************************************
- * DamageClass::read_vertices -- read damage vertices from a W3D file *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 11/04/1997 GH : Created. *
- *=============================================================================================*/
-WW3DErrorType DamageClass::read_vertices(ChunkLoadClass & cload,MeshModelClass * basemesh)
-{
-#if 0
- W3dMeshDamageVertexStruct dv;
-
- for (int i=0; igetVertexLoc();
-
- srVector3 sr_v;
- sr_v = vert_array[dv.VertexIndex];
-
- Verts[i].VertexIdx = dv.VertexIndex;
- Verts[i].Vertex0.Set(sr_v[0],sr_v[1],sr_v[2]);
- Verts[i].Vertex1.Set(dv.NewVertex.X,dv.NewVertex.Y,dv.NewVertex.Z);
- }
-#endif
- return WW3D_ERROR_OK;
-}
-
-/***********************************************************************************************
- * DamageClass::read_colors -- read damage colors from a w3d file *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 11/04/1997 GH : Created. *
- *=============================================================================================*/
-WW3DErrorType DamageClass::read_colors(ChunkLoadClass & cload,MeshModelClass * basemesh)
-{
-#if 0
- W3dMeshDamageColorStruct dc;
-
- for (int i=0; i.
-*/
-
-/***********************************************************************************************
- *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
- ***********************************************************************************************
- * *
- * Project Name : WW3D *
- * *
- * $Archive:: /Commando/Code/ww3d2/meshdam.h $*
- * *
- * $Author:: Greg_h $*
- * *
- * $Modtime:: 1/08/01 10:04a $*
- * *
- * $Revision:: 1 $*
- * *
- *---------------------------------------------------------------------------------------------*
- * Functions: *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-#if 0
-
-#if defined(_MSC_VER)
-#pragma once
-#endif
-
-#ifndef MESHDAM_H
-#define MESHDAM_H
-
-#include "always.h"
-#include "vector3.h"
-#include "bittype.h"
-#include "w3derr.h"
-
-class MeshModelClass;
-class ChunkLoadClass;
-
-struct RGBStruct
-{
- uint8 R,G,B;
-};
-
-struct DamageVertexStruct
-{
- int VertexIdx; // index of the vertex to "damage"
- Vector3 Vertex0; // original vertex position
- Vector3 Vertex1; // damaged vertex position
-};
-
-struct DamageColorStruct
-{
- int VertexIdx; // index of the vertex to damage.
- RGBStruct Color0; // original color.
- RGBStruct Color1; // damaged color.
-};
-
-
-/*
-** DamageClass - this class encapsulates the information needed
-** to apply damage to meshes. It contains replacement vertices,
-** vertex colors and materials
-*/
-class DamageClass
-{
-public:
-
- DamageClass(void);
- ~DamageClass(void);
-
- WW3DErrorType Load_W3D(ChunkLoadClass & cload,MeshModelClass * basemesh);
-
-protected:
-
- WW3DErrorType read_vertices(ChunkLoadClass & cload,MeshModelClass * basemesh);
- WW3DErrorType read_colors(ChunkLoadClass & cload,MeshModelClass * basemesh);
-
- int DamageIndex;
- int NumMaterials;
- int NumVerts;
- int NumColors;
-
- DamageVertexStruct * Verts;
- DamageColorStruct * Colors;
-
- friend class MeshClass;
-};
-
-
-#endif
-
-
-#endif //0
\ No newline at end of file
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/metalmap.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/metalmap.cpp
deleted file mode 100644
index a5a034fd991..00000000000
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/metalmap.cpp
+++ /dev/null
@@ -1,423 +0,0 @@
-/*
-** 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 .
-*/
-
-/***********************************************************************************************
- *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
- ***********************************************************************************************
- * *
- * Project Name : G *
- * *
- * $Archive:: /Commando/Code/ww3d2/metalmap.cpp $*
- * *
- * $Author:: Hector_y $*
- * *
- * $Modtime:: 6/27/01 4:59p $*
- * *
- * $Revision:: 3 $*
- * *
- *---------------------------------------------------------------------------------------------*
- * Functions: *
- * MMMC::MetalMapManagerClass -- Create metal map manager according to given metal parameters*
- * MMMC::MetalMapManagerClass -- Create metal map manager from INI *
- * MMMC::~MetalMapManagerClass -- MetalMapManagerClass destructor *
- * MMMC::Get_Metal_Map -- Get the texture for a metal map by id number *
- * MMMC::Metal_Map_Count -- Get the number of metal maps in the manager *
- * MMMC::Update_Lighting -- Update the lighting parameters used for generating the maps *
- * MMMC::Update_Textures -- Update metal map textures (call once/frame before rendering) *
- * MMMC::initialize_normal_table -- Utility function to initialize the normal table *
- * MMMC::initialize_metal_params -- Utility function (shared CTor code) *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-#include "metalmap.h"
-#include "texture.h"
-#include "ww3dformat.h"
-#include "ww3d.h"
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-/*
-** Class static members:
-*/
-Vector3 * MetalMapManagerClass::_NormalTable = 0;
-
-/***********************************************************************************************
- * MMMC::MetalMapManagerClass -- Create metal map manager from INI *
- * *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 11/23/1999 NH : Created. *
- *=============================================================================================*/
-MetalMapManagerClass::MetalMapManagerClass(INIClass &ini) :
- MapCount(0),
- Textures(0),
- MetalParameters(0),
- CurrentAmbient(0.0f, 0.0f, 0.0f),
- CurrentMainLightColor(0.0f, 0.0f, 0.0f),
- CurrentMainLightDir(1.0f, 0.0f, 0.0f),
- CurrentCameraDir(1.0f,0.0f,0.0f),
- Use16Bit(false)
-{
-
- // If the static normal table has not been initialized yet, initialize it
- if (!_NormalTable) {
- initialize_normal_table();
- }
-
- // Determine how many metals are in this file
- char section[255];
-
- int lp = 0;
- for (; ; lp++) {
- sprintf(section, "Metal%02d", lp);
- if (!ini.Find_Section(section)) {
- break; // NAK - Mar 8, 2000: changed to a break to fix off by one error in lp
- }
- }
-
- if (lp > 0) {
- // Create metal params structs and fill from INI:
- MetalParams *metal_params = W3DNEWARRAY MetalParams[lp];
- TPoint3D white_tpoint(255.0f, 255.0f, 255.0f);
- Vector3 white(1.0f, 1.0f, 1.0f);
- Vector3 black(0.0f, 0.0f, 0.0f);
- for (int i = 0; i < lp; i++) {
- sprintf(section, "Metal%02d", i);
- static const float cf = 0.003921568627451f; // 1 / 255
- TPoint3D color;
- color = ini.Get_Point(section, "AmbientColor", white_tpoint);
- metal_params[i].AmbientColor.Set(color.X * cf, color.Y * cf, color.Z * cf);
- metal_params[i].AmbientColor.Update_Min(white);
- metal_params[i].AmbientColor.Update_Max(black);
- color = ini.Get_Point(section, "DiffuseColor", white_tpoint);
- metal_params[i].DiffuseColor.Set(color.X * cf, color.Y * cf, color.Z * cf);
- metal_params[i].AmbientColor.Update_Min(white);
- metal_params[i].AmbientColor.Update_Max(black);
- color = ini.Get_Point(section, "SpecularColor", white_tpoint);
- metal_params[i].SpecularColor.Set(color.X * cf, color.Y * cf, color.Z * cf);
- metal_params[i].AmbientColor.Update_Min(white);
- metal_params[i].AmbientColor.Update_Max(black);
- float shininess = ini.Get_Float(section, "Shininess", 0.0f);
- metal_params[i].Shininess = WWMath::Clamp(shininess, 0.0f, 127.0f);
- }
-
- initialize_metal_params(lp, metal_params);
- delete [] metal_params;
- } else {
- assert(0);
- }
-
- int w,h,bits;
- bool windowed;
-
- WW3D::Get_Device_Resolution(w,h,bits,windowed);
- Use16Bit=(bits<=16);
-
- WW3DFormat format=(Use16Bit?WW3D_FORMAT_A4R4G4B4:WW3D_FORMAT_A8R8G8B8);
-
-
- for (int i = 0; i < lp; i++) {
- Textures[i]=NEW_REF(TextureClass,(METALMAP_SIZE,METALMAP_SIZE,format,MIP_LEVELS_1));
- Textures[i]->Get_Filter().Set_U_Addr_Mode(TextureFilterClass::TEXTURE_ADDRESS_CLAMP);
- Textures[i]->Get_Filter().Set_V_Addr_Mode(TextureFilterClass::TEXTURE_ADDRESS_CLAMP);
- StringClass tex_name;
- tex_name.Format("!m%02d.tga", i);
- Textures[i]->Set_Texture_Name(tex_name);
- }
-}
-
-
-/***********************************************************************************************
- * MMMC::~MetalMapManagerClass -- MetalMapManagerClass destructor *
- * *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 11/19/1999 NH : Created. *
- *=============================================================================================*/
-MetalMapManagerClass::~MetalMapManagerClass(void)
-{
- if (Textures) {
- for (int i = 0; i < MapCount; i++) {
- REF_PTR_RELEASE(Textures[i]);
- }
- delete [] Textures;
- Textures = 0;
- }
- if (MetalParameters) {
- delete [] MetalParameters;
- MetalParameters = 0;
- }
-}
-
-
-/***********************************************************************************************
- * MMMC::Get_Metal_Map -- Get the texture for a metal map by id number *
- * *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 11/19/1999 NH : Created. *
- *=============================================================================================*/
-TextureClass * MetalMapManagerClass::Get_Metal_Map(int id)
-{
- if (id < 0 || id >= MapCount) return 0;
- Textures[id]->Add_Ref();
- return Textures[id];
-}
-
-
-/***********************************************************************************************
- * MMMC::Metal_Map_Count -- Get the number of metal maps in the manager *
- * *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 11/19/1999 NH : Created. *
- *=============================================================================================*/
-int MetalMapManagerClass::Metal_Map_Count(void)
-{
- return MapCount;
-}
-
-
-/***********************************************************************************************
- * MMMC::Update_Lighting -- Update the lighting parameters used for generating the maps *
- * *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 11/19/1999 NH : Created. *
- *=============================================================================================*/
-void MetalMapManagerClass::Update_Lighting(const Vector3& ambient, const Vector3& main_light_color,
- const Vector3& main_light_dir, const Vector3& camera_dir)
-{
- CurrentAmbient = ambient;
- CurrentMainLightColor = main_light_color;
- CurrentMainLightDir = main_light_dir;
- CurrentCameraDir= camera_dir;
-}
-
-/***********************************************************************************************
- * MMMC::Update_Textures -- Update metal map textures (call once/frame before rendering) *
- * *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 11/19/1999 NH : Created. *
- *=============================================================================================*/
-void MetalMapManagerClass::Update_Textures(void)
-{
- // Currently the lighting is done using a simple Phong (actually Blinn) model.
- Vector3 &l = CurrentMainLightDir;
- Vector3 &v = CurrentCameraDir;
-
- // Calculate halfway vector
- Vector3 h = l+v;
- h.Normalize();
-
- // NOTE: when our lighting equation gets more complicated we might want to do some testing to
- // detect zero components...
-
- // Calculate quantities which are the same for all metal maps
- float n_dot_l[METALMAP_SIZE_2];
- float n_dot_h[METALMAP_SIZE_2];
-
- VectorProcessorClass::DotProduct(n_dot_l,l,_NormalTable,METALMAP_SIZE_2);
- VectorProcessorClass::ClampMin(n_dot_l, n_dot_l, 0.0f, METALMAP_SIZE_2);
- VectorProcessorClass::DotProduct(n_dot_h,h,_NormalTable, METALMAP_SIZE_2);
- VectorProcessorClass::ClampMin(n_dot_h, n_dot_h, 0.0f, METALMAP_SIZE_2);
-
- // Loop over each metal map and update it
- for (int i = 0; i < MapCount; i++) {
- MetalParams &cur_params = MetalParameters[i];
-
- // If shinyness > 1, apply it to specular value array
- float *specular = 0;
- float temp_specular[METALMAP_SIZE_2];
- float shinyness = cur_params.Shininess;
- if (shinyness > 1.0f) {
- VectorProcessorClass::Power(temp_specular, n_dot_h, shinyness, METALMAP_SIZE_2);
- specular = &(temp_specular[0]);
- } else {
- specular = &(n_dot_h[0]);
- }
-
- // Generate metal map row by row
- Vector3 specular_color(cur_params.SpecularColor.X * CurrentMainLightColor.X,
- cur_params.SpecularColor.Y * CurrentMainLightColor.Y,
- cur_params.SpecularColor.Z * CurrentMainLightColor.Z);
- Vector3 diffuse_color(cur_params.DiffuseColor.X * CurrentMainLightColor.X,
- cur_params.DiffuseColor.Y * CurrentMainLightColor.Y,
- cur_params.DiffuseColor.Z * CurrentMainLightColor.Z);
- Vector3 ambient_color(cur_params.AmbientColor.X * CurrentAmbient.X,
- cur_params.AmbientColor.Y * CurrentAmbient.Y,
- cur_params.AmbientColor.Z * CurrentAmbient.Z);
- Vector3 white(1.0f, 1.0f, 1.0f);
-
- SurfaceClass * metal_map_surface = Textures[i]->Get_Surface_Level(0);
- int pitch;
- unsigned char *map=(unsigned char *) metal_map_surface->Lock(&pitch);
- int idx=0;
- for (int y = 0; y < METALMAP_SIZE; y++) {
- for (int x = 0; x < METALMAP_SIZE; x++) {
- Vector3 result = ambient_color + (diffuse_color * n_dot_l[idx]) + (specular_color * specular[idx]);
- result.Update_Min(white); // Clamp to white
-
- unsigned char b,g,r,a;
- b= (unsigned char)WWMath::Floor(result.Z * 255.99f); // B
- g= (unsigned char)WWMath::Floor(result.Y * 255.99f); // G
- r= (unsigned char)WWMath::Floor(result.X * 255.99f); // R
- a= 0xFF; // A
-
- if (Use16Bit) {
- unsigned short tmp;
- tmp=(a&0xf0)<<8;
- tmp|=(r&0xf0)<<4;
- tmp|=(g&0xf0);
- tmp|=(b&0xf0)>>4;
- *(unsigned short*)&map[2*x]=tmp;
- } else {
- map[4*x]=b;
- map[4*x+1]=g;
- map[4*x+2]=r;
- map[4*x+3]=a;
- }
- idx++;
- }
- map+=pitch;
- }
- metal_map_surface->Unlock();
- REF_PTR_RELEASE(metal_map_surface);
- } // for i
-}
-
-/***********************************************************************************************
- * MMMC::initialize_normal_table -- Utility function to initialize the normal table *
- * *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 11/19/1999 NH : Created. *
- *=============================================================================================*/
-void MetalMapManagerClass::initialize_normal_table(void)
-{
- // NOTE: changing the actual static _NormalTable member must be the last thing this function
- // does to avoid synchronization errors.
-
- static Vector3 _normal_table[METALMAP_SIZE_2];
-
- // Calculate vectors (area outside sphere should be filled with a radial fill of the vectors at
- // the sphere's edge to avoid aliasing artifacts)
- float step = 2.0f / (float)METALMAP_SIZE;
- int idx = 0;
- for (int y = 0; y < METALMAP_SIZE; y++) {
- for (int x = 0; x < METALMAP_SIZE; x++) {
- Vector3 &normal = _normal_table[idx];
- // Set vector to point to surface of unit sphere
- normal.Set((step * (float)x) - 1.0f, (step * (float)y) - 1.0f, 0.0f);
- float z2 = 1 - ((normal.X * normal.X) + (normal.Y * normal.Y));
- z2 = MAX(z2, 0.0f); // If outside the sphere, treat as if on its edge
- normal.Z = sqrt(z2);
- normal.Normalize(); // Needed for "outside sphere" case and for safety's sake
-
- idx++;
- }
- }
-
- _NormalTable = &(_normal_table[0]);
-
-}
-
-/***********************************************************************************************
- * MMMC::initialize_metal_params -- Utility function (shared CTor code) *
- * *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 11/23/1999 NH : Created. *
- *=============================================================================================*/
-void MetalMapManagerClass::initialize_metal_params(int map_count, MetalParams *metal_params)
-{
- MapCount = map_count;
- if (MapCount > 0) {
- Textures = W3DNEWARRAY TextureClass *[MapCount];
- MetalParameters = W3DNEWARRAY MetalParams[MapCount];
-
- for (int i = 0; i < MapCount; i++) {
-
- // Copy metal parameters (assert if invalid)
- MetalParameters[i] = metal_params[i];
- assert(MetalParameters[i].AmbientColor.X >= 0.0f && MetalParameters[i].AmbientColor.X <= 1.0f);
- assert(MetalParameters[i].AmbientColor.Y >= 0.0f && MetalParameters[i].AmbientColor.Y <= 1.0f);
- assert(MetalParameters[i].AmbientColor.Z >= 0.0f && MetalParameters[i].AmbientColor.Z <= 1.0f);
- assert(MetalParameters[i].DiffuseColor.X >= 0.0f && MetalParameters[i].DiffuseColor.X <= 1.0f);
- assert(MetalParameters[i].DiffuseColor.Y >= 0.0f && MetalParameters[i].DiffuseColor.Y <= 1.0f);
- assert(MetalParameters[i].DiffuseColor.Z >= 0.0f && MetalParameters[i].DiffuseColor.Z <= 1.0f);
- assert(MetalParameters[i].SpecularColor.X >= 0.0f && MetalParameters[i].SpecularColor.X <= 1.0f);
- assert(MetalParameters[i].SpecularColor.Y >= 0.0f && MetalParameters[i].SpecularColor.Y <= 1.0f);
- assert(MetalParameters[i].SpecularColor.Z >= 0.0f && MetalParameters[i].SpecularColor.Z <= 1.0f);
- assert(MetalParameters[i].Shininess > 0.0f);
- }
- }
-}
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/metalmap.h b/Generals/Code/Libraries/Source/WWVegas/WW3D2/metalmap.h
deleted file mode 100644
index 00e93108e63..00000000000
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/metalmap.h
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
-** 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 .
-*/
-
-/***********************************************************************************************
- *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
- ***********************************************************************************************
- * *
- * Project Name : G *
- * *
- * $Archive:: /Commando/Code/ww3d2/metalmap.h $*
- * *
- * $Author:: Hector_y $*
- * *
- * $Modtime:: 6/27/01 4:30p $*
- * *
- * $Revision:: 2 $*
- * *
- *---------------------------------------------------------------------------------------------*
- * Functions: *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-#if defined(_MSC_VER)
-#pragma once
-#endif
-
-#ifndef METALMAP_H
-#define METALMAP_H
-
-#include
-
-class TextureClass;
-class INIClass;
-
-/*
-** MetalMapManagerClass: This class updates the procedural environment maps
-** (aka metal maps) based on the global lighting environment.
-** At the moment the metal maps are shaded using a simple Phong model - in
-** future this may be extended to more complex and realistic shading
-** (Cook-Torrance, etc.) which would require changing the metal parameters.
-** Another possible extension would be to support a large dynamic range for
-** the main light source (currently its color is treated as an RGB triple
-** which is bound to 0,1).
-*/
-
-// If this is increased too much the metal map updates will be too expensive
-#define METALMAP_SIZE 16
-#define METALMAP_SIZE_2 (METALMAP_SIZE * METALMAP_SIZE)
-
-class MetalMapManagerClass {
-
-public:
-
- // These parameters are for a simple Phong reflectance model
- struct MetalParams {
- Vector3 AmbientColor;
- Vector3 DiffuseColor;
- Vector3 SpecularColor;
- float Shininess;
- };
-
- // Create metal map manager with maps specified by INI file
- MetalMapManagerClass(INIClass &ini);
- ~MetalMapManagerClass(void);
-
- // Get the texture for a metal map by id number
- TextureClass * Get_Metal_Map(int id);
-
- // Get the number of metal maps in the manager
- int Metal_Map_Count(void);
-
- // Update the lighting parameters used for generating the maps
- void Update_Lighting(const Vector3& ambient, const Vector3& main_light_color,
- const Vector3& main_light_dir, const Vector3& camera_dir);
-
- // Update the metal map textures (should call once/frame before rendering)
- void Update_Textures(void);
-
-private:
-
- // 16 x 16 table of cameraspace normals for the environment maps
- static Vector3 * _NormalTable;
- void initialize_normal_table(void); // Utility function
-
- // Utility function - shared CTor code
- void initialize_metal_params(int map_count, MetalParams *metal_params);
-
- // Number of metal maps
- int MapCount;
-
- // Array of metal map texture pointers
- TextureClass ** Textures;
-
- // Array of metal parameters
- MetalParams * MetalParameters;
-
- // Current lighting parameters
- Vector3 CurrentAmbient;
- Vector3 CurrentMainLightColor;
- Vector3 CurrentMainLightDir;
- Vector3 CurrentCameraDir;
-
- // Use 16-bit metal maps or not
- bool Use16Bit;
-};
-
-#endif
\ No newline at end of file
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/missingtexture.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/missingtexture.cpp
deleted file mode 100644
index df80ba92b01..00000000000
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/missingtexture.cpp
+++ /dev/null
@@ -1,711 +0,0 @@
-/*
-** 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 .
-*/
-
-// 08/05/02 KM Texture class redesign
-#include "missingtexture.h"
-#include "texture.h"
-#include "dx8wrapper.h"
-#include
-
-static unsigned missing_image_width=128;
-static unsigned missing_image_height=128;
-static unsigned missing_image_depth=24;
-
-extern unsigned int missing_image_palette[];
-extern unsigned int missing_image_pixels[];
-
-static IDirect3DTexture8 * _MissingTexture = NULL;
-
-IDirect3DTexture8* MissingTexture::_Get_Missing_Texture()
-{
- WWASSERT(_MissingTexture);
- _MissingTexture->AddRef();
- return _MissingTexture;
-}
-
-IDirect3DSurface8* MissingTexture::_Create_Missing_Surface()
-{
- IDirect3DSurface8 *texture_surface = NULL;
- DX8_ErrorCode(_MissingTexture->GetSurfaceLevel(0, &texture_surface));
- D3DSURFACE_DESC texture_surface_desc;
- ::ZeroMemory(&texture_surface_desc, sizeof(D3DSURFACE_DESC));
- DX8_ErrorCode(texture_surface->GetDesc(&texture_surface_desc));
-
- IDirect3DSurface8 *surface = NULL;
- DX8CALL(CreateImageSurface(
- texture_surface_desc.Width,
- texture_surface_desc.Height,
- texture_surface_desc.Format,
- &surface));
- DX8CALL(CopyRects(texture_surface, NULL, 0, surface, NULL));
- texture_surface->Release();
- return surface;
-}
-
-void MissingTexture::_Init()
-{
- WWASSERT(!_MissingTexture);
-
- IDirect3DTexture8* tex=DX8Wrapper::_Create_DX8_Texture
- (
- missing_image_width,
- missing_image_height,
- WW3D_FORMAT_A8R8G8B8,
- MIP_LEVELS_ALL
- );
-
- D3DLOCKED_RECT locked_rect;
- RECT rect;
- rect.left=0;
- rect.right=missing_image_width;
- rect.top=0;
- rect.bottom=missing_image_height;
- DX8_ErrorCode(
- tex->LockRect(
- 0,
- &locked_rect,
- &rect,
- 0));
-
- unsigned *buffer=(unsigned*)locked_rect.pBits;
- unsigned char *pixels=(unsigned char *)missing_image_pixels;
- for (unsigned y=0;yUnlockRect(0));
-
- for (unsigned i=1;iGetLevelCount();++i) {
- IDirect3DSurface8 *src,*dst;
- DX8_ErrorCode(tex->GetSurfaceLevel(i-1,&src));
- DX8_ErrorCode(tex->GetSurfaceLevel(i,&dst));
-
- DX8_ErrorCode(D3DXLoadSurfaceFromSurface(
- dst,
- NULL, // palette
- NULL, // rect
- src,
- NULL, // palette
- NULL, // rect
- D3DX_FILTER_BOX, // box is good for 2:1 filtering
- 0));
-
- src->Release();
- dst->Release();
- }
-
- _MissingTexture=tex;
-/*
- //Load an 8-bit tga and generate text representation
- FILE *fp;
- fp=fopen("missing.tga","rb");
- if (fp)
- {
- char image[128*128]; //make enough storage for image and palette
- char palette[256*3];
- fread(image,18,1,fp); //skip over the header
- fread(palette,256,3,fp); //read the palette
- fread(image,1,128*128,fp);
- FILE *output=fopen("missing.txt","w");
- fprintf(output,"palette:\n");
- for (int i=0; i<256; i++)
- { int color=(((int)palette[i*3+0] & 0x000000ff)|(((int)palette[i*3+1] << 8)&0x0000ff00)|(((int)palette[i*3+2] << 16)&0x00ff0000)) | 0x7f000000;
- fprintf(output,"0x%.8X",color);
- if ((i&7) == 7) //check for end of 8 element line
- fprintf(output,",\n"); //new line
- else
- fprintf(output,","); //continue existing line
- }
- fprintf(output,"image:\n");
- for (int y=0; y<128; y++)
- {
- for (int x=0; x<32; x++)
- { int color=*((int *)(&image[y*128+x*4]));
- fprintf(output,"0x%.8X",color);
- if ((x&7)==7) //check for end of 8 element line
- fprintf(output,",\n"); //new line
- else
- fprintf(output,","); //continue existing line
- }
- }
- fclose(output);
- fclose(fp);
- }
-*/
-}
-
-void MissingTexture::_Deinit()
-{
- _MissingTexture->Release();
- _MissingTexture=0;
-}
-
-static unsigned int missing_image_palette[]={
-0x7F040204,0x7F048AC4,0x7F84829C,0x7FFC0204,0x7F0442AB,0x7FFCFE04,0x7F444244,0x7F0462FC,
-0x7F84CEE4,0x7FC4C6CF,0x7F9CA6B2,0x7FC4E6F4,0x7F04FE04,0x7F4C82D4,0x7F2452A1,0x7F0442D4,
-0x7F446AB0,0x7FA4A6B6,0x7F2C62C2,0x7FE4E6E9,0x7F646264,0x7F0402FC,0x7FC4D6E1,0x7F44B6DC,
-0x7FB4C6D4,0x7F8496A9,0x7F049ECC,0x7F0C52C9,0x7FA4B6C4,0x7FA4DEEC,0x7F0472FC,0x7F3C72C4,
-0x7F84A6DF,0x7F748294,0x7F24A6D4,0x7F1442A4,0x7F0452DA,0x7FE4F6FC,0x7FD4D6D6,0x7F849EC9,
-0x7F242224,0x7FBCD6F7,0x7FB4B6C2,0x7FD4F6F7,0x7F747274,0x7F0442BF,0x7F4C7ABC,0x7FACC6EC,
-0x7F9496AB,0x7F343234,0x7F042A98,0x7F648ADC,0x7F1C5AD4,0x7F545254,0x7F1C62D8,0x7FDCE6E9,
-0x7F0452EE,0x7F043AA2,0x7FC4CED3,0x7F2C62D4,0x7F34B6D4,0x7FB4BED9,0x7F6CA6EC,0x7F2C72EC,
-0x7F94B6E8,0x7F8482A4,0x7F8CA6CC,0x7F5C72AC,0x7FE4EEEF,0x7FC4D6FC,0x7F1472FC,0x7F7C96C4,
-0x7FF4F6F7,0x7FD4DEE3,0x7F6C728C,0x7F949EA4,0x7F5CC6E4,0x7F245ABC,0x7F4472C4,0x7F149ECD,
-0x7F6C82BC,0x7F34AED5,0x7F242251,0x7FB4BEC9,0x7F044AC8,0x7FBCCEF0,0x7F1462FC,0x7FD4EEF4,
-0x7FC4CEDC,0x7F7C7A97,0x7F0C4AB4,0x7FA4AEBC,0x7F3C62B4,0x7F646284,0x7FBCCEE4,0x7F1C52B7,
-0x7F0C5AE2,0x7F043294,0x7F3472E8,0x7F9CB6E1,0x7F74C6E4,0x7F2482FC,0x7F0C42AD,0x7F44426A,
-0x7F9CDEEC,0x7F5C9EFC,0x7FB4C6E1,0x7F8C9EAC,0x7FACBED0,0x7F5C7AAC,0x7FB4CEF2,0x7F35325C,
-0x7F4C5274,0x7FD4E6F9,0x7F64BEDF,0x7FECEEF2,0x7FDCDEE2,0x7F747A94,0x7F949EB0,0x7F19A6D4,
-0x7F342A58,0x7F0C4AC0,0x7F746A8C,0x7F96D6EC,0x7F4C82EC,0x7F345AB0,0x7F044ADA,0x7F4C72B9,
-0x7FCCD6E2,0x7F141214,0x7F6496EC,0x7F0696CC,0x7F7C9ECC,0x7F1482FC,0x7F241A4C,0x7FB8E6F4,
-0x7F58BEDC,0x7F7CA6E4,0x7F544A74,0x7F5C5A7D,0x7F9CAED0,0x7F443A64,0x7F8CBEFC,0x7F3C6AC9,
-0x7F1C5AC8,0x7F848A9C,0x7F8CAEEC,0x7F7C8A9C,0x7F144AB4,0x7F247AFC,0x7FC4DEF4,0x7F6CC6E4,
-0x7F2C2A56,0x7F146AF8,0x7F347AF4,0x7F4C4A70,0x7F448AFC,0x7F6C9EFC,0x7F8BD6EC,0x7FC8EEF4,
-0x7F2C5AA4,0x7F0A7AFC,0x7FECFEFC,0x7F2C2A2C,0x7F045AF4,0x7F848AA5,0x7F94AED0,0x7FFCFEFC,
-0x7F6C8AC4,0x7F646A8A,0x7F3C3A62,0x7F0A6AFC,0x7F9CAEBC,0x7F2C6ACC,0x7FACE6EC,0x7F28AED4,
-0x7F043AAF,0x7F2C6ADB,0x7F157AFC,0x7F245AD4,0x7F0432A0,0x7F79CEE4,0x7F7CAEF4,0x7F3C72D8,
-0x7F8C96A7,0x7F1452BC,0x7FACB6C3,0x7F7C8299,0x7F0C52D8,0x7F547AC3,0x7FB4C6EC,0x7FCCD6EC,
-0x7FBCBEC5,0x7FACAEC0,0x7F94BEF4,0x7F8C8A8E,0x7F1C4AA4,0x7F2C7AEC,0x7F1C6AF0,0x7F3C7AE4,
-0x7FCCE6FC,0x7F5482D0,0x7FECE6EC,0x7FBCC6D1,0x7F0C72FB,0x7FECF6F5,0x7FDCF6FA,0x7F0C3AA4,
-0x7FCCCECD,0x7F3CB6D7,0x7FBCBED4,0x7FFCF6FC,0x7F74728F,0x7F9C9E9C,0x7F64C6E3,0x7F4C72C5,
-0x7F1C9ED0,0x7F3CAED7,0x7FDCEEFC,0x7FCCCEDF,0x7F0C328C,0x7F2C82F4,0x7FBCC6DC,0x7F545275,
-0x7FDCE6F8,0x7F9C9EB0,0x7FCCDEEC,0x7F0C5AF0,0x7F8C8AA5,0x7F748ABC,0x7F6C6A8A,0x7F0442B4,
-0x7F0C62FC,0x7FC4C6DC,0x7F9CA6BC,0x7F0442E4,0x7F446ABC,0x7F2C62CC,0x7F4CB6DC,0x7F0C9ECC,
-0x7FACDEEC,0x7F2CA6D4,0x7F0452E4,0x7FD4D6E4,0x7F849ED4,0x7FB4B6CC,0x7F4C7ACC,0x7FACC6FC,
-0x7F9496B4,0x7F042AA4,0x7F1C62E4,0x7F74A6EC,0x7FE4EEFC,0x7F1C72FC,0x7FD4DEEC,0x7F2C5ABC};
-
-static unsigned int missing_image_pixels[]={
-0x03030303,0x03030303,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0x05050505,0x05050505,
-0x03030303,0x03030303,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0x05050505,0x05050505,
-0x03030303,0x03030303,0xA7A7A7A7,0xD574A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xC3C3C3C0,0xA7A7A7C3,0xA7A7A7A7,0x05050505,0x05050505,
-0x03030303,0x03030303,0xA7A7A7A7,0x00C3A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A700A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A700,0xA7A7A7A7,0x00000006,0xA7A70000,0xA7A7A7A7,0x05050505,0x05050505,
-0x03030303,0x03030303,0xA7A7A7A7,0x00C3A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A70000,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A70000,0xA7A7A7A7,0xA7A70606,0xA7C300A7,0xA7A7A7A7,0x05050505,0x05050505,
-0x03030303,0x03030303,0xA7A7A7A7,0x00C3A7A7,0xA7A7A7A7,0x3174A7A7,0xA33131A3,0x31A33131,
-0x3131A331,0xA33131A3,0x31A33131,0x3131A331,0xA33131A3,0x31A33131,0x3131A331,0xA33131A3,
-0x31A33131,0x3131A331,0xA33131A3,0x31A33131,0x3131A331,0xA33131A3,0x31A33131,0x3131A331,
-0xA33131A3,0x74A33131,0xA7A7A7A7,0xC3C32806,0xA7C00014,0xA7A7A7A7,0x05050505,0x05050505,
-0x03030303,0x03030303,0xA7A7A7A7,0x00C3A7A7,0xA7A7A7A7,0x0026A7A7,0x00000000,0x00000000,
-0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
-0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
-0x00000000,0x26000000,0xA7A7A7A7,0x00000006,0xA7A72C00,0xA7A7A7A7,0x05050505,0x05050505,
-0x03030303,0x03030303,0xA7A7A7A7,0x00C3A7A7,0xA7A7A7A7,0xD0D3A7A7,0xD0D00000,0xD0D0D0D0,
-0xD0D0D0D0,0xD0D0D0D0,0xD0D0D0D0,0xD0D0D0D0,0xD0D0D0D0,0xD0D0D0D0,0xD0D0D0D0,0xD0D0D0D0,
-0xD0D0D0D0,0xD0D0D0D0,0xD0D0D0D0,0xD0D0D0D0,0xD0D0D0D0,0xD0D0D0D0,0xD0D0D0D0,0xD0D0D0D0,
-0xD0D0D0D0,0xD3D00000,0xA7A7A7A7,0x74A70606,0xA7A7D500,0xA7A7A7A7,0x05050505,0x05050505,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0x00C3A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A700A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A700,0xA7A7A7A7,0xA7A70606,0xA7A7002C,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0x00C3A7A7,0xC3000000,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A70606,0xA70681A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xC0A7A7A7,0xC3C3C3C3,0xA7A7A7C3,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0x14A7A7A7,0x00000000,0xA7A7A700,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA700C3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA700C3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA700C3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA700C3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA700C3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA700C3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x48D026A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x0000A300,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0x00A7A7A7,0x00002800,0xA7A7A700,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0x48D348A2,
-0xA7A7A7D3,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0x7373D3A7,0x44131313,0x73737373,
-0x73737373,0xD3CD4873,0xA7A7A7D3,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0x1348A7A7,0x2680D026,0x44CA37FE,0xCDCDCD73,
-0xCDCDCDCD,0x737348CD,0x26487373,0xA7A748C0,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0x2AD226D3,0x26DB3ACB,0x73443774,0x484848CD,
-0x48D348D3,0xCDCDCD48,0xFE48CDCD,0xCA2A5902,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0x0973A7A7,0x2ABA5B5B,0xFEDB3ACB,0x733774FE,0xCD48A273,
-0xA7A2A748,0xCDD3A7A2,0x48CD4848,0x7A30CBBF,0xA7A7CA11,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xF8E10948,0xCBF5C1EA,0x37BF0909,0xF558BFFE,0xA519F8C1,
-0x5BF8B819,0xA7A28053,0xCD48A2A7,0xCBF3F374,0xA7C15930,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xF3A7A7A7,0xE1B8E4E1,0xDBD2C15B,0xEADBBF80,0x5B76BBBB,0xC0C0532A,
-0x5B2A5309,0x7691A5E1,0xA7A2133D,0xBF588073,0x02E43DF3,0xA7A7A7F3,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0x59C0A7A7,0xC1F8E459,0xBFFE74DB,0x0AD4BB53,0xA748CAD0,0xA7A7A7A7,
-0xA7A7A7A7,0xC074D3A7,0x740A4A91,0xF3BFFE48,0xBA80BF58,0xA7A72AE6,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0x59D41173,0xBF5811E4,0xBB7616FE,0xA7730911,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0x4B2ACAA7,0xFEFEBA91,0xF35858BF,0xA7304AD2,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x13A7A7A7,0xB8D45D02,0x58BF583D,0x745B91F8,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0x5B937609,0xBFBFFEFE,0x59A95880,0xA7A7A773,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xD426A7A7,0x58EAD48B,0xBBBABF58,0xA7A774D5,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0x9109A7A7,0x58FE58B8,0xA980BFBF,0xA7A773E6,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x9B5D74A7,0x74803DD4,0x80BB76F3,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xD3A7A7A7,0x135375BA,0xBFF3DBDB,0xA7485DA9,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x759BA9CA,0x58BF80F5,0xA748B8B8,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xACBBD0A7,0x588080FE,0xA77A7058,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0x48A7A7A7,0x5859AAD4,0x2158BF80,0xA7A7A711,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0x9173A7A7,0x80BFFEB8,0xE4AAD280,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xE4A7A7A7,0xF3807598,0xC07558FE,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0x48A7A7A7,0x80FEA530,0x9811FEBF,0xA7A7A7C1,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0x5211A7A7,0x49F3585D,0xA709BB58,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xFE6BE1D3,0x7549BFBF,0xA7A7DB98,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0x676F74A7,0xFEBF803D,0xA7A7BABB,0xA7A7A7A7,0x48A7A7A7,0x48484848,0x48484848,0x48484848,
-0x48484848,0xA7A7A748,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xF891A7A7,0xE9FE8074,0xA7A78B6F,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xEA985DA7,0xA58058F3,0xA7A7A70A,0xA7A7A7A7,0x8F55A7A7,0x4ED74ED7,0x4ED74ED7,0x4ED74ED7,
-0x8F7F4ED7,0xA7A748A8,0xA7A77463,0xA7A7A7A7,0xA7A7A7A7,0xBB73A7A7,0x8058FEBA,0xA711520A,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xFEE4862A,0xBBEABF58,0xA7A7A7D3,0xA7A7A7A7,0xB45CCDA7,0xB0B039F9,0x39B0B0B0,0xB0B039B0,
-0xF9B0B039,0x6EA7A742,0xA7A75039,0xA7A7A7A7,0xA7A7A7A7,0x49A7A7A7,0xDB745875,0x73AA8BFE,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0x73A7A7A7,
-0xBF80DF9B,0x13BB5880,0xA7A7A7A7,0xA7A7A7A7,0x043984A7,0xE7040404,0xE7545AE7,0x5A2D5A54,
-0xBDB05A54,0x1FCDA7A7,0xA7DE04F9,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xBFFEB8C0,0xE452BA80,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0x11A7A7A7,
-0x80F3BA86,0xA7539337,0xA7A7A7A7,0xA7A7A7A7,0x39B404DB,0xB0B0B0B0,0xB0B0B0B0,0xB0B0B0B0,
-0x7494B0B0,0xB089A7A7,0x737D3904,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xFEACB8A7,0x985DBFF3,
-0xA7A7A7CA,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xDF48A7A7,
-0xBF58808B,0xA7D3913D,0xA7A7A7A7,0xA7A7A7A7,0xBDBD7F8C,0xBDC9BDBD,0xBDBDC9BD,0xC9BDBDC9,
-0xA7A6D7BD,0x041B96A7,0x47390404,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0x809126A7,0x98E1F3BF,
-0xA7A7A711,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0x98F5A7A7,
-0xBFBFBFBA,0xA7A726BB,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x5AB00DA2,0x6639045A,0xA7A7A780,0xA7A7A7A7,0xA7A7A7A7,0xEA0AA7A7,0x7058BFF3,
-0xA7A773DF,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0x8B5DA7A7,
-0xBA74BFFE,0xA7A7D3A5,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x5A542D40,0xB0E75A5A,0xA7A7485C,0xA7A7A7A7,0xA7A7A7A7,0x91F3A7A7,0x59BFF3BF,
-0xA7A72A6F,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0x116F26A7,
-0xB8BF80FE,0xA7A7A7D0,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xDAA7A7A7,0x545A2D90,0x045A5A2D,0xA7A7A639,0xA7A7A7A7,0xA7A7A7A7,0xE1A7A7A7,0xBAFEFEBA,
-0xA7A7E667,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0x589BE1A7,
-0xBBDEDB58,0xA7A7A773,0xA7A7A7A7,0xFCDACDA7,0xFCFCFCFC,0xDAFCFC25,0xFCFCFCFC,0xA7CDE073,
-0x82A7A7A7,0x541B247E,0x5A2D544D,0xA7E00EB0,0xA7A7A7A7,0xA7A7A7A7,0x09A7A7A7,0xD2BFFEBB,
-0xA7FEDF8B,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xFE41E6A7,
-0x76F8DBDB,0xA7A7A7A7,0xA7A7A7A7,0x124DD773,0xED12124D,0xB1B1ADB3,0xB1B1B1B1,0xA7553BC6,
-0x246EA7A7,0xED54241B,0x5AB0BDE2,0xA7A8F9E7,0xA7A7A7A7,0xA7A7A7A7,0xD3A7A7A7,0xBFFE5875,
-0xA7C09BD4,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0x80CB8B73,
-0xD0BB5858,0xA7A7A7A7,0xA7A7A7A7,0x39B43227,0xE7B039B0,0x542DE72D,0x3824547E,0xA74833EB,
-0x383FDAA7,0x637EBCA4,0xE7B9BFA7,0x6C39E75A,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xBFFEF811,
-0xA7E170B8,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xF3FE5D2A,
-0xD3BB58DB,0xA7A7A7A7,0x5EA7A7A7,0x66043966,0x5A545AE7,0x24245454,0x38A4A460,0xA7A7733F,
-0xA4389DA7,0xD3C97EA4,0x2D20A7A7,0x0EB05A5A,0xA7A7A737,0xA7A7A7A7,0xA7A7A7A7,0xFEFEBB26,
-0x73598B0A,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0x80FEBBE4,
-0xA74B6CFE,0xA7A7A7A7,0xA0FCA7A7,0x04043932,0x54545AE7,0x7E540F2D,0x3838387E,0xA7A7A763,
-0x56E8E845,0xA77156A4,0xD7A7A7A7,0x39045A2D,0xA7A7A7E5,0xA7A7A7A7,0xA7A7A7A7,0x805891D3,
-0x13E65DF5,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xDE58F859,
-0xA7C0EABF,0xA7A7A7A7,0x4713A7A7,0x045C42F4,0x5F2D5A5A,0x202020F4,0x40202020,0x48A7A7D3,
-0x07AB079C,0xA7A792A4,0xF6FB89CD,0x04E75A2D,0xA7A7E966,0xA7A7A7A7,0xA7A7A7A7,0xFE3D0AA7,
-0xF3E6D4DE,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xDBDBBA59,
-0xA7F3B8BF,0xA7A7A7A7,0xA7A7A7A7,0x04FF48A7,0xF40454E7,0xA7A7A7A7,0xA7A7A7A7,0xC2A7A7A7,
-0x0746CC1E,0xA7A7487C,0x542D0FB6,0x045A5A5A,0xA7485C39,0xA7A7A7A7,0xA7A7A7A7,0xFE5BBAA7,
-0xD0E6BB58,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0x73A7A7A7,0xDBE9DEE4,
-0xA713BBBF,0xA7A7A7A7,0xA7A7A7A7,0xE7B0A8A7,0xD34E2D5A,0xA7A7A7A7,0xA7A7A7A7,0xB2C8A7A7,
-0xABCCCCCC,0x29A7A745,0x5424BCA4,0x66E75454,0xA7276104,0xA7A7A7A7,0xA7A7A7A7,0xFEF8C0A7,
-0xCBD4E458,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xCAA7A7A7,0xBF585830,
-0xA7D3BB58,0xA7A7A7A7,0xA7A7A7A7,0xE704CF5E,0xA7805A66,0xA7A7A7A7,0xA7A7A7A7,0x1E69A7A7,
-0x3EABA1A1,0x9A48A7A7,0x0F7EF27E,0x0404E72D,0x74943904,0xA7A7A7A7,0xA7A7A7A7,0xF3B8D0A7,
-0xF5BBE480,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0x74A7A7A7,0xF358DEB8,
-0xA7D3BB58,0xA7A7A7A7,0x48A7A7A7,0xE766398F,0xC8C80DB0,0xC8C8C80B,0xC871C8C8,0xA1858E71,
-0x73DDA185,0x9AF7A7A7,0x8FC7B79A,0x04B98F8F,0x43610466,0xA7A7A7A7,0xA7A7A7A7,0xF3A580A7,
-0x2ABBF858,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xF3A7A7A7,0xDBE9D2B8,
-0xA7A7BBDE,0xA7A7A7A7,0x84A7A7A7,0xE7660432,0x3490905A,0x99993636,0x65B2FD46,0x85A1A165,
-0xA72F1E85,0xFC48A7A7,0x73737373,0x5F554873,0x61663904,0xA7A7A7AC,0xA7A7A7A7,0xBFA526A7,
-0x5302E1BF,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0x26A7A7A7,0x58DBE9F8,
-0xA7A79118,0xA7A7A7A7,0x0480A7A7,0xE7040439,0x542D2D5A,0xA4F2247E,0x1EAB07E8,0x8585A1CC,
-0xA7A73E1E,0xA7A7A7A7,0xA7A7A7A7,0xA6A7A7A7,0x390404B0,0xA7A7370E,0xA7A7A7A7,0xF39149A7,
-0xC0E4E109,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xF3A7A7A7,0xBF585830,
-0xA7A741D2,0xA7A7A7A7,0x321048A7,0xE7040439,0x54542DE7,0xA4A42424,0x1EABAB07,0xA1A1A1A1,
-0xA7A71365,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xB439B42E,0xA7A76D61,0xA7A7A7A7,0x80A5F3A7,
-0xD2301158,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0x74A7A7A7,0xBF585830,
-0xA7D3BB58,0xA7A7A7A7,0x3932A6A7,0x04393939,0x542DE704,0xE3242454,0xABABE8E3,0xCC1ECCCC,
-0xA7A7A7C2,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0x39B46616,0xA76ADC61,0xA7A7A7A7,0xFEB8D0A7,
-0xD0E111D2,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xCAA7A7A7,0xBF58D2B8,
-0xA773BB13,0xA7A7A7A7,0x6A3DF3A7,0xBE6A6A6A,0xBE6ABE6A,0x6E6EBE6A,0x6E6E6E6E,0x456E6E55,
-0xA7A7A748,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0x6A3DBFA7,0xA7746C6A,0xA7A7A7A7,0xFEA509A7,
-0xDB11C13D,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0x48A7A7A7,0x7358D2B8,
-0xA713B8A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA2A7A7A2,0xA248A2A2,0xA7A7A2CD,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xFE0AC0A7,
-0x74C12AE9,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA237BA91,
-0xA7D00AA7,0xA7A7A7A7,0x4F77B5A7,0x77EF77EF,0xA7A7A2D6,0x0B77D6A7,0x48A7A7A7,0xA7A764F1,
-0xF0A7A7A7,0x770B0B77,0x77777777,0xA2CD51EF,0xAFAF7797,0x9F873C77,0xA7F07B9E,0xFE1CC1A7,
-0xCAF553C0,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xCDD358E1,
-0xA7BA5BA7,0xA7A7A7A7,0x88774F71,0x77888888,0xA7A78701,0xEE831A87,0x25A7A7A7,0xA7AE0177,
-0xEFA2A7A7,0x83878783,0x6464B551,0x7BA20897,0x6464D101,0x2BD80197,0xA7F0689F,0x58DE30A7,
-0x73C0D2CB,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xCDCD7373,
-0xA7B858A7,0xA7A7A7A7,0xA7648387,0x57A7A7A7,0xA2A75797,0x1AB52288,0x25A7A70B,0xA25183AF,
-0x8397A7A7,0x8387871A,0xA7A7A77B,0xB5A7A7A7,0xA7A78783,0xCD887BA7,0xA7A7A7A7,0x26809148,
-0xD3580958,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xCD48CDA7,
-0x73934448,0xA7A7A7A7,0xA7971A0B,0x878787A7,0x9FA7A287,0x1AA77B83,0x25A7A797,0x647797AF,
-0x9E1A1DA7,0x8387871A,0x7B7297F1,0x9EA7A7A7,0x9E7B8883,0xA7251D9E,0xA7A7A7A7,0xFEFEBB09,
-0xA7F3D080,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0x48CD48A7,
-0xC0F8A748,0xA7A7A7A7,0xA797EF87,0x1A4F22CE,0xD6A78783,0x88A2DAD8,0xCDA70B83,0xEF7B8777,
-0x9F972287,0x1A87871A,0x88EF771A,0xA2A7A7A7,0xEF4F4F88,0x25D9834F,0xA7A7A7A7,0xF337EAB8,
-0xA7138026,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xCD7348A7,
-0xB8BAA248,0xA7A7A7A7,0xA7641A0B,0x649FDAA7,0x1A258701,0x7717D91A,0x25A7D601,0xAFA7F077,
-0x0BCDAF83,0x8387871A,0xA7A2A708,0xDAA7A7A7,0x25CECE9F,0x571A1757,0x73A7A7A7,0x74F3BF75,
-0xA7D349FE,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xCD73A7A7,
-0xBB58A7CD,0xA7A7A713,0xA2D6EF87,0x08A7A2CD,0x83B59F01,0xD951D917,0x25CE1A4F,0x87A71D77,
-0x87A76801,0x8387AE1A,0xA2A2A264,0xAFA7A2CD,0xA7A7A7F1,0x2B8388A7,0x53A7A7A7,0x1374FE76,
-0xA7A73774,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0x7373A7A7,
-0xB848A248,0xA7A7A753,0x228377CE,0x4FF12222,0x88D81DEF,0xA2A2A2A2,0x2564017B,0xA7A77BEF,
-0x87A74868,0x83878783,0x2222F14F,0x88CED977,0x3C3C5101,0xCD7783F1,0x30A7A7A7,0x1373FE53,
-0xA7A77313,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0x44D3A7A7,
-0xDEA7CD48,0xA7A77375,0x88721DA7,0x88888888,0x9F72871D,0xA7A7A7A7,0xCD64B5A7,0xA7A78797,
-0xDAA7A7A7,0xD6DA574C,0x88888888,0xCD25D688,0x888888B5,0xA70BD688,0xBB09A7A7,0x447373BF,
-0xA7A7A713,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xCDA7A7A7,
-0x48A24873,0xA7A7C0BB,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0x5BB8A7A7,0x4448CD48,
-0xA7A7A748,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xD3A7A7A7,
-0xA248CD73,0xA748D4DB,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xE07509A7,0x73CD48A2,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA248CD73,0xA75BB848,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7BABB48,0x48734848,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xCD4873D3,0xD075F3A2,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA248E40A,0xA273CD48,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xCD7373A7,0x59F5FC48,0xA7A7A737,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xC0A7A7A7,0xCDA2FE4A,0xA7487348,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0x4873D3A7,0xBA74CD48,0xA7A748B8,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0x7526A7A7,0xCD48A2DE,0xA7A773CD,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0x7348A7A7,0xFEE07373,0xA7A730B8,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xBA7573A7,0xCD4848A7,0xA7A7D373,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0x44A7A7A7,0xF3134444,0xA7E1A5BF,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7CBBB73,0x73CD48A2,0xA7A7A748,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xD3A7A7A7,0xFE3713E0,0x307680FE,0xA7A7A7D3,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0x74A7A7A7,0x48A73DBB,0x4873CDCD,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x49747473,0xA580FE49,0xA7A713E4,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xBB3AA7A7,0xCDD3A7BA,0xA7737348,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x26F313A7,0x74DB80DB,0xA7DB755B,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xFE2111A7,0xCDCDD3A7,0xA7A773CD,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xDB74A7A7,0x80CB093A,0xBABBBAFE,0xA7A7A748,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0x13A7A7A7,0xA737194B,0x48CDCDD3,0xA7A74873,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x49A7A7A7,0xD2C0D2CB,0xB8BFFEF3,0xA7A73A59,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0x4AC173A7,0x13E0FE5B,0x4473CD73,0xA7A7A7D3,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0x2AF55374,0xFEBFD211,0x0902A5DB,0xA7A7A773,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0x74A7A7A7,0xBFB875C1,0x5880DBFE,0x74E4D2BF,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0x5BBA74A7,0xF3F5115B,0xB86C80FE,0xA726E1BB,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0x93B8CB48,0xFEFEE90A,0xFE58F3BF,0xA7C04A11,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xBACAA7A7,0x5B30E1E1,0xFEFEBFE9,0x59BBEAD2,0x48135811,0xA7A7A7A7,
-0xA7A7A7A7,0xE1CB7473,0xBF5B9175,0x58F3FEFE,0xE4585858,0xA7A72659,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xD3A7A7A7,0xE4B83009,0xBF58C1E4,0x5858FEFE,0x21930ABA,0xB8E491BB,
-0xBB91E4E4,0xF5EAA5BB,0xBFFEFE58,0x80585858,0x1175BADB,0xA7A7A7D3,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xE45B13A7,0xEAA5BBBB,0xFEFEF309,0x5880FEFE,0xBABAF5DE,
-0xDB3DC11C,0xBF74FEBF,0xDBDBDBBF,0xC180FEF3,0xA726B802,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0x26A7A7A7,0xE6E65911,0x585B3059,0xF3FE49BF,0xF3FEF3FE,
-0xF3FEBFFE,0x5858BF80,0xFEBF8058,0x3041B8CB,0xA7A7A7D2,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xD411F3A7,0xD48B8B8B,0x80DEC1B8,0xF3FEF3BF,
-0xDBBFF3F3,0x49FE80BF,0xE630CBF3,0xD3D0915D,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xCAA7A7A7,0x9BE6E42A,0xE6DF6767,0x0AF8A559,
-0xEAEA5BEA,0xA9BBE4F8,0x11595D8B,0xA7A7A7CA,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xC073A7A7,0x8A5D5930,0x986F6F8D,
-0xAA6F6F78,0x025DDF67,0xA7A7732A,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0x73D3A7A7,0xD209D074,
-0x74D009C0,0xA7A7A773,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x2600A3A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0x00A7A7A7,0x00002800,0xA7A7A700,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x0000A300,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0x743135A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0x74A7A7A7,0xC0C3C3C3,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xC3A7A7A7,0x00000000,0xA7A7A731,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xC3A7A7A7,0x74A7A700,0xA7A7A700,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xC3A7A7A7,0x35C3C300,0xA7A7A700,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xC3A7A7A7,0x00000000,0xA7A7A7A3,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xC3A7A7A7,0xA7A7A700,0xA7A7D500,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xC3A7A7A7,0xC0A7A700,0xA7A7D500,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xC3A7A7A7,0x00000000,0xA7A7A706,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0x0C0C0C0C,0x0C0C0C0C,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0x15151515,0x15151515,
-0x0C0C0C0C,0x0C0C0C0C,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0x15151515,0x15151515,
-0x0C0C0C0C,0x0C0C0C0C,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0x15151515,0x15151515,
-0x0C0C0C0C,0x0C0C0C0C,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0x15151515,0x15151515,
-0x0C0C0C0C,0x0C0C0C0C,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0x15151515,0x15151515,
-0x0C0C0C0C,0x0C0C0C0C,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0x15151515,0x15151515,
-0x0C0C0C0C,0x0C0C0C0C,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0x15151515,0x15151515,
-0x0C0C0C0C,0x0C0C0C0C,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
-0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0x15151515,0x15151515};
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/missingtexture.h b/Generals/Code/Libraries/Source/WWVegas/WW3D2/missingtexture.h
deleted file mode 100644
index d6130ea06ec..00000000000
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/missingtexture.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
-** 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 .
-*/
-
-#if defined(_MSC_VER)
-#pragma once
-#endif
-
-#ifndef DX8_MISSING_TEXTURE_H
-#define DX8_MISSING_TEXTURE_H
-
-#include "always.h"
-
-struct IDirect3DTexture8;
-struct IDirect3DSurface8;
-
-class MissingTexture
-{
-public:
- static void _Init();
- static void _Deinit();
-
- static IDirect3DTexture8* _Get_Missing_Texture(); // Return a reference to missing texture
- static IDirect3DSurface8* _Create_Missing_Surface(); // Create new surface which contain missing texture image
-};
-
-
-#endif // DX8_MISSING_TEXTURE
\ No newline at end of file
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/pivot.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/pivot.cpp
deleted file mode 100644
index 95acf22f9ec..00000000000
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/pivot.cpp
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
-** 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 .
-*/
-
-/* $Header: /Commando/Code/ww3d2/pivot.cpp 1 1/22/01 3:36p Greg_h $ */
-/***********************************************************************************************
- *** Confidential - Westwood Studios ***
- ***********************************************************************************************
- * *
- * Project Name : Commando / G 3D Library *
- * *
- * $Archive:: /Commando/Code/ww3d2/pivot.cpp $*
- * *
- * Author:: Greg_h *
- * *
- * $Modtime:: 1/08/01 10:04a $*
- * *
- * $Revision:: 1 $*
- * *
- *---------------------------------------------------------------------------------------------*
- * Functions: *
- * PivotClass::PivotClass -- Constructor for PivotClass *
- * PivotClass::Compute_Transform -- Update the pivot's transformation matrix *
- * PivotClass::Compute_Transform -- Update the pivot's transformation matrix *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-#include "pivot.h"
-#include "wwmath.h"
-#include
-
-
-/***********************************************************************************************
- * PivotClass::PivotClass -- Constructor for PivotClass *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 07/24/1997 GH : Created. *
- *=============================================================================================*/
-PivotClass::PivotClass(void) :
- Parent(NULL),
- BaseTransform(1),
- Transform(1),
-#ifdef LAZY_CAP_MTX_ALLOC
- CapTransformPtr(NULL),
- Index(0),
- IsVisible(true),
- WorldSpaceTranslation(false)
-#else
- CapTransform(1),
- Index(0),
- IsVisible(true),
- WorldSpaceTranslation(false),
- IsCaptured(false),
- Unused(false)
-#endif
-{
- Name[0] = 0;
-}
-
-PivotClass::PivotClass(const PivotClass& that) :
- Parent(that.Parent),
- BaseTransform(that.BaseTransform),
- Transform(that.Transform),
-#ifdef LAZY_CAP_MTX_ALLOC
- CapTransformPtr(NULL),
- Index(that.Index),
- IsVisible(that.IsVisible),
- WorldSpaceTranslation(that.WorldSpaceTranslation)
-#else
- CapTransform(that.CapTransform),
- Index(that.Index),
- IsVisible(that.IsVisible),
- WorldSpaceTranslation(that.WorldSpaceTranslation),
- IsCaptured(that.IsCaptured),
- Unused(that.Unused)
-#endif
-{
- memcpy(Name, that.Name, sizeof(Name));
-#ifdef LAZY_CAP_MTX_ALLOC
- if (that.CapTransformPtr != NULL)
- {
- CapTransformPtr = MSGW3DNEW("PivotClassCaptureBoneMtx") DynamicMatrix3D;
- CapTransformPtr->Mat = that.CapTransformPtr->Mat;
- }
-#endif
-}
-
-PivotClass& PivotClass::operator=(const PivotClass& that)
-{
- if (this != &that)
- {
- memcpy(Name, that.Name, sizeof(Name));
- Parent = that.Parent;
- BaseTransform = that.BaseTransform;
- Transform = that.Transform;
- #ifdef LAZY_CAP_MTX_ALLOC
- CapTransformPtr = NULL;
- Index = that.Index;
- IsVisible = that.IsVisible;
- WorldSpaceTranslation = that.WorldSpaceTranslation;
- if (that.CapTransformPtr != NULL)
- {
- CapTransformPtr = MSGW3DNEW("PivotClassCaptureBoneMtx") DynamicMatrix3D;
- CapTransformPtr->Mat = that.CapTransformPtr->Mat;
- }
- #else
- CapTransform = that.CapTransform;
- Index = that.Index;
- IsVisible = that.IsVisible;
- WorldSpaceTranslation = that.WorldSpaceTranslation;
- IsCaptured = that.IsCaptured;
- Unused = that.Unused;
- #endif
- }
- return *this;
-}
-
-void PivotClass::Capture_Update(void)
-{
-#ifdef LAZY_CAP_MTX_ALLOC
- if (!CapTransformPtr)
- return;
-
- const Matrix3D* ct = &CapTransformPtr->Mat;
-#else
- const Matrix3D* ct = &CapTransform;
-#endif
-
- if ( WorldSpaceTranslation )
- {
- // The Translation of CapTransform is meant to be in world space,
- // so remove before applying orientation
- Matrix3D CapOrientation = *ct;
- CapOrientation.Set_Translation( Vector3( 0,0,0 ) );
-#ifdef ALLOW_TEMPORARIES
- Matrix3D::Multiply(Transform,CapOrientation,&(Transform));
-#else
- Transform.postMul(CapOrientation);
-#endif
- // Now apply translation in world space
- Transform.Adjust_Translation( ct->Get_Translation() );
- }
- else
- {
-#ifdef ALLOW_TEMPORARIES
- Matrix3D::Multiply(Transform, *ct, &(Transform));
-#else
- Transform.postMul(*ct);
-#endif
- }
-}
-
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/pivot.h b/Generals/Code/Libraries/Source/WWVegas/WW3D2/pivot.h
deleted file mode 100644
index c083133df3b..00000000000
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/pivot.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
-** 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 .
-*/
-
-/* $Header: /Commando/Code/ww3d2/pivot.h 1 1/22/01 3:36p Greg_h $ */
-/***********************************************************************************************
- *** Confidential - Westwood Studios ***
- ***********************************************************************************************
- * *
- * Project Name : Commando / G 3D Library *
- * *
- * $Archive:: /Commando/Code/ww3d2/pivot.h $*
- * *
- * Author:: Greg_h *
- * *
- * $Modtime:: 1/08/01 10:04a $*
- * *
- * $Revision:: 1 $*
- * *
- *---------------------------------------------------------------------------------------------*
- * Functions: *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-#if defined(_MSC_VER)
-#pragma once
-#endif
-
-#ifndef PIVOT_H
-#define PIVOT_H
-
-#include "always.h"
-#include "vector3.h"
-#include "matrix3d.h"
-#include "quat.h"
-#include "w3d_file.h"
-
-
-/*
-
- PivotClass
-
- Each node of the hierarchy tree is represented by a
- PivotClass.
-
-*/
-
-//#define LAZY_CAP_MTX_ALLOC
-
-struct PivotClass
-{
-public:
-
- PivotClass(void);
- PivotClass(const PivotClass& that);
- PivotClass& operator=(const PivotClass& that);
-
- ~PivotClass(void)
- {
-#ifdef LAZY_CAP_MTX_ALLOC
- if (CapTransformPtr)
- delete CapTransformPtr;
-#endif
- }
-
- void Capture_Update(void);
- bool Is_Captured() const
- {
-#ifdef LAZY_CAP_MTX_ALLOC
- return CapTransformPtr != NULL;
-#else
- return IsCaptured;
-#endif
- }
-
-public:
- char Name[W3D_NAME_LEN];
- PivotClass * Parent;
- Matrix3D BaseTransform; // base-pose transform (relative to parent).
- Matrix3D Transform; // computed transform for this pivot
- // User control. When a pivot is 'captured' animation data is ignored and the
- // user data is used to control the pivot.
-#ifdef LAZY_CAP_MTX_ALLOC
- DynamicMatrix3D* CapTransformPtr;
- short Index;
- bool IsVisible; // result of the visibility channel
- bool WorldSpaceTranslation;
-#else
- Matrix3D CapTransform;
- int Index;
- bool IsVisible; // result of the visibility channel
- bool WorldSpaceTranslation;
- bool IsCaptured;
- bool Unused; // padding
-#endif
-
-};
-
-
-
-#endif
\ No newline at end of file
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/pointgr.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/pointgr.cpp
deleted file mode 100644
index eb959c193df..00000000000
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/pointgr.cpp
+++ /dev/null
@@ -1,1916 +0,0 @@
-/*
-** 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 .
-*/
-
-/***************************************************************************
- *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
- ***************************************************************************
- * *
- * Project Name : G *
- * *
- * $Archive:: /VSS_Sync/ww3d2/pointgr.cpp $*
- * *
- * Org Author:: Greg Hjelstrom *
- * *
- * $Author:: Kenny Mitchell *
- * *
- * $Modtime:: 06/26/02 4:04p $*
- * *
- * $Revision:: 38 $*
- * *
- * 06/26/02 KM Matrix name change to avoid MAX conflicts *
- *-------------------------------------------------------------------------*
- * Functions: *
- * PointGroupClass::PointGroupClass -- PointGroupClass CTor. *
- * PointGroupClass::~PointGroupClass -- PointGroupClass DTor. *
- * PointGroupClass::operator = -- PointGroupClass assignment operator. *
- * PointGroupClass::Set_Arrays -- Set point location/color/enable arrays.*
- * PointGroupClass::Set_Point_Size -- Set default point size. *
- * PointGroupClass::Get_Point_Size -- Get default point size. *
- * PointGroupClass::Set_Point_Color -- Set default point color. *
- * PointGroupClass::Get_Point_Color -- Get default point color. *
- * PointGroupClass::Set_Point_Alpha -- Set default point alpha. *
- * PointGroupClass::Get_Point_Alpha -- Get default point alpha. *
- * PointGroupClass::Set_Point_Orientation -- Set default point orientatio*
- * PointGroupClass::Get_Point_Orientation -- Get default point orientatio*
- * PointGroupClass::Set_Point_Frame -- Set default point frame. *
- * PointGroupClass::Get_Point_Frame -- Get default point frame. *
- * PointGroupClass::Set_Point_Mode -- Set point rendering method. *
- * PointGroupClass::Get_Point_Mode -- Get point rendering method. *
- * PointGroupClass::Set_Flag -- Set given flag to on or off. *
- * PointGroupClass::Get_Flag -- Get current value (on/off) of given flag.*
- * PointGroupClass::Set_Texture -- Set texture used. *
- * PointGroupClass::Get_Texture -- Get texture used. *
- * PointGroupClass::Set_Shader -- Set shader used. *
- * PointGroupClass::Get_Shader -- Get shader used. *
- * PointGroupClass::Set_Billboard -- Set whether to billboard. *
- * PointGroupClass::Get_Billboard -- Get whether to billboard. *
- * PointGroupClass::Get_Discrete_Orientation_Count_Log2 -- what it says *
- * PointGroupClass::Set_Discrete_Orientation_Count_Log2 -- what it says. *
- * PointGroupClass::Get_Frame_Row_Column_Count_Log2 -- what it says *
- * PointGroupClass::Set_Frame_Row_Column_Count_Log2 -- what it says. *
- * PointGroupClass::Get_Polygon_Count -- Get estimated polygon count. *
- * PointGroupClass::Render -- draw point group. *
- * PointGroupClass::vInstance -- Create instance of class. *
- * PointGroupClass::sGetClassName -- Get name of class. *
- * PointGroupClass::Update_Arrays -- Update all arrays used in rendering *
- * PointGroupClass::Peek_Texture -- Peeks texture *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-#include "pointgr.h"
-#include "vertmaterial.h"
-#include "ww3d.h"
-#include "aabox.h"
-#include "statistics.h"
-#include "simplevec.h"
-#include "texture.h"
-#include "Vector.H"
-#include "vp.h"
-#include "matrix4.h"
-#include "dx8wrapper.h"
-#include "dx8vertexbuffer.h"
-#include "dx8indexbuffer.h"
-#include "rinfo.h"
-#include "camera.h"
-#include "dx8fvf.h"
-#include "d3dx8math.h"
-#include "sortingrenderer.h"
-
-// Upgraded to DX8 2/2/01 HY
-
-// static data members
-Vector3 PointGroupClass::_TriVertexLocationOrientationTable[256][3];
-Vector3 PointGroupClass::_QuadVertexLocationOrientationTable[256][4];
-Vector2 *PointGroupClass::_TriVertexUVFrameTable[5] = { NULL, NULL, NULL, NULL, NULL};
-Vector2 *PointGroupClass::_QuadVertexUVFrameTable[5] = { NULL, NULL, NULL, NULL, NULL};
-VertexMaterialClass *PointGroupClass::PointMaterial=NULL;
-
-// Static arrays for intermediate calcs (never resized down, just up):
-VectorClass PointGroupClass::compressed_loc; // point locations 'compressed' by APT
-VectorClass PointGroupClass::compressed_diffuse; // point colors 'compressed' by APT
-VectorClass PointGroupClass::compressed_size; // point sizes 'compressed' by APT
-VectorClass PointGroupClass::compressed_orient; // point orientations 'compressed' by APT
-VectorClass PointGroupClass::compressed_frame; // point frames 'compressed' by APT
-VectorClass PointGroupClass::transformed_loc; // transformed point locations
-
-// This array has vertex locations for screenspace mode - calculated to cover exactly 1x1 and 2x2 pixels.
-Vector3 PointGroupClass::_ScreenspaceVertexLocationSizeTable[2][3] =
-{
- Vector3(0.5f, 0.0f, -1.0f),
- Vector3(1.0f, 1.0f, -1.0f),
- Vector3(0.0f, 1.0f, -1.0f),
- Vector3(1.0f, -0.5f, -1.0f),
- Vector3(2.7f, 2.0f, -1.0f),
- Vector3(-0.7f, 2.0f, -1.0f)
-};
-
-// useful for particles that aren't aligned with the screen.
-static Vector3 GroundMultiplierX(1.0f, 0.0f, 0.0f);
-static Vector3 GroundMultiplierY(0.0f, 1.0f, 0.0f);
-
-// Some internal variables
-VectorClass VertexLoc; // camera-space vertex locations
-VectorClass VertexDiffuse; // vertex diffuse/alpha colors
-VectorClass VertexUV; // vertex texture coords
-
-// Some DX 8 variables
-#define MAX_VB_SIZE 2048
-#define MAX_TRI_POINTS MAX_VB_SIZE/3
-#define MAX_TRI_IB_SIZE 3*MAX_TRI_POINTS
-#define MAX_QUAD_POINTS MAX_VB_SIZE/4
-#define MAX_QUAD_IB_SIZE 6*MAX_QUAD_POINTS
-
-DX8IndexBufferClass *Tris, *Quads; // Index buffers.
-SortingIndexBufferClass *SortingTris, *SortingQuads; // Sorting index buffers.
-
-/**************************************************************************
- * PointGroupClass::PointGroupClass -- PointGroupClass CTor. *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 11/17/1998 NH : Created. *
- *========================================================================*/
-PointGroupClass::PointGroupClass(void) :
- PointLoc(NULL),
- PointDiffuse(NULL),
- APT(NULL),
- PointSize(NULL),
- PointOrientation(NULL),
- PointFrame(NULL),
- PointCount(0),
- FrameRowColumnCountLog2(0),
- Texture(NULL),
- Flags(0),
- Shader(ShaderClass::_PresetAdditiveSpriteShader),
- PointMode(TRIS),
- DefaultPointSize(0.0f),
- DefaultPointColor(1.0f, 1.0f, 1.0f),
- DefaultPointAlpha(1.0f),
- DefaultPointOrientation(0),
- DefaultPointFrame(0),
- VPXMin(0.0f),
- VPYMin(0.0f),
- VPXMax(0.0f),
- VPYMax(0.0f)
-{
-}
-
-/**************************************************************************
- * PointGroupClass::~PointGroupClass -- PointGroupClass DTor. *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 11/17/1998 NH : Created. *
- *========================================================================*/
-PointGroupClass::~PointGroupClass(void)
-{
- if (PointLoc) {
- PointLoc->Release_Ref();
- PointLoc = NULL;
- }
- if (PointDiffuse) {
- PointDiffuse->Release_Ref();
- PointDiffuse=NULL;
- }
- if (APT) {
- APT->Release_Ref();
- APT = NULL;
- }
- if (PointSize) {
- PointSize->Release_Ref();
- PointSize = NULL;
- }
- if (PointOrientation) {
- PointOrientation->Release_Ref();
- PointOrientation = NULL;
- }
- if (PointFrame) {
- PointFrame->Release_Ref();
- PointFrame = NULL;
- }
- if (Texture) {
- REF_PTR_RELEASE(Texture);
- Texture = NULL;
- }
-}
-
-/**************************************************************************
- * PointGroupClass::operator = -- PointGroupClass assignment operator. *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 11/17/1998 NH : Created. *
- *========================================================================*/
-PointGroupClass & PointGroupClass::operator = (const PointGroupClass & that)
-{
- if (this != &that) {
- WWASSERT(0); // If you hit this assert implement the function!
- }
- return *this;
-}
-
-
-/**************************************************************************
- * PointGroupClass::Set_Arrays -- Set point location/color/enable arrays. *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * NOTES: colors, alphas, APT, sizes, orientations and frames are *
- * optional. active_point_count can also be used with a NULL apt.*
- * In this case active_point_count is ignored if it is -1 *
- * (default value) and otherwise it indicates the first N active *
- * points in the arrays. *
- * The view plane rectangle may optionally be passed as well - *
- * this is only used in SCREENSPACE mode. *
- * *
- * HISTORY: *
- * 11/17/1998 NH : Created. *
- * 08/25/1999 NH : Alphas added. *
- * 06/28/2000 NH : Orientations and frames added. *
- * 02/08/2001 HY : Upgraded to DX8 *
- *========================================================================*/
-void PointGroupClass::Set_Arrays(
- ShareBufferClass *locs,
- ShareBufferClass *diffuse,
- ShareBufferClass *apt,
- ShareBufferClass *sizes,
- ShareBufferClass *orientations,
- ShareBufferClass *frames,
- int active_point_count,
- float vpxmin,
- float vpymin,
- float vpxmax,
- float vpymax)
-{
- // The point locations array is NOT optional!
- WWASSERT(locs);
-
- // Ensure lengths of all arrays are the same:
- WWASSERT(!diffuse || locs->Get_Count() == diffuse->Get_Count());
- WWASSERT(!apt || locs->Get_Count() == apt->Get_Count());
- WWASSERT(!sizes || locs->Get_Count() == sizes->Get_Count());
- WWASSERT(!orientations || locs->Get_Count() == orientations->Get_Count());
- WWASSERT(!frames || locs->Get_Count() == frames->Get_Count());
-
- REF_PTR_SET(PointLoc,locs);
- REF_PTR_SET(PointDiffuse,diffuse);
- REF_PTR_SET(APT,apt);
- REF_PTR_SET(PointSize,sizes);
- REF_PTR_SET(PointOrientation,orientations);
- REF_PTR_SET(PointFrame,frames);
-
- if (APT) {
- PointCount = active_point_count;
- } else {
- PointCount = (active_point_count >= 0) ? active_point_count : PointLoc->Get_Count();
- }
-
- // Store view plane rectangle (only used in SCREENSPACE mode)
- VPXMin = vpxmin;
- VPYMin = vpymin;
- VPXMax = vpxmax;
- VPYMax = vpymax;
-}
-
-/**************************************************************************
- * PointGroupClass::Set_Point_Size -- Set default point size. *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: This size is ignored if a size array is present. *
- * *
- * HISTORY: *
- * 11/17/1998 NH : Created. *
- *========================================================================*/
-void PointGroupClass::Set_Point_Size(float size)
-{
- DefaultPointSize = size;
-}
-
-
-/**************************************************************************
- * PointGroupClass::Get_Point_Size -- Get default point size. *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: This size is ignored if a size array is present. *
- * *
- * HISTORY: *
- * 11/17/1998 NH : Created. *
- *========================================================================*/
-float PointGroupClass::Get_Point_Size(void)
-{
- return DefaultPointSize;
-}
-
-
-/**************************************************************************
- * PointGroupClass::Set_Point_Color -- Set default point color. *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: This color is ignored if a color array is present. *
- * *
- * HISTORY: *
- * 04/20/1999 NH : Created. *
- *========================================================================*/
-void PointGroupClass::Set_Point_Color(Vector3 color)
-{
- DefaultPointColor = color;
-}
-
-/**************************************************************************
- * PointGroupClass::Get_Point_Color -- Get default point color. *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: This color is ignored if a color array is present. *
- * *
- * HISTORY: *
- * 04/20/1999 NH : Created. *
- *========================================================================*/
-Vector3 PointGroupClass::Get_Point_Color(void)
-{
- return DefaultPointColor;
-}
-
-/**************************************************************************
- * PointGroupClass::Set_Point_Alpha -- Set default point alpha. *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: This alpha is ignored if an alpha array is present. *
- * *
- * HISTORY: *
- * 08/25/1999 NH : Created. *
- *========================================================================*/
-void PointGroupClass::Set_Point_Alpha(float alpha)
-{
- DefaultPointAlpha = alpha;
-}
-
-
-/**************************************************************************
- * PointGroupClass::Get_Point_Alpha -- Get default point alpha. *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: This alpha is ignored if an alpha array is present. *
- * *
- * HISTORY: *
- * 08/25/1999 NH : Created. *
- *========================================================================*/
-float PointGroupClass::Get_Point_Alpha(void)
-{
- return DefaultPointAlpha;
-}
-
-
-/**************************************************************************
- * PointGroupClass::Set_Point_Orientation -- Set default point orientation*
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: This is ignored if an orientation array is present. *
- * *
- * NOTE: No need to ensure value in valid range - it will be masked later.*
- * *
- * HISTORY: *
- * 06/28/2000 NH : Created. *
- *========================================================================*/
-void PointGroupClass::Set_Point_Orientation(unsigned char orientation)
-{
- DefaultPointOrientation = orientation;
-}
-
-
-/**************************************************************************
- * PointGroupClass::Get_Point_Orientation -- Get default point orientation*
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: This is ignored if an orientation array is present. *
- * *
- * HISTORY: *
- * 06/28/2000 NH : Created. *
- *========================================================================*/
-unsigned char PointGroupClass::Get_Point_Orientation(void)
-{
- return DefaultPointOrientation;
-}
-
-
-/**************************************************************************
- * PointGroupClass::Set_Point_Frame -- Set default point frame. *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: This frame is ignored if an frame array is present. *
- * *
- * NOTE: No need to ensure value in valid range - it will be masked later.*
- * *
- * HISTORY: *
- * 06/28/2000 NH : Created. *
- *========================================================================*/
-void PointGroupClass::Set_Point_Frame(unsigned char frame)
-{
- DefaultPointFrame = frame;
-}
-
-
-/**************************************************************************
- * PointGroupClass::Get_Point_Frame -- Get default point frame. *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: This frame is ignored if an frame array is present. *
- * *
- * HISTORY: *
- * 06/28/2000 NH : Created. *
- *========================================================================*/
-unsigned char PointGroupClass::Get_Point_Frame(void)
-{
- return DefaultPointFrame;
-}
-
-
-/**************************************************************************
- * PointGroupClass::Set_Point_Mode -- Set point rendering method. *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 11/17/1998 NH : Created. *
- *========================================================================*/
-void PointGroupClass::Set_Point_Mode(PointModeEnum mode)
-{
- PointMode = mode;
-}
-
-
-/**************************************************************************
- * PointGroupClass::Get_Point_Mode -- Get point rendering method. *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 11/17/1998 NH : Created. *
- *========================================================================*/
-PointGroupClass::PointModeEnum PointGroupClass::Get_Point_Mode(void)
-{
- return PointMode;
-}
-
-
-/**************************************************************************
- * Set_Flag -- PointGroupClass::Set given flag to on or off. *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 11/17/1998 NH : Created. *
- *========================================================================*/
-void PointGroupClass::Set_Flag(FlagsType flag, bool onoff)
-{
- if (onoff) Flags|=1<>flag) & 0x1;
-}
-
-/**************************************************************************
- * PointGroupClass::Set_Texture -- Set texture used. *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 11/17/1998 NH : Created. *
- * 02/08/2001 HY : Upgraded to DX8 *
- *========================================================================*/
-void PointGroupClass::Set_Texture(TextureClass* texture)
-{
- REF_PTR_SET(Texture,texture);
-}
-
-/**************************************************************************
- * PointGroupClass::Get_Texture -- Get texture used. *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 11/17/1998 NH : Created. *
- * 02/08/2001 HY : Upgraded to DX8 *
- *========================================================================*/
-TextureClass * PointGroupClass::Get_Texture(void)
-{
- if (Texture) Texture->Add_Ref();
- return Texture;
-}
-
-
-/***********************************************************************************************
- * PointGroupClass::Peek_Texture -- Peeks texture *
- * *
- * *
- * *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 4/12/2001 hy : Created. *
- *=============================================================================================*/
-TextureClass * PointGroupClass::Peek_Texture(void)
-{
- return Texture;
-}
-
-/**************************************************************************
- * PointGroupClass::Set_Shader -- Set shader used. *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: the primary gradient will be set to MODULATE/DISABLE in *
- * the shader depending on whether a color or alpha array was *
- * passed in Set_Point_Arrays. also, texturing will be *
- * enabled or disabled dependent on whether a non-NULL *
- * texture was set. *
- * these will override the primary gradient/texturing *
- * settings in the given shader. *
- * *
- * HISTORY: *
- * 11/17/1998 NH : Created. *
- * 02/08/2001 HY : Upgraded to DX8 *
- *========================================================================*/
-void PointGroupClass::Set_Shader(ShaderClass shader)
-{
- Shader = shader;
-}
-
-
-/**************************************************************************
- * PointGroupClass::Get_Shader -- Get shader used. *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 11/17/1998 NH : Created. *
- * 02/08/2001 HY : Upgraded to DX8 *
- *========================================================================*/
-ShaderClass PointGroupClass::Get_Shader(void)
-{
- return Shader;
-}
-
-/**************************************************************************
- * PointGroupClass::Set_Billboard -- Set whether to Billboard. *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 04/25/2002 JM : Created. *
- *========================================================================*/
-void PointGroupClass::Set_Billboard(bool shouldBillboard)
-{
- Billboard = shouldBillboard;
-}
-
-/**************************************************************************
- * PointGroupClass::Get_Billboard -- Get whether to Billboard. *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 04/25/2002 JM : Created. *
- *========================================================================*/
-bool PointGroupClass::Get_Billboard(void)
-{
- return Billboard;
-}
-
-/**************************************************************************
- * PointGroupClass::Get_Frame_Row_Column_Count_Log2 -- what it says *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 06/28/2000 NH : Created. *
- * 02/08/2001 HY : Upgraded to DX8 *
- *========================================================================*/
-unsigned char PointGroupClass::Get_Frame_Row_Column_Count_Log2(void)
-{
- return FrameRowColumnCountLog2;
-}
-
-
-/**************************************************************************
- * PointGroupClass::Set_Frame_Row_Column_Count_Log2 -- what it says. *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 06/28/2000 NH : Created. *
- * 02/08/2001 HY : Upgraded to DX8 *
- *========================================================================*/
-void PointGroupClass::Set_Frame_Row_Column_Count_Log2(unsigned char frccl2)
-{
- FrameRowColumnCountLog2 = MIN(frccl2, 4);
-}
-
-/**************************************************************************
- * PointGroupClass::Get_Polygon_Count -- Get estimated polygon count. *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 11/18/1998 NH : Created. *
- * 02/08/2001 HY : Upgraded to DX8 *
- *========================================================================*/
-int PointGroupClass::Get_Polygon_Count(void)
-{
- switch (PointMode) {
- case TRIS:
- case SCREENSPACE:
- return PointCount;
- break;
- case QUADS:
- return PointCount * 2;
- break;
- }
- WWASSERT(0);
- return 0;
-}
-
-/**************************************************************************
- * PointGroupClass::Render -- draw point group. *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 12/10/1998 NH : Created. *
- * 02/08/2001 HY : Upgraded to DX8 *
- *========================================================================*/
-static SimpleVecClass remap;
-void PointGroupClass::Render(RenderInfoClass &rinfo)
-{
- /// @todo lorenzen asks: is particle culling in the shader perhaps faster than in DoParticles? Fix winding and find out...
- // NB: the winding for pointgroups is wrong, but we
- // are disabling culling for particles anyway
- Shader.Set_Cull_Mode(ShaderClass::CULL_MODE_DISABLE);
-
- // If no points, do nothing:
- if (PointCount == 0) return;
-
- WWASSERT(PointLoc && PointLoc->Get_Array());
-
- // Process texture reductions:
-// if (Texture) Texture->Process_Reduction();
-
- // Pointers which point into existing buffers (member or static):
- Vector3 *current_loc = NULL;
- Vector4 *current_diffuse = NULL;
- float *current_size = NULL;
- unsigned char *current_orient = NULL;
- unsigned char *current_frame = NULL;
-
- // If there is a color or alpha array enable gradient in shader - otherwise disable.
- float value_255 = 0.9961f; //254 / 255
- bool default_white_opaque = ( DefaultPointColor.X > value_255 &&
- DefaultPointColor.Y > value_255 &&
- DefaultPointColor.Z > value_255 &&
- DefaultPointAlpha > value_255);
-
- // The reason we check for lack of texture here is that SR seems to render black triangles
- // rather than white triangles as would be expected) when there is no texture AND no gradient.
- if (PointDiffuse || !default_white_opaque || !Texture) {
- Shader.Set_Primary_Gradient(ShaderClass::GRADIENT_MODULATE);
- } else {
- Shader.Set_Primary_Gradient(ShaderClass::GRADIENT_DISABLE);
- }
-
- // If Texture is non-NULL enable texturing in shader - otherwise disable.
- if (Texture) {
- Shader.Set_Texturing(ShaderClass::TEXTURING_ENABLE);
- } else {
- Shader.Set_Texturing(ShaderClass::TEXTURING_DISABLE);
- }
-
- // If there is an active point table, use it to compress the point
- // locations/colors/alphas/sizes/orientations/frames.
- if (APT) {
- // Resize compressed result arrays if needed (2x guardband to prevent
- // frequent reallocations):
-
- /// @todo lorenzen sez: precompute pointers to indexed array elements, below
-
- if (compressed_loc.Length() < PointCount) {
- compressed_loc.Resize(PointCount * 2);
- }
- VectorProcessorClass::CopyIndexed(&compressed_loc[0],
- PointLoc->Get_Array(), APT->Get_Array(), PointCount);
- current_loc = &compressed_loc[0];
- if (PointDiffuse) {
- if (compressed_diffuse.Length() < PointCount) {
- compressed_diffuse.Resize(PointCount * 2);
- }
- VectorProcessorClass::CopyIndexed(&compressed_diffuse[0],
- PointDiffuse->Get_Array(), APT->Get_Array(), PointCount);
- current_diffuse = &compressed_diffuse[0];
- }
- if (PointSize) {
- if (compressed_size.Length() < PointCount) {
- compressed_size.Resize(PointCount * 2);
- }
- VectorProcessorClass::CopyIndexed(&compressed_size[0],
- PointSize->Get_Array(), APT->Get_Array(), PointCount);
- current_size = &compressed_size[0];
- }
- if (PointOrientation) {
- if (compressed_orient.Length() < PointCount) {
- compressed_orient.Resize(PointCount * 2);
- }
- VectorProcessorClass::CopyIndexed(&compressed_orient[0],
- PointOrientation->Get_Array(), APT->Get_Array(), PointCount);
- current_orient = &compressed_orient[0];
- }
- if (PointFrame) {
- if (compressed_frame.Length() < PointCount) {
- compressed_frame.Resize(PointCount * 2);
- }
- VectorProcessorClass::CopyIndexed(&compressed_frame[0],
- PointFrame->Get_Array(), APT->Get_Array(), PointCount);
- current_frame = &compressed_frame[0];
- }
- } else {
- current_loc = PointLoc->Get_Array();
- if (PointDiffuse) {
- current_diffuse = PointDiffuse->Get_Array();
- }
- if (PointSize) {
- current_size = PointSize->Get_Array();
- }
- if (PointOrientation) {
- current_orient = PointOrientation->Get_Array();
- }
- if (PointFrame) {
- current_frame = PointFrame->Get_Array();
- }
- }
-
- // Get the world and view matrices
- Matrix4x4 view;
- DX8Wrapper::Get_Transform(D3DTS_VIEW,view);
-
- // Transform the point locations from worldspace to camera space if needed
- // (i.e. if they are not already in camera space):
-
- // need to interrupt this processing. If we are not billboarding, then we need the actual position
- // of the vertice to lay it down flat.
-
- // (gth) changed this 'if' to use OR rather than AND... The way it was caused all emitters to break
- if (Get_Flag(TRANSFORM) && Billboard) {
- // Resize transformed location array if needed (2x guardband to prevent
- // frequent reallocations):
- if (transformed_loc.Length() < PointCount) {
- transformed_loc.Resize(PointCount * 2);
- }
- // Not using vector processor class because we are discarding w
- // Not using T&L in DX8 because we don't want DX8 to transform
- // 3 times per particle when we can do it once
- for (int i=0; iGet_Count(), vnum, pnum);
-
- // the locations are now in view space
- // so set world and view matrices to identity and render
-
- Matrix4x4 identity(true);
- DX8Wrapper::Set_Transform(D3DTS_WORLD,identity);
- DX8Wrapper::Set_Transform(D3DTS_VIEW,identity);
-
- DX8Wrapper::Set_Material(PointMaterial);
- DX8Wrapper::Set_Shader(Shader);
- DX8Wrapper::Set_Texture(0,Texture);
-
- // Enable sorting if the primitives are translucent and alpha testing is not enabled.
- const bool sort = (Shader.Get_Dst_Blend_Func() != ShaderClass::DSTBLEND_ZERO) && (Shader.Get_Alpha_Test() == ShaderClass::ALPHATEST_DISABLE) && (WW3D::Is_Sorting_Enabled());
-
- IndexBufferClass *indexbuffer;
- int verticesperprimitive;/// lorenzen fixed
- int current;
- int delta;
-
- /// @todo lorenzen sez: if tri-based particles are not supported, elim this test
- if (PointMode == QUADS) {
- verticesperprimitive = 2;
- indexbuffer = sort ? static_cast (SortingQuads) : static_cast (Quads);
- } else {
- verticesperprimitive = 3;
- indexbuffer = sort ? static_cast (SortingTris) : static_cast (Tris);
- }
-
- current = 0;
- while (current MAX_VOLUME_PARTICLE_DEPTH )
- depth = MAX_VOLUME_PARTICLE_DEPTH; // sanity
-
- Shader.Set_Cull_Mode(ShaderClass::CULL_MODE_DISABLE);
-
- if (PointCount == 0)
- return;
-
- WWASSERT(PointLoc && PointLoc->Get_Array());
-
- // Pointers which point into existing buffers (member or static):
- Vector3 *current_loc = NULL;
- Vector4 *current_diffuse = NULL;
- float *current_size = NULL;
- unsigned char *current_orient = NULL;
- unsigned char *current_frame = NULL;
-
- // If there is a color or alpha array enable gradient in shader - otherwise disable.
- float value_255 = 0.9961f; //254 / 255
- bool default_white_opaque = ( DefaultPointColor.X > value_255 &&
- DefaultPointColor.Y > value_255 &&
- DefaultPointColor.Z > value_255 &&
- DefaultPointAlpha > value_255);
-
- // The reason we check for lack of texture here is that SR seems to render black triangles
- // rather than white triangles as would be expected) when there is no texture AND no gradient.
- if (PointDiffuse || !default_white_opaque || !Texture) {
- Shader.Set_Primary_Gradient(ShaderClass::GRADIENT_MODULATE);
- } else {
- Shader.Set_Primary_Gradient(ShaderClass::GRADIENT_DISABLE);
- }
-
- // If Texture is non-NULL enable texturing in shader - otherwise disable.
- if (Texture) {
- Shader.Set_Texturing(ShaderClass::TEXTURING_ENABLE);
- } else {
- Shader.Set_Texturing(ShaderClass::TEXTURING_DISABLE);
- }
-
- // Get the world and view matrices
- Matrix4x4 view;
- DX8Wrapper::Get_Transform(D3DTS_VIEW,view);
-
-
-
- //// VOLUME_PARTICLE LOOP ///////////////
- for ( int t = 0; t < depth; ++t )
- {
-
-
-
-
-
- // If there is an active point table, use it to compress the point
- // locations/colors/alphas/sizes/orientations/frames.
- if (APT) {
- // Resize compressed result arrays if needed (2x guardband to prevent
- // frequent reallocations):
-
- /// @todo lorenzen sez: precompute pointers to indexed array elements, below
-
- if (compressed_loc.Length() < PointCount) {
- compressed_loc.Resize(PointCount * 2);
- }
- VectorProcessorClass::CopyIndexed(&compressed_loc[0],
- PointLoc->Get_Array(), APT->Get_Array(), PointCount);
- current_loc = &compressed_loc[0];
- if (PointDiffuse) {
- if (compressed_diffuse.Length() < PointCount) {
- compressed_diffuse.Resize(PointCount * 2);
- }
- VectorProcessorClass::CopyIndexed(&compressed_diffuse[0],
- PointDiffuse->Get_Array(), APT->Get_Array(), PointCount);
- current_diffuse = &compressed_diffuse[0];
- }
- if (PointSize) {
- if (compressed_size.Length() < PointCount) {
- compressed_size.Resize(PointCount * 2);
- }
- VectorProcessorClass::CopyIndexed(&compressed_size[0],
- PointSize->Get_Array(), APT->Get_Array(), PointCount);
- current_size = &compressed_size[0];
- }
- if (PointOrientation) {
- if (compressed_orient.Length() < PointCount) {
- compressed_orient.Resize(PointCount * 2);
- }
- VectorProcessorClass::CopyIndexed(&compressed_orient[0],
- PointOrientation->Get_Array(), APT->Get_Array(), PointCount);
- current_orient = &compressed_orient[0];
- }
- if (PointFrame) {
- if (compressed_frame.Length() < PointCount) {
- compressed_frame.Resize(PointCount * 2);
- }
- VectorProcessorClass::CopyIndexed(&compressed_frame[0],
- PointFrame->Get_Array(), APT->Get_Array(), PointCount);
- current_frame = &compressed_frame[0];
- }
- } else {
- current_loc = PointLoc->Get_Array();
- if (PointDiffuse) {
- current_diffuse = PointDiffuse->Get_Array();
- }
- if (PointSize) {
- current_size = PointSize->Get_Array();
- }
- if (PointOrientation) {
- current_orient = PointOrientation->Get_Array();
- }
- if (PointFrame) {
- current_frame = PointFrame->Get_Array();
- }
- }
-
-
-
-
-
- // Transform the point locations from worldspace to camera space if needed
- // (i.e. if they are not already in camera space):
-
- // need to interrupt this processing. If we are not billboarding, then we need the actual position
- // of the vertice to lay it down flat.
- if (Get_Flag(TRANSFORM) && Billboard) {
- // Resize transformed location array if needed (2x guardband to prevent
- // frequent reallocations):
- if (transformed_loc.Length() < PointCount) {
- transformed_loc.Resize(PointCount * 2);
- }
- // Not using vector processor class because we are discarding w
- // Not using T&L in DX8 because we don't want DX8 to transform
- // 3 times per particle when we can do it once
- float recipDepth = 0.1f / (float)depth;
-
- float shiftInc = ( t * *current_size * recipDepth );
-
- Vector3 volumeLayerShift;
- Vector3 cameraPosition = rinfo.Camera.Get_Position();
-
- for (int i=0; iX *= attenuator;
- //current_diffuse->Y *= attenuator;
- //current_diffuse->Z *= attenuator;
- //current_diffuse->W *= attenuator;
-
- Update_Arrays(current_loc, current_diffuse, current_size, current_orient, current_frame,
- PointCount, PointLoc->Get_Count(), vnum, pnum);
-
- // the locations are now in view space
- // so set world and view matrices to identity and render
-
- Matrix4x4 identity(true);
- DX8Wrapper::Set_Transform(D3DTS_WORLD,identity);
- DX8Wrapper::Set_Transform(D3DTS_VIEW,identity);
-
- DX8Wrapper::Set_Material(PointMaterial);
- DX8Wrapper::Set_Shader(Shader);
- DX8Wrapper::Set_Texture(0,Texture);
-
- // Enable sorting if the primitives are translucent and alpha testing is not enabled.
- const bool sort = (Shader.Get_Dst_Blend_Func() != ShaderClass::DSTBLEND_ZERO) && (Shader.Get_Alpha_Test() == ShaderClass::ALPHATEST_DISABLE) && (WW3D::Is_Sorting_Enabled());
-
- IndexBufferClass *indexbuffer;
- int verticesperprimitive;/// lorenzen fixed
- int current;
- int delta;
-
- /// @todo lorenzen sez: if tri-based particles are not supported, elim this test
- if (PointMode == QUADS) {
- verticesperprimitive = 2;
- indexbuffer = sort ? static_cast (SortingQuads) : static_cast (Quads);
- } else {
- verticesperprimitive = 3;
- indexbuffer = sort ? static_cast (SortingTris) : static_cast (Tris);
- }
-
-
- float nudge = 0;
-
- current = 0;
- while (current.
-*/
-
-/***************************************************************************
- *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
- ***************************************************************************
- * *
- * Project Name : G *
- * *
- * $Archive:: /Commando/Code/ww3d2/pointgr.h $*
- * *
- * $Author:: Naty_h $*
- * *
- * $Modtime:: 8/02/01 8:34p $*
- * *
- * $Revision:: 10 $*
- * *
- *-------------------------------------------------------------------------*
- * Functions: *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-#if defined(_MSC_VER)
-#pragma once
-#endif
-
-#ifndef POINTGR_H
-#define POINTGR_H
-
-#include "sharebuf.h"
-#include "shader.h"
-#include "vector4.h"
-#include "vector3.h"
-#include "vector2.h"
-#include "Vector.H"
-
-class VertexMaterialClass;
-class RenderInfoClass;
-class TextureClass;
-
-/*
-** PointGroupClass -- a custom object for rendering
-** groups of points (such as particle systems).
-** It is possible to change mode/number of points/shader/etc. but these
-** changes tend to be expensive if done often. Expected usage is to set the
-** point location/color/active arrays each frame the object is visible (with
-** the same number of points) and perform other changes relatively rarely.
-** NOTE: Currently it is implemented using general triangles (1 or 2 per
-** point), so it is probably suboptimal for software rasterization devices
-** (which would probably perform better with some kind of blit/sprite code).
-*/
-class PointGroupClass
-{
-public:
-
- enum PointModeEnum {
- TRIS, // each point is a triangle
- QUADS, // each point is a quad formed out of two triangles
- SCREENSPACE // each point is a tri placed to affect certain pixels (should be used with 2D camera)
- };
-
- enum FlagsType {
- TRANSFORM, // transform points w. modelview matrix (worldspace points)
- };
-
- PointGroupClass(void);
- virtual ~PointGroupClass(void);
- PointGroupClass & operator = (const PointGroupClass & that);
-
- // PointGroupClass interface:
- void Set_Arrays(ShareBufferClass *locs,
- ShareBufferClass *diffuse = NULL,
- ShareBufferClass *apt = NULL,
- ShareBufferClass *sizes = NULL,
- ShareBufferClass *orientations = NULL,
- ShareBufferClass *frames = NULL,
- int active_point_count = -1,
- float vpxmin = 0.0f, float vpymin = 0.0f,
- float vpxmax = 0.0f, float vpymax = 0.0f);
- void Set_Point_Size(float size);
- float Get_Point_Size(void);
- void Set_Point_Color(Vector3 color);
- Vector3 Get_Point_Color(void);
- void Set_Point_Alpha(float alpha);
- float Get_Point_Alpha(void);
- void Set_Point_Orientation(unsigned char orientation);
- unsigned char Get_Point_Orientation(void);
- void Set_Point_Frame(unsigned char frame);
- unsigned char Get_Point_Frame(void);
- void Set_Point_Mode(PointModeEnum mode);
- PointModeEnum Get_Point_Mode(void);
- void Set_Flag(FlagsType flag, bool onoff);
- int Get_Flag(FlagsType flag);
- void Set_Texture(TextureClass* texture);
- TextureClass * Get_Texture(void);
- TextureClass * Peek_Texture(void);
- void Set_Shader(ShaderClass shader);
- ShaderClass Get_Shader(void);
- void Set_Billboard(bool shouldBillboard);
- bool Get_Billboard(void);
-
- // The frame property is taken from a set of possible frames. The rows/columns in the frame
- // texture determine the number of possible frames. Since it must be a power of 2, we represent
- // it as its log base 2. This number cannot be greater than 4 (which corresponds to a 16x16
- // square of frames, i.e. 256 frames).
- unsigned char Get_Frame_Row_Column_Count_Log2(void);
- void Set_Frame_Row_Column_Count_Log2(unsigned char frccl2);
-
- int Get_Polygon_Count(void);
-
- void Render(RenderInfoClass &rinfo);
- void RenderVolumeParticle(RenderInfoClass &rinfo, unsigned int depth);
-
-protected:
- // Update arrays.
- void Update_Arrays(Vector3 *point_loc,
- Vector4 *point_diffuse,
- float *point_size,
- unsigned char *point_orientation,
- unsigned char *point_frame,
- int active_points,
- int total_points,
- int &vnum,
- int &pnum);
-
- // These shared buffers are used for communication to the point group - to
- // pass point locations, colors and enables. The location and color arrays
- // are 'compressed' using the active point table (if present) and then
- // are processed into other arrays which are passed to the GERD.
- // SR rather than WWMath types are used so Vector Processors can be used.
- // The arrays override the default value if present.
- // The orientation and frame properties are "index properties": they select one out of a small
- // group of possibilities for each point.
- // Orientation: this is the 2D rotation of the point about its center. There are 256 discrete
- // orientations. The unit circle is evenly subdivided 256 times to create the set of
- // orientations. The reason we discretize orientation is for performance: this way we can
- // precalculate vertex offsets.
- // Frame: the texture is divided into a 2D square grid, and each point uses one grid square
- // instead of the whole texture. The number of possible frames is not invariant - it depends
- // on the number of rows / columns in the grid. The reason we do this instead of having
- // different textures is to avoid texture state changes. Also for performance reasons, the
- // number of possible frames must be a power of two - for this reason the number of frame rows
- // and columns, orientations, etc. are represented as the log base 2 of the actual number.
- ShareBufferClass * PointLoc; // World/cameraspace point locs
- ShareBufferClass * PointDiffuse; // (NULL if not used) RGBA values
- ShareBufferClass * APT; // (NULL if not used) active point table
- ShareBufferClass * PointSize; // (NULL if not used) size override table
- ShareBufferClass * PointOrientation; // (NULL if not used) orientation indices
- ShareBufferClass * PointFrame; // (NULL if not used) frame indices
- int PointCount; // Active (if APT) or total point count
-
- // See comments for Get/Set_Frame_Row_Column_Count_Log2 above
- unsigned char FrameRowColumnCountLog2; // MUST be equal or lesser than 4
-
- // These parameters are passed to the GERD:
- TextureClass* Texture;
- ShaderClass Shader; // (default created in CTor)
-
- // Internal state:
- PointModeEnum PointMode; // are points tris or quads?
- unsigned int Flags; // operation control flags
- float DefaultPointSize; // point size (size array overrides if present)
- Vector3 DefaultPointColor; // point color (color array overrides if present)
- float DefaultPointAlpha; // point alpha (alpha array overrides if present)
- unsigned char DefaultPointOrientation;// point orientation (orientation array overrides if present)
- unsigned char DefaultPointFrame; // point texture frame (frame array overrides if present)
-
- // View plane rectangle (only used in SCREENSPACE mode - set by Set_Arrays
- // and used in Update_GERD_Arrays).
- float VPXMin;
- float VPYMin;
- float VPXMax;
- float VPYMax;
-
- bool Billboard;
-
- // Static stuff:
- // For performance / memory reasons we prepare vertex location and UV
- // arrays for various orientations and texture frames, as static data
- // members of this class. This avoids the need to create such arrays over
- // again for each object. The values in the UV arrays are used as-is, the
- // values in the location arrays normally need to be scaled to the point
- // sizes and added to the point location before use. We have distinct sets
- // of arrays for each point mode.
- // There are tables of vertex positions for each of triangle and quad mode
- // with 256 discrete orientations. Each entry contains 3 (for triangle
- // mode) or 4 (for quad mode) Vector3s.
- // There are five tables of texture UVs for each of triangle and quad mode:
- // with 1x1(1), 2x2(4), 4x4(16), 8x8(64) and 16x16(256) frames. Each entry
- // contains 3 (for triangle mode) or 4 (for quad mode) Vector2s.
- // In addition, there is one array of vertex positions for screenspace mode
- // with 2 entries (for size 1 and size 2). Each entry contains 3 Vector3s.
- // the Init function (which is called by WW3D::Init()) creates these
- // arrays, and the Shutdown function (which is called by WW3D::Shutdown()
- // releases them.
-public:
- static void _Init(void);
- static void _Shutdown(void);
-
-private:
- static Vector3 _TriVertexLocationOrientationTable[256][3];
- static Vector3 _QuadVertexLocationOrientationTable[256][4];
- static Vector3 _ScreenspaceVertexLocationSizeTable[2][3];
- static Vector2 *_TriVertexUVFrameTable[5];
- static Vector2 *_QuadVertexUVFrameTable[5];
- static VertexMaterialClass *PointMaterial;
-
- // Static arrays for intermediate calcs (never resized down, just up):
- static VectorClass compressed_loc; // point locations 'compressed' by APT
- static VectorClass compressed_diffuse; // point colors 'compressed' by APT
- static VectorClass compressed_size; // point sizes 'compressed' by APT
- static VectorClass compressed_orient; // point orientations 'compressed' by APT
- static VectorClass compressed_frame; // point frames 'compressed' by APT
- static VectorClass transformed_loc; // transformed point locations
-};
-
-
-class SegmentGroupClass : public PointGroupClass
-{
-public:
- SegmentGroupClass(void);
- virtual ~SegmentGroupClass(void);
-
-};
-
-
-
-#endif
\ No newline at end of file
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/polyinfo.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/polyinfo.cpp
deleted file mode 100644
index ab13c19fde5..00000000000
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/polyinfo.cpp
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
-** 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 .
-*/
-
-/***********************************************************************************************
- *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
- ***********************************************************************************************
- * *
- * Project Name : WW3D *
- * *
- * $Archive:: /Commando/Code/ww3d2/polyinfo.cpp $*
- * *
- * Original Author:: Greg Hjelstrom *
- * *
- * $Author:: Greg_h $*
- * *
- * $Modtime:: 2/07/01 12:50p $*
- * *
- * $Revision:: 3 $*
- * *
- *---------------------------------------------------------------------------------------------*
- * Functions: *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-
-#include "polyinfo.h"
-#include "texture.h"
-#include "vertmaterial.h"
-#include "shader.h"
-
-void PolygonInfoClass::Set_Texture(TextureClass *texture)
-{
- if(texture)
- texture->Add_Ref();
- if(Texture)
- Texture->Release_Ref();
- Texture = texture;
-}
-void PolygonInfoClass::Set_Vertex_Material(VertexMaterialClass *vertexMaterial)
-{
- if(vertexMaterial)
- vertexMaterial->Add_Ref();
- if(VertexMaterial)
- VertexMaterial->Release_Ref();
-
- VertexMaterial = vertexMaterial;
-}
-
-void PolygonInfoClass::Set_Shader(ShaderClass *shader)
-{
- if(Shader)
- delete Shader;
-
- // todo : update for refcounted shaders
- Shader = W3DNEW ShaderClass(* shader);
-}
-
-
-PolygonInfoClass::~PolygonInfoClass()
-{
- if(Texture)
- Texture->Release_Ref();
- if(VertexMaterial)
- VertexMaterial->Release_Ref();
-
- // todo : update for refcounted shaders
- if(Shader)
- delete Shader;
-}
-
-
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/polyinfo.h b/Generals/Code/Libraries/Source/WWVegas/WW3D2/polyinfo.h
deleted file mode 100644
index cccd45e9182..00000000000
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/polyinfo.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
-** 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 .
-*/
-
-/***********************************************************************************************
- *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
- ***********************************************************************************************
- * *
- * Project Name : ww3d *
- * *
- * $Archive:: /Commando/Code/ww3d2/polyinfo.h $*
- * *
- * $Author:: Greg_h $*
- * *
- * $Modtime:: 2/07/01 12:48p $*
- * *
- * $Revision:: 2 $*
- * *
- *---------------------------------------------------------------------------------------------*
- * Functions: *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-
-#ifndef POLYINFO_H
-#define POLYINFO_H
-
-#if _MSC_VER >= 1000
-#pragma once
-#endif // _MSC_VER >= 1000
-
-class TextureClass;
-class VertexMaterialClass;
-class ShaderClass;
-
-
-/**
-** PolyInfo.h
-**
-** This class is a simple storage class that keeps track of a texture, vertex material
-** and a shader.
-**
-*/
-class PolygonInfoClass
-{
-
-public:
-
- TextureClass * Peek_Texture() const { return Texture; }
- VertexMaterialClass * Peek_Vertex_Material() const { return VertexMaterial; }
- ShaderClass * Peek_Shader() const { return Shader; }
-
- void Set_Texture(TextureClass *texture);
- void Set_Vertex_Material(VertexMaterialClass *vertexMaterial);
- void Set_Shader(ShaderClass *shader);
-
- void Set(TextureClass *texture, VertexMaterialClass *vertexMaterial, ShaderClass *shader)
- {
- Set_Texture(texture);
- Set_Vertex_Material(vertexMaterial);
- Set_Shader(shader);
- }
-
- PolygonInfoClass(TextureClass *texture = 0, VertexMaterialClass *vertexMaterial = 0, ShaderClass *shader = 0)
- : Texture(0), VertexMaterial(0), Shader(0)
- {
- Set(texture, vertexMaterial, shader);
- }
-
- ~PolygonInfoClass();
-
-
-protected:
-
- TextureClass *Texture;
- VertexMaterialClass *VertexMaterial;
- ShaderClass *Shader;
-};
-
-#endif
-
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/predlod.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/predlod.cpp
deleted file mode 100644
index fc4e7620c2a..00000000000
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/predlod.cpp
+++ /dev/null
@@ -1,406 +0,0 @@
-/*
-** 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 .
-*/
-
-/***************************************************************************
- *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
- ***************************************************************************
- * *
- * Project Name : G *
- * *
- * $Archive:: /Commando/Code/ww3d2/predlod.cpp $*
- * *
- * $Author:: Jani_p $*
- * *
- * $Modtime:: 9/20/01 10:10a $*
- * *
- * $Revision:: 5 $*
- * *
- *-------------------------------------------------------------------------*
- * Functions: *
- * PredictiveLODOptimizerClass::Clear -- clear object list and total cost*
- * PredictiveLODOptimizerClass::Add_Object -- adds object to list, cost *
- * PredictiveLODOptimizerClass::Optimize_LODs -- does LOD optimization *
- * PredictiveLODOptimizerClass::Free -- releases all memory used. *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-#include "predlod.h"
-#include
-
-/* NOTE: The LODHeapNode and LODHeap classes are defined here for use in the
- * Optimize_LODs() member function. */
-
-// A node entry for a heap. It has no son/father pointers since it will be
-// used in an array implementation of a heap.
-
-/*
-** NOTE: LODHeapNodes contain pointers to RenderObjClass, but these pointers
-** are NOT tracked via refcounting. This is because the heaps are created and
-** destroyed within one function, so all references created are necessary;
-** and performing Add_Ref and Release_Ref every time a pointer is copied
-** would hurt performance.
-*/
-
-class LODHeapNode {
- public:
- LODHeapNode(void) { Item = NULL; }
- LODHeapNode (float key) { Item = NULL; Key = key; }
- LODHeapNode (RenderObjClass * item, float key) { Item = item; Key = key; }
-
- ~LODHeapNode(void) { }
-
- RenderObjClass * Get_Item(void) { return(Item); }
-
- float Get_Key(void) { return(Key); }
- void Set_Key(float key) { Key = key; }
-
- int operator < (const LODHeapNode& node) { return(Key < node.Key); }
- int operator <= (const LODHeapNode& node) { return(Key <= node.Key); }
- int operator > (const LODHeapNode& node) { return(Key > node.Key); }
- int operator >= (const LODHeapNode& node) { return(Key >= node.Key); }
- int operator == (const LODHeapNode& node) { return(Key == node.Key); }
- int operator != (const LODHeapNode& node) { return(Key != node.Key); }
-
- private:
- RenderObjClass *Item;
- float Key;
-};
-
-// A Heap implemented as a complete binary tree in an array.
-class LODHeap {
- public:
- // This constructor receives an array of HeapNodes and arranges it to
- // fulfil the heap condition. Note: the array will be used inside the
- // heap, so it should never be used or deleted outside. The resulting
- // heap is full - no nodes can be added until some are removed.
- LODHeap(int count, LODHeapNode *NodeArray) {
- Nodes = NodeArray;
- Num = Max = count;
- // Now build a heap from the array by working backwards, building
- // subheaps from the bottom up. (starting at the middle of the array
- // since the single-node subtrees at the leaves are already heaps)
- int index;
- for (index = Num/2; index >= 1; index--) Downheap(index);
- }
-
- ~LODHeap(void) {
-// delete []Nodes;
- }
-
- LODHeapNode *Top(void) {
- return &(Nodes[1]);
- }
-
- // This changes the key value of the entry at the top of the heap and
- // adjusts the heap accordingly.
- void Change_Key_Top(float new_key) {
- Nodes[1].Set_Key(new_key);
- Downheap(1);
- }
-
- // This searches for an entry which has a certain Item value, and
- // changes its key to a new one. The heap is then adjusted accordingly.
- void Change_Key(RenderObjClass *item, float new_key) {
- for (int i=1; i <= Num; i++) {
- if (Nodes[i].Get_Item() == item) {
- float old_key = Nodes[i].Get_Key();
- Nodes[i].Set_Key(new_key);
- // If the key has been decreased, adjust the node downwards.
- // Otherwise, adjust it upwards.
- if (new_key < old_key) Downheap(i);
- else Upheap(i);
- break;
- }
- }
- }
-
- private:
- LODHeap(void) {} // Just to ensure the default constructor is not used.
-
- // The node and key arrays have one extra entry because entry [0] is
- // reserved for various uses.
- LODHeapNode * Nodes; // The nodes
-
- int Max; // The maximum number of nodes
- int Num; // the current number of nodes
-
- // Two utility methods used by various other methods: both take a
- // single entry which violates the heap condition and moves it in the
- // heap until the heap condition is fulfilled.
-
- // Upheap takes an entry with a (possibly) overlarge key and moves it
- // up until the heap condition is satisfied. (this is a private
- // method, so no error checking is needed).
- // Note that Upheap puts a sentinel in Nodes[0].
- void Upheap(int index) {
- LODHeapNode node = Nodes[index];
- Nodes[0].Set_Key(FLT_MAX);
- while (Nodes[index/2] <= node) {
- Nodes[index] = Nodes[index/2];
- index = index/2;
- }
- Nodes[index] = node;
- }
-
- // Downheap takes an entry with a (possibly) oversmall key and moves it
- // down until the heap condition is satisfied. (this is a private
- // method, so no error checking is needed).
- void Downheap(int index) {
- LODHeapNode node = Nodes[index];
- while (index <= Num/2) {
- int child_index = index + index;
- if ((child_index < Num) && (Nodes[child_index] < Nodes[child_index+1])) child_index++;
- if (node >= Nodes[child_index]) break;
- Nodes[index] = Nodes[child_index];
- index = child_index;
- }
- Nodes[index] = node;
- }
-};
-
-// Static PredictiveLODOptimizerClass data members:
-RenderObjClass ** PredictiveLODOptimizerClass::ObjectArray = NULL;
-int PredictiveLODOptimizerClass::ArraySize = 0;
-int PredictiveLODOptimizerClass::NumObjects = 0;
-float PredictiveLODOptimizerClass::TotalCost = 0.0f;
-LODHeapNode * PredictiveLODOptimizerClass::VisibleObjArray1;
-LODHeapNode * PredictiveLODOptimizerClass::VisibleObjArray2;
-int PredictiveLODOptimizerClass::VisibleObjArraySize;
-
-
-/**************************************************************************
- * PredictiveLODOptimizerClass::Clear -- clear object list and total cost *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 03/12/1999 NH : Created. *
- *========================================================================*/
-void PredictiveLODOptimizerClass::Clear(void)
-{
- if (ObjectArray) {
- // Release refs to all objects in the list:
- for (int i = 0; i < NumObjects; i++) {
- if (ObjectArray[i]) {
- ObjectArray[i]->Release_Ref();
- ObjectArray[i] = NULL;
- }
- }
- }
-
- TotalCost = 0.0f;
- NumObjects = 0;
-}
-
-
-/**************************************************************************
- * PredictiveLODOptimizerClass::Add_Object -- adds object to list, cost *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 03/12/1999 NH : Created. *
- *========================================================================*/
-void PredictiveLODOptimizerClass::Add_Object(RenderObjClass *robj)
-{
- // If array present but too small, free it and copy it to new array.
- if (ObjectArray) {
- if (ArraySize <= NumObjects) {
- int new_array_size = NumObjects + 100;
- RenderObjClass **new_array = W3DNEWARRAY RenderObjClass *[new_array_size];
- memcpy(new_array, ObjectArray, sizeof(RenderObjClass *) * NumObjects);
- delete [] ObjectArray;
- ObjectArray = new_array;
- ArraySize = new_array_size;
- }
- } else {
- // Create new object array.
- ObjectArray = W3DNEWARRAY RenderObjClass *[100];
- }
-
- // Copy pointer and add ref
- ObjectArray[NumObjects] = robj;
- ObjectArray[NumObjects]->Add_Ref();
- NumObjects++;
-
- float cost = robj->Get_Cost();
- // Some sanity checking so one object doesn't mess up the entire scene
- WWASSERT (cost >= 0.0f);
- WWASSERT (cost < 1.0e6);
- TotalCost += cost;
-}
-
-
-/**************************************************************************
- * PredictiveLODOptimizerClass::Optimize_LODs -- does LOD optimization *
- * *
- * INPUT: float max_cost - the upper bound on the total scene Cost. *
- * *
- * OUTPUT: none. *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 12/08/1997 NH : Created. *
- * 04/23/1997 NH : Ported to SR 1.3. *
- * 03/12/1999 NH : Moved to PredictiveLODOptimizerClass. *
- * *
- * COMMENTS: *
- * This function implements the algorithm outlined in "Adaptive *
- * Display Algorithm for Interactive Frame Rates During Visualization *
- * of Complex Virtual Environments", Thomas Funkhouser & Carlo Sequin, *
- * SIGGRAPH '93 Proceedings, pp. 247-253. *
- * Modifications have been made to support screensize clamping of LODs. *
- *========================================================================*/
-void PredictiveLODOptimizerClass::Optimize_LODs(float max_cost)
-{
- if (!ObjectArray || NumObjects == 0) return;
-
- AllocVisibleObjArrays(NumObjects);
-
- // Allocate and fill arrays. (one extra entry since the zeroth entry is not used).
-// LODHeapNode *visible_obj_array1 = W3DNEWARRAY LODHeapNode[NumObjects + 1];
-// LODHeapNode *visible_obj_array2 = W3DNEWARRAY LODHeapNode[NumObjects + 1];
-
- // Insert objects into arrays: (0th entry reserved for sentinel values)
- for (int i = 0; i < NumObjects; i++) {
- RenderObjClass *robj = ObjectArray[i];
- // We use minus Value for the first queue to make it ordered by minimum Value.
- VisibleObjArray1[i + 1] = LODHeapNode(robj, -(robj->Get_Value()));
- VisibleObjArray2[i + 1] = LODHeapNode(robj, robj->Get_Post_Increment_Value());
- }
-
- // Build priority queues:
- LODHeap min_current_value_queue(NumObjects, VisibleObjArray1);
- LODHeap max_post_increment_value_queue(NumObjects, VisibleObjArray2);
- // These memory areas now are pointed to within the heaps:
-// visible_obj_array1 = NULL;
-// visible_obj_array2 = NULL;
-
- // Main loop: iteratively increment/decrement tuples.
- bool done = false;
- RenderObjClass *max_data, *min_data;
-
- while (!done) {
- // Initialize max_data and min_data so comparison at end of loop uses correct values.
- max_data = NULL;
- min_data = NULL;
-
- // Increment incrementable tuple with maximum next value.
- if (TotalCost <= max_cost) {
- // If tuple with maximum next value is already at maximum lod, all
- // tuples are (since AT_MAX_LOD is smaller than any Value), so stop.
- if (max_post_increment_value_queue.Top()->Get_Key() == RenderObjClass::AT_MAX_LOD) {
- done = true;
- break;
- }
-
- // Get (incrementable) tuple with maximum next value.
- max_data = max_post_increment_value_queue.Top()->Get_Item();
-
- // Increment tuple (and update TotalCost accordingly).
- TotalCost -= max_data->Get_Cost();
- max_data->Increment_LOD();
- TotalCost += max_data->Get_Cost();
-
- // Update priority queues with incremented tuple.
- max_post_increment_value_queue.Change_Key_Top(max_data->Get_Post_Increment_Value());
- min_current_value_queue.Change_Key(max_data, -(max_data->Get_Value()));
- }
-
- // Decrement decerementable tuples with minimum current value.
- while (TotalCost > max_cost) {
- // If tuple with minimum current value is already at minimum lod, all
- // tuples are (since AT_MIN_LOD is smaller than any (negated) Value),
- // so stop.
- if (min_current_value_queue.Top()->Get_Key() == -RenderObjClass::AT_MIN_LOD) {
- done = true;
- break;
- }
-
- // Get (decrementable) tuple with minimum current value.
- min_data = min_current_value_queue.Top()->Get_Item();
-
- // Decrement tuple (and update TotalCost accordingly).
- TotalCost -= min_data->Get_Cost();
- min_data->Decrement_LOD();
- TotalCost += min_data->Get_Cost();
-
- // Update priority queues with incremented tuple.
- min_current_value_queue.Change_Key_Top(-(min_data->Get_Value()));
- max_post_increment_value_queue.Change_Key(min_data, min_data->Get_Post_Increment_Value());
-
- // Check termination criterion (same tuple incremented and decremented).
- if (max_data == min_data) {
- done = true;
- break;
- }
- }
- }
-
- // Clear optimizer:
- Clear();
-}
-
-
-/**************************************************************************
- * PredictiveLODOptimizerClass::Free -- releases all memory used. *
- * *
- * INPUT: *
- * *
- * OUTPUT: *
- * *
- * WARNINGS: *
- * *
- * HISTORY: *
- * 03/12/1999 NH : Created. *
- *========================================================================*/
-void PredictiveLODOptimizerClass::Free(void)
-{
- Clear();
-
- if (ObjectArray) {
- delete [] ObjectArray;
- ObjectArray = NULL;
- ArraySize = 0;
- }
-
- // Only the array number one has been allocated...
- if (VisibleObjArray1) delete[] VisibleObjArray1;
- VisibleObjArray1=NULL;
- VisibleObjArray2=NULL;
- VisibleObjArraySize = 0;
-}
-
-void PredictiveLODOptimizerClass::AllocVisibleObjArrays(int num_objects)
-{
- if (VisibleObjArraySize.
-*/
-
-/***************************************************************************
- *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
- ***************************************************************************
- * *
- * Project Name : G *
- * *
- * $Archive:: /Commando/Code/ww3d2/predlod.h $*
- * *
- * $Author:: Jani_p $*
- * *
- * $Modtime:: 9/20/01 10:10a $*
- * *
- * $Revision:: 3 $*
- * *
- *-------------------------------------------------------------------------*
- * Functions: *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-#if defined(_MSC_VER)
-#pragma once
-#endif
-
-#ifndef PREDLOD_H
-#define PREDLOD_H
-
-// This file contains the classes which support predictive LOD management
-// similar to that outlined in "Adaptive Display Algorithm for Interactive
-// Frame Rates During Visualization of Complex Virtual Environments",
-// Thomas Funkhouser & Carlo Sequin, SIGGRAPH '93 Proceedings, pp. 247-253.
-// To this "pure predictive" LOD we have added distance (actually screensize)
-// clamping to control quality degradation.
-
-#include "rendobj.h"
-#include "float.h"
-#include "Vector.H"
-
-class LODHeapNode;
-
-/*
-** PredictiveLODOptimizerClass: Class which performs the predictive LOD
-** optimization. All the members of this class are static.
-*/
-class PredictiveLODOptimizerClass {
-
- public:
-
- static void Clear(void);
- static void Add_Object(RenderObjClass *robj);
- static void Add_Cost(float cost) { TotalCost += cost; }
- static void Optimize_LODs(float max_cost);
- static float Get_Total_Cost(void) { return TotalCost; }
- static void Free(void); // frees all memory
-
- private:
- static void AllocVisibleObjArrays(int num_objects);
-
- static RenderObjClass ** ObjectArray;
- static int ArraySize;
- static int NumObjects;
- static float TotalCost;
-
- static LODHeapNode *VisibleObjArray1;
- static LODHeapNode *VisibleObjArray2;
- static int VisibleObjArraySize;
-
-};
-
-#endif
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/prim_anim.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/prim_anim.cpp
deleted file mode 100644
index 79fe8e40ba2..00000000000
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/prim_anim.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
-** 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 .
-*/
-
-/***********************************************************************************************
- *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
- ***********************************************************************************************
- * *
- * Project Name : WW3D *
- * *
- * $Archive:: /Commando/Code/ww3d2/prim_anim.cpp $*
- * *
- * Author:: Patrick Smith *
- * *
- * $Modtime:: 1/08/01 10:04a $*
- * *
- * $Revision:: 1 $*
- * *
- *---------------------------------------------------------------------------------------------*
- * Functions: *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-
-#include "prim_anim.h"
-#include "chunkio.h"
-
diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/prim_anim.h b/Generals/Code/Libraries/Source/WWVegas/WW3D2/prim_anim.h
deleted file mode 100644
index c4a00e97322..00000000000
--- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/prim_anim.h
+++ /dev/null
@@ -1,391 +0,0 @@
-/*
-** 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 .
-*/
-
-/***********************************************************************************************
- *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
- ***********************************************************************************************
- * *
- * Project Name : WW3D *
- * *
- * $Archive:: /Commando/Code/ww3d2/prim_anim.h $*
- * *
- * Author:: Patrick Smith *
- * *
- * $Modtime:: 1/29/01 5:43p $*
- * *
- * $Revision:: 2 $*
- * *
- *---------------------------------------------------------------------------------------------*
- * Functions: *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-#if defined(_MSC_VER)
-#pragma once
-#endif
-
-#ifndef __PRIM_ANIM_H
-#define __PRIM_ANIM_H
-
-
-#include "simplevec.h"
-#include "chunkio.h"
-
-
-// Forward declarations
-class ChunkSaveClass;
-class ChunkLoadClass;
-
-
-/////////////////////////////////////////////////////////////////////
-//
-// PrimitiveAnimationChannelClass
-//
-// This template class provides animated 'channels' of data for the
-// RingRenderObjClass and SphereRenderObjClass objects.
-//
-/////////////////////////////////////////////////////////////////////
-template
-class PrimitiveAnimationChannelClass
-{
-public:
-
- /////////////////////////////////////////////////////////
- // Public constructors/destructors
- /////////////////////////////////////////////////////////
- PrimitiveAnimationChannelClass (void)
- : m_LastIndex (0) { }
- virtual ~PrimitiveAnimationChannelClass (void) { Reset (); }
-
- /////////////////////////////////////////////////////////
- // Public data types
- /////////////////////////////////////////////////////////
- class KeyClass
- {
- public:
- KeyClass (void)
- : m_Time (0) {}
-
- KeyClass (const T &value, float time)
- : m_Value (value),
- m_Time (time) {}
-
- float Get_Time (void) const { return m_Time; }
- const T & Get_Value (void) const { return m_Value; }
- T & Get_Value (void) { return m_Value; }
-
- float Set_Time (float time) { m_Time = time; }
- void Set_Value (const T &value) { m_Value = value; }
-
- private:
- T m_Value;
- float m_Time;
- };
-
- /////////////////////////////////////////////////////////
- // Public operators
- /////////////////////////////////////////////////////////
- const PrimitiveAnimationChannelClass &operator= (const PrimitiveAnimationChannelClass &src);
- const KeyClass & operator[] (int index) { return Get_Key (index); }
-
- /////////////////////////////////////////////////////////
- // Public methods
- /////////////////////////////////////////////////////////
- virtual T Evaluate (float time) = 0;
-
- int Get_Key_Count (void) const;
- const KeyClass & Get_Key (int index) const;
- void Set_Key (int index, const T &value, float time);
- void Set_Key_Value (int index, const T &value);
- void Add_Key (const T &value, float time);
- void Insert_Key (int index, const T &value, float time);
- void Delete_Key (int index);
- void Reset (void);
-
- virtual void Save (ChunkSaveClass &csave);
- virtual void Load (ChunkLoadClass &cload);
-
-protected:
-
- /////////////////////////////////////////////////////////
- // Protected constants
- /////////////////////////////////////////////////////////
- enum
- {
- CHUNKID_VARIABLES = 0x03150809,
- };
-
- enum
- {
- VARID_KEY = 1,
- };
-
- /////////////////////////////////////////////////////////
- // Protected methods
- /////////////////////////////////////////////////////////
- void Load_Variables (ChunkLoadClass &cload);
-
-protected:
-
- /////////////////////////////////////////////////////////
- // Protected member data
- /////////////////////////////////////////////////////////
- SimpleDynVecClass< KeyClass > m_Data;
- int m_LastIndex;
-};
-
-
-/////////////////////////////////////////////////////////////////////
-//
-// LERPAnimationChannelClass
-//
-// This template class provides a simple LERP implementation of the
-// Evaluate () method.
-//
-/////////////////////////////////////////////////////////////////////
-template
-class LERPAnimationChannelClass : public PrimitiveAnimationChannelClass
-{
- using PrimitiveAnimationChannelClass