Skip to content

Commit cb67bee

Browse files
committed
Synchronising branches
2 parents 97c359c + d3a1f12 commit cb67bee

4 files changed

Lines changed: 26 additions & 52 deletions

File tree

ZXBStudio/DocumentEditors/ZXGraphics/SpriteEditor.axaml

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -9,45 +9,7 @@
99
Focusable="True"
1010
Background="#ff202020"
1111
x:Class="ZXBasicStudio.DocumentEditors.ZXGraphics.SpriteEditor">
12-
<UserControl.Styles>
13-
<Style Selector="Button.toolbar_r90">
14-
<Setter Property="Background" Value="#fff0f0f0" />
15-
<Setter Property="Width" Value="32" />
16-
<Setter Property="Height" Value="32" />
17-
<Setter Property="Padding" Value="4" />
18-
<Setter Property="CornerRadius" Value="4" />
19-
<Setter Property="RenderTransform">
20-
<Setter.Value>
21-
<RotateTransform Angle="90"/>
22-
</Setter.Value>
23-
</Setter>
24-
</Style>
25-
<Style Selector="Button.toolbar_r270">
26-
<Setter Property="Background" Value="#fff0f0f0" />
27-
<Setter Property="Width" Value="32" />
28-
<Setter Property="Height" Value="32" />
29-
<Setter Property="Padding" Value="4" />
30-
<Setter Property="CornerRadius" Value="4" />
31-
<Setter Property="RenderTransform">
32-
<Setter.Value>
33-
<RotateTransform Angle="270"/>
34-
</Setter.Value>
35-
</Setter>
36-
</Style>
37-
<Style Selector="Button.toolbar_hMirror">
38-
<Setter Property="Background" Value="#fff0f0f0" />
39-
<Setter Property="Width" Value="32" />
40-
<Setter Property="Height" Value="32" />
41-
<Setter Property="Padding" Value="4" />
42-
<Setter Property="CornerRadius" Value="4" />
43-
<Setter Property="RenderTransform">
44-
<Setter.Value>
45-
<ScaleTransform ScaleX="-1"/>
46-
</Setter.Value>
47-
</Setter>
48-
</Style>
49-
</UserControl.Styles>
50-
12+
5113
<Grid Name="grdMain" RowDefinitions="*,Auto">
5214
<Grid Name="grdEditor" Grid.RowSpan="2" ColumnDefinitions="180,4,*,4,200" Margin="0,8,0,0">
5315

ZXBStudio/DocumentEditors/ZXGraphics/SpritePatternEditor.axaml.cs

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
using System.Runtime.InteropServices;
1313
using System.Xml.Schema;
1414
using ZXBasicStudio.Common;
15+
using ZXBasicStudio.DocumentEditors.ZXGraphics.log;
1516
using ZXBasicStudio.DocumentEditors.ZXGraphics.neg;
1617
using ZXBasicStudio.Extensions;
1718

@@ -430,7 +431,14 @@ public async void Paste()
430431

431432
if (cbPatterns.Length == 1)
432433
{
433-
SpriteData.Patterns[SpriteData.CurrentFrame].Data = cbPatterns[0].Data;
434+
if (cbPatterns[0].RawData == null)
435+
{
436+
SpriteData.Patterns[SpriteData.CurrentFrame].RawData = ServiceLayer.PointData2RawData(cbPatterns[0].Data, 8, 8);
437+
}
438+
else
439+
{
440+
SpriteData.Patterns[SpriteData.CurrentFrame].RawData = cbPatterns[0].RawData;
441+
}
434442
}
435443
else
436444
{
@@ -443,19 +451,24 @@ public async void Paste()
443451
// Paste from PointData
444452
int ox = 0;
445453
int oy = 0;
454+
int dir = 0;
446455
for (int n = 0; n < cbPatterns.Length; n++)
447456
{
457+
//int d1 = (n / SpriteData.Width);
458+
//int d2 = (d1 * SpriteData.Width) - n;
448459
for (int py = 0; py < 8; py++)
449460
{
450461
for (int px = 0; px < 8; px++)
451462
{
452463
var po = cbPatterns[n].Data.FirstOrDefault(d => d.X == px && d.Y == py);
453464
if (po != null)
454465
{
455-
var pd = pat2.Data.FirstOrDefault(d => d.X == px + ox && d.Y == py + oy);
456-
if (pd != null)
466+
dir = ((oy+py) * SpriteData.Width) + (ox+px);
467+
468+
if (dir < pattern.RawData.Length)
457469
{
458-
pd.ColorIndex = po.ColorIndex;
470+
SpriteData.Patterns[SpriteData.CurrentFrame].RawData[dir] = po.ColorIndex;
471+
//pattern.RawData[dir] = po.ColorIndex;
459472
}
460473
}
461474
}
@@ -467,7 +480,7 @@ public async void Paste()
467480
oy += 8;
468481
}
469482
}
470-
SpriteData.Patterns[SpriteData.CurrentFrame].Data = pat2.Data;
483+
//SpriteData.Patterns[SpriteData.CurrentFrame].Data = pat2.Data;
471484
}
472485
else
473486
{

ZXBStudio/Emulator/Controls/ZXEmulator.axaml.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
using CoreSpectrum.Interfaces;
1717
using CoreSpectrum.Renderers;
1818
using CoreSpectrum.SupportClasses;
19-
using Fizzler;
2019
using Konamiman.Z80dotNet;
2120
using Newtonsoft.Json.Linq;
2221
using System;

ZXBStudio/ZXBasicStudio.csproj

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -517,14 +517,14 @@
517517
</ItemGroup>
518518

519519
<ItemGroup>
520-
<PackageReference Include="Avalonia" Version="11.0.0" />
521-
<PackageReference Include="Avalonia.AvaloniaEdit" Version="11.0.0" />
522-
<PackageReference Include="Avalonia.Desktop" Version="11.0.0" />
523-
<PackageReference Include="Avalonia.Svg.Skia" Version="11.0.0" />
524-
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.0.0" />
520+
<PackageReference Include="Avalonia" Version="11.0.6" />
521+
<PackageReference Include="Avalonia.AvaloniaEdit" Version="11.0.5" />
522+
<PackageReference Include="Avalonia.Desktop" Version="11.0.6" />
523+
<PackageReference Include="Avalonia.Svg.Skia" Version="11.0.0.9" />
524+
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.0.6" />
525525
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
526-
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.0" />
527-
<PackageReference Include="Avalonia.Themes.Simple" Version="11.0.0" />
526+
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.6" />
527+
<PackageReference Include="Avalonia.Themes.Simple" Version="11.0.6" />
528528
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.1" />
529529
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
530530
<PackageReference Include="System.Resources.ResourceManager" Version="4.3.0" />

0 commit comments

Comments
 (0)