28 #include "../idlib/precompiled.h"
31 #include "../framework/Session_local.h"
39 #define BEAR_GRAVITY 240
40 #define BEAR_SIZE 24.f
41 #define BEAR_SHRINK_TIME 2000.f
43 #define MAX_WINDFORCE 100.f
249 savefile->
Write( &numberOfEnts,
sizeof(numberOfEnts) );
251 for (
int i=0;
i<numberOfEnts;
i++ ) {
252 entities[
i]->WriteToSaveGame( savefile );
257 savefile->
Write( &index,
sizeof(index) );
259 savefile->
Write( &index,
sizeof(index) );
261 savefile->
Write( &index,
sizeof(index) );
263 savefile->
Write( &index,
sizeof(index) );
265 savefile->
Write( &index,
sizeof(index) );
267 savefile->
Write( &index,
sizeof(index) );
306 savefile->
Read( &numberOfEnts,
sizeof(numberOfEnts) );
308 for (
int i=0;
i<numberOfEnts;
i++ ) {
317 savefile->
Read( &index,
sizeof(index) );
319 savefile->
Read( &index,
sizeof(index) );
321 savefile->
Read( &index,
sizeof(index) );
323 savefile->
Read( &index,
sizeof(index) );
325 savefile->
Read( &index,
sizeof(index) );
327 savefile->
Read( &index,
sizeof(index) );
443 int key =
event->evValue;
501 }
else if (
idStr::Icmp(_name,
"onContinue") == 0 ) {
503 }
else if (
idStr::Icmp(_name,
"onNewGame") == 0 ) {
561 turretOrig.
Set( 80.
f, 348.
f );
563 pt = pt - turretOrig;
571 angle =
RAD2DEG( acosf( dot ) );
583 bool startShrink =
false;
594 bool collision =
false;
648 angle =
RAD2DEG( atan2( dir.
x, dir.
y ) );
722 if ( height > 240 ) {
725 }
else if ( height < 30 ) {
750 vec.
x += ( 1 - vec.
x ) * 0.18
f;
void SetMaterial(const char *name)
virtual void SetStateString(const char *varName, const char *value)
void SetVisible(bool isVisible)
virtual const idSoundShader * FindSound(const char *name, bool makeDefault=true)=0
idCVar bearTurretAngle("bearTurretAngle","0", CVAR_FLOAT,"")
virtual void Draw(idDeviceContext *dc)
float GetFloat(void) const
GLenum GLenum GLenum GLenum GLenum scale
virtual bool ParseInternalVar(const char *name, idParser *src)
virtual void PlayShaderDirectly(const char *name, int channel=-1)=0
static float ClampFloat(float min, float max, float value)
float NormalizeFast(void)
virtual void WriteToSaveGame(idFile *savefile)
virtual const idMaterial * FindMaterial(const char *name, bool makeDefault=true)=0
idGameBearShootWindow(idUserInterfaceLocal *gui)
idGameBearShootWindow * game
idCVar bearTurretForce("bearTurretForce","200", CVAR_FLOAT,"")
int Icmp(const char *text) const
virtual void WriteToSaveGame(idFile *savefile)
void DrawMaterialRotated(float x, float y, float w, float h, const idMaterial *mat, const idVec4 &color, float scalex=1.0, float scaley=1.0, float angle=0.0f)
virtual void Update(float timeslice)
virtual idWinVar * GetWinVarByName(const char *_name, bool winLookup=false, drawWin_t **owner=NULL)
static float Sin(float a)
static float Fabs(float f)
const idMaterial * material
virtual int Read(void *buffer, int len)
void DeleteContents(bool clear)
virtual void ReadFromSaveGame(idFile *savefile)
BSEntity(idGameBearShootWindow *_game)
void ReadSaveGameString(idStr &string, idFile *savefile)
void WriteSaveGameString(const char *string, idFile *savefile)
GLenum GLsizei GLsizei height
idDeclManager * declManager
void SetSize(float _width, float _height)
virtual const char * Activate(bool activate)
int Append(const type &obj)
virtual bool ParseInternalVar(const char *name, idParser *src)
idUserInterfaceLocal * gui
virtual void ReadFromSaveGame(idFile *savefile)
virtual void WriteToSaveGame(idFile *savefile)
idList< BSEntity * > entities
virtual int Write(const void *buffer, int len)
virtual void Draw(int time, float x, float y)
void SetSort(float s) const
int FindIndex(const type &obj) const
virtual const char * HandleEvent(const sysEvent_t *event, bool *updateVisuals)
virtual void WriteToSaveGame(idFile *savefile)
void Set(const float x, const float y)
float dot(float a[], float b[])
char * va(const char *fmt,...)
virtual const char * HandleEvent(const sysEvent_t *event, bool *updateVisuals)
virtual void HandleNamedEvent(const char *namedEvent)
void SetFloat(const float value)
virtual idWinVar * GetWinVarByName(const char *_name, bool winLookup=false, drawWin_t **owner=NULL)
virtual void ReadFromSaveGame(idFile *savefile)
virtual void ReadFromSaveGame(idFile *savefile, idGameBearShootWindow *_game)
static float Cos(float a)