2015-06-14 23:23:09 +02:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <cstdint>
|
2015-10-15 07:06:51 +02:00
|
|
|
#include <array>
|
|
|
|
#include "demmessages.h"
|
2015-06-14 23:23:09 +02:00
|
|
|
|
|
|
|
class DemoFileReader;
|
2015-07-14 05:25:49 +02:00
|
|
|
namespace DemHandlers
|
|
|
|
{
|
|
|
|
using FileRead = DemoFileReader;
|
|
|
|
}
|
2015-06-14 23:23:09 +02:00
|
|
|
|
|
|
|
#define DECLARE_DEM_HANDLERS(msgname) \
|
|
|
|
namespace DemHandlers \
|
|
|
|
{ \
|
2015-06-19 02:18:55 +02:00
|
|
|
bool msgname##_FileRead_Internal(FileRead& demofile, DemMsg::msgname* data); \
|
|
|
|
inline bool msgname##_FileRead(FileRead& demofile, void* data) \
|
2015-06-14 23:23:09 +02:00
|
|
|
{ \
|
|
|
|
return msgname##_FileRead_Internal(demofile, reinterpret_cast<DemMsg::msgname*>(data)); \
|
|
|
|
} \
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace DemHandlers
|
|
|
|
{
|
2015-10-15 07:06:51 +02:00
|
|
|
using DemDataStructArray = std::array<void*, dem_lastcmd + 1>;
|
|
|
|
void CreateDemMsgStructs(DemDataStructArray& demDataStructs);
|
|
|
|
void DestroyDemMsgStructs(DemDataStructArray& demDataStructs);
|
2015-07-11 09:02:49 +02:00
|
|
|
|
2015-06-19 02:18:55 +02:00
|
|
|
bool DemMsg_FileRead(uint32_t type, FileRead& demofile, void* data);
|
2015-06-14 23:23:09 +02:00
|
|
|
}
|