#include "Game.hpp"
#include "Utils/Folders.hpp"
-extern bool visibleloading;
-
std::vector<Animation> Animation::animations;
void Animation::loadAll()
height = aheight;
attack = aattack;
- if (visibleloading)
- Game::LoadingScreen();
+ Game::LoadingScreen();
// read file in binary mode
tfile = Folders::openMandatoryFile( filepath, "rb" );
extern int whichjointstartarray[26];
extern int whichjointendarray[26];
-extern bool visibleloading;
-
Skeleton::Skeleton() :
selected(0),
id(0),
extern bool decals;
extern float blurness;
extern float targetblurness;
-extern bool visibleloading;
extern bool skyboxtexture;
//Functions
}
}
texture.bpp = 24;
- if (visibleloading)
- Game::LoadingScreen();
+ Game::LoadingScreen();
texdetail = temptexdetail;
}
}
- if (visibleloading)
- Game::LoadingScreen();
+ Game::LoadingScreen();
float slopeness;
textureness[i][j] = -1;
}
}
- if (visibleloading)
- Game::LoadingScreen();
+ Game::LoadingScreen();
for (i = 0; i < size; i++) {
}
}
}
- if (visibleloading)
- Game::LoadingScreen();
+ Game::LoadingScreen();
for (i = 0; i < size; i++) {
for (j = 0; j < size; j++) {
}
}
}
- if (visibleloading)
- Game::LoadingScreen();
+ Game::LoadingScreen();
for (i = 0; i < size; i++) {
for (j = 0; j < size; j++) {
}
}
}
- if (visibleloading)
- Game::LoadingScreen();
+ Game::LoadingScreen();
patch_size = size / subdivision;
patch_elements = (patch_size) * (patch_size) * 54;
glEnable(GL_BLEND);
UpdateTransparency(whichx, whichy);
}
+
glColor4f(1, 1, 1, 1);
+
//Set up vertex array
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_COLOR_ARRAY);
UpdateTransparency(whichx, whichy);
}
UpdateTransparencyother(whichx, whichy);
+
glColor4f(1, 1, 1, 1);
+
//Set up vertex array
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_COLOR_ARRAY);
}
}
}
- if (visibleloading)
- Game::LoadingScreen();
+ Game::LoadingScreen();
}
brightness = dotproduct(&lightloc, &normals[i][j]);
if (shadowed)
}
}
- if (visibleloading)
- Game::LoadingScreen();
+ Game::LoadingScreen();
//Smooth shadows
for (i = 0; i < size; i++) {
XYZ getLighting(float pointx, float pointz);
XYZ getNormal(float pointx, float pointz);
void UpdateVertexArray(int whichx, int whichy);
- void UpdateTransparency(int whichx, int whichy);
- void UpdateTransparencyother(int whichx, int whichy);
- void UpdateTransparencyotherother(int whichx, int whichy);
bool load(const std::string& fileName);
void CalculateNormals();
void drawdecals();
void draw(int layer);
- void drawpatch(int whichx, int whichy, float opacity);
- void drawpatchother(int whichx, int whichy, float opacity);
- void drawpatchotherother(int whichx, int whichy, float opacity);
void DoShadows();
Terrain();
+
+private:
+ void drawpatch(int whichx, int whichy, float opacity);
+ void drawpatchother(int whichx, int whichy, float opacity);
+ void drawpatchotherother(int whichx, int whichy, float opacity);
+ void UpdateTransparency(int whichx, int whichy);
+ void UpdateTransparencyother(int whichx, int whichy);
+ void UpdateTransparencyotherother(int whichx, int whichy);
};
#endif
void Game::LoadingScreen()
{
+ if (!visibleloading) {
+ return;
+ }
+
static float loadprogress;
static AbsoluteTime frametime = {0, 0};
AbsoluteTime currTime = UpTime ();
stillloading = 1;
- visibleloading = 0; //don't use loadscreentexture yet
+ visibleloading = false; //don't use loadscreentexture yet
loadscreentexture.load("Textures/Fire.jpg", 1);
- visibleloading = 1;
+ visibleloading = true;
temptexdetail = texdetail;
texdetail = 1;
loading = 0;
changedelay = 1;
- visibleloading = 0;
+ visibleloading = false;
}
LOG(std::string("Loading level...") + name);
if (!gameon)
- visibleloading = 1;
+ visibleloading = true;
if (stealthloading)
- visibleloading = 0;
+ visibleloading = false;
if (!stillloading)
loadtime = 0;
gamestarted = 1;
terrain.patchobjectnum[i][j] = 0;
}
}
- if (visibleloading)
- LoadingScreen();
+ Game::LoadingScreen();
}
weapons.clear();
weapons.push_back(Weapon(type, 0));
}
- if (visibleloading)
- LoadingScreen();
+ Game::LoadingScreen();
funpackf(tfile, "Bf Bf Bf", &Person::players[0]->armorhead, &Person::players[0]->armorhigh, &Person::players[0]->armorlow);
funpackf(tfile, "Bf Bf Bf", &Person::players[0]->protectionhead, &Person::players[0]->protectionhigh, &Person::players[0]->protectionlow);
Hotspot::hotspots.clear();
}
- if (visibleloading)
- LoadingScreen();
+ Game::LoadingScreen();
if (!stealthloading) {
Object::ComputeCenter();
-
- if (visibleloading)
- LoadingScreen();
-
Object::ComputeRadius();
}
- if (visibleloading)
- LoadingScreen();
+ Game::LoadingScreen();
int numplayers;
funpackf(tfile, "Bi", &numplayers);
cerr << "Invalid Person found in " << name << endl;
}
}
- if (visibleloading)
- LoadingScreen();
+ Game::LoadingScreen();
funpackf(tfile, "Bi", &numpathpoints);
if (numpathpoints > 30 || numpathpoints < 0)
funpackf(tfile, "Bi", &pathpointconnect[j][k]);
}
}
- if (visibleloading)
- LoadingScreen();
+ Game::LoadingScreen();
funpackf(tfile, "Bf Bf Bf Bf", &mapcenter.x, &mapcenter.y, &mapcenter.z, &mapradius);
if (!stealthloading) {
Object::AddObjectsToTerrain();
terrain.DoShadows();
- if (visibleloading)
- LoadingScreen();
+ Game::LoadingScreen();
Object::DoShadows();
- if (visibleloading)
- LoadingScreen();
+ Game::LoadingScreen();
}
fclose(tfile);
for (unsigned i = 0; i < Person::players.size(); i++) {
- if (visibleloading)
- LoadingScreen();
+ Game::LoadingScreen();
if (i == 0) {
Person::players[i]->burnt = 0;
Person::players[i]->bled = 0;
}
- if (visibleloading)
- LoadingScreen();
+ Game::LoadingScreen();
if (cellophane) {
Person::players[i]->proportionhead.z = 0;
hawkcoords = Person::players[0]->coords;
hawkcoords.y += 30;
- if (visibleloading)
- LoadingScreen();
+ Game::LoadingScreen();
LOG("Starting background music...");
leveltime = 0;
wonleveltime = 0;
- visibleloading = 0;
+ visibleloading = false;
}
void doDevKeys()
LoadStuff();
whichchoice = 0;
actuallevel = campaignlevels[actuallevel].nextlevel.front();
- visibleloading = 1;
+ visibleloading = true;
stillloading = 1;
Loadlevel(campaignlevels[actuallevel].mapname.c_str());
campaign = 1;
#include <SDL.h>
#include <string>
-bool visibleloading = 0;
+bool visibleloading = false;
float volume = 0;
bool ismotionblur = false;
extern float texdetail;
extern bool decals;
-extern bool visibleloading;
-
int Model::LineCheck(XYZ *p1, XYZ *p2, XYZ *p, XYZ *move, float *rotate)
{
static int j;
LOG(std::string("Loading model...") + filename);
- if (visibleloading)
- Game::LoadingScreen();
+ Game::LoadingScreen();
type = normaltype;
color = 0;
void Model::CalculateNormals(bool facenormalise)
{
- if (visibleloading)
- Game::LoadingScreen();
+ Game::LoadingScreen();
static int i;
if (type != normaltype && type != decalstype)
return;
LoadStuff();
whichchoice = selected - NB_CAMPAIGN_MENU_ITEM - Account::active().getCampaignChoicesMade();
actuallevel = (Account::active().getCampaignChoicesMade() > 0 ? campaignlevels[Account::active().getCampaignChoicesMade() - 1].nextlevel[whichchoice] : 0);
- visibleloading = 1;
+ visibleloading = true;
stillloading = 1;
Loadlevel(campaignlevels[actuallevel].mapname.c_str());
campaign = 1;
#include <stdio.h>
#include <zlib.h>
-extern bool visibleloading;
-
/* These two are needed for screenshot */
extern int kContextWidth;
extern int kContextHeight;
bool load_image(const char *file_name, ImageRec &tex)
{
- if (visibleloading) {
- Game::LoadingScreen();
- }
+ Game::LoadingScreen();
if ( tex.data == NULL ) {
return false;
extern float slomospeed;
extern float slomofreq;
-extern bool visibleloading;
extern int difficulty;