- backend update from Raze.

This commit is contained in:
Christoph Oelckers 2021-01-29 13:54:18 +01:00
parent 0036f7fade
commit f108a106c9
5 changed files with 11 additions and 3 deletions

View file

@ -41,7 +41,7 @@ public:
int Explode(unsigned char *out, unsigned int outsize, FileReader &in, unsigned int insize, int flags); int Explode(unsigned char *out, unsigned int outsize, FileReader &in, unsigned int insize, int flags);
}; };
class CExplosionError : CRecoverableError class CExplosionError : public CRecoverableError
{ {
public: public:
CExplosionError(const char *message) : CRecoverableError(message) {} CExplosionError(const char *message) : CRecoverableError(message) {}

View file

@ -837,6 +837,7 @@ void FileSystem::InitHashChains (void)
{ {
unsigned int i, j; unsigned int i, j;
NumEntries = FileInfo.Size();
Hashes.Resize(8 * NumEntries); Hashes.Resize(8 * NumEntries);
// Mark all buckets as empty // Mark all buckets as empty
memset(Hashes.Data(), -1, Hashes.Size() * sizeof(Hashes[0])); memset(Hashes.Data(), -1, Hashes.Size() * sizeof(Hashes[0]));
@ -1522,10 +1523,11 @@ const char *FileSystem::GetResourceFileFullName (int rfnum) const noexcept
bool FileSystem::CreatePathlessCopy(const char *name, int id, int /*flags*/) bool FileSystem::CreatePathlessCopy(const char *name, int id, int /*flags*/)
{ {
FString name2, type2, path; FString name2=name, type2, path;
// The old code said 'filename' and ignored the path, this looked like a bug. // The old code said 'filename' and ignored the path, this looked like a bug.
auto lump = FindFile(name); FixPathSeperator(name2);
auto lump = FindFile(name2);
if (lump < 0) return false; // Does not exist. if (lump < 0) return false; // Does not exist.
auto oldlump = FileInfo[lump]; auto oldlump = FileInfo[lump];

View file

@ -312,6 +312,7 @@ bool FHardwareTexture::BindOrCreate(FTexture *tex, int texunit, int clampmode, i
{ {
glTextureBytes = 1; glTextureBytes = 1;
forcenofilter = true; forcenofilter = true;
needmipmap = false;
} }
int w = 0, h = 0; int w = 0, h = 0;

View file

@ -99,5 +99,7 @@ inline void fillshort(void* buff, size_t count, uint16_t clear)
} }
} }
template<typename T> inline constexpr T Sgn(const T& val) { return (val > 0) - (val < 0); }
#endif #endif

View file

@ -7,8 +7,11 @@
__forceinline constexpr int32_t MulScale(int32_t a, int32_t b, int32_t shift) { return (int32_t)(((int64_t)a * b) >> shift); } __forceinline constexpr int32_t MulScale(int32_t a, int32_t b, int32_t shift) { return (int32_t)(((int64_t)a * b) >> shift); }
__forceinline constexpr double MulScaleF(double a, double b, int32_t shift) { return (a * b) * (1. / (uint32_t(1) << shift)); }
__forceinline constexpr int32_t DMulScale(int32_t a, int32_t b, int32_t c, int32_t d, int32_t shift) { return (int32_t)(((int64_t)a * b + (int64_t)c * d) >> shift); } __forceinline constexpr int32_t DMulScale(int32_t a, int32_t b, int32_t c, int32_t d, int32_t shift) { return (int32_t)(((int64_t)a * b + (int64_t)c * d) >> shift); }
__forceinline constexpr int32_t TMulScale(int32_t a, int32_t b, int32_t c, int32_t d, int32_t e, int32_t f, int32_t shift) { return (int32_t)(((int64_t)a * b + (int64_t)c * d + (int64_t)e * f) >> shift); }
__forceinline constexpr int32_t DivScale(int32_t a, int32_t b, int shift) { return (int32_t)(((int64_t)a << shift) / b); } __forceinline constexpr int32_t DivScale(int32_t a, int32_t b, int shift) { return (int32_t)(((int64_t)a << shift) / b); }
__forceinline constexpr int64_t DivScaleL(int64_t a, int64_t b, int shift) { return ((a << shift) / b); }
#include "xs_Float.h" #include "xs_Float.h"