From 218ca90543758a20ac326e444ca0643174ca7384 Mon Sep 17 00:00:00 2001 From: Rebellion Developments Date: Thu, 16 Mar 2000 11:25:00 +0100 Subject: Import Aliens vs Predator - Gold (Build 116) Source code release, imported from: https://www.gamefront.com/games/aliens-vs-predator-3/file/avp-gold-complete-source-code All text files were converted to Unix format. --- 3dc/win95/TOOLCHNK.CPP | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 3dc/win95/TOOLCHNK.CPP (limited to '3dc/win95/TOOLCHNK.CPP') diff --git a/3dc/win95/TOOLCHNK.CPP b/3dc/win95/TOOLCHNK.CPP new file mode 100644 index 0000000..b4a897b --- /dev/null +++ b/3dc/win95/TOOLCHNK.CPP @@ -0,0 +1,41 @@ +#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) + +RIF_IMPLEMENT_DYNCREATE("CAMORIGN",Camera_Origin_Chunk) + +Camera_Origin_Chunk::Camera_Origin_Chunk(Chunk_With_Children* parent) +:Chunk(parent,"CAMORIGN") +{ + location.x=0; + location.y=0; + location.z=0; + ChunkMatrix identity={1,0,0,0,1,0,0,0,1}; + orientation=identity; +} + +Camera_Origin_Chunk::Camera_Origin_Chunk(Chunk_With_Children* parent,const char* data,size_t ) +:Chunk(parent,"CAMORIGN") +{ + location=*(ChunkVector*)data; + data+=sizeof(ChunkVector); + orientation=*(ChunkMatrix*)data; +} + +void Camera_Origin_Chunk::fill_data_block(char * data_start) +{ + strncpy (data_start, identifier, 8); + data_start += 8; + *((int *) data_start) = chunk_size; + data_start += 4; + + *(ChunkVector*)data_start=location; + data_start+=sizeof(ChunkVector); + *(ChunkMatrix*)data_start=orientation; +} + -- cgit v1.3