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_ovthingcolor, 0xe88800, 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_ovtelecolor, 0xffff00, 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.FromCVar (am_ovthingcolor);
LockedColor.FromCVar (am_ovotherwallscolor);
EFWallColor = FDWallColor = CDWallColor = LockedColor;
EFWallColor.FromCVar (am_ovefwallcolor);
FDWallColor.FromCVar (am_ovfdwallcolor);
CDWallColor.FromCVar (am_ovcdwallcolor);
TSWallColor.FromCVar (am_ovunseencolor);
NotSeenColor = TSWallColor;
InterTeleportColor.FromCVar (am_ovtelecolor);

View file

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

View file

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

View file

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

View file

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

View file

@ -2329,6 +2329,18 @@ static int DoInclude (int dummy)
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 lastlump = 0, lumpnum, count = 0;
@ -2338,23 +2350,29 @@ int D_LoadDehLumps()
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
for (lumpnum = 0, lastlump = Wads.GetNumLumps();
lumpnum < lastlump;
++lumpnum)
if (dehload == 1) // load all .DEH lumps that are found.
{
const char* const fullName = Wads.GetLumpFullName(lumpnum);
const char* const extension = strrchr(fullName, '.');
const bool isDehOrBex = NULL != extension
&& (0 == stricmp(extension, ".deh") || 0 == stricmp(extension, ".bex"));
if (isDehOrBex)
for (lumpnum = 0, lastlump = Wads.GetNumLumps(); lumpnum < lastlump; ++lumpnum)
{
count += D_LoadDehLump(lumpnum);
if (isDehFile(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;
}
}
}
}

View file

@ -38,7 +38,7 @@
#endif
#include <float.h>
#if defined(unix) || defined(__APPLE__)
#if defined(__unix__) || defined(__APPLE__)
#include <unistd.h>
#endif
@ -2009,7 +2009,7 @@ static void AddAutoloadFiles(const char *gamesection)
D_AddFile (allwads, wad);
// [RH] Add any .wad files in the skins directory
#ifdef unix
#ifdef __unix__
file = SHARE_DIR;
#else
file = progdir;
@ -2017,7 +2017,7 @@ static void AddAutoloadFiles(const char *gamesection)
file += "skins";
D_AddDirectory (allwads, file);
#ifdef unix
#ifdef __unix__
file = NicePath("~/" GAME_DIR "/skins");
D_AddDirectory (allwads, file);
#endif
@ -2137,7 +2137,7 @@ static void CheckCmdLine()
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
// that would go to c:\\zdoomdat are already stored in .zdoom inside
// the user's home directory.

View file

@ -862,7 +862,10 @@ static void ChangeSpy (int changespy)
int pnum = consoleplayer;
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;
do
@ -1916,7 +1919,7 @@ FString G_BuildSaveName (const char *prefix, int slot)
leader = Args->CheckValue ("-savedir");
if (leader.IsEmpty())
{
#if !defined(unix) && !defined(__APPLE__)
#if !defined(__unix__) && !defined(__APPLE__)
if (Args->CheckParm ("-cdrom"))
{
leader = CDROM_DIR "/";
@ -1928,7 +1931,7 @@ FString G_BuildSaveName (const char *prefix, int slot)
}
if (leader.IsEmpty())
{
#ifdef unix
#ifdef __unix__
leader = "~/" GAME_DIR;
#elif defined(__APPLE__)
char cpath[PATH_MAX];

View file

@ -135,7 +135,7 @@ FGameConfigFile::FGameConfigFile ()
local_app_support << cpath << "/" GAME_DIR;
SetValueForKey("Path", local_app_support, true);
}
#elif !defined(unix)
#elif !defined(__unix__)
SetValueForKey ("Path", "$HOME", true);
SetValueForKey ("Path", "$PROGDIR", true);
#else
@ -153,7 +153,7 @@ FGameConfigFile::FGameConfigFile ()
SetValueForKey ("Path", user_app_support, true);
SetValueForKey ("Path", "$PROGDIR", true);
SetValueForKey ("Path", local_app_support, true);
#elif !defined(unix)
#elif !defined(__unix__)
SetValueForKey ("Path", "$PROGDIR", true);
#else
SetValueForKey ("Path", "~/" GAME_DIR, true);
@ -683,7 +683,7 @@ void FGameConfigFile::CreateStandardAutoExec(const char *section, bool start)
{
path << cpath << "/" GAME_DIR "/autoexec.cfg";
}
#elif !defined(unix)
#elif !defined(__unix__)
path = "$PROGDIR/autoexec.cfg";
#else
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 path;
@ -698,7 +698,7 @@ void M_ScreenShot (const char *filename)
// find a file name to save it to
if (filename == NULL || filename[0] == '\0')
{
#if !defined(unix) && !defined(__APPLE__)
#if !defined(__unix__) && !defined(__APPLE__)
if (Args->CheckParm ("-cdrom"))
{
autoname = CDROM_DIR "\\";
@ -715,7 +715,7 @@ void M_ScreenShot (const char *filename)
dirlen = autoname.Len();
if (dirlen == 0)
{
#ifdef unix
#ifdef __unix__
autoname = "~/" GAME_DIR "/screenshots/";
#elif defined(__APPLE__)
char cpath[PATH_MAX];

View file

@ -131,7 +131,8 @@ void ClearSaveGames()
{
for(unsigned i=0;i<DLoadSaveMenu::SaveGames.Size(); i++)
{
delete DLoadSaveMenu::SaveGames[i];
if(!DLoadSaveMenu::SaveGames[i]->bNoDelete)
delete DLoadSaveMenu::SaveGames[i];
}
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++)
{
FSaveGameNode *node = SaveGames[i];
#ifdef unix
#ifdef __unix__
if (node->Filename.Compare (file) == 0)
#else
if (node->Filename.CompareNoCase (file) == 0)

View file

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

View file

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

View file

@ -816,7 +816,7 @@ bool FMODSoundRenderer::Init()
}
result = Sys->getNumDrivers(&driver);
#ifdef unix
#ifdef __unix__
if (result == FMOD_OK)
{
// 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);
if (0 == LoadPatchSets(fluid_patchset))
{
#ifdef unix
#ifdef __unix__
// This is the standard location on Ubuntu.
if (0 == LoadPatchSets("/usr/share/sounds/sf2/FluidR3_GS.sf2:/usr/share/sounds/sf2/FluidR3_GM.sf2"))
{
@ -322,7 +322,7 @@ FluidSynthMIDIDevice::FluidSynthMIDIDevice()
}
}
#endif
#ifdef unix
#ifdef __unix__
}
#endif
}

View file

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

View file

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

View file

@ -850,6 +850,13 @@ OptionValue Autosave
2, "Never"
}
OptionValue dehopt
{
0, "Never"
1, "All"
2, "Only last one"
}
OptionMenu "MiscOptions"
{
Title "Miscellaneous Options"
@ -864,6 +871,7 @@ OptionMenu "MiscOptions"
Option "Enable cheats from all games", "allcheats", "OnOff"
Option "Enable autosaves", "disableautosave", "Autosave"
Slider "Number of autosaves", "autosavecount", 1, 20, 1, 0
Option "Load *.deh/*.bex lumps", "dehload", "dehopt"
StaticText " "
Option "Cache nodes", "gl_cachenodes", "OnOff"
Slider "Time threshold for node caching", "gl_cachetime", 0.0, 2.0, 0.1
@ -1010,8 +1018,11 @@ OptionMenu MapColorMenu
StaticText "Overlay Mode", 1
ColorPicker "You", "am_ovyourcolor"
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 "Locked doors", "am_ovotherwallscolor"
ColorPicker "Teleporter", "am_ovtelecolor"
ColorPicker "Secret sector", "am_ovsecretsectorcolor"
ColorPicker "Special trigger lines", "am_ovspecialwallcolor"