mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 00:41:55 +00:00
- code cleanup.
This commit is contained in:
parent
3874cf365c
commit
bea6834f8e
7 changed files with 23 additions and 9 deletions
|
@ -117,6 +117,13 @@ public:
|
|||
void MustGetNumber(bool evaluate = false);
|
||||
bool CheckNumber(bool evaluate = false);
|
||||
|
||||
bool GetNumber(int16_t& var, bool evaluate = false)
|
||||
{
|
||||
if (!GetNumber(evaluate)) return false;
|
||||
var = Number;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GetNumber(int& var, bool evaluate = false)
|
||||
{
|
||||
if (!GetNumber(evaluate)) return false;
|
||||
|
|
|
@ -82,8 +82,8 @@ PalettedPixels FImageSource::GetCachedPalettedPixels(int conversion)
|
|||
{
|
||||
PalettedPixels ret;
|
||||
|
||||
FString name;
|
||||
fileSystem.GetFileShortName(name, SourceLump);
|
||||
//FString name;
|
||||
//fileSystem.GetFileShortName(name, SourceLump);
|
||||
|
||||
auto imageID = ImageID;
|
||||
|
||||
|
@ -196,10 +196,10 @@ FBitmap FImageSource::GetCachedBitmap(const PalEntry *remap, int conversion, int
|
|||
{
|
||||
FBitmap ret;
|
||||
|
||||
FString name;
|
||||
int trans = -1;
|
||||
fileSystem.GetFileShortName(name, SourceLump);
|
||||
//FString name;
|
||||
//fileSystem.GetFileShortName(name, SourceLump);
|
||||
|
||||
int trans = -1;
|
||||
auto imageID = ImageID;
|
||||
|
||||
if (remap != nullptr)
|
||||
|
|
|
@ -60,7 +60,7 @@ public:
|
|||
virtual bool SupportRemap0() { return false; } // Unfortunate hackery that's needed for Hexen's skies. Only the image can know about the needed parameters
|
||||
virtual bool IsRawCompatible() { return true; } // Same thing for mid texture compatibility handling. Can only be determined by looking at the composition data which is private to the image.
|
||||
|
||||
void CopySize(FImageSource &other)
|
||||
void CopySize(FImageSource &other) noexcept
|
||||
{
|
||||
Width = other.Width;
|
||||
Height = other.Height;
|
||||
|
@ -71,6 +71,7 @@ public:
|
|||
|
||||
// Images are statically allocated and freed in bulk. None of the subclasses may hold any destructible data.
|
||||
void *operator new(size_t block) { return ImageArena.Alloc(block); }
|
||||
void* operator new(size_t block, void* mem) { return mem; }
|
||||
void operator delete(void *block) {}
|
||||
|
||||
bool bMasked = true; // Image (might) have holes (Assume true unless proven otherwise!)
|
||||
|
@ -102,8 +103,8 @@ public:
|
|||
noremap0 = 2
|
||||
};
|
||||
|
||||
FImageSource(int sourcelump = -1) : SourceLump(sourcelump) { ImageID = ++NextID; }
|
||||
virtual ~FImageSource() {}
|
||||
FImageSource(int sourcelump = -1) noexcept : SourceLump(sourcelump) { ImageID = ++NextID; }
|
||||
virtual ~FImageSource() = default;
|
||||
|
||||
int GetWidth() const
|
||||
{
|
||||
|
|
|
@ -174,6 +174,10 @@ public:
|
|||
BuildTileData.Reserve(1);
|
||||
return BuildTileData.Last();
|
||||
}
|
||||
TArray<TArray<uint8_t>>& GetBuildTileDataStore()
|
||||
{
|
||||
return BuildTileData;
|
||||
}
|
||||
|
||||
FGameTexture* GameTexture(FTextureID id) { return Textures[id.GetIndex()].Texture; }
|
||||
void SetTranslation(FTextureID fromtexnum, FTextureID totexnum);
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
#include "maptypes.h"
|
||||
#include "build.h"
|
||||
#include "actorinfo.h"
|
||||
#include "clip.h"
|
||||
|
||||
enum
|
||||
{
|
||||
|
|
|
@ -98,7 +98,7 @@ SkyDefinition getSky(int tilenum)
|
|||
result = {};
|
||||
result.scale = 1.f;
|
||||
}
|
||||
int w = tileWidth(tilenum);
|
||||
int w = tileWidth(tilenum);
|
||||
if (result.lognumtiles == 0 || w >= 256)
|
||||
{
|
||||
if (w < 512) result.lognumtiles = 2;
|
||||
|
|
|
@ -43,6 +43,7 @@ BEGIN_DUKE_NS
|
|||
void tileCopySection(FTextureID tilenum1, int sx1, int sy1, int xsiz, int ysiz, uint8_t* p2, int xsiz2, int ysiz2, int sx2, int sy2)
|
||||
{
|
||||
auto tex = TexMan.GetGameTexture(tilenum1);
|
||||
if (!tex->isValid()) return;
|
||||
int xsiz1 = tex->GetTexelWidth();
|
||||
int ysiz1 = tex->GetTexelHeight();
|
||||
if (xsiz1 > 0 && ysiz1 > 0)
|
||||
|
|
Loading…
Reference in a new issue