Open fatcerberus opened 7 years ago
As luck would have it, #167 doesn't apply to Surface#lineSeries()
because there are no implicit transformations involved when rendering to a legacy Surface. Coordinates always match 1:1 with surface pixels, unlike with the screen which can be scaled up so that logical pixels != real screen pixels.
I implemented the surface blit functions, but ended up creating a lot of duplicate code in the process. At some point it would be good to go through vanilla.c
and refactor to remove some of the duplication. The current state of it is a breeding ground for bugs.
While CreateSpriteset()
is not a release blocker (as noted above), there are other inconsistencies between the miniSphere and Sphere 1.x implementations of spritesets that should be reconciled before a release is done. So that would be a good opportunity to get the missing function out of the way, too.
Scratch that, spritesets are going to have to stay incompatible for a bit longer, as the fix turned out to be non-trivial. See https://github.com/fatcerberus/minisphere/issues/175#issuecomment-312545124.
All blockers for 4.6.0 have been implemented; reassigning the remaining functions to v5.0.0.
With #175 now fixed, I can move forward with implementing CreateSpriteset()
.
I added stubs for the missing APIs to throw a "not implemented" error when called. Hopefully this should clear up the confusion so people stop reporting bugs for "(function name) is undefined" upon attempting to call a missing function. "Not implemented" makes it very clear what's wrong. :o)
I'd like to tackle GetMapEngine()
and MapEngine#save()
next. That means code needs to be written to save an .rmp file, but seeing as I already have code to load them (which is pretty hairy, gotta be honest :o), saving should be trivial by comparison.
I will need to consult the Sphere 1.x source to see exactly what needs to be saved, though. Obviously zones and triggers, but I'm not sure how 1.x handles persons in this case since internally they are tracked independently from the map.
The code surrounding GetMapEngine().save()
in Sphere 1.x is all over the place and doesn't seem to be very well-thought-out. Best I can tell it's also pretty buggy: Changes to tiles are saved, any zones added seem to be kept, but entity changes (new triggers or persons, e.g.) are lost in favor of just saving whatever was there when the map was loaded.
Long story short, I'm just going to wing it because the Sphere 1.x map saving logic is... odd.
The following Sphere 1.5 functions and methods are missing as of miniSphere 4.7.0 and need to be implemented for full legacy compatibility:
FilledComplex()
GetLayerAngle()
GetMapEngine()
GradientComplex()
OutlinedComplex()
Polygon()
SetLayerAngle()
SetLayerScaleFactorX()
SetLayerScaleFactorY()
MapEngine#save()