Conflicts:
	src/version.h
This commit is contained in:
Christoph Oelckers 2013-07-30 15:20:38 +02:00
commit ef6fca823e
18 changed files with 83 additions and 43 deletions

View file

@ -186,6 +186,9 @@ CVAR (Color, am_ovwallcolor, 0x00ff00, CVAR_ARCHIVE);
CVAR (Color, am_ovspecialwallcolor, 0xffffff, CVAR_ARCHIVE); CVAR (Color, am_ovspecialwallcolor, 0xffffff, CVAR_ARCHIVE);
CVAR (Color, am_ovthingcolor, 0xe88800, CVAR_ARCHIVE); CVAR (Color, am_ovthingcolor, 0xe88800, CVAR_ARCHIVE);
CVAR (Color, am_ovotherwallscolor, 0x008844, CVAR_ARCHIVE); CVAR (Color, am_ovotherwallscolor, 0x008844, CVAR_ARCHIVE);
CVAR (Color, am_ovefwallcolor, 0x008844, CVAR_ARCHIVE);
CVAR (Color, am_ovfdwallcolor, 0x008844, CVAR_ARCHIVE);
CVAR (Color, am_ovcdwallcolor, 0x008844, CVAR_ARCHIVE);
CVAR (Color, am_ovunseencolor, 0x00226e, CVAR_ARCHIVE); CVAR (Color, am_ovunseencolor, 0x00226e, CVAR_ARCHIVE);
CVAR (Color, am_ovtelecolor, 0xffff00, CVAR_ARCHIVE); CVAR (Color, am_ovtelecolor, 0xffff00, CVAR_ARCHIVE);
CVAR (Color, am_intralevelcolor, 0x0000ff, CVAR_ARCHIVE); CVAR (Color, am_intralevelcolor, 0x0000ff, CVAR_ARCHIVE);
@ -921,7 +924,9 @@ static void AM_initColors (bool overlayed)
ThingColor_Monster.FromCVar (am_ovthingcolor_monster); ThingColor_Monster.FromCVar (am_ovthingcolor_monster);
ThingColor.FromCVar (am_ovthingcolor); ThingColor.FromCVar (am_ovthingcolor);
LockedColor.FromCVar (am_ovotherwallscolor); LockedColor.FromCVar (am_ovotherwallscolor);
EFWallColor = FDWallColor = CDWallColor = LockedColor; EFWallColor.FromCVar (am_ovefwallcolor);
FDWallColor.FromCVar (am_ovfdwallcolor);
CDWallColor.FromCVar (am_ovcdwallcolor);
TSWallColor.FromCVar (am_ovunseencolor); TSWallColor.FromCVar (am_ovunseencolor);
NotSeenColor = TSWallColor; NotSeenColor = TSWallColor;
InterTeleportColor.FromCVar (am_ovtelecolor); InterTeleportColor.FromCVar (am_ovtelecolor);

View file

@ -505,7 +505,7 @@ bool FCajunMaster::LoadBots ()
bool gotteam = false; bool gotteam = false;
bglobal.ForgetBots (); bglobal.ForgetBots ();
#ifndef unix #ifndef __unix__
tmp = progdir; tmp = progdir;
tmp += "zcajun/" BOTFILENAME; tmp += "zcajun/" BOTFILENAME;
if (!FileExists (tmp)) if (!FileExists (tmp))

View file

@ -1742,7 +1742,7 @@ static bool C_HandleKey (event_t *ev, BYTE *buffer, int len)
} }
break; break;
#ifdef unix #ifdef __unix__
case EV_GUI_MButtonDown: case EV_GUI_MButtonDown:
C_PasteText(I_GetFromClipboard(true), buffer, len); C_PasteText(I_GetFromClipboard(true), buffer, len);
break; break;
@ -2125,16 +2125,16 @@ static bool C_TabCompleteList ()
const char* colorcode = ""; const char* colorcode = "";
FConsoleCommand* ccmd; FConsoleCommand* ccmd;
if (FindCVar (TabCommands[i].TabName, NULL)) if (FindCVar (TabCommands[i].TabName, NULL))
colorcode = "\\c[Green]"; colorcode = TEXTCOLOR_GREEN;
else if ((ccmd = FConsoleCommand::FindByName (TabCommands[i].TabName)) != NULL) else if ((ccmd = FConsoleCommand::FindByName (TabCommands[i].TabName)) != NULL)
{ {
if (ccmd->IsAlias()) if (ccmd->IsAlias())
colorcode = "\\c[Red]"; colorcode = TEXTCOLOR_RED;
else else
colorcode = "\\c[Light Blue]"; colorcode = TEXTCOLOR_LIGHTBLUE;
} }
Printf ("%s%-*s", strbin1 (colorcode).GetChars(), int(maxwidth), TabCommands[i].TabName.GetChars()); Printf ("%s%-*s", colorcode, int(maxwidth), TabCommands[i].TabName.GetChars());
x += maxwidth; x += maxwidth;
if (x > ConCols - maxwidth) if (x > ConCols - maxwidth)
{ {

View file

@ -1506,7 +1506,7 @@ CCMD (pullin)
{ {
const char *lastSlash; const char *lastSlash;
#ifdef unix #ifdef __unix__
lastSlash = strrchr (PullinFile, '/'); lastSlash = strrchr (PullinFile, '/');
#else #else
const char *lastSlash1, *lastSlash2; const char *lastSlash1, *lastSlash2;

View file

@ -169,7 +169,7 @@ bool CT_Responder (event_t *ev)
} }
return true; return true;
} }
#ifdef unix #ifdef __unix__
else if (ev->subtype == EV_GUI_MButtonDown) else if (ev->subtype == EV_GUI_MButtonDown)
{ {
CT_PasteChat(I_GetFromClipboard(true)); CT_PasteChat(I_GetFromClipboard(true));

View file

@ -2329,6 +2329,18 @@ static int DoInclude (int dummy)
return GetLine(); return GetLine();
} }
CVAR(Int, dehload, 0, CVAR_ARCHIVE) // Autoloading of .DEH lumps is disabled by default.
// checks if lump is a .deh or .bex file. Only lumps in the root directory are considered valid.
static bool isDehFile(int lumpnum)
{
const char* const fullName = Wads.GetLumpFullName(lumpnum);
const char* const extension = strrchr(fullName, '.');
return NULL != extension && strchr(fullName, '/') == NULL
&& (0 == stricmp(extension, ".deh") || 0 == stricmp(extension, ".bex"));
}
int D_LoadDehLumps() int D_LoadDehLumps()
{ {
int lastlump = 0, lumpnum, count = 0; int lastlump = 0, lumpnum, count = 0;
@ -2338,26 +2350,32 @@ int D_LoadDehLumps()
count += D_LoadDehLump(lumpnum); count += D_LoadDehLump(lumpnum);
} }
if (0 == PatchSize) if (0 == PatchSize && dehload > 0)
{ {
// No DEH/BEX patch is loaded yet, try to find lump(s) with specific extensions // No DEH/BEX patch is loaded yet, try to find lump(s) with specific extensions
for (lumpnum = 0, lastlump = Wads.GetNumLumps(); if (dehload == 1) // load all .DEH lumps that are found.
lumpnum < lastlump;
++lumpnum)
{ {
const char* const fullName = Wads.GetLumpFullName(lumpnum); for (lumpnum = 0, lastlump = Wads.GetNumLumps(); lumpnum < lastlump; ++lumpnum)
const char* const extension = strrchr(fullName, '.'); {
if (isDehFile(lumpnum))
const bool isDehOrBex = NULL != extension
&& (0 == stricmp(extension, ".deh") || 0 == stricmp(extension, ".bex"));
if (isDehOrBex)
{ {
count += D_LoadDehLump(lumpnum); count += D_LoadDehLump(lumpnum);
} }
} }
} }
else // only load the last .DEH lump that is found.
{
for (lumpnum = Wads.GetNumLumps()-1; lumpnum >=0; --lumpnum)
{
if (isDehFile(lumpnum))
{
count += D_LoadDehLump(lumpnum);
break;
}
}
}
}
return count; return count;
} }

View file

@ -38,7 +38,7 @@
#endif #endif
#include <float.h> #include <float.h>
#if defined(unix) || defined(__APPLE__) #if defined(__unix__) || defined(__APPLE__)
#include <unistd.h> #include <unistd.h>
#endif #endif
@ -2009,7 +2009,7 @@ static void AddAutoloadFiles(const char *gamesection)
D_AddFile (allwads, wad); D_AddFile (allwads, wad);
// [RH] Add any .wad files in the skins directory // [RH] Add any .wad files in the skins directory
#ifdef unix #ifdef __unix__
file = SHARE_DIR; file = SHARE_DIR;
#else #else
file = progdir; file = progdir;
@ -2017,7 +2017,7 @@ static void AddAutoloadFiles(const char *gamesection)
file += "skins"; file += "skins";
D_AddDirectory (allwads, file); D_AddDirectory (allwads, file);
#ifdef unix #ifdef __unix__
file = NicePath("~/" GAME_DIR "/skins"); file = NicePath("~/" GAME_DIR "/skins");
D_AddDirectory (allwads, file); D_AddDirectory (allwads, file);
#endif #endif
@ -2137,7 +2137,7 @@ static void CheckCmdLine()
Printf ("%s", GStrings("D_DEVSTR")); Printf ("%s", GStrings("D_DEVSTR"));
} }
#if !defined(unix) && !defined(__APPLE__) #if !defined(__unix__) && !defined(__APPLE__)
// We do not need to support -cdrom under Unix, because all the files // We do not need to support -cdrom under Unix, because all the files
// that would go to c:\\zdoomdat are already stored in .zdoom inside // that would go to c:\\zdoomdat are already stored in .zdoom inside
// the user's home directory. // the user's home directory.

View file

@ -862,7 +862,10 @@ static void ChangeSpy (int changespy)
int pnum = consoleplayer; int pnum = consoleplayer;
if (changespy != SPY_CANCEL) if (changespy != SPY_CANCEL)
{ {
pnum = int(players[consoleplayer].camera->player - players); player_t *player = players[consoleplayer].camera->player;
// only use the camera as starting index if it's a valid player.
if (player != NULL) pnum = int(players[consoleplayer].camera->player - players);
int step = (changespy == SPY_NEXT) ? 1 : -1; int step = (changespy == SPY_NEXT) ? 1 : -1;
do do
@ -1916,7 +1919,7 @@ FString G_BuildSaveName (const char *prefix, int slot)
leader = Args->CheckValue ("-savedir"); leader = Args->CheckValue ("-savedir");
if (leader.IsEmpty()) if (leader.IsEmpty())
{ {
#if !defined(unix) && !defined(__APPLE__) #if !defined(__unix__) && !defined(__APPLE__)
if (Args->CheckParm ("-cdrom")) if (Args->CheckParm ("-cdrom"))
{ {
leader = CDROM_DIR "/"; leader = CDROM_DIR "/";
@ -1928,7 +1931,7 @@ FString G_BuildSaveName (const char *prefix, int slot)
} }
if (leader.IsEmpty()) if (leader.IsEmpty())
{ {
#ifdef unix #ifdef __unix__
leader = "~/" GAME_DIR; leader = "~/" GAME_DIR;
#elif defined(__APPLE__) #elif defined(__APPLE__)
char cpath[PATH_MAX]; char cpath[PATH_MAX];

View file

@ -135,7 +135,7 @@ FGameConfigFile::FGameConfigFile ()
local_app_support << cpath << "/" GAME_DIR; local_app_support << cpath << "/" GAME_DIR;
SetValueForKey("Path", local_app_support, true); SetValueForKey("Path", local_app_support, true);
} }
#elif !defined(unix) #elif !defined(__unix__)
SetValueForKey ("Path", "$HOME", true); SetValueForKey ("Path", "$HOME", true);
SetValueForKey ("Path", "$PROGDIR", true); SetValueForKey ("Path", "$PROGDIR", true);
#else #else
@ -153,7 +153,7 @@ FGameConfigFile::FGameConfigFile ()
SetValueForKey ("Path", user_app_support, true); SetValueForKey ("Path", user_app_support, true);
SetValueForKey ("Path", "$PROGDIR", true); SetValueForKey ("Path", "$PROGDIR", true);
SetValueForKey ("Path", local_app_support, true); SetValueForKey ("Path", local_app_support, true);
#elif !defined(unix) #elif !defined(__unix__)
SetValueForKey ("Path", "$PROGDIR", true); SetValueForKey ("Path", "$PROGDIR", true);
#else #else
SetValueForKey ("Path", "~/" GAME_DIR, true); SetValueForKey ("Path", "~/" GAME_DIR, true);
@ -683,7 +683,7 @@ void FGameConfigFile::CreateStandardAutoExec(const char *section, bool start)
{ {
path << cpath << "/" GAME_DIR "/autoexec.cfg"; path << cpath << "/" GAME_DIR "/autoexec.cfg";
} }
#elif !defined(unix) #elif !defined(__unix__)
path = "$PROGDIR/autoexec.cfg"; path = "$PROGDIR/autoexec.cfg";
#else #else
path = GetUserFile ("autoexec.cfg"); path = GetUserFile ("autoexec.cfg");

View file

@ -333,7 +333,7 @@ static long ParseCommandLine (const char *args, int *argc, char **argv)
} }
#if defined(unix) #if defined(__unix__)
FString GetUserFile (const char *file) FString GetUserFile (const char *file)
{ {
FString path; FString path;
@ -698,7 +698,7 @@ void M_ScreenShot (const char *filename)
// find a file name to save it to // find a file name to save it to
if (filename == NULL || filename[0] == '\0') if (filename == NULL || filename[0] == '\0')
{ {
#if !defined(unix) && !defined(__APPLE__) #if !defined(__unix__) && !defined(__APPLE__)
if (Args->CheckParm ("-cdrom")) if (Args->CheckParm ("-cdrom"))
{ {
autoname = CDROM_DIR "\\"; autoname = CDROM_DIR "\\";
@ -715,7 +715,7 @@ void M_ScreenShot (const char *filename)
dirlen = autoname.Len(); dirlen = autoname.Len();
if (dirlen == 0) if (dirlen == 0)
{ {
#ifdef unix #ifdef __unix__
autoname = "~/" GAME_DIR "/screenshots/"; autoname = "~/" GAME_DIR "/screenshots/";
#elif defined(__APPLE__) #elif defined(__APPLE__)
char cpath[PATH_MAX]; char cpath[PATH_MAX];

View file

@ -131,6 +131,7 @@ void ClearSaveGames()
{ {
for(unsigned i=0;i<DLoadSaveMenu::SaveGames.Size(); i++) for(unsigned i=0;i<DLoadSaveMenu::SaveGames.Size(); i++)
{ {
if(!DLoadSaveMenu::SaveGames[i]->bNoDelete)
delete DLoadSaveMenu::SaveGames[i]; delete DLoadSaveMenu::SaveGames[i];
} }
DLoadSaveMenu::SaveGames.Clear(); DLoadSaveMenu::SaveGames.Clear();
@ -344,7 +345,7 @@ void DLoadSaveMenu::NotifyNewSave (const char *file, const char *title, bool okF
for (unsigned i=0; i<SaveGames.Size(); i++) for (unsigned i=0; i<SaveGames.Size(); i++)
{ {
FSaveGameNode *node = SaveGames[i]; FSaveGameNode *node = SaveGames[i];
#ifdef unix #ifdef __unix__
if (node->Filename.Compare (file) == 0) if (node->Filename.Compare (file) == 0)
#else #else
if (node->Filename.CompareNoCase (file) == 0) if (node->Filename.CompareNoCase (file) == 0)

View file

@ -158,7 +158,7 @@ static bool CheckSkipOptionBlock(FScanner &sc)
} }
else if (sc.Compare("unix")) else if (sc.Compare("unix"))
{ {
#ifdef unix #ifdef __unix__
filter = true; filter = true;
#endif #endif
} }

View file

@ -749,6 +749,8 @@ int I_FindClose (void *handle)
findstate_t *state = (findstate_t *)handle; findstate_t *state = (findstate_t *)handle;
if (handle != (void*)-1 && state->count > 0) if (handle != (void*)-1 && state->count > 0)
{ {
for(int i = 0;i < state->count;++i)
free (state->namelist[i]);
state->count = 0; state->count = 0;
free (state->namelist); free (state->namelist);
state->namelist = NULL; state->namelist = NULL;

View file

@ -816,7 +816,7 @@ bool FMODSoundRenderer::Init()
} }
result = Sys->getNumDrivers(&driver); result = Sys->getNumDrivers(&driver);
#ifdef unix #ifdef __unix__
if (result == FMOD_OK) if (result == FMOD_OK)
{ {
// On Linux, FMOD defaults to OSS. If OSS is not present, it doesn't // On Linux, FMOD defaults to OSS. If OSS is not present, it doesn't

View file

@ -295,7 +295,7 @@ FluidSynthMIDIDevice::FluidSynthMIDIDevice()
fluid_chorus_speed, fluid_chorus_depth, fluid_chorus_type); fluid_chorus_speed, fluid_chorus_depth, fluid_chorus_type);
if (0 == LoadPatchSets(fluid_patchset)) if (0 == LoadPatchSets(fluid_patchset))
{ {
#ifdef unix #ifdef __unix__
// This is the standard location on Ubuntu. // This is the standard location on Ubuntu.
if (0 == LoadPatchSets("/usr/share/sounds/sf2/FluidR3_GS.sf2:/usr/share/sounds/sf2/FluidR3_GM.sf2")) if (0 == LoadPatchSets("/usr/share/sounds/sf2/FluidR3_GS.sf2:/usr/share/sounds/sf2/FluidR3_GM.sf2"))
{ {
@ -322,7 +322,7 @@ FluidSynthMIDIDevice::FluidSynthMIDIDevice()
} }
} }
#endif #endif
#ifdef unix #ifdef __unix__
} }
#endif #endif
} }

View file

@ -166,7 +166,7 @@ static Instrument *load_instrument(Renderer *song, const char *name, int percuss
tmp += ".pat"; tmp += ".pat";
if ((fp = open_filereader(tmp, openmode, NULL)) == NULL) if ((fp = open_filereader(tmp, openmode, NULL)) == NULL)
{ {
#ifdef unix // Windows isn't case-sensitive. #ifdef __unix__ // Windows isn't case-sensitive.
tmp.ToUpper(); tmp.ToUpper();
if ((fp = open_filereader(tmp, openmode, NULL)) == NULL) if ((fp = open_filereader(tmp, openmode, NULL)) == NULL)
#endif #endif

View file

@ -93,7 +93,7 @@ const char *GetVersionString();
#define FORUM_URL "http://forum.drdteam.org" #define FORUM_URL "http://forum.drdteam.org"
#define BUGS_FORUM_URL "http://forum.drdteam.org/viewforum.php?f=24" #define BUGS_FORUM_URL "http://forum.drdteam.org/viewforum.php?f=24"
#ifdef unix #ifdef __unix__
#define GAME_DIR ".config/gzdoom" #define GAME_DIR ".config/gzdoom"
#elif defined(__APPLE__) #elif defined(__APPLE__)
#define GAME_DIR GAMENAME #define GAME_DIR GAMENAME

View file

@ -850,6 +850,13 @@ OptionValue Autosave
2, "Never" 2, "Never"
} }
OptionValue dehopt
{
0, "Never"
1, "All"
2, "Only last one"
}
OptionMenu "MiscOptions" OptionMenu "MiscOptions"
{ {
Title "Miscellaneous Options" Title "Miscellaneous Options"
@ -864,6 +871,7 @@ OptionMenu "MiscOptions"
Option "Enable cheats from all games", "allcheats", "OnOff" Option "Enable cheats from all games", "allcheats", "OnOff"
Option "Enable autosaves", "disableautosave", "Autosave" Option "Enable autosaves", "disableautosave", "Autosave"
Slider "Number of autosaves", "autosavecount", 1, 20, 1, 0 Slider "Number of autosaves", "autosavecount", 1, 20, 1, 0
Option "Load *.deh/*.bex lumps", "dehload", "dehopt"
StaticText " " StaticText " "
Option "Cache nodes", "gl_cachenodes", "OnOff" Option "Cache nodes", "gl_cachenodes", "OnOff"
Slider "Time threshold for node caching", "gl_cachetime", 0.0, 2.0, 0.1 Slider "Time threshold for node caching", "gl_cachetime", 0.0, 2.0, 0.1
@ -1010,8 +1018,11 @@ OptionMenu MapColorMenu
StaticText "Overlay Mode", 1 StaticText "Overlay Mode", 1
ColorPicker "You", "am_ovyourcolor" ColorPicker "You", "am_ovyourcolor"
ColorPicker "1-sided walls", "am_ovwallcolor" ColorPicker "1-sided walls", "am_ovwallcolor"
ColorPicker "2-sided walls", "am_ovotherwallscolor" ColorPicker "2-sided walls with different floors", "am_ovfdwallcolor"
ColorPicker "2-sided walls with different ceilings", "am_ovcdwallcolor"
ColorPicker "2-sided walls with 3D floors", "am_ovefwallcolor"
ColorPicker "Not-yet-seen walls", "am_ovunseencolor" ColorPicker "Not-yet-seen walls", "am_ovunseencolor"
ColorPicker "Locked doors", "am_ovotherwallscolor"
ColorPicker "Teleporter", "am_ovtelecolor" ColorPicker "Teleporter", "am_ovtelecolor"
ColorPicker "Secret sector", "am_ovsecretsectorcolor" ColorPicker "Secret sector", "am_ovsecretsectorcolor"
ColorPicker "Special trigger lines", "am_ovspecialwallcolor" ColorPicker "Special trigger lines", "am_ovspecialwallcolor"