- fixed issues reported by XCode

This commit is contained in:
Christoph Oelckers 2020-07-23 16:31:26 +02:00
parent 27bbee6750
commit d16d8f0d0e
9 changed files with 9 additions and 20 deletions

View file

@ -218,7 +218,7 @@ public:
void Reload() void Reload()
{ {
buffer = std::move(Base->GetPalettedPixels(0)); buffer = Base->GetPalettedPixels(0);
} }
}; };
@ -383,7 +383,7 @@ inline const uint8_t* tilePtr(int num)
{ {
auto tex = TileFiles.tiledata[num].texture; auto tex = TileFiles.tiledata[num].texture;
if (!tex || tex->GetTexelWidth() <= 0 || tex->GetTexelHeight() <= 0) return nullptr; if (!tex || tex->GetTexelWidth() <= 0 || tex->GetTexelHeight() <= 0) return nullptr;
TileFiles.tiledata[num].rawCache.data = std::move(tex->GetTexture()->Get8BitPixels(false)); TileFiles.tiledata[num].rawCache.data = tex->GetTexture()->Get8BitPixels(false);
} }
TileFiles.tiledata[num].rawCache.lastUseTime = I_nsTime(); TileFiles.tiledata[num].rawCache.lastUseTime = I_nsTime();
return TileFiles.tiledata[num].rawCache.data.Data(); return TileFiles.tiledata[num].rawCache.data.Data();

View file

@ -454,7 +454,7 @@ public:
if (!S_CheckSoundPlaying(ENDSEQVOL3SND8)) if (!S_CheckSoundPlaying(ENDSEQVOL3SND8))
{ {
sound++; sound++;
waittime = clock + SoundEnabled()? 1'000'000'000 : 5'000'000'000; // if sound is off this wouldn't wait without a longer delay here. waittime = clock + (SoundEnabled()? 1'000'000'000 : 5'000'000'000); // if sound is off this wouldn't wait without a longer delay here.
} }
break; break;
@ -663,13 +663,6 @@ void doorders(const CompletionFunc& completion)
// //
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
static void PlayBonusMusic()
{
if (MusicEnabled() && mus_enabled)
S_PlaySound(BONUSMUSIC, CHAN_AUTO, CHANF_UI);
}
class DDukeMultiplayerBonusScreen : public DScreenJob class DDukeMultiplayerBonusScreen : public DScreenJob
{ {
int playerswhenstarted; int playerswhenstarted;

View file

@ -2813,7 +2813,7 @@ void handle_se14(int i, bool checkstat, int RPG, int JIBS6)
{ {
if (statstate) if (statstate)
{ {
if (!S_CheckSoundPlaying(hittype[i].lastvx) == 0) if (!S_CheckSoundPlaying(hittype[i].lastvx))
spritesound(hittype[i].lastvx, i); spritesound(hittype[i].lastvx, i);
} }
if ((!checkstat || !statstate) && (ud.monsters_off == 0 && sc->floorpal == 0 && (sc->floorstat & 1) && rnd(8))) if ((!checkstat || !statstate) && (ud.monsters_off == 0 && sc->floorpal == 0 && (sc->floorstat & 1) && rnd(8)))

View file

@ -4449,7 +4449,7 @@ static int fallspecial(int g_i, int g_p)
hittype[g_i].picnum = SHOTSPARK1; hittype[g_i].picnum = SHOTSPARK1;
hittype[g_i].extra = 1; hittype[g_i].extra = 1;
} }
else if (isRRRA() && sector[g_sp->sectnum].floorpicnum == RRTILE7820 || sector[g_sp->sectnum].floorpicnum == RRTILE7768) else if (isRRRA() && (sector[g_sp->sectnum].floorpicnum == RRTILE7820 || sector[g_sp->sectnum].floorpicnum == RRTILE7768))
{ {
if (g_sp->picnum != MINION && g_sp->pal != 19) if (g_sp->picnum != MINION && g_sp->pal != 19)
{ {

View file

@ -221,7 +221,6 @@ bool setnextmap(bool checksecretexit);
void prelevel_d(int g); void prelevel_d(int g);
void prelevel_r(int g); void prelevel_r(int g);
void e4intro(const CompletionFunc& completion); void e4intro(const CompletionFunc& completion);
void clearfrags(void);
void exitlevel(); void exitlevel();
int enterlevel(MapRecord* mi, int gm); int enterlevel(MapRecord* mi, int gm);
void donewgame(MapRecord* map, int sk); void donewgame(MapRecord* map, int sk);

View file

@ -77,7 +77,7 @@ public:
const char* GetChars() { return text; } const char* GetChars() { return text; }
int compare(const char* c) const { return strcmp(text, c); } int compare(const char* c) const { return strcmp(text, c); }
int comparei(const char* c) const { return stricmp(text, c); } int comparei(const char* c) const { return stricmp(text, c); }
labelstring& operator=(const char* c) { strncpy(text, c, 64); text[63] = 0; } labelstring& operator=(const char* c) { strncpy(text, c, 64); text[63] = 0; return *this; }
}; };
@ -471,7 +471,7 @@ int ConCompiler::keyword(void)
void ConCompiler::getlabel(void) void ConCompiler::getlabel(void)
{ {
long i; int i;
skipcomments(); skipcomments();

View file

@ -38,9 +38,6 @@ Modifications for JonoF's port by Jonathon Fowler (jf@jonof.id.au)
BEGIN_DUKE_NS BEGIN_DUKE_NS
void GetNextInput();
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// //
// abstract the queue's implementation // abstract the queue's implementation

View file

@ -442,7 +442,7 @@ bool IsGameEvent(int i)
{ {
if (i<0) return 0; if (i<0) return 0;
if (i>=MAXGAMEEVENTS) return 0; if (i>=MAXGAMEEVENTS) return 0;
return (apScriptGameEvent[i]!=NULL); return (apScriptGameEvent[i] != 0);
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------

View file

@ -1774,7 +1774,7 @@ static void onMotorcycle(int snum, ESyncBits &sb_snum)
} }
else if (p->MotoSpeed >= 20 && p->on_ground == 1 && (p->moto_on_mud || p->moto_on_oil)) else if (p->MotoSpeed >= 20 && p->on_ground == 1 && (p->moto_on_mud || p->moto_on_oil))
{ {
short var9c, vara0, vara4; short var9c, vara0, vara4=0;
var9c = p->MotoSpeed; var9c = p->MotoSpeed;
vara0 = p->getang(); vara0 = p->getang();
var84 = krand() & 1; var84 = krand() & 1;