view Indoor.h @ 82:f9a33f75bae3

Qick Record
author Nomad
date Mon, 29 Oct 2012 00:41:51 +0200
parents 8b0c4d626477
children 8be5293b6b33
line wrap: on
line source

#pragma once
#include "VectorTypes.h"
#include "IndoorCameraD3D.h"




/*  319 */
enum LEVEL_TYPE
{
  LEVEL_null = 0,
  LEVEL_Indoor = 0x1,
  LEVEL_Outdoor = 0x2,
};
extern LEVEL_TYPE uCurrentlyLoadedLevelType;





/*   74 */
#pragma pack(push, 1)
struct LevelDecoration
{
  LevelDecoration();
  int GetGlobalEvent();
  int IsInteractive();
  bool _47A825();


  unsigned __int16 uDecorationDescID;
  __int16 field_2;
  struct Vec3_int_ vPosition;
  int field_10_y_rot;
  __int16 uCog;
  __int16 field_16_event_id;
  __int16 field_18;
  __int16 field_1A;
  __int16 field_1C;
  __int16 field_1E;
};
#pragma pack(pop)
extern LevelDecoration pLevelDecorations[3000];
extern size_t uNumLevelDecorations;
extern LevelDecoration *_5C3420_pDecoration;








/*   86 */
#pragma pack(push, 1)
struct SpawnPointMM6
{
  Vec3_int_ vPosition;
  unsigned __int16 uRadius;
  unsigned __int16 uKind;
  unsigned __int16 uIndex;
  unsigned __int16 uAttributes;
};
#pragma pack(pop)



/*  102 */
#pragma pack(push, 1)
struct SpawnPointMM7
{
  //----- (00448DD6) --------------------------------------------------------
  SpawnPointMM7()
  {
    uRadius = 32;
    uAttributes = 0;
    uIndex = 0;
    uKind = 0;
    uGroup = 0;
  }


  Vec3_int_ vPosition;
  unsigned __int16 uRadius;
  unsigned __int16 uKind;
  unsigned __int16 uIndex;
  unsigned __int16 uAttributes;
  unsigned int uGroup;
};
#pragma pack(pop)










#pragma pack(push, 1)
struct DDM_DLV_Header
{
  //----- (00462607) --------------------------------------------------------
  inline DDM_DLV_Header()
  {
    this->uLastRepawnDay = 0;
    this->uNumRespawns = 0;
    this->uReputation = 0;
    this->field_C_alert = 0;
    this->uNumFacesInBModels = 0;
    this->uNumDecorations = 0;
    this->uNumBModels = 0;
  }


  int uNumRespawns;
  int uLastRepawnDay;
  int uReputation;
  int field_C_alert;
  unsigned int uNumFacesInBModels;
  unsigned int uNumDecorations;
  unsigned int uNumBModels;
  int field_1C;
  int field_20;
  int field_24;
};
#pragma pack(pop)



/*  291 */
enum PolygonType : __int8
{
  POLYGON_Invalid = 0x0,
  POLYGON_VerticalWall = 0x1,
  POLYGON_unk = 0x2,
  POLYGON_Floor = 0x3,
  POLYGON_InBetweenFloorAndWall = 0x4,
  POLYGON_Ceiling = 0x5,
  POLYGON_InBetweenCeilingAndWall = 0x6,
};

/*   90 */
#pragma pack(push, 1)
struct BLVHeader
{
  char field_0[104];
  unsigned int uFaces_fdata_Size;
  unsigned int uSector_rdata_Size;
  unsigned int uSector_lrdata_Size;
  unsigned int uDoors_ddata_Size;
  char field_78[16];
};
#pragma pack(pop)



/*   96 */
#pragma pack(push, 1)
struct BLVSectorMM8
{
  int dword_000074;
};
#pragma pack(pop)

/*   97 */
#pragma pack(push, 1)
struct BLVLightMM6
{
  Vec3_short_ vPosition;
  __int16 uRadius;
  __int16 uAttributes;
  unsigned __int16 uBrightness;
};
#pragma pack(pop)

/*   98 */
#pragma pack(push, 1)
struct BLVLightMM7
{
  struct Vec3_short_ vPosition;
  __int16 uRadius;
  char uRed;
  char uGreen;
  char uBlue;
  char uType;
  __int16 uAtributes;           // & 0x08    doesn't light faces
  __int16 uBrightness;
};
#pragma pack(pop)

/*   99 */
#pragma pack(push, 1)
struct BLVLightMM8
{
  int uID;
};
#pragma pack(pop)



/*  100 */
#pragma pack(push, 1)
struct BLVDoor
{
  enum State: unsigned __int16
  {
    Closed = 0,
    Opening = 1,
    Open = 2,
    Closing = 3
  };

  unsigned int uAttributes;
  unsigned int uDoorID;
  unsigned int uTimeSinceTriggered;
  Vec3_int_ vDirection;
  int uMoveLength;
  int uOpenSpeed;
  int uCloseSpeed;
  unsigned __int16 *pVertexIDs;
  unsigned __int16 *pFaceIDs;
  unsigned __int16 *pSectorIDs;
  __int16 *pDeltaUs;
  __int16 *pDeltaVs;
  unsigned __int16 *pXOffsets;
  unsigned __int16 *pYOffsets;
  unsigned __int16 *pZOffsets;
  unsigned __int16 uNumVertices;
  unsigned __int16 uNumFaces;
  __int16 field_48;
  unsigned __int16 uNumOffsets;
  State uState;
  __int16 field_4E;
};
#pragma pack(pop)

/*  101 */
#pragma pack(push, 1)
struct BLVMapOutline
{
  unsigned __int16 uVertex1ID;
  unsigned __int16 uVertex2ID;
  unsigned __int16 uFace1ID;
  unsigned __int16 uFace2ID;
  __int16 sZ;
  unsigned __int16 uFlags;
};
#pragma pack(pop)


#define FACE_TWO_SIDED        0x00000001 // portal/two-sided
// 0x02  color is saturated against lights
#define FACE_TEXTURE_ANIMATED 0x00000010 // like wavy water
#define FACE_INVISIBLE        0x00002000
#define FACE_TEXTURE_FRAME    0x00004000 // Texture ID is a frameset from TextureFrameTable, otherwise BitmapID
#define FACE_TEXTURE_FLOW     0x00040000 // The texture moves slowly. For horizontal facets only.
#define FACE_CLICKABLE        0x02000000 // Event can be triggered by clicking on the facet.
#define FACE_PRESSURE_PLATE   0x04000000 // Event can be triggered by stepping on the facet.
#define FACE_ETHEREAL         0x20000000 // Untouchable. You can pass through it.

/*   93 */
#pragma pack(push, 1)
struct BLVFace
{
  //----- (0046ED02) --------------------------------------------------------
  inline BLVFace()
  {
    this->uNumVertices = 0;
    this->uAttributes = 0;
    this->uFaceExtraID = 0;
    this->pVertexIDs = 0;
    this->pZInterceptDisplacements = 0;
    this->pYInterceptDisplacements = 0;
    this->pXInterceptDisplacements = 0;
  }

  char _get_normals(Vec3_int_ *a2, Vec3_int_ *a3);
  struct Texture *GetTexture();
  void FromODM(struct ODMFace *a2);

  inline bool Invisible() const {return uAttributes & FACE_INVISIBLE;}
  inline bool Visible() const   {return !Invisible();}
  inline bool TwoSided() const  {return uAttributes & FACE_TWO_SIDED;}
  inline bool Animated() const  {return uAttributes & FACE_TEXTURE_ANIMATED;}
  inline bool Clickable() const {return uAttributes & FACE_CLICKABLE;}


  struct Plane_float_ pFacePlane;
  struct Plane_int_ pFacePlane_old;
  int zCalc1;
  int zCalc2;
  int zCalc3;
  unsigned int uAttributes;
  unsigned __int16 *pVertexIDs;
  unsigned __int16 *pXInterceptDisplacements;
  unsigned __int16 *pYInterceptDisplacements;
  unsigned __int16 *pZInterceptDisplacements;
  signed __int16   *pVertexUIDs;
  signed __int16   *pVertexVIDs;
  unsigned __int16  uFaceExtraID;
  unsigned __int16  uBitmapID;
  unsigned __int16  uSectorID;
  __int16 uBackSectorID;
  struct BBox_short_ pBounding;
  PolygonType uPolygonType;
  unsigned __int8 uNumVertices;
  char field_5E;
  char field_5F;
};
#pragma pack(pop)

/*   94 */
#pragma pack(push, 1)
struct BLVFaceExtra
{
  int HasEventint();

  __int16 field_0;
  __int16 field_2;
  __int16 field_4;
  __int16 field_6;
  __int16 field_8;
  __int16 field_A;
  __int16 field_C;
  unsigned __int16 uAdditionalBitmapID;
  __int16 field_10;
  __int16 field_12;
  __int16 sTextureDeltaU;
  __int16 sTextureDeltaV;
  __int16 sCogNumber;
  unsigned __int16 uEventID;
  __int16 field_1C;
  __int16 field_1E;
  __int16 field_20;
  __int16 field_22;
};
#pragma pack(pop)

/*   95 */
#pragma pack(push, 1)
struct BLVSector
{
  int field_0;
  unsigned __int16 uNumFloors;
  __int16 field_6;
  unsigned __int16 *pFloors;
  __int16 field_C;
  __int16 field_E;
  unsigned __int16 *pWalls;
  __int16 field_14;
  __int16 field_16;
  unsigned __int16 *pCeilings;
  __int16 field_1C;
  __int16 field_1E;
  unsigned __int16 *pFluids;
  __int16 uNumPortals;
  __int16 field_26;
  unsigned __int16 *pPortals;
  __int16 field_2C;
  __int16 uNumNonBSPFaces;
  unsigned __int16 *pFaceIDs;
  __int16 uNumCylinderFaces;
  __int16 field_36;
  int pCylinderFaces;
  __int16 field_3C;
  __int16 field_3E;
  unsigned __int16 *pCogs;
  unsigned __int16 uNumDecorations;
  __int16 field_46;
  unsigned __int16 *pDecorationIDs;
  __int16 field_4C;
  __int16 field_4E;
  unsigned __int16 *pMarkers;
  __int16 uNumLights;
  __int16 field_56;
  unsigned __int16 *pLights;
  __int16 uWaterLevel;
  __int16 uMistLevel;
  __int16 uLightDistanceMultiplier;
  __int16 uMinAmbientLightLevel;
  __int16 uFirstBSPNode;
  __int16 exit_tag;
  BBox_short_ pBounding;
};
#pragma pack(pop)


#pragma pack(push, 1)
struct BLVMapOutlines
{
  uint          uNumOutlines;
  BLVMapOutline pOutlines[1];
};
#pragma pack(pop)



#pragma pack(push, 1)
struct IndoorLocation_stru1
{
  unsigned __int64 uLastVisitDay;
  char field_2F4[48];
};
#pragma pack(pop)



/*   89 */
#pragma pack(push, 1)
struct IndoorLocation
{
  //----- (00462592) --------------------------------------------------------
  inline IndoorLocation()
  {
    bLoaded = 0;
    ptr_0002B8_sector_lrdata = 0;
    ptr_0002B4_doors_ddata = 0;
    ptr_0002B0_sector_rdata = 0;
    ptr_2AC = 0;
    pVertices = 0;
    pFaces = 0;
    pFaceExtras = 0;
    pSectors = 0;
    pLights = 0;
    pDoors = 0;
    pNodes = 0;
    pMapOutlines = 0;
    uNumSpawnPoints = 0;
    pSpawnPoints = 0;
  }

  int GetSector(int sX, int sY, int sZ);
  void Release();
  int Alloc();
  bool Load(char *pFilename, int a3, size_t i, char *pDest);
  void Draw();
  void ToggleLight(unsigned int uLightID, unsigned int bToggle);

  static unsigned int GetLocationIndex(const char *Str1);
  static void ExecDraw(bool bD3D);
  static void ExecDraw_sw(unsigned int uFaceID);
  static void ExecDraw_d3d(unsigned int uFaceID, struct IndoorCameraD3D_Vec4 *pVertices, unsigned int uNumVertices, struct RenderVertexSoft *a4);

  char pFilename[32];
  char field_20[48];
  unsigned int bLoaded;
  char field_54[404];
  struct BLVHeader blv;
  unsigned int uNumVertices;
  struct Vec3_short_ *pVertices;
  unsigned int uNumFaces;
  struct BLVFace *pFaces;
  unsigned int uNumFaceExtras;
  struct BLVFaceExtra *pFaceExtras;
  int uNumSectors;
  struct BLVSector *pSectors;
  int uNumLights;
  struct BLVLightMM7 *pLights;
  int uNumDoors;
  struct BLVDoor *pDoors;
  unsigned int uNumNodes;
  struct BSPNode *pNodes;
  BLVMapOutlines *pMapOutlines;
  unsigned __int16 *ptr_2AC;
  unsigned __int16 *ptr_0002B0_sector_rdata;
  unsigned __int16 *ptr_0002B4_doors_ddata;
  unsigned __int16 *ptr_0002B8_sector_lrdata;
  unsigned int uNumSpawnPoints;
  struct SpawnPointMM7 *pSpawnPoints;
  struct DDM_DLV_Header dlv;
  IndoorLocation_stru1 stru1;
  char _visible_outlines[876];
};
#pragma pack(pop)

extern IndoorLocation *pIndoor;












/*  263 */
#pragma pack(push, 1)
struct IndoorLocation_drawstru
{
  int field_0_timer;
  int uFlags;
  Vec3_int_ vPosition;
  int sRotationY;
  int sRotationX;
  int field_1C_mb_fov;
  unsigned __int16 *pRenderTarget;
  unsigned int uTargetWidth;
  unsigned int uTargetHeight;
  unsigned int uViewportX;
  unsigned int uViewportY;
  unsigned int uViewportZ;
  unsigned int uViewportW;
  int field_3C;
  int *pTargetZ;
};
#pragma pack(pop)












/*  162 */
#pragma pack(push, 1)
struct BLVRenderParams
{
  int Reset(struct IndoorLocation_drawstru *a2);

  int field_0_timer_;
  int uFlags;
  Vec3_int_ vPartyPos;
  int sPartyRotY;
  int sPartyRotX;
  int uPartySectorID;
  int sCosineY;
  int sSineY;
  int sCosineNegX;
  int sSineNegX;
  float fCosineY;
  float fSineY;
  float fCosineNegX;
  float fSineNegX;
  int field_40;
  float field_44;
  unsigned __int16 *pRenderTarget;
  unsigned int uTargetWidth;
  unsigned int uTargetHeight;
  unsigned int uViewportX;
  unsigned int uViewportY;
  unsigned int uViewportZ;
  unsigned int uViewportW;
  int field_64;
  int *pTargetZBuffer;
  int uViewportHeight;
  int field_70;
  int uViewportCenterX;
  int uViewportCenterY;
  struct stru170_stru2 *field_7C;
  unsigned int uNumFacesRenderedThisFrame;
  int field_84;
  int field_88;
  int field_8C;
  int field_90;
  int field_94;
};
#pragma pack(pop)

extern struct BLVRenderParams *pBLVRenderParams;





#include "Indoor_stuff.h"