Commit Graph

17 Commits

Author SHA1 Message Date
Jonas Kulla 6e176a454c Constify 2015-07-07 16:06:45 +02:00
Jonas Kulla 87462fd7b0 Use more explicit vector math via method overloads 2015-02-10 17:04:00 +01:00
Jonas Kulla 81ac0780f8 Revert Disposable concept back into core
Pretty much a revert of
e858bbdcf5.

We need this in core to properly implement F12 reset.
2014-09-23 21:12:58 +02:00
Jonas Kulla d8bb6aa2fc Replicate RMVX/VXA's broken sprite Z sorting implementation
Fixes Window_NameBox visual appearance in Skyborn.

Also nuke the second SceneElement constructor that has been
obsolete since the Tilemap mapViewport rewrite.
2014-08-31 01:10:32 +02:00
Jonas Kulla 724d52f61e Tilemap: Finally get rid of that terrible name 'ScanRow'
Replacement: ZLayer
I'd really have loved to have used something alluding to physical
roof tiles (as that's the closest image I have to them), but without
reusing the word "tiles".. yeah, impossible.
2014-08-17 03:58:01 +02:00
Jonas Kulla e208bc49e8 Sprite: Implement Y based Z draw ordering (RGSS2)
If two sprites have the same Z, their order is decided based
on their Y coordinate first, and only then (if equal) by creation
time.
2014-08-16 16:12:51 +02:00
Jonas Kulla 91d19d0a73 Implement RGSS2 Window class (WindowVX) 2014-08-15 15:20:15 +02:00
Jonas Kulla e858bbdcf5 Lift 'Disposable' concept from core into bindings
Instead of replicating the RGSS Disposable interface in C++
and merely binding it, redefine the 'disposed' state as the
entire core object being deleted (and the binding object's
private pointer being null).

This makes the behavior more accurate in regard to RMXP.
It is now for example possible to subclass disposable classes
and access their 'dispose'/'disposed?' methods without
initializing the base class first (because the internal pointer
is simply null before initialization). Accessing any other
base methods will still raise an exception.

There are some quirks and irregular behavior in RMXP; eg.
most nullable bitmap attributes of disposable classes
(Sprite, Plane etc.) can still be queried afterwards, but
some cannot (Tilemap#tileset), and disposing certain
attributes crashes RMXP entirely (Tilemap#autotiles[n]).
mkxp tries to behave as close possible, but will be more
lenient some circumstances.

To the core, disposed bitmap attributes will look
identically to null, which slightly diverges from RMXP
(where they're treated as still existing, but aren't drawn).
The Disposable interface has been retained containing a
single signal, for the binding to inform core when
objects are disposed (so active attributes can be set to null).
2014-08-09 21:21:38 +02:00
Jonas Kulla 8dd7c1b48c Spacing/spelling 2014-05-07 17:52:11 +02:00
Edward Rudd af70e8c1ff correct ScanRow forward declares 2013-12-31 16:31:24 -05:00
Jonas Kulla f67a73cb4f Attempt at better documentation for SceneElement subclasses 2013-10-17 15:27:48 +02:00
Jonas Kulla 23e712a730 Tilemap: Draw consecutive scanrows in one draw call
If consecutive scanrows in the scene list have no foreign
elements in between them, we batch them up and draw them
in one glDrawElements() call.

This should reduce the Tilemap induced draw calls on
average by at least 50 percent.
2013-10-13 22:00:38 +02:00
Jonas Kulla 99cfe9aefd Tilemap: Optimize scanrow z ordering 2013-10-13 12:58:56 +02:00
Jonas Kulla 05f73f0b98 Ensure Elements don't unlink from an already dead Scene 2013-09-30 19:30:27 +02:00
Jonas Kulla 12c92d6dd0 Fix Tilemap's scanrow z sorting for good
Also make it a tad faster.
2013-09-27 04:42:22 +02:00
Jonas Kulla 3bd9df1191 Move draw order sorting into SceneElement 2013-09-06 13:10:41 +02:00
Jonas Kulla ff25887f41 Initial commit 2013-09-01 16:27:21 +02:00