Commit Graph

76 Commits

Author SHA1 Message Date
Varun Patil 80df1ee771 Add back main update loop with framerate limit 2020-05-07 00:51:18 +05:30
Varun Patil ad9474a6e9 Save game to indexeddb 2020-05-05 23:19:00 +05:30
Varun Patil ba2e08ec55 Load rxdata async 2020-05-05 16:00:11 +05:30
Varun Patil ebe8d6f3bd Remove custom mruby eval definition 2020-05-05 14:23:25 +05:30
Varun Patil 40c1872245 Fix audio during transition 2020-05-05 10:34:57 +05:30
Varun Patil 84cecb90f2 Remove old mruby extensions 2020-05-05 03:09:12 +05:30
Varun Patil f20d7a43b1 Remove main update loop 2020-05-04 22:51:21 +05:30
Varun Patil 9b531afb0c Add sync audio for emscripten 2020-05-04 17:39:00 +05:30
Varun Patil 8c5db3a401 Make changes for Emscripten 2020-05-04 13:13:57 +05:30
ReinUsesLisp b5e5a26d8b Config: Set debug editor's debug variables into ruby 2018-02-22 09:08:45 +01:00
Jonas Kulla e4558c9dfb Use FS::openReadRaw() where ext supplementing makes no sense
Specifically, in places where the full filename is always supplied,
eg. when reading .rxdata type files.
2015-07-09 12:58:01 +02:00
Jonas Kulla 6380a93cec Graphics: Fix ::transition() "filename" default value
The default value is an empty string, which triggers the simple
transition. Passing null is not legal (and wasn't possible in
mkxp from Ruby side anyway).

Fixes #108.
2015-06-10 13:30:26 +02:00
Jonas Kulla 685f8b63b3 Input: Integer button codes are still allowed in RGSS3 2014-12-09 04:21:48 +01:00
Jonas Kulla cfd9345e87 MRuby: Update module_rpg.c to newest bytecode format 2014-11-29 14:55:43 +01:00
Jonas Kulla 5c3f4b905a Use fopen with binary mode everywhere (for Windows compat) 2014-11-17 07:18:39 +01:00
Jonas Kulla c9d5059238 Pass value object attributes by reference (instead of pointer)
This underlines that no reference inside the setter is taken,
and that these attributes are non-nullable.

Also removes a couple of superfluous attribute macros.
2014-10-25 23:33:41 +02:00
Jonas Kulla 5549ff78f0 Bindings: Viewport: Don't dispose children in RGSS2/3 2014-10-24 18:55:03 +02:00
Jonas Kulla 1a489aafaf Bindings: Fix inconsistency in Viewport dispose (RGSS1)
As noted, on Viewport dispose, RMXP always calls the core
dispose method for child objects regardless of whether
user scripts override it in sub classes.

Implement this behavior in mkxp to prevent infinite recursion.
2014-10-24 18:35:05 +02:00
Jonas Kulla 8b31f97bb4 MRuby: Fix compilation 2014-10-24 18:26:10 +02:00
Jonas Kulla 520162f36a Use safe way to get at a vector's data pointer
&std::vector<C>[0] is not guaranteed to not throw if the
vector is empty. Better safe than sorry.
2014-10-09 19:02:29 +02:00
Jonas Kulla 7b65977eb9 Silence "uninitialized" warnings 2014-10-01 06:29:47 +02:00
Jonas Kulla 9758e660c4 Tilemap/VX: Ensure proxy objects don't outlive their parents
Either of these would previously crash (same for VX):

tm = Tilemap.new
at = tm.autotiles
tm = nil
GC.start
at[0] = Bitmap.new(1, 1)

tm = Tilemap.new
at = tm.autotiles
tm.dispose
at[0] = Bitmap.new(1, 1)

Funnily, this makes RMXP itself crash too, but crashing is
never acceptable except for possibly resource exhaustion.
2014-09-26 18:21:50 +02:00
Jonas Kulla e9d0d0566b RGSSError is a subclass of StandardError 2014-09-26 18:20:27 +02:00
Jonas Kulla d223d83cbf Implement F12 game reset (MRI only)
Can be disabled with "enableReset=false".

While at it, also replace the flakey volatile bool flags
with proper atomics.
2014-09-26 06:25:47 +02: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 9461449cc9 MRuby: Fix handling of Etc/Font properties
Port of f8c26fc515.
2014-09-05 22:53:19 +02:00
Jonas Kulla 4d54fce8ee Small compilation fix (mruby is still broken though) 2014-09-05 01:59:01 +02:00
Jonas Kulla 0131ed09f0 Bindings: Remove 'wrapNilProperty'
It's completely useless lol.
2014-09-05 01:59:01 +02:00
Jonas Kulla 55f1542c76 Merge separate RGSS version build configs into one
Setup active RGSS version at runtime. Desired version can be
specified via config, or as default, auto detected from the game
files. This removes the need to build specifically for each
version, which should help packaging a lot.

This also greatly reduces the danger of introducing code that
wouldn't compile on all RGSS version paths (as certain code paths
were completely ifdef'd out).

This can be optimized more, eg. not compiling shaders that aren't
needed in the active version.
2014-08-28 23:22:05 +02:00
Jonas Kulla 3887342439 Disposable: Emit 'wasDisposed' on destruction, not dispose()
Fixes segfaults when objects that were not explicitly disposed
were collected by the GC.
2014-08-16 11:47:07 +02:00
Jonas Kulla 3b35fb219c MRuby-Binding: Bind #initialize_copy for clonable classes
Port of b7a2ba830c.
2014-08-09 21:24:50 +02:00
Jonas Kulla 1cc1541377 MRuby-Binding: Input constants are symbols in RGSS3
Port of 88bb92aadc.
2014-08-09 21:23:26 +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 cc0ab35f10 Font: 'exist?' allows any object (returns false if not string) 2014-08-09 21:21:38 +02:00
Jonas Kulla 0ab543fd75 MRuby-Binding: Reduce number of object allocations
This is the same change as f067e0eff8,
applied to the mruby backend.
2014-08-09 21:21:38 +02:00
Jonas Kulla 88bb92aadc MRI-Binding: Input constants are symbols in RGSS3 2014-08-09 21:21:15 +02:00
Jonas Kulla e341dca579 Squash more "may be uninitialized" warnings 2014-07-23 17:28:03 +02:00
Jonas Kulla a310318c65 MRuby-Binding: Account for 'char' not being signed everywhere 2014-07-19 11:13:11 +00:00
Jonas Kulla 83ceed5592 'fgetc()' returns int 2014-07-19 11:11:27 +00:00
Jonas Kulla a56d446664 More size_t fixes 2014-07-19 09:57:41 +02:00
Jonas Kulla 48db6fbeda Binding-MRuby: Make stuff work with latest mruby git 2014-07-19 02:22:22 +02:00
Jonas Kulla ccba946973 util.h: Use size_t for static array sizes 2014-07-19 00:52:00 +02:00
Jonas Kulla a17043f785 MRI-Binding: Bitmap#get_pixel always returns a Color object 2014-07-16 17:39:39 +02:00
Jonas Kulla 80b2768e73 Fix "unused variable" warning 2014-05-03 04:05:11 +02:00
Jonas Kulla 58d86039d5 Merge branch 'dev' 2014-04-17 08:19:24 +02:00
Jonas Kulla 711060db8f Spacing / minor fixes 2014-04-14 09:39:23 +02:00
Jonas Kulla af9039f58d Sprite: Implement wave effect (RGSS2)
This initial implementation emulates the way RMVX splits
the sprite into "chunks" of about 8 pixels, which it then
scrolls left/right on a vertical sine wave. It even
replicates the weird behavior when wave_amp < 0, namely
"shrinking" the src_rect horizontally.

As with bush_opacity, this effect in combination with
rotation will render differently from RMVX.
2014-02-03 15:32:50 +01:00
Jonas Kulla 64f1e32fdc Input: Implement RGSS3 functionality in bindings
Ie. using symbols instead of Input:: constants to query
button states.
2014-02-03 15:04:57 +01:00
Jonas Kulla 5a6c0c14ed MRuby-Binding: Fix etc accessors not using getter/setter functions 2014-02-03 14:07:08 +01:00
Jonas Kulla e0a4dfe372 Bitmap: Make #get_pixel/#set_pixel more accurate
This gets rid of the "batch/flush" semantics for #set_pixel
and instead just directly uploads the pixel color to the
texture, circumventing the float conversion entirely.
Also makes a lot of code simpler in many places as calling
'flush()' is no longer required for bitmaps.
2014-01-31 10:19:16 +01:00