2001-11-04 19:34:28 +00:00
|
|
|
/*
|
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
File: RageTextureManager.h
|
|
|
|
|
|
|
|
|
|
Desc: Interface for loading and releasing textures.
|
|
|
|
|
|
2002-04-16 17:31:00 +00:00
|
|
|
Copyright (c) 2001-2002 by the persons listed below. All rights reserved.
|
2001-11-04 19:34:28 +00:00
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
*/
|
2001-11-03 10:52:42 +00:00
|
|
|
|
|
|
|
|
class RageTextureManager;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef _RAGETEXTUREMANAGER_H_
|
|
|
|
|
#define _RAGETEXTUREMANAGER_H_
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "RageTexture.h"
|
|
|
|
|
//#include <d3dx8.h>
|
|
|
|
|
//#include <d3d8types.h>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
// RageTextureManager Class Declarations
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
class RageTextureManager
|
|
|
|
|
{
|
|
|
|
|
public:
|
2002-03-30 20:00:13 +00:00
|
|
|
RageTextureManager( RageScreen* pScreen );
|
2001-11-03 10:52:42 +00:00
|
|
|
~RageTextureManager();
|
|
|
|
|
|
2002-03-30 20:00:13 +00:00
|
|
|
RageTexture* LoadTexture( CString sTexturePath, const DWORD dwHints = 0, const bool bForceReload = false );
|
2002-01-16 10:01:32 +00:00
|
|
|
bool IsTextureLoaded( CString sTexturePath );
|
|
|
|
|
void UnloadTexture( CString sTexturePath );
|
2002-04-28 20:42:32 +00:00
|
|
|
void ReloadAll();
|
2001-11-03 10:52:42 +00:00
|
|
|
|
2002-04-28 20:42:32 +00:00
|
|
|
void SetPrefs( const DWORD dwMaxSize, const DWORD dwTextureColorDepth )
|
|
|
|
|
{
|
|
|
|
|
ASSERT( m_dwMaxTextureSize >= 64 );
|
|
|
|
|
m_dwMaxTextureSize = dwMaxSize;
|
|
|
|
|
m_dwTextureColorDepth = dwTextureColorDepth;
|
|
|
|
|
ReloadAll();
|
|
|
|
|
};
|
2002-03-30 20:00:13 +00:00
|
|
|
DWORD GetMaxTextureSize() { return m_dwMaxTextureSize; };
|
|
|
|
|
DWORD GetTextureColorDepth() { return m_dwTextureColorDepth; };
|
|
|
|
|
|
2001-11-03 10:52:42 +00:00
|
|
|
protected:
|
2002-03-30 20:00:13 +00:00
|
|
|
RageScreen* m_pScreen;
|
|
|
|
|
|
|
|
|
|
DWORD m_dwMaxTextureSize;
|
|
|
|
|
DWORD m_dwTextureColorDepth;
|
2001-11-03 10:52:42 +00:00
|
|
|
|
|
|
|
|
// map from file name to a texture holder
|
2002-03-30 20:00:13 +00:00
|
|
|
CTypedPtrMap<CMapStringToPtr, CString, RageTexture*> m_mapPathToTexture;
|
2001-11-03 10:52:42 +00:00
|
|
|
};
|
|
|
|
|
|
2002-03-30 20:00:13 +00:00
|
|
|
extern RageTextureManager* TEXTURE; // global and accessable from anywhere in our program
|
2001-11-03 10:52:42 +00:00
|
|
|
|
|
|
|
|
#endif
|