mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-17 19:45:23 -04:00
More consistent C constant naming
This commit is contained in:
parent
2539ac3f6f
commit
c5c2e51b6f
@ -38,7 +38,7 @@ void AxisLinesRenderer_Render(Real64 delta) {
|
||||
if (!Game_ShowAxisLines || Gfx_LostContext) return;
|
||||
/* Don't do it in a ContextRecreated handler, because we only want VB recreated if ShowAxisLines in on. */
|
||||
if (axisLines_vb == NULL) {
|
||||
axisLines_vb = Gfx_CreateDynamicVb(VertexFormat_P3fC4b, axisLines_numVertices);
|
||||
axisLines_vb = Gfx_CreateDynamicVb(VERTEX_FORMAT_P3FC4B, axisLines_numVertices);
|
||||
}
|
||||
|
||||
Gfx_SetTexturing(false);
|
||||
@ -65,6 +65,6 @@ void AxisLinesRenderer_Render(Real64 delta) {
|
||||
P.X + axisLines_size, P.Y + axisLines_length, P.Z - axisLines_size);
|
||||
}
|
||||
|
||||
Gfx_SetBatchFormat(VertexFormat_P3fC4b);
|
||||
Gfx_SetBatchFormat(VERTEX_FORMAT_P3FC4B);
|
||||
GfxCommon_UpdateDynamicVb_IndexedTris(axisLines_vb, vertices, axisLines_numVertices);
|
||||
}
|
@ -30,7 +30,7 @@ GfxCommon_SetupAlphaState(Block_Draw[block]);\
|
||||
Gfx_EnableMipmaps();\
|
||||
\
|
||||
Gfx_BindTexture(texId);\
|
||||
Gfx_SetBatchFormat(VertexFormat_P3fT2fC4b);\
|
||||
Gfx_SetBatchFormat(VERTEX_FORMAT_P3FT2FC4B);\
|
||||
Gfx_BindVb(vb);
|
||||
|
||||
#define BordersRenderer_ResetState(block) \
|
||||
@ -205,7 +205,7 @@ void BordersRenderer_RebuildSides(Int32 y, Int32 axisSize) {
|
||||
BordersRenderer_DrawX(0, 0, World_Length, y1, y2, axisSize, col, &temp);
|
||||
BordersRenderer_DrawX(World_Width, 0, World_Length, y1, y2, axisSize, col, &temp);
|
||||
|
||||
borders_sidesVb = Gfx_CreateVb(v, VertexFormat_P3fT2fC4b, borders_sidesVertices);
|
||||
borders_sidesVb = Gfx_CreateVb(v, VERTEX_FORMAT_P3FT2FC4B, borders_sidesVertices);
|
||||
if (borders_sidesVertices > 4096) Platform_MemFree(ptr);
|
||||
}
|
||||
|
||||
@ -239,7 +239,7 @@ void BordersRenderer_RebuildEdges(Int32 y, Int32 axisSize) {
|
||||
borders_HorOffset(block), borders_YOffset(block), &temp);
|
||||
}
|
||||
|
||||
borders_edgesVb = Gfx_CreateVb(ptr, VertexFormat_P3fT2fC4b, borders_edgesVertices);
|
||||
borders_edgesVb = Gfx_CreateVb(ptr, VERTEX_FORMAT_P3FT2FC4B, borders_edgesVertices);
|
||||
if (borders_edgesVertices > 4096) Platform_MemFree(ptr);
|
||||
}
|
||||
|
||||
|
@ -93,7 +93,7 @@ void Builder_SetPartInfo(Builder1DPart* part, Int32 i, Int32 partsIndex, bool* h
|
||||
if (vCount == 0) return;
|
||||
|
||||
ChunkPartInfo info;
|
||||
info.VbId = Gfx_CreateVb(part->vertices, VertexFormat_P3fT2fC4b, vCount);
|
||||
info.VbId = Gfx_CreateVb(part->vertices, VERTEX_FORMAT_P3FT2FC4B, vCount);
|
||||
info.HasVertices = vCount > 0;
|
||||
|
||||
info.XMinCount = (UInt16)part->fCount[Face_XMin];
|
||||
|
@ -122,19 +122,19 @@ void Chat_AppendLog(STRING_PURE String* text) {
|
||||
Stream_WriteLine(&Chat_LogStream, &str);
|
||||
}
|
||||
|
||||
void Chat_Add(STRING_PURE String* text) { Chat_AddOf(text, MessageType_Normal); }
|
||||
void Chat_Add(STRING_PURE String* text) { Chat_AddOf(text, MESSAGE_TYPE_NORMAL); }
|
||||
void Chat_AddOf(STRING_PURE String* text, MessageType type) {
|
||||
if (type == MessageType_Normal) {
|
||||
if (type == MESSAGE_TYPE_NORMAL) {
|
||||
StringsBuffer_Add(&ChatLog, text);
|
||||
Chat_AppendLog(text);
|
||||
} else if (type >= MessageType_Status1 && type <= MessageType_Status3) {
|
||||
ChatLine_Make(&Chat_Status[type - MessageType_Status1], text);
|
||||
} else if (type >= MessageType_BottomRight1 && type <= MessageType_BottomRight3) {
|
||||
ChatLine_Make(&Chat_BottomRight[type - MessageType_BottomRight1], text);
|
||||
} else if (type == MessageType_Announcement) {
|
||||
} else if (type >= MESSAGE_TYPE_STATUS_1 && type <= MESSAGE_TYPE_STATUS_3) {
|
||||
ChatLine_Make(&Chat_Status[type - MESSAGE_TYPE_STATUS_1], text);
|
||||
} else if (type >= MESSAGE_TYPE_BOTTOMRIGHT_1 && type <= MESSAGE_TYPE_BOTTOMRIGHT_3) {
|
||||
ChatLine_Make(&Chat_BottomRight[type - MESSAGE_TYPE_BOTTOMRIGHT_1], text);
|
||||
} else if (type == MESSAGE_TYPE_ANNOUNCEMENT) {
|
||||
ChatLine_Make(&Chat_Announcement, text);
|
||||
} else if (type >= MessageType_ClientStatus1 && type <= MessageType_ClientStatus3) {
|
||||
ChatLine_Make(&Chat_ClientStatus[type - MessageType_ClientStatus1], text);
|
||||
} else if (type >= MESSAGE_TYPE_CLIENTSTATUS_1 && type <= MESSAGE_TYPE_CLIENTSTATUS_3) {
|
||||
ChatLine_Make(&Chat_ClientStatus[type - MESSAGE_TYPE_CLIENTSTATUS_1], text);
|
||||
}
|
||||
Events_RaiseChatReceived(text, type);
|
||||
}
|
||||
|
@ -554,11 +554,11 @@ void Gfx_DrawIndexedVb_TrisT2fC4b(Int32 verticesCount, Int32 startVertex) {
|
||||
|
||||
|
||||
void Gfx_SetMatrixMode(MatrixType matrixType) {
|
||||
if (matrixType == MatrixType_Projection) {
|
||||
if (matrixType == MATRIX_TYPE_PROJECTION) {
|
||||
curStack = &projStack;
|
||||
} else if (matrixType == MatrixType_Modelview) {
|
||||
} else if (matrixType == MATRIX_TYPE_MODELVIEW) {
|
||||
curStack = &viewStack;
|
||||
} else if (matrixType == MatrixType_Texture) {
|
||||
} else if (matrixType == MATRIX_TYPE_TEXTURE) {
|
||||
curStack = &texStack;
|
||||
}
|
||||
}
|
||||
|
@ -70,30 +70,30 @@ void EnvRenderer_RenderClouds(Real64 deltaTime) {
|
||||
Real64 time = Game_Accumulator;
|
||||
Real32 offset = (Real32)(time / 2048.0f * 0.6f * WorldEnv_CloudsSpeed);
|
||||
|
||||
Gfx_SetMatrixMode(MatrixType_Texture);
|
||||
Gfx_SetMatrixMode(MATRIX_TYPE_TEXTURE);
|
||||
Matrix matrix = Matrix_Identity; matrix.Row3.X = offset; /* translate X axis */
|
||||
Gfx_LoadMatrix(&matrix);
|
||||
Gfx_SetMatrixMode(MatrixType_Modelview);
|
||||
Gfx_SetMatrixMode(MATRIX_TYPE_MODELVIEW);
|
||||
|
||||
Gfx_SetAlphaTest(true);
|
||||
Gfx_SetTexturing(true);
|
||||
Gfx_BindTexture(env_cloudsTex);
|
||||
Gfx_SetBatchFormat(VertexFormat_P3fT2fC4b);
|
||||
Gfx_SetBatchFormat(VERTEX_FORMAT_P3FT2FC4B);
|
||||
Gfx_BindVb(env_cloudsVb);
|
||||
Gfx_DrawVb_IndexedTris(env_cloudVertices);
|
||||
Gfx_SetAlphaTest(false);
|
||||
Gfx_SetTexturing(false);
|
||||
|
||||
Gfx_SetMatrixMode(MatrixType_Texture);
|
||||
Gfx_SetMatrixMode(MATRIX_TYPE_TEXTURE);
|
||||
Gfx_LoadIdentityMatrix();
|
||||
Gfx_SetMatrixMode(MatrixType_Modelview);
|
||||
Gfx_SetMatrixMode(MATRIX_TYPE_MODELVIEW);
|
||||
}
|
||||
|
||||
void EnvRenderer_RenderSky(Real64 deltaTime) {
|
||||
Vector3 pos = Game_CurrentCameraPos;
|
||||
Real32 normalY = (Real32)World_Height + 8.0f;
|
||||
Real32 skyY = max(pos.Y + 8.0f, normalY);
|
||||
Gfx_SetBatchFormat(VertexFormat_P3fC4b);
|
||||
Gfx_SetBatchFormat(VERTEX_FORMAT_P3FC4B);
|
||||
Gfx_BindVb(env_skyVb);
|
||||
|
||||
if (skyY == normalY) {
|
||||
@ -116,10 +116,10 @@ void EnvRenderer_UpdateFog(void) {
|
||||
EnvRenderer_BlockOn(&fogDensity, &fogCol);
|
||||
|
||||
if (fogDensity != 0.0f) {
|
||||
Gfx_SetFogMode(Fog_Exp);
|
||||
Gfx_SetFogMode(FOG_EXP);
|
||||
Gfx_SetFogDensity(fogDensity);
|
||||
} else if (WorldEnv_ExpFog) {
|
||||
Gfx_SetFogMode(Fog_Exp);
|
||||
Gfx_SetFogMode(FOG_EXP);
|
||||
/* f = 1-z/end f = e^(-dz)
|
||||
solve for f = 0.01 gives:
|
||||
e^(-dz)=0.01 --> -dz=ln(0.01)
|
||||
@ -129,7 +129,7 @@ void EnvRenderer_UpdateFog(void) {
|
||||
Real32 density = -Math_LogE(0.01f) / (Game_ViewDistance * 0.99f);
|
||||
Gfx_SetFogDensity(density);
|
||||
} else {
|
||||
Gfx_SetFogMode(Fog_Linear);
|
||||
Gfx_SetFogMode(FOG_LINEAR);
|
||||
Gfx_SetFogEnd(Game_ViewDistance);
|
||||
}
|
||||
Gfx_ClearColour(fogCol);
|
||||
@ -211,7 +211,7 @@ void EnvRenderer_RebuildClouds(Int32 extent, Int32 axisSize) {
|
||||
}
|
||||
|
||||
EnvRenderer_DrawCloudsY(x1, z1, x2, z2, WorldEnv_CloudsHeight, axisSize, WorldEnv_CloudsCol, ptr);
|
||||
env_cloudsVb = Gfx_CreateVb(ptr, VertexFormat_P3fT2fC4b, env_cloudVertices);
|
||||
env_cloudsVb = Gfx_CreateVb(ptr, VERTEX_FORMAT_P3FT2FC4B, env_cloudVertices);
|
||||
|
||||
if (env_cloudVertices > 4096) Platform_MemFree(ptr);
|
||||
}
|
||||
@ -231,7 +231,7 @@ void EnvRenderer_RebuildSky(Int32 extent, Int32 axisSize) {
|
||||
|
||||
Int32 height = max((World_Height + 2) + 6, WorldEnv_CloudsHeight + 6);
|
||||
EnvRenderer_DrawSkyY(x1, z1, x2, z2, height, axisSize, WorldEnv_SkyCol, ptr);
|
||||
env_skyVb = Gfx_CreateVb(ptr, VertexFormat_P3fC4b, env_skyVertices);
|
||||
env_skyVb = Gfx_CreateVb(ptr, VERTEX_FORMAT_P3FC4B, env_skyVertices);
|
||||
|
||||
if (env_skyVertices > 4096) Platform_MemFree(ptr);
|
||||
}
|
||||
|
@ -51,9 +51,9 @@ void Game_UpdateProjection(void) {
|
||||
Game_DefaultFov = Options_GetInt(OptionsKey_FieldOfView, 1, 150, 70);
|
||||
Camera_ActiveCamera->GetProjection(&Game_Projection);
|
||||
|
||||
Gfx_SetMatrixMode(MatrixType_Projection);
|
||||
Gfx_SetMatrixMode(MATRIX_TYPE_PROJECTION);
|
||||
Gfx_LoadMatrix(&Game_Projection);
|
||||
Gfx_SetMatrixMode(MatrixType_Modelview);
|
||||
Gfx_SetMatrixMode(MATRIX_TYPE_MODELVIEW);
|
||||
Event_RaiseVoid(&GfxEvents_ProjectionChanged);
|
||||
}
|
||||
|
||||
|
@ -8,8 +8,8 @@
|
||||
#include "ExtMath.h"
|
||||
|
||||
void GfxCommon_Init(void) {
|
||||
GfxCommon_quadVb = Gfx_CreateDynamicVb(VertexFormat_P3fC4b, 4);
|
||||
GfxCommon_texVb = Gfx_CreateDynamicVb(VertexFormat_P3fT2fC4b, 4);
|
||||
GfxCommon_quadVb = Gfx_CreateDynamicVb(VERTEX_FORMAT_P3FC4B, 4);
|
||||
GfxCommon_texVb = Gfx_CreateDynamicVb(VERTEX_FORMAT_P3FT2FC4B, 4);
|
||||
}
|
||||
|
||||
void GfxCommon_Free(void) {
|
||||
@ -56,7 +56,7 @@ void GfxCommon_Draw2DFlat(Int32 x, Int32 y, Int32 width, Int32 height, PackedCol
|
||||
v.Y = (Real32)(y + height); quadVerts[2] = v;
|
||||
v.X = (Real32)x; quadVerts[3] = v;
|
||||
|
||||
Gfx_SetBatchFormat(VertexFormat_P3fC4b);
|
||||
Gfx_SetBatchFormat(VERTEX_FORMAT_P3FC4B);
|
||||
GfxCommon_UpdateDynamicVb_IndexedTris(GfxCommon_quadVb, quadVerts, 4);
|
||||
}
|
||||
|
||||
@ -69,7 +69,7 @@ void GfxCommon_Draw2DGradient(Int32 x, Int32 y, Int32 width, Int32 height, Packe
|
||||
v.Y = (Real32)(y + height); v.Col = bottomCol; quadVerts[2] = v;
|
||||
v.X = (Real32)x; quadVerts[3] = v;
|
||||
|
||||
Gfx_SetBatchFormat(VertexFormat_P3fC4b);
|
||||
Gfx_SetBatchFormat(VERTEX_FORMAT_P3FC4B);
|
||||
GfxCommon_UpdateDynamicVb_IndexedTris(GfxCommon_quadVb, quadVerts, 4);
|
||||
}
|
||||
|
||||
@ -77,7 +77,7 @@ void GfxCommon_Draw2DTexture(Texture* tex, PackedCol col) {
|
||||
VertexP3fT2fC4b texVerts[4];
|
||||
VertexP3fT2fC4b* ptr = texVerts;
|
||||
GfxCommon_Make2DQuad(tex, col, &ptr);
|
||||
Gfx_SetBatchFormat(VertexFormat_P3fT2fC4b);
|
||||
Gfx_SetBatchFormat(VERTEX_FORMAT_P3FT2FC4B);
|
||||
GfxCommon_UpdateDynamicVb_IndexedTris(GfxCommon_texVb, texVerts, 4);
|
||||
}
|
||||
|
||||
@ -102,10 +102,10 @@ void GfxCommon_Make2DQuad(Texture* tex, PackedCol col, VertexP3fT2fC4b** vertice
|
||||
|
||||
bool gfx_hadFog;
|
||||
void GfxCommon_Mode2D(Int32 width, Int32 height) {
|
||||
Gfx_SetMatrixMode(MatrixType_Projection);
|
||||
Gfx_SetMatrixMode(MATRIX_TYPE_PROJECTION);
|
||||
Gfx_PushMatrix();
|
||||
Gfx_LoadOrthoMatrix((Real32)width, (Real32)height);
|
||||
Gfx_SetMatrixMode(MatrixType_Modelview);
|
||||
Gfx_SetMatrixMode(MATRIX_TYPE_MODELVIEW);
|
||||
Gfx_PushMatrix();
|
||||
Gfx_LoadIdentityMatrix();
|
||||
|
||||
@ -116,9 +116,9 @@ void GfxCommon_Mode2D(Int32 width, Int32 height) {
|
||||
}
|
||||
|
||||
void GfxCommon_Mode3D(void) {
|
||||
Gfx_SetMatrixMode(MatrixType_Projection);
|
||||
Gfx_SetMatrixMode(MATRIX_TYPE_PROJECTION);
|
||||
Gfx_PopMatrix(); /* Get rid of orthographic 2D matrix. */
|
||||
Gfx_SetMatrixMode(MatrixType_Modelview);
|
||||
Gfx_SetMatrixMode(MATRIX_TYPE_MODELVIEW);
|
||||
Gfx_PopMatrix();
|
||||
|
||||
Gfx_SetDepthTest(false);
|
||||
|
@ -3,38 +3,38 @@
|
||||
|
||||
/* Vertex data format types*/
|
||||
typedef Int32 VertexFormat;
|
||||
#define VertexFormat_P3fC4b 0
|
||||
#define VertexFormat_P3fT2fC4b 1
|
||||
#define VERTEX_FORMAT_P3FC4B 0
|
||||
#define VERTEX_FORMAT_P3FT2FC4B 1
|
||||
|
||||
/* 3D graphics pixel comparison functions */
|
||||
typedef Int32 CompareFunc;
|
||||
#define CompareFunc_Always 0
|
||||
#define CompareFunc_NotEqual 1
|
||||
#define CompareFunc_Never 2
|
||||
#define CompareFunc_Less 3
|
||||
#define CompareFunc_LessEqual 4
|
||||
#define CompareFunc_Equal 5
|
||||
#define CompareFunc_GreaterEqual 6
|
||||
#define CompareFunc_Greater 7
|
||||
#define COMPARE_FUNC_ALWAYS 0
|
||||
#define COMPARE_FUNC_NOTEQUAL 1
|
||||
#define COMPARE_FUNC_NEVER 2
|
||||
#define COMPARE_FUNC_LESS 3
|
||||
#define COMPARE_FUNC_LESSEQUAL 4
|
||||
#define COMPARE_FUNC_EQUAL 5
|
||||
#define COMPARE_FUNC_GREATEREQUAL 6
|
||||
#define COMPARE_FUNC_GREATER 7
|
||||
|
||||
/* 3D graphics pixel blending functions */
|
||||
typedef Int32 BlendFunc;
|
||||
#define BlendFunc_Zero 0
|
||||
#define BlendFunc_One 1
|
||||
#define BlendFunc_SourceAlpha 2
|
||||
#define BlendFunc_InvSourceAlpha 3
|
||||
#define BlendFunc_DestAlpha 4
|
||||
#define BlendFunc_InvDestAlpha 5
|
||||
#define BLEND_FUNC_ZERO 0
|
||||
#define BLEND_FUNC_ONE 1
|
||||
#define BLEND_FUNC_SRC_ALPHA 2
|
||||
#define BLEND_FUNC_INV_SRC_ALPHA 3
|
||||
#define BLEND_FUNC_DST_ALPHA 4
|
||||
#define BLEND_FUNC_INV_DST_ALPHA 5
|
||||
|
||||
/* 3D graphics pixel fog blending functions */
|
||||
typedef Int32 Fog;
|
||||
#define Fog_Linear 0
|
||||
#define Fog_Exp 1
|
||||
#define Fog_Exp2 2
|
||||
#define FOG_LINEAR 0
|
||||
#define FOG_EXP 1
|
||||
#define FOG_EXP2 2
|
||||
|
||||
/* 3D graphics matrix types */
|
||||
typedef Int32 MatrixType;
|
||||
#define MatrixType_Projection 0
|
||||
#define MatrixType_Modelview 1
|
||||
#define MatrixType_Texture 2
|
||||
#define MATRIX_TYPE_PROJECTION 0
|
||||
#define MATRIX_TYPE_MODELVIEW 1
|
||||
#define MATRIX_TYPE_TEXTURE 2
|
||||
#endif
|
@ -87,7 +87,7 @@ void IModel_Render(IModel* model, Entity* entity) {
|
||||
if (model->Bobbing) pos.Y += entity->Anim.BobbingModel;
|
||||
IModel_SetupState(model, entity);
|
||||
|
||||
Gfx_SetBatchFormat(VertexFormat_P3fT2fC4b);
|
||||
Gfx_SetBatchFormat(VERTEX_FORMAT_P3FT2FC4B);
|
||||
Gfx_PushMatrix();
|
||||
|
||||
model->GetTransform(entity, pos);
|
||||
|
@ -127,7 +127,7 @@ void MapRenderer_RenderNormalBatch(UInt32 batch) {
|
||||
|
||||
void MapRenderer_RenderNormal(Real64 deltaTime) {
|
||||
if (MapRenderer_Chunks == NULL) return;
|
||||
Gfx_SetBatchFormat(VertexFormat_P3fT2fC4b);
|
||||
Gfx_SetBatchFormat(VERTEX_FORMAT_P3FT2FC4B);
|
||||
Gfx_SetTexturing(true);
|
||||
Gfx_SetAlphaTest(true);
|
||||
|
||||
@ -212,7 +212,7 @@ void MapRenderer_RenderTranslucent(Real64 deltaTime) {
|
||||
|
||||
/* First fill depth buffer */
|
||||
UInt32 vertices = Game_Vertices;
|
||||
Gfx_SetBatchFormat(VertexFormat_P3fT2fC4b);
|
||||
Gfx_SetBatchFormat(VERTEX_FORMAT_P3FT2FC4B);
|
||||
Gfx_SetTexturing(false);
|
||||
Gfx_SetAlphaBlending(false);
|
||||
Gfx_SetColourWrite(false);
|
||||
|
@ -16,7 +16,7 @@ void ModelCache_ContextLost(void) {
|
||||
}
|
||||
|
||||
void ModelCache_ContextRecreated(void) {
|
||||
ModelCache_Vb = Gfx_CreateDynamicVb(VertexFormat_P3fT2fC4b, MODELCACHE_MAX_VERTICES);
|
||||
ModelCache_Vb = Gfx_CreateDynamicVb(VERTEX_FORMAT_P3FT2FC4B, MODELCACHE_MAX_VERTICES);
|
||||
}
|
||||
|
||||
IModel* ModelCache_Get(STRING_PURE String* name) {
|
||||
|
@ -7,77 +7,72 @@
|
||||
|
||||
/* Network packet opcodes. */
|
||||
typedef UInt8 Opcode;
|
||||
#define Opcode_Handshake 0
|
||||
#define Opcode_Ping 1
|
||||
#define Opcode_LevelInit 2
|
||||
#define Opcode_LevelDataChunk 3
|
||||
#define Opcode_LevelFinalise 4
|
||||
#define Opcode_SetBlockClient 5
|
||||
#define Opcode_SetBlock 6
|
||||
#define Opcode_AddEntity 7
|
||||
#define Opcode_EntityTeleport 8
|
||||
#define Opcode_RelPosAndOrientationUpdate 9
|
||||
#define Opcode_RelPosUpdate 10
|
||||
#define Opcode_OrientationUpdate 11
|
||||
#define Opcode_RemoveEntity 12
|
||||
#define Opcode_Message 13
|
||||
#define Opcode_Kick 14
|
||||
#define Opcode_SetPermission 15
|
||||
#define OPCODE_HANDSHAKE 0
|
||||
#define OPCODE_PING 1
|
||||
#define OPCODE_LEVEL_INIT 2
|
||||
#define OPCODE_LEVEL_DATA_CHUNK 3
|
||||
#define OPCODE_LEVEL_FINALISE 4
|
||||
#define OPCODE_SET_BLOCK_CLIENT 5
|
||||
#define OPCODE_SET_BLOCK 6
|
||||
#define OPCODE_ADD_ENTITY 7
|
||||
#define OPCODE_ENTITY_TELEPORT 8
|
||||
#define OPCODE_RELPOSANDORIENTATION_UPDATE 9
|
||||
#define OPCODE_RELPOS_UPDATE 10
|
||||
#define OPCODE_ORIENTATION_UPDATE 11
|
||||
#define OPCODE_REMOVE_ENTITY 12
|
||||
#define OPCODE_MESSAGE 13
|
||||
#define OPCODE_KICK 14
|
||||
#define OPCODE_SET_PERMISSION 15
|
||||
|
||||
#define Opcode_CpeExtInfo 16
|
||||
#define Opcode_CpeExtEntry 17
|
||||
#define Opcode_CpeSetClickDistance 18
|
||||
#define Opcode_CpeCustomBlockSupportLevel 19
|
||||
#define Opcode_CpeHoldThis 20
|
||||
#define Opcode_CpeSetTextHotkey 21
|
||||
#define Opcode_CpeExtAddPlayerName 22
|
||||
#define Opcode_CpeExtAddEntity 23
|
||||
#define Opcode_CpeExtRemovePlayerName 24
|
||||
#define Opcode_CpeEnvColours 25
|
||||
#define Opcode_CpeMakeSelection 26
|
||||
#define Opcode_CpeRemoveSelection 27
|
||||
#define Opcode_CpeSetBlockPermission 28
|
||||
#define Opcode_CpeChangeModel 29
|
||||
#define Opcode_CpeEnvSetMapApperance 30
|
||||
#define Opcode_CpeEnvWeatherType 31
|
||||
#define Opcode_CpeHackControl 32
|
||||
#define Opcode_CpeExtAddEntity2 33
|
||||
#define Opcode_CpePlayerClick 34
|
||||
#define Opcode_CpeDefineBlock 35
|
||||
#define Opcode_CpeRemoveBlockDefinition 36
|
||||
#define Opcode_CpeDefineBlockExt 37
|
||||
#define Opcode_CpeBulkBlockUpdate 38
|
||||
#define Opcode_CpeSetTextColor 39
|
||||
#define Opcode_CpeSetMapEnvUrl 40
|
||||
#define Opcode_CpeSetMapEnvProperty 41
|
||||
#define Opcode_CpeSetEntityProperty 42
|
||||
#define Opcode_CpeTwoWayPing 43
|
||||
#define Opcode_CpeSetInventoryOrder 44
|
||||
#define OPCODE_CPE_EXT_INFO 16
|
||||
#define OPCODE_CPE_EXT_ENTRY 17
|
||||
#define OPCODE_CPE_SET_CLICK_DISTANCE 18
|
||||
#define OPCODE_CPE_CUSTOM_BLOCK_SUPPORT_LEVEL 19
|
||||
#define OPCODE_CPE_HOLD_THIS 20
|
||||
#define OPCODE_CPE_SET_TEXT_HOTKEY 21
|
||||
#define OPCODE_CPE_EXT_ADD_PLAYER_NAME 22
|
||||
#define OPCODE_CPE_EXT_ADD_ENTITY 23
|
||||
#define OPCODE_CPE_EXT_REMOVE_PLAYER_NAME 24
|
||||
#define OPCODE_CPE_ENV_SET_COLOR 25
|
||||
#define OPCODE_CPE_MAKE_SELECTION 26
|
||||
#define OPCODE_CPE_REMOVE_SELECTION 27
|
||||
#define OPCODE_CPE_SET_BLOCK_PERMISSION 28
|
||||
#define OPCODE_CPE_SET_MODEL 29
|
||||
#define OPCODE_CPE_ENV_SET_MAP_APPERANCE 30
|
||||
#define OPCODE_CPE_ENV_SET_WEATHER 31
|
||||
#define OPCODE_CPE_HACK_CONTROL 32
|
||||
#define OPCODE_CPE_EXT_ADD_ENTITY_2 33
|
||||
#define OPCODE_CPE_PLAYER_CLICK 34
|
||||
#define OPCODE_CPE_DEFINE_BLOCK 35
|
||||
#define OPCODE_CPE_UNDEFINE_BLOCK 36
|
||||
#define OPCODE_CPE_DEFINE_BLOCK_EXT 37
|
||||
#define OPCODE_CPE_BULK_BLOCK_UPDATE 38
|
||||
#define OPCODE_CPE_SET_TEXT_COLOR 39
|
||||
#define OPCODE_CPE_ENV_SET_MAP_URL 40
|
||||
#define OPCODE_CPE_ENV_SET_MAP_PROPERTY 41
|
||||
#define OPCODE_CPE_SET_ENTITY_PROPERTY 42
|
||||
#define OPCODE_CPE_TWO_WAY_PING 43
|
||||
#define Opcode_CPE_SET_INVENTORY_ORDER 44
|
||||
|
||||
|
||||
/* Chat message types.*/
|
||||
typedef UInt8 MessageType;
|
||||
/* CPE message types */
|
||||
|
||||
#define MessageType_Normal 0
|
||||
#define MessageType_Status1 1
|
||||
#define MessageType_Status2 2
|
||||
#define MessageType_Status3 3
|
||||
#define MessageType_BottomRight1 11
|
||||
#define MessageType_BottomRight2 12
|
||||
#define MessageType_BottomRight3 13
|
||||
#define MessageType_Announcement 100
|
||||
#define MESSAGE_TYPE_NORMAL 0
|
||||
#define MESSAGE_TYPE_STATUS_1 1
|
||||
#define MESSAGE_TYPE_STATUS_2 2
|
||||
#define MESSAGE_TYPE_STATUS_3 3
|
||||
#define MESSAGE_TYPE_BOTTOMRIGHT_1 11
|
||||
#define MESSAGE_TYPE_BOTTOMRIGHT_2 12
|
||||
#define MESSAGE_TYPE_BOTTOMRIGHT_3 13
|
||||
#define MESSAGE_TYPE_ANNOUNCEMENT 100
|
||||
|
||||
/* client defined message types */
|
||||
|
||||
#define MessageType_ClientStatus1 256
|
||||
#define MessageType_ClientStatus2 257
|
||||
/* Cuboid messages*/
|
||||
#define MessageType_ClientStatus3 258
|
||||
#define MESSAGE_TYPE_CLIENTSTATUS_1 256
|
||||
/* Clipboard invalid character */
|
||||
#define MessageType_ClientStatus4 259
|
||||
#define MESSAGE_TYPE_CLIENTSTATUS_2 257
|
||||
/* Tab list matching names*/
|
||||
#define MessageType_ClientStatus5 260
|
||||
/* No LongerMessages warning*/
|
||||
#define MessageType_ClientStatus6 261
|
||||
#define MESSAGE_TYPE_CLIENTSTATUS_3 258
|
||||
#endif
|
@ -266,10 +266,10 @@ GfxResourceID Gfx_CreateVb(void* vertices, VertexFormat vertexFormat, Int32 coun
|
||||
UInt16 indices[GFX_MAX_INDICES];
|
||||
GfxCommon_MakeIndices(indices, ICOUNT(count));
|
||||
|
||||
Int32 stride = vertexFormat == VertexFormat_P3fT2fC4b ? VertexP3fT2fC4b_Size : VertexP3fC4b_Size;
|
||||
Int32 stride = vertexFormat == VERTEX_FORMAT_P3FT2FC4B ? VertexP3fT2fC4b_Size : VertexP3fC4b_Size;
|
||||
glVertexPointer(3, GL_FLOAT, stride, vertices);
|
||||
glColorPointer(4, GL_UNSIGNED_BYTE, stride, (void*)((UInt8*)vertices + 12));
|
||||
if (vertexFormat == VertexFormat_P3fT2fC4b) {
|
||||
if (vertexFormat == VERTEX_FORMAT_P3FT2FC4B) {
|
||||
glTexCoordPointer(2, GL_FLOAT, stride, (void*)((UInt8*)vertices + 16));
|
||||
}
|
||||
|
||||
@ -357,13 +357,13 @@ void GL_SetupVbPos3fTex2fCol4b_Range(Int32 startVertex) {
|
||||
void Gfx_SetBatchFormat(VertexFormat vertexFormat) {
|
||||
if (vertexFormat == gl_batchFormat) return;
|
||||
|
||||
if (gl_batchFormat == VertexFormat_P3fT2fC4b) {
|
||||
if (gl_batchFormat == VERTEX_FORMAT_P3FT2FC4B) {
|
||||
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
}
|
||||
gl_batchFormat = vertexFormat;
|
||||
gl_batchStride = Gfx_strideSizes[vertexFormat];
|
||||
|
||||
if (vertexFormat == VertexFormat_P3fT2fC4b) {
|
||||
if (vertexFormat == VERTEX_FORMAT_P3FT2FC4B) {
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
gl_setupVBFunc = GL_SetupVbPos3fTex2fCol4b;
|
||||
gl_setupVBRangeFunc = GL_SetupVbPos3fTex2fCol4b_Range;
|
||||
@ -399,7 +399,7 @@ void GL_V24(VertexP3fT2fC4b v) {
|
||||
void GL_DrawDynamicLines(Int32 verticesCount) {
|
||||
glBegin(GL_LINES);
|
||||
Int32 i;
|
||||
if (gl_batchFormat == VertexFormat_P3fT2fC4b) {
|
||||
if (gl_batchFormat == VERTEX_FORMAT_P3FT2FC4B) {
|
||||
VertexP3fT2fC4b* ptr = (VertexP3fT2fC4b*)gl_dynamicListData;
|
||||
for (i = 0; i < verticesCount; i += 2) {
|
||||
GL_V24(ptr[i + 0]); GL_V24(ptr[i + 1]);
|
||||
@ -416,7 +416,7 @@ void GL_DrawDynamicLines(Int32 verticesCount) {
|
||||
void GL_DrawDynamicTriangles(Int32 verticesCount, Int32 startVertex) {
|
||||
glBegin(GL_TRIANGLES);
|
||||
Int32 i;
|
||||
if (gl_batchFormat == VertexFormat_P3fT2fC4b) {
|
||||
if (gl_batchFormat == VERTEX_FORMAT_P3FT2FC4B) {
|
||||
VertexP3fT2fC4b* ptr = (VertexP3fT2fC4b*)gl_dynamicListData;
|
||||
for (i = startVertex; i < startVertex + verticesCount; i += 4) {
|
||||
GL_V24(ptr[i + 0]); GL_V24(ptr[i + 1]); GL_V24(ptr[i + 2]);
|
||||
|
@ -179,7 +179,7 @@ void Particles_FileChanged(Stream* stream) {
|
||||
|
||||
void Particles_ContextLost(void) { Gfx_DeleteVb(&Particles_VB); }
|
||||
void Particles_ContextRecreated(void) {
|
||||
Particles_VB = Gfx_CreateDynamicVb(VertexFormat_P3fT2fC4b, PARTICLES_MAX * 4);
|
||||
Particles_VB = Gfx_CreateDynamicVb(VERTEX_FORMAT_P3FT2FC4B, PARTICLES_MAX * 4);
|
||||
}
|
||||
|
||||
void Particles_Init(void) {
|
||||
@ -273,7 +273,7 @@ void Particles_Render(Real64 delta, Real32 t) {
|
||||
Gfx_SetTexturing(true);
|
||||
Gfx_SetAlphaTest(true);
|
||||
|
||||
Gfx_SetBatchFormat(VertexFormat_P3fT2fC4b);
|
||||
Gfx_SetBatchFormat(VERTEX_FORMAT_P3FT2FC4B);
|
||||
Terrain_Render(t);
|
||||
Rain_Render(t);
|
||||
|
||||
|
@ -18,7 +18,7 @@ void PickedPosRenderer_ContextLost(void) {
|
||||
}
|
||||
|
||||
void PickedPosRenderer_ContextRecreated(void) {
|
||||
pickedPos_vb = Gfx_CreateDynamicVb(VertexFormat_P3fC4b, pickedPos_numVertices);
|
||||
pickedPos_vb = Gfx_CreateDynamicVb(VERTEX_FORMAT_P3FC4B, pickedPos_numVertices);
|
||||
}
|
||||
|
||||
void PickedPosRenderer_Init(void) {
|
||||
@ -39,7 +39,7 @@ void PickedPosRenderer_Render(Real64 delta) {
|
||||
|
||||
Gfx_SetAlphaBlending(true);
|
||||
Gfx_SetDepthWrite(false);
|
||||
Gfx_SetBatchFormat(VertexFormat_P3fC4b);
|
||||
Gfx_SetBatchFormat(VERTEX_FORMAT_P3FC4B);
|
||||
|
||||
GfxCommon_UpdateDynamicVb_IndexedTris(pickedPos_vb, pickedPos_vertices, pickedPos_numVertices);
|
||||
Gfx_SetDepthWrite(true);
|
||||
|
@ -40,7 +40,7 @@ void SkyboxRenderer_Render(Real64 deltaTime) {
|
||||
Gfx_SetDepthWrite(false);
|
||||
Gfx_SetTexturing(false);
|
||||
Gfx_BindTexture(skybox_tex);
|
||||
Gfx_SetBatchFormat(VertexFormat_P3fT2fC4b);
|
||||
Gfx_SetBatchFormat(VERTEX_FORMAT_P3FT2FC4B);
|
||||
|
||||
Matrix m = Matrix_Identity;
|
||||
Matrix rotX, rotY;
|
||||
@ -119,7 +119,7 @@ void SkyboxRenderer_MakeVb(void) {
|
||||
v.X = pos; v.U = 0.50f; vertices[22] = v;
|
||||
v.Z = -pos; v.V = 0.50f; vertices[23] = v;
|
||||
|
||||
skybox_vb = Gfx_CreateVb(vertices, VertexFormat_P3fT2fC4b, SKYBOX_COUNT);
|
||||
skybox_vb = Gfx_CreateVb(vertices, VERTEX_FORMAT_P3FT2FC4B, SKYBOX_COUNT);
|
||||
}
|
||||
|
||||
void SkyboxRenderer_ContextLost(void) { Gfx_DeleteVb(&skybox_vb); }
|
||||
|
@ -90,7 +90,7 @@ void WeatherRenderer_ContextLost(void) {
|
||||
}
|
||||
|
||||
void WeatherRenderer_ContextRecreated(void) {
|
||||
weather_vb = Gfx_CreateDynamicVb(VertexFormat_P3fT2fC4b, weather_verticesCount);
|
||||
weather_vb = Gfx_CreateDynamicVb(VERTEX_FORMAT_P3FT2FC4B, weather_verticesCount);
|
||||
}
|
||||
|
||||
Real32 WeatherRenderer_AlphaAt(Real32 x) {
|
||||
@ -176,7 +176,7 @@ void WeatherRenderer_Render(Real64 deltaTime) {
|
||||
Gfx_SetDepthWrite(false);
|
||||
Gfx_SetAlphaArgBlend(true);
|
||||
|
||||
Gfx_SetBatchFormat(VertexFormat_P3fT2fC4b);
|
||||
Gfx_SetBatchFormat(VERTEX_FORMAT_P3FT2FC4B);
|
||||
GfxCommon_UpdateDynamicVb_IndexedTris(weather_vb, vertices, vCount);
|
||||
|
||||
Gfx_SetAlphaArgBlend(false);
|
||||
|
@ -647,7 +647,7 @@ void TableWidget_Render(GuiElement* elem, Real64 delta) {
|
||||
size, size, Table_TopSelCol, Table_BottomSelCol);
|
||||
}
|
||||
Gfx_SetTexturing(true);
|
||||
Gfx_SetBatchFormat(VertexFormat_P3fT2fC4b);
|
||||
Gfx_SetBatchFormat(VERTEX_FORMAT_P3FT2FC4B);
|
||||
|
||||
VertexP3fT2fC4b vertices[TABLE_MAX_VERTICES];
|
||||
IsometricDrawer_BeginBatch(vertices, widget->VB);
|
||||
@ -688,7 +688,7 @@ void TableWidget_Free(GuiElement* elem) {
|
||||
void TableWidget_Recreate(GuiElement* elem) {
|
||||
TableWidget* widget = (TableWidget*)elem;
|
||||
elem->Free(elem);
|
||||
widget->VB = Gfx_CreateDynamicVb(VertexFormat_P3fT2fC4b, TABLE_MAX_VERTICES);
|
||||
widget->VB = Gfx_CreateDynamicVb(VERTEX_FORMAT_P3FT2FC4B, TABLE_MAX_VERTICES);
|
||||
TableWidget_RecreateDescTex(widget);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user