Commit Graph

14 Commits

Author SHA1 Message Date
Jonas Kulla ef2430e0c3 Sanitize #include statements
The general rule I'm aiming for is to <> include
system wide / installed paths / generally everything
that's outside the git managed source tree (this means
mruby paths too!), and "" include everything else,
ie. local mkxp headers.

The only current exception are the mri headers, which
all have './' at their front as to not clash with
system wide ruby headers. I'm leaving them be for now
until I can come up with a better general solution.
2013-12-04 17:48:37 +01:00
Jonas Kulla cb6f73f7df Rename 'GlobalState' to 'SharedState' to avoid confusion with GLState
This was particularly nasty with the shorthand macros
'gState' and 'glState'. The former is now 'shState'.
2013-10-09 12:30:33 +02:00
Jonas Kulla 20ec560145 Wrap color clear in 'FBO::clear()' convenience function 2013-10-01 13:10:14 +02:00
Jonas Kulla f49b03ba23 Window: Always rebuild cursor_rect tex coords
If the same Window updated its control verts without a visble
cursor_rect, these tex coords will get randomly overwritten by
further control parts.
2013-09-30 19:32:45 +02:00
Jonas Kulla 2226927b08 Null deref fixes / cleanups 2013-09-28 21:48:02 +02:00
Jonas Kulla 92ab65ba52 Fix window opacity not being applied on vert (re)construction 2013-09-27 04:37:56 +02:00
Jonas Kulla e903d8cb0f One last null pointer deref slipped through ;) 2013-09-24 23:00:16 +02:00
Jonas Kulla a9454fdf9c Fix nullpointer deref 2013-09-24 22:42:10 +02:00
Jonas Kulla 10ec55e39b Implement a new tileset atlas layout to allow for bigger tilesets
The atlas packing algorithm has been reworked to pack autotiles
and tileset very efficiently into a texture, splitting the tileset
in multiple ways and eliminating the previous duplication of image
data in the atlas across "frames". Animation, which these frames
were designed for, is now done via duplicated buffer frames,
ie. each animation frame has its own VBO and IBO data. This was
not done to save on VRAM (hardly less memory is used), but to
make place for the new atlas layout.
Thanks to this new layout, even with a max texture size of 2048,
one can use tilesets with up to 15000 height. Of course, such
a tileset couldn't be stored in a regular Bitmap to begin with,
which is why I also introduced a hack called "mega surfaces":
software surfaces stored in RAM and wrapped inside a Bitmap,
whose sole purpose is to be passed to a Tilemap as tilesets.

Various other minor changes and fixes are included.
2013-09-24 19:35:38 +02:00
Jonas Kulla 9e63fb6b64 Remove the remaining bits of deprecated GL usage
The drawing is now completely shader based, which makes away
with all usage of the depracted matrix stack. This also allows
us to do things like simple translations and texture coordinate
translation directly instead of doing everything indirectly
through matrices.

Fixed vertex attributes ('vertexPointer()' etc) are also
replaced with user defined attribute arrays.
2013-09-23 07:50:22 +02:00
Jonas Kulla 6c7d751dbd Remove 'Default' FBO binding (only allow 'Read' and 'Draw')
Also make code more verbose by removing default mode
parameter value to 'FBO::bind'
2013-09-06 14:56:30 +02:00
Jonas Kulla b151a22f6e Rename 'Tex' to 'TEX' for consistency 2013-09-06 12:26:41 +02:00
Jonas Kulla 6a133cf04b Clean up unused code and documentation 2013-09-03 14:51:55 +02:00
Jonas Kulla ff25887f41 Initial commit 2013-09-01 16:27:21 +02:00