123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138 |
- //===========================================================================//
- // Copyright (C) Microsoft Corporation. All rights reserved. //
- //===========================================================================//
- #pragma once
- #define MLR_MLRTEXTURE_HPP
- #if !defined(MLR_MLR_HPP)
- #include <MLR\MLR.hpp>
- #endif
- #if !defined(MLR_GOSIMAGE_HPP)
- #include <MLR\GOSImage.hpp>
- #endif
- namespace MidLevelRenderer {
- class MLRTexturePool;
- class MLRTexture
- #if defined(_ARMOR)
- : public Stuff::Signature
- #endif
- {
- friend class MLRTexturePool;
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- // Constructors/Destructors
- //
- protected:
- MLRTexture(Stuff::MemoryStream *stream);
- public:
- MLRTexture(
- MLRTexturePool *pool,
- const char* name,
- int instance,
- int handle,
- int hint=0
- );
- MLRTexture(
- MLRTexturePool *pool,
- GOSImage* image,
- int handle,
- int hint=0
- );
- MLRTexture(const MLRTexture&);
- ~MLRTexture();
- static MLRTexture*
- Make(Stuff::MemoryStream *stream);
- void
- Save(Stuff::MemoryStream *stream);
- GOSImage*
- GetImage(int *h=NULL)
- { Check_Object(this); if(h) { *h = hint; } return image; }
- const char*
- GetTextureName()
- {Check_Object(this); return textureName;}
- int
- GetTextureHandle()
- {Check_Object(this); return textureHandle;}
- int
- GetImageNumber();
- int
- GetInstanceNumber();
- int
- GetTextureInstance()
- {Check_Object(this); return instance;}
- bool
- GetAnimateTexture()
- {Check_Object(this); return !textureMatrixIsIdentity;}
- void
- SetAnimateTexture(bool yesNo)
- {
- Check_Object(this);
- if(yesNo==true)
- {
- textureMatrixIsIdentity = false;
- }
- else
- {
- textureMatrixIsIdentity = true;
- textureMatrix = Stuff::AffineMatrix4D::Identity;
- }
- }
- Stuff::AffineMatrix4D&
- GetTextureMatrix()
- { Check_Object(this); return textureMatrix; }
- void
- SetHint(int h)
- { Check_Object(this); hint = h; }
- int
- GetHint()
- { Check_Object(this); return hint; }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- // Testing
- //
- public:
- void
- TestInstance() const;
- protected:
- Stuff::MString textureName;
- int textureNameHashValue;
- int instance;
- int textureHandle;
- int hint;
- bool textureMatrixIsIdentity;
- Stuff::AffineMatrix4D textureMatrix;
- GOSImage *image;
- MLRTexturePool *thePool;
- };
- }
|