123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- //===========================================================================//
- // Copyright (C) Microsoft Corporation. All rights reserved. //
- //===========================================================================//
- #pragma once
- #define MLR_GOSIMAGE_HPP
- #if !defined(MLR_MLR_HPP)
- #include <MLR\MLR.hpp>
- #endif
- #if !defined(GAMEOS_HPP)
- #include <GameOS.hpp>
- #endif
- #ifndef TXMMGR_H
- #include "txmmgr.h"
- #endif
- namespace MidLevelRenderer {
- class GOSImage:
- public Stuff::Plug
- {
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- // Constructors/Destructors
- //
- public:
- GOSImage(const char* imageName);
- GOSImage(DWORD imageHandle);
- GOSImage(const char*, gos_TextureHints);
- ~GOSImage();
- int
- GetWidth();
- int
- GetHeight();
- const char*
- GetName()
- { Check_Object(this); return imageName; }
- int
- Ref()
- { Check_Object(this); instance++; return instance; }
- int
- DeRef()
- { Check_Object(this); instance--; return instance; }
- int
- GetRef()
- { Check_Object(this); return instance; }
- bool
- IsLoaded()
- { Check_Object(this); return ( (flags & Loaded) != 0); }
- DWORD GetHandle()
- {
- Check_Object(this);
- DWORD imageHandle = mcTextureManager->get_gosTextureHandle(mcTextureNodeIndex);
- if (imageHandle == 0xffffffff)
- imageHandle = 0;
- return imageHandle;
- }
- void SetHandle (DWORD handle)
- {
- //EVERY call to this must change from gos_load to our load
- Check_Object(this);
- mcTextureNodeIndex = handle;
- }
- enum {
- Loaded = 1,
- Locked = 2
- };
- void
- LockImage();
- void
- UnlockImage();
- unsigned char*
- GetImagePtr();
- int
- GetPitch()
- { return ptr.Pitch; }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- // Testing
- //
- public:
- void
- TestInstance() const
- {}
- Stuff::MString imageName;
- int flags;
- protected:
- gos_TextureHints ipHints;
- int instance;
- DWORD mcTextureNodeIndex;
- TEXTUREPTR ptr;
- };
- }
|