Skip to content

Commit

Permalink
Merge remote-tracking branch 'eduke32/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Hendricks266 committed May 13, 2024
2 parents b6bf756 + 11d2f1c commit 7463d74
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 25 deletions.
4 changes: 4 additions & 0 deletions source/build/include/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
#include <string.h>

#ifdef USE_MIMALLOC
# if defined __cplusplus && defined __APPLE__
// avoid compilation failure due to use of std::realloc in this header
# include <locale>
# endif
# include "mimalloc.h"
# include "mimalloc-override.h"
#endif
Expand Down
22 changes: 18 additions & 4 deletions source/duke3d/src/gameexec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3566,13 +3566,27 @@ GAMEEXEC_STATIC void VM_Execute(int vm_execution_depth /*= false*/)
insptr++;

tw = (*insptr++ - vm.pSprite->xrepeat) << 1;
vm.pSprite->xrepeat += ksgn(tw);

if ((vm.pSprite->picnum == APLAYER && vm.pSprite->yrepeat < 36) || *insptr < vm.pSprite->yrepeat
|| ((vm.pSprite->yrepeat * (tilesiz[vm.pSprite->picnum].y + 8)) << 2) < (vm.pActor->floorz - vm.pActor->ceilingz))
if (PLUTOPAK)
{
vm.pSprite->xrepeat += ksgn(tw);

if ((vm.pSprite->picnum == APLAYER && vm.pSprite->yrepeat < 36) || *insptr < vm.pSprite->yrepeat
|| ((vm.pSprite->yrepeat * (tilesiz[vm.pSprite->picnum].y + 8)) << 2) < (vm.pActor->floorz - vm.pActor->ceilingz))
{
tw = ((*insptr) - vm.pSprite->yrepeat) << 1;
if (klabs(tw))
vm.pSprite->yrepeat += ksgn(tw);
}
}
else
{
if (klabs(tw) > 2)
vm.pSprite->xrepeat += ksgn(tw);

tw = ((*insptr) - vm.pSprite->yrepeat) << 1;
if (klabs(tw))

if (klabs(tw) > 2)
vm.pSprite->yrepeat += ksgn(tw);
}

Expand Down
28 changes: 7 additions & 21 deletions source/duke3d/src/sounds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -848,6 +848,13 @@ int S_PlaySound3D(int num, int spriteNum, const vec3_t& pos)
|| (pPlayer->timebeforeexit > 0 && pPlayer->timebeforeexit <= GAMETICSPERSEC * 3))
return -1;

// Duke-Tag sound
if ((snd->flags & (SF_DTAG|SF_GLOBAL)) == SF_DTAG)
{
S_PlaySound(sndNum);
return 0;
}

// Duke talk
if (snd->flags & SF_TALK)
{
Expand All @@ -860,27 +867,6 @@ int S_PlaySound3D(int num, int spriteNum, const vec3_t& pos)
else if (g_dukeTalk || !(ud.config.VoiceToggle & 1))
return -1;
}
else if ((snd->flags & (SF_DTAG|SF_GLOBAL)) == SF_DTAG) // Duke-Tag sound
{
int const voice = S_PlaySound(sndNum);

if (voice <= FX_Ok)
return -1;

int slot = 0;
while (slot < MAXSOUNDINSTANCES && snd->voices[slot].handle != voice)
slot++;

if (/*EDUKE32_PREDICT_FALSE*/(slot >= MAXSOUNDINSTANCES))
{
LOG_F(WARNING, "S_PlaySound3D: slot >= MAXSOUNDINSTANCES!");
return -1;
}

snd->voices[slot].owner = spriteNum;

return voice;
}

int32_t sndist, sndang;
int const explosionp = S_CalcDistAndAng(spriteNum, sndNum, CAMERA(sect), fix16_to_int(CAMERA(q16ang)), CAMERA(pos), pos, &sndist, &sndang);
Expand Down

0 comments on commit 7463d74

Please sign in to comment.