Permalink
Browse files

map collisions, entities, grid; new screenshots

  • Loading branch information...
movAX13h committed Nov 2, 2018
1 parent 6f62310 commit 13037efa7187bd06151f08f6332720bff69c9a55
@@ -16,8 +16,7 @@ by [movAX13h](https://github.com/movAX13h/) and [srtuss](https://github.com/srtu
## TODO
- map entities to IDs
- entities in map preview
- map entities to IDs (the boring stuff)
## EIFS - Executable Integrated File System
@@ -5,8 +5,6 @@ VisualStudioVersion = 15.0.27004.2005
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "T2Tools", "T2Tools\T2Tools.csproj", "{626227C7-7695-4B79-9CB8-B72BA83A962B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Audiolib", "..\..\StudioHost\Audiolib\Audiolib.csproj", "{0D863BE6-B19C-4C6E-B024-40667FB16CE4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TFXTool", "TFXTool\TFXTool.csproj", "{1ED3A2D1-086B-4C4C-95AD-C58FF08D1024}"
EndProject
Global
@@ -19,10 +17,6 @@ Global
{626227C7-7695-4B79-9CB8-B72BA83A962B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{626227C7-7695-4B79-9CB8-B72BA83A962B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{626227C7-7695-4B79-9CB8-B72BA83A962B}.Release|Any CPU.Build.0 = Release|Any CPU
{0D863BE6-B19C-4C6E-B024-40667FB16CE4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0D863BE6-B19C-4C6E-B024-40667FB16CE4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0D863BE6-B19C-4C6E-B024-40667FB16CE4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0D863BE6-B19C-4C6E-B024-40667FB16CE4}.Release|Any CPU.Build.0 = Release|Any CPU
{1ED3A2D1-086B-4C4C-95AD-C58FF08D1024}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1ED3A2D1-086B-4C4C-95AD-C58FF08D1024}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1ED3A2D1-086B-4C4C-95AD-C58FF08D1024}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -1,8 +1,5 @@
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
using System.Windows.Forms;
using T2Tools.Formats;
using T2Tools.Turrican;
namespace T2Tools.Controls
{
@@ -16,7 +16,6 @@ public List<VGABitmap> DecodeFrames(BOBFile bob)
{
//System.IO.File.WriteAllBytes("dp.com", frame.DrawProgram);
var cpu = new DrawProgramCPU { Text = frame.DrawProgram, Data = frame.PixelData };
byte[] screenbuffer = new byte[frame.Width * frame.Height];
//byte[] dest = new byte[5000];
@@ -73,26 +73,7 @@ public EIBFile(byte[] data)
throw new Exception("EIB bad size");
int pos = blockLoc;
if(false)
{
int numChunks = 0;
while(pos < blockLoc + dataBlockSize)
{
if(data[pos] == 0xFF)
{
++pos;
Console.WriteLine();
++numChunks;
continue;
}
Console.Write(data[pos] + " " + data[pos + 1] + " " + data[pos + 2] + ", ");
pos += 3;
}
Console.WriteLine(numChunks + " chunks read of " + Width * Height);
}
byte[] block = new byte[dataBlockSize];
Array.Copy(data, blockLoc, block, 0, dataBlockSize);
short[] offsets = new short[Width * Height];

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -191,7 +191,7 @@ private void fileSelected(TOCListItem item)
entitiesList.Items.Add(new EntityListItem(point));
}
}
entityFileInfo.Text = $"Unknown D: {eibFile.D}, E: {eibFile.E}, F: {eibFile.F}";
entityFileInfo.Text = $"Unknown variables in file: D={eibFile.D}, E={eibFile.E}, F={eibFile.F}";
}
catch(Exception ex)
{
@@ -459,30 +459,57 @@ private void saveStripeButton_Click(object sender, EventArgs e)
}
#endregion
#region map preview
#region map preview
private void mapProgress(int progress)
{
mapMakerProgressBar.Value = progress;
}
private void mapComplete(Bitmap bitmap)
private void mapComplete(bool success)
{
mapMakerProgressPanel.Visible = false;
if (bitmap == null)
if (!success)
{
if (string.IsNullOrEmpty(mapMaker.Error)) return;
MessageBox.Show("Error: " + mapMaker.Error, "Failed to generate preview!", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
mapPictureBox.Image = bitmap;
updateMapPreview();
}
private void updateMapPreview()
{
if (mapCollisionsCheckbox.Checked || entitiesCheckbox.Checked || mapGridCheckbox.Checked)
{
int w = mapMaker.TilesBitmap.Width;
int h = mapMaker.TilesBitmap.Height;
var bmp = new Bitmap(w, h);
using (var gfx = Graphics.FromImage(bmp))
{
gfx.DrawImage(mapMaker.TilesBitmap, 0, 0, w, h);
if (mapCollisionsCheckbox.Checked) gfx.DrawImage(mapMaker.CollisionsBitmap, 0, 0, w, h);
if (entitiesCheckbox.Checked) gfx.DrawImage(mapMaker.EntitiesBitmap, 0, 0, w, h);
if (mapGridCheckbox.Checked) gfx.DrawImage(mapMaker.GridBitmap, 0, 0, w, h);
}
mapPictureBox.Image = bmp;
}
else mapPictureBox.Image = mapMaker.TilesBitmap;
mapDetailsLabel.Text = $"Size: {mapMaker.Map.Width}x{mapMaker.Map.Height}";
mapMaker = null;
GC.Collect(); // removes unused bitmaps from memory
}
#endregion
#region music
private void mapCheckbox_CheckedChanged(object sender, EventArgs e)
{
updateMapPreview();
}
#endregion
#region music
private void tfmxPlayButton_Click(object sender, EventArgs e)
{
playSelectedTFM();
@@ -504,7 +531,7 @@ private void playSelectedTFM()
}
#endregion
#region tiles preview
#region tiles preview
private void tilesCollisionsCheckbox_CheckedChanged(object sender, EventArgs e)
{
tilesPictureBox.Image = tilemapMaker.MakeTilesetBitmap(selectedItem.Entry, tilesCollisionsCheckbox.Checked);
@@ -516,8 +543,9 @@ private void saveTilesetButton_Click(object sender, EventArgs e)
if (saveImageDialog.ShowDialog() != DialogResult.OK) return;
tilesPictureBox.Image.Save(saveImageDialog.FileName);
}
#endregion
#endregion
}
}
@@ -62,6 +62,7 @@
<Compile Include="Formats\PCMFile.cs" />
<Compile Include="Formats\PCXFile.cs" />
<Compile Include="Formats\PICConverter.cs" />
<Compile Include="Turrican\CollisionDrawer.cs" />
<Compile Include="Turrican\EntityDrawer.cs" />
<Compile Include="Turrican\SpritesheetMaker.cs" />
<Compile Include="Turrican\TilemapMaker.cs" />
Oops, something went wrong.

0 comments on commit 13037ef

Please sign in to comment.