[airstrike] Changes in the Airstrike message handling

Eero Tamminen eero.tamminen at netsonic.fi
Fri Jan 7 13:19:53 EST 2005


Hi,

I did some more finetuning in the message semantics:

* Changed names of a few messages to be more consistent:
  MSG_NONE -> MSG_IGNORE (like earlier with signals before messages)
  MSG_ISHARMLESS -> MSG_IS_HARMLESS
  MSG_ACCEPT_BONUSES -> MSG_ACCEPTS_BONUS
  MSG_DAMAGE -> MSG_SET_DAMAGE

* msg_ctrl() & sprite_ask() assert that only correct message types are given
  to them.  Additionally sprite_ask() asserts that sprite returns correct
  message return value.  This revealed a few inconsistencies in the message
  helper functions usage, which I corrected (+ added msg_deactivate()).

* Grouped the messages in message_types.h according to their purpose and
  commented them.

* Typedeffed the message return value enum so that gcc reports warnings if
  message handler doesn't return them  (and it's easier to change it later).


Ulf, the old signals.h had a few things that are not in msg_types.h.
Are these not anymore useful:
  DEBUG
  BURN
  CAN_CONTROL
  IS_FRIEND
  END_OF_SOUND
  STAT_STRING
  ?

I think MSG_DEBUG might be interesting now that we have a shell.
It might be also nice to have a message e.g. for:
  MSG_SET_CONTENT
  MSG_HAS_CONTENT

When I add support for biplane bombs back to Airstrike, I'll do preliminary 
suport for the content stuff i.e. biplane can have any content and
dropping drops whatever biplane has onboard...


	- Eero



More information about the airstrike mailing list