Initial commit: ROW Client source code
Game client codebase including: - CharacterActionControl: Character and creature management - GlobalScript: Network, items, skills, quests, utilities - RYLClient: Main client application with GUI and event handlers - Engine: 3D rendering engine (RYLGL) - MemoryManager: Custom memory allocation - Library: Third-party dependencies (DirectX, boost, etc.) - Tools: Development utilities 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
70
Engine/Zalla3D Base Class/FileLoad.cpp
Normal file
70
Engine/Zalla3D Base Class/FileLoad.cpp
Normal file
@@ -0,0 +1,70 @@
|
||||
// FileLoad.cpp: implementation of the CFileLoad class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "FileLoad.h"
|
||||
#include <windows.h>
|
||||
#include "GMMemory.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
CFileLoad::CFileLoad()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
CFileLoad::~CFileLoad()
|
||||
{
|
||||
if ( m_Data )
|
||||
{
|
||||
delete[] m_Data;
|
||||
m_Data = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void CFileLoad::Load(char *strFilename)
|
||||
{
|
||||
strcpy(m_strFilename,strFilename);
|
||||
|
||||
m_Data=0;
|
||||
m_Len=0;
|
||||
|
||||
FILE *fp=fopen(strFilename,"rb");
|
||||
|
||||
if(fp)
|
||||
{
|
||||
fseek(fp,0L,SEEK_END);
|
||||
m_Len=ftell(fp);
|
||||
if(m_Len)
|
||||
{
|
||||
fseek(fp,0L,SEEK_SET);
|
||||
m_Data=(void*)new unsigned char[m_Len];
|
||||
if(m_Data)
|
||||
{
|
||||
int r=fread(m_Data,m_Len,1,fp);
|
||||
if(!r)
|
||||
{
|
||||
if(m_Data) {
|
||||
delete[] m_Data;
|
||||
m_Data=NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
fclose(fp);
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox(NULL,strFilename,0,0);
|
||||
}
|
||||
m_ReadLoc=(char*)m_Data;
|
||||
m_ReadLen=m_Len;
|
||||
}
|
||||
|
||||
void CFileLoad::GetData(void *pData, size_t size)
|
||||
{
|
||||
memcpy(pData,m_ReadLoc,size);
|
||||
m_ReadLoc+=size;
|
||||
}
|
||||
Reference in New Issue
Block a user