view mm7_data.h @ 125:b90504bbb93b

Merge
author Nomad
date Fri, 16 Nov 2012 13:58:59 +0200
parents 918dca162239
children 87c503d426e0
line wrap: on
line source

#pragma once
#include <string>
#include "OSAPI.h"

#include "VectorTypes.h"

typedef char _UNKNOWN;


typedef unsigned int uint;
/*
#define LOWORD(a) (*((unsigned short *)&a))
#define SLOWORD(a) (__debugbreak(), *((signed short *)&a))
#define HIWORD(a) (*((unsigned short *)&a + 1))
#define SHIWORD(a) (*((short *)&a + 1))

#define LODWORD(a) (*((unsigned int *)&a))
#define HIDWORD(a) (*((unsigned int *)&a + 1))
#define SLODWORD(a) (*((int *)&a))
#define SHIDWORD(a) (*((int *)&a + 1))

#define LOBYTE(a) (*((unsigned char *)&a))
#define SLOBYTE(a) (*((signed char *)&a))

#define HIBYTE(a) (*((unsigned char *)&a + sizeof(a) - 1))

#define BYTE1(a) (*((unsigned char *)&a + 1))
#define SBYTE1(a) (*((signed char *)&a + 1))

#define BYTE2(a) (*((unsigned char *)&a + 2))
#define BYTE3(a) (*((unsigned char *)&a + 3))

#define WORD2(a) (__debugbreak(), *(unsigned short *)((char *)&a + 4))

#define __OFSUB__(a, b) (unsigned __int8)((a) == (b))


typedef unsigned __int16 _WORD;
typedef unsigned __int64 _QWORD;
*/





#define COERCE_UNSIGNED_INT64(a) (__debugbreak(), a)















#if defined(__GNUC__)
  typedef          long long ll;
  typedef unsigned long long ull;
  #define __int64 long long
  #define __int32 int
  #define __int16 short
  #define __int8  char
  #define MAKELL(num) num ## LL
  #define FMT_64 "ll"
#elif defined(_MSC_VER)
  typedef          __int64 ll;
  typedef unsigned __int64 ull;
  #define MAKELL(num) num ## i64
  #define FMT_64 "I64"
#elif defined (__BORLANDC__)
  typedef          __int64 ll;
  typedef unsigned __int64 ull;
  #define MAKELL(num) num ## i64
  #define FMT_64 "L"
#else
  #error "unknown compiler"
#endif
typedef unsigned int uint;
typedef unsigned char uchar;
typedef unsigned short ushort;
typedef unsigned long ulong;

typedef          char   int8;
typedef   signed char   sint8;
typedef unsigned char   uint8;
typedef          short  int16;
typedef   signed short  sint16;
typedef unsigned short  uint16;
typedef          int    int32;
typedef   signed int    sint32;
typedef unsigned int    uint32;
typedef ll              int64;
typedef ll              sint64;
typedef ull             uint64;

// Partially defined types:
#define _BYTE  uint8
#define _WORD  uint16
#define _DWORD uint32
#define _QWORD uint64
#if !defined(_MSC_VER)
#define _LONGLONG __int128
#endif

#ifndef _WINDOWS_
typedef int8 BYTE;
typedef int16 WORD;
typedef int32 DWORD;
typedef int32 LONG;
#endif
typedef int64 QWORD;
#ifndef __cplusplus
typedef int bool;       // we want to use bool in our C programs
#endif

// Some convenience macros to make partial accesses nicer
// first unsigned macros:
#define LOBYTE(x)   (*((_BYTE*)&(x)))   // low byte
#define LOWORD(x)   (*((_WORD*)&(x)))   // low word
#define LODWORD(x)  (*((_DWORD*)&(x)))  // low dword
#define HIBYTE(x)   (*((_BYTE*)&(x)+1))
#define HIWORD(x)   (*((_WORD*)&(x)+1))
#define HIDWORD(x)  (*((_DWORD*)&(x)+1))
#define BYTEn(x, n)   (*((_BYTE*)&(x)+n))
#define WORDn(x, n)   (*((_WORD*)&(x)+n))
#define BYTE1(x)   BYTEn(x,  1)         // byte 1 (counting from 0)
#define BYTE2(x)   BYTEn(x,  2)
#define BYTE3(x)   BYTEn(x,  3)
#define BYTE4(x)   BYTEn(x,  4)
#define BYTE5(x)   BYTEn(x,  5)
#define BYTE6(x)   BYTEn(x,  6)
#define BYTE7(x)   BYTEn(x,  7)
#define BYTE8(x)   BYTEn(x,  8)
#define BYTE9(x)   BYTEn(x,  9)
#define BYTE10(x)  BYTEn(x, 10)
#define BYTE11(x)  BYTEn(x, 11)
#define BYTE12(x)  BYTEn(x, 12)
#define BYTE13(x)  BYTEn(x, 13)
#define BYTE14(x)  BYTEn(x, 14)
#define BYTE15(x)  BYTEn(x, 15)
#define WORD1(x)   WORDn(x,  1)
#define WORD2(x)   WORDn(x,  2)         // third word of the object, unsigned
#define WORD3(x)   WORDn(x,  3)
#define WORD4(x)   WORDn(x,  4)
#define WORD5(x)   WORDn(x,  5)
#define WORD6(x)   WORDn(x,  6)
#define WORD7(x)   WORDn(x,  7)

// now signed macros (the same but with sign extension)
#define SLOBYTE(x)   (*((int8*)&(x)))
#define SLOWORD(x)   (*((int16*)&(x)))
#define SLODWORD(x)  (*((int32*)&(x)))
#define SHIBYTE(x)   (*((int8*)&(x)+1))
#define SHIWORD(x)   (*((int16*)&(x)+1))
#define SHIDWORD(x)  (*((int32*)&(x)+1))
#define SBYTEn(x, n)   (*((int8*)&(x)+n))
#define SWORDn(x, n)   (*((int16*)&(x)+n))
#define SBYTE1(x)   SBYTEn(x,  1)
#define SBYTE2(x)   SBYTEn(x,  2)
#define SBYTE3(x)   SBYTEn(x,  3)
#define SBYTE4(x)   SBYTEn(x,  4)
#define SBYTE5(x)   SBYTEn(x,  5)
#define SBYTE6(x)   SBYTEn(x,  6)
#define SBYTE7(x)   SBYTEn(x,  7)
#define SBYTE8(x)   SBYTEn(x,  8)
#define SBYTE9(x)   SBYTEn(x,  9)
#define SBYTE10(x)  SBYTEn(x, 10)
#define SBYTE11(x)  SBYTEn(x, 11)
#define SBYTE12(x)  SBYTEn(x, 12)
#define SBYTE13(x)  SBYTEn(x, 13)
#define SBYTE14(x)  SBYTEn(x, 14)
#define SBYTE15(x)  SBYTEn(x, 15)
#define SWORD1(x)   SWORDn(x,  1)
#define SWORD2(x)   SWORDn(x,  2)
#define SWORD3(x)   SWORDn(x,  3)
#define SWORD4(x)   SWORDn(x,  4)
#define SWORD5(x)   SWORDn(x,  5)
#define SWORD6(x)   SWORDn(x,  6)
#define SWORD7(x)   SWORDn(x,  7)




// Generate a reference to pair of operands
template<class T>  int16 __PAIR__( int8  high, T low) { return ((( int16)high) << sizeof(high)*8) | uint8(low); }
template<class T>  int32 __PAIR__( int16 high, T low) { return ((( int32)high) << sizeof(high)*8) | uint16(low); }
template<class T>  int64 __PAIR__( int32 high, T low) { return ((( int64)high) << sizeof(high)*8) | uint32(low); }
template<class T> uint16 __PAIR__(uint8  high, T low) { return (((uint16)high) << sizeof(high)*8) | uint8(low); }
template<class T> uint32 __PAIR__(uint16 high, T low) { return (((uint32)high) << sizeof(high)*8) | uint16(low); }
template<class T> uint64 __PAIR__(uint32 high, T low) { return (((uint64)high) << sizeof(high)*8) | uint32(low); }

// rotate left
template<class T> T __ROL__(T value, uint count)
{
  const uint nbits = sizeof(T) * 8;
  count %= nbits;

  T high = value >> (nbits - count);
  value <<= count;
  value |= high;
  return value;
}

// rotate right
template<class T> T __ROR__(T value, uint count)
{
  const uint nbits = sizeof(T) * 8;
  count %= nbits;

  T low = value << (nbits - count);
  value >>= count;
  value |= low;
  return value;
}

// carry flag of left shift
template<class T> int8 __MKCSHL__(T value, uint count)
{
  const uint nbits = sizeof(T) * 8;
  count %= nbits;

  return (value >> (nbits-count)) & 1;
}

// carry flag of right shift
template<class T> int8 __MKCSHR__(T value, uint count)
{
  return (value >> (count-1)) & 1;
}

// sign flag
template<class T> int8 __SETS__(T x)
{
  if ( sizeof(T) == 1 )
    return int8(x) < 0;
  if ( sizeof(T) == 2 )
    return int16(x) < 0;
  if ( sizeof(T) == 4 )
    return int32(x) < 0;
  return int64(x) < 0;
}

// overflow flag of subtraction (x-y)
template<class T, class U> int8 __OFSUB__(T x, U y)
{
  if ( sizeof(T) < sizeof(U) )
  {
    U x2 = x;
    int8 sx = __SETS__(x2);
    return (sx ^ __SETS__(y)) & (sx ^ __SETS__(x2-y));
  }
  else
  {
    T y2 = y;
    int8 sx = __SETS__(x);
    return (sx ^ __SETS__(y2)) & (sx ^ __SETS__(x-y2));
  }
}

// overflow flag of addition (x+y)
template<class T, class U> int8 __OFADD__(T x, U y)
{
  if ( sizeof(T) < sizeof(U) )
  {
    U x2 = x;
    int8 sx = __SETS__(x2);
    return ((1 ^ sx) ^ __SETS__(y)) & (sx ^ __SETS__(x2+y));
  }
  else
  {
    T y2 = y;
    int8 sx = __SETS__(x);
    return ((1 ^ sx) ^ __SETS__(y2)) & (sx ^ __SETS__(x+y2));
  }
}

// carry flag of subtraction (x-y)
template<class T, class U> int8 __CFSUB__(T x, U y)
{
  int size = sizeof(T) > sizeof(U) ? sizeof(T) : sizeof(U);
  if ( size == 1 )
    return uint8(x) < uint8(y);
  if ( size == 2 )
    return uint16(x) < uint16(y);
  if ( size == 4 )
    return uint32(x) < uint32(y);
  return uint64(x) < uint64(y);
}

// carry flag of addition (x+y)
template<class T, class U> int8 __CFADD__(T x, U y)
{
  int size = sizeof(T) > sizeof(U) ? sizeof(T) : sizeof(U);
  if ( size == 1 )
    return uint8(x) > uint8(x+y);
  if ( size == 2 )
    return uint16(x) > uint16(x+y);
  if ( size == 4 )
    return uint32(x) > uint32(x+y);
  return uint64(x) > uint64(x+y);
}



//-------------------------------------------------------------------------
// Data declarations
extern int (__cdecl *sprintfex)(char *a1, const char *a2, ...);

extern int pWindowList_at_506F50_minus1_indexing[1];
extern int dword_4C9890[10]; // weak
extern int dword_4C9920[16]; // weak
extern _UNKNOWN unk_4D8548; // weak
extern char byte_4D864C; // weak
extern float flt_4D86CC; // weak
extern int dword_4D86D8; // weak
extern int dword_4DAFCC; // weak
extern int (__stdcall *off_4DAFDC)(char); // weak
extern char asc_4DB724[]; // idb
extern int dword_4DBD94; // weak
extern int dword_4DF380[]; // weak
extern int dword_4DF390; // weak
extern char Str2[]; // idb
extern int dword_4DF3A4; // weak
extern char byte_4E185C; // weak
extern char am_byte_4E185D; // weak
extern char byte_4E185E; // weak
extern int amuint_4E1860; // weak
extern int amuint_4E1864; // weak
extern int amuint_4E1868; // weak
extern int amuint_4E186C; // weak
extern int amuint_4E1870; // weak
extern int dword_4E1874; // weak
extern int dword_4E1878; // weak
extern float flt_4D84E8;
extern int dword_4E187C; // weak
extern int dword_4E1880; // weak
extern int dword_4E1884; // weak
extern int dword_4E1888; // weak
extern char pArcomagePlayer2Name[8];
extern char pArcomagePlayer1Name[8];
extern char pDeckMaster[12];
extern char aIxf[4]; // idb
extern _UNKNOWN unk_4E19FC; // weak
extern char pAreYouSureWishToLeave[32];
extern char asc_4E1A28[4]; // idb
extern char aUsxfs[13];
extern char aLayout_pcx[11]; // weak
extern char aSprites_pcx[12]; // weak
extern char aProblemInBlit_[]; // idb
extern char aEWorkMsdevMm7M[]; // idb
extern char aProblemInBli_0[]; // idb
extern char aD[]; // idb
extern char asc_4E1AB0[]; // idb
extern char aWb_0[]; // idb
extern char a24bitPcxOnly[]; // idb
extern char Mode[]; // idb
extern char a16bitPcx[]; // idb
extern char aUnableToLoadS[]; // idb
extern char aBitmaps[]; // idb
extern char aIcons[]; // idb
extern char aPending[]; // idb
extern char aCanTFindS[]; // idb
extern char pDayMoonPhase[28];
extern char *spellbook_texture_filename_suffices[8]; // weak
extern __int16 word_4E1D3A[]; // weak
extern __int16 pTownPortalBook_xs[6];
extern __int16 pTownPortalBook_ys[6];
extern __int16 pTownPortalBook_ws[6];
extern __int16 pTownPortalBook_hs[6];
extern int dword_4E20D0[]; // idb
extern char byte_4E2430[]; // weak
extern char byte_4E2431[]; // weak
extern unsigned int pLloydsBeaconsPreviewXs[5];
extern unsigned int pLloydsBeaconsPreviewYs[5];
extern unsigned int pLloydsBeacons_SomeXs[5];
extern unsigned int pLloydsBeacons_SomeYs[5]; // idb
extern char aSbwb00[7]; // weak
extern char aW[2]; // idb
extern char aA[2]; // idb
extern char aSD[]; // idb
extern char aSS03d03dS000S0[]; // idb
extern char aLuS[]; // idb
extern char aS_1[]; // idb
extern char aSbSc02d[]; // idb
extern char aSbSs02d[]; // idb
extern char aTabDb[]; // idb
extern char aTabDa[]; // idb
extern char aIbM6D[]; // idb
extern char aIbM6U[]; // idb
extern char aIbM5D[]; // idb
extern char aIbM5U[]; // idb
extern char aPagemask[]; // idb
extern char aBook[]; // idb
extern char aSpell_fnt[]; // idb
extern char aAutonote_fnt[]; // idb
extern char aBook2_fnt[]; // idb
extern char pFontFile[]; // idb
extern char aFontpal[]; // idb
extern char aMapbordr[]; // idb
extern char aLloydDD_pcx[]; // idb
extern char aDataLloydDD_pc[]; // idb
extern char aLb_bordr[]; // idb
extern char aTphell[]; // idb
extern char aTpheaven[]; // idb
extern char aTpisland[]; // idb
extern char aTpwarlock[]; // idb
extern char aTpelf[]; // idb
extern char aTpharmndy[]; // idb
extern char aTownport[]; // idb
extern char aSbquiknot[]; // idb
extern char aTabAn8a[]; // idb
extern char aTabAn8b[]; // idb
extern char aTabAn4a[]; // idb
extern char aTabAn4b[]; // idb
extern char aTabAn5a[]; // idb
extern char aTabAn5b[]; // idb
extern char aTabAn3a[]; // idb
extern char aTabAn3b[]; // idb
extern char aTabAn2a[]; // idb
extern char aTabAn2b[]; // idb
extern char aTabAn1a[]; // idb
extern char aTabAn1b[]; // idb
extern char aDivbar[]; // idb
extern char aSbautnot[]; // idb
extern char aTabwoff[]; // idb
extern char aTabwon[]; // idb
extern char aTabeoff[]; // idb
extern char aTabeon[]; // idb
extern char aTabsoff[]; // idb
extern char aTabson[]; // idb
extern char aTabnoff[]; // idb
extern char aTabnon[]; // idb
extern char aZootOff[]; // idb
extern char aZoomOff[]; // idb
extern char aZootOn[]; // idb
extern char aZoomOn[]; // idb
extern char aSbmap[]; // idb
extern char aMoon_ful[]; // idb
extern char aMoon_2[]; // idb
extern char aMoon_4[]; // idb
extern char aMoon_new[]; // idb
extern char aSbdateTime[]; // idb
extern char aTabAn7a[]; // idb
extern char aTabAn6a[]; // idb
extern char aTabAn7b[]; // idb
extern char aTabAn6b[]; // idb
extern char aSbplayrnot[]; // idb
extern char aPending_0[]; // idb
extern char aUnknown[8]; // weak
extern char aS100110S[]; // idb
extern char aS100110D[]; // idb
extern char aS100110DS[]; // idb
extern char aS100110D02dSS[]; // idb
extern int pCurrentScreen; // weak
extern char byte_4E28FC; // weak
extern unsigned int uGammaPos;
extern int dword_4E2910[]; // weak
extern __int16 word_4E2930[4];
extern __int16 word_4E2938[4];
extern void *off_4E2A12; // weak
extern int dword_4E2A18[5];
extern int dword_4E2A2C[9];
extern int dword_4E2A50[12];
extern int _4E2A80_skills[9];
extern unsigned __int8 pAwardsTextColors[20];
extern unsigned int pHealthBarPos[4];
extern unsigned int pManaBarPos[4];
extern char _4E2AD8_ui_colors[72];
extern char _4E2B21_buff_spell_tooltip_colors[80];
extern char byte_4E2B70[]; // weak
extern char byte_4E2BC8; // weak
extern int pChestSmthn1ByType[8];
extern int pChestSmthn2ByType[8];
extern int pChestWidthsByType[8];
extern int pChestHeightsByType[8];
extern char aSS[]; // idb
extern char ascii_4E2C54[6];
extern char ascii_4E2C5C[7];
extern char ascii_4E2C68[8];
extern char ascii_4E2C70[9];
extern char ascii_4E2C7C[8];
extern char ascii_4E2C84[11];
extern char ascii_4E2C90[12];
extern char ascii_4E2C9C[8];
extern char ascii_4E2CA4[7];
extern char ascii_4E2CB0[12];
extern char ascii_4E2CBC[12];
extern char ascii_4E2CC8[12];
extern char ascii_4E2CD4[6];
extern char ascii_4E2CDC[11];
extern char ascii_4E2CE8[8];
extern char ascii_4E2CF0[12];
extern char ascii_4E2CFC[6];
extern char ascii_4E2D04[8];
extern char ascii_4E2D0C[8];
extern char ascii_4E2D14[6];
extern char ascii_4E2D1C[12];
extern char ascii_4E2D28[8];
extern char ascii_4E2D30[7];
extern char ascii_4E2D38[5];
extern char ascii_4E2D40[8];
extern char ascii_4E2D48[6];
extern char ascii_4E2D50[12];
extern char ascii_4E2D5C[7];
extern char aMakingItemNumb[]; // idb
extern char aNpc03d[]; // idb
extern char format_4E2D80[16];
extern char format_4E2D90[8];
extern char aS03d03dS000_0[]; // idb
extern char aS03d03dS000[]; // idb
extern char format_4E2DC8[8];
extern char aS[]; // idb
extern char aLuSLuS[]; // idb
extern char byte_4E2DE8; // idb
extern char asc_4E2DFC[3]; // idb
extern char format_4E2E00[2]; // idb
extern char format_4E2E10[28]; // weak
extern char aS100S_0[]; // idb
extern char aS100S[]; // idb
extern char aS100D[]; // idb
extern char aS180[6]; // idb
extern char format_4E2E68[28]; // weak
extern char aS_6[2]; // idb
extern char aSS_0[]; // idb
extern char aS_5[4]; // idb
extern _UNKNOWN unk_4E2EB8; // weak
extern char string_4E3294[8];
extern char Format[]; // idb
extern char aMem03i_txt[]; // idb
extern char aMemory[]; // idb
extern char aIdSSizeI[16]; // idb
extern __int16 word_4E3C66[]; // idb
extern int dword_4E455C; // weak
extern int dword_4E4560[6];
extern int dword_4E4578[6];
extern int dword_4E4590[6];
extern int dword_4E45A8[6];
extern char aDDSDDS[]; // idb
extern char asc_4E45DC[]; // idb
extern char aD02dSSDSD[]; // idb
extern char aButtexi1[]; // idb
extern char aCanTJumpToThat[]; // idb
extern char aNoMapFoundForS[]; // idb
extern char global_a2[]; // idb
extern char aSSS[]; // idb
extern char aNotInMapStats[17]; // weak
extern char aD47_blv[]; // idb
extern char aOut15_odm[]; // idb
extern char Delim[]; // idb
extern char aGamma_pcx[];
extern char aQuit1[]; // idb
extern char aControls1[]; // idb
extern char aSave1[]; // idb
extern char aLoad1[]; // idb
extern char aNew1[]; // idb
extern char aOptions[]; // idb
extern char aGammapos[9]; // weak
extern char aBloodsplats[]; // idb
extern char aTinting[]; // idb
extern char aColoredLights[]; // idb
extern char aTurndelta[]; // idb
extern char aFliponexit[]; // idb
extern char pKey[]; // idb
extern char aGraphicsmode[]; // idb
extern char aShowdamage[]; // idb
extern char aWalksound[]; // idb
extern char aCharvoices[]; // idb
extern char aMusicflag[]; // idb
extern char aSoundflag[]; // idb
extern char aOpvdgTn[]; // idb
extern char aOpvdgCl[]; // idb
extern char aOpvdgBs[]; // idb
extern char aOpvdhTn[]; // idb
extern char aOpvdhCl[]; // idb
extern char aOpvdhBs[]; // idb
extern char aOptvid[]; // idb
extern char aOptkb_2[]; // idb
extern char aOptkb_1[]; // idb
extern char aResume1[]; // idb
extern char aOptkb_h[]; // idb
extern char aOptkb[]; // idb
extern char aOption01[]; // idb
extern char aOption02[]; // idb
extern char aOption03[]; // idb
extern char aOption04[]; // idb
extern char aConvol90[]; // idb
extern char aConvol80[]; // idb
extern char aConvol70[]; // idb
extern char aConvol60[]; // idb
extern char aConvol50[]; // idb
extern char aConvol40[]; // idb
extern char aConvol30[]; // idb
extern char aConvol20[]; // idb
extern char aConvol10[]; // idb
extern char aConvol00[]; // idb
extern char aCon_smoo[]; // idb
extern char aCon_arrr[]; // idb
extern char aCon_arrl[]; // idb
extern char aCon_32x[]; // idb
extern char aCon_16x[]; // idb
extern char aControlbg[]; // idb
extern char aTitle_pcx[10]; // weak
extern char aEWorkMsdevMm_0[]; // idb
extern char aDraw_debug_lin[]; // idb
extern char aGenuineintel[13]; // weak
extern char asc_4E4938[13]; // weak
extern int dword_4E4948[]; // weak
extern int dword_4E494C[]; // weak
extern int dword_4E49D0[]; // weak
extern _UNKNOWN dword_4E49D4; // idb
extern int dword_4E4A18[]; // weak
extern int dword_4E4A1C[]; // weak
extern int dword_4E4A40[]; // weak
extern int dword_4E4A44[]; // weak
extern char aCentaurhauls[13]; // weak
extern char aCyrixinstead[13]; // weak
extern char aAuthenticamd[13]; // weak
extern float flt_4E4A80[10];
extern char aInvalidPlayerI[]; // idb
extern char aEWorkMsdevMm_1[]; // idb
extern char aEWorkMsdevMm_2[]; // idb
extern char aErrorNoKeyboar[25]; // weak
extern char aInvalidDeviceP[]; // idb
extern char aInvalidDevic_0[]; // idb
extern char aEWorkMsdevMm_3[]; // idb
extern char aErrorNoMouseFo[22]; // weak
extern int papredoll_4E4C28; // weak
extern int paperdoll_4E4C2C; // weak
extern int paperdoll_array_4E4E30[4][17][2];
extern int dword_4E5050[8];
extern int dword_4E5270[8];
extern int dword_4E5490[4][7][2];
extern int paredoll_array_4E54B8[3][14];
extern int paperdoll_array_4E5570[4][10][2];
extern int dword_4E56B0; // weak
extern int dword_4E56B4; // weak
extern int dword_4E57F0[4][7][2];
extern int dword_4E58D0[]; // weak
extern int dword_4E58D4[]; // weak
extern int dword_4E5AD0[]; // weak
extern int dword_4E5AD4[]; // weak
extern int dword_4E5AE0[8];
extern int pPaperdollLeftHand[8];
extern int pPaperdollRightHand[8];
extern int pPaperdollLeftEmptyHand[8];
extern int dword_4E5C1C[6];
extern int dword_4E5C34[6];
extern char aItem092v3[]; // idb
extern char aIbCd5D[]; // idb
extern char aAr_dn_dn[]; // idb
extern char aAr_dn_up[]; // idb
extern char aAr_up_dn[]; // idb
extern char aAr_up_up[]; // idb
extern char aItem281pc02d[]; // idb
extern char aPc02dbrd[]; // idb
extern char aPc23vDlhu[]; // idb
extern char aPc23vDlh[]; // idb
extern char aPc23vDrh[]; // idb
extern char aPc23vDlau[]; // idb
extern char aPc23vDlad[]; // idb
extern char aPc23vDbod[]; // idb
extern char aBackhand[]; // idb
extern char aBackdoll[]; // idb
extern char aMagnifB[]; // idb
extern char aItem3_3dvDa2[]; // idb
extern char aItem3_3dvDa1[15]; // weak
extern char aItem3_3dvD[13]; // weak
extern char aItem64v1[9]; // weak
extern char aEffpar01[]; // idb
extern int pPartySpellbuffsUI_XYs[14][2];
extern char byte_4E5DD8[]; // weak
extern unsigned __int8 pPartySpellbuffsUI_smthns[14];
extern char aSpell27[]; // idb
extern char aSpell21[]; // idb
extern char aIsn02d[]; // idb
extern char aBardataB[]; // idb
extern char aBardata[8]; // weak
extern char aBardataC[10]; // weak
extern char aLoadprog[]; // idb
extern char aLoadingD_pcx[]; // idb
extern int _4E5E50_transui_x; // idb
extern int dword_4E5EC8[]; // weak
extern int _4E5EE0_transui_y; // idb
extern const char *pHouse_ExitPictures[11];
extern char *_4E6BDC_loc_names[11];
extern char aOutside[]; // idb
extern char aMer[]; // idb
extern char aMir[]; // idb
extern char aSel[]; // idb
extern char aEle[]; // idb
extern char aDar[]; // idb
extern char aLig[]; // idb
extern char aBod[]; // idb
extern char aMin[]; // idb
extern char aSpi[]; // idb
extern char aEar[]; // idb
extern char aWat[]; // idb
extern char aAir[]; // idb
extern char aFir[]; // idb
extern char aBan[]; // idb
extern char aTav[]; // idb
extern char aTow[]; // idb
extern char aTra[]; // idb
extern char aTem[]; // idb
extern char aBoa[]; // idb
extern char aSta[]; // idb
extern char aAlc[]; // idb
extern char aMag[]; // idb
extern char aArm[]; // idb
extern char aWea[]; // idb
extern char asc_4E7BD4[2]; // idb
extern char a2devents_txt[]; // idb
extern char aFileSSizeLuBuf[]; // idb
extern char aGlobal_evt[]; // idb
extern char aMax_event_text[]; // idb
extern char aS_str[]; // idb
extern char aS_evt[]; // idb
extern char aNoMazeInfoForT[36]; // weak
extern char aC[]; // idb
extern char aB[3]; // weak
extern char aEvt02d[]; // idb
extern char aNoTransitionTe[]; // idb
extern char aEWorkMsdevMm_4[]; // idb
extern char asc_4E7CD4[]; // idb
extern char aSS_1[]; // idb
extern char aNpcIdExceedsMa[]; // idb
extern char aNpc03u[]; // idb
extern char aPcout01[]; // idb
extern char aArbiterEvil[]; // idb
extern char aArbiterGood[]; // idb
extern char a0[]; // idb
extern char aPartyStart[]; // idb
extern char aNorthStart[12]; // weak
extern char aSouthStart[12]; // weak
extern char aEastStart[11]; // weak
extern char aWestStart[11]; // weak
extern char aUnableToFindDo[]; // idb
extern char aNwc_blv[]; // idb
extern char aUnableToOpenS[]; // idb
extern char aInvalidStringP[]; // idb
extern char aEWorkMsdevMm_5[]; // idb
extern char aNull[]; // idb
extern char aInvalidStrin_0[]; // idb
extern char aSI[]; // idb
extern char aS7[4]; // weak
extern char aS6[]; // idb
extern char aS5[4]; // weak
extern char aS1[]; // idb
extern char aS3[4]; // weak
extern char aS0[]; // idb
extern char aS2[4]; // weak
extern char aS4[4]; // weak
extern char aUnableToSaveDs[]; // idb
extern char aDataDsft_bin[]; // idb
extern char aPFrames[]; // idb
extern char aEFrames[]; // idb
extern char aSFrames[]; // idb
extern char aMirror7[]; // idb
extern char aMirror6[]; // idb
extern char aMirror5[]; // idb
extern char aMirror4[]; // idb
extern char aMirror3[]; // idb
extern char aMirror2[]; // idb
extern char aMirror1[]; // idb
extern char aMirror0[]; // idb
extern char aLuminous[]; // idb
extern char a1[]; // idb
extern char aNew[]; // idb
extern char pMessag[]; // idb
extern char aCspriteframeta[]; // idb
extern char aR[]; // idb
extern char aNew_0[]; // idb
extern char aUnableToSaveDt[]; // idb
extern char aDataDtft_bin[]; // idb
extern char aTxtFrames[]; // idb
extern char aCtexturefram_1[]; // idb
extern char aCtexturefram_0[]; // idb
extern char aCtextureframet[]; // idb
extern int bWinNT4_0; // weak
extern char aEWorkMsdevMm_6[]; // idb
extern char aTheVisObjectPo[]; // idb
extern char aSpriteOutlineC[]; // idb
extern char aUndefinedCobje[]; // idb
extern char aEWorkMsdevMm_7[]; // idb
extern char aGammaControlNo[]; // idb
extern __int16 word_4E8152[11];
extern char byte_4E8168[116];
extern char aD3dTextureName[]; // idb
extern char aLogd3d_txt[]; // idb
extern char byte_4E8394[]; // weak
#include "Texture.h"
extern stru355 stru_4E82A4;// = {0x20, 0x41, 0, 0x20, 0xFF0000, 0xFF00, 0xFF, 0xFF000000};
extern stru355 stru_4EFCBC;// = {0x20, 0x41, 0, 0x10, 0x7C00, 0x3E0, 0x1F, 0x8000};
extern char byte_4E94D0; // weak
extern char _4E94D2_light_type; // weak
extern char byte_4E94D3; // weak
extern unsigned int saveload_dlg_xs[2];
extern unsigned int saveload_dlg_ys[2];
extern unsigned int saveload_dlg_zs[2];
extern unsigned int saveload_dlg_ws[2];
extern int dword_4E98BC_bApplicationActive; // weak
extern char *off_4EB080; // idb
extern char *pTransitionStrings[464];
extern char aAwards_txt[]; // idb
extern char aScroll_txt[]; // idb
extern char aMerchant_txt[]; // idb
extern char aTrans_txt[]; // idb
extern char aTeacher[]; // idb
extern char aObelisk[]; // idb
extern char aSeer[]; // idb
extern char aStat[]; // idb
extern char aPotion[]; // idb
extern char aAutonote_txt[]; // idb
extern char aQuests_txt[]; // idb
extern char aNpcdist_txt[]; // idb
extern char aNpctopic_txt[]; // idb
extern char aNpctext_txt[]; // idb
extern char aNpcnews_txt[]; // idb
extern char aNpcgroup_txt[]; // idb
extern char aNpcgreet_txt[]; // idb
extern char aNpcdata_txt[]; // idb
extern char aNpcprof_txt[]; // idb
extern char aNpcnames_txt[]; // idb
extern char aD3dVersionOfRe[]; // idb
extern char aEWorkMsdevM_16[]; // idb
extern char aLevels_0[]; // idb
extern char aDmap[]; // idb
extern char aAmap[]; // idb
extern char aTmap[]; // idb
extern char aHmap[]; // idb
extern int dword_4EC268[]; // weak
extern int dword_4EC28C[]; // weak
extern int dword_4EC2A8; // weak
extern int dword_4EC2AC; // weak
extern char aInvalidGroundT[]; // idb
extern char aInvalidSkyTexH[]; // idb
extern char aIdlist[]; // idb
extern char aOmap[]; // idb
extern char aCmap[]; // idb
extern char aMm6OutdoorV1_0[]; // idb
extern char aI6_odm[]; // idb
extern char aBlank[]; // idb
extern char aHm005[]; // idb
extern char aSky043[]; // idb
extern char aDefault_odm[]; // idb
extern char aPlansky3[]; // idb
extern char aPlanskyD[]; // idb
extern char a_ddm[5]; // weak
extern char aCanTLoadFile[]; // idb
extern char aEWorkMsdevM_17[]; // idb
extern char a_odm[]; // idb
extern char aUnableToFindSI[]; // idb
extern char aSpawn[]; // idb
extern char aBddata[]; // idb
extern char aTernorm[]; // idb
extern char aGrastyl[]; // idb
extern char aOut09_odm[]; // idb
extern char aNewedges[]; // idb
extern char aSurfs[]; // idb
extern char aEdges[]; // idb
extern char aSpans[]; // idb
extern char aTheTextureFram[]; // idb
extern char aEWorkMsdevM_18[]; // idb
extern char aWtrtyla[]; // idb
extern char aWtrtyl[]; // idb
extern char aUnableToSave_1[]; // idb
extern char aDataDtile_bin[]; // idb
extern char aTileDescrip[]; // idb
extern char aTtattr_transit[]; // idb
extern char aTtattr_nodraw[]; // idb
extern char aTtattr_wave[]; // idb
extern char aTtattr_flat[]; // idb
extern char aTtattr_repulse[]; // idb
extern char aTtattr_block[]; // idb
extern char aTtattr_water2[]; // idb
extern char aTtattr_water[]; // idb
extern char aTtattr_burn[]; // idb
extern char aTtsect_dnw[]; // idb
extern char aTtsect_dse[]; // idb
extern char aTtsect_dne[]; // idb
extern char aTtsect_dsw[]; // idb
extern char aTtsect_de[]; // idb
extern char aTtsect_dw[]; // idb
extern char aTtsect_ds[]; // idb
extern char aTtsect_dn[]; // idb
extern char aTtsect_wcap[]; // idb
extern char aTtsect_scap[]; // idb
extern char aTtsect_ecap[]; // idb
extern char aTtsect_ncap[]; // idb
extern char aTtsect_ew_s[]; // idb
extern char aTtsect_ew_n[]; // idb
extern char aTtsect_ns_w[]; // idb
extern char aTtsect_ns_e[]; // idb
extern char aTtsect_s_w[]; // idb
extern char aTtsect_s_e[]; // idb
extern char aTtsect_n_w[]; // idb
extern char aTtsect_n_e[]; // idb
extern char aTtsect_ew[]; // idb
extern char aTtsect_ns[]; // idb
extern char aTtsect_cros[]; // idb
extern char aTtsect_xsw1[]; // idb
extern char aTtsect_xse1[]; // idb
extern char aTtsect_xnw1[]; // idb
extern char aTtsect_xne1[]; // idb
extern char aTtsect_s1[]; // idb
extern char aTtsect_n1[]; // idb
extern char aTtsect_w1[]; // idb
extern char aTtsect_e1[]; // idb
extern char aTtsect_sw1[]; // idb
extern char aTtsect_se1[]; // idb
extern char aTtsect_nw1[]; // idb
extern char aTtsect_ne1[]; // idb
extern char aTtsect_speci_6[]; // idb
extern char aTtsect_speci_5[]; // idb
extern char aTtsect_speci_4[]; // idb
extern char aTtsect_speci_3[]; // idb
extern char aTtsect_speci_2[]; // idb
extern char aTtsect_speci_1[]; // idb
extern char aTtsect_speci_0[]; // idb
extern char aTtsect_special[]; // idb
extern char aTtsect_base4[]; // idb
extern char aTtsect_base3[]; // idb
extern char aTtsect_base2[]; // idb
extern char aTtsect_base1[]; // idb
extern char aTtsect_start[]; // idb
extern char aTtsect_null[]; // idb
extern char aTttype_roadcit[]; // idb
extern char aTttype_roads_2[]; // idb
extern char aTttype_roadsno[]; // idb
extern char aTttype_roadt_0[]; // idb
extern char aTttype_roadtro[]; // idb
extern char aTttype_roads_1[]; // idb
extern char aTttype_roadswa[]; // idb
extern char aTttype_roadv_0[]; // idb
extern char aTttype_roadvol[]; // idb
extern char aTttype_roads_0[]; // idb
extern char aTttype_roadsan[]; // idb
extern char aTttype_roadc_0[]; // idb
extern char aTttype_roadcra[]; // idb
extern char aTttype_roadg_0[]; // idb
extern char aTttype_roadgra[]; // idb
extern char aTttype_city[]; // idb
extern char aTttype_swamp[]; // idb
extern char aTttype_tropica[]; // idb
extern char aTttype_water[]; // idb
extern char aTttype_dirt[]; // idb
extern char aTttype_volcano[]; // idb
extern char aTttype_sand[]; // idb
extern char aTttype_snow[]; // idb
extern char aTttype_cracked[]; // idb
extern char aTttype_grass[]; // idb
extern char aTttype_start[]; // idb
extern char aTttype_null[]; // idb
extern char aTiletableLoadO[]; // idb
extern char aTiletableLoadU[]; // idb
extern char byte_4ECA93[]; // weak
extern char byte_4ECACF[]; // weak
extern char byte_4ECB0C[64]; // idb
extern char aError_0[]; // idb
extern char aCouldnTLoadMap[]; // idb
extern char aOut02d_odm[]; // idb
extern char aOut14_odm[]; // idb
extern char aOut[]; // idb
extern char aLunSun[]; // idb
extern char aLunfull[]; // idb
extern char aLun34[]; // idb
extern char aLun12[]; // idb
extern char aLun14[]; // idb
extern char aPal03i[]; // idb
extern const char *pPlayerPortraitsNames[25];
extern const char *dlad_texnames_by_face[25];
extern const char *dlau_texnames_by_face[25];
extern const char *dbod_texnames_by_face[25];
extern const char *drh_texnames_by_face[25];
extern const char *dlh_texnames_by_face[25];
extern const char *dlhu_texnames_by_face[25];
extern _UNKNOWN unk_4ED3D8; // weak
extern unsigned char byte_4ED498; // weak
extern __int16 pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[4];
extern char byte_4ED970_skill_learn_ability_by_class_table[32][37];
extern int dword_4EDEA0[]; // weak
extern int dword_4EDEB4[]; // weak
extern int dword_4EDEC4[]; // weak
extern __int16 word_4EDED8[]; // weak
extern _UNKNOWN unk_4EDF40; // weak
extern unsigned int pHiredNPCsIconsOffsetsX[2];
extern unsigned int pHiredNPCsIconsOffsetsY[2];
extern int dword_4EE07C[2]; // weak
extern _UNKNOWN unk_4EE084; // weak
extern __int16 word_4EE088_sound_ids[]; // weak
extern short word_4EE150[];
extern int dword_4EED78; // weak
extern _UNKNOWN unk_4EED80; // weak
extern int dword_4EFA80; // weak
extern int dword_4EFA84; // weak
extern void *off_4EFDB0; // weak
extern int dword_4F031C[]; // weak
extern const char *off_4F03B8[]; // idb
extern __int16 word_4F03FE[]; // weak
extern __int16 word_4F0400[]; // weak
extern __int16 word_4F0498[]; // weak
extern __int16 word_4F0576[]; // weak
extern __int16 word_4F0578[]; // weak
extern __int16 word_4F05AE[]; // weak
extern char _4F063C_smthn_by_2da_uType[]; // weak
extern __int16 word_4F063E[290];
extern __int16 word_4F06D8[22];
extern __int16 word_4F0704[40];
extern __int16 word_4F0754[49];
extern __int16 word_4F07B6[88];
extern __int16 word_4F0866[14];
extern __int16 _4F0882_evt_VAR_PlayerItemInHands_vals[53];
extern int dword_4F08EC[]; // weak
extern char byte_4F09B0[]; // weak
extern char byte_4F09B1[]; // weak
extern char byte_4F09B8[]; // weak
extern int dword_4F09CC[192];
extern char byte_4F0CCF[]; // weak
extern char _4F0D38_TravelInfo[]; // weak
extern int dword_4F0E10[32];
extern Vec2_int_ pMonsterArenaPlacements[20];
extern __int16 word_4F0F30[]; // weak
extern char aS03d[]; // idb
extern char byte_4F0F98; // idb
extern char sz[]; // idb
extern char aSSSSSS[]; // idb
extern char aSDS[]; // idb
extern char aSS_3[]; // idb
extern char aSSSS[]; // idb
extern char aS_2[]; // idb
extern char aErrorlog_txt[]; // idb
extern char aUnsupportedPix[]; // idb
extern char aSmackerError[]; // idb
extern char aCS[]; // idb
extern char aAnimsMagic7_vi[]; // idb
extern char aVideoFileError[]; // idb
extern char aCanTOpenFileAn[]; // idb
extern char aAnimsMight7_vi[]; // idb
extern char aCanTLoadS[]; // idb
extern char aS_smk[]; // idb
extern char aUnsupportedBin[27]; // weak
extern char aEWorkMsdevM_29[]; // idb
extern char aFailedToOpenBl[]; // idb
extern char aCanTAllocateMe[33]; // weak
extern char aCanTLoadFileAn[]; // idb
extern char aS_bik[]; // idb
extern char aMm7_win_pcx[]; // idb
extern char aLuSLuSLuS[]; // idb
extern char aEndgame_fnt[]; // idb
extern char aWinbg_pcx[10]; // weak
extern char aDefaultCaseRea[]; // idb
extern char aUnsupportedExc[71]; // weak
extern char aEWorkMsdevM_30[]; // idb
extern char aUndefinedTypeR[]; // idb
extern char aUnknownPointer[]; // idb
extern char a1_1_3[6]; // weak
extern double dbl_4F2870; // weak
extern int dword_4F288C; // weak
extern double dbl_4F5372; // weak
extern int dword_4F5428[]; // weak
extern int dword_4F542C[]; // weak
extern _UNKNOWN crtunk_4F54B8; // weak
extern int dword_4F5B24_ys[]; // idb
extern int dword_4F5BF4_xs[]; // idb
extern int dword_4F5CC4_ys[]; // idb
extern int dword_4F5D98_xs[]; // idb
extern int ai_array_4F5E68[500];
extern int ai_array_4F6638_actor_ids[500];
extern int dword_4F6E08[500];
extern int ai_arrays_size; // weak
extern int ai_array_4F75E0[500];
extern unsigned int ai_array_4F7DB0_actor_ids[500];
extern int dword_4F8580[]; // weak
extern int dword_4FA9B0[]; // weak
extern int dword_4FA9B4[]; // weak
extern char byte_4FAA00; // weak
extern __int16 am_sounds[12];
extern _UNKNOWN unk_4FAA20; // weak
extern char byte_4FAA24; // weak
extern HWND dword_4FAA28; // idb
extern char byte_4FAA2C; // weak
extern char byte_4FAA2D; // weak
extern char byte_4FAA2E; // weak
extern int amuint_4FAA34; // weak
extern int amuint_4FAA38; // weak
extern int amuint_4FAA3C_blt_xy[2];
extern int am_uint_4FAA44_blt_xy[2];
extern int amuint_4FAA4C; // weak
extern unsigned int uCardID; // idb
extern int amuint_4FAA54_blt_xy[2];
extern int amuint_4FAA5C_blt_xy[2];
extern int dword_4FAA64; // weak
extern int dword_4FAA68; // weak
extern int amuint_4FAA6C; // idb
extern int dword_4FAA70; // weak
extern char byte_4FAA74; // weak
extern char am_byte_4FAA75; // weak
extern char am_byte_4FAA76; // weak
extern char am_byte_4FAA77; // weak
extern int amuint_4FAA78[777]; // weak
extern char am_byte_4FAA7C[777]; // weak
extern int amuint_4FAA80[777]; // weak
extern int amuint_4FAA84[777]; // weak
extern int amuint_4FAA88[777]; // weak
extern int amuint_4FAA8C[777]; // weak
extern int amuint_4FAA90[777][2];
extern int dword_4FABB8; // weak
extern signed int dword_4FABBC; // idb
extern unsigned int amuint_4FABC0; // idb
extern int amuint_4FABC4; // weak
extern int dword_4FABC8; // weak
extern char byte_4FABD0[]; // weak
extern char byte_4FABD1[]; // weak
extern _UNKNOWN unk_4FABD4; // weak
extern int dword_4FABD8[]; // weak
extern int dword_4FABDC[]; // weak
extern int dword_4FABE0[]; // weak
extern int dword_4FABE4[]; // weak
extern int dword_4FABE8[]; // weak
extern int dword_4FABEC[]; // weak
extern int dword_4FABF0[]; // weak
extern int dword_4FABF4[]; // weak
extern int dword_4FABF8[]; // weak
extern int dword_4FABFC[]; // weak
extern int dword_4FAC00[]; // weak
extern int dword_4FAC04[]; // weak
extern int dword_4FAC08[]; // weak
extern int dword_4FAC0C[]; // weak
extern _UNKNOWN unk_5052C8; // weak
extern int dword_505314[]; // weak
extern char byte_5054C8[32]; // idb
extern char byte_5054E8[108];
extern int dword_505554[]; // weak
extern _UNKNOWN unk_505704; // weak
extern char byte_505880; // weak
extern char byte_505881; // weak
extern int amuint_505884; // weak
extern int amuint_505888; // weak
extern int amuint_50588C; // weak
extern int dword_505890; // weak
extern unsigned int pSRZBufferLineOffsets[480];
extern int areWeLoadingTexture; // weak
extern char byte_506130[]; // weak
extern int dword_506338; // weak
extern int dword_50633C; // idb
extern signed int sRecoveryTime; // idb
extern unsigned int uRequiredMana; // idb
extern int _506348_current_lloyd_playerid; // weak
extern __int64 qword_506350; // weak
extern char byte_506360; // weak
extern int dword_506364; // weak
extern int dword_506408[]; // weak
extern int dword_50640C[]; // weak
extern unsigned int uTextureID_506438;
extern int dword_50651C; // weak
extern int dword_506520; // weak
extern int dword_506524; // weak
extern int dword_506528; // weak
extern int dword_50652C; // weak
extern int dword_506530; // weak
extern int dword_506534; // weak
extern int dword_506538; // weak
extern int dword_50653C; // weak
extern int dword_506540; // weak
extern int dword_506544; // weak
extern int dword_506548; // weak
extern int dword_50654C; // weak
extern char byte_506550; // weak
extern char *aMoonPhaseNames[5];
extern int dword_506568; // weak
extern char bRecallingBeacon; // weak
extern int uLastPointedObjectID; // weak
//extern unsigned __int8 bMonsterInfoUI_bDollInitialized;
extern char *aSpellNames[44];
extern int dword_506978; // weak
extern char byte_50697C; // weak
extern int dword_506980; // weak
extern int dword_506984; // weak
extern int dword_506988; // weak
extern int dword_50698C; // weak
extern int dword_506E68; // weak
extern __int16 word_506E6C[18]; // weak
extern unsigned int pPrevVirtualCidesMapping[27];
extern int dword_506F08; // weak
extern int dword_506F0C[]; // idb
extern int uRestUI_FoodRequiredToRest;
extern int dword_506F14; // weak
extern int _506F18_num_hours_to_sleep; // weak
extern int dword_506F1C; // weak
extern int pVisibleWindowsIdxs[20]; // weak
extern int uNumVisibleWindows;
extern char bFlashHistoryBook; // weak
extern char bFlashAutonotesBook; // weak
extern char bFlashQuestBook; // weak
extern int dword_507960; // weak
extern int dword_507964; // weak
extern int dword_507968; // weak
extern int dword_50796C; // weak
extern int dword_507974; // weak
extern int dword_5079B4; // weak
extern int dword_5079C8; // weak
extern int dword_5079CC; // weak
extern int dword_5079D0; // weak
extern int dword_5079D8; // weak
extern struct GUIButton *dword_507A14; // idb
extern struct GUIButton *dword_507A18; // idb
extern unsigned int uGameUIFontShadow;
extern unsigned int uGameUIFontMain;
extern int dword_507B00_spell_info_to_draw_in_popup; // weak
extern char *aMonthNames[12];
extern char *aDayNames[7];
extern char *aSpellSchoolNames[9];
extern char *aAttributeNames[7];
extern int dword_507B94; // weak
extern int dword_507B98_ctrl_pressed; // weak
extern unsigned int uActiveCharacter;
extern int dword_507BF0_is_there_popup_onscreen; // weak
extern int dword_507C08; // weak
extern int dword_507C0C; // weak
extern int dword_507CBC; // weak
extern int dword_507CC0; // weak
extern __int64 qword_507CC8; // weak
extern int _507CD4_RestUI_hourglass_anim_controller; // weak
extern int dword_507CD8; // weak
extern int dword_50B570[]; // weak
extern int dword_50B638[]; // weak
extern int dword_50B700; // weak
extern int dword_50B738[]; // idb
extern int _50B744_view_transformed_ys[43];
extern int dword_50B828[];
extern int _50B834_view_transformed_zs[43];
extern int dword_50B918[];
extern int _50B924_view_transformed_xs[43];
extern int unk_50B9D4[]; // idb
extern int dword_50B9D8_ys[];
extern int dword_50B9E0_ys[]; // idb
extern int dword_50B9EC[]; // idb
extern int dword_50B9F0[2]; // idb
extern int dword_50BAE8_xs[];
extern int dword_50BAF4_xs[];
extern int dword_50B9F8[]; // idb
extern int dword_50BA08[]; // idb
extern int dword_50BAC4[]; // weak
extern int dword_50BAC8[]; // idb
extern int dword_50BAD0[]; // weak
extern int dword_50BAD4[]; // weak
extern int dword_50BADC_xs[]; // weak
extern int dword_50BAE0[]; // weak
extern int dword_50BAE8[]; // weak
extern int dword_50BAEC_xs[]; // weak
extern int dword_50BAF4[]; // weak
extern int dword_50BAF8_xs[]; // weak
extern int dword_50BC10[]; // weak
extern int dword_50BDA0[]; // weak
extern int dword_50BF30[]; // weak
extern char byte_50C0C0; // weak
extern int some_active_character; // weak
extern _UNKNOWN unk_50C190; // weak
extern int dword_50C968; // weak
extern unsigned int pIconIDs_Turn[5];
extern unsigned int uIconID_TurnStop;
extern unsigned int uIconID_TurnHour;
extern int uIconID_CharacterFrame; // idb
extern int dword_50C98C; // weak
extern unsigned int uIconID_TurnStart;
extern int dword_50C994; // weak
extern int dword_50C998_turnbased_icon_1A; // weak
extern int uSpriteID_Spell11; // idb
extern _UNKNOWN unk_50C9A0; // weak
extern int dword_50C9A8; // weak
extern int dword_50C9AC; // weak
extern int dword_50C9D0; // weak
extern int dword_50C9D4; // weak
extern int dword_50C9D8; // weak
extern int dword_50C9DC; // weak
extern struct NPCData *ptr_50C9E0;
extern int dword_50C9E8; // idb
extern int dword_50C9EC[]; // weak
extern int dword_50C9F0[120]; // idb
extern int dword_50CDC8; // weak
extern int dword_50CDCC; // weak
extern int bProcessorIsNotIntel; // weak
extern Vec3_int_ layingitem_vel_50FDFC;
extern char pStartingMapName[]; // idb
extern unsigned __int8 IsPlayerWearingWatersuit[5];
extern char byte_5111C0[54];
extern char byte_5111F6[18];
extern unsigned int papredoll_dbrds[16];
extern unsigned int papredoll_drhs[4];
extern unsigned int papredoll_dlhus[4];
extern unsigned int papredoll_dlhs[4];
extern unsigned int papredoll_dbods[5];
extern int paperdoll_array_511290[4][17][3];
extern unsigned int papredoll_dlaus[5];
extern unsigned int papredoll_dlads[4];
extern int papredoll_flying_feet[]; // idb
extern int dword_511638[4][6];
extern int dword_511788[]; // weak
extern int dword_51179C; // weak
extern int dword_5117A0; // weak
extern int dword_5117A4; // weak
extern int dword_5117A8; // weak
extern int dword_5117AC; // weak
extern int paperdoll_array_511828[4][10];
extern int bRingsShownInCharScreen; // weak
extern int _unused000; // weak

extern unsigned __int16 _56EFD8_minimap[117][137];
extern unsigned int uNumBlueFacesInBLVMinimap;
extern unsigned __int16 pBlueFacesInBLVMinimapIDs[50];
extern int pTextureIDs_isns[14];
extern unsigned int uIconIdx_Spell21;
extern unsigned int uIconIdx_Spell27;
extern int dword_576E28; // weak
extern int dword_576E2C; // weak
extern __int64 _5773B8_event_timer; // weak
extern int dword_5773C0; // weak

extern int dword_591080; // weak
extern int dword_591084; // weak
extern struct Actor *pDialogue_SpeakingActor;
extern unsigned int uDialogueType;
extern unsigned int uDialogue_SpeakingActorNPC_ID;
extern struct LevelDecoration *_591094_decoration;
extern char byte_591098[200]; // idb
extern int uCurrentHouse_Animation; // weak
extern char *dword_591164_teleport_map_name; // idb
extern int dword_591168_teleport_speedz; // weak
extern int dword_59116C_teleport_directionx; // weak
extern int dword_591170_teleport_directiony; // weak
extern int dword_591174_teleportz; // weak
extern int dword_591178_teleporty; // weak
extern int dword_59117C_teleportx; // weak
extern char byte_591180[600]; // idb
extern struct NPCData *array_5913D8[12];
extern struct Texture *pDialogueNPCPortraits[6];
extern int uNumDialogueNPCPortraits; // weak
extern struct Texture *pTexture_591428;
extern struct Texture *pTexture_outside; // idb
extern struct Texture *pTexture_Dialogue_Background;
extern _UNKNOWN unk_597F10; // weak
extern int dword_597F18; // weak
extern char byte_5B0938[2000];
extern int dword_5B5920; // weak
extern int dword_5B5924; // weak
extern int _5B65A8_npcdata_uflags_or_other; // weak
extern int _5B65AC_npcdata_fame_or_other; // weak
extern int _5B65B0_npcdata_rep_or_other; // weak
extern int _5B65B4_npcdata_loword_house_or_other; // weak
extern int _5B65B8_npcdata_hiword_house_or_other; // weak
extern int dword_5B65BC; // weak
extern int dword_5B65C0; // weak
extern int dword_5B65C4; // weak
extern int dword_5B65C8; // weak
extern int dword_5B65CC; // weak
extern int dword_5B65D0_dialogue_actor_npc_id; // weak
extern int dword_5C3418; // weak
extern int dword_5C341C; // weak
extern char byte_5C3427[]; // weak
extern char GameUI_StatusBar_TimedString[200];
extern char pStatusBarString[200];
extern unsigned int GameUI_StatusBar_TimedStringTimeLeft;
extern int bForceDrawStatusBar; // weak
extern int dword_5C35C0; // weak
extern int bDialogueUI_InitializeActor_NPC_ID; // weak
extern int dword_5C35C8; // weak
extern char *p2DEventsTXT_Raw;
extern int uHouse_ExitPic; // weak
extern int dword_5C35D4; // weak
extern char *aAMPMNames[2];
extern char byte_5C45AF[]; // weak
extern char pTmpBuf3[2048];
extern char pFinalMessage[4096]; // idb
extern char pTmpBuf[2000];
extern char pTmpBuf2[2000];
extern char byte_5C6D50[]; // weak
extern int ui_current_text_color; // weak
extern __int64 qword_5C6DF0; // weak
extern int dword_5C6DF8; // weak
extern char item__getname_buffer[104]; // idb
extern char *pClassDescriptions[36];
extern char *pAttributeDescriptions[7];
extern char *pGrandSkillDesc[38];
extern char *pMasterSkillDesc[38];
extern char *pExpertSkillDesc[38];
extern char *pNormalSkillDesc[38];
extern char *pSkillDesc[38];
extern char *pHealthPointsAttributeDescription;
extern char *pSpellPointsAttributeDescription;
extern char *pArmourClassAttributeDescription;
extern char *pPlayerConditionAttributeDescription; // idb
extern char *pFastSpellAttributeDescription;
extern char *pPlayerAgeAttributeDescription;
extern char *pPlayerLevelAttributeDescription;
extern char *pPlayerExperienceAttributeDescription;
extern char *pAttackBonusAttributeDescription;
extern char *pAttackDamageAttributeDescription;
extern char *pMissleBonusAttributeDescription;
extern char *pMissleDamageAttributeDescription;
extern char *pFireResistanceAttributeDescription;
extern char *pAirResistanceAttributeDescription;
extern char *pWaterResistanceAttributeDescription;
extern char *pEarthResistanceAttributeDescription;
extern char *pMindResistanceAttributeDescription;
extern char *pBodyResistanceAttributeDescription;
extern char *pSkillPointsAttributeDescription;
extern char *pClassTXT_Raw;
extern char *pStatsTXT_Raw;
extern char *pSkillDescTXT_Raw;
extern struct StorylineText *pStorylineText;
extern struct FactionTable *pFactionTable;
extern char byte_5C8D1A[]; // weak
extern char *pGlobalTXT_LocalizationStrings[677];
extern char byte_5E4C15[]; // weak
extern char *pSomeItemsNames[14];
extern char *pGlobalTXT_Raw;
extern char *pMonstersTXT_Raw;
extern char *pMonsterPlacementTXT_Raw;
extern char *pSpellsTXT_Raw;
extern char *pMapStatsTXT_Raw;
extern char *pHostileTXT_Raw;
extern char *pPotionsTXT_Raw;
extern char *pPotionNotesTXT_Raw;
extern char *pHistoryTXT_Raw;
extern int _6807B8_level_decorations_ids[]; // idb
extern int _6807E0_num_decorations_with_sounds_6807B8; // weak
extern int _6807E8_level_decorations_ids[]; // idb
extern int _6836C8_num_decorations_6807E8; // weak
extern int dword_69B010[64];
extern float flt_69B138_dist; // weak
extern char byte_69BD41_unused; // weak
extern unsigned int uTextureID_x_u;
extern unsigned int uTextureID_LS_saveU;
extern unsigned int uTextureID_LS_loadU;
extern unsigned int uTextureID_AR_DN_DN;
extern unsigned int uTextureID_AR_UP_DN;
extern unsigned int uTextureID_LS_;
extern unsigned int uTextureID_x_d;
extern unsigned int uTextureID_save_up;
extern unsigned int uTextureID_load_up;
extern unsigned int uTextureID_loadsave;
extern _UNKNOWN _69FBB4_ptr_iterator_end; // weak
extern _UNKNOWN unk_6A0758; // weak
extern int dword_6A0C9C; // weak
extern unsigned int uLoadGameUI_SelectedSlot;
extern HWND hInsertCDWindow; // idb
extern int uCPUSpeed; // weak
extern char cMM7GameCDDriveLetter; // idb
extern void *ptr_6A0D08;
extern int _6A0D0C_txt_lod_loading; // weak
extern int _6A0D10_txt_lod_loading__unused; // weak
extern enum MENU_STATE uCurrentMenuID;
extern unsigned int uGameState;
extern int uDefaultTravelTime_ByFoot; // weak
extern int day_attrib; // weak
extern int day_fogrange_1; // weak
extern int day_fogrange_2; // weak
extern struct TileTable *pTileTable; // idb
extern int texmapping_terrain_subdivsize; // weak
extern int texmapping_terrain_subdivpow2; // weak
extern int texmapping_building_subdivsize; // weak
extern int texmapping_building_subdivpow2; // weak
extern int unnamed_6BE060[2];
extern int mipmapping_building_mm1; // weak
extern int mipmapping_building_mm2; // weak
extern int mipmapping_building_mm3; // weak
extern int mipmapping_terrain_mm1; // weak
extern int mipmapping_terrain_mm2; // weak
extern int mipmapping_terrain_mm3; // weak
extern int outdoor_grid_band_1; // idb
extern int outdoor_grid_band_2; // idb
extern int outdoor_grid_band_3; // idb
extern char outdoor_day_top_r; // weak
extern char outdoor_day_top_g; // weak
extern char outdoor_day_top_b; // weak
extern char outdoor_day_bottom_r; // weak
extern char outdoor_day_bottom_g; // weak
extern char outdoor_day_bottom_b; // weak
extern char outdoor_night_top_r; // weak
extern char outdoor_night_top_g; // weak
extern char outdoor_night_top_b; // weak
extern char outdoor_night_bottom_r; // weak
extern char outdoor_night_bottom_g; // weak
extern char outdoor_night_bottom_b; // weak
extern char pDefaultSkyTexture[]; // idb
extern char byte_6BE124_cfg_textures_DefaultGroundTexture[16]; // idb
extern int _6BE134_odm_main_tile_group; // weak
extern int dword_6BE138; // weak
extern int dword_6BE13C_uCurrentlyLoadedLocationID; // weak
extern float fWalkSpeedMultiplier; // weak
extern float fBackwardWalkSpeedMultiplier; // weak
extern float fTurnSpeedMultiplier; // weak
extern float flt_6BE150_look_up_down_dangle; // weak
//extern char pMM7WindowClassName[]; // idb
//extern HINSTANCE hInstance; // idb
//extern char *pCmdLine;
extern HWND hWnd; // idb
extern int uWindowWidth; // idb
extern int uWindowHeight; // idb
extern int uWindowX; // idb
extern int uWindowY; // idb
extern LONG uWindowStyle; // idb
extern HMENU hOSMenu; // idb
extern int dword_6BE340; // weak
extern char pCurrentMapName[20]; // idb
extern unsigned int uLevelMapStatsID;
extern int uLevel_StartingPointType; // weak
extern int dword_6BE364_game_settings_1; // weak
extern int dword_6BE368_debug_settings_2; // weak
extern unsigned __int8 bUseLoResSprites;
extern unsigned __int8 bUseRegistry;
extern unsigned __int8 bCanLoadFromCD;
extern int bShowDamage; // idb
extern unsigned int bAlwaysRun;
extern unsigned int bFlipOnExit;
extern int dword_6BE384_2dacceloff; // weak
extern char byte_6BE388_graphicsmode; // weak
extern unsigned int uTurnSpeed;
extern float flt_6BE3A0; // weak
extern float flt_6BE3A4_debug_recmod1;
extern float flt_6BE3A8_debug_recmod2;
extern float flt_6BE3AC_debug_recmod1_x_1_6;
extern char byte_6BE3B0[20]; // idb
extern char bUnderwater; // weak
extern char bNoNPCHiring; // weak
extern int _702AC0_unused; // weak
extern int _702AC4_unused; // weak
extern char _702ACC_unused; // weak
extern int bDebugResouces; // weak
extern unsigned int bNoVideo;
extern bool bNoIntro;
extern bool bNoLogo;
extern bool bNoCD;
extern bool bNoSound;
extern int aborting_app; // weak
extern int dword_720020_zvalues[100];
extern int dword_7201B0_zvalues[299];
extern int dword_72065C[]; // weak
extern int dword_720660[]; // idb
extern int dword_7207EC[]; // weak
extern int dword_7207F0[]; // idb
extern int uTextureID_720980; // weak
extern int _720984_unused; // weak
extern char _72098C_unused; // weak
extern __int16 word_7209A0_intercepts_ys_plus_ys[104];
extern __int16 word_720A70_intercepts_xs_plus_xs[104];
extern __int16 word_720B40_intercepts_zs[104];
extern __int16 word_720C10_intercepts_xs[102];
extern int dword_720CDC;
extern __int16 word_720CE0_ys[]; // idb
extern __int16 word_720DB0_xs[]; // idb
extern int dword_720E80[20];
extern int dword_720ED0[20];
extern int dword_720F20[20];
extern __int16 word_720F70[]; // idb
extern __int16 word_721040[]; // idb
extern int dword_721110[]; // idb
extern int dword_721160[]; // idb
extern int dword_7211B0[]; // idb
extern int dword_721200[]; // idb
extern int dword_7212C8[]; // idb
extern __int16 word_721390[]; // idb
extern __int16 word_721460[]; // idb
extern int blv_prev_party_x; // weak
extern int blv_prev_party_z; // weak
extern int blv_prev_party_y; // weak
extern char *dword_721660; // idb
extern char *dword_721664; // idb
extern char *dword_722F10; // idb
extern const char *pQuestTable[512];
extern _UNKNOWN unk_723714; // weak
extern char *dword_723718_autonote_related; // idb
extern int dword_72371C[]; // weak
extern const char *pScrolls[82];
extern int dword_723E80_award_related[]; // weak
extern int dword_723E84[]; // weak
extern int dword_7241C8; // weak
extern struct NPCStats *pNPCStats;
extern char *aNPCProfessionNames[59];
extern char *pAwardsTXT_Raw;
extern char *pScrollsTXT_Raw;
extern char *pMerchantsTXT_Raw;
extern const char *pMerchantsBuyPhrases[7];
extern const char *pMerchantsSellPhrases[7];
extern const char *pMerchantsRepairPhrases[7];
extern const char *pMerchantsIdentifyPhrases[7];
extern char *pTransitionsTXT_Raw;
extern char *pAutonoteTXT_Raw;
extern char *pQuestsTXT_Raw;
extern unsigned int uNumTerrainNormals;
extern int pTerrainSomeOtherData[32768];
extern unsigned __int16 pTerrainNormalIndices[32768];
extern struct Vec3_float_ *pTerrainNormals;
extern int dword_76D518_terrain_cell_world_pos_around_party_y; // weak
extern int dword_76D51C_terrain_cell_world_pos_around_party_y; // weak
extern int dword_76D520_terrain_cell_world_pos_around_party_y; // weak
extern int dword_76D524_terrain_cell_world_pos_around_party_y; // weak
extern int dword_76D528_terrain_cell_world_pos_around_party_z; // weak
extern int dword_76D52C_terrain_cell_world_pos_around_party_z; // weak
extern int dword_76D530_terrain_cell_world_pos_around_party_z; // weak
extern int dword_76D534_terrain_cell_world_pos_around_party_z; // weak
extern int dword_76D538_terrain_cell_world_pos_around_party_x; // weak
extern int dword_76D53C_terrain_cell_world_pos_around_party_x; // weak
extern int dword_76D540_terrain_cell_world_pos_around_party_x; // weak
extern int dword_76D544_terrain_cell_world_pos_around_party_x; // weak
extern int dword_76D548_terrain_cell_world_pos_around_party_y; // weak
extern int dword_76D54C_terrain_cell_world_pos_around_party_y; // weak
extern int dword_76D550_terrain_cell_world_pos_around_party_y; // weak
extern int dword_76D554_terrain_cell_world_pos_around_party_y; // weak
extern int dword_76D558_terrain_cell_world_pos_around_party_z; // weak
extern int dword_76D55C_terrain_cell_world_pos_around_party_z; // weak
extern int dword_76D560_terrain_cell_world_pos_around_party_z; // weak
extern int dword_76D564_terrain_cell_world_pos_around_party_z; // weak
extern int dword_76D568_terrain_cell_world_pos_around_party_x; // weak
extern int dword_76D56C_terrain_cell_world_pos_around_party_x; // weak
extern int dword_76D570_terrain_cell_world_pos_around_party_x; // weak
extern int dword_76D574_terrain_cell_world_pos_around_party_x; // weak
extern int terrain_76D5C8[128];
extern int terrain_76D7C8[128];
extern int terrain_76D9C8[128];
extern int terrain_76DBC8[128];
extern int terrain_76DDC8[128];
extern int terrain_76DFC8[128];
extern int terrain_76E1C8[128];
extern int terrain_76E3C8[128];
extern _UNKNOWN unk_801A00; // weak
extern _UNKNOWN unk_801A0C; // weak
extern char byte_80AA10; // weak
extern int dword_80AA14; // weak
extern int dword_80AA18; // weak
extern int dword_80AA1C; // weak
extern int dword_80AA20; // weak
extern unsigned int uNumElementsIn80AA28;
extern struct stru148 *ptr_80AA28[2000];
extern struct Edge *pNewEdges;
extern struct Surf *pSurfs;
extern struct Edge *pEdges;
extern struct Span *pSpans;
extern struct Edge *ptr_80C978_Edges;
extern struct Surf *ptr_80C97C_Surfs;
extern struct Edge *ptr_80CA10[480];
extern _UNKNOWN unk_80D190; // weak
extern int dword_A74C88; // weak
extern unsigned int uPlayerCreationUI_SkySliderPos;
extern int uPlayerCreationUI_ArrowAnim;
extern unsigned int uPlayerCreationUI_SelectedCharacter;
extern int dword_A74CDC; // weak
extern struct Texture *pTexture_PlayerFaceMask;
extern struct Texture *pTexture_PlayerFaceEradicated;
extern struct Texture *pTexture_PlayerFaceDead;
extern struct Texture *pTextures_PlayerFaces[4][56];
extern int dword_A75070; // weak
extern struct Player *pPlayers[5];
extern __int64 qword_A750D8; // weak
extern __int16 word_A750E0; // weak
extern __int16 word_A750E2; // weak
extern char *pClassNames[36];
extern char *aCharacterConditionNames[19];
extern char *pSkillNames[38];
extern char byte_AE3368[]; // weak
extern char byte_AE3369; // weak
extern char byte_AE336A; // weak
extern char byte_AE336B; // weak
extern int dword_AE336C; // weak
extern int dword_AE3370; // weak
extern char byte_AE5B91; // weak
extern int dword_F1B430[32]; // weak
extern int dword_F8B144; // idb
extern char byte_F8B148[16];
extern __int16 word_F8B158[]; // weak
extern struct Texture *dword_F8B164; // idb
extern struct Texture *dword_F8B168[12];
extern int dword_F8B198; // weak
extern int dword_F8B19C; // weak
extern __int16 word_F8B1A0; // weak
extern const char *dword_F8B1A4; // idb
extern int dword_F8B1A8; // weak
extern int dword_F8B1AC_something_todo_with_awards; // idb
extern int dword_F8B1B0; // weak
extern int dword_F8B1B4; // weak
extern char *pShopOptions[4];
extern _UNKNOWN unk_F8B1C8; // weak
extern int dword_F8B1D8; // weak
extern int dword_F8B1DC; // weak
extern int dword_F8B1E0; // weak
extern int dword_F8B1E4; // weak
extern const char *ptr_F8B1E8; // idb
extern char byte_F8B1EC; // weak
extern char byte_F8B1EF[]; // weak
extern char byte_F8B1F0[4];
extern int dword_F8B1F4; // weak
extern _UNKNOWN unk_F8B1F8; // weak
extern _UNKNOWN unk_F8B5E0; // weak
extern struct FrameTableTxtLine stru_F8B5E8; // weak
extern _UNKNOWN unk_F8B668; // weak
extern _UNKNOWN unk_F8BA50; // weak
extern char byte_F8BC0C; // weak
extern int bGameoverLoop; // weak
extern __int16 word_F8BC48_displaced_face_intersect_plane_coords_a; // idb
extern __int16 word_F8BD18_displaced_face_intersect_plane_coords_b; // idb
//extern _UNKNOWN unk_F8EA04; // weak
//extern _UNKNOWN unk_F8F8F8; // weak
extern int dword_F93F20; // weak
extern int dword_F93F70; // weak

//extern int crt_F94004; // weak
//extern int crtdword_F9400C; // weak
extern FARPROC lpfn; // idb
//extern int crt_F944EC; // weak
//extern int crtdword_F944F0; // weak
//extern void *crt_F944F4; // idb
//extern int crtdword_F944F8; // weak
//extern LPVOID crt_lpMem; // idb
//extern int crt_F94500; // weak
//extern HANDLE crt_hHeap; // idb
//extern int crt_F94508; // weak














//-------------------------------------------------------------------------
// Function declarations

#define __thiscall __cdecl // Test compile in C mode

void __stdcall mm7__vector_constructor(void *a1, int objSize, int numObjs, int (__thiscall *constructor)(int));
int __cdecl ODM_4014E6_AI();
int __cdecl BLV_4016FA_AI();
void __cdecl sub_401A91_AI();
bool __fastcall sub_4070EF_prolly_collide_objects(unsigned int uObjID, unsigned int uObj2ID);
bool __fastcall sub_4075DB(int a1, int a2, int a3, struct BLVFace *a4);
bool __fastcall sub_4077F1(int a1, int a2, int a3, struct ODMFace *a4, struct BSPVertexBuffer *a5);
bool __fastcall sub_407A1C(int x, int z, int y, struct Vec3_int_ v); // idb
void InitializeActors();
void InitializeLayingItems();
int __fastcall sub_4088E9(int a1, int a2, int a3, int a4, int a5, int a6);
unsigned int __thiscall SearchAliveActors(unsigned int *pTotalActors);
unsigned int __fastcall SearchActorByMonsterID(unsigned int *pTotalActors, int uMonsterID);
unsigned int __fastcall SearchActorByGroup(unsigned int *pTotalActors, unsigned int uGroup);
unsigned int __fastcall SearchActorByID(unsigned int *pTotalActors, unsigned int a2);
// char __usercall am_408BB4<al>(int a1<ecx>, int a2<ebp>);
void __cdecl sub_409BE8();
void __cdecl PrepareArcomage();
char __cdecl am_409FE9();
char __cdecl am_40A198();
int __fastcall am_40A255(int a1, int a2);
int __fastcall am_40A283(int a1, int a2);
signed int __fastcall am_40A324(int a1);
int __fastcall am_40A346(int a1);
void __cdecl am_40A383();
bool __cdecl am_40A514();
char __thiscall am_40A560(unsigned int _this);
void __thiscall am_blts(int a1); // idb
void __cdecl am_40AA4E();
void __cdecl am_chroma_blts();
void __cdecl am_DrawUI();
void __fastcall am_40B102(int a1, char *a2, int *pXY); // idb
void __fastcall am_40B17E(int a1, int a2, int *pXY); // idb
void __fastcall am_40B1F3(int a1, int a2, int a3);
void __fastcall am_40B268(int a1, char *a2, int *pXY); // idb
void __cdecl am_chroma_and_copy_blts();
void __cdecl am_chroma_blt();
void __cdecl am_40B4B9();
void __fastcall am_40B76F(int a1);
int __fastcall am_40BB49(int a1);
signed int __fastcall am_40BB67(int a1);
char __fastcall am_40BCFB(int a1, signed int a2);
bool __fastcall am_40BE0E(int a1, signed int a2);
bool __fastcall am_40BF15(int a1, int a2);
void __fastcall am_40BF77(int a1, unsigned int uCardID); // idb
int __fastcall am_40D2B4(struct Vec2_int_ *, int); // weak
int __fastcall am_40D402(int, int); // weak
int __cdecl am_40D444();
struct GUIWindow *__fastcall ModalWindow(const char *pStr, int a4);
char __fastcall pGUIWindow0_draws_text(int a1, const char *pText, int *pXY);
void __thiscall am_BeginScene(unsigned __int16 *pPcxPixels, int a2, int a3); // idb
void __fastcall Blt_Chroma(struct ArcomageRect *pSrcXYZW, int *pTargetXY, int a3, int a4);
void __fastcall Blt_Copy(struct ArcomageRect *pSrcXYZW, int *pTargetXY, int a3);
void __cdecl am_EndScene();
void __fastcall DrawRect(struct Vec4_int_ *pXYZW, unsigned __int16 uColor, char bSolidFill); // idb
int __fastcall rand_interval(int a, int b); // idb
char *__fastcall inv_strcat(const char *Source, char *Dest);
char *__fastcall inv_strcpy(const char *Source, char *Dest);
void __fastcall intToString(int val, char *pOut);
// int __cdecl crt_retnull_sub();
unsigned int __stdcall R8G8B8_to_TargetFormat(int uColor); // idb
unsigned int __fastcall GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(unsigned __int16 r, unsigned __int16 g, unsigned __int16 b); // idb
void __cdecl CallRenderPresent();
void __thiscall DoBlt_Copy(unsigned __int16 *pPixels); // idb
int __stdcall retzero_sub_40DFA7(int); // weak
int loc_40E4FC(); // weak
void __fastcall ZBuffer_Fill(int *pZBuffer, int uTextureId, int iZValue);
__int16 __fastcall sub_40F845(int a1, int a2, int a3, int a4, int a5, __int16 a6, int a7);
void __fastcall ZBuffer_DoFill(int *pZBuffer, Texture *pTex, int uZValue);
void __fastcall sub_40F92A(int *pZBuffer, struct Texture *a2, int a3); // idb
void __cdecl SetMoonPhaseNames();
void __thiscall DrawSpellDescriptionPopup(void *_this);
signed int __fastcall sub_410D99_get_map_index(int a1);
unsigned int __cdecl DrawLloydBeaconsScreen();
char *__cdecl DrawTownPortalScreen();
struct Texture *__fastcall LoadSpellbook(unsigned int uID); // idb
struct GUIWindow *__cdecl sub_41140B();
void __cdecl sub_411473();
void __cdecl OnCloseSpellook();
void __cdecl InitializeBookTextures();
void __cdecl InitializeBookFonts();
void __fastcall LoadThumbnailLloydTexture(unsigned int uSlot, unsigned int uPlayer);
void __cdecl sub_412AF9();
void __cdecl sub_412B58();
char __cdecl sub_412E85();
void __cdecl DrawSpellbook_Quests();
void __cdecl DrawSpellbook_Autonotes();
char *__cdecl DrawSpellbook_Map();
void __thiscall DrawSpellbook(unsigned int uBook); // idb
char *__cdecl GetDayPart();
char __cdecl DrawSpellbook_Calendar();
void __cdecl SetAttributeNames();
void __cdecl uGameUIFontMain_initialize();
void __cdecl uGameUIFontShadow_initialize();
void __cdecl sub_41420D_press_esc();
void __cdecl sub_41426F();
char __cdecl GameMenuUI_DrawKeyBindings();
unsigned int __thiscall sub_414D24(int _this);
void __cdecl GameMenuUI_DrawVideoOptions();
void __cdecl sub_414F82_DrawGameOptions();
void __fastcall DrawPopupWindow(unsigned int uX, unsigned int uY, unsigned int uWidth, unsigned int uHeight); // idb
char *__cdecl DrawCopyrightWindow();
void __cdecl GUI_UpdateWindows();
void __cdecl identify_item();
void __thiscall sub_416B01(void *_this);
void __thiscall sub_416D62_ShowPopupWindow_MonsterRecord_ItemInfo_etcsub_416D62(struct Vec2_int_ *_this);
void __thiscall UI_OnMouseLeftClick(int *pXY); // idb
void __thiscall sub_417871(int *pXY);
void __cdecl sub_4178C4();
void __cdecl sub_4178E1();
unsigned int __fastcall UI_GetHealthManaStringColor(signed int a1, signed int a2);
signed int __thiscall GetConditionDrawColor(unsigned int uConditionIdx); // idb
char __fastcall sub_4179BC_draw_tooltip(const char *a1, const char *a2); // idb
unsigned int __fastcall sub_417AD4(unsigned int uPlayerClass, enum PLAYER_SKILL_TYPE uPlayerSkillType, signed int a3);
const char *__fastcall CharacterUI_GetSkillDescText(unsigned int uPlayerID, enum PLAYER_SKILL_TYPE uPlayerSkillType);
char __cdecl CharacterUI_SkillsTab_ShowHint();
char __cdecl CharacterUI_StatsTab_ShowHint();
char __fastcall CharacterUI_StatsTab_Draw(unsigned int uPlayerID); // idb
int __cdecl sub_419100();
void __cdecl sub_419220();
void __cdecl sub_419379();
void __cdecl sub_419401();
void __cdecl sub_4196A0();
char __fastcall CharacterUI_SkillsTab_Draw(unsigned int uPlayerID); // idb
unsigned int __fastcall CharacterUI_AwardsTab_Draw(unsigned int uPlayerID); // idb
unsigned int __fastcall GetSizeInInventorySlots(unsigned int uNumPixels);
void __fastcall CharacterUI_InventoryTab_Draw(unsigned int uPlayerID, char a2);
void __cdecl draw_leather();
char __cdecl QuickRefDraw();
void __thiscall CharacterUI_CharacterScreen_Draw(unsigned int uPlayerIdx); // idb
void __cdecl GameUI_DrawRightPanelItems();
void __cdecl GameUI_DrawFoodAndGold();
void __cdecl GameUI_DrawLifeManaBars();
void __cdecl draw_right_panel();
void __cdecl GameUI_DrawRightPanelFrames();
struct GUIButton *__fastcall GUI_HandleHotkey(unsigned __int8 uHotkey); // idb
int __fastcall GUI_ReplaceHotkey(unsigned __int8 uOldHotkey, unsigned __int8 uNewHotkey, char bFirstCall);
void __cdecl MainMenuUI_LoadFontsAndSomeStuff();
void __cdecl MainMenuUI_Create();
void __cdecl GameUI_DrawStatusBar_2();
void __thiscall sub_41C0B8_set_status_string(const char *pStr); // idb
void __cdecl GameUI_DrawStatusBar();
bool __thiscall sub_41CD4F(unsigned int _this);
char __fastcall sub_41D20D_buff_remaining_time_string(int ecx0, struct GUIWindow *edx0, __int64 a3, struct GUIFont *a2);
void __thiscall GameUI_DrawItemInfo(struct ItemGen *_this); // idb
char *__fastcall MonsterPopup_Draw(unsigned int uActorID, struct GUIWindow *edx0);
void __cdecl nullsub_3(); // idb
void __cdecl LoadActualSkyFrame();
void __cdecl Sleep6Hours();
void __cdecl RestUI_Initialize();
void __cdecl RestUI_Draw(); // idb
void __cdecl sub_42038D();
void __fastcall sub_420B13(int a1, int a2);
void __fastcall party_finds_gold(unsigned int uNumGold, int _1_dont_share_with_followers___2_the_same_but_without_a_message__else_normal); // idb
void __cdecl sub_420E01();
void __cdecl GameUI_WritePointedObjectStatusString();
struct GUIWindow *__thiscall GameUI_InitializeCharacterWindow(unsigned int _this);
struct GUIWindow *__thiscall sub_4219BE(void *a4);
bool __cdecl sub_421B2C_PlaceInInventory_or_DropPickedItem();
void __fastcall GameUI_OnPlayerPortraitLeftClick(unsigned int uPlayerID); // idb
void __cdecl sub_421EA6_OnInventoryLeftClick();
void __cdecl OnGameViewportClick();
bool __cdecl sub_4226C2();
void __fastcall SetUserInterface(int a1, bool bReplace);
void __cdecl reset_some_strus_flt_2Cs();
void __cdecl j_sub_423B4A();
void __cdecl sub_423B4A();
int __fastcall sub_423B5D(unsigned int uFaceID);
signed int __fastcall sub_424579(int uFaceID, struct stru320 *a2);
bool sub_424829(int a1, struct BspRenderer_stru2 *a2, struct BspRenderer_stru2 *a3, int a4);
signed int __fastcall sr_424CD7(unsigned int uVertexID); // idb
signed int __fastcall sr_424EE0_MakeFanFromTriangle(unsigned int uVertexID); // idb
signed int __fastcall sr_4250FE(unsigned int uVertexID); // idb
signed int __fastcall sr_4252E8(unsigned int uVertexID);
int __fastcall sr_4254D2(signed int a1);
bool __thiscall sr_42620A(struct RenderVertexSoft *p);
int __fastcall _4268E3_smthn_to_a1r5g5b5(unsigned int uColor); // idb
int __fastcall _42690D_colors_cvt(unsigned int a1);
void __cdecl sub_426947();
int __fastcall sub_4269A2_GivePartyExp(unsigned int a1);
bool __fastcall sub_427769_spell(unsigned int uSpellID);
bool __fastcall _42777D_CastSpell_UseWand_ShootArrow(int a1, unsigned int uPlayerID, unsigned int a4, __int16 a5, int a6);
int __fastcall sub_42EBBE(int, int); // weak
bool __cdecl _42ECB5_PlayerAttacksActor();
void __thiscall InitializeTurnBasedAnimations(void *);
signed int __cdecl sub_42F4DA();
bool __fastcall sub_42F7EB_DropItemAt(unsigned int uSpriteID, int x, int y, int z, int a4, int count, int a7, unsigned __int16 attributes, ItemGen *a9);
void __fastcall sub_42F960_create_object(int x, int y, int z); // idb
char *__cdecl sub_42FA22_mess_with_laying_item_list();
signed int __fastcall _42FA66_do_explosive_impact(int a1, int a2, int a3, int a4, __int16 a5, signed int a6);
bool __fastcall sub_42FB5C(signed int a1);
// int __cdecl crt_sub_42FBB7();
// void __cdecl crt_construct_50CDB4();
void __cdecl sub_42FBDD();
void __cdecl sub_42FC15();
void __cdecl ProcessInputActions();
void __cdecl GameUI_MsgProc();
void __cdecl back_to_game();
void __cdecl GUI_MainMenuMessageProc();
double __cdecl get_shading_dist_mist();
double __cdecl GetPickDepth();
void Vec3_short__to_RenderVertexSoft(struct RenderVertexSoft *_this, struct Vec3_short_ *a2);
void __cdecl nullsub_4(); // idb
void __cdecl nullsub_5(); // idb
void __cdecl nullsub_6(); // idb
__int16 __thiscall sub_4382BC(int _this);
int __cdecl sub_4383ED();
__int16 __cdecl sub_43847A();
void __cdecl _438F8F_area_of_effect__damage_evaluate();
void __fastcall DamagePlayerFromMonster(unsigned int uObjID, int a2, struct Vec3_int_ *pPos, unsigned int a4);
void __fastcall sub_43A97E(unsigned int uLayingItemID, signed int a2); // idb
double __fastcall sub_43AE12(signed int a1);
int __fastcall _43AFE3_calc_spell_damage(int a1, int a2, signed int a3, int a4);
void __fastcall sub_43B057(unsigned int uObjID, unsigned int uActorID, struct Vec3_int_ *pVelocity);
__int16 __fastcall sub_43B1B0(signed int a1, unsigned int a2, struct Vec3_int_ *pVelocity, signed int a4);
int __stdcall DirectInputKeyboard_enumerator_43B9B9(int, int); // weak
void Software_ResetNewEdges();
// int __cdecl crt_deconstruct_43B9E3();
int __stdcall DirectInputMouse_enumerator(int, int); // weak
int __cdecl CharacterUI_LoadPaperdollTextures();
int __fastcall _43C91D_FormItemTextureFilename(char *a1, signed int a2, int a3, int a4);
void __fastcall CharacterUI_DrawPaperdoll(unsigned int uPlayerID); // idb
void __fastcall CharacterUI_DrawPaperdollWithRingOverlay(unsigned int uPlayerID); // idb
bool _43ED6F_check_party_races(bool b);
bool __thiscall sub_43EDB9_get_some_race_sex_relation_2(unsigned int _this);
bool __fastcall sub_43EE15_player_has_item(unsigned int uItemID, struct Player *pPlayer, char a3);
bool __fastcall sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(signed int a1);
void __fastcall WetsuitOn(unsigned int uPlayerID); // idb
unsigned int __fastcall WetsuitOff(unsigned int uPlayerID);
void __fastcall PrepareDrawLists_BLV(struct IndoorLocation_drawstru *_this);
int /*__usercall*/ sr_sub_4D6FB0/*<eax>*/(struct stru315 *a1/*<ebp>*/);
int /*__usercall*/ sr_sub_4D705A/*<eax>*/(struct stru315 *a1/*<ebp>*/);
void __cdecl MessWithBillboards_BLV();
int __fastcall _43F55F_get_billboard_light_level(struct RenderBillboard *a1, int uBaseLightLevel);
int __fastcall _43F5C8_get_point_light_level_with_respect_to_lights(unsigned int uBaseLightLevel, int uSectorID, float x, float y, float z);
void PrepareBspRenderList_BLV();
void __fastcall PrepareDecorationsRenderList_BLV(unsigned int uDecorationID, unsigned int uSectorID);
void PrepareActorRenderList_BLV();
void PrepareItemsRenderList_BLV();
void __fastcall sub_440639(int a1);
void __fastcall sub_4406BC(int a1, unsigned int uFirstNode); // idb
void __fastcall sub_440BED(struct IndoorLocation_drawstru *_this);
bool sub_44100D();
void GameUI_DrawTorchlightAndWizardEye();
void GameUI_DrawCharacterSelectionFrame();
void Load_isn_spells_21_27();
void GameUI_DrawPartySpells();
__int16 __fastcall sub_441A4E(int a1);
void GameUI_DrawMinimap(unsigned int uX, unsigned int uY, unsigned int uZ, unsigned int uW, unsigned int uZoom, unsigned int flags);
int __fastcall DrawSpellbook_Map_sub(unsigned int x, unsigned int y, unsigned int a4, int a5, int _48074); // idb
int __cdecl Initialize2DA();
unsigned int __fastcall LoadEventsToBuffer(const char *pContainerName, char *a2, unsigned int uBufferSize);
void __cdecl Initialize_GlobalEVT();
void __cdecl LoadLevel_InitializeLevelStr();
void __cdecl LoadLevel_InitializeLevelEvt();
void __cdecl OnMapLeave();
void /*__usercall*/ OnMapLoad();
void __thiscall Level_LoadEvtAndStr(const char *pLevelName);
char *__cdecl _4443D5_GetMinimapRightClickText();
const char *__cdecl sub_444564();
char *__thiscall _444732_GetEventHintString(unsigned int uEventID); // idb
unsigned int __fastcall sub_444839_move_map(unsigned int a1, int a2, int x, int y, int z, int directiony, int directionx, int a8, const char *pLocationName); // idb
char *__cdecl TransitionUI_Draw();
struct GUIWindow *__cdecl UI_CreateTravelDialogue();
signed int __cdecl GetTravelTime();
void __cdecl TravelUI_Draw();
void __cdecl DrawBranchlessDialogueUI();
void __fastcall sub_4451A8_press_any_key(int a1, int a2, int a4);
void __cdecl sub_4452BB();
const char *__fastcall sub_445308(int a1);
void __cdecl DrawDialogueUI();
struct NPCData *__fastcall GetNPCData(unsigned int npcid);
struct NPCData *__fastcall GetNewNPCData(signed int npcid, int a2);
int __fastcall sub_445C8B(signed int a1);
void __cdecl sub_44603D();
int __fastcall PrepareHouse(unsigned int uHouseID); // idb
bool __fastcall EnterHouse(enum HOUSE_TYPE uHouseID);
int sub_4465DF_check_season(int a1);
int __fastcall IsActorAlive(unsigned int uType, unsigned int uParam, unsigned int uNumAlive); // idb
// void __cdecl crt_construct_5773C4();
bool __thiscall sub_4466C4(void *_this);
void __fastcall EventProcessor(int a1, int a2, int a3);
void __fastcall sub_448518_npc_set_item(int npc, unsigned int item, int a3);
void __fastcall sub_44861E_set_texture(unsigned int uFaceCog, const char *pFilename);
void __fastcall SetDecorationSprite(unsigned int uCog, int a2, const char *pFileName); // idb
void __fastcall sub_44892E_set_faces_bit(int sCogNumber, int bit, int on);
void __fastcall ToggleActorGroupFlag(unsigned int uGroupID, unsigned int uFlag, unsigned int bToggle);
void __thiscall GameUI_StatusBar_UpdateTimedString(unsigned int bForceHide); // idb
void __thiscall OnTimer(int a1);
void __fastcall sub_448CF4_spawn_monsters(__int16 typeindex, __int16 level, int count, int x, int y, int z, int group, unsigned int uUniqueName);
void __fastcall sub_448DF8_cast_spell(int spellnum, int rank, int level, int fromx, int fromy, int fromz, int tox, int toy, int toz);
char *__fastcall sub_44987B(const char *pMapName, unsigned int uStartingPointType); // idb
void __thiscall TeleportToStartingPoint(unsigned int uPointType); // idb
__int16 __fastcall sub_449A49_door_switch_animation(unsigned int uDoorID, int a2); // idb
unsigned int __fastcall _449B57_test_bit(unsigned __int8 *a1, __int16 a2);
unsigned char *_449B7E_toggle_bit(unsigned char *pArray, __int16 a2, unsigned __int16 bToggle); // idb
void __cdecl sub_44A56A();
void __fastcall ShowStatusBarString(const char *pString, unsigned int uNumSeconds);
void __cdecl ShowNothingHereStatus();
signed int __cdecl const_2();
bool __cdecl sub_44C28F_open_nwc_dungeon();
// int __cdecl crt_deconstruct_44C42C();
struct GUIFont *LoadFont(const char *pFontFile, const char *pFontPalette, ...);
char *__fastcall FitTextInAWindow(const char *pInString, GUIFont *pFont, GUIWindow *pWindow, unsigned int uX, int a5);
void SpawnEncounter(struct MapInfo *pMapInfo, struct SpawnPointMM7 *spawn, int a3, int a4, int a5);
int __fastcall sub_44FA4C_spawn_light_elemental(int a1, int a2, int a3);
void __cdecl sub_450218_prolly_generate_chests_loot();
signed int __fastcall sub_450521_ProllyDropItemAt(int ecx0, signed int a2, int a3, int a4, int a5, unsigned __int16 a6);
int __fastcall sub_45063B(struct MapInfo *a1, int a2);
void RespawnGlobalDecorations();
bool __fastcall SpawnActor(unsigned int uMonsterID);
int __cdecl GetAlertStatus();
unsigned int __fastcall sub_452442(unsigned __int16 a1, unsigned __int16 a2, int a3, int a4);
signed int __fastcall sub_452A9E(signed int a1);
int __fastcall MakeColorMaskFromBitDepth(int a1);
void __fastcall fill_pixels_fast(unsigned int a1, unsigned __int16 *pPixels, unsigned int uNumPixels);
int __fastcall GetDiceResult(unsigned int uNumDice, unsigned int uDiceSides); // idb
inline void __fastcall memset32(void *ptr, unsigned __int32 value, int count)
{
  auto p = (unsigned __int32 *)ptr;
  for ( int i=0; i < count; i++ )
    *p++ = value;
}
inline void __fastcall j_memset32(int a2, void *a1, unsigned int a3) {memset32(a1, a2, a3);}
// int __cdecl crt_452B74();
int __cdecl j_SetSomeItemsNames();
void __cdecl SetSomeItemsNames();
char *RemoveQuotes(char *Str);
void __cdecl InitializeGameText();
unsigned int __fastcall ParseSpellType(struct FrameTableTxtLine *, int a2);
int __thiscall ParseAttackType(unsigned __int8 *_this);
char __fastcall ParseDamage(const char *Str, int a2, int a3, int a4);
int __fastcall ParseMissleAttackType(const char *Str1);
unsigned int __fastcall SkillToMastery(unsigned __int16 a1);
unsigned int __fastcall GetSpellColor(signed int a1);
void *__thiscall unknown_vdtor_6(void *_this, bool a2);
unsigned __int16 *__fastcall MakeScreenshot(signed int width, signed int height);
void __thiscall SaveScreenshot(const char *pFilename);
void __fastcall GameUI_DrawLoadMenu(unsigned int uDialogueType); // idb
void __cdecl GameUI_DrawSaveMenu();
void __fastcall LoadGame(unsigned int uSlot); // idb
int __fastcall SaveGame(int a1, __int16 *a2);
void __fastcall DoSavegame(unsigned int uSlot); // idb
void GameUI_MainMenu_DoDrawLoad(int a1);
void GameUI_MainMenu_DrawLoad();
void __cdecl sub_4606FE();
void __cdecl TryLoadLevelFromLOD();
void __cdecl sub_46080D();
bool __cdecl Initialize_GamesLOD_NewLOD();
bool Autosave();
void __thiscall PrepareToLoadBLV(unsigned int bLoading);
void __fastcall PrepareToLoadODM(unsigned int bLoading, struct OutdoorCamera *a2);
void __cdecl sub_461103();
int __cdecl sub_4613C4();
int __fastcall sub_4621DA(signed int a1, signed int a2, signed int a3);
int __cdecl sub_46224A();
int __cdecl crt_init_globals_462620();
void __cdecl crt_init_globals_462659();
void __cdecl crt_init_globals_46269B();
void __cdecl crt_init_globals_46271C();
void __cdecl MainMenu_Loop();
char __cdecl sub_4637E0_is_there_popup_onscreen();
void __cdecl ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows();
void __thiscall PrepareWorld(unsigned int _this);
void __thiscall Game_DeinitializeAndTerminate(int exitCode); // idb
void __cdecl FinalInitialization();
char __cdecl Is_out15odm_underwater();
void __cdecl SetUnderwaterFog();
void __fastcall DoPrepareWorld(unsigned int bLoading, int a2);
int __fastcall ReadWindowsRegistryInt(const char *pKey, int uDefValue); // idb
void __fastcall WriteWindowsRegistryString(const char *pKey, const char *pString);
void __fastcall ReadWindowsRegistryString(const char *pKeyName, char *pOutString, int uBufLen, const char *pDefaultValue);
void __fastcall WriteWindowsRegistryInt(const char *pKey, int val);
bool __fastcall CheckMM7CD(char c);
int loc_465CC8(); // weak
void __cdecl SecondaryInitialization();
void __cdecl CreateAsyncMouse();
void __cdecl CreateAsyncKeyboard();
void __cdecl MM6_Initialize(const wchar_t *pIniFilename);
void __cdecl MM7Initialization();
int __cdecl AbortWithError();
void Abortf(const char *Format, ...);
void FreeSavegameThumbnails();
void SetCurrentMenuID(enum MENU_STATE); // idb
enum MENU_STATE GetCurrentMenuID();
void *__thiscall output_debug_string(void *_this, std::string a2, const char *a3, int a4);
std::string *__fastcall _4678E2_make_error_string(std::string *a1, int line, std::string file);
int __thiscall sub_467D5D(int _this);
void __thiscall sub_467E7F_EquipBody(unsigned int uEquipType); // idb
void __fastcall sub_467F48(signed int a1);
void __cdecl free_book_subwindow();
char __cdecl sub_467FB6();
void __cdecl OnPaperdollLeftClick();
int __thiscall UnprojectX(int x);
int __thiscall UnprojectY(int _this);
char __cdecl OnPressSpace();
char __fastcall DoInteractionWithTopmostZObject(int a1, int a2);
int __fastcall sub_46A6AC(int a1, int a2, int a3);
int __fastcall sub_46A7C8(int a1, int a2, signed int a3);
int __fastcall sub_46A89E(int a1, int a2, signed int a3);
int __cdecl sub_46A99B();
void *__thiscall unknown_libname_8(void *_this, char a2);
unsigned int __cdecl GetGravityStrength();
void __cdecl sub_46BDC0_UpdateUserInput_and_MapSpecificStuff();
void __cdecl BLV_UpdateUserInputAndOther();
void __cdecl ODM_UpdateUserInputAndOther();
bool __fastcall _46BFFA_check_object_intercept(unsigned int uLayingItemID, signed int a2);
void __cdecl _46CC4B_check_event_triggers();
int _46CEC3_get_floor_level(int x, int y, int z, unsigned int uSectorID, unsigned int *pFaceID);
int __fastcall sub_46D49E_prolly_get_world_y_under_party(int a1, signed int a2, int a3, int a4, int *a5, int *a6, int a7);
int __fastcall sub_46D8E3(int a1, signed int a2, int a3, int a4);
signed __int64 __fastcall _46DCC8_get_gravity_direction_outdoor(int a1, int a2, Vec3_int_ *a3);
unsigned int __fastcall sub_46DEF2(signed int a2, unsigned int uLayingItemID);
int __fastcall _46DF1A_collide_against_actor(int, int); // weak
void __cdecl _46E0B2_collide_against_decorations();
void __fastcall _46E26D_collide_against_sprites(signed int a1, signed int a2);
int __thiscall _46E44E_collide_against_faces_and_portals(unsigned int b1); // idb
int __fastcall _46E889_collide_against_bmodels(unsigned int ecx0);
int _46ED1B_collide_against_floor(int x, int y, int z, unsigned int *pSectorID, unsigned int *pFaceID); // idb
void __fastcall _46ED8A_collide_against_layingItems(unsigned int _this);
int __thiscall _46EF01_collision_chech_player(int a1); // idb
signed int __cdecl _46F04E_collide_against_portals();
void __cdecl BLV_UpdateDoors();
void __cdecl UpdateActors_BLV();
void __cdecl UpdateActors_ODM();
void __cdecl UpdateObjects();
int _47272C_collide_agains_some_secotors_floors(int x, int y, int z, unsigned int *pSectorID, unsigned int *pFaceID); // idb
void __cdecl BLV_ProcessPartyActions();
void __cdecl ODM_ProcessPartyActions();
bool __fastcall sub_47531C(int a1, int *a2, int a3, int a4, int a5, int a6, int a7, int a8, BLVFace *a9, int a10);
bool __fastcall sub_4754BF(int a1, int *a2, int a3, int a4, int a5, int a6, int a7, int a8, BLVFace *a9, int a10, int a11);
signed int __thiscall sub_475665(BLVFace *_this, int a2, __int16 a3);
bool __fastcall sub_4759C9(BLVFace *a1, int a2, int a3, __int16 a4);
bool __fastcall sub_475D85(Vec3_int_ *a1, Vec3_int_ *a2, int *a3, BLVFace *a4);
bool __fastcall sub_475F30(int *a1, BLVFace *a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9);
bool __cdecl sub_476387();
bool __thiscall CheckHiredNPCSpeciality(unsigned int uProfession);
void __cdecl InitializeAwards();
void __cdecl InitializeScrolls();
void __cdecl InitializeMerchants();
void __cdecl InitializeTransitions();
void __cdecl InitializeAutonotes();
void __cdecl InitializeQuests();
int __fastcall const_1(int, int); // weak
int __cdecl GetPartyReputation();
void __cdecl sub_4783FA_construct_global_73D150();
void __cdecl loc_4789D4(); // idb
void __cdecl loc_47907F(); // idb
bool __fastcall IsBModelVisible(unsigned int uModelID, int *unused);
void __fastcall _479A53_draw_some_blv_poly(unsigned int uNumVertices, unsigned int uFaceID); // idb
void __thiscall ODM_LoadAndInitialize(const char *pLevelFilename, struct OutdoorCamera *thisa);
unsigned __int16 *__fastcall GetBillboardPalette(struct RenderBillboard *a1, int a2, signed int a3, int a4);
int __fastcall sr_sub_47BEB1(signed int a1, stru148 *a2, int terrain_gamma, int a4, int *a5, int *a6, int a7, int a8);
void *__fastcall sr_sub_47C178(signed int a1, stru148 *a2, int terrain_gamma, int a4);
void *__fastcall sr_sub_47C1CA(stru148 *a1, char a2, int a3, signed int a4);
unsigned __int16 *__fastcall sr_sub_47C24C_get_palette(BLVFace *a1, int a2, int a3, char a4);
char *__fastcall sr_sub_47C28C_get_palette(stru148 *a1, char a2, signed int a3, signed int a4);
unsigned int __cdecl GetLevelFogColor();
int __fastcall sub_47C3D7_get_fog_related_stuff(int a1, int a2, float a3);
signed int __fastcall GetActorTintColor(int a1, int a2, float a3, int a4, struct RenderBillboard *a5);
int __stdcall WorldPosToGridCellX(int); // weak
int __stdcall WorldPosToGridCellZ(int); // weak
int __stdcall GridCellToWorldPosX(int); // weak
int __stdcall GridCellToWorldPosZ(int); // weak
void __fastcall sub_47F4D3(int band1, int band2, int band3);
void __cdecl loc_481185(); // idb
void __cdecl loc_48118F(); // idb
void __cdecl loc_481199(); // idb
char __fastcall sr_sub_481DB2(RenderVertexSoft *a1, signed int a2, stru148 *a3);
void __cdecl ResetStru148s();
void __cdecl sub_481ED9_MessWithOutdoorCamera();
bool __fastcall sub_481EFA(RenderVertexSoft *a1, RenderVertexSoft *a2, RenderVertexSoft *a3, RenderVertexSoft *a4, int a5);
signed int __fastcall sub_481FC9(RenderVertexSoft *_ECX, RenderVertexSoft *a2, RenderVertexSoft *a3, stru148 *a4);
bool __fastcall GetTerrainHeightsAroundParty(int a1, int a2);
int __fastcall GetTerrainHeightsAroundParty2(int a1, int a2, int *a3, int a4);
struct stru148 *__fastcall sr_sub_4829B9(RenderVertexSoft *a1, RenderVertexSoft *a2, RenderVertexSoft *a3, stru148 *a4, int a5);
signed int __cdecl const_1_0();
signed int __thiscall sr_sub_482A94(struct Span *_this);
signed int __fastcall sr_sub_482E07(struct Span *a1, unsigned __int16 *pRenderTarget); // idb
signed int __fastcall sr_sub_4839BD(struct Span *a1, unsigned __int16 *pTargetSurface); // idb
signed int __thiscall sr_sub_48408A_prolly_odm_water_no_waves(struct Span *_this);
signed int __thiscall sr_sub_484442(struct Span *_this);
signed int __thiscall sr_sub_4847EB(struct Span *_this);
signed int __fastcall sr_sub_485407_prolly_odm_water_wavy(struct Span *a1);
signed int __fastcall sr_sub_48585C_mb_DrawSpan(struct Span *a1, unsigned __int16 *pRenderTarget, int a3); // idb
struct stru315 *__fastcall sr_sub_485975(struct stru315 *a1, struct stru315 *a2);
struct stru315 *__fastcall sr_sub_485A24(struct stru315 *a1, struct stru315 *a2);
struct stru315 *__fastcall sr_sub_485AFF(struct stru315 *a1, struct stru316 *a2);
struct stru315 *__fastcall sr_sub_485BAE(struct stru315 *a1, struct stru316 *a2);
struct stru315 *__fastcall sr_sub_485C89(struct stru315 *a1, struct stru316 *a2);
struct stru315 *__fastcall sr_sub_485D3E(struct stru315 *a1, struct stru316 *a2);
void *__fastcall sr_sub_485E1F(struct stru316 *a1, Span *a2, int a3, struct stru148 *a4, int a5, unsigned __int8 a6, char a7);
void __thiscall sub_485F53(struct Vec2_int_ *v); // idb
char __fastcall sr_sub_486B4E_push_outdoor_edges(struct RenderVertexSoft *a1, int *a2, int *a3, stru148 *a4);
void __cdecl sr_sub_486F92_MessWithEdgesAndSpans();
void __cdecl sub_487DA9();
double __thiscall GetFogDensityByTime(struct OutdoorLocation *_this);
int __stdcall loc_489BB3(struct stru320 *a2, int thisa, unsigned int uNumVertices, RenderVertexSoft *a5, float a6, char uClipFlag); // weak
bool __fastcall HSV2RGB(float *a1, float *a2, float *a3, float a4, float a5, float a6);
void __fastcall RGB2HSV(float *a1, float *a2, float a3, float a4, float a5, float *a6);
unsigned int ReplaceHSV(unsigned int uColor, float a2, float gamma, float a4);
int _48B561_mess_with_scaling_along_z(/*int a1, */float a2);
signed int __cdecl sub_4908DE();
signed int __cdecl PlayerCreation_ComputeAttributeBonus();
void __cdecl LoadPlayerPortraintsAndVoices();
int __fastcall ReloadPlayerPortraits(int, int); // weak
void __cdecl sub_491E3A();
void __cdecl DrawHiredNPCs();
void __thiscall GameUI_DrawPortraits(unsigned int _this);
signed int __thiscall CycleCharacter(unsigned int _this);
void __fastcall Rest(unsigned int uHoursToSleep);
int __cdecl _493938_regenerate();
int __thiscall sub_493F79(struct stru351 *_this, __int64 a2);
void __cdecl _494035_timed_effects__water_walking_damage__etc();
unsigned int __fastcall sub_494820(unsigned int a1);
char *__fastcall sub_495366(unsigned __int8 a1, unsigned __int8 a2);
char *__fastcall GetReputationString(signed int a1);
char *__fastcall sub_495461(char *lpsz, unsigned __int8 uPlayerID, struct ItemGen *a3, char *a4, int a5, __int64 *a6);
void __cdecl PlayerCreationUI_Draw();
void __cdecl PlayerCreationUI_Initialize();
void __cdecl DeleteCCharFont();
bool __cdecl PlayerCreationUI_Loop();
void __cdecl loc_49B785(); // idb
unsigned int __fastcall GetMaxMipLevels(unsigned int uDim);
bool __cdecl CheckTextureStages();
bool __cdecl AreRenderSurfacesOk();
int __fastcall sub_4A19D8(unsigned int, unsigned int); // weak
void __cdecl DoRenderBillboards_D3D();
int __fastcall sr_4A46E6_draw_particle_segment(unsigned int x, signed int y, signed int z, int a4, unsigned int lightColor);
void __cdecl Present_ColorKey();
void __cdecl Present_NoColorKey();
int __thiscall sub_4A7063(unsigned int uDiffuse, float a2); // idb
struct SoundHeader *__fastcall FindSound_BinSearch(unsigned int uStart, unsigned int uEnd, const char *pName);
struct SoundData *LoadSound(const char *pSoundName, struct SoundData *pOutBuff, unsigned int uID);
int __fastcall sub_4AAEA6_transform(RenderVertexSoft *a1);
int __fastcall sub_4AB66C(int, int); // weak
int __fastcall GetSoundStrengthByDistanceFromParty(int a1, int a2, int a3);
struct _DIG_DRIVER *Audio_GetFirstHardwareDigitalDriver(void);
void __cdecl PlayLevelMusic();
int __thiscall sub_4AC1C9(unsigned int _this, Vec4_int_ *a2);
struct Vec4_int_ *__thiscall sub_4AC277(unsigned int _this, Vec4_int_ *a2);
struct Vec4_int_ *__thiscall sub_4AC33A_get_cpu_clocks_QPC(int _this, Vec4_int_ *a1);
struct Vec4_int_ *__thiscall sub_4AC4FD_get_cpu_clocks_rdtsc(int _this, Vec4_int_ *a1);
int __fastcall sub_4AD504(unsigned int uFaceID);
void __fastcall sub_4ADD1D(int uFaceID);
int __fastcall sub_4AE1E7(int a1, int a2, int a3);
int __fastcall sub_4AE313(int viewport_space_x, int viewport_space_y, struct stru337_stru0 *p);
int __fastcall sub_4AE491(int, int); // weak
void __fastcall sub_4AE5F1(unsigned int uFaceID); // idb
int __cdecl sub_4AF412();
void __cdecl stru170_sub_4B0967();
void __cdecl loc_4B0DFB(); // idb
void __cdecl nullsub_18(); // idb
void __cdecl nullsub_19(); // idb
unsigned int __fastcall sub_4B0E07(unsigned int uFaceID); // idb
void __cdecl nullsub_20(); // idb
void __cdecl nullsub_21(); // idb
struct Player *__fastcall sub_4B1447_party_fine(int a1, int a2, int a3);
char *__thiscall sub_4B1523(int *_this);
bool __cdecl sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
void __cdecl sub_4B1A2D();
void __stdcall RestAndHeal(__int64 uNumMinutes); // idb
void __cdecl sub_4B1D27();
void __fastcall HousePlaySomeSound(unsigned int uHouseID, int a2); // idb
void __cdecl sub_4B1ECE();
void __fastcall sub_4B2001(signed int a1);
char *__thiscall _4B254D_SkillMasteryTeacher(int _this);
const char *__fastcall sub_4B29F2(int a1);
char __cdecl sub_4B2A74();
struct GUIButton *__fastcall sub_4B36CC(int a1, unsigned int a2);
int __thiscall sub_4B3703(void *_this);
int __thiscall sub_4B3A72(int a1); // idb
int __fastcall sub_4B3AD4(signed int a1);
int __fastcall sub_4B3B42(signed int a1);
void __cdecl sub_4B3E1E();
void __fastcall sub_4B3EF0(int a4);
void __fastcall sub_4B3FE5(int a4);
void __cdecl sub_4B40E6();
struct GUIButton *__thiscall _4B4224_UpdateNPCTopics(int _this);
char __fastcall sub_4B46A5(const char *Str, int a5);
int __fastcall sub_4B46F8(int a1);
int __cdecl ui_training();
char *__cdecl sub_4B4F4F();
int __cdecl ui_shop_teachers();
int __cdecl sub_4B5D7C();
int __cdecl sub_4B6478();
bool __fastcall sub_4B68EA(int a1);
void __cdecl TravelByTransport();
int __cdecl sub_4B705E();
void __cdecl sub_4B7911();
void __cdecl _4B7D7E_bank();
void __cdecl sub_4B8285_prolly_draw_arcomage_result();
void *__cdecl GenerateShopItems();
void *__cdecl sub_4B8F94();
char *__cdecl sub_4B910F();
POINT *__cdecl sub_4B9CC6();
void __cdecl sub_4BA928();
signed int __fastcall sub_4BB756(signed int a1);
const char *sub_4BBA85_bounties();
void __cdecl sub_4BBCDD();
void __fastcall _4BBF61_summon_actor(int a1, __int16 x, int y, int z); // idb
void __cdecl ArenaFight();
void __thiscall sub_4BC49B(unsigned int _this);
struct Texture *__cdecl sub_4BC8D5();
struct GUIButton *__cdecl sub_4BCA33();
void __fastcall sub_4BCACC_bounties(signed int a1);
signed int __cdecl sub_4BD8B5();
bool __fastcall sub_4BDAAF(ItemGen *a1, int _2da_idx);
void __cdecl sub_4BDB56_buy_skill____();
struct FrameTableTxtLine *__thiscall texture_frame_table_txt_parser(const char *_this, FrameTableTxtLine *a2);
struct FrameTableTxtLine *__thiscall frame_table_txt_parser(const char *pString, FrameTableTxtLine *a2);
int __fastcall sub_4BE571(int a1, int *a2, int a3, int a4);
void __cdecl ShowIntroVideo_and_LoadingScreen();
unsigned int __thiscall GameOverMenu(void *ecx0);
bool __thiscall BinkLockBuffer(struct _BINKBUF *_this);
void __thiscall BinkUnlockBuffer(struct _BINKBUF *_this);
void __cdecl loc_4C0D27(); // idb
void __cdecl vis_nullsub_22(); // idb
void __cdecl vis_nullsub_23(); // idb
void __cdecl vis_loc_4C19F7(); // idb
int __cdecl sr_sub_4D714C(struct stru315 *a1);
int __cdecl sr_sub_4D71F8(struct stru315 *a1);
void __cdecl sr_sub_4D754B(struct stru315 *a1, struct stru316 *a2);
void __cdecl sr_sub_4D7630(struct stru315 *a1, struct stru316 *a2);
void __cdecl sr_sub_4D76ED(struct stru315 *a1, struct stru316 *a2);
void __cdecl sr_sub_4D77D2(struct stru315 *a1, struct stru316 *a2);
void __cdecl sr_sub_4D789A(struct stru315 *a1, struct stru316 *a2);
int __cdecl sub_4D798C(int a1, int a2, int a3, int a4);
int __cdecl sub_4D79CF(int a1, int a2, int a3, int a4);
int __cdecl sub_4D79FD(int a1, int a2, int a3, int a4);
int __cdecl sub_4D7A10(int a1, int a2, int a3, int a4);
int /*__usercall*/ sr_sub_4D72EC/*<eax>*/(int a1/*<ebp>*/);
int /*__usercall*/ sr_sub_4D73DF/*<eax>*/(int a1/*<ebp>*/);
signed int __fastcall SpawnRandomTreasure(struct MapInfo *a1, struct SpawnPointMM7 *a2);
bool __fastcall DamageMonsterFromParty(signed int a1, unsigned int uActorID_Monster, struct Vec3_int_ *pVelocity);


#define ErrD3D(hr) do {extern void ErrHR(HRESULT, const char *, const char *, const char *, int); ErrHR(hr, "Direct3D", __FUNCTION__, __FILE__, __LINE__);} while(0)


namespace zlib
{
  int MemZip(void *dest, unsigned int *destLen, void *source, unsigned int sourceLen);
  int MemUnzip(void *dest, unsigned int *destLen, const void *source, unsigned int sourceLen);
};