resolving namespace std conflicts

This commit is contained in:
Raildex 2020-06-18 15:54:08 +02:00
parent a4e4bd702d
commit 2b4d1ca2e8
25 changed files with 233 additions and 234 deletions

View file

@ -288,8 +288,8 @@ short AIGuard(CREATURE_INFO* creature);
void AlertNearbyGuards(ITEM_INFO* item);
void AlertAllGuards(short itemNumber);
void CreatureKill(ITEM_INFO* item, int killAnim, int killState, short laraAnim);
short CreatureEffect2(ITEM_INFO* item, BITE_INFO* bite, short damage, short angle, function<CreatureEffectFunction> func);
short CreatureEffect(ITEM_INFO* item, BITE_INFO* bite, function<CreatureEffectFunction> func);
short CreatureEffect2(ITEM_INFO* item, BITE_INFO* bite, short damage, short angle, std::function<CreatureEffectFunction> func);
short CreatureEffect(ITEM_INFO* item, BITE_INFO* bite, std::function<CreatureEffectFunction> func);
void CreatureUnderwater(ITEM_INFO* item, int depth);
void CreatureFloat(short itemNumber);
void CreatureJoint(ITEM_INFO* item, short joint, short required);

View file

@ -4,7 +4,7 @@
#include "setup.h"
#include "control.h"
#include "trmath.h"
using std::vector;
ShatterImpactInfo ShatterImpactData;
SHATTER_ITEM ShatterItem;
short SmashedMeshCount;

View file

@ -40,7 +40,7 @@ typedef struct ShatterImpactInfo
typedef struct DebrisMesh
{
RENDERER_BUCKETS bucket;
array<RendererVertex, 3> vertices;
std::array<RendererVertex, 3> vertices;
};
typedef struct DebrisFragment
@ -85,7 +85,7 @@ typedef struct DEBRIS_STRUCT
};
extern SHATTER_ITEM ShatterItem;
extern vector<DebrisFragment> DebrisFragments;
extern std::vector<DebrisFragment> DebrisFragments;
extern ShatterImpactInfo ShatterImpactData;
extern short SmashedMeshCount;
extern MESH_INFO* SmashedMesh[32];

View file

@ -20,7 +20,7 @@ struct FX_INFO
short flag2;
};
extern function<EffectFunction> effect_routines[];
extern std::function<EffectFunction> effect_routines[];
extern FX_INFO* Effects;
bool ItemNearLara(PHD_3DPOS* pos, int radius);

View file

@ -333,7 +333,7 @@ private:
float m_deltaMovement;
InventoryObjectDefinition m_objectsTable[INVENTORY_TABLE_SIZE];
int m_type;
vector<InventoryObjectCombination> m_combinations;
std::vector<InventoryObjectCombination> m_combinations;
int m_activeGui;
float m_cameraY;
float m_cameraTilt;

View file

@ -24,8 +24,8 @@ extern byte LaraNodeUnderwater[NUM_LARA_MESHES];
#define INIT_LARA_MESHES(mesh, to, from) Lara.meshPtrs[mesh] = LARA_MESHES(to, mesh) = LARA_MESHES(from, mesh)
#define LaraRoutineFunction void(ITEM_INFO* item, COLL_INFO* coll)
extern function<LaraRoutineFunction> lara_control_routines[NUM_LARA_STATES + 1];
extern function<LaraRoutineFunction> lara_collision_routines[NUM_LARA_STATES + 1];
extern std::function<LaraRoutineFunction> lara_control_routines[NUM_LARA_STATES + 1];
extern std::function<LaraRoutineFunction> lara_collision_routines[NUM_LARA_STATES + 1];
///extern function<LaraRoutineFunction> lara_camera_routines[NUM_LARA_STATES + 1];
void lara_as_pbleapoff(ITEM_INFO* item, COLL_INFO* coll);

View file

@ -47,7 +47,7 @@ typedef struct SAVEGAME_INFO
typedef struct SaveGameHeader
{
string LevelName;
std::string LevelName;
int Days;
int Hours;
int Minutes;

View file

@ -218,7 +218,7 @@ LUALIB_API void (luaL_openlib) (lua_State *L, const char *libname,
** ===================================================================
*/
/* print a string */
/* print a std::string */
#if !defined(lua_writestring)
#define lua_writestring(s,l) fwrite((s), sizeof(char), (l), stdout)
#endif

View file

@ -160,7 +160,7 @@
/*
** LUA_PATH_SEP is the character that separates templates in a path.
** LUA_PATH_MARK is the string that marks the substitution points in a
** LUA_PATH_MARK is the std::string that marks the substitution points in a
** template.
** LUA_EXEC_DIR in a Windows path is replaced by the executable's
** directory.
@ -427,7 +427,7 @@
@@ lua_number2str converts a float to a string.
@@ l_mathop allows the addition of an 'l' or 'f' to all math operations.
@@ l_floor takes the floor of a float.
@@ lua_str2number converts a decimal numeric string to a number.
@@ lua_str2number converts a decimal numeric std::string to a number.
*/
@ -612,7 +612,7 @@
/*
@@ lua_strx2number converts an hexadecimal numeric string to a number.
@@ lua_strx2number converts an hexadecimal numeric std::string to a number.
** In C99, 'strtod' does that conversion. Otherwise, you can
** leave 'lua_strx2number' undefined and Lua will provide its own
** implementation.

View file

@ -168,7 +168,7 @@ extern int ZEXPORT unzGetGlobalComment OF((unzFile file,
char *szComment,
uLong uSizeBuf));
/*
Get the global comment string of the ZipFile, in the szComment buffer.
Get the global comment std::string of the ZipFile, in the szComment buffer.
uSizeBuf is the size of the szComment buffer.
return the number of byte copied or an error code <0
*/
@ -215,12 +215,12 @@ extern int ZEXPORT unzGetCurrentFileInfo OF((unzFile file,
Get Info about the current file
if pfile_info!=NULL, the *pfile_info structure will contain somes info about
the current file
if szFileName!=NULL, the filemane string will be copied in szFileName
if szFileName!=NULL, the filemane std::string will be copied in szFileName
(fileNameBufferSize is the size of the buffer)
if extraField!=NULL, the extra field information will be copied in extraField
(extraFieldBufferSize is the size of the buffer).
This is the Central-header version of the extra field
if szComment!=NULL, the comment string of the file will be copied in szComment
if szComment!=NULL, the comment std::string of the file will be copied in szComment
(commentBufferSize is the size of the buffer)
*/

View file

@ -285,7 +285,7 @@ ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm));
deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the
stream state was inconsistent, Z_DATA_ERROR if the stream was freed
prematurely (some input or output was discarded). In the error case,
msg may be set but then points to a static string (which must not be
msg may be set but then points to a static std::string (which must not be
deallocated).
*/
@ -388,7 +388,7 @@ ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm));
inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state
was inconsistent. In the error case, msg may be set but then points to a
static string (which must not be deallocated).
static std::string (which must not be deallocated).
*/
/* Advanced functions */
@ -427,10 +427,10 @@ ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
The strategy parameter is used to tune the compression algorithm. Use the
value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a
filter (or predictor), or Z_HUFFMAN_ONLY to force Huffman encoding only (no
string match). Filtered data consists mostly of small values with a
std::string match). Filtered data consists mostly of small values with a
somewhat random distribution. In this case, the compression algorithm is
tuned to compress them better. The effect of Z_FILTERED is to force more
Huffman coding and less string matching; it is somewhat intermediate
Huffman coding and less std::string matching; it is somewhat intermediate
between Z_DEFAULT and Z_HUFFMAN_ONLY. The strategy parameter only affects
the compression ratio but not the correctness of the compressed output even
if it is not set appropriately.
@ -718,7 +718,7 @@ ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...));
ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
/*
Writes the given null-terminated string to the compressed file, excluding
Writes the given null-terminated std::string to the compressed file, excluding
the terminating null character.
gzputs returns the number of characters written, or -1 in case of error.
*/
@ -727,7 +727,7 @@ ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
/*
Reads bytes from the compressed file until len-1 characters are read, or
a newline character is read and transferred to buf, or an end-of-file
condition is encountered. The string is then terminated with a null
condition is encountered. The std::string is then terminated with a null
character.
gzgets returns buf, or Z_NULL in case of error.
*/

View file

@ -8,7 +8,7 @@
#include "Lara.h"
#include "switch.h"
#include "tomb4fx.h"
using std::vector;
BaboonRespawnClass BaboonRespawn;
static BITE_INFO baboonBite = { 10, 10, 11, 4 };

View file

@ -13,7 +13,7 @@ struct BaboonRespawnStruct
class BaboonRespawnClass
{
private:
vector<BaboonRespawnStruct> baboonRespawnArray;
std::vector<BaboonRespawnStruct> baboonRespawnArray;
public:
void Free(void);
void Add(ITEM_INFO* item, int max_count);

View file

@ -8,7 +8,6 @@
#include "ShadowLightBuffer.h"
#include "RoomBuffer.h"
#include "ItemBuffer.h"
#include "CameraMatrixBuffer.h"
#include "Frustum.h"
#include "items.h"
@ -16,6 +15,7 @@
#include <IndexBuffer.h>
#include "VertexBuffer.h"
#include "RenderTarget2D.h"
#include <Renderer\CameraMatrixBuffer.h>
class RenderTarget2D;
@ -42,17 +42,17 @@ struct RendererDisplayMode
};
struct RendererVideoAdapter
{
string Name;
std::string Name;
int Index;
vector<RendererDisplayMode> DisplayModes;
std::vector<RendererDisplayMode> DisplayModes;
};
struct RendererVertex
{
Vector3 Position;
Vector3 Normal;
Vector2 UV;
Vector4 Color;
DirectX::SimpleMath::Vector3 Position;
DirectX::SimpleMath::Vector3 Normal;
DirectX::SimpleMath::Vector2 UV;
DirectX::SimpleMath::Vector4 Color;
float Bone;
};
@ -151,7 +151,7 @@ struct RendererHUDBar
| | |
6-----------7-----------8
*/
RendererHUDBar(ID3D11Device* m_device, int x, int y, int w, int h, int borderSize, array<Vector4, 9> colors);
RendererHUDBar(ID3D11Device* m_device, int x, int y, int w, int h, int borderSize, std::array<DirectX::SimpleMath::Vector4, 9> colors);
};
struct RendererStringToDraw
@ -159,8 +159,8 @@ struct RendererStringToDraw
float X;
float Y;
int Flags;
wstring String;
Vector3 Color;
std::wstring String;
DirectX::SimpleMath::Vector3 Color;
};
struct RendererPolygon
@ -174,32 +174,32 @@ struct RendererPolygon
struct RendererBone
{
Vector3 Translation;
Matrix GlobalTransform;
Matrix Transform;
Vector3 GlobalTranslation;
vector<RendererBone*> Children;
DirectX::SimpleMath::Vector3 Translation;
DirectX::SimpleMath::Matrix GlobalTransform;
DirectX::SimpleMath::Matrix Transform;
DirectX::SimpleMath::Vector3 GlobalTranslation;
std::vector<RendererBone*> Children;
RendererBone* Parent;
int Index;
Vector3 ExtraRotation;
DirectX::SimpleMath::Vector3 ExtraRotation;
byte ExtraRotationFlags;
RendererBone(int index)
{
Index = index;
ExtraRotationFlags = 0;
Translation = Vector3(0, 0, 0);
ExtraRotation = Vector3(0, 0, 0);
Translation = DirectX::SimpleMath::Vector3(0, 0, 0);
ExtraRotation = DirectX::SimpleMath::Vector3(0, 0, 0);
}
};
struct RendererLight
{
Vector3 Position;
DirectX::SimpleMath::Vector3 Position;
float Type;
Vector3 Color;
DirectX::SimpleMath::Vector3 Color;
bool Dynamic;
Vector4 Direction;
DirectX::SimpleMath::Vector4 Direction;
float Intensity;
float In;
float Out;
@ -213,21 +213,21 @@ struct RendererLight
struct RendererAnimatedTexture
{
int Id;
Vector2 UV[4];
DirectX::SimpleMath::Vector2 UV[4];
};
struct RendererAnimatedTextureSet
{
int NumTextures;
vector<RendererAnimatedTexture> Textures;
std::vector<RendererAnimatedTexture> Textures;
};
struct RendererBucket
{
vector<RendererVertex> Vertices;
vector<int> Indices;
vector<RendererPolygon> Polygons;
vector<RendererPolygon> AnimatedPolygons;
std::vector<RendererVertex> Vertices;
std::vector<int> Indices;
std::vector<RendererPolygon> Polygons;
std::vector<RendererPolygon> AnimatedPolygons;
int StartVertex;
int StartIndex;
int NumTriangles;
@ -240,41 +240,41 @@ struct RendererStatic
int Id;
short RoomIndex;
MESH_INFO* Mesh;
Matrix World;
DirectX::SimpleMath::Matrix World;
};
struct RendererRoom
{
ROOM_INFO* Room;
Vector4 AmbientLight;
DirectX::SimpleMath::Vector4 AmbientLight;
RendererBucket Buckets[NUM_BUCKETS];
RendererBucket AnimatedBuckets[NUM_BUCKETS];
vector<RendererLight> Lights;
vector<RendererStatic> Statics;
std::vector<RendererLight> Lights;
std::vector<RendererStatic> Statics;
bool Visited;
float Distance;
int RoomNumber;
vector<RendererLight*> LightsToDraw;
std::vector<RendererLight*> LightsToDraw;
};
struct RendererRoomNode
{
short From;
short To;
Vector4 ClipPort;
DirectX::SimpleMath::Vector4 ClipPort;
};
struct RendererItem
{
int Id;
ITEM_INFO* Item;
Matrix World;
Matrix Translation;
Matrix Rotation;
Matrix Scale;
Matrix AnimationTransforms[32];
DirectX::SimpleMath::Matrix World;
DirectX::SimpleMath::Matrix Translation;
DirectX::SimpleMath::Matrix Rotation;
DirectX::SimpleMath::Matrix Scale;
DirectX::SimpleMath::Matrix AnimationTransforms[32];
int NumMeshes;
vector<RendererLight*> Lights;
std::vector<RendererLight*> Lights;
bool DoneAnimations;
};
@ -283,26 +283,26 @@ struct RendererMesh
BoundingSphere Sphere;
RendererBucket Buckets[NUM_BUCKETS];
RendererBucket AnimatedBuckets[NUM_BUCKETS];
vector<Vector3> Positions;
std::vector<DirectX::SimpleMath::Vector3> Positions;
};
struct RendererEffect
{
int Id;
FX_INFO* Effect;
Matrix World;
DirectX::SimpleMath::Matrix World;
RendererMesh* Mesh;
vector<RendererLight*> Lights;
std::vector<RendererLight*> Lights;
};
struct RendererObject
{
int Id;
vector<RendererMesh*> ObjectMeshes;
std::vector<RendererMesh*> ObjectMeshes;
RendererBone* Skeleton;
vector<Matrix> AnimationTransforms;
vector<Matrix> BindPoseTransforms;
vector<RendererBone*> LinearizedBones;
std::vector<DirectX::SimpleMath::Matrix> AnimationTransforms;
std::vector<DirectX::SimpleMath::Matrix> BindPoseTransforms;
std::vector<RendererBone*> LinearizedBones;
bool DoNotDraw;
bool HasDataInBucket[NUM_BUCKETS];
bool HasDataInAnimatedBucket[NUM_BUCKETS];
@ -320,13 +320,13 @@ struct RendererSprite
{
int Width;
int Height;
Vector2 UV[4];
DirectX::SimpleMath::Vector2 UV[4];
};
struct RendererSpriteSequence
{
int Id;
vector<RendererSprite*> SpritesList;
std::vector<RendererSprite*> SpritesList;
int NumSprites;
RendererSpriteSequence()
@ -339,7 +339,7 @@ struct RendererSpriteSequence
{
Id = id;
NumSprites = num;
SpritesList = vector<RendererSprite*>(NumSprites);
SpritesList = std::vector<RendererSprite*>(NumSprites);
}
RendererSpriteSequence(const RendererSpriteSequence& rhs)
@ -355,7 +355,7 @@ struct RendererSpriteSequence
{
Id = other.Id;
NumSprites = other.NumSprites;
SpritesList = vector<RendererSprite*>(NumSprites);
SpritesList = std::vector<RendererSprite*>(NumSprites);
std::copy(other.SpritesList.begin(), other.SpritesList.end(),back_inserter(SpritesList));
}
return *this;
@ -368,24 +368,24 @@ struct RendererSpriteToDraw
RendererSprite* Sprite;
float Distance;
float Scale;
Vector3 pos;
Vector3 vtx1;
Vector3 vtx2;
Vector3 vtx3;
Vector3 vtx4;
Vector4 color;
DirectX::SimpleMath::Vector3 pos;
DirectX::SimpleMath::Vector3 vtx1;
DirectX::SimpleMath::Vector3 vtx2;
DirectX::SimpleMath::Vector3 vtx3;
DirectX::SimpleMath::Vector3 vtx4;
DirectX::SimpleMath::Vector4 color;
float Rotation;
float Width;
float Height;
BLEND_MODES BlendMode;
Vector3 ConstrainAxis;
DirectX::SimpleMath::Vector3 ConstrainAxis;
};
struct RendererLine3D
{
Vector3 start;
Vector3 end;
Vector4 color;
DirectX::SimpleMath::Vector3 start;
DirectX::SimpleMath::Vector3 end;
DirectX::SimpleMath::Vector4 color;
};
struct RendererWeatherParticle
@ -409,8 +409,8 @@ struct RendererUnderwaterDustParticle
struct RendererLine2D
{
Vector2 Vertices[2];
Vector4 Color;
DirectX::SimpleMath::Vector2 Vertices[2];
DirectX::SimpleMath::Vector4 Color;
};
class Renderer11
@ -428,7 +428,7 @@ private:
D3D11_VIEWPORT m_viewport;
D3D11_VIEWPORT m_shadowMapViewport;
Viewport* m_viewportToolkit;
vector<RendererVideoAdapter> m_adapters;
std::vector<RendererVideoAdapter> m_adapters;
// Main back buffer
ID3D11RenderTargetView* m_backBufferRTV;
@ -496,7 +496,7 @@ private:
// Text and sprites
SpriteFont* m_gameFont;
SpriteBatch* m_spriteBatch;
vector<RendererStringToDraw> m_strings;
std::vector<RendererStringToDraw> m_strings;
int m_blinkColorValue;
int m_blinkColorDirection;
PrimitiveBatch<RendererVertex>* m_primitiveBatch;
@ -519,22 +519,22 @@ private:
IndexBuffer m_moveablesIndexBuffer;
VertexBuffer m_staticsVertexBuffer;
IndexBuffer m_staticsIndexBuffer;
vector<RendererRoom> m_rooms;
Matrix m_hairsMatrices[12];
std::vector<RendererRoom> m_rooms;
DirectX::SimpleMath::Matrix m_hairsMatrices[12];
short m_numHairVertices;
short m_numHairIndices;
vector<RendererVertex> m_hairVertices;
vector<short> m_hairIndices;
vector<RendererRoom*> m_roomsToDraw;
vector<RendererItem*> m_itemsToDraw;
vector<RendererEffect*> m_effectsToDraw;
vector<RendererStatic*> m_staticsToDraw;
vector<RendererLight*> m_lightsToDraw;
vector<RendererLight*> m_dynamicLights;
vector<RendererSpriteToDraw*> m_spritesToDraw;
vector<RendererLine3D*> m_lines3DToDraw;
vector<RendererLine2D*> m_lines2DToDraw;
vector<RendererLight*> m_tempItemLights;
std::vector<RendererVertex> m_hairVertices;
std::vector<short> m_hairIndices;
std::vector<RendererRoom*> m_roomsToDraw;
std::vector<RendererItem*> m_itemsToDraw;
std::vector<RendererEffect*> m_effectsToDraw;
std::vector<RendererStatic*> m_staticsToDraw;
std::vector<RendererLight*> m_lightsToDraw;
std::vector<RendererLight*> m_dynamicLights;
std::vector<RendererSpriteToDraw*> m_spritesToDraw;
std::vector<RendererLine3D*> m_lines3DToDraw;
std::vector<RendererLine2D*> m_lines2DToDraw;
std::vector<RendererLight*> m_tempItemLights;
RendererSpriteToDraw* m_spritesBuffer;
int m_nextSprite;
RendererLine3D* m_lines3DBuffer;
@ -549,15 +549,15 @@ private:
int m_numStatics;
int m_numSprites;
int m_numSpritesSequences;
vector<RendererSpriteSequence> m_spriteSequences;
unordered_map<unsigned int, RendererMesh*> m_meshPointersToMesh;
Matrix m_LaraWorldMatrix;
vector<RendererAnimatedTextureSet> m_animatedTextureSets;
std::vector<RendererSpriteSequence> m_spriteSequences;
std::unordered_map<unsigned int, RendererMesh*> m_meshPointersToMesh;
DirectX::SimpleMath::Matrix m_LaraWorldMatrix;
std::vector<RendererAnimatedTextureSet> m_animatedTextureSets;
int m_numAnimatedTextureSets;
int m_currentCausticsFrame;
RendererUnderwaterDustParticle m_underwaterDustParticles[NUM_UNDERWATER_DUST_PARTICLES];
bool m_firstUnderwaterDustParticles = true;
vector<RendererMesh*> m_meshes;
std::vector<RendererMesh*> m_meshes;
// Debug variables
int m_numDrawCalls = 0;
@ -597,13 +597,13 @@ private:
int getAnimatedTextureInfo(short textureId);
void initialiseHairRemaps();
RendererMesh* getRendererMeshFromTrMesh(RendererObject* obj, short* meshPtr, short boneIndex, int isJoints, int isHairs);
void fromTrAngle(Matrix* matrix, short* frameptr, int index);
void fromTrAngle(DirectX::SimpleMath::Matrix* matrix, short* frameptr, int index);
void buildHierarchy(RendererObject* obj);
void buildHierarchyRecursive(RendererObject* obj, RendererBone* node, RendererBone* parentNode);
void updateAnimation(RendererItem* item, RendererObject* obj, short** frmptr, short frac, short rate, int mask,bool useObjectWorldRotation = false);
bool printDebugMessage(int x, int y, int alpha, byte r, byte g, byte b, LPCSTR Message);
bool checkPortal(short roomIndex, short* portal, Vector4* viewPort, Vector4* clipPort);
void getVisibleRooms(int from, int to, Vector4* viewPort, bool water, int count);
bool checkPortal(short roomIndex, short* portal, DirectX::SimpleMath::Vector4* viewPort, DirectX::SimpleMath::Vector4* clipPort);
void getVisibleRooms(int from, int to, DirectX::SimpleMath::Vector4* viewPort, bool water, int count);
void collectRooms();
void collectItems(short roomNumber);
void collectStatics(short roomNumber);
@ -618,7 +618,7 @@ private:
void updateEffects();
int getFrame(short animation, short frame, short** framePtr, int* rate);
bool drawAmbientCubeMap(short roomNumber);
bool sphereBoxIntersection(Vector3 boxMin, Vector3 boxMax, Vector3 sphereCentre, float sphereRadius);
bool sphereBoxIntersection(DirectX::SimpleMath::Vector3 boxMin, DirectX::SimpleMath::Vector3 boxMax, DirectX::SimpleMath::Vector3 sphereCentre, float sphereRadius);
bool drawHorizonAndSky();
bool drawRooms(bool transparent, bool animated);
bool drawStatics(bool transparent);
@ -655,17 +655,17 @@ private:
int drawInventoryScene();
int drawFinalPass();
void updateAnimatedTextures();
void createBillboardMatrix(Matrix* out, Vector3* particlePos, Vector3* cameraPos, float rotation);
void createBillboardMatrix(DirectX::SimpleMath::Matrix* out, DirectX::SimpleMath::Vector3* particlePos, DirectX::SimpleMath::Vector3* cameraPos, float rotation);
void drawShockwaves();
void drawRipples();
void drawUnderwaterDust();
bool doRain();
bool doSnow();
bool drawFullScreenQuad(ID3D11ShaderResourceView* texture, Vector3 color, bool cinematicBars);
bool drawFullScreenQuad(ID3D11ShaderResourceView* texture, DirectX::SimpleMath::Vector3 color, bool cinematicBars);
bool drawFullScreenImage(ID3D11ShaderResourceView* texture, float fade);
bool isRoomUnderwater(short roomNumber);
bool isInRoom(int x, int y, int z, short roomNumber);
bool drawColoredQuad(int x, int y, int w, int h, Vector4 color);
bool drawColoredQuad(int x, int y, int w, int h, DirectX::SimpleMath::Vector4 color);
bool initialiseScreen(int w, int h, int refreshRate, bool windowed, HWND handle, bool reset);
bool initialiseBars();
bool drawSmokeParticles();
@ -673,9 +673,9 @@ private:
bool drawDripParticles();
bool drawExplosionParticles();
public:
Matrix View;
Matrix Projection;
Matrix ViewProjection;
DirectX::SimpleMath::Matrix View;
DirectX::SimpleMath::Matrix Projection;
DirectX::SimpleMath::Matrix ViewProjection;
float FieldOfView;
int ScreenWidth;
int ScreenHeight;
@ -705,26 +705,26 @@ public:
void DrawLoadingScreen(char* fileName);
void UpdateProgress(float value);
bool IsFading();
void GetLaraBonePosition(Vector3* pos, int bone);
void GetLaraBonePosition(DirectX::SimpleMath::Vector3* pos, int bone);
bool ToggleFullScreen();
bool IsFullsScreen();
vector<RendererVideoAdapter>* GetAdapters();
std::vector<RendererVideoAdapter>* GetAdapters();
bool DoTitleImage();
void AddLine2D(int x1, int y1, int x2, int y2, byte r, byte g, byte b, byte a);
void AddSpriteBillboard(RendererSprite* sprite, Vector3 pos,Vector4 color, float rotation, float scale, float width, float height, BLEND_MODES blendMode);
void AddSpriteBillboardConstrained(RendererSprite* sprite, Vector3 pos, Vector4 color, float rotation, float scale, float width, float height, BLEND_MODES blendMode, Vector3 constrainAxis);
void AddSprite3D(RendererSprite* sprite, Vector3 vtx1, Vector3 vtx2, Vector3 vtx3, Vector3 vtx4, Vector4 color, float rotation, float scale, float width, float height, BLEND_MODES blendMode);
void AddLine3D(Vector3 start, Vector3 end, Vector4 color);
void AddSpriteBillboard(RendererSprite* sprite, DirectX::SimpleMath::Vector3 pos,DirectX::SimpleMath::Vector4 color, float rotation, float scale, float width, float height, BLEND_MODES blendMode);
void AddSpriteBillboardConstrained(RendererSprite* sprite, DirectX::SimpleMath::Vector3 pos, DirectX::SimpleMath::Vector4 color, float rotation, float scale, float width, float height, BLEND_MODES blendMode, DirectX::SimpleMath::Vector3 constrainAxis);
void AddSprite3D(RendererSprite* sprite, DirectX::SimpleMath::Vector3 vtx1, DirectX::SimpleMath::Vector3 vtx2, DirectX::SimpleMath::Vector3 vtx3, DirectX::SimpleMath::Vector3 vtx4, DirectX::SimpleMath::Vector4 color, float rotation, float scale, float width, float height, BLEND_MODES blendMode);
void AddLine3D(DirectX::SimpleMath::Vector3 start, DirectX::SimpleMath::Vector3 end, DirectX::SimpleMath::Vector4 color);
bool ChangeScreenResolution(int width, int height, int frequency, bool windowed);
bool DrawBar(float percent, const RendererHUDBar* const bar);
void FlipRooms(short roomNumber1, short roomNumber2);
void ResetAnimations();
void UpdateLaraAnimations(bool force);
void UpdateItemAnimations(int itemNumber, bool force);
void GetLaraAbsBonePosition(Vector3* pos, int joint);
void GetItemAbsBonePosition(int itemNumber, Vector3* pos, int joint);
int GetSpheres(short itemNumber, BoundingSphere* ptr, char worldSpace, Matrix local);
void GetBoneMatrix(short itemNumber, int joint, Matrix* outMatrix);
void GetLaraAbsBonePosition(DirectX::SimpleMath::Vector3* pos, int joint);
void GetItemAbsBonePosition(int itemNumber, DirectX::SimpleMath::Vector3* pos, int joint);
int GetSpheres(short itemNumber, BoundingSphere* ptr, char worldSpace, DirectX::SimpleMath::Matrix local);
void GetBoneMatrix(short itemNumber, int joint, DirectX::SimpleMath::Matrix* outMatrix);
RendererMesh* getMeshFromMeshPtr(unsigned int meshp);
private:

View file

@ -11,7 +11,7 @@ RendererHUDBar* g_SFXVolumeBar;
bool Renderer11::initialiseBars()
{
array<Vector4, 9> healthColors = {
std::array<Vector4, 9> healthColors = {
//top
Vector4(82 / 255.0f,0,0,1),
Vector4(36 / 255.0f,46 / 255.0f,0,1),
@ -26,7 +26,7 @@ bool Renderer11::initialiseBars()
Vector4(0,82 / 255.0f,0,1),
};
array<Vector4, 9> airColors = {
std::array<Vector4, 9> airColors = {
//top
Vector4(0 ,0,90 / 255.0f,1),
Vector4(0 / 255.0f,28 / 255.0f,84 / 255.0f,1),
@ -41,7 +41,7 @@ bool Renderer11::initialiseBars()
Vector4(0 ,47 / 255.0f,96 / 255.0f,1),
};
array<Vector4, 9> dashColors = {
std::array<Vector4, 9> dashColors = {
//top
Vector4(78 / 255.0f,4 / 255.0f,0,1),
Vector4(161 / 255.0f,25 / 255.0f,84 / 255.0f,1),
@ -55,7 +55,7 @@ bool Renderer11::initialiseBars()
Vector4(161 / 255.0f,25 / 255.0f,84 / 255.0f,1),
Vector4(136 / 255.0f,117 / 255.0f,5 / 255.0f,1),
};
array<Vector4, 9> soundSettingColors = {
std::array<Vector4, 9> soundSettingColors = {
//top
Vector4(0.18f,0.3f,0.72f,1),
Vector4(0.18f,0.3f,0.72f,1),

View file

@ -35,7 +35,7 @@ struct GameScriptSettings
bool EnableDynamicShadows;
bool EnableWaterCaustics;
bool Windowed;
string WindowTitle;
std::string WindowTitle;
int DrawingDistance;
bool ShowRendererSteps;
bool ShowDebugInfo;
@ -111,10 +111,10 @@ struct GameScriptMirror
struct GameScriptLevel
{
int NameStringIndex;
string FileName;
string ScriptFileName;
string LoadScreenFileName;
string Background;
std::string FileName;
std::string ScriptFileName;
std::string LoadScreenFileName;
std::string Background;
int Name;
int Soundtrack;
GameScriptSkyLayer Layer1;

View file

@ -24,8 +24,8 @@
#define LUA_VARIABLE_TYPE_STRING 3
typedef struct LuaFunction {
string Name;
string Code;
std::string Name;
std::string Code;
bool Executed;
};
@ -106,18 +106,18 @@ class LuaVariables
public:
map<string, sol::object> variables;
sol::object GetVariable(string key);
void SetVariable(string key, sol::object value);
sol::object GetVariable(std::string key);
void SetVariable(std::string key, sol::object value);
};
typedef struct LuaVariable
{
bool IsGlobal;
string Name;
std::string Name;
int Type;
float FloatValue;
int IntValue;
string StringValue;
std::string StringValue;
bool BoolValue;
};
@ -139,7 +139,7 @@ public:
void FreeLevelScripts();
void AddTrigger(LuaFunction* function);
void AddLuaId(int luaId, short itemNumber);
void AddLuaName(string luaName, short itemNumber);
void AddLuaName(std::string luaName, short itemNumber);
void AssignItemsAndLara();
void ResetVariables();
@ -156,7 +156,7 @@ public:
void AddOneSecret();
void MakeItemInvisible(short id);
unique_ptr<GameScriptItem> GetItemById(int id);
unique_ptr<GameScriptItem> GetItemByName(string name);
unique_ptr<GameScriptItem> GetItemByName(std::string name);
void PlaySoundEffectAtPosition(short id, int x, int y, int z, int flags);
void PlaySoundEffect(short id, int flags);
GameScriptPosition CreatePosition(float x, float y, float z);

View file

@ -1,6 +1,6 @@
#include "framework.h"
#include "LanguageScript.h"
using std::string;
LanguageScript::LanguageScript(char* name)
{
Name = string(name);

View file

@ -1,6 +1,6 @@
#pragma once
// Define string ids
// Define std::string ids
#define STRING_PASSPORT 1
#define STRING_LARA_HOME 2
#define STRING_CONTROLS 3
@ -104,8 +104,8 @@
class LanguageScript
{
public:
string Name;
vector<string> Strings;
std::string Name;
std::vector<std::string> Strings;
LanguageScript(char* name);
~LanguageScript();

View file

@ -102,8 +102,8 @@ extern int NumMeshPointers;
extern int* MeshTrees;
extern int NumObjects;
extern int NumStaticObjects;
extern vector<int> MoveablesIds;
extern vector<int> StaticObjectsIds;
extern std::vector<int> MoveablesIds;
extern std::vector<int> StaticObjectsIds;
extern int* RawMeshPointers;
extern short* RawMeshData;
extern int NumObjectTextures;

View file

@ -59,7 +59,7 @@ private:
ChunkId* m_chunkFloorData = ChunkId::FromString("T5MFloorData");
int m_magicNumber = 0x4D355254;
string m_filename;
std::string m_filename;
ChunkReader* m_reader;
FileStream* m_stream;
int m_numSamples = 0;
@ -94,7 +94,7 @@ private:
bool readSample();
public:
LevelLoader(string filename);
LevelLoader(std::string filename);
~LevelLoader();
bool Load();
bool FillLegacyData();

View file

@ -13,7 +13,7 @@ struct TrTexturePage
struct TrPolygon
{
vector<int> indices;
std::vector<int> indices;
int animatedSequence;
int frame;
};
@ -28,13 +28,13 @@ struct TrMaterial
struct TrBucket
{
TrMaterial material;
vector<Vector3> positions;
vector<Vector3> colors;
vector<Vector2> textureCoords;
vector<Vector3> normals;
vector<int> verticesEffects;
vector<int> bones;
vector<TrPolygon> polygons;
std::vector<Vector3> positions;
std::vector<Vector3> colors;
std::vector<Vector2> textureCoords;
std::vector<Vector3> normals;
std::vector<int> verticesEffects;
std::vector<int> bones;
std::vector<TrPolygon> polygons;
};
struct TrVolume
@ -44,7 +44,7 @@ struct TrVolume
Quaternion rotation;
BoundingBox box;
BoundingSphere sphere;
string script;
std::string script;
};
struct TrClimbVolume : TrVolume
@ -68,7 +68,7 @@ struct TrSector
int roomAbove;
int floor;
int ceiling;
vector<int> floorData;
std::vector<int> floorData;
};
struct TrLight
@ -88,7 +88,7 @@ struct TrLight
struct TrRoomStatic
{
string name;
std::string name;
Vector3 position;
Quaternion rotation;
Vector3 scale;
@ -97,14 +97,14 @@ struct TrRoomStatic
bool receiveShadows;
bool castShadows;
int flags;
string script;
std::string script;
};
struct TrPortal
{
int adjoiningRoom;
Vector3 normal;
vector<Vector3> vertices;
std::vector<Vector3> vertices;
};
struct TrRoom
@ -123,13 +123,13 @@ struct TrRoom
int alternatGroup;
int flags;
Vector3 ambient;
vector<TrBucket> buckets;
vector<TrLight> lights;
vector<TrRoomStatic> statics;
vector<TrSector> sectors;
vector<TrPortal> portals;
vector<TrTriggerVolume> triggers;
vector<TrClimbVolume> climbVolumes;
std::vector<TrBucket> buckets;
std::vector<TrLight> lights;
std::vector<TrRoomStatic> statics;
std::vector<TrSector> sectors;
std::vector<TrPortal> portals;
std::vector<TrTriggerVolume> triggers;
std::vector<TrClimbVolume> climbVolumes;
int itemNumber;
int fxNumber;
};
@ -137,7 +137,7 @@ struct TrRoom
struct TrMesh
{
BoundingSphere sphere;
vector<TrBucket> buckets;
std::vector<TrBucket> buckets;
};
struct TrBone
@ -150,14 +150,14 @@ struct TrKeyFrame
{
Vector3 origin;
BoundingBox boundingBox;
vector<Quaternion> angles;
std::vector<Quaternion> angles;
};
struct TrAnimCommand
{
int type;
int frame;
vector<int> params;
std::vector<int> params;
};
struct TrAnimDispatch
@ -173,7 +173,7 @@ struct TrStateChange
int state;
int dispatchIndex;
int dispatchCount;
vector<TrAnimDispatch> dispatches;
std::vector<TrAnimDispatch> dispatches;
};
struct TrAnimation
@ -194,9 +194,9 @@ struct TrAnimation
int changesCount;
int commandsIndex;
int commandsCount;
vector<TrKeyFrame> keyframes;
vector<TrStateChange> changes;
vector<TrAnimCommand> commands;
std::vector<TrKeyFrame> keyframes;
std::vector<TrStateChange> changes;
std::vector<TrAnimCommand> commands;
};
struct TrMoveable
@ -208,9 +208,9 @@ struct TrMoveable
int meshCount;
int bonesIndex;
int bonesCount;
vector<TrMesh> meshes;
vector<TrBone> bones;
vector<TrAnimation> animations;
std::vector<TrMesh> meshes;
std::vector<TrBone> bones;
std::vector<TrAnimation> animations;
};
struct TrStatic
@ -220,13 +220,13 @@ struct TrStatic
BoundingBox collisionBox;
int meshNumber;
int meshCount;
vector<TrMesh> meshes;
std::vector<TrMesh> meshes;
};
struct TrAnimatedTexturesFrame
{
int texture;
vector<Vector2> textureCoords;
std::vector<Vector2> textureCoords;
};
struct TrAnimatedTexturesSequence
@ -234,12 +234,12 @@ struct TrAnimatedTexturesSequence
byte animationType;
float fps;
int uvRotate;
vector<TrAnimatedTexturesFrame> frames;
std::vector<TrAnimatedTexturesFrame> frames;
};
struct TrItem
{
string name;
std::string name;
Vector3 position;
Quaternion rotation;
float angle;
@ -247,22 +247,22 @@ struct TrItem
Vector3 color;
int roomNumber;
int objectNumber;
string script;
std::string script;
};
struct TrCamera
{
string name;
std::string name;
Vector3 position;
int roomNumber;
int type;
int flags;
string script;
std::string script;
};
struct TrSoundSource
{
string name;
std::string name;
Vector3 position;
int roomNumber;
float volume;
@ -272,7 +272,7 @@ struct TrSoundSource
struct TrSink
{
string name;
std::string name;
Vector3 position;
int roomNumber;
float strength;
@ -293,7 +293,7 @@ struct TrBox
int flags;
int overlapsIndex;
int overlapsCount;
vector<TrOverlap> overlaps;
std::vector<TrOverlap> overlaps;
};
struct TrSample
@ -313,12 +313,12 @@ struct TrSoundDetails
bool randomizeGain;
bool noPanoramic;
byte loop;
vector<TrSample> samples;
std::vector<TrSample> samples;
};
struct TrFlybyCamera
{
string name;
std::string name;
int sequence;
int number;
Vector3 position;
@ -329,13 +329,13 @@ struct TrFlybyCamera
int timer;
int roomNumber;
int flags;
string script;
std::string script;
};
struct TrSprite
{
int texture;
vector<Vector2> textureCoords;
std::vector<Vector2> textureCoords;
};
struct TrSpriteSequence
@ -343,36 +343,36 @@ struct TrSpriteSequence
int id;
int spritesIndex;
int spritesCount;
vector<TrSprite> sprites;
std::vector<TrSprite> sprites;
};
struct TrLevel
{
vector<TrTexturePage> textures;
vector<TrRoom> rooms;
vector<int> floorData;
vector<TrMesh> meshes;
vector<TrAnimation> animations;
vector<TrBone> bones;
vector<TrStateChange> changes;
vector<TrAnimDispatch> dispatches;
vector<TrKeyFrame> frames;
vector<TrAnimCommand> commands;
vector<TrAnimatedTexturesSequence> animatedTextures;
vector<TrSprite> sprites;
vector<TrSpriteSequence> spriteSequences;
vector<int> soundMap;
vector<TrSoundDetails> soundDetails;
vector<TrSample> samples;
vector<TrItem> items;
vector<TrItem> aiItems;
vector<TrMoveable> moveables;
vector<TrStatic> statics;
vector<TrBox> boxes;
vector<TrOverlap> overlaps;
vector<int> zones[5][2];
vector<TrSink> sinks;
vector<TrCamera> cameras;
vector<TrSoundSource> soundSources;
vector<TrFlybyCamera> flybyCameras;
std::vector<TrTexturePage> textures;
std::vector<TrRoom> rooms;
std::vector<int> floorData;
std::vector<TrMesh> meshes;
std::vector<TrAnimation> animations;
std::vector<TrBone> bones;
std::vector<TrStateChange> changes;
std::vector<TrAnimDispatch> dispatches;
std::vector<TrKeyFrame> frames;
std::vector<TrAnimCommand> commands;
std::vector<TrAnimatedTexturesSequence> animatedTextures;
std::vector<TrSprite> sprites;
std::vector<TrSpriteSequence> spriteSequences;
std::vector<int> soundMap;
std::vector<TrSoundDetails> soundDetails;
std::vector<TrSample> samples;
std::vector<TrItem> items;
std::vector<TrItem> aiItems;
std::vector<TrMoveable> moveables;
std::vector<TrStatic> statics;
std::vector<TrBox> boxes;
std::vector<TrOverlap> overlaps;
std::vector<int> zones[5][2];
std::vector<TrSink> sinks;
std::vector<TrCamera> cameras;
std::vector<TrSoundSource> soundSources;
std::vector<TrFlybyCamera> flybyCameras;
};

View file

@ -18,13 +18,13 @@ typedef struct ObjectInfo
short meshIndex;
int boneIndex;
short* frameBase;
function<void(short itemNumber)> initialise;
function<void(short itemNumber)> control;
function<void(ITEM_INFO* item, int x, int y, int z, int* height)> floor;
function<void(ITEM_INFO* item, int x, int y, int z, int* height)> ceiling;
function<void(ITEM_INFO* item)> drawRoutine;
function<void(ITEM_INFO* item)> drawRoutineExtra;
function<void(short item_num, ITEM_INFO* laraitem, COLL_INFO* coll)> collision;
std::function<void(short itemNumber)> initialise;
std::function<void(short itemNumber)> control;
std::function<void(ITEM_INFO* item, int x, int y, int z, int* height)> floor;
std::function<void(ITEM_INFO* item, int x, int y, int z, int* height)> ceiling;
std::function<void(ITEM_INFO* item)> drawRoutine;
std::function<void(ITEM_INFO* item)> drawRoutineExtra;
std::function<void(short item_num, ITEM_INFO* laraitem, COLL_INFO* coll)> collision;
ZoneType zoneType;
short animIndex;
short hitPoints;

View file

@ -27,7 +27,7 @@ extern HWND WindowsHandle;
#define BeginThread(function, threadid) _beginthreadex(0, 0, &function, 0, 0, &threadid)
#define EndThread() _endthreadex(1)
int lua_exception_handler(lua_State* L, sol::optional<const exception&> maybe_exception, sol::string_view description);
int lua_exception_handler(lua_State* L, sol::optional<const std::exception&> maybe_exception, sol::string_view description);
void WinProcMsg();
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd);
void WinClose();

View file

@ -44,7 +44,6 @@
#include "bass_fx.h"
#include "sol.hpp"
using namespace std;
using namespace DirectX;
using namespace DirectX::SimpleMath;