public static void Blit(LogicIntArray2 s, int sX, int sY, int width, int height, LogicIntArray2 d, int dX, int dY) { Debugger.doAssert(d != null, "blit Destination null"); Debugger.doAssert(s != null, "blit Source null"); switch (GetBlitMethod()) { case BlitMethod.Add: { for (int y = 0; y < height; ++y) { for (int x = 0; x < width; ++x) { int value = s.Get(sX + x, sY + y) + d.Get(dX + x, dY + y); d.Set(dX + x, dY + y, value); } } } break; case BlitMethod.Multiply: { for (int y = 0; y < height; ++y) { for (int x = 0; x < width; ++x) { int value = s.Get(sX + x, sY + y) * d.Get(dX + x, dY + y); d.Set(dX + x, dY + y, value); } } } break; case BlitMethod.Replace: default: { for (int y = 0; y < height; ++y) { for (int x = 0; x < width; ++x) { int value = s.Get(sX + x, sY + y); d.Set(dX + x, dY + y, value); } } } break; } }
public static void FillRect(int width, int height, int value, LogicIntArray2 d, int dX, int dY) { for (int y = 0; y < height; ++y) { for (int x = 0; x < width; ++x) { d.Set(dX + x, dY + y, value); } } }