diff --git a/programs/games/doom/trunk/d_main.c b/programs/games/doom/trunk/d_main.c index 2fa8e41a49..4d8ff0033b 100644 --- a/programs/games/doom/trunk/d_main.c +++ b/programs/games/doom/trunk/d_main.c @@ -1,4 +1,4 @@ -// Emacs style mode select -*- C++ -*- +// Emacs style mode select -*- C++ -*- //----------------------------------------------------------------------------- // // $Id:$ @@ -160,12 +160,12 @@ void D_PostEvent (event_t* ev) void D_ProcessEvents (void) { event_t* ev; - + // IF STORE DEMO, DO NOT ACCEPT INPUT if ( ( gamemode == commercial ) && (W_CheckNumForName("map01")<0) ) return; - + for ( ; eventtail != eventhead ; eventtail = (++eventtail)&(MAXEVENTS-1) ) { ev = &events[eventtail]; @@ -213,9 +213,9 @@ void D_Display (void) { XXX(0); return; // for comparative timing / profiling - } + } redrawsbar = false; - + // change the view size if needed if (setsizeneeded) { @@ -233,7 +233,7 @@ void D_Display (void) wipe = true; wipe_StartScreen(0, 0, SCREENWIDTH, SCREENHEIGHT); } - else + else wipe = false; XXX(6); @@ -275,12 +275,12 @@ void D_Display (void) XXX(14); break; } - + // draw buffered stuff to screen XXX(15); I_UpdateNoBlit (); XXX(16); - + // draw the view directly if (gamestate == GS_LEVEL && !automapactive && gametic) R_RenderPlayerView (&players[displayplayer]); @@ -289,7 +289,7 @@ void D_Display (void) if (gamestate == GS_LEVEL && gametic) HU_Drawer (); XXX(18); - + // clean up border stuff if (gamestate != oldgamestate && gamestate != GS_LEVEL) I_SetPalette (W_CacheLumpName ("PLAYPAL",PU_CACHE)); @@ -326,7 +326,7 @@ void D_Display (void) viewactivestate = viewactive; inhelpscreensstate = inhelpscreens; oldgamestate = wipegamestate = gamestate; - + // draw pause pic if (paused) { @@ -356,7 +356,7 @@ void D_Display (void) return; } XXX(32); - + // wipe update wipe_EndScreen(0, 0, SCREENWIDTH, SCREENHEIGHT); XXX(33); @@ -395,23 +395,23 @@ void D_DoomLoop (void) { if (demorecording) G_BeginRecording (); - + if (M_CheckParm ("-debugfile")) { char filename[32]; sprintf (filename,"debug%i.txt",consoleplayer); debugfile = fopen (filename,"w"); } - + I_InitGraphics (); while (1) { // frame syncronous IO operations XXX(100); - I_StartFrame (); + I_StartFrame (); XXX(101); - + // process one or more tics if (singletics) { @@ -420,11 +420,11 @@ void D_DoomLoop (void) D_ProcessEvents (); G_BuildTiccmd (&netcmds[consoleplayer][maketic%BACKUPTICS]); - + if (advancedemo) - { + { D_DoAdvanceDemo (); - }; + }; M_Ticker (); G_Ticker (); gametic++; @@ -436,7 +436,7 @@ void D_DoomLoop (void) S_UpdateSounds (players[consoleplayer].mo);// move positional sounds D_Display (); - // I_UpdateSound(); + // I_UpdateSound(); XXX(105); } } @@ -498,7 +498,7 @@ void D_AdvanceDemo (void) demosequence = (demosequence+1)%7; else demosequence = (demosequence+1)%6; - + switch (demosequence) { case 0: @@ -579,13 +579,13 @@ void D_AddFile (char *file) { int numwadfiles; char *newfile; - + for (numwadfiles = 0 ; wadfiles[numwadfiles] ; numwadfiles++) ; newfile = malloc (strlen(file)+1); strcpy (newfile, file); - + wadfiles[numwadfiles] = newfile; } @@ -619,11 +619,11 @@ void IdentifyVersion (void) // Retail. doomuwad = malloc(strlen(doomwaddir)+1+8+1); sprintf(doomuwad, "%s/doomu.wad", doomwaddir); - + // Registered. doomwad = malloc(strlen(doomwaddir)+1+8+1); sprintf(doomwad, "%s/doom.wad", doomwaddir); - + // Shareware. doom1wad = malloc(strlen(doomwaddir)+1+9+1); sprintf(doom1wad, "%s/doom1.wad", doomwaddir); @@ -631,7 +631,7 @@ void IdentifyVersion (void) // Bug, dear Shawn. // Insufficient malloc, caused spurious realloc errors. plutoniawad = malloc(strlen(doomwaddir)+1+/*9*/12+1); - sprintf(plutoniawad, "%splutonia.wad", doomwaddir); + sprintf(plutoniawad, "%s/plutonia.wad", doomwaddir); tntwad = malloc(strlen(doomwaddir)+1+9+1); sprintf(tntwad, "%s/tnt.wad", doomwaddir); @@ -679,7 +679,7 @@ void IdentifyVersion (void) D_AddFile (DEVDATA"tnt.wad"); else*/ D_AddFile (DEVDATA"doom2.wad"); - + D_AddFile (DEVMAPS"cdata/texture1.lmp"); D_AddFile (DEVMAPS"cdata/pnames.lmp"); strcpy (basedefault,DEVDATA"default.cfg"); @@ -753,7 +753,7 @@ void FindResponseFile (void) { int i; #define MAXARGVS 100 - + for (i = 1;i < myargc;i++) if (myargv[i][0] == '@') { @@ -766,7 +766,7 @@ void FindResponseFile (void) char *file; char *moreargs[20]; char *firstargv; - + // READ THE RESPONSE FILE INTO MEMORY handle = fopen (&myargv[i][1],"rb"); if (!handle) @@ -781,16 +781,16 @@ void FindResponseFile (void) // file = malloc (size); // fread (file,size,1,handle); // fclose (handle); - + // KEEP ALL CMDLINE ARGS FOLLOWING @RESPONSEFILE ARG for (index = 0,k = i+1; k < myargc; k++) moreargs[index++] = myargv[k]; - + firstargv = myargv[0]; myargv = malloc(sizeof(char *)*MAXARGVS); memset(myargv,0,sizeof(char *)*MAXARGVS); myargv[0] = firstargv; - + infile = file; indexinfile = k = 0; indexinfile++; // SKIP PAST ARGV[0] (KEEP IT) @@ -805,11 +805,11 @@ void FindResponseFile (void) ((*(infile+k)<= ' ') || (*(infile+k)>'z'))) k++; } while(k < size); - + for (k = 0;k < index;k++) myargv[indexinfile++] = moreargs[k]; myargc = indexinfile; - + // DISPLAY ARGS // __libclog_printf("%d command-line args:\n",myargc); // for (k=1;k