Add layer range check on AddLight
This commit is contained in:
parent
e3aac88c17
commit
9c71529d8e
|
@ -240,9 +240,11 @@ public class WorldRep : IChunk
|
|||
return bytes;
|
||||
}
|
||||
|
||||
// TODO: This ONLY works for rgba (bpp = 4)!!!
|
||||
public void AddLight(int layer, int x, int y, float r, float g, float b)
|
||||
{
|
||||
ArgumentOutOfRangeException.ThrowIfLessThan(layer, 0, nameof(layer));
|
||||
ArgumentOutOfRangeException.ThrowIfGreaterThan(layer, Layers, nameof(layer));
|
||||
|
||||
var idx = (x + y * Width) * Bpp;
|
||||
var pLayer = Pixels[layer];
|
||||
switch (Bpp)
|
||||
|
|
Loading…
Reference in New Issue