mirror of
https://github.com/ServUO/ServUO
synced 2026-08-11 20:23:04 -04:00
* Move game asset factories in to Assets directory. * * Core + Improved file sharing capability. ~ A running client and shard can now share an install location) * Assets + Thread safety for image loading. + Improved detection for UOP or MUL support. (prioritize UOP) + Always load and convert raw image data from 16bpp to 32bpp. ~ This change is aimed at improving cross-platform support.
54 lines
1.6 KiB
C#
54 lines
1.6 KiB
C#
using Server.Commands;
|
|
using System;
|
|
using System.IO;
|
|
|
|
namespace Server.Bounds
|
|
{
|
|
public class Bounds
|
|
{
|
|
public static void Initialize()
|
|
{
|
|
CommandSystem.Register("GenBounds", AccessLevel.Administrator, GenBounds_OnCommand);
|
|
}
|
|
|
|
[Usage("GenBounds")]
|
|
[Description("GenBounds")]
|
|
public static void GenBounds_OnCommand(CommandEventArgs e)
|
|
{
|
|
try
|
|
{
|
|
Utility.PushColor(ConsoleColor.Yellow);
|
|
Console.Write("Generating Bounds.bin...");
|
|
Utility.PopColor();
|
|
|
|
FileStream fs = new FileStream("Data/Binary/Bounds.bin", FileMode.Create, FileAccess.Write);
|
|
|
|
BinaryWriter bin = new BinaryWriter(fs);
|
|
|
|
for (int i = 0; i <= ArtData.MaxItemID; ++i)
|
|
{
|
|
ArtData.Measure(Item.GetBitmap(i), out int xMin, out int yMin, out int xMax, out int yMax);
|
|
|
|
bin.Write((ushort)xMin);
|
|
bin.Write((ushort)yMin);
|
|
bin.Write((ushort)xMax);
|
|
bin.Write((ushort)yMax);
|
|
}
|
|
|
|
bin.Flush();
|
|
bin.Close();
|
|
|
|
Utility.PushColor(ConsoleColor.Green);
|
|
Console.WriteLine("done");
|
|
Utility.PopColor();
|
|
}
|
|
catch (Exception x)
|
|
{
|
|
Utility.PushColor(ConsoleColor.Red);
|
|
Console.WriteLine("GenBounds Failed: ");
|
|
Console.WriteLine(x);
|
|
Utility.PopColor();
|
|
}
|
|
}
|
|
}
|
|
}
|