void MakeTexture(ref int id, ref int lastTexLoc, BlockID block) { int texLoc = BlockInfo.GetTextureLoc(block, Side.Top); if (texLoc == lastTexLoc || game.Graphics.LostContext) { return; } lastTexLoc = texLoc; game.Graphics.DeleteTexture(ref id); id = TerrainAtlas2D.LoadTextureElement(texLoc); }
void MakeTexture(ref int id, ref int lastTexLoc, int newTex) { int texLoc = newTex; if (texLoc == lastTexLoc || game.Graphics.LostContext) { return; } lastTexLoc = texLoc; game.Graphics.DeleteTexture(ref id); id = TerrainAtlas2D.LoadTextureElement(texLoc); }