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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions Core/Libraries/Source/WWVegas/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ add_subdirectory(WWDebug)
add_subdirectory(WWDownload)
add_subdirectory(WWLib)
add_subdirectory(WWMath)
add_subdirectory(WWSaveLoad)
add_subdirectory(WWStub)

# Helpful interface to bundle the ww modules together.
Expand All @@ -36,5 +35,4 @@ target_link_libraries(core_wwvegas INTERFACE
# core_wwdownload
core_wwlib
core_wwmath
core_wwsaveload
)
1 change: 0 additions & 1 deletion Core/Libraries/Source/WWVegas/WW3D2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,6 @@ set(WW3D2_SRC
ww3d.h
ww3dformat.cpp
ww3dformat.h
ww3dids.h
ww3dtrig.h
)

Expand Down
3 changes: 0 additions & 3 deletions Core/Libraries/Source/WWVegas/WW3D2/animatedsoundmgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@
#include "WWLib/inisup.h"
#include "WWLib/ffactory.h"
#include "WWLib/WWFILE.h"
#include "WWSaveLoad/definition.h"
#include "WWSaveLoad/definitionmgr.h"
#include "WWSaveLoad/definitionclassids.h"
#include "WWAudio/WWAudio.h"
#include "WWAudio/AudibleSound.h"
#include "htree.h"
Expand Down
140 changes: 0 additions & 140 deletions Core/Libraries/Source/WWVegas/WW3D2/rendobj.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,6 @@
#include "camera.h"
#include "ww3d.h"
#include "WWLib/chunkio.h"
#include "WWSaveLoad/persistfactory.h"
#include "WWSaveLoad/saveload.h"
#include "ww3dids.h"
#include "intersec.h"
#include <Utility/bit_adapter.h>

Expand Down Expand Up @@ -1177,140 +1174,3 @@ void RenderObjClass::Add_Dependencies_To_List
}



/****************************************************************************************


RenderObjClass - Persistent object support.

NOTE: For now, the render obj PersistFactory is going to cheat by simply storing
the name of the render object that was saved. At load time, it will ask the
asset manager for that object again. If the asset manager fails to re-create the
object,


****************************************************************************************/

class RenderObjPersistFactoryClass : public PersistFactoryClass
{
virtual uint32 Chunk_ID() const override;
virtual PersistClass * Load(ChunkLoadClass & cload) const override;
virtual void Save(ChunkSaveClass & csave,PersistClass * obj) const override;

enum
{
RENDOBJFACTORY_CHUNKID_VARIABLES = 0x00555040,
RENDOBJFACTORY_VARIABLE_OBJPOINTER = 0x00,
RENDOBJFACTORY_VARIABLE_NAME,
RENDOBJFACTORY_VARIABLE_TRANSFORM
};
};

static RenderObjPersistFactoryClass _RenderObjPersistFactory;

uint32 RenderObjPersistFactoryClass::Chunk_ID() const
{
return WW3D_PERSIST_CHUNKID_RENDEROBJ;
}

PersistClass * RenderObjPersistFactoryClass::Load(ChunkLoadClass & cload) const
{
RenderObjClass * old_obj = nullptr;
Matrix3D tm(1);
char name[64];
name[0] = '\0';

while (cload.Open_Chunk()) {
switch (cload.Cur_Chunk_ID()) {

case RENDOBJFACTORY_CHUNKID_VARIABLES:

while (cload.Open_Micro_Chunk()) {
switch(cload.Cur_Micro_Chunk_ID()) {
READ_MICRO_CHUNK(cload,RENDOBJFACTORY_VARIABLE_OBJPOINTER,old_obj);
READ_MICRO_CHUNK(cload,RENDOBJFACTORY_VARIABLE_TRANSFORM,tm);
READ_MICRO_CHUNK_STRING(cload,RENDOBJFACTORY_VARIABLE_NAME,name,sizeof(name));
}
cload.Close_Micro_Chunk();
}
break;

default:
WWDEBUG_SAY(("Unhandled Chunk: 0x%X File: %s Line: %d",__FILE__,__LINE__));
break;
};
cload.Close_Chunk();
}

// if the object we saved didn't have a name, replace it with null
if (strlen(name) == 0) {
static int count = 0;
if ( count++ < 10 ) {
WWDEBUG_SAY(("RenderObjPersistFactory attempted to load an un-named render object!"));
WWDEBUG_SAY(("Replacing it with a null render object!"));
}
strcpy(name,"NULL");
}

RenderObjClass * new_obj = WW3DAssetManager::Get_Instance()->Create_Render_Obj(name);

if (new_obj == nullptr) {
static int count = 0;
if ( count++ < 10 ) {
WWDEBUG_SAY(("RenderObjPersistFactory failed to create object: %s!!",name));
WWDEBUG_SAY(("Either the asset for this object is gone or you tried to save a procedural object."));
WWDEBUG_SAY(("Replacing it with a null render object!"));
}
strcpy(name,"NULL");
new_obj = WW3DAssetManager::Get_Instance()->Create_Render_Obj(name);
}

WWASSERT(new_obj != nullptr);
if (new_obj) {
new_obj->Set_Transform(tm);
}

SaveLoadSystemClass::Register_Pointer(old_obj,new_obj);
return new_obj;
}

void RenderObjPersistFactoryClass::Save(ChunkSaveClass & csave,PersistClass * obj) const
{
RenderObjClass * robj = (RenderObjClass *)obj;
const char * name = robj->Get_Name();
const Matrix3D& tm = robj->Get_Transform();

csave.Begin_Chunk(RENDOBJFACTORY_CHUNKID_VARIABLES);
WRITE_MICRO_CHUNK(csave,RENDOBJFACTORY_VARIABLE_OBJPOINTER,robj);
WRITE_MICRO_CHUNK_STRING(csave,RENDOBJFACTORY_VARIABLE_NAME,name);
WRITE_MICRO_CHUNK(csave,RENDOBJFACTORY_VARIABLE_TRANSFORM,tm);
csave.End_Chunk();
}


/*
** RenderObj save-load.
*/
const PersistFactoryClass & RenderObjClass::Get_Factory () const
{
return _RenderObjPersistFactory;
}

bool RenderObjClass::Save (ChunkSaveClass &csave)
{
// This should never hit with the persist factory we're using...
// Yes this looks like a design flaw but the way we're saving render objects is
// a "shortcut". We specifically designed this capability into the persistent
// object system so that we could avoid making all render object's save and
// load themselves if possible.
WWASSERT(0);
return true;
}

bool RenderObjClass::Load (ChunkLoadClass &cload)
{
WWASSERT(0); // this should never hit with the persist factory we're using.
return true;
}


10 changes: 1 addition & 9 deletions Core/Libraries/Source/WWVegas/WW3D2/rendobj.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
#include "WWMath/sphere.h"
#include "coltype.h"
#include "WWMath/aabox.h"
#include "WWSaveLoad/persist.h"
#include "WWLib/multilist.h"
#include "robjlist.h"
#include <float.h>
Expand Down Expand Up @@ -148,7 +147,7 @@ class RenderHookClass
};

// RenderObjClass definition
class RenderObjClass : public RefCountClass , public PersistClass, public MultiListObjectClass
class RenderObjClass : public RefCountClass , public MultiListObjectClass
{
public:

Expand Down Expand Up @@ -482,13 +481,6 @@ class RenderObjClass : public RefCountClass , public PersistClass, public MultiL
void Unset_Is_Self_Shadowed() { Bits&=~IS_SELF_SHADOWED; }
int Is_Self_Shadowed() const { return (Bits&IS_SELF_SHADOWED); }

///////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Persistent object save-load interface
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
virtual const PersistFactoryClass & Get_Factory () const override;
virtual bool Save (ChunkSaveClass &csave) override;
virtual bool Load (ChunkLoadClass &cload) override;

// Application-specific render hook:
RenderHookClass * Get_Render_Hook() { return RenderHook; }
void Set_Render_Hook(RenderHookClass *hook) { if (RenderHook) delete RenderHook; RenderHook = hook; }
Expand Down
Loading
Loading