mirror of
https://github.com/ZDoom/Raze.git
synced 2025-04-24 08:48:52 +00:00
Compare commits
7 commits
Author | SHA1 | Date | |
---|---|---|---|
|
9aa805e749 | ||
|
7092780569 | ||
|
247319096f | ||
|
82064ae73a | ||
|
f21f248588 | ||
|
ce732f4cd7 | ||
|
9a068cf7c9 |
9 changed files with 65 additions and 13 deletions
|
@ -128,6 +128,8 @@ void Win32Window::SetWindowFrame(const Rect& box)
|
||||||
|
|
||||||
void Win32Window::SetClientFrame(const Rect& box)
|
void Win32Window::SetClientFrame(const Rect& box)
|
||||||
{
|
{
|
||||||
|
// This function is currently unused but needs to be disabled because it contains Windows API calls that were only added in Windows 10.
|
||||||
|
#if 0
|
||||||
double dpiscale = GetDpiScale();
|
double dpiscale = GetDpiScale();
|
||||||
|
|
||||||
RECT rect = {};
|
RECT rect = {};
|
||||||
|
@ -141,6 +143,7 @@ void Win32Window::SetClientFrame(const Rect& box)
|
||||||
AdjustWindowRectExForDpi(&rect, style, FALSE, exstyle, GetDpiForWindow(WindowHandle));
|
AdjustWindowRectExForDpi(&rect, style, FALSE, exstyle, GetDpiForWindow(WindowHandle));
|
||||||
|
|
||||||
SetWindowPos(WindowHandle, nullptr, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, SWP_NOACTIVATE | SWP_NOZORDER);
|
SetWindowPos(WindowHandle, nullptr, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, SWP_NOACTIVATE | SWP_NOZORDER);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void Win32Window::Show()
|
void Win32Window::Show()
|
||||||
|
@ -268,9 +271,22 @@ int Win32Window::GetPixelHeight() const
|
||||||
return box.bottom;
|
return box.bottom;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
typedef UINT(WINAPI* GetDpiForWindow_t)(HWND);
|
||||||
double Win32Window::GetDpiScale() const
|
double Win32Window::GetDpiScale() const
|
||||||
{
|
{
|
||||||
return GetDpiForWindow(WindowHandle) / 96.0;
|
static GetDpiForWindow_t pGetDpiForWindow = nullptr;
|
||||||
|
static bool done = false;
|
||||||
|
if (!done)
|
||||||
|
{
|
||||||
|
HMODULE hMod = GetModuleHandleA("User32.dll");
|
||||||
|
if (hMod != nullptr) pGetDpiForWindow = reinterpret_cast<GetDpiForWindow_t>(GetProcAddress(hMod, "GetDpiForWindow"));
|
||||||
|
done = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pGetDpiForWindow)
|
||||||
|
return pGetDpiForWindow(WindowHandle) / 96.0;
|
||||||
|
else
|
||||||
|
return 1.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Win32Window::GetClipboardText()
|
std::string Win32Window::GetClipboardText()
|
||||||
|
|
|
@ -749,9 +749,8 @@ sfxinfo_t *SoundEngine::LoadSound(sfxinfo_t *sfx)
|
||||||
{
|
{
|
||||||
auto sfxp = sfxdata.data();
|
auto sfxp = sfxdata.data();
|
||||||
int32_t dmxlen = LittleLong(((int32_t *)sfxp)[1]);
|
int32_t dmxlen = LittleLong(((int32_t *)sfxp)[1]);
|
||||||
|
|
||||||
// If the sound is voc, use the custom loader.
|
// If the sound is voc, use the custom loader.
|
||||||
if (memcmp (sfxp, "Creative Voice File", 19) == 0)
|
if (size > 19 && memcmp (sfxp, "Creative Voice File", 19) == 0)
|
||||||
{
|
{
|
||||||
sfx->data = GSnd->LoadSoundVoc(sfxp, size);
|
sfx->data = GSnd->LoadSoundVoc(sfxp, size);
|
||||||
}
|
}
|
||||||
|
|
|
@ -132,7 +132,7 @@ int FDirectory::AddDirectory(const char *dirpath, LumpFilterInfo* filter, FileSy
|
||||||
// On Linux this is important because its file system is case sensitive,
|
// On Linux this is important because its file system is case sensitive,
|
||||||
// but even on Windows the Unicode normalization is destructive
|
// but even on Windows the Unicode normalization is destructive
|
||||||
// for some characters and cannot be used for file names.
|
// for some characters and cannot be used for file names.
|
||||||
// Examples for this are the Turkish 'i's or the German Ăź.
|
// Examples for this are the Turkish 'i's or the German Ăź.
|
||||||
SystemFilePath[count] = stringpool->Strdup(entry.FilePathRel.c_str());
|
SystemFilePath[count] = stringpool->Strdup(entry.FilePathRel.c_str());
|
||||||
// for internal access we use the normalized form of the relative path.
|
// for internal access we use the normalized form of the relative path.
|
||||||
// this is fine because the paths that get compared against this will also be normalized.
|
// this is fine because the paths that get compared against this will also be normalized.
|
||||||
|
|
|
@ -317,6 +317,8 @@ void DObject::Release()
|
||||||
|
|
||||||
void DObject::Destroy ()
|
void DObject::Destroy ()
|
||||||
{
|
{
|
||||||
|
RemoveFromNetwork();
|
||||||
|
|
||||||
// We cannot call the VM during shutdown because all the needed data has been or is in the process of being deleted.
|
// We cannot call the VM during shutdown because all the needed data has been or is in the process of being deleted.
|
||||||
if (PClass::bVMOperational)
|
if (PClass::bVMOperational)
|
||||||
{
|
{
|
||||||
|
@ -569,8 +571,15 @@ void DObject::Serialize(FSerializer &arc)
|
||||||
|
|
||||||
SerializeFlag("justspawned", OF_JustSpawned);
|
SerializeFlag("justspawned", OF_JustSpawned);
|
||||||
SerializeFlag("spawned", OF_Spawned);
|
SerializeFlag("spawned", OF_Spawned);
|
||||||
|
SerializeFlag("networked", OF_Networked);
|
||||||
|
|
||||||
ObjectFlags |= OF_SerialSuccess;
|
ObjectFlags |= OF_SerialSuccess;
|
||||||
|
|
||||||
|
if (arc.isReading() && (ObjectFlags & OF_Networked))
|
||||||
|
{
|
||||||
|
ClearNetworkID();
|
||||||
|
EnableNetworking(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DObject::CheckIfSerialized () const
|
void DObject::CheckIfSerialized () const
|
||||||
|
@ -585,7 +594,6 @@ void DObject::CheckIfSerialized () const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
DEFINE_ACTION_FUNCTION(DObject, MSTime)
|
DEFINE_ACTION_FUNCTION(DObject, MSTime)
|
||||||
{
|
{
|
||||||
ACTION_RETURN_INT((uint32_t)I_msTime());
|
ACTION_RETURN_INT((uint32_t)I_msTime());
|
||||||
|
|
|
@ -351,6 +351,18 @@ protected:
|
||||||
friend T* Create(Args&&... args);
|
friend T* Create(Args&&... args);
|
||||||
|
|
||||||
friend class JitCompiler;
|
friend class JitCompiler;
|
||||||
|
|
||||||
|
private:
|
||||||
|
// This is intentionally left unserialized.
|
||||||
|
uint32_t _networkID;
|
||||||
|
|
||||||
|
public:
|
||||||
|
inline bool IsNetworked() const { return (ObjectFlags & OF_Networked); }
|
||||||
|
inline uint32_t GetNetworkID() const { return _networkID; }
|
||||||
|
void SetNetworkID(const uint32_t id);
|
||||||
|
void ClearNetworkID();
|
||||||
|
void RemoveFromNetwork();
|
||||||
|
virtual void EnableNetworking(const bool enable);
|
||||||
};
|
};
|
||||||
|
|
||||||
// This is the only method aside from calling CreateNew that should be used for creating DObjects
|
// This is the only method aside from calling CreateNew that should be used for creating DObjects
|
||||||
|
|
|
@ -26,6 +26,7 @@ enum EObjectFlags
|
||||||
OF_Transient = 1 << 11, // Object should not be archived (references to it will be nulled on disk)
|
OF_Transient = 1 << 11, // Object should not be archived (references to it will be nulled on disk)
|
||||||
OF_Spawned = 1 << 12, // Thinker was spawned at all (some thinkers get deleted before spawning)
|
OF_Spawned = 1 << 12, // Thinker was spawned at all (some thinkers get deleted before spawning)
|
||||||
OF_Released = 1 << 13, // Object was released from the GC system and should not be processed by GC function
|
OF_Released = 1 << 13, // Object was released from the GC system and should not be processed by GC function
|
||||||
|
OF_Networked = 1 << 14, // Object has a unique network identifier that makes it synchronizable between all clients.
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class T> class TObjPtr;
|
template<class T> class TObjPtr;
|
||||||
|
|
|
@ -41,11 +41,11 @@ const char *GetVersionString();
|
||||||
|
|
||||||
/** Lots of different version numbers **/
|
/** Lots of different version numbers **/
|
||||||
|
|
||||||
#define VERSIONSTR "1.9pre"
|
#define VERSIONSTR "1.10.1"
|
||||||
|
|
||||||
// The version as seen in the Windows resource
|
// The version as seen in the Windows resource
|
||||||
#define RC_FILEVERSION 1,8,9999,0
|
#define RC_FILEVERSION 1,10,1,0
|
||||||
#define RC_PRODUCTVERSION 1,8,9999,0
|
#define RC_PRODUCTVERSION 1,10,1,0
|
||||||
#define RC_PRODUCTVERSION2 VERSIONSTR
|
#define RC_PRODUCTVERSION2 VERSIONSTR
|
||||||
// These are for content versioning.
|
// These are for content versioning.
|
||||||
#define VER_MAJOR 4
|
#define VER_MAJOR 4
|
||||||
|
@ -53,8 +53,8 @@ const char *GetVersionString();
|
||||||
#define VER_REVISION 0
|
#define VER_REVISION 0
|
||||||
|
|
||||||
#define ENG_MAJOR 1
|
#define ENG_MAJOR 1
|
||||||
#define ENG_MINOR 8
|
#define ENG_MINOR 10
|
||||||
#define ENG_REVISION 0
|
#define ENG_REVISION 1
|
||||||
|
|
||||||
// More stuff that needs to be different for derivatives.
|
// More stuff that needs to be different for derivatives.
|
||||||
#define GAMENAME "Raze"
|
#define GAMENAME "Raze"
|
||||||
|
|
|
@ -1,8 +1,22 @@
|
||||||
#include "common/engine/palettecontainer.h"
|
|
||||||
#include "name.h"
|
#include "name.h"
|
||||||
#include "dobject.h"
|
#include "dobject.h"
|
||||||
|
|
||||||
bool ShouldAllowGameSpecificVirtual(FName name, unsigned index, PType* arg, PType* varg)
|
bool ShouldAllowGameSpecificVirtual(FName name, unsigned index, PType* arg, PType* varg)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void DObject::EnableNetworking(const bool enable)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
void DObject::RemoveFromNetwork(void)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
void DObject::ClearNetworkID()
|
||||||
|
{
|
||||||
|
return;
|
||||||
}
|
}
|
|
@ -85,6 +85,7 @@ void PlayGamePage::OnGeometryChanged()
|
||||||
|
|
||||||
y = GetHeight() - 10.0;
|
y = GetHeight() - 10.0;
|
||||||
|
|
||||||
|
#if 0 // NYI: Additional Parameters
|
||||||
double editHeight = 24.0;
|
double editHeight = 24.0;
|
||||||
y -= editHeight;
|
y -= editHeight;
|
||||||
ParametersEdit->SetFrameGeometry(0.0, y, GetWidth(), editHeight);
|
ParametersEdit->SetFrameGeometry(0.0, y, GetWidth(), editHeight);
|
||||||
|
@ -94,6 +95,7 @@ void PlayGamePage::OnGeometryChanged()
|
||||||
y -= labelHeight;
|
y -= labelHeight;
|
||||||
ParametersLabel->SetFrameGeometry(0.0, y, GetWidth(), labelHeight);
|
ParametersLabel->SetFrameGeometry(0.0, y, GetWidth(), labelHeight);
|
||||||
y -= 10.0;
|
y -= 10.0;
|
||||||
|
#endif
|
||||||
|
|
||||||
double listViewBottom = y - 10.0;
|
double listViewBottom = y - 10.0;
|
||||||
GamesList->SetFrameGeometry(0.0, listViewTop, GetWidth(), std::max(listViewBottom - listViewTop, 0.0));
|
GamesList->SetFrameGeometry(0.0, listViewTop, GetWidth(), std::max(listViewBottom - listViewTop, 0.0));
|
||||||
|
|
Loading…
Reference in a new issue