Fix majority of C compilation errors. Do I even know what I'm doing?

This commit is contained in:
UnknownShadow200 2017-05-11 21:44:53 +10:00
parent bea9194169
commit 0e78857604
6 changed files with 40 additions and 27 deletions

View file

@ -17,13 +17,13 @@
void Gfx_Init(Game* game);
/* Maximum supported length of a dimension (width and height) of a 2D texture. */
Int32 Gfx_MaxTextureDimensions = 0;
Int32 Gfx_MaxTextureDimensions;
/* Minimum near plane value supported by the graphics API. */
float Gfx_MinZNear = 0.0f;
float Gfx_MinZNear;
/* Returns whether this graphics api had a valid context. */
bool Gfx_LostContext = false;
bool Gfx_LostContext;
/* Maximum number of vertices that can be indexed. */
#define Gfx_MaxIndices (65536 / 4 * 6)
@ -31,11 +31,11 @@ bool Gfx_LostContext = false;
/* Event raised when a context is destroyed after having been previously lost. */
Event_Void Gfx_ContextLost[EventHandler_Size];
Int32 Gfx_ContextLostCount = 0;
Int32 Gfx_ContextLostCount;
/* Event raised when a context is recreated after having been previously lost. */
Event_Void Gfx_ContextRecreated[EventHandler_Size];
Int32 Gfx_ContextRecreatedCount = 0;
Int32 Gfx_ContextRecreatedCount;
// TODO: IMPLEMENT THIS
/* /// <summary> Delegate that is invoked when the current context is lost,
@ -162,7 +162,7 @@ void Gfx_DrawIndexedVb_TrisT2fC4b_Range(Int32 indicesCount, Int32 offsetVertex,
/* Optimised version of DrawIndexedVb for VertexFormat_Pos3fTex2fCol4b */
void Gfx_DrawIndexedVb_TrisT2fC4b(Int32 indicesCount, Int32 startIndex);
Int32 Gfx_strideSizes[2] = { 16, 24 };
static Int32 Gfx_strideSizes[2] = { 16, 24 };
/* Sets the matrix type that load/push/pop operations should be applied to. */

View file

@ -1,6 +1,13 @@
#include "Matrix.h"
#include "ExtMath.h"
Matrix Matrix_Identity = {
1.0f, 0.0f, 0.0f, 0.0f,
0.0f, 1.0f, 0.0f, 0.0f,
0.0f, 0.0f, 1.0f, 0.0f,
0.0f, 0.0f, 0.0f, 1.0f
};
/* Transposed, copied from https://open.gl/transformations */
void Matrix_RotateX(Real32 angle, Matrix* result) {

View file

@ -22,13 +22,7 @@ typedef struct Matrix {
} Matrix;
/* Identity matrix. */
Matrix Matrix_Identity = {
1.0f, 0.0f, 0.0f, 0.0f,
0.0f, 1.0f, 0.0f, 0.0f,
0.0f, 0.0f, 1.0f, 0.0f,
0.0f, 0.0f, 0.0f, 1.0f
};
extern Matrix Matrix_Identity;
/* Transformation matrix representing rotation angle radians around X axis. */
void Matrix_RotateX(Real32 angle, Matrix* result);

View file

@ -3,6 +3,18 @@
#include "WorldEvents.h"
BlockID WorldEnv_EdgeBlock = BlockID_StillWater;
BlockID WorldEnv_SidesBlock = BlockID_Bedrock;
Int32 WorldEnv_EdgeHeight;
Int32 WorldEnv_SidesOffset = -2;
Int32 WorldEnv_CloudsHeight;
Real32 WorldEnv_CloudsSpeed = 1.0f;
Real32 WorldEnv_WeatherSpeed = 1.0f;
Real32 WorldEnv_WeatherFade = 1.0f;
Int32 WorldEnv_Weather = Weather_Sunny;
bool WorldEnv_ExpFog = false;
/* Sets a value and potentially raises event. */
#define WorldEnv_Set(value, dst, envVar)\
if (value == dst) return;\

View file

@ -14,36 +14,36 @@
/* Block that surrounds map the map horizontally (default water) */
BlockID WorldEnv_EdgeBlock = BlockID_StillWater;
extern BlockID WorldEnv_EdgeBlock;
/* Block that surrounds the map that fills the bottom of the map horizontally,
fills part of the vertical sides of the map, and also surrounds map the map horizontally. (default bedrock) */
BlockID WorldEnv_SidesBlock = BlockID_Bedrock;
extern BlockID WorldEnv_SidesBlock;
/* Height of the map edge. */
Int32 WorldEnv_EdgeHeight;
extern Int32 WorldEnv_EdgeHeight;
/* Offset of height of map sides from height of map edge. */
Int32 WorldEnv_SidesOffset = -2;
extern Int32 WorldEnv_SidesOffset;
/* Height of the clouds. */
Int32 WorldEnv_CloudsHeight;
extern Int32 WorldEnv_CloudsHeight;
/* Modifier of how fast clouds travel across the world, defaults to 1. */
Real32 WorldEnv_CloudsSpeed = 1.0f;
extern Real32 WorldEnv_CloudsSpeed;
/* Modifier of how fast rain/snow falls, defaults to 1. */
Real32 WorldEnv_WeatherSpeed = 1.0f;
extern Real32 WorldEnv_WeatherSpeed;
/* Modifier of how fast rain/snow fades, defaults to 1. */
Real32 WorldEnv_WeatherFade = 1.0f;
extern Real32 WorldEnv_WeatherFade;
/* Current weather for this particular map. */
Int32 WorldEnv_Weather = Weather_Sunny;
extern Int32 WorldEnv_Weather;
/* Whether exponential fog mode is used by default. */
bool WorldEnv_ExpFog = false;
extern bool WorldEnv_ExpFog;
/* Colour of the sky located behind / above clouds. */

View file

@ -8,7 +8,7 @@
/* Raised when the player joins and begins loading a new world. */
Event_Void WorldEvents_NewMap[EventHandler_Size];
Int32 WorldEvents_NewMapCount = 0;
Int32 WorldEvents_NewMapCount;
/* Raises NewMap event. */
#define WorldEvents_RaiseNewMap()\
@ -18,7 +18,7 @@ EventHandler_Raise_Void(WorldEvents_NewMap, WorldEvents_NewMapCount);
/* Raised when a portion of the world is read and decompressed, or generated.
The floating point argument is progress (from 0 to 1). */
Event_Float32 WorldEvents_MapLoading[EventHandler_Size];
Int32 WorldEvents_MapLoadingCount = 0;
Int32 WorldEvents_MapLoadingCount;
/* Raises MapLoading event. */
#define WorldEvents_RaiseMapLoading(progress)\
@ -27,7 +27,7 @@ EventHandler_Raise_Float32(WorldEvents_MapLoading, WorldEvents_MapLoadingCount,
/* Raised when new world has finished loading and the player can now interact with it. */
Event_Void WorldEvents_MapLoaded[EventHandler_Size];
Int32 WorldEvents_MapLoadedCount = 0;
Int32 WorldEvents_MapLoadedCount;
/* Raises NewMapLoaded event. */
#define WorldEvents_RaiseMapLoaded()\
@ -36,7 +36,7 @@ EventHandler_Raise_Void(WorldEvents_MapLoaded, WorldEvents_MapLoadedCount);
/* Raised when an environment variable of the world is changed by the user, CPE, or WoM config. */
Event_Int32 WorldEvents_EnvVarChanged[EventHandler_Size];
Int32 WorldEvents_EnvVarChangedCount = 0;
Int32 WorldEvents_EnvVarChangedCount;
/* Raises EnvVariableChanged event. */
#define WorldEvents_RaiseEnvVariableChanged(envVar)\