glEnable(GL_TEXTURE_2D);
glColor4f(.5,.5,.5,1);
- if(!console){
+ if(!console) {
sprintf (string, " ",(int)(fps));
text.glPrint(10,30,string,0,.8,screenwidth,screenheight);
glDepthMask(1);
}
- if(flashamount>0&&damageeffects){
+ if(flashamount>0&&damageeffects) {
if(flashamount>1)flashamount=1;
if(flashdelay<=0)flashamount-=multiplier;
flashdelay--;
glDepthMask(1);
}
- if(!console){
+ if(!console) {
displaytime[0]=0;
glEnable(GL_TEXTURE_2D);
glColor4f(1,1,1,1);
text.glPrint(30+(float)(displayselected)*10,30+(screenheight-330),string,0,1,screenwidth,screenheight);
}
}
- for(i=0;i<15;i++){
+ for(i=0;i<15;i++) {
if((i!=0||chatting)&&displaytime[i]<4)
- for(j=0;j<displaychars[i];j++){
+ for(j=0;j<displaychars[i];j++) {
glColor4f(1,1,1,4-displaytime[i]);
- if(j<displaychars[i]){
+ if(j<displaychars[i]) {
sprintf (string, "%c",displaytext[i][j]);
text.glPrint(30+j*10,30+i*20+(screenheight-330),string,0,1,screenwidth,screenheight);
}
}
static const char *cmd_names[] = {
-#define DECLARE_COMMAND(cmd) #cmd " ",
+#define DECLARE_COMMAND(cmd) #cmd,
#include "ConsoleCmds.h"
#undef DECLARE_COMMAND
};
for (i = 0; i < n_cmds; i++)
if (stripfx(cmd, cmd_names[i]))
{
- cmd_handlers[i](game, cmd + strlen(cmd_names[i]));
- break;
+ cmd_handlers[i](game, cmd + strlen(cmd_names[i])+1);
+ break;
}
emit_sound_np(i < n_cmds ? consolesuccesssound : consolefailsound);
}
texdetail=temptexdetail;
}
-void Game::Loadlevel(int which){
+void Game::Loadlevel(int which) {
stealthloading=0;
whichlevel=which;
- if(which == -1){
+ if(which == -1) {
tutoriallevel = -1;
Loadlevel("tutorial");
- }else if(which >= 0 && which <= 15){
+ } else if(which >= 0 && which <= 15) {
char buf[32];
snprintf(buf, 32, "map%d", which + 1); // challenges
Loadlevel(buf);
- }else
+ } else
Loadlevel("mapsave");
}
-void Game::Loadlevel(const char *name){
+void Game::Loadlevel(const char *name) {
int templength;
float lamefloat;
static const char *pfx = ":Data:Maps:";
if(chatting)
keyboardfrozen=true;
- if(Input::isKeyPressed(consolekey)&&debugmode){
+ if(Input::isKeyPressed(consolekey)&&debugmode) {
console=!console;
- if(console){
+ if(console) {
OPENAL_SetFrequency(OPENAL_ALL, 0.001);
} else {
freeze=0;
if(console)
freeze=1;
- if(console&&!Input::isKeyDown(SDLK_LMETA)){
+ if(console&&!Input::isKeyDown(SDLK_LMETA)) {
inputText(consoletext[0],&consoleselected,&consolechars[0]);
if(!waiting) {
archiveselected=0;
- if(consolechars[0]>0){
- consoletext[0][consolechars[0]]=' ';
+ if(consolechars[0]>0) {
+ consoletext[0][consolechars[0]]='\0';
cmd_dispatch(this, consoletext[0]);
- for(int k=14;k>=1;k--){
+ for(int k=14;k>=1;k--) {
for(int j=0;j<255;j++)
consoletext[k][j]=consoletext[k-1][j];
consolechars[k]=consolechars[k-1];
}
consoleblinkdelay-=multiplier;
- if(consoleblinkdelay<=0){
+ if(consoleblinkdelay<=0) {
consoleblinkdelay=.3;
consoleblink=1-consoleblink;
}