mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-26 22:11:43 +00:00
- whitespace cleanup, updated from Raze.
This commit is contained in:
parent
3b879c5656
commit
e60e6967c0
182 changed files with 812 additions and 801 deletions
|
@ -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;
|
||||
|
|
|
@ -101,7 +101,7 @@ public:
|
|||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
struct RenderCommand
|
||||
{
|
||||
EDrawType mType;
|
||||
|
@ -175,7 +175,7 @@ public:
|
|||
public:
|
||||
int fullscreenautoaspect = 3;
|
||||
int cliptop = -1, clipleft = -1, clipwidth = -1, clipheight = -1;
|
||||
|
||||
|
||||
int AddCommand(RenderCommand *data);
|
||||
void AddIndices(int firstvert, int count, ...);
|
||||
private:
|
||||
|
@ -200,8 +200,8 @@ public:
|
|||
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);
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -226,7 +226,7 @@ void I_InitMusic(void)
|
|||
nomusic = !!Args->CheckParm("-nomusic") || !!Args->CheckParm("-nosound");
|
||||
|
||||
snd_mididevice.Callback();
|
||||
|
||||
|
||||
ZMusicCallbacks callbacks{};
|
||||
|
||||
callbacks.MessageFunc = zmusic_printfunc;
|
||||
|
|
|
@ -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);
|
||||
|
@ -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))
|
||||
{
|
||||
|
|
|
@ -29,13 +29,13 @@ protected:
|
|||
// 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()
|
||||
|
@ -147,15 +147,15 @@ public:
|
|||
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
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
@ -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.
|
||||
|
|
|
@ -107,7 +107,7 @@ public:
|
|||
|
||||
// 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;
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
@ -1721,7 +1721,7 @@ void OpenALSoundRenderer::UpdateListener(SoundListener *listener)
|
|||
}
|
||||
else if(WasInWater)
|
||||
{
|
||||
|
||||
|
||||
WasInWater = false;
|
||||
|
||||
if(EnvSlot != 0)
|
||||
|
|
|
@ -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.
|
||||
|
@ -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
|
||||
|
@ -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++)
|
||||
|
@ -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;
|
||||
|
|
|
@ -73,7 +73,7 @@ class FSoundID
|
|||
{
|
||||
public:
|
||||
FSoundID() = default;
|
||||
|
||||
|
||||
static FSoundID byResId(int ndx)
|
||||
{
|
||||
return FSoundID(S_FindSoundByResID(ndx));
|
||||
|
@ -120,7 +120,7 @@ protected:
|
|||
enum EDummy { NoInit };
|
||||
FSoundID(EDummy) {}
|
||||
};
|
||||
|
||||
|
||||
class FSoundIDNoInit : public FSoundID
|
||||
{
|
||||
public:
|
||||
|
@ -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:
|
||||
|
|
|
@ -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())
|
||||
|
@ -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"))
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
@ -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--;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -175,7 +175,7 @@ public:
|
|||
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)
|
||||
|
@ -398,7 +398,7 @@ public:
|
|||
|
||||
protected:
|
||||
virtual void DoSet (UCVarValue value, ECVarType type);
|
||||
|
||||
|
||||
static UCVarValue FromInt2 (int value, ECVarType type);
|
||||
static int ToInt2 (UCVarValue value, ECVarType type);
|
||||
};
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -248,7 +248,7 @@ done:
|
|||
bool IsFloat (const char *str)
|
||||
{
|
||||
const char *pt;
|
||||
|
||||
|
||||
if (*str == '+' || *str == '-')
|
||||
str++;
|
||||
|
||||
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -97,20 +97,20 @@ void FCycler::Update(double diff)
|
|||
{
|
||||
double mult, angle;
|
||||
double step = m_end - m_start;
|
||||
|
||||
|
||||
if (!m_shouldCycle)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
m_time += diff;
|
||||
if (m_time >= m_cycle)
|
||||
{
|
||||
m_time = m_cycle;
|
||||
}
|
||||
|
||||
|
||||
mult = m_time / m_cycle;
|
||||
|
||||
|
||||
switch (m_cycleType)
|
||||
{
|
||||
case CYCLE_Linear:
|
||||
|
@ -149,7 +149,7 @@ void FCycler::Update(double diff)
|
|||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (m_time == m_cycle)
|
||||
{
|
||||
m_time = 0.;
|
||||
|
|
|
@ -23,7 +23,7 @@ public:
|
|||
FCycler() = default;
|
||||
FCycler(const FCycler &other) = default;
|
||||
FCycler &operator=(const FCycler &other) = default;
|
||||
|
||||
|
||||
void Update(double diff);
|
||||
void SetParams(double start, double end, double cycle, bool update = false);
|
||||
void ShouldCycle(bool sc) { m_shouldCycle = sc; }
|
||||
|
|
|
@ -138,7 +138,7 @@ void D_RemoveNextCharEvent()
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
|
|
|
@ -172,7 +172,7 @@ FString GetPlayerName(int num)
|
|||
SOCKET UDPsocket (void)
|
||||
{
|
||||
SOCKET s;
|
||||
|
||||
|
||||
// allocate a socket
|
||||
s = socket (PF_INET, SOCK_DGRAM, IPPROTO_UDP);
|
||||
if (s == INVALID_SOCKET)
|
||||
|
@ -193,7 +193,7 @@ void BindToLocalPort (SOCKET s, u_short port)
|
|||
address.sin_family = AF_INET;
|
||||
address.sin_addr.s_addr = INADDR_ANY;
|
||||
address.sin_port = htons(port);
|
||||
|
||||
|
||||
v = bind (s, (sockaddr *)&address, sizeof(address));
|
||||
if (v == SOCKET_ERROR)
|
||||
I_FatalError ("BindToPort: %s", neterror ());
|
||||
|
@ -459,7 +459,7 @@ void StartNetwork (bool autoPort)
|
|||
|
||||
netgame = true;
|
||||
multiplayer = true;
|
||||
|
||||
|
||||
// create communication socket
|
||||
mysocket = UDPsocket ();
|
||||
BindToLocalPort (mysocket, autoPort ? 0 : DOOMPORT);
|
||||
|
@ -892,7 +892,7 @@ bool JoinGame (int i)
|
|||
SendAbort();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
StartScreen->NetMessage ("Total players: %d", doomcom.numnodes);
|
||||
|
||||
doomcom.id = DOOMCOM_ID;
|
||||
|
|
|
@ -76,7 +76,7 @@ struct doomcom_t
|
|||
|
||||
// packet data to be sent
|
||||
uint8_t data[MAX_MSGLEN];
|
||||
|
||||
|
||||
};
|
||||
|
||||
extern doomcom_t doomcom;
|
||||
|
|
|
@ -21,7 +21,7 @@ enum EJoyAxis
|
|||
struct NOVTABLE IJoystickConfig
|
||||
{
|
||||
virtual ~IJoystickConfig() = 0;
|
||||
|
||||
|
||||
virtual FString GetName() = 0;
|
||||
virtual float GetSensitivity() = 0;
|
||||
virtual void SetSensitivity(float scale) = 0;
|
||||
|
|
|
@ -857,7 +857,7 @@ bool FScanner::CheckFloat (bool evaluate)
|
|||
UnGet();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Float = strtod (String, &stopper);
|
||||
if (*stopper != 0)
|
||||
{
|
||||
|
|
|
@ -159,7 +159,7 @@ public:
|
|||
{
|
||||
return constants.CheckKey(name);
|
||||
}
|
||||
|
||||
|
||||
// Token based variant
|
||||
bool CheckValue(bool allowfloat, bool evaluate = true);
|
||||
void MustGetValue(bool allowfloat, bool evaluate = true);
|
||||
|
|
|
@ -102,14 +102,14 @@ std2:
|
|||
":" { RET(':'); }
|
||||
";" { RET(';'); }
|
||||
"}" { StateMode = 0; StateOptions = false; RET('}'); }
|
||||
|
||||
|
||||
WSP+ { goto std1; }
|
||||
"\n" { goto newline; }
|
||||
|
||||
|
||||
TOKS = (NWS\[/":;}]);
|
||||
TOKS* ([/] (TOKS\[*]) TOKS*)*
|
||||
{ RET(TK_NonWhitespace); }
|
||||
|
||||
|
||||
*/
|
||||
}
|
||||
else if (tokens) // A well-defined scanner, based on the c.re example.
|
||||
|
@ -222,7 +222,7 @@ std2:
|
|||
'canraise' { RET(StateOptions ? TK_CanRaise : TK_Identifier); }
|
||||
'offset' { RET(StateOptions ? TK_Offset : TK_Identifier); }
|
||||
'light' { RET(StateOptions ? TK_Light : TK_Identifier); }
|
||||
|
||||
|
||||
/* other DECORATE top level keywords */
|
||||
'#include' { RET(TK_Include); }
|
||||
|
||||
|
|
|
@ -623,7 +623,7 @@ void FSerializer::WriteObjects()
|
|||
void FSerializer::ReadObjects(bool hubtravel)
|
||||
{
|
||||
bool founderrors = false;
|
||||
|
||||
|
||||
if (isReading() && BeginArray("objects"))
|
||||
{
|
||||
// Do not link any thinker that's being created here. This will be done by deserializing the thinker list later.
|
||||
|
|
|
@ -111,7 +111,7 @@ public:
|
|||
{
|
||||
return w != nullptr;
|
||||
}
|
||||
|
||||
|
||||
bool canSkip() const;
|
||||
|
||||
template<class T>
|
||||
|
|
|
@ -42,7 +42,7 @@ struct FWriter
|
|||
rapidjson::StringBuffer mOutString;
|
||||
TArray<DObject *> mDObjects;
|
||||
TMap<DObject *, int> mObjectMap;
|
||||
|
||||
|
||||
FWriter(bool pretty)
|
||||
{
|
||||
if (!pretty)
|
||||
|
@ -193,7 +193,7 @@ struct FReader
|
|||
rapidjson::Value *FindKey(const char *key)
|
||||
{
|
||||
FJSONObject &obj = mObjects.Last();
|
||||
|
||||
|
||||
if (obj.mObject->IsObject())
|
||||
{
|
||||
if (key == nullptr)
|
||||
|
|
|
@ -47,7 +47,7 @@ public:
|
|||
CurPos = 0;
|
||||
NotchPos = 0;
|
||||
}
|
||||
|
||||
|
||||
virtual ~FStartupScreen() = default;
|
||||
|
||||
virtual void Progress() {}
|
||||
|
@ -98,7 +98,7 @@ public:
|
|||
void AppendStatusLine(const char *status);
|
||||
protected:
|
||||
void SetWindowSize();
|
||||
|
||||
|
||||
int ThermX, ThermY, ThermWidth, ThermHeight;
|
||||
int HMsgY, SMsgX;
|
||||
};
|
||||
|
|
|
@ -61,28 +61,28 @@ public:
|
|||
{
|
||||
Sec = 0;
|
||||
}
|
||||
|
||||
|
||||
void Clock()
|
||||
{
|
||||
timespec ts;
|
||||
|
||||
|
||||
clock_gettime(CLOCK_MONOTONIC, &ts);
|
||||
Sec -= ts.tv_sec + ts.tv_nsec * 1e-9;
|
||||
}
|
||||
|
||||
|
||||
void Unclock()
|
||||
{
|
||||
timespec ts;
|
||||
|
||||
|
||||
clock_gettime(CLOCK_MONOTONIC, &ts);
|
||||
Sec += ts.tv_sec + ts.tv_nsec * 1e-9;
|
||||
}
|
||||
|
||||
|
||||
double Time()
|
||||
{
|
||||
return Sec;
|
||||
}
|
||||
|
||||
|
||||
double TimeMS()
|
||||
{
|
||||
return Sec * 1e3;
|
||||
|
@ -159,24 +159,24 @@ public:
|
|||
{
|
||||
Counter = 0;
|
||||
}
|
||||
|
||||
|
||||
void Clock()
|
||||
{
|
||||
int64_t time = rdtsc();
|
||||
Counter -= time;
|
||||
}
|
||||
|
||||
|
||||
void Unclock(bool checkvar = true)
|
||||
{
|
||||
int64_t time = rdtsc();
|
||||
Counter += time;
|
||||
}
|
||||
|
||||
|
||||
double Time()
|
||||
{
|
||||
return Counter * PerfToSec;
|
||||
}
|
||||
|
||||
|
||||
double TimeMS()
|
||||
{
|
||||
return Counter * PerfToMillisec;
|
||||
|
|
|
@ -639,7 +639,7 @@ bool FStringTable::MatchDefaultString(const char *name, const char *content) con
|
|||
// This only compares the first line to avoid problems with bad linefeeds. For the few cases where this feature is needed it is sufficient.
|
||||
auto c = GetLanguageString(name, FStringTable::default_table);
|
||||
if (!c) return false;
|
||||
|
||||
|
||||
// Check a secondary key, in case the text comparison cannot be done due to needed orthographic fixes (see Harmony's exit text)
|
||||
FStringf checkkey("%s_CHECK", name);
|
||||
auto cc = GetLanguageString(checkkey, FStringTable::default_table);
|
||||
|
|
|
@ -91,7 +91,7 @@ public:
|
|||
allStrings.Insert(override_table, map);
|
||||
UpdateLanguage(nullptr);
|
||||
}
|
||||
|
||||
|
||||
const char *GetLanguageString(const char *name, uint32_t langtable, int gender = -1) const;
|
||||
bool MatchDefaultString(const char *name, const char *content) const;
|
||||
const char *GetString(const char *name, uint32_t *langtable, int gender = -1) const;
|
||||
|
@ -110,7 +110,7 @@ private:
|
|||
StringMacroMap allMacros;
|
||||
LangMap allStrings;
|
||||
TArray<std::pair<uint32_t, StringMap*>> currentLanguageSet;
|
||||
|
||||
|
||||
void LoadLanguage (int lumpnum, const TArray<uint8_t> &buffer);
|
||||
TArray<TArray<FString>> parseCSV(const TArray<uint8_t> &buffer);
|
||||
bool ParseLanguageCSV(int lumpnum, const TArray<uint8_t> &buffer);
|
||||
|
@ -127,7 +127,7 @@ public:
|
|||
if (*str == '$') return str;
|
||||
return FString("$") + str;
|
||||
}
|
||||
|
||||
|
||||
static FString MakeMacro(const char *str, size_t len)
|
||||
{
|
||||
if (*str == '$') return FString(str, len);
|
||||
|
|
|
@ -57,7 +57,7 @@ ColorTable256k RGB256k;
|
|||
void BuildTransTable (const PalEntry *palette)
|
||||
{
|
||||
int r, g, b;
|
||||
|
||||
|
||||
// create the RGB555 lookup table
|
||||
for (r = 0; r < 32; r++)
|
||||
for (g = 0; g < 32; g++)
|
||||
|
@ -68,16 +68,16 @@ void BuildTransTable (const PalEntry *palette)
|
|||
for (g = 0; g < 64; g++)
|
||||
for (b = 0; b < 64; b++)
|
||||
RGB256k.RGB[r][g][b] = ColorMatcher.Pick ((r<<2)|(r>>4), (g<<2)|(g>>4), (b<<2)|(b>>4));
|
||||
|
||||
|
||||
int x, y;
|
||||
|
||||
|
||||
// create the swizzled palette
|
||||
for (x = 0; x < 65; x++)
|
||||
for (y = 0; y < 256; y++)
|
||||
Col2RGB8[x][y] = (((palette[y].r*x)>>4)<<20) |
|
||||
((palette[y].g*x)>>4) |
|
||||
(((palette[y].b*x)>>4)<<10);
|
||||
|
||||
|
||||
// create the swizzled palette with the lsb of red and blue forced to 0
|
||||
// (for green, a 1 is okay since it never gets added into)
|
||||
for (x = 1; x < 64; x++)
|
||||
|
@ -90,7 +90,7 @@ void BuildTransTable (const PalEntry *palette)
|
|||
}
|
||||
Col2RGB8_LessPrecision[0] = Col2RGB8[0];
|
||||
Col2RGB8_LessPrecision[64] = Col2RGB8[64];
|
||||
|
||||
|
||||
// create the inverse swizzled palette
|
||||
for (x = 0; x < 65; x++)
|
||||
for (y = 0; y < 256; y++)
|
||||
|
|
|
@ -118,7 +118,7 @@ int FDirectory::AddDirectory(const char *dirpath)
|
|||
FString dirmatch = dirpath;
|
||||
findstate_t find;
|
||||
dirmatch += '*';
|
||||
|
||||
|
||||
handle = I_FindFirst(dirmatch.GetChars(), &find);
|
||||
if (handle == ((void *)(-1)))
|
||||
{
|
||||
|
|
|
@ -99,7 +99,7 @@ bool FGrpFile::Open(bool quiet, LumpFilterInfo*)
|
|||
|
||||
Reader.Read(&header, sizeof(header));
|
||||
NumLumps = LittleLong(header.NumLumps);
|
||||
|
||||
|
||||
GrpLump *fileinfo = new GrpLump[NumLumps];
|
||||
Reader.Read (fileinfo, NumLumps * sizeof(GrpLump));
|
||||
|
||||
|
|
|
@ -95,7 +95,7 @@ bool FPakFile::Open(bool quiet, LumpFilterInfo* filter)
|
|||
Reader.Read(&header, sizeof(header));
|
||||
NumLumps = LittleLong(header.dirlen) / sizeof(dpackfile_t);
|
||||
header.dirofs = LittleLong(header.dirofs);
|
||||
|
||||
|
||||
TArray<dpackfile_t> fileinfo(NumLumps, true);
|
||||
Reader.Seek (header.dirofs, FileReader::SeekSet);
|
||||
Reader.Read (fileinfo.Data(), NumLumps * sizeof(dpackfile_t));
|
||||
|
|
|
@ -221,7 +221,7 @@ int FRFFLump::FillCache()
|
|||
{
|
||||
int cryptlen = min<int> (LumpSize, 256);
|
||||
uint8_t *data = (uint8_t *)Cache;
|
||||
|
||||
|
||||
for (int i = 0; i < cryptlen; ++i)
|
||||
{
|
||||
data[i] ^= i >> 1;
|
||||
|
|
|
@ -206,7 +206,7 @@ bool FWadFile::Open(bool quiet, LumpFilterInfo*)
|
|||
Lumps[i].LumpSize = isBigEndian ? BigLong(fileinfo[i].Size) : LittleLong(fileinfo[i].Size);
|
||||
Lumps[i].Namespace = ns_global;
|
||||
Lumps[i].Flags = Lumps[i].Compressed ? LUMPF_COMPRESSED | LUMPF_SHORTNAME : LUMPF_SHORTNAME;
|
||||
|
||||
|
||||
// Check if the lump is within the WAD file and print a warning if not.
|
||||
if (Lumps[i].Position + Lumps[i].LumpSize > wadSize || Lumps[i].Position < 0 || Lumps[i].LumpSize < 0)
|
||||
{
|
||||
|
@ -279,7 +279,7 @@ void FWadFile::SetNamespace(const char *startmarker, const char *endmarker, name
|
|||
int numstartmarkers = 0, numendmarkers = 0;
|
||||
unsigned int i;
|
||||
TArray<Marker> markers;
|
||||
|
||||
|
||||
for(i = 0; i < NumLumps; i++)
|
||||
{
|
||||
if (IsMarker(i, startmarker))
|
||||
|
@ -302,7 +302,7 @@ void FWadFile::SetNamespace(const char *startmarker, const char *endmarker, name
|
|||
|
||||
Printf(TEXTCOLOR_YELLOW"WARNING: %s marker without corresponding %s found.\n", endmarker, startmarker);
|
||||
|
||||
|
||||
|
||||
if (flathack)
|
||||
{
|
||||
// We have found no F_START but one or more F_END markers.
|
||||
|
|
|
@ -95,10 +95,10 @@ FWHResFile::FWHResFile(const char *filename, FileReader &file)
|
|||
bool FWHResFile::Open(bool quiet, LumpFilterInfo*)
|
||||
{
|
||||
int directory[1024];
|
||||
|
||||
|
||||
Reader.Seek(-4096, FileReader::SeekEnd);
|
||||
Reader.Read(directory, 4096);
|
||||
|
||||
|
||||
int nl =1024/3;
|
||||
Lumps.Resize(nl);
|
||||
|
||||
|
@ -135,10 +135,10 @@ FResourceFile *CheckWHRes(const char *filename, FileReader &file, bool quiet, Lu
|
|||
{
|
||||
int directory[1024];
|
||||
int nl =1024/3;
|
||||
|
||||
|
||||
file.Seek(-4096, FileReader::SeekEnd);
|
||||
file.Read(directory, 4096);
|
||||
|
||||
|
||||
int checkpos = 0;
|
||||
for(int k = 0; k < nl; k++)
|
||||
{
|
||||
|
|
|
@ -219,12 +219,12 @@ void FileSystem::InitMultipleFiles (TArray<FString> &filenames, bool quiet, Lump
|
|||
for(unsigned i=0;i<filenames.Size(); i++)
|
||||
{
|
||||
AddFile (filenames[i], nullptr, quiet, filter);
|
||||
|
||||
|
||||
if (i == (unsigned)MaxIwadIndex) MoveLumpsInFolder("after_iwad/");
|
||||
FStringf path("filter/%s", Files.Last()->GetHash().GetChars());
|
||||
MoveLumpsInFolder(path);
|
||||
}
|
||||
|
||||
|
||||
NumEntries = FileInfo.Size();
|
||||
if (NumEntries == 0)
|
||||
{
|
||||
|
@ -283,7 +283,7 @@ int FileSystem::AddFromBuffer(const char* name, const char* type, char* data, in
|
|||
FileInfo.Last().resourceId = id;
|
||||
return FileInfo.Size()-1;
|
||||
}
|
||||
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// AddFile
|
||||
|
@ -332,7 +332,7 @@ void FileSystem::AddFile (const char *filename, FileReader *filer, bool quiet, L
|
|||
startlump = NumEntries;
|
||||
|
||||
FResourceFile *resfile;
|
||||
|
||||
|
||||
if (!isdir)
|
||||
resfile = FResourceFile::OpenResourceFile(filename, filereader, quiet, false, filter);
|
||||
else
|
||||
|
@ -945,10 +945,10 @@ void FileSystem::MoveLumpsInFolder(const char *path)
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
auto len = strlen(path);
|
||||
auto rfnum = FileInfo.Last().rfnum;
|
||||
|
||||
|
||||
unsigned i;
|
||||
for (i = 0; i < FileInfo.Size(); i++)
|
||||
{
|
||||
|
@ -1021,7 +1021,7 @@ int FileSystem::FindLumpMulti (const char **names, int *lastlump, bool anyns, in
|
|||
{
|
||||
if (anyns || lump_p->Namespace == ns_global)
|
||||
{
|
||||
|
||||
|
||||
for(const char **name = names; *name != NULL; name++)
|
||||
{
|
||||
if (!strnicmp(*name, lump_p->shortName.String, 8))
|
||||
|
@ -1511,7 +1511,7 @@ int FileSystem::GetEntryCount (int rfnum) const noexcept
|
|||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
return Files[rfnum]->LumpCount();
|
||||
}
|
||||
|
||||
|
|
|
@ -306,11 +306,11 @@ int lumpcmp(const void * a, const void * b)
|
|||
void FResourceFile::GenerateHash()
|
||||
{
|
||||
// hash the lump directory after sorting
|
||||
|
||||
|
||||
Hash.Format(("%08X-%04X-"), (unsigned)Reader.GetLength(), NumLumps);
|
||||
|
||||
|
||||
MD5Context md5;
|
||||
|
||||
|
||||
uint8_t digest[16];
|
||||
for(uint32_t i = 0; i < NumLumps; i++)
|
||||
{
|
||||
|
@ -382,9 +382,9 @@ int FResourceFile::FilterLumps(FString filtername, void *lumps, size_t lumpsize,
|
|||
return 0;
|
||||
}
|
||||
filter << "filter/" << filtername << '/';
|
||||
|
||||
|
||||
bool found = FindPrefixRange(filter, lumps, lumpsize, max, start, end);
|
||||
|
||||
|
||||
// Workaround for old Doom filter names.
|
||||
if (!found && filtername.IndexOf("doom.id.doom") == 0)
|
||||
{
|
||||
|
|
|
@ -86,10 +86,10 @@ FFont::FFont (const char *name, const char *nametemplate, const char *filetempla
|
|||
TMap<int, FGameTexture*> charMap;
|
||||
int minchar = INT_MAX;
|
||||
int maxchar = INT_MIN;
|
||||
|
||||
|
||||
// Read the font's configuration.
|
||||
// This will not be done for the default fonts, because they are not atomic and the default content does not need it.
|
||||
|
||||
|
||||
TArray<FolderEntry> folderdata;
|
||||
if (filetemplate != nullptr)
|
||||
{
|
||||
|
@ -97,16 +97,16 @@ FFont::FFont (const char *name, const char *nametemplate, const char *filetempla
|
|||
// If a name template is given, collect data from all resource files.
|
||||
// For anything else, each folder is being treated as an atomic, self-contained unit and mixing from different glyph sets is blocked.
|
||||
fileSystem.GetFilesInFolder(path, folderdata, nametemplate == nullptr);
|
||||
|
||||
|
||||
//if (nametemplate == nullptr)
|
||||
{
|
||||
FStringf infpath("fonts/%s/font.inf", filetemplate);
|
||||
|
||||
|
||||
unsigned index = folderdata.FindEx([=](const FolderEntry &entry)
|
||||
{
|
||||
return infpath.CompareNoCase(entry.name) == 0;
|
||||
});
|
||||
|
||||
|
||||
if (index < folderdata.Size())
|
||||
{
|
||||
FScanner sc;
|
||||
|
@ -182,7 +182,7 @@ FFont::FFont (const char *name, const char *nametemplate, const char *filetempla
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (FixedWidth > 0)
|
||||
{
|
||||
ReadSheetFont(folderdata, FixedWidth, FontHeight, Scale);
|
||||
|
@ -559,10 +559,10 @@ FFont *FFont::FindFont (FName name)
|
|||
void RecordTextureColors (FImageSource *pic, uint32_t *usedcolors)
|
||||
{
|
||||
int x;
|
||||
|
||||
|
||||
auto pixels = pic->GetPalettedPixels(false);
|
||||
auto size = pic->GetWidth() * pic->GetHeight();
|
||||
|
||||
|
||||
for(x = 0;x < size; x++)
|
||||
{
|
||||
usedcolors[pixels[x]]++;
|
||||
|
@ -727,7 +727,7 @@ int FFont::GetCharCode(int code, bool needpic) const
|
|||
{
|
||||
return code;
|
||||
}
|
||||
|
||||
|
||||
// Use different substitution logic based on the fonts content:
|
||||
// In a font which has both upper and lower case, prefer unaccented small characters over capital ones.
|
||||
// In a pure upper-case font, do not check for lower case replacements.
|
||||
|
@ -805,7 +805,7 @@ FGameTexture *FFont::GetChar (int code, int translation, int *const width) const
|
|||
code -= FirstChar;
|
||||
xmove = Chars[code].XMove;
|
||||
}
|
||||
|
||||
|
||||
if (width != nullptr)
|
||||
{
|
||||
*width = xmove;
|
||||
|
|
|
@ -266,7 +266,7 @@ int FHexFontChar2::CopyPixels(FBitmap* bmp, int conversion)
|
|||
|
||||
class FHexFont : public FFont
|
||||
{
|
||||
|
||||
|
||||
public:
|
||||
//==========================================================================
|
||||
//
|
||||
|
@ -283,14 +283,14 @@ public:
|
|||
assert(lump >= 0);
|
||||
|
||||
FontName = fontname;
|
||||
|
||||
|
||||
FirstChar = hexdata.FirstChar;
|
||||
LastChar = hexdata.LastChar;
|
||||
|
||||
FontHeight = 16;
|
||||
SpaceWidth = 9;
|
||||
GlobalKerning = 0;
|
||||
|
||||
|
||||
Chars.Resize(LastChar - FirstChar + 1);
|
||||
for (int i = FirstChar; i <= LastChar; i++)
|
||||
{
|
||||
|
@ -325,7 +325,7 @@ public:
|
|||
else Translations[i] = LuminosityTranslation(i * 2 + 1, minlum, maxlum);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -96,7 +96,7 @@ protected:
|
|||
void LoadFON1 (int lump, const uint8_t *data);
|
||||
void LoadFON2 (int lump, const uint8_t *data);
|
||||
void LoadBMF (int lump, const uint8_t *data);
|
||||
|
||||
|
||||
enum
|
||||
{
|
||||
FONT1,
|
||||
|
@ -259,7 +259,7 @@ void FSingleLumpFont::LoadFON2 (int lump, const uint8_t *data)
|
|||
LastChar = data[7];
|
||||
ActiveColors = data[10]+1;
|
||||
RescalePalette = data[9] == 0;
|
||||
|
||||
|
||||
count = LastChar - FirstChar + 1;
|
||||
Chars.Resize(count);
|
||||
TArray<int> widths2(count, true);
|
||||
|
|
|
@ -106,10 +106,10 @@ FFont *V_GetFont(const char *name, const char *fontlumpname)
|
|||
|
||||
int lump = -1;
|
||||
int folderfile = -1;
|
||||
|
||||
|
||||
TArray<FolderEntry> folderdata;
|
||||
FStringf path("fonts/%s/", name);
|
||||
|
||||
|
||||
// Use a folder-based font only if it comes from a later file than the single lump version.
|
||||
if (fileSystem.GetFilesInFolder(path, folderdata, true))
|
||||
{
|
||||
|
@ -119,7 +119,7 @@ FFont *V_GetFont(const char *name, const char *fontlumpname)
|
|||
|
||||
|
||||
lump = fileSystem.CheckNumForFullName(fontlumpname? fontlumpname : name, true);
|
||||
|
||||
|
||||
if (lump != -1 && fileSystem.GetFileContainer(lump) >= folderfile)
|
||||
{
|
||||
uint32_t head;
|
||||
|
@ -769,7 +769,7 @@ static void CalcDefaultTranslation(FFont* base, int index)
|
|||
lowindex = highindex++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
|
|
@ -271,7 +271,7 @@ DMenu::DMenu(DMenu *parent)
|
|||
DontDim = false;
|
||||
GC::WriteBarrier(this, parent);
|
||||
}
|
||||
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
//
|
||||
|
|
|
@ -48,7 +48,7 @@ protected:
|
|||
unsigned int mNumIndices;
|
||||
TArray<FModelVertex> mVertices;
|
||||
TArray<unsigned int> mIndices;
|
||||
|
||||
|
||||
void MakeSlabPolys(int x, int y, kvxslab_t *voxptr, FVoxelMap &check);
|
||||
void AddFace(int x1, int y1, int z1, int x2, int y2, int z2, int x3, int y3, int z3, int x4, int y4, int z4, uint8_t color, FVoxelMap &check);
|
||||
unsigned int AddVertex(FModelVertex &vert, FVoxelMap &check);
|
||||
|
|
|
@ -536,7 +536,7 @@ void FMD2Model::LoadGeometry()
|
|||
}
|
||||
|
||||
lods[0].triangles = new FTriangle[lodInfo[0].numTriangles];
|
||||
|
||||
|
||||
int cnt = lodInfo[0].numTriangles;
|
||||
memcpy(lods[0].triangles, buffer + lodInfo[0].offsetTriangles, sizeof(FTriangle) * cnt);
|
||||
for (int j = 0; j < cnt; j++)
|
||||
|
|
|
@ -133,7 +133,7 @@ bool FMD3Model::Load(const char * path, int lumpnum, const char * buffer, int le
|
|||
|
||||
auto numFrames = LittleLong(hdr->Num_Frames);
|
||||
auto numSurfaces = LittleLong(hdr->Num_Surfaces);
|
||||
|
||||
|
||||
numTags = LittleLong(hdr->Num_Tags);
|
||||
|
||||
md3_frame_t * frm = (md3_frame_t*)(buffer + LittleLong(hdr->Ofs_Frames));
|
||||
|
|
|
@ -100,7 +100,7 @@ TArray<uint8_t> FVoxelTexture::CreatePalettedPixels(int conversion)
|
|||
pe.b = (pp[2] << 2) | (pp[2] >> 4);
|
||||
// Alphatexture handling is just for completeness, but rather unlikely to be used ever.
|
||||
Pixels[i] = conversion == luminance ? pe.r : ColorMatcher.Pick(pe);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
@ -267,7 +267,7 @@ DObject::~DObject ()
|
|||
Release();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (nullptr != type)
|
||||
{
|
||||
type->DestroySpecials(this);
|
||||
|
|
|
@ -158,6 +158,10 @@ namespace GC
|
|||
{
|
||||
MarkArray((DObject **)(obj), count);
|
||||
}
|
||||
template<class T> void MarkArray(TObjPtr<T>* obj, size_t count)
|
||||
{
|
||||
MarkArray((DObject**)(obj), count);
|
||||
}
|
||||
template<class T> void MarkArray(TArray<T> &arr)
|
||||
{
|
||||
MarkArray(&arr[0], arr.Size());
|
||||
|
|
|
@ -429,7 +429,7 @@ void ProcessKeyboardEventInMenu(NSEvent* theEvent)
|
|||
event.subtype = EV_GUI_Char;
|
||||
event.data1 = realchar;
|
||||
event.data2 = event.data3 & GKM_ALT;
|
||||
|
||||
|
||||
D_PostEvent(&event);
|
||||
}
|
||||
}
|
||||
|
@ -667,9 +667,9 @@ void ProcessMouseWheelEvent(NSEvent* theEvent)
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
event_t event = {};
|
||||
|
||||
|
||||
if (GUICapture)
|
||||
{
|
||||
event.type = EV_GUI_Event;
|
||||
|
@ -681,7 +681,7 @@ void ProcessMouseWheelEvent(NSEvent* theEvent)
|
|||
event.type = isZeroDelta ? EV_KeyUp : EV_KeyDown;
|
||||
event.data1 = delta > 0.0f ? KEY_MWHEELUP : KEY_MWHEELDOWN;
|
||||
}
|
||||
|
||||
|
||||
D_PostEvent(&event);
|
||||
}
|
||||
|
||||
|
|
|
@ -1127,7 +1127,7 @@ void IOKitJoystickManager::AddDevices(const IONotificationPortRef notificationPo
|
|||
}
|
||||
|
||||
IOObjectRelease(device);
|
||||
|
||||
|
||||
PostDeviceChangeEvent();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -90,10 +90,10 @@ static bool ReadSystemVersionFromPlist(NSOperatingSystemVersion& version)
|
|||
|
||||
if (stat(plistPath, &dummy) != 0)
|
||||
return false;
|
||||
|
||||
|
||||
char commandLine[1024] = {};
|
||||
snprintf(commandLine, sizeof commandLine, "defaults read %s ProductVersion", plistPath);
|
||||
|
||||
|
||||
FILE *const versionFile = popen(commandLine, "r");
|
||||
|
||||
if (versionFile == nullptr)
|
||||
|
@ -146,7 +146,7 @@ void I_DetectOS()
|
|||
}
|
||||
|
||||
const char* name = "Unknown version";
|
||||
|
||||
|
||||
switch (version.majorVersion)
|
||||
{
|
||||
case 10:
|
||||
|
@ -183,7 +183,7 @@ void I_DetectOS()
|
|||
#else
|
||||
"Unknown";
|
||||
#endif
|
||||
|
||||
|
||||
Printf("%s running %s %d.%d.%d (%s) %s\n", model, name,
|
||||
int(version.majorVersion), int(version.minorVersion), int(version.patchVersion),
|
||||
release, architecture);
|
||||
|
@ -266,14 +266,14 @@ ApplicationController* appCtrl;
|
|||
- (void)keyDown:(NSEvent*)theEvent
|
||||
{
|
||||
// Empty but present to avoid playing of 'beep' alert sound
|
||||
|
||||
|
||||
ZD_UNUSED(theEvent);
|
||||
}
|
||||
|
||||
- (void)keyUp:(NSEvent*)theEvent
|
||||
{
|
||||
// Empty but present to avoid playing of 'beep' alert sound
|
||||
|
||||
|
||||
ZD_UNUSED(theEvent);
|
||||
}
|
||||
|
||||
|
@ -283,7 +283,7 @@ extern bool AppActive;
|
|||
- (void)applicationDidBecomeActive:(NSNotification*)aNotification
|
||||
{
|
||||
ZD_UNUSED(aNotification);
|
||||
|
||||
|
||||
S_SetSoundPaused(1);
|
||||
|
||||
AppActive = true;
|
||||
|
@ -292,7 +292,7 @@ extern bool AppActive;
|
|||
- (void)applicationWillResignActive:(NSNotification*)aNotification
|
||||
{
|
||||
ZD_UNUSED(aNotification);
|
||||
|
||||
|
||||
S_SetSoundPaused(i_soundinbackground);
|
||||
|
||||
AppActive = false;
|
||||
|
|
|
@ -449,7 +449,7 @@ public:
|
|||
}
|
||||
else
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAVE_SOFTPOLY
|
||||
if (vid_preferbackend == 2)
|
||||
{
|
||||
|
@ -832,7 +832,7 @@ bool I_SetCursor(FGameTexture *cursorpic)
|
|||
if (NULL != cursorpic && cursorpic->isValid())
|
||||
{
|
||||
// Create bitmap image representation
|
||||
|
||||
|
||||
auto sbuffer = cursorpic->GetTexture()->CreateTexBuffer(0);
|
||||
|
||||
const NSInteger imageWidth = sbuffer.mWidth;
|
||||
|
@ -873,11 +873,11 @@ bool I_SetCursor(FGameTexture *cursorpic)
|
|||
cursor = [[NSCursor alloc] initWithImage:cursorImage
|
||||
hotSpot:NSMakePoint(0.0f, 0.0f)];
|
||||
}
|
||||
|
||||
|
||||
SystemBaseFrameBuffer::SetCursor(cursor);
|
||||
|
||||
|
||||
[pool release];
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -256,7 +256,7 @@ FString M_GetDocumentsPath()
|
|||
FString M_GetDemoPath()
|
||||
{
|
||||
FString path = GetSpecialPath(NSDocumentDirectory);
|
||||
|
||||
|
||||
if (path.IsNotEmpty())
|
||||
{
|
||||
path += "/" GAME_DIR "/Demos/";
|
||||
|
|
|
@ -446,7 +446,7 @@ int I_PickIWad_Cocoa (WadStuff *wads, int numwads, bool showwin, int defaultiwad
|
|||
if (ret >= 0)
|
||||
{
|
||||
NSString* parametersToAppend = [picker commandLineParameters];
|
||||
|
||||
|
||||
if (0 != [parametersToAppend length])
|
||||
{
|
||||
RestartWithParameters(wads[ret], parametersToAppend);
|
||||
|
|
|
@ -79,7 +79,7 @@ void I_InitGraphics ()
|
|||
|
||||
extern IVideo *gl_CreateVideo();
|
||||
Video = gl_CreateVideo();
|
||||
|
||||
|
||||
if (Video == NULL)
|
||||
I_FatalError ("Failed to initialize display");
|
||||
}
|
||||
|
|
|
@ -205,7 +205,7 @@ static void MouseRead ()
|
|||
static void I_CheckNativeMouse ()
|
||||
{
|
||||
bool focus = SDL_GetKeyboardFocus() != NULL;
|
||||
|
||||
|
||||
bool captureModeInGame = sysCallbacks.CaptureModeInGame && sysCallbacks.CaptureModeInGame();
|
||||
bool wantNative = !focus || (!use_mouse || GUICapture || !captureModeInGame);
|
||||
|
||||
|
@ -228,7 +228,7 @@ void MessagePump (const SDL_Event &sev)
|
|||
static int lastx = 0, lasty = 0;
|
||||
int x, y;
|
||||
event_t event = { 0,0,0,0,0,0,0 };
|
||||
|
||||
|
||||
switch (sev.type)
|
||||
{
|
||||
case SDL_QUIT:
|
||||
|
@ -369,7 +369,7 @@ void MessagePump (const SDL_Event &sev)
|
|||
{
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
event.type = sev.type == SDL_KEYDOWN ? EV_KeyDown : EV_KeyUp;
|
||||
|
||||
// Try to look up our key mapped key for conversion to DirectInput.
|
||||
|
@ -448,7 +448,7 @@ void MessagePump (const SDL_Event &sev)
|
|||
if (GUICapture)
|
||||
{
|
||||
int size;
|
||||
|
||||
|
||||
int unichar = utf8_decode((const uint8_t*)sev.text.text, &size);
|
||||
if (size != 4)
|
||||
{
|
||||
|
@ -474,7 +474,7 @@ void MessagePump (const SDL_Event &sev)
|
|||
void I_GetEvent ()
|
||||
{
|
||||
SDL_Event sev;
|
||||
|
||||
|
||||
while (SDL_PollEvent (&sev))
|
||||
{
|
||||
MessagePump (sev);
|
||||
|
|
|
@ -171,7 +171,7 @@ int main (int argc, char **argv)
|
|||
}
|
||||
|
||||
printf("\n");
|
||||
|
||||
|
||||
Args = new FArgs(argc, argv);
|
||||
|
||||
// Should we even be doing anything with progdir on Unix systems?
|
||||
|
@ -188,7 +188,7 @@ int main (int argc, char **argv)
|
|||
{
|
||||
progdir = "./";
|
||||
}
|
||||
|
||||
|
||||
I_StartupJoysticks();
|
||||
|
||||
const int result = GameMain();
|
||||
|
|
|
@ -159,7 +159,7 @@ void RedrawProgressBar(int CurPos, int MaxPos)
|
|||
memset(progressBuffer,'.',512);
|
||||
progressBuffer[sizeOfWindow.ws_col - 1] = 0;
|
||||
int lengthOfStr = 0;
|
||||
|
||||
|
||||
while (curProgVal-- > 0)
|
||||
{
|
||||
progressBuffer[lengthOfStr++] = '=';
|
||||
|
@ -208,7 +208,7 @@ void I_PrintStr(const char *cp)
|
|||
else if (v < 0.90) attrib = 0x7;
|
||||
else attrib = 0xF;
|
||||
}
|
||||
|
||||
|
||||
printData.AppendFormat("\033[%um",((attrib & 0x8) ? 90 : 30) + (attrib & 0x7));
|
||||
}
|
||||
else printData.AppendFormat("\033[38;2;%u;%u;%um",color.r,color.g,color.b);
|
||||
|
@ -224,7 +224,7 @@ void I_PrintStr(const char *cp)
|
|||
else break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (StartScreen) CleanProgressBar();
|
||||
fputs(printData.GetChars(),stdout);
|
||||
if (terminal) fputs("\033[0m",stdout);
|
||||
|
@ -303,7 +303,7 @@ int I_PickIWad (WadStuff *wads, int numwads, bool showwin, int defaultiwad)
|
|||
#ifdef __APPLE__
|
||||
return I_PickIWad_Cocoa (wads, numwads, showwin, defaultiwad);
|
||||
#endif
|
||||
|
||||
|
||||
if (!isatty(fileno(stdin)))
|
||||
{
|
||||
return defaultiwad;
|
||||
|
|
|
@ -5,13 +5,13 @@ void Mac_I_FatalError(const char* errortext)
|
|||
{
|
||||
// Close window or exit fullscreen and release mouse capture
|
||||
SDL_Quit();
|
||||
|
||||
|
||||
const CFStringRef errorString = CFStringCreateWithCStringNoCopy( kCFAllocatorDefault,
|
||||
errortext, kCFStringEncodingASCII, kCFAllocatorNull );
|
||||
if ( NULL != errorString )
|
||||
{
|
||||
CFOptionFlags dummy;
|
||||
|
||||
|
||||
CFUserNotificationDisplayAlert( 0, kCFUserNotificationStopAlertLevel, NULL, NULL, NULL,
|
||||
CFSTR( "Fatal Error" ), errorString, CFSTR( "Exit" ), NULL, NULL, &dummy );
|
||||
CFRelease( errorString );
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
#ifdef HAVE_GLES2
|
||||
#include "gles_framebuffer.h"
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAVE_VULKAN
|
||||
#include "vulkan/system/vk_framebuffer.h"
|
||||
#endif
|
||||
|
@ -517,7 +517,7 @@ int SystemBaseFrameBuffer::GetClientWidth()
|
|||
return width;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAVE_VULKAN
|
||||
assert(Priv::vulkanEnabled);
|
||||
SDL_Vulkan_GetDrawableSize(Priv::window, &width, nullptr);
|
||||
|
|
|
@ -228,7 +228,7 @@ void FTTYStartupScreen::NetMessage(const char *format, ...)
|
|||
{
|
||||
FString str;
|
||||
va_list argptr;
|
||||
|
||||
|
||||
va_start (argptr, format);
|
||||
str.VFormat (format, argptr);
|
||||
va_end (argptr);
|
||||
|
|
|
@ -165,5 +165,5 @@ void I_InitGraphics ()
|
|||
// we somehow STILL don't have a display!!
|
||||
if (Video == NULL)
|
||||
I_FatalError ("Failed to initialize display");
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1581,7 +1581,7 @@ static void AddZipFile (HANDLE ziphandle, TarFile *whichfile, short dosdate, sho
|
|||
local.ModDate = dosdate;
|
||||
local.UncompressedSize = LittleLong(whichfile->UncompressedSize);
|
||||
local.NameLength = LittleShort((uint16_t)strlen(whichfile->Filename));
|
||||
|
||||
|
||||
whichfile->ZipOffset = SetFilePointer (ziphandle, 0, NULL, FILE_CURRENT);
|
||||
WriteFile (ziphandle, &local, sizeof(local), &wrote, NULL);
|
||||
WriteFile (ziphandle, whichfile->Filename, (DWORD)strlen(whichfile->Filename), &wrote, NULL);
|
||||
|
|
|
@ -58,7 +58,7 @@ class FDInputKeyboard : public FKeyboard
|
|||
public:
|
||||
FDInputKeyboard();
|
||||
~FDInputKeyboard();
|
||||
|
||||
|
||||
bool GetDevice();
|
||||
void ProcessInput();
|
||||
|
||||
|
|
|
@ -777,7 +777,7 @@ int DoMain (HINSTANCE hInstance)
|
|||
RECT cRect;
|
||||
TIMECAPS tc;
|
||||
DEVMODE displaysettings;
|
||||
|
||||
|
||||
// Do not use the multibyte __argv here because we want UTF-8 arguments
|
||||
// and those can only be done by converting the Unicode variants.
|
||||
Args = new FArgs();
|
||||
|
@ -787,17 +787,17 @@ int DoMain (HINSTANCE hInstance)
|
|||
{
|
||||
Args->AppendArg(FString(wargv[i]));
|
||||
}
|
||||
|
||||
|
||||
// Load Win32 modules
|
||||
Kernel32Module.Load({"kernel32.dll"});
|
||||
Shell32Module.Load({"shell32.dll"});
|
||||
User32Module.Load({"user32.dll"});
|
||||
|
||||
|
||||
// Under XP, get our session ID so we can know when the user changes/locks sessions.
|
||||
// Since we need to remain binary compatible with older versions of Windows, we
|
||||
// need to extract the ProcessIdToSessionId function from kernel32.dll manually.
|
||||
HMODULE kernel = GetModuleHandleA ("kernel32.dll");
|
||||
|
||||
|
||||
if (Args->CheckParm("-stdout"))
|
||||
{
|
||||
// As a GUI application, we don't normally get a console when we start.
|
||||
|
@ -805,7 +805,7 @@ int DoMain (HINSTANCE hInstance)
|
|||
// console. Otherwise, we can create a new one. If we already have a
|
||||
// stdout handle, then we have been redirected and should just use that
|
||||
// handle instead of creating a console window.
|
||||
|
||||
|
||||
StdOut = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||
if (StdOut != NULL)
|
||||
{
|
||||
|
@ -832,18 +832,18 @@ int DoMain (HINSTANCE hInstance)
|
|||
{
|
||||
StdOut = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||
}
|
||||
|
||||
|
||||
// These two functions do not exist in Windows XP.
|
||||
BOOL (WINAPI* p_GetCurrentConsoleFontEx)(HANDLE hConsoleOutput, BOOL bMaximumWindow, PCONSOLE_FONT_INFOEX lpConsoleCurrentFontEx);
|
||||
BOOL (WINAPI* p_SetCurrentConsoleFontEx)(HANDLE hConsoleOutput, BOOL bMaximumWindow, PCONSOLE_FONT_INFOEX lpConsoleCurrentFontEx);
|
||||
|
||||
|
||||
p_SetCurrentConsoleFontEx = (decltype(p_SetCurrentConsoleFontEx))GetProcAddress(kernel, "SetCurrentConsoleFontEx");
|
||||
p_GetCurrentConsoleFontEx = (decltype(p_GetCurrentConsoleFontEx))GetProcAddress(kernel, "GetCurrentConsoleFontEx");
|
||||
if (p_SetCurrentConsoleFontEx && p_GetCurrentConsoleFontEx)
|
||||
{
|
||||
CONSOLE_FONT_INFOEX cfi;
|
||||
cfi.cbSize = sizeof(cfi);
|
||||
|
||||
|
||||
if (p_GetCurrentConsoleFontEx(StdOut, false, &cfi))
|
||||
{
|
||||
if (*cfi.FaceName == 0) // If the face name is empty, the default (useless) raster font is actoive.
|
||||
|
@ -858,16 +858,16 @@ int DoMain (HINSTANCE hInstance)
|
|||
FancyStdOut = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Set the timer to be as accurate as possible
|
||||
if (timeGetDevCaps (&tc, sizeof(tc)) != TIMERR_NOERROR)
|
||||
TimerPeriod = 1; // Assume minimum resolution of 1 ms
|
||||
else
|
||||
TimerPeriod = tc.wPeriodMin;
|
||||
|
||||
|
||||
timeBeginPeriod (TimerPeriod);
|
||||
atexit(UnTbp);
|
||||
|
||||
|
||||
// Figure out what directory the program resides in.
|
||||
WCHAR progbuff[1024];
|
||||
if (GetModuleFileNameW(nullptr, progbuff, sizeof progbuff) == 0)
|
||||
|
@ -875,22 +875,22 @@ int DoMain (HINSTANCE hInstance)
|
|||
MessageBoxA(nullptr, "Fatal", "Could not determine program location.", MB_ICONEXCLAMATION|MB_OK);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
|
||||
progbuff[1023] = '\0';
|
||||
if (auto lastsep = wcsrchr(progbuff, '\\'))
|
||||
{
|
||||
lastsep[1] = '\0';
|
||||
}
|
||||
|
||||
|
||||
progdir = progbuff;
|
||||
FixPathSeperator(progdir);
|
||||
|
||||
|
||||
HDC screenDC = GetDC(0);
|
||||
int dpi = GetDeviceCaps(screenDC, LOGPIXELSX);
|
||||
ReleaseDC(0, screenDC);
|
||||
width = (512 * dpi + 96 / 2) / 96;
|
||||
height = (384 * dpi + 96 / 2) / 96;
|
||||
|
||||
|
||||
// Many Windows structures that specify their size do so with the first
|
||||
// element. DEVMODE is not one of those structures.
|
||||
memset (&displaysettings, 0, sizeof(displaysettings));
|
||||
|
@ -898,12 +898,12 @@ int DoMain (HINSTANCE hInstance)
|
|||
EnumDisplaySettings (NULL, ENUM_CURRENT_SETTINGS, &displaysettings);
|
||||
x = (displaysettings.dmPelsWidth - width) / 2;
|
||||
y = (displaysettings.dmPelsHeight - height) / 2;
|
||||
|
||||
|
||||
if (Args->CheckParm ("-0"))
|
||||
{
|
||||
x = y = 0;
|
||||
}
|
||||
|
||||
|
||||
WNDCLASS WndClass;
|
||||
WndClass.style = 0;
|
||||
WndClass.lpfnWndProc = LConProc;
|
||||
|
@ -915,14 +915,14 @@ int DoMain (HINSTANCE hInstance)
|
|||
WndClass.hbrBackground = NULL;
|
||||
WndClass.lpszMenuName = NULL;
|
||||
WndClass.lpszClassName = WinClassName;
|
||||
|
||||
|
||||
/* register this new class with Windows */
|
||||
if (!RegisterClass((LPWNDCLASS)&WndClass))
|
||||
{
|
||||
MessageBoxA(nullptr, "Could not register window class", "Fatal", MB_ICONEXCLAMATION|MB_OK);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
|
||||
/* create window */
|
||||
FStringf caption("" GAMENAME " %s " X64 " (%s)", GetVersionString(), GetGitTime());
|
||||
std::wstring wcaption = caption.WideString();
|
||||
|
@ -936,13 +936,13 @@ int DoMain (HINSTANCE hInstance)
|
|||
(HMENU) NULL,
|
||||
hInstance,
|
||||
NULL);
|
||||
|
||||
|
||||
if (!Window)
|
||||
{
|
||||
MessageBoxA(nullptr, "Unable to create main window", "Fatal", MB_ICONEXCLAMATION|MB_OK);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
|
||||
if (kernel != NULL)
|
||||
{
|
||||
typedef BOOL (WINAPI *pts)(DWORD, DWORD *);
|
||||
|
@ -969,15 +969,15 @@ int DoMain (HINSTANCE hInstance)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
GetClientRect (Window, &cRect);
|
||||
|
||||
|
||||
WinWidth = cRect.right;
|
||||
WinHeight = cRect.bottom;
|
||||
|
||||
|
||||
CoInitialize (NULL);
|
||||
atexit (UnCOM);
|
||||
|
||||
|
||||
int ret = GameMain ();
|
||||
CheckForRestart();
|
||||
|
||||
|
@ -990,7 +990,7 @@ int DoMain (HINSTANCE hInstance)
|
|||
{ // Outputting to a new console window: Wait for a keypress before quitting.
|
||||
DWORD bytes;
|
||||
HANDLE stdinput = GetStdHandle(STD_INPUT_HANDLE);
|
||||
|
||||
|
||||
ShowWindow(Window, SW_HIDE);
|
||||
WriteFile(StdOut, "Press any key to exit...", 24, &bytes, NULL);
|
||||
FlushConsoleInputBuffer(stdinput);
|
||||
|
@ -1017,7 +1017,7 @@ void I_ShowFatalError(const char *msg)
|
|||
{
|
||||
Printf("%s", CVMAbortException::stacktrace.GetChars());
|
||||
}
|
||||
|
||||
|
||||
if (!batchrun)
|
||||
{
|
||||
ShowErrorPane(msg);
|
||||
|
|
|
@ -86,7 +86,7 @@ class FDInputMouse : public FMouse
|
|||
public:
|
||||
FDInputMouse();
|
||||
~FDInputMouse();
|
||||
|
||||
|
||||
bool GetDevice();
|
||||
void ProcessInput();
|
||||
bool WndProcHook(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam, LRESULT *result);
|
||||
|
@ -103,7 +103,7 @@ class FWin32Mouse : public FMouse
|
|||
public:
|
||||
FWin32Mouse();
|
||||
~FWin32Mouse();
|
||||
|
||||
|
||||
bool GetDevice();
|
||||
void ProcessInput();
|
||||
bool WndProcHook(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam, LRESULT *result);
|
||||
|
@ -697,7 +697,7 @@ bool FDInputMouse::GetDevice()
|
|||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// How many buttons does this mouse have?
|
||||
DIDEVCAPS_DX3 caps = { sizeof(caps) };
|
||||
hr = Device->GetCapabilities((DIDEVCAPS *)&caps);
|
||||
|
|
|
@ -503,7 +503,7 @@ bool FRawPS2Controller::ProcessInput(RAWHID *raw, int code)
|
|||
|
||||
// Generate events for buttons that have changed.
|
||||
int buttons = 0;
|
||||
|
||||
|
||||
// If we know we are digital, ignore the D-Pad.
|
||||
if (!digital)
|
||||
{
|
||||
|
@ -538,7 +538,7 @@ void FRawPS2Controller::ProcessThumbstick(int value1, AxisInfo *axis1, int value
|
|||
{
|
||||
uint8_t buttonstate;
|
||||
double axisval1, axisval2;
|
||||
|
||||
|
||||
axisval1 = value1 * (2.0 / 255) - 1.0;
|
||||
axisval2 = value2 * (2.0 / 255) - 1.0;
|
||||
axisval1 = Joy_RemoveDeadZone(axisval1, axis1->DeadZone, NULL);
|
||||
|
|
|
@ -868,7 +868,7 @@ static HCURSOR CreateBitmapCursor(int xhot, int yhot, HBITMAP and_mask, HBITMAP
|
|||
// Delete the bitmaps.
|
||||
DeleteObject(and_mask);
|
||||
DeleteObject(color_mask);
|
||||
|
||||
|
||||
return cursor;
|
||||
}
|
||||
|
||||
|
|
|
@ -310,7 +310,7 @@ void FXInputController::ProcessThumbstick(int value1, AxisInfo *axis1,
|
|||
{
|
||||
uint8_t buttonstate;
|
||||
double axisval1, axisval2;
|
||||
|
||||
|
||||
axisval1 = (value1 - SHRT_MIN) * 2.0 / 65536 - 1.0;
|
||||
axisval2 = (value2 - SHRT_MIN) * 2.0 / 65536 - 1.0;
|
||||
axisval1 = Joy_RemoveDeadZone(axisval1, axis1->DeadZone, NULL);
|
||||
|
@ -337,7 +337,7 @@ void FXInputController::ProcessTrigger(int value, AxisInfo *axis, int base)
|
|||
{
|
||||
uint8_t buttonstate;
|
||||
double axisval;
|
||||
|
||||
|
||||
axisval = Joy_RemoveDeadZone(value / 256.0, axis->DeadZone, &buttonstate);
|
||||
Joy_GenerateButtonEvents(axis->ButtonValue, buttonstate, 1, base);
|
||||
axis->ButtonValue = buttonstate;
|
||||
|
|
|
@ -310,7 +310,7 @@ void FBasicStartupScreen::NetMessage(const char *format, ...)
|
|||
{
|
||||
FString str;
|
||||
va_list argptr;
|
||||
|
||||
|
||||
va_start (argptr, format);
|
||||
str.VFormat (format, argptr);
|
||||
va_end (argptr);
|
||||
|
|
|
@ -17,7 +17,7 @@ void I_GetVulkanDrawableSize(int *width, int *height)
|
|||
|
||||
RECT clientRect = { 0 };
|
||||
GetClientRect(Window, &clientRect);
|
||||
|
||||
|
||||
if (width != nullptr)
|
||||
{
|
||||
*width = clientRect.right;
|
||||
|
|
|
@ -21,7 +21,7 @@ public:
|
|||
{
|
||||
device = new VulkanDevice();
|
||||
}
|
||||
|
||||
|
||||
~Win32VulkanVideo()
|
||||
{
|
||||
delete device;
|
||||
|
|
|
@ -192,12 +192,12 @@ void GLBuffer::GPUDropSync()
|
|||
void GLBuffer::GPUWaitSync()
|
||||
{
|
||||
GLenum status = glClientWaitSync(mGLSync, GL_SYNC_FLUSH_COMMANDS_BIT, 1000 * 1000 * 50); // Wait for a max of 50ms...
|
||||
|
||||
|
||||
if (status != GL_ALREADY_SIGNALED && status != GL_CONDITION_SATISFIED)
|
||||
{
|
||||
//Printf("Error on glClientWaitSync: %d\n", status);
|
||||
}
|
||||
|
||||
|
||||
glDeleteSync(mGLSync);
|
||||
|
||||
mGLSync = NULL;
|
||||
|
@ -213,10 +213,10 @@ void GLVertexBuffer::SetFormat(int numBindingPoints, int numAttributes, size_t s
|
|||
{
|
||||
static int VFmtToGLFmt[] = { GL_FLOAT, GL_FLOAT, GL_FLOAT, GL_FLOAT, GL_UNSIGNED_BYTE, GL_INT_2_10_10_10_REV };
|
||||
static uint8_t VFmtToSize[] = {4, 3, 2, 1, 4, 4};
|
||||
|
||||
|
||||
mStride = stride;
|
||||
mNumBindingPoints = numBindingPoints;
|
||||
|
||||
|
||||
for(int i = 0; i < numAttributes; i++)
|
||||
{
|
||||
if (attrs[i].location >= 0 && attrs[i].location < VATTR_MAX)
|
||||
|
|
|
@ -65,7 +65,7 @@ public:
|
|||
|
||||
bool HWGammaActive = false; // Are we using hardware or software gamma?
|
||||
std::shared_ptr<FGLDebug> mDebug; // Debug API
|
||||
|
||||
|
||||
FTexture *WipeStartScreen() override;
|
||||
FTexture *WipeEndScreen() override;
|
||||
|
||||
|
|
|
@ -148,7 +148,7 @@ unsigned int FHardwareTexture::CreateTexture(unsigned char * buffer, int w, int
|
|||
{
|
||||
sourcetype = GL_BGRA;
|
||||
}
|
||||
|
||||
|
||||
if (!firstCall && glBufferID > 0)
|
||||
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, rw, rh, sourcetype, GL_UNSIGNED_BYTE, buffer);
|
||||
else
|
||||
|
@ -315,7 +315,7 @@ bool FHardwareTexture::BindOrCreate(FTexture *tex, int texunit, int clampmode, i
|
|||
int w = 0, h = 0;
|
||||
|
||||
// Create this texture
|
||||
|
||||
|
||||
FTextureBuffer texbuffer;
|
||||
|
||||
if (!tex->isHardwareCanvas())
|
||||
|
|
|
@ -80,7 +80,7 @@ public:
|
|||
void DrawPresentTexture(const IntRect &box, bool applyGamma);
|
||||
void Flush();
|
||||
void BeginFrame();
|
||||
|
||||
|
||||
bool StartOffscreen();
|
||||
void EndOffscreen();
|
||||
|
||||
|
|
|
@ -311,7 +311,7 @@ void FGLRenderState::ApplyMaterial(FMaterial *mat, int clampmode, int translatio
|
|||
if (tex->isHardwareCanvas()) static_cast<FCanvasTexture*>(tex->GetTexture())->NeedUpdate();
|
||||
|
||||
clampmode = tex->GetClampMode(clampmode);
|
||||
|
||||
|
||||
// avoid rebinding the same texture multiple times.
|
||||
if (mat == lastMaterial && lastClamp == clampmode && translation == lastTranslation) return;
|
||||
lastMaterial = mat;
|
||||
|
|
|
@ -98,7 +98,7 @@ void FSamplerManager::UnbindAll()
|
|||
glBindSampler(i, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
uint8_t FSamplerManager::Bind(int texunit, int num, int lastval)
|
||||
{
|
||||
unsigned int samp = mSamplers[num];
|
||||
|
@ -106,11 +106,11 @@ uint8_t FSamplerManager::Bind(int texunit, int num, int lastval)
|
|||
return 255;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void FSamplerManager::SetTextureFilterMode()
|
||||
{
|
||||
GLint bounds[IHardwareTexture::MAX_TEXTURES];
|
||||
|
||||
|
||||
// Unbind all
|
||||
for(int i = IHardwareTexture::MAX_TEXTURES-1; i >= 0; i--)
|
||||
{
|
||||
|
@ -138,4 +138,4 @@ void FSamplerManager::SetTextureFilterMode()
|
|||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -336,7 +336,7 @@ bool FShader::Load(const char * name, const char * vert_prog_lump, const char *
|
|||
#endif
|
||||
|
||||
)";
|
||||
|
||||
|
||||
|
||||
#ifdef __APPLE__
|
||||
// The noise functions are completely broken in macOS OpenGL drivers
|
||||
|
|
|
@ -325,7 +325,7 @@ class FShaderCollection
|
|||
|
||||
void Clean();
|
||||
void CompileShaders(EPassType passType);
|
||||
|
||||
|
||||
public:
|
||||
FShaderCollection(EPassType passType);
|
||||
~FShaderCollection();
|
||||
|
|
|
@ -230,7 +230,7 @@ void gl_PrintStartupLog()
|
|||
Printf ("Max. texture units: %d\n", v);
|
||||
glGetIntegerv(GL_MAX_VARYING_FLOATS, &v);
|
||||
Printf ("Max. varying: %d\n", v);
|
||||
|
||||
|
||||
if (gl.flags & RFL_SHADER_STORAGE_BUFFER)
|
||||
{
|
||||
glGetIntegerv(GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS, &v);
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
static void* AppleGLGetProcAddress (const char *name)
|
||||
{
|
||||
static void* image = NULL;
|
||||
|
||||
|
||||
if (NULL == image)
|
||||
image = dlopen("/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL", RTLD_LAZY);
|
||||
|
||||
|
@ -61,9 +61,9 @@ static int TestPointer(const PROC pTest)
|
|||
ptrdiff_t iTest;
|
||||
if(!pTest) return 0;
|
||||
iTest = (ptrdiff_t)pTest;
|
||||
|
||||
|
||||
if(iTest == 1 || iTest == 2 || iTest == 3 || iTest == -1) return 0;
|
||||
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -119,7 +119,7 @@ static PROC WinGetProcAddress(const char *name)
|
|||
glMod = GetModuleHandleA("OpenGL32.dll");
|
||||
return (PROC)GetProcAddress(glMod, (LPCSTR)name);
|
||||
}
|
||||
|
||||
|
||||
#define IntGetProcAddress(name) WinGetProcAddress(name)
|
||||
#else
|
||||
#if defined(__APPLE__)
|
||||
|
@ -3363,7 +3363,7 @@ static ogl_StrToExtMap *FindExtEntry(const char *extensionName)
|
|||
if(strcmp(extensionName, currLoc->extensionName) == 0)
|
||||
return currLoc;
|
||||
}
|
||||
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -3465,7 +3465,7 @@ int ogl_LoadFunctions()
|
|||
{
|
||||
int numFailed = 0;
|
||||
ClearExtensionVars();
|
||||
|
||||
|
||||
_ptrc_glGetIntegerv = (void (CODEGEN_FUNCPTR *)(GLenum, GLint *))IntGetProcAddress("glGetIntegerv");
|
||||
if(!_ptrc_glGetIntegerv) return ogl_LOAD_FAILED;
|
||||
_ptrc_glGetStringi = (const GLubyte * (CODEGEN_FUNCPTR *)(GLenum, GLuint))IntGetProcAddress("glGetStringi");
|
||||
|
@ -3479,7 +3479,7 @@ int ogl_LoadFunctions()
|
|||
}
|
||||
|
||||
numFailed = Load_Version_4_5();
|
||||
|
||||
|
||||
if(numFailed == 0)
|
||||
return ogl_LOAD_SUCCEEDED;
|
||||
else
|
||||
|
@ -3515,7 +3515,7 @@ int ogl_IsVersionGEQ(int majorVersion, int minorVersion)
|
|||
{
|
||||
if(g_major_version == 0)
|
||||
GetGLVersion();
|
||||
|
||||
|
||||
if(majorVersion < g_major_version) return 1;
|
||||
if(majorVersion > g_major_version) return 0;
|
||||
if(minorVersion <= g_minor_version) return 1;
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
APIs: gles2=2.0
|
||||
Profile: compatibility
|
||||
Extensions:
|
||||
|
||||
|
||||
Loader: True
|
||||
Local files: False
|
||||
Omit khrplatform: False
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
APIs: egl=1.4
|
||||
Profile: -
|
||||
Extensions:
|
||||
|
||||
|
||||
Loader: True
|
||||
Local files: False
|
||||
Omit khrplatform: False
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
APIs: gles2=2.0
|
||||
Profile: compatibility
|
||||
Extensions:
|
||||
|
||||
|
||||
Loader: True
|
||||
Local files: False
|
||||
Omit khrplatform: False
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
APIs: egl=1.4
|
||||
Profile: -
|
||||
Extensions:
|
||||
|
||||
|
||||
Loader: True
|
||||
Local files: False
|
||||
Omit khrplatform: False
|
||||
|
|
|
@ -79,7 +79,7 @@ GLBuffer::~GLBuffer()
|
|||
glBindBuffer(mUseType, 0);
|
||||
glDeleteBuffers(1, &mBufferId);
|
||||
}
|
||||
|
||||
|
||||
if (memory)
|
||||
delete[] memory;
|
||||
}
|
||||
|
@ -129,9 +129,9 @@ void GLBuffer::SetData(size_t size, const void* data, BufferUsageType usage)
|
|||
void GLBuffer::SetSubData(size_t offset, size_t size, const void *data)
|
||||
{
|
||||
Bind();
|
||||
|
||||
|
||||
memcpy(memory + offset, data, size);
|
||||
|
||||
|
||||
if (!isData)
|
||||
{
|
||||
glBufferSubData(mUseType, offset, size, data);
|
||||
|
@ -143,7 +143,7 @@ void GLBuffer::Upload(size_t start, size_t size)
|
|||
if (!gles.useMappedBuffers)
|
||||
{
|
||||
Bind();
|
||||
|
||||
|
||||
if(size)
|
||||
glBufferSubData(mUseType, start, size, memory + start);
|
||||
}
|
||||
|
@ -278,10 +278,10 @@ void GLVertexBuffer::SetFormat(int numBindingPoints, int numAttributes, size_t s
|
|||
{
|
||||
static int VFmtToGLFmt[] = { GL_FLOAT, GL_FLOAT, GL_FLOAT, GL_FLOAT, GL_UNSIGNED_BYTE, GL_FLOAT }; // TODO Fix last entry GL_INT_2_10_10_10_REV, normals for models will be broken
|
||||
static uint8_t VFmtToSize[] = {4, 3, 2, 1, 4, 4};
|
||||
|
||||
|
||||
mStride = stride;
|
||||
mNumBindingPoints = numBindingPoints;
|
||||
|
||||
|
||||
for(int i = 0; i < numAttributes; i++)
|
||||
{
|
||||
if (attrs[i].location >= 0 && attrs[i].location < VATTR_MAX)
|
||||
|
|
|
@ -136,7 +136,7 @@ void OpenGLFrameBuffer::InitializeState()
|
|||
glEnable(GL_DITHER);
|
||||
glDisable(GL_CULL_FACE);
|
||||
glDisable(GL_POLYGON_OFFSET_FILL);
|
||||
|
||||
|
||||
glEnable(GL_BLEND);
|
||||
if (gles.depthClampAvailable) glEnable(GL_DEPTH_CLAMP);
|
||||
|
||||
|
@ -237,7 +237,7 @@ const char* OpenGLFrameBuffer::DeviceName() const
|
|||
|
||||
void OpenGLFrameBuffer::Swap()
|
||||
{
|
||||
|
||||
|
||||
Finish.Reset();
|
||||
Finish.Clock();
|
||||
|
||||
|
@ -245,7 +245,7 @@ void OpenGLFrameBuffer::Swap()
|
|||
|
||||
FPSLimit();
|
||||
SwapBuffers();
|
||||
|
||||
|
||||
mVertexData->NextPipelineBuffer();
|
||||
mVertexData->WaitSync();
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ public:
|
|||
|
||||
bool HWGammaActive = false; // Are we using hardware or software gamma?
|
||||
std::shared_ptr<FGLDebug> mDebug; // Debug API
|
||||
|
||||
|
||||
FTexture *WipeStartScreen() override;
|
||||
FTexture *WipeEndScreen() override;
|
||||
|
||||
|
|
|
@ -176,7 +176,7 @@ unsigned int FHardwareTexture::CreateTexture(unsigned char * buffer, int w, int
|
|||
glGenerateMipmap(GL_TEXTURE_2D);
|
||||
mipmapped = true;
|
||||
}
|
||||
|
||||
|
||||
if (texunit > 0) glActiveTexture(GL_TEXTURE0);
|
||||
else if (texunit == -1) glBindTexture(GL_TEXTURE_2D, textureBinding);
|
||||
return glTexID;
|
||||
|
@ -317,7 +317,7 @@ bool FHardwareTexture::BindOrCreate(FTexture *tex, int texunit, int clampmode, i
|
|||
int w = 0, h = 0;
|
||||
|
||||
// Create this texture
|
||||
|
||||
|
||||
FTextureBuffer texbuffer;
|
||||
|
||||
if (!tex->isHardwareCanvas())
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue