Commit Graph

659 Commits

Author SHA1 Message Date
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
Jonas Kulla 3da785b293 FileSystem: RGSS2 means ogg vorbis support is always available 2014-08-30 12:00:56 +02:00
Jonas Kulla 2ba9f6589b Merge pull request #57 from cremno/mri-use-rb_type_p-instead-of-rb_type
MRI: use RB_TYPE_P() instead of rb_type()
2014-08-30 03:56:37 +02:00
Jonas Kulla f7d7b16eaf Merge pull request #58 from cremno/mri-use-rb_data_type_t
MRI: use rb_data_type_t and initialize in definition
2014-08-29 22:17:25 +02:00
Jonas Kulla 3cdbf2b035 Merge pull request #59 from cremno/mri-add-global-function-rgss_stop
MRI: add global function rgss_stop
2014-08-29 22:15:31 +02:00
cremno 173ee07959 get rid of INIT_TYPE() / initType()
A function to initialize rb_data_type_t variables is not needed.

Also fix a FIXME (WindowVX's name is now "Window") on the way.
2014-08-29 21:01:53 +02:00
cremno 4920931d33 add global function rgss_stop
It's only useful for testing code. Also RGSS3's rgss_stop (and rgss_main)
is written in Ruby and not in C++. But I doubt someone relies on that.
2014-08-29 14:32:43 +02:00
cremno 0203e28436 use rb_data_type_t instead rb_data_type_struct
For some reason the struct tag and typedef name differ and
nobody uses rb_data_type_struct.
2014-08-29 14:13:40 +02:00
cremno 70c40fe530 MRI: use RB_TYPE_P() instead of rb_type()
Just a very small optimization.
2014-08-29 13:11:39 +02:00
Jonas Kulla 6d414c0777 Print RGSS version on startup 2014-08-29 03:16:12 +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 b1981055e1 Core: Remove ifdefs that don't influence RGSS specific behavior
This is the first step in eliminating the build time RGSS
versioning.
2014-08-28 19:43:13 +02:00
Jonas Kulla 28421a0ce5 Tilemap: Remove RGSS2 viewport setter
This class is not used in RGSS2 at all.
2014-08-28 15:37:04 +02:00
Jonas Kulla c88b4b03d6 Bitmap: Fix blitshader draw_text path not taking squeezing into account 2014-08-28 14:53:28 +02:00
Jonas Kulla 20081cb07e Wrap include in feature macro 2014-08-28 11:27:36 +02:00