Commit Graph

223 Commits

Author SHA1 Message Date
Chris Danford 01d59d97ce add base alpha 2005-04-30 07:48:10 +00:00
Glenn Maynard 4ad1b23244 cleanup 2005-04-29 00:07:33 +00:00
Glenn Maynard 4bba3fbaa8 add lights as an effect source 2005-04-28 23:55:47 +00:00
Glenn Maynard 8b76b5eafd experimental: allow implementing effects in Lua.
The biggest risk here is performance; we rarely call Lua per-frame.  However,
there are lots of places where we can call Lua while rendering (any time we
call a command), and there's little difference between calling Lua once
every ten frames or once every frame; either way you're counting against the
per-frame time quota to hit vsync.  So, this probably isn't much of a stretch.

Usage is simple:

  OnCommand=luaeffect,Foo
  FooCommand=addx,math.random()*10

Actor commands run during the effect will only apply for that frame.  Don't
call tweening commands ("linear") or anything else that doesn't make sense
in this context; you're modifying m_TempState instead of the tweening queue.
This is hoped to replace some of the more esoteric stuff in the effect code.

For this to be of much use, Lua access to m_fSecsIntoEffect and probably
other stuff is needed.
2005-04-28 10:18:36 +00:00
Glenn Maynard b2b3a80625 fix queued commands ending up in m_current, causing all future tweens to inherit it 2005-03-27 18:55:26 +00:00
Glenn Maynard a0877fdab0 Actor::SubscribeToMessage 2005-03-27 05:54:26 +00:00
Chris Danford 6016f34983 multiply the alphas so we can fade even while an effect is playing 2005-03-26 19:30:10 +00:00
Chris Danford a16db4edaa Don't use negative names for booleans: rename Hidden -> Visible, but still support the old interfaces. 2005-03-25 20:30:39 +00:00
Steve Checkoway ae02033893 Fix warnings. 2005-03-23 21:04:40 +00:00
Chris Danford 7ca20486ef use sin lookup table to fix terrible performance with float and tipsy performance on some archs 2005-03-22 00:58:05 +00:00
Chris Danford 1d1a6a95ac add diffuse_ramp effect 2005-03-21 10:49:51 +00:00
Chris Danford d83e8ec60c warn instead of asserting on tween overflow 2005-03-20 20:37:24 +00:00
Chris Danford ca8106297e add HasCommand 2005-03-13 20:34:52 +00:00
Chris Danford 7ab74cdd24 don't keep "Message" in command name
fixes ScoreDisplayCalories
2005-03-08 16:54:48 +00:00
Chris Danford 2cc06cdc27 add 2nd parameter to ActorCommands 2005-03-01 21:56:28 +00:00
Glenn Maynard b76c0edfa9 cleanup 2005-02-28 18:52:38 +00:00
Glenn Maynard 6a20525872 cleanup, comment 2005-02-28 18:16:41 +00:00
Chris Danford 4a2499b0fb fix Model doesn't obey m_bTextureWrapping 2005-02-27 08:31:41 +00:00
Glenn Maynard 81bf2cf8ff add queuemessage 2005-02-27 03:21:18 +00:00
Glenn Maynard 8e35534656 fix Update(0) not clearing m_bFirstUpdate (this would also happen previously:
every frame would be m_bFirstUpdate while hibernating)
2005-02-24 21:42:02 +00:00
Glenn Maynard 74e02e55ef make sure that large updates don't throw hibernation timing out of sync;
this also affects small updates, preventing small sub-frame timing errors;
if there's 10ms of hibernation left, and a 17ms update arrives, we should
update for only 7ms, not 17ms
2005-02-24 20:37:39 +00:00
Glenn Maynard 148bee1c51 re-update 2005-02-23 20:58:07 +00:00
Glenn Maynard 22b6a821d5 tabs 2005-02-23 19:22:52 +00:00
Glenn Maynard 53f7fbd890 fix VC7 compile 2005-02-23 19:11:40 +00:00
Chris Danford 2e5b94e064 have Actors automatically subscribe to a message for each command that ends in "MessageCommand" 2005-02-23 18:53:54 +00:00
Chris Danford eb6e4cdb50 play InitCommand for all Actors at load time 2005-02-19 01:06:03 +00:00
Glenn Maynard e16b72f5ed Actor::RunCommands, etc. can take any LuaReference, not just
ActorCommands
2005-02-17 05:12:23 +00:00
Chris Danford 533e83ed00 Don't set two different names for an element. Instead, pass the metrics group name as a parameter to Load() 2005-02-16 23:03:01 +00:00
Glenn Maynard 470b308fe0 comment 2005-02-13 20:10:27 +00:00
Glenn Maynard 40f82442b0 add assert (because ActorCommands.PushSelf() no longer does it) 2005-02-13 04:06:14 +00:00
Chris Danford 8decda4f63 allow AtExpressions in Commands 2005-02-12 22:54:15 +00:00
Glenn Maynard 06ddb73d93 don't reset if already wagging 2005-02-11 02:56:08 +00:00
Glenn Maynard 3e389c103b Translation and scaling (when applied in that order) are trivially combined;
save a matrix multiply for every actor.  (Maybe we can avoid doing any,
for objects which are neither rotated nor scaled--such as those positioned
based on their parent--but I'm not sure it's worth it.)  Rotations can be
combined without doing a full matrix multiply, too; if an actor rotates at all,
only do one matrix multiply.
2005-02-05 03:12:04 +00:00
Chris Danford 68dd253720 use templated classes instead of macros for easier debugging 2005-01-31 08:05:27 +00:00
Glenn Maynard b547efa5e7 have ActorCommands push themself 2005-01-28 20:08:29 +00:00
Chris Danford 8555a6da45 use Lua to execute commands
(needs cleanup)
2005-01-26 11:21:43 +00:00
Chris Danford cd9c48d645 LuaHelpers -> LuaManager 2005-01-24 02:26:55 +00:00
Chris Danford cda4c3b04a make Actor LoadFromNode signatures consistent 2005-01-17 05:28:16 +00:00
Chris Danford 8a1fb93003 move attribute loading into the class that owns the attribute 2005-01-16 23:40:21 +00:00
Chris Danford cfb9d284c5 simplify: combine two Actor deques into one 2005-01-16 04:35:47 +00:00
Chris Danford f2060969de fix tween overflow in Actor commands that call themself 2005-01-16 04:22:43 +00:00
Glenn Maynard d58fa5178c remove GlowMode 2005-01-08 22:40:42 +00:00
Glenn Maynard f9a96f885c (let's just remove glowmode entirely) 2005-01-08 22:10:04 +00:00
Glenn Maynard 25a5bfa7e7 Remove "blendmode,brighten"; it's the same as "blend,add", use that instead. 2005-01-08 22:08:31 +00:00
Chris Danford a3b49485b5 let Actors store commands 2005-01-04 10:41:32 +00:00
Glenn Maynard fac13bf393 remove fadecolor 2005-01-01 22:04:40 +00:00
Glenn Maynard 0d4f15c72f const 2004-12-27 22:30:51 +00:00
Chris Danford d544ea4972 scale pulse effect by EffectColors for added control 2004-12-27 03:25:09 +00:00
Chris Danford ed19821e09 rename: ActorCommand -> Command
Make Command smaller and more generic.
Parse arguments on use, not in Command::Load.
2004-12-03 05:19:46 +00:00
Chris Danford e1da21f61c Let ActorCommand do the parsing for ModeChoice 2004-12-02 05:56:38 +00:00