Commit Graph
108 Commits
Author SHA1 Message Date
Adrian Frühwirth 0524ff6e8d JANITORIAL: Silence GCC 7 fallthrough warnings 2018-03-23 18:34:17 +01:00
D G Turner 5199f9d080 SWORD25: Suppress GCC Cast Qualification Warnings.
Since lua_pushlightuserdata and lua_touserdata operate on (void *)
values, it is tricky to fix these warnings "correctly" without looking
at invasive changes to a significant amount of Lua internal code.

Since these pointers to consts are already being recast to drop the
const qualifications, then removing the const on the underlying value
declaration does not further expose this to change and stops the
compiler warnings associated with this.

Anyone with a better fix for this can restore the const
qualifications later.
2017-11-12 20:55:59 +00:00
Torbjörn Andersson 665f5c99b2 JANITORIAL: Silence some more GCC 7 fall through warnings
I think these are the last one that were already flagged as being
deliberate.
2017-08-06 16:54:38 +02:00
Torbjörn Andersson a57c5b385d SWORD25: Increase buffer length to silence GCC 7 warning 2017-08-06 16:42:40 +02:00
Torbjörn Andersson 3d8d5541dc JANITORIAL: Silence GCC 7 fall through warning 2017-08-06 16:40:42 +02:00
Willem Jan Palenstijn c3d533a72b SWORD25: Use direct integer index into indexTbl
This matches the behaviour of the Pluto rewrite Eris, and avoids
casting the integer indices to void *.

I verified this code by running this method in parallel with the current
lightuserdata/void* approach and asserting the retrieved objects were
identical when loading a savegame.
2017-01-28 18:47:11 +01:00
Eugene Sandulenko 12fadf713d SWORD25: Fixing bug #7041: SWORD25: Crash in final scene
The original was ignoring Lua errors in that scene and was
restoring the state with longjmp.

We are yet to see the platform compatibility, but Lua's code
is too tangled to make simple replacement with error() work.

Another possible alternative would be to rework the original
game scripts. We will do it if this commit is problematic.
2016-02-19 22:42:01 +01:00
Alexandre Detiste 6c298e964f JANITORIAL: Typos detected with lintian & grep 2016-02-15 18:27:02 +01:00
Willem Jan Palenstijn ad688f9d6f SWORD25: Remove now unused function 2016-02-02 02:16:41 +01:00
Willem Jan Palenstijn 75f1d2e259 SWORD25: Use more appropriate function for growing the stack
The call to lua_growstack in unpersistThread would unconditionally at
least double the size of the stack. This caused memory usage to grow
exponentially (literally) with the number of serialized threads.

Bugs #6977, #6999.
2016-02-02 01:21:28 +01:00
Eugene Sandulenko efaf82c66e SWORD25: Fix Hungarian version support 2015-11-19 00:51:44 +01:00
Matthew Hoops 797506eff7 SWORD25: Use fabs for absolute value of doubles 2015-04-11 16:12:47 -04:00
RichieSams 4c64f7e194 SWORD25: Remove unused code
The original idea was to keep the code variation and pick the best one. However,
these two methods we're portable enough for our needs.
2015-01-07 07:00:13 -06:00
Eugene Sandulenko baacf0be61 SWORD25: Commend unused and unportable functions 2015-01-04 22:16:50 +01:00
Eugene Sandulenko 17fe53a34c SWORD25: Hopefully fix compilation errors 2015-01-04 22:10:17 +01:00
Eugene Sandulenko ce45caaf83 SWORD25: Fix warning 2015-01-04 21:06:49 +01:00
RichieSams e4f74b6c34 SWORD25: Remove the option to persist a double as a string
Since the current method *should* be more accurate
2014-12-30 18:28:14 -06:00
RichieSams 9a4d62e76a SWORD25: Change function names to use persist instead of serialize
Same argument as in 97c35714ce.
To match the rest of the SWORD25 code base
2014-12-30 18:26:59 -06:00
RichieSams 8ee75e1dc5 SWORD25: Add Pluto copyright message to new persistence code
Since the code is based off the Pluto code
2014-12-30 18:22:15 -06:00
RichieSams eaff6a40f6 SWORD25: Correct include guards to reflect the changes to the file names 2014-12-30 18:21:43 -06:00
RichieSams 67114c3e7e SWORD25: Remove old lua persistence files 2014-12-30 15:40:33 -06:00
RichieSams 8668707f16 SWORD25: Fix how nils are persisted
The unpersist code expects nils to be represented as an index with value 0.
The persist code incorrectly wrote out this data
2014-12-30 15:40:33 -06:00
RichieSams 08e3f21a8d SWORD25: Rename double serialization file to better represent what it is
AKA functions, rather than a class
2014-12-30 15:40:33 -06:00
RichieSams 97c35714ce SWORD25: Rename lua serialization functions to use 'persist' in order to match the rest of the engine 2014-12-30 15:40:29 -06:00
RichieSams 2fb116f10e SWORD25: Move all lua serialization helper functions to their own file 2014-12-30 13:41:24 -06:00
Adrian Astley 2c7a87a4e3 SWORD25: Fix code formatting
... with AStyle
2014-12-19 14:51:00 -06:00
Adrian Astley de20880d9d SWORD25: Re-write the pluto unserializing function(s) 2014-12-19 13:41:58 -06:00
Adrian Astley dedfd7aa84 SWORD25: Move common functions to their own set of files so they can be shared 2014-12-19 13:38:56 -06:00
Adrian Astley efcd6196ee SWORD25: Create a function for serializing lua objects
This function is very similar to the Pluto function. However, this code
is much cleaner and is endian-safe
2014-12-19 11:29:22 -06:00
Adrian Astley ff35d7118c SWORD25: Create a set of functions for manually serializing a double
Since we can't assume IEEE.
2014-12-19 11:29:22 -06:00
Filippos Karapetis fa9e2f7b29 SWORD25: Disable unused code
Thanks to fingolfin for pointing out this unused code
2014-12-07 17:49:52 +02:00
Filippos Karapetis e938ddcef7 SWORD25: Remove trailing whitespace 2014-10-28 16:13:07 +02:00
Adrian Astley 2ec3adfad5 SWORD25: Make save files x32/x64 agnostic 2014-09-12 16:07:06 -05:00
Eugene Sandulenko c3ffbd884a Merge pull request #426 from sunmax/master
PS2: Pull request to master for latest PS2 code
2014-04-28 21:20:42 +03:00
Johannes Schickel bad7cdd3a6 SWORD25: Make GPL headers consistent in themselves. 2014-02-18 02:39:38 +01:00
Max Lingua 001e3f7658 PS2: modified sword25 loslib.cpp to support PS2 2014-01-19 00:51:02 -05:00
Strangerke 622dfcf950 SWORD25: Janitorial - Fix spacing errors 2013-11-24 18:52:48 +01:00
Willem Jan Palenstijn 34169a817c SWORD25: Revert "Fix compilation on some 32-bit systems"
This reverts commit 6dc3768faa.

This commit was the wrong fix to the compilation problem later
fixed by 8e9aefbf6e.
2013-11-04 21:25:00 +01:00
Eugene Sandulenko 8053989dd1 SWORD25: Remove explictit #includes
Makes Coverity happier.
2013-09-27 11:07:25 +03:00
Eugene Sandulenko 6dc3768faa SWORD25: Fix compilation on some 32-bit systems 2013-07-15 19:19:45 +03:00
Eugene Sandulenko b7e3d52abc SWORD25: Replace Pluto with Tamed Pluto for increased compatibility
Still saves are incompatible but at least this now has enhanced
debugging capabilities.
2013-07-15 19:02:34 +03:00
Max Horn 4a55f52818 SWORD25: Silence warning in the Lua code
This fixes warnings like this that crop up when compiling sword25
with Apple clang 4.2 (clang-425.0.28) (based on LLVM 3.2svn)
2013-04-18 17:09:32 +02:00
Filippos Karapetis 6286779d0a SWORD25: Fix some spacing in LUA 2013-02-03 18:18:43 +02:00
Filippos Karapetis afdb28b4e9 SWORD25: Replace calls to LUAI_THROW() with error() in LUA
This removes one of the uses of setjmp(), but its use in LUAI_TRY still
remains
2013-02-03 18:17:02 +02:00
Johannes Schickel 2773f5d7af COMMON: Forbid symbols for the rest of is* from ctype.h.
I also moved the isprint case to the correct position.

This adds a FIXME to our lua code from sword25, which uses iscntrl directly.
2012-12-13 21:08:48 +01:00
upthorn f34924bc39 SWORD25: Fix loading savegames on 64-bit archs. 2012-08-20 21:15:46 +02:00
Christoph Mallon a64b5e2a77 ALL: Use GCC_ATLEAST(). 2012-03-17 20:09:49 +01:00
Max Horn 367131ef0e COMMON: Move Language and Platform functionality into separate files 2012-02-26 15:21:36 +01:00
Willem Jan Palenstijn 9ffe3e11d9 Merge pull request #182 from fingolfin/forbid-ctype
ALL: Avoid using is* macros from ctype.h
2012-02-21 11:33:32 -08:00
Max Horn 4f8665fc83 COMMON: Move isFoo functions to namespace Common, add doxygen comments 2012-02-20 16:18:27 +01:00