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

GMain.h

Go to the documentation of this file.
00001 /****************************************************************************************/
00002 /*  GMain.h                                                                             */
00003 /*                                                                                      */
00004 /*  Author: John Pollard                                                                */
00005 /*  Description:                                                                        */
00006 /*                                                                                      */
00007 /*  Copyright (c) 1997, 1999, Eclipse Entertainment; All rights reserved.               */
00008 /*                                                                                      */
00009 /*  See the accompanying file LICENSE.TXT for terms on the use of this library.         */
00010 /*  This library is distributed in the hope that it will be useful but WITHOUT          */
00011 /*  ANY WARRANTY OF ANY KIND and without any implied warranty of MERCHANTABILITY        */
00012 /*  or FITNESS FOR ANY PURPOSE.  Refer to LICENSE.TXT for more details.                 */
00013 /*                                                                                      */
00014 /****************************************************************************************/
00015 #ifndef GMAIN_H
00016 #define GMAIN_H
00017 
00018 #include <Windows.h>
00019 
00020 #include "Game.h"
00021 
00022 #ifdef __cplusplus
00023 extern "C" {
00024 #endif
00025 
00026 // Actor indexes
00027 #define ACTOR_INDEX_PLAYER                      0
00028 #define ACTOR_INDEX_TURRET                      1
00029 
00030 #define ACTOR_INDEX_HEALTH                      2
00031 #define ACTOR_INDEX_ROCKET_AMMO         3
00032 #define ACTOR_INDEX_ROCKET                      4
00033 #define ACTOR_INDEX_SHREDDER            5
00034 #define ACTOR_INDEX_SHREDDER_AMMO       6
00035 #define ACTOR_INDEX_GRENADE_AMMO        7
00036 #define ACTOR_INDEX_GRENADE                     8
00037 #define ACTOR_INDEX_ARMOR                       9
00038 
00039 // Motion indexes
00040 #define ACTOR_MOTION_PLAYER_WALK        0
00041 #define ACTOR_MOTION_PLAYER_RUN         1
00042 #define ACTOR_MOTION_PLAYER_HIT         2
00043 #define ACTOR_MOTION_PLAYER_DIE         3
00044 #define ACTOR_MOTION_PLAYER_IDLE        4
00045 #define ACTOR_MOTION_T1                         5
00046 #define ACTOR_MOTION_T2                         6
00047 
00048 // Sound Indexes
00049 #define SOUND_INDEX_HURT1                       5
00050 #define SOUND_INDEX_HURT2                       6
00051 #define SOUND_INDEX_HURT3                       7
00052 #define SOUND_INDEX_HURT4                       8
00053 #define SOUND_INDEX_DIE                         9
00054 #define SOUND_INDEX_PICKUP_HEALTH       10
00055 #define SOUND_INDEX_PICKUP_WEAPON1      11
00056 #define SOUND_INDEX_PICKUP_WEAPON2      12
00057 #define SOUND_INDEX_JUMP                        13
00058 #define SOUND_INDEX_BLASTER                     14
00059 #define SOUND_INDEX_BLASTER_BANG        15
00060 #define SOUND_INDEX_SHREDDER            16
00061 #define SOUND_INDEX_ITEM_SPAWN          17
00062 #define SOUND_INDEX_PLAYER_SPAWN        18
00063 #define SOUND_INDEX_GRENADE                     19
00064 
00065 // Texture indexes
00066 #define TEXTURE_INDEX_WEAPON2           0
00067 
00068 // Inventory types for players...
00069 #define ITEM_BLASTER                    0
00070 #define ITEM_GRENADES                   1
00071 #define ITEM_ROCKETS                    2
00072 #define ITEM_SHREDDER                   3
00073 // Reserve 16 slots for weapons
00074 
00075 // Armor is hacked for now...  Client assumes armor is in inventory slot 16...
00076 #define ITEM_ARMOR                              16
00077 
00078 //
00079 // Items info
00080 //
00081 
00082 // Health
00083 #define HEALTH_RESPAWN                  45.0f
00084 
00085 // Rocket
00086 #define ROCKET_RESPAWN                  10.0f
00087 #define ROCKET_AMMO_RESPAWN             30.0f
00088 
00089 #define ROCKET_AMOUNT                   5
00090 #define ROCKET_MAX_AMOUNT               100
00091 #define ROCKET_AMMO_AMOUNT              5
00092 
00093 // Grenade
00094 #define GRENADE_RESPAWN                 10.0f
00095 #define GRENADE_AMMO_RESPAWN    30.0f
00096 
00097 #define GRENADE_AMOUNT                  5
00098 #define GRENADE_MAX_AMOUNT              100
00099 #define GRENADE_AMMO_AMOUNT             5
00100 
00101 // Shredder
00102 #define SHREDDER_RESPAWN                10.0f
00103 #define SHREDDER_AMMO_RESPAWN   30.0f
00104 
00105 #define SHREDDER_AMOUNT                 25
00106 #define SHREDDER_MAX_AMOUNT             200
00107 #define SHREDDER_AMMO_AMOUNT    50
00108 
00109 // The algo used for armor is as followed:
00110 // Dammage -= ((Armor/MAX_ARMOR)*MAX_ARMOR_PROETECTION)*Dammage
00111 #define ARMOR_RESPAWN                   25.0f
00112 #define ARMOR_AMOUNT                    100
00113 #define MAX_ARMOR                               300
00114 #define MAX_ARMOR_PROTECTION    0.7f                    // Between 0-1
00115 
00116 #define ROTATION_FRICTION               0.90f
00117 #define PLAYER_GROUND_FRICTION  7.0f
00118 #define PLAYER_LIQUID_FRICTION  2.5f
00119 #define PLAYER_AIR_FRICTION             1.00f
00120 #define PLAYER_GRAVITY                  1600.0f
00121 #define PLAYER_JUMP_THRUST              700//17000.0f
00122 #define PLAYER_SIDE_SPEED               4000.0f
00123 
00124 #define CONTENTS_WATER          GE_CONTENTS_USER1
00125 #define CONTENTS_LAVA           GE_CONTENTS_USER2
00126 
00127 //===========================================================================
00128 //      Struct defs
00129 //===========================================================================
00130 
00131 typedef struct
00132 {
00133         GenVSI          *VSI;
00134         GPlayer         *Player;
00135 } CData;
00136 
00137 
00138 extern GPlayer  *CurrentPlayerStart;
00139 
00140 //===========================================================================
00141 //      Function prototypes
00142 //===========================================================================
00143 
00144 // GMain.c
00145 BOOL            XFormFromVector(const geVec3d *Source, const geVec3d *Target, float Roll, geXForm3d *Out);
00146 void            SqueezeVector(geVec3d *Vect, float Epsilon);
00147 void            ClampVector(geVec3d *Vect, float Epsilon);
00148 void            ReflectVelocity(geVec3d *In, geVec3d *Normal, geVec3d *Out, float Scale);
00149 
00150 geBoolean       AnimatePlayer(GenVSI *VSI, void *PlayerData, uint16 MotionIndex, float Speed, geBoolean Loop);
00151 geBoolean       AnimatePlayer2(GenVSI *VSI, void *PlayerData, int32 MotionSlot, float Speed, geBoolean Loop);
00152 
00153 void            UpdateClientInventory(GenVSI *VSI, GPlayer *Player, int32 Slot);
00154 
00155 geBoolean       CheckVelocity(GenVSI *VSI, void *PlayerData, float BounceScale, geBoolean AllowBounce, float Time);
00156 
00157 // Weapons.c
00158 geBoolean       DammagePlayer(GenVSI *VSI, void *PlayerData, void *TargetData, int32 Amount, float Power, float Time);
00159 
00160 void            FireGrenade(GenVSI *VSI, void *PlayerData, float Time);
00161 void            FireRocket(GenVSI *VSI, void *PlayerData, float Time);
00162 geBoolean       FireWeapon(GenVSI *VSI, void *PlayerData, float Time);
00163 
00164 geBoolean       Blaster_Control(GenVSI *VSI, void *PlayerData, float Time);
00165 geBoolean       Grenade_Control(GenVSI *VSI, void *PlayerData, float Time);
00166 geBoolean       Rocket_Control(GenVSI *VSI, void *PlayerData, float Time);
00167 geBoolean       Shredder_Control(GenVSI *VSI, void *PlayerData, float Time);
00168 
00169 // Items.c
00170 geBoolean       Item_ControlHealth(GenVSI *VSI, void *PlayerData, float Time);
00171 
00172 geBoolean       Item_HealthSpawn(GenVSI *VSI, void *PlayerData, void *ClassData, char *EntityName);
00173 geBoolean       Item_ArmorSpawn(GenVSI *VSI, void *PlayerData, void *ClassData, char *EntityName);
00174 geBoolean       Item_RocketSpawn(GenVSI *VSI, void *PlayerData, void *ClassData, char *EntityName);
00175 geBoolean       Item_RocketAmmoSpawn(GenVSI *VSI, void *PlayerData, void *ClassData, char *EntityName);
00176 geBoolean       Item_GrenadeSpawn(GenVSI *VSI, void *PlayerData, void *ClassData, char *EntityName);
00177 geBoolean       Item_GrenadeAmmoSpawn(GenVSI *VSI, void *PlayerData, void *ClassData, char *EntityName);
00178 geBoolean       Item_ShredderSpawn(GenVSI *VSI, void *PlayerData, void *ClassData, char *EntityName);
00179 geBoolean       Item_ShredderAmmoSpawn(GenVSI *VSI, void *PlayerData, void *ClassData, char *EntityName);
00180 
00181 // Level.c
00182 geBoolean       SetupWorldCB(GenVSI *VSI, const char *WorldName, geVFile *MainFS);
00183 geBoolean       ShutdownWorldCB(GenVSI *VSI);
00184 
00185 geBoolean       ChangeLevel_Spawn(GenVSI *VSI, void *PlayerData, void *ClassData, char *EntityName);
00186 
00187 // Attacker.c
00188 geBoolean Attacker_TurretSpawn(GenVSI *VSI, void *PlayerData, void *ClassData, char *EntityName);       
00189 void Attacker_TurretDestroy(GenVSI *VSI, void *PlayerData, void *ClassData);    
00190 void Attacker_Fire(GenVSI *VSI, GPlayer *Player, GPlayer *Target, float Time);
00191 
00192 geBoolean PlayerPhysics(GenVSI *VSI, 
00193                                                 void *PlayerData, 
00194                                                 float GroundFriction, 
00195                                                 float AirFriction, 
00196                                                 float LiquidFriction, 
00197                                                 float Gravity,
00198                                                 float BounceScale, 
00199                                                 geBoolean AllowBounce,
00200                                                 float Time);
00201 
00202 geBoolean       UpdatePlayerContents(GenVSI *VSI, void *PlayerData, float Time);
00203 
00204 geBoolean SelfCollisionCB(geWorld_Model *Model, geActor *Actor, void *Context);
00205 geBoolean SelfCollisionCB2(geWorld_Model *Model, geActor *Actor, void *Context);
00206 
00207 #ifdef __cplusplus
00208 }
00209 #endif
00210 
00211 #endif

Generated on Tue Sep 30 12:35:53 2003 for GTestAndEngine by doxygen 1.3.2