-ADD_LIBRARY (Genesis3D STATIC CSNetMgr.c)
+ADD_LIBRARY (Genesis3D STATIC Box.c CRC32.c CSNetMgr.c Camera.c Entities.c ErrorLog.c ExtBox.c Font.c Ge.c
+ GeAssert.c Log.c Matrix33.c MemPool.c NetPlay.c)
/* Copyright (C) 1999 WildTangent, Inc. All Rights Reserved */\r
/* */\r
/****************************************************************************************/\r
-#include "crc32.h"\r
+#include "CRC32.h"\r
\r
static uint32 crc_table[256] =\r
{\r
#ifndef GE_CRC32_H\r
#define GE_CRC32_H\r
\r
-#include "basetype.h"\r
+#include "BaseType.h"\r
\r
#ifdef __cplusplus\r
extern "C" {\r
#include <memory.h> // memset\r
\r
#include "Camera.h"\r
-#include "include/Ram.h"\r
-#include "include/ErrorLog.h"\r
+#include "Ram.h"\r
+#include "ErrorLog.h"\r
#include "G3D/Engine/Drivers/DCommon.h"\r
\r
typedef struct geCamera \r
#ifndef GE_CAMERA_H\r
#define GE_CAMERA_H\r
\r
-#include "include/BaseType.h"\r
-#include "include/Vec3d.h"\r
-#include "include/XForm3d.h"\r
-#include "include/GeTypes.h"\r
+#include "BaseType.h"\r
+#include "Vec3d.h"\r
+#include "XForm3d.h"\r
+#include "GeTypes.h"\r
\r
#ifdef __cplusplus\r
extern "C" {\r
#ifndef BITMAPLIST_H\r
#define BITMAPLIST_H\r
\r
-#include "include/GeTypes.h"\r
+#include "G3D/GeTypes.h"\r
#include "G3D/Engine/Drivers/DCommon.h"\r
-#include "include/Bitmap.h"\r
+#include "G3D/Bitmap.h"\r
\r
typedef struct BitmapList BitmapList;\r
\r
\r
//#define OLD_FONT\r
\r
-#include "include/ErrorLog.h"\r
-#include "include/Genesis.h"\r
+#include "G3D/ErrorLog.h"\r
+#include "G3D/Genesis.h"\r
#include <windows.h>\r
#include "G3D/Engine/Drivers/DCommon.h"\r
#include "G3D/Camera.h"\r
#include <assert.h>\r
\r
#include "Entities.h"\r
-#include "include/BaseType.h"\r
-#include "include/ErrorLog.h"\r
-#include "include/Vec3d.h"\r
-#include "include/Ram.h"\r
+#include "BaseType.h"\r
+#include "ErrorLog.h"\r
+#include "Vec3d.h"\r
+#include "Ram.h"\r
\r
// These are temporary until we find a better way to get models pointers into the entity stuff\r
-#include "G3D/World/World.h"\r
-#include "G3D/World/GBSPFile.h"\r
+#include "World.h"\r
+#include "GBSPFile.h"\r
\r
\r
//=====================================================================================\r
#include <assert.h>\r
#include <windows.h>\r
\r
-#include "include/BaseType.h"\r
-#include "include/ErrorLog.h"\r
-#include "include/Vec3d.h"\r
+#include "BaseType.h"\r
+#include "ErrorLog.h"\r
+#include "Vec3d.h"\r
#include "G3D/Engine/System.h"\r
-#include "World/World.h"\r
-#include "include/Ram.h"\r
+#include "World.h"\r
+#include "Ram.h"\r
\r
#ifdef __cplusplus\r
extern "C" {\r
\r
#include <assert.h>\r
\r
-#include "include/Vec3d.h"\r
-#include "include/BaseType.h"\r
-#include "include/GeTypes.h"\r
-#include "include/Ram.h"\r
-#include "include/ErrorLog.h"\r
+#include "G3D/Vec3d.h"\r
+#include "G3D/BaseType.h"\r
+#include "G3D/GeTypes.h"\r
+#include "G3D/Ram.h"\r
+#include "G3D/ErrorLog.h"\r
\r
#ifdef __cplusplus\r
extern "C" {\r
#include <windowsx.h>\r
#pragma warning(default : 4201 4214 4115)\r
\r
-#include "extbox.h"\r
-#include "ram.h"\r
-#include "wgClip.h"\r
+#include "ExtBox.h"\r
+#include "Ram.h"\r
+#include "WgClip.h"\r
\r
#include <assert.h>\r
#include <string.h>\r
\r
-#include "font.h"\r
+#include "Font.h"\r
\r
#pragma warning (disable:4514) // unreferenced inline function (caused by Windows)\r
\r
#define GE_FONT_H\r
\r
// includes\r
-#include "genesis.h"\r
-#include "basetype.h"\r
-#include "bitmap.h"\r
+#include "Genesis.h"\r
+#include "BaseType.h"\r
+#include "Bitmap.h"\r
// **************************\r
// to use this API:\r
\r
+++ /dev/null
-/****************************************************************************************/\r
-/* FONT.H */\r
-/* */\r
-/* Author: Thom Robertson */\r
-/* Description: Bitmapped font support interface */\r
-/* This implementation supports any TrueType fonts provided by Windows */\r
-/* */\r
-/* The contents of this file are subject to the Genesis3D Public License */\r
-/* Version 1.01 (the "License"); you may not use this file except in */\r
-/* compliance with the License. You may obtain a copy of the License at */\r
-/* http://www.genesis3d.com */\r
-/* */\r
-/* Software distributed under the License is distributed on an "AS IS" */\r
-/* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See */\r
-/* the License for the specific language governing rights and limitations */\r
-/* under the License. */\r
-/* */\r
-/* The Original Code is Genesis3D, released March 25, 1999. */\r
-/* Genesis3D Version 1.1 released November 15, 1999 */\r
-/* Copyright (C) 1999 WildTangent, Inc. All Rights Reserved */\r
-/* */\r
-/****************************************************************************************/\r
-#ifndef GE_FONT_H\r
-#define GE_FONT_H\r
-\r
-// includes\r
-#include "genesis.h"\r
-#include "basetype.h"\r
-#include "bitmap.h"\r
-// **************************\r
-// to use this API:\r
-\r
-// 2. geFont_CreateFont().\r
-\r
-// 3. (Optionally) geFont_AddCharacters().\r
-// 3A. Otherwise, IF you intend to use geFont_DrawText(), call geFont_AddBitmapBuffer().\r
-\r
-// 4. Between geEngine_BeginFrame() and geEngine_EndFrame(), and after geEngine_RenderWorld(),\r
-// geFont_DrawText(). You may call geFont_DrawTextToBitmap() anytime, though.\r
-\r
-// 5. When finished, geFont_Destroy().\r
-\r
-\r
-\r
-//*************************************************************************************** \r
-// these are bit flags for _DrawText(). Currently only _WORDWRAP is implemented, and without\r
-// it, the function will still wrap, just not on word boundaries.\r
-// Note that these will fail for non ascii fonts.\r
-#define GE_FONT_WRAP 0x00000001 // wrap to fit inside the drawing rect\r
-#define GE_FONT_WORDWRAP 0x00000002 // wrap on word boundaries\r
-#define GE_FONT_JUST_RETURN_FIT 0x00000004 // returns number of characters that fit in drawing rectangle, WITHOUT drawing anything.\r
-#define GE_FONT_JUSTIFY_RIGHT 0x00000008\r
-#define GE_FONT_JUSTIFY_CENTER 0x00000010\r
-\r
-#ifdef __cplusplus\r
-extern "C" {\r
-#endif\r
-\r
-// opaque structure headers.\r
-typedef struct geFont geFont; // an instance of a font\r
-\r
-\r
-//*************************************************************************************** \r
-GENESISAPI geFont *GENESISCC geFont_Create(const geEngine *Engine, const char *fontNameString, \r
- const int fontSize,\r
- const int fontWeight , const geBoolean antialiased) ;\r
- // Creates a font, and returns a pointer to it.\r
- // Pass in the string name of the TrueType font (case sensitive), and the height in pixels.\r
- \r
- // ARGUMENTS:\r
- // fontNameString - char pointer to a string containing the case sensitive name of the font.\r
- // fontSize - the pixel height of the requested font.\r
-\r
- // RETURNS:\r
- // success: pointer to the newly created font.\r
- // failure: NULL.\r
-\r
- // NOTE: the new font set has NO actual characters in it at first. You must add characters\r
- // to it with the _AddCharacters() function before you can use the font.\r
- // NOTE: all fonts start out with a grayscale palette, with the range 0 to 128.\r
-\r
-//*************************************************************************************** \r
-GENESISAPI void GENESISCC geFont_CreateRef(geFont *font);\r
-\r
-\r
-//*************************************************************************************** \r
-GENESISAPI void GENESISCC geFont_Destroy(geFont **font);\r
- // destroys a font.\r
-\r
- // ARGUMENTS:\r
- // font - pointer to the font to be destroyed.\r
-\r
- // RETURNS:\r
- // nothing.\r
-\r
-//*************************************************************************************** \r
-GENESISAPI geBoolean GENESISCC geFont_AddCharacters(geFont *font, \r
- unsigned char leastIndex, \r
- unsigned char mostIndex\r
- );\r
- // Adds a set of characters to the font defined by the ascii range passed in \r
- // (leastIndex and mostIndex, inclusive).\r
-\r
- // ARGUMENTS:\r
- // font - pointer to the font to add characters to.\r
- // e - pointer to a valid geEngine.\r
- // leastIndex and mostIndex - the ASCII range of characters to add.\r
- // cellBuffer - an allocated hunk of ram to temproarily store the character image\r
- // bufferSize - length of the above buffer\r
-\r
- // RETURNS:\r
- // success: GE_TRUE.\r
- // failure: GE_FALSE.\r
-\r
- // NOTES:\r
- // This is the function that actually uses the\r
- // Win32 GetGlyphOutline() function to draw the character onto a geBitmap, which can be\r
- // blitted to the screen.\r
-\r
-\r
-//*******************************************************************************\r
-GENESISAPI void GENESISCC geFont_DestroyBitmapBuffer( geFont *font );\r
- // destroys any valid "scratch-pad" buffer attached to the geFont.\r
- // ARGUMENTS:\r
- // font - pointer to the geFont.\r
- //\r
- // NOTES:\r
- // you'll rarely need to call this function; it's called by geFont_Destroy() anyway.\r
- // Calling this function with a geFont that has no initialized buffer doesn't\r
- // hurt anything.\r
-\r
-//*******************************************************************************\r
-GENESISAPI geBoolean GENESISCC geFont_AddBitmapBuffer(\r
- geFont *font, const uint32 width, const uint32 height);\r
- // Adds a geBitmap to the geFont, to be used as a temporary "scratch-pad". This is\r
- // required for using geFont_DrawText() when no characters have been added.\r
-\r
- // ARGUMENTS:\r
- // font - pointer to the geFont to add a buffer to.\r
- // width and height - the size of the buffer to create. Make sure this size is >=\r
- // the biggest rectagle of text you'll want to write to the screen using this geFont\r
- // and DrawText().\r
-\r
- // RETURNS:\r
- // success: GE_TRUE.\r
- // failure: GE_FALSE.\r
-\r
- // NOTES:\r
- // You don't need to call this function IF you _AddCharacters() to this geFont.\r
- // You call this function for each geFont you need to use. geFont's don't share buffers.\r
- // if you call this function on a geFont that already has a valid buffer, the buffer is\r
- // destroyed, and replaced by the new one.\r
-\r
-//*************************************************************************************** \r
-GENESISAPI geBoolean GENESISCC geFont_DrawText(geFont *font, const char *textString, \r
- const GE_Rect *Rect, const GE_RGBA *Color, \r
- uint32 flags, const GE_Rect *clipRect);\r
- // This is the function you put between geEngine_BeginFrame() and _EndFrame(), the function\r
- // that draws text to the screen.\r
-\r
- // ARGUMENTS:\r
- // font - pointer to the font to draw with. IF the font has NO characters in it\r
- // (added by geFont_AddCharacters() ) then a different, more windows-intensive way is\r
- // used to draw out the characters.\r
- // textString - pointer to the text string to output to the screen.\r
- // Rect - screen rectangle to place the text within.\r
- // Color - RGB color the text should be.\r
- // flags - a bitfield of GE_FONT_ values.\r
- // clipRect - pointer to a screen rectangle to clip the text to. MAY BE NULL, in which\r
- // case the text is only clipped by the boundaries of the screen.\r
-\r
- // RETURNS:\r
- // success: GE_TRUE.\r
- // failure: GE_FALSE.\r
-\r
- // NOTES:\r
- // Assuming you've added characters to the font, characters which have NOT been added\r
- // WILL cause an assert if you try to draw them. \r
- // Only GE_FONTSET_WORDWRAP is meaningfull right now. Using any other flags will cause\r
- // an assert.\r
- // As stated above, you can use an entirely different way of creating a string, by\r
- // making a font with no characters in it. This\r
- // jumps through Windows DIB hoops, and draws the text in a non-anti-aliased, but\r
- // (hopefully) more unicode-tolerant way (DrawText() ).\r
-\r
-\r
-//*************************************************************************************** \r
-GENESISAPI geBoolean GENESISCC geFont_DrawTextToBitmap(geFont *font, const char *textString, \r
- const GE_Rect *Rect, const GE_RGBA *Color, \r
- uint32 flags, const GE_Rect *clipRect,\r
- geBitmap *targetBitmap);\r
- // This is the function you put between geEngine_BeginFrame() and _EndFrame(), the function\r
- // that draws text to the screen.\r
-\r
- // ARGUMENTS:\r
- // font - pointer to the font to draw with. IF the font has NO characters in it\r
- // (added by geFont_AddCharacters() ) then a different, more windows-intensive way is\r
- // used to draw out the characters.\r
- // textString - pointer to the text string to output to the screen.\r
- // Rect - screen rectangle to place the text within.\r
- // Color - RGB color the text should be.\r
- // flags - a bitfield of GE_FONT_ values.\r
- // clipRect - pointer to a screen rectangle to clip the text to. MAY BE NULL, in which\r
- // case the text is only clipped by the boundaries of the screen.\r
- // targetBitmap - pointer to a target bitmap to draw the text into. MAY NOT BE NULL,\r
- // and MUST BE GE_PIXELFORMAT_8BIT.\r
-\r
- // RETURNS:\r
- // success: GE_TRUE.\r
- // failure: GE_FALSE.\r
-\r
- // NOTES:\r
- // Assuming you've added characters to the font, characters which have NOT been added\r
- // WILL cause an assert if you try to draw them. \r
- // Only GE_FONTSET_WORDWRAP is meaningfull right now. Using any other flags will cause\r
- // an assert.\r
- // As stated above, you can use an entirely different way of creating a string, by\r
- // making a font with no characters in it. This\r
- // jumps through Windows DIB hoops, and draws the text in a non-anti-aliased, but\r
- // (hopefully) more unicode-tolerant way (DrawText() ).\r
- // The Color argument is will be used to modify the existing palette of the targetBitmap\r
- // passed in. Therefore, you won't be able to _DrawTextToBitmap() a red piece of text,\r
- // then a green piece, then a blue piece. You'll end up with three lines of blue text.\r
-\r
-\r
-//*************************************************************************************** \r
-GENESISAPI int32 GENESISCC geFont_GetStringPixelWidth (geFont *font, const char *textString);\r
-GENESISAPI int32 GENESISCC geFont_GetStringPixelHeight(geFont *font, const char *textString);\r
- // These two functions return the pixel width and height of the string passed in.\r
-\r
- // ARGUMENTS:\r
- // font - pointer to the font to draw with.\r
- // textString - pointer to the text string to output to the screen.\r
-\r
- // RETURNS:\r
- // success: a positive value in pixels. IF the text passed in contains characters\r
- // which haven't been added to the font yet, BUT other characters HAVE\r
- // been added, the function asserts.\r
- // failure: -1.\r
- // NOTES:\r
- // these two functions assume no text wrapping!\r
-\r
-//*************************************************************************************** \r
-GENESISAPI geBitmap* GENESISCC geFont_GetBuffer(geFont *font);\r
- // This function returns a pointer to the drawing buffer contained by the font.\r
-\r
- // ARGUMENTS:\r
- // font - pointer to the font.\r
-\r
- // RETURNS:\r
- // a valid pointer to a geBitmap, OR NULL, signifying that the buffer wasn't initialized.\r
-\r
-\r
-//*************************************************************************************** \r
-GENESISAPI geBoolean GENESISCC geFont_GetCharMap(geFont *font, uint8 character, GE_Rect *Rect, \r
- geBitmap **targetBitmap, int32 *fullWidth, int32 *fullHeight, \r
- int32 *offsetX, int32 *offsetY);\r
-\r
-//*************************************************************************************** \r
-GENESISAPI void GENESISCC geFont_EnableAntialiasing(geFont *font, const geBoolean anti);\r
-//*************************************************************************************** \r
-GENESISAPI geBoolean GENESISCC geFont_IsAntialiased(geFont *font);\r
-\r
-#ifdef __cplusplus\r
-}\r
-#endif\r
-\r
-#endif\r
-\r
#include <assert.h>\r
//#include <Windows.h>\r
\r
-#include "include/BaseType.h"\r
+#include "G3D/BaseType.h"\r
#include "GBSPFile.h"\r
-#include "include/Vec3d.h"\r
+#include "G3D/Vec3d.h"\r
#include "G3D/Camera.h"\r
-#include "include/XForm3d.h"\r
+#include "G3D/XForm3d.h"\r
#include "Surface.h"\r
\r
#ifdef __cplusplus\r
\r
#include <stdio.h>\r
\r
-#include "include/BaseType.h"\r
-#include "include/Vec3d.h"\r
+#include "G3D/BaseType.h"\r
+#include "G3D/Vec3d.h"\r
#include <windows.h>\r
#include "G3D/Engine/Drivers/DCommon.h"\r
-#include "include/VFile.h"\r
-#include "include/Motion.h"\r
+#include "G3D/VFile.h"\r
+#include "G3D/Motion.h"\r
\r
#ifdef __cplusplus\r
extern "C" {\r
#include <math.h>\r
#include <assert.h>\r
\r
-#include "include/Genesis.h"\r
+#include "Genesis.h"\r
#include "G3D/Engine/System.h"\r
-#include "include/Ram.h"\r
+#include "Ram.h"\r
\r
//#include "Sound.h"\r
//#include "Sound3d.h"\r
\r
-#include "G3D/World/World.h"\r
-#include "G3D/World/Surface.h"\r
+#include "World.h"\r
+#include "Surface.h"\r
//#include "Camera.h"\r
-#include "G3D/World/Light.h"\r
-#include "G3D/World/Plane.h"\r
+#include "Light.h"\r
+#include "Plane.h"\r
#include "Entities.h"\r
-#include "G3D/World/Trace.h"\r
-#include "G3D/World/User.h"\r
+#include "Trace.h"\r
+#include "User.h"\r
//#include "Host.h"\r
-#include "include/Motion.h"\r
-#include "G3D/World/Vis.h"\r
+#include "Motion.h"\r
+#include "Vis.h"\r
\r
//=====================================================================================\r
// local static globals\r
/* Copyright (C) 1999 WildTangent, Inc. All Rights Reserved */\r
/* */\r
/****************************************************************************************/\r
-#include "geAssert.h"\r
+#include "GeAssert.h"\r
#include <assert.h>\r
#include <stdlib.h>\r
#include <string.h>\r
#include <stdio.h>\r
- \r
+\r
// See geAssert.h for details.\r
\r
//void __cdecl _assertge (void *expr,void *filename,unsigned lineno);\r
#include <assert.h>\r
//#include <Windows.h>\r
\r
-#include "include/Genesis.h"\r
-#include "include/BaseType.h"\r
+#include "G3D/Genesis.h"\r
+#include "G3D/BaseType.h"\r
#include "G3D/Engine/System.h"\r
#include "G3D/Engine/Drivers/DCommon.h"\r
\r
#include <assert.h>\r
#include <stdlib.h>\r
#include <string.h>\r
-#include "list.h"\r
-#include "mempool.h"\r
-#include "ram.h"\r
-#include "crc32.h"\r
+#include "List.h"\r
+#include "MemPool.h"\r
+#include "Ram.h"\r
+#include "CRC32.h"\r
\r
/**********************************/\r
// Timer Stuff\r
if ( pHash )\r
{\r
HashNode *pList,*pNode,*pNext;\r
- \r
- assert( pHash->MySelf1 == pHash && pHash->MySelf2 == pHash );\r
+ // FIXME: where does this member variable come from?!?\r
+ //assert( pHash->MySelf1 == pHash && pHash->MySelf2 == pHash );\r
\r
Debug(pHash->Members += 2) // count Head & Tail\r
\r
pList = pHash->NodeList;\r
LN_Walk_Editting(pNode,pList,pNext) {\r
MemPool_FreeHunk(HashNodePool_g,pNode);\r
- assert(pHash->Members > 1);\r
+ // FIXME: where does this member variable come from?!?\r
+ //assert(pHash->Members > 1);\r
Debug(pHash->Members --)\r
}\r
- assert(pHash->Members == 1);\r
+ // FIXME: where does this member variable come from?!?\r
+ //assert(pHash->Members == 1);\r
MemPool_FreeHunk(HashNodePool_g,pList);\r
destroy(pHash);\r
}\r
Debug( int ListLen1; int ListLen2; int HashLen1; int HashLen2; int WalkLen)\r
\r
assert(pHash);\r
- assert( pHash->MySelf1 == pHash && pHash->MySelf2 == pHash );\r
+ // FIXME: where does this member variable come from?!?\r
+ //assert( pHash->MySelf1 == pHash && pHash->MySelf2 == pHash );\r
\r
hn = MemPool_GetHunk(HashNodePool_g);\r
assert(hn);\r
{\r
Prev = Node;\r
Node = LN_Next(Prev);\r
- \r
- assert(WalkLen < pHash->Members );\r
+ // FIXME: where does this member variable come from?!?\r
+ //assert(WalkLen < pHash->Members );\r
Debug( WalkLen ++)\r
\r
assert(Prev->Hash <= Node->Hash);\r
Debug(pHash->Members ++)\r
\r
Debug(ListLen2 = Hash_ListLen(pHash,H))\r
- assert( ListLen2 == (ListLen1 + 1) );\r
+ // FIXME: where does this member variable come from?!?\r
+ //assert( ListLen2 == (ListLen1 + 1) );\r
Debug(HashLen2 = Hash_NumMembers(pHash))\r
- assert( HashLen2 == (HashLen1 + 1) );\r
+ // FIXME: where does this member variable come from?!?\r
+ //assert( HashLen2 == (HashLen1 + 1) );\r
\r
return hn;\r
}\r
\r
assert(pNode );\r
assert( pHash );\r
- assert( pHash->MySelf1 == pHash && pHash->MySelf2 == pHash );\r
+ // FIXME: where does this member variable come from?!?\r
+ //assert( pHash->MySelf1 == pHash && pHash->MySelf2 == pHash );\r
\r
assert( pNode->Hash > 0 && pNode->Hash < HASH_SIZE );\r
\r
\r
Debug( HashLen1 = Hash_NumMembers(pHash) )\r
Debug( ListLen1 = Hash_ListLen(pHash,H) )\r
- assert(pHash->Members > 0);\r
+ // FIXME: where does this member variable come from?!?\r
+ //assert(pHash->Members > 0);\r
Debug(pHash->Members --)\r
\r
if ( *pHead == pNode )\r
\r
Debug( HashLen2 = Hash_NumMembers(pHash) )\r
Debug( ListLen2 = Hash_ListLen(pHash,H) )\r
- assert( HashLen2 == (HashLen1 - 1) );\r
+ // FIXME: where does this member variable come from?!?\r
+ //assert( HashLen2 == (HashLen1 - 1) );\r
\r
}\r
\r
HashNode *pNode;\r
\r
assert(pHash );\r
- assert( pHash->MySelf1 == pHash && pHash->MySelf2 == pHash );\r
+ // FIXME: where does this member variable come from?!?\r
+ //assert( pHash->MySelf1 == pHash && pHash->MySelf2 == pHash );\r
\r
H = HASH(Key);\r
assert( H > 0 && H < HASH_SIZE );\r
HashNode *pNext;\r
\r
assert(pHash);\r
- assert( pHash->MySelf1 == pHash && pHash->MySelf2 == pHash );\r
+ // FIXME: where does this member variable come from?!?\r
+ //assert( pHash->MySelf1 == pHash && pHash->MySelf2 == pHash );\r
\r
if ( ! pNode )\r
{\r
HashNode *pNode;\r
\r
assert(pHash);\r
- assert( pHash->MySelf1 == pHash && pHash->MySelf2 == pHash );\r
+ // FIXME: where does this member variable come from?!?\r
+ //assert( pHash->MySelf1 == pHash && pHash->MySelf2 == pHash );\r
\r
pNode = pHash->NodeList;\r
assert( pNode->Hash == 0 );\r
N = 0;\r
while( pNode->Hash < HASH_SIZE )\r
{\r
- assert( N < (uint32)pHash->Members );\r
+ // FIXME: where does this member variable come from?!?\r
+ //assert( N < (uint32)pHash->Members );\r
pNode = LN_Next(pNode);\r
N ++;\r
}\r
\r
- assert( N == (uint32)pHash->Members );\r
+ // FIXME: where does this member variable come from?!?\r
+ //assert( N == (uint32)pHash->Members );\r
\r
return N;\r
}\r
/* */\r
/****************************************************************************************/\r
\r
-#include "basetype.h"\r
+#include "BaseType.h"\r
\r
#ifdef __cplusplus\r
extern "C" {\r
+++ /dev/null
-/****************************************************************************************/\r
-/* EXTBOX.H */\r
-/* */\r
-/* Author: */\r
-/* Description: Axial aligned bounding box (extent box) support */\r
-/* */\r
-/* The contents of this file are subject to the Genesis3D Public License */\r
-/* Version 1.01 (the "License"); you may not use this file except in */\r
-/* compliance with the License. You may obtain a copy of the License at */\r
-/* http://www.genesis3d.com */\r
-/* */\r
-/* Software distributed under the License is distributed on an "AS IS" */\r
-/* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See */\r
-/* the License for the specific language governing rights and limitations */\r
-/* under the License. */\r
-/* */\r
-/* The Original Code is Genesis3D, released March 25, 1999. */\r
-/* Genesis3D Version 1.1 released November 15, 1999 */\r
-/* Copyright (C) 1999 WildTangent, Inc. All Rights Reserved */\r
-/* */\r
-/****************************************************************************************/\r
-#ifndef GE_EXTBOX_H\r
-#define GE_EXTBOX_H\r
-\r
-#include "basetype.h"\r
-#include "vec3d.h"\r
-\r
-#ifdef __cplusplus\r
- extern "C" {\r
-#endif\r
-\r
-typedef struct geExtBox\r
-{\r
- geVec3d Min;\r
- geVec3d Max;\r
-} geExtBox;\r
-\r
-// Set the values in a box\r
-void GENESISCC geExtBox_Set ( geExtBox *B,\r
- geFloat X1, geFloat Y1, geFloat Z1,\r
- geFloat X2, geFloat Y2, geFloat Z2 );\r
-\r
-// Test a box for validity ( non NULL and max >= min )\r
-geBoolean GENESISCC geExtBox_IsValid( const geExtBox *B );\r
-\r
-// Set box Min and Max to the passed point\r
-void GENESISCC geExtBox_SetToPoint ( geExtBox *B, const geVec3d *Point );\r
-\r
-// Extend a box to encompass the passed point\r
-void GENESISCC geExtBox_ExtendToEnclose( geExtBox *B, const geVec3d *Point );\r
-\r
-// Return result of box intersection.\r
-// If no intersection, returns GE_FALSE and bResult is not modified.\r
-// If intersection, returns GE_TRUE and fills bResult (if not NULL)\r
-// with the intersected box,\r
-// bResult may be one of b1 or b2.\r
-// \r
-geBoolean GENESISCC geExtBox_Intersection ( const geExtBox *B1, const geExtBox *B2, geExtBox *Result );\r
-\r
-// computes union of b1 and b2 and returns in bResult.\r
-void GENESISCC geExtBox_Union ( const geExtBox *B1, const geExtBox *B2, geExtBox *Result );\r
-\r
-geBoolean GENESISCC geExtBox_ContainsPoint ( const geExtBox *B, const geVec3d *Point );\r
-\r
-void GENESISCC geExtBox_GetTranslation ( const geExtBox *B, geVec3d *pCenter );\r
-void GENESISCC geExtBox_SetTranslation ( geExtBox *B, const geVec3d *pCenter );\r
-void GENESISCC geExtBox_Translate ( geExtBox *B, geFloat DX, geFloat DY, geFloat DZ );\r
-\r
-void GENESISCC geExtBox_GetScaling ( const geExtBox *B, geVec3d *pScale );\r
-void GENESISCC geExtBox_SetScaling ( geExtBox *B, const geVec3d *pScale );\r
-void GENESISCC geExtBox_Scale ( geExtBox *B, geFloat DX, geFloat DY,geFloat DZ );\r
-\r
-// Creates a box that encloses the entire area of a box that moves along linear path\r
-void GENESISCC geExtBox_LinearSweep( const geExtBox *BoxToSweep, \r
- const geVec3d *StartPoint, \r
- const geVec3d *EndPoint, \r
- geExtBox *EnclosingBox );\r
-\r
-// Collides a ray with box B. The ray is directed, from Start to End. \r
-// Only returns a ray hitting the outside of the box. \r
-// on success, GE_TRUE is returned, and \r
-// if T is non-NULL, T is returned as 0..1 where 0 is a collision at Start, and 1 is a collision at End\r
-// if Normal is non-NULL, Normal is the surface normal of the box where the collision occured.\r
-geBoolean GENESISCC geExtBox_RayCollision( const geExtBox *B, const geVec3d *Start, const geVec3d *End, \r
- geFloat *T, geVec3d *Normal );\r
-\r
-#ifdef __cplusplus\r
- }\r
-#endif\r
-\r
-\r
-\r
-#endif\r
-\r
+++ /dev/null
-/****************************************************************************************/\r
-/* VEC3D.H */\r
-/* */\r
-/* Author: */\r
-/* Description: 3D Vector interface */\r
-/* */\r
-/* The contents of this file are subject to the Genesis3D Public License */\r
-/* Version 1.01 (the "License"); you may not use this file except in */\r
-/* compliance with the License. You may obtain a copy of the License at */\r
-/* http://www.genesis3d.com */\r
-/* */\r
-/* Software distributed under the License is distributed on an "AS IS" */\r
-/* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See */\r
-/* the License for the specific language governing rights and limitations */\r
-/* under the License. */\r
-/* */\r
-/* The Original Code is Genesis3D, released March 25, 1999. */\r
-/* Genesis3D Version 1.1 released November 15, 1999 */\r
-/* Copyright (C) 1999 WildTangent, Inc. All Rights Reserved */\r
-/* */\r
-/****************************************************************************************/\r
-#ifndef GE_VEC3D_H\r
-#define GE_VEC3D_H\r
-\r
-#include "basetype.h"\r
-\r
-#ifdef __cplusplus\r
-extern "C" {\r
-#endif\r
-\r
-typedef struct\r
-{\r
- geFloat X, Y, Z;\r
-} geVec3d;\r
-\r
-#ifndef NDEBUG\r
-GENESISAPI geFloat GENESISCC geVec3d_GetElement(geVec3d *V, int Index);\r
-#else\r
- #define geVec3d_GetElement(Vector,Index) (* ((&((Vector)->X)) + (Index) ))\r
-#endif\r
-\r
-GENESISAPI void GENESISCC geVec3d_Set(geVec3d *V, geFloat X, geFloat Y, geFloat Z);\r
-GENESISAPI void GENESISCC geVec3d_Get(const geVec3d *V, geFloat *X, geFloat *Y, geFloat *Z);\r
-\r
-GENESISAPI geFloat GENESISCC geVec3d_DotProduct(const geVec3d *V1, const geVec3d *V2);\r
-GENESISAPI void GENESISCC geVec3d_CrossProduct(const geVec3d *V1, const geVec3d *V2, geVec3d *VResult);\r
-GENESISAPI geBoolean GENESISCC geVec3d_Compare(const geVec3d *V1, const geVec3d *V2,geFloat tolarance);\r
-GENESISAPI geFloat GENESISCC geVec3d_Normalize(geVec3d *V1);\r
-GENESISAPI geBoolean GENESISCC geVec3d_IsNormalized(const geVec3d *V);\r
-GENESISAPI void GENESISCC geVec3d_Scale(const geVec3d *VSrc, geFloat Scale, geVec3d *VDst);\r
-GENESISAPI geFloat GENESISCC geVec3d_Length(const geVec3d *V1); \r
-GENESISAPI geFloat GENESISCC geVec3d_LengthSquared(const geVec3d *V1);\r
-GENESISAPI void GENESISCC geVec3d_Subtract(const geVec3d *V1, const geVec3d *V2, geVec3d *V1MinusV2);\r
-GENESISAPI void GENESISCC geVec3d_Add(const geVec3d *V1, const geVec3d *V2, geVec3d *VSum);\r
-GENESISAPI void GENESISCC geVec3d_Copy(const geVec3d *Vsrc, geVec3d *Vdst);\r
-GENESISAPI void GENESISCC geVec3d_Clear(geVec3d *V);\r
-GENESISAPI void GENESISCC geVec3d_Inverse(geVec3d *V);\r
-GENESISAPI void GENESISCC geVec3d_MA(geVec3d *V1, geFloat Scale, const geVec3d *V2, geVec3d *V1PlusV2Scaled);\r
-GENESISAPI void GENESISCC geVec3d_AddScaled(const geVec3d *V1, const geVec3d *V2, geFloat Scale, geVec3d *V1PlusV2Scaled);\r
-\r
-GENESISAPI geFloat GENESISCC geVec3d_DistanceBetween(const geVec3d *V1, const geVec3d *V2); // returns length of V1-V2 \r
-\r
-GENESISAPI geBoolean GENESISCC geVec3d_IsValid(const geVec3d *V);\r
-\r
-#ifdef __cplusplus\r
-}\r
-#endif\r
-\r
-#endif\r
-\r
+++ /dev/null
-/****************************************************************************************/\r
-/* XFORM3D.H */\r
-/* */\r
-/* Author: */\r
-/* Description: 3D transform interface */\r
-/* */\r
-/* The contents of this file are subject to the Genesis3D Public License */\r
-/* Version 1.01 (the "License"); you may not use this file except in */\r
-/* compliance with the License. You may obtain a copy of the License at */\r
-/* http://www.genesis3d.com */\r
-/* */\r
-/* Software distributed under the License is distributed on an "AS IS" */\r
-/* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See */\r
-/* the License for the specific language governing rights and limitations */\r
-/* under the License. */\r
-/* */\r
-/* The Original Code is Genesis3D, released March 25, 1999. */\r
-/* Genesis3D Version 1.1 released November 15, 1999 */\r
-/* Copyright (C) 1999 WildTangent, Inc. All Rights Reserved */\r
-/* */\r
-/****************************************************************************************/\r
-#ifndef GE_XFORM_H\r
-#define GE_XFORM_H\r
-\r
-\r
-#include "Vec3d.h"\r
-\r
-#ifdef __cplusplus\r
-extern "C" {\r
-#endif\r
-\r
-typedef struct\r
-{ \r
- geFloat AX,AY,AZ; // e[0][0],e[0][1],e[0][2]\r
- geFloat BX,BY,BZ; // e[1][0],e[1][1],e[1][2]\r
- geFloat CX,CY,CZ; // e[2][0],e[2][1],e[2][2]\r
- geVec3d Translation; // e[0][3],e[1][3],e[2][3]\r
- // 0,0,0,1 // e[3][0],e[3][1],e[3][2]\r
-} geXForm3d;\r
-\r
-/* this is essentially a 'standard' 4x4 transform matrix,\r
- with the bottom row always 0,0,0,1\r
-\r
- | AX, AY, AZ, Translation.X | \r
- | BX, BY, BZ, Translation.Y | \r
- | CX, CY, CZ, Translation.Z | \r
- | 0, 0, 0, 1 | \r
-*/\r
-\r
-// all geXForm3d_Set* functions return a right-handed transform.\r
-\r
-#define GEXFORM3D_MINIMUM_SCALE (0.00001f)\r
-\r
-\r
-GENESISAPI void GENESISCC geXForm3d_Copy(\r
- const geXForm3d *Src, \r
- geXForm3d *Dst);\r
- // copies Src to Dst. \r
-\r
-GENESISAPI geBoolean GENESISCC geXForm3d_IsValid(const geXForm3d *M);\r
- // returns GE_TRUE if M is 'valid' \r
- // 'valid' means that M is non NULL, and there are no NAN's in the matrix.\r
-\r
-//MRB BEGIN\r
-GENESISAPI geBoolean GENESISCC geXForm3d_IsIdentity(const geXForm3d *M);\r
- // returns GE_TRUE if M is an identity matrix \r
-//MRB END\r
-\r
-GENESISAPI geBoolean GENESISCC geXForm3d_IsOrthonormal(const geXForm3d *M);\r
- // returns GE_TRUE if M is orthonormal \r
- // (if the rows and columns are all normalized (transform has no scaling or shearing)\r
- // and is orthogonal (row1 cross row2 = row3 & col1 cross col2 = col3)\r
- // * does not check for right-handed convention *\r
-\r
-GENESISAPI geBoolean GENESISCC geXForm3d_IsOrthogonal(const geXForm3d *M);\r
- // returns GE_TRUE if M is orthogonal\r
- // (row1 cross row2 = row3 & col1 cross col2 = col3)\r
- // * does not check for right-handed convention *\r
-\r
-GENESISAPI void GENESISCC geXForm3d_Orthonormalize(geXForm3d *M);\r
- // essentially removes scaling (or other distortions) from \r
- // an orthogonal (or nearly orthogonal) matrix \r
- // returns a right-handed matrix\r
-\r
-\r
-GENESISAPI void GENESISCC geXForm3d_SetIdentity(geXForm3d *M); \r
- // sets M to an identity matrix (clears it)\r
- \r
-GENESISAPI void GENESISCC geXForm3d_SetXRotation(geXForm3d *M,geFloat RadianAngle);\r
- // sets up a transform that rotates RadianAngle about X axis\r
- // all existing contents of M are replaced\r
- \r
-GENESISAPI void GENESISCC geXForm3d_SetYRotation(geXForm3d *M,geFloat RadianAngle);\r
- // sets up a transform that rotates RadianAngle about Y axis\r
- // all existing contents of M are replaced\r
-\r
-GENESISAPI void GENESISCC geXForm3d_SetZRotation(geXForm3d *M,geFloat RadianAngle);\r
- // sets up a transform that rotates RadianAngle about Z axis\r
- // all existing contents of M are replaced\r
-\r
-GENESISAPI void GENESISCC geXForm3d_SetTranslation(geXForm3d *M,geFloat x, geFloat y, geFloat z);\r
- // sets up a transform that translates x,y,z\r
- // all existing contents of M are replaced\r
-\r
-GENESISAPI void GENESISCC geXForm3d_SetScaling(geXForm3d *M,geFloat x, geFloat y, geFloat z);\r
- // sets up a transform that scales by x,y,z\r
- // all existing contents of M are replaced\r
-\r
-GENESISAPI void GENESISCC geXForm3d_RotateX(geXForm3d *M,geFloat RadianAngle); \r
- // Rotates M by RadianAngle about X axis \r
- // applies the rotation to the existing contents of M\r
-\r
-GENESISAPI void GENESISCC geXForm3d_RotateY(geXForm3d *M,geFloat RadianAngle);\r
- // Rotates M by RadianAngle about Y axis\r
- // applies the rotation to the existing contents of M\r
-\r
-GENESISAPI void GENESISCC geXForm3d_RotateZ(geXForm3d *M,geFloat RadianAngle);\r
- // Rotates M by RadianAngle about Z axis\r
- // applies the rotation to the existing contents of M\r
-\r
-GENESISAPI void GENESISCC geXForm3d_Translate(geXForm3d *M,geFloat x, geFloat y, geFloat z); \r
- // Translates M by x,y,z\r
- // applies the translation to the existing contents of M\r
-\r
-GENESISAPI void GENESISCC geXForm3d_Scale(geXForm3d *M,geFloat x, geFloat y, geFloat z); \r
- // Scales M by x,y,z\r
- // applies the scale to the existing contents of M\r
-\r
-GENESISAPI void GENESISCC geXForm3d_Multiply(\r
- const geXForm3d *M1, \r
- const geXForm3d *M2, \r
- geXForm3d *MProduct);\r
- // MProduct = matrix multiply of M1*M2\r
- // Concatenates the transformation in the M2 matrix onto the transformation in M1\r
-\r
-GENESISAPI void GENESISCC geXForm3d_Transform(\r
- const geXForm3d *M,\r
- const geVec3d *V, \r
- geVec3d *Result);\r
- // Result is Matrix M * Vector V: V Tranformed by M\r
-\r
-GENESISAPI void GENESISCC geXForm3d_TransformArray( const geXForm3d *XForm, \r
- const geVec3d *Source, \r
- geVec3d *Dest, \r
- int32 Count);\r
-\r
-GENESISAPI void GENESISCC geXForm3d_Rotate(\r
- const geXForm3d *M,\r
- const geVec3d *V, \r
- geVec3d *Result);\r
- // Result is Matrix M * Vector V: V Rotated by M (no translation)\r
-\r
-\r
-/***\r
-*\r
- "Left,Up,In" are just the basis vectors in the new coordinate space.\r
- You can get them by multiplying the unit bases into the transforms.\r
-*\r
-******/\r
-\r
-GENESISAPI void GENESISCC geXForm3d_GetLeft(const geXForm3d *M, geVec3d *Left);\r
- // Gets a vector that is 'left' in the frame of reference of M (facing -Z)\r
-\r
-GENESISAPI void GENESISCC geXForm3d_GetUp(const geXForm3d *M, geVec3d *Up);\r
- // Gets a vector that is 'up' in the frame of reference of M (facing -Z)\r
-\r
-GENESISAPI void GENESISCC geXForm3d_GetIn(const geXForm3d *M, geVec3d *In);\r
- // Gets a vector that is 'in' in the frame of reference of M (facing -Z)\r
-\r
-GENESISAPI void GENESISCC geXForm3d_GetTranspose(const geXForm3d *M, geXForm3d *MTranspose);\r
- // Gets the Transpose transform of M (M^T) \r
- // Transpose of a matrix is the switch of the rows and columns\r
- // The transpose is usefull because it is rapidly computed and is equal to the inverse \r
- // transform for orthonormal transforms [inverse is (M') where M*M' = Identity ]\r
-\r
-GENESISAPI void GENESISCC geXForm3d_TransposeTransform(\r
- const geXForm3d *M, \r
- const geVec3d *V, \r
- geVec3d *Result);\r
- // applies the transpose transform of M to V. Result = (M^T) * V\r
-\r
-/*****\r
-*\r
- the Euler angles are subsequent rotations :\r
- by Angles->Z around the Z axis\r
- then by Angles->Y around the Y axis, in the newly rotate coordinates\r
- then by Angles->X around the X axis\r
-*\r
-******/ \r
-\r
-GENESISAPI void GENESISCC geXForm3d_GetEulerAngles(const geXForm3d *M, geVec3d *Angles);\r
- // Finds Euler angles from M and puts them into Angles\r
- \r
-GENESISAPI void GENESISCC geXForm3d_SetEulerAngles(geXForm3d *M, const geVec3d *Angles);\r
- // Applies Euler angles to build M\r
-\r
-GENESISAPI void GENESISCC geXForm3d_SetFromLeftUpIn(\r
- geXForm3d *M,\r
- const geVec3d *Left, \r
- const geVec3d *Up, \r
- const geVec3d *In);\r
- // Builds an geXForm3d from orthonormal Left, Up and In vectors\r
-\r
-GENESISAPI void GENESISCC geXForm3d_Mirror(\r
- const geXForm3d *Source, \r
- const geVec3d *PlaneNormal, \r
- geFloat PlaneDist, \r
- geXForm3d *Dest);\r
- // Mirrors a XForm3d about a plane\r
-\r
-\r
-//--------------\r
-\r
-#ifndef NDEBUG\r
- GENESISAPI void GENESISCC geXForm3d_SetMaximalAssertionMode( geBoolean Enable );\r
-#else\r
- #define geXForm3d_SetMaximalAssertionMode(Enable)\r
-#endif\r
-\r
-#ifdef __cplusplus\r
-}\r
-#endif\r
-\r
-#endif\r
-\r
+++ /dev/null
-/****************************************************************************************/\r
-/* QUATERN.H */\r
-/* */\r
-/* Author: Mike Sandige */\r
-/* Description: Quaternion mathematical system interface */\r
-/* */\r
-/* The contents of this file are subject to the Genesis3D Public License */\r
-/* Version 1.01 (the "License"); you may not use this file except in */\r
-/* compliance with the License. You may obtain a copy of the License at */\r
-/* http://www.genesis3d.com */\r
-/* */\r
-/* Software distributed under the License is distributed on an "AS IS" */\r
-/* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See */\r
-/* the License for the specific language governing rights and limitations */\r
-/* under the License. */\r
-/* */\r
-/* The Original Code is Genesis3D, released March 25, 1999. */\r
-/* Genesis3D Version 1.1 released November 15, 1999 */\r
-/* Copyright (C) 1999 WildTangent, Inc. All Rights Reserved */\r
-/* */\r
-/****************************************************************************************/\r
-#ifndef GE_QUATERNION_H\r
-#define GE_QUATERNION_H\r
-\r
-/***************************************************************************\r
-\r
- The quatern module contains basic support for a quaternion object.\r
-\r
- quaternions are an extension of complex numbers that allows an\r
- expression for rotation that can be easily interpolated. geQuaternion_s are also \r
- more numericaly stable for repeated rotations than matrices.\r
-\r
- \r
- A quaternion is a 4 element 'vector' [w,x,y,z] where:\r
-\r
- q = w + xi + yj + zk\r
- i*i = -1\r
- j*j = -1\r
- k*k = -1\r
- i*j = -j*i = k\r
- j*k = -k*j = i\r
- k*i = -i*k = j\r
- q' (conjugate) = w - xi - yj - zk\r
- ||q|| (magnitude) = sqrt(q*q') = sqrt(w*w + x*x + y*y + z*z)\r
- unit quaternion ||q|| == 1; this implies q' == qinverse \r
- quaternions are associative (q1*q2)*q3 == q1*(q2*q3)\r
- quaternions are not commutative q1*q2 != q2*q1\r
- qinverse (inverse (1/q) ) = q'/(q*q')\r
- \r
- q can be expressed by w + xi + yj + zk or [w,x,y,z] \r
- or as in this implementation (s,v) where s=w, and v=[x,y,z]\r
-\r
- quaternions can represent a rotation. The rotation is an angle t, around a \r
- unit vector u. q=(s,v); s= cos(t/2); v= u*sin(t/2).\r
-\r
- quaternions can apply the rotation to a point. let the point be p [px,py,pz],\r
- and let P be a quaternion(0,p). Protated = q*P*qinverse \r
- ( Protated = q*P*q' if q is a unit quaternion)\r
-\r
- concatenation rotations is similar to matrix concatenation. given two rotations\r
- q1 and q2, to rotate by q1, then q2: let qc = (q2*q1), then the combined \r
- rotation is given by qc*P*qcinverse (= qc*P*qc' if q is a unit quaternion)\r
-\r
- multiplication: \r
- q1 = w1 + x1i + y1j + z1k\r
- q2 = w2 + x2i + y2j + z2k\r
- q1*q2 = q3 =\r
- (w1*w2 - x1*x2 - y1*y2 - z1*z2) {w3}\r
- (w1*x2 + x1*w2 + y1*z2 - z1*y2)i {x3}\r
- (w1*y2 - x1*z2 + y1*w2 + z1*x2)j {y3}\r
- (w1*z2 + x1*y2 + y1*x2 + z1*w2)k {z3}\r
-\r
- also, \r
- q1 = (s1,v1) = [s1,(x1,y1,z1)]\r
- q2 = (s2,v2) = [s2,(x2,y2,z2)]\r
- q1*q2 = q3 = (s1*s2 - dot_product(v1,v2), {s3}\r
- (s1*v2 + s2*v1 + cross_product(v1,v2)) {v3}\r
-\r
-\r
- interpolation - it is possible (and sometimes reasonable) to interpolate between\r
- two quaternions by interpolating each component. This does not quarantee a \r
- resulting unit quaternion, and will result in an animation with non-linear \r
- rotational velocity.\r
-\r
- spherical interpolation: (slerp) treat the quaternions as vectors \r
- find the angle between them (w = arccos(q1 dot q2) ).\r
- given 0<=t<=1, q(t) = q1*(sin((1-t)*w)/sin(w) + q2 * sin(t*w)/sin(w).\r
- since q == -q, care must be taken to rotate the proper way. \r
-\r
- this implementation uses the notation quaternion q = (quatS,quatV) \r
- where quatS is a scalar, and quatV is a 3 element vector.\r
-\r
-********************************************/\r
-\r
-#include "basetype.h"\r
-#include "xform3d.h"\r
-\r
-#ifdef __cplusplus\r
-extern "C" {\r
-#endif\r
-\r
-typedef struct \r
-{\r
- geFloat W;\r
- geFloat X,Y,Z;\r
- //geVec3d QuatV;\r
-} geQuaternion;\r
-\r
-\r
-#define QUATERNION_PI (GE_PI)\r
-\r
-geBoolean GENESISCC geQuaternion_IsValid( const geQuaternion *Q );\r
- // return GE_TRUE if Q is non null and for has no NAN's in its components\r
-\r
-void GENESISCC geQuaternion_Set( geQuaternion *Q, geFloat W, geFloat X, geFloat Y, geFloat Z);\r
- // set quaternion components. Doesn't normalize\r
-void GENESISCC geQuaternion_SetVec3d( geQuaternion *Q, geFloat W, const geVec3d *V);\r
- // set quaternion components. Doesn't normalize\r
-GENESISAPI void GENESISCC geQuaternion_SetFromAxisAngle(geQuaternion *Q, const geVec3d *Axis, geFloat Theta);\r
- // set a quaternion from an axis and a rotation around the axis\r
-geBoolean GENESISCC geQuaternion_GetAxisAngle(const geQuaternion *Q, geVec3d *Axis, geFloat *Theta);\r
- // gets an axis and angle of rotation around the axis from a quaternion\r
- // returns GE_TRUE if there is an axis. \r
- // returns GE_FALSE if there is no axis (and Axis is set to 0,0,0, and Theta is 0)\r
-\r
-void GENESISCC geQuaternion_Get( const geQuaternion *Q, \r
- geFloat *W, geFloat *X, geFloat *Y, geFloat *Z);\r
- // get quaternion components into W,X,Y,Z\r
-void GENESISCC geQuaternion_GetVec3d( const geQuaternion *Q, geFloat *W, geVec3d *V);\r
- // get quaternion components into W and V\r
-\r
-void GENESISCC geQuaternion_FromMatrix(\r
- const geXForm3d *RotationMatrix,\r
- geQuaternion *QDest);\r
- // takes upper 3 by 3 portion of matrix (rotation sub matrix) \r
- // and generates a quaternion\r
-\r
-GENESISAPI void GENESISCC geQuaternion_ToMatrix(\r
- const geQuaternion *Q, \r
- geXForm3d *RotationMatrixDest);\r
- // takes a unit quaternion and makes RotationMatrixDest an equivelant rotation xform.\r
- // (any translation in RotationMatrixDest will be list)\r
-\r
-void GENESISCC geQuaternion_Slerp(\r
- const geQuaternion *Q0, \r
- const geQuaternion *Q1, \r
- geFloat T, \r
- geQuaternion *QT);\r
- // spherical interpolation between q0 and q1. 0<=t<=1 \r
- // resulting quaternion is 'between' q0 and q1\r
- // with t==0 being all q0, and t==1 being all q1.\r
- // returns a quaternion with a positive W - always takes shortest route\r
- // through the positive W domain.\r
-\r
-void GENESISCC geQuaternion_SlerpNotShortest(\r
- const geQuaternion *Q0, \r
- const geQuaternion *Q1, \r
- geFloat T, \r
- geQuaternion *QT);\r
- // spherical interpolation between q0 and q1. 0<=t<=1 \r
- // resulting quaternion is 'between' q0 and q1\r
- // with t==0 being all q0, and t==1 being all q1.\r
-\r
-\r
-void GENESISCC geQuaternion_Multiply(\r
- const geQuaternion *Q1, \r
- const geQuaternion *Q2, \r
- geQuaternion *QProduct);\r
- // multiplies q1 * q2, and places the result in q.\r
- // no failure. renormalization not automatic\r
-\r
-void GENESISCC geQuaternion_Rotate(\r
- const geQuaternion *Q, \r
- const geVec3d *V, \r
- geVec3d *VRotated);\r
- // Rotates V by the quaternion Q, places the result in VRotated.\r
-\r
-geBoolean GENESISCC geQuaternion_IsUnit(const geQuaternion *Q);\r
- // returns GE_TRUE if q is a unit quaternion. GE_FALSE otherwise.\r
-\r
-GENESISAPI geFloat GENESISCC geQuaternion_Normalize(geQuaternion *Q);\r
- // normalizes q to be a unit quaternion. returns original magnitude of q\r
-\r
-GENESISAPI void GENESISCC geQuaternion_Copy(const geQuaternion *QSrc, geQuaternion *QDst);\r
- // copies quaternion QSrc into QDst\r
-\r
-void GENESISCC geQuaternion_SetNoRotation(geQuaternion *Q);\r
- // sets Q to be a quaternion with no rotation (like an identity matrix)\r
-\r
-void GENESISCC geQuaternion_Ln(\r
- const geQuaternion *Q, \r
- geQuaternion *LnQ);\r
- // ln(Q) for unit quaternion only!\r
-\r
-void GENESISCC geQuaternion_Exp(\r
- const geQuaternion *Q,\r
- geQuaternion *ExpQ);\r
- // exp(Q) for pure quaternion only! (zero scalar part (W))\r
-\r
-void GENESISCC geQuaternion_Scale(\r
- const geQuaternion *Q,\r
- geFloat Scale,\r
- geQuaternion *QScaled);\r
- // Q = Q * Scale (result is not generally a unit quaternion!)\r
-\r
-void GENESISCC geQuaternion_Add(\r
- const geQuaternion *Q1,\r
- const geQuaternion *Q2,\r
- geQuaternion *QSum);\r
- // QSum = Q1 + Q2 (result is not generally a unit quaternion!)\r
-\r
-void GENESISCC geQuaternion_Subtract(\r
- const geQuaternion *Q1, \r
- const geQuaternion *Q2, \r
- geQuaternion *QSum);\r
- // QSum = Q1 - Q2 (result is not generally a unit quaternion!)\r
-\r
-void GENESISCC geQuaternion_Inverse(const geQuaternion *Q, geQuaternion *QInv);\r
- // sets QInv to the inverse of Q. \r
-\r
-geFloat GENESISCC geQuaternion_Magnitude(const geQuaternion *Q);\r
- // returns Magnitude of Q. \r
-\r
-geBoolean GENESISCC geQuaternion_Compare( geQuaternion *Q1, geQuaternion *Q2, geFloat Tolerance );\r
- // return GE_TRUE if quaternions differ elementwise by less than Tolerance.\r
-\r
-\r
-#ifndef NDEBUG\r
-void GENESISCC geQuaternion_SetMaximalAssertionMode( geBoolean Enable );\r
-#endif\r
-\r
-#ifdef __cplusplus\r
-}\r
-#endif\r
-\r
-\r
-#endif // GE_QUATERNION_H\r
#include <assert.h>\r
#include <math.h>\r
\r
-#include "vec3d.h"\r
-#include "xform3d.h"\r
-#include "matrix33.h"\r
+#include "Vec3d.h"\r
+#include "XForm3d.h"\r
+#include "Matrix33.h"\r
\r
void Matrix33_MakeCrossProductMatrix33(const geVec3d* v,\r
Matrix33* m)\r
#include <string.h>\r
#include <assert.h>\r
\r
-#include "mempool.h"\r
-#include "ram.h"\r
+#include "MemPool.h"\r
+#include "Ram.h"\r
\r
/*\r
* MemPool is a 'root' level object (eg. 'list' uses us). We sit only above 'Ram'\r
\r
#include <windows.h>\r
#include <assert.h>\r
-\r
#include <dplay.h>\r
#include <dplobby.h>\r
#include <stdio.h>\r
\r
#include "NetPlay.h"\r
-#include "include/ErrorLog.h"\r
+#include "ErrorLog.h"\r
\r
//#define INIT_GUID\r
\r
\r
#include "BaseType.h"\r
#include "XForm3d.h"\r
-#include "Quatern.h"\r
+#include "Quaternion.h"\r
#include "VFile.h"\r
\r
#ifdef __cplusplus\r
+++ /dev/null
-/****************************************************************************************/\r
-/* MATRIX33.H */\r
-/* */\r
-/* Author: Jason Wood */\r
-/* Description: Pure 3x3 matrix */\r
-/* */\r
-/* The contents of this file are subject to the Genesis3D Public License */\r
-/* Version 1.01 (the "License"); you may not use this file except in */\r
-/* compliance with the License. You may obtain a copy of the License at */\r
-/* http://www.genesis3d.com */\r
-/* */\r
-/* Software distributed under the License is distributed on an "AS IS" */\r
-/* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See */\r
-/* the License for the specific language governing rights and limitations */\r
-/* under the License. */\r
-/* */\r
-/* The Original Code is Genesis3D, released March 25, 1999. */\r
-/* Genesis3D Version 1.1 released November 15, 1999 */\r
-/* Copyright (C) 1999 WildTangent, Inc. All Rights Reserved */\r
-/* */\r
-/****************************************************************************************/\r
-#ifndef MATRIX33_H\r
-#define MATRIX33_H\r
-\r
-#ifdef __cplusplus\r
-extern "C" {\r
-#endif\r
-\r
-typedef struct\r
-{\r
- geFloat x[3][3];\r
-} Matrix33;\r
-\r
-void Matrix33_Copy(const Matrix33* m, Matrix33* c);\r
-void Matrix33_SetIdentity(Matrix33* m);\r
-void Matrix33_Add(const Matrix33* m1, const Matrix33* m2, Matrix33* res);\r
-void Matrix33_Subtract(const Matrix33* m1, const Matrix33* m2, Matrix33* res);\r
-void Matrix33_MultiplyVec3d(const Matrix33* m, const geVec3d* v, geVec3d* res);\r
-void Matrix33_Multiply(const Matrix33* m1, const Matrix33* m2, Matrix33* res);\r
-void Matrix33_MultiplyScalar(geFloat s, const Matrix33* m, Matrix33* res);\r
-void Matrix33_GetTranspose(const Matrix33* m, Matrix33* t);\r
-void Matrix33_GetInverse(const Matrix33* m, Matrix33* inv);\r
-void Matrix33_MakeCrossProductMatrix33(const geVec3d* v, Matrix33* m);\r
-void Matrix33_ExtractFromXForm3d(const geXForm3d* xform, Matrix33* m);\r
-\r
-#ifdef __cplusplus\r
-}\r
-#endif\r
-\r
-#endif\r
-\r
#ifndef GE_PTRTYPES_H\r
#define GE_PTRTYPES_H\r
\r
-#include "include/BaseType.h"\r
+#include "BaseType.h"\r
\r
#ifdef __cplusplus\r
extern "C" {\r
+++ /dev/null
-/****************************************************************************************/\r
-/* ERRORLOG.H */\r
-/* */\r
-/* Author: Mike Sandige */\r
-/* Description: Generic error logging system interface */\r
-/* */\r
-/* The contents of this file are subject to the Genesis3D Public License */\r
-/* Version 1.01 (the "License"); you may not use this file except in */\r
-/* compliance with the License. You may obtain a copy of the License at */\r
-/* http://www.genesis3d.com */\r
-/* */\r
-/* Software distributed under the License is distributed on an "AS IS" */\r
-/* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See */\r
-/* the License for the specific language governing rights and limitations */\r
-/* under the License. */\r
-/* */\r
-/* The Original Code is Genesis3D, released March 25, 1999. */\r
-/* Genesis3D Version 1.1 released November 15, 1999 */\r
-/* Copyright (C) 1999 WildTangent, Inc. All Rights Reserved */\r
-/* */\r
-/****************************************************************************************/\r
-#ifndef GE_ERRORLOG_H\r
-#define GE_ERRORLOG_H\r
-\r
-#include "basetype.h"\r
-\r
-#ifndef NDEBUG \r
- #define ERRORLOG_FULL_REPORTING\r
-#endif\r
-\r
-\r
-#ifdef __cplusplus\r
-extern "C" {\r
-#endif\r
-\r
-typedef enum\r
-{\r
- GE_ERR_INVALID_DRIVER_HANDLE, // Driver not supported\r
- GE_ERR_INVALID_MODE_HANDLE, // Mode not supported\r
- GE_ERR_DRIVER_INIT_FAILED, // Could not init Driver\r
- GE_ERR_DRIVER_ALLREADY_INITIALIZED, // Driver init failure\r
- GE_ERR_DRIVER_NOT_FOUND, // File open error for driver\r
- GE_ERR_DRIVER_NOT_INITIALIZED, // Driver shutdown failure\r
- GE_ERR_INVALID_DRIVER, // Wrong driver version, or bad driver\r
- GE_ERR_DRIVER_BEGIN_SCENE_FAILED,\r
- GE_ERR_DRIVER_END_SCENE_FAILED,\r
- GE_ERR_CREATE_SOUND_MANAGER_FAILED,\r
- GE_ERR_CREATE_SOUND_BUFFER_FAILED,\r
- GE_ERR_DS_ERROR,\r
- GE_ERR_INVALID_WAV,\r
- GE_ERR_NO_PERF_FREQ,\r
- GE_ERR_FILE_OPEN_ERROR,\r
- GE_ERR_FILE_READ_ERROR,\r
- GE_ERR_FILE_WRITE_ERROR,\r
- GE_ERR_PALETTE_LOAD_FAILURE,\r
- GE_ERR_GBSP_LOAD_FAILURE,\r
- GE_ERR_INVALID_PARMS,\r
- GE_ERR_INVALID_CAMERA,\r
- GE_ERR_RENDER_WORLD_FAILED,\r
- GE_ERR_BEGIN_WORLD_FAILED,\r
- GE_ERR_END_WORLD_FAILED,\r
- GE_ERR_BEGIN_MODELS_FAILED,\r
- GE_ERR_END_MODELS_FAILED,\r
- GE_ERR_BEGIN_MESHES_FAILED,\r
- GE_ERR_END_MESHES_FAILED,\r
- GE_ERR_RENDER_MESH_FAILED,\r
- GE_ERR_BAD_LMAP_EXTENTS,\r
- GE_ERR_INVALID_TEXTURE,\r
- GE_ERR_REGISTER_WORLD_TEXTURE_FAILED,\r
- GE_ERR_REGISTER_LIGHTMAPS_FAILED,\r
- GE_ERR_REGISTER_WORLD_PALETTE_FAILED,\r
- GE_ERR_REGISTER_MISC_TEXTURE_FAILED,\r
- GE_ERR_INVALID_MESH_FILE,\r
- GE_ERR_LOAD_BITMAP_FAILED,\r
- GE_ERR_MAX_MESH_DEFS,\r
- GE_ERR_MESH_MAX_NODES,\r
- GE_ERR_INVALID_MESH_MATERIAL,\r
- GE_ERR_MAX_MESH_MATERIALS,\r
- GE_ERR_MAX_MESH_CLIP_PLANES,\r
- GE_ERR_RENDERQ_OVERFLOW,\r
- GE_ERR_INVALID_LTYPE,\r
- GE_ERR_MAX_ENTITIES,\r
- GE_ERR_GET_ENTITY_DATA_ERROR,\r
- GE_ERR_INVALID_ENTITY_FIELD_TYPE,\r
- GE_ERR_MODEL_NOT_FOUND,\r
- GE_ERR_MODEL_NOT_IN_ENTITY,\r
- GE_ERR_MAX_TEXTURES,\r
- GE_ERR_MAX_DECALS,\r
- GE_ERR_MAX_VERTS,\r
- GE_ERR_OUT_OF_MEMORY,\r
- GE_ERR_INVALID_BSP_TAG,\r
- GE_ERR_INVALID_BSP_VERSION,\r
- GE_ERR_ERROR_READING_BSP_CHUNK,\r
- ERR_PATH_CREATE_ENOMEM, // failure to create a path (memory allocation failed)\r
- ERR_PATH_INSERT_R_KEYFRAME, // failure to insert a rotation keyframe\r
- ERR_PATH_INSERT_T_KEYFRAME, // failure to insert a translation keyframe\r
- ERR_PATH_DELETE_R_KEYFRAME, // failure to delete a rotation keyframe\r
- ERR_PATH_DELETE_T_KEYFRAME, // failure to delete a translation keyframe\r
- ERR_PATH_FILE_READ, // failure to read from file\r
- ERR_PATH_FILE_VERSION, // tried to create path from file with wrong/bad version\r
- ERR_PATH_FILE_PARSE, // failure to parse file (unexpected format problem)\r
- ERR_PATH_FILE_WRITE, // failure to read from file\r
- ERR_MOTION_CREATE_ENOMEM, // failure to create (memory allocation failed)\r
- ERR_MOTION_ADDPATH_ENOMEM, // failure to add path into motion (memory allocation failed)\r
- ERR_MOTION_ADDPATH_PATH, // failure to add path into motion (path creation failed)\r
- ERR_MOTION_ADDPATH_BAD_NAME, // failure to add path into motion due to name conflict\r
- ERR_MOTION_INSERT_EVENT, // failure to insert event (memory allocation failed or duplicate key)\r
- ERR_MOTION_DELETE_EVENT, // failure to insert event\r
- ERR_MOTION_FILE_READ, // failure to read from file\r
- ERR_MOTION_FILE_WRITE, // failure to write to file\r
- ERR_MOTION_FILE_PARSE, // failure to parse file (unexpected format problem)\r
- ERR_TKARRAY_INSERT_IDENTICAL, // failure to insert into list because of existing identical key\r
- ERR_TKARRAY_INSERT_ENOMEM, // failure to insert into list because of memory allocation failure\r
- ERR_TKARRAY_DELETE_NOT_FOUND, // failure to delete from list because key was not found\r
- ERR_TKARRAY_CREATE, // failure to create TKArray object (out of memroy)\r
- ERR_TKARRAY_TOO_BIG, // TKArray object can't be added to - it's list is as big as it can get\r
- ERR_VKARRAY_INSERT, // insertion to VKArray failed\r
- ERR_QKARRAY_INSERT, // insertion to QKArray failed\r
- ERR_POSE_CREATE_ENOMEM, // Motion object failed to create (memory allocation failed)\r
- ERR_POSE_ADDJOINT_ENOMEM, // Motion_AddJoint failed to allocate/reallocate memory for new joint\r
- ERR_TKEVENTS_CREATE_ENOMEM, // failure to create TKEvents object (memory allocation failed)\r
- ERR_TKEVENTS_DELETE_NOT_FOUND, // failure to delete from list because key was not found\r
- ERR_TKEVENTS_INSERT_ENOMEM, // failure to insert into list because of memory allocation failure\r
- ERR_TKEVENTS_INSERT, // failure to insert into list \r
- ERR_TKEVENTS_FILE_READ, // failure to read from data file\r
- ERR_TKEVENTS_FILE_WRITE, // failure to write to data file\r
- ERR_TKEVENTS_FILE_VERSION, // failure to read tkevents object: file has wrong version\r
- ERR_TKEVENTS_FILE_PARSE, // failure to parse file (unexpected format problem)\r
- ERR_STRBLOCK_ENOMEM, // failure to create, insert, or append (memory allocation failed)\r
- ERR_STRBLOCK_STRLEN, // string too long to insert or append\r
- ERR_STRBLOCK_FILE_READ, // failure to read from data file\r
- ERR_STRBLOCK_FILE_WRITE, // failure to write to data file\r
- ERR_STRBLOCK_FILE_PARSE, // failure to parse reading from input file (unexpected format problem)\r
- ERR_BODY_ENOMEM, // failure to create, or add (memory allocation failed)\r
- ERR_BODY_FILE_PARSE, // failure to parse reading from input file (unexpected format problem)\r
- ERR_BODY_FILE_READ, // failure to read from data file\r
- ERR_BODY_FILE_WRITE, // failure to write to data file\r
- ERR_BODY_BONEXFARRAY, // XFArray object failed to return array, or array size doesn't match bone count\r
- ERR_XFARRAY_ENOMEM, // failure to create. (memory allocation failure)\r
- ERR_PUPPET_ENOMEM, // failure to create. (memory allocation failure)\r
- ERR_PUPPET_RENDER, // failure to render. \r
- ERR_PUPPET_NO_MATERIALS, // failure to create: associated body has no materials.\r
- ERR_PUPPET_LOAD_TEXTURE, // failure to load texture \r
- ERR_TEXPOOL_ENOMEM, // failure to create or add to. (memory allocation/reallocation failure)\r
- ERR_TEXPOOL_TOO_BIG, // failure to add to pool, pool is too large.\r
- ERR_TEXPOOL_LOAD_TEXTURE, // failure to load texture into pool\r
- ERR_TEXPOOL_TEXTURE_NOT_FREE, // texture pool destroyed without first freeing all it's shared textures\r
- ERR_ACTOR_ENOMEM, // failure to create. (memory allocation failure)\r
- ERR_ACTOR_RENDER_PREP, // failure to prepare actor for rendering (bad Body or allocation failure)\r
- ERR_ACTOR_RENDER_FAILED, // failure to render. failure to get geometry from Body \r
- ERR_ACTOR_TOO_MANY_MOTIONS, // failure to add motion. too many.\r
- ERR_ACTOR_FILE_READ, // failure to read from data file.\r
- ERR_ACTOR_FILE_PARSE, // failure to parse reading from input file(unexpected format problem)\r
- ERR_ACTOR_FILE_WRITE, // failure to write to data file.\r
- GE_ERR_INVALID_MODEL_MOTION_FILE, // Bad model motion file (for bsp files)\r
- GE_ERR_BAD_BSP_FILE_CHUNK_SIZE, // Chunk size does not match structure size of kind\r
-//MRB BEGIN\r
-//geSprite\r
- ERR_SPRITE_ENOMEM, // failure to create. (memory allocation failure)\r
- ERR_SPRITE_INVALIDBITMAP, // failure to use bitmap because bitmap was invalid\r
-//MRB END\r
-} geErrorLog_ErrorIDEnumType;\r
-\r
-\r
-typedef enum \r
-{\r
- GE_ERR_MEMORY_RESOURCE,\r
- GE_ERR_DISPLAY_RESOURCE,\r
- GE_ERR_SOUND_RESOURCE,\r
- GE_ERR_SYSTEM_RESOURCE,\r
- GE_ERR_INTERNAL_RESOURCE,\r
- \r
- GE_ERR_FILEIO_OPEN,\r
- GE_ERR_FILEIO_CLOSE,\r
- GE_ERR_FILEIO_READ,\r
- GE_ERR_FILEIO_WRITE,\r
- GE_ERR_FILEIO_FORMAT,\r
- GE_ERR_FILEIO_VERSION,\r
- \r
- GE_ERR_LIST_FULL,\r
- GE_ERR_DATA_FORMAT,\r
- GE_ERR_SEARCH_FAILURE,\r
-} geErrorLog_ErrorClassType;\r
-\r
-GENESISAPI void geErrorLog_Clear(void);\r
- // clears error history\r
-\r
-GENESISAPI int geErrorLog_Count(void);\r
- // reports size of current error log\r
-\r
-GENESISAPI void geErrorLog_AddExplicit(geErrorLog_ErrorClassType,\r
- const char *ErrorIDString,\r
- const char *ErrorFileString,\r
- int LineNumber,\r
- const char *UserString,\r
- const char *Context);\r
- // not intended to be used directly: use ErrorLog_Add or ErrorLog_AddString\r
-\r
-\r
-#ifdef ERRORLOG_FULL_REPORTING\r
- // 'Debug' version includes a textual error id, and the user string\r
-\r
- #define geErrorLog_Add(Error, Context) geErrorLog_AddExplicit(Error, #Error, __FILE__, __LINE__,"", Context)\r
- // logs an error. \r
-\r
- #define geErrorLog_AddString(Error,String, Context) geErrorLog_AddExplicit(Error, #Error, __FILE__,__LINE__, String, Context)\r
- // logs an error with additional identifing string. \r
- \r
-GENESISAPI geBoolean geErrorLog_AppendStringToLastError(const char *String);// use geErrorLog_AppendString\r
-\r
- #define geErrorLog_AppendString(XXX) geErrorLog_AppendStringToLastError(XXX)\r
- // adds text to the previous logged error\r
-\r
-#else\r
- // 'Release' version does not include the textual error id, or the user string\r
-\r
- #define geErrorLog_Add(Error, Context) geErrorLog_AddExplicit(Error, "", __FILE__, __LINE__,"", Context)\r
- // logs an error. \r
-\r
- #define geErrorLog_AddString(Error,String, Context) geErrorLog_AddExplicit(Error, "", __FILE__,__LINE__, "", Context)\r
- // logs an error with additional identifing string. \r
- \r
- #define geErrorLog_AppendString(XXX)\r
- // adds text to the previous logged error\r
-\r
-#endif\r
-\r
-GENESISAPI geBoolean geErrorLog_Report(int History, geErrorLog_ErrorClassType *Error, const char **UserString);\r
- // reports from the error log. \r
- // history is 0 for most recent, 1.. for second most recent etc.\r
- // returns GE_TRUE if report succeeded. GE_FALSE if it failed.\r
-\r
-#ifdef __cplusplus\r
-}\r
-#endif\r
-\r
-#endif\r
-\r
+++ /dev/null
-/****************************************************************************************/\r
-/* RAM.H */\r
-/* */\r
-/* Author: */\r
-/* Description: Replacement for malloc, realloc and free */\r
-/* */\r
-/* The contents of this file are subject to the Genesis3D Public License */\r
-/* Version 1.01 (the "License"); you may not use this file except in */\r
-/* compliance with the License. You may obtain a copy of the License at */\r
-/* http://www.genesis3d.com */\r
-/* */\r
-/* Software distributed under the License is distributed on an "AS IS" */\r
-/* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See */\r
-/* the License for the specific language governing rights and limitations */\r
-/* under the License. */\r
-/* */\r
-/* The Original Code is Genesis3D, released March 25, 1999. */\r
-/* Genesis3D Version 1.1 released November 15, 1999 */\r
-/* Copyright (C) 1999 WildTangent, Inc. All Rights Reserved */\r
-/* */\r
-/****************************************************************************************/\r
-#ifndef GE_RAM_H\r
-#define GE_RAM_H\r
-\r
-#include "basetype.h"\r
-\r
-#ifdef __cplusplus\r
-extern "C" {\r
-#endif\r
-\r
-typedef int (* geRam_CriticalCallbackFunction)(void);\r
-\r
-/*\r
- Set the critical callback function. ram_allocate will call the critical\r
- callback function if it's unable to allocate memory.\r
-*/\r
-GENESISAPI geRam_CriticalCallbackFunction geRam_SetCriticalCallback\r
- (\r
- geRam_CriticalCallbackFunction callback\r
- );\r
-\r
-/*\r
- increments or decrements a counter . if the counter is >0\r
- the critical callback function (if set) is called for a failed memory allocation.\r
- add is added to the current counter value. the new counter value is returned.\r
-*/\r
-GENESISAPI int geRam_EnableCriticalCallback(int add);\r
-\r
-\r
-/*\r
- Allocate memory of the given size. In debug mode, the memory is filled\r
- with 0xA5, and we keep track of the amount of memory allocated. Also, in debug\r
- mode, we track where the memory was allocated and can optionally provide a\r
- report of allocated blocks. See geRam_ReportAllocations.\r
-*/\r
-#ifndef NDEBUG\r
-\r
-#define geRam_Allocate(size) _geRam_DebugAllocate(size, __FILE__, __LINE__)\r
-\r
-// Do not call _geRam_DebugAllocate directly.\r
-GENESISAPI void* _geRam_DebugAllocate(uint32 size, const char* pFile, int line);\r
-\r
-#else\r
-\r
-GENESISAPI void *geRam_Allocate(uint32 size);\r
-\r
-#endif\r
-\r
-/*\r
- Free an allocated memory block.\r
-*/\r
-GENESISAPI void geRam_Free_(void *ptr);\r
-\r
- extern void *StupidUnusedPointer; // never used, except to mask the\r
- // possible warning you get if you use the geRam_Free macro below, without\r
- // using the xxx pointer again in the same block. This is ugly.\r
- \r
-#define geRam_Free(xxx) geRam_Free_(xxx) ,(xxx)=NULL, StupidUnusedPointer=(xxx)\r
-\r
-/*\r
- Reallocate memory. This function supports shrinking and expanding blocks,\r
- and will also act like ram_allocate if the pointer passed to it is NULL.\r
- It won't, however, free the memory if you pass it a 0 size.\r
-*/\r
-#ifndef NDEBUG\r
-\r
-#define geRam_Realloc(ptr, newsize) _geRam_DebugRealloc(ptr, newsize, __FILE__, __LINE__)\r
-\r
-// Do not call _geRam_DebugRealloc directly.\r
-GENESISAPI void* _geRam_DebugRealloc(void* ptr, uint32 size, const char* pFile, int line);\r
-\r
-#else\r
-\r
-GENESISAPI void *geRam_Realloc(void *ptr,uint32 newsize);\r
-\r
-#endif\r
-\r
-#ifndef NDEBUG\r
-\r
-GENESISAPI void geRam_ReportAllocations(void);\r
-\r
-#else\r
-\r
-#define geRam_ReportAllocations() \r
-\r
-#endif\r
-\r
-#ifndef NDEBUG\r
- extern int32 geRam_CurrentlyUsed;\r
- extern int32 geRam_NumberOfAllocations;\r
- extern int32 geRam_MaximumUsed;\r
- extern int32 geRam_MaximumNumberOfAllocations;\r
-\r
-GENESISAPI void geRam_AddAllocation(int n,uint32 size);\r
-#else\r
- #define geRam_AddAllocation(n,s)\r
-#endif\r
-\r
-// allocate the ram & clear it. (calloc)\r
-GENESISAPI void * geRam_AllocateClear(uint32 size);\r
-\r
-#define GE_RAM_ALLOCATE_STRUCT(type) (type *)geRam_Allocate (sizeof (type))\r
-#define GE_RAM_ALLOCATE_ARRAY(type,count) (type *)geRam_Allocate (sizeof (type) * (count))\r
-\r
-#ifndef NDEBUG\r
-#define GE_RAM_REALLOC_ARRAY(ptr,type,count) (type *)geRam_Realloc( (ptr), sizeof(type) * (count) );{type *XX=(ptr);}\r
-#else\r
-#define GE_RAM_REALLOC_ARRAY(ptr,type,count) (type *)geRam_Realloc( (ptr), sizeof(type) * (count) )\r
-#endif\r
-\r
-#ifndef NDEBUG\r
-geBoolean geRam_IsValidPtr(void *ptr);\r
-#endif\r
-\r
-#ifdef __cplusplus\r
- }\r
-#endif\r
-\r
-#endif\r
-\r
#include <assert.h>\r
#include <windows.h>\r
\r
-#include "include/BaseType.h"\r
+#include "G3D/BaseType.h"\r
#include "G3D/PtrTypes.h"\r
-#include "include/Vec3d.h"\r
+#include "G3D/Vec3d.h"\r
#include "G3D/Engine/Drivers/DCommon.h"\r
\r
#ifdef __cplusplus\r
#include <assert.h>\r
#include <windows.h>\r
\r
-#include "include/Genesis.h"\r
-#include "include/BaseType.h"\r
-#include "include/Vec3d.h"\r
-#include "World/World.h"\r
+#include "Genesis.h"\r
+#include "BaseType.h"\r
+#include "Vec3d.h"\r
+#include "World.h"\r
//#include "System.h"\r
\r
#ifdef __cplusplus\r
#include <assert.h>\r
#include <windows.h>\r
\r
-#include "include/BaseType.h"\r
-#include "include/Vec3d.h"\r
-#include "include/XForm3d.h"\r
+#include "G3D/BaseType.h"\r
+#include "G3D/Vec3d.h"\r
+#include "G3D/XForm3d.h"\r
#include "G3D/Camera.h"\r
-#include "include/Genesis.h"\r
+#include "G3D/Genesis.h"\r
#include "World.h"\r
#include "Surface.h"\r
\r
+++ /dev/null
-/****************************************************************************************/\r
-/* VFILE.H */\r
-/* */\r
-/* Author: Eli Boling */\r
-/* Description: Virtual file interface */\r
-/* */\r
-/* The contents of this file are subject to the Genesis3D Public License */\r
-/* Version 1.01 (the "License"); you may not use this file except in */\r
-/* compliance with the License. You may obtain a copy of the License at */\r
-/* http://www.genesis3d.com */\r
-/* */\r
-/* Software distributed under the License is distributed on an "AS IS" */\r
-/* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See */\r
-/* the License for the specific language governing rights and limitations */\r
-/* under the License. */\r
-/* */\r
-/* The Original Code is Genesis3D, released March 25, 1999. */\r
-/* Genesis3D Version 1.1 released November 15, 1999 */\r
-/* Copyright (C) 1999 WildTangent, Inc. All Rights Reserved */\r
-/* */\r
-/****************************************************************************************/\r
-#ifndef VFILE_H\r
-#define VFILE_H\r
-\r
-#ifdef __cplusplus\r
-extern "C" {\r
-#endif\r
-\r
-#include "basetype.h"\r
-\r
-typedef struct geVFile geVFile;\r
-\r
-//--------- Finder (Directory) --------------\r
-typedef struct geVFile_Finder geVFile_Finder;\r
-\r
-typedef int geVFile_TypeIdentifier;\r
-typedef unsigned int geVFile_Attributes;\r
-\r
-typedef struct geVFile_Hints\r
-{\r
- void * HintData;\r
- int HintDataLength;\r
-} geVFile_Hints;\r
-\r
-typedef struct geVFile_Time\r
-{\r
- unsigned long Time1;\r
- unsigned long Time2;\r
-} geVFile_Time;\r
-\r
-#define GE_VFILE_ATTRIB_READONLY 0x00000001\r
-#define GE_VFILE_ATTRIB_DIRECTORY 0x00000002\r
-\r
-typedef struct geVFile_Properties\r
-{\r
- geVFile_Time Time;\r
- geVFile_Attributes AttributeFlags;\r
- long Size;\r
- geVFile_Hints Hints;\r
- char Name[1024];\r
-} geVFile_Properties;\r
-\r
-#ifdef _INC_WINDOWS\r
-GENESISAPI void GENESISCC geVFile_TimeToWin32FileTime(const geVFile_Time *, LPFILETIME Win32FileTime);\r
- // Converts a geVFile time to a Win32 FILETIME structure. This API is the\r
- // way to get the file time into a format to do standardized date/time\r
- // operations on. We do not provide date/time operations natively.\r
-#endif\r
-\r
-GENESISAPI geVFile_Finder * GENESISCC geVFile_CreateFinder(\r
- geVFile * FileSystem,\r
- const char * FileSpec);\r
- // Creates a finder object from which you can get iterated file names.\r
- // This is findfirst/findnext functionality. \r
-\r
-GENESISAPI void GENESISCC geVFile_DestroyFinder(geVFile_Finder *Finder);\r
- // Destroys a Finder object\r
-\r
-GENESISAPI geBoolean GENESISCC geVFile_FinderGetNextFile(geVFile_Finder *Finder);\r
- // Tracks to the next file in the finder directory\r
-\r
-GENESISAPI geBoolean GENESISCC geVFile_FinderGetProperties(const geVFile_Finder *Finder, geVFile_Properties *Properties);\r
- // Gets the file properties from a geVFile_Finder. You cannot set properties for\r
- // a file through a finder. You have to set the properties through a geVFile.\r
-\r
-//--------- File System Operations ----\r
-\r
-typedef struct geVFile_MemoryContext\r
-{\r
- void * Data;\r
- int DataLength;\r
-} geVFile_MemoryContext;\r
-\r
-#define GE_VFILE_TYPE_DOS ( (geVFile_TypeIdentifier) 1L )\r
-#define GE_VFILE_TYPE_MEMORY ( (geVFile_TypeIdentifier) 2L )\r
-#define GE_VFILE_TYPE_VIRTUAL ( (geVFile_TypeIdentifier) 3L )\r
-//#define GE_VFILE_TYPE_CVIRTUAL ( (geVFile_TypeIdentifier) 4L )\r
-\r
-// First three flags are mutually exclusive. Combining them will result in failure\r
-// returns for both geVFile_OpenNewSystem and geVFile_Open.\r
-#define GE_VFILE_OPEN_READONLY 0x00000001\r
-#define GE_VFILE_OPEN_UPDATE 0x00000002\r
-#define GE_VFILE_OPEN_CREATE 0x00000004\r
-\r
-#define GE_VFILE_OPEN_DIRECTORY 0x00000008\r
-\r
-\r
-GENESISAPI geVFile * GENESISCC geVFile_OpenNewSystem(\r
- geVFile * FS,\r
- geVFile_TypeIdentifier FileSystemType, // { DOS, MEMORY, ETC ... },\r
- const char * Name, \r
- void * Context, \r
- unsigned int OpenModeFlags);\r
- // Opens a file / file system.\r
-\r
-GENESISAPI geBoolean GENESISCC geVFile_UpdateContext(geVFile *FS, void *Context, int ContextSize);\r
-\r
-GENESISAPI geVFile * GENESISCC geVFile_GetContext(const geVFile *File);\r
- // Returns the outer context in which File was opened.\r
-\r
-GENESISAPI geVFile * GENESISCC geVFile_Open( \r
- geVFile * FS,\r
- const char * Name, \r
- unsigned int OpenModeFlags);\r
-\r
-/*\r
-typedef enum\r
-{\r
- geVFile_AppendPath,\r
- geVFile_PrependPath,\r
-} geVFile_SearchOrder;\r
-*/\r
-\r
-GENESISAPI geBoolean GENESISCC geVFile_AddPath(geVFile *FS1, const geVFile *FS2, geBoolean Append);\r
- // Appends (or prepends) the path associated with FS2 into FS1.\r
- // Append==GE_TRUE causes the FS2 to be searched AFTER FS1\r
- // Append==GE_FALSE causes the FS2 to be searched BEFORE FS1\r
-\r
-/* perhaps geVFile_AppendPath and geVFile_PrependPath */\r
-\r
-\r
-GENESISAPI geBoolean GENESISCC geVFile_DeleteFile(geVFile *FS, const char *FileName);\r
- // Deletes a file within a file system. Returns GE_TRUE on success, GE_FALSE\r
- // on failure.\r
-\r
-GENESISAPI geBoolean GENESISCC geVFile_RenameFile(geVFile *FS, const char *FileName, const char *NewName);\r
- // Renames a file within a file system. Returns GE_TRUE on success, GE_FALSE\r
- // on failure.\r
-\r
-GENESISAPI geBoolean GENESISCC geVFile_FileExists(geVFile *FS, const char *FileName);\r
- // Returns GE_TRUE if the file FileName exists in FS, GE_FALSE otherwise.\r
- // Does not do any searching (?)\r
-\r
-//geVFile_VFileType geVFile_Register( all kinds of stuff );\r
-\r
-GENESISAPI geBoolean GENESISCC geVFile_Close (geVFile *File);\r
- // closes and destroys the File\r
-\r
-GENESISAPI void GENESISCC geVFile_CloseAPI (void);\r
-\r
-//---------- File Specific Operations -----------\r
-\r
-typedef enum\r
-{\r
- GE_VFILE_SEEKCUR = 0,\r
- GE_VFILE_SEEKEND = 1,\r
- GE_VFILE_SEEKSET = 2\r
-} geVFile_Whence;\r
-\r
-GENESISAPI geBoolean GENESISCC geVFile_GetS ( geVFile *File, void *Buff, int MaxLen);\r
-GENESISAPI geBoolean GENESISCC geVFile_Read ( geVFile *File, void *Buff, int Count);\r
-GENESISAPI geBoolean GENESISCC geVFile_Write ( geVFile *File, const void *Buff, int Count);\r
-GENESISAPI geBoolean GENESISCC geVFile_Seek ( geVFile *File, int where, geVFile_Whence Whence);\r
-GENESISAPI geBoolean GENESISCC geVFile_Printf ( geVFile *File, const char *Format, ...);\r
-GENESISAPI geBoolean GENESISCC geVFile_EOF (const geVFile *File);\r
-GENESISAPI geBoolean GENESISCC geVFile_Tell (const geVFile *File, long *Position);\r
-GENESISAPI geBoolean GENESISCC geVFile_GetProperties(const geVFile *File, geVFile_Properties *Properties);\r
-//geBoolean geVFile_GetName(geVFile *File, char *Buff, int MaxBuffLen);\r
- // Gets the name of the file\r
-\r
-GENESISAPI geBoolean GENESISCC geVFile_Size (const geVFile *File, long *Size);\r
-GENESISAPI geBoolean GENESISCC geVFile_SetSize ( geVFile *File, long Size);\r
-GENESISAPI geBoolean GENESISCC geVFile_SetAttributes( geVFile *File, geVFile_Attributes Attributes);\r
-GENESISAPI geBoolean GENESISCC geVFile_SetTime ( geVFile *File, const geVFile_Time *Time);\r
-GENESISAPI geBoolean GENESISCC geVFile_SetHints ( geVFile *File, const geVFile_Hints *Hints);\r
-\r
-\r
-#ifdef __cplusplus\r
-}\r
-#endif\r
-\r
-#endif\r
#ifndef GE_VIS_H\r
#define GE_VIS_H\r
\r
-#include "include/Genesis.h"\r
-#include "include/BaseType.h"\r
+#include "G3D/Genesis.h"\r
+#include "G3D/BaseType.h"\r
\r
#include "Frustum.h"\r
\r
\r
#include <assert.h>\r
\r
-#include "include/BaseType.h"\r
+#include "G3D/BaseType.h"\r
#include "GBSPFile.h"\r
-#include "include/Bitmap.h"\r
+#include "G3D/Bitmap.h"\r
\r
#ifdef __cplusplus\r
extern "C" {\r
\r
#define GE_CLIP_CENTER 1\r
#define GE_CLIP_CORNER 0\r
-#include "basetype.h"\r
-#include "getypes.h"\r
+#include "BaseType.h"\r
+#include "GeTypes.h"\r
\r
//***************************************************************\r
// returns true if you need to draw at all.\r
#ifndef GE_WORLD_H\r
#define GE_WORLD_H\r
\r
-#include "include/ErrorLog.h"\r
+#include "G3D/ErrorLog.h"\r
#include "G3D/PtrTypes.h"\r
-#include "include/Genesis.h"\r
+#include "G3D/Genesis.h"\r
#include "GBSPFile.h"\r
-#include "include/Motion.h"\r
+#include "G3D/Motion.h"\r
#include "Surface.h"\r
#include "Fog.h"\r
#include "WBitmap.h"\r
\r
#include "G3D/Engine/BitmapList.h"\r
\r
-#include "include/Actor.h"\r
+#include "G3D/Actor.h"\r
\r
//MRB BEGIN\r
//geSprite\r
-#include "include/Sprite.h"\r
-//MRB END \r
+#include "G3D/Sprite.h"\r
+//MRB END\r
\r
#ifdef __cplusplus\r
extern "C" {\r
rm -rf G3D/Makefile
rm -rf G3D/cmake_install.cmake
+rm -rf GBSPLib/CMakeCache.txt
+rm -rf GBSPLib/CMakeFiles/
+rm -rf GBSPLib/Makefile
+rm -rf GBSPLib/cmake_install.cmake
+
Scripts/code_counter.sh