view Outdoor.h @ 796:14beae4f1723

Last observable issues with walking in dragon cave fixed.
author Nomad
date Mon, 25 Mar 2013 14:56:50 +0200
parents 346f7069676a
children f5156b8c61ad
line wrap: on
line source

#pragma
#include "BSPModel.h"
#include "OutdoorCamera.h"
#include "Indoor.h"
#include "TileFrameTable.h"
#include "MapInfo.h"



#define DAY_ATTRIB_FOG  1

/*  256 */
#pragma pack(push, 1)
struct ODMHeader
{
  int uVersion;
  char pMagic[4];
  unsigned int uCompressedSize;
  unsigned int uDecompressedSize;
};
#pragma pack(pop)



/*   78 */
#pragma pack(push, 1)
struct OutdoorLocationTileType
{
  Tileset tileset;
  unsigned __int16 uTileID;
};
#pragma pack(pop)

#pragma pack(push, 1)
struct DMap
    {
    unsigned __int8 field0;
    unsigned __int8 field1;
    };
#pragma pack(pop)

/*   79 */
#pragma pack(push, 1)
struct OutdoorLocationTerrain
{
  //----- (0047C794) --------------------------------------------------------
  inline OutdoorLocationTerrain()
  {
    pHeightmap = NULL;
    pTilemap = NULL;
    pAttributemap = NULL;
    pDmap = NULL;;
    this->field_10 = 0;
    this->field_12 = 0;

    
  }

  void _47C7A9();
  void Release();
  void FillDMap(int X, int Y, int W, int Z);
  int _47CB57(int a1, int a2, int a3);
  bool ZeroLandscape();
  bool Initialize();


  unsigned __int8 *pHeightmap;
  unsigned __int8 *pTilemap;
  unsigned __int8 *pAttributemap;
  struct DMap *pDmap;
  __int16 field_10;
  __int16 field_12;
  __int16 field_14;
  __int16 field_16;
  int field_18;
  int field_1C;
};
#pragma pack(pop)


/*   81 */
#pragma pack(push, 1)
struct ODMFace
{
  bool HasEventHint();

  
  static bool IsBackfaceCulled(struct ODMFace *a1, struct RenderVertexSoft *a2, struct stru148 *a3);
  
  inline bool Invisible() const {return uAttributes & FACE_INVISIBLE;}
  inline bool Visible() const   {return !Invisible();}
  inline bool Portal() const    {return uAttributes & FACE_PORTAL;}
  inline bool Fluid() const     {return uAttributes & FACE_FLUID;}

  struct Plane_int_ pFacePlane;
  int zCalc1;
  int zCalc2;
  int zCalc3;
  unsigned int uAttributes;
  unsigned __int16 pVertexIDs[20];
  unsigned __int16 pTextureUIDs[20];
  unsigned __int16 pTextureVIDs[20];
  signed __int16 pXInterceptDisplacements[20];
  signed __int16 pYInterceptDisplacements[20];
  signed __int16 pZInterceptDisplacements[20];
  unsigned __int16 uTextureID;
  __int16 sTextureDeltaU;
  __int16 sTextureDeltaV;
  struct BBox_short_ pBoundingBox;
  __int16 sCogNumber;
  __int16 sCogTriggeredID;
  __int16 sCogTriggerType;
  char field_128;
  char field_129;
  unsigned __int8 uGradientVertex1;
  unsigned __int8 uGradientVertex2;
  unsigned __int8 uGradientVertex3;
  unsigned __int8 uGradientVertex4;
  unsigned __int8 uNumVertices;
  unsigned __int8 uPolygonType;
  unsigned __int8 uShadeType;
  unsigned __int8 bVisible;
  char field_132;
  char field_133;
};
#pragma pack(pop)



#pragma pack(push, 1)
struct OutdoorLocation
{
  //----- (004626BA) --------------------------------------------------------
  OutdoorLocation()
  {
    subconstuctor();
    uLastSunlightUpdateMinute = 0;

    uNumBModels = 0;
    pBModels = nullptr;
  }
  //----- (004626CD) --------------------------------------------------------
  void subconstuctor()
  {
    //OutdoorLocationTerrain::OutdoorLocationTerrain(&this->pTerrain);
    field_F0 = 0;
    field_F4 = 0x40000000u;
    //DLVHeader::DLVHeader(&v1->ddm);
    pSpawnPoints = 0;
    pBModels = 0;
    pCmap = 0;
    pFaceIDLIST = 0;
    pOMAP = 0;
  }

  void ExecDraw(unsigned int bRedraw);
  void PrepareActorsDrawList();
  void CreateDebugLocation();
  void Release();
  bool Load(const char *pFilename, ODMFace *File, size_t a4, int thisa);
  int GetTileIdByTileMapId(signed int a2);
  unsigned int DoGetTileTexture(unsigned int uX, unsigned int uZ);
  int _47ED83(signed int a2, signed int a3);
  int ActuallyGetSomeOtherTileInfo(unsigned int uX, unsigned int uY);
  int DoGetHeightOnTerrain(unsigned int uX, unsigned int uZ);
  int GetSoundIdByPosition(signed int X_pos, signed int Y_pos, int a4);
  int UpdateDiscoveredArea(int a2, int a3, int a4);
  bool _47F04C(signed int a2, signed int a3);
  bool _47F097(signed int a2, signed int a3);
  bool _47F0E2();
  bool PrepareDecorations();
  int _47F223_LooksLikeGenerateMonsterLoot();
  bool InitalizeActors(int a1);
  bool LoadRoadTileset();
  bool LoadTileGroupIds();
  double GetFogDensityByTime();
  int GetSomeOtherTileInfo(int sX, int sY);
  unsigned int GetTileTexture(int sX, int sZ);
  int GetHeightOnTerrain(int sX, int sZ);
  bool Initialize(const char *pFilename, int File, size_t uRespawnInterval, int thisa);
  bool Release2();
  bool GetTravelDestination(signed int sPartyX, signed int sPartyZ, char *pOut, signed int a5);
  void MessWithLUN();
  void UpdateSunlightVectors();
  void UpdateFog();
  int GetNumFoodRequiredToRestInCurrentPos(int x, signed int y, int z);
  void SetFog();
  void Draw();


  char pLevelFilename[32];
  char pLocationFileName[32];
  char pLocationFileDescription[32];
  char pSkyTextureName[32];
  char pGroundTileset[32];
  OutdoorLocationTileType pTileTypes[4];    // [3]  road tileset
  unsigned int uNumBModels;
  struct OutdoorLocationTerrain pTerrain;
  void *pCmap;
  struct BSPModel *pBModels;
  unsigned int numFaceIDListElems;
  unsigned __int16 *pFaceIDLIST;
  unsigned int *pOMAP;
  unsigned int uSky_TextureID;
  unsigned int uMainTile_BitmapID;
  __int16 field_F0;
  __int16 field_F2;
  int field_F4;
  char field_F8[968];
  unsigned int uNumSpawnPoints;
  struct SpawnPointMM7 *pSpawnPoints;
  struct DDM_DLV_Header ddm;
  unsigned __int64 uLastVisitDay;
  char sky_texture_name[12];
  int day_attrib;
  int day_fogrange_1;
  int day_fogrange_2;
  char field_510[24];
  unsigned char uUndiscoveredArea[88][11];//968
  unsigned char uDicovered_area[88][11];//[968]
  int field_CB8;
  int max_terrain_dimming_level;
  int field_CC0;
  unsigned int pSpriteIDs_LUN[8];
  unsigned int uSpriteID_LUNFULL;
  int field_CE8;
  unsigned int uSpriteID_LUN3_4_cp;
  int field_CF0;
  unsigned int uSpriteID_LUN1_2_cp;
  int field_CF8;
  unsigned int uSpriteID_LUN1_4_cp;
  int field_D00;
  unsigned __int16 uSpriteID_LUN_SUN;
  __int16 field_D06;
  int field_D08;
  int field_D0C;
  int field_D10;
  int field_D14;
  int inv_sunlight_x;
  int inv_sunlight_y;
  int inv_sunlight_z;
  int field_D24;
  int field_D28;
  int field_D2C;
  Vec3_int_ vSunlight;
  int field_D3C;
  int field_D40;
  int field_D44;
  int field_D48;
  int field_D4C;
  float field_D50;
  int field_D54;
  int field_D58;
  int field_D5C;
  int field_D60;
  int field_D64;
  char field_D68[111900];
  float fFogDensity;
  int uLastSunlightUpdateMinute;
};
#pragma pack(pop)


extern struct OutdoorLocation *pOutdoor;





extern MapStartPoint uLevel_StartingPointType; // weak








#include "Outdoor_stuff.h"