From ab1ed3aaa680ddc9208b3c78523201b01e177e2b Mon Sep 17 00:00:00 2001 From: Avi Weinstock Date: Sat, 24 Apr 2021 21:49:22 -0400 Subject: [PATCH] Remove a use of inline_tweak and use `TallPacking` instead of `GridLtrPacking` in `common_net::msg::server`. --- common/net/src/msg/server.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/common/net/src/msg/server.rs b/common/net/src/msg/server.rs index 7c26aa9192..59e8c37877 100644 --- a/common/net/src/msg/server.rs +++ b/common/net/src/msg/server.rs @@ -1,6 +1,6 @@ use super::{ - world_msg::EconomyInfo, ClientType, CompressedData, EcsCompPacket, GridLtrPacking, - MixedEncoding, PingMsg, QuadPngEncoding, TallPacking, TriPngEncoding, WireChonk, + world_msg::EconomyInfo, ClientType, CompressedData, EcsCompPacket, MixedEncoding, PingMsg, + QuadPngEncoding, TallPacking, TriPngEncoding, WireChonk, }; use crate::sync; use common::{ @@ -70,13 +70,13 @@ pub type ServerRegisterAnswer = Result<(), RegisterError>; pub enum SerializedTerrainChunk { DeflatedChonk(CompressedData), PngPngPngJpeg(WireChonk), - QuadPng(WireChonk, GridLtrPacking, TerrainChunkMeta, TerrainChunkSize>), + QuadPng(WireChonk, TallPacking, TerrainChunkMeta, TerrainChunkSize>), TriPng(WireChonk), } impl SerializedTerrainChunk { pub fn image(chunk: &TerrainChunk) -> Self { - match inline_tweak::tweak!(2) { + match 2 { 0 => Self::deflate(chunk), 1 => Self::jpeg(chunk), 2 => Self::quadpng(chunk), @@ -99,7 +99,9 @@ impl SerializedTerrainChunk { } pub fn quadpng(chunk: &TerrainChunk) -> Self { - if let Some(wc) = WireChonk::from_chonk(QuadPngEncoding(), GridLtrPacking, chunk) { + if let Some(wc) = + WireChonk::from_chonk(QuadPngEncoding(), TallPacking { flip_y: true }, chunk) + { Self::QuadPng(wc) } else { warn!("Image encoding failure occurred, falling back to deflate");