Main Page | Alphabetical List | Compound List | File List | Compound Members | File Members

Fog.c File Reference

#include <Windows.h>
#include <Assert.h>
#include "Fog.h"

Go to the source code of this file.

Functions

GENESISAPI geFoggeFog_Create (SET_ATTR_CB *SetAttrCB)
GENESISAPI void geFog_Destroy (geFog *Fog)
GENESISAPI geBoolean geFog_SetAttributes (geFog *Fog, const geVec3d *Pos, GE_RGBA *Color, geFloat LightBrightness, geFloat VolumeBrightness, geFloat VolumeRadius)
GENESISAPI geBoolean geFog_SetUserData (geFog *Fog, void *UserData)
GENESISAPI void * geFog_GetUserData (geFog *Fog)


Function Documentation

GENESISAPI geFog* geFog_Create SET_ATTR_CB SetAttrCB  ) 
 

Definition at line 30 of file Fog.c.

References GE_ERR_OUT_OF_MEMORY, GE_RAM_ALLOCATE_STRUCT, geErrorLog_Add, GENESISAPI, NULL, and geFog::SetAttrCB.

Referenced by geWorld_AddFog().

00031 {
00032         geFog   *Fog;
00033 
00034         Fog = GE_RAM_ALLOCATE_STRUCT(geFog);
00035 
00036         if (!Fog)
00037         {
00038                 geErrorLog_Add(GE_ERR_OUT_OF_MEMORY, NULL);
00039                 return NULL;
00040         }
00041 
00042         memset(Fog, 0, sizeof(geFog));
00043 
00044         if (SetAttrCB)
00045                 Fog->SetAttrCB = SetAttrCB;
00046         
00047         return Fog;
00048 }

GENESISAPI void geFog_Destroy geFog Fog  ) 
 

Definition at line 53 of file Fog.c.

References GENESISAPI, and geRam_Free.

Referenced by geWorld_Free(), and geWorld_RemoveFog().

00054 {
00055         assert(Fog);
00056 
00057         geRam_Free(Fog);
00058 }

GENESISAPI void* geFog_GetUserData geFog Fog  ) 
 

Definition at line 105 of file Fog.c.

References GENESISAPI, and geFog::UserData.

Referenced by geFog_SetAttributesCB(), geWorld_Free(), geWorld_RemoveFog(), and VisFog().

00106 {
00107         assert(Fog);
00108 
00109         return Fog->UserData;
00110 }

GENESISAPI geBoolean geFog_SetAttributes geFog Fog,
const geVec3d Pos,
GE_RGBA Color,
geFloat  LightBrightness,
geFloat  VolumeBrightness,
geFloat  VolumeRadius
 

Definition at line 63 of file Fog.c.

References GE_RGBA::b, geFog::Color, GE_RGBA::g, GE_FALSE, GE_TRUE, geBoolean, GENESISAPI, geFog::LightBrightness, geFog::Pos, GE_RGBA::r, geFog::SetAttrCB, geFog::VolumeBrightness, geFog::VolumeRadius, geFog::VolumeRadius2, and geFog::VolumeRadiusSquared.

Referenced by CreateStaticFogList().

00069 {
00070         Fog->Pos = *Pos;
00071         Fog->Color.r = Color->r*(1.0f/255.0f)*(1<<8);
00072         Fog->Color.g = Color->g*(1.0f/255.0f)*(1<<8);
00073         Fog->Color.b = Color->b*(1.0f/255.0f)*(1<<8);
00074         Fog->LightBrightness = LightBrightness;
00075         Fog->VolumeBrightness = VolumeBrightness;
00076         Fog->VolumeRadius = VolumeRadius;
00077         Fog->VolumeRadiusSquared = VolumeRadius*VolumeRadius;
00078         Fog->VolumeRadius2 = VolumeRadius*2;
00079 
00080         // Now that all is set, call the CB if it exist...
00081         if (Fog->SetAttrCB)
00082         {
00083                 if (!Fog->SetAttrCB(Fog))
00084                         return GE_FALSE;
00085         }
00086 
00087         return GE_TRUE;
00088 }

GENESISAPI geBoolean geFog_SetUserData geFog Fog,
void *  UserData
 

Definition at line 93 of file Fog.c.

References GE_TRUE, geBoolean, GENESISAPI, and geFog::UserData.

Referenced by geWorld_AddFog(), geWorld_Free(), and geWorld_RemoveFog().

00094 {
00095         assert(Fog);
00096 
00097         Fog->UserData = UserData;
00098 
00099         return GE_TRUE;
00100 }


Generated on Tue Sep 30 12:37:31 2003 for GTestAndEngine by doxygen 1.3.2