Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

Play Class Reference

#include <Play.h>

Inherits Scene.

Inheritance diagram for Play:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 Play ()
virtual ~Play ()
bool load (Application *parent)
bool unload ()
bool update ()
bool drawFrame ()
void handleKeys ()

Protected Member Functions

bool loadObjects ()
bool loadSounds ()
bool loadTextures ()
int playerCollission (Vec3 pos, float size)
void bot (int playerID)
void serverLoop ()
void networkLoop ()
void applyExtras (int playerID, int type, bool add=true)
void dealExtras ()
void newExtras (int type, float x, float z)
void drawGrenades ()
void drawExplosions ()
void drawProjectiles ()
void drawPlayers ()
void drawPlayer (int playerID)
void drawSpawn (int playerID)
void drawParticleSystems ()
void drawShadow (Vec3 pos, float size)
void drawLifebar ()
void drawExtras ()
void drawAvatar (int model, bool clear=false)
void setSpawnPlayer (int playerID)
void setPlayerCam (int playerID)
void throwGrenade (int playerID, Vec3 pos, Vec3 vel, float life, float strength)
void fireProjectile (int playerID, Vec3 pos, Vec3 vel, float strength)
void createExplosion (Vec3 pos, float power, bool sphere=false)
int startParticleSystem (Vec3 pos, int type)
void grenadeExplode (int ownerID, Vec3 pos, float strength)
void dealDamage (int onwerID, int playerID, float damage)
void setParticleSystemPos (int id, Vec3 pos)

Protected Attributes

TextureID m_textures [PLAY_TEXTURES]
Sound m_sounds [PLAY_SOUNDS]
OpenGLObjectm_objects [PLAY_OBJECTS]
Music m_music
OpenGLParticleSystem m_particleSystems [MAX_PARTICLESYSTEMS]
Granade m_granades [MAX_GRANADES]
Explosion m_explosions [MAX_EXPLOSIONS]
Projectile m_projectiles [MAX_PROJECTILES]
LevelInfo m_lvl
ObjLevelm_objLevel
float m_timeStart
float m_timeEnd
PlayExtras m_extras [PLAY_EXTRAS_SIMULTANEOUS]

Detailed Description

Definition at line 99 of file Play.h.


Constructor & Destructor Documentation

Play::Play  ) 
 

Play.cpp

Author: Petter Alstermark, petter@alstermark.com

Definition at line 12 of file Play.cpp.

References m_objects, m_objLevel, and PLAY_OBJECTS.

Play::~Play  )  [virtual]
 

Definition at line 25 of file Play.cpp.

References unload().

Here is the call graph for this function:


Member Function Documentation

void Play::applyExtras int  playerID,
int  type,
bool  add = true
[protected]
 

Definition at line 1490 of file Play.cpp.

References SPlayer::ammo, SPlayer::extras, g_players, g_time, SPlayer::life, PLAY_EXTRAS_AMMO, PLAY_EXTRAS_FAST, PLAY_EXTRAS_FLIPVIEW, PLAY_EXTRAS_IMMORTAL, PLAY_EXTRAS_INVISIBLE, PLAY_EXTRAS_LIFE, PLAY_EXTRAS_SHAKE, PLAY_EXTRAS_SLOW, and SPlayer::timeExtras.

Referenced by networkLoop().

void Play::bot int  playerID  )  [protected]
 

Definition at line 1667 of file Play.cpp.

References SPlayer::angle, ObjLevel::collission(), SPlayer::dir, fireProjectile(), g_frameTime, g_models, g_myPlayerID, g_players, g_time, MilkShape::guns, ObjLevel::isWater(), m_objLevel, SPlayer::moving, Vec3::normalize(), PI, PIdiv180, PLAYER_STATE_USER, SPlayer::pos, SWeapon::power, SWeapon::reload, SWeapon::speed, SPLAYER_MAX_PLAYERS, SPlayer::state, throwGrenade(), SPlayer::weapon, Vec3::x, Vec3::y, and Vec3::z.

Here is the call graph for this function:

void Play::createExplosion Vec3  pos,
float  power,
bool  sphere = false
[protected]
 

Definition at line 970 of file Play.cpp.

References Explosion::explode(), m_explosions, and MAX_EXPLOSIONS.

Referenced by drawProjectiles(), grenadeExplode(), and networkLoop().

Here is the call graph for this function:

void Play::dealDamage int  onwerID,
int  playerID,
float  damage
[protected]
 

Definition at line 1040 of file Play.cpp.

References g_players, gne, Gne::isServer(), SPlayer::life, PLAY_EXTRAS_IMMORTAL, PLAYER_STATE_USER, and Gne::setPlayerDeath().

Referenced by drawProjectiles(), and grenadeExplode().

Here is the call graph for this function:

void Play::dealExtras  )  [protected]
 

float maxTime = 0.0f; int avaiable = 0; for (unsigned int i=0; i<PLAY_EXTRAS_SIMULTANEOUS; i++) { if (m_extras[i].type == PLAY_EXTRAS_NONE) { avaiable = i; break; }

if (m_extras[i].time > maxTime) { maxTime = m_extras[i].time; avaiable = i; } }

Definition at line 1585 of file Play.cpp.

References Gne::dealExtras(), g_time, ObjLevel::getExtras(), gne, int(), Gne::isServer(), m_objLevel, PLAY_EXTRAS, round, Vec3::x, and Vec3::z.

Referenced by serverLoop().

Here is the call graph for this function:

void Play::drawAvatar int  model,
bool  clear = false
[protected]
 

Definition at line 1364 of file Play.cpp.

References Renderer::apply(), COLOR, GL_TEXTURE0_ARB, glMultiTexCoord2fARB, Scene::m_parent, m_textures, ONE, Application::renderer, Renderer::setBlending(), Renderer::setMask(), and Renderer::setTextures().

Here is the call graph for this function:

void Play::drawExplosions  )  [protected]
 

Definition at line 1054 of file Play.cpp.

References Renderer::apply(), COLOR, Explosion::drawAndUpdate(), g_frameTime, LEQUAL, m_explosions, Scene::m_parent, m_textures, MAX_EXPLOSIONS, ONE, PLAY_TEX_PARTICLE, Application::renderer, Renderer::setBlending(), Renderer::setDepthFunc(), Renderer::setMask(), and Renderer::setTextures().

Referenced by drawFrame().

Here is the call graph for this function:

void Play::drawExtras  )  [protected]
 

Definition at line 1629 of file Play.cpp.

References Renderer::apply(), COLOR, g_time, GL_TEXTURE0_ARB, glMultiTexCoord2fARB, m_extras, Scene::m_parent, m_textures, ONE, PLAY_EXTRAS_NONE, PLAY_EXTRAS_SIMULTANEOUS, PLAY_TEX_EXTRAS_OTHER, PlayExtras::pos, Application::renderer, Renderer::setBlending(), Renderer::setMask(), Renderer::setTextures(), Vec3::y, and Vec3::z.

Referenced by drawFrame().

Here is the call graph for this function:

bool Play::drawFrame  )  [virtual]
 

Reimplemented from Scene.

Definition at line 699 of file Play.cpp.

References LevelLight::ambient, Renderer::apply(), LevelLight::attenuation, Application::camera, COLOR, LevelLight::color, SPlayer::deaths, Application::defaultFont, drawExplosions(), drawExtras(), ObjLevel::drawFloor(), drawGrenades(), drawLifebar(), ObjLevel::drawObjects(), drawParticleSystems(), drawPlayers(), drawProjectiles(), ObjLevel::drawShadow(), ObjLevel::drawWalls(), ObjLevel::drawWater(), ObjLevel::drawWaterSurface(), OpenGLFont::endTextMode(), SPlayer::frags, g_frameTime, g_gameInfo, g_height, g_myPlayerID, g_players, g_stencilBuffer, g_time, g_width, GAME_STATE_GAME_OVER, GAME_STATE_WAITING, SGameInfo::gameState, GL_TEXTURE0_ARB, glMultiTexCoord2fARB, gne, int(), Gne::isRunning(), Application::keys, SPlayer::kills, LevelInfo::lights, Scene::m_loaded, m_lvl, m_objLevel, Scene::m_parent, m_textures, m_timeEnd, SPlayer::name, NONE, LevelInfo::numLights, ONE, PLAY_TEX_GAME_OVER, PLAYER_STATE_OFFLINE, PLAYER_STATE_USER, LevelLight::pos, OpenGLFont::print(), Application::renderer, Renderer::setBlending(), OpenGLFont::setColor(), Renderer::setMask(), Camera::setPrespective(), Renderer::setTextures(), SPLAYER_MAX_PLAYERS, OpenGLFont::startTextMode(), Camera::updateFrustum(), Vec3::x, Vec3::y, and Vec3::z.

Here is the call graph for this function:

void Play::drawGrenades  )  [protected]
 

Definition at line 982 of file Play.cpp.

References Renderer::apply(), OpenGLObject::draw(), g_frameTime, Granade::getPos(), grenadeExplode(), m_granades, m_objects, m_objLevel, Scene::m_parent, m_textures, MAX_GRANADES, PLAY_OBJ_GRENADE, PLAY_TEX_GRENADE, Application::renderer, Renderer::setTextures(), update(), Vec3::x, Vec3::y, and Vec3::z.

Referenced by drawFrame().

Here is the call graph for this function:

void Play::drawLifebar  )  [protected]
 

Definition at line 1405 of file Play.cpp.

References Renderer::apply(), COLOR, DST_COLOR, g_height, g_myPlayerID, g_players, g_time, g_width, GL_TEXTURE0_ARB, glMultiTexCoord2fARB, SPlayer::life, Scene::m_parent, m_textures, ONE, PLAY_EXTRAS_IMMORTAL, PLAY_TEX_LIFEBAR_BG, PLAY_TEX_LIFEBAR_FRAME, PLAY_TEX_LIFEBAR_GLOW, Application::renderer, Renderer::setBlending(), Renderer::setMask(), Renderer::setTextures(), and ZERO.

Referenced by drawFrame().

Here is the call graph for this function:

void Play::drawParticleSystems  )  [protected]
 

Definition at line 1287 of file Play.cpp.

References Renderer::apply(), Application::camera, COLOR, OpenGLParticleSystem::drawAndUpdate(), g_frameTime, ParticleSystem::getPos(), LEQUAL, Scene::m_parent, m_particleSystems, m_textures, MAX_PARTICLESYSTEMS, ONE, PLAY_TEX_PARTICLE, Application::renderer, Renderer::setBlending(), Renderer::setDepthFunc(), Renderer::setMask(), Renderer::setTextures(), and Camera::sphereInFrustum().

Referenced by drawFrame().

Here is the call graph for this function:

void Play::drawPlayer int  playerID  )  [protected]
 

Definition at line 1160 of file Play.cpp.

References SPlayer::angle, Renderer::apply(), Application::camera, COLOR, OpenGLObject::draw(), drawShadow(), SPlayer::extras, g_models, g_players, g_time, LEQUAL, m_objects, Scene::m_parent, m_textures, ONE, ONE_MINUS_SRC_ALPHA, PLAY_EXTRAS_IMMORTAL, PLAY_EXTRAS_INVISIBLE, PLAY_OBJ_SPHERE, PLAY_TEX_SPAWN_SPHERE, PLAYER_STATE_INVISIBLE, PLAYER_STATE_OFFLINE, PLAYER_STATE_SPAWNING, SPlayer::pos, MilkShape::render(), Application::renderer, Renderer::setBlending(), Renderer::setDepthFunc(), Renderer::setMask(), Renderer::setTextures(), Camera::sphereInFrustum(), SPlayer::state, SPlayer::textureID, Vec3::x, Vec3::y, and Vec3::z.

Referenced by drawPlayers().

Here is the call graph for this function:

void Play::drawPlayers  )  [protected]
 

Definition at line 1149 of file Play.cpp.

References drawPlayer(), g_players, PLAYER_STATE_OFFLINE, and SPLAYER_MAX_PLAYERS.

Referenced by drawFrame().

Here is the call graph for this function:

void Play::drawProjectiles  )  [protected]
 

Definition at line 1070 of file Play.cpp.

References Renderer::apply(), ObjLevel::collission(), createExplosion(), dealDamage(), Projectile::die(), OpenGLObject::draw(), g_frameTime, g_myPlayerID, g_players, Projectile::getPos(), m_objects, m_objLevel, Scene::m_parent, m_projectiles, m_sounds, m_textures, MAX_PROJECTILES, Sound::play(), PLAY_OBJ_GRENADE, PLAY_SOUND_GUN_HIT, PLAY_TEX_GRENADE, SPlayer::pos, Application::renderer, Renderer::setTextures(), Projectile::update(), Vec3::x, Vec3::y, and Vec3::z.

Referenced by drawFrame().

Here is the call graph for this function:

void Play::drawShadow Vec3  pos,
float  size
[protected]
 

Definition at line 1305 of file Play.cpp.

References Renderer::apply(), COLOR, DST_COLOR, GL_TEXTURE0_ARB, glMultiTexCoord2fARB, Scene::m_parent, m_textures, PLAY_TEX_SHADOW, Application::renderer, Renderer::setBlending(), Renderer::setMask(), Renderer::setTextures(), Vec3::x, Vec3::z, and ZERO.

Referenced by drawPlayer().

Here is the call graph for this function:

void Play::drawSpawn int  playerID  )  [protected]
 

Definition at line 1240 of file Play.cpp.

void Play::fireProjectile int  playerID,
Vec3  pos,
Vec3  vel,
float  strength
[protected]
 

Definition at line 957 of file Play.cpp.

References Projectile::create(), m_projectiles, MAX_PROJECTILES, and Projectile::setPlayerID().

Referenced by bot(), handleKeys(), and networkLoop().

Here is the call graph for this function:

void Play::grenadeExplode int  ownerID,
Vec3  pos,
float  strength
[protected]
 

Definition at line 1010 of file Play.cpp.

References Application::camera, createExplosion(), dealDamage(), g_myPlayerID, g_players, Scene::m_parent, m_sounds, Sound::play(), PLAY_SOUND_GRENADE, PLAYER_STATE_OFFLINE, SPlayer::pos, Camera::shake(), and SPLAYER_MAX_PLAYERS.

Referenced by drawGrenades().

Here is the call graph for this function:

void Play::handleKeys  ) 
 

if (m_parent->keys['K']) { if (g_players[g_myPlayerID].extras[PLAY_EXTRAS_FLIPVIEW] > 0) g_players[g_myPlayerID].extras[PLAY_EXTRAS_FLIPVIEW] = 0; else g_players[g_myPlayerID].extras[PLAY_EXTRAS_FLIPVIEW] = 1; m_parent->keys['K'] = false; }

if (m_parent->keys['J']) { if (g_players[g_myPlayerID].extras[PLAY_EXTRAS_SHAKE] > 0) g_players[g_myPlayerID].extras[PLAY_EXTRAS_SHAKE] = 0; else g_players[g_myPlayerID].extras[PLAY_EXTRAS_SHAKE] = 1; m_parent->keys['J'] = false; }

if (m_parent->keys['H']) { if (g_players[g_myPlayerID].extras[PLAY_EXTRAS_INVISIBLE] > 0) g_players[g_myPlayerID].extras[PLAY_EXTRAS_INVISIBLE] = 0; else g_players[g_myPlayerID].extras[PLAY_EXTRAS_INVISIBLE] = 1; m_parent->keys['H'] = false; }

if (m_parent->keys['G']) { if (g_players[g_myPlayerID].extras[PLAY_EXTRAS_IMMORTAL] > 0) g_players[g_myPlayerID].extras[PLAY_EXTRAS_IMMORTAL] = 0; else g_players[g_myPlayerID].extras[PLAY_EXTRAS_IMMORTAL] = 1; m_parent->keys['G'] = false; }

if (m_parent->keys['U']) { g_players[g_myPlayerID].extras[PLAY_EXTRAS_FAST] += 1; m_parent->keys['U'] = false; }

if (m_parent->keys['I']) { g_players[g_myPlayerID].extras[PLAY_EXTRAS_FAST] -= 1; if (g_players[g_myPlayerID].extras[PLAY_EXTRAS_FAST] < 0) g_players[g_myPlayerID].extras[PLAY_EXTRAS_FAST] = 0; m_parent->keys['I'] = false; }

if (m_parent->keys['O']) { g_players[g_myPlayerID].extras[PLAY_EXTRAS_SLOW] += 1; m_parent->keys['O'] = false; }

if (m_parent->keys['P']) { g_players[g_myPlayerID].extras[PLAY_EXTRAS_SLOW] -= 1; if (g_players[g_myPlayerID].extras[PLAY_EXTRAS_SLOW] < 0) g_players[g_myPlayerID].extras[PLAY_EXTRAS_SLOW] = 0; m_parent->keys['P'] = false; }

Definition at line 491 of file Play.cpp.

References SPlayer::angle, SPlayer::dir, fireProjectile(), g_models, g_myPlayerID, g_players, g_time, gne, MilkShape::guns, Application::keys, Scene::m_parent, m_sounds, SPlayer::moveVal, SPlayer::moving, PIdiv180, Sound::play(), PLAY_NET_GAME_OVER, PLAY_SOUND_GUN, PLAYER_MOVING_BACKWARD, PLAYER_MOVING_FORWARD, PLAYER_MOVING_NONE, PLAYER_ROTATION_LEFT, PLAYER_ROTATION_NONE, PLAYER_ROTATION_RIGHT, PLAYER_STATE_USER, SPlayer::pos, SWeapon::power, SWeapon::reload, SPlayer::rotation, Gne::sendAttack(), Gne::setPlayerExtras(), Gne::setPlayerPos(), SWeapon::speed, SPlayer::speed, SPlayer::state, throwGrenade(), SWeapon::type, SPlayer::weapon, WEAPON_GRENADE, Vec3::x, Vec3::y, and Vec3::z.

Referenced by update().

Here is the call graph for this function:

bool Play::load Application parent  )  [virtual]
 

strcpy(g_players[0].skin, "robot1.bmp"); strcpy(g_players[1].skin, "robot2.bmp"); strcpy(g_players[2].skin, "robot3.bmp"); strcpy(g_players[3].skin, "robot4.bmp");

strcpy(g_players[4].skin, "robot1.bmp"); strcpy(g_players[5].skin, "robot2.bmp"); strcpy(g_players[6].skin, "robot3.bmp"); strcpy(g_players[7].skin, "robot4.bmp");

strcpy(g_players[8].skin, "robot1.bmp"); strcpy(g_players[9].skin, "robot2.bmp"); strcpy(g_players[10].skin, "robot3.bmp"); strcpy(g_players[11].skin, "robot4.bmp");

strcpy(g_players[12].skin, "robot1.bmp"); strcpy(g_players[13].skin, "robot2.bmp"); strcpy(g_players[14].skin, "robot3.bmp"); strcpy(g_players[15].skin, "robot4.bmp");

Reimplemented from Scene.

Definition at line 32 of file Play.cpp.

References Console::addEx(), console, g_drawConsole, g_gameInfo, g_myPlayerID, g_players, g_showFPS, GAME_STATE_WAITING, SGameInfo::gameState, gne, Gne::isRunning(), loadObjects(), loadSounds(), loadTextures(), LOG_SUCCESS, m_extras, Scene::m_loaded, Scene::m_parent, PLAY_EXTRAS_NONE, PLAY_EXTRAS_SIMULTANEOUS, PLAYER_STATE_READY, setPlayerCam(), Gne::setPlayerState(), SPlayer::state, and PlayExtras::type.

Here is the call graph for this function:

bool Play::loadObjects  )  [protected]
 

"data\\lvls\\lvl1.lvl"

Definition at line 192 of file Play.cpp.

References ObjLevel::createVertexBuffer(), SGameInfo::currLvl, g_allModels, g_galaxies, g_gameInfo, g_models, g_players, ObjLevel::load(), Level::load(), m_lvl, m_objects, m_objLevel, Scene::m_parent, PLAY_OBJ_GRENADE, PLAY_OBJ_SPHERE, Application::renderer, and SPLAYER_MAX_PLAYERS.

Referenced by load().

Here is the call graph for this function:

bool Play::loadSounds  )  [protected]
 

Definition at line 233 of file Play.cpp.

References Music::load(), Sound::load(), m_music, m_sounds, Music::play(), PLAY_SOUND_DEATH, PLAY_SOUND_DROWN, PLAY_SOUND_EXTRAS_AMMO, PLAY_SOUND_EXTRAS_FAST, PLAY_SOUND_EXTRAS_FLIPVIEW, PLAY_SOUND_EXTRAS_IMMORTAL, PLAY_SOUND_EXTRAS_INVISIBLE, PLAY_SOUND_EXTRAS_LIFE, PLAY_SOUND_EXTRAS_SHAKE, PLAY_SOUND_EXTRAS_SLOW, PLAY_SOUND_GRENADE, PLAY_SOUND_GUN, PLAY_SOUND_GUN_HIT, and PLAY_SOUND_SPAWN.

Referenced by load().

Here is the call graph for this function:

bool Play::loadTextures  )  [protected]
 

if (strcmp(g_players[i].skin, "") != 0) { char str[256] = {0}; sprintf(str, "data\\textures\\skins\\%s", g_players[i].skin); if ((g_players[i].textureID = m_parent->renderer->addTexture(str)) == TEXTURE_NONE) return false; }

Definition at line 133 of file Play.cpp.

References Renderer::addTexture(), g_allModels, g_players, Scene::m_parent, m_textures, SPlayer::model, PLAY_TEX_EXTRAS_OTHER, PLAY_TEX_GAME_OVER, PLAY_TEX_GRENADE, PLAY_TEX_LIFEBAR_BG, PLAY_TEX_LIFEBAR_FRAME, PLAY_TEX_LIFEBAR_GLOW, PLAY_TEX_MODEL_0, PLAY_TEX_PARTICLE, PLAY_TEX_SHADOW, PLAY_TEX_SKIN, PLAY_TEX_SPAWN_SPHERE, Application::renderer, SPLAYER_MAX_PLAYERS, and TEXTURE_NONE.

Referenced by load().

Here is the call graph for this function:

void Play::networkLoop  )  [protected]
 

Play_network.cpp

Author: Petter Alstermark, petter@alstermark.com

Just some network functions (to get overview)

case E_PLAYER_JOINED: ge_playerJoined = (GE_PlayerJoined *)gne->getNextEvent(); playerID = ge_playerJoined->getId(); p = gne->getPlayerById(playerID); strcpy(g_players[playerID].name, p->getName());

set defaults for player g_players[playerID].life = 100.0f; g_players[playerID].frags = 0; g_players[playerID].kills = 0; g_players[playerID].deaths = 0; g_players[playerID].state = PLAYER_STATE_INVISIBLE; g_players[playerID].ownsParticleSystem = -1;

I'm server, spawn the new player if (gne->isServer()) {

send info about all players to the new player.. hmmm for all players where state == PLAYER_STATE_USER do gne->setPlayerState(playerID, g_players[playerID].state);

setSpawnPlayer(playerID); }

console.addEx(Vec3(1.0f, 1.0f, 1.0f), "Player %d joined", playerID);

if (ge_playerJoined) delete ge_playerJoined; break;

Definition at line 12 of file Play_network.cpp.

References Console::addEx(), SPlayer::angle, applyExtras(), console, createExplosion(), SPlayer::deaths, ParticleSystem::die(), SPlayer::dir, E_ATTACK, E_DEAL_EXTRAS, E_PLAYER_ACTION, E_PLAYER_DEATH, E_PLAYER_DISCONNECTED, E_PLAYER_EXTRAS, E_PLAYER_POS, E_PLAYER_SCORE, E_PLAYER_STATE, fireProjectile(), SPlayer::frags, g_gameInfo, g_myPlayerID, g_players, g_time, GAME_STATE_GAME_OVER, GAME_STATE_RUNNING, SGameInfo::gameState, GE_PlayerAction::getAction(), GE_PlayerPos::getAngle(), GE_Attack::getAttackType(), GE_PlayerScore::getDeaths(), GE_DealExtras::getDEType(), GE_Attack::getDir(), GE_PlayerExtras::getExtras(), GE_DealExtras::getFlag(), GE_PlayerScore::getFrags(), GE::getId(), GE_PlayerDeath::getKillerID(), GE_PlayerScore::getKills(), GE_PlayerPos::getMove(), Gne::getNextEvent(), GE_Attack::getPos(), GE_PlayerPos::getRotation(), GE_State::getState(), GE_PlayerExtras::getValue(), GE_DealExtras::getX(), GE_PlayerPos::getX(), GE_DealExtras::getY(), GE_PlayerPos::getY(), gne, Gne::isServer(), SPlayer::kills, SPlayer::life, m_extras, m_particleSystems, m_sounds, m_timeEnd, m_timeStart, SPlayer::moving, newExtras(), Gne::nextEventPending(), SPlayer::ownsParticleSystem, PARTICLESYSTEM_SPAWN, Sound::play(), PLAY_ACTION_PLAYER_DROWN, PLAY_ACTION_PLAYER_EXPLODE, PLAY_ACTION_PLAYER_SPAWN, PLAY_ACTION_PLAYER_SPAWNED, PLAY_EXTRAS_NONE, PLAY_EXTRAS_SIMULTANEOUS, PLAY_NET_GAME_OVER, PLAY_NET_START_GAME, PLAY_SOUND_DEATH, PLAY_SOUND_DROWN, PLAY_SOUND_SPAWN, PLAYER_MOVING_NONE, PLAYER_ROTATION_NONE, PLAYER_STATE_INVISIBLE, PLAYER_STATE_OFFLINE, PLAYER_STATE_READY, PLAYER_STATE_SPAWNING, PLAYER_STATE_USER, PlayExtras::pos, SPlayer::pos, SWeapon::power, RANDOM_NUM, SPlayer::rotation, Weapon::set(), setPlayerCam(), Gne::setPlayerScore(), SPlayer::spawnTime, SPLAYER_MAX_PLAYERS, startParticleSystem(), SPlayer::state, throwGrenade(), PlayExtras::type, WEAPON_GRENADE, and WEAPON_GUN.

Referenced by update().

Here is the call graph for this function:

void Play::newExtras int  type,
float  x,
float  z
[protected]
 

Definition at line 1560 of file Play.cpp.

References g_time, m_extras, PLAY_EXTRAS_NONE, PLAY_EXTRAS_SIMULTANEOUS, PlayExtras::pos, PlayExtras::time, and PlayExtras::type.

Referenced by networkLoop().

int Play::playerCollission Vec3  pos,
float  size
[protected]
 

Definition at line 1113 of file Play.cpp.

References g_players, PLAYER_STATE_OFFLINE, SPlayer::pos, SPLAYER_MAX_PLAYERS, Vec3::x, and Vec3::z.

void Play::serverLoop  )  [protected]
 

Play_server.cpp

Author: Petter Alstermark, petter@alstermark.com

Just some server functions (to get overview)

Definition at line 12 of file Play_server.cpp.

References SPlayer::angle, dealExtras(), g_gameInfo, g_players, g_time, GAME_STATE_WAITING, SGameInfo::gameState, ObjLevel::getSpawnpool(), gne, Gne::isRunning(), Gne::isServer(), m_objLevel, m_timeEnd, SPlayer::moving, PLAY_ACTION_PLAYER_SPAWN, PLAY_ACTION_PLAYER_SPAWNED, PLAY_NET_GAME_OVER, PLAY_NET_START_GAME, PLAYER_MOVING_NONE, PLAYER_ROTATION_NONE, PLAYER_STATE_INVISIBLE, PLAYER_STATE_LOADING, PLAYER_STATE_OFFLINE, PLAYER_STATE_SPAWNING, SPlayer::pos, SPlayer::rotation, Gne::setPlayerAction(), Gne::setPlayerExtras(), Gne::setPlayerPos(), SPlayer::spawnTime, SPLAYER_MAX_PLAYERS, SPlayer::state, Vec3::x, and Vec3::z.

Referenced by update().

Here is the call graph for this function:

void Play::setParticleSystemPos int  id,
Vec3  pos
[protected]
 

Definition at line 1279 of file Play.cpp.

References m_particleSystems, and ParticleSystem::move().

Here is the call graph for this function:

void Play::setPlayerCam int  playerID  )  [protected]
 

Definition at line 1339 of file Play.cpp.

References Application::camera, g_players, g_time, Scene::m_parent, PLAY_EXTRAS_FLIPVIEW, PLAY_EXTRAS_SHAKE, SPlayer::pos, Camera::setHeading(), Camera::setPitch(), and Camera::setPosition().

Referenced by load(), networkLoop(), and update().

Here is the call graph for this function:

void Play::setSpawnPlayer int  playerID  )  [protected]
 

Definition at line 1135 of file Play.cpp.

References g_players, g_time, gne, Gne::isRunning(), Gne::isServer(), PLAYER_STATE_INVISIBLE, Gne::setPlayerState(), SPlayer::spawnTime, and SPlayer::state.

Here is the call graph for this function:

int Play::startParticleSystem Vec3  pos,
int  type
[protected]
 

Definition at line 1262 of file Play.cpp.

References ParticleSystem::loadPreset(), m_particleSystems, MAX_PARTICLESYSTEMS, ParticleSystem::move(), and ParticleSystem::start().

Referenced by networkLoop().

Here is the call graph for this function:

void Play::throwGrenade int  playerID,
Vec3  pos,
Vec3  vel,
float  life,
float  strength
[protected]
 

Definition at line 944 of file Play.cpp.

References Granade::create(), m_granades, MAX_GRANADES, and Granade::setPlayerID().

Referenced by bot(), handleKeys(), and networkLoop().

Here is the call graph for this function:

bool Play::unload  )  [virtual]
 

Reimplemented from Scene.

Definition at line 259 of file Play.cpp.

References MilkShape::clear(), OpenGLObject::clearVertexBuffer(), Renderer::deleteTexture(), g_models, g_players, LOG_SUCCESS, Scene::m_loaded, m_lvl, m_music, m_objects, m_objLevel, Scene::m_parent, m_sounds, m_textures, PLAY_OBJECTS, PLAY_SOUNDS, PLAY_TEXTURES, Application::renderer, SPLAYER_MAX_PLAYERS, Music::stop(), TEXTURE_NONE, Level::unload(), Music::unload(), and Sound::unload().

Referenced by ~Play().

Here is the call graph for this function:

bool Play::update  )  [virtual]
 

Reimplemented from Scene.

Definition at line 318 of file Play.cpp.

References MilkShape::advanceAnimation(), SPlayer::angle, ObjLevel::collission(), Gne::dealExtras(), SPlayer::dir, SPlayer::extras, LevelInfo::friction, g_frameTime, g_gameInfo, g_models, g_myPlayerID, g_players, g_selectedScene, g_time, GAME_STATE_GAME_OVER, SGameInfo::gameState, gne, handleKeys(), Gne::isServer(), ObjLevel::isWater(), m_extras, Scene::m_loaded, m_lvl, m_objLevel, m_timeEnd, SPlayer::moveVal, SPlayer::moving, networkLoop(), Vec3::normalize(), PIdiv180, PLAY_ACTION_PLAYER_DROWN, PLAY_EXTRAS, PLAY_EXTRAS_FAST, PLAY_EXTRAS_NONE, PLAY_EXTRAS_SIMULTANEOUS, PLAY_EXTRAS_SLOW, PLAYER_MOVING_BACKWARD, PLAYER_MOVING_FORWARD, PLAYER_MOVING_NONE, PLAYER_ROTATION_LEFT, PLAYER_ROTATION_NONE, PLAYER_ROTATION_RIGHT, PLAYER_STATE_INVISIBLE, PLAYER_STATE_USER, PlayExtras::pos, SPlayer::pos, SPlayer::rotation, SCENE_SCORES, serverLoop(), Gne::setPlayerAction(), setPlayerCam(), Gne::setPlayerExtras(), SPlayer::speed, SPLAYER_MAX_PLAYERS, SPlayer::state, SPlayer::timeExtras, PlayExtras::type, Vec3::x, Vec3::y, and Vec3::z.

Referenced by drawGrenades().

Here is the call graph for this function:


Member Data Documentation

Explosion Play::m_explosions[MAX_EXPLOSIONS] [protected]
 

Definition at line 161 of file Play.h.

Referenced by createExplosion(), and drawExplosions().

PlayExtras Play::m_extras[PLAY_EXTRAS_SIMULTANEOUS] [protected]
 

Definition at line 169 of file Play.h.

Referenced by drawExtras(), load(), networkLoop(), newExtras(), and update().

Granade Play::m_granades[MAX_GRANADES] [protected]
 

Definition at line 160 of file Play.h.

Referenced by drawGrenades(), and throwGrenade().

LevelInfo Play::m_lvl [protected]
 

Definition at line 164 of file Play.h.

Referenced by drawFrame(), loadObjects(), unload(), and update().

Music Play::m_music [protected]
 

Definition at line 157 of file Play.h.

Referenced by loadSounds(), and unload().

OpenGLObject* Play::m_objects[PLAY_OBJECTS] [protected]
 

Definition at line 156 of file Play.h.

Referenced by drawGrenades(), drawPlayer(), drawProjectiles(), loadObjects(), Play(), and unload().

ObjLevel* Play::m_objLevel [protected]
 

Definition at line 165 of file Play.h.

Referenced by bot(), dealExtras(), drawFrame(), drawGrenades(), drawProjectiles(), loadObjects(), Play(), serverLoop(), unload(), and update().

OpenGLParticleSystem Play::m_particleSystems[MAX_PARTICLESYSTEMS] [protected]
 

Definition at line 159 of file Play.h.

Referenced by drawParticleSystems(), networkLoop(), setParticleSystemPos(), and startParticleSystem().

Projectile Play::m_projectiles[MAX_PROJECTILES] [protected]
 

Definition at line 162 of file Play.h.

Referenced by drawProjectiles(), and fireProjectile().

Sound Play::m_sounds[PLAY_SOUNDS] [protected]
 

Definition at line 155 of file Play.h.

Referenced by drawProjectiles(), grenadeExplode(), handleKeys(), loadSounds(), networkLoop(), and unload().

TextureID Play::m_textures[PLAY_TEXTURES] [protected]
 

Definition at line 154 of file Play.h.

Referenced by drawAvatar(), drawExplosions(), drawExtras(), drawFrame(), drawGrenades(), drawLifebar(), drawParticleSystems(), drawPlayer(), drawProjectiles(), drawShadow(), loadTextures(), and unload().

float Play::m_timeEnd [protected]
 

Definition at line 167 of file Play.h.

Referenced by drawFrame(), networkLoop(), serverLoop(), and update().

float Play::m_timeStart [protected]
 

Definition at line 166 of file Play.h.

Referenced by networkLoop().


Generated on Sun Jun 5 15:50:52 2005 for Defacto by  doxygen 1.4.3