#include "Genesis.h"#include "System.h"#include "world.h"#include "bitmap.h"#include "BitmapList.h"Go to the source code of this file.
|
|
Definition at line 43 of file engine.h. Referenced by EnumSubDrivers(), geEngine_LoadLibrary(), WindowCleanup(), and WindowSetup(). |
|
||||||||||||||||||||||||
|
Definition at line 2143 of file engine.c. References geEngine::DriverInfo, Engine, ENGINE_PF_ALPHA_CHANNEL, ENGINE_PF_PALETTE, geRDriver_PixelFormat::Flags, gePixelFormat_HasPalette(), geEngine::HasPixelFormat, geRDriver_THandleInfo::Height, NULL, geRDriver_PixelFormat::PixelFormat, geEngine::PixelFormats, Sys_DriverInfo::RDriver, RDRIVER_PF_ALPHA, RDRIVER_PF_HAS_ALPHA, DRV_Driver::THandle_Create, DRV_Driver::THandle_Destroy, DRV_Driver::THandle_SetAlpha, DRV_Driver::THandle_SetPalette, and geRDriver_THandleInfo::Width. Referenced by geEngine_CreateWorldLightmapTHandles().
02144 {
02145 geRDriver_THandle * THandle;
02146
02147 if ( ! Engine->HasPixelFormat[EngineTexType] )
02148 {
02149 //{} assert( Engine->HasPixelFormat[EngineTexType] );
02150 return NULL;
02151 }
02152
02153 THandle = Engine->DriverInfo.RDriver->THandle_Create(Width,Height,Mips,&(Engine->PixelFormats[EngineTexType]));
02154
02155 if (! THandle )
02156 return NULL;
02157
02158 if ( gePixelFormat_HasPalette(Engine->PixelFormats[EngineTexType].PixelFormat) )
02159 {
02160 geRDriver_THandle * PalHandle;
02161 PalHandle = Engine->DriverInfo.RDriver->THandle_Create(256,1,1,&(Engine->PixelFormats[ENGINE_PF_PALETTE]));
02162 if ( ! PalHandle )
02163 {
02164 Engine->DriverInfo.RDriver->THandle_Destroy(THandle);
02165 return NULL;
02166 }
02167 Engine->DriverInfo.RDriver->THandle_SetPalette(THandle,PalHandle);
02168
02169 #ifdef _DEBUG
02170 {
02171 geRDriver_THandleInfo Info;
02172 (Engine->DriverInfo.RDriver)->THandle_GetInfo(PalHandle,0,&Info);
02173 assert(Info.Width == 256);
02174 assert(Info.Height == 1);
02175 }
02176 #endif
02177 }
02178
02179 if ( (Engine->PixelFormats[EngineTexType].Flags) & RDRIVER_PF_HAS_ALPHA )
02180 {
02181 geRDriver_THandle * AlphaHandle;
02182 assert( Engine->PixelFormats[ENGINE_PF_ALPHA_CHANNEL].Flags & RDRIVER_PF_ALPHA );
02183 assert( ! (Engine->PixelFormats[ENGINE_PF_ALPHA_CHANNEL].Flags & RDRIVER_PF_HAS_ALPHA) );
02184 AlphaHandle = Engine_CreateTHandle(Engine,Width,Height,Mips,ENGINE_PF_ALPHA_CHANNEL);
02185 if ( ! AlphaHandle )
02186 {
02187 Engine->DriverInfo.RDriver->THandle_Destroy(THandle);
02188 return NULL;
02189 }
02190 Engine->DriverInfo.RDriver->THandle_SetAlpha(THandle,AlphaHandle);
02191 }
02192
02193 return THandle;
02194 }
|
|
||||||||||||
|
Definition at line 2196 of file engine.c. References geEngine::DriverInfo, Engine, Sys_DriverInfo::RDriver, and DRV_Driver::THandle_Destroy.
02197 {
02198 Engine->DriverInfo.RDriver->THandle_Destroy(THandle);
02199 }
|
|
|
Definition at line 2105 of file engine.c. References geEngine::DriverInfo, Engine, ENGINE_PF_ALPHA_CHANNEL, ENGINE_PF_DECAL, ENGINE_PF_LIGHTMAP, ENGINE_PF_PALETTE, ENGINE_PF_USER, ENGINE_PF_USER_ALPHA, ENGINE_PF_WORLD, DRV_Driver::EnumPixelFormats, GE_TRUE, geBoolean, Hack_EnumCallBack(), Sys_DriverInfo::RDriver, RDRIVER_PF_2D, RDRIVER_PF_3D, RDRIVER_PF_ALPHA, RDRIVER_PF_COMBINE_LIGHTMAP, RDRIVER_PF_LIGHTMAP, RDRIVER_PF_PALETTE, and uint32. Referenced by Engine_InitDriver().
02106 {
02107 geRDriver_PixelFormat PixelFormatsArray[100],*PixelArrayPtr;
02108 int PixelFormatsLen;
02109
02110 PixelArrayPtr = PixelFormatsArray;
02111
02112 Engine->DriverInfo.RDriver->EnumPixelFormats(Hack_EnumCallBack , &PixelArrayPtr);
02113
02114 PixelFormatsLen = ((uint32)PixelArrayPtr - (uint32)PixelFormatsArray)/sizeof(geRDriver_PixelFormat);
02115 assert(PixelFormatsLen > 0);
02116
02117 #define SetupPF( type, flag, alpha ) \
02118 if ( PixelArrayPtr = Hack_FindPixelFormat(PixelFormatsArray,PixelFormatsLen,flag,alpha) ) \
02119 { \
02120 Engine->PixelFormats[type] = *PixelArrayPtr; \
02121 Engine->HasPixelFormat[type] = GE_TRUE; \
02122 } \
02123 else \
02124 { \
02125 Engine->HasPixelFormat[type] = GE_FALSE; \
02126 }
02127
02128 SetupPF( ENGINE_PF_WORLD, RDRIVER_PF_COMBINE_LIGHTMAP,0);
02129 SetupPF( ENGINE_PF_LIGHTMAP, RDRIVER_PF_LIGHTMAP,0);
02130 SetupPF( ENGINE_PF_USER, RDRIVER_PF_3D,0);
02131 SetupPF( ENGINE_PF_USER_ALPHA, RDRIVER_PF_3D,1);
02132 SetupPF( ENGINE_PF_DECAL, RDRIVER_PF_2D,0);
02133 SetupPF( ENGINE_PF_PALETTE, RDRIVER_PF_PALETTE,0);
02134 SetupPF( ENGINE_PF_ALPHA_CHANNEL,RDRIVER_PF_ALPHA,0);
02135
02136 return GE_TRUE;
02137 }
|
|
||||||||||||||||||||
|
|
|
||||||||||||
|
Definition at line 812 of file engine.c.
00813 {
00814 int32 i;
00815 geEngine_WorldList *pWorldList;
00816
00817 assert(Engine);
00818 assert(World);
00819
00820 // Try to find it in the list first
00821 pWorldList = Engine->WorldList;
00822 for (i=0; i< ENGINE_MAX_WORLDS; i++, pWorldList++)
00823 {
00824 if (pWorldList->World == World) // World is allready in list
00825 {
00826 assert(pWorldList->RefCount > 0); // There should allready be a ref count!!!
00827 pWorldList->RefCount++;
00828
00829 #ifdef DO_ADDREMOVE_MESSAGES
00830 {
00831 char str[100];
00832 sprintf(str,"Engine_AddWorld : %08X : old\n",World);
00833 OutputDebugString(str);
00834 }
00835 #endif
00836
00837 return GE_TRUE;
00838 }
00839
00840 }
00841
00842 #ifdef DO_ADDREMOVE_MESSAGES
00843 {
00844 char str[100];
00845 sprintf(str,"Engine_AddWorld : %08X : new\n",World);
00846 OutputDebugString(str);
00847 }
00848 #endif
00849
00850 // Not found, add a new one
00851 pWorldList = Engine->WorldList;
00852 for (i=0; i< ENGINE_MAX_WORLDS; i++, pWorldList++)
00853 {
00854 if (!pWorldList->RefCount)
00855 break;
00856 }
00857
00858 if (i == ENGINE_MAX_WORLDS)
00859 {
00860 geErrorLog_AddString(-1, "geEngine_AddWorld: Out of slots.", NULL);
00861 return GE_FALSE;
00862 }
00863
00864 // Save the info for the first time
00865 pWorldList->World = World;
00866 pWorldList->RefCount = 1;
00867
00868 // Re-build the fast list of worlds
00869 geEngine_RebuildFastWorldList(Engine);
00870 Engine->Changed = GE_TRUE;
00871 World->Changed = GE_TRUE;
00872
00873 if (!geWorld_CreateRef(World))
00874 {
00875 geErrorLog_AddString(-1, "geEngine_AddWorld: geWorld_CreateRef failed...", NULL);
00876 return GE_FALSE;
00877 }
00878
00879 return GE_TRUE;
00880 }
|
|
|
Definition at line 1225 of file engine.c. References Sys_DriverInfo::Active, geEngine::AttachedBitmaps, geEngine::BitmapGamma, BitmapList_AttachAll(), geEngine::DriverInfo, Engine, GE_FALSE, GE_TRUE, geBoolean, geEngine_AttachAllWorlds(), geErrorLog_AddString, NULL, and Sys_DriverInfo::RDriver. Referenced by geEngine_Prep().
01226 {
01227 DRV_Driver *RDriver;
01228
01229 assert( Engine );
01230
01231 RDriver = Engine->DriverInfo.RDriver;
01232 assert( RDriver );
01233
01234 // If current driver is not active, then split
01235 if (!Engine->DriverInfo.Active)
01236 return GE_TRUE;
01237
01238 // Attach all the bitmaps for the engine
01239 if (!BitmapList_AttachAll(Engine->AttachedBitmaps, RDriver, Engine->BitmapGamma))
01240 {
01241 geErrorLog_AddString(-1, "geEngine_AttachAll: BitmapList_AttachAll for Engine failed...", NULL);
01242 return GE_FALSE;
01243 }
01244
01245 // Attach all the bitmaps for the world
01246 if (!geEngine_AttachAllWorlds(Engine))
01247 {
01248 geErrorLog_AddString(-1, "geEngine_AttachAll: geEngine_AttachAllWorlds failed.", NULL);
01249 return GE_FALSE;
01250 }
01251
01252 return GE_TRUE;
01253 }
|
|
|
Definition at line 1194 of file engine.c. References geEngine::BitmapGamma, geEngine::DriverInfo, Engine, GE_FALSE, GE_TRUE, geBoolean, geEngine_CreateWorldLightmapTHandles(), geErrorLog_AddString, geWorld_AttachAll(), int32, NULL, geEngine::NumWorlds, Sys_DriverInfo::RDriver, and geEngine::Worlds. Referenced by geEngine_AttachAll().
01195 {
01196 int32 i;
01197 DRV_Driver *RDriver;
01198
01199 assert(Engine);
01200
01201 RDriver = Engine->DriverInfo.RDriver;
01202
01203 for (i=0; i< Engine->NumWorlds; i++)
01204 {
01205 if (!geWorld_AttachAll(Engine->Worlds[i], RDriver, Engine->BitmapGamma ))
01206 {
01207 geErrorLog_AddString(-1, "geEngine_AttachAllWorlds: geWorld_AttachAll failed.", NULL);
01208 return GE_FALSE;
01209 }
01210
01211 if (!geEngine_CreateWorldLightmapTHandles(Engine, Engine->Worlds[i]))
01212 {
01213 geErrorLog_AddString(-1, "geEngine_AttachAllWorlds: geEngine_CreateWorldLightmapTHandles failed.", NULL);
01214 return GE_FALSE;
01215 }
01216
01217 }
01218
01219 return GE_TRUE;
01220 }
|
|
|
Definition at line 185 of file engine.c. References geEngine::AttachedBitmaps, BitmapList_Create(), Engine, GE_FALSE, GE_TRUE, geBoolean, geErrorLog_AddString, and NULL. Referenced by Sys_EngineCreate().
00186 {
00187 assert(Engine);
00188 assert(Engine->AttachedBitmaps == NULL);
00189
00190 if ( Engine->AttachedBitmaps == NULL )
00191 {
00192 Engine->AttachedBitmaps = BitmapList_Create();
00193 if ( ! Engine->AttachedBitmaps )
00194 {
00195 geErrorLog_AddString(-1, "geEngine_BitmapListInit: BitmapList_Create failed...", NULL);
00196 return GE_FALSE;
00197 }
00198 }
00199 return GE_TRUE;
00200 }
|
|
|
Definition at line 205 of file engine.c. References Sys_DriverInfo::Active, geEngine::AttachedBitmaps, BitmapList_CountMembersAttached(), BitmapList_Destroy(), geEngine::DriverInfo, Engine, GE_TRUE, geBoolean, and NULL. Referenced by Sys_EngineFree().
00206 {
00207 assert(Engine);
00208
00209 if ( Engine->AttachedBitmaps )
00210 {
00211 assert( Engine->DriverInfo.Active || BitmapList_CountMembersAttached(Engine->AttachedBitmaps) == 0 );
00212
00213 //BitmapList_DetachAll(Engine->AttachedBitmaps);
00214 // Destroy detaches for you!
00215 BitmapList_Destroy(Engine->AttachedBitmaps);
00216 Engine->AttachedBitmaps = NULL;
00217 }
00218
00219 return GE_TRUE;
00220 }
|
|
||||||||||||
|
Definition at line 1061 of file engine.c. References World_BSP::BSPData, geWorld::CurrentBSP, geEngine::DriverInfo, Engine, Engine_CreateTHandle(), ENGINE_PF_LIGHTMAP, DRV_LInfo::Face, Surf_SurfInfo::Flags, GE_FALSE, GE_TRUE, geBoolean, geErrorLog_AddString, DRV_LInfo::Height, int32, DRV_Driver::LastErrorStr, Light_SetupLightmap(), Surf_SurfInfo::LInfo, Log_Printf(), NULL, GBSP_BSPData::NumGFXFaces, Sys_DriverInfo::RDriver, World_BSP::SurfInfo, SURFINFO_LIGHTMAP, DRV_LInfo::THandle, DRV_LInfo::Width, World_SetEngine(), World_SetGBSP(), and World_SetWorld(). Referenced by geEngine_AttachAllWorlds().
01062 {
01063 DRV_Driver *RDriver;
01064 int32 i;
01065 World_BSP *BSP;
01066 GBSP_BSPData *BSPData;
01067 #ifdef _DEBUG
01068 int CreatedCount = 0;
01069 #endif
01070
01071 assert(Engine);
01072 assert(World);
01073
01074 BSP = World->CurrentBSP;
01075 BSPData = &BSP->BSPData;
01076 RDriver = Engine->DriverInfo.RDriver;
01077
01078 //
01079 // Create all the lightmap thandles
01080 //
01081 World_SetEngine(Engine);
01082 World_SetWorld(World);
01083 World_SetGBSP(World->CurrentBSP);
01084
01085 for (i=0; i<BSPData->NumGFXFaces; i++)
01086 {
01087 BOOL D;
01088 DRV_LInfo *pLInfo;
01089
01090 pLInfo = &BSP->SurfInfo[i].LInfo;
01091
01092 if ((pLInfo->Face == -1))
01093 continue;
01094
01095 if (!(BSP->SurfInfo[i].Flags & SURFINFO_LIGHTMAP))
01096 continue;
01097
01098 assert(!pLInfo->THandle); // This should be true!!!
01099
01100 if (pLInfo->THandle)
01101 continue;
01102
01103 Light_SetupLightmap(pLInfo, &D);
01104
01105 // {} _LIGHTMAP_
01106 pLInfo->THandle = Engine_CreateTHandle(Engine,pLInfo->Width, pLInfo->Height, 1, ENGINE_PF_LIGHTMAP);
01107
01108 if (!pLInfo->THandle)
01109 {
01110 geErrorLog_AddString(-1, RDriver->LastErrorStr, NULL);
01111 geErrorLog_AddString(-1, "geEngine_CreateWorldTHandles: Engine_CreateTHandle failed...\n", NULL);
01112 return GE_FALSE;
01113 }
01114
01115 #ifdef _DEBUG
01116 CreatedCount ++;
01117 #endif
01118 }
01119
01120 #ifdef _DEBUG
01121 Log_Printf("geEngine_CreateWorldLightmapTHandles:Created %d of %d\n",CreatedCount,BSPData->NumGFXFaces);
01122 #endif
01123
01124 return GE_TRUE;
01125 }
|
|
||||||||||||
|
Definition at line 1130 of file engine.c. References World_BSP::BSPData, geWorld::CurrentBSP, geEngine::DriverInfo, Engine, DRV_LInfo::Face, Surf_SurfInfo::Flags, GE_FALSE, GE_TRUE, geBoolean, int32, Surf_SurfInfo::LInfo, Log_Printf(), NULL, GBSP_BSPData::NumGFXFaces, Sys_DriverInfo::RDriver, World_BSP::SurfInfo, SURFINFO_LIGHTMAP, DRV_LInfo::THandle, DRV_Driver::THandle_Destroy, World_SetEngine(), World_SetGBSP(), and World_SetWorld(). Referenced by geEngine_DetachAllWorlds().
01131 {
01132 DRV_Driver *RDriver;
01133 int32 i;
01134 World_BSP *BSP;
01135 GBSP_BSPData *BSPData;
01136 geBoolean Ret;
01137 int32 Handle1=1768710981;
01138 int32 Handle2=0x21657370;
01139 #ifdef _DEBUG
01140 int DestroyedCount = 0;
01141 #endif
01142
01143 assert(Engine);
01144 assert(World);
01145
01146 Ret = GE_TRUE;
01147
01148 BSP = World->CurrentBSP;
01149 BSPData = &BSP->BSPData;
01150 RDriver = Engine->DriverInfo.RDriver;
01151
01152 //
01153 // Create all the lightmap thandles
01154 //
01155 World_SetEngine(Engine);
01156 World_SetWorld(World);
01157 World_SetGBSP(World->CurrentBSP);
01158
01159 for (i=0; i<BSPData->NumGFXFaces; i++)
01160 {
01161 DRV_LInfo *pLInfo;
01162
01163 pLInfo = &BSP->SurfInfo[i].LInfo;
01164
01165 if ((pLInfo->Face == -1))
01166 continue;
01167
01168 if (!(BSP->SurfInfo[i].Flags & SURFINFO_LIGHTMAP))
01169 continue;
01170
01171 if (!pLInfo->THandle)
01172 continue;
01173
01174 if (!RDriver->THandle_Destroy(pLInfo->THandle))
01175 Ret = GE_FALSE;
01176
01177 pLInfo->THandle = NULL;
01178
01179 #ifdef _DEBUG
01180 DestroyedCount ++;
01181 #endif
01182 }
01183
01184 #ifdef _DEBUG
01185 Log_Printf("geEngine_DestroyWorldLightmapTHandles: Freed %d of %d\n",DestroyedCount,BSPData->NumGFXFaces);
01186 #endif
01187
01188 return Ret;
01189 }
|
|
|
Definition at line 1258 of file engine.c. References geEngine::AttachedBitmaps, BitmapList_DetachAll(), Engine, GE_FALSE, GE_TRUE, geBoolean, geEngine_DetachAllWorlds(), geErrorLog_AddString, and NULL. Referenced by geEngine_ResetDriver().
01259 {
01260 assert(Engine);
01261
01262 // Shutdown all the geBitmaps
01263 if (!BitmapList_DetachAll(Engine->AttachedBitmaps))
01264 {
01265 geErrorLog_AddString(-1, "geEngine_DetachAll: BitmapList_DetachAll failed for engine.", NULL);
01266 return GE_FALSE;
01267 }
01268
01269 // Detach all the bitmaps that belong to all the currently connected worlds
01270 if (!geEngine_DetachAllWorlds(Engine))
01271 {
01272 geErrorLog_AddString(-1, "geEngine_DetachAll: geEngine_DetachAllWorlds failed for engine.", NULL);
01273 return GE_FALSE;
01274 }
01275
01276 return GE_TRUE;
01277 }
|
|
|
Definition at line 1033 of file engine.c. References Engine, GE_FALSE, GE_TRUE, geBoolean, geEngine_DestroyWorldLightmapTHandles(), geErrorLog_AddString, geWorld_DetachAll(), int32, NULL, geEngine::NumWorlds, and geEngine::Worlds. Referenced by geEngine_DetachAll().
01034 {
01035 int32 i;
01036 geBoolean Ret;
01037
01038 Ret = GE_TRUE;
01039
01040 for (i=0; i< Engine->NumWorlds; i++)
01041 {
01042 if (!geWorld_DetachAll(Engine->Worlds[i]))
01043 {
01044 geErrorLog_AddString(-1, "geEngine_DetachAllWorlds: geWorld_DetachAll failed.", NULL);
01045 Ret = GE_FALSE;
01046 }
01047
01048 if (!geEngine_DestroyWorldLightmapTHandles(Engine, Engine->Worlds[i]))
01049 {
01050 geErrorLog_AddString(-1, "geEngine_DetachAllWorlds: geEngine_DestroyWorldLightmapTHandles failed.", NULL);
01051 Ret = GE_FALSE;
01052 }
01053 }
01054
01055 return Ret;
01056 }
|
|
||||||||||||
|
|
|
||||||||||||||||||||||||||||||||||||
|
Definition at line 324 of file engine.c.
00334 {
00335 // set up variables
00336 GE_TLVertex vertex[4];
00337 geFloat fUVAdd = 0.0f;
00338 geFloat fWidthBmp = 0;
00339 geFloat fHeightBmp = 0;
00340 GE_Rect ClipRect = {0,0,0,0};
00341 GE_Rect UseRect = {0,0,0,0};
00342 geVec3d DefaultUVArray[4] = {{0,0,0},{1,0,0},{1,1,0},{0,1,0}};
00343 GE_RGBA DefaultRGBA_Array[4] =
00344 {{255,255,255,Alpha},
00345 {255,255,255,Alpha},
00346 {255,255,255,Alpha},
00347 {255,255,255,Alpha}};
00348 geBitmap_Info TempInfo, TempInfo2;
00349 geFloat UVbreak = 0.0f;
00350
00351 if(pBitmap)
00352 geBitmap_GetInfo(pBitmap, &TempInfo, &TempInfo2);
00353 else
00354 TempInfo.Height = TempInfo.Width = 8;
00355
00356 fWidthBmp = (geFloat)TempInfo.Width;
00357 fHeightBmp = (geFloat)TempInfo.Height;
00358
00359 //
00360 // Clip 2d viewport
00361 //
00362
00363 #if 0
00364 // eaa3 01/14/2001 Right now, you have to pass the camera in.
00365 // ..I'll fix it eventually...
00366 if(!ClipCamera )
00367 {
00368 ClipRect.Top = 0;
00369 ClipRect.Left = 0;
00370 ClipRect.Bottom = CHeight-1;
00371 ClipRect.Right = CWidth-1;
00372 }
00373 else
00374 #endif
00375 geCamera_GetClippingRect( ClipCamera, &ClipRect );
00376
00377 if(!VertUVArray)
00378 VertUVArray = &DefaultUVArray[0];
00379 if(!RGBA_Array)
00380 RGBA_Array = &DefaultRGBA_Array[0];
00381 if(PixelRect)
00382 {
00383 UseRect.Top = PixelRect->Top + ClipRect.Top;
00384 UseRect.Left = PixelRect->Left + ClipRect.Left;
00385 UseRect.Bottom = PixelRect->Bottom + ClipRect.Top;
00386 UseRect.Right = PixelRect->Right + ClipRect.Left;
00387 }
00388 else
00389 {
00390 if(PercentRect)
00391 {
00392 UseRect.Top = ClipRect.Top
00393 + (int32)(0.01f * PercentRect->Top
00394 * (ClipRect.Bottom - ClipRect.Top));
00395 UseRect.Left = ClipRect.Left
00396 + (int32)(0.01f * PercentRect->Left
00397 * (ClipRect.Right - ClipRect.Left));
00398 UseRect.Bottom = ClipRect.Bottom
00399 + (int32)(0.01f * PercentRect->Bottom
00400 * (ClipRect.Bottom - ClipRect.Top));
00401 UseRect.Right = ClipRect.Right
00402 + (int32)(0.01f * PercentRect->Right
00403 * (ClipRect.Right - ClipRect.Left));
00404 }
00405 else
00406 {
00407 UseRect = ClipRect;
00408 }
00409 }
00410
00411 vertex[0].x = (geFloat)UseRect.Left;
00412 vertex[0].y = (geFloat)UseRect.Top;
00413 vertex[0].z = 1.0f;
00414 vertex[0].r = RGBA_Array[0].r;
00415 vertex[0].g = RGBA_Array[0].g;
00416 vertex[0].b = RGBA_Array[0].b;
00417 vertex[0].a = RGBA_Array[0].a;
00418 vertex[0].u = VertUVArray[0].X + UVbreak/fWidthBmp;
00419 vertex[0].v = VertUVArray[0].Y + UVbreak/fHeightBmp;
00420
00421 vertex[1].x = (geFloat)UseRect.Right;
00422 vertex[1].y = (geFloat)UseRect.Top;
00423 vertex[1].z = vertex[0].z;
00424 vertex[1].r = RGBA_Array[1].r;
00425 vertex[1].g = RGBA_Array[1].g;
00426 vertex[1].b = RGBA_Array[1].b;
00427 vertex[1].a = RGBA_Array[1].a;
00428 vertex[1].u = VertUVArray[1].X - UVbreak/fWidthBmp;
00429 vertex[1].v = VertUVArray[1].Y + UVbreak/fHeightBmp;
00430
00431 vertex[2].x = (geFloat)UseRect.Right;
00432 vertex[2].y = (geFloat)UseRect.Bottom;
00433 vertex[2].z = vertex[0].z;
00434 vertex[2].r = RGBA_Array[2].r;
00435 vertex[2].g = RGBA_Array[2].g;
00436 vertex[2].b = RGBA_Array[2].b;
00437 vertex[2].a = RGBA_Array[2].a;
00438 vertex[2].u = VertUVArray[2].X - UVbreak/fWidthBmp;
00439 vertex[2].v = VertUVArray[2].Y - UVbreak/fHeightBmp;
00440
00441 vertex[3].x = (geFloat)UseRect.Left;
00442 vertex[3].y = (geFloat)UseRect.Bottom;
00443 vertex[3].z = vertex[0].z;
00444 vertex[3].r = RGBA_Array[3].r;
00445 vertex[3].g = RGBA_Array[3].g;
00446 vertex[3].b = RGBA_Array[3].b;
00447 vertex[3].a = RGBA_Array[3].a;
00448 vertex[3].u = VertUVArray[3].X + UVbreak/fWidthBmp;
00449 vertex[3].v = VertUVArray[3].Y - UVbreak/fHeightBmp;
00450
00451 if(vertex[0].x < ClipRect.Left )
00452 {
00453 if(vertex[1].x <= ClipRect.Left )
00454 {
00455 geErrorLog_AddString(-1, "Clipping Rect has negative dimension",
00456 NULL);
00457 return GE_FALSE;
00458 }
00459 fUVAdd = ( ClipRect.Left - vertex[0].x ) / fWidthBmp;
00460 fWidthBmp -= ( ClipRect.Left - vertex[0].x );
00461 vertex[0].u += fUVAdd;
00462 vertex[3].u = vertex[0].u;
00463 vertex[0].x = (geFloat)ClipRect.Left;
00464 vertex[3].x = vertex[0].x;
00465 }
00466
00467 if( vertex[0].y < ClipRect.Top )
00468 {
00469 if( vertex[2].y <= ClipRect.Top )
00470 {
00471 geErrorLog_AddString(-1, "Clipping Rect has negative dimension",
00472 NULL);
00473 return GE_FALSE;
00474 }
00475 fUVAdd = ( ClipRect.Top - vertex[0].y ) / fHeightBmp;
00476 fHeightBmp -= ( ClipRect.Top - vertex[0].y );
00477 vertex[0].v += fUVAdd;
00478 vertex[1].v = vertex[0].v;
00479 vertex[0].y = (geFloat)ClipRect.Top;
00480 vertex[1].y = vertex[0].y;
00481 }
00482
00483 if(vertex[1].x > ClipRect.Right )
00484 {
00485 if( vertex[0].x >= ClipRect.Right )
00486 {
00487 geErrorLog_AddString(-1, "Clipping Rect has negative dimension",
00488 NULL);
00489 return GE_FALSE;
00490 }
00491 fUVAdd = ( vertex[1].x - ClipRect.Right ) / fWidthBmp;
00492 vertex[1].u -= fUVAdd;
00493 vertex[2].u = vertex[1].u;
00494 vertex[1].x = (geFloat)ClipRect.Right - 1;
00495 vertex[2].x = vertex[1].x;
00496 }
00497
00498 if( vertex[2].y > ClipRect.Bottom )
00499 {
00500 if( vertex[0].y >= ClipRect.Bottom )
00501 {
00502 geErrorLog_AddString(-1, "Clipping Rect has negative dimension",
00503 NULL);
00504 return GE_FALSE;
00505 }
00506 fUVAdd = ( vertex[2].y - ClipRect.Bottom ) / fHeightBmp;
00507 vertex[2].v -= fUVAdd;
00508 vertex[3].v = vertex[2].v;
00509 vertex[2].y = (geFloat)ClipRect.Bottom - 1;
00510 vertex[3].y = vertex[2].y;
00511 }
00512
00513 geEngine_RenderPoly( Engine,
00514 vertex,
00515 4,
00516 pBitmap,
00517 ( Alpha != 255 ? DRV_RENDER_ALPHA : 0 ) |
00518 DRV_RENDER_CLAMP_UV | DRV_RENDER_FLUSH |
00519 DRV_RENDER_NO_ZMASK | DRV_RENDER_NO_ZWRITE );
00520
00521 return GE_TRUE;
00522 }
|
|
||||||||||||||||||||||||
|
Definition at line 737 of file engine.c.
00740 {
00741 geRDriver_THandle * TH;
00742 geBoolean Ret;
00743
00744 //#pragma message("make geRect the same as RECT, or don't use RECT!?")
00745 // The drivers once did not include genesis .h's
00746 // (D3D uses RECT so thats why the drivers adopted RECT's...)
00747 #pragma message("Engine : Make the drivers use geRect, JP")
00748
00749 assert(Engine);
00750 assert(Bitmap);
00751
00752 assert(Engine->AttachedBitmaps);
00753 assert(BitmapList_Has(Engine->AttachedBitmaps, (geBitmap *)Bitmap) == GE_TRUE);
00754
00755 TH = geBitmap_GetTHandle(Bitmap);
00756 assert(TH);
00757
00758 //Ret = Engine->DriverInfo.RDriver->Drawdecal(TH,(RECT *)Source,x,y);
00759
00760 if (Source) // Source CAN be NULL!!!
00761 {
00762 RECT rect;
00763
00764 rect.left = Source->Left;
00765 rect.top = Source->Top;
00766 rect.right = Source->Right;
00767 rect.bottom = Source->Bottom;
00768
00769 Ret = Engine->DriverInfo.RDriver->DrawDecal(TH, &rect, x,y);
00770 }
00771 else
00772 Ret = Engine->DriverInfo.RDriver->DrawDecal(TH, NULL, x,y);
00773
00774 if ( ! Ret )
00775 {
00776 geErrorLog_AddString(-1,"geEngine_DrawBitmap : DrawDecal failed", NULL);
00777 }
00778
00779 return Ret;
00780 }
|
|
|
Definition at line 564 of file engine.c.
00565 {
00566 assert(Engine);
00567
00568 return (geDriver_System*)&Engine->DriverInfo;
00569 }
|
|
||||||||||||
|
Definition at line 87 of file engine.c.
00088 {
00089 assert(Engine);
00090 assert(Gamma);
00091
00092 *Gamma = Engine->CurrentGamma;
00093
00094 return GE_TRUE;//Engine->DriverInfo.RDriver->GetGamma(Gamma);
00095 }
|
|
||||||||||||
|
Definition at line 1008 of file engine.c. References Engine, ENGINE_MAX_WORLDS, GE_FALSE, GE_TRUE, geBoolean, int32, geEngine_WorldList::RefCount, geEngine_WorldList::World, and geEngine::WorldList. Referenced by geEngine_RenderWorld().
01009 {
01010 int32 i;
01011 const geEngine_WorldList *pWorldList;
01012
01013 assert(Engine);
01014 assert(World);
01015
01016 // Try to find it in the list
01017 pWorldList = Engine->WorldList;
01018 for (i=0; i< ENGINE_MAX_WORLDS; i++, pWorldList++)
01019 {
01020 if (pWorldList->World == World)
01021 {
01022 assert(pWorldList->RefCount > 0);
01023 return GE_TRUE;
01024 }
01025 }
01026
01027 return GE_FALSE;
01028 }
|
|
|
Definition at line 1309 of file engine.c. References geVFile_MemoryContext::Data, geVFile_MemoryContext::DataLength, Engine, font_bmp, font_bmp_length, Sys_FontInfo::FontBitmap, geEngine::FontInfo, Sys_FontInfo::FontLUT1, GE_FALSE, GE_PIXELFORMAT_8BIT_GRAY, GE_TRUE, GE_VFILE_OPEN_READONLY, GE_VFILE_TYPE_MEMORY, geBitmap_BlitBitmap(), geBitmap_Create(), geBitmap_CreateFromFile(), geBitmap_Destroy(), geBitmap_Height(), geBitmap_SetAlpha(), geBitmap_SetColorKey(), geBitmap_Width(), geBoolean, geEngine_AddBitmap(), geErrorLog_AddString, geVFile_Close(), geVFile_OpenNewSystem(), and NULL. Referenced by Sys_EngineCreate().
01310 {
01311 Sys_FontInfo *Fi;
01312
01313 assert(Engine);
01314
01315 Fi = &Engine->FontInfo;
01316
01317 assert(Fi->FontBitmap == NULL);
01318
01319 // Load the bitmap
01320 {
01321 geVFile * MemFile;
01322 geVFile_MemoryContext Context;
01323
01324 {
01325 extern unsigned char font_bmp[];
01326 extern int font_bmp_length;
01327
01328 Context.Data = font_bmp;
01329 Context.DataLength = font_bmp_length;
01330
01331 MemFile = geVFile_OpenNewSystem(NULL, GE_VFILE_TYPE_MEMORY, NULL, &Context, GE_VFILE_OPEN_READONLY);
01332 }
01333
01334 if (!MemFile)
01335 {
01336 geErrorLog_AddString(-1,"InitFonts : geVFile_OpenNewSystem Memory fontbmp failed.", NULL);
01337 return GE_FALSE;
01338 }
01339
01340 if ( ! (Fi->FontBitmap = geBitmap_CreateFromFile(MemFile)) )
01341 {
01342 geErrorLog_AddString(-1,"InitFonts : geBitmap_CreateFromFile failed.", NULL);
01343 goto fail;
01344 }
01345
01346 #if 0
01347 #pragma message("Engine : fonts will have alpha once Decals do : CB");
01348 // <> CB : give fonts alpha so they look purty
01349 // pointless right now cuz we don't get enum'ed a _2D_ type with alpha
01350 {
01351 geBitmap * FontAlpha;
01352 FontAlpha = geBitmap_Create( geBitmap_Width(Fi->FontBitmap), geBitmap_Height(Fi->FontBitmap), 1, GE_PIXELFORMAT_8BIT_GRAY );
01353 if ( FontAlpha )
01354 {
01355 if ( geBitmap_BlitBitmap(Fi->FontBitmap,FontAlpha) )
01356 {
01357 if ( ! geBitmap_SetAlpha( Fi->FontBitmap, FontAlpha ) )
01358 {
01359 geErrorLog_AddString(-1,"InitFonts : SetAlpha failed : non-fatal", NULL);
01360 }
01361 }
01362 else
01363 {
01364 geErrorLog_AddString(-1,"InitFonts : BlitBitmap failed : non-fatal", NULL);
01365 }
01366 geBitmap_Destroy(&FontAlpha);
01367 }
01368 }
01369 #endif
01370
01371 if (!geBitmap_SetColorKey(Fi->FontBitmap, GE_TRUE, 0, GE_FALSE))
01372 {
01373 geErrorLog_AddString(-1,"InitFonts : geBitmap_SetColorKey failed.", NULL);
01374 goto fail;
01375 }
01376
01377 if ( ! geEngine_AddBitmap(Engine,Fi->FontBitmap) )
01378 {
01379 geErrorLog_AddString(-1,"InitFonts : geEngine_AddBitmap failed.", NULL);
01380 goto fail;
01381 }
01382
01383 goto success;
01384
01385 fail:
01386
01387 geVFile_Close(MemFile);
01388 return GE_FALSE;
01389
01390 success:
01391
01392 geVFile_Close(MemFile);
01393 }
01394
01395 //
01396 // Setup font lookups
01397 //
01398 {
01399 int PosX, PosY, Width, i;
01400
01401 PosX = 0;
01402 PosY = 0;
01403 Width = 128*8;
01404
01405 for (i=0; i< 128; i++)
01406 {
01407 Fi->FontLUT1[i] = (PosX<<16) | PosY;
01408 PosX+=8;
01409
01410 if (PosX >= Width)
01411 {
01412 PosY += 14;
01413 PosX = 0;
01414 }
01415 }
01416 }
01417
01418 return GE_TRUE;
01419 }
|
|
||||||||||||
|
Definition at line 1462 of file engine.c. References HINSTANCE, and NULL. Referenced by Engine_InitDriver(), and EnumSubDrivers().
01463 {
01464 char Buff[_MAX_PATH];
01465 char *StrEnd;
01466 HINSTANCE Library;
01467
01468 //-------------------------
01469 strcpy(Buff, DriverDirectory);
01470 StrEnd = Buff + strlen(Buff) - 1;
01471 if ( *StrEnd != '\\' && *StrEnd != '/' && *StrEnd != ':' )
01472 {
01473 strcat(Buff,"\\");
01474 }
01475 strcat(Buff, lpLibFileName);
01476 Library = LoadLibrary(Buff);
01477 if ( Library )
01478 return Library;
01479
01480 #pragma message("Engine : LoadLibrary : need geConfig_GetDriverDir")
01481 #ifdef LOADLIBRARY_HARDCODES
01482 #pragma message("Engine : using LoadLibrary HardCodes : curdir, q:\\genesis, c:\\genesis")
01483
01484 //-------------------------
01485
01486 getcwd(Buff,_MAX_PATH);
01487 StrEnd = Buff + strlen(Buff) - 1;
01488 if ( *StrEnd != '\\' && *StrEnd != '/' && *StrEnd != ':' )
01489 {
01490 strcat(Buff,"\\");
01491 }
01492 strcat(Buff, lpLibFileName);
01493 Library = LoadLibrary(Buff);
01494 if ( Library )
01495 return Library;
01496
01497 //-------------------------
01498
01499 strcpy(Buff, "q:\\genesis");
01500 StrEnd = Buff + strlen(Buff) - 1;
01501 if ( *StrEnd != '\\' && *StrEnd != '/' && *StrEnd != ':' )
01502 {
01503 strcat(Buff,"\\");
01504 }
01505 strcat(Buff, lpLibFileName);
01506 Library = LoadLibrary(Buff);
01507 if ( Library )
01508 return Library;
01509
01510 //-------------------------
01511
01512 strcpy(Buff, "c:\\genesis");
01513 StrEnd = Buff + strlen(Buff) - 1;
01514 if ( *StrEnd != '\\' && *StrEnd != '/' && *StrEnd != ':' )
01515 {
01516 strcat(Buff,"\\");
01517 }
01518 strcat(Buff, lpLibFileName);
01519 Library = LoadLibrary(Buff);
01520 if ( Library )
01521 return Library;
01522 #endif
01523
01524 return NULL;
01525 }
|
|
|
Definition at line 964 of file engine.c. References Sys_DriverInfo::Active, geEngine::Changed, geEngine::DriverInfo, Engine, ENGINE_MAX_WORLDS, GE_FALSE, GE_TRUE, geBoolean, geEngine_RebuildFastWorldList(), geErrorLog_AddString, geWorld_DetachAll(), geWorld_Free(), int32, NULL, geWorld::RefCount, geEngine_WorldList::RefCount, geEngine_WorldList::World, and geEngine::WorldList. Referenced by Sys_EngineFree().
00965 {
00966 int32 i;
00967 geEngine_WorldList *pWorldList;
00968 geWorld *World;
00969
00970 assert(Engine);
00971
00972 // Try to find it in the list
00973 pWorldList = Engine->WorldList;
00974 for (i=0; i< ENGINE_MAX_WORLDS; i++, pWorldList++)
00975 {
00976 World = pWorldList->World;
00977 if ( World )
00978 {
00979 assert(pWorldList->RefCount > 0);
00980
00981 if (Engine->DriverInfo.Active)
00982 {
00983 if (!geWorld_DetachAll(World))
00984 {
00985 geErrorLog_AddString(-1, "geEngine_RemoveWorld: geWorld_DetachAll failed.", NULL);
00986 return GE_FALSE;
00987 }
00988 }
00989
00990 assert( World->RefCount >= 1 );
00991
00992 // Free the world (decrease it's reference count)
00993 geWorld_Free(World);
00994 }
00995 memset(pWorldList, 0, sizeof(*pWorldList));
00996 }
00997
00998 // Force an update
00999 geEngine_RebuildFastWorldList(Engine);
01000 Engine->Changed = GE_TRUE;
01001
01002 return GE_TRUE;
01003 }
|
|
||||||||||||
|
Definition at line 885 of file engine.c.
00886 {
00887 int32 i;
00888 geEngine_WorldList *pWorldList;
00889
00890 assert(Engine);
00891 assert(World);
00892
00893 // Try to find it in the list
00894 pWorldList = Engine->WorldList;
00895 for (i=0; i< ENGINE_MAX_WORLDS; i++, pWorldList++)
00896 {
00897 if (pWorldList->World == World)
00898 break;
00899 }
00900
00901 if (i == ENGINE_MAX_WORLDS)
00902 {
00903 geErrorLog_AddString(-1, "geEngine_RemoveWorld: World not found.", NULL);
00904 return GE_FALSE;
00905 }
00906
00907 assert(pWorldList->RefCount > 0);
00908
00909 // Decrease the reference count on the worldlist
00910 pWorldList->RefCount--;
00911
00912 // When the ref count gos to zero, remove the world for good
00913 if (pWorldList->RefCount == 0)
00914 {
00915
00916 #ifdef DO_ADDREMOVE_MESSAGES
00917 {
00918 char str[100];
00919 sprintf(str,"Engine_RemoveWorld : %08X : removed\n",World);
00920 OutputDebugString(str);
00921 }
00922 #endif
00923
00924 // Detach all the bitmaps in the world before finally removing it
00925 if (Engine->DriverInfo.Active)
00926 {
00927 if (!geWorld_DetachAll(World))
00928 {
00929 geErrorLog_AddString(-1, "geEngine_RemoveWorld: geWorld_DetachAll failed.", NULL);
00930 return GE_FALSE;
00931 }
00932 }
00933
00934 // Clear this pWorldList slot
00935 memset(pWorldList, 0, sizeof(*pWorldList));
00936
00937 // Re-build the fast list of worlds
00938 geEngine_RebuildFastWorldList(Engine);
00939
00940 // Force an update
00941 Engine->Changed = GE_TRUE;
00942
00943 // Free the world (decrease it's reference count)
00944 geWorld_Free(World);
00945 }
00946 else
00947 {
00948 #ifdef DO_ADDREMOVE_MESSAGES
00949 {
00950 char str[100];
00951 sprintf(str,"Engine_RemoveWorld : %08X : left\n",World);
00952 OutputDebugString(str);
00953 }
00954 #endif
00955 }
00956
00957 return GE_TRUE;
00958 }
|
|
||||||||||||||||||||||||
|
Definition at line 663 of file engine.c.
00665 {
00666 geBoolean Ret;
00667
00668 assert(Engine && Points );
00669
00670 if ( Texture )
00671 {
00672 geRDriver_THandle * TH;
00673
00674 // assert(World);
00675 // assert(geEngine_HasWorld(Engine, World) == GE_TRUE);
00676 // assert(World->AttachedBitmaps);
00677 // assert(BitmapList_Has(World->AttachedBitmaps, (geBitmap*)Texture) == GE_TRUE);
00678
00679 TH = geBitmap_GetTHandle(Texture);
00680 assert(TH);
00681
00682 Ret = Engine->DriverInfo.RDriver->RenderMiscTexturePoly((DRV_TLVertex *)Points,
00683 NumPoints,TH,Flags);
00684 }
00685 else
00686 {
00687 Ret = Engine->DriverInfo.RDriver->RenderGouraudPoly((DRV_TLVertex *)Points,
00688 NumPoints,Flags);
00689 }
00690
00691 assert(Ret == GE_TRUE);
00692 }
|
|
||||||||||||||||||||||||||||
|
Definition at line 694 of file engine.c.
00696 {
00697 geBoolean Ret;
00698 int pn;
00699 DRV_Driver * Driver;
00700
00701 assert(Engine && pPoints && pNumPoints );
00702
00703 Driver = Engine->DriverInfo.RDriver;
00704 assert(Driver);
00705
00706 if ( Texture )
00707 {
00708 geRDriver_THandle * TH;
00709
00710 TH = geBitmap_GetTHandle(Texture);
00711 assert(TH);
00712
00713 for(pn=0;pn<NumPolys;pn++)
00714 {
00715 assert(pPoints[pn]);
00716 Ret = Driver->RenderMiscTexturePoly((DRV_TLVertex *)pPoints[pn],
00717 pNumPoints[pn],TH,Flags);
00718 assert(Ret);
00719 }
00720 }
00721 else
00722 {
00723 for(pn=0;pn<NumPolys;pn++)
00724 {
00725 assert(pPoints[pn]);
00726 Ret = Driver->RenderGouraudPoly((DRV_TLVertex *)pPoints[pn],
00727 pNumPoints[pn],Flags);
00728 assert(Ret);
00729 }
00730 }
00731
00732 }
|
|
|
Definition at line 1282 of file engine.c. References geEngine::DriverInfo, Engine, GE_FALSE, GE_TRUE, geBoolean, geEngine_DetachAll(), geEngine_UpdateFogEnable(), geErrorLog_AddString, NULL, Sys_DriverInfo::RDriver, and DRV_Driver::Reset. Referenced by geEngine_Prep(), and geEngine_ShutdownDriver().
01283 {
01284 assert(Engine != NULL);
01285 assert(Engine->DriverInfo.RDriver);
01286
01287 // To be safe, detach all things from the current driver
01288 if (!geEngine_DetachAll(Engine))
01289 {
01290 geErrorLog_AddString(-1, "geEngine_ResetDriver: geEngine_DetachAll failed.", NULL);
01291 return GE_FALSE;
01292 }
01293
01294 // Reset the driver
01295 if (!Engine->DriverInfo.RDriver->Reset())
01296 {
01297 geErrorLog_AddString(-1, "geEngine_ResetDriver: Engine->DriverInfo.RDriver->Reset() failed.", NULL);
01298 return GE_FALSE;
01299 }
01300
01301 geEngine_UpdateFogEnable(Engine);
01302
01303 return GE_TRUE;
01304 }
|
|
||||||||||||
|
Definition at line 1450 of file engine.c. References geWorld::Changed, Engine, int32, geEngine::NumWorlds, and geEngine::Worlds. Referenced by geEngine_Prep(), and geEngine_SetDriverAndMode().
|
|
||||||||||||||||
|
Definition at line 527 of file engine.c.
00530 {
00531 assert(Engine);
00532 assert(Driver);
00533 assert(DriverMode);
00534
00535 // init calls _Reset and eventually it gets down and Detaches all
00536
00537 // Set up the Render Driver
00538 if (!Engine_InitDriver(Engine, Driver, DriverMode))
00539 return GE_FALSE;
00540
00541 // Force a Driver update
00542 geEngine_SetAllWorldChangedFlag(Engine, GE_TRUE);
00543 Engine->Changed = GE_TRUE;
00544
00545 geEngine_UpdateGamma(Engine);
00546 geEngine_UpdateFogEnable(Engine);
00547
00548 //#ifdef DONT_DO_SPLASH
00549 #ifdef _DEBUG
00550 #pragma message("Engine :splash screen disabled")
00551 Engine = Engine;
00552 #else
00553 // Do the splash screen
00554 if (DoSplashScreen(Engine, DriverMode) == GE_FALSE)
00555 return GE_FALSE;
00556 #endif
00557
00558 return GE_TRUE;
00559 }
|
|
||||||||||||||||||||||||||||||||
|
Definition at line 118 of file engine.c.
|
|
||||||||||||
|
Definition at line 67 of file engine.c.
00068 {
00069 assert(Engine);
00070
00071 if ( Gamma < 0.01f )
00072 Gamma = 0.01f;
00073
00074 if ( ABS( Engine->CurrentGamma - Gamma) < 0.01f )
00075 return GE_TRUE;
00076
00077 Engine->CurrentGamma = Gamma;
00078
00079 geEngine_UpdateGamma(Engine);
00080
00081 return GE_TRUE;
00082 }
|
|
|
Definition at line 1424 of file engine.c. References Engine, Sys_FontInfo::FontBitmap, geEngine::FontInfo, GE_FALSE, GE_TRUE, geBitmap_Destroy(), geBoolean, geEngine_RemoveBitmap(), geErrorLog_AddString, and NULL. Referenced by Sys_EngineFree().
01425 {
01426 Sys_FontInfo *Fi;
01427
01428 assert(Engine);
01429
01430 Fi = &Engine->FontInfo;
01431
01432 if (Fi->FontBitmap)
01433 {
01434 if (!geEngine_RemoveBitmap(Engine, Fi->FontBitmap))
01435 {
01436 geErrorLog_AddString(-1, "geEngine_ShutdownFonts: geEngine_RemoveBitmap failed.", NULL);
01437 return GE_FALSE;
01438 }
01439
01440 geBitmap_Destroy(&Fi->FontBitmap);
01441 }
01442
01443 return GE_TRUE;
01444 }
|
|
|
Definition at line 132 of file engine.c. References ABS, geWorld::AttachedBitmaps, geEngine::AttachedBitmaps, geEngine::BitmapGamma, BitmapList_SetGamma(), DRV_EngineSettings::CanSupportFlags, geEngine::CurrentGamma, geEngine::DriverInfo, DRV_SUPPORT_GAMMA, Engine, DRV_Driver::EngineSettings, geErrorLog_AddString, geFloat, NULL, geEngine::NumWorlds, Sys_DriverInfo::RDriver, DRV_Driver::SetGamma, and geEngine::Worlds. Referenced by geEngine_SetDriverAndMode(), and geEngine_SetGamma().
00133 {
00134 DRV_Driver * RDriver;
00135 geFloat LastBitmapGamma;
00136
00137 assert(Engine);
00138
00139 RDriver = Engine->DriverInfo.RDriver;
00140
00141 LastBitmapGamma = Engine->BitmapGamma;
00142
00143 if ( RDriver && (RDriver->EngineSettings->CanSupportFlags & DRV_SUPPORT_GAMMA) )
00144 {
00145 if ( RDriver->SetGamma(Engine->CurrentGamma) )
00146 Engine->BitmapGamma = 1.0f;
00147 else
00148 Engine->BitmapGamma = Engine->CurrentGamma;
00149 }
00150 else
00151 {
00152 Engine->BitmapGamma = Engine->CurrentGamma;
00153 }
00154
00155 if ( ABS(Engine->BitmapGamma - LastBitmapGamma) < 0.1f )
00156 {
00157 Engine->BitmapGamma = LastBitmapGamma;
00158 }
00159 else
00160 {
00161 int i;
00162
00163 // Attach all the bitmaps for the engine
00164 if (!BitmapList_SetGamma(Engine->AttachedBitmaps, Engine->BitmapGamma))
00165 {
00166 geErrorLog_AddString(-1, "geEngine_UpdateGamma: BitmapList_SetGamma for Engine failed", NULL);
00167 }
00168
00169 for (i=0; i< Engine->NumWorlds; i++)
00170 {
00171 // <> sleazy to peak into World like this
00172 if (!BitmapList_SetGamma(Engine->Worlds[i]->AttachedBitmaps, Engine->BitmapGamma ))
00173 {
00174 geErrorLog_AddString(-1, "geEngine_UpdateGamma: BitmapList_SetGamma for World failed", NULL);
00175 }
00176 }
00177 }
00178
00179 }
|
1.3.2