Skip to content

Commit

Permalink
- whitespace cleanup, updated from Raze.
Browse files Browse the repository at this point in the history
  • Loading branch information
coelckers committed Jan 2, 2022
1 parent 3b879c5 commit e60e696
Show file tree
Hide file tree
Showing 182 changed files with 835 additions and 824 deletions.
2 changes: 1 addition & 1 deletion src/common/2d/v_2ddrawer.cpp
Expand Up @@ -993,7 +993,7 @@ void F2DDrawer::AddLine(double x1, double y1, double x2, double y2, int clipx1,
dg.mScissor[3] = clipy2 + 1 + int(offset.Y);
dg.mFlags |= DTF_Scissor;
}

dg.mType = DrawTypeLines;
dg.mRenderStyle = LegacyRenderStyles[STYLE_Translucent];
dg.mVertCount = 2;
Expand Down
8 changes: 4 additions & 4 deletions src/common/2d/v_2ddrawer.h
Expand Up @@ -101,7 +101,7 @@ class F2DDrawer
}

};

struct RenderCommand
{
EDrawType mType;
Expand Down Expand Up @@ -175,7 +175,7 @@ class F2DDrawer
public:
int fullscreenautoaspect = 3;
int cliptop = -1, clipleft = -1, clipwidth = -1, clipheight = -1;

int AddCommand(RenderCommand *data);
void AddIndices(int firstvert, int count, ...);
private:
Expand All @@ -200,8 +200,8 @@ class F2DDrawer
void ClearScreen(PalEntry color = 0xff000000);
void AddDim(PalEntry color, float damount, int x1, int y1, int w, int h);
void AddClear(int left, int top, int right, int bottom, int palcolor, uint32_t color);


void AddLine(double x1, double y1, double x2, double y2, int cx, int cy, int cx2, int cy2, uint32_t color, uint8_t alpha = 255);
void AddThickLine(int x1, int y1, int x2, int y2, double thickness, uint32_t color, uint8_t alpha = 255);
void AddPixel(int x1, int y1, uint32_t color);
Expand Down
2 changes: 1 addition & 1 deletion src/common/2d/v_draw.cpp
Expand Up @@ -857,7 +857,7 @@ bool ParseDrawTextureTags(F2DDrawer *drawer, FGameTexture *img, double x, double
parms->cleanmode = DTA_Base;
parms->virtHeight = ListGetDouble(tags);
break;

case DTA_FullscreenScale:
intval = ListGetInt(tags);
if (intval >= FSMode_None && intval < FSMode_Max)
Expand Down
2 changes: 1 addition & 1 deletion src/common/2d/v_draw.h
Expand Up @@ -36,7 +36,7 @@ enum


FSMode_Max,

// These all use ScaleToFit43, their purpose is to cut down on verbosity because they imply the virtual screen size.
FSMode_Predefined = 1000,
FSMode_Fit320x200 = 1000,
Expand Down
2 changes: 1 addition & 1 deletion src/common/audio/music/i_music.cpp
Expand Up @@ -226,7 +226,7 @@ void I_InitMusic(void)
nomusic = !!Args->CheckParm("-nomusic") || !!Args->CheckParm("-nosound");

snd_mididevice.Callback();

ZMusicCallbacks callbacks{};

callbacks.MessageFunc = zmusic_printfunc;
Expand Down
4 changes: 2 additions & 2 deletions src/common/audio/music/i_soundfont.cpp
Expand Up @@ -140,7 +140,7 @@ FileReader FSoundFontReader::Open(const char *name, std::string& filename)
ZMusicCustomReader* FSoundFontReader::open_interface(const char* name)
{
std::string filename;

FileReader fr = Open(name, filename);
if (!fr.isOpen()) return nullptr;
auto fri = GetMusicReader(fr);
Expand Down Expand Up @@ -336,7 +336,7 @@ void FSoundFontManager::ProcessOneFile(const FString &fn)
// We already got a soundfont with this name. Do not add again.
if (!sfi.mName.CompareNoCase(fb)) return;
}

FileReader fr;
if (fr.OpenFile(fn))
{
Expand Down
16 changes: 8 additions & 8 deletions src/common/audio/music/i_soundfont.h
Expand Up @@ -29,13 +29,13 @@ class FSoundFontReader
// When reading from an archive it will always be case insensitive, just like the lump manager.
bool mCaseSensitivePaths = false;
TArray<FString> mPaths;


int pathcmp(const char *p1, const char *p2);


public:

virtual ~FSoundFontReader() {}
virtual FileReader OpenMainConfigFile() = 0; // this is special because it needs to be synthesized for .sf files and set some restrictions for patch sets
virtual FString MainConfigFileName()
Expand Down Expand Up @@ -147,15 +147,15 @@ class FPatchSetReader : public FSoundFontReader
class FSoundFontManager
{
TArray<FSoundFontInfo> soundfonts;

void ProcessOneFile(const FString & fn);

public:
void CollectSoundfonts();
const FSoundFontInfo *FindSoundFont(const char *name, int allowedtypes) const;
FSoundFontReader *OpenSoundFont(const char *name, int allowedtypes);
const auto &GetList() const { return soundfonts; } // This is for the menu

};


Expand Down
4 changes: 2 additions & 2 deletions src/common/audio/music/music.cpp
Expand Up @@ -180,7 +180,7 @@ static bool FillStream(SoundStream* stream, void* buff, int len, void* userdata)
fbuf[i] = convert[i] * mus_playing.replayGainFactor * (1.f/32768.f);
}
}

if (!written)
{
memset((char*)buff, 0, len);
Expand Down Expand Up @@ -298,7 +298,7 @@ void S_UpdateMusic ()
if (mus_playing.handle != nullptr)
{
ZMusic_Update(mus_playing.handle);

// [RH] Update music and/or playlist. IsPlaying() must be called
// to attempt to reconnect to broken net streams and to advance the
// playlist when the current song finishes.
Expand Down
2 changes: 1 addition & 1 deletion src/common/audio/sound/i_sound.h
Expand Up @@ -107,7 +107,7 @@ class SoundRenderer

// Streaming sounds.
virtual SoundStream *CreateStream (SoundStreamCallback callback, int buffbytes, int flags, int samplerate, void *userdata) = 0;

// Starts a sound.
virtual FISoundChannel *StartSound (SoundHandle sfx, float vol, int pitch, int chanflags, FISoundChannel *reuse_chan, float startTime = 0.f) = 0;
virtual FISoundChannel *StartSound3D (SoundHandle sfx, SoundListener *listener, float vol, FRolloffInfo *rolloff, float distscale, int pitch, int priority, const FVector3 &pos, const FVector3 &vel, int channum, int chanflags, FISoundChannel *reuse_chan, float startTime = 0.f) = 0;
Expand Down
4 changes: 2 additions & 2 deletions src/common/audio/sound/oalsound.cpp
Expand Up @@ -1675,7 +1675,7 @@ void OpenALSoundRenderer::UpdateListener(SoundListener *listener)

const_cast<ReverbContainer*>(env)->Modified = false;
}

// NOTE: Moving into and out of water will undo pitch variations on sounds.
if(listener->underwater || env->SoftwareWater)
{
Expand Down Expand Up @@ -1721,7 +1721,7 @@ void OpenALSoundRenderer::UpdateListener(SoundListener *listener)
}
else if(WasInWater)
{

WasInWater = false;

if(EnvSlot != 0)
Expand Down
8 changes: 4 additions & 4 deletions src/common/audio/sound/s_sound.cpp
Expand Up @@ -402,7 +402,7 @@ FSoundChan *SoundEngine::StartSound(int type, const void *source,
{
return nullptr;
}

sfx = &S_sfx[sound_id];

// Scale volume according to SNDINFO data.
Expand Down Expand Up @@ -611,7 +611,7 @@ FSoundChan *SoundEngine::StartSound(int type, const void *source,
{
chan->Source = source;
}

if (spitch > 0.0) // A_StartSound has top priority over all others.
SetPitch(chan, spitch);
else if (defpitch > 0.0) // $PitchSet overrides $PitchShift
Expand Down Expand Up @@ -726,7 +726,7 @@ sfxinfo_t *SoundEngine::LoadSound(sfxinfo_t *sfx)
{
return sfx;
}

// See if there is another sound already initialized with this lump. If so,
// then set this one up as a link, and don't load the sound again.
for (i = 0; i < S_sfx.Size(); i++)
Expand Down Expand Up @@ -830,7 +830,7 @@ bool SoundEngine::CheckSoundLimit(sfxinfo_t *sfx, const FVector3 &pos, int near_
{
FSoundChan *chan;
int count;

for (chan = Channels, count = 0; chan != NULL && count < near_limit; chan = chan->NextChan)
{
if (chan->ChanFlags & CHANF_FORGETTABLE) continue;
Expand Down
6 changes: 3 additions & 3 deletions src/common/audio/sound/s_soundinternal.h
Expand Up @@ -73,7 +73,7 @@ class FSoundID
{
public:
FSoundID() = default;

static FSoundID byResId(int ndx)
{
return FSoundID(S_FindSoundByResID(ndx));
Expand Down Expand Up @@ -120,7 +120,7 @@ class FSoundID
enum EDummy { NoInit };
FSoundID(EDummy) {}
};

class FSoundIDNoInit : public FSoundID
{
public:
Expand Down Expand Up @@ -196,7 +196,7 @@ void S_SetEnvironment (const ReverbContainer *settings);
ReverbContainer *S_FindEnvironment (const char *name);
ReverbContainer *S_FindEnvironment (int id);
void S_AddEnvironment (ReverbContainer *settings);

class SoundEngine
{
protected:
Expand Down
4 changes: 2 additions & 2 deletions src/common/console/c_bind.cpp
Expand Up @@ -393,7 +393,7 @@ void FKeyBindings::PerformBind(FCommandLine &argv, const char *msg)
else
{
Printf ("%s:\n", msg);

for (i = 0; i < NUM_KEYS; i++)
{
if (!Binds[i].IsEmpty())
Expand Down Expand Up @@ -696,7 +696,7 @@ void ReadBindings(int lump, bool override)
}
continue;
}

// bind destination is optional and is the same as the console command
if (sc.Compare("bind"))
{
Expand Down
6 changes: 3 additions & 3 deletions src/common/console/c_buttons.cpp
Expand Up @@ -101,13 +101,13 @@ int ButtonMap::ListActionCommands (const char *pattern)
int ButtonMap::FindButtonIndex (const char *key, int funclen) const
{
if (!key) return -1;

FName name = funclen == -1? FName(key, true) : FName(key, funclen, true);
if (name == NAME_None) return -1;

auto res = NameToNum.CheckKey(name);
if (!res) return -1;

return *res;
}

Expand Down
2 changes: 1 addition & 1 deletion src/common/console/c_commandbuffer.cpp
Expand Up @@ -299,7 +299,7 @@ void FCommandBuffer::AddString(FString clip)
}
auto strp = (const uint8_t*)clip.GetChars();
while (auto chr = GetCharFromString(strp)) build += chr;

if (Text.length() == 0)
{
Text = build;
Expand Down
2 changes: 1 addition & 1 deletion src/common/console/c_console.cpp
Expand Up @@ -1027,7 +1027,7 @@ static bool C_HandleKey (event_t *ev, FCommandBuffer &buffer)
TabbedList = false;
break;
}

case '`':
// Check to see if we have ` bound to the console before accepting
// it as a way to close the console.
Expand Down
8 changes: 4 additions & 4 deletions src/common/console/c_consolebuffer.cpp
Expand Up @@ -72,7 +72,7 @@ FConsoleBuffer::FConsoleBuffer()
void FConsoleBuffer::AddText(int printlevel, const char *text)
{
FString build = TEXTCOLOR_TAN;

if (mAddType == REPLACELINE)
{
// Just wondering: Do we actually need this case? If so, it may need some work.
Expand All @@ -85,15 +85,15 @@ void FConsoleBuffer::AddText(int printlevel, const char *text)
printlevel = -1;
mLastLineNeedsUpdate = true;
}

if (printlevel >= 0 && printlevel != PRINT_HIGH)
{
if (printlevel == 200) build = TEXTCOLOR_GREEN;
else if (printlevel < PRINTLEVELS) build.Format("%c%c", TEXTCOLOR_ESCAPE, PrintColors[printlevel]+'A');
}

size_t textsize = strlen(text);

if (text[textsize-1] == '\r')
{
textsize--;
Expand Down
4 changes: 2 additions & 2 deletions src/common/console/c_consolebuffer.h
Expand Up @@ -56,12 +56,12 @@ class FConsoleBuffer
EAddType mAddType;
int mTextLines;
bool mBufferWasCleared;

FFont *mLastFont;
int mLastDisplayWidth;
bool mLastLineNeedsUpdate;


public:
FConsoleBuffer();
void AddText(int printlevel, const char *string);
Expand Down
4 changes: 2 additions & 2 deletions src/common/console/c_cvars.h
Expand Up @@ -175,7 +175,7 @@ class FBaseCVar
static void ResetColors (); // recalc color cvars' indices after screen change

static void ListVars (const char *filter, bool plain);

const FString &GetDescription() const { return Description; };
const FString& GetToggleMessage(int which) { return ToggleMessages[which]; }
void SetToggleMessages(const char* on, const char* off)
Expand Down Expand Up @@ -398,7 +398,7 @@ class FColorCVar : public FIntCVar

protected:
virtual void DoSet (UCVarValue value, ECVarType type);

static UCVarValue FromInt2 (int value, ECVarType type);
static int ToInt2 (UCVarValue value, ECVarType type);
};
Expand Down
2 changes: 1 addition & 1 deletion src/common/console/c_dispatch.cpp
Expand Up @@ -253,7 +253,7 @@ void C_DoCommand (const char *cmd, int keynum)
return;
}
}

// Parse it as a normal command
// Checking for matching commands follows this search order:
// 1. Check the Commands[] hash table
Expand Down
4 changes: 2 additions & 2 deletions src/common/console/c_expr.cpp
Expand Up @@ -248,7 +248,7 @@ static FProduction *ParseExpression (FCommandLine &argv, int &parsept)
bool IsFloat (const char *str)
{
const char *pt;

if (*str == '+' || *str == '-')
str++;

Expand Down Expand Up @@ -367,7 +367,7 @@ static FStringProd *DoubleToString (FProduction *prod)
static FDoubleProd *StringToDouble (FProduction *prod)
{
FDoubleProd *newprod;

newprod = NewDoubleProd (atof (static_cast<FStringProd *>(prod)->Value));
M_Free (prod);
return newprod;
Expand Down
2 changes: 1 addition & 1 deletion src/common/console/c_notifybufferbase.cpp
Expand Up @@ -126,7 +126,7 @@ void FNotifyBufferBase::Tick()
{
Text[i].Ticker++;
}

for (i = 0; i < Text.Size(); ++i)
{
if (Text[i].TimeOut != 0 && Text[i].TimeOut > Text[i].Ticker)
Expand Down

0 comments on commit e60e696

Please sign in to comment.