summaryrefslogtreecommitdiff
path: root/hammer/textureconverter.h
blob: a5cffc390b16f2f62cda02ee9f4b7f8686cd1872 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: 
//
// $NoKeywords: $
//=============================================================================//

#ifndef TEXTURECONVERT_H
#define TEXTURECONVERT_H
#pragma once


#include "MapWorld.h"
#include "MapSolid.h"
#include "MapFace.h"
#include "MapDecal.h"
#include "IEditorTexture.h"
#include "resource.h"
#include "ProgDlg.h"

class CTextureConverter
{
public:
	static void	ConvertWorldTextures( CMapWorld * pWorld );

private:
	static void			Initialize( void );
	static void			ConvertSolids( CMapWorld * pWorld );
	static void			ConvertDecals( CMapWorld * pWorld );
	static bool			CountMapSolids( CMapSolid * pSolid, DWORD );
	static bool			CountMapDecals( CMapEntity *, DWORD );
	static bool			CheckSolidTextures( CMapSolid * pSolid, DWORD );
	static bool			CheckDecalTextures( CMapEntity * pEnt, DWORD );
	static void			CheckFaceTexture( CMapFace * pFace );
	static void			ConvertFaceTexture( CMapFace * pFace );
	static void			ConvertDecalTexture( CMapEntity * pEnt );
	static void			GetNewTextureMatches( const char * pszOldName, EditorTextureList_t &MatchList );
	static bool			TextureNameMatchesMaterialName( const char * pszTextureName, const char * pszMaterialName );
	static void			ReplaceFaceTexture( CMapFace * pFace, IEditorTexture * pNewTexture );
	static void			ReplaceDecalTexture( CMapEntity * pEnt, IEditorTexture * pNewTexture );
	static IEditorTexture *	FindWAD3Texture( const char * pszName );
	static void			RescaleFaceTexture( CMapFace * pFace, IEditorTexture * pNewTexture );
	static void			MsgConvertFace( CMapFace * pFace, PRINTF_FORMAT_STRING const char * format, ... );
	static void			MsgConvertDecal( CMapEntity * pEnt, PRINTF_FORMAT_STRING const char * format, ... );
	static void			DisplayStatistics( void );

	static CProgressDlg *	m_pProgDlg;
	static int				m_nSolidCount;
	static int				m_nFaceCount;
	static int				m_nDecalCount;
	static int				m_nCurrentSolid;
	static int				m_nCurrentDecal;
	static int				m_nSuccesses;
	static int				m_nErrors;
	static int				m_nSkipped;
	static int				m_nWarnings;
};


#endif // TEXTURECONVERT_H