Commit Graph

50 Commits

Author SHA1 Message Date
Glenn Maynard f567a0fd28 cleanup arg order 2006-09-26 08:54:54 +00:00
Glenn Maynard 12a21ce930 remove old stuff 2006-09-21 01:41:37 +00:00
Chris Danford 7f821e8cfc CString -> RString 2006-01-22 01:00:06 +00:00
Chris Danford d507f3fd28 move LuaBinding into namespace 2005-12-27 22:58:30 +00:00
Glenn Maynard 4cd71c77bd const 2005-12-22 22:08:41 +00:00
Chris Danford 65d71a4f23 expermienting with DEFINE_METHOD macro for Lua methods 2005-09-10 02:47:04 +00:00
Glenn Maynard b6d428d37c Make Lua type checks optional. They add a lot of overhead to Lua dispatches. 2005-08-25 17:51:00 +00:00
Chris Danford be35783a30 allow multiple Luna types defined in a single .cpp 2005-08-15 01:54:04 +00:00
Eric Gustafson 52a290a867 Fix compile on GCC4 #2 (Thanks to Sesse for submitting this) 2005-07-11 21:16:53 +00:00
Eric Gustafson 541410b945 Fix compile on GCC4 (Thanks to Sesse for submitting this) 2005-07-11 19:40:18 +00:00
Glenn Maynard ea6d806dad Allow associating a table with Lua-bound objects, for storing state in Lua.
Design goals are: minimal overhead (one table); minimal extra code to use
it (two lines in the header, to have a space to store a reference to the
table), same API for classes with and without a table; allow switching to
a table-bound class without derived classes having to know about it; keep
zero per-object overhead for classes that don't need it.
2005-07-04 21:43:27 +00:00
Glenn Maynard fc948e9ce9 simplify 2005-06-23 09:04:06 +00:00
Glenn Maynard c8994b27f9 cleanup 2005-06-23 09:02:04 +00:00
Glenn Maynard a76c3fa158 cleanup; remove userdataType 2005-06-23 08:58:43 +00:00
Glenn Maynard ff9e753979 cleanup 2005-06-23 08:53:04 +00:00
Glenn Maynard ccb65cc3fe cleanup (move public/private stuff together; no code changes) 2005-06-23 08:50:58 +00:00
Glenn Maynard f3a20cf729 cleanup 2005-06-23 08:49:36 +00:00
Glenn Maynard 14fd08abc1 __type -> type 2005-06-23 08:47:34 +00:00
Glenn Maynard 36794f6d5f CheckType -> CheckLuaObjectType 2005-06-23 08:46:21 +00:00
Glenn Maynard be8c5d23b5 CreateGlobalTable -> CreateMethodsTable 2005-06-23 08:44:46 +00:00
Glenn Maynard 7e20ccc36c don't point the metatable at the methods table; comment 2005-06-23 08:42:48 +00:00
Steve Checkoway 5fd18e730a Fix "too few template-parameter-lists" error. 2005-06-20 11:20:30 +00:00
Glenn Maynard 74828836cb cosmetic 2005-06-20 09:53:02 +00:00
Glenn Maynard 3c04a63c12 simplify 2005-06-20 09:42:24 +00:00
Glenn Maynard 9276c4f395 simplify 2005-06-20 09:35:06 +00:00
Glenn Maynard bde35cb47f simplify: don't template RegType separately 2005-06-20 09:28:45 +00:00
Glenn Maynard fae7e5b265 oops, wrong guy 2005-06-20 05:08:51 +00:00
Glenn Maynard 0b3c14888f cleanup, fix name 2005-06-20 05:05:55 +00:00
Glenn Maynard 9d7f835609 no need to template Luna specializations 2005-06-20 05:02:03 +00:00
Glenn Maynard 4dd73b2c81 fix comment (no new T is created) 2005-06-20 04:42:11 +00:00
Glenn Maynard 72e7a4b1e4 cleanup 2005-06-20 04:32:24 +00:00
Glenn Maynard aff28653da Rearrange Lua types. Instead of each class registering all of the functions
of its base classes, set __index in the methods table to point to the base class's
methods table.  This has a few important advantages.  First and most importantly,
types don't need access to the Luna type of their base to derive from it, so these
definitions don't have to be in the headers, and probably don't need to be
templated.  Second, you can say:

function Actor:queue_rotate()
   self:linear(0.5)
   self:rotationz( 180 )
end

OnCommand=x,100;queue_rotate

This partially worked previously, but wasn't inherited; a function defined for
Actor wouldn't work for BitmapText.

(changes that use this in a few minutes)
2005-06-20 03:54:51 +00:00
Glenn Maynard 8c121d4598 s_className -> m_sClassName 2005-06-20 00:33:07 +00:00
Glenn Maynard 6bfb3f0bad pass L to LuaHelpers::TypeError 2005-06-15 08:33:26 +00:00
Glenn Maynard c724b4ad53 dependency cleanup 2005-05-29 03:47:40 +00:00
Glenn Maynard e504164796 debugging message assumes that method calls ("x:y()") have an initial
self argument; we remove it, causing off-by-one error messages
2005-05-28 07:27:49 +00:00
Glenn Maynard d8a82be539 implement == for lua objects 2005-05-24 20:56:38 +00:00
Glenn Maynard 3b993dfa08 Replace PopStack with FromStack as a basic overloaded function.
Move Push and FromStack into a namespace, so other files can add to it;
that way, we can say Push(1) or Push(Actor*), instead of Push(1) and
pActor->PushSelf(), allowing easier templating.
Add presently unused/untested LuaHelpers::ReadArrayFromTable.
2005-02-24 20:03:07 +00:00
Chris Danford a2915c038b add TemporaryEventMode flag to GameState 2005-02-21 17:29:49 +00:00
Chris Danford 09f19b9d0c change BArg to look for a Lua boolean type 2005-02-17 21:34:46 +00:00
Glenn Maynard d1a701a9a9 more g++ 3.4 compile fixes 2005-02-05 21:46:52 +00:00
Chris Danford 57c75d43e3 fix gcc compile 2005-02-01 22:40:27 +00:00
Glenn Maynard 4aa142711d fix g++ compile 2005-02-01 19:59:41 +00:00
Chris Danford 275edd909b style cleanup 2005-02-01 07:50:26 +00:00
Chris Danford d6c33c96d6 fix GCC errors and warnings 2005-02-01 07:49:23 +00:00
Chris Danford 68dd253720 use templated classes instead of macros for easier debugging 2005-01-31 08:05:27 +00:00
Glenn Maynard de2b899a5f fix g++ compile 2005-01-26 21:36:01 +00:00
Glenn Maynard 69f515ef76 fix implicit cast warning flood 2005-01-26 18:14:56 +00:00
Chris Danford 8555a6da45 use Lua to execute commands
(needs cleanup)
2005-01-26 11:21:43 +00:00
Chris Danford 29a1bbb993 add macros for Lua binding C++ classes 2005-01-24 02:11:23 +00:00