doom3-bfg/neo/ui/GameBearShootWindow.h

135 lines
3.8 KiB
C
Raw Normal View History

2012-11-26 18:58:24 +00:00
/*
===========================================================================
Doom 3 BFG Edition GPL Source Code
Copyright (C) 1993-2012 id Software LLC, a ZeniMax Media company.
2012-11-26 18:58:24 +00:00
This file is part of the Doom 3 BFG Edition GPL Source Code ("Doom 3 BFG Edition Source Code").
2012-11-26 18:58:24 +00:00
Doom 3 BFG Edition Source Code is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Doom 3 BFG Edition Source Code is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Doom 3 BFG Edition Source Code. If not, see <http://www.gnu.org/licenses/>.
In addition, the Doom 3 BFG Edition Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 BFG Edition Source Code. If not, please request a copy in writing from id Software at the address below.
If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
===========================================================================
*/
#ifndef __GAME_BEARSHOOT_WINDOW_H__
#define __GAME_BEARSHOOT_WINDOW_H__
class idGameBearShootWindow;
class BSEntity
{
2012-11-26 18:58:24 +00:00
public:
const idMaterial* material;
2012-11-26 18:58:24 +00:00
idStr materialName;
float width, height;
bool visible;
2012-11-26 18:58:24 +00:00
idVec4 entColor;
idVec2 position;
float rotation;
float rotationSpeed;
idVec2 velocity;
2012-11-26 18:58:24 +00:00
bool fadeIn;
bool fadeOut;
idGameBearShootWindow* game;
2012-11-26 18:58:24 +00:00
public:
BSEntity( idGameBearShootWindow* _game );
2012-11-26 18:58:24 +00:00
virtual ~BSEntity();
virtual void WriteToSaveGame( idFile* savefile );
virtual void ReadFromSaveGame( idFile* savefile, idGameBearShootWindow* _game );
void SetMaterial( const char* name );
2012-11-26 18:58:24 +00:00
void SetSize( float _width, float _height );
void SetVisible( bool isVisible );
2012-11-26 18:58:24 +00:00
virtual void Update( float timeslice );
virtual void Draw();
2012-11-26 18:58:24 +00:00
private:
};
class idGameBearShootWindow : public idWindow
{
2012-11-26 18:58:24 +00:00
public:
idGameBearShootWindow( idUserInterfaceLocal* gui );
2012-11-26 18:58:24 +00:00
~idGameBearShootWindow();
virtual void WriteToSaveGame( idFile* savefile );
virtual void ReadFromSaveGame( idFile* savefile );
virtual const char* HandleEvent( const sysEvent_t* event, bool* updateVisuals );
2012-11-26 18:58:24 +00:00
virtual void PostParse();
virtual void Draw( int time, float x, float y );
virtual const char* Activate( bool activate );
virtual idWinVar* GetWinVarByName( const char* _name, bool winLookup = false, drawWin_t** owner = NULL );
2012-11-26 18:58:24 +00:00
private:
void CommonInit();
void ResetGameState();
2012-11-26 18:58:24 +00:00
void UpdateBear();
void UpdateHelicopter();
void UpdateTurret();
void UpdateButtons();
void UpdateGame();
void UpdateScore();
virtual bool ParseInternalVar( const char* name, idTokenParser* src );
2012-11-26 18:58:24 +00:00
private:
idWinBool gamerunning;
idWinBool onFire;
idWinBool onContinue;
idWinBool onNewGame;
2012-11-26 18:58:24 +00:00
float timeSlice;
float timeRemaining;
bool gameOver;
2012-11-26 18:58:24 +00:00
int currentLevel;
int goalsHit;
bool updateScore;
bool bearHitTarget;
2012-11-26 18:58:24 +00:00
float bearScale;
bool bearIsShrinking;
int bearShrinkStartTime;
2012-11-26 18:58:24 +00:00
float turretAngle;
float turretForce;
2012-11-26 18:58:24 +00:00
float windForce;
int windUpdateTime;
2012-11-26 18:58:24 +00:00
idList<BSEntity*> entities;
BSEntity* turret;
BSEntity* bear;
BSEntity* helicopter;
BSEntity* goal;
BSEntity* wind;
BSEntity* gunblast;
2012-11-26 18:58:24 +00:00
};
#endif //__GAME_BEARSHOOT_WINDOW_H__