Skip to content

Commit 8a942d2

Browse files
committed
add more wallobject flags, comment some old code out, fix some csproj settings
1 parent 4a610e2 commit 8a942d2

File tree

4 files changed

+58
-29
lines changed

4 files changed

+58
-29
lines changed

Core/Objects/WallObject.cs

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System.ComponentModel;
1+
using System.ComponentModel;
22
using OpenLoco.ObjectEditor.Data;
33
using OpenLoco.ObjectEditor.DatFileParsing;
44

@@ -9,13 +9,25 @@ public enum WallObjectFlags : uint8_t
99
{
1010
None = 0,
1111
HasPrimaryColour = 1 << 0,
12-
unk1 = 1 << 1,
12+
HasGlass = 1 << 1, // unused? only for rct2?
1313
OnlyOnLevelLand = 1 << 2,
14-
unk3 = 1 << 3,
15-
unk4 = 1 << 4,
16-
unk5 = 1 << 5,
14+
DoubleSided = 1 << 3, // unused? only for rct2?
15+
Door = 1 << 4, // unused? only for rct2?
16+
LongDoorAnimation = 1 << 5, // unused? only for rct2?
1717
HasSecondaryColour = 1 << 6,
18-
HasTertiaryColour = 1 << 7,
18+
HasTertiaryColour = 1 << 7, // unused? only for rct2?
19+
};
20+
21+
// this is copied from OpenRCT2: https://github.com/OpenRCT2/OpenRCT2/blob/develop/src/openrct2/object/WallSceneryEntry.h
22+
[Flags]
23+
public enum WallObjectFlags2 : uint8_t
24+
{
25+
None = 0,
26+
NoSelectPrimaryColour = 1 << 0,
27+
DoorSoundMask = 1 << 1, // unused? only for rct2?
28+
DoorSoundShift = 1 << 2, // unused? only for rct2?
29+
IsOpaque = 1 << 3, // unused? only for rct2?
30+
Animated = 1 << 4, // unused? only for rct2?
1931
};
2032

2133
[TypeConverter(typeof(ExpandableObjectConverter))]
@@ -25,9 +37,9 @@ public enum WallObjectFlags : uint8_t
2537
public record WallObject(
2638
[property: LocoStructOffset(0x00), LocoString, Browsable(false)] string_id Name,
2739
[property: LocoStructOffset(0x02), Browsable(false)] image_id Image,
28-
[property: LocoStructOffset(0x06), LocoPropertyMaybeUnused] uint8_t var_06,
40+
[property: LocoStructOffset(0x06), LocoPropertyMaybeUnused] uint8_t ToolId,
2941
[property: LocoStructOffset(0x07)] WallObjectFlags Flags,
3042
[property: LocoStructOffset(0x08)] uint8_t Height,
31-
[property: LocoStructOffset(0x09), LocoPropertyMaybeUnused] uint8_t var_09
43+
[property: LocoStructOffset(0x09), LocoPropertyMaybeUnused] WallObjectFlags2 Flags2
3244
) : ILocoStruct;
3345
}

Gui/Gui.csproj

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@
88
<ImplicitUsings>enable</ImplicitUsings>
99
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
1010
<ApplicationIcon>..\loco_icon.ico</ApplicationIcon>
11+
<StartupObject>OpenLoco.ObjectEditor.Gui.Program</StartupObject>
12+
<PackageReadmeFile>README.md</PackageReadmeFile>
13+
<RepositoryUrl>https://github.com/OpenLoco/OpenLocoObjectEditor</RepositoryUrl>
14+
<AssemblyVersion>1.0.0</AssemblyVersion>
15+
<FileVersion>1.0.0</FileVersion>
16+
<AssemblyName>ObjectEditor</AssemblyName>
17+
<Authors>LeftofZen</Authors>
18+
<Product>$(AssemblyName) $(AssemblyVersion)</Product>
1119
</PropertyGroup>
1220

1321
<ItemGroup>
@@ -16,13 +24,20 @@
1624

1725
<ItemGroup>
1826
<EmbeddedResource Include="..\palette.png">
19-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
27+
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
2028
</EmbeddedResource>
2129
<EmbeddedResource Include="..\version.txt">
22-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
30+
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
2331
</EmbeddedResource>
2432
</ItemGroup>
2533

34+
<ItemGroup>
35+
<None Include="..\README.md">
36+
<Pack>True</Pack>
37+
<PackagePath>\</PackagePath>
38+
</None>
39+
</ItemGroup>
40+
2641
<ItemGroup>
2742
<PackageReference Include="NAudio" Version="2.2.1" />
2843
</ItemGroup>

Gui/PaletteHelpers.cs

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System.Drawing.Imaging;
1+
using System.Drawing.Imaging;
22

33
namespace OpenLoco.ObjectEditor.Gui
44
{
@@ -21,26 +21,26 @@ public static Color[] PaletteFromBitmap(Bitmap img)
2121
return palette;
2222
}
2323

24-
public static byte[] Palettise(Bitmap img)
25-
{
26-
var pixels = img.Width * img.Height;
27-
var bytes = new byte[pixels];
24+
//public static byte[] Palettise(Bitmap img)
25+
//{
26+
// var pixels = img.Width * img.Height;
27+
// var bytes = new byte[pixels];
2828

29-
var rect = new Rectangle(0, 0, img.Width, img.Height);
30-
var imgData = img.LockBits(rect, ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb);
29+
// var rect = new Rectangle(0, 0, img.Width, img.Height);
30+
// var imgData = img.LockBits(rect, ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb);
3131

32-
for (var y = 0; y < img.Height; ++y)
33-
{
34-
for (var x = 0; x < img.Width; ++x)
35-
{
36-
var paletteIndex = (y * img.Width) + x;
37-
bytes[paletteIndex] = ColorToPaletteIndex(ImageHelpers.GetPixel(imgData, x, y));
38-
}
39-
}
32+
// for (var y = 0; y < img.Height; ++y)
33+
// {
34+
// for (var x = 0; x < img.Width; ++x)
35+
// {
36+
// var paletteIndex = (y * img.Width) + x;
37+
// bytes[paletteIndex] = ColorToPaletteIndex(ImageHelpers.GetPixel(imgData, x, y));
38+
// }
39+
// }
4040

41-
return bytes;
42-
}
41+
// return bytes;
42+
//}
4343

44-
static byte ColorToPaletteIndex(Color c) => 0;
44+
//static byte ColorToPaletteIndex(Color c) => 0;
4545
}
46-
}
46+
}

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,6 @@ A modern implementation of 'LocoTool' for Locomotion `dat` file parsing and edit
7474
- Dark modern
7575
- Cross-platform support
7676
- Full unit-testing suite
77+
- Blank template objects for object creation from scratch
78+
- Use a proper C# image library for image creation instead of WinForms
7779
- ...many more things

0 commit comments

Comments
 (0)