diff --git a/ClassicalSharp/Network/Protocols/Classic.cs b/ClassicalSharp/Network/Protocols/Classic.cs index 4a7c553a3..5df9b7ae6 100644 --- a/ClassicalSharp/Network/Protocols/Classic.cs +++ b/ClassicalSharp/Network/Protocols/Classic.cs @@ -186,7 +186,7 @@ namespace ClassicalSharp.Network.Protocols { string name = reader.ReadString(); string skin = name; net.CheckName(id, ref name, ref skin); - net.AddEntity(id, name, skin, true); + net.AddEntity(id, name, skin, true); if (!net.addEntityHack) return; // Workaround for some servers that declare they support ExtPlayerList, diff --git a/src/Client/2DStructs.c b/src/Client/2DStructs.c index 5fe9b64f8..c2db16e87 100644 --- a/src/Client/2DStructs.c +++ b/src/Client/2DStructs.c @@ -1,11 +1,11 @@ #include "2DStructs.h" -Rectangle Rectangle_Make(Int32 x, Int32 y, Int32 width, Int32 height) { - Rectangle r; +Rectangle2D Rectangle2D_Make(Int32 x, Int32 y, Int32 width, Int32 height) { + Rectangle2D r; r.X = x; r.Y = y; r.Width = width; r.Height = height; return r; } -bool Rectangle_Contains(Rectangle a, Int32 x, Int32 y) { +bool Rectangle2D_Contains(Rectangle2D a, Int32 x, Int32 y) { return x >= a.X && y >= a.Y && x < (a.X + a.Width) && y < (a.Y + a.Height); } \ No newline at end of file diff --git a/src/Client/2DStructs.h b/src/Client/2DStructs.h index 0a883b379..49333024f 100644 --- a/src/Client/2DStructs.h +++ b/src/Client/2DStructs.h @@ -6,17 +6,17 @@ */ /* Stores location and dimensions of a 2D rectangle. */ -typedef struct Rectangle_ { +typedef struct Rectangle2D_ { /* Coordinates of top left corner of rectangle.*/ Int32 X, Y; /* Size of rectangle. */ Int32 Width, Height; -} Rectangle; +} Rectangle2D; /* Creates a new rectangle. */ -Rectangle Rectangle_Make(Int32 x, Int32 y, Int32 width, Int32 height); +Rectangle2D Rectangle2D_Make(Int32 x, Int32 y, Int32 width, Int32 height); /* Returns whether the given rectangle contains the given point. */ -bool Rectangle_Contains(Rectangle a, Int32 x, Int32 y); +bool Rectangle2D_Contains(Rectangle2D a, Int32 x, Int32 y); #endif \ No newline at end of file diff --git a/src/Client/AutoRotate.h b/src/Client/AutoRotate.h index 430912a19..2c8983282 100644 --- a/src/Client/AutoRotate.h +++ b/src/Client/AutoRotate.h @@ -23,4 +23,5 @@ static BlockID AutoRotate_RotateOther(BlockID block, String* name, Vector3 offse static BlockID AutoRotate_RotateDirection(BlockID block, String* name, Vector3 offset); static BlockID AutoRotate_Find(BlockID block, String* name, const UInt8* suffix); +#endif #endif \ No newline at end of file diff --git a/src/Client/BordersRenderer.c b/src/Client/BordersRenderer.c index 4ecae59de..44cd275ad 100644 --- a/src/Client/BordersRenderer.c +++ b/src/Client/BordersRenderer.c @@ -19,7 +19,7 @@ GfxResourceID borders_sidesVb = -1, borders_edgesVb = -1; GfxResourceID borders_edgeTexId, borders_sideTexId; Int32 borders_sidesVertices, borders_edgesVertices; bool borders_fullBrightSides, borders_fullBrightEdge; -Rectangle borders_rects[4]; +Rectangle2D borders_rects[4]; TextureLoc borders_lastEdgeTexLoc, borders_lastSideTexLoc; /* Creates game component implementation. */ @@ -165,7 +165,7 @@ void BordersRenderer_RebuildSides(Int32 y, Int32 axisSize) { Int32 i; for (i = 0; i < 4; i++) { - Rectangle r = borders_rects[i]; + Rectangle2D r = borders_rects[i]; borders_sidesVertices += Math_CountVertices(r.Width, r.Height, axisSize); /* YQuads outside */ } borders_sidesVertices += Math_CountVertices(World_Width, World_Length, axisSize); /* YQuads beneath map */ @@ -185,7 +185,7 @@ void BordersRenderer_RebuildSides(Int32 y, Int32 axisSize) { Block_Tint(col, block) for (i = 0; i < 4; i++) { - Rectangle r = borders_rects[i]; + Rectangle2D r = borders_rects[i]; BordersRenderer_DrawY(r.X, r.Y, r.X + r.Width, r.Y + r.Height, (Real32)y, axisSize, col, 0, borders_YOffset(block), &temp); } @@ -210,7 +210,7 @@ void BordersRenderer_RebuildEdges(Int32 y, Int32 axisSize) { Int32 i; for (i = 0; i < 4; i++) { - Rectangle r = borders_rects[i]; + Rectangle2D r = borders_rects[i]; borders_edgesVertices += Math_CountVertices(r.Width, r.Height, axisSize); /* YPlanes outside */ } @@ -227,7 +227,7 @@ void BordersRenderer_RebuildEdges(Int32 y, Int32 axisSize) { Block_Tint(col, block) for (i = 0; i < 4; i++) { - Rectangle r = borders_rects[i]; + Rectangle2D r = borders_rects[i]; BordersRenderer_DrawY(r.X, r.Y, r.X + r.Width, r.Y + r.Height, (Real32)y, axisSize, col, borders_HorOffset(block), borders_YOffset(block), &temp); } @@ -305,11 +305,11 @@ void BordersRenderer_DrawY(Int32 x1, Int32 z1, Int32 x2, Int32 z2, Real32 y, Int void BordersRenderer_CalculateRects(Int32 extent) { extent = Math_AdjViewDist(extent); - borders_rects[0] = Rectangle_Make(-extent, -extent, extent + World_Width + extent, extent); - borders_rects[1] = Rectangle_Make(-extent, World_Length, extent + World_Width + extent, extent); + borders_rects[0] = Rectangle2D_Make(-extent, -extent, extent + World_Width + extent, extent); + borders_rects[1] = Rectangle2D_Make(-extent, World_Length, extent + World_Width + extent, extent); - borders_rects[2] = Rectangle_Make(-extent, 0, extent, World_Length); - borders_rects[3] = Rectangle_Make(World_Width, 0, extent, World_Length); + borders_rects[2] = Rectangle2D_Make(-extent, 0, extent, World_Length); + borders_rects[3] = Rectangle2D_Make(World_Width, 0, extent, World_Length); } void BordersRenderer_MakeTexture(GfxResourceID* texId, TextureLoc* lastTexLoc, BlockID block) { diff --git a/src/Client/DisplayDevice.c b/src/Client/DisplayDevice.c index 4bd520c27..5186a04a8 100644 --- a/src/Client/DisplayDevice.c +++ b/src/Client/DisplayDevice.c @@ -10,12 +10,12 @@ DisplayResolution DisplayResolution_Make(Int32 width, Int32 height, Int32 bitsPe DisplayDevice DisplayDevice_Make(DisplayResolution* curResolution) { DisplayDevice device; device.CurResolution = *curResolution; - device.Bounds = Rectangle_Make(0, 0, curResolution->Width, curResolution->Height); + device.Bounds = Rectangle2D_Make(0, 0, curResolution->Width, curResolution->Height); device.Metadata = NULL; return device; } -void DisplayDevice_SetBounds(DisplayDevice* device, Rectangle* bounds) { +void DisplayDevice_SetBounds(DisplayDevice* device, Rectangle2D* bounds) { device->Bounds = *bounds; device->CurResolution.Width = bounds->Width; device->CurResolution.Height = bounds->Height; diff --git a/src/Client/DisplayDevice.h b/src/Client/DisplayDevice.h index 1e8355243..85eab0b8a 100644 --- a/src/Client/DisplayDevice.h +++ b/src/Client/DisplayDevice.h @@ -38,7 +38,7 @@ typedef struct DisplayDevice_ { DisplayResolution CurResolution; /* The bounds of the display device.*/ - Rectangle Bounds; + Rectangle2D Bounds; /* Metadata unique to this display device instance. */ void* Metadata; @@ -48,7 +48,7 @@ typedef struct DisplayDevice_ { DisplayDevice DisplayDevice_Make(DisplayResolution* curResolution); /* Updates the bounds of the display device to the given bounds. */ -void DisplayDevice_SetBounds(DisplayDevice* device, Rectangle* bounds); +void DisplayDevice_SetBounds(DisplayDevice* device, Rectangle2D* bounds); /* The primary / default / main display device. */ DisplayDevice DisplayDevice_Default;