Out of curiosity though, what was the quirky bug?
A new feature in my Sphere version: CreateColor(copy);
var copy = BlendColors(color, color);
var col1 = CreateColor(255, 0, 0);var col2 = CreateColor(255, 255, 255);for (var i in col1) col2[i] = col1[i];image.blitMask(0, 0, col2); // will be red.
What's your procedure for writing tests, just visiting the API list (either in doc_functions or the wiki page) and going down the list or do you concentrate on specific areas at a time like "all Image API" then "all Surface API" then "all Sound API" etc?
engine.SetGlobalFunction("GradientTriangle", new Action<double, double, double, double, double, double, ColorInstance, ColorInstance, ColorInstance>(GlobalPrimitives.GradientTriangle));
I just tested this, you can do this:Code: (javascript) [Select]var col1 = CreateColor(255, 0, 0);var col2 = CreateColor(255, 255, 255);for (var i in col1) col2[i] = col1[i];image.blitMask(0, 0, col2); // will be red.
I just got basic input in. I thought it would be a nightmare to try and cover all of the key constants, but I was able to make a mapping between SFML's keyboard constants and the KEY_* fields. However, they may not be the same as Sphere 1.5. Therefore if you have a saved game that saved your key mappings from Sphere 1.5 they'll change if you switch over to sphere-sfml! I'll have to individually remap each key... to fix that.
I did figure out a better way, though. I can just loop from 32 to 130 (100? Something like that?), bind the variable as the number, and then call SDL_ScanCodeToKeyCode (or maybe it was KeyCodeToScanCode? Either way it changed in SDL 2) and then call the SDL Key Name function on that number. I'll certainly get a bunch of garbage values in there, but I'd also get all the codes needed. And it would be prettier code, easier to write, simpler in general, and better to maintain.
// Purpose: Tests the speed and efficiency of images.function TestWindows(){ var done = false; var wind = LoadWindowStyle("main.rws"); var wind2 = wind.clone(); var blue = CreateColor(0, 0, 255); var white = CreateColor(255, 255, 255); var time = 0, i = 1, x = 0, y = 0; while (!done) { wind.drawWindow(32, 32, 80, 80); wind.setColorMask(blue); wind.drawWindow(128, 32, 80, 80); wind2.drawWindow(32, 128, 80 + x, 80 + y); wind.setColorMask(white); if (time + 25 < GetTime()) { if (x == 100 || x == -4) i *= -1; x += 4 * i; y += i; time = GetTime(); } FlipScreen(); while (AreKeysLeft()) { if (GetKey() == KEY_ENTER) done = true; } }}