2022-12-17 13:32:43 +01:00
|
|
|
/***
|
2013-08-30 13:34:05 -07:00
|
|
|
*
|
|
|
|
* Copyright (c) 1999, Valve LLC. All rights reserved.
|
|
|
|
*
|
|
|
|
* This product contains software technology licensed from Id
|
|
|
|
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
|
|
|
* All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Use, distribution, and modification of this source code and/or resulting
|
|
|
|
* object code is restricted to non-commercial enhancements to products from
|
|
|
|
* Valve LLC. All other use, distribution, or modification is prohibited
|
|
|
|
* without written permission from Valve LLC.
|
|
|
|
*
|
|
|
|
****/
|
|
|
|
//
|
|
|
|
// parsemsg.h
|
|
|
|
// MDC - copying from cstrike\cl_dll so career-mode stuff can catch messages
|
|
|
|
// in this dll. (and C++ifying it)
|
|
|
|
//
|
|
|
|
|
2021-11-18 19:17:53 +01:00
|
|
|
#pragma once
|
2013-08-30 13:34:05 -07:00
|
|
|
|
2021-11-28 16:54:48 +01:00
|
|
|
#define ASSERT(x)
|
2013-08-30 13:34:05 -07:00
|
|
|
//--------------------------------------------------------------------------------------------------------------
|
2021-11-28 16:54:48 +01:00
|
|
|
void BEGIN_READ(void* buf, int size);
|
2021-03-05 20:54:33 +01:00
|
|
|
int READ_CHAR();
|
|
|
|
int READ_BYTE();
|
|
|
|
int READ_SHORT();
|
|
|
|
int READ_WORD();
|
|
|
|
int READ_LONG();
|
|
|
|
float READ_FLOAT();
|
|
|
|
char* READ_STRING();
|
|
|
|
float READ_COORD();
|
|
|
|
float READ_ANGLE();
|
|
|
|
float READ_HIRESANGLE();
|
2021-11-28 15:32:26 +01:00
|
|
|
bool READ_OK();
|
2013-08-30 13:34:05 -07:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------------------
|
|
|
|
class BufferWriter
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
BufferWriter();
|
2021-11-28 16:54:48 +01:00
|
|
|
BufferWriter(unsigned char* buffer, int bufferLen);
|
|
|
|
void Init(unsigned char* buffer, int bufferLen);
|
2013-08-30 13:34:05 -07:00
|
|
|
|
2021-11-28 16:54:48 +01:00
|
|
|
void WriteByte(unsigned char data);
|
|
|
|
void WriteLong(int data);
|
|
|
|
void WriteString(const char* str);
|
2013-08-30 13:34:05 -07:00
|
|
|
|
|
|
|
bool HasOverflowed();
|
|
|
|
int GetSpaceUsed();
|
|
|
|
|
|
|
|
protected:
|
2021-11-28 16:54:48 +01:00
|
|
|
unsigned char* m_buffer;
|
2013-08-30 13:34:05 -07:00
|
|
|
int m_remaining;
|
|
|
|
bool m_overflow;
|
|
|
|
int m_overallLength;
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------------------
|