mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-11 15:22:15 +00:00
Merge branch 'master' of https://github.com/rheit/zdoom into z_osx_clean
This commit is contained in:
commit
0f602fb1ce
7 changed files with 66 additions and 11 deletions
|
@ -2306,6 +2306,12 @@ void FBehavior::LoadScriptsDirectory ()
|
|||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
// [EP] Clang 3.5.0 optimizer miscompiles this function and causes random
|
||||
// crashes in the program. I hope that Clang 3.5.x will fix this.
|
||||
#if defined(__clang__) && __clang_major__ == 3 && __clang_minor__ >= 5
|
||||
asm("" : "+g" (NumScripts));
|
||||
#endif
|
||||
for (i = 0; i < NumScripts; ++i)
|
||||
{
|
||||
Scripts[i].Flags = 0;
|
||||
|
@ -4361,6 +4367,7 @@ enum EACSFunctions
|
|||
ACSF_ChangeActorAngle,
|
||||
ACSF_ChangeActorPitch, // 80
|
||||
ACSF_GetArmorInfo,
|
||||
ACSF_DropInventory,
|
||||
|
||||
/* Zandronum's - these must be skipped when we reach 99!
|
||||
-100:ResetMap(0),
|
||||
|
@ -5485,6 +5492,42 @@ doplaysound: if (funcIndex == ACSF_PlayActorSound)
|
|||
break;
|
||||
}
|
||||
|
||||
case ACSF_DropInventory:
|
||||
{
|
||||
const char *type = FBehavior::StaticLookupString(args[1]);
|
||||
AInventory *inv;
|
||||
|
||||
if (type != NULL)
|
||||
{
|
||||
if (args[0] == 0)
|
||||
{
|
||||
if (activator != NULL)
|
||||
{
|
||||
inv = activator->FindInventory(type);
|
||||
if (inv)
|
||||
{
|
||||
activator->DropInventory(inv);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
FActorIterator it(args[0]);
|
||||
AActor *actor;
|
||||
|
||||
while ((actor = it.Next()) != NULL)
|
||||
{
|
||||
inv = actor->FindInventory(type);
|
||||
if (inv)
|
||||
{
|
||||
actor->DropInventory(inv);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case ACSF_CheckFlag:
|
||||
{
|
||||
AActor *actor = SingleActorFromTID(args[0], activator);
|
||||
|
|
|
@ -206,7 +206,7 @@ void AActor::Serialize (FArchive &arc)
|
|||
{
|
||||
arc << flags7;
|
||||
}
|
||||
if (SaveVersion >= 4511)
|
||||
if (SaveVersion >= 4512)
|
||||
{
|
||||
arc << weaponspecial;
|
||||
}
|
||||
|
|
|
@ -1321,7 +1321,7 @@ sfxinfo_t *S_LoadSound(sfxinfo_t *sfx)
|
|||
// If the sound is voc, use the custom loader.
|
||||
if (strncmp ((const char *)sfxstart, "Creative Voice File", 19) == 0)
|
||||
{
|
||||
sfx->data = GSnd->LoadSoundVoc(sfxstart, len);
|
||||
sfx->data = GSnd->LoadSoundVoc(sfxstart, size);
|
||||
}
|
||||
// If the sound is raw, just load it as such.
|
||||
// Otherwise, try the sound as DMX format.
|
||||
|
|
|
@ -14,14 +14,13 @@
|
|||
|
||||
|
||||
static DWORD TicStart;
|
||||
static DWORD TicNext;
|
||||
static DWORD BaseTime;
|
||||
static int TicFrozen;
|
||||
|
||||
// Signal based timer.
|
||||
static Semaphore timerWait;
|
||||
static int tics;
|
||||
static DWORD sig_start, sig_next;
|
||||
static DWORD sig_start;
|
||||
|
||||
void I_SelectTimer();
|
||||
|
||||
|
@ -60,7 +59,6 @@ int I_GetTimePolled (bool saveMS)
|
|||
if (saveMS)
|
||||
{
|
||||
TicStart = tm;
|
||||
TicNext = Scale((Scale (tm, TICRATE, 1000) + 1), 1000, TICRATE);
|
||||
}
|
||||
return Scale(tm - BaseTime, TICRATE, 1000);
|
||||
}
|
||||
|
@ -70,7 +68,6 @@ int I_GetTimeSignaled (bool saveMS)
|
|||
if (saveMS)
|
||||
{
|
||||
TicStart = sig_start;
|
||||
TicNext = sig_next;
|
||||
}
|
||||
return tics;
|
||||
}
|
||||
|
@ -141,7 +138,6 @@ void I_HandleAlarm (int sig)
|
|||
if(!TicFrozen)
|
||||
tics++;
|
||||
sig_start = SDL_GetTicks();
|
||||
sig_next = Scale((Scale (sig_start, TICRATE, 1000) + 1), 1000, TICRATE);
|
||||
SEMAPHORE_SIGNAL(timerWait)
|
||||
}
|
||||
|
||||
|
@ -184,15 +180,14 @@ void I_SelectTimer()
|
|||
fixed_t I_GetTimeFrac (uint32 *ms)
|
||||
{
|
||||
DWORD now = SDL_GetTicks ();
|
||||
if (ms) *ms = TicNext;
|
||||
DWORD step = TicNext - TicStart;
|
||||
if (step == 0)
|
||||
if (ms) *ms = TicStart + (1000 / TICRATE);
|
||||
if (TicStart == 0)
|
||||
{
|
||||
return FRACUNIT;
|
||||
}
|
||||
else
|
||||
{
|
||||
fixed_t frac = clamp<fixed_t> ((now - TicStart)*FRACUNIT/step, 0, FRACUNIT);
|
||||
fixed_t frac = clamp<fixed_t> ((now - TicStart)*FRACUNIT*TICRATE/1000, 0, FRACUNIT);
|
||||
return frac;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -494,6 +494,7 @@ SoundHandle SoundRenderer::LoadSoundVoc(BYTE *sfxdata, int length)
|
|||
break;
|
||||
default: break;
|
||||
}
|
||||
i += blocksize;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1755,6 +1755,8 @@ enum SIX_Flags
|
|||
SIXF_TRANSFERSPECIAL = 1 << 15,
|
||||
SIXF_CLEARCALLERSPECIAL = 1 << 16,
|
||||
SIXF_TRANSFERSTENCILCOL = 1 << 17,
|
||||
SIXF_TRANSFERALPHA = 1 << 18,
|
||||
SIXF_TRANSFERRENDERSTYLE = 1 << 19,
|
||||
};
|
||||
|
||||
static bool InitSpawnedItem(AActor *self, AActor *mo, int flags)
|
||||
|
@ -1843,6 +1845,10 @@ static bool InitSpawnedItem(AActor *self, AActor *mo, int flags)
|
|||
// If this is a missile or something else set the target to the originator
|
||||
mo->target = originator ? originator : self;
|
||||
}
|
||||
if (flags & SIXF_SETMASTER)
|
||||
{
|
||||
mo->master = originator;
|
||||
}
|
||||
if (flags & SIXF_TRANSFERSCALE)
|
||||
{
|
||||
mo->scaleX = self->scaleX;
|
||||
|
@ -1871,6 +1877,14 @@ static bool InitSpawnedItem(AActor *self, AActor *mo, int flags)
|
|||
{
|
||||
mo->fillcolor = self->fillcolor;
|
||||
}
|
||||
if (flags & SIXF_TRANSFERALPHA)
|
||||
{
|
||||
mo->alpha = self->alpha;
|
||||
}
|
||||
if (flags & SIXF_TRANSFERRENDERSTYLE)
|
||||
{
|
||||
mo->RenderStyle = self->RenderStyle;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -65,6 +65,8 @@ const int SXF_TRANSFERSCALE = 16384;
|
|||
const int SXF_TRANSFERSPECIAL = 32768;
|
||||
const int SXF_CLEARCALLERSPECIAL = 65536;
|
||||
const int SXF_TRANSFERSTENCILCOL = 131072;
|
||||
const int SXF_TRANSFERALPHA = 262144;
|
||||
const int SXF_TRANSFERRENDERSTYLE = 524288;
|
||||
|
||||
// Flags for A_Chase
|
||||
const int CHF_FASTCHASE = 1;
|
||||
|
|
Loading…
Reference in a new issue