fixed windows builds

This commit is contained in:
2025-07-20 00:45:31 +03:00
parent 070c3ff309
commit fb4c201921
26 changed files with 519 additions and 338 deletions

View File

@@ -3,6 +3,7 @@
#include "brush.h"
#include "engine.h"
#include "filesystem.h"
#include "interface.h"
#include "tier1/utlbuffer.h"
#include "tier1/utlstring.h"
@@ -18,15 +19,27 @@ struct EntityHeader_t
uint32_t nProperties;
};
interface CLevelManager: public ILevelManager
{
public:
virtual void Init() override {}
virtual void Frame() override {}
virtual void Deinit() override {}
virtual void LoadLevel( const char *szLevelName ) override;
};
DECLARE_ENGINE_INTERFACE(LevelManager, CLevelManager);
//-----------------------------------------------------------------------------
// Loads level from file, deserializes it and creates entities.
//-----------------------------------------------------------------------------
void ILevel::LoadLevel( const char *szLevelName )
void CLevelManager::LoadLevel( const char *szLevelName )
{
FileHandle_t handle = IFileSystem::Open(CUtlString("%s.fmap",szLevelName), IFILE_READ);
CUtlBuffer<char> mapdata(IFileSystem::Size(handle));
IFileSystem::Read(handle, mapdata.GetMemory(), mapdata.GetSize());
IFileSystem::Close(handle);
FileHandle_t handle = FileSystem()->Open(CUtlString("%s.fmap",szLevelName), IFILE_READ);
CUtlBuffer<char> mapdata(FileSystem()->Size(handle));
FileSystem()->Read(handle, mapdata.GetMemory(), mapdata.GetSize());
FileSystem()->Close(handle);
MapHeader_t* pHeader = (MapHeader_t*)mapdata.GetMemory();
char *pData = (char*)mapdata.GetMemory()+sizeof(MapHeader_t);
for ( uint32_t i = 0; i < pHeader->nEntities; i++ )