Remove D2kFogPalette.

This commit is contained in:
Paul Chote
2023-11-14 22:25:22 +00:00
committed by Gustas
parent 46ba8ef5dd
commit ac53b89421
3 changed files with 4 additions and 59 deletions

View File

@@ -1,57 +0,0 @@
#region Copyright & License Information
/*
* Copyright (c) The OpenRA Developers and Contributors
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version. For more
* information, see COPYING.
*/
#endregion
using System.Collections.Generic;
using OpenRA.Graphics;
using OpenRA.Mods.Common.Traits;
using OpenRA.Traits;
namespace OpenRA.Mods.D2k.Traits
{
[TraitLocation(SystemActors.World | SystemActors.EditorWorld)]
sealed class D2kFogPaletteInfo : TraitInfo
{
[PaletteDefinition]
[FieldLoader.Require]
[Desc("Internal palette name")]
public readonly string Name = null;
[PaletteReference]
[FieldLoader.Require]
[Desc("The name of the shroud palette to base off.")]
public readonly string BasePalette = null;
[Desc("Allow palette modifiers to change the palette.")]
public readonly bool AllowModifiers = true;
public override object Create(ActorInitializer init) { return new D2kFogPalette(this); }
}
sealed class D2kFogPalette : ILoadsPalettes, IProvidesAssetBrowserPalettes
{
readonly D2kFogPaletteInfo info;
public D2kFogPalette(D2kFogPaletteInfo info) { this.info = info; }
public void LoadPalettes(WorldRenderer wr)
{
var basePalette = wr.Palette(info.BasePalette).Palette;
// Bit twiddling is equivalent to unpacking RGB channels, dividing them by 2, subtracting from 255, then repacking
var fog = new uint[Palette.Size];
for (var i = 0; i < Palette.Size; i++)
fog[i] = ~((basePalette[i] >> 1) & 0x007F7F7F);
wr.AddPalette(info.Name, new ImmutablePalette(fog), info.AllowModifiers);
}
public IEnumerable<string> PaletteNames { get { yield return info.Name; } }
}
}

1
mods/d2k/bits/fog.pal Normal file
View File

@@ -0,0 +1 @@
??????>>>===<<<;;;:::999888777666555333222111000///...---,,,+++***)))((('''&&&%%%$$$###"""!!! ? ;! ?! ?$#?'&?*)?,,?//?21?54?774 %7 '; )? +?#-?&/?)1?,3$ $( (, ,0 /4 37 7; ;? ?? ??"??#??%??&??(??)??+??,??.??0??1??3??4??6??7? $ ( , 0 4 7 ; ?##?&&?))?,,?//?11?44?77? (4 )7 *; ,?#.?&0?)2?,4? $$ (( ,, /0 34 77 ;; ?? ??"??#??%??&??(??)??+??,??.??0??1??3??4??6??7?? $! (# ,$ 0% 4& 7( ;) ?*#?,&?/)?1,?3/?51?74?97?: $ ( , 0 4 7 ; ? #?#&?&)?),?,/?/1?24?47?7$" %# '$ (% )& +' ,( -( /) 1+ 3, 4-!4."5.$5/%60&60(71)72*83+83,94-94.:5/:61;62;74<85<86<97=:8>;:????????????????????????::':6':1':,':'':',:'1:'69':4':.':)':'*:'0:'5:'::':4':/':)*:'/:'5:'::' 7??'.5?3)><6)3)>??& ?'?????7??7???????????5$4=%4??+7??7??7)5>(!,05?3)=$4 *5??+>??>??=?+121332:32?32?>5???=%4???

View File

@@ -35,9 +35,10 @@
Name: smoke3
Filename: DATA.R8
Frame: 3747
D2kFogPalette@fog:
PaletteFromFile@fog:
Name: fog
BasePalette: shroud
Filename: fog.pal
AllowModifiers: false
PlayerColorPalette:
BasePalette: d2k
RemapIndex: 255, 254, 253, 252, 251, 250, 249, 248, 247, 246, 245, 244, 243, 242, 241, 240