Xrasher/3rdparty/MultiEmulator/src/DoubleBuffering.h
Alibek Omarov ae2ad6ddf2 3rdparty: add MultiEmulator by 2010kohtep
* patched to be portable, turned into a static library
* integrated to the engine
2024-10-21 06:19:11 +03:00

40 lines
987 B
C++

//DoubleBuffering.h Header File
#ifndef __DOUBLEBUFFERING_H__
#define __DOUBLEBUFFERING_H__
//Typical DISCLAIMER:
//The code in this project is Copyright (C) 2003 by George Anescu. You have the right to
//use and distribute the code in any way you see fit as long as this paragraph is included
//with the distribution. No warranties or claims are made as to the validity of the
//information and code contained herein, so use it at your own risk.
#include <fstream>
using namespace std;
class CDoubleBuffering
{
public:
//Constructor
CDoubleBuffering(ifstream& in, char* pcBuff, int iSize, int iDataLen);
//Get Next Data Buffer
int GetData(char* pszDataBuf, int iDataLen=-1);
private:
ifstream& m_rin;
int m_iSize;
int m_iSize2; //m_iSize/2
int m_iDataLen;
//Current Position
int m_iCurPos;
//End Position
int m_iEnd;
//Which Buffer
int m_iBuf;
char* m_pcBuff;
//EOF attained
bool m_bEOF;
};
#endif //__DOUBLEBUFFERING_H__