mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-24 21:11:39 +00:00
Merge branch 'master' into unsafe_context
This commit is contained in:
commit
4cf5977b56
33 changed files with 2178 additions and 849 deletions
|
@ -1169,6 +1169,7 @@ public:
|
|||
int Score; // manipulated by score items, ACS or DECORATE. The engine doesn't use this itself for anything.
|
||||
FString * Tag; // Strife's tag name.
|
||||
int DesignatedTeam; // Allow for friendly fire cacluations to be done on non-players.
|
||||
int friendlyseeblocks; // allow to override friendly search distance calculation
|
||||
|
||||
AActor *BlockingMobj; // Actor that blocked the last move
|
||||
line_t *BlockingLine; // Line that blocked the last move
|
||||
|
|
|
@ -510,7 +510,7 @@ public:
|
|||
crouchdir = 0;
|
||||
crouching = 0;
|
||||
crouchviewdelta = 0;
|
||||
viewheight = mo->ViewHeight;
|
||||
viewheight = mo ? mo->ViewHeight : 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -371,6 +371,7 @@ struct FMapThing
|
|||
int16_t roll;
|
||||
uint32_t RenderStyle;
|
||||
int FloatbobPhase;
|
||||
int friendlyseeblocks;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -2074,8 +2074,8 @@ DEFINE_ACTION_FUNCTION(DBaseStatusBar, GetGlobalACSArrayValue)
|
|||
|
||||
enum ENumFlags
|
||||
{
|
||||
FNF_FILLZEROS,
|
||||
FNF_WHENNOTZERO,
|
||||
FNF_WHENNOTZERO = 0x1,
|
||||
FNF_FILLZEROS = 0x2,
|
||||
};
|
||||
|
||||
DEFINE_ACTION_FUNCTION(DBaseStatusBar, FormatNumber)
|
||||
|
|
|
@ -735,7 +735,11 @@ void M_Ticker (void)
|
|||
if (CurrentMenu != nullptr && menuactive != MENU_Off)
|
||||
{
|
||||
CurrentMenu->CallTicker();
|
||||
}
|
||||
|
||||
// Check again because menu could be closed from Ticker()
|
||||
if (CurrentMenu != nullptr && menuactive != MENU_Off)
|
||||
{
|
||||
for (int i = 0; i < NUM_MKEYS; ++i)
|
||||
{
|
||||
if (MenuButtons[i].bDown)
|
||||
|
|
|
@ -542,7 +542,7 @@ static bool FindMatchingItem(DMenuItemBase *desc)
|
|||
{
|
||||
// Check for presence of menu
|
||||
auto menu = MenuDescriptors.CheckKey(name);
|
||||
if (menu == nullptr) return true;
|
||||
if (menu == nullptr) return false;
|
||||
}
|
||||
else if (grp == 4)
|
||||
{
|
||||
|
|
|
@ -502,6 +502,7 @@ xx(Roll)
|
|||
xx(Scale)
|
||||
xx(ScaleX)
|
||||
xx(ScaleY)
|
||||
xx(FriendlySeeBlocks)
|
||||
xx(Floatbobphase)
|
||||
xx(Floatbobstrength)
|
||||
xx(Target)
|
||||
|
|
|
@ -761,35 +761,6 @@ protected:
|
|||
private:
|
||||
DLevelScript();
|
||||
|
||||
int getbyte(int *&pc)
|
||||
{
|
||||
CheckInstructionPointer(pc);
|
||||
|
||||
int res = *(uint8_t *)pc;
|
||||
pc = (int *)((uint8_t *)pc+1);
|
||||
return res;
|
||||
}
|
||||
|
||||
int getshort(int *&pc)
|
||||
{
|
||||
CheckInstructionPointer(pc);
|
||||
|
||||
int res = LittleShort( *(int16_t *)pc);
|
||||
pc = (int *)((uint8_t *)pc+2);
|
||||
return res;
|
||||
}
|
||||
|
||||
void CheckInstructionPointer(int *pc) const
|
||||
{
|
||||
const uint32_t offset = activeBehavior->PC2Ofs(pc);
|
||||
const uint32_t size = activeBehavior->GetDataSize();
|
||||
|
||||
if (offset >= size)
|
||||
{
|
||||
I_Error("Out of bounds instruction pointer in ACS VM");
|
||||
}
|
||||
}
|
||||
|
||||
friend class DACSThinker;
|
||||
};
|
||||
|
||||
|
@ -844,7 +815,7 @@ TArray<FString> ACS_StringBuilderStack;
|
|||
//
|
||||
//============================================================================
|
||||
|
||||
#if defined(_M_IX86) || defined(_M_X64) || defined(__i386__)
|
||||
#if defined(_M_IX86) || defined(_M_X64) || defined(__i386__) || defined(__x86_64__)
|
||||
inline int uallong(const int &foo)
|
||||
{
|
||||
return foo;
|
||||
|
@ -6925,7 +6896,7 @@ enum
|
|||
};
|
||||
|
||||
|
||||
#define NEXTWORD (CheckInstructionPointer(pc), LittleLong(*pc++))
|
||||
#define NEXTWORD (LittleLong(*pc++))
|
||||
#define NEXTBYTE (fmt==ACS_LittleEnhanced?getbyte(pc):NEXTWORD)
|
||||
#define NEXTSHORT (fmt==ACS_LittleEnhanced?getshort(pc):NEXTWORD)
|
||||
#define STACK(a) (Stack[sp - (a)])
|
||||
|
@ -6933,6 +6904,20 @@ enum
|
|||
// Direct instructions that take strings need to have the tag applied.
|
||||
#define TAGSTR(a) (a|activeBehavior->GetLibraryID())
|
||||
|
||||
inline int getbyte (int *&pc)
|
||||
{
|
||||
int res = *(uint8_t *)pc;
|
||||
pc = (int *)((uint8_t *)pc+1);
|
||||
return res;
|
||||
}
|
||||
|
||||
inline int getshort (int *&pc)
|
||||
{
|
||||
int res = LittleShort( *(int16_t *)pc);
|
||||
pc = (int *)((uint8_t *)pc+2);
|
||||
return res;
|
||||
}
|
||||
|
||||
static bool CharArrayParms(int &capacity, int &offset, int &a, FACSStackMemory& Stack, int &sp, bool ranged)
|
||||
{
|
||||
if (ranged)
|
||||
|
|
|
@ -1704,7 +1704,7 @@ bool P_LookForEnemies (AActor *actor, INTBOOL allaround, FLookExParams *params)
|
|||
{
|
||||
AActor *other;
|
||||
|
||||
other = P_BlockmapSearch (actor, 10, LookForEnemiesInBlock, params);
|
||||
other = P_BlockmapSearch (actor, actor->friendlyseeblocks, LookForEnemiesInBlock, params);
|
||||
|
||||
if (other != NULL)
|
||||
{
|
||||
|
|
|
@ -355,6 +355,7 @@ DEFINE_FIELD(AActor, BloodColor)
|
|||
DEFINE_FIELD(AActor, BloodTranslation)
|
||||
DEFINE_FIELD(AActor, RenderHidden)
|
||||
DEFINE_FIELD(AActor, RenderRequired)
|
||||
DEFINE_FIELD(AActor, friendlyseeblocks)
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
|
@ -533,6 +534,7 @@ void AActor::Serialize(FSerializer &arc)
|
|||
A("stealthalpha", StealthAlpha)
|
||||
A("renderhidden", RenderHidden)
|
||||
A("renderrequired", RenderRequired);
|
||||
A("friendlyseeblocks", friendlyseeblocks);
|
||||
}
|
||||
|
||||
#undef A
|
||||
|
@ -6027,6 +6029,8 @@ AActor *P_SpawnMapThing (FMapThing *mthing, int position)
|
|||
mobj->SpawnPoint = mthing->pos;
|
||||
mobj->SpawnAngle = mthing->angle;
|
||||
mobj->SpawnFlags = mthing->flags;
|
||||
if (mthing->friendlyseeblocks > 0)
|
||||
mobj->friendlyseeblocks = mthing->friendlyseeblocks;
|
||||
if (mthing->FloatbobPhase >= 0 && mthing->FloatbobPhase < 64) mobj->FloatBobPhase = mthing->FloatbobPhase;
|
||||
if (mthing->Gravity < 0) mobj->Gravity = -mthing->Gravity;
|
||||
else if (mthing->Gravity > 0) mobj->Gravity *= mthing->Gravity;
|
||||
|
@ -8463,5 +8467,6 @@ void PrintMiscActorInfo(AActor *query)
|
|||
Printf("\nSpeed= %f, velocity= x:%f, y:%f, z:%f, combined:%f.\n",
|
||||
query->Speed, query->Vel.X, query->Vel.Y, query->Vel.Z, query->Vel.Length());
|
||||
Printf("Scale: x:%f, y:%f\n", query->Scale.X, query->Scale.Y);
|
||||
Printf("FriendlySeeBlocks: %d\n", query->friendlyseeblocks);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -116,6 +116,7 @@
|
|||
#include "events.h"
|
||||
#include "types.h"
|
||||
#include "i_time.h"
|
||||
#include "scripting/vm/vm.h"
|
||||
|
||||
#include "fragglescript/t_fs.h"
|
||||
|
||||
|
@ -552,6 +553,18 @@ void MapData::GetChecksum(uint8_t cksum[16])
|
|||
md5.Final(cksum);
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(FLevelLocals, GetChecksum)
|
||||
{
|
||||
PARAM_SELF_STRUCT_PROLOGUE(FLevelLocals);
|
||||
char md5string[33];
|
||||
|
||||
for(int j = 0; j < 16; ++j)
|
||||
{
|
||||
sprintf(md5string + j * 2, "%02x", level.md5[j]);
|
||||
}
|
||||
|
||||
ACTION_RETURN_STRING((const char*)md5string);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
|
@ -1818,6 +1831,7 @@ void P_LoadThings2 (MapData * map)
|
|||
mti[i].Alpha = -1;
|
||||
mti[i].Health = 1;
|
||||
mti[i].FloatbobPhase = -1;
|
||||
mti[i].friendlyseeblocks = -1;
|
||||
}
|
||||
delete[] mtp;
|
||||
}
|
||||
|
|
|
@ -799,6 +799,11 @@ public:
|
|||
th->Scale.X = th->Scale.Y = CheckFloat(key);
|
||||
break;
|
||||
|
||||
case NAME_FriendlySeeBlocks:
|
||||
CHECK_N(Zd | Zdt)
|
||||
th->friendlyseeblocks = CheckInt(key);
|
||||
break;
|
||||
|
||||
default:
|
||||
CHECK_N(Zd | Zdt)
|
||||
if (0 == strnicmp("user_", key.GetChars(), 5))
|
||||
|
|
|
@ -226,14 +226,7 @@ void OriginalMainTry(int argc, char** argv)
|
|||
namespace
|
||||
{
|
||||
|
||||
const int ARGC_MAX = 64;
|
||||
|
||||
int s_argc;
|
||||
char* s_argv[ARGC_MAX];
|
||||
|
||||
TArray<FString> s_argvStorage;
|
||||
|
||||
bool s_restartedFromWADPicker;
|
||||
TArray<FString> s_argv;
|
||||
|
||||
|
||||
void NewFailure()
|
||||
|
@ -348,7 +341,17 @@ ApplicationController* appCtrl;
|
|||
FConsoleWindow::CreateInstance();
|
||||
atterm(FConsoleWindow::DeleteInstance);
|
||||
|
||||
exit(OriginalMain(s_argc, s_argv));
|
||||
const size_t argc = s_argv.Size();
|
||||
TArray<char*> argv(argc + 1, true);
|
||||
|
||||
for (size_t i = 0; i < argc; ++i)
|
||||
{
|
||||
argv[i] = s_argv[i].LockBuffer();
|
||||
}
|
||||
|
||||
argv[argc] = nullptr;
|
||||
|
||||
exit(OriginalMain(argc, &argv[0]));
|
||||
}
|
||||
|
||||
|
||||
|
@ -356,20 +359,13 @@ ApplicationController* appCtrl;
|
|||
{
|
||||
ZD_UNUSED(theApplication);
|
||||
|
||||
if (s_restartedFromWADPicker
|
||||
|| 0 == [filename length]
|
||||
|| s_argc + 2 >= ARGC_MAX)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// Some parameters from command line are passed to this function
|
||||
// These parameters need to be skipped to avoid duplication
|
||||
// Note: SDL has different approach to fix this issue, see the same method in SDLMain.m
|
||||
|
||||
const char* const charFileName = [filename UTF8String];
|
||||
|
||||
for (int i = 0; i < s_argc; ++i)
|
||||
for (size_t i = 0, count = s_argv.Size(); i < count; ++i)
|
||||
{
|
||||
if (0 == strcmp(s_argv[i], charFileName))
|
||||
{
|
||||
|
@ -377,11 +373,8 @@ ApplicationController* appCtrl;
|
|||
}
|
||||
}
|
||||
|
||||
s_argvStorage.Push("-file");
|
||||
s_argv[s_argc++] = s_argvStorage.Last().LockBuffer();
|
||||
|
||||
s_argvStorage.Push([filename UTF8String]);
|
||||
s_argv[s_argc++] = s_argvStorage.Last().LockBuffer();
|
||||
s_argv.Push("-file");
|
||||
s_argv.Push([filename UTF8String]);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -539,21 +532,12 @@ void ReleaseApplicationController()
|
|||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
for (int i = 0; i <= argc; ++i)
|
||||
for (int i = 0; i < argc; ++i)
|
||||
{
|
||||
const char* const argument = argv[i];
|
||||
|
||||
if (NULL == argument || '\0' == argument[0])
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (0 == strcmp(argument, "-wad_picker_restart"))
|
||||
{
|
||||
s_restartedFromWADPicker = true;
|
||||
}
|
||||
#if _DEBUG
|
||||
else if (0 == strcmp(argument, "-wait_for_debugger"))
|
||||
if (0 == strcmp(argument, "-wait_for_debugger"))
|
||||
{
|
||||
NSAlert* alert = [[NSAlert alloc] init];
|
||||
[alert setMessageText:@GAMENAME];
|
||||
|
@ -562,11 +546,8 @@ int main(int argc, char** argv)
|
|||
[alert runModal];
|
||||
}
|
||||
#endif // _DEBUG
|
||||
else
|
||||
{
|
||||
s_argvStorage.Push(argument);
|
||||
s_argv[s_argc++] = s_argvStorage.Last().LockBuffer();
|
||||
}
|
||||
|
||||
s_argv.Push(argument);
|
||||
}
|
||||
|
||||
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
|
||||
|
|
|
@ -418,7 +418,6 @@ static void RestartWithParameters(const WadStuff& wad, NSString* parameters)
|
|||
executablePath = @"/usr/bin/arch";
|
||||
}
|
||||
|
||||
[arguments addObject:@"-wad_picker_restart"];
|
||||
[arguments addObject:@"-iwad"];
|
||||
[arguments addObject:[NSString stringWithUTF8String:wad.Path]];
|
||||
|
||||
|
|
|
@ -394,7 +394,7 @@ public:
|
|||
}
|
||||
|
||||
// Moves a plane up/down by hdiff units
|
||||
double GetChangedHeight(double hdiff)
|
||||
double GetChangedHeight(double hdiff) const
|
||||
{
|
||||
return D - hdiff * normal.Z;
|
||||
}
|
||||
|
|
|
@ -8935,7 +8935,7 @@ FxExpression *FxVMFunctionCall::Resolve(FCompileContext& ctx)
|
|||
else
|
||||
{
|
||||
bool writable;
|
||||
ArgList[i] = ArgList[i]->Resolve(ctx); // nust be resolved before the address is requested.
|
||||
ArgList[i] = ArgList[i]->Resolve(ctx); // must be resolved before the address is requested.
|
||||
if (ArgList[i] != nullptr && ArgList[i]->ValueType != TypeNullPtr)
|
||||
{
|
||||
if (type == ArgList[i]->ValueType && type->isRealPointer() && type->toPointer()->PointedType->isStruct())
|
||||
|
|
|
@ -51,6 +51,7 @@ typedef TArray<uint32_t> FDynArray_I32;
|
|||
typedef TArray<float> FDynArray_F32;
|
||||
typedef TArray<double> FDynArray_F64;
|
||||
typedef TArray<void*> FDynArray_Ptr;
|
||||
typedef TArray<DObject*> FDynArray_Obj;
|
||||
typedef TArray<FString> FDynArray_String;
|
||||
|
||||
//-----------------------------------------------------
|
||||
|
@ -672,6 +673,112 @@ DEFINE_ACTION_FUNCTION(FDynArray_Ptr, Clear)
|
|||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------
|
||||
//
|
||||
// Object array
|
||||
//
|
||||
//-----------------------------------------------------
|
||||
|
||||
DEFINE_ACTION_FUNCTION(FDynArray_Obj, Copy)
|
||||
{
|
||||
PARAM_SELF_STRUCT_PROLOGUE(FDynArray_Obj);
|
||||
PARAM_POINTER(other, FDynArray_Obj);
|
||||
*self = *other;
|
||||
return 0;
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(FDynArray_Obj, Move)
|
||||
{
|
||||
PARAM_SELF_STRUCT_PROLOGUE(FDynArray_Obj);
|
||||
PARAM_POINTER(other, FDynArray_Obj);
|
||||
*self = std::move(*other);
|
||||
return 0;
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(FDynArray_Obj, Find)
|
||||
{
|
||||
PARAM_SELF_STRUCT_PROLOGUE(FDynArray_Obj);
|
||||
PARAM_OBJECT(val, DObject);
|
||||
ACTION_RETURN_INT(self->Find(val));
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(FDynArray_Obj, Push)
|
||||
{
|
||||
PARAM_SELF_STRUCT_PROLOGUE(FDynArray_Obj);
|
||||
PARAM_OBJECT(val, DObject);
|
||||
GC::WriteBarrier(val);
|
||||
ACTION_RETURN_INT(self->Push(val));
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(FDynArray_Obj, Pop)
|
||||
{
|
||||
PARAM_SELF_STRUCT_PROLOGUE(FDynArray_Obj);
|
||||
ACTION_RETURN_BOOL(self->Pop());
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(FDynArray_Obj, Delete)
|
||||
{
|
||||
PARAM_SELF_STRUCT_PROLOGUE(FDynArray_Obj);
|
||||
PARAM_INT(index);
|
||||
PARAM_INT_DEF(count);
|
||||
self->Delete(index, count);
|
||||
return 0;
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(FDynArray_Obj, Insert)
|
||||
{
|
||||
PARAM_SELF_STRUCT_PROLOGUE(FDynArray_Obj);
|
||||
PARAM_INT(index);
|
||||
PARAM_OBJECT(val, DObject);
|
||||
GC::WriteBarrier(val);
|
||||
self->Insert(index, val);
|
||||
return 0;
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(FDynArray_Obj, ShrinkToFit)
|
||||
{
|
||||
PARAM_SELF_STRUCT_PROLOGUE(FDynArray_Obj);
|
||||
self->ShrinkToFit();
|
||||
return 0;
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(FDynArray_Obj, Grow)
|
||||
{
|
||||
PARAM_SELF_STRUCT_PROLOGUE(FDynArray_Obj);
|
||||
PARAM_INT(count);
|
||||
self->Grow(count);
|
||||
return 0;
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(FDynArray_Obj, Resize)
|
||||
{
|
||||
PARAM_SELF_STRUCT_PROLOGUE(FDynArray_Obj);
|
||||
PARAM_INT(count);
|
||||
self->Resize(count);
|
||||
return 0;
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(FDynArray_Obj, Reserve)
|
||||
{
|
||||
PARAM_SELF_STRUCT_PROLOGUE(FDynArray_Obj);
|
||||
PARAM_INT(count);
|
||||
ACTION_RETURN_INT(self->Reserve(count));
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(FDynArray_Obj, Max)
|
||||
{
|
||||
PARAM_SELF_STRUCT_PROLOGUE(FDynArray_Obj);
|
||||
ACTION_RETURN_INT(self->Max());
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(FDynArray_Obj, Clear)
|
||||
{
|
||||
PARAM_SELF_STRUCT_PROLOGUE(FDynArray_Obj);
|
||||
self->Clear();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------
|
||||
//
|
||||
// String array
|
||||
|
@ -781,4 +888,5 @@ DEFINE_FIELD_NAMED_X(DynArray_I32, FArray, Count, Size)
|
|||
DEFINE_FIELD_NAMED_X(DynArray_F32, FArray, Count, Size)
|
||||
DEFINE_FIELD_NAMED_X(DynArray_F64, FArray, Count, Size)
|
||||
DEFINE_FIELD_NAMED_X(DynArray_Ptr, FArray, Count, Size)
|
||||
DEFINE_FIELD_NAMED_X(DynArray_Obj, FArray, Count, Size)
|
||||
DEFINE_FIELD_NAMED_X(DynArray_String, FArray, Count, Size)
|
||||
|
|
|
@ -2050,7 +2050,10 @@ PDynArray *NewDynArray(PType *type)
|
|||
break;
|
||||
|
||||
case REGT_POINTER:
|
||||
backingname = "DynArray_Ptr";
|
||||
if (type->isObjectPointer())
|
||||
backingname = "DynArray_Obj";
|
||||
else
|
||||
backingname = "DynArray_Ptr";
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
@ -1627,7 +1627,7 @@ PType *ZCCCompiler::DetermineType(PType *outertype, ZCC_TreeNode *field, FName n
|
|||
}
|
||||
else
|
||||
{
|
||||
Error(field, "%s: Base type for dynamic array types nust be integral, but got %s", name.GetChars(), ftype->DescriptiveName());
|
||||
Error(field, "%s: Base type for dynamic array types must be integral, but got %s", name.GetChars(), ftype->DescriptiveName());
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
@ -649,18 +649,11 @@ void CALLBACK WinMIDIDevice::CallbackFunc(HMIDIOUT hOut, UINT uMsg, DWORD_PTR dw
|
|||
// are done by sending MIDI channel volume messages to the stream, not
|
||||
// through midiOutSetVolume().)
|
||||
//
|
||||
// This is using VC++'s __uuidof extension instead of the the CLSID_ and
|
||||
// IID_ definitions because I couldn't figure out why it wasn't finding them
|
||||
// when linking, and __uuidof circumvents that problem. I'd also be
|
||||
// surprised if w32api includes any WASAPI stuff any time soon, so it's no
|
||||
// big loss making this VC++-specific for the time being
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
static bool IgnoreMIDIVolume(UINT id)
|
||||
{
|
||||
MIDIOUTCAPS caps;
|
||||
bool mustcheck = false;
|
||||
|
||||
if (MMSYSERR_NOERROR == midiOutGetDevCaps(id, &caps, sizeof(caps)))
|
||||
{
|
||||
|
@ -668,7 +661,7 @@ static bool IgnoreMIDIVolume(UINT id)
|
|||
{
|
||||
// We cannot determine what this is so we have to assume the worst, as the default
|
||||
// devive's volume control is irreparably broken.
|
||||
mustcheck = true;
|
||||
return true;
|
||||
}
|
||||
// The Microsoft GS Wavetable Synth advertises itself as MIDIDEV_SWSYNTH with a VOLUME control.
|
||||
// If the one we're using doesn't match that, we don't need to bother checking the name.
|
||||
|
@ -676,28 +669,8 @@ static bool IgnoreMIDIVolume(UINT id)
|
|||
{
|
||||
if (strncmp(caps.szPname, "Microsoft GS", 12) == 0)
|
||||
{
|
||||
mustcheck = true;
|
||||
}
|
||||
}
|
||||
if (mustcheck)
|
||||
{
|
||||
#ifndef __GNUC__
|
||||
IMMDeviceEnumerator *enumerator;
|
||||
|
||||
// Now try to create an IMMDeviceEnumerator interface. If it succeeds,
|
||||
// we know we're using the new audio stack introduced with Vista and
|
||||
// should ignore this MIDI device's volume control.
|
||||
if (SUCCEEDED(CoCreateInstance(__uuidof(MMDeviceEnumerator), nullptr, CLSCTX_ALL,
|
||||
__uuidof(IMMDeviceEnumerator), (void**)&enumerator))
|
||||
&& enumerator != nullptr)
|
||||
{
|
||||
enumerator->Release();
|
||||
return true;
|
||||
}
|
||||
#else
|
||||
// assume the worst and consider volume control broken.
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -592,6 +592,12 @@ CCMD(printstats)
|
|||
|
||||
CCMD(finishgame)
|
||||
{
|
||||
bool gamestatecheck = gamestate == GS_LEVEL || gamestate == GS_INTERMISSION || gamestate == GS_FINALE;
|
||||
if (!gamestatecheck)
|
||||
{
|
||||
Printf("Cannot use 'finishgame' while not in a game!\n");
|
||||
return;
|
||||
}
|
||||
// This CCMD simulates an end-of-game action and exists to end mods that never exit their last level.
|
||||
Net_WriteByte(DEM_FINISHGAME);
|
||||
}
|
||||
|
|
|
@ -175,15 +175,14 @@ protected:
|
|||
|
||||
struct TexPart
|
||||
{
|
||||
int16_t OriginX, OriginY;
|
||||
uint8_t Rotate;
|
||||
uint8_t op;
|
||||
FRemapTable *Translation;
|
||||
PalEntry Blend;
|
||||
FTexture *Texture;
|
||||
blend_t Alpha;
|
||||
|
||||
TexPart();
|
||||
FRemapTable *Translation = nullptr;
|
||||
FTexture *Texture = nullptr;
|
||||
PalEntry Blend = 0;
|
||||
blend_t Alpha = FRACUNIT;
|
||||
int16_t OriginX = 0;
|
||||
int16_t OriginY = 0;
|
||||
uint8_t Rotate = 0;
|
||||
uint8_t op = OP_COPY;
|
||||
};
|
||||
|
||||
struct TexInit
|
||||
|
@ -797,23 +796,6 @@ FTexture *FMultiPatchTexture::GetRawTexture()
|
|||
return NumParts == 1 ? Parts->Texture : this;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// FMultiPatchTexture :: TexPart :: TexPart
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
FMultiPatchTexture::TexPart::TexPart()
|
||||
{
|
||||
OriginX = OriginY = 0;
|
||||
Rotate = 0;
|
||||
Texture = NULL;
|
||||
Translation = NULL;
|
||||
Blend = 0;
|
||||
Alpha = FRACUNIT;
|
||||
op = OP_COPY;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// FTextureManager :: AddTexturesLump
|
||||
|
@ -1369,7 +1351,7 @@ void FMultiPatchTexture::ResolvePatches()
|
|||
{
|
||||
if (Parts[i].Texture == nullptr)
|
||||
{
|
||||
memcpy(&Parts[i], &Parts[i + 1], NumParts - i - 1);
|
||||
memcpy(&Parts[i], &Parts[i + 1], (NumParts - i - 1) * sizeof(TexPart));
|
||||
i--;
|
||||
NumParts--;
|
||||
}
|
||||
|
|
|
@ -2186,13 +2186,14 @@ MODMNU_CHIPOMATIC = "Chip-o-matic";
|
|||
RNDMNU_TITLE = "CHANGE RENDERER";
|
||||
RNDMNU_RENDERER = "Hardware Acceleration";
|
||||
RNDMNU_TRUECOLOR = "Software Truecolor Mode";
|
||||
RNDMNU_POLY = "Poly Renderer (experimental)";
|
||||
RNDMNU_POLY = "Poly Renderer (experimental)";
|
||||
RNDMNU_CANVAS = "Software Canvas";
|
||||
|
||||
// Video Options
|
||||
VIDMNU_TITLE = "VIDEO MODE";
|
||||
VIDMNU_FULLSCREEN = "Fullscreen";
|
||||
VIDMNU_HIDPI = "Retina/HiDPI support";
|
||||
VIDMNU_BRDLSS = "Borderless Windowed Mode";
|
||||
VIDMNU_ASPECTRATIO = "Aspect ratio";
|
||||
VIDMNU_FORCEASPECT = "Force aspect ratio";
|
||||
VIDMNU_CROPASPECT = "Forced ratio style";
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1874,10 +1874,17 @@ OptionMenu VideoModeMenu protected
|
|||
Title "$VIDMNU_TITLE"
|
||||
|
||||
Option "$VIDMNU_FULLSCREEN", "fullscreen", "YesNo"
|
||||
|
||||
IfOption(Mac)
|
||||
{
|
||||
Option "$VIDMNU_HIDPI", "vid_hidpi", "YesNo"
|
||||
}
|
||||
|
||||
IfOption(Windows)
|
||||
{
|
||||
Option "$VIDMNU_BRDLSS", "win_borderless", "YesNo"
|
||||
}
|
||||
|
||||
Option "$VIDMNU_ASPECTRATIO", "menu_screenratios", "Ratios"
|
||||
Option "$VIDMNU_FORCEASPECT", "vid_aspect", "ForceRatios"
|
||||
Option "$VIDMNU_CROPASPECT", "vid_cropaspect", "CropAspect"
|
||||
|
|
|
@ -203,6 +203,7 @@ class Actor : Thinker native
|
|||
native readonly int BloodTranslation;
|
||||
native int RenderHidden;
|
||||
native int RenderRequired;
|
||||
native readonly int FriendlySeeBlocks;
|
||||
|
||||
meta String Obituary; // Player was killed by this actor
|
||||
meta String HitObituary; // Player was killed by this actor in melee
|
||||
|
@ -292,6 +293,7 @@ class Actor : Thinker native
|
|||
property RipLevelMax: RipLevelMax;
|
||||
property RenderHidden: RenderHidden;
|
||||
property RenderRequired: RenderRequired;
|
||||
property FriendlySeeBlocks: FriendlySeeBlocks;
|
||||
|
||||
// need some definition work first
|
||||
//FRenderStyle RenderStyle;
|
||||
|
@ -372,6 +374,7 @@ class Actor : Thinker native
|
|||
BurnHeight -1;
|
||||
RenderHidden 0;
|
||||
RenderRequired 0;
|
||||
FriendlySeeBlocks 10; // 10 (blocks) * 128 (one map unit block)
|
||||
}
|
||||
|
||||
// Functions
|
||||
|
|
|
@ -555,6 +555,8 @@ struct LevelLocals native
|
|||
|
||||
native static clearscope vector2 Vec2Diff(vector2 v1, vector2 v2);
|
||||
native static clearscope vector3 Vec3Diff(vector3 v1, vector3 v2);
|
||||
|
||||
native String GetChecksum() const;
|
||||
|
||||
String TimeFormatted(bool totals = false)
|
||||
{
|
||||
|
|
|
@ -205,7 +205,11 @@ extend class Actor
|
|||
if (mo.health > 0 && mo.bBossSpawned)
|
||||
{
|
||||
mo.DamageMobj(self, self, mo.health, "None", DMG_NO_ARMOR|DMG_FORCED|DMG_THRUSTLESS|DMG_NO_FACTOR);
|
||||
count++;
|
||||
|
||||
// [Blue Shadow] If 'mo' is a RandomSpawner or another actor which can't be killed,
|
||||
// it could cause this code to loop indefinitely. So only let it trigger a loop if it
|
||||
// has been actually killed.
|
||||
if (mo.bKilled) count++;
|
||||
}
|
||||
}
|
||||
} while (count != 0);
|
||||
|
|
|
@ -115,6 +115,25 @@ struct DynArray_Ptr native
|
|||
native void Clear ();
|
||||
}
|
||||
|
||||
struct DynArray_Obj native
|
||||
{
|
||||
native readonly uint Size;
|
||||
|
||||
native void Copy(DynArray_Obj other);
|
||||
native void Move(DynArray_Obj other);
|
||||
native uint Find(Object item) const;
|
||||
native uint Push (Object item);
|
||||
native bool Pop ();
|
||||
native void Delete (uint index, int deletecount = 1);
|
||||
native void Insert (uint index, Object item);
|
||||
native void ShrinkToFit ();
|
||||
native void Grow (uint amount);
|
||||
native void Resize (uint amount);
|
||||
native uint Reserve (uint amount);
|
||||
native uint Max () const;
|
||||
native void Clear ();
|
||||
}
|
||||
|
||||
struct DynArray_String native
|
||||
{
|
||||
native readonly uint Size;
|
||||
|
|
|
@ -184,7 +184,7 @@ struct SecPlane native play
|
|||
native bool isEqual(Secplane other) const;
|
||||
native void ChangeHeight(double hdiff);
|
||||
native double GetChangedHeight(double hdiff) const;
|
||||
native double HeightDiff(double oldd, double newd = 0.0);
|
||||
native double HeightDiff(double oldd, double newd = 0.0) const;
|
||||
native double PointToDist(Vector2 xy, double z) const;
|
||||
}
|
||||
|
||||
|
|
|
@ -46,6 +46,8 @@ struct StrifeDialogueNode native version("2.4")
|
|||
native String Goodbye;
|
||||
|
||||
native StrifeDialogueReply Children;
|
||||
native Name MenuClassName;
|
||||
native String UserData;
|
||||
}
|
||||
|
||||
// FStrifeDialogueReply holds responses the player can give to the NPC
|
||||
|
|
|
@ -62,6 +62,8 @@ class InterpolationPoint : Actor
|
|||
Next = null;
|
||||
}
|
||||
|
||||
override void Tick () {} // Nodes do no thinking
|
||||
|
||||
void FormChain ()
|
||||
{
|
||||
let me = self;
|
||||
|
|
|
@ -254,8 +254,8 @@ class BaseStatusBar native ui
|
|||
|
||||
enum ENumFlags
|
||||
{
|
||||
FNF_FILLZEROS,
|
||||
FNF_WHENNOTZERO,
|
||||
FNF_WHENNOTZERO = 0x1,
|
||||
FNF_FILLZEROS = 0x2,
|
||||
}
|
||||
|
||||
enum EShade
|
||||
|
|
Loading…
Reference in a new issue