Commit 76cf9570 authored by Steven Fuller's avatar Steven Fuller

moved the glob code around a little...

parent e3ee07e4
...@@ -2522,9 +2522,6 @@ void DrawOutline(int x,int y,int w,int h,int color1,int color2) ...@@ -2522,9 +2522,6 @@ void DrawOutline(int x,int y,int w,int h,int color1,int color2)
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
void SetupControlPanel() void SetupControlPanel()
{ {
#ifdef DOSISM /* DOS VERSION */
#ifdef HAVE_FFBLK
struct ffblk f;
int which; int which;
// //
...@@ -2549,6 +2546,9 @@ void SetupControlPanel() ...@@ -2549,6 +2546,9 @@ void SetupControlPanel()
// //
// SEE WHICH SAVE GAME FILES ARE AVAILABLE & READ STRING IN // SEE WHICH SAVE GAME FILES ARE AVAILABLE & READ STRING IN
// //
{
#if defined(HAVE_FFBLK)
struct ffblk f;
if (!findfirst(SaveNaame,&f,0)) if (!findfirst(SaveNaame,&f,0))
do do
...@@ -2564,34 +2564,10 @@ void SetupControlPanel() ...@@ -2564,34 +2564,10 @@ void SetupControlPanel()
} }
} }
} while(!findnext(&f)); } while(!findnext(&f));
#else #elif defined(HAVE_FINDDATA)
struct _finddata_t f; struct _finddata_t f;
int which;
long hand; long hand;
//
// CACHE GRAPHICS & SOUNDS
//
CA_CacheGrChunk(STARTFONT+1);
#ifndef SPEAR
CacheLump(CONTROLS_LUMP_START,CONTROLS_LUMP_END);
#else
CacheLump(BACKDROP_LUMP_START,BACKDROP_LUMP_END);
#endif
SETFONTCOLOR(TEXTCOLOR,BKGDCOLOR);
fontnumber=1;
WindowH=200;
if (!ingame)
CA_LoadAllSounds();
else
MainMenu[savegame].active=1;
//
// SEE WHICH SAVE GAME FILES ARE AVAILABLE & READ STRING IN
//
if ((hand = _findfirst(SaveName, &f)) != -1) if ((hand = _findfirst(SaveName, &f)) != -1)
do do
{ {
...@@ -2606,28 +2582,9 @@ void SetupControlPanel() ...@@ -2606,28 +2582,9 @@ void SetupControlPanel()
} }
} }
} while(_findnext(hand, &f) != -1); } while(_findnext(hand, &f) != -1);
#endif
#else #else
glob_t globbuf; glob_t globbuf;
int which, x; int x;
CA_CacheGrChunk(STARTFONT+1);
#ifndef SPEAR
CacheLump(CONTROLS_LUMP_START, CONTROLS_LUMP_END);
#else
CacheLump(BACKDROP_LUMP_START, BACKDROP_LUMP_END);
#endif
SETFONTCOLOR(TEXTCOLOR, BKGDCOLOR);
fontnumber = 1;
WindowH = 200;
if (!ingame)
CA_LoadAllSounds();
else
MainMenu[savegame].active = 1;
if (glob(SaveName, 0, NULL, &globbuf)) if (glob(SaveName, 0, NULL, &globbuf))
return; return;
...@@ -2643,10 +2600,13 @@ void SetupControlPanel() ...@@ -2643,10 +2600,13 @@ void SetupControlPanel()
} }
} }
} }
globfree(&globbuf); globfree(&globbuf);
#endif #endif
} }
}
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
// //
...@@ -3224,8 +3184,7 @@ void ShootSnd() ...@@ -3224,8 +3184,7 @@ void ShootSnd()
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
void CheckForEpisodes() void CheckForEpisodes()
{ {
#ifdef DOSISM /* DOS VERSION */ #if defined(HAVE_FFBLK)
#ifdef HAVE_FFBLK
struct ffblk f; struct ffblk f;
// //
// ENGLISH // ENGLISH
...@@ -3273,13 +3232,10 @@ void CheckForEpisodes() ...@@ -3273,13 +3232,10 @@ void CheckForEpisodes()
if (!findfirst("*.wl1",&f,FA_ARCH)) { if (!findfirst("*.wl1",&f,FA_ARCH)) {
strcpy(extension, "wl1"); strcpy(extension, "wl1");
} else } else
Quit("NO WOLFENSTEIN 3-D DATA FILES to be found!"); Quit("NO WOLFENSTEIN 3-D DATA FILES TO BE FOUND!");
#endif /* SPEAR */ #endif /* SPEAR */
strcat(configname, extension); #elif defined(HAVE_FINDDATA)
strcat(SaveName, extension);
#else
struct _finddata_t f; struct _finddata_t f;
...@@ -3329,13 +3285,9 @@ void CheckForEpisodes() ...@@ -3329,13 +3285,9 @@ void CheckForEpisodes()
if (_findfirst("*.wl1",&f) != -1) { if (_findfirst("*.wl1",&f) != -1) {
strcpy(extension, "wl1"); strcpy(extension, "wl1");
} else } else
Quit("NO WOLFENSTEIN 3-D DATA FILES to be found!"); Quit("NO WOLFENSTEIN 3-D DATA FILES TO BE FOUND!");
#endif /* SPEAR */ #endif /* SPEAR */
strcat(configname, extension);
strcat(SaveName, extension);
#endif
#else #else
glob_t globbuf; glob_t globbuf;
// //
...@@ -3382,13 +3334,12 @@ void CheckForEpisodes() ...@@ -3382,13 +3334,12 @@ void CheckForEpisodes()
if (glob("*.wl1", 0, NULL, &globbuf) == 0) { if (glob("*.wl1", 0, NULL, &globbuf) == 0) {
strcpy(extension, "wl1"); strcpy(extension, "wl1");
} else } else
Quit("NO WOLFENSTEIN 3-D DATA FILES to be found!"); Quit("NO WOLFENSTEIN 3-D DATA FILES TO BE FOUND!");
#endif /* SPEAR */ #endif /* SPEAR */
strcat(configname, extension);
strcat(SaveName, extension);
globfree(&globbuf); globfree(&globbuf);
#endif #endif
strcat(configname, extension);
strcat(SaveName, extension);
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment