Get rid of VertexStructs.h and fixup some includes

This commit is contained in:
UnknownShadow200 2020-05-06 22:41:16 +10:00
parent 354884a80b
commit 9924ba2a04
25 changed files with 31 additions and 29 deletions

View File

@ -6,6 +6,7 @@
#include "Camera.h"
#include "Event.h"
#include "Entity.h"
#include "GameStructs.h"
cc_bool AxisLinesRenderer_Enabled;
static GfxResourceID axisLines_vb;

View File

@ -12,9 +12,9 @@
#include "Block.h"
#include "PackedCol.h"
#include "TexturePack.h"
#include "VertexStructs.h"
#include "Game.h"
#include "Options.h"
#include "GameStructs.h"
int Builder_SidesLevel, Builder_EdgeLevel;
/* Packs an index into the 16x16x16 count array. Coordinates range from 0 to 15. */

View File

@ -245,7 +245,6 @@
<ClInclude Include="String.h" />
<ClInclude Include="Core.h" />
<ClInclude Include="Vectors.h" />
<ClInclude Include="VertexStructs.h" />
<ClInclude Include="Vorbis.h" />
<ClInclude Include="Widgets.h" />
<ClInclude Include="Window.h" />

View File

@ -147,9 +147,6 @@
<ClInclude Include="ExtMath.h">
<Filter>Header Files\Math</Filter>
</ClInclude>
<ClInclude Include="VertexStructs.h">
<Filter>Header Files\Graphics</Filter>
</ClInclude>
<ClInclude Include="World.h">
<Filter>Header Files\Map</Filter>
</ClInclude>

View File

@ -1,6 +1,7 @@
#include "Drawer.h"
#include "TexturePack.h"
#include "Constants.h"
#include "Graphics.h"
struct _DrawerData Drawer;
void Drawer_XMin(int count, PackedCol col, TextureLoc texLoc, struct VertexTextured** vertices) {

View File

@ -1,10 +1,11 @@
#ifndef CC_DRAWER_H
#define CC_DRAWER_H
#include "VertexStructs.h"
#include "PackedCol.h"
#include "Vectors.h"
/* Draws the vertices for a cuboid region.
Copyright 2014-2019 ClassiCube | Licensed under BSD-3
*/
struct VertexTextured;
CC_VAR extern struct _DrawerData {
/* Whether a colour tinting effect should be applied to all faces. */

View File

@ -12,6 +12,7 @@
#include "Errors.h"
#include "Window.h"
#include "Options.h"
#include "GameStructs.h"
cc_bool Drawer2D_BitmappedText;
cc_bool Drawer2D_BlackTextShadows;

View File

@ -21,6 +21,7 @@
#include "Logger.h"
#include "Options.h"
#include "Errors.h"
#include "GameStructs.h"
const char* const NameMode_Names[NAME_MODE_COUNT] = { "None", "Hovered", "All", "AllHovered", "AllUnscaled" };
const char* const ShadowMode_Names[SHADOW_MODE_COUNT] = { "None", "SnapToBlock", "Circle", "CircleAll" };

View File

@ -8,7 +8,6 @@
#include "Platform.h"
#include "Camera.h"
#include "Funcs.h"
#include "VertexStructs.h"
#include "Graphics.h"
#include "Physics.h"
#include "Model.h"

View File

@ -18,6 +18,7 @@
#include "Camera.h"
#include "Particle.h"
#include "Options.h"
#include "GameStructs.h"
cc_bool EnvRenderer_Legacy, EnvRenderer_Minimal;

View File

@ -33,6 +33,7 @@
#include "Audio.h"
#include "Stream.h"
#include "Builder.h"
#include "GameStructs.h"
struct _GameData Game;
int Game_Port;

View File

@ -1,9 +1,8 @@
#ifndef CC_GFXAPI_H
#define CC_GFXAPI_H
#include "Vectors.h"
#include "GameStructs.h"
#include "Bitmap.h"
#include "VertexStructs.h"
#include "PackedCol.h"
/* Abstracts a 3D graphics rendering API.
Copyright 2014-2019 ClassiCube | Licensed under BSD-3
@ -20,8 +19,13 @@ typedef enum MatrixType_ {
MATRIX_PROJECTION, MATRIX_VIEW, MATRIX_TEXTURE
} MatrixType;
#define SIZEOF_VERTEX_TEXTURED 24
#define SIZEOF_VERTEX_COLOURED 16
#define SIZEOF_VERTEX_TEXTURED 24
/* 3 floats for position (XYZ), 4 bytes for colour. */
typedef struct VertexColoured { float X, Y, Z; PackedCol Col; } VertexP3fC4b;
/* 3 floats for position (XYZ), 2 floats for texture coordinates (UV), 4 bytes for colour. */
typedef struct VertexTextured { float X, Y, Z; PackedCol Col; float U, V; } VertexP3fT2fC4b;
void Gfx_Init(void);
void Gfx_Free(void);

View File

@ -12,6 +12,7 @@
#include "Platform.h"
#include "Bitmap.h"
#include "Options.h"
#include "GameStructs.h"
cc_bool Gui_ClassicTexture, Gui_ClassicTabList, Gui_ClassicMenu, Gui_ClassicChat;
int Gui_Chatlines;

View File

@ -1,6 +1,6 @@
#ifndef CC_GUI_H
#define CC_GUI_H
#include "VertexStructs.h"
#include "String.h"
/* Describes and manages 2D GUI elements on screen.
Copyright 2014-2019 ClassiCube | Licensed under BSD-3
*/
@ -14,6 +14,7 @@ enum GuiAnchor {
};
struct IGameComponent;
struct VertexTextured;
struct FontDesc;
struct Widget;
extern struct IGameComponent Gui_Component;

View File

@ -1,9 +1,10 @@
#ifndef CC_ISOMETRICDRAWER_H
#define CC_ISOMETRICDRAWER_H
#include "VertexStructs.h"
#include "Core.h"
/* Draws 2D isometric blocks for the hotbar and inventory UIs.
Copyright 2014-2019 ClassiCube | Licensed under BSD-3
*/
struct VertexTextured;
/* Maximum number of vertices used to draw a block in isometric way. */
#define ISOMETRICDRAWER_MAXVERTICES 16

View File

@ -14,6 +14,7 @@
#include "Utils.h"
#include "World.h"
#include "Options.h"
#include "GameStructs.h"
int MapRenderer_ChunksX, MapRenderer_ChunksY, MapRenderer_ChunksZ;
int MapRenderer_1DUsedCount, MapRenderer_ChunksCount;

View File

@ -13,6 +13,7 @@
#include "Stream.h"
#include "Funcs.h"
#include "Options.h"
#include "GameStructs.h"
struct _ModelsData Models;

View File

@ -3,7 +3,6 @@
#include "Vectors.h"
#include "PackedCol.h"
#include "Constants.h"
#include "VertexStructs.h"
/* Contains various structs and methods for an entity model.
Also contains a list of models and default textures for those models.
Copyright 2014-2019 ClassiCube | Licensed under BSD-3
@ -11,6 +10,7 @@
struct Entity;
struct AABB;
struct IGameComponent;
struct VertexTextured;
extern struct IGameComponent Models_Component;
#define MODEL_QUAD_VERTICES 4

View File

@ -1,12 +1,13 @@
#ifndef CC_PARTICLE_H
#define CC_PARTICLE_H
#include "Vectors.h"
#include "VertexStructs.h"
#include "PackedCol.h"
/* Represents particle effects, and manages rendering and spawning particles.
Copyright 2014-2019 ClassiCube | Licensed under BSD-3
*/
struct IGameComponent;
struct VertexTextured;
struct ScheduledTask;
extern struct IGameComponent Particles_Component;

View File

@ -1,12 +1,12 @@
#include "PickedPosRenderer.h"
#include "PackedCol.h"
#include "VertexStructs.h"
#include "Graphics.h"
#include "Game.h"
#include "Event.h"
#include "Picking.h"
#include "Funcs.h"
#include "Camera.h"
#include "GameStructs.h"
static GfxResourceID pickedPos_vb;
#define PICKEDPOS_NUM_VERTICES (16 * 6)

View File

@ -1,6 +1,6 @@
#ifndef CC_SCREENS_H
#define CC_SCREENS_H
#include "VertexStructs.h"
#include "String.h"
/* Contains all 2D non-menu screen implementations.
Copyright 2014-2019 ClassiCube | Licensed under BSD-3
*/

View File

@ -5,6 +5,7 @@
#include "Funcs.h"
#include "Game.h"
#include "Camera.h"
#include "GameStructs.h"
/* Data for a selection box. */
struct SelectionBox {

View File

@ -1,7 +1,7 @@
#ifndef CC_SELECTIONBOX_H
#define CC_SELECTIONBOX_H
#include "VertexStructs.h"
#include "Vectors.h"
#include "PackedCol.h"
/* Describes a selection box, and contains methods related to the selection box.
Copyright 2014-2019 ClassiCube | Licensed under BSD-3
*/

View File

@ -17,6 +17,7 @@
#include "Chat.h"
#include "Options.h"
#include "Logger.h"
#include "GameStructs.h"
#define LIQUID_ANIM_MAX 64
#define WATER_TEX_LOC 14

View File

@ -1,12 +0,0 @@
#ifndef CC_VERTEXSTRUCTS_H
#define CC_VERTEXSTRUCTS_H
#include "PackedCol.h"
/* Represents simple vertex formats.
Copyright 2014-2019 ClassiCube | Licensed under BSD-3
*/
/* 3 floats for position (XYZ), 4 bytes for colour. */
typedef struct VertexColoured { float X, Y, Z; PackedCol Col; } VertexP3fC4b;
/* 3 floats for position (XYZ), 2 floats for texture coordinates (UV), 4 bytes for colour. */
typedef struct VertexTextured { float X, Y, Z; PackedCol Col; float U, V; } VertexP3fT2fC4b;
#endif