Commit Graph

96 Commits

Author SHA1 Message Date
Bill Currie 0e40366c7f [ruamoko] Implement class conformsToProtocol
Seems to work nicely, too :)
2020-03-02 15:21:10 +09:00
Bill Currie a906efac47 [ruamoko] Register protocols and their selectors 2020-03-02 15:20:34 +09:00
Bill Currie 78f552aa87 [ruamoko] Initialize static instances
This is one step closer to implementing conformsToProtocol. However,
protocols are not yet initialized correctly: they are not registered,
nor are their selectors.

While the static initializer list pointer was not written previously,
the module struct always came immediately after the symbols struct, and
the module version has so far always been 0. Thus, the list pointer is
correctly 0 for older progs and there's no need for a version bump.
2020-03-02 13:45:47 +09:00
Bill Currie bc4bea79cb [ruamoko] Remove a stale FIXME
This was fixed when pr_def_t was introduced. I missed the comment at the
time.
2020-03-02 13:00:33 +09:00
Bill Currie 383a7fe5e1 Remove File_Open
Other than its blocking of access to certain files, it really wasn't
that useful compared to the functions in qfs, and pointless with access
to qfs anyway.
2020-02-26 13:45:14 +09:00
Bill Currie d60291a73e Clean up a lot of va usage
va is not thread-safe (it's not save even without threads), and I want
to be able to run progs in threads.
2020-02-26 09:46:59 +09:00
Bill Currie 42713cad8b Make script much friendlier to use
It now simply sets an error message pointer and returns false if there's
an error.
2020-02-26 09:39:03 +09:00
Bill Currie 3577d27a45 Move the ObjQC data into a resource block
This makes it nice and private (though with the cached pointer, ObjQC is
still a first-class component).
2020-02-25 23:14:18 +09:00
Bill Currie a55b9544ac Improve handling of pr_argc
It is now set to 0 when progs are loaded and every time
PR_ExecuteProgram() returns. This takes care of the default case, but
when setting parameters, pr_argc needs to be set correctly in case a
vararg function is called.
2020-02-25 17:36:29 +09:00
Bill Currie 9bb68f2d8c Allow nested use of PR_SaveParams()
PR_SaveParams() is required for implementing the +initialize diversion
used by Objective-QuakeC because builtins do not have local def spaces
(of course, a normal stack calling convention would help). However, it
is entirely possible for a call to +initialize to trigger another call
to +initialize, thus the need for stacking parameter stashes. As a
bonus, this implementation cleans up some fields in progs_t.
2020-02-25 14:30:26 +09:00
Bill Currie 4b7ecdf74a Make PR_Init take an instance to initialize
This allows internal sub-systems to do per-instance initializations
without other engine systems having to know about them.
2020-02-23 18:32:16 +09:00
Bill Currie 81083698a8 Move to using an in-memory form of ddef_t
This allows the VM to work with extended ddefs transparently. It seems
to have uncovered a typedef alias relocation bug, though.
2020-02-22 22:33:44 +09:00
Bill Currie 2db5d04e3f Reduce the ephemeral nature of str_mid
When the substring is the tail of the supplied string, return a
"pointer" to within the supplied string rather than a new "return"
string. This means that tail-end substrings of string constants are
themselves constants.
2020-02-19 21:41:46 +09:00
Bill Currie bab3752e98 Add missed overridden math functions
And fix misspelled ones too.
2020-02-15 23:49:12 +09:00
Bill Currie df7c08a010 Add support for doubles to Ruamoko
Only as scalars, I still need to think about what to do for vectors and
quaternions due to param size issues. Also, doubles are not yet
guaranteed to be correctly aligned.
2020-02-15 23:49:12 +09:00
Bill Currie 8f028b8a0d Fix some double frees. 2018-09-07 20:03:19 +09:00
Bill Currie 3efb0c538f Separate file search from loading.
QFS_LoadFile (and its wrappers) now  take a file handle rather than a
path. This will make vpath usage a little cleaner to implement.
2014-01-28 16:22:05 +09:00
Bill Currie f5501fbf24 Fix a pile of automake deprecation warnings.
s/INCLUDES/AM_CPPFLAGS/g

I <3 sed :)
2013-11-24 13:11:50 +09:00
Bill Currie 6288684fa2 Fix more gcc 4.8 errors.
More actual bugs found, too.
2013-09-27 23:09:37 +09:00
Bill Currie c6f9d8b64c Reduce CFLAGS abuse a little for mingw targets.
This fixes missing debug info (useful for fixing linker errors, if nothing
else).
2013-01-28 16:21:42 +09:00
Bill Currie e27d7cbd2d Handle alloca "correctly".
Use AC_FUNC_ALLOCA and the #ifdef mess suggested by the autoconf docs
(hidden in qfalloca.h).
2013-01-22 21:02:50 +09:00
Bill Currie 6eb6b6c0ba Change pointer_t to unsigned and clean up the mess.
It doesn't make sense to have negative pointers. The size of the commit is
from enabling gcc's -Wtype-limits warning and cleaning up that mess too.
2012-12-21 21:53:13 +09:00
Bill Currie 84a68b139e Rename set_iter_t's value to element.
Correct terminology and all :)
2012-12-21 14:09:00 +09:00
Bill Currie 427d52511c Fix an uninitialized variable warning.
It's a false positive, but best to be safe.
2012-12-19 17:13:32 +09:00
Bill Currie e17d8ac9db Add ruamoko wrappers for the set api.
This includes both normal functions and a Set class (and SetIterator
class). Most of the methods are implemented as builtins.
2012-12-16 13:48:36 +09:00
Bill Currie 3a9fe196b6 Get the return param right for messages to nil.
R_INT(pr) = R_(INT)(pr); is not exactly what I had intended :P
2012-12-16 13:39:59 +09:00
Bill Currie f631f514e9 Fix the obj_error family of functions.
It seems they were written before quaternion support was added and were not
updated to take into account the variable size of parameters. Now at least
Object's -error: works.
2012-12-16 13:19:31 +09:00
Bill Currie d5c831b6da Add a little test case for accessing types.
Using ruamoko to access ruamoko type encodings is actually quite pleasant
:)
2012-11-15 13:40:11 +09:00
Bill Currie 6b46cde7c8 Move retainCount out of Object.
Going by "standard" Objective-C, retainCount really doesn't belong in
Object itself. The way GNUStep does it is to stash retainCount in memory
just below the object by allocating extra bytes for the count and returning
a pointer just beyond those extra bytes. Now Ruamoko does the same. This
fixes the inconsistencies in structure layouts for Protocol and class
structs between qfcc generated (internal) structs and user visible structs.
2012-11-08 20:24:25 +09:00
Bill Currie ec42bde527 Make hash tables more const correct.
And clean up the resulting mess :/
2012-10-27 11:44:31 +09:00
Bill Currie 23a38738fc Massive whitespace cleanup.
Lots of trailing whitespace and otherwise blank lines.
2012-05-22 08:23:22 +09:00
Bill Currie bc1b483525 Nuke the rcsid stuff.
It's pretty useless in git.
2012-04-22 10:56:32 +09:00
Bill Currie 7a8f91edda Move bi_gib.c from ruamoko to gib.
This makes gib depend on gamecode, but removes the dependency on gib from
ruamoko. Unfortunately, carne now needs to be linked against gamecode even
though it never uses it.
2012-02-09 10:00:54 +09:00
Bill Currie 9fbff2f4d5 Do an audit of the Makefile.am files.
o All instances of LIBADD/LDADD have a corresponding DEPENDENCIES
    specificatiion.
  o libraries now use a lib_ldflags macro to keep things consistent
  o duplication of source/lib names has been minimized (particularly in
    the libraries; more work needs to be done for the executables)
  o automake spec blocks have been organized (again, more work needs to be
    done for the executables)
2012-02-07 16:04:19 +09:00
Bill Currie b5019c8e33 Nuke the engine dicrectory from gamecode.
Not the contents, of course :) Anyway, finally, that totally useless
directory is gone.
2012-02-06 23:44:52 +09:00
Bill Currie c98ffa4eda Create a message buffer API for Ruamoko
The api hides all the gory details of message buffer setup and usage
(particularly the differences between writing and reading). Most
importantly, the api provides a safe way to read and write binary data
(always little endian).
2012-02-06 15:50:32 +09:00
Bill Currie 3bd75cefd8 Autoconfiscate log2f.
Android doesn't supply log2f for us (though it does have all the other
float calls ruamoko wants).
2012-02-05 14:23:33 +09:00
Bill Currie cc5140e3a1 Move min/max/bound and field_offset into better locations.
min/max bound into mathlib.h (they /are/ math functions, after all) and
field_offset into qtypes.h.
2011-12-24 10:04:33 +09:00
Jeff Teunissen 361255cf31 Ruamoko: New math constants, some new math functions
Also, switch all of the math builtins functions we use from Rua to the
ones that accept and return floats, avoiding conversions to/from double.
2011-12-09 22:36:41 -05:00
Bill Currie f75b0a611b Some compile fixes for OpenBSD 2011-08-25 22:35:20 +09:00
Bill Currie 3dd31b7de9 Fix some bugs found while hacking inputlines. 2011-07-09 09:42:11 +09:00
Antti Harri 358a844a42 Implement --version-info configure switch to override QuakeForge
library versioning. From Lasse Collin, thanks!
2011-07-09 01:23:36 +03:00
Bill Currie 4e66a5b327 Add rua rappers for the cvar alias functions. 2011-07-06 19:17:28 +09:00
Bill Currie a8245e598e Fix a memory leak.
The command hash table is shared between all progs engine instances, but it
was being allocated for every instance. Ensure only one is allocated.
2011-07-05 19:05:24 +09:00
Bill Currie 6484dd16c7 Finish cvar alias support.
Several functions that manipulate cvars were not checking for aliases.
2011-07-04 21:05:42 +09:00
Bill Currie 74a7e07dfc Use AM_CFLAGS instead of CFLAGS.
CFLAGS is meant to be reserved for the user.
2011-05-10 12:44:44 +09:00
Bill Currie 2bacfdabf2 Interpret func fields as selectors for entities with objects. 2011-03-30 20:19:31 +09:00
Bill Currie 2be07fd652 Keep the the temp string out of progs for sprintf.
There's no need for the string to be in progs memory when printing as the
end result will be moved into progs memory regardless.
2011-03-24 11:45:58 +09:00
Bill Currie cb0bc7229a Resurect the debugging messages in rua_obj.c
Yet another debug flag: SYS_RUA_OBJ
2011-01-10 12:26:10 +09:00
Bill Currie a85c0713aa Nuke libQFbuiltins.
The gib and "common" builtins are now part of libQFruamoko.
2011-01-04 21:21:19 +09:00