Merge branch 'master' into 2D_Refactor

This commit is contained in:
Christoph Oelckers 2018-04-01 08:44:39 +02:00
commit 3671fd7f97
9 changed files with 59 additions and 58 deletions

View file

@ -348,13 +348,6 @@ int FIWadManager::CheckIWADInfo(const char *fn)
FIWADInfo result; FIWADInfo result;
ParseIWadInfo(resfile->Filename, (const char*)lmp->CacheLump(), lmp->LumpSize, &result); ParseIWadInfo(resfile->Filename, (const char*)lmp->CacheLump(), lmp->LumpSize, &result);
delete resfile; delete resfile;
for (auto &wadinf : mIWadInfos)
{
if (wadinf.Name == result.Name)
{
return -1; // do not show the same one twice.
}
}
return mIWadInfos.Push(result); return mIWadInfos.Push(result);
} }
catch (CRecoverableError &err) catch (CRecoverableError &err)
@ -519,28 +512,39 @@ int FIWadManager::IdentifyVersion (TArray<FString> &wadfiles, const char *iwad,
if (iwadparm) if (iwadparm)
{ {
// Check if the given IWAD has an absolute path, in which case the search path will be ignored. const char* const extensions[] = { ".wad", ".pk3", ".iwad", ".ipk3", ".ipk7" };
custwad = iwadparm;
FixPathSeperator(custwad); for (auto ext : extensions)
DefaultExtension(custwad, ".wad"); {
bool isAbsolute = (custwad[0] == '/'); // Check if the given IWAD has an absolute path, in which case the search path will be ignored.
custwad = iwadparm;
FixPathSeperator(custwad);
DefaultExtension(custwad, ext);
bool isAbsolute = (custwad[0] == '/');
#ifdef WINDOWS #ifdef WINDOWS
isAbsolute |= (custwad.Len() >= 2 && custwad[1] == ':'); isAbsolute |= (custwad.Len() >= 2 && custwad[1] == ':');
#endif #endif
if (isAbsolute) if (isAbsolute)
{
if (FileExists(custwad)) mFoundWads.Push({ custwad, "", -1 });
}
else
{
for (auto &dir : mSearchPaths)
{ {
FStringf fullpath("%s/%s", dir.GetChars(), custwad.GetChars()); if (FileExists(custwad)) mFoundWads.Push({ custwad, "", -1 });
if (FileExists(fullpath)) }
else
{
for (auto &dir : mSearchPaths)
{ {
mFoundWads.Push({ fullpath, "", -1 }); FStringf fullpath("%s/%s", dir.GetChars(), custwad.GetChars());
if (FileExists(fullpath))
{
mFoundWads.Push({ fullpath, "", -1 });
}
} }
} }
if (mFoundWads.Size() != numFoundWads)
{
// Found IWAD with guessed extension
break;
}
} }
} }
// -iwad not found or not specified. Revert back to standard behavior. // -iwad not found or not specified. Revert back to standard behavior.

View file

@ -6765,7 +6765,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CheckTerrain)
DEFINE_ACTION_FUNCTION(AActor, A_SetSize) DEFINE_ACTION_FUNCTION(AActor, A_SetSize)
{ {
PARAM_SELF_PROLOGUE(AActor); PARAM_SELF_PROLOGUE(AActor);
PARAM_FLOAT(newradius); PARAM_FLOAT_DEF(newradius);
PARAM_FLOAT_DEF(newheight); PARAM_FLOAT_DEF(newheight);
PARAM_BOOL_DEF(testpos); PARAM_BOOL_DEF(testpos);

View file

@ -8317,15 +8317,15 @@ DEFINE_ACTION_FUNCTION(AActor, Vec2To)
{ {
PARAM_SELF_PROLOGUE(AActor); PARAM_SELF_PROLOGUE(AActor);
PARAM_OBJECT_NOT_NULL(t, AActor) PARAM_OBJECT_NOT_NULL(t, AActor)
ACTION_RETURN_VEC2(self->Vec2To(t)); ACTION_RETURN_VEC2(self->Vec2To(t));
} }
DEFINE_ACTION_FUNCTION(AActor, Vec3Angle) DEFINE_ACTION_FUNCTION(AActor, Vec3Angle)
{ {
PARAM_SELF_PROLOGUE(AActor); PARAM_SELF_PROLOGUE(AActor);
PARAM_FLOAT(length) PARAM_FLOAT(length)
PARAM_ANGLE(angle); PARAM_ANGLE(angle);
PARAM_FLOAT(z); PARAM_FLOAT_DEF(z);
PARAM_BOOL_DEF(absolute); PARAM_BOOL_DEF(absolute);
ACTION_RETURN_VEC3(self->Vec3Angle(length, angle, z, absolute)); ACTION_RETURN_VEC3(self->Vec3Angle(length, angle, z, absolute));
} }

View file

@ -1204,8 +1204,8 @@ DEFINE_ACTION_FUNCTION(FStringStruct, AppendFormat)
DEFINE_ACTION_FUNCTION(FStringStruct, Mid) DEFINE_ACTION_FUNCTION(FStringStruct, Mid)
{ {
PARAM_SELF_STRUCT_PROLOGUE(FString); PARAM_SELF_STRUCT_PROLOGUE(FString);
PARAM_UINT(pos); PARAM_UINT_DEF(pos);
PARAM_UINT(len); PARAM_UINT_DEF(len);
FString s = self->Mid(pos, len); FString s = self->Mid(pos, len);
ACTION_RETURN_STRING(s); ACTION_RETURN_STRING(s);
} }

View file

@ -579,7 +579,6 @@ NERVETEXT =
"\n" "\n"
"THIS RIDE IS CLOSED.\n"; "THIS RIDE IS CLOSED.\n";
// Cast list (must appear in this order) // Cast list (must appear in this order)
CC_ZOMBIE = "ZOMBIEMAN"; CC_ZOMBIE = "ZOMBIEMAN";
CC_SHOTGUN = "SHOTGUN GUY"; CC_SHOTGUN = "SHOTGUN GUY";
@ -1299,7 +1298,6 @@ TXT_IMITEMS = "ITEMS";
TXT_IMSECRETS = "SECRETS"; TXT_IMSECRETS = "SECRETS";
TXT_IMTIME = "TIME"; TXT_IMTIME = "TIME";
RAVENQUITMSG = "ARE YOU SURE YOU WANT TO QUIT?"; RAVENQUITMSG = "ARE YOU SURE YOU WANT TO QUIT?";
// Hexen strings // Hexen strings
@ -1459,7 +1457,6 @@ TXT_MAULER = "You picked up the mauler.";
TXT_GLAUNCHER = "You picked up the Grenade launcher."; TXT_GLAUNCHER = "You picked up the Grenade launcher.";
TXT_SIGIL = "You picked up the SIGIL."; TXT_SIGIL = "You picked up the SIGIL.";
TXT_BASEKEY = "You picked up the Base Key."; TXT_BASEKEY = "You picked up the Base Key.";
TXT_GOVSKEY = "You picked up the Govs Key."; TXT_GOVSKEY = "You picked up the Govs Key.";
TXT_PASSCARD = "You picked up the Passcard."; TXT_PASSCARD = "You picked up the Passcard.";
@ -1567,6 +1564,7 @@ TXT_GOAWAY = "Go away!";
TXT_COMM0 = "Incoming Message"; TXT_COMM0 = "Incoming Message";
TXT_COMM1 = "Incoming Message from BlackBird"; TXT_COMM1 = "Incoming Message from BlackBird";
TXT_TRADE = " for %u";
AMMO_CLIP = "Bullets"; AMMO_CLIP = "Bullets";
AMMO_SHELLS = "Shotgun Shells"; AMMO_SHELLS = "Shotgun Shells";
@ -2471,12 +2469,10 @@ OPTSTR_NOINTERPOLATION = "No interpolation";
OPTSTR_SPLINE = "Spline"; OPTSTR_SPLINE = "Spline";
OPTSTR_OPENAL = "OpenAL"; OPTSTR_OPENAL = "OpenAL";
NOTSET = "Not set"; NOTSET = "Not set";
SAFEMESSAGE = "Do you really want to do this?"; SAFEMESSAGE = "Do you really want to do this?";
MNU_COLORPICKER = "SELECT COLOR"; MNU_COLORPICKER = "SELECT COLOR";
WI_FINISHED = "finished"; WI_FINISHED = "finished";
WI_ENTERING = "Now entering:"; WI_ENTERING = "Now entering:";
@ -2852,7 +2848,6 @@ DSPLYMNU_TCOPT = "TrueColor Options";
TCMNU_TITLE = "TRUECOLOR OPTIONS"; TCMNU_TITLE = "TRUECOLOR OPTIONS";
TCMNU_TRUECOLOR = "True color output"; TCMNU_TRUECOLOR = "True color output";
TCMNU_MINFILTER = "Linear filter when downscaling"; TCMNU_MINFILTER = "Linear filter when downscaling";
TCMNU_MAGFILTER = "Linear filter when upscaling"; TCMNU_MAGFILTER = "Linear filter when upscaling";

View file

@ -1646,6 +1646,8 @@ TXT_GOAWAY = "Allez-vous en!";
TXT_COMM0 = "Message reçu."; TXT_COMM0 = "Message reçu.";
TXT_COMM1 = "Message reçu de BlackBird"; TXT_COMM1 = "Message reçu de BlackBird";
TXT_TRADE = " pour %u";
AMMO_CLIP = "Balles"; AMMO_CLIP = "Balles";
AMMO_SHELLS = "Cartouches"; AMMO_SHELLS = "Cartouches";
AMMO_ROCKETS = "Roquettes"; AMMO_ROCKETS = "Roquettes";

View file

@ -1145,7 +1145,7 @@ class Actor : Thinker native
native bool A_CopySpriteFrame(int from, int to, int flags = 0); native bool A_CopySpriteFrame(int from, int to, int flags = 0);
native bool A_SetVisibleRotation(double anglestart = 0, double angleend = 0, double pitchstart = 0, double pitchend = 0, int flags = 0, int ptr = AAPTR_DEFAULT); native bool A_SetVisibleRotation(double anglestart = 0, double angleend = 0, double pitchstart = 0, double pitchend = 0, int flags = 0, int ptr = AAPTR_DEFAULT);
native void A_SetTranslation(name transname); native void A_SetTranslation(name transname);
native bool A_SetSize(double newradius, double newheight = -1, bool testpos = false); native bool A_SetSize(double newradius = -1, double newheight = -1, bool testpos = false);
native void A_SprayDecal(String name, double dist = 172); native void A_SprayDecal(String name, double dist = 172);
native void A_SetMugshotState(String name); native void A_SetMugshotState(String name);

View file

@ -671,31 +671,31 @@ struct StringTable native
// Most are handled at load time and are omitted here. // Most are handled at load time and are omitted here.
struct DehInfo native struct DehInfo native
{ {
native int MaxSoulsphere; native readonly int MaxSoulsphere;
native uint8 ExplosionStyle; native readonly uint8 ExplosionStyle;
native double ExplosionAlpha; native readonly double ExplosionAlpha;
native int NoAutofreeze; native readonly int NoAutofreeze;
native int BFGCells; native readonly int BFGCells;
native int BlueAC; native readonly int BlueAC;
} }
struct State native struct State native
{ {
native State NextState; native readonly State NextState;
native int sprite; native readonly int sprite;
native int16 Tics; native readonly int16 Tics;
native uint16 TicRange; native readonly uint16 TicRange;
native uint8 Frame; native readonly uint8 Frame;
native uint8 UseFlags; native readonly uint8 UseFlags;
native int Misc1; native readonly int Misc1;
native int Misc2; native readonly int Misc2;
native uint16 bSlow; native readonly uint16 bSlow;
native uint16 bFast; native readonly uint16 bFast;
native bool bFullbright; native readonly bool bFullbright;
native bool bNoDelay; native readonly bool bNoDelay;
native bool bSameFrame; native readonly bool bSameFrame;
native bool bCanRaise; native readonly bool bCanRaise;
native bool bDehacked; native readonly bool bDehacked;
native int DistanceTo(state other); native int DistanceTo(state other);
native bool ValidateSpriteFrame(); native bool ValidateSpriteFrame();

View file

@ -137,7 +137,7 @@ class ConversationMenu : Menu
mShowGold |= reply.NeedsGold; mShowGold |= reply.NeedsGold;
let ReplyText = Stringtable.Localize(reply.Reply); let ReplyText = Stringtable.Localize(reply.Reply);
if (reply.NeedsGold) ReplyText.AppendFormat(" for %u", reply.PrintAmount); if (reply.NeedsGold) ReplyText.AppendFormat(Stringtable.Localize("$TXT_TRADE"), reply.PrintAmount);
let ReplyLines = SmallFont.BreakLines (ReplyText, ReplyWidth); let ReplyLines = SmallFont.BreakLines (ReplyText, ReplyWidth);