mirror of
https://github.com/glest/glest-source.git
synced 2025-08-13 03:44:00 +02:00
- cleanup of texture compression. We output stats for textures that we attempt to compress and what percent they were compressed (before and after byte sizes)
This commit is contained in:
@@ -24,20 +24,24 @@ namespace Shared{ namespace Graphics{ namespace Gl{
|
||||
|
||||
class TextureGl {
|
||||
protected:
|
||||
GLuint handle;
|
||||
GLuint handle;
|
||||
|
||||
public:
|
||||
TextureGl();
|
||||
GLuint getHandle() const {return handle;}
|
||||
|
||||
void OutputTextureDebugInfo(Texture::Format format, int components, const string path);
|
||||
void OutputTextureDebugInfo(Texture::Format format, int components, const string path,uint64 rawSize);
|
||||
};
|
||||
|
||||
// =====================================================
|
||||
// class Texture1DGl
|
||||
// =====================================================
|
||||
|
||||
class Texture1DGl: public Texture1D, public TextureGl{
|
||||
class Texture1DGl: public Texture1D, public TextureGl {
|
||||
public:
|
||||
Texture1DGl();
|
||||
virtual ~Texture1DGl();
|
||||
|
||||
virtual void init(Filter filter, int maxAnisotropy= 1);
|
||||
virtual void end();
|
||||
};
|
||||
@@ -48,6 +52,9 @@ public:
|
||||
|
||||
class Texture2DGl: public Texture2D, public TextureGl{
|
||||
public:
|
||||
Texture2DGl();
|
||||
virtual ~Texture2DGl();
|
||||
|
||||
virtual void init(Filter filter, int maxAnisotropy= 1);
|
||||
virtual void end();
|
||||
};
|
||||
@@ -58,6 +65,10 @@ public:
|
||||
|
||||
class Texture3DGl: public Texture3D, public TextureGl{
|
||||
public:
|
||||
|
||||
Texture3DGl();
|
||||
virtual ~Texture3DGl();
|
||||
|
||||
virtual void init(Filter filter, int maxAnisotropy= 1);
|
||||
virtual void end();
|
||||
};
|
||||
@@ -68,6 +79,10 @@ public:
|
||||
|
||||
class TextureCubeGl: public TextureCube, public TextureGl{
|
||||
public:
|
||||
|
||||
TextureCubeGl();
|
||||
virtual ~TextureCubeGl();
|
||||
|
||||
virtual void init(Filter filter, int maxAnisotropy= 1);
|
||||
virtual void end();
|
||||
};
|
||||
|
@@ -24,6 +24,7 @@ using Shared::Platform::int16;
|
||||
using Shared::Platform::uint16;
|
||||
using Shared::Platform::int32;
|
||||
using Shared::Platform::uint32;
|
||||
using Shared::Platform::uint64;
|
||||
using Shared::Platform::float32;
|
||||
|
||||
namespace Shared{ namespace Graphics{
|
||||
@@ -97,7 +98,7 @@ public:
|
||||
// class Pixmap1D
|
||||
// =====================================================
|
||||
|
||||
class Pixmap1D{
|
||||
class Pixmap1D {
|
||||
protected:
|
||||
int w;
|
||||
int components;
|
||||
@@ -124,13 +125,14 @@ public:
|
||||
uint8 *getPixels() const {return pixels;}
|
||||
void deletePixels();
|
||||
string getPath() const { return path;}
|
||||
uint64 getPixelByteCount() const;
|
||||
};
|
||||
|
||||
// =====================================================
|
||||
// class Pixmap2D
|
||||
// =====================================================
|
||||
|
||||
class Pixmap2D{
|
||||
class Pixmap2D {
|
||||
protected:
|
||||
int h;
|
||||
int w;
|
||||
@@ -199,6 +201,7 @@ public:
|
||||
void copy(const Pixmap2D *sourcePixmap);
|
||||
void subCopy(int x, int y, const Pixmap2D *sourcePixmap);
|
||||
string getPath() const { return path;}
|
||||
uint64 getPixelByteCount() const;
|
||||
|
||||
private:
|
||||
bool doDimensionsAgree(const Pixmap2D *pixmap);
|
||||
@@ -208,7 +211,7 @@ private:
|
||||
// class Pixmap3D
|
||||
// =====================================================
|
||||
|
||||
class Pixmap3D{
|
||||
class Pixmap3D {
|
||||
protected:
|
||||
int h;
|
||||
int w;
|
||||
@@ -240,13 +243,14 @@ public:
|
||||
uint8 *getPixels() const {return pixels;}
|
||||
void deletePixels();
|
||||
string getPath() const { return path;}
|
||||
uint64 getPixelByteCount() const;
|
||||
};
|
||||
|
||||
// =====================================================
|
||||
// class PixmapCube
|
||||
// =====================================================
|
||||
|
||||
class PixmapCube{
|
||||
class PixmapCube {
|
||||
public:
|
||||
enum Face{
|
||||
fPositiveX,
|
||||
@@ -276,6 +280,7 @@ public:
|
||||
const Pixmap2D *getFace(int face) const {return &faces[face];}
|
||||
void deletePixels();
|
||||
string getPath(int face) const { return path[face];}
|
||||
uint64 getPixelByteCount() const;
|
||||
};
|
||||
|
||||
}}//end namespace
|
||||
|
@@ -61,6 +61,7 @@ protected:
|
||||
Format format;
|
||||
|
||||
bool inited;
|
||||
bool forceCompressionDisabled;
|
||||
|
||||
public:
|
||||
Texture();
|
||||
@@ -82,6 +83,10 @@ public:
|
||||
virtual void deletePixels() = 0;
|
||||
|
||||
virtual void reseInitState() { inited = false; }
|
||||
|
||||
virtual void setForceCompressionDisabled(bool value) { forceCompressionDisabled = value;}
|
||||
virtual bool getForceCompressionDisabled() const {return forceCompressionDisabled;}
|
||||
|
||||
};
|
||||
|
||||
// =====================================================
|
||||
@@ -105,7 +110,7 @@ public:
|
||||
// class Texture2D
|
||||
// =====================================================
|
||||
|
||||
class Texture2D: public Texture{
|
||||
class Texture2D: public Texture {
|
||||
protected:
|
||||
Pixmap2D pixmap;
|
||||
|
||||
|
Reference in New Issue
Block a user