mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-15 18:45:23 -04:00
Fetch gui.png, sky should not move below map.Height + 8.
This commit is contained in:
parent
1e0860354b
commit
62f1ca71d6
@ -31,7 +31,7 @@
|
|||||||
<DebugType>Full</DebugType>
|
<DebugType>Full</DebugType>
|
||||||
<Optimize>False</Optimize>
|
<Optimize>False</Optimize>
|
||||||
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
|
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
|
||||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
<DefineConstants>DEBUG;TRACE;</DefineConstants>
|
||||||
<StartAction>Project</StartAction>
|
<StartAction>Project</StartAction>
|
||||||
<BaseIntermediateOutputPath>obj\</BaseIntermediateOutputPath>
|
<BaseIntermediateOutputPath>obj\</BaseIntermediateOutputPath>
|
||||||
<StartArguments>wwwf null 127.0.0.1 25566</StartArguments>
|
<StartArguments>wwwf null 127.0.0.1 25566</StartArguments>
|
||||||
|
@ -26,7 +26,7 @@ namespace ClassicalSharp.Renderers {
|
|||||||
|
|
||||||
Vector3 eyePos = game.LocalPlayer.EyePosition;
|
Vector3 eyePos = game.LocalPlayer.EyePosition;
|
||||||
Vector3 pos = game.Camera.GetCameraPos( eyePos );
|
Vector3 pos = game.Camera.GetCameraPos( eyePos );
|
||||||
float normalY = map.CloudHeight + 8;
|
float normalY = map.Height + 8;
|
||||||
float skyY = Math.Max( pos.Y + 8, normalY );
|
float skyY = Math.Max( pos.Y + 8, normalY );
|
||||||
|
|
||||||
graphics.SetBatchFormat( VertexFormat.Pos3fCol4b );
|
graphics.SetBatchFormat( VertexFormat.Pos3fCol4b );
|
||||||
@ -176,7 +176,7 @@ namespace ClassicalSharp.Renderers {
|
|||||||
skyVertices = Utils.CountVertices( x2 - x1, z2 - z1, axisSize );
|
skyVertices = Utils.CountVertices( x2 - x1, z2 - z1, axisSize );
|
||||||
|
|
||||||
VertexPos3fCol4b* vertices = stackalloc VertexPos3fCol4b[skyVertices];
|
VertexPos3fCol4b* vertices = stackalloc VertexPos3fCol4b[skyVertices];
|
||||||
DrawSkyY( x1, z1, x2, z2, map.CloudHeight + 8, axisSize, map.SkyCol, vertices );
|
DrawSkyY( x1, z1, x2, z2, map.Height + 8, axisSize, map.SkyCol, vertices );
|
||||||
skyVb = graphics.CreateVb( (IntPtr)vertices, VertexFormat.Pos3fCol4b, skyVertices );
|
skyVb = graphics.CreateVb( (IntPtr)vertices, VertexFormat.Pos3fCol4b, skyVertices );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,41 +12,59 @@ namespace Launcher2 {
|
|||||||
this.downloader = downloader;
|
this.downloader = downloader;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const string jarClassicUri = "http://s3.amazonaws.com/Minecraft.Download/versions/c0.30_01c/c0.30_01c.jar";
|
||||||
|
const string jar162Uri = "http://s3.amazonaws.com/Minecraft.Download/versions/1.6.2/1.6.2.jar";
|
||||||
|
const string pngTerrainPatchUri = "http://static.classicube.net/terrain-patch.png";
|
||||||
|
const string pngGuiPatchUri = "http://static.classicube.net/gui.png";
|
||||||
|
|
||||||
public void DownloadItems( Action<string> setStatus ) {
|
public void DownloadItems( Action<string> setStatus ) {
|
||||||
downloader.DownloadData( "http://s3.amazonaws.com/Minecraft.Download/versions/c0.30_01c/c0.30_01c.jar", false, "classic_jar" );
|
downloader.DownloadData( jarClassicUri, false, "classic_jar" );
|
||||||
downloader.DownloadData( "http://s3.amazonaws.com/Minecraft.Download/versions/1.6.2/1.6.2.jar", false, "162_jar" );
|
downloader.DownloadData( jar162Uri, false, "162_jar" );
|
||||||
downloader.DownloadData( "http://static.classicube.net/terrain-patch.png", false, "terrain_patch" );
|
downloader.DownloadData( pngTerrainPatchUri, false, "terrain_patch" );
|
||||||
setStatus( "&eFetching classic jar.. (1/3)" );
|
downloader.DownloadData( pngGuiPatchUri, false, "gui_patch" );
|
||||||
|
setStatus( "&eFetching classic jar.. (1/4)" );
|
||||||
}
|
}
|
||||||
|
|
||||||
internal byte[] jarClassic, jar162, pngTerrainPatch;
|
internal byte[] jarClassic, jar162, pngTerrainPatch, pngGuiPatch;
|
||||||
public bool Check( Action<string> setStatus ) {
|
public bool Check( Action<string> setStatus ) {
|
||||||
if( Done ) return true;
|
if( Done ) return true;
|
||||||
|
|
||||||
DownloadedItem item;
|
if( !DownloadItem( "classic_jar", "classic jar",
|
||||||
if( downloader.TryGetItem( "classic_jar", out item ) ) {
|
"&eFetching 1.6.2 jar.. (2/4)", ref jarClassic, setStatus))
|
||||||
if( item.Data == null ) {
|
return false;
|
||||||
setStatus( "&cFailed to download classic jar" ); return false;
|
|
||||||
}
|
|
||||||
setStatus( "&eFetching 1.6.2 jar.. (2/3)" );
|
|
||||||
jarClassic = (byte[])item.Data;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( downloader.TryGetItem( "162_jar", out item ) ) {
|
if( !DownloadItem( "162_jar", "1.6.2 jar",
|
||||||
if( item.Data == null ) {
|
"&eFetching terrain patch.. (3/4)", ref jar162, setStatus))
|
||||||
setStatus( "&cFailed to download 1.6.2 jar" ); return false;
|
return false;
|
||||||
}
|
|
||||||
setStatus( "&eFetching terrain patch.. (3/3)" );
|
|
||||||
jar162 = (byte[])item.Data;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( downloader.TryGetItem( "terrain_patch", out item ) ) {
|
if( !DownloadItem( "terrain_patch", "terrain.png patch",
|
||||||
if( item.Data == null ) {
|
"&eFetching gui.. (3/4)", ref pngTerrainPatch, setStatus))
|
||||||
setStatus( "&cFailed to download terrain patch" ); return false;
|
return false;
|
||||||
}
|
|
||||||
setStatus( "&eCreating default.zip.." );
|
if( !DownloadItem( "gui_patch", "gui.png patch",
|
||||||
pngTerrainPatch = (byte[])item.Data;
|
"&eCreating default.zip..", ref pngGuiPatch, setStatus))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if( pngGuiPatch != null ) {
|
||||||
Done = true;
|
Done = true;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool DownloadItem( string identifier, string name, string next,
|
||||||
|
ref byte[] data, Action<string> setStatus ) {
|
||||||
|
DownloadedItem item;
|
||||||
|
if( downloader.TryGetItem( identifier, out item ) ) {
|
||||||
|
Console.WriteLine( "FOUND" + identifier );
|
||||||
|
if( item.Data == null ) {
|
||||||
|
setStatus( "&cFailed to download " + name );
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
setStatus( next );
|
||||||
|
data = (byte[])item.Data;
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -56,8 +74,8 @@ namespace Launcher2 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static string EstimateDownloadSize() {
|
public static string EstimateDownloadSize() {
|
||||||
float size = (291 + 4621 + 7) / 1024f;
|
float size = (291 + 4621 + 7 + 21) / 1024f;
|
||||||
// classic.jar + 1.6.2.jar + terrain-patch.png
|
// classic.jar + 1.6.2.jar + terrain-patch.png + gui.png
|
||||||
return size.ToString( "F2" );
|
return size.ToString( "F2" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,9 +13,10 @@ namespace Launcher2 {
|
|||||||
jarClassic = fetcher.jarClassic;
|
jarClassic = fetcher.jarClassic;
|
||||||
jar162 = fetcher.jar162;
|
jar162 = fetcher.jar162;
|
||||||
pngTerrainPatch = fetcher.pngTerrainPatch;
|
pngTerrainPatch = fetcher.pngTerrainPatch;
|
||||||
|
pngGuiPatch = fetcher.pngGuiPatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
byte[] jarClassic, jar162, pngTerrainPatch;
|
byte[] jarClassic, jar162, pngTerrainPatch, pngGuiPatch;
|
||||||
public void Run() {
|
public void Run() {
|
||||||
reader = new ZipReader();
|
reader = new ZipReader();
|
||||||
reader.ShouldProcessZipEntry = ShouldProcessZipEntry_Classic;
|
reader.ShouldProcessZipEntry = ShouldProcessZipEntry_Classic;
|
||||||
@ -35,6 +36,9 @@ namespace Launcher2 {
|
|||||||
|
|
||||||
writer.WriteNewImage( animBitmap, "animations.png" );
|
writer.WriteNewImage( animBitmap, "animations.png" );
|
||||||
writer.WriteNewString( animationsTxt, "animations.txt" );
|
writer.WriteNewString( animationsTxt, "animations.txt" );
|
||||||
|
using( Bitmap guiBitmap = new Bitmap( new MemoryStream( pngGuiPatch ) ) ) {
|
||||||
|
writer.WriteNewImage( guiBitmap, "gui.png" );
|
||||||
|
}
|
||||||
animBitmap.Dispose();
|
animBitmap.Dispose();
|
||||||
writer.WriteCentralDirectoryRecords();
|
writer.WriteCentralDirectoryRecords();
|
||||||
}
|
}
|
||||||
@ -44,7 +48,7 @@ namespace Launcher2 {
|
|||||||
Bitmap animBitmap;
|
Bitmap animBitmap;
|
||||||
|
|
||||||
bool ShouldProcessZipEntry_Classic( string filename ) {
|
bool ShouldProcessZipEntry_Classic( string filename ) {
|
||||||
return filename.StartsWith( "mob" ) || ( filename.IndexOf( '/' ) < 0 );
|
return filename.StartsWith( "mob" ) || (filename.IndexOf( '/' ) < 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProcessZipEntry_Classic( string filename, byte[] data, ZipEntry entry ) {
|
void ProcessZipEntry_Classic( string filename, byte[] data, ZipEntry entry ) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user