// Game object
// Copyright (C) 2002 David Rosen
// Copyright (C) 2003 Steven Fuller
// Copyright (C) 2003 Zachary Jack Slater
// Copyright (C) 2021 Nguyễn Gia Phong
//
// This file is part of Black Shades.
//
// Black Shades 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.
//
// Black Shades 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 Black Shades. If not, see .
#ifndef BLACKSHADES_GAME_H
#define BLACKSHADES_GAME_H
#define num_blocks 100
#define block_spacing 360
#define max_people 90
#define max_people_block 20
extern float multiplier;
#include
#include
#include
#include
#include "Camera.h"
#include "Quaternions.h"
#include "config.h"
#include "misc.h"
#ifdef __cplusplus
#include "Skeleton.h"
#include "Models.h"
#include "Text.h"
#include "Sprites.h"
#include "Person.h"
#include "Decals.h"
struct Game {
// Graphics
int screenwidth, screenheight;
float viewdistance;
// Mouse
float mouse_sensitivity;
// Project specific
int cityrotation[num_blocks][num_blocks];
int citytype[num_blocks][num_blocks];
int citypeoplenum[num_blocks][num_blocks];
bool initialized = false;
float flashamount;
float flashr,flashg,flashb;
int enemystate;
float losedelay;
Model blocks[4];
Model blockwalls[4];
Model blockcollide[4];
Model blocksimplecollide[4];
Model blockroofs[4];
Model blockocclude;
Model sidewalkcollide;
Model street;
Model Bigstreet;
Model path;
Model blocksimple;
struct XYZ boundingpoints[8];
Text text;
int goodkills;
int badkills;
int civkills;
bool debug;
bool paused;
bool menu;
struct XYZ lastshot[2];
bool zoom;
int numpeople;
float spawndelay;
bool musictoggle;
float psychicpower;
int type;
int mouseoverbutton;
Person person[max_people];
GLuint personspritetextureptr;
GLuint deadpersonspritetextureptr;
GLuint scopetextureptr;
GLuint flaretextureptr;
void *decals;
bool gameinprogress;
bool beatgame;
int murderer;
float timeremaining;
int whichsong;
int highscore;
int score;
int mission;
int nummissions;
struct Level* levels;
int numpossibleguns;
int possiblegun[6];
int evilprobability;
float difficulty;
// Game functions
void DrawGLScene();
void Tick();
};
#else // __cplusplus
typedef struct Game Game;
#endif // __cplusplus
#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
Game* makeGame(void *decals, struct Config config, struct Scores scores);
void initGl(Game* game);
void initGame(Game* game);
void resizeWindow(Game* game, int width, int height);
void look(Game* game, double xpos, double ypos);
void click(Game* game, int button, int action, int mods);
void handleKey(Game* game, int key, int action, int mods);
void setMenu(Game* game, bool value);
void eventLoop(Game* game);
struct Scores getScores(Game* game);
void closeGame(Game* game);
#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
#endif // BLACKSHADES_GAME_H