Skip to content

Commit

Permalink
Merge pull request #21 from jakobharder/devel/0.7
Browse files Browse the repository at this point in the history
improve options, trader and add amiga sounds/music
  • Loading branch information
jakobharder authored Oct 29, 2023
2 parents 28d94b0 + 71cd7a4 commit 2b5c615
Show file tree
Hide file tree
Showing 104 changed files with 2,567 additions and 1,490 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,22 @@ jobs:
- name: Build
run: (cd source && dotnet publish Burntime.MonoGame -c Release /p:DebugSymbols=false /p:PublishReadyToRun=false /p:TieredCompilation=false --self-contained /p:PublishSingleFile=true && cd ..)

# - name: Build Tools
# run: |
# cd source
# dotnet publish PakConverter -c Release /p:DebugSymbols=false /p:PublishReadyToRun=false /p:TieredCompilation=false --self-contained /p:PublishSingleFile=true
# cd ..

- name: Package
run: |
rm ./bin/Release/win-x64/publish/*.pdb
tar -caf burntime.zip -C ./bin/Release/win-x64/publish *
rm ./bin/tools/Release/win-x64/publish/*.pdb
tar -caf burntime-${{ github.ref_name }}.zip -C ./bin/Release/win-x64/publish *
# tar -caf burntime-tools.zip -C ./bin/tools/Release/win-x64/publish *

- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
draft: true
files: ./burntime.zip
files: ./burntime*.zip
29 changes: 29 additions & 0 deletions resources/Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,34 @@
# Burntime Changelog

## 0.7 - Options, Trader and Amiga (2023-10-26)

### Changes

- Improved trader
- Show both trader and player inventory on wide screens
- Reworked options
- Change language in options
- Toggle fullscreen in options
- Show fullscreen and remaster graphics shortcuts
- Jukebox to play all songs
- Remastered graphics
- Player flags
- Cursor animations
- Trader intro scenes
- Inventory UIs
- Added Amiga sounds, music
- Amiga version hit, barf and die sounds
- Switch to Amiga music in options
- Start game with language selection
- Save user settings
- Scroll maps with right mouse button

### Fixes

- Fixed draw order of characters on map
- Fixed music in monastery
- Ensure 4:3 screen portion is always on screen, independent of window size

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

### Changes
Expand Down
Binary file added resources/game/classic/gfx/ui/options_bulb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 16 additions & 16 deletions resources/game/classic/lang/en/newburn.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,22 @@ no AI players
easy
normal
hard
NewGfx ON
NewGfx OFF














Graphics REMASTER
Graphics ORIGINAL
Fullscreen ON
Fullscreen OFF
Saves
Settings
toggle in-game with F11
toggle in-game with F8
toggle in-game with F9
Language ENGLISH
Give up
Start new game
Jukebox
Music AMIGA
Music DOS
Music REMASTER



Expand Down
Binary file added resources/game/classic/sounds/barf.ogg
Binary file not shown.
Binary file added resources/game/classic/sounds/camp.ogg
Binary file not shown.
Binary file added resources/game/classic/sounds/change.ogg
Binary file not shown.
Binary file added resources/game/classic/sounds/hit-barf.ogg
Binary file not shown.
Binary file added resources/game/classic/sounds/hit-die.ogg
Binary file not shown.
Binary file added resources/game/classic/sounds/hit.ogg
Binary file not shown.
Binary file added resources/game/classic/sounds/trader.ogg
Binary file not shown.
Binary file added resources/game/classic_de/highres-font_de.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions resources/game/classic_de/highres-font_de.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
image=highres-font.png
factor=0.5
offset=-2
lines=1
height=12
char0=" !""#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyzüäÄöÖÜß"
// ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z ü ä Ä ö Ö Ü ß"
width0=6 2 4 4 6 6 4 3 4 4 6 4 3 5 2 6 5 3 5 5 5 5 5 5 5 5 2 4 5 5 5 5 2 5 5 5 5 5 5 5 5 2 5 5 4 6 5 5 5 5 5 5 5 5 5 6 5 5 5 3 6 3 6 5 3 6 5 6 5 5 4 5 5 2 5 5 3 6 5 5 5 5 5 5 4 5 5 6 6 5 5 6 6 5 6 6 6 5
y0=0

32 changes: 16 additions & 16 deletions resources/game/classic_de/lang/de/newburn.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,22 @@ Ohne Computergegner
Einfach
Normal
Schwer
NewGfx AN
NewGfx AUS














Grafik REMASTER
Grafik ORIGINAL
Vollbild AN
Vollbild AUS
Spielst�nde
Optionen
im Spiel mit F11 wechseln
im Spiel mit F8 wechseln
im Spiel mit F9 wechseln
Sprache DEUTSCH
Aufgeben
Neues Spiel starten
Jukebox
Musik AMIGA
Musik DOS
Musik REMASTER



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.
Binary file not shown.
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/munt_fight.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/munt_info.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.
Binary file modified resources/game/classic_newgfx/gfx/objects/player_icons.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions resources/game/classic_newgfx/newgfx.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
[replacement_60x72]
' Remastered graphics are ratio corrected from 8:5 to 4:3 - 1 horizontal to 1.2 vertical.
' Upscale is not exactly 2x but ratio correct to ensure clean pixel sizes and positions.
' 32x32 -> 60x72
' 16x16 -> 30x36
' 8x8 -> 15x18
' Ratio correction factor without upscale: 0.9375x1.125

sprite_scale=1.875x2.25
zei_004.raw=pngsheet@maps/shared/set_4.png?{0}?60x72
zei_005.raw=pngsheet@maps/shared/set_5.png?{0}?60x72
Expand Down Expand Up @@ -36,22 +43,47 @@ maps/mat_033_tiles.png=pngsheet@maps/mat_033_tiles_2x.png?{0}?60x72
film_02.pac=gfx/backgrounds/film2.png
film_03.pac=gfx/backgrounds/film3.png
film_04.pac=gfx/backgrounds/film4.png
film_05.pac=gfx/backgrounds/film5.png
film_09.pac=gfx/backgrounds/film9.png
film_10.pac=gfx/backgrounds/film10.png
info.pac=gfx/backgrounds/info.png
hint1.pac=gfx/backgrounds/trader.png
film_05.ani?0-17?p=pngsheet@gfx/backgrounds/film5_ani.png?0-17?135x126
film_05.ani?18-19=pngsheet@gfx/backgrounds/film5_ani2.png?0-1?90x72
film_05.ani?20-21=pngsheet@gfx/backgrounds/film5_ani3.png?0-1?90x72
film_10.ani=pngsheet@gfx/backgrounds/film10_ani.png?0-12?60x72

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
munt.raw?22=gfx/munt_daytime.png
gfx/up.png=gfx/up.png
gfx/down.png=gfx/down.png
gfx/inventory_left.png=gfx/inventory_left.png
inv.raw?1=gfx/inventory_middle.png
inv.raw?2=gfx/inventory_right.png
munt.raw?5=pngsheet@gfx/inventory_buttons.png?0?30x36
munt.raw?6=pngsheet@gfx/inventory_buttons.png?1?30x36
munt.raw?7=pngsheet@gfx/inventory_buttons.png?2?30x36
munt.raw?8=pngsheet@gfx/inventory_buttons.png?3?30x36
munt.raw?9=pngsheet@gfx/inventory_buttons.png?4?30x36

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
[email protected]?24-27=pngsheet@gfx/syssze.png?18-19?30x36
[email protected]?20-23=pngsheet@gfx/munt_info.png?0-3?23x30
[email protected]?14-17=pngsheet@gfx/munt_fight.png?0-3?30x54
[email protected]?0-3=pngsheet@gfx/objects/flags.png?0-11?30x36
[email protected]?4-7=pngsheet@gfx/objects/flags.png?12-23?30x36
[email protected]?8-11=pngsheet@gfx/objects/flags.png?24-35?30x36
[email protected]?12-15=pngsheet@gfx/objects/flags.png?36-47?30x36

[newgfx_native]
' Graphics only used in remastered mode

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
Expand All @@ -63,12 +95,16 @@ gfx/backgrounds/statistics.png=gfx/backgrounds/statistics.png
gfx/backgrounds/statistics2.png=gfx/backgrounds/statistics2.png

[replacement]
' Old upscale graphics. They should be replaced by 60x72 verisons eventually.

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

[replacement_stretched]
' Old upscale graphics. They should be replaced by 60x72 verisons eventually.

sprite_scale=2x2.375
ges_00.ani=pngsheet@gfx/faces/ges_00.png?0-39?136x152
ges_01.ani=pngsheet@gfx/faces/ges_01.png?0?136x133
Expand Down
42 changes: 38 additions & 4 deletions source/BurnGfxRipper/AnimationExporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
using System.Drawing.Imaging;
using System.Drawing;
using System.Runtime.InteropServices;
using System.Collections.Generic;
using System.Linq;

namespace BurnGfxRipper;

Expand All @@ -12,7 +14,8 @@ public void Export(string file, string dir, CommandParameter parameter)
{
if (!parameter.MegaTexture)
{
ExportAsSeparateFiles(file, dir, parameter);
ExportAsSpriteSheet(file, dir, parameter);
//ExportAsSeparateFiles(file, dir, parameter);
}
else
{
Expand Down Expand Up @@ -43,11 +46,43 @@ private void ExportAsSeparateFiles(string file, string dir, CommandParameter par
}
}

void ExportAsSpriteSheet(string originalFilePath, string dir, CommandParameter parameter)
{
SpriteLoaderAni loader = new();
loader.Process(originalFilePath);
System.IO.Directory.CreateDirectory(System.IO.Path.GetDirectoryName(dir));
string outputFilePath = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(dir), System.IO.Path.GetFileNameWithoutExtension(originalFilePath));

var animations = Enumerable.Range(0, loader.FrameCount)
.Select(index => { loader.SetFrame(index); return loader.FrameSize; })
.GroupBy(size => size)
.Select(group => new { Size = group.Key, Count = group.Count() });

int frameCount = 0;
int animCount = 1;
foreach (var anim in animations)
{
loader.Process($"{originalFilePath}?{frameCount}-{frameCount + anim.Count}");
loader.SetFrame(0);
var progressive = new SpriteSheet(loader.Size.x * anim.Count, loader.Size.x, loader.Size.y, anim.Count, 0);
progressive.Render(loader, nonProgressive: false, heightPadding: 1);
TextureUtils.Save(progressive.Bitmap, $"{outputFilePath}_{animCount}_p.png", parameter);

loader.Process($"{originalFilePath}?{frameCount}-{frameCount + anim.Count}?p");
loader.SetFrame(0);
var fullImage = new SpriteSheet(loader.Size.x * anim.Count, loader.Size.x, loader.Size.y, anim.Count, 0);
fullImage.Render(loader, nonProgressive: false, heightPadding: 1);
TextureUtils.Save(fullImage.Bitmap, $"{outputFilePath}_{animCount}_f.png", parameter);

frameCount += anim.Count;
animCount++;
}
}

private void ExportAsSingleFile(string originalFilePath, string dir, CommandParameter parameter)
{
SpriteLoaderAni ani = new();
ani.Process(originalFilePath);

System.IO.Directory.CreateDirectory(System.IO.Path.GetDirectoryName(dir));

ani.SetFrame(0);
Expand All @@ -57,10 +92,9 @@ private void ExportAsSingleFile(string originalFilePath, string dir, CommandPara
progressive.Render(ani, false);
TextureUtils.Save(progressive.Bitmap, outputFilePath + "_progressive.png", parameter);

var baseImage = new SpriteSheet(parameter.TextureWidth, ani.Size.x, ani.Size.y, ani.FrameCount);
var baseImage = new SpriteSheet(parameter.TextureWidth, ani.Size.x, ani.Size.y, ani.FrameCount, parameter.Padding ? 1 : 0);
baseImage.Render(ani, true);
TextureUtils.Save(baseImage.Bitmap, outputFilePath + "_base.png", parameter);

TextureUtils.Save(baseImage.Bitmap, progressive.Bitmap, outputFilePath + "_full.png", parameter);
}
}
Expand Down
4 changes: 2 additions & 2 deletions source/BurnGfxRipper/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ class CommandParameter
public int TextureWidth = 0;
public bool RatioCorrection = false;
public bool MegaTexture = false;
public bool Padding = true;
public bool Palette = true;
public bool Padding = false;
public bool Palette = false;

public bool HandleArg(string arg)
{
Expand Down
31 changes: 21 additions & 10 deletions source/BurnGfxRipper/SpriteSheet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,38 +57,49 @@ public void RenderSingle(MemoryStream memory, int frameWidth, int frameHeight, i
Bitmap.UnlockBits(loc);
}

public void Render(ISpriteAnimationProcessor ani, bool baseImage)
public void Render(ISpriteAnimationProcessor ani, bool nonProgressive, int heightPadding = TextureUtils.HEIGHT_PADDING, int startFrame = 0, int frameCount = 0)
{
ani.SetFrame(0);
ani.SetFrame(startFrame);
frameCount = frameCount == 0 ? (ani.FrameCount - startFrame - 1) : System.Math.Min(frameCount, (ani.FrameCount - startFrame - 1));

int columns = (int)Math.Floor(Bitmap.Width / (float)(ani.Size.x + _padding * 2));
int rows = (int)Math.Ceiling(ani.FrameCount / (float)columns);
int rows = (int)Math.Ceiling(frameCount / (float)columns);

int rowHeight = TextureUtils.MakeMultipleOf(ani.Size.y, TextureUtils.HEIGHT_PADDING) + _padding * 2;
int rowHeight = TextureUtils.MakeMultipleOf(ani.Size.y, heightPadding) + _padding * 2;
int columnWidth = ani.FrameSize.x + _padding * 2;

int i = 0;
int frame = startFrame;
for (int y = 0; y < rows; y++)
{
for (int x = 0; x < columns && i < ani.FrameCount; x++)
for (int x = 0; x < columns && frame < frameCount; x++)
{
ani.SetFrame(baseImage ? 0 : i);
ani.SetFrame(frame);

BitmapData loc = Bitmap.LockBits(new Rectangle(x * columnWidth, y * rowHeight, ani.FrameSize.x, ani.FrameSize.y),
ImageLockMode.ReadWrite, PixelFormat.Format32bppArgb);
System.IO.MemoryStream mem = new();

if (nonProgressive)
{
for (int baseFrame = startFrame; baseFrame < frame; baseFrame++)
{
ani.SetFrame(baseFrame);
ani.Render(mem, ani.FrameSize.x * 4);
}
}

ani.SetFrame(frame);
ani.Render(mem, ani.FrameSize.x * 4);

byte[] buffer = mem.ToArray();

for (int py = 0; py < ani.FrameSize.y; py++)
Marshal.Copy(buffer,
py * ani.FrameSize.x * 4,
loc.Scan0 + py * loc.Stride,
ani.FrameSize.x * 4);

Bitmap.UnlockBits(loc);

i++;
frame++;
}
}

Expand Down
3 changes: 3 additions & 0 deletions source/Burntime.BurnGfx/BurnGfxData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ public void AddPacColorTable(String Pac, ColorTable Table)

void InitializeColorTables()
{
//#warning OPTIMIZE remove, as it is only needed in development
// _ = PacImageFileReader.Read("film_05.pac");
// _ = PacImageFileReader.Read("film_10.pac");
}
#endregion

Expand Down
2 changes: 1 addition & 1 deletion source/Burntime.BurnGfx/PacImageFileReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ static public PacImageFileReader Read(String filePath)
//ByteBuffer b = new ByteBuffer(1, 1, data);
//g.Draw(ref b);

// TODO: optimize loading sequence
#warning // TODO: optimize loading sequence

g.bytes = new PixelColor[g.width * g.height];
ByteBuffer buffer = new ByteBuffer(g.width, g.height, g.bytes);
Expand Down
Loading

0 comments on commit 2b5c615

Please sign in to comment.