mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-18 03:55:19 -04:00
C client should't reject inf tex terrain.png
This commit is contained in:
parent
915781c7ca
commit
91e707f03b
@ -43,9 +43,9 @@ namespace ClassicalSharp {
|
||||
|
||||
public bool ChangeTerrainAtlas(Bitmap atlas) {
|
||||
if (!ValidateBitmap("terrain.png", atlas)) return false;
|
||||
if (atlas.Width != atlas.Height && (atlas.Width * 2 != atlas.Height)) {
|
||||
if (atlas.Height < atlas.Width) {
|
||||
Chat.Add("&cUnable to use terrain.png from the texture pack.");
|
||||
Chat.Add("&c Its width is not the same as its height.");
|
||||
Chat.Add("&c Its height is less than its width.");
|
||||
return false;
|
||||
}
|
||||
if (Graphics.LostContext) return false;
|
||||
|
@ -421,9 +421,7 @@ namespace ClassicalSharp.Network.Protocols {
|
||||
BlockID order = reader.ReadBlock();
|
||||
|
||||
game.Inventory.Remove(block);
|
||||
// TODO: kinda hacky, get rid of 255 completely when servers updated
|
||||
bool hidden = order == 0 || (order == 255 && !net.cpeData.extTexs);
|
||||
if (!hidden) { game.Inventory.Map[order - 1] = block; }
|
||||
if (order != 0) { game.Inventory.Map[order - 1] = block; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -40,7 +40,7 @@ namespace ClassicalSharp.Particles {
|
||||
|
||||
void TextureChanged(object sender, TextureEventArgs e) {
|
||||
if (e.Name == "particles.png")
|
||||
game.Loadtexture(ref ParticlesTexId, e.Name, e.Data);
|
||||
game.LoadTexture(ref ParticlesTexId, e.Name, e.Data);
|
||||
}
|
||||
|
||||
|
||||
|
@ -19,6 +19,7 @@ namespace ClassicalSharp.Textures {
|
||||
Atlas = bmp;
|
||||
TileSize = bmp.Width / TilesPerRow;
|
||||
RowsCount = bmp.Height / TileSize;
|
||||
RowsCount = Math.Min(RowsCount, MaxRowsCount);
|
||||
BlockInfo.RecalculateSpriteBB();
|
||||
}
|
||||
|
||||
|
@ -139,9 +139,9 @@ bool Game_ChangeTerrainAtlas(struct Bitmap* atlas) {
|
||||
String terrain = String_FromConst("terrain.png");
|
||||
if (!Game_ValidateBitmap(&terrain, atlas)) return false;
|
||||
|
||||
if (atlas->Width != atlas->Height) {
|
||||
if (atlas->Height < atlas->Width) {
|
||||
String m1 = String_FromConst("&cUnable to use terrain.png from the texture pack."); Chat_Add(&m1);
|
||||
String m2 = String_FromConst("&c Its width is not the same as its height."); Chat_Add(&m2);
|
||||
String m2 = String_FromConst("&c Its height is less than its width."); Chat_Add(&m2);
|
||||
return false;
|
||||
}
|
||||
if (Gfx_LostContext) return false;
|
||||
|
@ -2941,12 +2941,12 @@ static void TexIdsOverlay_ContextRecreated(void* obj) {
|
||||
String prefix = String_FromConst("f");
|
||||
TextAtlas_Make(&screen->IdAtlas, &chars, &screen->TextFont, &prefix);
|
||||
|
||||
Int32 size = Game_Height / ATLAS2D_ROWS_COUNT;
|
||||
Int32 size = Game_Height / ATLAS2D_TILES_PER_ROW;
|
||||
size = (size / 8) * 8;
|
||||
Math_Clamp(size, 8, 40);
|
||||
|
||||
screen->XOffset = Gui_CalcPos(ANCHOR_CENTRE, 0, size * ATLAS2D_TILES_PER_ROW, Game_Width);
|
||||
screen->YOffset = Gui_CalcPos(ANCHOR_CENTRE, 0, size * ATLAS2D_ROWS_COUNT, Game_Height);
|
||||
screen->XOffset = Gui_CalcPos(ANCHOR_CENTRE, 0, size * ATLAS2D_ROWS_COUNT, Game_Width);
|
||||
screen->YOffset = Gui_CalcPos(ANCHOR_CENTRE, 0, size * ATLAS2D_TILES_PER_ROW, Game_Height);
|
||||
screen->TileSize = size;
|
||||
|
||||
String title = String_FromConst("Texture ID reference sheet");
|
||||
|
@ -1145,9 +1145,7 @@ static void CPE_SetInventoryOrder(struct Stream* stream) {
|
||||
BlockID order = Handlers_ReadBlock(stream);
|
||||
|
||||
Inventory_Remove(block);
|
||||
if (order != 255 && order != 0) {
|
||||
Inventory_Map[order - 1] = block;
|
||||
}
|
||||
if (order) { Inventory_Map[order - 1] = block; }
|
||||
}
|
||||
|
||||
static void CPE_Reset(void) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user