Chik3r
Chik3r
CC#
Created by Chik3r on 4/18/2024 in #help
Waiting until struct is modified from another thread
my simple attempt at parallelizing floyd dither
13 replies
CC#
Created by Chik3r on 4/18/2024 in #help
Waiting until struct is modified from another thread
its only a tiny wait
13 replies
CC#
Created by Chik3r on 4/18/2024 in #help
Waiting until struct is modified from another thread
ty for the help
13 replies
CC#
Created by Chik3r on 4/18/2024 in #help
Waiting until struct is modified from another thread
this works
13 replies
CC#
Created by Chik3r on 4/18/2024 in #help
Waiting until struct is modified from another thread
idk why i didnt just use an array
13 replies
CC#
Created by Chik3r on 4/18/2024 in #help
Waiting until struct is modified from another thread
because i was using unsafe stuff and got stuck thinking about pointers
13 replies
CC#
Created by Chik3r on 9/7/2023 in #help
✅ Output TaskParameter is unrecognized
I decided to just pass the @(_ResolvedProjectReferencePaths) to a custom task and then do the filtering I need there
10 replies
CC#
Created by Chik3r on 9/7/2023 in #help
✅ Output TaskParameter is unrecognized
Bump
10 replies
CC#
Created by Chik3r on 9/7/2023 in #help
✅ Output TaskParameter is unrecognized
10 replies
CC#
Created by Chik3r on 9/7/2023 in #help
✅ Output TaskParameter is unrecognized
it's probably not the best or correct way to do what I want I have a list of items with a ProjectPath metadata (that then gets converted to a ProjectReference), and I want to filter _ResolvedProjectReferencePaths to only those that exist in my list (so that I can then get the referenced projects' compiled dll file) I found this (https://stackoverflow.com/questions/42403046/msbuild-itemgroup-intersection) and this (https://learn.microsoft.com/en-us/archive/blogs/msbuild/batching-brainteaser-explained) to get the intersecting items, but I have the issue with CreateItem
10 replies
CC#
Created by Chik3r on 8/21/2023 in #help
Custom MSBuild task fails to load `System.Runtime`
Solved my issue My build task is ProjectReferenced by a net6.0 project that copies references to a custom folder, and it then passes a .targets file to other projects for them to use the build task. Since the custom task was using <PackageReference Include="SixLabors.ImageSharp" />, the reference was passed along to the net6.0 project which instead of using the netstandard2.0 version of ImageSharp used the netcoreapp3.1 version of ImageSharp. That version was then copied next to the BuildTools.dll file so that the references to ImageSharp were resolved. As it was the netcoreapp3.1 version, it failed when building from VS (since it uses net framework), so it threw the system.runtime error. I fixed this by adding PrivateAssets="all" to the ImageSharp PackageReference (in the custom build tool project), adding a <PackageReference Include="SixLabors.ImageSharp" Version="2.1.5" GeneratePathProperty="true" PrivateAssets="all" ExcludeAssets="all" /> just to get the path to the dll of imagesharp, and then adding a copy task to copy the netstandard2.0 dll next to the BuildTools.dll (<Copy SourceFiles="$(PkgSixLabors_ImageSharp)\lib\netstandard2.0\SixLabors.ImageSharp.dll" DestinationFolder="$(_ActualOutputDirectory)/Libraries/tModLoader.BuildTools/1.0.0/" SkipUnchangedFiles="True" />)
10 replies
CC#
Created by Chik3r on 8/21/2023 in #help
Custom MSBuild task fails to load `System.Runtime`
10 replies
CC#
Created by Chik3r on 8/21/2023 in #help
Custom MSBuild task fails to load `System.Runtime`
but when I tried using the net6.0 version it threw an error
10 replies
CC#
Created by Chik3r on 8/21/2023 in #help
Custom MSBuild task fails to load `System.Runtime`
i might be wrong though
10 replies
CC#
Created by Chik3r on 8/21/2023 in #help
Custom MSBuild task fails to load `System.Runtime`
when using custom msbuild tasks
10 replies
CC#
Created by Chik3r on 8/21/2023 in #help
Custom MSBuild task fails to load `System.Runtime`
How can I stop this exception from happening when building from Visual Studio?
10 replies
CC#
Created by Chik3r on 8/21/2023 in #help
Custom MSBuild task fails to load `System.Runtime`
10 replies
CC#
Created by Chik3r on 8/21/2023 in #help
Custom MSBuild task fails to load `System.Runtime`
Here's the method's code:
public static void ToRaw(Stream src, Stream dst) {
using Image<Rgba32> image = Image.Load<Rgba32>(src);

using BinaryWriter writer = new(dst);
writer.Write(Version);
writer.Write(image.Width);
writer.Write(image.Height);

for (int y = 0; y < image.Height; y++) {
for (int x = 0; x < image.Width; x++) {
Rgba32 color = image[x, y];

if (color.A == 0) color = new Rgba32(0, 0, 0, 0);
dst.WriteByte(color.R);
dst.WriteByte(color.G);
dst.WriteByte(color.B);
dst.WriteByte(color.A);
}
}
}
public static void ToRaw(Stream src, Stream dst) {
using Image<Rgba32> image = Image.Load<Rgba32>(src);

using BinaryWriter writer = new(dst);
writer.Write(Version);
writer.Write(image.Width);
writer.Write(image.Height);

for (int y = 0; y < image.Height; y++) {
for (int x = 0; x < image.Width; x++) {
Rgba32 color = image[x, y];

if (color.A == 0) color = new Rgba32(0, 0, 0, 0);
dst.WriteByte(color.R);
dst.WriteByte(color.G);
dst.WriteByte(color.B);
dst.WriteByte(color.A);
}
}
}
10 replies
CC#
Created by Chik3r on 8/5/2023 in #help
❔ How to serialize certain null values with System.Text.Json
Always and Never wouldnt work since I only want to write it in some conditions (Text matches x value or some other condition) WhenWritingDefault would ignore all null values and WhenWritingNull wouldnt let me write null
5 replies
CC#
Created by Chik3r on 7/5/2023 in #help
✅ Serializing XML with diacritics/accents
Thanks for the help
21 replies