Commit Graph

823 Commits

Author SHA1 Message Date
Jonas Kulla 4a015c6397 Bitmap: Add font shadow rendering 2014-09-29 10:30:41 +02:00
Jonas Kulla 9e64dff01c Bitmap: Fix mem leak 2014-09-29 10:30:16 +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 3a2e560139 Input: Fix default keybinds 2014-09-26 06:25:47 +02:00
Jonas Kulla 2550fd8ccc WindowVX: Initialize all dirty flags and connect tmp tone 2014-09-26 06:24:43 +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 3983fe66e9 Config: Print parsing errors instead of ignoring them 2014-09-23 19:23:11 +02:00
Jonas Kulla 17efcbbbbd tl;dr: I fucking suck at coding (fix double free)
MRI: Filesystem: A garbage collected SDL_RWops file handle
will call close on itself even if 'close' was explicitly
called on it on the script side before.
2014-09-23 17:26:30 +02:00
Jonas Kulla 8d67b7c91d MRI: Init default font names to correct value (RGSS2) 2014-09-23 12:05:28 +02:00
Jonas Kulla 5c3c73ee94 README: Remove erroneous line about cmake 2014-09-15 09:42:09 +02:00
Jonas Kulla 3a29385df0 MRI: load_data: Catch exceptions and pass onto ruby 2014-09-13 07:26:42 +02:00
Jonas Kulla 05041fdb03 Couple fixes to last SDL_sound patch 2014-09-13 07:26:42 +02:00
Jonas Kulla 61b77c2027 Merge pull request #69 from cremno/check-ruby-string-for-embedded-null-bytes
MRI: check Ruby strings for embedded null bytes
2014-09-12 23:30:07 +02:00
Jonas Kulla f49cd4391a Merge pull request #68 from cremno/vxtilemap-has-9-bitmaps
VX tilemap has 9 bitmaps
2014-09-12 23:13:08 +02:00
cremno 6abc207f1e VX tilemap has 9 bitmaps 2014-09-12 15:21:20 +02:00
cremno 29dfda0011 check Ruby strings for embedded null bytes
The RGSS doesn't do it. But doing it shouldn't be a problem, as it's the
correct way. If a game is broken by this commit (unlikely), then the game
needs to be fixed as silent truncation is highly unlikely to be wanted.
2014-09-12 15:20:12 +02:00
Jonas Kulla a365a7a754 Spacing 2014-09-12 06:42:18 +02:00
Jonas Kulla 0c318ee0b2 SDL_sound: Add wave IMA ADPCM (4bit) support patch 2014-09-12 06:39:49 +02:00
Jonas Kulla 757a1d5e39 Load fluidsynth entrypoints dynamically (and make them optional)
This removes the static dependency on fluidsynth being present
at buildtime (even headers aren't needed anymore).

Even though midi is a default format for the RPG XP/VX series,
it has fallen more and more out of use, with VX Ace completely
abandoning it from the RTP and making ogg vorbis the de facto
standard. Midi support is kept for legacy reasons, but isn't
encouraged. On top of all this, fluidsynth together with glib
is a heavy dependency that often times won't even be used.
Making it optional at build time is an attempt to unify and
keep build config fragmentation low.

In RGSS3, fluidsynth / midi is not initialized at all by
default, but rather on demand when either a midi track is
played back or Audio.setup_midi is called.
2014-09-09 00:08:32 +02:00
Jonas Kulla 673a25f811 Bitmap: Don't use 'pixman_region_clear'
It's not included in older pixman versions.
2014-09-07 19:11:20 +02:00
Jonas Kulla ac9b98157e TilemapVX: Use SimpleShader for unanimated ground layers
Also remove some useless member variables.
2014-09-06 22:02:00 +02:00
Jonas Kulla 6bc3460294 Core, MRI: Don't expose RGSS3 functionality in 2 2014-09-06 02:01:20 +02:00
Jonas Kulla bca95adc0e MRI: WindowVX dummy contents object is always created
The check was against rgssVer >= 2, but since that's always
true if WindowVX is used, it was pointless.
2014-09-05 22:54:57 +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 7f41b9cc45 Config: Correctly setup rgssVer / screen size with customScript 2014-09-05 21:54:16 +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 f8c26fc515 Core/MRI: Fix handling of Etc/Font properties
The gist of it is that for Etc and Font props, the assignment
operator (eg. 'sprite.color=') does not take a reference of the
right hand parameter and replaces its previous one with it (this
was the old behavior). Rather, it keeps its internal property
object and copies the parameter object into it by value.
The getter is unchanged; it still returns a reference to the
internal property object.

s = Sprite.new
c = Color.new
s.color = c
p s.color == c # => true
p s.color.object_id == c.object_id # => false (true before)
c = s.color
p s.color.object_id == c.object_id # => true
2014-09-05 01:58:41 +02:00
Jonas Kulla f665d8b41c BoostSet: Add 'remove' and rename BoostHash::erase to remove
This is more consistent with Qt's method naming.
2014-09-05 01:06:08 +02:00
Jonas Kulla 10186e8dcc Input: Fix isRepeated off-by-one error and do small optim. 2014-09-03 02:35:57 +02:00
Jonas Kulla d2d86e7002 Merge pull request #66 from cremno/add-rgss2-3-input.repeat
Input: add RGSS2/3 Input.repeat?
2014-09-02 23:42:14 +02:00
Jonas Kulla 8c1cf27b7c Merge pull request #67 from cremno/add-rgss-3-0-1-etc-classes-equality-comparison
add RGSS 3.0.1 etc classes equality comparison
2014-09-02 20:09:10 +02:00
Jonas Kulla 8975255ecf Merge pull request #65 from cremno/define-case-and-hash-equality-for-etc-classes
define case and hash equality for etc classes
2014-09-02 20:02:47 +02:00
cremno fd4f7c66d1 bump RGSS_VERSION to 3.0.1 2014-09-02 19:53:09 +02:00
cremno 7acbb06fbd add RGSS 3.0.1 etc classes equality comparison
RGSS 3.0.1 finally fixed #==, #===, #eql? for Color, Tone, and Rect.
Now instances of them can be compared to other kinds of objects.
2014-09-02 19:53:05 +02:00
Jonas Kulla 48b1af1e43 Merge pull request #64 from Ancurio/show_exc_fixes
MRI: Fix exception message box script name and display script index
2014-09-02 19:48:10 +02:00
cremno a366862076 define case and hash equality for etc classes
RGSS also defines #=== and #eql? for Color, Tone, and Rect:

  Color.instance_method(:==) == Color.instance_method(:===)   # => true
  Color.instance_method(:==) == Color.instance_method(:eql?)  # => true
2014-09-02 19:18:51 +02:00
cremno 4b08eee81f add RGSS2/3 Input.repeat? 2014-09-02 19:14:05 +02:00
Jonas Kulla 3b7b8657ea MRI: Fix exception message box script name and display script index
Previously, when the script names in the backtrace were in the form
'SectionXXX'/'{XXXX}' (default RMXP behavior), this same name would
be shown in the error message box, whereas RMXP always displays the
actual script name (eg. 'Scene_Map') instead; only with
useScriptNames=true was mkxp's behavior mostly correct.
Fix this by keeping a backtrace format -> actual script name mapping
and always using the script name in the message box.
The script name and line would also be parsed wrongly if the name
contained any colons, fix this by walking the exception string
back to front instead.

Also prepend the script index to the name when useScriptNames=true;
this is invaluable when debugging projects where multiple scripts
carry the same name. The format is 'XXX:Script_Name'.
2014-09-02 17:16:14 +02:00
Jonas Kulla 7bc07301db Merge pull request #62 from cremno/mri-bitmap-fix-obj2str-conversion
fix Bitmap's object to string conversion
2014-08-31 14:06:54 +02:00
Jonas Kulla 360cf240f6 Merge pull request #61 from cremno/mri-add-rgss_version
add RGSS_VERSION (RGSS3)
2014-08-31 12:58:11 +02:00
Jonas Kulla 91209fa4bb Merge pull request #60 from cremno/mri-table-fix-conversions
fix some integer conversions in the Table class
2014-08-31 11:20:09 +02:00
cremno 53cd5e1fbc use std::max instead of ?: 2014-08-31 11:10:57 +02:00
cremno b8fc8cf9b6 fix Bitmap's object to string conversion
Calling #to_s might not return a string (it should though).
2014-08-31 09:52:04 +02:00
cremno 95c53899be add RGSS_VERSION (RGSS3)
Even though 3.0.1 is the current version, 3.0.0 is used, because mkxp doesn't
implement the changes like not raising a TypeError for 'Color.new == nil' yet.
3.0.1 (finally) returns false. Other changes don't affect mkxp (I think).

See <http://tkool.jp/support/download/rpgvxace/rpgvxace_update> (Japanese).
2014-08-31 05:46:04 +02:00
cremno acf826eb7a fix some integer conversions in the Table class
Sizes (x, y, z) are clamped to a non-negative int value.
Use NUM2INT instead of FIX2INT as the argument might not be a Fixnum.
2014-08-31 04:46:51 +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 1a98760b31 Config: Properly clamp rgssVersion to allowed range 2014-08-30 12:00:56 +02:00