diff --git a/src/main.c b/src/main.c index d0147956c..3fa2828f9 100644 --- a/src/main.c +++ b/src/main.c @@ -169,7 +169,8 @@ int FPSB = 0; int MSIGN =-1; //int CGOL = 0; //int GSPEED = 1;//causes my .exe to crash.. -int sound_enable; +int sound_enable = 0; +int file_script = 0; sign signs[MAXSIGNS]; @@ -1214,16 +1215,7 @@ int main(int argc, char *argv[]) fmt.samples = 512; fmt.callback = mixaudio; fmt.userdata = NULL; - /* Open the audio device and start playing sound! */ - if ( SDL_OpenAudio(&fmt, NULL) < 0 ) - { - fprintf(stderr, "Unable to open audio: %s\n", SDL_GetError()); - } - else - { - sound_enable = 1; - SDL_PauseAudio(0); - } + #ifdef MT numCores = core_count(); #endif @@ -1276,6 +1268,24 @@ int main(int argc, char *argv[]) //sdl_scale = 2; //Removed because some displays cannot handle the resolution hud_enable = 0; } + else if (!strncmp(argv[i], "sound", 5)) + { + /* Open the audio device and start playing sound! */ + if ( SDL_OpenAudio(&fmt, NULL) < 0 ) + { + fprintf(stderr, "Unable to open audio: %s\n", SDL_GetError()); + } + else + { + sound_enable = 1; + SDL_PauseAudio(0); + } + } + else if (!strncmp(argv[i], "scripts", 5)) + { + file_script = 1; + } + } save_presets(0); @@ -2767,84 +2777,93 @@ int process_command(pixel *vid_buf,char *console,char *console_error) { } else if(strcmp(console2, "file")==0 && console3) { - FILE *f=fopen(console3, "r"); - if(f) - { - char fileread[5000];//TODO: make this change with file size - char pch[5000]; - char tokens[10]; - int tokensize; - nx = 0; - ny = 0; - j = 0; - m = 0; - if(console4) - console_parse_coords(console4, &nx , &ny, console_error); - memset(pch,0,sizeof(pch)); - memset(fileread,0,sizeof(fileread)); - fread(fileread,1,5000,f); - for(i=0; i