From 5d3725f9d972cde917ab9b076cb0b89b33557c7a Mon Sep 17 00:00:00 2001 From: Steven Fuller Date: Sun, 4 May 2008 20:47:08 -0700 Subject: Removed a lot of tool code. --- src/win95/animchnk.hpp | 22 -- src/win95/bmpnames.cpp | 26 --- src/win95/bmpnames.hpp | 34 +-- src/win95/chnkload.cpp | 4 - src/win95/chnkload.h | 5 - src/win95/chnktype.cpp | 30 +-- src/win95/chnktype.hpp | 12 +- src/win95/chunk.cpp | 21 -- src/win95/chunk.hpp | 83 +------ src/win95/chunkpal.cpp | 11 - src/win95/chunkpal.hpp | 165 ------------- src/win95/dummyobjectchunk.cpp | 4 - src/win95/enumchnk.cpp | 4 - src/win95/enumsch.cpp | 4 - src/win95/enumsch.hpp | 14 -- src/win95/gsprchnk.cpp | 4 - src/win95/list_tem.hpp | 7 +- src/win95/ltchunk.cpp | 30 --- src/win95/ltchunk.hpp | 8 - src/win95/mishchnk.cpp | 42 ---- src/win95/mishchnk.hpp | 20 -- src/win95/obchunk.cpp | 15 -- src/win95/oechunk.cpp | 9 - src/win95/oechunk.h | 16 +- src/win95/shpchunk.cpp | 520 ----------------------------------------- src/win95/shpchunk.hpp | 4 - src/win95/sndchunk.cpp | 3 - src/win95/sprchunk.cpp | 263 --------------------- src/win95/sprchunk.hpp | 7 - src/win95/toolchnk.cpp | 4 - src/win95/zsp.cpp | 254 -------------------- src/win95/zsp.hpp | 20 -- 32 files changed, 13 insertions(+), 1652 deletions(-) (limited to 'src/win95') diff --git a/src/win95/animchnk.hpp b/src/win95/animchnk.hpp index 531f7f8..2576647 100644 --- a/src/win95/animchnk.hpp +++ b/src/win95/animchnk.hpp @@ -30,9 +30,6 @@ struct FrameList { ~FrameList(); FrameList(TEXANIM*); - #if InterfaceEngine - FrameList(TEXANIM* p,FrameList* templ); - #endif FrameList(TEXANIM* p,FrameList* fl,int* conv); int Speed; int Flags; @@ -44,14 +41,6 @@ struct FrameList int* Textures; int* UVCoords; int spare1,spare2; - - - #if InterfaceEngine - void CopyToSID(int shape,int poly); - void CopyFromSID(int shape,int poly); - void AddFrame(); - void RemoveFrame(); - #endif }; #define AnimFlag_NotPlaying 0x00000001 @@ -61,11 +50,6 @@ struct TEXANIM TEXANIM(); ~TEXANIM(); - #if InterfaceEngine - TEXANIM(int s,int p,int id); - //construct a TEXANIM using templ as a template. - TEXANIM(int s,int p,TEXANIM* templ); - #endif int shape; int poly; int NumVerts; @@ -76,12 +60,6 @@ struct TEXANIM int Identifier; FrameList** Seq; - #if InterfaceEngine - void ChangeFrame(int newseq,int newframe); - void AddSeq(); - void RemoveSeq(); - void CopySeq(int seq_num); - #endif void CopyAnimData(TEXANIM* ta,int* conv); }; diff --git a/src/win95/bmpnames.cpp b/src/win95/bmpnames.cpp index 961ac00..b27e4ea 100644 --- a/src/win95/bmpnames.cpp +++ b/src/win95/bmpnames.cpp @@ -2,21 +2,9 @@ #include "bmpnames.hpp" #include "mishchnk.hpp" -#if engine #define UseLocalAssert No #include "ourasert.h" #define assert(x) GLOBALASSERT(x) -#else -#if cencon -#include "ccassert.h" -#else -#include -#endif -#endif - -#ifdef cencon -#define new my_new -#endif //macro for helping to force inclusion of chunks when using libraries FORCE_CHUNK_INCLUDE_IMPLEMENT(bmpnames) @@ -24,9 +12,6 @@ FORCE_CHUNK_INCLUDE_IMPLEMENT(bmpnames) BMP_Name::BMP_Name (const char * fname, int const gbnc_version) : flags((BMPN_Flags)DEFAULT_BMPN_FLAGS), index(0), version_num (gbnc_version << BMPNAME_PARENT_VER_SHIFT), enum_id(0), priority (DEFAULT_BMPN_PRIORITY), transparency_colour_union(0) -#if cencon -, md5val(0) -#endif { filename = new char [strlen(fname)+1]; strcpy (filename, fname); @@ -34,9 +19,6 @@ BMP_Name::BMP_Name (const char * fname, int const gbnc_version) BMP_Name::BMP_Name (const char * fname) : flags((BMPN_Flags)DEFAULT_BMPN_FLAGS), index(0), version_num (0), enum_id(0), priority (DEFAULT_BMPN_PRIORITY), transparency_colour_union(0) -#if cencon -, md5val(0) -#endif { filename = new char [strlen(fname)+1]; strcpy (filename, fname); @@ -60,9 +42,6 @@ BMP_Name::BMP_Name (const BMP_Name & bn) enum_id = bn.enum_id; priority = bn.priority; transparency_colour_union = bn.transparency_colour_union; - #if cencon - md5val = bn.md5val; - #endif } void BMP_Name::Validate(void) @@ -88,13 +67,8 @@ const BMP_Name & BMP_Name::operator=(const BMP_Name & bn) enum_id = bn.enum_id; priority = bn.priority; transparency_colour_union = bn.transparency_colour_union; - #if cencon - md5val = bn.md5val; - #endif return(*this); - - } diff --git a/src/win95/bmpnames.hpp b/src/win95/bmpnames.hpp index 40d7c80..1b9ec81 100644 --- a/src/win95/bmpnames.hpp +++ b/src/win95/bmpnames.hpp @@ -4,22 +4,10 @@ #include "chunk.hpp" // for assert -#if engine - #define UseLocalAssert No #include "ourasert.h" #define assert(x) GLOBALASSERT(x) -#else - -#if cencon -#include "ccassert.h" -#else -#include -#endif - -#endif - enum BMPN_Flags { ChunkBMPFlag_Null = 0x00000000, // all flags reset @@ -165,24 +153,6 @@ public: void Validate(void); - #if cencon - int const * md5val; // space to put a pointer - - void DeleteAssociatedFiles() const; - void DeleteAssociatedMipFiles() const; - // changes the filename member, returns FALSE on failure - BOOL Rename(char const * newname); - - // use these to prevent DeleteAssociatedMipFiles & DeleteAssociatedFiles - // from deleting specific files - static void PreventDeleteFile(char const * pszFileName); - static void ReallowDeleteFile(char const * pszFileName); - private: - static List ms_listFilesCantDelete; - static void DeleteFileProt(char const * pszFileName); - public: - #endif - unsigned GetTranspRedVal() const; unsigned GetTranspGreenVal() const; unsigned GetTranspBlueVal() const; @@ -346,8 +316,8 @@ public: virtual void SetMD5Val(BMP_Name const & rcbmp, int const * md5id); virtual void RemoveMD5Val(char const * bname); - friend class BMP_Group; // for cencon - friend class BMP_Info; // for cencon + //friend class BMP_Group; // for cencon + //friend class BMP_Info; // for cencon protected: virtual Bitmap_MD5_Chunk * GetMD5Chunk(char const * bname) = 0; diff --git a/src/win95/chnkload.cpp b/src/win95/chnkload.cpp index e7e1149..cd60e23 100644 --- a/src/win95/chnkload.cpp +++ b/src/win95/chnkload.cpp @@ -2999,10 +2999,6 @@ BOOL copy_to_map6(Object_Chunk * ob,MAPBLOCK6* mapblock, int shplst_pos) mapblock->MapEuler.EulerY = e.EulerY; mapblock->MapEuler.EulerZ = e.EulerZ; - #if InterfaceEngine - mapblock->o_chunk = (void *)ob; - #endif - return TRUE; } diff --git a/src/win95/chnkload.h b/src/win95/chnkload.h index 55fd754..5f753eb 100644 --- a/src/win95/chnkload.h +++ b/src/win95/chnkload.h @@ -189,12 +189,7 @@ extern int start_of_loaded_shapes; extern unsigned char *TextureLightingTable; -#if defined(InterfaceEngine) && InterfaceEngine -// this is of crucial importance!! -extern SHAPEHEADER * mainshapelist[]; -#else extern SHAPEHEADER ** mainshapelist; -#endif extern MAPHEADER Map[]; diff --git a/src/win95/chnktype.cpp b/src/win95/chnktype.cpp index 6bef4de..4612cdf 100644 --- a/src/win95/chnktype.cpp +++ b/src/win95/chnktype.cpp @@ -2,26 +2,10 @@ #include #include "chnktype.hpp" -#if engine - #define UseLocalAssert No #include "ourasert.h" #define assert(x) GLOBALASSERT(x) -#else - -#if cencon -#include "ccassert.h" -#else -#include -#endif - -#endif - -#ifdef cencon -#define new my_new -#endif - // misc data structures functions BOOL operator==(const obinfile &o1, const obinfile &o2) { @@ -175,7 +159,6 @@ ChunkVector& ChunkVector::operator-=(const ChunkVector& a) -#if engine ChunkVector::operator VECTORCH () const { VECTORCH v; @@ -185,7 +168,7 @@ ChunkVector::operator VECTORCH () const return(v); } -#endif + ChunkVector::operator ChunkVectorInt () const { ChunkVectorInt v; @@ -267,7 +250,6 @@ ChunkVectorInt operator+(const ChunkVectorInt& a, const ChunkVectorInt& b) return v; } - ChunkVectorInt operator-(const ChunkVectorInt& a, const ChunkVectorInt& b) { ChunkVectorInt v; @@ -286,8 +268,6 @@ ChunkVectorInt& ChunkVectorInt::operator+=(const ChunkVectorInt& a) return *this; } - - ChunkVectorInt& ChunkVectorInt::operator-=(const ChunkVectorInt& a) { x -= a.x; @@ -297,9 +277,6 @@ ChunkVectorInt& ChunkVectorInt::operator-=(const ChunkVectorInt& a) return *this; } - - -#if engine ChunkVectorInt::operator VECTORCH () const { VECTORCH v; @@ -309,7 +286,6 @@ ChunkVectorInt::operator VECTORCH () const return(v); } -#endif ChunkVectorInt operator*(const ChunkVectorInt & a, const double s) { @@ -407,7 +383,6 @@ ChunkVectorFloat operator/(const ChunkVectorFloat & a, const double s) return(v); } -#if engine ChunkVectorFloat::operator VECTORCH () const { VECTORCH v; @@ -417,7 +392,7 @@ ChunkVectorFloat::operator VECTORCH () const return(v); } -#endif + int ChunkVectorFloat::norm() { float modulos =(float) mod(*this); @@ -430,6 +405,7 @@ int ChunkVectorFloat::norm() return(1); } + double mod(const ChunkVectorFloat& a) { return(sqrt((double)a.x*(double)a.x+(double)a.y*(double)a.y+(double)a.z*(double)a.z)); diff --git a/src/win95/chnktype.hpp b/src/win95/chnktype.hpp index b53a507..500df6d 100644 --- a/src/win95/chnktype.hpp +++ b/src/win95/chnktype.hpp @@ -1,9 +1,7 @@ #ifndef _chnktype_hpp #define _chnktype_hpp 1 -#if engine #include "3dc.h" -#endif #include "list_tem.hpp" struct ChunkVectorInt; @@ -28,10 +26,7 @@ struct ChunkVector ChunkVector friend operator*(const ChunkVector&, const ChunkVector&); //cross prod - - #if engine operator VECTORCH () const; - #endif operator ChunkVectorInt () const; operator ChunkVectorFloat () const; @@ -57,12 +52,8 @@ struct ChunkVectorInt ChunkVectorInt friend operator/(const ChunkVectorInt&, const double); //ChunkVectorInt friend operator*(const ChunkVectorInt&, const ChunkVectorInt&); //cross prod - - - #if engine operator VECTORCH () const; - #endif //friend double dot(const ChunkVector&, const ChunkVector&);//dot product friend double mod(const ChunkVectorInt&);//magnitude of vector @@ -84,9 +75,8 @@ struct ChunkVectorFloat ChunkVectorFloat friend operator/(const ChunkVectorFloat&, const double); //ChunkVectorInt friend operator*(const ChunkVectorInt&, const ChunkVectorInt&); //cross prod - #if engine + operator VECTORCH () const; - #endif //friend double dot(const ChunkVector&, const ChunkVector&);//dot product friend double mod(const ChunkVectorFloat&);//magnitude of vector diff --git a/src/win95/chunk.cpp b/src/win95/chunk.cpp index 6e61338..cab7ff3 100644 --- a/src/win95/chunk.cpp +++ b/src/win95/chunk.cpp @@ -2,34 +2,13 @@ #include "chunk.hpp" -#if engine - #define UseLocalAssert No #include "ourasert.h" #define assert(x) GLOBALASSERT(x) -#else - -#if cencon -#include "ccassert.h" -#else -#include -#endif - -#endif - - -#if cencon -#include "environs.hpp" -#else #define twprintf printf -#ifdef cencon -#define new my_new -#endif - char * users_name = "Player"; -#endif #include "hash_tem.hpp" Chunk * Parent_File; diff --git a/src/win95/chunk.hpp b/src/win95/chunk.hpp index bb58380..2d8ae04 100644 --- a/src/win95/chunk.hpp +++ b/src/win95/chunk.hpp @@ -5,56 +5,20 @@ #include "fixer.h" -#if engine - - #include "3dc.h" - #include "mem3dc.h" // for debug new and delete +#include "3dc.h" +#include "mem3dc.h" // for debug new and delete - #include "inline.h" +#include "inline.h" #if SupportModules - #include "module.h" - -#endif - - #include "list_tem.hpp" - - -#endif - -#if cencon - -#include "AFXWIN.H" - -#ifdef _DEBUG -#undef new -#define new DEBUG_NEW -#define my_new DEBUG_NEW -#else -#define my_new new -#endif - -#include "list_tem.hpp" - -#endif + #include "module.h" -#if objedit || sprite_edit || ANIMEXP -#include "StdAfx.h" -#include "list_tem.hpp" #endif -#if shpedit -#include "stdafx.h" #include "list_tem.hpp" -#endif - -#if standard -#include "advwin32.h" -#include -#include "list_tem.hpp" -#endif + #define CHUNK_FAILED_ON_LOAD -1 @@ -75,10 +39,6 @@ // we start at the header of the chunk we are in // so that we can stop at the end of the chunk -#if cencon -extern char users_name[]; -#endif - #include "list_tem.hpp" #ifndef RIFF_OPTIMIZE // define this to get compiler errors where you are calling the old slow functions @@ -655,36 +615,3 @@ FORCE_CHUNK_INCLUDE_END */ #endif // !included - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/win95/chunkpal.cpp b/src/win95/chunkpal.cpp index 1e98413..a132550 100644 --- a/src/win95/chunkpal.cpp +++ b/src/win95/chunkpal.cpp @@ -1,23 +1,12 @@ #include "chunkpal.hpp" #include "mishchnk.hpp" -#if engine - #ifndef UseLocalAssert #define UseLocalAssert 1 #endif #include "ourasert.h" #define assert(x) GLOBALASSERT(x) -#else - -#if cencon -#include "ccassert.h" -#else -#include -#endif - -#endif //macro for helping to force inclusion of chunks when using libraries FORCE_CHUNK_INCLUDE_IMPLEMENT(chunkpal) diff --git a/src/win95/chunkpal.hpp b/src/win95/chunkpal.hpp index c293072..5de7801 100644 --- a/src/win95/chunkpal.hpp +++ b/src/win95/chunkpal.hpp @@ -3,9 +3,6 @@ #include "chunk.hpp" #include "bmpnames.hpp" -#if cencon -#include "palette.h" -#endif class Environment_Data_Chunk; @@ -30,10 +27,6 @@ class Environment_Palette_Chunk : public Chunk public: -#if cencon - // constructor from data - defined in genpal - Environment_Palette_Chunk (Chunk_With_Children * const parent, PPM_Header const * const palette); -#endif // constructor from buffer Environment_Palette_Chunk (Chunk_With_Children * const parent, const char * sdata, size_t const /*ssize*/) : Chunk (parent, "ENVPALET") @@ -75,32 +68,6 @@ class Preset_Palette { public: -#if cencon - // constructor from data - defined in genpal - Preset_Palette (PPM_Header const * const palette); - - // update by generating from bmps chunk - void update(Global_BMP_Name_Chunk * gbnc, Preset_Palette_Chunk * ppc, class Environment * e, Environment_Data_Chunk * envd, BOOL bDoSoftwareTex); - -#if 0 - Preset_Palette (const char * iname) - : size(0) - , flags(0) - , reserved1(0) - , reserved2(0) - , startpos(0) - , pixel_data(0) - , name(0) - { - if (iname) - { - name = new char[strlen(iname)+1]; - strcpy(name,iname); - } - } -#endif -#endif - Preset_Palette () : size(0) , flags(0) @@ -166,18 +133,6 @@ class Preset_Palette_Chunk : public Chunk { public: -#if cencon - // empty constructor - Preset_Palette_Chunk (Chunk_With_Children * const parent) - : Chunk (parent,"PRSETPAL") - , flags(0) - , version_num(0) - , reserved1(0) - , reserved2(0) - , reserved3(0) - {} - -#endif // constructor from buffer Preset_Palette_Chunk (Chunk_With_Children * const parent, char const * sdata, size_t const ssize); ~Preset_Palette_Chunk () {}; @@ -211,10 +166,6 @@ class Environment_TLT_Chunk : public Chunk public: -#if cencon - // constructor using palette - defined in genpal - Environment_TLT_Chunk (Chunk_With_Children * parent, PPM_Header * palette, PPM_Header * tlt_palette, Lighting_Style const * ls); -#endif // constructor from buffer Environment_TLT_Chunk (Chunk_With_Children * parent, const char * sdata, size_t ssize); @@ -334,20 +285,6 @@ class TLT_Config_Chunk : public Chunk public: -#if cencon - // constructor for default - TLT_Config_Chunk (Chunk_With_Children * parent, char const * rifname = 0) - : Chunk (parent, "TLTCONFG") - , num_shades_white(16) - , srcrifname(rifname ? new char [strlen(rifname)+1] : 0) - , blocks(TLTConfigBlock(0,0,1,1)) - , table_size(256) - , palette_size(0) - { - for (int i=0; i<3; ++i) reserved[i]=0; - if (rifname) strcpy(srcrifname,rifname); - } -#endif // constructor from buffer TLT_Config_Chunk (Chunk_With_Children * parent, const char * sdata, size_t ssize); @@ -389,11 +326,6 @@ private: }; -#if cencon -extern TLT_Config_Chunk Default_TLT_Config_Chunk; -#endif - - // Multi-Palettes for one environment @@ -558,17 +490,6 @@ class Environment_Game_Mode_Chunk : public Chunk_With_Children public: -#if cencon - // constructor from data - Environment_Game_Mode_Chunk (Environment_Data_Chunk * const parent, const char * _mode_id); - - // defined in gmodlink - void remove(class CWnd * const pWnd); // update this copy by finding its original - void update(class CWnd * const pWnd, BOOL bDoSoftwareTex); // update this copy by finding its original - void been_updated(class CWnd * const pWnd, BOOL bDoSoftwareTex); // find and update copies from this original - void definite_update(Environment_Game_Mode_Chunk const * const src, class CWnd * const pWnd, Environment_Data_Chunk * envd, BOOL bDoSoftwareTex); - -#endif // constructor from buffer Environment_Game_Mode_Chunk (Chunk_With_Children * const parent, const char * sdata, size_t const ssize); @@ -681,48 +602,6 @@ private: int version_num; - - #if cencon - // constructor from parent - Environment_Game_Mode_Header_Chunk (Environment_Game_Mode_Chunk * const parent, const char * const _mode_id) - : Chunk (parent, "GMODHEAD"), version_num(0), - flags (0), rif_files() - { - for (int i=0; iheader = this; - } - - inline Environment_Game_Mode_Header_Chunk const & operator = (Environment_Game_Mode_Header_Chunk & s) - { - flags = s.flags; - while (rif_files.size()) - { - delete[] rif_files.first_entry(); - rif_files.delete_first_entry(); - } - if (mode_identifier) delete[] mode_identifier; - - mode_identifier = new char[strlen(s.mode_identifier)+1]; - strcpy(mode_identifier,s.mode_identifier); - - for (LIF src(&s.rif_files); !src.done(); src.next()) - { - add_rif_entry(src()); - } - - version_num = s.version_num; - - return *this; - - } - #endif - // deconstructor ~Environment_Game_Mode_Header_Chunk(); @@ -826,10 +705,6 @@ public: { return _stricmp(filename,c.filename); } - - #if cencon - void DeleteAssociatedFiles(RIF_Child_Chunk const *, Environment_Data_Chunk *) const; - #endif }; enum RCC_Flags { @@ -845,13 +720,6 @@ class RIF_Child_Chunk : public Chunk { public: -#if cencon - RIF_Child_Chunk(Environment_Game_Mode_Chunk * const parent, const char * fname, class CWnd * const pWnd, BOOL bDoSoftwareTex); - - void update(class CWnd * const, BOOL bDoSoftwareTex); - void update(class Environment * e, BOOL bDoSoftwareTex); // for where the environment is already loaded - void DeleteAssociatedFiles(Environment_Data_Chunk *) const; -#endif // constructor from buffer RIF_Child_Chunk (Chunk_With_Children * const parent, const char * sdata, size_t const ssize); ~RIF_Child_Chunk(); @@ -903,35 +771,6 @@ class Preset_Palette_Store_Chunk : public Chunk { public: -#if cencon - // constructor from Preset_Palette_Chunk - Preset_Palette_Store_Chunk (Chunk_With_Children * const parent, Preset_Palette_Chunk const * const schunk, const char * const srname) - : Chunk (parent,"SETPALST") - , flags(schunk->flags) - , version_num(schunk->version_num) - , reserved1(schunk->reserved1) - , reserved2(schunk->reserved2) - , reserved3(schunk->reserved3) - , rifname(new char[strlen(srname)+1]) - , pplist(schunk->pplist) - { - strcpy(rifname,srname); - } - - // empty constructor - Preset_Palette_Store_Chunk (Chunk_With_Children * const parent, const char * const srname) - : Chunk (parent,"SETPALST") - , flags(0) - , version_num(0) - , reserved1(0) - , reserved2(0) - , reserved3(0) - , rifname(new char[strlen(srname)+1]) - { - strcpy(rifname,srname); - } - -#endif // constructor from buffer Preset_Palette_Store_Chunk (Chunk_With_Children * const parent, char const * sdata, size_t const ssize); ~Preset_Palette_Store_Chunk () @@ -983,10 +822,6 @@ class Coloured_Polygons_Lookup_Chunk : public Chunk { public: -#if cencon - // constructor from data - defined in cencon - Coloured_Polygons_Lookup_Chunk (Chunk_With_Children * parent, PPM_Header * const palette); -#endif // constructor from buffer Coloured_Polygons_Lookup_Chunk (Chunk_With_Children * parent, const char * sdata, size_t ssize); diff --git a/src/win95/dummyobjectchunk.cpp b/src/win95/dummyobjectchunk.cpp index 0b9a6b6..cc2ba0b 100644 --- a/src/win95/dummyobjectchunk.cpp +++ b/src/win95/dummyobjectchunk.cpp @@ -1,9 +1,5 @@ #include "dummyobjectchunk.hpp" -#ifdef cencon -#define new my_new -#endif - //macro for helping to force inclusion of chunks when using libraries FORCE_CHUNK_INCLUDE_IMPLEMENT(dummyobjectchunk) diff --git a/src/win95/enumchnk.cpp b/src/win95/enumchnk.cpp index 6b6a3e7..c030e4a 100644 --- a/src/win95/enumchnk.cpp +++ b/src/win95/enumchnk.cpp @@ -1,10 +1,6 @@ #include "enumchnk.hpp" //#include "enumsch.hpp" -#ifdef cencon -#define new my_new -#endif - //macro for helping to force inclusion of chunks when using libraries FORCE_CHUNK_INCLUDE_IMPLEMENT(enumchnk) diff --git a/src/win95/enumsch.cpp b/src/win95/enumsch.cpp index 73f8626..21ea90b 100644 --- a/src/win95/enumsch.cpp +++ b/src/win95/enumsch.cpp @@ -2,10 +2,6 @@ #include "enumsch.hpp" -#ifdef cencon -#define new my_new -#endif - //macro for helping to force inclusion of chunks when using libraries FORCE_CHUNK_INCLUDE_IMPLEMENT(enumsch) diff --git a/src/win95/enumsch.hpp b/src/win95/enumsch.hpp index a332b84..a502924 100644 --- a/src/win95/enumsch.hpp +++ b/src/win95/enumsch.hpp @@ -45,10 +45,6 @@ public: List enums; virtual ~Enum_Const_List(){} -#if cencon - int lowest_free_index(void); - void Sort_By_Name(void); -#endif }; @@ -58,16 +54,6 @@ public: // constructor from buffer BMP_Enums_Chunk (Chunk_With_Children * const parent, char const * sdata, size_t const ssize); -#if cencon - // empty constructor - BMP_Enums_Chunk (Chunk_With_Children * const parent) - : Chunk(parent,"BMPENUMS") - , ctype(0) - , reserved1(0) - , reserved2(0) - {} -#endif - ~BMP_Enums_Chunk () { if (ctype) delete[] ctype; diff --git a/src/win95/gsprchnk.cpp b/src/win95/gsprchnk.cpp index b20293f..f89987d 100644 --- a/src/win95/gsprchnk.cpp +++ b/src/win95/gsprchnk.cpp @@ -1,9 +1,5 @@ #include "gsprchnk.hpp" -#ifdef cencon -#define new my_new -#endif - //macro for helping to force inclusion of chunks when using libraries FORCE_CHUNK_INCLUDE_IMPLEMENT(gsprchnk) diff --git a/src/win95/list_tem.hpp b/src/win95/list_tem.hpp index d5a150a..5f72558 100644 --- a/src/win95/list_tem.hpp +++ b/src/win95/list_tem.hpp @@ -29,12 +29,7 @@ #define LIST_TEM_TYPEID_THIS "?" #endif -#if defined(engine) -// Not all preprocessors do lazy evaluation. DW -#if engine - #include "mem3dc.h" -#endif -#endif +#include "mem3dc.h" #ifdef NDEBUG static void fail(...) {} diff --git a/src/win95/ltchunk.cpp b/src/win95/ltchunk.cpp index 0a50010..78bd44f 100644 --- a/src/win95/ltchunk.cpp +++ b/src/win95/ltchunk.cpp @@ -3,10 +3,6 @@ #include "ltchunk.hpp" -#ifdef cencon -#define new my_new -#endif - //macro for helping to force inclusion of chunks when using libraries FORCE_CHUNK_INCLUDE_IMPLEMENT(ltchunk) @@ -150,35 +146,9 @@ Light_Chunk::Light_Chunk(Chunk_With_Children * parent, const char * data, size_t data += 4; light.pad2 = *((int *) data); - #if engine || cencon light_added_to_module = FALSE; - #endif - } -#if InterfaceEngine -AVP_Strategy_Chunk* Light_Chunk::GetStrategyChunk() -{ - List chlist; - parent->lookup_child("AVPSTRAT",chlist); - for(LIF chlif(&chlist);!chlif.done();chlif.next()) - { - AVP_Strategy_Chunk* asc=(AVP_Strategy_Chunk*)chlif(); - if(asc->index==light.light_number) return asc; - } - return 0; -} - -AVP_Strategy_Chunk* Light_Chunk::CreateStrategyChunk() -{ - AVP_Strategy_Chunk* asc=GetStrategyChunk(); - if(asc) return asc; - - asc=new AVP_Strategy_Chunk(parent); - asc->index=light.light_number; - return asc; -} -#endif //////////////////////////////////////////////////////////////////////////////////// diff --git a/src/win95/ltchunk.hpp b/src/win95/ltchunk.hpp index 444f0f4..b226e12 100644 --- a/src/win95/ltchunk.hpp +++ b/src/win95/ltchunk.hpp @@ -4,9 +4,6 @@ #include "chunk.hpp" #include "chnktype.hpp" -#if InterfaceEngine -#include "strachnk.hpp" -#endif #define LOFlag_On 0x00000001 #define LOFlag_ShadowData 0x00000002 @@ -143,11 +140,6 @@ public: void fill_data_block ( char * data_start); -#if InterfaceEngine - AVP_Strategy_Chunk* GetStrategyChunk(); - AVP_Strategy_Chunk* CreateStrategyChunk(); -#endif - private: friend class Light_Set_Chunk; diff --git a/src/win95/mishchnk.cpp b/src/win95/mishchnk.cpp index 649eed2..a0e3795 100644 --- a/src/win95/mishchnk.cpp +++ b/src/win95/mishchnk.cpp @@ -10,17 +10,9 @@ #include "huffman.hpp" -#ifdef cencon -#define new my_new -#endif - - // Class Lockable_Chunk_With_Children functions -#if cencon -#else extern char * users_name; -#endif //macro for helping to force inclusion of chunks when using libraries FORCE_CHUNK_INCLUDE_IMPLEMENT(mishchnk) @@ -1033,12 +1025,6 @@ BOOL File_Chunk::check_file() } -#if InterfaceEngine - - extern File_Chunk * Env_Chunk; - -#endif - BOOL File_Chunk::update_file() { @@ -1074,22 +1060,6 @@ BOOL File_Chunk::update_file() #else -#if InterfaceEngine - - // log, to track error - char fname [256]; - char * dotpos; - - strcpy (fname, filename); - - dotpos = strrchr (fname, '.'); - - sprintf (dotpos, ".log"); - - FILE * log = fopen (fname, "a"); - -#endif - if (!filename) return FALSE; twprintf("Updating %s\n",filename); @@ -1237,13 +1207,6 @@ BOOL File_Chunk::update_file() ed = (Environment_Data_Chunk *)lookup_single_child ("REBENVDT"); if (ed) { - -#if InterfaceEngine - - fprintf (log, "Env_Data %d %d %d %d", ed->updated, ed->local_lock, ed->updated_outside, ed->external_lock); - -#endif - if (ed->updated && !(ed->updated_outside || ed->external_lock)) ed->update_chunk_in_file(rif_file); @@ -1272,11 +1235,6 @@ BOOL File_Chunk::update_file() CloseHandle (rif_file); -#if InterfaceEngine - - fclose (log); - -#endif return TRUE; #endif //DisableLock diff --git a/src/win95/mishchnk.hpp b/src/win95/mishchnk.hpp index 237da64..438f99b 100644 --- a/src/win95/mishchnk.hpp +++ b/src/win95/mishchnk.hpp @@ -6,29 +6,13 @@ #include "chnktype.hpp" -#if engine - #define UseLocalAssert No #include "ourasert.h" #define assert(x) GLOBALASSERT(x) -#else - -#if cencon -#include "ccassert.h" -#else -#include -#endif - -#endif - -#if cencon -#include "output.hpp" -#else #define twprintf printf extern char * users_name; -#endif class File_Chunk; @@ -244,8 +228,4 @@ private: }; - - - - #endif diff --git a/src/win95/obchunk.cpp b/src/win95/obchunk.cpp index 6f159d8..b062570 100644 --- a/src/win95/obchunk.cpp +++ b/src/win95/obchunk.cpp @@ -7,9 +7,6 @@ #include "md5.h" // Class Object_Chunk functions -#ifdef cencon -#define new my_new -#endif //macro for helping to force inclusion of chunks when using libraries FORCE_CHUNK_INCLUDE_IMPLEMENT(obchunk) @@ -402,19 +399,7 @@ ObjectID Object_Chunk::CalculateID() if(!chlist.size()) return retval; char Name[100]; - #if InterfaceEngine||cencon - //need to check for console specific rif files,and skip the 'sat' or 'psx' - //so that they get the same ids as the pc - const char* r_name=((RIF_Name_Chunk*)chlist.first_entry())->rif_name; - if(tolower(r_name[0])=='p' && tolower(r_name[1])=='s' && tolower(r_name[2])=='x' ) - strcpy(Name,&r_name[3]); - else if (tolower(r_name[0])=='s' && tolower(r_name[1])=='a' && tolower(r_name[2])=='t' ) - strcpy(Name,&r_name[3]); - else - strcpy(Name,r_name); - #else strcpy(Name,((RIF_Name_Chunk*)chlist.first_entry())->rif_name); - #endif strcat(Name,object_data.o_name); char buffer[16]; diff --git a/src/win95/oechunk.cpp b/src/win95/oechunk.cpp index 643071b..f82c76a 100644 --- a/src/win95/oechunk.cpp +++ b/src/win95/oechunk.cpp @@ -1,13 +1,6 @@ -#if objedit -#include "template.hpp" -#endif - #include "oechunk.h" #include "chunk.hpp" -#ifdef cencon -#define new my_new -#endif //macro for helping to force inclusion of chunks when using libraries FORCE_CHUNK_INCLUDE_IMPLEMENT(oechunk) @@ -163,5 +156,3 @@ BOOL Strategy_Chunk::output_chunk(HANDLE &hand) return TRUE; } - - diff --git a/src/win95/oechunk.h b/src/win95/oechunk.h index 5dc247c..125790f 100644 --- a/src/win95/oechunk.h +++ b/src/win95/oechunk.h @@ -4,21 +4,6 @@ #include "chunk.hpp" #include "obchunk.hpp" -#if objedit -#include "template.hpp" -#endif -//#if engine -//#define VECTOR VECTORCH -//#endif - -#if engine -#else -struct VECTORCH -{ - int vx, vy, vz; -}; -#endif - struct ChunkMapBlock { char TemplateName[20]; @@ -96,4 +81,5 @@ public : //constructor from buffer Strategy_Chunk (Chunk_With_Children * parent,const char* data,size_t); }; + #endif diff --git a/src/win95/shpchunk.cpp b/src/win95/shpchunk.cpp index 0fe1811..332ff39 100644 --- a/src/win95/shpchunk.cpp +++ b/src/win95/shpchunk.cpp @@ -6,19 +6,6 @@ #include "obchunk.hpp" -#if cencon || InterfaceEngine -#include "fnamefnc.hpp" -#include "zsp.hpp" -#include "bmpnames.hpp" -#include "envchunk.hpp" -#include "animchnk.hpp" -#include "chunkpal.hpp" -#include "fragchnk.hpp" -#endif - -#ifdef cencon -#define new my_new -#endif //macro for helping to force inclusion of chunks when using libraries FORCE_CHUNK_INCLUDE_IMPLEMENT(shpchunk) @@ -97,14 +84,6 @@ Shape_Chunk::Shape_Chunk(Chunk_With_Children * parent, const char *data, size_t **----------------------------------------------------------------------------*/ } - #if cencon || InterfaceEngine - Listchlist; - lookup_child("CONSHAPE",chlist); - for(LIF chlif(&chlist);!chlif.done();chlif.next()) - { - ((Console_Shape_Chunk*)chlif())->generate_console_chunkshape(); - } - #endif } Shape_Chunk::Shape_Chunk (Chunk_With_Children * parent, ChunkShape &shp_dat) @@ -1591,501 +1570,10 @@ Shape_External_File_Chunk::Shape_External_File_Chunk (Chunk_With_Children * pare post_input_processing(); } -#if cencon || InterfaceEngine - -void Shape_External_File_Chunk::update_from_external_rif(BOOL force_scale_update) -{ - if(UpdatingExternalShape) - { - return; - } - - Shape_Chunk * parent_shp = (Shape_Chunk *) parent; - - Environment_Data_Chunk * envd = 0; - envd = (Environment_Data_Chunk *) parent_shp->parent->lookup_single_child("REBENVDT"); - - BOOL fixpal = IsFixedPalette(envd); - - List chlst; - lookup_child("SHPEXTFN",chlst); - - if (chlst.size()) - { - UpdatingExternalShape=TRUE; - - Shape_External_Filename_Chunk * sefc = (Shape_External_Filename_Chunk *)chlst.first_entry(); - - #if cencon - twprintf("Locating %s\n",sefc->file_name); - char * locatedfile = FindExistingFileInPath_PreferWriteable(CWnd::GetActiveWindow(),sefc->file_name,"RifSearchPath"); - twprintf("Loading %s\n",locatedfile ? locatedfile : sefc->file_name); - RIF_File_Chunk * rfc = new RIF_File_Chunk (this, locatedfile ? locatedfile : sefc->file_name); - #elif InterfaceEngine - RIF_File_Chunk * rfc; - char * locatedfile = FindExistingFile_PreferWriteable(sefc->file_name,"RifSearchPath",FALSE); - if (locatedfile) - { - rfc = new RIF_File_Chunk (this, locatedfile); - } - else - { - UpdatingExternalShape=FALSE; - return; - } - #endif - - //Now loaded external file,so UpdatingExternalShape can now be reset - UpdatingExternalShape=FALSE; - - if (rfc->error_code != 0) - { - #if cencon - extern BOOL SuppressFailedToFindShapeRifErrors; - - if(!SuppressFailedToFindShapeRifErrors) - { - char message[300]; - sprintf(message,"Error loading shape rif : %s",locatedfile ? locatedfile : sefc->file_name); - twMessageBox(CWnd::GetActiveWindow(),message,"Tools Control Area", MB_TASKMODAL+MB_OK+MB_ICONHAND); - } - #endif - if (locatedfile) - { - delete[] locatedfile; - } - delete rfc; - return; - } - - Shape_Chunk* shp=0; - lookup_child("EXTOBJNM",chlst); - - - if(chlst.size()) - { - //we have an object name so we need to search for the correct object in the file - Shape_External_Object_Name_Chunk* seonm=(Shape_External_Object_Name_Chunk*) chlst.first_entry(); - - rfc->lookup_child("RBOBJECT",chlst); - for(LIF chlif(&chlst);!chlif.done();chlif.next()) - { - Object_Chunk* oc=(Object_Chunk*)chlif(); - if(!strcmp(oc->object_data.o_name,seonm->object_name))break; - } - if(chlif.done()) - { - //can't find the object - #if cencon - char message[300]; - sprintf(message,"Failed to find %s in %s\n(There may be several different rif files with the same name)",seonm->object_name,locatedfile); - twMessageBox(CWnd::GetActiveWindow(),message,"Tools Control Area", MB_TASKMODAL+MB_OK+MB_ICONHAND); - #endif - delete [] locatedfile; - delete rfc; - return; - } - - shp=((Object_Chunk*)chlif())->get_assoc_shape(); - } - else - { - //no object name,so there has to be just one shape in the file - rfc->lookup_child("REBSHAPE",chlst); - - if (chlst.size() != 1) - { - #if cencon - char message[300]; - sprintf(message,"There are %d shapes in %s\n(There should only be one)\n",chlst.size(),locatedfile); - twMessageBox(CWnd::GetActiveWindow(),message,"Tools Control Area", MB_TASKMODAL+MB_OK+MB_ICONHAND); - #endif - Environment_Data_Chunk * edc = 0; - edc = (Environment_Data_Chunk *)rfc->lookup_single_child("REBENVDT"); - if(edc) - { - lookup_child("RIFFNAME",chlst); - - while (chlst.size()) - { - delete chlst.first_entry(); - chlst.delete_first_entry(); - } - edc->lookup_child("RIFFNAME",chlst); - - if (chlst.size()) - { - new RIF_Name_Chunk (this, ((RIF_Name_Chunk *)chlst.first_entry())->rif_name); - } - } - delete [] locatedfile; - delete rfc; - return; - } - - shp = (Shape_Chunk *)chlst.first_entry(); - } - delete [] locatedfile; - locatedfile=0; - - // set so that it updates it whatever - - if (shp->get_header()->version_no != sefc->version_no || TRUE) - { - //if the shape doesn't have any associated objects,get scale from external file's - //environment scale chunk. - //also get scale if force_scale_update is true - if(parent_shp->list_assoc_objs().size()==0 || force_scale_update) - { - if(force_scale_update) - { - sefc->rescale=1; - } - List chlist=rfc->lookup_child("REBENVDT"); - if(chlist.size()) - { - chlist=((Chunk_With_Children*)chlist.first_entry())->lookup_child("ENVSDSCL"); - if(chlist.size()) - { - Environment_Scale_Chunk* esc =(Environment_Scale_Chunk*)chlist.first_entry(); - sefc->rescale=esc->scale; - } - } - } - // copy all the data over from the loaded shape into the parent - ChunkShape cs = shp->shape_data; - - cs.rescale(sefc->rescale); - - - // here we may want to sort out texture index nos. - - - // hmmm fix me - // definitely fixme... - // everytime the file is loaded, - // the shape is updated, and its bmps - // and thus the palette-up-to-date flag is reset, - // and the machine reckons on a new palette. - - parent_shp->local_lock = TRUE; - - parent_shp->update_my_chunkshape (cs); - - parent_shp->local_lock = FALSE; - - // delete all other chunks in the parent shape - // apart form the header !!!! - - parent_shp->destroy_auxiliary_chunks(); - - char * tempbuffer; - Chunk* child_chunk; - - child_chunk=shp->lookup_single_child("SHPZSPDT"); - if (child_chunk) - { - tempbuffer = child_chunk->make_data_block_from_chunk(); - new Shape_ZSP_Data_Chunk (parent_shp, (tempbuffer + 12), (*(int *) (tempbuffer + 8))-12); - delete [] tempbuffer; - } - - child_chunk = shp->lookup_single_child("SHPMRGDT"); - if (child_chunk) - { - tempbuffer = child_chunk->make_data_block_from_chunk(); - new Shape_Merge_Data_Chunk (parent_shp, (tempbuffer + 12), (*(int *) (tempbuffer + 8))-12); - delete [] tempbuffer; - } - - child_chunk = shp->lookup_single_child("SHPMORPH"); - if (child_chunk) - { - tempbuffer = child_chunk->make_data_block_from_chunk(); - new Shape_Morphing_Data_Chunk (parent_shp, (tempbuffer + 12), (*(int *) (tempbuffer + 8))-12); - delete [] tempbuffer; - } - - child_chunk = shp->lookup_single_child("TEXTANIM"); - if (child_chunk) - { - tempbuffer = child_chunk->make_data_block_from_chunk(); - new Animation_Chunk (parent_shp, (tempbuffer + 12), (*(int *) (tempbuffer + 8))-12); - delete [] tempbuffer; - } - - child_chunk = shp->lookup_single_child("SHPPCINF"); - if (child_chunk) - { - tempbuffer = child_chunk->make_data_block_from_chunk(); - new Shape_Poly_Change_Info_Chunk (parent_shp, (tempbuffer + 12), (*(int *) (tempbuffer + 8))-12); - delete [] tempbuffer; - } - - - child_chunk = shp->lookup_single_child("SHPFRAGS"); - if (child_chunk) - { - tempbuffer = child_chunk->make_data_block_from_chunk(); - Shape_Fragments_Chunk * sfc = new Shape_Fragments_Chunk (parent_shp, (tempbuffer + 12), (*(int *) (tempbuffer + 8))-12); - - List cl2; - sfc->lookup_child("SUBSHAPE",cl2); - - for (LIF cli2(&cl2); !cli2.done(); cli2.next()) - { - Shape_Sub_Shape_Chunk * sssc = (Shape_Sub_Shape_Chunk *)cli2(); - - ChunkShape sscs = sssc->shape_data; - sscs.rescale(sefc->rescale); - sssc->update_my_chunkshape (sscs); - - Shape_Fragment_Location_Chunk * sflc = (Shape_Fragment_Location_Chunk *)sssc->lookup_single_child("FRAGLOCN"); - if (sflc) - { - sflc->frag_loc.x =(int) (sflc->frag_loc.x*sefc->rescale); - sflc->frag_loc.y =(int) (sflc->frag_loc.y*sefc->rescale); - sflc->frag_loc.z =(int) (sflc->frag_loc.z*sefc->rescale); - } - - } - - delete [] tempbuffer; - } - - shp->lookup_child("ANIMSEQU",chlst); - for(LIF chlif(&chlst);!chlif.done();chlif.next()) - { - Anim_Shape_Sequence_Chunk* assc=(Anim_Shape_Sequence_Chunk*)chlif(); - new Anim_Shape_Sequence_Chunk(parent_shp,&assc->sequence_data); - } - - child_chunk = shp->lookup_single_child("PNOTINBB"); - if(child_chunk) - { - tempbuffer = child_chunk->make_data_block_from_chunk(); - new Poly_Not_In_Bounding_Box_Chunk (parent_shp, (tempbuffer + 12), (*(int *) (tempbuffer + 8))-12); - delete [] tempbuffer; - } - child_chunk = shp->lookup_single_child("ANSHCEN2"); - if(child_chunk) - { - tempbuffer = child_chunk->make_data_block_from_chunk(); - new Anim_Shape_Centre_Chunk (parent_shp, (tempbuffer + 12), (*(int *) (tempbuffer + 8))-12); - delete [] tempbuffer; - } - child_chunk = shp->lookup_single_child("ASALTTEX"); - if(child_chunk) - { - tempbuffer = child_chunk->make_data_block_from_chunk(); - new Anim_Shape_Alternate_Texturing_Chunk (parent_shp, (tempbuffer + 12), (*(int *) (tempbuffer + 8))-12); - delete [] tempbuffer; - } - shp->lookup_child("CONSHAPE",chlst); - for(chlif.restart();!chlif.done();chlif.next()) - { - tempbuffer = chlif()->make_data_block_from_chunk(); - Console_Shape_Chunk* csc=new Console_Shape_Chunk (parent_shp, (tempbuffer + 12), (*(int *) (tempbuffer + 8))-12); - csc->generate_console_chunkshape(); - delete [] tempbuffer; - } - - parent_shp->updated = TRUE; - - sefc->version_no = shp->get_header()->version_no; - - } - - Bitmap_List_Store_Chunk * blsc = 0; - - Global_BMP_Name_Chunk * gbnc = 0; - - Environment_Data_Chunk * edc = 0; - - edc = (Environment_Data_Chunk *)rfc->lookup_single_child("REBENVDT"); - - - if (edc) - { - gbnc = (Global_BMP_Name_Chunk *) edc->lookup_single_child("BMPNAMES"); - if (gbnc) - { - if (!gbnc->bmps.size()) gbnc = 0; - } - - List oldlst; - lookup_child("BMPLSTST",oldlst); - if (oldlst.size()>1) - { - while (oldlst.size()) - { - delete oldlst.first_entry(); - oldlst.delete_first_entry(); - } - } - - if (oldlst.size()) - { - blsc = (Bitmap_List_Store_Chunk *)oldlst.first_entry(); - } - else - { - if (gbnc) blsc = new Bitmap_List_Store_Chunk(this); - } - - BMP_Names_ExtraData * extended = 0; - if (blsc) - { - extended = blsc->GetExtendedData(); - if (fixpal) - extended->flags = (GlobalBMPFlags)(extended->flags | GBF_FIXEDPALETTE); - else - extended->flags = (GlobalBMPFlags)(extended->flags & ~GBF_FIXEDPALETTE); - } - if (gbnc) - { - //if ((gbnc->get_version_num()!=blsc->get_version_num()) || (gbnc->bmps.size() != blsc->bmps.size())) - /*update regardless of version number*/ - { // other checks could be done as well - if (blsc->bmps.size()) - { - BOOL neednewpalette = FALSE; - - List newlist = gbnc->bmps; - for (LIF newLIF(&newlist); !newLIF.done(); newLIF.next()) - { - BMP_Name newcur = newLIF(); - newcur.flags = (BMPN_Flags) (newcur.flags & ~(COMPLETED_BMPN_FLAGS | ChunkBMPFlag_FixedPalette)); - if (fixpal) newcur.flags = (BMPN_Flags) (newcur.flags | ChunkBMPFlag_FixedPalette); - for (LIF oldLIF(&blsc->bmps); !oldLIF.done(); oldLIF.next()) - { - BMP_Name oldcur = oldLIF(); - if (newcur == oldcur) - { - // do we need to requantize? - if ((oldcur.flags ^ newcur.flags) & CHECKMODIFY_BMPN_FLAGS - || newcur.flags & ChunkBMPFlag_UsesTransparency - && !(newcur.flags & ChunkBMPFlag_IFF) - && !(oldcur.flags & ChunkBMPFlag_IFF) - && oldcur.DifferentTransparencyColour(newcur)) - oldcur.flags = (BMPN_Flags)(oldcur.flags & ~COMPLETED_BMPN_FLAGS); - // keep some of the old flags - the ones that can differ - newcur.flags = (BMPN_Flags)(newcur.flags & COPY_BMPN_FLAGS); - newcur.flags = (BMPN_Flags)(newcur.flags | oldcur.flags & ~COPY_BMPN_FLAGS); - if (oldcur.version_num != newcur.version_num) - { - neednewpalette = TRUE; - newcur.flags = (BMPN_Flags)(newcur.flags & ~ChunkBMPFlag_HistogramExists); - extended->flags = (GlobalBMPFlags)(extended->flags & ~GBF_HISTOGRAMEXISTS); - } - break; - } - } - if (oldLIF.done()) - { - // reset palette up to date flag - neednewpalette = TRUE; - newcur.flags = (BMPN_Flags)(newcur.flags & ~(ChunkBMPFlag_HistogramExists | COMPLETED_BMPN_FLAGS)); - extended->flags = (GlobalBMPFlags)(extended->flags & ~GBF_HISTOGRAMEXISTS); - } - newLIF.change_current(newcur); - } - - // check if any bitmaps have been removed - for (LIF bli(&blsc->bmps); !bli.done(); bli.next()) - { - if (!newlist.contains(bli())) - { - // delete assoc files - neednewpalette = TRUE; - extended->flags = (GlobalBMPFlags)(extended->flags & ~GBF_HISTOGRAMEXISTS); - } - } - - if (neednewpalette) - { - Palette_Outdated(envd); - if (fixpal) FixedPalette_Outdated(envd); - envd->updated = TRUE; - } - blsc->bmps = newlist; - } - else - { - blsc->bmps = gbnc->bmps; - for (LIF flagresetLIF(&blsc->bmps); !flagresetLIF.done(); flagresetLIF.next()) - { - BMP_Name current = flagresetLIF(); - current.flags = (BMPN_Flags)(current.flags & (COPY_BMPN_FLAGS & ~ChunkBMPFlag_FixedPalette)); - if (fixpal) current.flags = (BMPN_Flags) (current.flags | ChunkBMPFlag_FixedPalette); - flagresetLIF.change_current(current); - } - // reset palette up to date flag - extended->flags = (GlobalBMPFlags)(extended->flags & ~GBF_HISTOGRAMEXISTS); - Palette_Outdated(envd); - if (fixpal) FixedPalette_Outdated(envd); - envd->updated = TRUE; - } - blsc->max_index = gbnc->max_index; - blsc->set_version_num(gbnc->get_version_num()); - parent_shp->updated = TRUE; - } - } - else - { - if (blsc) - { - if (blsc->bmps.size()) - { - // reset palette up to date flag - extended->flags = (GlobalBMPFlags)(extended->flags & ~GBF_HISTOGRAMEXISTS); - Palette_Outdated(envd); - if (fixpal) FixedPalette_Outdated(envd); - envd->updated = TRUE; - parent_shp->updated = TRUE; - } - delete blsc; - } - } - } - - lookup_child("RIFFNAME",chlst); - - while (chlst.size()) - { - delete chlst.first_entry(); - chlst.delete_first_entry(); - } - - if (edc) - { - edc->lookup_child("RIFFNAME",chlst); - - if (chlst.size()) - { - new RIF_Name_Chunk (this, ((RIF_Name_Chunk *)chlst.first_entry())->rif_name); - } - - } - - delete rfc; - } - -} - -void Shape_External_File_Chunk::post_input_processing() -{ - - update_from_external_rif(FALSE); - Chunk_With_Children::post_input_processing(); - -} -#else void Shape_External_File_Chunk::post_input_processing() { Chunk_With_Children::post_input_processing(); } -#endif const char* Shape_External_File_Chunk::get_shape_name() { @@ -2546,14 +2034,6 @@ Shape_Sub_Shape_Chunk::Shape_Sub_Shape_Chunk(Chunk_With_Children * parent, const data += *(int *)(data + 8); } - #if cencon || InterfaceEngine - Listchlist; - lookup_child("CONSHAPE",chlist); - for(LIF chlif(&chlist);!chlif.done();chlif.next()) - { - ((Console_Shape_Chunk*)chlif())->generate_console_chunkshape(); - } - #endif } Shape_Sub_Shape_Chunk::Shape_Sub_Shape_Chunk (Chunk_With_Children * parent, ChunkShape &shp_dat) diff --git a/src/win95/shpchunk.hpp b/src/win95/shpchunk.hpp index 18f8041..1aabd20 100644 --- a/src/win95/shpchunk.hpp +++ b/src/win95/shpchunk.hpp @@ -769,10 +769,6 @@ public: void post_input_processing(); - #if cencon || InterfaceEngine - void update_from_external_rif(BOOL force_scale_update); - #endif - //gets name from shape_external_object_name_chunk if it has one //otherwise takes name from rif_name_chunk const char * get_shape_name(); diff --git a/src/win95/sndchunk.cpp b/src/win95/sndchunk.cpp index 7054111..7c8c53d 100644 --- a/src/win95/sndchunk.cpp +++ b/src/win95/sndchunk.cpp @@ -4,9 +4,6 @@ #include "obchunk.hpp" #include "md5.h" -#ifdef cencon -#define new my_new -#endif //macro for helping to force inclusion of chunks when using libraries FORCE_CHUNK_INCLUDE_IMPLEMENT(sndchunk) diff --git a/src/win95/sprchunk.cpp b/src/win95/sprchunk.cpp index 93f67e6..83a8aac 100644 --- a/src/win95/sprchunk.cpp +++ b/src/win95/sprchunk.cpp @@ -1,15 +1,6 @@ #include "sprchunk.hpp" #include "mishchnk.hpp" -#if cencon -#include "fnamefnc.hpp" -#include "bmpnames.hpp" -#include "shpchunk.hpp" -#endif - -#ifdef cencon -#define new my_new -#endif //macro for helping to force inclusion of chunks when using libraries FORCE_CHUNK_INCLUDE_IMPLEMENT(sprchunk) @@ -300,260 +291,6 @@ BOOL Sprite_Header_Chunk::output_chunk(HANDLE & hand) return TRUE; } -#if cencon -void Sprite_Header_Chunk::post_input_processing() -{ - if (parent) - { - List chlst; - GetRootChunk()->lookup_child("REBENVDT",chlst); - Lockable_Chunk_With_Children * envd = 0; - if (chlst.size()) envd = (Lockable_Chunk_With_Children *) chlst.first_entry(); - - BOOL fixpal = IsFixedPalette(envd); - - lookup_child("SHPEXTFN",chlst); - - if (chlst.size()) - { - Shape_External_Filename_Chunk * sefc = (Shape_External_Filename_Chunk *)chlst.first_entry(); - - #if cencon - twprintf("Locating %s\n",sefc->file_name); - char * locatedfile = FindExistingFileInPath_PreferWriteable(CWnd::GetActiveWindow(),sefc->file_name,"RifSearchPath"); - twprintf("Loading %s\n",locatedfile ? locatedfile : sefc->file_name); - Sprite_Header_Chunk rfc(locatedfile ? locatedfile : sefc->file_name); - if (locatedfile) - { - delete[] locatedfile; - } - #else - Sprite_Header_Chunk rfc(sefc->file_name); - #endif - - if (rfc.error_code != 0) - { - return; - } - - lookup_child("SPRITVER",chlst); - int myver = -2; - if (chlst.size()) - { - Sprite_Version_Number_Chunk * svnc = (Sprite_Version_Number_Chunk *)chlst.first_entry(); - myver = svnc->version_num; - } - rfc.lookup_child("SPRITVER",chlst); - int yourver = -1; - if (chlst.size()) - { - Sprite_Version_Number_Chunk * svnc = (Sprite_Version_Number_Chunk *)chlst.first_entry(); - yourver = svnc->version_num; - } - - if (yourver != myver) - { - #define NOT_A_BITMAP_RELATED_CHUNK \ - strncmp ("BMPLSTST", child_ptr->identifier, 8) && \ - strncmp ("BMNAMVER", child_ptr->identifier, 8) && \ - strncmp ("BMNAMEXT", child_ptr->identifier, 8) && \ - strncmp ("RIFFNAME", child_ptr->identifier, 8) && \ - strncmp ("SHPEXTFN", child_ptr->identifier, 8) && \ - strncmp ("BMPMD5ID", child_ptr->identifier, 8) - - Chunk * child_ptr = children; - List chunks_to_delete; - while (child_ptr != NULL) - { - if (NOT_A_BITMAP_RELATED_CHUNK) - { - chunks_to_delete.add_entry(child_ptr); - } - child_ptr = child_ptr->next; - } - for (LIF delchunks(&chunks_to_delete); !delchunks.done(); delchunks.next()) - { - delete delchunks(); - } - - child_ptr = rfc.children; - while (child_ptr != NULL) - { - if (NOT_A_BITMAP_RELATED_CHUNK) - { - #define CREATE_CHUNK_END(_datablock) \ - new Miscellaneous_Chunk(this,_datablock,_datablock+12,*(int *)(_datablock+8)-12); - - #define CREATE_CHUNK_FOR(_datablock,_id,_chunkclass) \ - if (!strncmp(_datablock,_id,8)) { \ - new _chunkclass(this,_datablock+12,*(int *)(_datablock+8)-12); \ - } else - - child_ptr->prepare_for_output(); - char * datablock = child_ptr->make_data_block_from_chunk(); - - CREATE_CHUNK_FOR(datablock,"SPRITVER",Sprite_Version_Number_Chunk) - CREATE_CHUNK_FOR(datablock,"SPRITEPC",PC_Sprite_Chunk) - CREATE_CHUNK_FOR(datablock,"SPRITEPS",Playstation_Sprite_Chunk) - CREATE_CHUNK_FOR(datablock,"SPRITESA",Saturn_Sprite_Chunk) - CREATE_CHUNK_FOR(datablock,"SPRISIZE",Sprite_Size_Chunk) - CREATE_CHUNK_FOR(datablock,"SPRBMPSC",Sprite_Bitmap_Scale_Chunk) - CREATE_CHUNK_FOR(datablock,"SPRBMPCE",Sprite_Bitmap_Centre_Chunk) - CREATE_CHUNK_FOR(datablock,"SPREXTEN",Sprite_Extent_Chunk) - CREATE_CHUNK_END(datablock) - - delete[] datablock; - } - child_ptr = child_ptr->next; - } - - } - - Chunk_With_BMPs * blsc = 0; - Chunk_With_BMPs * gbnc = 0; - - rfc.lookup_child("BMPLSTST",chlst); - if (chlst.size()) - { - gbnc = (Chunk_With_BMPs *) chlst.first_entry(); - if (!gbnc->bmps.size()) gbnc = 0; - } - - List oldlst; - lookup_child("BMPLSTST",oldlst); - assert (oldlst.size()<2); - - if (oldlst.size()) - { - blsc = (Bitmap_List_Store_Chunk *)oldlst.first_entry(); - } - else - { - if (gbnc) blsc = new Bitmap_List_Store_Chunk(this); - } - - BMP_Names_ExtraData * extended = 0; - if (blsc) - { - extended = blsc->GetExtendedData(); - if (fixpal) - extended->flags = (GlobalBMPFlags)(extended->flags | GBF_FIXEDPALETTE); - else - extended->flags = (GlobalBMPFlags)(extended->flags & ~GBF_FIXEDPALETTE); - } - if (gbnc) - { - if ((gbnc->get_version_num()!=blsc->get_version_num()) || (gbnc->bmps.size() != blsc->bmps.size())) - { // other checks could be done as well - if (blsc->bmps.size()) - { - BOOL neednewpalette = FALSE; - - List newlist = gbnc->bmps; - for (LIF newLIF(&newlist); !newLIF.done(); newLIF.next()) - { - BMP_Name newcur = newLIF(); - newcur.flags = (BMPN_Flags) (newcur.flags & ~(COMPLETED_BMPN_FLAGS | ChunkBMPFlag_FixedPalette)); - if (fixpal) newcur.flags = (BMPN_Flags) (newcur.flags | ChunkBMPFlag_FixedPalette); - for (LIF oldLIF(&blsc->bmps); !oldLIF.done(); oldLIF.next()) - { - BMP_Name oldcur = oldLIF(); - if (newcur == oldcur) - { - // do we need to requantize? - if ((oldcur.flags ^ newcur.flags) & CHECKMODIFY_BMPN_FLAGS - || newcur.flags & ChunkBMPFlag_UsesTransparency - && !(newcur.flags & ChunkBMPFlag_IFF) - && !(oldcur.flags & ChunkBMPFlag_IFF) - && oldcur.DifferentTransparencyColour(newcur)) - oldcur.flags = (BMPN_Flags)(oldcur.flags & ~COMPLETED_BMPN_FLAGS); - // keep some of the old flags - the ones that can differ - newcur.flags = (BMPN_Flags)(newcur.flags & COPY_BMPN_FLAGS); - newcur.flags = (BMPN_Flags)(newcur.flags | oldcur.flags & ~COPY_BMPN_FLAGS); - if (oldcur.version_num != newcur.version_num) - { - neednewpalette = TRUE; - newcur.flags = (BMPN_Flags)(newcur.flags & ~ChunkBMPFlag_HistogramExists); - extended->flags = (GlobalBMPFlags)(extended->flags & ~GBF_HISTOGRAMEXISTS); - } - break; - } - } - if (oldLIF.done()) - { - // reset palette up to date flag - neednewpalette = TRUE; - newcur.flags = (BMPN_Flags)(newcur.flags & ~(ChunkBMPFlag_HistogramExists | COMPLETED_BMPN_FLAGS)); - extended->flags = (GlobalBMPFlags)(extended->flags & ~GBF_HISTOGRAMEXISTS); - } - newLIF.change_current(newcur); - } - - // check if any bitmaps have been removed - for (LIF bli(&blsc->bmps); !bli.done(); bli.next()) - { - if (!newlist.contains(bli())) - { - // delete assoc files - neednewpalette = TRUE; - extended->flags = (GlobalBMPFlags)(extended->flags & ~GBF_HISTOGRAMEXISTS); - } - } - - if (neednewpalette) - { - Palette_Outdated(envd); - if (fixpal) FixedPalette_Outdated(envd); - envd->updated = TRUE; - } - blsc->bmps = newlist; - } - else - { - blsc->bmps = gbnc->bmps; - for (LIF flagresetLIF(&blsc->bmps); !flagresetLIF.done(); flagresetLIF.next()) - { - BMP_Name current = flagresetLIF(); - current.flags = (BMPN_Flags)(current.flags & (COPY_BMPN_FLAGS & ~ChunkBMPFlag_FixedPalette)); - if (fixpal) current.flags = (BMPN_Flags) (current.flags | ChunkBMPFlag_FixedPalette); - flagresetLIF.change_current(current); - } - // reset palette up to date flag - extended->flags = (GlobalBMPFlags)(extended->flags & ~GBF_HISTOGRAMEXISTS); - Palette_Outdated(envd); - if (fixpal) FixedPalette_Outdated(envd); - envd->updated = TRUE; - } - blsc->max_index = gbnc->max_index; - blsc->set_version_num(gbnc->get_version_num()); - assert (!strcmp("RSPRITES",parent->identifier)); - ((Lockable_Chunk_With_Children *)parent)->updated = TRUE; - } - } - else - { - if (blsc) - { - if (blsc->bmps.size()) - { - // reset palette up to date flag - extended->flags = (GlobalBMPFlags)(extended->flags & ~GBF_HISTOGRAMEXISTS); - Palette_Outdated(envd); - if (fixpal) FixedPalette_Outdated(envd); - envd->updated = TRUE; - assert (!strcmp("RSPRITES",parent->identifier)); - ((Lockable_Chunk_With_Children *)parent)->updated = TRUE; - } - delete blsc; - } - } - - } - - } - Chunk_With_Children::post_input_processing(); -} -#endif RIF_IMPLEMENT_DYNCREATE_DECLARE_PARENT("SPRITEPC",PC_Sprite_Chunk,"SPRIHEAD",Sprite_Header_Chunk) PC_Sprite_Chunk::PC_Sprite_Chunk(Sprite_Header_Chunk* parent,const char* data,size_t datasize) diff --git a/src/win95/sprchunk.hpp b/src/win95/sprchunk.hpp index 867f9f8..1e4f15a 100644 --- a/src/win95/sprchunk.hpp +++ b/src/win95/sprchunk.hpp @@ -9,9 +9,6 @@ struct Frame int CentreX; int CentreY; int UVCoords[4][2]; -#if cencon - int OldTexNum; -#endif }; class Sprite_Header_Chunk : public Chunk_With_Children @@ -26,10 +23,6 @@ public: int write_file(const char* fname); virtual BOOL output_chunk(HANDLE &hand); - #if cencon - virtual void post_input_processing(); - #endif - }; class PC_Sprite_Chunk : public Chunk_With_Children diff --git a/src/win95/toolchnk.cpp b/src/win95/toolchnk.cpp index b4a897b..01e2865 100644 --- a/src/win95/toolchnk.cpp +++ b/src/win95/toolchnk.cpp @@ -1,9 +1,5 @@ #include "toolchnk.hpp" -#ifdef cencon -#define new my_new -#endif - //macro for helping to force inclusion of chunks when using libraries FORCE_CHUNK_INCLUDE_IMPLEMENT(toolchnk) diff --git a/src/win95/zsp.cpp b/src/win95/zsp.cpp index 1484812..5ff0930 100644 --- a/src/win95/zsp.cpp +++ b/src/win95/zsp.cpp @@ -1,263 +1,9 @@ #include -#if cencon -#include "AFXWIN.H" #include "list_tem.hpp" -#include "Vectors.hpp" -#include "environs.hpp" -#include "shpchunk.hpp" -#elif shpedit -#include "list_tem.hpp" -#include "Vectors.hpp" -#else -#include "list_tem.hpp" -#endif - #include "zsp.hpp" -#ifdef cencon -#define new my_new -#endif - -#if shpedit -#define twprintf printf -#endif - -// ZSP creation functions - -#if cencon -void generate_zsp_data (int num_cubes, CWnd * pWnd) -{ - Shape_Chunk * shpch = Sel_Obj->get_assoc_shape(); - - if (!shpch->lock_chunk(*(Main_Env.environment))) - { - char message[300]; - char * locker = "Unknown"; - - Shape_Header_Chunk * head = shpch->get_header(); - if (head) - locker = head->lock_user; - - sprintf (message, "Shape locked by %s\n can not continue", locker); - - pWnd->MessageBox (message, "Tools Control Area", - MB_ICONHAND + MB_OK + MB_TASKMODAL); - return; - } - start_text_window(pWnd); - - - ZSP_Data * zsp = new ZSP_Data (shpch->shape_data, num_cubes); - new Shape_ZSP_Data_Chunk (shpch, *zsp); - - shpch->unlock_chunk (*(Main_Env.environment), TRUE); - stop_text_window(); - - delete zsp; -} -#endif - -#if cencon || shpedit - -ZSP_Data::ZSP_Data (const ChunkShape & shp, int num_cubes) -{ - double xsize,ysize,zsize; - double max_size; - Vector cube_vector; - int num_subshapes; - - xsize = fabs(shp.max.x) + fabs(shp.min.x); - ysize = fabs(shp.max.y) + fabs(shp.min.y); - zsize = fabs(shp.max.z) + fabs(shp.min.z); - - max_size=max(xsize,ysize); - max_size=max(max_size,zsize); - - cube_size = max_size / num_cubes; - - int nc = num_cubes+2; - - num_x_cubes = nc-(int) ( nc-(xsize / cube_size) ); - num_y_cubes = nc-(int) ( nc-(ysize / cube_size) ); - num_z_cubes = nc-(int) ( nc-(zsize / cube_size) ); - - cube_vector.x = cube_size / 2; - cube_vector.y = cube_size / 2; - cube_vector.z = cube_size / 2; - cube_radius = mod(cube_vector); - - num_subshapes = num_x_cubes * num_y_cubes * num_z_cubes; - - int i,j,k; - double xstart, ystart, zstart; - double xstart_tmp, ystart_tmp, zstart_tmp; - - - xstart = shp.min.x; - ystart = shp.min.y; - zstart = shp.min.z; - - xstart_tmp = xstart; - - twprintf ("Number of zones is \n",num_subshapes); - - for(i = 0; i < num_x_cubes; i++) { - - twprintf ("x = %d\n",i); - - ystart_tmp = ystart; - - for(j = 0; j < num_y_cubes; j++) { - - twprintf ("y = %d\nz = ",j); - - zstart_tmp = zstart; - - for(k = 0; k < num_z_cubes; k++) { - - twprintf ("%d ",k); - - /* Process the subshape and update the ZSP pointer array */ - - ZSP_zone temp_zone(shp, xstart_tmp, ystart_tmp, - zstart_tmp, cube_size); - - zone_array.add_entry(temp_zone); - - zstart_tmp += cube_size; - - } - - twprintf ("\n"); - - ystart_tmp += cube_size; - - } - - xstart_tmp += cube_size; - - } - - - -} - - - -static int zone_polygons[20000]; -static unsigned char vertex_outcode [20000]; - -ZSP_zone::ZSP_zone (const ChunkShape & shp, double xstart, double ystart, - double zstart, double cube_size) -{ - double xplane0, xplane1; - double yplane0, yplane1; - double zplane0, zplane1; - int i,j; - int outcode_or, outcode_and; - int vert_outcode; - - num_z_polys = 0; - num_z_verts = 0; - - /* Bounding planes in terms of axis limits */ - - xplane0 = xstart; - xplane1 = xstart + cube_size; - - yplane0 = ystart; - yplane1 = ystart + cube_size; - - zplane0 = zstart; - zplane1 = zstart + cube_size; - - for (i=0; i xplane1) vert_outcode |= rsp_oc_x1; - if(shp.v_list[point_no].y < yplane0) vert_outcode |= rsp_oc_y0; - if(shp.v_list[point_no].y > yplane1) vert_outcode |= rsp_oc_y1; - if(shp.v_list[point_no].z < zplane0) vert_outcode |= rsp_oc_z0; - if(shp.v_list[point_no].z > zplane1) vert_outcode |= rsp_oc_z1; - - if(j==0) { - - outcode_or = vert_outcode; - outcode_and = vert_outcode; - - } - - else { - - outcode_or |= vert_outcode; - outcode_and &= vert_outcode; - - } - - } - - if (outcode_and == 0) - { - zone_polygons[num_z_polys] = i; - num_z_polys++; - } - - } - - if (!num_z_polys) - { - z_poly_list=0; - z_vert_list=0; - return; - } - - z_poly_list = new int [num_z_polys]; - for (i=0; i