Commit graph

385 commits

Author SHA1 Message Date
Mathew Velasquez
d47a2241ee Messagebox fix 2016-12-15 05:39:51 -05:00
Vinyl Darkscratch
f8c3862c2e Accommodate for @mathewv's "smooth" implementation 2016-12-14 21:14:42 -08:00
Vinyl Darkscratch
582b750c2b Merge remote-tracking branch 'mathewv/master' 2016-12-14 21:10:23 -08:00
Vinyl Darkscratch
3224d65988 Made paths in script cross-platform friendly
An ending that made me very, VERY teary-eyed, interrupted by an access
denied error…argh, code bugs, why!  >~<  Basically, the path to “My
Games” and the name of the journal’s executable are now defined by
oneshot.cpp and loaded into the Ruby script, so the ending isn’t
interrupted.  Now all that’s left is to compile the journal!
2016-12-14 21:09:33 -08:00
Mathew Velasquez
99d0c2888a Marshal tweaks 2016-12-14 22:05:53 -05:00
Mathew Velasquez
a0ba40916d Smooth scaling Graphics option 2016-12-14 22:05:53 -05:00
Vinyl Darkscratch
0a1d9c570f Add "smooth" property to graphics module
This is just a simple bind and addition of a “smooth” property in the
graphics module, to fix fatal issue #2
2016-12-14 16:06:40 -08:00
Vinyl Darkscratch
0b7fdbf8e1 Updates for a future Mac build 2016-12-12 22:59:07 -08:00
Mathew Velasquez
aa7818847c Lots of stuff 2016-12-06 23:49:37 -05:00
Mathew Velasquez
1f35ab104f Various last-minute beta fixes 2016-11-04 05:29:22 -04:00
Mathew Velasquez
693f045ff8 More line ending fixes, ___ 2016-11-04 00:05:49 -04:00
Mathew Velasquez
6312ce865c Added active? function, fixed CRLF line endings 2016-11-04 00:04:27 -04:00
Mathew Velasquez
78c4c3b9bf Niko/Journal for windows 2016-11-03 18:37:14 -04:00
Mathew Velasquez
50d64ea060 Window shaking 2016-10-29 22:22:22 -04:00
Mathew Velasquez
99c9a27f2a Wallpaper functionality restored for windows 2016-10-13 20:26:01 -04:00
Mathew Velasquez
0dc872bcea Journal screen stuff 2016-10-13 20:26:01 -04:00
Mathew Velasquez
302ec6dd02 I stopped making commits for a good while. Here's the latest junk. 2016-09-19 13:54:38 -04:00
Jonas Kulla
0ec1fce4ac MRI: Bind Audio.setup_midi 2016-09-12 20:20:56 +02:00
Mathew Velasquez
82493cd0a0 Added footprints and src_rect to Plane class 2016-04-11 21:33:54 -04:00
Mathew Velasquez
d53ad4b124 Improved internationalization support 2016-04-06 13:45:36 -04:00
Mathew Velasquez
737f0759e7 Added cheap hack for sprite lighting occlusion 2016-03-11 02:28:26 -05:00
Mathew Velasquez
1fd808d0af Gutted more unused features 2016-02-29 15:40:10 -05:00
Mathew Velasquez
546f29f42e Preliminary i18n improvements 2016-02-29 01:41:37 -05:00
Mathew Velasquez
a4de9d9f10 integrated steamshim 2016-02-29 01:22:55 -05:00
Mathew Velasquez
21fcc9e19c Basic Steamworks API support 2016-02-17 17:16:22 -05:00
Mathew Velasquez
2df5fd29de Renamed $DEBUG to $debug to avoid verbose mode.
Also made GL debug functions print less stuff.
2016-02-17 17:14:16 -05:00
Mathew Velasquez
ba0203169e Added obscured/scratched window puzzle 2016-02-17 17:14:16 -05:00
Mathew
90cf07c825 Linked to debugMode option, gutted RTP config 2016-01-05 14:50:18 -05:00
Mathew Velasquez
5ff71744b5 Rudimentary map wrapping added 2016-01-05 14:50:18 -05:00
Mathew Velasquez
3c6cef9aeb overhauled input symbols to be more gamepad-friendly 2016-01-05 14:50:17 -05:00
Mathew Velasquez
3d2d1a9150 Manually rebased over latest mkxp commit. Some features, such as lighting, are not reimplemented yet. 2016-01-05 14:50:17 -05:00
Jonas Kulla
5d776319b5 Font/MRI: Improve handling of (default_)name attributes
More accurate behavior, such as Font objects properly inheriting
their name attributes, and centralization of code for picking
the first existing name from a passed string array.

Also centralizes initial default_name population in core.

Note: This currently breaks the mruby binding build.
2016-01-05 08:47:52 +01:00
Mook
8e411cbcfe Graphics: Stub out play_movie
Some people are using it to detect the RGSS version.
2015-10-30 08:01:36 -07:00
cremno
861d261af2 add Sprite#{bush_opacity,bush_opacity=} 2015-07-21 07:27:53 +02: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
88eca58268 Revert "check Ruby strings for embedded null bytes"
This reverts commit 29dfda0011.
It turned out to be a bad idea after all.
2015-05-11 23:13:02 +02:00
Jonas Kulla
8d7166f3d2 MRI: Fix Font.name returning nil
I wish I had tests..
2015-03-16 08:36:29 +01:00
Jonas Kulla
35077793a0 Add std::streambuf wrapper around SDL_RWops for boost
Also add SDL_RWops version of the readFile utility function.
2014-12-31 18:52:21 +01:00
Jonas Kulla
4b08d82ea4 MRI: dataDirectory: Return "." if customDataPath is not defined 2014-12-31 18:52:20 +01:00
Jonas Kulla
b39964a49a MRI: Make error handling during script load more robust 2014-12-31 18:52:20 +01:00
Jonas Kulla
685f8b63b3 Input: Integer button codes are still allowed in RGSS3 2014-12-09 04:21:48 +01:00
Jonas Kulla
33c571e691 MRI: Fix mingw build crash when linking with -mwindows 2014-11-20 13:51:35 +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
ecf9b065c8 MRI: Revise 'MKXP.data_directory' behavior
This function which was formerly a simple wrapper around
SLD_GetPrefPath() is changed to instead return the directory
assembled from org/app name specified in mkxp.conf, so one
can be sure that both mkxp and user scripts will always write
into the same directory when a custom path is preferred.
2014-10-22 04:16:15 +02:00
Jonas Kulla
af8f3a36d2 MRI: Move former 'System' module into 'MKXP' module
This breaks script compatibility.

'System' is way too generic of a name to reserve for mkxp use,
and I have already seen at least one occurance in the wild of
it being used by user scripts.

Ideally, all mkxp RGSS extensions would be moved under this
module, but I feel like the core modules (Input, Graphics etc)
are more safe as users are hesitant to directly extend these.
2014-10-22 04:15:40 +02:00
Jonas Kulla
4a8b0f30c8 MRI: Add 'System.raw_key_states' to query full keyboard state
Returns a byte array with all key states (0 = released,
1 = pressed) indexed via SDL_SCANCODE_* enums.
2014-10-20 10:27:01 +02:00
Jonas Kulla
47851718eb MRI: Handle exceptions raised in preloaded scripts 2014-10-15 06:27:43 +02:00
Jonas Kulla
7b65977eb9 Silence "uninitialized" warnings 2014-10-01 06:29:47 +02:00
Jonas Kulla
3dd703f732 MRI: Use ruby 2.0 compatible function name 2014-09-30 00:48:22 +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
8d67b7c91d MRI: Init default font names to correct value (RGSS2) 2014-09-23 12:05:28 +02:00
Jonas Kulla
3a29385df0 MRI: load_data: Catch exceptions and pass onto ruby 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
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
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
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
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
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
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
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
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
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
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
117ddeee5c Config: Add 'preloadScript' entry to run raw scripts before the game scripts
Useful to insert common code, wrappers etc. without touching Scripts.rxdata.
2014-08-24 07:32:44 +02:00
Jonas Kulla
d2fd692041 MRI: Actually define '$MKXP' 2014-08-24 07:21:26 +02:00
Jonas Kulla
dbb2249ff3 MRI: Graphics: Bind resize_screen 2014-08-24 07:20:44 +02:00
Jonas Kulla
4baf7b5a5a Spacing 2014-08-23 13:53:13 +02:00
Jonas Kulla
f76ecfdba8 MRI: WindowVX: Bind RGSS2 constructor (same as RGSS1) 2014-08-22 23:57:12 +02:00
Jonas Kulla
ee8a3ca402 MRI-Binding: Font: Add get/set_default_out_color binding 2014-08-22 23:49:18 +02:00
Jonas Kulla
d075bd255c MRI-Binding: WindowVX: Since RGSS2 'contents' has a 1x1 dummy bitmap 2014-08-17 00:27:07 +02:00
Jonas Kulla
169f9e9285 MRI-Binding: Audio: Bind RGSS3 functions 2014-08-17 00:27:07 +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
7f69786c47 MRI-Binding: TilemapVX: 'flags' is called 'passages' in RGSS2 2014-08-16 11:47:06 +02:00
Jonas Kulla
d439b1d833 MRI-Binding: Add RGSS2 RPG module 2014-08-16 11:47:06 +02:00
Jonas Kulla
9003f9a435 Font: Add missing RGSS2+ props basic plumbing (and bind most in MRI)
No core implementations yet for shadow and outline color.
2014-08-16 11:46:25 +02:00
Jonas Kulla
de8773fb5c MRI-Binding: WindowVX: Fix method name typo 2014-08-16 06:04:02 +02:00
Jonas Kulla
931755cb64 MRI-Binding: Add RGSS3 RPG module 2014-08-16 06:04:02 +02:00
Jonas Kulla
deb5696ddb MRI-Binding: Graphics: Bind 'brightness' prop (RGSS2) 2014-08-16 06:04:02 +02:00
Jonas Kulla
7a655528e4 Viewport: Add zero arg constructor (RGSS3) and bind in MRI 2014-08-16 06:03:48 +02:00
Jonas Kulla
5bc6f6f32c Etc: Implement missing RGSS3 functionality (and bind in MRI) 2014-08-15 22:58:08 +02:00
Jonas Kulla
0c5e84eb4b MRI-Binding: Bitmap: Bind missing RGSS2 methods 2014-08-15 22:51:32 +02:00
Jonas Kulla
5b319020ea MRI-Binding: Bitmap: 'draw_text' and 'text_size' should call #to_s (RGSS2) 2014-08-15 22:49:22 +02:00
Jonas Kulla
3224950a1c MRI-Binding: Add crude 'rgss_main' implementation (RGSS3)
No F12 reset yet.
2014-08-15 22:35:57 +02:00
Jonas Kulla
7790bd6c2c Implement RGSS2 Tilemap class (TilemapVX) 2014-08-15 15:20:32 +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
b7af8cc92f MRI-Binding: Typo in Flashable binding 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
88bb92aadc MRI-Binding: Input constants are symbols in RGSS3 2014-08-09 21:21:15 +02:00
Jonas Kulla
151a1f0d1b Table: Add clone constructor (and bind in MRI)
Fixes #50.
2014-08-05 05:24:13 +02:00
Jonas Kulla
e38ec7be98 Simplify earlier patch 2014-07-25 07:57:01 +02:00
Jonas Kulla
262023b088 MRI-Binding: Fix typo and don't set $LOAD_PATH (thanks @cremno)
'$:' and '$LOAD_PATH' point to the same array.
2014-07-25 00:40:36 +02:00
Jonas Kulla
ec16210f8a MRI-Binding: Allow manually specifying load paths in config 2014-07-24 23:11:12 +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
b878149f5c MRI-Binding: Properly init Bitmap in Graphics#snap_to_bitmap 2014-07-16 05:27:16 +02:00
Jonas Kulla
7ad6b7b5df MRI-Binding: Add some RGSS2 Graphics bindings 2014-07-15 12:34:58 +02:00
Jonas Kulla
a541cb1205 Some RGSS2/RGSS3 compile fixes 2014-07-13 05:34:18 +02:00
cremno
e6a116f43f use rb_funcall2 instead of rb_funcallv
In 2.1 `rb_funcall2`  was renamed to `rb_funcallv` and
a macro for backward compatibility was added.
2014-05-25 12:57:04 +02:00
Jonas Kulla
72fc659a4c MRI-Binding: Don't refine Kernel#caller in RGSS3 2014-05-07 03:19:06 +02:00
Jonas Kulla
1bdcfa7b04 MRI-Binding: Adjust 'Kernel#caller' output to match RMXP 2014-05-06 12:13:12 +02:00
Jonas Kulla
58d86039d5 Merge branch 'dev' 2014-04-17 08:19:24 +02:00
Jonas Kulla
4e346cac27 Merge pull request #25 from cremno/mri-improve-error-printing
MRI: improve error printing
2014-04-16 20:22:58 +02:00
cremno
bd6764450f fix comment style 2014-04-16 20:05:15 +02:00
Jonas Kulla
1ef6e04520 Font: Overhaul font asset discovery
Previously, any font names requested by RGSS would be translated
directly to filenames by lowercasing and replacing spaces with
underscores (and finally doing some extension substitution).
To make this whole thing work smoother as well as get closer to
how font discovery is done in VX, we now scan the "Fonts/" folder
at startup and index all present font assets by their family name;
now, if an "Open Sans" font is present in "Fonts/", it will be
used regardless of filename.

Font assets with "Regular" style are preferred, but in their
absence, mkxp will make use of any other style it can find for
the respective family. This is not the exact same behavior as
VX, but it should cover 95% of use cases.

Previously, one could substitute fonts via filenames, ie. to
substitute "Arial" with "Open Sans", one would just rename
"OpenSans.ttf" to "arial.ttf" and put it in "Fonts/". With the
above change, this is no longer possible. As an alternative, one
can now explicitly specify font family substitutions via mkxp.conf;
eg. for the above case, one would add

fontSub=Arial>Open Sans

to the configuration file. Multiple such rules can be specified.

In the process, I also added the ability to provide
'Font.(default_)name' with an array of font families to search
for the first existing one instead of a plain string.
This makes the behavior closer to RMXP; however, it doesn't
work 100% the same: when a reference to the 'Font.name' array is
held and additional strings are added to it without re-assignig
the array to 'Font.name', those will be ignored.
2014-04-16 13:37:22 +02:00
Jonas Kulla
f25d2db63c MRI-Binding: Add RGSS3 '__FILE__' variant 2014-04-15 11:54:22 +02:00
cremno
4ca9e82a14 MRI: improve error printing
`Debug()` is CRuby-style and `showMsg` is RGSS-style.
The `Debug()` output is safe, `showMsg` might be fragile.
2014-04-14 00:07:51 +02:00
cremno
95c112bbe4 MRI: add option to use a script's name as filename 2014-04-11 18:11:32 +02:00
cremno
8bc17a9a98 MRI: less strlen calls, use custom script's filename 2014-04-11 17:13:25 +02:00
Jonas Kulla
6dfa4f6b7d MRI-Binding: Add 'Graphics.width/height' bindings (RGSS2) 2014-04-11 13:34:19 +02:00
Jonas Kulla
8203e32900 MRI-Binding: Define 'msgbox' p/print aliases (RGSS3) 2014-04-11 13:31:09 +02:00
cremno
f6ec364632 MRI: rewrite script eval
- set __FILE__ (RGSS 1 and 2)
 - set Ruby string encoding to UTF-8
   instead of using a magic comment
2014-04-10 14:00:05 +02:00
cremno
06b877a78c MRI: don't set $0 (see #24) 2014-04-10 02:14:25 +02:00
cremno
4e0262d2a7 MRI: fix $RGSS_SCRIPTS 2014-04-10 01:16:31 +02:00
cremno
f8b87eb188 MRI: don't manually peform GC 2014-04-09 23:45:24 +02:00
cremno
804a697c03 MRI: add $RGSS_SCRIPTS 2014-04-09 22:36:56 +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
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
cremno
f06769b434 MRI: some minor optimizations 2014-01-24 22:30:19 +01:00
Jonas Kulla
a0a27889a3 Merge #8 2014-01-02 00:11:57 +01:00
Edward Rudd
5c0295e972 use correct macros in ruby code so code compiles in 32bit and 64bit mode 2014-01-01 11:20:42 -05:00
Jonas Kulla
1bacceddf0 Spacing 2014-01-01 12:59:40 +01:00
Edward Rudd
4a817f45e5 wrap not check in parenthesis so the check is done correctly. 2013-12-31 16:26:10 -05:00
Edward Rudd
2572a05e8b safely print errors by explicitly specifying a format string 2013-12-31 16:25:38 -05:00
Edward Rudd
adfbc5bb64 pull in missing include 2013-12-31 16:25:13 -05:00
Edward Rudd
5b4e512dc6 ulong isn't defined anywhere (maybe on linux it is.. but not standard on OS X) 2013-12-31 16:24:56 -05:00
Jonas Kulla
9759e52b3c Exception: Constructor now takes printf style arguments 2013-12-29 18:05:11 +01:00
Jonas Kulla
7f4e58fd6e MRI-Binding: Don't memcpy script data before deflating
I think the reason this was originally done was some
issue with ruby's GC where it would wrongfully sweep
the script array variable on the C stack.

This change should speed up startup a little.
2013-12-29 14:55:49 +01:00
Jonas Kulla
2adf8ab265 Transition from QtCore to stdc++ / STL / boost
This looks like a pretty major change, but in reality,
80% of it is just renames of types and corresponding
methods.

The config parsing code has been completely replaced
with a boost::program_options based version. This
means that the config file format slightly changed
(checkout the updated README).

I still expect there to be bugs / unforseen events.
Those should be fixed in follow up commits.

Also, finally reverted back to using pkg-config to
locate and link libruby. Yay for less hacks!
2013-12-29 13:59:26 +01:00
Jonas Kulla
231e38ae8e Replace QVector, QList with std::vector, std::list
An exception is made of TexPool, which will need a
bit more testing before transitioning to std containers.

Also replace 'int' with 'size_t' where it is used only
as an array index.
2013-12-26 20:18:33 +01:00
Jonas Kulla
c504a383ba MRI-Binding: Optimize RB_ARG_END vaarg guard
It's enough to check this only in debug mode.
Make this an empty define in release mode.
2013-12-20 11:29:12 +01:00
Jonas Kulla
d7ceff91a2 MRI-Binding: Deduplicate code 2013-12-20 10:22:01 +01:00
Jonas Kulla
7e943e2803 MRI-Binding: Optimize attribute setters 2013-12-18 17:36:45 +01:00
Jonas Kulla
91c5eb1861 MRI-Binding: Fix typo that led to access of freed Color objects
Also fix my moronic variable naming in the InitCopy
functions that let to this mess up in the first place.
2013-12-15 10:18:58 +01:00
Jonas Kulla
94119baeee MRI-Binding: Add 'ViewportElement.viewport=' binding 2013-12-06 15:56:38 +01:00
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
b5d1172350 MRI-Binding: Silence "may be uninitialized" warnings 2013-11-30 14:46:45 +01:00
Jonas Kulla
5863e14953 MRI-Binding: Bitmap: Add FIXME 2013-11-01 08:37:27 +01:00
Jonas Kulla
3359451f3a MRI-Binding: Catch exceptions in clone constructors 2013-10-31 10:25:54 +01:00
Jonas Kulla
b7a2ba830c MRI-Binding: Bind #initialize_copy for clonable classes
This replaces the previously directly bound #clone
methods, which weren't really the "the Ruby way".
Rubys default Object#clone will call into our #init_copy
methods instead.

Partly incorporates pull request #3 by /cremno.
2013-10-31 10:13:24 +01:00
Jonas Kulla
f067e0eff8 MRI-Binding: Reduce number of object allocations
Previously, wrapped instances of mkxp core classes were
stored as RData ivars inside the actual object. This turned
out to be pointless as RData objects themselves are perfectly
valid objects that can carry ivars and have parent classes.
Therefore, the RData objects are now exposed directly to
the user scripts, effectively halving the amount of object
allocations.
2013-10-30 10:06:24 +01:00
cremno
8c45a5b11e follow-up: style adjustments (see GH-2) 2013-10-22 15:24:55 +02:00
cremno
071ad5d961 MRI: changes to mkxp's Marshal::load monkey patch
- force string encoding to UTF-8 only when it's ASCII-8BIT (force only valid UTF-8 strings in future?)

- support original Marshal::load proc (2nd arg)
2013-10-22 13:45:57 +02:00
Jonas Kulla
aa786e268d Remove unused code 2013-10-20 21:04:30 +02:00
Jonas Kulla
27341dc95d MRI-Binding: Enforce UTF-8 strings in 'Marshal::load()' via aux proc
We override 'Marshal::load()' via alias and call it with
a custom auxiliary proc in the alias which sets the encoding
of all demarshalled strings to UTF-8. The case where a user
himself provided a proc to 'load()' is not implemented.

This is definitely a better solution than patching the ruby
source tree. Thanks to github.com/cremno for hints and help!
2013-10-20 20:54:56 +02:00
Jonas Kulla
30507d2f6f MRI-Binding: Enforce UTF-8 string encoding 2013-10-19 18:57:34 +02:00
Jonas Kulla
d5bc71f7ba MRI-Binding: Add 'System.puts()' for console printing 2013-10-19 15:54:21 +02:00
Jonas Kulla
1759a1b4a9 MRI-Binding: Fix Audio fade functions all fading the BGM 2013-10-17 01:02:09 +02:00
Jonas Kulla
26bc4842c0 MRI-Binding: Catch exceptions in '_load' implementations 2013-10-15 05:12:20 +02:00
Jonas Kulla
39436ad231 Fix up SDL2 include paths
Using "SDL2/SDL_xxx.h" instead of "SDL_xxx.h" caused
the include paths provided by pkg-config to be ignored,
and headers from a standard include path to be used instead.
2013-10-13 23:21:34 +02: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
6fef49f42a Cosmetic fixes 2013-10-08 06:05:06 +02:00
Jonas Kulla
a108843069 Add 'System.data_directory()' for save files etc.
Just a small wrapper around SDL2's GetPrefPath()
2013-10-08 06:04:21 +02:00
Jonas Kulla
dd25323cdd Ifdef out more RGSS2 functionality 2013-10-06 10:28:03 +02:00
Jonas Kulla
ce70b6dc95 Fix a heavy memory corruption in p()/print()
If you free locally allocated ruby objects
you're gonna have a BAAAD time
2013-10-06 10:19:31 +02:00
Jonas Kulla
4ff563725b Make 'rb_get_args()' va_arg passing safer by introducing a termination marker
What can I say. I made a pact with the devil, and paid dearly.
Almost a whole day's worth of debugging, actually. Not again.

If this turns out to be slow we can always optimize the critical
parts (with no variable param count) later, or completely remove it.
2013-09-27 04:49:48 +02:00
Jonas Kulla
fe557bca1d Implement "show_cursor" attribute in Graphics module
If false (the default), the system cursor is hidden
inside the game window.
2013-09-24 22:56:25 +02:00
Jonas Kulla
e42e6398cb Add FIXME 2013-09-10 04:21:57 +02:00
Jonas Kulla
f87f231129 Fix Plane not accepting nil for '#bitmap=' 2013-09-06 15:54:30 +02:00
Jonas Kulla
f81e20cc68 Raise exception on too big textures 2013-09-03 15:22:00 +02:00
Jonas Kulla
73812e957e Clean up unused code 2013-09-03 14:39:11 +02:00
Jonas Kulla
57a8f772c8 Remove leftover junk 2013-09-01 16:39:22 +02:00
Jonas Kulla
88041a2395 Check if RMXP script pack path was read from Game.ini 2013-09-01 16:36:11 +02:00
Jonas Kulla
ff25887f41 Initial commit 2013-09-01 16:27:21 +02:00