-ADD_LIBRARY (genesis3d STATIC CSNetMgr.c)
+ADD_LIBRARY (genesis3d STATIC CSNetMgr.c Camera.c Ge.c)
#include <assert.h>\r
\r
//#define INITGUID\r
-#include <Windows.H>\r
+#include <windows.h>\r
#include <objbase.h>\r
\r
#include "CSNetMgr.h"\r
#include "NetPlay.h"\r
\r
-#include "BaseType.h"\r
-#include "Ram.h"\r
-#include "ErrorLog.h"\r
+#include "include/BaseType.h"\r
+#include "include/Ram.h"\r
+#include "include/ErrorLog.h"\r
\r
-#include <InitGuid.h>\r
+#include <initguid.h>\r
\r
#pragma message(" some assertions in here would be nice:")\r
\r
#ifndef GE_CSNETMGR_H\r
#define GE_CSNETMGR_H\r
\r
-#include "BaseType.h"\r
+#include "include/BaseType.h"\r
\r
#ifdef __cplusplus\r
extern "C" {\r
/* */\r
/****************************************************************************************/\r
#include <math.h>\r
-#include <Assert.h>\r
-#include <Memory.h> // memset\r
+#include <assert.h>\r
+#include <memory.h> // memset\r
\r
#include "Camera.h"\r
-#include "Ram.h"\r
-#include "ErrorLog.h"\r
-\r
-\r
-#include "DCommon.h"\r
+#include "include/Ram.h"\r
+#include "include/ErrorLog.h"\r
+#include "G3D/Engine/Drivers/DCommon.h"\r
\r
typedef struct geCamera \r
{\r
#ifndef GE_CAMERA_H\r
#define GE_CAMERA_H\r
\r
-#include "BaseType.h"\r
-#include "Vec3d.h"\r
-#include "XForm3d.h"\r
-#include "GETypes.h"\r
+#include "include/BaseType.h"\r
+#include "include/Vec3d.h"\r
+#include "include/XForm3d.h"\r
+#include "include/GETypes.h"\r
\r
#ifdef __cplusplus\r
extern "C" {\r
// If you include Windows it MUST be before dcommon!\r
\r
// FIXME: What should we do with these?\r
-#include "XForm3d.h"\r
-#include "Vec3d.h"\r
-#include "PixelFormat.h"\r
-#include "geTypes.h" // This is a no no\r
+#include "include/XForm3d.h"\r
+#include "include/Vec3d.h"\r
+#include "include/PixelFormat.h"\r
+#include "include/GETypes.h" // This is a no no\r
\r
#ifdef __cplusplus\r
extern "C" {\r
/* */\r
/****************************************************************************************/\r
\r
-#include <Windows.h>\r
-#include <Math.h>\r
-#include <Assert.h>\r
+#include <windows.h>\r
+#include <math.h>\r
+#include <assert.h>\r
\r
-#include "Genesis.H"\r
-#include "System.h"\r
-#include "Ram.h"\r
+#include "include/Genesis.h"\r
+#include "G3D/Engine/System.h"\r
+#include "include/Ram.h"\r
\r
//#include "Sound.h"\r
//#include "Sound3d.h"\r
#include <windows.h>\r
#include <dplay.h>\r
\r
-#include "BaseType.h"\r
+#include "include/BaseType.h"\r
\r
#ifdef __cplusplus\r
extern "C" {\r
+++ /dev/null
-/****************************************************************************************/\r
-/* BASETYPE.H */\r
-/* */\r
-/* Author: */\r
-/* Description: Basic type definitions and calling convention defines */\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_BASETYPE_H\r
-#define GE_BASETYPE_H\r
- \r
-#ifdef __cplusplus\r
-extern "C" {\r
-#endif\r
-\r
-/******** The Genesis Calling Conventions ***********/ \r
-\r
-#define GENESISCC _fastcall\r
-\r
-#if defined(BUILDGENESIS) && defined(GENESISDLLVERSION)\r
- #define GENESISAPI _declspec(dllexport)\r
-#else\r
- #if defined(GENESISDLLVERSION)\r
- #define GENESISAPI _declspec(dllimport)\r
- #else\r
- #define GENESISAPI\r
- #endif\r
-#endif\r
-\r
-/******** The Basic Types ****************************/\r
-\r
-typedef signed int geBoolean;\r
-#define GE_FALSE (0)\r
-#define GE_TRUE (1)\r
-\r
-typedef float geFloat;\r
-typedef double geDouble;\r
-\r
-#ifndef NULL\r
-/* #define NULL ((void *)0) */\r
-#define NULL 0\r
-#endif\r
-\r
-typedef signed long int32;\r
-typedef signed short int16;\r
-typedef signed char int8 ;\r
-typedef unsigned long uint32;\r
-typedef unsigned short uint16;\r
-typedef unsigned char uint8 ;\r
-\r
-/******** Macros on Genesis basic types *************/\r
-\r
-#define GE_ABS(x) ( (x) < 0 ? (-(x)) : (x) )\r
-#define GE_CLAMP(x,lo,hi) ( (x) < (lo) ? (lo) : ( (x) > (hi) ? (hi) : (x) ) )\r
-#define GE_CLAMP8(x) GE_CLAMP(x,0,255)\r
-#define GE_CLAMP16(x) GE_CLAMP(x,0,65536)\r
-#define GE_BOOLSAME(x,y) ( ( (x) && (y) ) || ( !(x) && !(y) ) )\r
-\r
-#define GE_EPSILON ((geFloat)0.000797f)\r
-#define GE_FLOATS_EQUAL(x,y) ( GE_ABS((x) - (y)) < GE_EPSILON )\r
-#define GE_FLOAT_ISZERO(x) GE_FLOATS_EQUAL(x,0.0f)\r
-\r
-#define GE_PI ((geFloat)3.14159265358979323846f)\r
-\r
-/****************************************************/\r
-\r
-#ifdef __cplusplus\r
-}\r
-#endif\r
-\r
-#endif\r
- \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
#ifndef GE_EXTBOX_H\r
#define GE_EXTBOX_H\r
\r
-#include "basetype.h"\r
-#include "vec3d.h"\r
+#include "BaseType.h"\r
+#include "Vec3d.h"\r
\r
#ifdef __cplusplus\r
extern "C" {\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
+++ /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
-/* GeTypes.h */\r
-/* */\r
-/* Description: Genesis Types (not primitive enough for basetype) */\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_TYPES_H\r
-#define GE_TYPES_H\r
-\r
-#include "BaseType.h"\r
-\r
-\r
-#ifdef __cplusplus\r
-extern "C" {\r
-#endif\r
-\r
-//\r
-// Collision defines (for geWorld_Collision)\r
-//\r
-#define GE_COLLIDE_MESHES (1<<0)\r
-#define GE_COLLIDE_MODELS (1<<1)\r
-#define GE_COLLIDE_ACTORS (1<<2)\r
-#define GE_COLLIDE_NO_SUB_MODELS (1<<3)\r
-#define GE_COLLIDE_ALL (GE_COLLIDE_MESHES | GE_COLLIDE_MODELS | GE_COLLIDE_ACTORS)\r
-\r
-//\r
-// Actor flags (geWorld_AddActor)\r
-//\r
-#define GE_ACTOR_RENDER_NORMAL (1<<0) // Render in normal views\r
-#define GE_ACTOR_RENDER_MIRRORS (1<<1) // Render in mirror views\r
-#define GE_ACTOR_RENDER_ALWAYS (1<<2) // Render always, skipping all visibility tests\r
-#define GE_ACTOR_COLLIDE (1<<3) // Collide when calling geWorld_Collision\r
-\r
-//MRB BEGIN\r
-//geSprite\r
-//\r
-// Sprite flags (geSprite_AddSprite)\r
-//\r
-#define GE_SPRITE_RENDER_NORMAL (1<<0) // Render in normal views\r
-#define GE_SPRITE_RENDER_MIRRORS (1<<1) // Render in mirror views\r
-#define GE_SPRITE_RENDER_ALWAYS (1<<2) // Render always, skipping all visibility tests\r
-#define GE_SPRITE_COLLIDE (1<<3) // Collide when calling geWorld_Collision\r
-//MRB END\r
-\r
-typedef struct\r
-{\r
- geBoolean UseEnvironmentMapping; //toggle for actor-level environ-map\r
- geBoolean Supercede; //toggle for material-level\r
- geFloat PercentEnvironment;\r
- geFloat PercentMaterial; //Used when Supercede == GE_FALSE\r
- geFloat PercentPuppet;\r
-} geEnvironmentOptions;\r
-\r
-//\r
-// Model flags (geWorld_ModelSetFlags)\r
-//\r
-#define GE_MODEL_RENDER_NORMAL (1<<0) // Render in normal views\r
-#define GE_MODEL_RENDER_MIRRORS (1<<1) // Render in mirror views\r
-#define GE_MODEL_RENDER_ALWAYS (1<<2) // Render always, skipping all visibility tests\r
-#define GE_MODEL_COLLIDE (1<<3) // Collide when calling geWorld_Collision\r
-\r
-//MRB BEGIN\r
-typedef struct\r
-{\r
- geFloat r, g, b;\r
-} geColor;\r
-\r
-typedef struct\r
-{\r
- geFloat u, v;\r
-} geUV;\r
-//MRB END\r
-\r
-typedef struct\r
-{\r
- geFloat r, g, b, a;\r
-} GE_RGBA;\r
-\r
-typedef struct\r
-{\r
- int32 Left;\r
- int32 Right;\r
- int32 Top;\r
- int32 Bottom;\r
-} GE_Rect;\r
-\r
-typedef struct\r
-{\r
- geFloat MinX,MaxX;\r
- geFloat MinY,MaxY;\r
-} geFloatRect;\r
-\r
-//MRB BEGIN\r
-typedef struct\r
-{\r
- geFloat X;\r
- geFloat Y;\r
-} geCoordinate;\r
-//MRB END\r
-\r
-// Lit vertex\r
-typedef struct\r
-{\r
- // FIXME: Convert 3d X,Y,Z to geVec3d\r
- geFloat X, Y, Z; // 3d vertex\r
- geFloat u, v; // Uv's\r
- // FIXME: Convert r,g,b,a to GE_RGBA\r
- geFloat r, g, b, a; // color\r
-} GE_LVertex;\r
-\r
-// Transformed Lit vertex\r
-typedef struct\r
-{\r
- geFloat x, y, z; // screen points\r
- geFloat u, v; // Uv's\r
- geFloat r, g, b, a; // color\r
-} GE_TLVertex;\r
-\r
-typedef GE_Rect geRect;\r
-\r
-#ifdef __cplusplus\r
-}\r
-#endif\r
-\r
-\r
-#endif GETYPES_H\r
+++ /dev/null
-#ifndef PIXELFORMAT_H\r
-#define PIXELFORMAT_H\r
-\r
-/****************************************************************************************/\r
-/* PixelFormat.h */\r
-/* */\r
-/* Author: Charles Bloom */\r
-/* Description: The abstract Pixel primitives */\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
-\r
-#include "basetype.h"\r
-\r
-#ifdef __cplusplus\r
-extern "C" {\r
-#endif\r
-\r
-typedef enum // all supported formats (including shifts)\r
-{\r
- GE_PIXELFORMAT_NO_DATA = 0,\r
- GE_PIXELFORMAT_8BIT, // PAL\r
- GE_PIXELFORMAT_8BIT_GRAY, // no palette (intensity from bit value)\r
- GE_PIXELFORMAT_16BIT_555_RGB,\r
- GE_PIXELFORMAT_16BIT_555_BGR,\r
- GE_PIXELFORMAT_16BIT_565_RGB, // #5\r
- GE_PIXELFORMAT_16BIT_565_BGR, \r
- GE_PIXELFORMAT_16BIT_4444_ARGB, // #7\r
- GE_PIXELFORMAT_16BIT_1555_ARGB, \r
- GE_PIXELFORMAT_24BIT_RGB, // #9\r
- GE_PIXELFORMAT_24BIT_BGR,\r
- GE_PIXELFORMAT_24BIT_YUV, // * see note below\r
- GE_PIXELFORMAT_32BIT_RGBX, \r
- GE_PIXELFORMAT_32BIT_XRGB, \r
- GE_PIXELFORMAT_32BIT_BGRX, \r
- GE_PIXELFORMAT_32BIT_XBGR,\r
- GE_PIXELFORMAT_32BIT_RGBA, \r
- GE_PIXELFORMAT_32BIT_ARGB, // #17\r
- GE_PIXELFORMAT_32BIT_BGRA, \r
- GE_PIXELFORMAT_32BIT_ABGR,\r
- \r
- GE_PIXELFORMAT_WAVELET, // #20 , Wavelet Compression\r
-\r
- GE_PIXELFORMAT_COUNT\r
-} gePixelFormat;\r
- \r
-/******\r
-\r
-there's something wacked out about these format names :\r
-\r
- for 16 bit & 32 bit , the _RGB or _BGR refers to their order\r
- *in the word or dword* ; since we're on intel, this means\r
- the bytes in the data file have the *opposite* order !!\r
- (for example the 32 bit _ARGB is actually B,G,R,A in raw bytes)\r
- for 24 bit , the _RGB or _BGR refers to their order in the\r
- actual bytes, so that windows bitmaps actually have\r
- _RGB order in a dword !!\r
-\r
-* YUV : the pixelformat ops here are identical to those of 24bit_RGB ;\r
- this is just a place-keeper to notify you that you should to a YUV_to_RGB conversion\r
-\r
-*********/\r
-\r
-#define GE_PIXELFORMAT_8BIT_PAL GE_PIXELFORMAT_8BIT\r
-\r
-typedef uint32 (*gePixelFormat_Composer )(int R,int G,int B,int A);\r
-typedef void (*gePixelFormat_Decomposer )(uint32 Pixel,int *R,int *G,int *B,int *A);\r
-\r
-typedef void (*gePixelFormat_ColorGetter)(uint8 **ppData,int *R,int *G,int *B,int *A);\r
-typedef void (*gePixelFormat_ColorPutter)(uint8 **ppData,int R,int G,int B,int A);\r
-\r
-typedef uint32 (*gePixelFormat_PixelGetter)(uint8 **ppData);\r
-typedef void (*gePixelFormat_PixelPutter)(uint8 **ppData,uint32 Pixel);\r
-\r
-typedef struct gePixelFormat_Operations\r
-{\r
- uint32 RMask;\r
- uint32 GMask;\r
- uint32 BMask;\r
- uint32 AMask;\r
-\r
- int RShift;\r
- int GShift;\r
- int BShift;\r
- int AShift;\r
-\r
- int RAdd;\r
- int GAdd;\r
- int BAdd;\r
- int AAdd;\r
-\r
- int BytesPerPel;\r
- geBoolean HasPalette;\r
- char * Description;\r
- \r
- gePixelFormat_Composer ComposePixel;\r
- gePixelFormat_Decomposer DecomposePixel;\r
-\r
- gePixelFormat_ColorGetter GetColor;\r
- gePixelFormat_ColorPutter PutColor;\r
-\r
- gePixelFormat_PixelGetter GetPixel;\r
- gePixelFormat_PixelPutter PutPixel;\r
-} gePixelFormat_Operations;\r
-\r
- // the Masks double as boolean "HaveAlpha" .. etc..\r
-\r
-GENESISAPI const gePixelFormat_Operations * GENESISCC gePixelFormat_GetOperations( gePixelFormat Format );\r
-\r
- // quick accessors to _GetOps\r
-GENESISAPI geBoolean GENESISCC gePixelFormat_IsValid( gePixelFormat Format);\r
-GENESISAPI unsigned int GENESISCC gePixelFormat_BytesPerPel( gePixelFormat Format );\r
-GENESISAPI geBoolean GENESISCC gePixelFormat_HasPalette( gePixelFormat Format );\r
-GENESISAPI geBoolean GENESISCC gePixelFormat_HasAlpha( gePixelFormat Format );\r
-GENESISAPI geBoolean GENESISCC gePixelFormat_HasGoodAlpha( gePixelFormat Format ); // more than 1 bit of alpha\r
-GENESISAPI const char * GENESISCC gePixelFormat_Description( gePixelFormat Format );\r
-GENESISAPI geBoolean GENESISCC gePixelFormat_IsRaw( gePixelFormat Format );\r
- // 'Raw' means pixels can be made with the Compose operations\r
-\r
-GENESISAPI uint32 GENESISCC gePixelFormat_ComposePixel( gePixelFormat Format,int R,int G,int B,int A);\r
-GENESISAPI void GENESISCC gePixelFormat_DecomposePixel( gePixelFormat Format,uint32 Pixel,int *R,int *G,int *B,int *A);\r
- \r
- // these four functions move ppData to the next pixel\r
-\r
-GENESISAPI void GENESISCC gePixelFormat_GetColor(gePixelFormat Format,uint8 **ppData,int *R,int *G,int *B,int *A);\r
-GENESISAPI void GENESISCC gePixelFormat_PutColor(gePixelFormat Format,uint8 **ppData,int R,int G,int B,int A);\r
-\r
-GENESISAPI uint32 GENESISCC gePixelFormat_GetPixel(gePixelFormat Format,uint8 **ppData);\r
-GENESISAPI void GENESISCC gePixelFormat_PutPixel(gePixelFormat Format,uint8 **ppData,uint32 Pixel);\r
- \r
-GENESISAPI uint32 GENESISCC gePixelFormat_ConvertPixel(gePixelFormat Format,uint32 Pixel,gePixelFormat ToFormat);\r
-\r
-\r
-#ifdef __cplusplus\r
-}\r
-#endif\r
-\r
-#endif\r
-\r