Restructure repository to include all source folders
Move git root from Client/ to src/ to track all source code: - Client: Game client source (moved to Client/Client/) - Server: Game server source - GameTools: Development tools - CryptoSource: Encryption utilities - database: Database scripts - Script: Game scripts - rylCoder_16.02.2008_src: Legacy coder tools - GMFont, Game: Additional resources 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
197
GameTools/CaldronBase/Caldron.h
Normal file
197
GameTools/CaldronBase/Caldron.h
Normal file
@@ -0,0 +1,197 @@
|
||||
/* *********************************************************************
|
||||
|
||||
* Caldron Engine <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
* <20><><EFBFBD><EFBFBD> : Caldron.h
|
||||
* <20><><EFBFBD><EFBFBD> : Caldron Engine <20><> <20>̿<EFBFBD><CCBF>ϴ°<CFB4><C2B0><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϰԵǴ<D4B5> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
* <20>ۼ<EFBFBD><DBBC><EFBFBD>: 2003.10.23
|
||||
* <20>ۼ<EFBFBD><DBBC><EFBFBD>: yundi ( 2003.10.23)
|
||||
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:
|
||||
|
||||
********************************************************************** */
|
||||
|
||||
#pragma once
|
||||
#pragma warning(disable:4786)
|
||||
#pragma warning(disable:4251)
|
||||
#pragma warning(disable:4503)
|
||||
|
||||
#include <algorithm>
|
||||
//#include <d3d9.h>
|
||||
#include <d3dx8.h>
|
||||
#include <tchar.h>
|
||||
#include <vector>
|
||||
#include <queue>
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <list>
|
||||
#include <math.h>
|
||||
#include <process.h>
|
||||
#include <mmsystem.h>
|
||||
#include <windows.h>
|
||||
|
||||
namespace Caldron
|
||||
{
|
||||
// epsilon <20><><EFBFBD><EFBFBD>
|
||||
extern const float MIN_EPSILON;
|
||||
extern const float MAX_EPSILON;
|
||||
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
const float FLOAT_RAD = 0.0174532925f; // radian <20><>
|
||||
extern const float FLOAT_PI; // pi
|
||||
extern const float FLOAT_2PI;
|
||||
|
||||
extern const int MAX_STRINGSIZE;
|
||||
const int MAX_RELOADING = 3; // Resource Loader <20><><EFBFBD><EFBFBD> Object <20>ε<EFBFBD> <20><><EFBFBD>н<EFBFBD> <20>ִ<EFBFBD> Reloading <20>õ<EFBFBD> Ƚ<><C8BD>
|
||||
|
||||
#define FLOAT_TO_INT(fValue) (*(int *)&(fValue))
|
||||
#define IS_SIGNBIT(fValue) (FLOAT_TO_INT(fValue) & 0x80000000)
|
||||
|
||||
|
||||
// template function <20><><EFBFBD><EFBFBD>
|
||||
template<class _T>
|
||||
inline void SafeDelete( _T ptr )
|
||||
{
|
||||
if( NULL != ptr )
|
||||
{
|
||||
delete (ptr);
|
||||
ptr = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
template<class _T>
|
||||
inline void SafeDeleteA( _T ptr )
|
||||
{
|
||||
if( NULL != ptr )
|
||||
{
|
||||
delete[] (ptr);
|
||||
ptr = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
template<class _T>
|
||||
inline void SafeRelease( _T ptr )
|
||||
{
|
||||
if( NULL != ptr )
|
||||
{
|
||||
ptr->Release();
|
||||
ptr = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
inline bool Succeeded( HRESULT hr )
|
||||
{
|
||||
return (hr >= 0);
|
||||
}
|
||||
|
||||
inline bool Failed( HRESULT hr )
|
||||
{
|
||||
return (hr < 0);
|
||||
}
|
||||
|
||||
inline bool IsZero(float fValue)
|
||||
{
|
||||
if((fValue > -(MIN_EPSILON)) && (fValue < MIN_EPSILON))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
inline float Def2Rad( float fDeg )
|
||||
{
|
||||
return fDeg*FLOAT_PI/180;
|
||||
}
|
||||
|
||||
// CProfileMgr <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
inline void ProfileGetTicks(_int64 * ticks)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push edx;
|
||||
push ecx;
|
||||
mov ecx,ticks;
|
||||
_emit 0Fh
|
||||
_emit 31h
|
||||
mov [ecx],eax;
|
||||
mov [ecx+4],edx;
|
||||
pop ecx;
|
||||
pop edx;
|
||||
}
|
||||
}
|
||||
|
||||
inline float ProfileGetTickRate(void)
|
||||
{
|
||||
static float _CPUFrequency = -1.0f;
|
||||
|
||||
if (_CPUFrequency == -1.0f) {
|
||||
__int64 curr_rate = 0;
|
||||
::QueryPerformanceFrequency ((LARGE_INTEGER *)&curr_rate);
|
||||
_CPUFrequency = (float)curr_rate;
|
||||
}
|
||||
|
||||
return _CPUFrequency;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//
|
||||
|
||||
/* *********************************************************************
|
||||
|
||||
* CBitset
|
||||
* <20><><EFBFBD><EFBFBD> : Bitset.h
|
||||
* <20><><EFBFBD><EFBFBD> : Caldron Engine<6E><65> Bitset Class
|
||||
* <20>ۼ<EFBFBD><DBBC><EFBFBD> : 2003.10.24
|
||||
* History : wizardbug ( 2003.10.24)
|
||||
|
||||
********************************************************************** */
|
||||
|
||||
class CBitset {
|
||||
protected:
|
||||
|
||||
unsigned int *m_pBits; // Bit Set ptr
|
||||
int m_iBitSize; // Bit Set Size
|
||||
|
||||
public:
|
||||
CBitset() {
|
||||
m_pBits = NULL;
|
||||
m_iBitSize = 0;
|
||||
}
|
||||
~CBitset() {
|
||||
if(m_pBits)
|
||||
{
|
||||
delete[] m_pBits;
|
||||
m_pBits = NULL;
|
||||
}
|
||||
}
|
||||
void ResizeBits(int iNewCount) {
|
||||
|
||||
m_iBitSize = iNewCount / 32 + 1; // Get Inteager Size
|
||||
if(m_pBits) {
|
||||
delete[] m_pBits;
|
||||
m_pBits = NULL;
|
||||
}
|
||||
m_pBits = new unsigned int[m_iBitSize]; // Allocate Bits
|
||||
ClearBits();
|
||||
|
||||
}
|
||||
void ClearBits() { // Clear All Bits
|
||||
memset(m_pBits,0,sizeof(unsigned int) * m_iBitSize);
|
||||
|
||||
}
|
||||
void ClearOneBit(int index) {
|
||||
|
||||
m_pBits[ index >> 5 ] &= ~( 1 << ( index & 31 ) );
|
||||
}
|
||||
void SetBit(int index) { // Set Bit
|
||||
m_pBits[ index >> 5 ] |= ( 1 << ( index & 31 ) );
|
||||
|
||||
}
|
||||
bool GetBit(int index) { // Return Bit's Setting : return true or false
|
||||
|
||||
return (m_pBits[ index >> 5 ] & ( 1 << (index & 31 ) )) ? true : false;
|
||||
|
||||
}
|
||||
};
|
||||
/********************************************************************** */
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user