mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-17 19:45:23 -04:00
Fix gui/gui.png not being treated as gui.png, fixes #188.
This commit is contained in:
parent
4d8b0fc3d8
commit
7042dccd2f
@ -37,11 +37,15 @@ namespace ClassicalSharp.TexturePack {
|
||||
void ProcessZipEntry( string filename, byte[] data, ZipEntry entry ) {
|
||||
MemoryStream stream = new MemoryStream( data );
|
||||
ModelCache cache = game.ModelCache;
|
||||
filename = filename.ToLower();
|
||||
if( filename.StartsWith( "mob/" ) )
|
||||
filename = filename.Substring( 4 );
|
||||
|
||||
switch( filename ) {
|
||||
// Ignore directories: convert x/name to name and x\name to name.
|
||||
string name = filename.ToLower();
|
||||
int i = name.LastIndexOf( '\\' );
|
||||
if( i >= 0 ) name = name.Substring( i + 1, name.Length - 1 - i );
|
||||
i = name.LastIndexOf( '/' );
|
||||
if( i >= 0 ) name = name.Substring( i + 1, name.Length - 1 - i );
|
||||
|
||||
switch( name ) {
|
||||
case "terrain.png":
|
||||
Bitmap atlas = Platform.ReadBmp( stream );
|
||||
if( !game.ChangeTerrainAtlas( atlas ) ) atlas.Dispose();
|
||||
@ -90,8 +94,8 @@ namespace ClassicalSharp.TexturePack {
|
||||
SetFontBitmap( game, stream ); break;
|
||||
}
|
||||
|
||||
if( !filename.EndsWith( ".png" ) ) return;
|
||||
string tex = filename.Substring( 0, filename.Length - 4 );
|
||||
if( !name.EndsWith( ".png" ) ) return;
|
||||
string tex = name.Substring( 0, name.Length - 4 );
|
||||
game.Events.RaiseTextureChanged( tex );
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user