diff options
| author | Joe Ludwig <[email protected]> | 2013-06-26 15:22:04 -0700 |
|---|---|---|
| committer | Joe Ludwig <[email protected]> | 2013-06-26 15:22:04 -0700 |
| commit | 39ed87570bdb2f86969d4be821c94b722dc71179 (patch) | |
| tree | abc53757f75f40c80278e87650ea92808274aa59 /mp/src/utils/common/map_shared.h | |
| download | source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.tar.xz source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.zip | |
First version of the SOurce SDK 2013
Diffstat (limited to 'mp/src/utils/common/map_shared.h')
| -rw-r--r-- | mp/src/utils/common/map_shared.h | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/mp/src/utils/common/map_shared.h b/mp/src/utils/common/map_shared.h new file mode 100644 index 00000000..08e443a0 --- /dev/null +++ b/mp/src/utils/common/map_shared.h @@ -0,0 +1,91 @@ +//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+//=============================================================================//
+
+#ifndef MAP_SHARED_H
+#define MAP_SHARED_H
+#ifdef _WIN32
+#pragma once
+#endif
+
+
+#include "ChunkFile.h"
+#include "bsplib.h"
+#include "cmdlib.h"
+
+
+struct LoadEntity_t
+{
+ entity_t *pEntity;
+ int nID;
+ int nBaseFlags;
+ int nBaseContents;
+};
+
+
+class CMapError
+{
+public:
+
+ void BrushState( int brushID )
+ {
+ m_brushID = brushID;
+ }
+
+ void BrushSide( int side )
+ {
+ m_sideIndex = side;
+ }
+
+ void TextureState( const char *pTextureName )
+ {
+ Q_strncpy( m_textureName, pTextureName, sizeof( m_textureName ) );
+ }
+
+ void ClearState( void )
+ {
+ BrushState( 0 );
+ BrushSide( 0 );
+ TextureState( "Not a Parse error!" );
+ }
+
+ //-----------------------------------------------------------------------------
+ // Purpose: Hook the map parse errors and report brush/ent/texture state
+ // Input : *pErrorString -
+ //-----------------------------------------------------------------------------
+ void ReportError( const char *pErrorString )
+ {
+ Error( "Brush %i: %s\nSide %i\nTexture: %s\n", m_brushID, pErrorString, m_sideIndex, m_textureName );
+ }
+
+ //-----------------------------------------------------------------------------
+ // Purpose: Hook the map parse errors and report brush/ent/texture state without exiting.
+ // Input : pWarningString -
+ //-----------------------------------------------------------------------------
+ void ReportWarning( const char *pWarningString )
+ {
+ printf( "Brush %i, Side %i: %s\n", m_brushID, m_sideIndex, pWarningString );
+ }
+
+private:
+
+ int m_brushID;
+ int m_sideIndex;
+ char m_textureName[80];
+};
+
+
+extern CMapError g_MapError;
+extern int g_nMapFileVersion;
+
+
+// Shared mapload code.
+ChunkFileResult_t LoadEntityKeyCallback( const char *szKey, const char *szValue, LoadEntity_t *pLoadEntity );
+
+// Used by VRAD incremental lighting - only load ents from the file and
+// fill in the global entities/num_entities array.
+bool LoadEntsFromMapFile( char const *pFilename );
+
+#endif // MAP_SHARED_H
|