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

Genvsi.c File Reference

#include <Windows.h>
#include <Assert.h>
#include <stdio.h>
#include "GenVSI.h"
#include "Genesis.h"

Go to the source code of this file.

Functions

void GenVSI_SetClassSpawn (GenVSI *VSI, const char *ClassName, GenVSI_SpawnFunc *Func, GenVSI_DestroyFunc *DFunc)
void GenVSI_SetWorld (GenVSI *VSI, GenVSI_NewWorldCB *NewWorldCB, GenVSI_ShutdownWorldCB *ShutdownWorldCB, const char *WorldName)
void GenVSI_ActorIndex (GenVSI *VSI, uint16 Index, const char *GFXPath, const char *FileName)
void GenVSI_MotionIndex (GenVSI *VSI, uint16 Index, const char *MotionName)
void GenVSI_BoneIndex (GenVSI *VSI, uint16 Index, const char *BoneName)
void GenVSI_TextureIndex (GenVSI *VSI, uint16 Index, const char *TextureName, const char *ATextureName)
void GenVSI_SoundIndex (GenVSI *VSI, uint16 Index, const char *FileName)
void GenVSI_PlaySound (GenVSI *VSI, uint16 Index, const geVec3d *Pos)
void GenVSI_SpawnFx (GenVSI *VSI, uint8 FxNum, const geVec3d *Pos, uint8 SoundIndex)
void * GenVSI_GetPlayerClientData (GenVSI *VSI, GenVSI_CHandle ClientHandle)
void GenVSI_SetClientScore (GenVSI *VSI, GenVSI_CHandle ClientHandle, int32 Score)
void GenVSI_SetClientHealth (GenVSI *VSI, GenVSI_CHandle ClientHandle, int32 Health)
void GenVSI_SetClientWeapon (GenVSI *VSI, GenVSI_CHandle ClientHandle, int32 Weapon)
void GenVSI_SetClientInventory (GenVSI *VSI, GenVSI_CHandle ClientHandle, int32 Slot, uint16 Amount, geBoolean HasItem)
geBoolean GenVSI_IsClientBot (GenVSI *VSI, GenVSI_CHandle ClientHandle)
geBoolean GenVSI_ClientDisconnect (GenVSI *VSI, GenVSI_CHandle ClientHandle)
GenVSI_CMoveGenVSI_GetClientMove (GenVSI *VSI, GenVSI_CHandle ClientHandle)
uint16 GenVSI_ModelToViewIndex (GenVSI *VSI, geWorld_Model *Model)
void GenVSI_RegisterPlayerModel (GenVSI *VSI, void *PlayerData, geWorld_Model *Model)
void * GenVSI_GetNextPlayer (GenVSI *VSI, void *Start, const char *ClassName)
void * GenVSI_GetNextPlayerInRadius (GenVSI *VSI, void *PlayerData, void *Start, const char *ClassName, float Radius)
void GenVSI_SetViewPlayer (GenVSI *VSI, GenVSI_CHandle ClientHandle, void *PlayerData)
geBoolean GenVSI_MovePlayerModel (GenVSI *VSI, void *PlayerData, const geXForm3d *DestXForm)
void GenVSI_GetPlayerTimeExtents (GenVSI *VSI, void *PlayerData, uint16 MotionIndex, float *Start, float *End)
void * GenVSI_ActorToPlayer (GenVSI *VSI, geActor *Actor)
geWorldGenVSI_GetWorld (GenVSI *VSI)
void GenVSI_ConsolePrintf (GenVSI *VSI, const char *Str,...)
void GenVSI_ConsoleHeaderPrintf (GenVSI *VSI, int32 ClientHandle, geBoolean AllClients, const char *Str,...)
float GenVSI_GetTime (GenVSI *VSI)
void * GenVSI_SpawnPlayer (GenVSI *VSI, const char *ClassName)
void GenVSI_DestroyPlayer (GenVSI *VSI, void *PlayerData)
void GenVSI_ProcIndex (GenVSI *VSI, uint16 Index, void *Proc)


Function Documentation

void GenVSI_ActorIndex GenVSI VSI,
uint16  Index,
const char *  GFXPath,
const char *  FileName
 

Definition at line 53 of file Genvsi.c.

References GenVSI::ActorIndex, and GenVSI::UData.

Referenced by SetupWorldCB().

00054 {
00055         if (!VSI->ActorIndex)
00056                 return;
00057 
00058         VSI->ActorIndex(VSI->UData, Index, GFXPath, FileName);
00059 }

void* GenVSI_ActorToPlayer GenVSI VSI,
geActor Actor
 

Definition at line 315 of file Genvsi.c.

References GenVSI::ActorToPlayer, NULL, and GenVSI::UData.

Referenced by Blaster_Control(), Bot_GetContents(), Client_Control(), FireShredder(), Grenade_Control(), Rocket_Control(), SelfCollisionCB(), and SelfCollisionCB2().

00316 {
00317         if (!VSI->ActorToPlayer)
00318                 return NULL;
00319 
00320         return VSI->ActorToPlayer(VSI->UData, Actor);
00321 }

void GenVSI_BoneIndex GenVSI VSI,
uint16  Index,
const char *  BoneName
 

Definition at line 75 of file Genvsi.c.

References GenVSI::BoneIndex, and GenVSI::UData.

Referenced by SetupWorldCB().

00076 {
00077         if (!VSI->BoneIndex)
00078                 return;
00079 
00080         VSI->BoneIndex(VSI->UData, Index, BoneName);
00081 }

geBoolean GenVSI_ClientDisconnect GenVSI VSI,
GenVSI_CHandle  ClientHandle
 

Definition at line 212 of file Genvsi.c.

References GenVSI::ClientDisconnect, GE_FALSE, geBoolean, and GenVSI::UData.

Referenced by Game_SpawnBot().

00213 {
00214         if (!VSI->ClientDisconnect)
00215                 return GE_FALSE;
00216 
00217         return VSI->ClientDisconnect(VSI->UData, ClientHandle);
00218 }

void GenVSI_ConsoleHeaderPrintf GenVSI VSI,
int32  ClientHandle,
geBoolean  AllClients,
const char *  Str,
... 
 

Definition at line 355 of file Genvsi.c.

References GenVSI::ConsoleHeaderPrintf, and GenVSI::UData.

Referenced by Bot_Keys(), Item_TriggerArmor(), Item_TriggerGrenade(), Item_TriggerGrenadeAmmo(), Item_TriggerHealth(), Item_TriggerRocket(), Item_TriggerRocketAmmo(), Item_TriggerShredder(), Item_TriggerShredderAmmo(), and KillPlayer().

00356 {
00357         va_list         ArgPtr;
00358     char                TempStr[256];
00359 
00360         if (!VSI->ConsoleHeaderPrintf)
00361                 return;
00362 
00363         assert(VSI);
00364         assert(Str);
00365 
00366         va_start (ArgPtr, Str);
00367     vsprintf (TempStr, Str, ArgPtr);
00368         va_end (ArgPtr);
00369 
00370     VSI->ConsoleHeaderPrintf(VSI->UData, ClientHandle, AllClients, TempStr);
00371 }

void GenVSI_ConsolePrintf GenVSI VSI,
const char *  Str,
... 
 

Definition at line 337 of file Genvsi.c.

References GenVSI::ConsolePrintf, and GenVSI::UData.

Referenced by Bot_CheckVelocity(), Bot_ScanCheckVelocity(), CheckVelocity(), FireBlaster(), FireGrenade(), FireRocket(), FireShredder(), and KillPlayer().

00338 {
00339         va_list         ArgPtr;
00340 
00341         if (!VSI->ConsolePrintf)
00342                 return;
00343 
00344         assert(VSI);
00345         assert(Str);
00346 
00347         va_start (ArgPtr, Str);
00348     VSI->ConsolePrintf(VSI->UData, Str, ArgPtr);
00349         va_end (ArgPtr);
00350 }

void GenVSI_DestroyPlayer GenVSI VSI,
void *  PlayerData
 

Definition at line 398 of file Genvsi.c.

References GenVSI::DestroyPlayer, and GenVSI::UData.

Referenced by Blaster_Control(), Bot_ActorDying(), Grenade_Control(), Rocket_Control(), and Shredder_Control().

00399 {
00400         if (!VSI->DestroyPlayer)
00401         {
00402                 assert(!"Bad! No destroy!!!");
00403                 return;
00404         }
00405         
00406         VSI->DestroyPlayer(VSI->UData, PlayerData);
00407 }

GenVSI_CMove* GenVSI_GetClientMove GenVSI VSI,
GenVSI_CHandle  ClientHandle
 

Definition at line 223 of file Genvsi.c.

References GenVSI::GetClientMove, NULL, and GenVSI::UData.

Referenced by Client_Control(), Player_Dying(), and SetupPlayerXForm().

00224 {
00225         if (!VSI->GetClientMove)
00226                 return NULL;
00227 
00228         return VSI->GetClientMove(VSI->UData, ClientHandle);
00229 }

void* GenVSI_GetNextPlayer GenVSI VSI,
void *  Start,
const char *  ClassName
 

Definition at line 260 of file Genvsi.c.

References GenVSI::GetNextPlayer, NULL, and GenVSI::UData.

Referenced by Bot_Destroy(), Bot_FindItem(), Bot_FindRandomItem(), Bot_PickTgtPlayer(), GetBotMatchSpawn(), and GetDMSpawn().

00261 {
00262         if (!VSI->GetNextPlayer)
00263                 return NULL;
00264 
00265         return VSI->GetNextPlayer(VSI->UData, Start, ClassName);
00266 }

void* GenVSI_GetNextPlayerInRadius GenVSI VSI,
void *  PlayerData,
void *  Start,
const char *  ClassName,
float  Radius
 

Definition at line 271 of file Genvsi.c.

References GenVSI::GetNextPlayerInRadius, NULL, and GenVSI::UData.

Referenced by Attacker_ControlTurret(), and RadiusDammage().

00272 {
00273         if (!VSI->GetNextPlayerInRadius)
00274                 return NULL;
00275 
00276         return VSI->GetNextPlayerInRadius(VSI->UData, PlayerData, Start, ClassName, Radius);
00277 }

void* GenVSI_GetPlayerClientData GenVSI VSI,
GenVSI_CHandle  ClientHandle
 

Definition at line 145 of file Genvsi.c.

References GenVSI::GetPlayerClientData, NULL, and GenVSI::UData.

00146 {
00147         if (!VSI->GetPlayerClientData)
00148                 return NULL;
00149 
00150         return VSI->GetPlayerClientData(VSI->UData, ClientHandle);
00151 }

void GenVSI_GetPlayerTimeExtents GenVSI VSI,
void *  PlayerData,
uint16  MotionIndex,
float *  Start,
float *  End
 

Definition at line 304 of file Genvsi.c.

References GenVSI::GetPlayerTimeExtents, and GenVSI::UData.

Referenced by AnimatePlayer(), and AnimatePlayer2().

00305 {
00306         if (!VSI->GetPlayerTimeExtents)
00307                 return;
00308 
00309         VSI->GetPlayerTimeExtents(VSI->UData, PlayerData, MotionIndex, Start, End);
00310 }

float GenVSI_GetTime GenVSI VSI  ) 
 

Definition at line 376 of file Genvsi.c.

References GenVSI::GetTime, and GenVSI::UData.

Referenced by Bot_FireWeapon(), Bot_ShootFoot(), Bot_ShootPoint(), Bot_Suicide(), Bot_TargetTest(), Bot_TrackAction(), Bot_WaitForEntityDist(), Bot_WaitForEntityVisible(), Bot_WaitForPlayer(), FireBlaster(), FireGrenade(), FireRocket(), FireShredder(), FireWeapon(), Item_ControlArmor(), Item_ControlGrenade(), Item_ControlGrenadeAmmo(), Item_ControlHealth(), Item_ControlRocket(), Item_ControlRocketAmmo(), Item_ControlShredder(), Item_ControlShredderAmmo(), Item_TriggerArmor(), Item_TriggerGrenade(), Item_TriggerGrenadeAmmo(), Item_TriggerHealth(), Item_TriggerRocket(), Item_TriggerRocketAmmo(), Item_TriggerShredder(), and Item_TriggerShredderAmmo().

00377 {
00378         if (!VSI->GetTime)
00379                 return 0.0f;
00380 
00381         return VSI->GetTime(VSI->UData);
00382 }

geWorld* GenVSI_GetWorld GenVSI VSI  ) 
 

Definition at line 326 of file Genvsi.c.

References GenVSI::GetWorld, NULL, and GenVSI::UData.

Referenced by Blaster_Control(), Bot_CheckPosition(), Bot_CheckVelocity(), Bot_Control(), Bot_Destroy(), Bot_FindItem(), Bot_FindRandomItem(), Bot_FindTrack(), Bot_FindTrackToGoal(), Bot_GetActorStart(), Bot_GetContents(), Bot_IsActorRespawn(), Bot_MoveFree(), Bot_MoveToPoint(), Bot_NudgePlayer(), Bot_OverLedge(), Bot_OverLedgeScan(), Bot_PickTgtPlayer(), Bot_ScanCheckVelocity(), Bot_ShootPoint(), Bot_TrackAction(), Bot_WaitForEntityDist(), Bot_WaitForEntityVisible(), Bot_WaitForPlayer(), CheckPlayer(), CheckVelocity(), Client_Control(), Door_Control(), Door_Spawn(), FireBlaster(), FireRocket(), FireShredder(), Grenade_Control(), MovePlayerUpStep(), PhysicsObject_Control(), PhysicsObject_Spawn(), Plat_Control(), Plat_Spawn(), Plat_Trigger(), RadiusDammage(), Rocket_Control(), SetupWorldCB(), Track_FindCloseTrack(), Track_FindFarTrack(), Track_FindMultiTrack(), Track_FindTrack(), Track_NextMultiTrack(), and UpdatePlayerContents().

00327 {
00328         if (!VSI->GetWorld)
00329                 return NULL;
00330 
00331         return VSI->GetWorld(VSI->UData);
00332 }

geBoolean GenVSI_IsClientBot GenVSI VSI,
GenVSI_CHandle  ClientHandle
 

Definition at line 201 of file Genvsi.c.

References GE_FALSE, geBoolean, GenVSI::IsClientBot, and GenVSI::UData.

Referenced by Bot_Destroy(), Bot_PickTgtPlayer(), Bot_TargetTest(), DammagePlayer(), and KillPlayer().

00202 {
00203         if (!VSI->IsClientBot)
00204                 return GE_FALSE;
00205 
00206         return VSI->IsClientBot(VSI->UData, ClientHandle);
00207 }

uint16 GenVSI_ModelToViewIndex GenVSI VSI,
geWorld_Model Model
 

Definition at line 235 of file Genvsi.c.

References GenVSI::ModelToViewIndex, GenVSI::UData, and uint16.

Referenced by Door_Spawn(), PhysicsObject_Spawn(), and Plat_Spawn().

00236 {
00237         if (!VSI->ModelToViewIndex)
00238         {
00239                 assert(!"Should'nt be here!!!");
00240                 return 0xffff;
00241         }
00242 
00243         return VSI->ModelToViewIndex(VSI->UData, Model);
00244 }

void GenVSI_MotionIndex GenVSI VSI,
uint16  Index,
const char *  MotionName
 

Definition at line 64 of file Genvsi.c.

References GenVSI::MotionIndex, and GenVSI::UData.

Referenced by SetupWorldCB().

00065 {
00066         if (!VSI->MotionIndex)
00067                 return;
00068 
00069         VSI->MotionIndex(VSI->UData, Index, MotionName);
00070 }

geBoolean GenVSI_MovePlayerModel GenVSI VSI,
void *  PlayerData,
const geXForm3d DestXForm
 

Definition at line 293 of file Genvsi.c.

References GE_FALSE, geBoolean, GenVSI::MovePlayerModel, and GenVSI::UData.

Referenced by Door_Control(), PhysicsObject_Control(), and Plat_Control().

00294 {
00295         if (!VSI->MovePlayerModel)
00296                 return GE_FALSE;
00297 
00298         return VSI->MovePlayerModel(VSI->UData, PlayerData, DestXForm);
00299 }

void GenVSI_PlaySound GenVSI VSI,
uint16  Index,
const geVec3d Pos
 

Definition at line 112 of file Genvsi.c.

References GenVSI::PlaySound, and GenVSI::UData.

Referenced by Attacker_Fire(), Client_Control(), DammagePlayer(), Door_Trigger(), FireBlaster(), FireGrenade(), FireRocket(), FireShredder(), Grenade_Control(), Item_TriggerArmor(), Item_TriggerGrenade(), Item_TriggerGrenadeAmmo(), Item_TriggerHealth(), Item_TriggerRocket(), Item_TriggerRocketAmmo(), Item_TriggerShredder(), Item_TriggerShredderAmmo(), KillPlayer(), and Plat_Trigger().

00113 {
00114         if (!VSI->PlaySound)
00115                 return;
00116 
00117         VSI->PlaySound(VSI->UData, Index, Pos);
00118 }

void GenVSI_ProcIndex GenVSI VSI,
uint16  Index,
void *  Proc
 

Definition at line 413 of file Genvsi.c.

References GenVSI::ProcIndex, and GenVSI::UData.

Referenced by Client_Main(), and Server_Main().

00414 {
00415         if (!VSI->ProcIndex)
00416                 return;
00417 
00418         VSI->ProcIndex(VSI->UData, Index, Proc);
00419 }

void GenVSI_RegisterPlayerModel GenVSI VSI,
void *  PlayerData,
geWorld_Model Model
 

Definition at line 249 of file Genvsi.c.

References GenVSI::RegisterPlayerModel, and GenVSI::UData.

Referenced by BlockActor_Spawn(), ChangeLevel_Spawn(), Door_Spawn(), PhysicsObject_Spawn(), and Plat_Spawn().

00250 {
00251         if (!VSI->RegisterPlayerModel)
00252                 return;
00253 
00254         VSI->RegisterPlayerModel(VSI->UData, PlayerData, Model);
00255 }

void GenVSI_SetClassSpawn GenVSI VSI,
const char *  ClassName,
GenVSI_SpawnFunc Func,
GenVSI_DestroyFunc DFunc
 

Definition at line 31 of file Genvsi.c.

References GenVSI::SetClassSpawn, and GenVSI::UData.

Referenced by Bot_Main(), and Server_Main().

00032 {
00033         if (!VSI->SetClassSpawn)
00034                 return;
00035 
00036         VSI->SetClassSpawn(VSI->UData, ClassName, Func, DFunc);
00037 }

void GenVSI_SetClientHealth GenVSI VSI,
GenVSI_CHandle  ClientHandle,
int32  Health
 

Definition at line 167 of file Genvsi.c.

References GenVSI::SetClientHealth, and GenVSI::UData.

Referenced by DammagePlayer(), Game_SpawnBot(), Game_SpawnClient(), Item_TriggerHealth(), and KillPlayer().

00168 {
00169         if (!VSI->SetClientHealth)
00170                 return;
00171 
00172         VSI->SetClientHealth(VSI->UData, ClientHandle, Health);
00173 }

void GenVSI_SetClientInventory GenVSI VSI,
GenVSI_CHandle  ClientHandle,
int32  Slot,
uint16  Amount,
geBoolean  HasItem
 

Definition at line 189 of file Genvsi.c.

References GenVSI::SetClientInventory, and GenVSI::UData.

Referenced by Client_Control(), Game_SpawnBot(), Game_SpawnClient(), and UpdateClientInventory().

00190 {
00191         if (!VSI->SetClientInventory)
00192                 return;
00193 
00194         VSI->SetClientInventory(VSI->UData, ClientHandle, Slot, Amount, HasItem);
00195 }

void GenVSI_SetClientScore GenVSI VSI,
GenVSI_CHandle  ClientHandle,
int32  Score
 

Definition at line 156 of file Genvsi.c.

References GenVSI::SetClientScore, and GenVSI::UData.

Referenced by Game_SpawnBot(), Game_SpawnClient(), and KillPlayer().

00157 {
00158         if (!VSI->SetClientScore)
00159                 return;
00160 
00161         VSI->SetClientScore(VSI->UData, ClientHandle, Score);
00162 }

void GenVSI_SetClientWeapon GenVSI VSI,
GenVSI_CHandle  ClientHandle,
int32  Weapon
 

Definition at line 178 of file Genvsi.c.

References GenVSI::SetClientWeapon, and GenVSI::UData.

Referenced by Item_TriggerGrenade(), Item_TriggerRocket(), Item_TriggerShredder(), KillPlayer(), SwitchToNextBestWeapon(), and ValidateWeapon().

00179 {
00180         if (!VSI->SetClientWeapon)
00181                 return;
00182 
00183         VSI->SetClientWeapon(VSI->UData, ClientHandle, Weapon);
00184 }

void GenVSI_SetViewPlayer GenVSI VSI,
GenVSI_CHandle  ClientHandle,
void *  PlayerData
 

Definition at line 282 of file Genvsi.c.

References GenVSI::SetViewPlayer, and GenVSI::UData.

Referenced by Bot_Keys(), and Game_SpawnClient().

00283 {
00284         if (!VSI->SetViewPlayer)
00285                 return;
00286 
00287         VSI->SetViewPlayer(VSI->UData, ClientHandle, PlayerData);
00288 }

void GenVSI_SetWorld GenVSI VSI,
GenVSI_NewWorldCB NewWorldCB,
GenVSI_ShutdownWorldCB ShutdownWorldCB,
const char *  WorldName
 

Definition at line 42 of file Genvsi.c.

References GenVSI::SetWorld, ShutdownWorldCB(), and GenVSI::UData.

Referenced by ChangeLevel_Trigger(), Client_Control(), and Server_Main().

00043 {
00044         if (!VSI->SetWorld)
00045                 return;
00046 
00047         VSI->SetWorld(VSI->UData, NewWorldCB, ShutdownWorldCB, WorldName);
00048 }

void GenVSI_SoundIndex GenVSI VSI,
uint16  Index,
const char *  FileName
 

Definition at line 97 of file Genvsi.c.

References GenVSI::SoundIndex, and GenVSI::UData.

Referenced by SetupWorldCB().

00098 {
00099         if (!VSI->SoundIndex)
00100                 return;
00101 
00102         VSI->SoundIndex(VSI->UData, Index, FileName);
00103 }

void GenVSI_SpawnFx GenVSI VSI,
uint8  FxNum,
const geVec3d Pos,
uint8  SoundIndex
 

Definition at line 123 of file Genvsi.c.

References GenVSI::SpawnFx, and GenVSI::UData.

Referenced by Blaster_Control(), Bot_ActorDying(), Bot_Dying(), Grenade_Control(), Item_ControlArmor(), Item_ControlGrenade(), Item_ControlGrenadeAmmo(), Item_ControlHealth(), Item_ControlRocket(), Item_ControlRocketAmmo(), Item_ControlShredder(), Item_ControlShredderAmmo(), Player_Dying(), and Rocket_Control().

00124 {
00125         if (!VSI->SpawnFx)
00126                 return;
00127 
00128         VSI->SpawnFx(VSI->UData, FxNum, Pos, SoundIndex);
00129 }

void* GenVSI_SpawnPlayer GenVSI VSI,
const char *  ClassName
 

Definition at line 387 of file Genvsi.c.

References NULL, GenVSI::SpawnPlayer, and GenVSI::UData.

Referenced by Attacker_Fire(), Bot_ActorStart(), FireBlaster(), FireGrenade(), FireRocket(), and FireShredder().

00388 {
00389         if (!VSI->SpawnPlayer)
00390                 return NULL;
00391 
00392         return VSI->SpawnPlayer(VSI->UData, ClassName);
00393 }

void GenVSI_TextureIndex GenVSI VSI,
uint16  Index,
const char *  TextureName,
const char *  ATextureName
 

Definition at line 86 of file Genvsi.c.

References GenVSI::TextureIndex, and GenVSI::UData.

Referenced by SetupWorldCB().

00087 {
00088         if (!VSI->TextureIndex)
00089                 return;
00090 
00091         VSI->TextureIndex(VSI->UData, Index, TextureName, ATextureName);
00092 }


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