Skip to content

Commit

Permalink
Merge pull request #20 from jakobharder/devel/0.6
Browse files Browse the repository at this point in the history
add music support
  • Loading branch information
jakobharder authored Oct 21, 2023
2 parents c451877 + abb50d8 commit 28d94b0
Show file tree
Hide file tree
Showing 45 changed files with 513 additions and 310 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ The game is a complete port of the original game to Windows with some adjustment
- some locations are larger to fill wide screens
- Monastery got another gap in the wall to go through

Note: unfortunately the game music is still missing due to an unclear license situation.

### Extended Game

The extended game mode adds new items, locations and gameplay features.
Expand Down
16 changes: 16 additions & 0 deletions resources/Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Burntime Changelog

## 0.6 - Music Support (2023-10-21)

### Changes

- Added music support
- Remastered graphics
- Player icons on maps
- Dropped items
- Statistics screen
- Toggle fullscreen with F11 as well

### Fixes

- Fixed flickering items in inventory with groups
- Fixed not localized text input

## 0.5 - Remastered Characters (2023-10-15)

### 0.5.1
Expand Down
2 changes: 0 additions & 2 deletions resources/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ The game is a complete port of the original game to Windows with some adjustment
- some locations are larger to fill wide screens
- Monastery got another gap in the wall to go through

Note: unfortunately the game music is still missing due to an unclear license situation.

### Extended Game

The extended game mode adds new items, locations and gameplay features.
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/game/classic_newgfx/gfx/down.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/game/classic_newgfx/gfx/objects/munt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed resources/game/classic_newgfx/gfx/syst_17.png
Binary file not shown.
Binary file removed resources/game/classic_newgfx/gfx/syst_28.png
Binary file not shown.
Binary file removed resources/game/classic_newgfx/gfx/syst_6.png
Binary file not shown.
Binary file added resources/game/classic_newgfx/gfx/up.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 24 additions & 7 deletions resources/game/classic_newgfx/newgfx.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
[replacement]
sprite_scale=2x2
burngfxani@munt.raw=pngani@gfx/munt_{0}.png
munt.raw=gfx/munt_{0}.png
sta.pac=gfx/sta.png
syst.raw=gfx/syst_{0}.png

[replacement_60x72]
sprite_scale=1.875x2.25
zei_004.raw=pngsheet@maps/shared/set_4.png?{0}?60x72
Expand Down Expand Up @@ -44,12 +37,36 @@ film_02.pac=gfx/backgrounds/film2.png
film_03.pac=gfx/backgrounds/film3.png
film_04.pac=gfx/backgrounds/film4.png
film_09.pac=gfx/backgrounds/film9.png
info.pac=gfx/backgrounds/info.png

syssze.raw=pngsheet@gfx/syssze.png?{0}?30x36

munt.raw?3=pngsheet@gfx/objects/munt.png?0?15x18
munt.raw?4=pngsheet@gfx/objects/munt.png?1?15x18
gfx/up.png=gfx/up.png
gfx/down.png=gfx/down.png

syst.raw?16=pngsheet@gfx/objects/player_icon_colors.png?0?36x38
syst.raw?17=pngsheet@gfx/objects/player_icon_colors.png?1?36x38
syst.raw?18=pngsheet@gfx/objects/player_icon_colors.png?2?36x38
syst.raw?19=pngsheet@gfx/objects/player_icon_colors.png?3?36x38

[newgfx_native]
sprite_scale=1.875x2.25
gfx/char_shadow.png=gfx/char_shadow.png
gfx/objects/player_icons.png=pngsheet@gfx/objects/player_icons.png?{0}?36x38
gfx/backgrounds/stats_rightbottom.png=gfx/backgrounds/stats_rightbottom.png
gfx/backgrounds/stats_righttop.png=gfx/backgrounds/stats_righttop.png
gfx/backgrounds/stats_leftbottom.png=gfx/backgrounds/stats_leftbottom.png
gfx/backgrounds/stats_lefttop.png=gfx/backgrounds/stats_lefttop.png
gfx/backgrounds/statistics.png=gfx/backgrounds/statistics.png
gfx/backgrounds/statistics2.png=gfx/backgrounds/statistics2.png

[replacement]
sprite_scale=2x2
burngfxani@munt.raw=pngani@gfx/munt_{0}.png
munt.raw=gfx/munt_{0}.png
sta.pac=gfx/sta.png

[replacement_stretched]
sprite_scale=2x2.375
Expand Down
29 changes: 29 additions & 0 deletions source/BurnGfxRipper/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class CommandParameter
public bool RatioCorrection = false;
public bool MegaTexture = false;
public bool Padding = true;
public bool Palette = true;

public bool HandleArg(string arg)
{
Expand All @@ -37,6 +38,12 @@ public bool HandleArg(string arg)
return true;
}

if (arg.StartsWith("--palette"))
{
Palette = true;
return true;
}

return false;
}
}
Expand Down Expand Up @@ -67,6 +74,12 @@ static void Main(string[] args)
String file = System.IO.Path.GetFileName(arg);
String dir = path + "\\" + file + "_output";

if (parameter.Palette)
{
ExportColorTables(path, file);
return;
}

bool stretch = true;

switch (ext)
Expand Down Expand Up @@ -119,4 +132,20 @@ static void Main(string[] args)
// Console.ReadKey();
//}
}

static void ExportColorTables(string basePath, string fileName)
{
using Bitmap bmp = new(256, 1, PixelFormat.Format24bppRgb);
for (int i = 0; i < 256; i++)
bmp.SetPixel(i, 0, Color.FromArgb(BurnGfxData.Instance.DefaultColorTable.GetColor(i).ToInt()));

bmp.Save(System.IO.Path.Combine(basePath, System.IO.Path.GetFileNameWithoutExtension(fileName) + "_palette.png"));

using Bitmap bmp2 = new(256, 38, PixelFormat.Format24bppRgb);
for (int map = 0; map < 38; map++)
for (int i = 0; i < 256; i++)
bmp2.SetPixel(i, map, Color.FromArgb(BurnGfxData.Instance.GetMapColorTable(map).GetColor(i).ToInt()));

bmp2.Save(System.IO.Path.Combine(basePath, "maps_palette.png"));
}
}
2 changes: 1 addition & 1 deletion source/Burntime.BurnGfx/BurnGfxData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ void InitializeMaps()
}
#endregion

public void Initialize()
void Initialize()
{
Burntime.Platform.Log.Info("Initialize BurnGfx library");
InitializeMaps();
Expand Down
8 changes: 2 additions & 6 deletions source/Burntime.BurnGfx/ColorTable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ public class ColorTable
{
PixelColor[] colorTable;

public static ColorTable Last;
public static ColorTable Default;

public const int DefaultBlue = 148;
public const int DefaultRed = 241;
public const int ButtonBlue = 140;
Expand All @@ -22,10 +19,12 @@ public class ColorTable

public ColorTable()
{
colorTable = new PixelColor[256];
}

public ColorTable(File file)
{
colorTable = new PixelColor[256];
file.Seek(16, SeekPosition.Begin);
Read(file);
}
Expand Down Expand Up @@ -309,9 +308,6 @@ public void FromPac(byte[] file, int offset, short[] moveCmd)

public bool Read(File reader)
{
colorTable = new PixelColor[256];
// Last = this;

byte[] colorbytes = new byte[3];
int read = 3;// = File.Read(colorbytes, 0, 3);
for (int i = 0; i < 256 && read == 3; i++)
Expand Down
143 changes: 1 addition & 142 deletions source/Burntime.BurnGfx/Map.cs
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ public bool CheckTile(int x, int y)
return false;
}

[Obsolete]
public void Read(File reader)
{
int width = reader.ReadUShort() / 2;
Expand Down Expand Up @@ -272,107 +273,6 @@ public void Read(File reader)

}

public void Convert()
{
//bmp.Save("c:\\burntime\\input.bmp", System.Drawing.Imaging.ImageFormat.Bmp);

//Size sz = bmp.Size;

//bmp = null;

//System.Diagnostics.Process proc = new System.Diagnostics.Process();
//proc.EnableRaisingEvents = false;
//proc.StartInfo.FileName = "c:\\burntime\\hq3x.exe";
//proc.StartInfo.Arguments = "c:\\burntime\\input.bmp c:\\burntime\\output.bmp";
//proc.Start();
//proc.WaitForExit();

//Image img = Image.FromFile("c:\\burntime\\output.bmp");

//int zoom = 3;
//bmp = new Bitmap(zoom * sz.Width, zoom * sz.Height);
//Graphics g = Graphics.FromImage(bmp);

//g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor;
//g.DrawImage(img, new Rectangle(0, 0, zoom * sz.Width, zoom * sz.Height), new Rectangle(0, 0, sz.Width * 3, sz.Height * 3), GraphicsUnit.Pixel);

//img.Dispose();
}

public void DrawGrid()
{
//Graphics g = Graphics.FromImage(bmp);

//g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor;

//Pen p = new Pen(new SolidBrush(Color.Black));

//for (int i = 0; i < Size.Width; i++)
//{
// Point pt1 = new Point(i * TileWidth, 0);
// Point pt2 = new Point(pt1.X, Size.Height * TileHeight - 1);
// g.DrawLine(p, pt1, pt2);
//}

//for (int i = 0; i < Size.Height; i++)
//{
// Point pt1 = new Point(0, i * TileHeight);
// Point pt2 = new Point(Size.Width * TileWidth - 1, pt1.Y);
// g.DrawLine(p, pt1, pt2);
//}

//p = new Pen(new SolidBrush(Color.Red));
//foreach (Mask m in masks)
//{
// bool[] matrix = new bool[16];

// int value = m.Value;
// for (int i = 0; i < 16; i++, value >>= 1)
// matrix[15 - i] = (value & 1) != 0;


// for (int i = 0; i < 16; i++)
// {
// if (matrix[i])
// {
// int x = i % 4;
// int y = (i - x) / 4;

// Rectangle rc = new Rectangle(m.x + x * TileWidth / 4, m.y + y * TileHeight / 4, TileWidth / 4, TileHeight / 4);

// // left
// if (x == 0 || (x > 0 && !matrix[y * 4 + x - 1]))
// {
// g.DrawLine(p, new Point(rc.Left, rc.Top), new Point(rc.Left, rc.Bottom));
// }
// // right
// if (x == 3 || (x < 3 && !matrix[y * 4 + x + 1]))
// {
// g.DrawLine(p, new Point(rc.Right, rc.Top), new Point(rc.Right, rc.Bottom));
// }
// // top
// if (y == 0 || (y > 0 && !matrix[(y - 1) * 4 + x]))
// {
// g.DrawLine(p, new Point(rc.Left, rc.Top), new Point(rc.Right, rc.Top));
// }
// // bottom
// if (y == 3 || (y < 3 && !matrix[(y + 1) * 4 + x]))
// {
// g.DrawLine(p, new Point(rc.Left, rc.Bottom), new Point(rc.Right, rc.Bottom));
// }

// //g.DrawRectangle(p, rc);
// }
// }
//}
//p = new Pen(new SolidBrush(Color.Blue));

//foreach (Door d in doors)
//{
// g.DrawRectangle(p, d.Area);
//}
}

public int GetDoor(Vector2 pos)
{
Vector2 pt = new Vector2(pos);
Expand All @@ -393,46 +293,5 @@ public Door GetDoor(int id)
return null;
return doors[id - 1];
}

public void save(String file)
{
//Bitmap bmp = new Bitmap(PixelSize.Width, PixelSize.Height, System.Drawing.Imaging.PixelFormat.Format24bppRgb);


//System.Drawing.Imaging.BitmapData bdata = bmp.LockBits(new Rectangle(0, 0, PixelSize.Width, PixelSize.Height), System.Drawing.Imaging.ImageLockMode.ReadOnly,
// System.Drawing.Imaging.PixelFormat.Format24bppRgb);


//ByteBuffer target = new ByteBuffer(PixelSize.Width, PixelSize.Height, new byte[3 * PixelSize.Width * PixelSize.Height]);


//for (int y = 0; y < height; y++)
//{
// for (int x = 0; x < width; x++)
// {
// int tileset = data[x + y * width] & 0xff;
// int tileid = data[x + y * width] >> 8;

// Tile tile = TileDB.Singleton.GetTile(tileset, tileid);
// tile.Draw(ref target, x * Tile.WIDTH, y * Tile.HEIGHT, ColorTable.Last);

// ByteBuffer tt = new ByteBuffer(Tile.WIDTH, Tile.HEIGHT, new byte[3 * Tile.WIDTH * Tile.HEIGHT]);
// tile.Draw(ref tt, 0, 0, ColorTable.Last);
// Bitmap tbmp = new Bitmap(Tile.WIDTH, Tile.HEIGHT, System.Drawing.Imaging.PixelFormat.Format24bppRgb);
// System.Drawing.Imaging.BitmapData bdata2 = tbmp.LockBits(new Rectangle(0, 0, Tile.WIDTH, Tile.HEIGHT), System.Drawing.Imaging.ImageLockMode.ReadOnly,
// System.Drawing.Imaging.PixelFormat.Format24bppRgb);

// System.Runtime.InteropServices.Marshal.Copy(tt.Data, 0, bdata2.Scan0, tt.Height * tt.Stride);
// tbmp.UnlockBits(bdata2);

// tbmp.Save(BurnGfxSetting.Singleton.DataPath + "\\..\\output\\tiles\\" + tileset.ToString("D2") + "_" + tileid.ToString("D2") + ".png");
// }
//}

//System.Runtime.InteropServices.Marshal.Copy(target.Data, 0, bdata.Scan0, target.Height * target.Stride);
//bmp.UnlockBits(bdata);

//bmp.Save(BurnGfxSetting.Singleton.DataPath + "\\..\\output\\maps\\" + file + ".png");
}
}
}
1 change: 1 addition & 0 deletions source/Burntime.Framework/GUI/GuiImage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public class GuiImage

public int Width => sprite_.Width;
public int Height => sprite_.Height;
public Vector2 Size => sprite_.Size;
public bool IsLoaded => sprite_.IsLoaded;
public SpriteAnimation Animation => sprite_.Animation;

Expand Down
9 changes: 4 additions & 5 deletions source/Burntime.Framework/Scene.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,14 @@ internal void ActivateScene(object parameter)
{
OnResizeScreen();
OnActivateScene(parameter);
#warning TODO SlimDX/Mono Music
//if (music != null)
// app.Engine.Music.Play(music);

if (music != null)
app.Engine.Music.Play(music);
}

internal void InactivateScene()
{
#warning TODO SlimDX/Mono Music
//app.Engine.Music.Stop();
app.Engine.Music.Stop();

OnInactivateScene();
}
Expand Down
Loading

0 comments on commit 28d94b0

Please sign in to comment.