Initial full mirror of c:\VWE (source + assets + toolchain + outputs) via Git LFS

Complete disaster-recovery snapshot: engine/game source, game data assets,
VC6 toolchain + DX SDKs, build outputs, deployed game, and _UNUSED archive.
Large binaries in Git LFS; text preserved byte-for-byte (core.autocrlf=false,
no eol attributes). See RECOVERY.md for the one-clone rebuild procedure.
This commit is contained in:
Cyd
2026-06-24 21:28:16 -05:00
commit 2b8ca921cb
66341 changed files with 7923174 additions and 0 deletions
@@ -0,0 +1,906 @@
#if !defined(__ARRAY__)
#define __ARRAY__
//{{NO_DEPENDENCIES}}
//
// Array Templates
//
#pragma warning(disable: 4786)
#ifndef NULL_CLASS_DEFINED
#define NULL_CLASS_DEFINED
class CNullClass {};
#endif
#define TARRAY(TYPE) TArray<TYPE, CNullClass> // TARRAY(int) - none/none
#define TARRAYREF(TYPE) TArrayDynamic<TYPE, TConNCon<TYPE>, TDesNDes<TYPE>, CNullClass> // TARRAYREF(CStr) - constructor/destructor
#define TARRAYPTR(TYPE) TArrayDynamic<TYPE, TConNFZ<TYPE>, TDesNDEL<TYPE>, CNullClass> // TARRAYREF(CStr*) - new/delete
#define TARRAYPTR2(TYPE) TArrayDynamic<TYPE, TConNFZ<TYPE>, TDesNDEL2<TYPE>, CNullClass> // // TARRAYREF(char*) - malloc/free
#define TARRAYSIMPLE(TYPE) TArraySimple<TYPE, CNullClass> // TARRAYSIMPLE(int), TARRAYZERO(float)
// above class definition
#define DECLARE_TARRAYREF_EX(CClass) inline void* _cdecl operator new(size_t nSize, CClass* pData) { return (void*)pData; } inline void _cdecl operator delete(void* p, CClass* pData) { }
#define DECLARE_TARRAYREF(CClass) class CClass; DECLARE_TARRAYREF_EX(CClass);
#define DECLARE_TARRAYREF_CLASS_EX(CClass, BaseClass) DECLARE_TARRAYREF(CClass) class CClass : public BaseClass { public: CClass() {} ~CClass() {} };
#define DECLARE_TARRAYREF_CLASS(Class,TYPE) DECLARE_TARRAYREF_CLASS_EX(Class, TARRAYREF(TYPE))
// in class definition
#define DECLARE_STATIC_CONSTRUCTION(CClass) inline void new##CClass() { new (this) CClass; } inline void delete##CClass() { this-> ~CClass(); }
template <class TYPE> inline void SwapValue(TYPE& a, TYPE& b)
{
a ^= b;
b ^= a;
a ^= b;
}
template <class TYPE> inline void SwapPointer(TYPE*& a, TYPE*& b)
{
TYPE* p;
p = a;
a = b;
b = p;
}
/*
All the structures starting with TCon are the Template-Constructor.
TCon1XXXX means the constructor for 1 element.
TConNXXXX means the constructor for arbitrary number of elements.
All the structures starting with TDes are the Template-Destructor.
*/
template <class TYPE>
struct TCon1None
{
// constructor: do NOTHING
static void Construct(TYPE* pData)
{
ASSERT(pData);
}
};
template <class TYPE>
struct TCon1Con
{
// constructor: call the constructor...
static void Construct(TYPE* pData)
{
ASSERT(pData);
new (pData) TYPE;
}
};
template <class TYPE>
struct TCon1AZ
{
// constructor: assign zero.
static void Construct(TYPE* pData)
{
ASSERT(pData);
*pData = 0;
}
};
template <class TYPE>
struct TCon1FZ
{
// constructor: fill with zero
static void Construct(TYPE* pData)
{
ASSERT(pData);
memset(pData, 0, sizeof(TYPE));
}
};
template <class TYPE>
struct TConNNone
{
// constructor: do NOTHING
static void Construct(TYPE* pData, int nCount)
{
ASSERT((nCount >= 0) && (pData || (nCount == 0)));
}
};
template <class TYPE>
struct TConNCon : public TCon1Con<TYPE>
{
// constructor: call the constructor
static void Construct(TYPE* pData, int nCount)
{
ASSERT((nCount >= 0) && (pData || (nCount == 0)));
while(nCount-- > 0) {
TCon1Con<TYPE>::Construct(pData++);
}
}
};
template <class TYPE>
struct TConNAZ : public TCon1AZ<TYPE>
{
// constructor: assign zero
static void Construct(TYPE* pData, int nCount)
{
ASSERT((nCount >= 0) && (pData || (nCount == 0)));
while(nCount-- > 0) {
TCon1AZ<TYPE>::Construct(pData++);
}
}
};
template <class TYPE>
struct TConNFZ
{
// constructor: fill with zero
static void Construct(TYPE* pData, int nCount)
{
ASSERT((nCount >= 0) && (pData || (nCount == 0)));
if (nCount > 0) {
memset(pData, 0, sizeof(TYPE) * nCount);
}
}
};
template <class TYPE>
struct TDes1None
{
// destructor: do NOTHING
static void Destruct(TYPE* pData)
{
ASSERT(pData);
}
};
template <class TYPE>
struct TDes1Des
{
// destructor: call the destructor
static void Destruct(TYPE* pData)
{
ASSERT(pData);
pData-> ~TYPE();
}
};
template <class TYPE>
struct TDes1AZ
{
// destructor: assign zero
static void Destruct(TYPE* pData)
{
ASSERT(pData);
*pData = 0;
}
};
template <class TYPE>
struct TDes1FZ
{
// destructor: fill with zero
static void Destruct(TYPE* pData)
{
ASSERT(pData);
memset(pData, 0, sizeof(TYPE));
}
};
template <class TYPE>
struct TDesNNone
{
// destructor: do NOTHING
static void Destruct(TYPE* pData, int nCount)
{
ASSERT((nCount >= 0) && (pData || (nCount == 0)));
}
};
template <class TYPE>
struct TDesNDes : public TDes1Des<TYPE>
{
// destructor: call the destructor
static void Destruct(TYPE* pData, int nCount)
{
ASSERT((nCount >= 0) && (pData || (nCount == 0)));
while(nCount-- > 0) {
TDes1Des<TYPE>::Destruct(pData++);
}
}
};
template <class TYPE>
struct TDesNAZ : public TDes1AZ<TYPE>
{
// destructor: assign zero
static void Destruct(TYPE* pData, int nCount)
{
ASSERT((nCount >= 0) && (pData || (nCount == 0)));
while(nCount-- > 0) {
TDes1AZ<TYPE>::Destruct(pData++);
}
}
};
template <class TYPE>
struct TDesNFZ
{
// destructor: fill with zero
static void Destruct(TYPE* pData, int nCount)
{
ASSERT((nCount >= 0) && (pData || (nCount == 0)));
if (nCount > 0) {
memset(pData, 0, sizeof(TYPE) * nCount);
}
}
};
template <class TYPE>
struct TDesNDEL
{
// destructor: fill with zero
static void Destruct(TYPE* pData, int nCount)
{
ASSERT((nCount >= 0) && (pData || (nCount == 0)));
while(nCount-- > 0) {
TYPE t = *pData++;
if (t)
delete t;
}
}
};
template <class TYPE>
struct TDesNDEL2
{
// destructor: fill with zero
static void Destruct(TYPE* pData, int nCount)
{
ASSERT((nCount >= 0) && (pData || (nCount == 0)));
while(nCount-- > 0) {
TYPE t = *pData++;
if (t)
delete [] t;
}
}
};
template <class TYPE, class BaseClass>
class TArray : public BaseClass
{
/*
This class is the classical array implementation.
*/
public:
typedef TYPE Type;
public: // This may should be protected or private, but...
TYPE* m_pData; // Data Type Pointer - classic data array pointer
int m_nSize; // Exact Array Size - size of array being used
protected:
int m_nGrowBy; // Number used to determine the allocate unit.
private:
int m_nSizeMax; // Allocated Array Size - It could be modified by SetGrowBy()... - size of array allocated (memory allocation)
public: // Construction & Desturction
TArray()
{
// as is...
m_pData = NULL;
m_nSize = m_nSizeMax = 0;
m_nGrowBy = 100;
}
~TArray()
{
// as is...
Reset();
}
void RemoveAll()
{
// remove all the elements, and free all the memory used.
// but no destruction of object-itself.
// IMPORTANT: don't call this method, when constructor/destructor should be called.
if (m_pData) {
ASSERT(m_nSizeMax > 0);
free(m_pData);
m_pData = NULL;
m_nSize = m_nSizeMax = 0;
} else {
ASSERT((m_nSize == 0) && (m_nSizeMax == 0));
}
}
void Reset()
{
// same with RemoveAll
RemoveAll();
}
void Swap(TArray<TYPE, BaseClass>& that)
{
SwapPointer(m_pData, that.m_pData);
SwapValue(m_nSize, that.m_nSize);
SwapValue(m_nGrowBy, that.m_nGrowBy);
SwapValue(m_nSizeMax, that.m_nSizeMax);
}
BOOL IsEqual(const TArray<TYPE, BaseClass>& that) const
{
int nSize = m_nSize;
if (nSize == that.m_nSize) {
if (nSize > 0) {
if (memcmp(m_pData, that.m_pData, nSize * sizeof(TYPE)) == 0) {
return TRUE;
}
} else {
return TRUE;
}
}
return FALSE;
}
BOOL operator == (const TArray<TYPE, BaseClass>& that) const
{
return IsEqual(that);
}
BOOL operator != (const TArray<TYPE, BaseClass>& that) const
{
return !IsEqual(that);
}
void SetAllValue(const TYPE one)
{
int i, nSize = m_nSize;
TYPE* pDest = m_pData;
for(i = 0; i < nSize; i++) {
*pDest = one;
pDest++;
}
}
void SetAll(const TYPE& one)
{
int i, nSize = m_nSize;
TYPE* pDest = m_pData;
for(i = 0; i < nSize; i++) {
*pDest = one;
pDest++;
}
}
int SetGrowBy(int nGrowBy)
{
ASSERT(nGrowBy >= 0);
// swap m_nGrowBy with nGrowBy, and return nGrowBy(old value)...
SwapValue(m_nGrowBy, nGrowBy);
return nGrowBy;
}
int GetSize() const
{
// as is...
return m_nSize;
}
void SetSize(int nSize)
{
ASSERT(nSize >= 0);
int nDiff = nSize - m_nSize;
if (nDiff != 0) {
if (nDiff < 0) {
// shrink
Del(m_nSize + nDiff, -nDiff);
} else {
// grow
Add(nDiff);
}
}
}
void ResetSize(int nSize)
{
Reset();
SetSize(nSize);
}
TYPE At(int nIndex) const // return data
{
// used to retrive values(as like char, int, long...)
// usually this method used retrieve small(accuping 1 or 2 CPU register) objects
ASSERT((0 <= nIndex) && (nIndex < m_nSize));
return m_pData[nIndex];
}
TYPE& GetAt(int nIndex) const // return reference to data
{
// used to retrive structures(as like POINT, RECT, MSG...)
// usually this method used retrieve large(accuping 2 or more CPU registers) objects
ASSERT(0 <= nIndex); // (nIndex < m_nSize) - used as pointer?
return m_pData[nIndex];
}
TYPE& operator [] (int nIndex) const // return reference to data
{
// same with "TYPE& GetAt(int nIndex) const"
ASSERT(0 <= nIndex); // (nIndex < m_nSize) - used as pointer?
return m_pData[nIndex];
}
int Find(TYPE data) const
{
int i, nSize = m_nSize;
TYPE* pData = m_pData;
for(i = 0; i < nSize; i++) {
if (*pData == data)
return i;
pData++;
}
return -1;
}
TYPE& Add(int nRoom = 1) // return reference to the first slot added
{
// add nRoom element(s), and return its starting memory reference...
ASSERT(nRoom > 0);
TYPE* pData = m_pData;
nRoom += m_nSize;
if (nRoom > m_nSizeMax) { // insufficient slot. grow array
int nSizeMax = nRoom + m_nGrowBy;
if (pData) {
pData = (TYPE*)realloc(pData, sizeof(TYPE) * nSizeMax);
} else {
pData = (TYPE*)malloc(sizeof(TYPE) * nSizeMax);
}
#if 0
if (!pData)
return *(TYPE*)NULL;
#endif
m_pData = pData;
m_nSizeMax = nSizeMax;
}
pData = &m_pData[m_nSize]; // point to the first slot added
m_nSize = nRoom;
return *pData;
}
TYPE& Ins(int nIndex, int nRoom = 1) // return reference to the first slot inserted
{
// insert nRoom element(s) before nIndex, and return its starting memory reference...
ASSERT(nRoom > 0);
ASSERT((0 <= nIndex) && (nIndex <= m_nSize));
int nSize = m_nSize - nIndex; // number of array to move
TYPE* pData = &Add(nRoom);
if (nSize) {
int nCount = nSize * sizeof(TYPE);
TYPE* pDataSrc = (TYPE*)((char*)pData - nCount);
memmove(&pDataSrc[nRoom], pDataSrc, nCount);
return *pDataSrc;
}
return *pData;
}
void FreeExtra()
{
// used to free extra memories(make m_nSizeMax same with m_nSize)...
if (m_pData) {
if (m_nSize) {
// realloc to smaller size: always successive.
m_pData = (TYPE*)realloc(m_pData, sizeof(TYPE) * m_nSize);
} else {
free(m_pData);
m_pData = NULL;
}
m_nSizeMax = m_nSize;
} else {
ASSERT(m_nSize == 0); // (m_nSizeMax == 0)
}
}
void Del(int nIndex, int nCount = 1)
{
// delete nCount element(s) where nIndex...
ASSERT(nCount > 0);
ASSERT((0 <= nIndex) && (nIndex <= m_nSize));
int nSize = m_nSize;
if (nIndex < nSize) {
ASSERT(nIndex + nCount <= nSize);
TYPE* pDataDst = &m_pData[nIndex];
nIndex += nCount;
int nMove = nSize - nIndex;
if (nMove) {
memcpy(pDataDst, &pDataDst[nCount], nMove * sizeof(TYPE));
}
m_nSize = nSize - nCount;
} else {
TRACE("TArray::Del() : deletion at the out of bound\n");
ASSERT(nIndex == nSize);
}
}
int DelFind(TYPE data)
{
int nIndex = Find(data);
if (0 <= nIndex) {
Del(nIndex);
}
return nIndex;
}
void Append(const TArray<TYPE, BaseClass>& that)
{
// append array...
int nSize = that.m_nSize;
if (nSize > 0) {
memcpy(&Add(nSize), that.m_pData, nSize * sizeof(TYPE));
}
}
void Assign(const TArray<TYPE, BaseClass>& that)
{
// append array...
int nSize = that.m_nSize;
SetSize(nSize);
if (nSize > 0) {
memcpy(m_pData, that.m_pData, nSize * sizeof(TYPE));
}
}
TArray<TYPE, BaseClass>& operator = (const TArray<TYPE, BaseClass>& that)
{
Assign(that);
return *this;
}
void operator *= (const TArray<TYPE, BaseClass>& that)
{
int nSize = m_nSize;
ASSERT(nSize > 0);
ASSERT(nSize == that.GetSize());
TYPE* pStart = m_pData;
TYPE* pEnd = &pStart[nSize];
const TYPE* pSrc = that.m_pData;
while(pStart < pEnd) {
*pStart *= *pSrc;
pSrc++;
pStart++;
}
}
void operator /= (const TArray<TYPE, BaseClass>& that)
{
int nSize = m_nSize;
ASSERT(nSize > 0);
ASSERT(nSize == that.GetSize());
TYPE* pStart = m_pData;
TYPE* pEnd = &pStart[nSize];
const TYPE* pSrc = that.m_pData;
while(pStart < pEnd) {
*pStart /= *pSrc;
pSrc++;
pStart++;
}
}
void operator += (const TArray<TYPE, BaseClass>& that)
{
int nSize = m_nSize;
ASSERT(nSize > 0);
ASSERT(nSize == that.GetSize());
TYPE* pStart = m_pData;
TYPE* pEnd = &pStart[nSize];
const TYPE* pSrc = that.m_pData;
while(pStart < pEnd) {
*pStart += *pSrc;
pSrc++;
pStart++;
}
}
void operator -= (const TArray<TYPE, BaseClass>& that)
{
int nSize = m_nSize;
ASSERT(nSize > 0);
ASSERT(nSize == that.GetSize());
TYPE* pStart = m_pData;
TYPE* pEnd = &pStart[nSize];
const TYPE* pSrc = that.m_pData;
while(pStart < pEnd) {
*pStart -= *pSrc;
pSrc++;
pStart++;
}
}
void operator *= (TYPE tValue)
{
int nSize = m_nSize;
ASSERT(nSize > 0);
TYPE* pStart = m_pData;
TYPE* pEnd = &pStart[nSize];
while(pStart < pEnd) {
*pStart *= tValue;
pStart++;
}
}
void operator /= (TYPE tValue)
{
ASSERT(tValue != 0);
int nSize = m_nSize;
ASSERT(nSize > 0);
TYPE* pStart = m_pData;
TYPE* pEnd = &pStart[nSize];
while(pStart < pEnd) {
*pStart /= tValue;
pStart++;
}
}
void operator += (TYPE tValue)
{
int nSize = m_nSize;
ASSERT(nSize > 0);
TYPE* pStart = m_pData;
TYPE* pEnd = &pStart[nSize];
while(pStart < pEnd) {
*pStart += tValue;
pStart++;
}
}
void operator -= (TYPE tValue)
{
int nSize = m_nSize;
ASSERT(nSize > 0);
TYPE* pStart = m_pData;
TYPE* pEnd = &pStart[nSize];
while(pStart < pEnd) {
*pStart -= tValue;
pStart++;
}
}
};
template <class TYPE, class CON, class DES, class BaseClass>
class TArrayDynamic : public TArray<TYPE, BaseClass>
{
/*
This class is used to call constructor or destructor when enlarged or reduced.
CON: constructor template(TConNNone, TConNCon, TConNAZ, TConNFZ)
DES: destructor template(TDesNNone, TDesNCon, TDesNAZ, TDesNFZ)
*/
public:
~TArrayDynamic()
{
Reset();
}
void ConstructAll()
{
CON::Construct(m_pData, m_nSize);
}
void DestructAll()
{
DES::Destruct(m_pData, m_nSize);
}
void Reset()
{
// call the specified destructor(see DES)
DES::Destruct(m_pData, m_nSize);
TArray<TYPE, BaseClass>::Reset();
}
BOOL IsEqual(const TArrayDynamic<TYPE, CON, DES, BaseClass>& that) const
{
int nSize = m_nSize;
if (nSize == that.m_nSize) {
if (nSize > 0) {
const TYPE* pDest = m_pData;
const TYPE* pSrc = that.m_pData;
for(int i = 0; i < nSize; i++) {
if (!(*pDest == *pSrc)) {
return FALSE;
}
pDest++;
pSrc++;
}
}
return TRUE;
}
return FALSE;
}
BOOL operator == (const TArrayDynamic<TYPE, CON, DES, BaseClass>& that) const
{
return IsEqual(that);
}
BOOL operator != (const TArrayDynamic<TYPE, CON, DES, BaseClass>& that) const
{
return !IsEqual(that);
}
void SetSize(int nSize)
{
ASSERT(nSize >= 0);
int nDiff = nSize - m_nSize;
if (nDiff != 0) {
if (nDiff < 0) {
// shrink
Del(m_nSize + nDiff, -nDiff);
} else {
// grow
Add(nDiff);
}
}
}
void ResetSize(int nSize)
{
Reset();
SetSize(nSize);
}
TYPE& Add(int nRoom = 1)
{
ASSERT(nRoom >= 0);
TYPE* pData;
if (nRoom) {
pData = &TArray<TYPE, BaseClass>::Add(nRoom);
CON::Construct(pData, nRoom);
} else {
pData = NULL;
}
return *pData;
}
TYPE& Ins(int nIndex, int nRoom = 1)
{
ASSERT((0 <= nIndex) && (nIndex <= m_nSize) && (nRoom >= 0));
TYPE* pData;
if (nRoom) {
pData = &TArray<TYPE, BaseClass>::Ins(nIndex, nRoom);
CON::Construct(pData, nRoom);
} else {
pData = NULL;
}
return *pData;
}
void Del(int nIndex, int nCount = 1)
{
ASSERT(nCount > 0);
ASSERT((0 <= nIndex) && (nIndex < m_nSize));
TYPE* pData = &m_pData[nIndex];
DES::Destruct(pData, nCount);
TArray<TYPE, BaseClass>::Del(nIndex, nCount);
}
int DelFind(TYPE data)
{
int nIndex = Find(data);
if (0 <= nIndex) {
Del(nIndex);
}
return nIndex;
}
void Append(const TArrayDynamic<TYPE, CON, DES, BaseClass>& that)
{
// append array...
int nSize = that.m_nSize;
TYPE* pDest = &Add(nSize);
const TYPE* pSrc = that.m_pData;
for(int i = 0; i < nSize; i++) {
*pDest = *pSrc;
pDest++;
pSrc++;
}
}
void Assign(const TArrayDynamic<TYPE, CON, DES, BaseClass>& that)
{
// append array...
int nSize = that.m_nSize;
SetSize(nSize);
TYPE* pDest = m_pData;
const TYPE* pSrc = that.m_pData;
for(int i = 0; i < nSize; i++) {
*pDest = *pSrc;
pDest++;
pSrc++;
}
}
TArrayDynamic<TYPE, CON, DES, BaseClass>& operator = (const TArrayDynamic<TYPE, CON, DES, BaseClass>& that)
{
Assign(that);
return *this;
}
};
template <class TYPE, class BaseClass>
class TArraySimple : public TArrayDynamic<TYPE, TConNFZ<TYPE>, TDesNNone<TYPE>, BaseClass>
{
public:
BOOL IsEqual(const TArraySimple<TYPE, BaseClass>& that) const
{
return TArray<TYPE, BaseClass>::IsEqual(that);
}
BOOL operator == (const TArraySimple<TYPE, BaseClass>& that) const
{
return TArray<TYPE, BaseClass>::IsEqual(that);
}
BOOL operator != (const TArraySimple<TYPE, BaseClass>& that) const
{
return !TArray<TYPE, BaseClass>::IsEqual(that);
}
void Append(const TArraySimple<TYPE, BaseClass>& that)
{
// append array...
int nSize = that.m_nSize;
if (nSize > 0) {
memcpy(&TArray<TYPE, BaseClass>::Add(nSize), that.m_pData, nSize * sizeof(TYPE));
}
}
void Assign(const TArraySimple<TYPE, BaseClass>& that)
{
// append array...
int nSize = that.m_nSize;
TArray<TYPE, BaseClass>::SetSize(nSize);
if (nSize > 0) {
memcpy(m_pData, that.m_pData, nSize * sizeof(TYPE));
}
}
TArraySimple<TYPE, BaseClass>& operator = (const TArraySimple<TYPE, BaseClass>& that)
{
Assign(that);
return *this;
}
};
#endif // !defined(__ARRAY__)
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,197 @@
#if !defined(__CStr__)
#define __CStr__
// include: cstr.h, stdarg.h
#if !defined(CHAR)
#define CHAR char
#endif // !defined(CHAR)
#if !defined(USE_STRLOCK)
#define USE_STRLOCK
#endif // !defined(USE_STRLOCK)
#if !defined(__QSortCompareProc_DEFINED__)
typedef int (__cdecl* QSortCompareProc)(const void* elem1, const void* elem2);
#define __QSortCompareProc_DEFINED__
#endif // !defined(__QSortCompareProc_DEFINED__)
int __cdecl str_memcmp(const void* elem1, const void* elem2);
#if !defined(WIN32)
#define lstrcmp strcmp
#define lstrcmpi strcasecmp
char* _strupr(char *string);
char* _strlwr(char *string);
#endif // !defined(WIN32)
int __cdecl str_Compare(const void* elem1, const void* elem2);
int __cdecl str_CompareReverse(const void* elem1, const void* elem2);
int __cdecl str_CompareIC(const void* elem1, const void* elem2);
int __cdecl str_CompareICReverse(const void* elem1, const void* elem2);
DECLARE_TARRAYREF(CStr);
class CStr
{
private:
CHAR* m_psz;
// all data in this section must be INITIALIZED!!!!!!!!!!!!!
public:
CStr();
CStr(const CHAR* pcsz);
CStr(const CHAR* pcsz, int nLen);
CStr(CHAR c, int nLen);
CStr(const CStr& that);
private:
CStr(int nMax);
public:
~CStr();
public:
operator const CHAR* () const { return m_psz; }
CHAR* GetRawBuffer() const { return m_psz; } // be very cautious!!!!
int GetLength() const { return strlen(m_psz); }
BOOL IsEmpty() const { return m_psz[0] == '\0'; }
const CHAR* String() const { return m_psz; }
const CHAR* Empty();
void Swap(CStr& that);
#ifdef USE_STRLOCK
WORD IsLocked() const;
CHAR* LockBuffer();
WORD UnlockBuffer();
#endif // USE_STRLOCK
#ifndef _DEBUG
#define CheckRange(nIndex)
#else // _DEBUG
void CheckRange(int nIndex) const
{
ASSERT((0 <= nIndex) && (nIndex <= lstrlen(m_psz)));
}
#endif // !_DEBUG
CHAR operator () (int nIndex) const { CheckRange(nIndex); return m_psz[nIndex]; }
const CHAR& operator [] (int nIndex) const { CheckRange(nIndex); return m_psz[nIndex]; }
CHAR& operator [] (int nIndex) { CheckRange(nIndex); return m_psz[nIndex]; }
CHAR GetAt(int nIndex) const { CheckRange(nIndex); return m_psz[nIndex]; }
void SetAt(int nIndex, CHAR c) { CheckRange(nIndex); m_psz[nIndex] = c; }
#ifndef _DEBUG
#undef CheckRange
#endif // !_DEBUG
const CHAR* Assign(const CHAR* pcsz, int nLen = -1);
CStr& operator = (const CHAR* pcsz) { Assign(pcsz); return *this; }
CStr& operator = (const CStr& that) { Assign(that.m_psz); return *this; }
BOOL operator == (const CHAR* pcsz) const { return pcsz ? strcmp(m_psz, pcsz) == 0: m_psz[0] == '\0'; }
BOOL operator != (const CHAR* pcsz) const { return pcsz ? strcmp(m_psz, pcsz) != 0: m_psz[0] != '\0'; }
BOOL operator > (const CHAR* pcsz) const { return pcsz ? strcmp(m_psz, pcsz) > 0: m_psz[0] != '\0'; }
BOOL operator >= (const CHAR* pcsz) const { return pcsz ? strcmp(m_psz, pcsz) >= 0: TRUE; }
BOOL operator < (const CHAR* pcsz) const { return pcsz ? strcmp(m_psz, pcsz) < 0: FALSE; }
BOOL operator <= (const CHAR* pcsz) const { return pcsz ? strcmp(m_psz, pcsz) <= 0: m_psz[0] == '\0'; }
CStr operator + (const CHAR* pcsz) const;
CStr& operator += (const CHAR* pcsz);
CStr operator + (CHAR c) const;
CStr& operator += (CHAR c);
void MakeUpper() { _strupr(m_psz); }
void MakeLower() { _strlwr(m_psz); }
void MakeReverse();
const CHAR* Prune(const CHAR* pcszDELs = NULL);
const CHAR* TrimLeft();
const CHAR* TrimRight();
const CHAR* TrimAll();
void __cdecl Format(LPCTSTR lpszFormat, ...);
void vFormat(LPCTSTR lpszFormat, va_list marker);
CHAR* GetBuffer(int nLen);
const CHAR* ReleaseBuffer(int nLen = -1);
CHAR* GetBufferSetLength(int nLen);
void ChangeChars(CHAR cBefore, CHAR cAfter);
BOOL AsDirectory(BOOL bRemoveLastDEL = FALSE);
BOOL AddDirDEL();
int FindExtPos() const;
const char* FindExt() const;
BOOL ChangeExt(const char* pcszExt, BOOL bForce = TRUE);
const CHAR* Left(CStr& strLeft, int nCount) const;
const CHAR* Right(CStr& strRight, int nCount) const;
const CHAR* Mid(CStr& strMid, int nFirst) const;
const CHAR* Mid(CStr& strMid, int nFirst, int nCount) const;
CStr Left(int nCount) const;
CStr Right(int nCount) const;
CStr Mid(int nFirst) const;
CStr Mid(int nFirst, int nCount) const;
int FindNext(CHAR c, int nStart) const;
int Find(CHAR c) const;
int rFindNext(CHAR c, int nStart) const;
int rFind(CHAR c) const;
int Find(const CHAR* pcsz, int nStart) const;
int Find(const CHAR* pcsz) const;
int FindSet(const CHAR* pcszSet) const;
int rFindSet(const CHAR* pcszSet) const;
#if defined(WIN32)
BOOL GetWindowText(HWND hWnd);
#endif // defined(WIN32)
protected:
const CHAR* AssignNoCheck(const CHAR* pcsz, int nLen = -1);
private:
CHAR* Reset();
#ifdef USE_STRLOCK
CHAR* ResetLocked();
#endif // USE_STRLOCK
};
#if !defined(USE_CSTR_ISTREAM) && defined(_INC_ISTREAM)
#define USE_CSTR_ISTREAM
#endif // !defined(USE_CSTR_ISTREAM) && defined(_INC_ISTREAM)
#if defined(NO_USE_CSTR_ISTREAM)
#undef USE_CSTR_ISTREAM
#endif // defined(NO_USE_CSTR_ISTREAM)
#ifdef USE_CSTR_ISTREAM
istream& operator >> (istream& s, CStr& str);
#endif // USE_CSTR_ISTREAM
#define LSTRS_TOLOWER 0x0001
#define LSTRS_TOUPPER 0x0002
#define LSTRS_ALLOWDUP 0x0004
#define LSTRS_DOSORT 0x0008
class CStrArray : public TARRAYREF(CStr)
{
public:
int GetTotalLength() const;
int Find(const char* pcsz) const;
int AddIfNotFound(const char* pcsz);
int AddIfNotFound(const CStr astrs[], int nCount);
void Sort(QSortCompareProc pQSortCompareProc = (QSortCompareProc)NULL);
BOOL LoadStrs(const char* pcszFile, const char* pcszVals = NULL, UINT uFlags = 0);
BOOL LoadStrs(FILE* pFile, const char* pcszVals = NULL, UINT uFlags = 0);
void LSTRS_CheckAdd(CStr& str, UINT uFlags);
};
#ifdef _DEBUG
#define ASSERT_VALIDSTRING(pcszStr) ASSERT(IsValidString(pcszStr))
#define ASSERT_VALIDSTRINGSAFE(pcszStr) ASSERT(IsValidStringSafe(pcszStr))
#define ASSERT_CLSPTR(p) ASSERT(IsValidMemory(p, sizeof(*p), TRUE))
BOOL IsValidString(const CHAR* pcszStr, int nLen = -1);
BOOL IsValidStringSafe(const CHAR* pcszStr, int nLen = -1);
BOOL IsValidMemory(const void* pMem, UINT uBytes, BOOL bWriteCheck = TRUE);
BOOL IsValidMemorySafe(const void* pMem, UINT uBytes, BOOL bWriteCheck = TRUE);
#else // !_DEBUG
#define ASSERT_VALIDSTRING(pcszStr)
#define ASSERT_VALIDSTRINGSAFE(pcszStr)
#define ASSERT_CLSPTR(p)
inline BOOL __RelIsValidAddr(const void* p, int nLen = -1) { &p, &nLen; return TRUE; }
#define IsValidString 1 ? 1: __RelIsValidAddr
#define IsValidStringSafe 1 ? 1: __RelIsValidAddr
#define IsValidMemory 1 ? 1: __RelIsValidAddr
#define IsValidMemorySafe 1 ? 1: __RelIsValidAddr
#endif // _DEBUG
#ifdef _DEBUG
void CStrTestMain();
#endif // _DEBUG
#endif // !defined(__CStr__)
@@ -0,0 +1,104 @@
#include"MW4AppHeaders.hpp"
#include<Windows.h>
//
//Do not use ….\EulaTest\\1.0 as the key for your game; use your game name and version instead…
// PLEASE NOTE: do not place backslashes on beginning or end of regkey.
//
#define GAME_REG_KEY "Software\\Microsoft\\Microsoft Games\\MechWarrior Vengeance"
typedef DWORD (*EBUPROC) (LPCTSTR lpRegKeyLocation, LPCTSTR lpEULAFileName, LPCSTR lpWarrantyFileName, BOOL fCheckForFirstRun);
//
//The game applications .RC file should define strings for the EULA and WARRANTY pathnames…
//
bool FirstRunEula(const char *eula_filename,const char *warranty_filename)
{
#if 1 // jcem
return true;
#else // jcem
EBUPROC pfnEBUEula;
HINSTANCE hMod;
hMod = LoadLibrary("Assets\\binaries\\EBUEula.dll");
if (NULL == hMod)
hMod = LoadLibrary("EBUEula.dll");
if (NULL == hMod) // cant attach to DLL
{
STOP(("Cannot Load EBUEula.dll"));
}
pfnEBUEula = (EBUPROC) GetProcAddress(hMod, "EBUEula");
if (NULL == pfnEBUEula) // cant find entry point
{
FreeLibrary(hMod);
STOP(("Cannot Find Entry Point to EBUEula.dll"));
}
//
//This call enables both EULA and warranty accepting/viewing/printing. If your
//game doesnt ship with a WARRANTY file, specifiy NULL instead of szWarranty…
//The code below, for instance, works with both OEM and retail builds…
//
const char *pszWarrantyParam = 0xFFFFFFFF != GetFileAttributes(warranty_filename) ? warranty_filename : NULL;
BOOL fAllowGameToRun = pfnEBUEula(GAME_REG_KEY, eula_filename, pszWarrantyParam, TRUE);
FreeLibrary(hMod);
return fAllowGameToRun?true:false;
#endif // jcem
}
bool EulaDeclineMsg(const char *str,const char *caption)
{
return IDOK==MessageBox(NULL,str,caption,MB_OKCANCEL);
}
bool ExecuteAndWait(const char *exename)
{
STARTUPINFO sinfo;
PROCESS_INFORMATION pinfo;
ZeroMemory(&sinfo,sizeof(sinfo));
sinfo.cb=sizeof(sinfo);
if(CreateProcess(exename,NULL,NULL,NULL,FALSE,NULL,NULL,NULL,&sinfo,&pinfo)==NULL) return false;
DWORD eflag;
do
{
if(GetExitCodeProcess(pinfo.hProcess,&eflag)==0) return false;
}
while(eflag==STILL_ACTIVE);
return true;
}
extern HWND hWindow;
extern void __stdcall EnterWindowMode();
extern void __stdcall EnterFullScreenMode();
bool WinMessageBox(const char *str,const char *msg,int mode)
{
bool res=false;
bool needflip=Environment.fullScreen;
if(needflip) gos_EnableSetting(gos_Set_MinMaxApp,0);
switch(mode)
{
case 0:
res=(IDRETRY==MessageBox(hWindow,msg,str,MB_RETRYCANCEL));
break;
case 1:
res=(IDOK==MessageBox(hWindow,msg,str,MB_OK));
break;
}
if(needflip) gos_EnableSetting(gos_Set_MinMaxApp,1);
return res;
}
@@ -0,0 +1,6 @@
#pragma once
bool FirstRunEula(const char *eula_filename,const char *warranty_filename);
bool EulaDeclineMsg(const char *str,const char *caption);
bool ExecuteAndWait(const char *exename);
bool WinMessageBox(const char *str,const char *msg,int mode=0);
@@ -0,0 +1,3 @@
#include "MW4AppHeaders.hpp"
// This file does nothing but make the pch file
@@ -0,0 +1,13 @@
#pragma once
// jcem
#define _WINSOCKAPI_ /* Prevent inclusion of winsock.h in windows.h */
#include <winsock2.h> // jcem winsock2.h <- winsock.h <- this will include windows.h
#include "MW4Application.hpp"
#include <MW4\MW4.hpp>
using namespace MechWarrior4;
using namespace Adept;
using namespace Stuff;
Binary file not shown.
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,18 @@
//===========================================================================//
// File: MW4Application.hpp //
//---------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ---------------------------------------------------------- //
// 08/25/97 JMA Infrastructure changes. //
// 08/25/97 ECH Infrastructure changes. //
// 08/27/98 BDB Made it MW4 //
//---------------------------------------------------------------------------//
// Copyright (C) 1995-97, Virtual World Entertainment, Inc. //
// All Rights reserved worldwide //
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL //
//===========================================================================//
#pragma once
extern void MW4Testall();
@@ -0,0 +1,217 @@
<html>
<body>
<pre>
<h1>Build Log</h1>
<h3>
--------------------Configuration: GameOS - Win32 Release--------------------
</h3>
<h3>Command Lines</h3>
Creating temporary file "C:\DOCUME~1\jeff\LOCALS~1\Temp\RSPA.tmp" with contents
[
/nologo /G6 /Gz /Zp4 /MD /W4 /GR /Oa /Og /Oi /Oy /Gy /I "..\..\Libraries" /I "..\..\..\CoreTech\Libraries" /I "..\GUN" /D "_WINDOWS" /D "NOMINMAX" /D "NDEBUG" /D "WIN32" /Fp"Release/GameOS.pch" /Yu"pch.hpp" /Fo"Release/" /Fd"Release/GameOS.pdb" /Zl /FD /GF /c
"C:\VWE\GameleapCode5_03\CoreTech\Libraries\GameOS\DXRasterizer.cpp"
]
Creating command line "cl.exe @C:\DOCUME~1\jeff\LOCALS~1\Temp\RSPA.tmp"
Creating temporary file "C:\DOCUME~1\jeff\LOCALS~1\Temp\RSPB.tmp" with contents
[
/nologo /out:"../../../rel.bin\GameOS.lib"
.\Release\DirtyRectangle.obj
.\Release\DXRasterizer.obj
.\Release\RenderIME.obj
.\Release\VertexBuffer.obj
.\Release\VideoCard.obj
".\Release\3D T&L.obj"
.\Release\3DPrimitives.obj
.\Release\3DRasterizer.obj
.\Release\Clipping.obj
.\Release\RenderStates.obj
.\Release\RenderToTexture.obj
.\Release\png.obj
.\Release\pngerror.obj
.\Release\pngget.obj
.\Release\pngmem.obj
.\Release\pngpread.obj
.\Release\pngread.obj
.\Release\pngrio.obj
.\Release\pngrtran.obj
.\Release\pngrutil.obj
.\Release\pngset.obj
.\Release\pngtrans.obj
.\Release\pngwio.obj
.\Release\pngwrite.obj
.\Release\pngwtran.obj
.\Release\pngwutil.obj
.\Release\adler32.obj
.\Release\compress.obj
.\Release\crc32.obj
.\Release\deflate.obj
.\Release\gzio.obj
.\Release\infblock.obj
.\Release\infcodes.obj
.\Release\inffast.obj
.\Release\inflate.obj
.\Release\inftrees.obj
.\Release\infutil.obj
.\Release\trees.obj
.\Release\uncompr.obj
.\Release\zutil.obj
.\Release\Loader_BMP.obj
.\Release\Loader_JPG.obj
.\Release\Loader_PNG.obj
.\Release\Loader_TGA.obj
".\Release\Texture API.obj"
".\Release\Texture Convert.obj"
".\Release\Texture Create.obj"
".\Release\Texture Format.obj"
".\Release\Texture Manager.obj"
".\Release\Texture MipMap.obj"
".\Release\Texture Original.obj"
".\Release\Texture SysMem.obj"
".\Release\Texture Update.obj"
".\Release\Texture VidMem.obj"
.\Release\ControlManager.obj
.\Release\ForceFeedback.obj
.\Release\Keyboard.obj
.\Release\Mouse.obj
.\Release\Cpu.obj
.\Release\ErrorDialogs.obj
.\Release\ErrorHandler.obj
.\Release\Exceptions.obj
.\Release\ExitGameOS.obj
.\Release\ImageHlp.obj
.\Release\Logfile.obj
.\Release\MachineDetails.obj
.\Release\Mail.obj
.\Release\Raid.obj
.\Release\Spew.obj
.\Release\ThunkDLLs.obj
.\Release\FileIO.obj
.\Release\Font3D.obj
.\Release\Font3D_Load.obj
.\Release\Font3D_DBCS.obj
.\Release\Font3D_DBCS_Storage.obj
.\Release\Font3D_DBCS_Surface.obj
.\Release\LocalizationManager.obj
.\Release\MemoryManager.obj
.\Release\Games_GUN.obj
.\Release\Games_LAN.obj
.\Release\GUNGameList.obj
.\Release\Net_Globals.obj
.\Release\Net_Main.obj
.\Release\Net_Packet.obj
.\Release\Net_Protocol.obj
.\Release\Net_Routines.obj
.\Release\Net_Threads.obj
.\Release\nglog_mark.obj
.\Release\UserInterface.obj
.\Release\zping.obj
.\Release\Registry.obj
.\Release\ACM.obj
.\Release\EZVector.obj
".\Release\Sound API.obj"
".\Release\Sound DS3DChannel.obj"
".\Release\Sound DS3DMixer.obj"
".\Release\Sound Renderer.obj"
".\Release\Sound Resource.obj"
.\Release\Time.obj
.\Release\Globals.obj
.\Release\Libraries.obj
.\Release\Threads.obj
.\Release\Windows.obj
.\Release\WindowsDebugging.obj
.\Release\WinMain.obj
.\Release\WinProc.obj
.\Release\Direct3D.obj
.\Release\DirectDraw.obj
.\Release\DirectInput.obj
.\Release\DirectPlay.obj
.\Release\DirectShow.obj
.\Release\DirectSound.obj
.\Release\DirectX.obj
.\Release\DirectXDebugging.obj
.\Release\DirectXErrors.obj
.\Release\perf.obj
.\Release\Profiler.obj
.\Release\Debugger.obj
.\Release\DebugGraphs.obj
.\Release\DebugGUI.obj
.\Release\DebugMenus.obj
.\Release\guids.obj
.\Release\pch.obj
.\Release\VideoPlayback.obj
.\Release\Music.obj
.\Release\eventid.obj
.\Release\goslog.obj
.\Release\gvserver.obj
.\Release\render.obj
]
Creating command line "link.exe -lib @C:\DOCUME~1\jeff\LOCALS~1\Temp\RSPB.tmp"
<h3>Output Window</h3>
Compiling...
DXRasterizer.cpp
Creating library...
<h3>
--------------------Configuration: autoconfig - Win32 Release--------------------
</h3>
<h3>Command Lines</h3>
Creating temporary file "C:\DOCUME~1\jeff\LOCALS~1\Temp\RSPC.tmp" with contents
[
/nologo /subsystem:windows /incremental:no /pdb:"../../../rel.bin/autoconfig.pdb" /machine:I386 /out:"../../../rel.bin/autoconfig.exe"
.\Release\autoconfig.obj
.\Release\autoconfigDlg.obj
.\Release\ConfigError.obj
.\Release\StdAfx.obj
.\Release\autoconfig.res
\VWE\GameleapCode5_03\rel.bin\GameOS.lib
\VWE\GameleapCode5_03\rel.bin\MFCPlatform.lib
\VWE\GameleapCode5_03\rel.bin\Stuff.lib
]
Creating command line "link.exe @C:\DOCUME~1\jeff\LOCALS~1\Temp\RSPC.tmp"
<h3>Output Window</h3>
Linking...
LINK : warning LNK4089: all references to "SHELL32.dll" discarded by /OPT:REF
<h3>
--------------------Configuration: MW4Application - Win32 Release--------------------
</h3>
<h3>Command Lines</h3>
Creating temporary file "C:\DOCUME~1\jeff\LOCALS~1\Temp\RSPE.tmp" with contents
[
comdlg32.lib /nologo /subsystem:windows /incremental:no /pdb:"Release/MW4_rel.pdb" /map:"Release/MW4.map" /machine:I386 /out:"../../../rel.bin/MW4.exe"
.\Release\MW4AppHeaders.obj
.\Release\MW4Testall.obj
.\Release\UserInterface.obj
.\Release\Cstr.obj
.\Release\ctcl.obj
.\Release\ctime.obj
.\Release\mugSocs.obj
.\Release\StdAfx.obj
.\Release\Eula.obj
.\Release\MW4Application.obj
.\Release\MW4Application.res
\VWE\GameleapCode5_03\rel.bin\GameOS.lib
\VWE\GameleapCode5_03\rel.bin\Stuff.lib
\VWE\GameleapCode5_03\rel.bin\MLR.lib
\VWE\GameleapCode5_03\rel.bin\gosFX.lib
\VWE\GameleapCode5_03\rel.bin\ElementRenderer.lib
\VWE\GameleapCode5_03\rel.bin\Adept.lib
\VWE\GameleapCode5_03\rel.bin\MW4.lib
\VWE\GameleapCode5_03\rel.bin\GOSScript.lib
\VWE\GameleapCode5_03\rel.bin\Compost.lib
\VWE\GameleapCode5_03\Rel.bin\GamePlatformNoMain.lib
\VWE\GameleapCode5_03\rel.bin\MW4DedicatedUI.lib
\VWE\GameleapCode5_03\rel.bin\server.lib
\VWE\GameleapCode5_03\rel.bin\ctcls.lib
]
Creating command line "link.exe @C:\DOCUME~1\jeff\LOCALS~1\Temp\RSPE.tmp"
<h3>Output Window</h3>
Linking...
LINK : warning LNK4089: all references to "MSVCIRT.dll" discarded by /OPT:REF
LINK : warning LNK4089: all references to "comdlg32.dll" discarded by /OPT:REF
<h3>Results</h3>
MW4.exe - 0 error(s), 3 warning(s)
</pre>
</body>
</html>
@@ -0,0 +1,85 @@
//Microsoft Developer Studio generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_MW4ICON ICON DISCARDABLE "res\\Mech4.ico"
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE DISCARDABLE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE DISCARDABLE
BEGIN
END
3 TEXTINCLUDE DISCARDABLE
BEGIN
"\r\n"
"#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
"#ifdef _WIN32\r\n"
"LANGUAGE 9, 1\r\n"
"#pragma code_page(1252)\r\n"
"#endif //_WIN32\r\n"
"#include ""res\\MW4GameEd.rc2"" // non-Microsoft Visual C++ edited resources\r\n"
"#endif\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE 9, 1
#pragma code_page(1252)
#endif //_WIN32
#include "..\MW4GameED\res\MW4GameEd.rc2" // non-Microsoft Visual C++ edited resources
#endif
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED
@@ -0,0 +1,102 @@
#include "MW4AppHeaders.hpp"
void
MW4Testall()
{
gos_PushCurrentHeap(MechWarrior4::Heap);
//
// Test string class
//
#if 1
MString::TestClass();
#endif
//
// Test Math brick
//
#if 1
Random::TestClass();
Radian::TestClass();
Degree::TestClass();
SinCosPair::TestClass();
Vector3D::TestClass();
Vector4D::TestClass();
Point3D::TestClass();
UnitVector3D::TestClass();
EulerAngles::TestClass();
UnitQuaternion::TestClass();
Origin3D::TestClass();
AffineMatrix4D::TestClass();
LinearMatrix4D::TestClass();
Matrix4D::TestClass();
Normal3D::TestClass();
Sphere::TestClass();
#endif
//
// Test time manager
//
#if 0
Time::TestClass();
#endif
//
// Test connection library
//
#if 1
Chain::TestClass();
SafeChain::TestClass();
SortedChain::TestClass();
Table::TestClass();
Hash::TestClass();
Tree::TestClass();
#endif
//
// Test Memory brick
//
#if 1
MemoryBlock::TestClass();
MemoryStack::TestClass();
#endif
//
// Test NameList classes
//
#if 1
NotationFile::TestClass();
#endif
//
// Test dynamic dispatch brick
//
#if 1
Receiver::TestClass();
#endif
//
// Test file stream manager
//
#if 0
FileStreamManager::TestClass();
#endif
//
// Test resource manager
//
#if 0
ResourceManager::TestClass();
#endif
//
// Test BitPackers
//
#if 0
MemoryStream::TestClass();
#endif
gos_PopCurrentHeap();
}
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,336 @@
#if !defined(__QSORT__)
#define __QSORT__
// stealed from qsort.c
#if !defined(FASTAPICALLCONVENTION)
#if defined(_WINDOWS)
#ifdef WIN32
#define FASTAPICALLCONVENTION __fastcall
#else // !WIN32
#define FASTAPICALLCONVENTION PASCAL
#endif // WIN32
#else // !defined(_WINDOWS)
#define FASTAPICALLCONVENTION
#endif // defined(_WINDOWS)
#endif // !defined(TSORTCALL)
#define TQSORT_VALUE(TYPE,ptr,count) TQSORT<TYPE, TCompDiff<TYPE>, TSwapAssign<TYPE> >::qsort(ptr,count)
#define TQSORT_VALUEUNSIGNED(TYPE,ptr,count) TQSORT<TYPE, TCompDiffUnsigned<TYPE>, TSwapAssign<TYPE> >::qsort(ptr,count)
#define TQSORT_MEM(TYPE,ptr,count) TQSORT<TYPE, TCompMEM<TYPE>, TSwapMEM<TYPE> >::qsort(ptr,count)
#define TQSORT_PTR(TYPE,ptr,count) TQSORT<TYPE, TCompPtr<TYPE>, TSwapAssign<TYPE> >::qsort(ptr,count)
/* this parameter defines the cutoff between using quick sort and
insertion sort for arrays; arrays with lengths shorter or equal to the
below value use insertion sort */
#define TQSORT_CUTOFF 8 /* testing shows that this is good value */
template <class TYPE>
struct TCompDiff
{
static int FASTAPICALLCONVENTION Compare(const TYPE* pa, const TYPE* pb)
{
return *pa - *pb;
}
};
template <class TYPE>
struct TCompDiffUnsigned
{
static int FASTAPICALLCONVENTION Compare(const TYPE* pa, const TYPE* pb)
{
TYPE tmpA = *pa;
TYPE tmpB = *pb;
if (tmpA != tmpB) {
if (tmpA > tmpB) {
return +1;
}
return -1;
}
return 0;
}
};
template <class TYPE>
struct TCompMEM
{
static int FASTAPICALLCONVENTION Compare(const TYPE* pa, const TYPE* pb)
{
return memcmp(pa, pb, sizeof(TYPE));
}
};
template <class TYPE>
struct TCompPtr
{
static int FASTAPICALLCONVENTION Compare(const TYPE* pa, const TYPE* pb)
{
BYTE* p1 = (BYTE**)pa;
BYTE* p2 = (BYTE**)pb;
if (p1 != p2) {
if (p1 > p2) {
return +1;
}
return -1;
}
return 0;
}
};
template <class TYPE>
struct TSwapAssign
{
static void FASTAPICALLCONVENTION Swap(TYPE* pa, TYPE* pb)
{
if (pa != pb) {
TYPE tmp;
tmp = *pa;
*pa = *pb;
*pb = tmp;
}
}
};
template <class TYPE>
struct TSwapMEM
{
static void FASTAPICALLCONVENTION Swap(BYTE* pa, BYTE* pb)
{
if (pa != pb) {
int nWidth = sizeof(TYPE);
/* Do the swap one character at a time to avoid potential alignment problems. */
while(nWidth-- > 0) {
BYTE tmp;
tmp = *(BYTE*)pa;
*pa++ = *pb;
*pb++ = tmp;
}
}
}
};
template <class TYPE, class COMP, class SWAP>
class TQSORT
{
public:
public:
private:
static void FASTAPICALLCONVENTION shortsort(BYTE *lo, BYTE *hi)
{
/***
*shortsort(hi, lo) - insertion sort for sorting short arrays
*
*Purpose:
* sorts the sub-array of elements between lo and hi (inclusive)
* side effects: sorts in place
* assumes that lo < hi
*
*Entry:
* BYTE *lo = pointer to low element to sort
* BYTE *hi = pointer to high element to sort
*Exit:
* returns void
*
*Exceptions:
*
*******************************************************************************/
BYTE *p, *max;
/* Note: in assertions below, i and j are alway inside original bound of
array to sort. */
while (hi > lo) {
/* A[i] <= A[j] for i <= j, j > hi */
max = lo;
for (p = lo+sizeof(TYPE); p <= hi; p += sizeof(TYPE)) {
/* A[i] <= A[max] for lo <= i < p */
if (COMP::Compare((TYPE*)p, (TYPE*)max) > 0) {
max = p;
}
/* A[i] <= A[max] for lo <= i <= p */
}
/* A[i] <= A[max] for lo <= i <= hi */
SWAP::Swap((TYPE*)max, (TYPE*)hi);
/* A[i] <= A[hi] for i <= hi, so A[i] <= A[j] for i <= j, j >= hi */
hi -= sizeof(TYPE);
/* A[i] <= A[j] for i <= j, j > hi, loop top condition established */
}
/* A[i] <= A[j] for i <= j, j > lo, which implies A[i] <= A[j] for i < j,
so array is sorted */
}
public:
static void FASTAPICALLCONVENTION qsort(TYPE* base, size_t num)
{
/* sort the array between lo and hi (inclusive) */
/***
*qsort(base, num, wid) - quicksort function for sorting arrays
*
*Purpose:
* quicksort the array of elements
* side effects: sorts in place
*
*Entry:
* TYPE *base = pointer to base of array
* size_t num = number of elements in the array
*Exit:
* returns void
*
*Exceptions:
*
*******************************************************************************/
BYTE *lo, *hi; /* ends of sub-array currently sorting */
BYTE *mid; /* points to middle of subarray */
BYTE *loguy, *higuy; /* traveling pointers for partition step */
unsigned size; /* size of the sub-array */
BYTE *lostk[30], *histk[30];
int stkptr; /* stack for saving sub-array to be processed */
/* Note: the number of stack entries required is no more than
1 + log2(size), so 30 is sufficient for any array */
if (num < 2 || sizeof(TYPE) == 0)
return; /* nothing to do */
stkptr = 0; /* initialize stack */
lo = (BYTE*)&base[0];
hi = (BYTE*)&base[num - 1]; /* initialize limits */
/* this entry point is for pseudo-recursion calling: setting
lo and hi and jumping to here is like recursion, but stkptr is
prserved, locals aren't, so we preserve stuff on the stack */
recurse:
size = (hi - lo) / sizeof(TYPE) + 1; /* number of el's to sort */
/* below a certain size, it is faster to use a O(n^2) sorting method */
if (size <= TQSORT_CUTOFF) {
shortsort(lo, hi);
} else {
/* First we pick a partititioning element. The efficiency of the
algorithm demands that we find one that is approximately the
median of the values, but also that we select one fast. Using
the first one produces bad performace if the array is already
sorted, so we use the middle one, which would require a very
wierdly arranged array for worst case performance. Testing shows
that a median-of-three algorithm does not, in general, increase
performance. */
mid = lo + (size / 2) * sizeof(TYPE); /* find middle element */
SWAP::Swap((TYPE*)mid, (TYPE*)lo); /* swap it to beginning of array */
/* We now wish to partition the array into three pieces, one
consisiting of elements <= partition element, one of elements
equal to the parition element, and one of element >= to it. This
is done below; comments indicate conditions established at every
step. */
loguy = lo;
higuy = hi + sizeof(TYPE);
/* Note that higuy decreases and loguy increases on every iteration,
so loop must terminate. */
for (;;) {
/* lo <= loguy < hi, lo < higuy <= hi + 1,
A[i] <= A[lo] for lo <= i <= loguy,
A[i] >= A[lo] for higuy <= i <= hi */
do {
loguy += sizeof(TYPE);
} while (loguy <= hi && COMP::Compare((const TYPE*)loguy, (const TYPE*)lo) <= 0);
/* lo < loguy <= hi+1, A[i] <= A[lo] for lo <= i < loguy,
either loguy > hi or A[loguy] > A[lo] */
do {
higuy -= sizeof(TYPE);
} while (higuy > lo && COMP::Compare((const TYPE*)higuy, (const TYPE*)lo) >= 0);
/* lo-1 <= higuy <= hi, A[i] >= A[lo] for higuy < i <= hi,
either higuy <= lo or A[higuy] < A[lo] */
if (higuy < loguy)
break;
/* if loguy > hi or higuy <= lo, then we would have exited, so
A[loguy] > A[lo], A[higuy] < A[lo],
loguy < hi, highy > lo */
SWAP::Swap((TYPE*)loguy, (TYPE*)higuy);
/* A[loguy] < A[lo], A[higuy] > A[lo]; so condition at top
of loop is re-established */
}
/* A[i] >= A[lo] for higuy < i <= hi,
A[i] <= A[lo] for lo <= i < loguy,
higuy < loguy, lo <= higuy <= hi
implying:
A[i] >= A[lo] for loguy <= i <= hi,
A[i] <= A[lo] for lo <= i <= higuy,
A[i] = A[lo] for higuy < i < loguy */
SWAP::Swap((TYPE*)lo, (TYPE*)higuy); /* put partition element in place */
/* OK, now we have the following:
A[i] >= A[higuy] for loguy <= i <= hi,
A[i] <= A[higuy] for lo <= i < higuy
A[i] = A[lo] for higuy <= i < loguy */
/* We've finished the partition, now we want to sort the subarrays
[lo, higuy-1] and [loguy, hi].
We do the smaller one first to minimize stack usage.
We only sort arrays of length 2 or more.*/
if ( higuy - 1 - lo >= hi - loguy ) {
if (lo + sizeof(TYPE) < higuy) {
lostk[stkptr] = lo;
histk[stkptr] = higuy - sizeof(TYPE);
++stkptr;
} /* save big recursion for later */
if (loguy < hi) {
lo = loguy;
goto recurse; /* do small recursion */
}
} else {
if (loguy < hi) {
lostk[stkptr] = loguy;
histk[stkptr] = hi;
++stkptr; /* save big recursion for later */
}
if (lo + sizeof(TYPE) < higuy) {
hi = higuy - sizeof(TYPE);
goto recurse; /* do small recursion */
}
}
}
/* We have sorted the array, except for any pending sorts on the stack.
Check if there are any, and do them. */
--stkptr;
if (stkptr >= 0) {
lo = lostk[stkptr];
hi = histk[stkptr];
goto recurse; /* pop subarray from stack */
}
//return; /* all subarrays done */
}
};
#endif // !defined(__QSORT__)
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,8 @@
// stdafx.cpp : source file that includes just the standard includes
// ctcl.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
// TODO: reference any additional headers you need in STDAFX.H
// and not in this file
@@ -0,0 +1,84 @@
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#if !defined(AFX_STDAFX_H__3376A352_035E_4275_A4F2_D4A2C610461D__INCLUDED_)
#define AFX_STDAFX_H__3376A352_035E_4275_A4F2_D4A2C610461D__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "MW4AppHeaders.hpp"
#include "MW4Application.hpp"
#include <windows.h>
#include <MW4DedicatedUI\DedicatedUI.hpp>
#include <GameOS\GameOS.hpp>
#include <GameOS\Platform.hpp>
#include <GameOs\Network.hpp>
#include <gosFX\gosFX.hpp>
#include <gosFX\EffectLibrary.hpp>
#include <Adept\Application.hpp>
#include <MW4\MWApplication.hpp>
#include <gosScript\gosScriptHeaders.hpp>
#include <Adept\ResourceImagePool.hpp>
#include <MW4\MWMission.hpp>
#include <MW4\MWPlayer.hpp>
#include <Compost\Compost.hpp>
#include <mw4\gameinfo.hpp>
#include <Adept\ResourceEffectLibrary.hpp>
#include <mw4\ai_statistics.hpp>
#include "mw4\mw4shell.hpp"
#include "mw4\hudcomp.hpp"
#include <Adept\GlobalPointerManager.hpp>
#include <MW4\MWTool.hpp>
#include <Stuff\Random.hpp>
#include <MLR\MLR.hpp>
#include <MLR\MLRTexturePool.hpp>
#include <MLR\MLRTexture.hpp>
#include <adept\gamespy\gamespy.h>
#include <GameOS\GUNGameList.h>
#include <process.h>
// Insert your headers here
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#include <windows.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <stdlib.h>
#include <limits.h>
#include <malloc.h>
#include <math.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <io.h>
#include <crtdbg.h>
#include <stdio.h>
#include <ctype.h>
#include <signal.h>
#include <errno.h>
#include <limits.h>
#include <fcntl.h>
#define _T(x) x
#include "nonmfc.h"
#include "mugpdefs.h"
#include "ctime.h"
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_STDAFX_H__3376A352_035E_4275_A4F2_D4A2C610461D__INCLUDED_)
@@ -0,0 +1,163 @@
#if !defined(__STDDEFS__)
#define __STDDEFS__
#ifdef RC_INVOKED
#else // RC_INVOKED
#ifdef WIN32
#pragma warning (disable:4200)
#endif // WIN32
#if 0 // def _DEBUG
inline void HEAPCHK()
{
PVOID pa[10];
int i;
for(i = 0; i < 10; i++) {
pa[i] = malloc(rand() % 32000 + 767);
ASSERT(_heapchk() == _HEAPOK);
}
_HEAPINFO hh;
int nRet;
hh._pentry = NULL;
while((nRet = _heapwalk(&hh)) == _HEAPOK)
;
if (nRet != _HEAPEND) {
ASSERT(FALSE);
}
for(i = 0; i < 10; i++) {
free(pa[i]);
ASSERT(_heapchk() == _HEAPOK);
}
}
#else
#define HEAPCHK()
#endif
#ifdef WIN32
#pragma pack(push, 1)
#endif // WIN32
union WORDPACK {
struct {
BYTE m_bLow;
BYTE m_bHigh;
} m_W;
WORD m_wValue;
};
typedef WORDPACK* PWORDPACK;
union DWORDPACK {
struct {
WORDPACK m_wLow;
WORDPACK m_wHigh;
} m_DW;
DWORD m_dwValue;
};
typedef DWORDPACK* PDWORDPACK;
#ifdef WIN32
#pragma pack(pop)
#endif // WIN32
#define GETLBYTE(W) (((PWORDPACK)&(W))->m_W.m_bLow)
#define GETHBYTE(W) (((PWORDPACK)&(W))->m_W.m_bHigh)
#define GETLWORD(D) (((PDWORDPACK)&(D))->m_DW.m_wLow.m_wValue)
#define GETHWORD(D) (((PDWORDPACK)&(D))->m_DW.m_wHigh.m_wValue)
#define WORDHI(lvalue) (*((LPWORD)&(lvalue) + 1))
#define BYTEHI(lvalue) (*((LPBYTE)&(lvalue) + 1))
#define MAKE_VERSION(rmj, rmm, rup) (((DWORD)rmj) << 16) | (((DWORD)rmm) << 8) | (((DWORD)rup) << 0)
#define NOFA(name_of_array) (sizeof(name_of_array)/sizeof(name_of_array[0]))
#define ChkFlag(flag,mask) ((flag) & (mask))
#define SetFlag(flag,mask) ((flag) |= (mask))
#define XorFlag(flag,mask) ((flag) ^= (mask))
#define ClrFlag(flag,mask) ((flag) &= ~(mask))
#ifdef _DEBUG
#define DEBUGONLY(expr) (expr)
#else
#define DEBUGONLY(expr)
#endif
typedef signed long SINT; // logical unit, signed 32bit
typedef short SINT16;
typedef unsigned short UINT16;
typedef int SINT32;
#if _MSC_VER <= 1100
typedef unsigned int UINT32;
#endif // _MSC_VER <== 1100(developers studio 5.0)
#ifdef WIN32
typedef __int64 SINT64;
typedef unsigned __int64 UINT64;
#else // WIN32
typedef long long SINT64;
typedef unsigned long long UINT64;
#endif // WIN32
typedef float FLOAT;
typedef double DOUBLE;
typedef unsigned char U8;
typedef signed char S8;
typedef unsigned short U16;
typedef signed short S16;
typedef unsigned int U32;
typedef signed int S32;
#define SIZE_SINT 4
#define SIZE_SINT16 2
#define SIZE_UINT16 2
#define SIZE_SINT32 4
#define SIZE_UINT32 4
#define SIZE_SINT64 8
#define SIZE_UINT64 8
#define SIZE_FLOAT 4
#define SIZE_DOUBLE 8
typedef SINT* PSINT;
typedef PSINT* PPSINT;
typedef SINT16* PSINT16;
typedef PSINT16* PPSINT16;
typedef UINT16* PUINT16;
typedef PUINT16* PPUINT16;
typedef SINT32* PSINT32;
typedef PSINT32* PPSINT32;
typedef UINT32* PUINT32;
typedef PUINT32* PPUINT32;
typedef SINT64* PSINT64;
typedef PSINT64* PPSINT64;
typedef UINT64* PUINT64;
typedef PUINT64* PPUINT64;
typedef FLOAT* PFLOAT;
typedef PFLOAT* PPFLOAT;
typedef DOUBLE* PDOUBLE;
typedef PDOUBLE* PPDOUBLE;
#if !(defined(BOOL) || defined(TRUE) || defined(FALSE))
#define BOOL int
#define TRUE 1
#define FALSE 0
#endif
#if 1 // def WIN32
#define DECLARE_VOIDHANDLE(name) struct __##name##__ { int unused; }; typedef const struct __##name##__* name
#define DECLARE_CLASS(name) __DECLARE_CLASS(C,name)
#define DECLARE_CLASS_PTR(name) __DECLARE_CLASS_PTR(C,name)
#define __DECLARE_CLASS(prefix,name) class prefix##name; typedef class prefix##name* P##name; typedef const class prefix##name* PC##name
#define __DECLARE_CLASS_PTR(prefix,name) __DECLARE_CLASS(prefix, name); typedef P##name* PP##name; typedef PC##name* PPC##name
#define DECLARE_STRUCT(name) __DECLARE_STRUCT(S,name)
#define DECLARE_STRUCT_PTR(name) __DECLARE_STRUCT_PTR(S,name)
#define __DECLARE_STRUCT(prefix,name) struct prefix##name; typedef struct prefix##name* P##name; typedef const struct prefix##name* PC##name;
#define __DECLARE_STRUCT_PTR(prefix,name) __DECLARE_STRUCT(prefix,name); typedef P##name* PP##name; typedef PC##name* PPC##name
#endif // WIN32
#define DLLDAT // will be redefined, if necessary in dllapi.h
#define DLLAPI // will be redefined, if necessary in dllapi.h
#define DLLCLS // will be redefined, if necessary in dllapi.h
#endif // RC_INVOKED
#endif // __STDDEFS__
@@ -0,0 +1,193 @@
#if !defined(__BSEARCH__)
#define __BSEARCH__
// stealed from bsearch.c
#if !defined(FASTAPICALLCONVENTION)
#if defined(_WINDOWS)
#ifdef WIN32
#define FASTAPICALLCONVENTION __fastcall
#else // !WIN32
#define FASTAPICALLCONVENTION PASCAL
#endif // WIN32
#else // !defined(_WINDOWS)
#define FASTAPICALLCONVENTION
#endif // defined(_WINDOWS)
#endif // !defined(TSORTCALL)
#define TBSEARCH_SAMEVALUE(TYPE,key,ptr,count) TBSEARCH<TYPE, TYPE, TBsearchSameDiff<TYPE,TYPE> >::bsearch(key,ptr,count)
#define TBSEARCH_SAMEVALUEUNSIGNED(TYPE,key,ptr,count) TBSEARCH<TYPE, TYPE, TBsearchSameDiffUnsigned<TYPE,TYPE> >::bsearch(key,ptr,count)
#define TBSEARCH_SAMEMEM(TYPE,pKey,ptr,count) TBSEARCH<const TYPE*, TYPE, TBsearchSameMEM<const TYPE*,TYPE> >::bsearch(pKey,ptr,count)
#define TBSEARCH_SAMEPTR(TYPE,pKey,ptr,count) TBSEARCH<const TYPE*, TYPE, TBsearchSameDiffUnsigned<const TYPE,TYPE> >::bsearch(pKey,ptr,count)
#define TBRANGE_SAMEVALUE(TYPE,key,ptr,count,bRange) TBRANGE<TYPE, TYPE, TBsearchSameDiff<TYPE,TYPE> >::GetIndexViaKey(key,ptr,count,bRange)
#define TBRANGE_SAMEVALUEUNSIGNED(TYPE,key,ptr,count,bRange) TBRANGE<TYPE, TYPE, TBsearchSameDiffUnsigned<TYPE,TYPE> >::GetIndexViaKey(key,ptr,count,bRange)
#define TBRANGE_SAMEMEM(TYPE,pKey,ptr,count,bRange) TBRANGE<const TYPE*, TYPE, TBsearchSameMEM<const TYPE*,TYPE> >::GetIndexViaKey(pKey,ptr,count,bRange)
#define TBRANGE_SAMEPTR(TYPE,pKey,ptr,count,bRange) TBRANGE<const TYPE*, TYPE, TBsearchSameDiffUnsigned<const TYPE,TYPE> >::GetIndexViaKey(pKey,ptr,count,bRange)
template <class KEY, class TYPE>
struct TBsearchSameDiff
{
static int FASTAPICALLCONVENTION Compare(KEY key, const TYPE* pb)
{
return key - *pb;
}
};
template <class KEY, class TYPE>
struct TBsearchSameDiffUnsigned
{
static int FASTAPICALLCONVENTION Compare(KEY key, const TYPE* pb)
{
TYPE tmp = *pb;
if (key != tmp) {
if (key > tmp)
return +1;
return -1;
}
return 0;
}
};
template <class KEY, class TYPE>
struct TBsearchSameMEM
{
static int FASTAPICALLCONVENTION Compare(KEY key, const TYPE* pb)
{
return memcmp(key, pb, sizeof(TYPE));
}
};
template <class KEY, class TYPE, class COMP>
struct TBSEARCH
{
public:
public:
static TYPE* FASTAPICALLCONVENTION bsearch(KEY key, const TYPE* base, size_t num)
{
/***
*TYPE *bsearch() - do a binary search on an array
*
*Purpose:
* Does a binary search of a sorted array for a key.
*
*Entry:
* const char *key - key to search for
* const char *base - base of sorted array to search
* unsigned int num - number of elements in array
*
*Exit:
* if key is found:
* returns pointer to occurrence of key in array
* if key is not found:
* returns NULL
*
*Exceptions:
*
*******************************************************************************/
BYTE *lo = (BYTE *)base;
BYTE *hi = (BYTE *)base + (num - 1) * sizeof(TYPE);
BYTE *mid;
size_t half;
int result;
while(lo <= hi) {
if ((half = num / 2) != 0) {
mid = lo + (num & 1 ? half : (half - 1)) * sizeof(TYPE);
if ((result = COMP::Compare(key, (const TYPE*)mid)) == 0)
return (TYPE*)mid;
else if (result < 0) {
hi = mid - sizeof(TYPE);
num = num & 1 ? half : half-1;
} else {
lo = mid + sizeof(TYPE);
num = half;
}
} else if (num)
return (TYPE*)(COMP::Compare(key, (const TYPE*)lo) ? NULL : lo);
else
break;
}
return NULL;
}
};
template <class KEY, class TYPE, class COMP>
struct TBRANGE
{
public:
public:
static int FASTAPICALLCONVENTION GetIndexViaKey(KEY key, const TYPE* base, int nSize, BOOL bRange = FALSE)
{
if (nSize > 0) {
int nNum = nSize;
const TYPE* pStart = &base[0];
const TYPE* pLo = pStart;
const TYPE* pHi = &pStart[nNum - 1];
const TYPE* pMd;
int nHalf;
int nIndex;
int nDiffer;
while(pLo <= pHi) {
nHalf = nNum / 2;
if (nHalf) {
int nNum2 = nNum & 1 ? nHalf : (nHalf - 1);
pMd = &pLo[nNum2];
nDiffer = COMP::Compare(key, pMd);
if (nDiffer) {
if (nDiffer > 0) {
pLo = &pMd[1];
nNum = nHalf;
} else {
nNum = nNum2;
if (!nNum) {
if (bRange) {
nIndex = pLo - pStart;
goto check_1below;
}
break;
}
pHi = &pMd[-1];
}
} else {
nIndex = pMd - pStart;
pLo = pMd;
goto check_before;
}
} else {
ASSERT(nNum == 1);
nDiffer = COMP::Compare(key, pLo);
nIndex = pLo - pStart;
if (bRange) {
if (nDiffer < 0) {
check_1below:
if (0 < nIndex) {
pLo--;
if (COMP::Compare(key, pLo) >= 0) {
ASSERT(COMP::Compare(key, pLo) != 0);
nIndex--;
goto check_before;
}
}
break;
}
} else {
if (nDiffer != 0)
break;
}
check_before:
return nIndex;
}
}
}
return -1;
}
};
#endif // !defined(__BSEARCH__)
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,174 @@
#if !defined(__CTCL_H__)
#define __CTCL_H__
// The following ifdef block is the standard way of creating macros which make exporting
// from a DLL simpler. All files within this DLL are compiled with the CTCL_EXPORTS
// symbol defined on the command line. this symbol should not be defined on any project
// that uses this DLL. This way any other project whose source files include this file see
// CTCL_API functions as being imported from a DLL, wheras this DLL sees symbols
// defined with this macro as being exported.
#define CTCL_API _stdcall
#if !defined(BOOL)
#define BOOL int
#if !defined(TRUE)
#define TRUE 1
#define FALSE 0
#endif // !defined(TRUE)
#endif // !defined(BOOL)
#pragma pack(push, 1)
#if !defined(CTCLS_EXPORTS)
class CInviteCOOP
{
public:
void* m_pParent;
int m_nTimeInvite;
int m_nResult; // 0: not inited, 1: requesting, 2: no, 3: yes...
int m_nResultAccepted;
GUID m_guidGameData;
public:
CInviteCOOP();
void Clear();
};
#endif // !defined(CTCLS_EXPORTS)
struct STeslaInfo
{
public:
BOOL m_bCameraShip;
unsigned long m_ulAddr;
const char* m_pcsz;
int m_nLauncherConnection; // 0: no connection, +1: connection, -1: connecting
int m_nConnection2; // m_bCameraShip값에 따라 게임 혹은 카메라 쉽과의 접속을 의미, 0: no connection, +1: connection, -1: connecting
int m_nApplType;
int m_nApplState;
int m_nGameState;
int m_nGameTime;
int m_nGameIsServer;
public:
};
#define MAX_PLYR_NAME 20
struct SPlayerInfo
{
public:
BYTE m_bBot;
BYTE m_bTeam;
int m_nLevelOrTesla;
char m_szName[MAX_PLYR_NAME];
UINT m_uPlayerID;
int m_nMechIndex;
short m_fileID;
WORD m_recordID;
char m_szMech[64];
int m_nTeamOrSkin;
int m_nDecal;
DWORD m_dwAddr;
};
#pragma pack(pop)
#define C_GameInfo 1 // Console 2 Launcher
#define S_GameInfo 1 // Launcher 2 Console
#define C_OrderAppl 10 // Console 2 Launcher
#define C_ErrorStartGame 19 // to server & client - error occurred, to mainmenu
#define C_ReadyStartGame 20 // to server - Game Server Start w/ HostSetup & Mission Params...
#define C_BOTS 21 // to server - Bot Infos
#define C_SetMechs 22 // to server & client -
#define C_GetReady 23 // to server & client -
#define C_DoLaunch 24 // to server
#define S_GameReturn 30 // game to console
#define C_SendFile 40
#define S_SendFile 40
#define C_InviteCOOP 50 // to server & client - invite clients
#define S_InviteCOOP 50 // to server & client - reply to server for invitation
class CTeslaInfo;
typedef CTeslaInfo* TESLA_HANDLE;
BOOL CTCL_API CTCL_Start(int nCTCLType);
void CTCL_API CTCL_Stop();
void CTCL_API CTCL_Run();
// Used by All
int CTCL_API CTCL_API CTCL_GetType();
BOOL CTCL_API CTCL_IsNone(); // no -ctcltype...
BOOL CTCL_API CTCL_IsConsole(); // Console Only
bool CTCL_API CTCL_IsCOOP(); // is COOP?
BOOL CTCL_API CTCL_IsConsoleOrCOOP(); // Console or COOP(COin OPerational)
BOOL CTCL_API CTCL_IsConsoleX(); // Game & Cameraship
// Used by Console(+ COOP)
int CTCL_API CTCL_GetTeslaCountAll();
int CTCL_API CTCL_GetTeslaCount();
TESLA_HANDLE CTCL_API CTCL_GetTeslaInfo(int nIndex, STeslaInfo& TI);
int CTCL_API CTCL_InviteCOOP(int nTimeInvite, int& nYes, int& nNo, int& nProcessings);
const char* CTCL_API CTCL_GetTeslaName(int nIndex);
int CTCL_API CTCL_OrderAppl(int nIndex, int nOrder, int nParam);
// Used by Launcher
// Used by Game
// Used by CameraShip
void CTCL_API CTCL_DoTerminateAppl();
void CTCL_API CTCL_DoEndMission();
void CTCL_API CTCL_DoMainShell();
void CTCL_API CTCL_DoCreateGame();
void CTCL_API CTCL_DoJoinGame();
void CTCL_API CTCL_StartGame(BOOL bRealLaunch);
void CTCL_API CTCL_InitMechDatas();
void CTCL_API CTCL_CheckJoinGame();
void CTCL_API CTCL_CheckNetConnectedToServer();
void CTCL_API CTCL_SetMissionParams();
void CTCL_API CTCL_CheckMissionParams();
void CTCL_API CTCL_SetMechs();
void CTCL_API CTCL_CheckClientReady();
void CTCL_API CTCL_CheckServerReady();
void CTCL_API CTCL_DefaultHostSetup(int nMode);
// from here - Mech4 only
void CTCL_API CTCL_DoSendGameReturn(int nValue);
void CTCL_API CTCL_SaveNMP(const void* p, int nSize);
void* CTCL_API CTCL_LoadNMP(int& nSize);
void CTCL_API CTCL_SendFile(const SYSTEMTIME& SysTime, const GUID& guid, int nType);
bool CTCL_API CTCL_DoReprintOrCheck(bool bRealPrint);
void CTCL_API CTCL_SetGameStateAsIdle();
// to here - Mech4 only
extern "C" {
extern int g_nCTCLType;
extern int g_nCTCL_DoLaunchGame;
#if !defined(CTCLS_EXPORTS)
extern CInviteCOOP g_InviteCOOP;
// console only...
// Mech4 only
extern int g_nMech4Comm;
// server & client only
extern BOOL g_bIsServer;
// console(All), server & client only(g_aPlayerInfos[0]), server only(g_aPlayerInfos[1..g_nBOTs]
extern SPlayerInfo g_aPlayerInfos[20];
extern int g_nPlayerInfos;
extern int g_nServer;
extern int g_nTeslas;
extern int g_nPrintOut;
extern int g_nMissionReview;
extern SYSTEMTIME g_SysTime;
extern GUID g_guidGameDatas;
// Tesla Server & Clients only
extern char g_szGameName[128];
extern int g_nBOTs;
extern DWORD g_dwJoinStartTicks;
#endif // !defined(CTCLS_EXPORTS)
extern const char PROF_INI[];
extern const char SECT_TESLAS[];
extern const char SECT_GAMES[];
extern const char SECT_CONFIG[];
} // end of extern "C"
#endif // !defined(__CTCL_H__)
@@ -0,0 +1,49 @@
#define _EAT_None 0
#define _EAT_MW4 1
#define _EAT_RP 2
#define _EAT_MAX 2 // max appl count...
#define _EAS_None 0
#define _EAS_PreLaunch 1
#define _EAS_Launched 2
#define _EAS_PostLaunch 3
#define _EGS_None 0
#define _EGS_Idle 1
#define _EGS_Preparing 2
#define _EGS_Running 3
#define _EGS_Closing 4
#define _EGR_NotConnected (-2)
#define _EGR_Connected (-1)
#define _EGR_NoError 0
#define _EGR_PreparingStarted 1
#define _EGR_ErrCreateSession 2
#define _EGR_OkCreateSession 3
#define _EGR_OkLaunchReady 4
#define _EGR_ErrJoinSession 5
#define _EGR_OkJoinSession 6
// CTCL_GetType return value
#define _ECTCL_Launcher 0
#define _ECTCL_Console 1 // CTCL_IsConsole()
#define _ECTCL_Game 2
#define _ECTCL_CameraShip 3
#define _ECTCL_None 4
// CTCL_Get/Set Param...
#define _CTCL_GetTeslaCountAll 100
#define _CTCL_GetTeslaCount 101
#define _CTCL_GetTeslaInfo 102
#define _CTCL_GetTeslaName 103
#define _CTCL_OrderAppl 104 // param: 0 - terminate, 1 - launch, 2 - end mission
#define _CTCL_Order_Terminate 0
#define _CTCL_Order_EndMission 1
#define _CTCL_Order_Launch 100
#define _CTCL_Order_Shutdown 101
#define _CTCL_Order_Reboot 102
#define _CTCL_Order_Unload 103
#define _CTCL_GetInviteCOOP 105
#define _CTCL_SetInviteCOOP 106
@@ -0,0 +1,26 @@
// The following ifdef block is the standard way of creating macros which make exporting
// from a DLL simpler. All files within this DLL are compiled with the CTCLS_EXPORTS
// symbol defined on the command line. this symbol should not be defined on any project
// that uses this DLL. This way any other project whose source files include this file see
// CTCLS_API functions as being imported from a DLL, wheras this DLL sees symbols
// defined with this macro as being exported.
#ifdef CTCLS_EXPORTS
#define CTCLS_API __declspec(dllexport)
#else
#define CTCLS_API __declspec(dllimport)
#endif
#include "ctcl_params.h"
CTCLS_API DWORD CTCL_GetVersion();
CTCLS_API int CTCL_GetApplType();
CTCLS_API void CTCL_SetApplType(int nApplType);
CTCLS_API int CTCL_GetApplState();
CTCLS_API void CTCL_SetApplState(int nApplState);
CTCLS_API int CTCL_GetGameState();
CTCLS_API void CTCL_SetGameState(int nGameState);
CTCLS_API int CTCL_GetGameTime();
CTCLS_API void CTCL_SetGameTime(int nGameTime);
CTCLS_API int CTCL_GetGameIsServer();
CTCLS_API void CTCL_SetGameIsServer(int nGameIsServer);
@@ -0,0 +1,191 @@
#include "stdafx.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/*
BOOL IsLeapYear(int nYear)
{
// nYear is in Solar system, 1982...
if (nYear % 4 == 0) {
if (nYear % 100 == 0) {
if (nYear % 400 == 0) {
//...
return FALSE;
}
}
return TRUE;
}
return FALSE;
}
int GetDayEnd(int nYear, int nMonth)
{
int nDayEnd;
if (nMonth == 2) {
nDayEnd = 28;
if (IsLeapYear(nYear)) {
nDayEnd++;
} else {
// 28
}
} else {
nDayEnd = 30;
if ((nMonth == 1) || (nMonth == 3) || (nMonth == 5) || (nMonth == 7) || (nMonth == 8) || (nMonth == 10) || (nMonth == 12))
nDayEnd++; // 31
}
return nDayEnd;
}
long GetTotalSeconds(int nYear, int nMonth, int nDay)
{
// nYear, nMonth, nDay날의 0시 0분 0초를 0으로 한 초단위 수...
ASSERT(nYear >= 1970);
ASSERT((1 <= nMonth) && (nMonth <= 12));
ASSERT(1 <= nDay);
ASSERT(nDay <= GetDayEnd(nYear, nMonth));
long lTotal = 0;
int nStart;
for(nStart = 1970; nStart < nYear; nStart++) {
int nDays = 365;
if (IsLeapYear(nStart)) {
nDays++;
}
lTotal += nDays * 24 * 60 * 60; // 24시간 60분 60초
}
for(nStart = 1; nStart < nMonth; nStart++) {
int nDayEnd = GetDayEnd(nYear, nStart);
lTotal += nDayEnd * 24 * 60 * 60; // 24시간 60분 60초
}
lTotal += (nDay - 1) * 24 * 60 * 60; // 24시간 60분 60초
return lTotal;
}
*/
BOOL CTimeDate::IsLeapYear(int nYear)
{
// nYear is in Solar system, 1982...
if (nYear % 4 == 0) {
if (nYear % 100 == 0) {
if (nYear % 400 == 0) {
//...
return FALSE;
}
}
return TRUE;
}
return FALSE;
}
long CTimeDate::GetCurrent()
{
CTimeDate t;
t.CurrentDate();
return t.m_lDate;
}
void CTimeDate::CurrentDate()
{
ASSERT(this);
time_t t;
struct tm* p;
time(&t);
p = localtime(&t);
m_lDate = 0;
m_LN.m_xDay = p->tm_mday - 1;
m_LN.m_xMonth = p->tm_mon;
m_LN.m_xYear = (p->tm_year + 1900) - TIMEDATE_YEAR_BASE;
//m_LN.m_xReserved = 0;
//m_LN.m_xLunar = 0;
//m_LN.m_xLeap = 0;
}
BOOL CTimeDate::GetDate(long lDate, BOOL bLunar/* = FALSE*/, BOOL bLeap/* = FALSE*/)
{
ASSERT(!bLunar && !bLeap); // not yet implemented...
int nDay = lDate % 100;
lDate /= 100;
int nMonth = lDate % 100;
lDate /= 100;
int nYear = lDate;
BOOL bLeapYear = IsLeapYear(nYear);
nYear -= TIMEDATE_YEAR_BASE;
if ((nYear < 0) || (nYear >= (1 << TIMEDATE_YEAR_BITS)))
return FALSE;
if (!((1 <= nMonth) && (nMonth <= 12))) {
return FALSE;
}
int nDayMax = 30;
switch(nMonth) {
case 1:
case 3:
case 5:
case 7:
case 8:
case 10:
case 12:
nDayMax++; // 31
break;
case 2:
nDayMax--; // 29
if (!bLeapYear) {
nDayMax--; // 28
}
break;
default:
break;
}
if (!((1 <= nDay) && (nDay <= nDayMax))) {
return FALSE;
}
nMonth--;
nDay--;
m_lDate = 0;
m_LN.m_xYear = nYear;
m_LN.m_xMonth = nMonth;
m_LN.m_xDay = nDay;
//m_LN.m_xReserved = 0;
//m_LN.m_xLunar = 0;
//m_LN.m_xLeap = 0;
return TRUE;
}
long CTimeLong::GetCurrent()
{
CTimeLong t;
t.CurrentTime();
return t.m_lTime;
}
void CTimeLong::CurrentTime()
{
ASSERT(this);
time_t t;
time(&t);
m_lTime = t;
}
void CTimeLong::GetTime(tm& t) const
{
ASSERT(this);
t = *localtime(&m_lTime);
}
@@ -0,0 +1,55 @@
#if !defined(__CTIME__)
#define __CTIME__
#if !defined(TIMEDATE_YEAR_BASE)
#define TIMEDATE_YEAR_BASE 1900
#endif // !defined(TIMEDATE_YEAR_BASE)
#if !defined(TIMEDATE_YEAR_BITS)
#define TIMEDATE_YEAR_BITS 8
#endif // !defined(TIMEDATE_YEAR_BITS)
#define TIMEDATE_RESERVED_BITS (32 - (5 + 4 + TIMEDATE_YEAR_BITS + 1 + 1)) // 13?
class CTimeDate
{
public:
union {
struct {
// Bit Field는 앞쪽에 지정된 것이 LowBit이다.
DWORD m_xDay: 5; // 2^0, 2^5-1
DWORD m_xMonth: 4; // 2^5, 2^4-1
DWORD m_xYear: TIMEDATE_YEAR_BITS; // from 1900-2155 // 2^9, 2^8-1
DWORD m_xReserved: TIMEDATE_RESERVED_BITS; // 2^17,2^13-1
DWORD m_xLunar: 1; // lunar system not solar system // 2^30, 2^1-1
DWORD m_xLeap: 1; // leap month? in case of lunar system // 2^31, 2^1-1
} m_LN;
long m_lDate;
};
public:
CTimeDate() { m_lDate = 0; } // TIMEDATE_YEAR_BASE/1/1 in solar
CTimeDate(const CTimeDate& that) { m_lDate = that.m_lDate; }
operator long& () { return *(long*)&m_lDate; }
static BOOL IsLeapYear(int nYear);
static long GetCurrent();
int const GetYear() const { return m_LN.m_xYear + TIMEDATE_YEAR_BASE; }
int const GetMonth() const { return m_LN.m_xMonth; }
int const GetDay() const { return m_LN.m_xDay; }
void CurrentDate();
BOOL GetDate(long lDate, BOOL bLunar = FALSE, BOOL bLeap = FALSE);
};
class CTimeLong
{
public:
long m_lTime; // time_t
public:
CTimeLong() { m_lTime = 0; }
CTimeLong(const CTimeLong& that) { m_lTime = that.m_lTime; }
operator long& () { return *(long*)&m_lTime; }
static long GetCurrent();
void CurrentTime();
void GetTime(tm& t) const;
};
#endif //!defined(__CTIME__)
@@ -0,0 +1,748 @@
#if !defined(__DBLINKS__)
#define __DBLINKS__
#ifndef NULL_CLASS_DEFINED
#define NULL_CLASS_DEFINED
class CNullClass {};
#endif
#define TDBLNK(TYPE) TDoubleLinkRef<TYPE,CNullClass> // TDBLNK(CObject*)
#define TDBLNKCUT(TYPE) TDoubleLinkCut<TYPE,CNullClass> // TDBLNKDESTROY(TDBLNK(CObject*))
#define TDBLNKFREE(TYPE) TDoubleLinkFree<TYPE,CNullClass> // TDBLNKFREE(TDBLNK(CObject*))
#define TDBLNKDESTROY(TYPE) TDoubleLinkDestroy<TYPE,CNullClass> // TDBLNKDESTROY(TDBLNK(CObject*))
#define TDBLNKTREE(TYPE) TDoubleLinkTreeRef<TYPE,CNullClass> // TDBLNKTREE(CObject*)
#if !defined(DO_VERIFY)
#ifdef _DEBUG
#define DO_VERIFY 0
#else // !_DEBUG
#define DO_VERIFY 0
#endif // _DEBUG
#endif // !defined(DO_VERIFY)
template <class TYPE, class BaseClass>
class TDoubleLinkRef : public BaseClass
{
public:
TYPE m_pPrev;
TYPE m_pNext;
public:
#if DO_VERIFY
void VerifyLinks(const TYPE& pHead) const
{
ASSERT(&pHead);
if (pHead) {
ASSERT(!pHead->m_pPrev);
TYPE pLink = (TYPE)this;
while(pLink != pHead) {
ASSERT(pLink);
pLink = pLink->m_pPrev;
}
while((pLink = pLink->m_pNext) != NULL)
;
} else {
ASSERT(!this);
}
}
#endif // DO_VERIFY
public:
TDoubleLinkRef()
{
m_pPrev = NULL;
m_pNext = NULL;
}
static TYPE CutHead(TYPE& pHead);
static void CutListAll(TYPE& pHead);
static void FreeListAll(TYPE& pHead);
static void DestroyListAll(TYPE& pHead);
int GetCount() const;
TYPE GetHead() const;
TYPE GetTail() const;
TYPE GetNeighbor(BOOL bNext);
TYPE GetTerminal(BOOL bNext);
BOOL CutCheck(TYPE& pHead);
TYPE Cut(TYPE& pHead);
void InsHead(TYPE& pHead);
void InsBefore(TYPE& pHead, TYPE pPrev = NULL);
void InsAfter(TYPE& pHead, TYPE pNext = NULL);
void AddTail(TYPE& pHead);
TYPE CutGroup(TYPE& pHead);
void InsHeadGroup(TYPE& pHead);
void InsGroup(TYPE& pHead, TYPE pPrev = NULL);
void AddTailGroup(TYPE& pHead);
};
template <class TYPE, class BaseClass>
TYPE TDoubleLinkRef<TYPE, BaseClass>::CutHead(TYPE& pHead)
{
#if DO_VERIFY
pHead->VerifyLinks(pHead);
#endif // DO_VERIFY
TYPE pLink = pHead;
if (pLink) {
ASSERT(!pLink->m_pPrev);
TYPE pLink2 = pLink->m_pNext;
if (pLink2) {
ASSERT(pLink2->m_pPrev == pLink);
pLink2->m_pPrev = NULL;
pLink->m_pNext = NULL;
}
pHead = pLink2;
}
return pLink;
}
template <class TYPE, class BaseClass>
void TDoubleLinkRef<TYPE, BaseClass>::CutListAll(TYPE& pHead)
{
#if DO_VERIFY
pHead->VerifyLinks(pHead);
#endif // DO_VERIFY
TYPE pLink;
while((pLink = CutHead(pHead)) != NULL)
;
}
template <class TYPE, class BaseClass>
void TDoubleLinkRef<TYPE, BaseClass>::FreeListAll(TYPE& pHead)
{
#if DO_VERIFY
pHead->VerifyLinks(pHead);
#endif // DO_VERIFY
TYPE pLink;
while((pLink = CutHead(pHead)) != NULL)
free(pLink);
}
template <class TYPE, class BaseClass>
void TDoubleLinkRef<TYPE, BaseClass>::DestroyListAll(TYPE& pHead)
{
#if DO_VERIFY
pHead->VerifyLinks(pHead);
#endif // DO_VERIFY
TYPE pLink;
while((pLink = CutHead(pHead)) != NULL)
delete pLink;
}
template <class TYPE, class BaseClass>
int TDoubleLinkRef<TYPE, BaseClass>::GetCount() const
{
int nCount = 0;
TYPE pLink = (TYPE)this;
while(pLink) {
nCount++;
pLink = pLink->m_pNext;
}
return nCount;
}
template <class TYPE, class BaseClass>
TYPE TDoubleLinkRef<TYPE, BaseClass>::GetHead() const
{
TYPE p = (TYPE)this;
if (p) {
TYPE pLink;
while((pLink = p->m_pPrev) != NULL)
p = pLink;
}
return p;
}
template <class TYPE, class BaseClass>
TYPE TDoubleLinkRef<TYPE, BaseClass>::GetTail() const
{
TYPE p = (TYPE)this;
if (p) {
TYPE pLink;
while((pLink = p->m_pNext) != NULL)
p = pLink;
}
return p;
}
template <class TYPE, class BaseClass>
TYPE TDoubleLinkRef<TYPE, BaseClass>::GetNeighbor(BOOL bNext)
{
ASSERT(this);
if (bNext)
return m_pNext;
return m_pPrev;
}
template <class TYPE, class BaseClass>
TYPE TDoubleLinkRef<TYPE, BaseClass>::GetTerminal(BOOL bNext)
{
if (bNext) {
return GetTail();
}
return GetHead();
}
template <class TYPE, class BaseClass>
BOOL TDoubleLinkRef<TYPE, BaseClass>::CutCheck(TYPE& pHead)
{
ASSERT(this);
TYPE pPrev = m_pPrev;
if (pPrev) {
#if DO_VERIFY
VerifyLinks(pHead);
#endif // DO_VERIFY
pPrev->m_pNext = m_pNext;
TYPE pNext;
if ((pNext = m_pNext) != NULL) {
pNext->m_pPrev = pPrev;
m_pNext = NULL;
}
m_pPrev = NULL;
return TRUE;
} else {
if (this == pHead) {
TYPE pNext = m_pNext;
pHead = pNext;
if (pNext) {
pNext->m_pPrev = NULL;
m_pNext = NULL;
}
return TRUE;
} else {
ASSERT(!m_pNext);
return FALSE;
}
}
}
template <class TYPE, class BaseClass>
TYPE TDoubleLinkRef<TYPE, BaseClass>::Cut(TYPE& pHead)
{
ASSERT(this);
#if DO_VERIFY
VerifyLinks(pHead);
#endif // DO_VERIFY
TYPE pPrev = m_pPrev;
TYPE pNext = m_pNext;
if (pPrev) {
pPrev->m_pNext = pNext;
if (pNext != NULL) {
pNext->m_pPrev = pPrev;
m_pNext = NULL;
}
m_pPrev = NULL;
} else {
ASSERT(this == pHead);
pHead = pNext;
if (pNext) {
pNext->m_pPrev = NULL;
m_pNext = NULL;
}
}
return pPrev;
}
template <class TYPE, class BaseClass>
void TDoubleLinkRef<TYPE, BaseClass>::InsHead(TYPE& pHead)
{
ASSERT(this && !m_pPrev && !m_pNext);
m_pNext = pHead;
if (pHead) {
pHead->m_pPrev = (TYPE)this;
}
pHead = (TYPE)this;
#if DO_VERIFY
VerifyLinks(pHead);
#endif // DO_VERIFY
}
template <class TYPE, class BaseClass>
void TDoubleLinkRef<TYPE, BaseClass>::InsBefore(TYPE& pHead, TYPE pPrev/* = NULL*/)
{
ASSERT(this && !m_pPrev && !m_pNext);
if (pPrev) {
TYPE pPrevPrev = pPrev->m_pPrev;
pPrev->m_pPrev = (TYPE)this;
m_pNext = pPrev;
if (pPrevPrev) {
pPrevPrev->m_pNext = (TYPE)this;
m_pPrev = pPrevPrev;
} else {
pHead = (TYPE)this;
}
#if DO_VERIFY
VerifyLinks(pHead);
#endif // DO_VERIFY
} else {
AddTail(pHead);
}
}
template <class TYPE, class BaseClass>
void TDoubleLinkRef<TYPE, BaseClass>::InsAfter(TYPE& pHead, TYPE pNext/* = NULL*/)
{
ASSERT(this && !m_pPrev && !m_pNext);
if (pNext) {
TYPE pNextNext = pNext->m_pNext;
pNext->m_pNext = (TYPE)this;
m_pPrev = pNext;
if (pNextNext) {
pNextNext->m_pPrev = (TYPE)this;
m_pNext = pNextNext;
}
#if DO_VERIFY
VerifyLinks(pHead);
#endif // DO_VERIFY
} else {
AddTail(pHead);
}
}
template <class TYPE, class BaseClass>
void TDoubleLinkRef<TYPE, BaseClass>::AddTail(TYPE& pHead)
{
ASSERT(this && !m_pPrev && !m_pNext);
if (pHead) {
TYPE pTail = pHead->GetTail();
ASSERT(pTail && !pTail->m_pNext);
pTail->m_pNext = (TYPE)this;
m_pPrev = pTail;
} else {
pHead = (TYPE)this;
}
#if DO_VERIFY
VerifyLinks(pHead);
#endif // DO_VERIFY
}
template <class TYPE, class BaseClass>
TYPE TDoubleLinkRef<TYPE, BaseClass>::CutGroup(TYPE& pHead)
{
if (this) {
#if DO_VERIFY
VerifyLinks(pHead);
#endif // DO_VERIFY
TYPE pPrev = m_pPrev;
if (pPrev) {
pPrev->m_pNext = NULL;
m_pPrev = NULL;
} else {
ASSERT(this == pHead);
pHead = NULL;
}
}
return (TYPE)this;
}
template <class TYPE, class BaseClass>
void TDoubleLinkRef<TYPE, BaseClass>::InsHeadGroup(TYPE& pHead)
{
if (this) {
ASSERT(!m_pPrev);
if (pHead) {
TYPE pTail = GetTail();
pTail->m_pNext = pHead;
pHead->m_pPrev = pTail;
}
pHead = (TYPE)this;
#if DO_VERIFY
VerifyLinks(pHead);
#endif // DO_VERIFY
}
}
template <class TYPE, class BaseClass>
void TDoubleLinkRef<TYPE, BaseClass>::InsGroup(TYPE& pHead, TYPE pPrev/* = NULL*/)
{
if (this) {
ASSERT(!m_pPrev);
if (pPrev) {
TYPE pNext = pPrev->m_pNext;
pPrev->m_pNext = (TYPE)this;
m_pPrev = pPrev;
if (pNext) {
TYPE pTail = GetTail();
pTail->m_pNext = pNext;
pNext->m_pPrev = pTail;
}
#if DO_VERIFY
VerifyLinks(pHead);
#endif // DO_VERIFY
} else {
InsHeadGroup(pHead);
}
}
}
template <class TYPE, class BaseClass>
void TDoubleLinkRef<TYPE, BaseClass>::AddTailGroup(TYPE& pHead)
{
if (this) {
ASSERT(!m_pPrev);
if (pHead) {
TYPE pTail = pHead->GetTail();
ASSERT(pTail && !pTail->m_pNext);
pTail->m_pNext = (TYPE)this;
m_pPrev = pTail;
} else {
pHead = (TYPE)this;
}
#if DO_VERIFY
VerifyLinks(pHead);
#endif // DO_VERIFY
}
}
template <class TYPE, class BaseClass>
class TDoubleLink : public BaseClass
{
public:
TYPE* m_pLinkStart;
public:
TDoubleLink()
{
m_pLinkStart = NULL;
}
~TDoubleLink()
{
ASSERT(!m_pLinkStart);
}
operator TYPE* () const { return m_pLinkStart; }
TYPE* CutHead()
{
return TYPE::CutHead(m_pLinkStart);
}
void CutListAll()
{
TYPE::CutListAll(m_pLinkStart);
}
void FreeListAll()
{
TYPE::FreeListAll(m_pLinkStart);
}
void DestroyListAll()
{
TYPE::DestroyListAll(m_pLinkStart);
}
int GetCount() const
{
return m_pLinkStart->GetCount();
}
TYPE* GetHead() const
{
return m_pLinkStart;
}
TYPE* GetTail() const
{
return m_pLinkStart->GetTail();
}
BOOL CutCheck(TYPE* pLink)
{
return pLink->CutCheck(m_pLinkStart);
}
TYPE* Cut(TYPE* pLink)
{
return pLink->Cut(m_pLinkStart);
}
void InsHead(TYPE* pLink)
{
pLink->InsHead(m_pLinkStart);
}
void InsBefore(TYPE* pLink, TYPE* pPrev = NULL)
{
pLink->InsBefore(m_pLinkStart, pPrev);
}
void InsAfter(TYPE* pLink, TYPE* pNext = NULL)
{
pLink->InsAfter(m_pLinkStart, pNext);
}
void AddTail(TYPE* pLink)
{
pLink->AddTail(m_pLinkStart);
}
TYPE* CutGroup(TYPE* pLink)
{
return pLink->CutGroup(m_pLinkStart);
}
void InsHeadGroup(TYPE* pLink)
{
pLink->InsHeadGroup(m_pLinkStart);
}
void InsGroup(TYPE* pLink, TYPE* pPrev = NULL)
{
pLink->InsGroup(m_pLinkStart, pPrev);
}
void AddTailGroup(TYPE* pLink)
{
pLink->AddTailGroup(m_pLinkStart);
}
TYPE* FindIndex(int nIndex) const
{
if (nIndex >= 0) {
TYPE* pLink = m_pLinkStart;
while(pLink) {
if (nIndex == 0) {
return pLink;
}
pLink = pLink->m_pNext;
nIndex--;
}
}
return NULL;
}
int Find(TYPE* pLink) const
{
if (pLink) {
int nIndex = 0;
TYPE* pLink2 = m_pLinkStart;
while(pLink2) {
if (pLink2 == pLink) {
return nIndex;
}
pLink2 = pLink2->m_pNext;
nIndex++;
}
}
return -1;
}
};
template <class TYPE, class BaseClass>
class TDoubleLinkCut : public TDoubleLink<TYPE, BaseClass>
{
public:
~TDoubleLinkCut()
{
Reset();
}
void Reset()
{
CutListAll();
}
void Del(TYPE* pLink)
{
CutCheck(pLink);
}
};
template <class TYPE, class BaseClass>
class TDoubleLinkFree : public TDoubleLink<TYPE, BaseClass>
{
public:
~TDoubleLinkFree()
{
Reset();
}
void Reset()
{
FreeListAll();
}
void Del(TYPE* pLink)
{
CutCheck(pLink);
free(pLink);
}
};
template <class TYPE, class BaseClass>
class TDoubleLinkDestroy : public TDoubleLink<TYPE, BaseClass>
{
public:
~TDoubleLinkDestroy()
{
Reset();
}
void Reset()
{
DestroyListAll();
}
void Del(TYPE* pLink)
{
CutCheck(pLink);
delete pLink;
}
};
template <class TYPE, class BaseClass>
class TDoubleLinkTreeRef : public TDoubleLinkRef<TYPE, BaseClass>
{
public:
TYPE m_pParent;
TYPE m_pChild;
public:
TDoubleLinkTreeRef()
{
m_pParent = NULL;
m_pChild = NULL;
}
#ifdef _DEBUG
~TDoubleLinkTreeRef()
{
ASSERT(!(m_pPrev || m_pNext || m_pParent));
}
#endif // _DEBUG
int CountChildren() const
{
return m_pChild->TDoubleLinkRef<TYPE, BaseClass>::GetCount();
}
int CountChildrenAll() const
{
if (this) {
TYPE pChild = m_pChild;
int nCount;
for(nCount = 0; pChild; nCount++) {
nCount += pChild->CountChildrenAll();
pChild = pChild->m_pNext;
}
return nCount;
}
return 0;
}
int CountParent() const
{
ASSERT(this);
TYPE pParent = m_pParent;
int nCount = 0;
while(pParent) {
nCount++;
pParent = pParent->m_pParent;
}
return nCount;
}
TYPE CutChild(TYPE pLink)
{
ASSERT(pLink->m_pParent == (TYPE)this);
TYPE pPrev = pLink->TDoubleLinkRef<TYPE, BaseClass>::Cut(m_pChild);
pLink->m_pParent = NULL;
return pPrev;
}
void InsChild(TYPE pLink)
{
pLink->TDoubleLinkRef<TYPE, BaseClass>::InsHead(m_pChild);
pLink->m_pParent = (TYPE)this;
}
void InsChildBefore(TYPE pLink, TYPE pPrev = NULL)
{
pLink->TDoubleLinkRef<TYPE, BaseClass>::InsBefore(m_pChild, pPrev);
pLink->m_pParent = (TYPE)this;
}
void AddChild(TYPE pLink)
{
pLink->TDoubleLinkRef<TYPE, BaseClass>::AddTail(m_pChild);
pLink->m_pParent = (TYPE)this;
}
TYPE CutChildren()
{
TYPE pChild = m_pChild;
m_pChild = NULL;
TYPE p = pChild;
while(p) {
p->m_pParent = NULL;
p = p->m_pNext;
}
return pChild;
}
void AddChildren(TYPE pChild)
{
if (pChild) {
ASSERT(!pChild->m_pPrev);
TYPE pTail = m_pChild->TDoubleLinkRef<TYPE, BaseClass>::GetTail();
if (pTail) {
pTail->m_pNext = pChild;
pChild->m_pPrev = pTail;
} else {
m_pChild = pChild;
}
while(pChild) {
ASSERT(!pChild->m_pParent);
pChild->m_pParent = (TYPE)this;
pChild = pChild->m_pNext;
}
}
}
static void DestroyAll(TYPE& pStart)
{
pStart->DestroyAll();
pStart = NULL;
}
void DestroyAll()
{
if (this) {
DestroyAllChildren();
if (m_pParent) {
m_pParent->CutChild((TYPE)this);
}
delete this;
}
}
void DestroyAllChildren()
{
ASSERT(this);
while(m_pChild) {
TYPE pChild = m_pChild;
CutChild(pChild);
pChild->DestroyAllChildren();
delete pChild;
}
}
void SetAtArray(TYPE* pArray, int& nIndex) const
{
// this is not included...
ASSERT(&nIndex);
if (this) {
TYPE pChild = m_pChild;
while(pChild) {
pArray[nIndex++] = pChild;
pChild->SetAtArray(pArray, nIndex);
pChild = pChild->m_pNext;
}
}
}
void MakeArray(TARRAY(TYPE)& aTree) const
{
aTree.Reset();
int nSize = CountChildrenAll();
int nIndex = 0;
SetAtArray(&aTree.Add(nSize), nIndex);
}
};
#endif // !defined(__DBLINKS__)
@@ -0,0 +1,89 @@
#if !defined(__DQFIXED__)
#define __DQFIXED__
#ifndef NULL_CLASS_DEFINED
#define NULL_CLASS_DEFINED
class CNullClass {};
#endif
template <class TYPE, int nMAX, class BaseClass>
class TDeQueueFixed : public BaseClass
{
protected:
int m_nStart, m_nEnd;
TYPE m_a[nMAX];
public:
TDeQueueFixed()
{
m_nStart = m_nEnd = 0;
}
~TDeQueueFixed()
{
}
static int GetMax() { return nMAX; }
int GetDataSize() const
{
return m_nEnd - m_nStart;
}
int GetFreeSize() const
{
return nMAX - (m_nEnd - m_nStart);
}
int GetFreeSizeEnd() const
{
return nMAX - m_nEnd;
}
TYPE* Prepare(int nSize)
{
if (GetFreeSize() >= nSize) {
if (nMAX - m_nEnd < nSize) {
memcpy(&m_a[0], &m_a[m_nStart], (m_nEnd - m_nStart) * sizeof(TYPE));
m_nEnd -= m_nStart;
m_nStart = 0;
}
int nEnd = m_nEnd;
m_nEnd += nSize;
return &m_a[nEnd];
} else {
return NULL;
}
}
int GetBegin(TYPE*& pbBegin) const
{
pbBegin = (TYPE*)&m_a[m_nStart];
return m_nEnd - m_nStart;
}
void CheckEmpty()
{
if (m_nStart >= m_nEnd) {
m_nStart = m_nEnd = 0;
}
}
void RemoveBegin(int nSize)
{
m_nStart += nSize;
CheckEmpty();
}
void RemoveEnd(int nSize)
{
m_nEnd -= nSize;
CheckEmpty();
}
BOOL AddData(const TYPE* pData, int nSize)
{
TYPE* pDest = Prepare(nSize);
if (pDest) {
memcpy(pDest, pData, nSize * sizeof(TYPE));
}
return pDest;
}
void FreeAll()
{
m_nStart = m_nEnd = 0;
}
};
#endif // !defined(__DQFIXED__)
@@ -0,0 +1,31 @@
// find the ground relative to this camera pos
Point3D worldPos;
worldPos = m_FixedPoint;
Stuff::Normal3D normal;
Stuff::Line3D line;
CollisionQuery query(&line, &normal, CanBeWalkedOnFlag, this);
line.m_length = 150.0f;
line.m_direction = Vector3D(0.0f, -1.0f, 0.0f);
line.m_origin = worldPos;
// push well up above the ground before looking for collision
line.m_origin.y += 50.0f;
Adept::Entity *entityHit;
Check_Object(CollisionGrid::Instance);
entityHit = CollisionGrid::Instance->ProjectLine(&query);
float groundOffsetY = 0.0f;
if(entityHit != NULL)
{
line.FindEnd(&worldPos);
groundOffsetY = (worldPos.y + offsetY);
}
// distance our camera from the ground
Point3D tempPnt1, tempPnt2;
tempPnt1 = m_FixedPoint;
tempPnt1.y = 0.0f;
tempPnt2.AddScaled(tempPnt1, Vector3D::Up, groundOffsetY);
@@ -0,0 +1,6 @@
page=startup_ini.FindPage("msr spectator stuff");
if(page!=NULL)
{
page->GetEntry("testMSR",&SpectatorEngine::testIniVal);
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,80 @@
#ifdef WIN32
#define _WINSOCKAPI_ /* Prevent inclusion of winsock.h in windows.h */
#pragma warning(disable:4201)
#endif // WIN32
#ifdef IRIX
#define _BSD_SIGNALS
#include <fcntl.h>
/* #include <stropts.h> */
#endif
#include <stdio.h>
#include <time.h>
#include <sys/types.h>
#include <errno.h>
#include <string.h>
#include <stdarg.h>
#ifdef WIN32
//#include <winsock.h>
#include <winsock2.h>
#else
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <sys/signal.h>
#include <sys/wait.h>
#include <sys/time.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#endif
#ifdef CHECK_ASSERT_VALID
#define CHECK_ASSERT_VALID(expr) (expr)
#endif // CHECK_ASSERT_VALID
#ifndef TRACE
#define TRACE(x)
#endif // TRACE
#ifndef ASSERT
#define ASSERT(x)
#endif // ASSERT
#include "stddefs.h"
#include "array.inl"
#include "dblinks.inl"
#include "qsort.inl"
#include "bsearch.inl"
#include "dqfixed.inl"
DECLARE_CLASS(TEXTFmt);
DECLARE_CLASS(DAPacket);
DECLARE_CLASS(TimerEvent);
DECLARE_CLASS(TimerPool);
DECLARE_CLASS(PacketDumper);
DECLARE_CLASS(PacketDump);
DECLARE_CLASS(Packet);
DECLARE_CLASS(PacketAuto);
DECLARE_CLASS(Broadcast);
DECLARE_CLASS(SockAddr);
DECLARE_CLASS(FileTransfer);
DECLARE_CLASS(FTPArray);
DECLARE_CLASS(SOC);
DECLARE_CLASS(SOCListen);
DECLARE_CLASS(SOCConnect);
DECLARE_CLASS(SOCClient);
DECLARE_CLASS(SOCServer);
DECLARE_CLASS(FDSet);
DECLARE_CLASS(Droppings);
DECLARE_CLASS(SOCManager);
DECLARE_CLASS(SOCSystem);
#include "cstr.h"
#include "mugsocs.h"
#ifdef WIN32
#pragma warning(default:4201)
#endif // WIN32
File diff suppressed because it is too large Load Diff
Binary file not shown.
@@ -0,0 +1,503 @@
[Class Tree]
Signature
AttributeTable
AverageOf<>
Chain
ChainOf<>
ChainIterator
ChainIteratorOf<>
ChainLink
CMoveData
CFleeData
CFollowData
CLookoutData
CMoveLocPointData
CMoveObjectData
CPatrolData
CRigidPatrolData
CSemiPatrolData
CSitData
CollisionQuery
Entity__CollisionQuery
CommandEntry
Die
Directory
Effect__Specification
EffectLibrary
ResourceEffectLibrary
Entity__CollisionData
FileStreamManager
GOSImagePool
ResourceImagePool
TGAFilePool
Iterator
SocketIterator
SafeIterator
SafeChainIterator
SortedIterator
HashIterator
SortedChainIterator
SortedChainIteratorOf
TableIterator
TableIteratorOf
TreeIterator
Line3D
Link
SafeChainLink
SlotLink
SortedChainLink
SortedChainLinkOf<>
TableEntry
TableEntryOf<>
TreeNode
TreeNodeOf<>
MemoryBlockBase
MemoryBlock
MemoryBlockOf<>
MemoryStack
MemoryStackOf<>
MLRStateBase
MLRState
ModelAttributeTable
MString
NotationFile
ObjectNameList
NameList
AlphaNameList
Random
ReadOnlyArrayOf<>
DynamicArrayOf<>
RegisteredClass
MemoryStream
DynamicMemoryStream
FileStream
Resource
MLRTexturePool
Plug
AbstractEvent
Event
NetworkEvent
AdeptNetMissionParameters
MWNetMissionParameters
AnimationState
TransitionState
AnimationTrigger
AnimationTriggerManager
AnimHierarchyIteratorManager
AnimHierarchyNode
AnimInstance
AnimInstanceManager
AnimIterator
ApplicationTask
CPathManager
FryDeathRowTask
ProcessEventTask
RouteLocalPacketsTask
RoutePacketsTask
AttributeEntry
DirectStateAttributeEntry
IndirectStateAttributeEntry
BackgroundTasks
ControlsInstance
DirectControlsInstance
EventControlsInstance
EventControlsInstanceOf<>
ControlsMappingGroup
ControlsUpdateManagerOfOf<>
DecalEntry
Dictionary
DictionaryManager
DictionaryPage
DictionaryParagraph
Effect
Element
LineCloudElement
ScreenQuadsElement
EntityManager
MWEntityManager
EntityStockpile
Event
Feature_Texture
Tool_Feature_Texture
FileDependencies
FootStepPlug
GeneralEventQueue
EventQueue
GOSImage
GUIGroup
GUIManager
MWGUIManager
HeatObject
IdleEffectObject
MechPrototype
MemoryDiffKiller
MLRTexture
MLRMovieTexture
ModelAttributeEntry
MWOptions
NameTable
NameTableEntry
Note
Page
QuadIndexObject
QuedPacket
ReactionSphere
FogReactionSphere
HeatReactionSphere
InstantHeatReactionSphere
RadarReactionSphere
Receiver
Component
ControlsManager
CRailGraph
GUIObject
GUITextObject
HeatManager
InBox
Application
MWApplication
Connection
Network
Renderer
VideoRenderer
RendererManager
Replicator
Entity
Driver
AI
MoverAI
CombatAI
MechAI
PlayerAI
Player
MWPlayer
Interface
VehicleInterface
Mission
MWMission
Mover
Effect
Beam
DebrisCloud
ParticleCloud
SpinningCloud
PointLight
Singleton
Card
Flare
MWMover
MWObject
Building
Bridge
Turret
NavPoint
Flag
NonCom
Vehicle
Airplane
Helicopter
Dropship
Boat
Hovercraft
Mech
MFB
FieldBase
ObservationVehicle
Tank
Team
Truck
WeaponMover
Explosive
FlameMover
LBXMover
Missile
StickyMover
ArtilleryMark
Narc
Path
Subsystem
Engine
Torso
Weapon
BeamWeapon
BombastWeapon
ProjectileWeapon
ArtilleryWeapon
FlamerWeapon
FlareWeapon
HighExplosiveWeapon
LBXWeaponSub
MissileWeapon
BombWeaponSubsystem
LongTomWeaponSubsystem
LRMWeaponSubsystem
MRMWeaponSubsystem
SRMWeaponSubsystem
SSRMWeaponSubsystem
NarcWeapon
ResourceFile
ResourceManager
ScoreObject
ScreenQuadObject
StateEngine
AnimationStateEngine
MechAnimationStateEngine
ApplicationStateEngine
Entity__ExecutionStateEngine
Mover__ExecutionStateEngine
MWMover__ExecutionStateEngine
Vehicle__ExecutionStateEngine
Airplane__ExecutionStateEngine
Dropship__ExecutionStateEngine
Mech__ExecutionStateEngine
PlayerAI__ExecutionStateEngine
Subsystem__ExecutionStateEngine
VehicleInterface__ExecutionStateEngine
VehicleCommand
WeaponUpdate
RegisteredClass__ClassData
Effect__ClassData
Element__ClassData
Receiver__ClassData
Replicator__ClassData
Entity__ClassData
MWObject__ClassData
StateEngine__ClassData
Entity__ExecutionStateEngine__ClassData
Socket
SafeSocket
SafeChain
SafeChainOf<>
SortedSocket
Hash
HashOf<>
SortedChain
SortedChainOf<>
Table
TableOf<>
Tree
TreeOf<>
Slot
SphereTest
StaticArrayOf
Tool
MWTool
[Receiver MessageID]
Receiver
InBox
Connection
Application
Replicator
Entity
Interface
VehicleInterface
Driver
AI
MoverAI
CombatAI
PlaneAI
MechAI
PlayerAI
ShooterAI
NonComAI
Alpha
Beta
Gamma
TestControlsReceiver
VehicleInterface enum {
ChangeViewMessageID = Adept::Interface::NextMessageID,
JoyStickButton1MessageID,
GetUpCommandMessageID,
ShutDownCommandMessageID,
CrouchCommandMessageID,
JumpCommandMessageID,
AnimDiagTest1MessageID, // anim diag test 1
AnimDiagTest2MessageID,
AnimDiagTest3MessageID,
AnimDiagTest4MessageID,
AnimDiagTest5MessageID,
AnimDiagTest6MessageID,
AnimDiagTest7MessageID,
AnimDiagTest8MessageID,
DebugTextMessageID,
Lancemate1MessageID,
Lancemate2MessageID,
Lancemate3MessageID,
LancemateAllMessageID,
LancemateAttackMyTargetMessageID,
LancemateDefendMyTargetMessageID,
LancemateFormOnMeMessageID,
LancemateHoldFireMessageID,
LancemateGoToMyNavPointMessageID,
LancemateStopMessageID,
LancemateShutdownMessageID,
LancemateAttackNearestThreatMessageID,
LancemateRepairAtNearestRepairBayMessageID,
LancemateCapturePlayersFlagMessageID,
ChangeWeaponModeMessageID,
WeaponGroup1MessageID,
WeaponGroup2MessageID,
WeaponGroup3MessageID,
WeaponGroup4MessageID,
WeaponGroup5MessageID,
WeaponGroup6MessageID,
NextWeaponGroupMessageID,
PreviousWeaponGroupMessageID,
NextWeaponMessageID,
TopDownViewMessageID,
ToggleInvulnerableMessageID,
KillCurrentTargetMessageID,
NextVehicleMessageID,
ToggleSearchLightMessageID,
SelfDestructMessageID,
CoolantMessageID,
SendChatMessage1MessageID,
SendChatMessage2MessageID,
SendChatMessage3MessageID,
SendChatMessage4MessageID,
ToggleLightAmpMessageID,
ToggleHUDMessageID,
ToggleMultiplayerScoringMessageID,
NextNavPointMessageID,
PreviousNavPointMessageID,
NextEnemyMessageID,
PreviousEnemyMessageID,
NearestEnemyMessageID,
TargetReticuleEnemyMessageID,
ToggleRadarRangeMessageID,
ForwardMessageID,
BackwardMessageID,
RotateLeftMessageID,
RotateRightMessageID,
OriginMessageID,
TorsoTwistLeftMessageID,
TorsoTwistRightMessageID,
PitchUpMessageID,
PitchDownMessageID,
ReverseMessageID,
FireWeaponMessageID,
LookLeftMessageID,
LookRightMessageID,
LookBackMessageID,
LookDownMessageID,
CameraDetachMessageID,
CameraResetMessageID,
CameraTerrainMessageID,
CameraTargetReticuleMessageID,
CameraPitchUpMessageID,
CameraPitchDownMessageID,
CameraRollRightMessageID,
CameraRollLeftMessageID,
CameraYawLeftMessageID,
CameraYawRightMessageID,
CameraPanUpMessageID,
CameraPanDownMessageID,
CameraPanLeftMessageID,
CameraPanRightMessageID,
CameraZoomInMessageID,
CameraZoomOutMessageID,
Throttle0MessageID,
Throttle10MessageID,
Throttle20MessageID,
Throttle30MessageID,
Throttle40MessageID,
Throttle50MessageID,
Throttle60MessageID,
Throttle70MessageID,
Throttle80MessageID,
Throttle90MessageID,
Throttle100MessageID,
CenterTorsoToLegsMessageID,
CenterLegsToTorsoMessageID,
NextFriendlyMessageID,
PreviousFriendlyMessageID,
NearestFriendlyMessageID,
ToggleZoomReticuleMessageID,
ShowObjectivesMessageID,
MuteMessageID,
MouseTorsoToggleMessageID,
MouseDeltaToggleMessageID,
// AutoPilotMessageID,
EjectMessageID,
OverrideAutoCenterToTorsoMessageID,
ToggleRadarPassiveMessageID,
ShowMapMessageID,
StartChatMessageID,
StartTeamChatMessageID,
OverrideShutdownMessageID,
LeftMFDMessageID,
RightMFDMessageID,
ToggleMouseControlMessageID,
ToggleLargeChatMessageID,
ShutDownOnlyCommandMessageID,
StartUpOnlyCommandMessageID,
TakeSnapShotMessageID,
ToggleGroup1MessageID,
ToggleGroup2MessageID,
ToggleGroup3MessageID,
ToggleGroup4MessageID,
ToggleGroup5MessageID,
ToggleGroup6MessageID,
ToggleGroupWeaponModeMessageID
//
// Section for keys we don't want in the release build
//
,
DebugFastMessageID,
FreezeGameLogicMessageID,
ImmediateWeaponLockModeMessageID,
SucceedMissionMessageID,
FailMissionMessageID,
ToggleDebugHudMessageID,
NextMessageID
};
Application enum {
LoadQuickGameMessageID = InBox::NextMessageID,
SaveQuickGameMessageID,
PauseGameMessageID,
NextMessageID
};
Connection enum {
ReplicateMessageID = InBox::NextMessageID,
ReplicatorMessageID,
NextMessageID
};
TestControlsReceiver enum {
KeyboardMessageID=Receiver::NextMessageID,
JoystickMessageID,
NextMessageID
};
Entity enum {
UpdateMessageID = Replicator::NextMessageID,
TakeDamageMessageID,
BecomeInterestingMessageID,
NextMessageID
};
Alpha enum {
Method0MessageID = Receiver::NextMessageID,
Method1MessageID,
NextMessageID
};
Beta enum {
Method2MessageID=Alpha::NextMessageID,
Method3MessageID,
NextMessageID
};
Gamma enum {
Method4MessageID=Beta::NextMessageID,
NextMessageID
};
Replicator enum {
DestroyMessageID = Receiver::NextMessageID,
NextMessageID
};
Receiver enum {
AnyMessageID=0,
DefaultMessageID,
NextMessageID
};
@@ -0,0 +1,237 @@
[Mission Review]
움직임 정보 - 이동, 회전, 몸통회전, 셨다운
무기 발사 - 누가 어디를 향하여 무엇을 발사.
데미지 정보 - 누구의 무슨 무기에 어디를 가격 당함...
충돌 정보 - 누가 누구(어떤 빌딩)의 어디 부분에 부딪혀서 얼마의 데미지
이젝트 - 누가 이젝트
리스폰 - 어디에 누가 리스폰...
사용자 및 멕 상태...
[Score Sheet]
콘솔에서 프린트하기
[Console]
중간에 게임 캔슬하기.
RecScore(const ReplicatorID& who, const ReplicatorID& whom, int nType, UINT uWhere, UINT uBy, DWORD dwParam)
Mech::PostCollisionExecute
Mech::ReactToDestruction
ScoringReactToMechDeath
Entity::TakeDamage
ReactToDamageTaken
CBucketManager::UpdateFrame
CBucketManager::UpdateObjectiveFrame
--Flag::IncrementScore
MWInternalDamageObject::_TakeDamage
Mech::TakeDamageMessageHandler
Mech::ReactToHit
Mech::ReactToDamageTaken
[binary파일들]
.obb
netclientservercontoller.cpp 443line "// jcem - Verify(fabs(time_dif) > 0.0f);"
ElementRenderer::GroupElement::SetSyncState() - 380line
adept/tile.cpp "Verify(enter >= 0.0f && enter <= leave);" 65line
void VehicleInterface::SetGUITarget(Entity* target)
{
if (g_pCurTOC) {
Entity* oldTarget = m_interfaceTarget.GetCurrent();
if (oldTarget) {
g_LastTarget = oldTarget->GetReplicatorID();
} else {
g_LastTarget = g_null_repid;
}
}
Libraries/Adept/UserInterface.cpp
/Adept/Application.cpp
Code\MW4GameEd2\MW4GameEd2.cpp & stdafx.h
scriptstrings.rc IDS_MP_BOT_NAME "Player Name:"
// jcem - start
if (CTCL_IsConsole()) {
extern bool InNetworkGame;
extern bool IAmTheServer;
InNetworkGame=0;
IAmTheServer=0;
}
ReplicatorID base_id;
if (!CTCL_IsConsole()) // jcem
base_id = Connection::Local->GetNextReplicatorID();
int __stdcall CTCL_IsTeslaUsed(void* instance, int args, void* data[])
GetLeader()...
-> "AI_Lancemate.cpp" AI_SquadOrders.hpp
mwapplication.cpp
// team order
MESSAGE_NAME(MechWarrior4::MWApplication::TeamOrderMessageID);
MESSAGE_NAME(MechWarrior4::MWApplication::svrTeamOrderMessageID);
MESSAGE_NAME(MechWarrior4::MWApplication::RepTeamOrderMessageID);
MESSAGE_NAME(MechWarrior4::MWApplication::svrRepTeamOrderMessageID);
// team order
BOOL g_bExitGameOS_via_exit = TRUE;
GameOS/ImageHlp.cpp & GameOS/Libraries.cpp// directory settings...
GameOS/WinMain.cpp
// 鉉 - start
if (g_pfnRIO_Proc) {
(*g_pfnRIO_Proc)();
}
// 鉉 - end
GameOS/WinProc.cpp
// 鉉
case WM_USER + 100:
{
// 鉉 - start
if (g_pfnRIO_ButtonEvent) {
(*g_pfnRIO_ButtonEvent)((BYTE*)&lParam);
}
// 鉉 - end
}
break;
AddToLancemateGroup
void MWMission::CreateLancemateGroups()
void Vehicle::ProcessCommand(int command)
MWPlayer::LancemateCommandProxy::IssueCommand(Vehicle* v, MW4AI::LancemateCommands::ID command)
void LancemateCommands::Execute(ID command, const lancemate_list& lancemates)
void ExecuteForAllLancemates(const lancemate_list& lancemates, LancemateCommands::ID command_id)
inline MW4AI::SquadOrders* CombatAI::GetSquadOrders()
bool LancemateSquadOrders::CanExecuteCommands() const
Stuff::Auto_Ptr<LancemateCommands::LancemateCommand> LancemateSquadOrders::CreateCommand(LancemateCommands::ID command_id)
Stuff::Auto_Ptr<LancemateCommands::LancemateCommand> LancemateCommands::CreateLancemateCommand(ID command,
LancemateCommand::LancemateCommand(CombatAI& combat_ai,
bool LancemateSquadOrders::ShouldRunScript() const
EntityManager::PreCollisionExecute(Time till)
ResolveReactionSpheres();
Mission::PreCollisionExecute(Time till)
Entity::PreCollisionExecute(Time till) <- mwmap(m_executingAIs) - MechAI - CombatAI
void CombatAI::PreCollisionExecute(Stuff::Time till)
void CombatAI::Update(Stuff::Time till)
void CombatAI::UpdateSquad()
void Group::UpdateAI(CombatAI& combat_ai)
m_SquadAI->Update(*this,combat_ai);
m_SquadOrders->Update();
{FRIENDLY|ENEMY}_COMPONENT_{KILLS|DEATHS}
KILLS|SUICIDES|DEATHS=>KILLS_BY_TONNAGE|FRIENDLY_KILLS_BY_TONNAGE|ENEMY_KILLS_BY_TONNAGE
DFA
LEG_SHOTS,ARM_SHOTS,TORSO_SHOTS,HEAD_SHOTS
DAMAGE_RECEIVE,DAMAGE_INFLICT=ENEMY_DAMAGE_RECEIVE,ENEMY_DAMAGE_INFLICT,FRIENDLY_DAMAGE_RECEIVE,FRIENDLY_DAMAGE_INFLICT
[todo]
Score Sheet
Cameraship
hsh/*.bmp들을 resource들로....
Console
Weapon Assignment - ok
Team Ordering -ok
RGB 분리-ok
[todo]
비디오 카드 종류 디스플레이하는 문제.
콘솔에서 Skin 선택문제
전에 버추얼월드에서 ctcl.ini에 관하여 수정사항 보내준 문서...
사용자 Mech Sync문제
콘솔에서 맵을 바꾸었을 때 팀 갯수가 제대로 Refresh되지 않음.
Console에서 현재 게임에 대한 정보(남은시간, 게임이름, 게임 상태)
클라이언트로 참여한 후 CGameList::~CGameList의 filter지울 때 문제
게임 만들기/참여 등에서 문제가 생겨서 StartMainShell해야 되는 경우...
/////
shell.script
mainmenu.script -> callback($$SetShellCommand$$, START_NETWORK_SHELLS_COMMAND) & @SHELL@currentScreen = LAUNCHGAME
MW4Shell::StartNetworkShellsCommand
mw4shell.cpp -> StartNetworkStartupScreen
Adept::gos_NetStartGame
Multiplayer/MultiplayerConsole.script
// init
callback($$CancelDialup$$)
callback($$LoadMPConnectionSettings$$) -> load all m4c*(==name).m4c
callback($$InitConnectionWizard$$) -> set 0 index or create new connection file & load
// on button(host or connect)
$$ConnectionIndex$$ = o_connections_droplist.nselected
callback($$PreConnect$$)
callback($$GetDialupConnectionStatus$$)
Multiplayer/Hostgame1.script or Multiplayer/Listofgames.script
[bugs]
file:
line(101): o_thumbslide_skins.region = 0,-2 to buttonwidth,o_thumbslide_skins.handleheight+2
* replace o_downarrow_skins.handleheight with o_thumbslide_skins.handleheight
scriptkeywords.cpp(6042):
아래의 내용이 중복?...
if( *pLine=='(' )
{
FoundOpen=1;
pLine++;
}
[stlport를 사용하는 프로젝트]
stuff
map:NotationFile.*
Adept
vector:control_mapping.*, controls.*
ElementRenderer
map:gosFXElement.* <- GosFX::EffectLibrary.*
GosFX
map:EffectLibrary.*
MW4
vector,slist,map,list,stack
::sort, ::reverse, ::binary_function
[빌드과정에서 미심적은 부분]
Content/Textures/Maps/Lunar02/CA|CB|CC
Content/Textures/Customdecals/cstmdcal.txt
Maps/Misc
[Build에 관한 사항]
Script로 구현
Target
기본 함수 - Directory & Wild Card
Macro - Param
Except
exclude - Duplicated
filtering
compression - w/ param
encryption
[!4] MissionLang/StlPort
[stdcall] GameOS/GamePlatform/Gosscript/ImageLib/MFCPlatform
jgarbarini@virtualworld.com
mlowrance@virtualworld.com
@@ -0,0 +1,108 @@
#ifdef _DEBUG
#define AssertDebugBreak() _asm { int 3 }
inline BOOL AssertDialog(const char* pcszExpr, const char* pcszfile, int nLine)
{
char szBuf[MAX_PATH * 2];
sprintf(szBuf, "\"%s\" 파일의 %d줄에서 ASSERT!!!\n\n디버깅을 하시겠습니까?", pcszfile, nLine);
#ifdef WIN32
return ::MessageBox(NULL, szBuf, pcszExpr, MB_YESNO) == IDYES;
#else // !WIN32
return FALSE;
#endif // WIN32
}
inline BOOL __cdecl AssertReturnFALSE()
{
return FALSE;
}
#ifndef ASSERT
#define ASSERT(x) { if (!(x)) AssertDialog(#x, THIS_FILE, __LINE__); }
#endif
#define ASSERT_FALSE() ASSERT(AssertReturnFALSE())
#ifndef VERIFY
#define VERIFY(x) { if (!(x)) AssertDialog(#x, THIS_FILE, __LINE__); }
#endif
#ifndef TRACE
inline int __DbgTrace(const char* pcszFormat, ...)
{
va_list ap;
va_start(ap, pcszFormat);
char caBuffer[1024];
vsprintf(caBuffer, pcszFormat, ap);
va_end(ap);
::OutputDebugString(caBuffer);
return 0;
}
#define TRACE __DbgTrace
#endif
#ifndef THIS_FILE
#define THIS_FILE __FILE__
#endif // !THIS_FILE
#ifndef BASED_CODE
#define BASED_CODE
#endif // !BASED_CODE
#ifdef malloc
#undef malloc
#undef calloc
#undef realloc
#undef _expand
#undef free
#undef _msize
#endif
#define malloc(s) _malloc_dbg(s, _NORMAL_BLOCK, THIS_FILE, __LINE__)
#define calloc(c, s) _calloc_dbg(c, s, _NORMAL_BLOCK, THIS_FILE, __LINE__)
#define realloc(p, s) _realloc_dbg(p, s, _NORMAL_BLOCK, THIS_FILE, __LINE__)
#define _expand(p, s) _expand_dbg(p, s, _NORMAL_BLOCK, THIS_FILE, __LINE__)
#define free(p) _free_dbg(p, _NORMAL_BLOCK)
#define _msize(p) _msize_dbg(p, _NORMAL_BLOCK)
//----------------------------------------------------------------------------------------------------------
inline void* __cdecl operator new(size_t nSize, LPCSTR lpszFileName, int nLine)
{
void* p = _malloc_dbg(nSize, _NORMAL_BLOCK, lpszFileName, nLine);
return p;
}
inline void __cdecl operator delete(void* p, LPCSTR lpszFileName, int nLine)
{
_free_dbg(p, _NORMAL_BLOCK);
}
//----------------------------------------------------------------------------------------------------------
#ifndef _AFX
#define DEBUG_NEW new //(THIS_FILE, __LINE__)
#define DEBUG_DELETE delete //(THIS_FILE, __LINE__)
#endif
#else // !_DEBUG
#define ASSERTDLG_PUSH(hWnd)
#define ASSERTDLG_POP()
#ifndef ASSERT
#define ASSERT(x)
#endif
#define ASSERT_FALSE()
#ifndef VERIFY
#define VERIFY(x) x
#endif
#ifndef TRACE
inline int __DbgTraceIgnore(const char* pcszFormat, ...) { &pcszFormat; return 0; }
#define TRACE 1 ? 0: __DbgTraceIgnore
#endif
#endif // _DEBUG
@@ -0,0 +1,85 @@
//Microsoft Developer Studio generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_MW4ICON ICON DISCARDABLE "res\\Mech4.ico"
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE DISCARDABLE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE DISCARDABLE
BEGIN
END
3 TEXTINCLUDE DISCARDABLE
BEGIN
"\r\n"
"#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
"#ifdef _WIN32\r\n"
"LANGUAGE 9, 1\r\n"
"#pragma code_page(1252)\r\n"
"#endif //_WIN32\r\n"
"#include ""res\\MW4GameEd.rc2"" // non-Microsoft Visual C++ edited resources\r\n"
"#endif\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE 9, 1
#pragma code_page(1252)
#endif //_WIN32
#include "res\MW4GameEd.rc2" // non-Microsoft Visual C++ edited resources
#endif
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED
@@ -0,0 +1,194 @@
#if !defined(__RECSCORE_H__)
#define __RECSCORE_H__
#define MAX_SCORE_PACK 100
#define MAX_SCORE_PACK_PER_FRAME 2000
struct SRecScore;
class CRecScorePack;
class CRecScoreObject;
class CRecScoreFull;
extern const char* g_pcszGameDataSavePath;
extern const char* g_pcszGameDataExtPR;
void GetFileName4GUID(char szBuf[256], const char* pcszPath, const char* pcszExt, const GUID& guid = *(const GUID*)NULL);
#define MW4PRINT_COPYDATA_META 0xf4f72a54
#pragma pack(push, 1)
class MW4PRINT_COPYDATASTRUCT : public COPYDATASTRUCT
{
public:
GUID m_GUID;
char m_szFile[256];
};
#pragma pack(pop)
#pragma pack(push, 4)
union PART_WHERE
{
public:
int m_nWhere;
struct {
int m_xWhere: 8;
int m_xMasks: 24;
};
public:
void SetWhere(int nWhere);
void SetMask(int nWhere);
};
struct SRecScore
{
public:
int m_nType; // CBucketManager::Bucket_Type
ReplicatorID m_who;
ReplicatorID m_whom;
int m_nBy;
PART_WHERE m_Where;
union {
DWORD m_dwParam;
int m_nParam;
void* m_pParam;
float m_fTime;
};
};
class CRecScorePack
{
public:
CRecScorePack* m_pPrev;
CRecScorePack* m_pNext;
int m_nCount;
SRecScore m_a[MAX_SCORE_PACK];
public:
CRecScorePack();
~CRecScorePack();
int GetMemSize() const;
void Save(DynamicMemoryStream& mf);
void Load(MemoryStream& mf);
};
class CRecScoreFull;
class CRecScoreObject
{
public:
CRecScoreFull* m_pRSF;
CRecScoreObject* m_pPrev;
CRecScoreObject* m_pNext;
bool m_bRemoved;
// player info
bool m_bBOT;
ReplicatorID m_who;
MString m_strName;
MString m_strMech;
// Mech Info...
int m_nPilotTeam;
int m_nTeamDecal;
int m_nPilotDecal;
// Score...
int m_nScore;
int m_nKills;
int m_nDeaths;
public:
CRecScoreObject(CRecScoreFull* pRSF);
#if !defined(MW4PRINT)
CRecScoreObject(CRecScoreFull* pRSF, const Mech* pMech, const char* pcszName, const char* pcszMech, int nPilotTeam, int nTeamDecal, int nPilotDecal);
#endif // !defined(MW4PRINT)
~CRecScoreObject();
const char* GetName() const;
const char* GetMech() const;
bool CheckRemove();
int GetMemSize() const;
void Save(DynamicMemoryStream& mf, DWORD dwMeta);
void Load(MemoryStream& mf, DWORD dwMeta);
};
typedef CRecScoreObject* PRecScoreObject;
typedef const CRecScoreObject* PCRecScoreObject;
class CRecScoreFull
{
public:
int m_nState;
SYSTEMTIME m_SysTime;
int m_nMissionParamSize;
BYTE* m_pMissionParam;
bool m_bTeamGame;
CRecScoreObject* m_pScoreObjects;
int m_nCount;
float m_fFrameTime;
int m_naTeamScores[8];
CRecScorePack* m_pScorePackStart;
struct SPVP_Rec
{
public:
ReplicatorID m_Inf;
ReplicatorID m_Rcv;
int m_nKills;
int m_nScore;
};
int m_nPVPs;
SPVP_Rec* m_pPVPs;
public:
static int s_nLang;
public:
CRecScoreFull();
~CRecScoreFull();
static void CheckLanguage();
#if !defined(MW4PRINT)
static MWApplication* Check();
#endif // !defined(MW4PRINT)
bool IsValidData() const;
void Reset();
void Loading();
void Loaded();
void Starting();
void Started();
void StartFrame();
void StopFrame();
void ReduceFrame();
void Stopping();
void Stopped();
int GetTotalRECs() const;
int CalcKillsAndDeaths(ReplicatorID who, ReplicatorID whom) const;
int CalcKillsAndDeathsForTeam(int nTeam, ReplicatorID id, bool bKill) const;
int GetTeamScore(int nTeam) const;
int RelativeGetScore4Player(const ReplicatorID& me, const ReplicatorID& whom, int& nKills, int& nDeaths) const; // jcem
void Snap();
CRecScoreObject& FindReplicatorID(ReplicatorID who) const;
#if !defined(MW4PRINT)
void AddScoreObject(Mech* pMech, const char* pcszName, int nPilotTeam, int nTeamDecal, int nPilotDecal);
void RemoveScoreObject(Mech* pMech);
#endif // !defined(MW4PRINT)
SRecScore* AddRecScore();
void RecScore(int nType, ReplicatorID who, ReplicatorID whom = ReplicatorID::Null, int nBy = 0, int nWhere = 0, DWORD dwParam = 0);
#ifdef _DEBUG
void AddString(const SRecScore& RS) const;
#endif // _DEBUG
int AddString(MString& str, const SRecScore& RS, const CRecScoreObject& For) const;
MString* MakeInfoTable(PCRecScoreObject aRSOs[], int nPlayers, const int naTeams[8], int nTeamCount) const;
int DoPrint() const;
bool CheckTableFont(HDC hDC, const RECT& rcDraw, const POINT& DPI, const MString* pInfoTable, int nPlayers, int nTeamCount, int naColWidths[], int& nCellTextHeight) const;
void DrawTable(HDC hDC, const MString* pInfoTable, const int naX[], const int naY[], const int nTableCols, const int nTableRows, const int nInvCol, const int nInvRow) const;
void DoPrint(HDC hDC, const RECT& rcDraw, const POINT& DPI, int nCurPlayer, const MString* pInfoTable, const int naColWidths[], int nCellTextHeight, int nRow, PCRecScoreObject aRSOs[], int nPlayers, const int naTeams[8], int nTeamCount, int nTotals, const void* pParams) const;
int GetMemSize() const;
bool SavePR(const char* pcszFile);
bool LoadPR(const char* pcszFile);
void LoadPrintParams() const;
void LoadPrintParam(const char* pcszINI, const char* pcszKey, long& lValue, int nDef, int nMin, int nMax) const;
void LoadPrintParam(const char* pcszINI, const char* pcszKey, int& nValue, int nDef, int nMin, int nMax) const;
};
#pragma pack(pop)
extern CRecScoreFull g_RSF;
#endif // !defined(__RECSCORE_H__)
@@ -0,0 +1,62 @@
//
// MW4APPLICATION.RC2 - resources Microsoft Visual C++ does not edit directly
//
#ifdef APSTUDIO_INVOKED
#error this file is not editable by Microsoft Visual C++
#endif //APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
// Add manually edited resources here...
/////////////////////////////////////////////////////////////////////////////
// Version info is now here since it does not just have magic numbers any more
// and we don't want VC to change this info while we're not paying attention.
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
#include "..\buildnum\buildnum.h" // get the current build number
1 VERSIONINFO
FILEVERSION VER_PRODUCTVERSION
PRODUCTVERSION VER_PRODUCTVERSION
FILEFLAGSMASK 0x3fL //VS_FFI_FILEFLAGSMASK
#ifdef _DEBUG
FILEFLAGS 0x1L //VS_FF_DEBUG
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L //VOS__WINDOWS32
FILETYPE 0x1L //VFT_APP
FILESUBTYPE 0x0L //VFT2_UNKNOWN
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "Comments", "\0"
VALUE "CompanyName", "Microsoft Corp.\0"
VALUE "FileDescription", "MechWarrior IV\0"
VALUE "FileVersion", VER_PRODUCTVERSION_STR
VALUE "InternalName", "MechWarrior4\0"
VALUE "LegalCopyright", VER_COPYRIGHT_STR
VALUE "LegalTrademarks", VER_LEGALTRADEMARKS_STR
VALUE "OriginalFilename", "MechWarrior4.EXE\0"
VALUE "PrivateBuild", "\0"
VALUE "ProductName", "MechWarrior IV\0"
VALUE "ProductVersion", VER_PRODUCTVERSION_STR
VALUE "SpecialBuild", "\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,62 @@
//
// MW4APPLICATION.RC2 - resources Microsoft Visual C++ does not edit directly
//
#ifdef APSTUDIO_INVOKED
#error this file is not editable by Microsoft Visual C++
#endif //APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
// Add manually edited resources here...
/////////////////////////////////////////////////////////////////////////////
// Version info is now here since it does not just have magic numbers any more
// and we don't want VC to change this info while we're not paying attention.
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
#include "..\buildnum\buildnum.h" // get the current build number
1 VERSIONINFO
FILEVERSION VER_PRODUCTVERSION
PRODUCTVERSION VER_PRODUCTVERSION
FILEFLAGSMASK 0x3fL //VS_FFI_FILEFLAGSMASK
#ifdef _DEBUG
FILEFLAGS 0x1L //VS_FF_DEBUG
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L //VOS__WINDOWS32
FILETYPE 0x1L //VFT_APP
FILESUBTYPE 0x0L //VFT2_UNKNOWN
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "Comments", "\0"
VALUE "CompanyName", "Microsoft Corp.\0"
VALUE "FileDescription", "MechWarrior IV\0"
VALUE "FileVersion", VER_PRODUCTVERSION_STR
VALUE "InternalName", "MechWarrior4\0"
VALUE "LegalCopyright", VER_COPYRIGHT_STR
VALUE "LegalTrademarks", VER_LEGALTRADEMARKS_STR
VALUE "OriginalFilename", "MechWarrior4.EXE\0"
VALUE "PrivateBuild", "\0"
VALUE "ProductName", "MechWarrior IV\0"
VALUE "ProductVersion", VER_PRODUCTVERSION_STR
VALUE "SpecialBuild", "\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
@@ -0,0 +1,16 @@
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by MW4Application.rc
//
#define IDI_MW4ICON 101
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 104
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1000
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
@@ -0,0 +1,131 @@
//Microsoft Developer Studio generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_MW4ICON ICON DISCARDABLE "res\\Mech4.ico"
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE DISCARDABLE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE DISCARDABLE
BEGIN
END
3 TEXTINCLUDE DISCARDABLE
BEGIN
"\r\n"
"#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
"#ifdef _WIN32\r\n"
"LANGUAGE 9, 1\r\n"
"#pragma code_page(1252)\r\n"
"#endif //_WIN32\r\n"
"#include ""res\\MW4GameEd.rc2"" // non-Microsoft Visual C++ edited resources\r\n"
"#endif\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
#ifndef _MAC
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,1
PRODUCTVERSION 1,0,0,1
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x40004L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "Comments", " x\0"
VALUE "CompanyName", "Microsoft Corporation\0"
VALUE "FileDescription", "MW4\0"
VALUE "FileVersion", "1, 0, 0, 1\0"
VALUE "InternalName", "MW4\0"
VALUE "LegalCopyright", "Copyright © 2002\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "MW4.exe\0"
VALUE "PrivateBuild", "\0"
VALUE "ProductName", "Microsoft Corporation MW4\0"
VALUE "ProductVersion", "1, 0, 0, 1\0"
VALUE "SpecialBuild", "\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
#endif // !_MAC
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE 9, 1
#pragma code_page(1252)
#endif //_WIN32
#include "res\MW4GameEd.rc2" // non-Microsoft Visual C++ edited resources
#endif
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED
@@ -0,0 +1,100 @@
#ifndef NULL_CLASS_DEFINED
#define NULL_CLASS_DEFINED
class CNullClass {};
#endif
#define TTREENODE(TYPE) TTreeNode<TYPE,CNullClass>
enum ETreeNodeState {
ETNS_Unknown = -1,
ETNS_None,
ETNS_Plus,
ETNS_Minus,
};
template <class TYPE, class BaseClass>
class TTreeNode : public TDoubleLinkTreeRef<TYPE, BaseClass>
{
public:
ETreeNodeState m_eTNS;
CStr m_strName;
// runtime...
HTREEITEM m_hTI;
public:
TTreeNode(const char* pcszName = NULL)
: m_strName(pcszName)
{
m_eTNS = ETNS_Unknown;
// runtime...
m_hTI = NULL;
}
void SetAsRoot()
{
ASSERT(this);
m_eTNS = ETNS_Unknown;
// runtime...
m_hTI = TVI_ROOT;
}
TYPE FindNode(HTREEITEM hTI) const
{
if (this) {
if (m_hTI == hTI)
return (TYPE)this;
TYPE pChild = m_pChild;
while(pChild) {
TYPE pFound = pChild->FindNode(hTI);
if (pFound)
return pFound;
pChild = pChild->m_pNext;
}
}
return NULL;
}
void Validate(CTreeCtrl& TC)
{
if (m_eTNS == ETNS_Unknown) {
TYPE pChild = m_pChild;
if (pChild) {
m_eTNS = ETNS_Plus;
} else {
m_eTNS = ETNS_None;
}
while(pChild) {
pChild->Validate(TC);
pChild = pChild->m_pNext;
}
}
}
void InsertNode(CTreeCtrl& TC, TYPE pNode, HTREEITEM hTIAfter = TVI_LAST)
{
ASSERT(this && &TC);
TV_INSERTSTRUCT tvi;
memset(&tvi, 0, sizeof(tvi));
tvi.hParent = this ? m_hTI: TVI_ROOT;
tvi.hInsertAfter = hTIAfter;
tvi.item.mask = TVIF_STATE | TVIF_TEXT;
tvi.item.stateMask = TVIS_EXPANDED;
tvi.item.state = (pNode->m_eTNS == ETNS_Minus) ? TVIS_EXPANDED: 0;
//tvi.item.iImage = 0;
tvi.item.pszText = (char *)(LPCTSTR)pNode->m_strName;
pNode->m_hTI = TC.InsertItem(&tvi);
}
void InsertRecursive(CTreeCtrl& TC)
{
TYPE pNode = m_pChild;
while(pNode) {
InsertNode(TC, pNode);
pNode->InsertRecursive(TC);
pNode = pNode->m_pNext;
}
}
};