Commit Graph

265 Commits (4cdb0ff138ecc832a2c051f272a8e3e8feae1b4f)

Author SHA1 Message Date
lethosor 11222f21d3
Update lint.py filters and fix a couple identified issues 2021-09-06 18:42:45 -04:00
lethosor 4554ca35f3
Ruby: add _indexenum wrapper to OtherVectors for compat with devel/scanitemsother
Ref #1558
2020-07-26 23:11:04 -04:00
Ben Lubar 28c34217d8
Ruby implementation of df-other-vectors-type 2020-05-09 18:28:40 -05:00
lethosor 1dc59d3772 Ruby: use core methods for finding selected item and building
Similar to c3d566332, the core methods have become more complicated (and are also checked at compile-time). This will give a more consistent experience across scripts.

Fixes #1563
2020-05-01 22:50:02 -04:00
lethosor 76da2c2aaf Clean up CMakeLists.txt style 2019-07-16 22:19:11 -04:00
Joel "The Merciless" Meador cddfb87e22 Make unit_ishostile always return a non-nil value
Have been messing with this function in the dfhack repl and when it returns nil it's hard to know what that means unless you have also already read the code. So this handles a couple spots in `unit_ishostile` that previously just returned false-ey `nil`s to return `false`
2019-05-21 10:48:28 -04:00
lethosor 368f8d0504 Remove and replace checks for OnBreak 2018-11-24 14:52:26 -05:00
Pauli ff6d0c4e7d Fix memory return calling convention in ruby bindings
Calling convention for memory return is that caller allocates (in stack)
memory to hold returned object. Then caller passes the pointer to callee
as implicit first parameter.

references:
https://github.com/hjl-tools/x86-psABI/wiki/X86-psABI
https://msdn.microsoft.com/en-us/library/7572ztz4.aspx

Fixes #1209
2018-07-04 23:46:23 +03:00
lethosor 7e91173289 Merge remote-tracking branch 'origin/develop-cf-autofix' into develop 2018-07-02 13:44:20 -04:00
codefactor-io a08f08ae5f [CodeFactor] Apply fixes 2018-07-01 15:25:53 +00:00
Pauli afd942a94b ruby: Support automatic array size from index-enum 2018-06-26 23:48:54 +03:00
lethosor 7a5e7c7c86 Rename unit_flags1.dead to killed, update submodules/changelog
Follow-up for dfhack/df-structures#247
2018-06-21 11:17:09 -04:00
Pauli 8f2cf3ad26 Fix printf format warnings 2018-06-11 19:57:06 +03:00
lethosor 5cd8aa0458 Update downloads to 0.44.09 2018-04-19 12:35:00 -04:00
Ben Lubar 1dd6625270
Fix remaining warnings in supported plugins 2018-04-06 14:17:34 -05:00
Quietust 88c7e493b8 Merge ui_area_map_width into ui_menu_width, now a 2-byte array 2017-12-03 20:34:59 -06:00
lethosor 2c95ac411e Update xml and all uses of job_handler 2017-11-25 00:59:59 -05:00
lethosor 65382473f7 Ruby: stop cpp_new from truncating vtable pointers
This fixes a crash in levers.rb, for instance.
2017-06-10 17:22:52 -04:00
lethosor c3d5663320 Ruby: use Gui module to get selected unit
This allows "exterminate it" to work from command-prompt, among other things.

Fixes #1100
2017-06-06 23:34:34 -04:00
lethosor 4dff218976 ruby: fix crash when unloading plugin on Windows 2017-05-09 13:49:07 -04:00
Ben Rosser f0d4a1f563 Add DOWNLOAD_RUBY option to Ruby plugin cmake, defaulting to ON
If DOWNLOAD_RUBY is set to OFF, the build will not attempt to download
a prebuilt libruby.so and not fire a warning that one is not present.
This may be desired if one wants to link dfhack against a newer system
libruby.so, now that dfhack supports ruby 2.x and also supports linking
against system libruby (at least, on Linux), as per the following commit:

df9b5bca73

This also allows the dfhack build to proceed without network access
(once all submodules have been fetched), which at least some Linux
distributions, like Fedora, require.

By default DOWNLOAD_RUBY is set to ON, so this should not change
the behavior of default builds.

I tested that when DOWNLOAD_RUBY is set to OFF, dfhack still launches
and that the Ruby plugin still functions, e.g. by running
```rb_eval puts('Hello world.')``` in the dfhack console.
2017-01-20 17:40:14 -05:00
Kelly Kinkade 439e13643c better hack to make ruby work on win64 2016-12-13 23:55:20 -06:00
jj 8488b1a953 ruby: use correct raw string length with encodings 2016-12-05 10:29:16 +01:00
lethosor dd28079f30 Fix ruby.cpp compilation on win64 2016-11-22 22:43:48 -05:00
lethosor df9b5bca73 Allow ruby plugin to try more than one library path, including libruby.so on Linux 2016-11-17 10:31:48 -05:00
lethosor 8d9b888410 Revert "fixed MD5 hash of win64 ruby lib."
Unable to get anything other than 8a856 for the extracted library on my end

This reverts commit fbaf2697cb.
2016-11-14 14:16:43 -05:00
Japa Illo fbaf2697cb fixed MD5 hash of win64 ruby lib. 2016-11-08 15:10:43 +05:30
lethosor 2e6c7a90be fix whitespace 2016-10-31 01:58:40 -04:00
lethosor 9e97ccbb50 Use system libruby on osx64 (since ruby 1.8 and 2 are supported now) 2016-10-29 19:08:54 -04:00
lethosor 4e7f2b9579 win64 ruby 2 2016-10-29 19:00:28 -04:00
jj c640006069 ruby: some more updates for x64, fix df_flagarray size 2016-10-28 16:40:14 +02:00
lethosor d62d263793 ruby: Fix potential onupdate crash when cur_year is missing 2016-10-26 20:55:16 -04:00
lethosor cf329c7ceb Ruby: fix Qnil and Qtrue constants with 64-bit Ruby 2.x
These have different values on x64 Ruby 2.x (see USE_FLONUM in ruby.h in the
ruby source). This was causing dump_rb_error to crash, since it was walking an
array until it got to Qnil (but thinking Qnil was 4 instead of 8) and trying to
print each element as a string. There were probably more subtle issues with
Qnil and Qtrue being wrong too.
2016-10-26 20:44:35 -04:00
lethosor defedb351e Fix raw_vcall crash on Linux/OS X x64 2016-10-26 09:34:14 -04:00
lethosor 3df74de021 Fix rb_dfget_vtable_ptr on x64
This was causing rb_dfget_rtti_classname to receive a truncated pointer and
crash
2016-10-21 11:46:53 -04:00
jj 97f29229cd ruby: fix weird freeze when printing large strings to the console on linux64 2016-10-21 17:00:02 +02:00
jj f586692ed6 plugins/ruby: update for 64bits 2016-10-21 14:52:26 +02:00
lethosor 2806fe73a9 ruby: Support for loading Ruby 2.x libruby
Check for rb_float_new and rb_float_new_in_heap, as documented in #271
2016-10-08 17:01:52 -04:00
lethosor 714ba1a030 Warn if ruby library is missing instead of breaking installation 2016-09-26 18:28:59 -04:00
lethosor caa6a81669 Add ruby library for linux x64
Built by @dseguin: https://github.com/DFHack/dfhack/pull/989

Closes dfhack/dfhack#989
2016-09-26 17:46:50 -04:00
lethosor 7abb82b6d1 Switch to downloading 32-bit libruby on Linux and Windows 2016-09-26 17:36:57 -04:00
lethosor 888a09bed5 Switch to downloading OS X libruby 2016-09-26 17:24:35 -04:00
lethosor bbaf129adf Fix ruby codegen for bitfields/enums with long base-type 2016-08-27 15:24:53 -04:00
lethosor 1b11c46a98 ruby.cpp: uint32_t -> uintptr_t 2016-08-10 15:24:07 -04:00
Lethosor 6e741b1a80 Merge pull request #969 from Qartar/win64
Minor fixes/updates for Visual Studio 2015 Win64
2016-08-10 15:15:44 -04:00
Carter Bray 5fef2ad075 Add windows container sizes to ruby codegen 2016-08-07 10:11:17 -07:00
lethosor ddbb1b5bb8 ruby: Update sizes for some types
Many are still incomplete on x64, especially on Windows
2016-08-05 17:29:24 -04:00
lethosor dbd2e71920 Ruby codegen integer improvements
- Add uint64_t
- Add special case for long on different platforms
- Require OS and architecture to be specified

NOTE: integer alignment on x64 is probably still incorrect
2016-08-05 17:12:07 -04:00
lethosor ef569dc5a1 Pass OS and architecture to ruby codegen explicitly
- Passing the architecture is needed to determine sizeof(long)
- Passing the OS prevents potential issues when cross-compiling between Windows
  and non-Windows (although this is unlikely)
2016-08-05 17:09:25 -04:00
Carter Bray 9da2dcb8a2 Fix raw_vcall on Win64 builds
MSVC's call conventions on x64 are the same for normal function calls and
member function calls (with the addition of the implicit 'this'
parameter).
2016-07-31 17:01:57 -07:00