save_image(temp);
}
-
-
void Game::SetUpLighting(){
if(environment==snowyenvironment)
light.setColors(.65,.65,.7,.4,.4,.44);
return -1;
}
-void Game::Setenvironment(int which)
+void Game::Setenvironment(int which)
{
LOGFUNC;
texdetail=temptexdetail;
- }
- if(environment==desertenvironment){
+ } else if(environment==desertenvironment){
windvector=0;
windvector.z=2;
LoadTexture(":Data:Textures:deserttree.png",&objects.treetextureptr,0,1);
texdetail=temptexdetail;
- }
- if(environment==grassyenvironment){
+ } else if(environment==grassyenvironment){
windvector=0;
windvector.z=2;
LoadTexture(":Data:Textures:tree.png",&objects.treetextureptr,0,1);
texdetail=temptexdetail;
}
-
void Game::Loadlevel(int which){
stealthloading=0;
whichlevel=which;
visibleloading=0;
}
-
-
/*
Values of mainmenu :
1 Main menu
break;
case 8:
flash();
-
- if(newdetail>2) newdetail=detail;
- if(newdetail<0) newdetail=detail;
- if(newscreenwidth<0) newscreenwidth=screenwidth;
- if(newscreenheight<0) newscreenheight=screenheight;
-
+
SaveSettings(*this);
mainmenu=gameon?2:1;
break;
flash();
mainmenu=3;
-
- if(newdetail>2) newdetail=detail;
- if(newdetail<0) newdetail=detail;
- if(newscreenwidth>3000) newscreenwidth=screenwidth;
- if(newscreenwidth<0) newscreenwidth=screenwidth;
- if(newscreenheight>3000) newscreenheight=screenheight;
- if(newscreenheight<0) newscreenheight=screenheight;
}
}
break;
if(Input::isKeyDown(SDLK_q) && Input::isKeyDown(SDLK_LMETA)){
tryquit=1;
- if(mainmenu==3){
- if(newdetail>2) newdetail=detail;
- if(newdetail<0) newdetail=detail;
- if(newscreenwidth<0) newscreenwidth=screenwidth;
- if(newscreenheight<0) newscreenheight=screenheight;
-
+ if(mainmenu==3) {
SaveSettings(*this);
}
}
}
}
-
-
void Game::doDebugKeys(){
float headprop,bodyprop,armprop,legprop;
if(debugmode){
}
}
-
-
void Game::doJumpReversals(){
for(int k=0;k<numplayers;k++)
for(int i=k;i<numplayers;i++){
}
}
-
-
void Game::doAI(int i){
static bool connected;
if(player[i].aitype!=playercontrolled&&indialogue==-1){
}
}
-
-
void Game::Tick(){
static XYZ facing,flatfacing;
static int target;
}
//finished with settings menu
if(mainmenu==3){
- if(newdetail>2)
- newdetail=detail;
- if(newdetail<0)
- newdetail=detail;
- if(newscreenwidth<0)
- newscreenwidth=screenwidth;
- if(newscreenheight<0)
- newscreenheight=screenheight;
SaveSettings(*this);
}
//effects
if(Input::isKeyDown(SDLK_q)&&Input::isKeyDown(SDLK_LMETA)){
tryquit=1;
- if(mainmenu==3){
- if(newdetail>2)newdetail=detail;
- if(newdetail<0)newdetail=detail;
- if(newscreenwidth<0)newscreenwidth=screenwidth;
- if(newscreenheight<0)newscreenheight=screenheight;
-
+ if(mainmenu==3) {
SaveSettings(*this);
}
}
Screenshot();
}
-
-
-void Game::TickOnce(){
+void Game::TickOnce(){
if(mainmenu)
rotation+=multiplier*5;
else
}
}
-void Game::TickOnceAfter(){
+void Game::TickOnceAfter(){
static XYZ colviewer;
static XYZ coltarget;
static XYZ target;
}
void SaveSettings(Game &game) {
+ if(game.newdetail<0) game.newdetail=0;
+ if(game.newdetail>2) game.newdetail=2;
+ if(game.newscreenwidth>3000) game.newscreenwidth=screenwidth;
+ if(game.newscreenwidth<0) game.newscreenwidth=screenwidth;
+ if(game.newscreenheight>3000) game.newscreenheight=screenheight;
+ if(game.newscreenheight<0) game.newscreenheight=screenheight;
ofstream opstream(ConvertFileName(":Data:config.txt", "w"));
opstream << "Screenwidth:\n";
opstream << game.newscreenwidth;