Initial import. master
authorSimon Morgan <sjm@sjm.io>
Sat, 20 Jun 2015 13:08:46 +0000 (14:08 +0100)
committerSimon Morgan <sjm@sjm.io>
Sat, 20 Jun 2015 13:08:46 +0000 (14:08 +0100)
361 files changed:
Marathon 2 Source ReadMe [new file with mode: 0644]
gpl.txt [new file with mode: 0644]
marathon2/.AppleDouble/.Parent [new file with mode: 0644]
marathon2/.AppleDouble/Icon_ [new file with mode: 0644]
marathon2/.AppleDouble/buildprogram [new file with mode: 0644]
marathon2/.AppleDouble/collection_definition.h [new file with mode: 0644]
marathon2/.AppleDouble/computer_interface.c [new file with mode: 0644]
marathon2/.AppleDouble/computer_interface.h [new file with mode: 0644]
marathon2/.AppleDouble/crc.c [new file with mode: 0644]
marathon2/.AppleDouble/crc.h [new file with mode: 0644]
marathon2/.AppleDouble/demos.make [new file with mode: 0644]
marathon2/.AppleDouble/devices.c [new file with mode: 0644]
marathon2/.AppleDouble/effect_definitions.h [new file with mode: 0644]
marathon2/.AppleDouble/effects.c [new file with mode: 0644]
marathon2/.AppleDouble/effects.h [new file with mode: 0644]
marathon2/.AppleDouble/export_definitions [new file with mode: 0644]
marathon2/.AppleDouble/export_definitions.c [new file with mode: 0644]
marathon2/.AppleDouble/export_definitions.make [new file with mode: 0644]
marathon2/.AppleDouble/extensions.h [new file with mode: 0644]
marathon2/.AppleDouble/fades.c [new file with mode: 0644]
marathon2/.AppleDouble/fades.h [new file with mode: 0644]
marathon2/.AppleDouble/files_macintosh.c [new file with mode: 0644]
marathon2/.AppleDouble/find_files.c [new file with mode: 0644]
marathon2/.AppleDouble/find_files.h [new file with mode: 0644]
marathon2/.AppleDouble/flood_map.c [new file with mode: 0644]
marathon2/.AppleDouble/flood_map.h [new file with mode: 0644]
marathon2/.AppleDouble/game_dialogs.c [new file with mode: 0644]
marathon2/.AppleDouble/game_errors.c [new file with mode: 0644]
marathon2/.AppleDouble/game_errors.h [new file with mode: 0644]
marathon2/.AppleDouble/game_wad.c [new file with mode: 0644]
marathon2/.AppleDouble/game_wad.h [new file with mode: 0644]
marathon2/.AppleDouble/game_window.c [new file with mode: 0644]
marathon2/.AppleDouble/game_window.h [new file with mode: 0644]
marathon2/.AppleDouble/game_window_macintosh.c [new file with mode: 0644]
marathon2/.AppleDouble/images.c [new file with mode: 0644]
marathon2/.AppleDouble/images.h [new file with mode: 0644]
marathon2/.AppleDouble/import_definitions.c [new file with mode: 0644]
marathon2/.AppleDouble/interface.c [new file with mode: 0644]
marathon2/.AppleDouble/interface.h [new file with mode: 0644]
marathon2/.AppleDouble/interface_editor [new file with mode: 0644]
marathon2/.AppleDouble/interface_macintosh.c [new file with mode: 0644]
marathon2/.AppleDouble/interface_menus.h [new file with mode: 0644]
marathon2/.AppleDouble/item_definitions.h [new file with mode: 0644]
marathon2/.AppleDouble/items.c [new file with mode: 0644]
marathon2/.AppleDouble/items.h [new file with mode: 0644]
marathon2/.AppleDouble/key_definitions.h [new file with mode: 0644]
marathon2/.AppleDouble/keyboard_dialog.c [new file with mode: 0644]
marathon2/.AppleDouble/lightsource.c [new file with mode: 0644]
marathon2/.AppleDouble/lightsource.h [new file with mode: 0644]
marathon2/.AppleDouble/low_level_textures.c [new file with mode: 0644]
marathon2/.AppleDouble/macintosh_network.h [new file with mode: 0644]
marathon2/.AppleDouble/makefile [new file with mode: 0644]
marathon2/.AppleDouble/map.c [new file with mode: 0644]
marathon2/.AppleDouble/map.h [new file with mode: 0644]
marathon2/.AppleDouble/map_accessors.c [new file with mode: 0644]
marathon2/.AppleDouble/map_constructors.c [new file with mode: 0644]
marathon2/.AppleDouble/marathon2.c [new file with mode: 0644]
marathon2/.AppleDouble/marathon2.r [new file with mode: 0644]
marathon2/.AppleDouble/media.c [new file with mode: 0644]
marathon2/.AppleDouble/media.h [new file with mode: 0644]
marathon2/.AppleDouble/media_definitions.h [new file with mode: 0644]
marathon2/.AppleDouble/monster_definitions.h [new file with mode: 0644]
marathon2/.AppleDouble/monsters.c [new file with mode: 0644]
marathon2/.AppleDouble/monsters.h [new file with mode: 0644]
marathon2/.AppleDouble/motion_sensor.c [new file with mode: 0644]
marathon2/.AppleDouble/motion_sensor.h [new file with mode: 0644]
marathon2/.AppleDouble/mouse.c [new file with mode: 0644]
marathon2/.AppleDouble/mouse.h [new file with mode: 0644]
marathon2/.AppleDouble/music.c [new file with mode: 0644]
marathon2/.AppleDouble/music.h [new file with mode: 0644]
marathon2/.AppleDouble/network.c [new file with mode: 0644]
marathon2/.AppleDouble/network.h [new file with mode: 0644]
marathon2/.AppleDouble/network_adsp.c [new file with mode: 0644]
marathon2/.AppleDouble/network_ddp.c [new file with mode: 0644]
marathon2/.AppleDouble/network_dialogs.c [new file with mode: 0644]
marathon2/.AppleDouble/network_games.c [new file with mode: 0644]
marathon2/.AppleDouble/network_games.h [new file with mode: 0644]
marathon2/.AppleDouble/network_listener.a [new file with mode: 0644]
marathon2/.AppleDouble/network_lookup.c [new file with mode: 0644]
marathon2/.AppleDouble/network_microphone.c [new file with mode: 0644]
marathon2/.AppleDouble/network_modem.c [new file with mode: 0644]
marathon2/.AppleDouble/network_modem.h [new file with mode: 0644]
marathon2/.AppleDouble/network_modem_protocol.c [new file with mode: 0644]
marathon2/.AppleDouble/network_modem_protocol.h [new file with mode: 0644]
marathon2/.AppleDouble/network_names.c [new file with mode: 0644]
marathon2/.AppleDouble/network_sound.h [new file with mode: 0644]
marathon2/.AppleDouble/network_speaker.c [new file with mode: 0644]
marathon2/.AppleDouble/network_stream.c [new file with mode: 0644]
marathon2/.AppleDouble/network_stream.h [new file with mode: 0644]
marathon2/.AppleDouble/overhead_map.c [new file with mode: 0644]
marathon2/.AppleDouble/overhead_map.h [new file with mode: 0644]
marathon2/.AppleDouble/overhead_map_macintosh.c [new file with mode: 0644]
marathon2/.AppleDouble/pathfinding.c [new file with mode: 0644]
marathon2/.AppleDouble/physics.c [new file with mode: 0644]
marathon2/.AppleDouble/physics_models.h [new file with mode: 0644]
marathon2/.AppleDouble/physics_patches.c [new file with mode: 0644]
marathon2/.AppleDouble/physics_patches.make [new file with mode: 0644]
marathon2/.AppleDouble/placement.c [new file with mode: 0644]
marathon2/.AppleDouble/platform_definitions.h [new file with mode: 0644]
marathon2/.AppleDouble/platforms.c [new file with mode: 0644]
marathon2/.AppleDouble/platforms.h [new file with mode: 0644]
marathon2/.AppleDouble/player.c [new file with mode: 0644]
marathon2/.AppleDouble/player.h [new file with mode: 0644]
marathon2/.AppleDouble/portable_files.h [new file with mode: 0644]
marathon2/.AppleDouble/preferences.c [new file with mode: 0644]
marathon2/.AppleDouble/preferences.h [new file with mode: 0644]
marathon2/.AppleDouble/preprocess_map_mac.c [new file with mode: 0644]
marathon2/.AppleDouble/progress.c [new file with mode: 0644]
marathon2/.AppleDouble/progress.h [new file with mode: 0644]
marathon2/.AppleDouble/projectile_definitions.h [new file with mode: 0644]
marathon2/.AppleDouble/projectiles.c [new file with mode: 0644]
marathon2/.AppleDouble/projectiles.h [new file with mode: 0644]
marathon2/.AppleDouble/quadruple.s [new file with mode: 0644]
marathon2/.AppleDouble/render.c [new file with mode: 0644]
marathon2/.AppleDouble/render.h [new file with mode: 0644]
marathon2/.AppleDouble/scenery.c [new file with mode: 0644]
marathon2/.AppleDouble/scenery.h [new file with mode: 0644]
marathon2/.AppleDouble/scenery_definitions.h [new file with mode: 0644]
marathon2/.AppleDouble/scottish_textures.a [new file with mode: 0644]
marathon2/.AppleDouble/scottish_textures.c [new file with mode: 0644]
marathon2/.AppleDouble/scottish_textures.h [new file with mode: 0644]
marathon2/.AppleDouble/scottish_textures16.a [new file with mode: 0644]
marathon2/.AppleDouble/screen.a [new file with mode: 0644]
marathon2/.AppleDouble/screen.c [new file with mode: 0644]
marathon2/.AppleDouble/screen.h [new file with mode: 0644]
marathon2/.AppleDouble/screen_definitions.h [new file with mode: 0644]
marathon2/.AppleDouble/screen_drawing.c [new file with mode: 0644]
marathon2/.AppleDouble/screen_drawing.h [new file with mode: 0644]
marathon2/.AppleDouble/shape_definitions.h [new file with mode: 0644]
marathon2/.AppleDouble/shape_descriptors.h [new file with mode: 0644]
marathon2/.AppleDouble/shapes.c [new file with mode: 0644]
marathon2/.AppleDouble/shapes.make [new file with mode: 0644]
marathon2/.AppleDouble/shapes_macintosh.c [new file with mode: 0644]
marathon2/.AppleDouble/shell.c [new file with mode: 0644]
marathon2/.AppleDouble/shell.h [new file with mode: 0644]
marathon2/.AppleDouble/song_definitions.h [new file with mode: 0644]
marathon2/.AppleDouble/sound.c [new file with mode: 0644]
marathon2/.AppleDouble/sound.h [new file with mode: 0644]
marathon2/.AppleDouble/sound_definitions.h [new file with mode: 0644]
marathon2/.AppleDouble/sound_macintosh.c [new file with mode: 0644]
marathon2/.AppleDouble/tags.h [new file with mode: 0644]
marathon2/.AppleDouble/texts.make [new file with mode: 0644]
marathon2/.AppleDouble/textures.c [new file with mode: 0644]
marathon2/.AppleDouble/textures.h [new file with mode: 0644]
marathon2/.AppleDouble/valkyrie.c [new file with mode: 0644]
marathon2/.AppleDouble/valkyrie.h [new file with mode: 0644]
marathon2/.AppleDouble/vbl.c [new file with mode: 0644]
marathon2/.AppleDouble/vbl.h [new file with mode: 0644]
marathon2/.AppleDouble/vbl_definitions.h [new file with mode: 0644]
marathon2/.AppleDouble/vbl_macintosh.c [new file with mode: 0644]
marathon2/.AppleDouble/wad.c [new file with mode: 0644]
marathon2/.AppleDouble/wad.h [new file with mode: 0644]
marathon2/.AppleDouble/wad_macintosh.c [new file with mode: 0644]
marathon2/.AppleDouble/wad_prefs.c [new file with mode: 0644]
marathon2/.AppleDouble/wad_prefs.h [new file with mode: 0644]
marathon2/.AppleDouble/wad_prefs_macintosh.c [new file with mode: 0644]
marathon2/.AppleDouble/weapon_definitions.h [new file with mode: 0644]
marathon2/.AppleDouble/weapons.c [new file with mode: 0644]
marathon2/.AppleDouble/weapons.h [new file with mode: 0644]
marathon2/.AppleDouble/world.c [new file with mode: 0644]
marathon2/.AppleDouble/world.h [new file with mode: 0644]
marathon2/Icon_ [new file with mode: 0644]
marathon2/binaries/.AppleDouble/.Parent [new file with mode: 0644]
marathon2/binaries/.AppleDouble/NotPPC [new file with mode: 0644]
marathon2/binaries/.AppleDouble/demo.resource [new file with mode: 0644]
marathon2/binaries/.AppleDouble/folder icon [new file with mode: 0644]
marathon2/binaries/.AppleDouble/game.resource [new file with mode: 0644]
marathon2/binaries/.AppleDouble/marathon2.resource [new file with mode: 0644]
marathon2/binaries/NotPPC [new file with mode: 0644]
marathon2/binaries/demo.resource [new file with mode: 0644]
marathon2/binaries/folder icon [new file with mode: 0644]
marathon2/binaries/game.resource [new file with mode: 0644]
marathon2/binaries/marathon2.resource [new file with mode: 0644]
marathon2/buildprogram [new file with mode: 0644]
marathon2/collection_definition.h [new file with mode: 0644]
marathon2/computer_interface.c [new file with mode: 0644]
marathon2/computer_interface.h [new file with mode: 0644]
marathon2/crc.c [new file with mode: 0644]
marathon2/crc.h [new file with mode: 0644]
marathon2/demos.demo/.AppleDouble/.Parent [new file with mode: 0644]
marathon2/demos.make [new file with mode: 0644]
marathon2/demos/.AppleDouble/.Parent [new file with mode: 0644]
marathon2/demos/.AppleDouble/L00.demo [new file with mode: 0644]
marathon2/demos/.AppleDouble/L01.demo [new file with mode: 0644]
marathon2/demos/.AppleDouble/L05.demo [new file with mode: 0644]
marathon2/demos/.AppleDouble/demos.resource [new file with mode: 0644]
marathon2/demos/L00.demo [new file with mode: 0644]
marathon2/demos/L01.demo [new file with mode: 0644]
marathon2/demos/L05.demo [new file with mode: 0644]
marathon2/demos/demos.resource [new file with mode: 0644]
marathon2/devices.c [new file with mode: 0644]
marathon2/editor code/.AppleDouble/.Parent [new file with mode: 0644]
marathon2/editor code/.AppleDouble/editor.h [new file with mode: 0644]
marathon2/editor code/editor.h [new file with mode: 0644]
marathon2/effect_definitions.h [new file with mode: 0644]
marathon2/effects.c [new file with mode: 0644]
marathon2/effects.h [new file with mode: 0644]
marathon2/export_definitions [new file with mode: 0644]
marathon2/export_definitions.c [new file with mode: 0644]
marathon2/export_definitions.make [new file with mode: 0644]
marathon2/extensions.h [new file with mode: 0644]
marathon2/extract/.AppleDouble/.Parent [new file with mode: 0644]
marathon2/extract/.AppleDouble/shapeextract [new file with mode: 0644]
marathon2/extract/.AppleDouble/shapeextract.c [new file with mode: 0644]
marathon2/extract/.AppleDouble/shapeextract.make [new file with mode: 0644]
marathon2/extract/.AppleDouble/sndextract [new file with mode: 0644]
marathon2/extract/.AppleDouble/sndextract.c [new file with mode: 0644]
marathon2/extract/.AppleDouble/sndextract.make [new file with mode: 0644]
marathon2/extract/shapeextract [new file with mode: 0644]
marathon2/extract/shapeextract.c [new file with mode: 0644]
marathon2/extract/shapeextract.make [new file with mode: 0644]
marathon2/extract/sndextract [new file with mode: 0644]
marathon2/extract/sndextract.c [new file with mode: 0644]
marathon2/extract/sndextract.make [new file with mode: 0644]
marathon2/fades.c [new file with mode: 0644]
marathon2/fades.h [new file with mode: 0644]
marathon2/files_macintosh.c [new file with mode: 0644]
marathon2/find_files.c [new file with mode: 0644]
marathon2/find_files.h [new file with mode: 0644]
marathon2/flood_map.c [new file with mode: 0644]
marathon2/flood_map.h [new file with mode: 0644]
marathon2/game_dialogs.c [new file with mode: 0644]
marathon2/game_errors.c [new file with mode: 0644]
marathon2/game_errors.h [new file with mode: 0644]
marathon2/game_wad.c [new file with mode: 0644]
marathon2/game_wad.h [new file with mode: 0644]
marathon2/game_window.c [new file with mode: 0644]
marathon2/game_window.h [new file with mode: 0644]
marathon2/game_window_macintosh.c [new file with mode: 0644]
marathon2/graphics/.AppleDouble/.Parent [new file with mode: 0644]
marathon2/graphics/.AppleDouble/demo.screens [new file with mode: 0644]
marathon2/graphics/.AppleDouble/game.screens [new file with mode: 0644]
marathon2/graphics/demo.screens [new file with mode: 0644]
marathon2/graphics/game.screens [new file with mode: 0644]
marathon2/images.c [new file with mode: 0644]
marathon2/images.h [new file with mode: 0644]
marathon2/import_definitions.c [new file with mode: 0644]
marathon2/interface.c [new file with mode: 0644]
marathon2/interface.h [new file with mode: 0644]
marathon2/interface_editor [new file with mode: 0644]
marathon2/interface_macintosh.c [new file with mode: 0644]
marathon2/interface_menus.h [new file with mode: 0644]
marathon2/item_definitions.h [new file with mode: 0644]
marathon2/items.c [new file with mode: 0644]
marathon2/items.h [new file with mode: 0644]
marathon2/key_definitions.h [new file with mode: 0644]
marathon2/keyboard_dialog.c [new file with mode: 0644]
marathon2/lightsource.c [new file with mode: 0644]
marathon2/lightsource.h [new file with mode: 0644]
marathon2/low_level_textures.c [new file with mode: 0644]
marathon2/macintosh_network.h [new file with mode: 0644]
marathon2/makefile [new file with mode: 0644]
marathon2/map.c [new file with mode: 0644]
marathon2/map.h [new file with mode: 0644]
marathon2/map_accessors.c [new file with mode: 0644]
marathon2/map_constructors.c [new file with mode: 0644]
marathon2/marathon2.c [new file with mode: 0644]
marathon2/marathon2.r [new file with mode: 0644]
marathon2/media.c [new file with mode: 0644]
marathon2/media.h [new file with mode: 0644]
marathon2/media_definitions.h [new file with mode: 0644]
marathon2/monster_definitions.h [new file with mode: 0644]
marathon2/monsters.c [new file with mode: 0644]
marathon2/monsters.h [new file with mode: 0644]
marathon2/motion_sensor.c [new file with mode: 0644]
marathon2/motion_sensor.h [new file with mode: 0644]
marathon2/mouse.c [new file with mode: 0644]
marathon2/mouse.h [new file with mode: 0644]
marathon2/music.c [new file with mode: 0644]
marathon2/music.h [new file with mode: 0644]
marathon2/network.c [new file with mode: 0644]
marathon2/network.h [new file with mode: 0644]
marathon2/network_adsp.c [new file with mode: 0644]
marathon2/network_ddp.c [new file with mode: 0644]
marathon2/network_dialogs.c [new file with mode: 0644]
marathon2/network_games.c [new file with mode: 0644]
marathon2/network_games.h [new file with mode: 0644]
marathon2/network_listener.a [new file with mode: 0644]
marathon2/network_lookup.c [new file with mode: 0644]
marathon2/network_microphone.c [new file with mode: 0644]
marathon2/network_modem.c [new file with mode: 0644]
marathon2/network_modem.h [new file with mode: 0644]
marathon2/network_modem_protocol.c [new file with mode: 0644]
marathon2/network_modem_protocol.h [new file with mode: 0644]
marathon2/network_names.c [new file with mode: 0644]
marathon2/network_sound.h [new file with mode: 0644]
marathon2/network_speaker.c [new file with mode: 0644]
marathon2/network_stream.c [new file with mode: 0644]
marathon2/network_stream.h [new file with mode: 0644]
marathon2/overhead_map.c [new file with mode: 0644]
marathon2/overhead_map.h [new file with mode: 0644]
marathon2/overhead_map_macintosh.c [new file with mode: 0644]
marathon2/pathfinding.c [new file with mode: 0644]
marathon2/physics.c [new file with mode: 0644]
marathon2/physics_models.h [new file with mode: 0644]
marathon2/physics_patches.c [new file with mode: 0644]
marathon2/physics_patches.make [new file with mode: 0644]
marathon2/placement.c [new file with mode: 0644]
marathon2/platform_definitions.h [new file with mode: 0644]
marathon2/platforms.c [new file with mode: 0644]
marathon2/platforms.h [new file with mode: 0644]
marathon2/player.c [new file with mode: 0644]
marathon2/player.h [new file with mode: 0644]
marathon2/portable_files.h [new file with mode: 0644]
marathon2/preferences.c [new file with mode: 0644]
marathon2/preferences.h [new file with mode: 0644]
marathon2/preprocess_map_mac.c [new file with mode: 0644]
marathon2/progress.c [new file with mode: 0644]
marathon2/progress.h [new file with mode: 0644]
marathon2/projectile_definitions.h [new file with mode: 0644]
marathon2/projectiles.c [new file with mode: 0644]
marathon2/projectiles.h [new file with mode: 0644]
marathon2/quadruple.s [new file with mode: 0644]
marathon2/render.c [new file with mode: 0644]
marathon2/render.h [new file with mode: 0644]
marathon2/scenery.c [new file with mode: 0644]
marathon2/scenery.h [new file with mode: 0644]
marathon2/scenery_definitions.h [new file with mode: 0644]
marathon2/scottish_textures.a [new file with mode: 0644]
marathon2/scottish_textures.c [new file with mode: 0644]
marathon2/scottish_textures.h [new file with mode: 0644]
marathon2/scottish_textures16.a [new file with mode: 0644]
marathon2/screen.a [new file with mode: 0644]
marathon2/screen.c [new file with mode: 0644]
marathon2/screen.h [new file with mode: 0644]
marathon2/screen_definitions.h [new file with mode: 0644]
marathon2/screen_drawing.c [new file with mode: 0644]
marathon2/screen_drawing.h [new file with mode: 0644]
marathon2/shape_definitions.h [new file with mode: 0644]
marathon2/shape_descriptors.h [new file with mode: 0644]
marathon2/shapes.c [new file with mode: 0644]
marathon2/shapes.make [new file with mode: 0644]
marathon2/shapes_macintosh.c [new file with mode: 0644]
marathon2/shell.c [new file with mode: 0644]
marathon2/shell.h [new file with mode: 0644]
marathon2/song_definitions.h [new file with mode: 0644]
marathon2/sound.c [new file with mode: 0644]
marathon2/sound.h [new file with mode: 0644]
marathon2/sound_definitions.h [new file with mode: 0644]
marathon2/sound_macintosh.c [new file with mode: 0644]
marathon2/tags.h [new file with mode: 0644]
marathon2/texts.make [new file with mode: 0644]
marathon2/textures.c [new file with mode: 0644]
marathon2/textures.h [new file with mode: 0644]
marathon2/valkyrie.c [new file with mode: 0644]
marathon2/valkyrie.h [new file with mode: 0644]
marathon2/vbl.c [new file with mode: 0644]
marathon2/vbl.h [new file with mode: 0644]
marathon2/vbl_definitions.h [new file with mode: 0644]
marathon2/vbl_macintosh.c [new file with mode: 0644]
marathon2/wad.c [new file with mode: 0644]
marathon2/wad.h [new file with mode: 0644]
marathon2/wad_macintosh.c [new file with mode: 0644]
marathon2/wad_prefs.c [new file with mode: 0644]
marathon2/wad_prefs.h [new file with mode: 0644]
marathon2/wad_prefs_macintosh.c [new file with mode: 0644]
marathon2/weapon_definitions.h [new file with mode: 0644]
marathon2/weapons.c [new file with mode: 0644]
marathon2/weapons.h [new file with mode: 0644]
marathon2/world.c [new file with mode: 0644]
marathon2/world.h [new file with mode: 0644]

diff --git a/Marathon 2 Source ReadMe b/Marathon 2 Source ReadMe
new file mode 100644 (file)
index 0000000..27aeb03
--- /dev/null
@@ -0,0 +1 @@
+So here it is, the mysterious #2 you've heard so much about: the source code for Marathon 2: Durandal. Now all you mad hackers can see how it was done, and nod admiringly or shiver in terror as the situation may demand.\r\rThis code is issued under the GNU Public License.  Please read the license (a copy is enclosed in the same directory as this ReadMe) and abide by its terms.\r\rThe following are some things to keep in mind when using and perusing this source code:\r\r1. As noted in the license agreement, this code is provided as-is.  We're not in a position to offer coding support, so please don't call or email us asking for help or explanations.  If you're not a programmer you should probably delete this and get on with your life.  Even experienced coders are going to find some of this pretty hairy.\r\r2. These are MPW files, because Macintosh Programmer's Workshop is what we used back in the day.  Getting these files to compile under any development environment will require some effort on your part, as certain bits (like the serial number algorithm) have been removed.\r\r3. This is real code written by real programmers and as such contains real language, sometimes in variable names where it's impossible to avoid.  If you (or your parents) are especially sensitive to four-letter words, please consider perusing some of the profanity-free source code available on the net, such as "Hello World."\r\r4. This is the Mac source.  The sole known archive of the Windows 9x source was placed in a lead box and shipped to one of our island laboratories for safekeeping.  Unbeknownst to us, the boat carrying the box made an unscheduled run up the coast of Madagascar, where the ship's captain hoped to catch the end of the annual Miss Middle Of Nowhere pageant.   The ship was approximately six miles from shore when it was torpedoed by a one-man sub purchased from the Hammacher-Schlemmer catalog by a punter with more money than brains.  Divers are still combing the sea floor looking for the box containing the Windows code, and if we ever find it I'm sure we'll let you know.  Windows hackers with lots of spare time may still be able to do interesting things with this code.\r\r\rIf you manage to do anything cool with this code, please let us know so we can download it and check it out.\r\rRegards,\r\rMatthew Soell\rDirector of Customer Support\rBungie Software\rJanuary 17, 2000\r(1/17/2000 = 1 + 1 + 7 + 2 + 0 + 0 + 0 = 11 = 1 + 1 = #2)\r
\ No newline at end of file
diff --git a/gpl.txt b/gpl.txt
new file mode 100644 (file)
index 0000000..60549be
--- /dev/null
+++ b/gpl.txt
@@ -0,0 +1,340 @@
+                   GNU GENERAL PUBLIC LICENSE
+                      Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+                       59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                           Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+\f
+                   GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+\f
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+\f
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+\f
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+                           NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+                    END OF TERMS AND CONDITIONS
+\f
+           How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) 19yy  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) 19yy name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/marathon2/.AppleDouble/.Parent b/marathon2/.AppleDouble/.Parent
new file mode 100644 (file)
index 0000000..ed33fcb
Binary files /dev/null and b/marathon2/.AppleDouble/.Parent differ
diff --git a/marathon2/.AppleDouble/Icon_ b/marathon2/.AppleDouble/Icon_
new file mode 100644 (file)
index 0000000..d0e3781
Binary files /dev/null and b/marathon2/.AppleDouble/Icon_ differ
diff --git a/marathon2/.AppleDouble/buildprogram b/marathon2/.AppleDouble/buildprogram
new file mode 100644 (file)
index 0000000..2398220
Binary files /dev/null and b/marathon2/.AppleDouble/buildprogram differ
diff --git a/marathon2/.AppleDouble/collection_definition.h b/marathon2/.AppleDouble/collection_definition.h
new file mode 100644 (file)
index 0000000..838ce99
Binary files /dev/null and b/marathon2/.AppleDouble/collection_definition.h differ
diff --git a/marathon2/.AppleDouble/computer_interface.c b/marathon2/.AppleDouble/computer_interface.c
new file mode 100644 (file)
index 0000000..107c96b
Binary files /dev/null and b/marathon2/.AppleDouble/computer_interface.c differ
diff --git a/marathon2/.AppleDouble/computer_interface.h b/marathon2/.AppleDouble/computer_interface.h
new file mode 100644 (file)
index 0000000..472dfee
Binary files /dev/null and b/marathon2/.AppleDouble/computer_interface.h differ
diff --git a/marathon2/.AppleDouble/crc.c b/marathon2/.AppleDouble/crc.c
new file mode 100644 (file)
index 0000000..7c193fa
Binary files /dev/null and b/marathon2/.AppleDouble/crc.c differ
diff --git a/marathon2/.AppleDouble/crc.h b/marathon2/.AppleDouble/crc.h
new file mode 100644 (file)
index 0000000..74754e5
Binary files /dev/null and b/marathon2/.AppleDouble/crc.h differ
diff --git a/marathon2/.AppleDouble/demos.make b/marathon2/.AppleDouble/demos.make
new file mode 100644 (file)
index 0000000..4c9bc64
Binary files /dev/null and b/marathon2/.AppleDouble/demos.make differ
diff --git a/marathon2/.AppleDouble/devices.c b/marathon2/.AppleDouble/devices.c
new file mode 100644 (file)
index 0000000..7947d33
Binary files /dev/null and b/marathon2/.AppleDouble/devices.c differ
diff --git a/marathon2/.AppleDouble/effect_definitions.h b/marathon2/.AppleDouble/effect_definitions.h
new file mode 100644 (file)
index 0000000..6bcac08
Binary files /dev/null and b/marathon2/.AppleDouble/effect_definitions.h differ
diff --git a/marathon2/.AppleDouble/effects.c b/marathon2/.AppleDouble/effects.c
new file mode 100644 (file)
index 0000000..323fb9e
Binary files /dev/null and b/marathon2/.AppleDouble/effects.c differ
diff --git a/marathon2/.AppleDouble/effects.h b/marathon2/.AppleDouble/effects.h
new file mode 100644 (file)
index 0000000..e245e70
Binary files /dev/null and b/marathon2/.AppleDouble/effects.h differ
diff --git a/marathon2/.AppleDouble/export_definitions b/marathon2/.AppleDouble/export_definitions
new file mode 100644 (file)
index 0000000..5545056
Binary files /dev/null and b/marathon2/.AppleDouble/export_definitions differ
diff --git a/marathon2/.AppleDouble/export_definitions.c b/marathon2/.AppleDouble/export_definitions.c
new file mode 100644 (file)
index 0000000..f931206
Binary files /dev/null and b/marathon2/.AppleDouble/export_definitions.c differ
diff --git a/marathon2/.AppleDouble/export_definitions.make b/marathon2/.AppleDouble/export_definitions.make
new file mode 100644 (file)
index 0000000..12a90ac
Binary files /dev/null and b/marathon2/.AppleDouble/export_definitions.make differ
diff --git a/marathon2/.AppleDouble/extensions.h b/marathon2/.AppleDouble/extensions.h
new file mode 100644 (file)
index 0000000..9473e68
Binary files /dev/null and b/marathon2/.AppleDouble/extensions.h differ
diff --git a/marathon2/.AppleDouble/fades.c b/marathon2/.AppleDouble/fades.c
new file mode 100644 (file)
index 0000000..307cd31
Binary files /dev/null and b/marathon2/.AppleDouble/fades.c differ
diff --git a/marathon2/.AppleDouble/fades.h b/marathon2/.AppleDouble/fades.h
new file mode 100644 (file)
index 0000000..120604e
Binary files /dev/null and b/marathon2/.AppleDouble/fades.h differ
diff --git a/marathon2/.AppleDouble/files_macintosh.c b/marathon2/.AppleDouble/files_macintosh.c
new file mode 100644 (file)
index 0000000..0c752f2
Binary files /dev/null and b/marathon2/.AppleDouble/files_macintosh.c differ
diff --git a/marathon2/.AppleDouble/find_files.c b/marathon2/.AppleDouble/find_files.c
new file mode 100644 (file)
index 0000000..7c9ae51
Binary files /dev/null and b/marathon2/.AppleDouble/find_files.c differ
diff --git a/marathon2/.AppleDouble/find_files.h b/marathon2/.AppleDouble/find_files.h
new file mode 100644 (file)
index 0000000..3098e81
Binary files /dev/null and b/marathon2/.AppleDouble/find_files.h differ
diff --git a/marathon2/.AppleDouble/flood_map.c b/marathon2/.AppleDouble/flood_map.c
new file mode 100644 (file)
index 0000000..a1e0e0b
Binary files /dev/null and b/marathon2/.AppleDouble/flood_map.c differ
diff --git a/marathon2/.AppleDouble/flood_map.h b/marathon2/.AppleDouble/flood_map.h
new file mode 100644 (file)
index 0000000..fa5c576
Binary files /dev/null and b/marathon2/.AppleDouble/flood_map.h differ
diff --git a/marathon2/.AppleDouble/game_dialogs.c b/marathon2/.AppleDouble/game_dialogs.c
new file mode 100644 (file)
index 0000000..4d6060e
Binary files /dev/null and b/marathon2/.AppleDouble/game_dialogs.c differ
diff --git a/marathon2/.AppleDouble/game_errors.c b/marathon2/.AppleDouble/game_errors.c
new file mode 100644 (file)
index 0000000..da1fc20
Binary files /dev/null and b/marathon2/.AppleDouble/game_errors.c differ
diff --git a/marathon2/.AppleDouble/game_errors.h b/marathon2/.AppleDouble/game_errors.h
new file mode 100644 (file)
index 0000000..0d97c56
Binary files /dev/null and b/marathon2/.AppleDouble/game_errors.h differ
diff --git a/marathon2/.AppleDouble/game_wad.c b/marathon2/.AppleDouble/game_wad.c
new file mode 100644 (file)
index 0000000..01a4bd9
Binary files /dev/null and b/marathon2/.AppleDouble/game_wad.c differ
diff --git a/marathon2/.AppleDouble/game_wad.h b/marathon2/.AppleDouble/game_wad.h
new file mode 100644 (file)
index 0000000..b578786
Binary files /dev/null and b/marathon2/.AppleDouble/game_wad.h differ
diff --git a/marathon2/.AppleDouble/game_window.c b/marathon2/.AppleDouble/game_window.c
new file mode 100644 (file)
index 0000000..58e003b
Binary files /dev/null and b/marathon2/.AppleDouble/game_window.c differ
diff --git a/marathon2/.AppleDouble/game_window.h b/marathon2/.AppleDouble/game_window.h
new file mode 100644 (file)
index 0000000..3e11134
Binary files /dev/null and b/marathon2/.AppleDouble/game_window.h differ
diff --git a/marathon2/.AppleDouble/game_window_macintosh.c b/marathon2/.AppleDouble/game_window_macintosh.c
new file mode 100644 (file)
index 0000000..8532289
Binary files /dev/null and b/marathon2/.AppleDouble/game_window_macintosh.c differ
diff --git a/marathon2/.AppleDouble/images.c b/marathon2/.AppleDouble/images.c
new file mode 100644 (file)
index 0000000..62125d4
Binary files /dev/null and b/marathon2/.AppleDouble/images.c differ
diff --git a/marathon2/.AppleDouble/images.h b/marathon2/.AppleDouble/images.h
new file mode 100644 (file)
index 0000000..ba64e72
Binary files /dev/null and b/marathon2/.AppleDouble/images.h differ
diff --git a/marathon2/.AppleDouble/import_definitions.c b/marathon2/.AppleDouble/import_definitions.c
new file mode 100644 (file)
index 0000000..b3407ca
Binary files /dev/null and b/marathon2/.AppleDouble/import_definitions.c differ
diff --git a/marathon2/.AppleDouble/interface.c b/marathon2/.AppleDouble/interface.c
new file mode 100644 (file)
index 0000000..f2eeccc
Binary files /dev/null and b/marathon2/.AppleDouble/interface.c differ
diff --git a/marathon2/.AppleDouble/interface.h b/marathon2/.AppleDouble/interface.h
new file mode 100644 (file)
index 0000000..56563df
Binary files /dev/null and b/marathon2/.AppleDouble/interface.h differ
diff --git a/marathon2/.AppleDouble/interface_editor b/marathon2/.AppleDouble/interface_editor
new file mode 100644 (file)
index 0000000..c869ac3
Binary files /dev/null and b/marathon2/.AppleDouble/interface_editor differ
diff --git a/marathon2/.AppleDouble/interface_macintosh.c b/marathon2/.AppleDouble/interface_macintosh.c
new file mode 100644 (file)
index 0000000..53162db
Binary files /dev/null and b/marathon2/.AppleDouble/interface_macintosh.c differ
diff --git a/marathon2/.AppleDouble/interface_menus.h b/marathon2/.AppleDouble/interface_menus.h
new file mode 100644 (file)
index 0000000..c9f1f44
Binary files /dev/null and b/marathon2/.AppleDouble/interface_menus.h differ
diff --git a/marathon2/.AppleDouble/item_definitions.h b/marathon2/.AppleDouble/item_definitions.h
new file mode 100644 (file)
index 0000000..b16cc35
Binary files /dev/null and b/marathon2/.AppleDouble/item_definitions.h differ
diff --git a/marathon2/.AppleDouble/items.c b/marathon2/.AppleDouble/items.c
new file mode 100644 (file)
index 0000000..173848c
Binary files /dev/null and b/marathon2/.AppleDouble/items.c differ
diff --git a/marathon2/.AppleDouble/items.h b/marathon2/.AppleDouble/items.h
new file mode 100644 (file)
index 0000000..c86fde7
Binary files /dev/null and b/marathon2/.AppleDouble/items.h differ
diff --git a/marathon2/.AppleDouble/key_definitions.h b/marathon2/.AppleDouble/key_definitions.h
new file mode 100644 (file)
index 0000000..b7a2b15
Binary files /dev/null and b/marathon2/.AppleDouble/key_definitions.h differ
diff --git a/marathon2/.AppleDouble/keyboard_dialog.c b/marathon2/.AppleDouble/keyboard_dialog.c
new file mode 100644 (file)
index 0000000..be10cd2
Binary files /dev/null and b/marathon2/.AppleDouble/keyboard_dialog.c differ
diff --git a/marathon2/.AppleDouble/lightsource.c b/marathon2/.AppleDouble/lightsource.c
new file mode 100644 (file)
index 0000000..a2fa4d6
Binary files /dev/null and b/marathon2/.AppleDouble/lightsource.c differ
diff --git a/marathon2/.AppleDouble/lightsource.h b/marathon2/.AppleDouble/lightsource.h
new file mode 100644 (file)
index 0000000..2653694
Binary files /dev/null and b/marathon2/.AppleDouble/lightsource.h differ
diff --git a/marathon2/.AppleDouble/low_level_textures.c b/marathon2/.AppleDouble/low_level_textures.c
new file mode 100644 (file)
index 0000000..6ab4d36
Binary files /dev/null and b/marathon2/.AppleDouble/low_level_textures.c differ
diff --git a/marathon2/.AppleDouble/macintosh_network.h b/marathon2/.AppleDouble/macintosh_network.h
new file mode 100644 (file)
index 0000000..a689823
Binary files /dev/null and b/marathon2/.AppleDouble/macintosh_network.h differ
diff --git a/marathon2/.AppleDouble/makefile b/marathon2/.AppleDouble/makefile
new file mode 100644 (file)
index 0000000..8287873
Binary files /dev/null and b/marathon2/.AppleDouble/makefile differ
diff --git a/marathon2/.AppleDouble/map.c b/marathon2/.AppleDouble/map.c
new file mode 100644 (file)
index 0000000..a651514
Binary files /dev/null and b/marathon2/.AppleDouble/map.c differ
diff --git a/marathon2/.AppleDouble/map.h b/marathon2/.AppleDouble/map.h
new file mode 100644 (file)
index 0000000..480a391
Binary files /dev/null and b/marathon2/.AppleDouble/map.h differ
diff --git a/marathon2/.AppleDouble/map_accessors.c b/marathon2/.AppleDouble/map_accessors.c
new file mode 100644 (file)
index 0000000..0dad58e
Binary files /dev/null and b/marathon2/.AppleDouble/map_accessors.c differ
diff --git a/marathon2/.AppleDouble/map_constructors.c b/marathon2/.AppleDouble/map_constructors.c
new file mode 100644 (file)
index 0000000..9a7a1c4
Binary files /dev/null and b/marathon2/.AppleDouble/map_constructors.c differ
diff --git a/marathon2/.AppleDouble/marathon2.c b/marathon2/.AppleDouble/marathon2.c
new file mode 100644 (file)
index 0000000..8ba34b4
Binary files /dev/null and b/marathon2/.AppleDouble/marathon2.c differ
diff --git a/marathon2/.AppleDouble/marathon2.r b/marathon2/.AppleDouble/marathon2.r
new file mode 100644 (file)
index 0000000..6d55397
Binary files /dev/null and b/marathon2/.AppleDouble/marathon2.r differ
diff --git a/marathon2/.AppleDouble/media.c b/marathon2/.AppleDouble/media.c
new file mode 100644 (file)
index 0000000..a7c2a8e
Binary files /dev/null and b/marathon2/.AppleDouble/media.c differ
diff --git a/marathon2/.AppleDouble/media.h b/marathon2/.AppleDouble/media.h
new file mode 100644 (file)
index 0000000..a510a41
Binary files /dev/null and b/marathon2/.AppleDouble/media.h differ
diff --git a/marathon2/.AppleDouble/media_definitions.h b/marathon2/.AppleDouble/media_definitions.h
new file mode 100644 (file)
index 0000000..3f72d2d
Binary files /dev/null and b/marathon2/.AppleDouble/media_definitions.h differ
diff --git a/marathon2/.AppleDouble/monster_definitions.h b/marathon2/.AppleDouble/monster_definitions.h
new file mode 100644 (file)
index 0000000..5ac8a56
Binary files /dev/null and b/marathon2/.AppleDouble/monster_definitions.h differ
diff --git a/marathon2/.AppleDouble/monsters.c b/marathon2/.AppleDouble/monsters.c
new file mode 100644 (file)
index 0000000..e2fed9c
Binary files /dev/null and b/marathon2/.AppleDouble/monsters.c differ
diff --git a/marathon2/.AppleDouble/monsters.h b/marathon2/.AppleDouble/monsters.h
new file mode 100644 (file)
index 0000000..f2a6b9d
Binary files /dev/null and b/marathon2/.AppleDouble/monsters.h differ
diff --git a/marathon2/.AppleDouble/motion_sensor.c b/marathon2/.AppleDouble/motion_sensor.c
new file mode 100644 (file)
index 0000000..e8ea9d9
Binary files /dev/null and b/marathon2/.AppleDouble/motion_sensor.c differ
diff --git a/marathon2/.AppleDouble/motion_sensor.h b/marathon2/.AppleDouble/motion_sensor.h
new file mode 100644 (file)
index 0000000..c9d2c9c
Binary files /dev/null and b/marathon2/.AppleDouble/motion_sensor.h differ
diff --git a/marathon2/.AppleDouble/mouse.c b/marathon2/.AppleDouble/mouse.c
new file mode 100644 (file)
index 0000000..0c72e93
Binary files /dev/null and b/marathon2/.AppleDouble/mouse.c differ
diff --git a/marathon2/.AppleDouble/mouse.h b/marathon2/.AppleDouble/mouse.h
new file mode 100644 (file)
index 0000000..2bb934b
Binary files /dev/null and b/marathon2/.AppleDouble/mouse.h differ
diff --git a/marathon2/.AppleDouble/music.c b/marathon2/.AppleDouble/music.c
new file mode 100644 (file)
index 0000000..10b6109
Binary files /dev/null and b/marathon2/.AppleDouble/music.c differ
diff --git a/marathon2/.AppleDouble/music.h b/marathon2/.AppleDouble/music.h
new file mode 100644 (file)
index 0000000..1dd404b
Binary files /dev/null and b/marathon2/.AppleDouble/music.h differ
diff --git a/marathon2/.AppleDouble/network.c b/marathon2/.AppleDouble/network.c
new file mode 100644 (file)
index 0000000..091693f
Binary files /dev/null and b/marathon2/.AppleDouble/network.c differ
diff --git a/marathon2/.AppleDouble/network.h b/marathon2/.AppleDouble/network.h
new file mode 100644 (file)
index 0000000..4450958
Binary files /dev/null and b/marathon2/.AppleDouble/network.h differ
diff --git a/marathon2/.AppleDouble/network_adsp.c b/marathon2/.AppleDouble/network_adsp.c
new file mode 100644 (file)
index 0000000..90caa28
Binary files /dev/null and b/marathon2/.AppleDouble/network_adsp.c differ
diff --git a/marathon2/.AppleDouble/network_ddp.c b/marathon2/.AppleDouble/network_ddp.c
new file mode 100644 (file)
index 0000000..263cdd4
Binary files /dev/null and b/marathon2/.AppleDouble/network_ddp.c differ
diff --git a/marathon2/.AppleDouble/network_dialogs.c b/marathon2/.AppleDouble/network_dialogs.c
new file mode 100644 (file)
index 0000000..5250e08
Binary files /dev/null and b/marathon2/.AppleDouble/network_dialogs.c differ
diff --git a/marathon2/.AppleDouble/network_games.c b/marathon2/.AppleDouble/network_games.c
new file mode 100644 (file)
index 0000000..6544d6f
Binary files /dev/null and b/marathon2/.AppleDouble/network_games.c differ
diff --git a/marathon2/.AppleDouble/network_games.h b/marathon2/.AppleDouble/network_games.h
new file mode 100644 (file)
index 0000000..925073f
Binary files /dev/null and b/marathon2/.AppleDouble/network_games.h differ
diff --git a/marathon2/.AppleDouble/network_listener.a b/marathon2/.AppleDouble/network_listener.a
new file mode 100644 (file)
index 0000000..5e72d6b
Binary files /dev/null and b/marathon2/.AppleDouble/network_listener.a differ
diff --git a/marathon2/.AppleDouble/network_lookup.c b/marathon2/.AppleDouble/network_lookup.c
new file mode 100644 (file)
index 0000000..d36d9f3
Binary files /dev/null and b/marathon2/.AppleDouble/network_lookup.c differ
diff --git a/marathon2/.AppleDouble/network_microphone.c b/marathon2/.AppleDouble/network_microphone.c
new file mode 100644 (file)
index 0000000..4bc0cf1
Binary files /dev/null and b/marathon2/.AppleDouble/network_microphone.c differ
diff --git a/marathon2/.AppleDouble/network_modem.c b/marathon2/.AppleDouble/network_modem.c
new file mode 100644 (file)
index 0000000..8290d6c
Binary files /dev/null and b/marathon2/.AppleDouble/network_modem.c differ
diff --git a/marathon2/.AppleDouble/network_modem.h b/marathon2/.AppleDouble/network_modem.h
new file mode 100644 (file)
index 0000000..b1b1b9f
Binary files /dev/null and b/marathon2/.AppleDouble/network_modem.h differ
diff --git a/marathon2/.AppleDouble/network_modem_protocol.c b/marathon2/.AppleDouble/network_modem_protocol.c
new file mode 100644 (file)
index 0000000..3dffd2e
Binary files /dev/null and b/marathon2/.AppleDouble/network_modem_protocol.c differ
diff --git a/marathon2/.AppleDouble/network_modem_protocol.h b/marathon2/.AppleDouble/network_modem_protocol.h
new file mode 100644 (file)
index 0000000..914c4d4
Binary files /dev/null and b/marathon2/.AppleDouble/network_modem_protocol.h differ
diff --git a/marathon2/.AppleDouble/network_names.c b/marathon2/.AppleDouble/network_names.c
new file mode 100644 (file)
index 0000000..815600d
Binary files /dev/null and b/marathon2/.AppleDouble/network_names.c differ
diff --git a/marathon2/.AppleDouble/network_sound.h b/marathon2/.AppleDouble/network_sound.h
new file mode 100644 (file)
index 0000000..b5d02a4
Binary files /dev/null and b/marathon2/.AppleDouble/network_sound.h differ
diff --git a/marathon2/.AppleDouble/network_speaker.c b/marathon2/.AppleDouble/network_speaker.c
new file mode 100644 (file)
index 0000000..b04b847
Binary files /dev/null and b/marathon2/.AppleDouble/network_speaker.c differ
diff --git a/marathon2/.AppleDouble/network_stream.c b/marathon2/.AppleDouble/network_stream.c
new file mode 100644 (file)
index 0000000..38bc0b0
Binary files /dev/null and b/marathon2/.AppleDouble/network_stream.c differ
diff --git a/marathon2/.AppleDouble/network_stream.h b/marathon2/.AppleDouble/network_stream.h
new file mode 100644 (file)
index 0000000..d2d09c4
Binary files /dev/null and b/marathon2/.AppleDouble/network_stream.h differ
diff --git a/marathon2/.AppleDouble/overhead_map.c b/marathon2/.AppleDouble/overhead_map.c
new file mode 100644 (file)
index 0000000..bf0e94c
Binary files /dev/null and b/marathon2/.AppleDouble/overhead_map.c differ
diff --git a/marathon2/.AppleDouble/overhead_map.h b/marathon2/.AppleDouble/overhead_map.h
new file mode 100644 (file)
index 0000000..7d8855b
Binary files /dev/null and b/marathon2/.AppleDouble/overhead_map.h differ
diff --git a/marathon2/.AppleDouble/overhead_map_macintosh.c b/marathon2/.AppleDouble/overhead_map_macintosh.c
new file mode 100644 (file)
index 0000000..f39afa7
Binary files /dev/null and b/marathon2/.AppleDouble/overhead_map_macintosh.c differ
diff --git a/marathon2/.AppleDouble/pathfinding.c b/marathon2/.AppleDouble/pathfinding.c
new file mode 100644 (file)
index 0000000..a43358f
Binary files /dev/null and b/marathon2/.AppleDouble/pathfinding.c differ
diff --git a/marathon2/.AppleDouble/physics.c b/marathon2/.AppleDouble/physics.c
new file mode 100644 (file)
index 0000000..945207a
Binary files /dev/null and b/marathon2/.AppleDouble/physics.c differ
diff --git a/marathon2/.AppleDouble/physics_models.h b/marathon2/.AppleDouble/physics_models.h
new file mode 100644 (file)
index 0000000..9c171c9
Binary files /dev/null and b/marathon2/.AppleDouble/physics_models.h differ
diff --git a/marathon2/.AppleDouble/physics_patches.c b/marathon2/.AppleDouble/physics_patches.c
new file mode 100644 (file)
index 0000000..39188f9
Binary files /dev/null and b/marathon2/.AppleDouble/physics_patches.c differ
diff --git a/marathon2/.AppleDouble/physics_patches.make b/marathon2/.AppleDouble/physics_patches.make
new file mode 100644 (file)
index 0000000..2629ceb
Binary files /dev/null and b/marathon2/.AppleDouble/physics_patches.make differ
diff --git a/marathon2/.AppleDouble/placement.c b/marathon2/.AppleDouble/placement.c
new file mode 100644 (file)
index 0000000..7d25581
Binary files /dev/null and b/marathon2/.AppleDouble/placement.c differ
diff --git a/marathon2/.AppleDouble/platform_definitions.h b/marathon2/.AppleDouble/platform_definitions.h
new file mode 100644 (file)
index 0000000..98287ae
Binary files /dev/null and b/marathon2/.AppleDouble/platform_definitions.h differ
diff --git a/marathon2/.AppleDouble/platforms.c b/marathon2/.AppleDouble/platforms.c
new file mode 100644 (file)
index 0000000..0fb2ba5
Binary files /dev/null and b/marathon2/.AppleDouble/platforms.c differ
diff --git a/marathon2/.AppleDouble/platforms.h b/marathon2/.AppleDouble/platforms.h
new file mode 100644 (file)
index 0000000..5360c15
Binary files /dev/null and b/marathon2/.AppleDouble/platforms.h differ
diff --git a/marathon2/.AppleDouble/player.c b/marathon2/.AppleDouble/player.c
new file mode 100644 (file)
index 0000000..6a0a13e
Binary files /dev/null and b/marathon2/.AppleDouble/player.c differ
diff --git a/marathon2/.AppleDouble/player.h b/marathon2/.AppleDouble/player.h
new file mode 100644 (file)
index 0000000..d8e6505
Binary files /dev/null and b/marathon2/.AppleDouble/player.h differ
diff --git a/marathon2/.AppleDouble/portable_files.h b/marathon2/.AppleDouble/portable_files.h
new file mode 100644 (file)
index 0000000..33d1c07
Binary files /dev/null and b/marathon2/.AppleDouble/portable_files.h differ
diff --git a/marathon2/.AppleDouble/preferences.c b/marathon2/.AppleDouble/preferences.c
new file mode 100644 (file)
index 0000000..93f7ee6
Binary files /dev/null and b/marathon2/.AppleDouble/preferences.c differ
diff --git a/marathon2/.AppleDouble/preferences.h b/marathon2/.AppleDouble/preferences.h
new file mode 100644 (file)
index 0000000..96e87e1
Binary files /dev/null and b/marathon2/.AppleDouble/preferences.h differ
diff --git a/marathon2/.AppleDouble/preprocess_map_mac.c b/marathon2/.AppleDouble/preprocess_map_mac.c
new file mode 100644 (file)
index 0000000..4141081
Binary files /dev/null and b/marathon2/.AppleDouble/preprocess_map_mac.c differ
diff --git a/marathon2/.AppleDouble/progress.c b/marathon2/.AppleDouble/progress.c
new file mode 100644 (file)
index 0000000..019621f
Binary files /dev/null and b/marathon2/.AppleDouble/progress.c differ
diff --git a/marathon2/.AppleDouble/progress.h b/marathon2/.AppleDouble/progress.h
new file mode 100644 (file)
index 0000000..51e9d7d
Binary files /dev/null and b/marathon2/.AppleDouble/progress.h differ
diff --git a/marathon2/.AppleDouble/projectile_definitions.h b/marathon2/.AppleDouble/projectile_definitions.h
new file mode 100644 (file)
index 0000000..91ca0a6
Binary files /dev/null and b/marathon2/.AppleDouble/projectile_definitions.h differ
diff --git a/marathon2/.AppleDouble/projectiles.c b/marathon2/.AppleDouble/projectiles.c
new file mode 100644 (file)
index 0000000..dc03537
Binary files /dev/null and b/marathon2/.AppleDouble/projectiles.c differ
diff --git a/marathon2/.AppleDouble/projectiles.h b/marathon2/.AppleDouble/projectiles.h
new file mode 100644 (file)
index 0000000..e6cde66
Binary files /dev/null and b/marathon2/.AppleDouble/projectiles.h differ
diff --git a/marathon2/.AppleDouble/quadruple.s b/marathon2/.AppleDouble/quadruple.s
new file mode 100644 (file)
index 0000000..9ab5917
Binary files /dev/null and b/marathon2/.AppleDouble/quadruple.s differ
diff --git a/marathon2/.AppleDouble/render.c b/marathon2/.AppleDouble/render.c
new file mode 100644 (file)
index 0000000..cc7de00
Binary files /dev/null and b/marathon2/.AppleDouble/render.c differ
diff --git a/marathon2/.AppleDouble/render.h b/marathon2/.AppleDouble/render.h
new file mode 100644 (file)
index 0000000..8ee2acf
Binary files /dev/null and b/marathon2/.AppleDouble/render.h differ
diff --git a/marathon2/.AppleDouble/scenery.c b/marathon2/.AppleDouble/scenery.c
new file mode 100644 (file)
index 0000000..52d46ee
Binary files /dev/null and b/marathon2/.AppleDouble/scenery.c differ
diff --git a/marathon2/.AppleDouble/scenery.h b/marathon2/.AppleDouble/scenery.h
new file mode 100644 (file)
index 0000000..7828ed9
Binary files /dev/null and b/marathon2/.AppleDouble/scenery.h differ
diff --git a/marathon2/.AppleDouble/scenery_definitions.h b/marathon2/.AppleDouble/scenery_definitions.h
new file mode 100644 (file)
index 0000000..f450084
Binary files /dev/null and b/marathon2/.AppleDouble/scenery_definitions.h differ
diff --git a/marathon2/.AppleDouble/scottish_textures.a b/marathon2/.AppleDouble/scottish_textures.a
new file mode 100644 (file)
index 0000000..f1cca69
Binary files /dev/null and b/marathon2/.AppleDouble/scottish_textures.a differ
diff --git a/marathon2/.AppleDouble/scottish_textures.c b/marathon2/.AppleDouble/scottish_textures.c
new file mode 100644 (file)
index 0000000..cbfa999
Binary files /dev/null and b/marathon2/.AppleDouble/scottish_textures.c differ
diff --git a/marathon2/.AppleDouble/scottish_textures.h b/marathon2/.AppleDouble/scottish_textures.h
new file mode 100644 (file)
index 0000000..77a4a85
Binary files /dev/null and b/marathon2/.AppleDouble/scottish_textures.h differ
diff --git a/marathon2/.AppleDouble/scottish_textures16.a b/marathon2/.AppleDouble/scottish_textures16.a
new file mode 100644 (file)
index 0000000..2f865ba
Binary files /dev/null and b/marathon2/.AppleDouble/scottish_textures16.a differ
diff --git a/marathon2/.AppleDouble/screen.a b/marathon2/.AppleDouble/screen.a
new file mode 100644 (file)
index 0000000..d557d76
Binary files /dev/null and b/marathon2/.AppleDouble/screen.a differ
diff --git a/marathon2/.AppleDouble/screen.c b/marathon2/.AppleDouble/screen.c
new file mode 100644 (file)
index 0000000..62ea31c
Binary files /dev/null and b/marathon2/.AppleDouble/screen.c differ
diff --git a/marathon2/.AppleDouble/screen.h b/marathon2/.AppleDouble/screen.h
new file mode 100644 (file)
index 0000000..b7fb8a6
Binary files /dev/null and b/marathon2/.AppleDouble/screen.h differ
diff --git a/marathon2/.AppleDouble/screen_definitions.h b/marathon2/.AppleDouble/screen_definitions.h
new file mode 100644 (file)
index 0000000..46b7f19
Binary files /dev/null and b/marathon2/.AppleDouble/screen_definitions.h differ
diff --git a/marathon2/.AppleDouble/screen_drawing.c b/marathon2/.AppleDouble/screen_drawing.c
new file mode 100644 (file)
index 0000000..38e0964
Binary files /dev/null and b/marathon2/.AppleDouble/screen_drawing.c differ
diff --git a/marathon2/.AppleDouble/screen_drawing.h b/marathon2/.AppleDouble/screen_drawing.h
new file mode 100644 (file)
index 0000000..66c2d58
Binary files /dev/null and b/marathon2/.AppleDouble/screen_drawing.h differ
diff --git a/marathon2/.AppleDouble/shape_definitions.h b/marathon2/.AppleDouble/shape_definitions.h
new file mode 100644 (file)
index 0000000..8625284
Binary files /dev/null and b/marathon2/.AppleDouble/shape_definitions.h differ
diff --git a/marathon2/.AppleDouble/shape_descriptors.h b/marathon2/.AppleDouble/shape_descriptors.h
new file mode 100644 (file)
index 0000000..f744321
Binary files /dev/null and b/marathon2/.AppleDouble/shape_descriptors.h differ
diff --git a/marathon2/.AppleDouble/shapes.c b/marathon2/.AppleDouble/shapes.c
new file mode 100644 (file)
index 0000000..ec284b5
Binary files /dev/null and b/marathon2/.AppleDouble/shapes.c differ
diff --git a/marathon2/.AppleDouble/shapes.make b/marathon2/.AppleDouble/shapes.make
new file mode 100644 (file)
index 0000000..0a6fe23
Binary files /dev/null and b/marathon2/.AppleDouble/shapes.make differ
diff --git a/marathon2/.AppleDouble/shapes_macintosh.c b/marathon2/.AppleDouble/shapes_macintosh.c
new file mode 100644 (file)
index 0000000..67042a5
Binary files /dev/null and b/marathon2/.AppleDouble/shapes_macintosh.c differ
diff --git a/marathon2/.AppleDouble/shell.c b/marathon2/.AppleDouble/shell.c
new file mode 100644 (file)
index 0000000..87057fb
Binary files /dev/null and b/marathon2/.AppleDouble/shell.c differ
diff --git a/marathon2/.AppleDouble/shell.h b/marathon2/.AppleDouble/shell.h
new file mode 100644 (file)
index 0000000..0241ae1
Binary files /dev/null and b/marathon2/.AppleDouble/shell.h differ
diff --git a/marathon2/.AppleDouble/song_definitions.h b/marathon2/.AppleDouble/song_definitions.h
new file mode 100644 (file)
index 0000000..84e639b
Binary files /dev/null and b/marathon2/.AppleDouble/song_definitions.h differ
diff --git a/marathon2/.AppleDouble/sound.c b/marathon2/.AppleDouble/sound.c
new file mode 100644 (file)
index 0000000..244f5e8
Binary files /dev/null and b/marathon2/.AppleDouble/sound.c differ
diff --git a/marathon2/.AppleDouble/sound.h b/marathon2/.AppleDouble/sound.h
new file mode 100644 (file)
index 0000000..dae1727
Binary files /dev/null and b/marathon2/.AppleDouble/sound.h differ
diff --git a/marathon2/.AppleDouble/sound_definitions.h b/marathon2/.AppleDouble/sound_definitions.h
new file mode 100644 (file)
index 0000000..c92c2e2
Binary files /dev/null and b/marathon2/.AppleDouble/sound_definitions.h differ
diff --git a/marathon2/.AppleDouble/sound_macintosh.c b/marathon2/.AppleDouble/sound_macintosh.c
new file mode 100644 (file)
index 0000000..4616596
Binary files /dev/null and b/marathon2/.AppleDouble/sound_macintosh.c differ
diff --git a/marathon2/.AppleDouble/tags.h b/marathon2/.AppleDouble/tags.h
new file mode 100644 (file)
index 0000000..57ffd18
Binary files /dev/null and b/marathon2/.AppleDouble/tags.h differ
diff --git a/marathon2/.AppleDouble/texts.make b/marathon2/.AppleDouble/texts.make
new file mode 100644 (file)
index 0000000..b91acb1
Binary files /dev/null and b/marathon2/.AppleDouble/texts.make differ
diff --git a/marathon2/.AppleDouble/textures.c b/marathon2/.AppleDouble/textures.c
new file mode 100644 (file)
index 0000000..993b3d1
Binary files /dev/null and b/marathon2/.AppleDouble/textures.c differ
diff --git a/marathon2/.AppleDouble/textures.h b/marathon2/.AppleDouble/textures.h
new file mode 100644 (file)
index 0000000..ab5f4bc
Binary files /dev/null and b/marathon2/.AppleDouble/textures.h differ
diff --git a/marathon2/.AppleDouble/valkyrie.c b/marathon2/.AppleDouble/valkyrie.c
new file mode 100644 (file)
index 0000000..cb4b7fc
Binary files /dev/null and b/marathon2/.AppleDouble/valkyrie.c differ
diff --git a/marathon2/.AppleDouble/valkyrie.h b/marathon2/.AppleDouble/valkyrie.h
new file mode 100644 (file)
index 0000000..02d3a51
Binary files /dev/null and b/marathon2/.AppleDouble/valkyrie.h differ
diff --git a/marathon2/.AppleDouble/vbl.c b/marathon2/.AppleDouble/vbl.c
new file mode 100644 (file)
index 0000000..22a0935
Binary files /dev/null and b/marathon2/.AppleDouble/vbl.c differ
diff --git a/marathon2/.AppleDouble/vbl.h b/marathon2/.AppleDouble/vbl.h
new file mode 100644 (file)
index 0000000..7ac7e8f
Binary files /dev/null and b/marathon2/.AppleDouble/vbl.h differ
diff --git a/marathon2/.AppleDouble/vbl_definitions.h b/marathon2/.AppleDouble/vbl_definitions.h
new file mode 100644 (file)
index 0000000..9030720
Binary files /dev/null and b/marathon2/.AppleDouble/vbl_definitions.h differ
diff --git a/marathon2/.AppleDouble/vbl_macintosh.c b/marathon2/.AppleDouble/vbl_macintosh.c
new file mode 100644 (file)
index 0000000..77e0b02
Binary files /dev/null and b/marathon2/.AppleDouble/vbl_macintosh.c differ
diff --git a/marathon2/.AppleDouble/wad.c b/marathon2/.AppleDouble/wad.c
new file mode 100644 (file)
index 0000000..8413ff9
Binary files /dev/null and b/marathon2/.AppleDouble/wad.c differ
diff --git a/marathon2/.AppleDouble/wad.h b/marathon2/.AppleDouble/wad.h
new file mode 100644 (file)
index 0000000..8ace942
Binary files /dev/null and b/marathon2/.AppleDouble/wad.h differ
diff --git a/marathon2/.AppleDouble/wad_macintosh.c b/marathon2/.AppleDouble/wad_macintosh.c
new file mode 100644 (file)
index 0000000..acd7495
Binary files /dev/null and b/marathon2/.AppleDouble/wad_macintosh.c differ
diff --git a/marathon2/.AppleDouble/wad_prefs.c b/marathon2/.AppleDouble/wad_prefs.c
new file mode 100644 (file)
index 0000000..65a1fb4
Binary files /dev/null and b/marathon2/.AppleDouble/wad_prefs.c differ
diff --git a/marathon2/.AppleDouble/wad_prefs.h b/marathon2/.AppleDouble/wad_prefs.h
new file mode 100644 (file)
index 0000000..74794f4
Binary files /dev/null and b/marathon2/.AppleDouble/wad_prefs.h differ
diff --git a/marathon2/.AppleDouble/wad_prefs_macintosh.c b/marathon2/.AppleDouble/wad_prefs_macintosh.c
new file mode 100644 (file)
index 0000000..9ec5813
Binary files /dev/null and b/marathon2/.AppleDouble/wad_prefs_macintosh.c differ
diff --git a/marathon2/.AppleDouble/weapon_definitions.h b/marathon2/.AppleDouble/weapon_definitions.h
new file mode 100644 (file)
index 0000000..f5f388b
Binary files /dev/null and b/marathon2/.AppleDouble/weapon_definitions.h differ
diff --git a/marathon2/.AppleDouble/weapons.c b/marathon2/.AppleDouble/weapons.c
new file mode 100644 (file)
index 0000000..2348f0c
Binary files /dev/null and b/marathon2/.AppleDouble/weapons.c differ
diff --git a/marathon2/.AppleDouble/weapons.h b/marathon2/.AppleDouble/weapons.h
new file mode 100644 (file)
index 0000000..3a47ee6
Binary files /dev/null and b/marathon2/.AppleDouble/weapons.h differ
diff --git a/marathon2/.AppleDouble/world.c b/marathon2/.AppleDouble/world.c
new file mode 100644 (file)
index 0000000..7098e26
Binary files /dev/null and b/marathon2/.AppleDouble/world.c differ
diff --git a/marathon2/.AppleDouble/world.h b/marathon2/.AppleDouble/world.h
new file mode 100644 (file)
index 0000000..c61de48
Binary files /dev/null and b/marathon2/.AppleDouble/world.h differ
diff --git a/marathon2/Icon_ b/marathon2/Icon_
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/marathon2/binaries/.AppleDouble/.Parent b/marathon2/binaries/.AppleDouble/.Parent
new file mode 100644 (file)
index 0000000..712dddf
Binary files /dev/null and b/marathon2/binaries/.AppleDouble/.Parent differ
diff --git a/marathon2/binaries/.AppleDouble/NotPPC b/marathon2/binaries/.AppleDouble/NotPPC
new file mode 100644 (file)
index 0000000..e51d847
Binary files /dev/null and b/marathon2/binaries/.AppleDouble/NotPPC differ
diff --git a/marathon2/binaries/.AppleDouble/demo.resource b/marathon2/binaries/.AppleDouble/demo.resource
new file mode 100644 (file)
index 0000000..4ad3b69
Binary files /dev/null and b/marathon2/binaries/.AppleDouble/demo.resource differ
diff --git a/marathon2/binaries/.AppleDouble/folder icon b/marathon2/binaries/.AppleDouble/folder icon
new file mode 100644 (file)
index 0000000..7233f90
Binary files /dev/null and b/marathon2/binaries/.AppleDouble/folder icon differ
diff --git a/marathon2/binaries/.AppleDouble/game.resource b/marathon2/binaries/.AppleDouble/game.resource
new file mode 100644 (file)
index 0000000..c28b98a
Binary files /dev/null and b/marathon2/binaries/.AppleDouble/game.resource differ
diff --git a/marathon2/binaries/.AppleDouble/marathon2.resource b/marathon2/binaries/.AppleDouble/marathon2.resource
new file mode 100644 (file)
index 0000000..38f3cd9
Binary files /dev/null and b/marathon2/binaries/.AppleDouble/marathon2.resource differ
diff --git a/marathon2/binaries/NotPPC b/marathon2/binaries/NotPPC
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/marathon2/binaries/demo.resource b/marathon2/binaries/demo.resource
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/marathon2/binaries/folder icon b/marathon2/binaries/folder icon
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/marathon2/binaries/game.resource b/marathon2/binaries/game.resource
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/marathon2/binaries/marathon2.resource b/marathon2/binaries/marathon2.resource
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/marathon2/buildprogram b/marathon2/buildprogram
new file mode 100644 (file)
index 0000000..bb140a1
--- /dev/null
@@ -0,0 +1 @@
+### BUILDPROGRAM\r### Monday, March 28, 1994 3:09:50 PM\r\r# Sunday, April 10, 1994 2:37:03 PM\r#   generalized\r\r# Friday, July 1, 1994 3:02:32 PM\r#   ajr--made changes so Obj68k and ObjPPC are always defined.\r#   this was done so that the socket_listener can always be compiled properly.\r#   (Technically, ObjPPC doesn't always need to be defined, but maybe we'll want it some day...)\r\r#Saturday, September 17, 1994 12:09:42 PM  (Jason')\r#   alpha no longer defines DEBUG so we get a clearer idea of how the final version will\r#  behave\r\rSet Exit 1\r\r#   Find the program parameter.\r\rUnSet program\rFor i In {"Parameters"}\r     If "{i}" !~ /-Å/\r               Set program "{i}"\r              Break\r  End\rEnd\rIf "{program}" == ""\r   Echo "### {0} - Specify a program to build." > Dev:StdErr\r      Echo "# Usage - {0} program [optionsÉ]" > Dev:StdErr\r   Exit 1\rEnd\r\rif "{program}" == "shapes"\r\rSet RawShapeFiles "`files :graphics:Å.raw`"\rExport RawShapeFiles\r\relse if "{program}" == "shapes.16"\r\rSet RawShapeFiles16 "`files :graphics.16:Å.raw`"\rExport RawShapeFiles16\r\relse if "{program}" == "demos"\r\rSet DemoFiles "`files :demos:Å.demo`"\rExport DemoFiles\r\relse if "{program}" == "texts"\r\rSet TextFiles "`files :texts:LÅ`"\rExport TextFiles\r\relse\r\rSet Application "marathon2"\r\r#set defaults so make doesn't chuck (looking for Targ68k if we build DemoTarg68k for example)\rSet CSeriesLibraries68k ""\rSet CSeriesLibrariesPPC ""\rSet Targ68k "{Application}"\rSet DemoTarg68k "{Application}.demo"\rSet TargPPC "{Application}.ppc"\rSet DemoTargPPC "{Application}.ppc.demo"\r\r#options for 68k full versions\rif "{program}" == "{Application}.alpha" || "{program}" == "{Application}.alpha.ppc" || "{program}" == "{Application}.alpha.fat"\r    Set Obj68k ":objects:game:68k:alpha:"\r  Set VerRezOptions "-d DEBUG"\r   Set VersionAsmOptions "-d DEBUG=1"\r     Set VersionCOptions "-mbg on -d GAME -d ALPHA -d PERFORMANCE -d COMPILE_TIME=`Date -n`"\r        Set Targ68k "{Application}.alpha"\r      Set Link68kOptions "-l"\r        Set CSeriesLibraries68k "{CSeriesLibraries}cseries.debug.lib {Libraries}PerformLib.o"\relse if "{program}" == "{Application}.beta" || "{program}" == "{Application}.beta.ppc" || "{program}" == "{Application}.beta.fat"\r        Set Obj68k ":objects:game:68k:beta:"\r   Set VerRezOptions "-d DEBUG"\r   Set VersionAsmOptions "-d DEBUG=1"\r     Set VersionCOptions "-d DEBUG -mbg on -d GAME -d BETA -d COMPILE_TIME=`Date -n`"\r       Set Targ68k "{Application}.beta"\r       Set CSeriesLibraries68k "{CSeriesLibraries}cseries.debug.lib"\r  Set Link68kOptions ""\relse if "{program}" == "{Application}.gamma" || "{program}" == "{Application}.gamma.ppc" || "{program}" == "{Application}.gamma.fat"\r     Set Obj68k ":objects:game:68k:gamma:"\r  Set VerRezOptions ""\r   Set VersionAsmOptions "-d DEBUG=1"\r     Set VersionCOptions "-d DEBUG -mbg off -d GAME -d GAMMA -d COMPILE_TIME=`Date -n`"\r     Set Targ68k "{Application}.gamma"\r      Set CSeriesLibraries68k "{CSeriesLibraries}cseries.debug.lib"\r  Set Link68kOptions ""\relse if "{program}" == "{Application}" || "{program}" == "{Application}.ppc" || "{program}" == "{Application}.fat"\r       Set Obj68k ":objects:game:68k:final:"\r  Set VerRezOptions ""\r   Set VersionAsmOptions "-d DEBUG=0"\r     Set VersionCOptions "-mbg off -d GAME -d FINAL"\r        Set Targ68k "{Application}"\r    Set CSeriesLibraries68k "{CSeriesLibraries}cseries.lib"\r        Set Link68kOptions ""\r\r#options for 68k demo versions\relse if "{program}" == "{Application}.demo.alpha" || "{program}" == "{Application}.demo.alpha.ppc" || "{program}" == "{Application}.demo.alpha.fat"\r      Set Obj68k ":objects:demo:68k:alpha:"\r  Set VerRezOptions "-d DEBUG -d DEMO"\r   Set VersionAsmOptions "-d DEBUG=1"\r     Set VersionCOptions "-d DEBUG -mbg on -d DEMO -d ALPHA -d DEBUG -d COMPILE_TIME=`Date -n`"\r     Set DemoTarg68k "{Application}.demo.alpha"\r     Set CSeriesLibraries68k "{CSeriesLibraries}cseries.debug.lib"\relse if "{program}" == "{Application}.demo.beta" || "{program}" == "{Application}.demo.beta.ppc" || "{program}" == "{Application}.demo.beta.fat"\r Set Obj68k ":objects:demo:68k:beta:"\r   Set VerRezOptions "-d DEBUG -d DEMO"\r   Set VersionAsmOptions "-d DEBUG=1"\r     Set VersionCOptions "-d DEBUG -mbg on -d DEMO -d BETA -d COMPILE_TIME=`Date -n`"\r       Set DemoTarg68k "{Application}.demo.beta"\r      Set CSeriesLibraries68k "{CSeriesLibraries}cseries.debug.lib"\relse if "{program}" == "{Application}.demo" || "{program}" == "{Application}.demo.ppc" || "{program}" == "{Application}.demo.fat"\r        Set Obj68k ":objects:demo:68k:final:"\r  Set VerRezOptions "-d DEMO"\r    Set VersionAsmOptions "-d DEBUG=0"\r     Set VersionCOptions "-mbg off -d DEMO -d GAME -d FINAL"\r        Set DemoTarg68k "{Application}.demo"\r   Set CSeriesLibraries68k "{CSeriesLibraries}cseries.lib"\relse\r   #we must be doing a PowerPC build; set some defaults so Make won't crap looking for 68k variables\r      Set No68k 1\r    Set Obj68k ":"\rend\r\r#options for PowerPC full versions\rif "{program}" == "{Application}.alpha.ppc" || "{program}" == "{Application}.alpha" || "{program}" == "{Application}.alpha.fat"\r Set ObjPPC ":objects:game:ppc:alpha:"   \r       Set VerRezOptions "-d DEBUG"\r   Set SymbolsPPC "-sym on"\r       Set VersionPPCCOptions "-opt off {SymbolsPPC} -d GAME -d ALPHA -d DEBUG -d COMPILE_TIME=`Date -n`"\r     Set TargPPC "{Application}.alpha.ppc"\r  Set CSeriesLibrariesPPC "{CSeriesLibraries}cseries.sym.xcoff"\relse if "{program}" == "{Application}.beta.ppc" || "{program}" == "{Application}.beta" || "{program}" == "{Application}.beta.fat"\r        Set ObjPPC ":objects:game:ppc:beta:"    \r       Set VerRezOptions "-d DEBUG"\r   Set SymbolsPPC "-sym off"\r      Set VersionPPCCOptions "-opt speed {SymbolsPPC} -d GAME -d DEBUG -d BETA -d COMPILE_TIME=`Date -n`"\r    Set TargPPC "{Application}.beta.ppc"\r   Set CSeriesLibrariesPPC "{CSeriesLibraries}cseries.debug.xcoff"\relse if "{program}" == "{Application}.gamma.ppc" || "{program}" == "{Application}.gamma" || "{program}" == "{Application}.gamma.fat"\r   Set ObjPPC ":objects:game:ppc:beta:"    \r       Set VerRezOptions ""\r   Set SymbolsPPC "-sym off"\r      Set VersionPPCCOptions "-opt speed {SymbolsPPC} -d GAME -d DEBUG -d GAMMA -d COMPILE_TIME=`Date -n`"\r   Set TargPPC "{Application}.gamma.ppc"\r  Set CSeriesLibrariesPPC "{CSeriesLibraries}cseries.debug.xcoff"\relse if "{program}" == "{Application}.ppc" || "{program}" == "{Application}" || "{program}" == "{Application}.fat"\r     Set ObjPPC ":objects:game:ppc:final:"   \r       Set VerRezOptions ""\r   Set SymbolsPPC "-sym off"\r      Set VersionPPCCOptions "-opt speed {SymbolsPPC} -d GAME -d FINAL"\r      Set TargPPC "{Application}.ppc"\r        Set CSeriesLibrariesPPC "{CSeriesLibraries}cseries.xcoff"\r\r#options for PowerPC demo versions\relse if "{program}" == "{Application}.demo.alpha.ppc" || "{program}" == "{Application}.demo.alpha" || "{program}" == "{Application}.demo.alpha.fat"\r      Set ObjPPC ":objects:demo:ppc:alpha:"   \r       Set VerRezOptions "-d DEBUG -d DEMO"\r   Set SymbolsPPC "-sym on"\r       Set VersionPPCCOptions "-opt off {SymbolsPPC} -d ALPHA -d DEMO -d DEBUG -d COMPILE_TIME=`Date -n`"\r     Set DemoTargPPC "{Application}.demo.alpha.ppc"\r Set CSeriesLibrariesPPC "{CSeriesLibraries}cseries.sym.xcoff"\relse if "{program}" == "{Application}.demo.beta.ppc" || "{program}" == "{Application}.demo.beta" || "{program}" == "{Application}.demo.beta.fat"\r Set ObjPPC ":objects:demo:ppc:beta:"    \r       Set VerRezOptions "-d DEBUG -d DEMO"\r   Set SymbolsPPC "-sym off"\r      Set VersionPPCCOptions "-opt speed {SymbolsPPC} -d BETA -d DEMO -d DEBUG -d COMPILE_TIME=`Date -n`"\r    Set DemoTargPPC "{Application}.demo.beta.ppc"\r  Set CSeriesLibrariesPPC "{CSeriesLibraries}cseries.debug.xcoff"\relse if "{program}" == "{Application}.demo.ppc" || "{program}" == "{Application}.demo" || "{program}" == "{Application}.demo.fat"\r      Set ObjPPC ":objects:demo:ppc:final:"   \r       Set VerRezOptions "-d DEMO"\r    Set SymbolsPPC "-sym off"\r      Set VersionPPCCOptions "-opt speed {SymbolsPPC} -d FINAL -d DEMO"\r      Set DemoTargPPC "{Application}.demo.ppc"\r       Set CSeriesLibrariesPPC "{CSeriesLibraries}cseries.xcoff"\r\relse\r        #we must be doing a 68k build; set some defaults so Make won't crap looking for PowerPC variables\r      Set NoPPC 1\r    Set ObjPPC ":objects:ppc:final:"\rend\r\rif {MakeAILibrary} == 1\r  set VersionCOptions "{VersionCOptions}"" -d AI_LIBRARY"\r        set VersionPPCCOptions "{VersionPPCCOptions}"" -d AI_LIBRARY"\rend\r\r# if we're doing a fat build, set FatTarg or DemoFatTarg appropriately, otherwise leave them\r# set to something that make will ignore (in this case {Application}.fat and {Application}.demo.fat\rif "{program}" == "{Application}.fat" || "{program}" == "{Application}.beta.fat"  || "{program}" == "{Application}.alpha.fat" || "{program}" == "{Application}.gamma.fat"\r  Set FatTarg "{program}"\relse\r   Set FatTarg "{Application}.fat"\rend\rif "{program}" == "{Application}.demo.fat" || "{program}" == "{Application}.demo.beta.fat"  || "{program}" == "{Application}.demo.alpha.fat"\r       Set DemoFatTarg "{program}"\relse\r       Set DemoFatTarg "{Application}.demo.fat"\rend\r\r# export everything we just did so Make can see it\rExport Obj68k\rExport ObjPPC\rExport VersionAsmOptions\rExport VersionCOptions\rExport VersionPPCCOptions\rExport Targ68k\rExport DemoTarg68k\rExport Link68kOptions\rExport TargPPC\rExport DemoTargPPC\rExport FatTarg\rExport DemoFatTarg\rExport CSeriesLibraries68k\rExport CSeriesLibrariesPPC\rExport SymbolsPPC\rExport VerRezOptions\r\r# from way, way above (ending "if {program}==shapes or {program}==demos")\rend\r\r# Select the makefile.\rSet makefile `(Files -t TEXT "{program}".make || ¶\r      Files -t TEXT MakeFile || Echo '""') ³ Dev:Null`\r       \r# if we selected "MakeFile" but we didn't get a valid 68k or PPC target then we don't know\r# what we're doing (or at least the environment variables won't be set up right so even if we\r# think we know what we're doing make won't have a clue) and we should punt.\rif {NoPPC} && {No68k} && {makefile} == "MakeFile"\r       Echo "### {0} - ¶"{program}.make¶" doesn't exist and this buildprogram can't handle ¶"{program}¶"." > Dev:StdErr\r       Exit 1\rend\r\rIf "{makefile}" == ""\r      Echo "### {0} - No makefile exists for ¶"{program}¶"." > Dev:StdErr\r    Exit 1\rEnd\r\r#   Run Make, then execute its output.\r\rEcho "# `Date -t` ----- Build of {program}."\rEcho "# `Date -t` ----- Analyzing dependencies."\rBegin\r        Echo "Set Echo 1"\r      Make {"Parameters"} -f "{makefile}"\rEnd > "{program}".makeout\rEcho "# `Date -t` ----- Executing build commands."\r"{program}".makeout\rDelete "{program}".makeout\rEcho "# `Date -t` ----- Done."\rSet type "`files -i -n -x t "{program}" ³ Dev:Null || Set Status 0`"\rSet CaseSensitive True #filetype check for DA must be case sensitive\rIf "{type}" =~ /Å APPL/ OR "{type}" =~ /Å MPST/        # application or tool\r  If {No68k}\r             Echo -n ¶t; Echo -n "move '{program}' 'hoax:doomsucks' -y"; echo -n " "\r        else\r           Echo -n ¶t; Quote -n "{program}"; Echo -n " "\r  end\rEnd\r
\ No newline at end of file
diff --git a/marathon2/collection_definition.h b/marathon2/collection_definition.h
new file mode 100644 (file)
index 0000000..958f89a
--- /dev/null
@@ -0,0 +1 @@
+/*\rCOLLECTION_DEFINITION.H\rFriday, June 17, 1994 11:48:27 AM\r\rFriday, June 17, 1994 11:27:13 PM\r       added .minimum_light_intensity field to low-level shape.\rTuesday, June 21, 1994 2:59:16 PM\r     added collection version number, added unused bytes to all structures.\rWednesday, June 22, 1994 3:53:22 PM\r     scaling modifications.\rWednesday, June 22, 1994 10:07:38 PM\r    added _scenery_collection type, .size field to collection_definition structure, changed\r        Ôshape_indexesÕ to Ôlow_level_shape_indexesÕ in high_level_shape_definition structure\rSaturday, July 9, 1994 3:36:05 PM\r        added NUMBER_OF_PRIVATE_COLORS constant.\r*/\r\r/* ---------- collection definition structure */\r\r/* 2 added pixels_to_world to collection_definition structure */\r/* 3 added size to collection_definition structure */\r#define COLLECTION_VERSION 3\r\r/* at the beginning of the clut, used by the extractor for various opaque reasons */\r#define NUMBER_OF_PRIVATE_COLORS 3\r\renum /* collection types */\r{\r     _unused_collection= 0, /* raw */\r       _wall_collection, /* raw */\r    _object_collection, /* rle */\r  _interface_collection, /* raw */\r       _scenery_collection /* rle */\r};\r\rstruct collection_definition\r{\r       short version;\r \r       short type; /* used for get_shape_descriptors() */\r     word flags; /* [unused.16] */\r  \r       short color_count, clut_count;\r long color_table_offset; /* an array of clut_count arrays of color_count ColorSpec structures */\r\r      short high_level_shape_count;\r  long high_level_shape_offset_table_offset;\r\r    short low_level_shape_count;\r   long low_level_shape_offset_table_offset;\r\r     short bitmap_count;\r    long bitmap_offset_table_offset;\r\r      short pixels_to_world; /* used to shift pixel values into world coordinates */\r \r       long size; /* used to assert offsets */\r        \r       short unused[253];\r};\r\r/* ---------- high level shape definition */\r\r#define HIGH_LEVEL_SHAPE_NAME_LENGTH 32\r\rstruct high_level_shape_definition\r{\r     short type; /* ==0 */\r  word flags; /* [unused.16] */\r  \r       char name[HIGH_LEVEL_SHAPE_NAME_LENGTH+1];\r     \r       short number_of_views;\r \r       short frames_per_view, ticks_per_frame;\r        short key_frame;\r       \r       short transfer_mode;\r   short transfer_mode_period; /* in ticks */\r     \r       short first_frame_sound, key_frame_sound, last_frame_sound;\r\r   short pixels_to_world;\r\r        short loop_frame;\r\r     short unused[14];\r\r     /* number_of_views*frames_per_view indexes of low-level shapes follow */\r       short low_level_shape_indexes[1];\r};\r\r/* --------- low-level shape definition */\r\r#define _X_MIRRORED_BIT 0x8000\r#define _Y_MIRRORED_BIT 0x4000\r#define _KEYPOINT_OBSCURED_BIT 0x2000\r\rstruct low_level_shape_definition\r{\r     word flags; /* [x-mirror.1] [y-mirror.1] [keypoint_obscured.1] [unused.13] */\r\r fixed minimum_light_intensity; /* in [0,FIXED_ONE] */\r\r short bitmap_index;\r    \r       /* (x,y) in pixel coordinates of origin */\r     short origin_x, origin_y;\r      \r       /* (x,y) in pixel coordinates of key point */\r  short key_x, key_y;\r\r   short world_left, world_right, world_top, world_bottom;\r        short world_x0, world_y0;\r      \r       short unused[4];\r};\r\r/* ---------- colors */\r\renum\r{\r   SELF_LUMINESCENT_COLOR_FLAG= 0x80\r};\r\rstruct rgb_color_value\r{\r byte flags;\r    byte value;\r    \r       word red, green, blue;\r};\r
\ No newline at end of file
diff --git a/marathon2/computer_interface.c b/marathon2/computer_interface.c
new file mode 100644 (file)
index 0000000..8f8e10d
--- /dev/null
@@ -0,0 +1 @@
+/*\r\r   computer_interface.c\r   Monday, May 8, 1995 7:18:55 PM- rdm created.\r\r*/\r\r// add logon/logoff keywords. (& make terminal display them)\r// cameras\r// static\r// delayed teleport\r\r// activate tags\r// picture with scrolling text.\r// checkpoint with scrolling text\r// don't use charwidth\r\r#pragma segment drawing\r\r#include "macintosh_cseries.h"\r#include "world.h"\r#include "map.h"\r#include "player.h"\r#include "computer_interface.h"\r#include "screen_drawing.h"\r#include "overhead_map.h"\r#include "time.h"\r#include "sound.h"\r#include "interface.h" // for the error strings.\r#include "shell.h"\r#include "platforms.h" // for tagged platforms\r#include "lightsource.h" // for tagged lightsources\r#include "screen.h"\r\r#include "portable_files.h"\r#include "images.h"\r\r#define LABEL_INSET 3\r#define LOG_DURATION_BEFORE_TIMEOUT (2*TICKS_PER_SECOND)\r#define BORDER_HEIGHT 18\r#define BORDER_INSET 9\r#define FUDGE_FACTOR 1\r\renum {\r      _reading_terminal,\r     _no_terminal_state,\r    NUMBER_OF_TERMINAL_STATES\r};\r\renum {\r   _terminal_is_dirty= 0x01\r};\r\renum {\r    _any_abort_key_mask= _action_trigger_state,\r    _terminal_up_arrow= _moving_forward,\r   _terminal_down_arrow= _moving_backward,\r        _terminal_page_down= _turning_right,\r   _terminal_page_up= _turning_left,\r      _terminal_next_state= _left_trigger_state\r};\r\r#define strCOMPUTER_LABELS 135\renum\r{\r    _marathon_name,\r        _computer_starting_up,\r _computer_manufacturer,\r        _computer_address,\r     _computer_terminal,\r    _scrolling_message,\r    _acknowledgement_message,\r      _disconnecting_message,\r        _connection_terminated_message,\r        _date_format\r};\r\r#define TERMINAL_IS_DIRTY(term) ((term)->flags & _terminal_is_dirty)\r#define SET_TERMINAL_IS_DIRTY(term, v) ((v)? ((term)->flags |= _terminal_is_dirty) : ((term)->flags &= ~_terminal_is_dirty))\r\r/* Maximum face changes per text grouping.. */\r#define MAXIMUM_FACE_CHANGES_PER_TEXT_GROUPING (128)\r\renum {\r        _text_is_encoded_flag= 0x0001\r};\r\renum {\r       _logon_group,\r  _unfinished_group,\r     _success_group,\r        _failure_group,\r        _information_group,\r    _end_group,\r    _interlevel_teleport_group, // permutation is level to go to\r   _intralevel_teleport_group, // permutation is polygon to go to.\r        _checkpoint_group, // permutation is the goal to show\r  _sound_group, // permutation is the sound id to play\r   _movie_group, // permutation is the movie id to play\r   _track_group, // permutation is the track to play\r      _pict_group, // permutation is the pict to display\r     _logoff_group,\r _camera_group, //  permutation is the object index\r     _static_group, // permutation is the duration of static.\r       _tag_group, // permutation is the tag to activate\r\r     NUMBER_OF_GROUP_TYPES\r};\r\renum // flags to indicate text styles for paragraphs\r{\r       _plain_text      = 0x00,\r       _bold_text       = 0x01,\r       _italic_text     = 0x02,\r       _underline_text  = 0x04\r};\r\renum { /* terminal grouping flags */\r       _draw_object_on_right= 0x01,  // for drawing checkpoints, picts, movies.\r       _center_object= 0x02\r};\r\rstruct terminal_groupings {\r   short flags; /* varies.. */\r    short type; /* _information_text, _checkpoint_text, _briefing_text, _movie, _sound_bite, _soundtrack */\r        short permutation; /* checkpoint id for chkpt, level id for _briefing, movie id for movie, sound id for sound, soundtrack id for soundtrack */\r short start_index;\r     short length;\r  short maximum_line_count;\r};\r\rstruct text_face_data {\r  short index;\r   short face;\r    short color;\r};\r\rstruct player_terminal_data\r{\r short flags;\r   short phase;\r   short state;\r   short current_group;\r   short level_completion_state;\r  short current_line;\r    short maximum_line;\r    short terminal_id;\r     long last_action_flag;\r};\r\rstruct terminal_key {\r       short keycode;\r short offset;\r  short mask;\r    long action_flag;\r};\r\rstruct font_dimensions {\r short lines_per_screen;\r        short character_width;\r};\r\r/* globals - I would really like to make these static to computer_interface.c, but game_wad.c needs them */\rbyte *map_terminal_data;\rlong map_terminal_data_length;\r\r/* internal global structure */\rstatic struct player_terminal_data *player_terminals;\rstatic struct font_dimensions font_data;\r\rstatic struct terminal_key terminal_keys[]= {\r  {0x7e, 0, 0, _terminal_page_up},  // arrow up\r  {0x7d, 0, 0, _terminal_page_down},// arrow down\r        {0x74, 0, 0, _terminal_page_up},   // page up\r  {0x79, 0, 0, _terminal_page_down}, // page down\r        {0x30, 0, 0, _terminal_next_state}, // tab\r     {0x4c, 0, 0, _terminal_next_state}, // enter\r   {0x24, 0, 0, _terminal_next_state}, // return\r  {0x31, 0, 0, _terminal_next_state}, // space\r   {0x3a, 0, 0, _terminal_next_state}, // command\r {0x35, 0, 0, _any_abort_key_mask}  // escape\r};\r#define NUMBER_OF_TERMINAL_KEYS (sizeof(terminal_keys)/sizeof(struct terminal_key))\r\rextern TextSpec *_get_font_spec(short font_index);\r\r#ifdef DEBUG\rstruct player_terminal_data *get_player_terminal_data(\r   short player_index)\r{\r  assert(player_index>=0 && player_index<MAXIMUM_NUMBER_OF_PLAYERS);\r     return player_terminals+player_index;\r}\r#else\r#define get_player_terminal_data(index) (player_terminals+index)\r#endif\r\r/* ------------ private prototypes */\rstatic void draw_logon_text(Rect *bounds, struct static_preprocessed_terminal_data *terminal_text,\r        short current_group_index, short logon_shape_id);\rstatic void draw_computer_text(Rect *bounds, \r        struct static_preprocessed_terminal_data *terminal_text, short current_group_index, short current_line);\rstatic void _draw_computer_text(char *base_text, short start_index, Rect *bounds,\r     struct static_preprocessed_terminal_data *terminal_text, short current_line);\rstatic void render_terminal(short player_index, struct view_terminal_data *data);\rstatic short find_group_type(struct static_preprocessed_terminal_data *data, \r  short group_type);\rstatic void teleport_to_level(short level_number);\rstatic void teleport_to_polygon(short player_index, short polygon_index);\rstatic struct terminal_groupings *get_indexed_grouping(\r        struct static_preprocessed_terminal_data *data, short index);\rstatic struct text_face_data *get_indexed_font_changes(\r  struct static_preprocessed_terminal_data *data, short index);\rstatic char *get_text_base(struct static_preprocessed_terminal_data *data);\rstatic void draw_terminal_borders(struct view_terminal_data *data, \r  struct player_terminal_data *terminal_data, Rect *terminal_frame);\rstatic void next_terminal_state(short player_index);\rstatic void next_terminal_group(short player_index, struct static_preprocessed_terminal_data *terminal_text);\rstatic get_date_string(char *date_string);\rstatic void present_checkpoint_text(Rect *frame,\r      struct static_preprocessed_terminal_data *terminal_text, short current_group_index,\r    short current_line);\rstatic boolean find_checkpoint_location(short checkpoint_index, world_point2d *location, \r short *polygon_index);\rstruct static_preprocessed_terminal_data *preprocess_text(char *text, short length);\rstatic void pre_build_groups(struct terminal_groupings *groups,\r    short *group_count, struct text_face_data *text_faces, short *text_face_count, \r        char *base_text, short *base_length);\rstatic short matches_group(char *base_text, short length, short index, short possible_group, \r    short *permutation);\rstatic void        set_text_face(struct text_face_data *text_face);\rstatic void draw_line(char *base_text, short start_index, short end_index, Rect *bounds,\r      struct static_preprocessed_terminal_data *terminal_text, short *text_face_start_index,\r short line_number);\rstatic boolean calculate_line(char *base_text, short width, short start_index, \r    short text_end_index, short *end_index);\rstatic void handle_reading_terminal_keys(short player_index, long action_flags);\rstatic void calculate_bounds_for_object(Rect *frame, short flags, Rect *bounds, Rect *source);\rstatic void display_picture(short picture_id, Rect *frame, short flags);\rstatic void display_picture_with_text(struct player_terminal_data *terminal_data, \r   Rect *bounds, struct static_preprocessed_terminal_data *terminal_text, short current_lien);\rstatic short count_total_lines(char *base_text, short width, short start_index, short end_index);\rstatic void calculate_bounds_for_text_box(Rect *frame, short flags, Rect *bounds);\rstatic void goto_terminal_group(short player_index, struct static_preprocessed_terminal_data *terminal_text, \r short new_group_index);\rstatic boolean previous_terminal_group(short player_index, struct static_preprocessed_terminal_data *terminal_text);\rstatic void fill_terminal_with_static(Rect *bounds);\rstatic short calculate_lines_per_page(void);\r\r#ifndef PREPROCESSING_CODE\rstatic struct static_preprocessed_terminal_data *get_indexed_terminal_data(short id);\rstatic void encode_text(struct static_preprocessed_terminal_data *terminal_text);\rstatic void decode_text(struct static_preprocessed_terminal_data *terminal_text);\r#endif\r\r/* ------------ code begins */\rvoid initialize_terminal_manager(\r  void)\r{\r        short index;\r\r  player_terminals= (struct player_terminal_data *) \r             malloc(MAXIMUM_NUMBER_OF_PLAYERS*sizeof(struct player_terminal_data));\r assert(player_terminals);\r      memset(player_terminals, 0, MAXIMUM_NUMBER_OF_PLAYERS*sizeof(struct player_terminal_data));\r\r   for(index= 0; index<NUMBER_OF_TERMINAL_KEYS; ++index)\r  {\r              terminal_keys[index].mask= 1 << (terminal_keys[index].keycode&7);\r              terminal_keys[index].offset= terminal_keys[index].keycode>>3;\r  }\r\r     return;\r}\r\rvoid initialize_player_terminal_info(\r       short player_index)\r{\r  struct player_terminal_data *terminal= get_player_terminal_data(player_index);\r\r        terminal->flags= 0;\r    terminal->phase = NONE; // not using a control panel.\r  terminal->state= _no_terminal_state; // And there is no line..\r terminal->current_group= NONE;\r terminal->level_completion_state= 0;\r   terminal->current_line= 0;\r     terminal->maximum_line= 0;\r     terminal->terminal_id= 0;\r      terminal->last_action_flag= -1l; /* Eat the first key */\r}\r\rvoid enter_computer_interface(\r     short player_index, \r   short text_number, \r    short completion_flag)\r{\r       struct player_terminal_data *terminal= get_player_terminal_data(player_index);\r struct player_data *player= get_player_data(player_index);\r     struct static_preprocessed_terminal_data *terminal_text= get_indexed_terminal_data(text_number);\r\r      if(dynamic_world->player_count==1)\r     {\r              short lines_per_page;\r  \r               /* Reset the lines per page to the actual value for whatever fucked up font that they have */\r          lines_per_page= calculate_lines_per_page();\r            if(lines_per_page != terminal_text->lines_per_page)\r            {\r// dprintf("You have one confused font.");\r                   terminal_text->lines_per_page= lines_per_page;\r         }\r      }\r\r     /* Tell everyone that this player is in the computer interface.. */     \r       terminal->state= _reading_terminal;\r    terminal->phase= NONE;\r terminal->current_group= NONE;\r terminal->level_completion_state= completion_flag;\r     terminal->current_line= 0;\r     terminal->maximum_line= 1; // any click or keypress will get us out.\r   terminal->terminal_id= text_number;\r    terminal->last_action_flag= -1l; /* Eat the first key */\r\r      /* And select the first one. */\r        next_terminal_group(player_index, terminal_text);\r}\r\r/*  Assumes ¶t==1 tick */\rvoid update_player_for_terminal_mode(\r   short player_index)\r{\r  struct player_terminal_data *terminal= get_player_terminal_data(player_index);\r\r        if(terminal->state != _no_terminal_state)\r      {\r              /* Phase is a timer for logging in and out only.. */\r           switch(terminal->state)\r                {\r                      case _reading_terminal:\r                                if(terminal->phase != NONE)\r                            {\r                                      if(--terminal->phase<=0)\r                                       {\r                                              struct static_preprocessed_terminal_data *terminal_text= get_indexed_terminal_data(terminal->terminal_id);\r                                             \r                                               next_terminal_group(player_index, terminal_text);\r                                      }\r                              }\r                              break;\r                         \r                       default:\r                               break;\r         }\r      }\r}\r\rvoid update_player_keys_for_terminal(\r     short player_index,\r    long action_flags)\r{\r   struct player_terminal_data *terminal= get_player_terminal_data(player_index);\r\r        switch(terminal->state)\r        {\r              case _reading_terminal:\r                        handle_reading_terminal_keys(player_index, action_flags);\r                      break;\r         \r               case _no_terminal_state:\r               default:\r                       halt();\r                        break;\r }\r}\r\rboolean player_in_terminal_mode(\r  short player_index)\r{\r  struct player_terminal_data *terminal= get_player_terminal_data(player_index);\r boolean in_terminal_mode;\r      \r       if(terminal->state==_no_terminal_state)\r        {\r              in_terminal_mode= FALSE;\r       } else {\r               in_terminal_mode= TRUE;\r        }\r      \r       return in_terminal_mode;\r}\r\rvoid *get_terminal_data_for_save_game(\r     void)\r{\r        return player_terminals;\r}\r\rlong calculate_terminal_data_length(\r       void)\r{\r        long length= dynamic_world->player_count*sizeof(struct player_terminal_data);\r  \r       return length;\r}\r\rvoid *get_terminal_information_array(\r        void)\r{\r        return map_terminal_data;\r}\r\rlong calculate_terminal_information_length(\r       void)\r{\r        return map_terminal_data_length;\r}\r\rvoid _render_computer_interface(\r   struct view_terminal_data *data)\r{\r     struct player_terminal_data *terminal_data= get_player_terminal_data(current_player_index);\r    \r       assert(terminal_data->state != _no_terminal_state);\r    if(TERMINAL_IS_DIRTY(terminal_data))\r   {\r              struct static_preprocessed_terminal_data *terminal_text;\r               struct terminal_groupings *current_group;\r              Rect bounds;\r\r          /* Get the terminal text.. */\r          terminal_text= get_indexed_terminal_data(terminal_data->terminal_id);\r  \r               switch(terminal_data->state)\r           {\r                      case _reading_terminal:\r                                /* Initialize it if it hasn't been done.. */\r                           current_group= get_indexed_grouping(terminal_text, terminal_data->current_group);\r      \r                               /* Draw the borders! */\r                                draw_terminal_borders(data, terminal_data, &bounds);\r                           switch(current_group->type)\r                            {\r                                      case _logon_group:\r                                     case _logoff_group:\r                                            draw_logon_text(&bounds, terminal_text, terminal_data->current_group, \r                                                 current_group->permutation);\r                                           break;\r                                         \r                                       case _unfinished_group:\r                                        case _success_group:\r                                   case _failure_group:\r                                           dprintf("You shouldn't try to render this view.;g");\r                                           break;\r                                         \r                                       case _information_group:\r                                               /* Draw as normal... */\r                                                InsetRect(&bounds, 72-BORDER_INSET, 0); /* 1 inch in from each side */\r                                         draw_computer_text(&bounds, terminal_text, terminal_data->current_group, \r                                                      terminal_data->current_line);\r                                          break;\r                                         \r                                       case _checkpoint_group: // permutation is the goal to show\r                                             /* note that checkpoints can only be equal to one screenful.. */\r                                               present_checkpoint_text(&bounds, terminal_text, terminal_data->current_group,\r                                                  terminal_data->current_line);\r                                          break;\r                                         \r                                       case _end_group:\r                                       case _interlevel_teleport_group: // permutation is level to go to\r                                      case _intralevel_teleport_group: // permutation is polygon to go to.\r                                   case _sound_group: // permutation is the sound id to play\r                                      case _tag_group:\r                                               // These are all handled elsewhere\r                                             break;\r                                         \r                                       case _movie_group:\r                                     case _track_group:\r                                             if(!game_is_networked)\r                                         {\r                                                      dprintf("Movies/Music Tracks not supported on playback (yet);g");\r                                              } else {\r                                                       dprintf("On networked games, should we display a PICT here?;g");\r                                               }\r                                              break;\r                                 \r                                       case _pict_group:\r                                              display_picture_with_text(terminal_data, &bounds, terminal_text, \r                                                      terminal_data->current_line);\r                                          break;\r                 \r                                       case _static_group:\r                                            fill_terminal_with_static(&bounds);\r                                            break;\r                                         \r                                       case _camera_group:\r                                            break;\r\r                                        default:\r                                               vhalt(csprintf(temporary, "What is this group: %d", current_group->type));\r                                             break;\r                         }\r                              break;\r                         \r                       default:\r                               halt();\r                                break;\r         }\r              SET_TERMINAL_IS_DIRTY(terminal_data, FALSE);\r   }\r}\r\r/* Only care about local_player_index */\rlong build_terminal_action_flags(\r        char *keymap)\r{\r        long flags, raw_flags;\r short index;\r   struct terminal_key *key= terminal_keys;\r       struct player_terminal_data *terminal= get_player_terminal_data(local_player_index);\r   \r       raw_flags= 0;\r  for(index= 0; index<NUMBER_OF_TERMINAL_KEYS; ++index)\r  {\r              if (*(keymap + key->offset) & key->mask) raw_flags|= key->action_flag;\r         key++;\r }\r\r     /* Only catch the key the first time. */\r       flags= raw_flags^terminal->last_action_flag;\r   flags&= raw_flags;\r     terminal->last_action_flag= raw_flags;\r\r//dprintf("Flags: %x (Raw: %x Mask: %x);g", flags, raw_flags, terminal->last_action_flag);\r     return flags;\r}\r\r/* called from walk_player_list.. */\rvoid dirty_terminal_view(\r        short player_index)\r{\r  struct player_terminal_data *terminal= get_player_terminal_data(player_index);\r \r       if(terminal->state != _no_terminal_state)\r      {\r              SET_TERMINAL_IS_DIRTY(terminal, TRUE);\r }\r}\r\r/* Take damage, abort.. */\rvoid abort_terminal_mode(\r      short player_index)\r{\r  struct player_terminal_data *terminal= get_player_terminal_data(player_index);\r \r       if(terminal->state != _no_terminal_state)\r      {\r              terminal->state= _no_terminal_state;\r   }\r}\r\r/* --------- local code */\rstatic void draw_logon_text(\r   Rect *bounds, \r struct static_preprocessed_terminal_data *terminal_text,\r       short current_group_index,\r     short logon_shape_id)\r{\r        Rect picture_bounds= *bounds;\r  char *base_text= get_text_base(terminal_text);\r short width;\r   struct terminal_groupings *current_group= get_indexed_grouping(terminal_text, \r         current_group_index);\r  \r       /* Draw the login emblem.. */\r  display_picture(logon_shape_id, &picture_bounds,  _center_object);\r\r    /* Use the picture bounds to create the logon text crap . */    \r       /* The top has the font line height subtracted due to the fudge factor... */\r// picture_bounds.top= picture_bounds.bottom-_get_font_line_height(_computer_interface_font)+5;\r   picture_bounds.top= picture_bounds.bottom;\r     picture_bounds.bottom= bounds->bottom;\r picture_bounds.left= bounds->left;\r     picture_bounds.right= bounds->right;\r\r  /* This is always just a line, so we can do this here.. */\r     {\r              TextSpec old_font;\r\r            GetFont(&old_font);\r            SetFont(_get_font_spec(_computer_interface_font));\r     \r               width= TextWidth(base_text, current_group->start_index, current_group->length);\r                picture_bounds.left += (RECTANGLE_WIDTH(&picture_bounds)-width)/2;\r             SetFont(&old_font);\r    }\r      \r       _draw_computer_text(base_text, current_group_index, &picture_bounds, terminal_text, 0);\r\r       return;\r}\r\r/* returns true for phase chagne */\rstatic void draw_computer_text(\r Rect *bounds, \r struct static_preprocessed_terminal_data *terminal_text, \r      short current_group_index,\r     short current_line)\r{\r  char *base_text= get_text_base(terminal_text);\r \r       _draw_computer_text(base_text, current_group_index, bounds, \r           terminal_text, current_line);\r}\r\r/* Returns TRUE if current_line> end of text.. (for phase change) */\rstatic void _draw_computer_text(\r char *base_text,\r       short group_index,\r     Rect *bounds,\r  struct static_preprocessed_terminal_data *terminal_text,\r       short current_line)\r{\r  boolean done= FALSE;\r   short line_count, start_index, text_index;\r     struct terminal_groupings *current_group= get_indexed_grouping(terminal_text, group_index);\r    struct text_face_data text_face;\r       short index, last_index, last_text_index, end_index;\r   TextSpec old_font;\r\r    /* Set the font.. */\r   GetFont(&old_font);\r    SetFont(_get_font_spec(_computer_interface_font));\r\r    line_count= 0;\r start_index= current_group->start_index;\r       end_index= current_group->length+current_group->start_index;\r   \r       /* eat the previous lines */\r   for(index= 0; index<current_line; ++index)\r     {\r              /* Calculate one line.. */\r             if(!calculate_line(base_text, RECTANGLE_WIDTH(bounds), start_index, current_group->start_index+current_group->length, \r                 &end_index))\r           {\rif(end_index>current_group->start_index+current_group->length)\r{\r     dprintf("Start: %d Length: %d End: %d;g", current_group->start_index, current_group->length, end_index);\r       dprintf("Width: %d", RECTANGLE_WIDTH(bounds));\r end_index= current_group->start_index+current_group->length;\r}\r//dprintf("calculate line: %d start: %d end: %d", index, start_index, end_index);\r                       assert(end_index<=current_group->start_index+current_group->length);\r                   start_index= end_index;\r                } else {\r                       /* End of text.. */\r                    done= TRUE;\r            }\r      }\r\r     if(!done)\r      {\r              /* Go backwards, and see if there were any other face changes... */\r            last_index= current_group->start_index;\r                last_text_index= NONE;\r         for(text_index= 0; text_index<terminal_text->font_changes_count; ++text_index)\r         {\r                      struct text_face_data *font_face= get_indexed_font_changes(terminal_text, text_index);\r                 \r                       /* Go backwards from the scrolled starting location.. */\r                       if(font_face->index>last_index && font_face->index<start_index)\r                        {\r// dprintf("ff index: %d last: %d end: %d", font_face->index, last_index, start_index);\r                              last_index= font_face->index;\r                          last_text_index= text_index;\r                   }\r              }\r              \r// dprintf("last index: %d", last_text_index);\r                /* Figure out the font.. */\r            if(last_text_index==NONE)\r              {\r                      /* Default-> plain, etc.. */\r                   text_face.color= 0;\r                    text_face.face= 0;\r             } else {\r                       struct text_face_data *font_face= get_indexed_font_changes(terminal_text, \r                             last_text_index);\r                      text_face= *font_face;\r         }\r      \r               /* Set the font.. */\r           set_text_face(&text_face);\r     \r               /* Draw what is one the screen */\r              for(index= 0; !done && index<terminal_text->lines_per_page; ++index)\r           {\r//dprintf("calculating the line");\r                   /* Calculate one line.. */\r                     if(!calculate_line(base_text, RECTANGLE_WIDTH(bounds), start_index, current_group->start_index+current_group->length, &end_index))\r                     {\r//dprintf("draw calculate line: %d start: %d end: %d text: %x length: %d lti: %d", index, start_index, end_index, base_text, current_group->length, last_text_index);\rif(end_index>current_group->start_index+current_group->length)\r{\r       dprintf("Start: %d Length: %d End: %d;g", current_group->start_index, current_group->length, end_index);\r       dprintf("Width: %d", RECTANGLE_WIDTH(bounds));\r end_index= current_group->start_index+current_group->length;\r}\r                         assert(end_index<=current_group->start_index+current_group->length);\r                           draw_line(base_text, start_index, end_index, bounds, terminal_text, &last_text_index, \r                                 index);\r                                start_index= end_index;\r                        } else {\r                               /* End of text. */\r//                           done= TRUE;\r                    }\r              }\r      }\r      SetFont(&old_font);\r\r   return;\r}\r\rstatic short count_total_lines(\r     char *base_text,\r       short width,\r   short start_index,\r     short end_index)\r{\r     short total_line_count= 0;\r     TextSpec old_font;\r     short text_end_index= end_index;\r\r      /* Set the font.. */\r   GetFont(&old_font);\r    SetFont(_get_font_spec(_computer_interface_font));\r\r    while(!calculate_line(base_text, width, start_index, text_end_index, &end_index))\r      {\r              total_line_count++;\r            start_index= end_index;\r        }\r      SetFont(&old_font);\r    \r       return total_line_count;\r}\r\r#ifdef OBSOLETE\rstatic boolean calculate_line(\r     char *base_text, \r      short width,\r   short start_index,\r     short text_end_index,\r  short *end_index)\r{\r    boolean done= FALSE;\r\r  if(base_text[start_index])\r     {\r              short index, running_width;\r\r           index= start_index;\r            running_width= 0;\r              while(running_width<width && base_text[index] && base_text[index]!='\n')\r               {\r                      running_width+= CharWidth(base_text[index]);\r                   index++;\r               }\r//dprintf("base: %x start: %d index: %d", base_text, start_index, index);             \r               \r               /* Now go backwards, looking for whitespace to split on.. */\r           if(base_text[index]=='\n')\r             {\r                      index++;\r               } \r             else if(base_text[index])\r              {\r                      short break_point= index;\r\r                     while(break_point>start_index) \r                        {\r                              if(base_text[break_point]==' ') break; /* Non printing.. */\r                            break_point--; /* this needs to be in front of the test.. */\r                   }\r                      \r                       if(break_point!=start_index) \r                  {\r                              index= break_point+1; /* Space at the end of the line.. */\r                     } /* else punt.. */\r            }\r//dprintf("End: %d", index);\r         \r               *end_index= index;\r     } else {\r               done= TRUE;\r    }\r      \r       return done;\r}\r#else\rstatic boolean calculate_line(\r    char *base_text, \r      short width,\r   short start_index,\r     short text_end_index,\r  short *end_index)\r{\r    boolean done= FALSE;\r\r  if(start_index!=text_end_index)\r        {\r              StyledLineBreakCode code;\r              Fixed text_width;\r              long end_of_line_offset= 1; /* non-zero.. */\r\r          text_width= width;\r             text_width <<= 16;\r\r            code= StyledLineBreak(base_text, text_end_index, start_index,\r                  text_end_index, 0, &text_width, &end_of_line_offset);\r          *end_index= end_of_line_offset;\r\r               /* We assume the last line is empty, always.. */\r               if(code==smBreakOverflow)\r              {\r                      done= TRUE;\r            }\r//dprintf("Code: %d Length: %d Start: %d TextEnd: %d End: %d Star Text: %x", code, \r//        text_end_index, start_index, text_end_index, *end_index, &base_text[start_index]);\r     } else {\r               done= TRUE;\r    }\r      \r       return done;\r}\r#endif\r\rstatic void draw_line(\r  char *base_text, \r      short start_index, \r    short end_index, \r      Rect *bounds,\r  struct static_preprocessed_terminal_data *terminal_text,\r       short *text_face_start_index,\r  short line_number)\r{\r   short line_height= _get_font_line_height(_computer_interface_font);\r    boolean done= FALSE;\r   short text_index, current_start;\r       short current_end= end_index;\r  struct text_face_data *face_data= NULL;\r\r       if((*text_face_start_index)==NONE) \r    {\r              text_index= 0;\r } else {\r               text_index= (*text_face_start_index);\r  }\r      \r       /* Get to the first one that concerns us.. */\r  if(text_index<terminal_text->font_changes_count)\r       {\r              do {\r                   face_data= get_indexed_font_changes(terminal_text, text_index);\r                        if(face_data->index<start_index) text_index++;\r         } while(face_data->index<start_index && text_index<terminal_text->font_changes_count);\r }\r      \r       current_start= start_index;\r    MoveTo(bounds->left, bounds->top+line_height*(line_number+FUDGE_FACTOR));\r\r     while(!done)\r   {\r              if(text_index<terminal_text->font_changes_count)\r               {\r                      face_data= get_indexed_font_changes(terminal_text, text_index);\r\r                       if(face_data->index>=current_start && face_data->index<current_end)\r                    {\r                              current_end= face_data->index;\r                         text_index++;\r                          (*text_face_start_index)= text_index;\r                  }\r              }\r\r             DrawText(base_text, current_start, current_end-current_start);\r         if(current_end!=end_index)\r             {\r                      current_start= current_end;\r                    current_end= end_index;\r                        assert(face_data);\r                     set_text_face(face_data);\r              } else {\r                       done= TRUE;\r            }\r      }\r}\r\rstatic void        set_text_face(\r struct text_face_data *text_face)\r{\r    Style face= 0;\r RGBColor color;\r\r       /* Set the computer interface font.. */\r\r       /* Set the face/color crap */\r  if(text_face->face & _bold_text) face |= bold;\r if(text_face->face & _italic_text) face |= italic;\r     if(text_face->face & _underline_text) face |= underline;\r       TextFace(face);\r\r       /* Set the color */\r    _get_interface_color(text_face->color+_computer_interface_text_color, &color);\r RGBForeColor(&color);\r}\r\rstatic short find_group_type(\r struct static_preprocessed_terminal_data *data, \r       short group_type)\r{\r    short index;\r   \r       for(index= 0; index<data->grouping_count; index++)\r     {\r              struct terminal_groupings *group= get_indexed_grouping(data, index);\r           if(group->type==group_type) break;\r     }\r      \r       return index;\r}\r\rstatic void teleport_to_level(\r        short level_number)\r{\r  /* It doesn't matter which player we get. */\r   struct player_data *player= get_player_data(0);\r        \r       assert(level_number != 0);\r     player->teleporting_destination= -level_number;\r        player->delay_before_teleport= TICKS_PER_SECOND/2; // delay before we teleport.\r}\r                      \rstatic void teleport_to_polygon(\r      short player_index,\r    short polygon_index)\r{\r struct player_data *player= get_player_data(player_index);\r     \r       player->teleporting_destination= polygon_index;\r        assert(!player->delay_before_teleport);\r}\r\rstatic void calculate_bounds_for_text_box(\r  Rect *frame,\r   short flags,\r   Rect *bounds)\r{\r        if(flags & _center_object)\r     {\r              dprintf("splitting text not supported!");\r      } \r     else if(flags & _draw_object_on_right)\r {\r              calculate_bounds_for_object(frame, 0, bounds, NULL);\r   } \r     else \r  {\r              calculate_bounds_for_object(frame, _draw_object_on_right, bounds, NULL);\r       }\r\r     return;\r}\r\rstatic void display_picture_with_text(\r      struct player_terminal_data *terminal_data, \r   Rect *bounds, \r struct static_preprocessed_terminal_data *terminal_text,\r       short current_line)\r{\r  struct terminal_groupings *current_group= get_indexed_grouping(terminal_text, terminal_data->current_group);\r   Rect text_bounds;\r      Rect picture_bounds;\r\r  assert(current_group->type==_pict_group);\r      picture_bounds= *bounds;\r       display_picture(current_group->permutation, &picture_bounds, current_group->flags);\r\r   /* Display the text */\r calculate_bounds_for_text_box(bounds, current_group->flags, &text_bounds);\r     draw_computer_text(&text_bounds, terminal_text, terminal_data->current_group, current_line);\r}\r\rstatic void display_picture(\r   short picture_id,\r      Rect *frame,\r   short flags)\r{\r PicHandle picture;\r     boolean drawn= FALSE;\r\r picture= get_picture_resource_from_scenario(picture_id);\r       if (picture)\r   {\r              Rect bounds;\r           Rect screen_bounds;\r\r           bounds= (*picture)->picFrame;\r          OffsetRect(&bounds, -bounds.left, -bounds.top);\r                calculate_bounds_for_object(frame, flags, &screen_bounds, &bounds);\r\r           if(RECTANGLE_WIDTH(&bounds)<=RECTANGLE_WIDTH(&screen_bounds) && \r                       RECTANGLE_HEIGHT(&bounds)<=RECTANGLE_HEIGHT(&screen_bounds))\r           {\r                      /* It fits-> center it. */\r                     OffsetRect(&bounds, screen_bounds.left+(RECTANGLE_WIDTH(&screen_bounds)-RECTANGLE_WIDTH(&bounds))/2,\r                           screen_bounds.top+(RECTANGLE_HEIGHT(&screen_bounds)-RECTANGLE_HEIGHT(&bounds))/2);\r             } else {\r                       /* Doesn't fit.  Make it, but preserve the aspect ratio like a good little boy */\r                      if(RECTANGLE_HEIGHT(&bounds)-RECTANGLE_HEIGHT(&screen_bounds)>=\r                                RECTANGLE_WIDTH(&bounds)-RECTANGLE_WIDTH(&screen_bounds))\r                      {\r                              short adjusted_width;\r                          \r                               adjusted_width= RECTANGLE_HEIGHT(&screen_bounds)*RECTANGLE_WIDTH(&bounds)/RECTANGLE_HEIGHT(&bounds);\r                           bounds= screen_bounds;\r                         InsetRect(&bounds, (RECTANGLE_WIDTH(&screen_bounds)-adjusted_width)/2, 0);\rdprintf("Warning: Not large enough for pict: %d (height);g", picture_id);\r                   } else {\r                               /* Width is the predominant factor */\r                          short adjusted_height;\r                         \r                               adjusted_height= RECTANGLE_WIDTH(&screen_bounds)*RECTANGLE_HEIGHT(&bounds)/RECTANGLE_WIDTH(&bounds);\r                           bounds= screen_bounds;\r                         InsetRect(&bounds, 0, (RECTANGLE_HEIGHT(&screen_bounds)-adjusted_height)/2);\rdprintf("Warning: Not large enough for pict: %d (width);g", picture_id);\r                  }\r              }\r\r//           warn(HGetState((Handle) picture) & 0x40); // assert it is purgable.\r\r           HLock((Handle) picture);\r               DrawPicture(picture, &bounds);\r         HUnlock((Handle) picture);\r\r            ReleaseResource((Handle) picture);      \r               /* And let the caller know where we drew the picture */\r                *frame= bounds;\r        } else {\r               Rect bounds;\r           char format_string[128];\r               short width;\r\r          calculate_bounds_for_object(frame, flags, &bounds, NULL);\r      \r               EraseRect(&bounds);\r            getcstr(format_string, strERRORS, pictureNotFound);\r            sprintf(temporary, format_string, picture_id);\r         width= TextWidth(temporary, 0, strlen(temporary));\r\r            /* Center the error message.. */\r               MoveTo(bounds.left+(RECTANGLE_WIDTH(&bounds)-width)/2, \r                        bounds.top+RECTANGLE_HEIGHT(&bounds)/2);\r               DrawText(temporary, 0, strlen(temporary));\r     }\r}\r\r/* Not completed. Remember 16/24 bit & valkyrie */\rstatic void fill_terminal_with_static(\r Rect *bounds)\r{\r#pragma unused (bounds);\r       dprintf("Filling with static;g");\r#ifdef OBSOLETE\r      static long seed= TickCount();\r byte *base;\r    short x, y;\r    \r       base= base_address_of_gworld;\r  rowBytes= base_rowbytes;\r       for(y= bounds->top; y<bounds->bottom; ++y)\r     {\r              for(x= bounds->left; x<bounds->right; ++x)\r             {\r                      (*base)++= BASE_STATIC_COLOR+(seed&7);\r                 seed= (seed&1) ? ((seed>>1)^0xb400) : (seed>> 1);\r              }\r              base+= (rowBytes-width);\r       }\r#endif\r}\r\r#ifndef PREPROCESSING_CODE\rstatic struct static_preprocessed_terminal_data *get_indexed_terminal_data(\r     short id)\r{\r    struct static_preprocessed_terminal_data *data;\r        long offset= 0l;\r       short index= id;\r\r      data= (struct static_preprocessed_terminal_data *) (map_terminal_data);\r        while(index>0) {\r               vassert(offset<map_terminal_data_length, csprintf(temporary, "Unable to get data for terminal: %d", id));\r              offset+= data->total_length;\r           data= (struct static_preprocessed_terminal_data *) (map_terminal_data+offset);\r         index--;\r       }\r\r     /* Note that this will only decode the text once. */    \r       decode_text(data);\r\r    return data;\r}\r#endif\r\r#ifdef PREPROCESSING_CODE\rvoid decode_text(\r     struct static_preprocessed_terminal_data *terminal_text)\r#else\rstatic void decode_text(\r        struct static_preprocessed_terminal_data *terminal_text)\r#endif\r{\r      if(terminal_text->flags & _text_is_encoded_flag)\r       {\r              encode_text(terminal_text);\r            \r               terminal_text->flags &= ~_text_is_encoded_flag;\r        }\r}\r\r#ifdef PREPROCESSING_CODE\rvoid encode_text(\r       struct static_preprocessed_terminal_data *terminal_text)\r#else\rstatic void encode_text(\r        struct static_preprocessed_terminal_data *terminal_text)\r#endif\r{\r      char *text_base= get_text_base(terminal_text);\r short index;\r   long length;\r   long *long_offset;\r     char *byte_offset;\r\r    length= terminal_text->total_length-\r           (sizeof(struct static_preprocessed_terminal_data) + \r           terminal_text->grouping_count*sizeof(struct terminal_groupings)+\r               terminal_text->font_changes_count*sizeof(struct text_face_data));\r      \r       long_offset= (long *) text_base;\r       for(index= 0; index<length/sizeof(long); ++index)\r      {\r              (*long_offset) ^= 0xfeed;\r              long_offset++;\r }\r      \r       /* And get the last bytes */\r   byte_offset= (char *) long_offset;\r     for(index= 0; index<length%sizeof(long); ++index)\r      {\r              (*byte_offset) ^= 0xfe;\r                byte_offset++;\r }\r\r     terminal_text->flags |= _text_is_encoded_flag;\r}\r\rstatic void draw_terminal_borders(\r   struct view_terminal_data *data,\r       struct player_terminal_data *terminal_data,\r    Rect *terminal_frame)\r{\r        Rect frame, border;\r    short top_message, bottom_left_message, bottom_right_message;\r  struct static_preprocessed_terminal_data *terminal_text= get_indexed_terminal_data(terminal_data->terminal_id);\r        struct terminal_groupings *current_group= get_indexed_grouping(terminal_text, terminal_data->current_group);\r   \r       switch(current_group->type)\r    {\r              case _logon_group:\r                     top_message= _computer_starting_up;\r                    bottom_left_message= _computer_manufacturer;\r                   bottom_right_message= _computer_address;\r                       break;\r                 \r               case _logoff_group:\r                    top_message= _disconnecting_message;\r                   bottom_left_message= _computer_manufacturer;\r                   bottom_right_message= _computer_address;\r                       break;\r\r                default:                        \r                       top_message= _computer_terminal;\r                       bottom_left_message= _scrolling_message;\r                       bottom_right_message= _acknowledgement_message;\r                        break;\r }\r\r     /* First things first: draw the border.. */\r    /* Get the destination frame.. */       \r       frame.top= data->top;\r  frame.bottom= data->bottom;\r    frame.left= data->left;\r        frame.right= data->right;\r\r     /* Erase the rectangle.. */\r    _fill_screen_rectangle((screen_rectangle *) &frame, _black_color);\r\r    /* Now letterbox it if necessary */\r    frame.top+= data->vertical_offset;\r     frame.bottom-= data->vertical_offset;\r  \r       /* Draw the top rectangle */\r   border= frame;\r border.bottom= border.top+BORDER_HEIGHT;\r       _fill_screen_rectangle((screen_rectangle *) &border, _computer_border_background_text_color);\r\r /* Draw the top login header text... */\r        border.left += LABEL_INSET; border.right -= LABEL_INSET;\r       getcstr(temporary, strCOMPUTER_LABELS, top_message);\r   _draw_screen_text(temporary, (screen_rectangle *) &border, _center_vertical, _computer_interface_font, _computer_border_text_color);\r   get_date_string(temporary);\r    _draw_screen_text(temporary, (screen_rectangle *) &border, _right_justified | _center_vertical, \r               _computer_interface_font, _computer_border_text_color);\r        \r       /* Draw the the bottom rectangle & text */\r     border= frame;\r border.top= border.bottom-BORDER_HEIGHT;\r       _fill_screen_rectangle((screen_rectangle *) &border, _computer_border_background_text_color);\r  border.left += LABEL_INSET; border.right -= LABEL_INSET;\r       getcstr(temporary, strCOMPUTER_LABELS, bottom_left_message);\r   _draw_screen_text(temporary, (screen_rectangle *) &border, _center_vertical, _computer_interface_font, \r                _computer_border_text_color);\r  getcstr(temporary, strCOMPUTER_LABELS, bottom_right_message);\r  _draw_screen_text(temporary, (screen_rectangle *) &border, _right_justified | _center_vertical, \r               _computer_interface_font, _computer_border_text_color);\r        \r       /* The screen rectangle minus the border.. */\r  *terminal_frame= frame;\r        InsetRect(terminal_frame, BORDER_INSET, BORDER_HEIGHT+BORDER_INSET);\r}\r\rstatic void next_terminal_state(\r       short player_index)\r{\r  struct player_terminal_data *terminal= get_player_terminal_data(player_index);\r struct player_data *player= get_player_data(player_index);\r\r    switch(terminal->state)\r        {\r#ifdef OBSOLETE\r      struct static_preprocessed_terminal_data *terminal_text;\r       \r               case _logging_in_terminal:\r                     terminal->state= _reading_terminal;\r                    terminal->phase= NONE; /* Different type.. */\r                  /* Get the terminal text.. */\r                  terminal_text= get_indexed_terminal_data(terminal->terminal_id);\r                       terminal->current_group= NONE;\r                 next_terminal_group(player_index, terminal_text);\r                      break;\r\r                case _logging_out_terminal:\r                    terminal->state= _no_terminal_state;\r                   terminal->phase= 0;\r                    terminal->current_group= NONE;\r                 terminal->current_line= 0;\r                     terminal->maximum_line= 1; // any click or keypress will get us out.\r                   initialize_player_terminal_info(player_index);\r                 break;\r         case _reading_terminal:\r                        terminal->state= _logging_out_terminal;\r                        terminal->phase= LOG_DURATION_BEFORE_TIMEOUT;\r                  terminal->current_group= NONE;\r                 terminal->current_line= 0;\r                     terminal->maximum_line= 1; // any click or keypress will get us out.\r                   SET_TERMINAL_IS_DIRTY(terminal, TRUE);\r#ifndef PREPROCESSING_CODE\r                      play_object_sound(player->object_index, _snd_computer_interface_logout);\r#endif                 \r#endif\r                case _reading_terminal:\r                        initialize_player_terminal_info(player_index);\r                 break;\r                 \r               case _no_terminal_state:\r               default:\r                       vhalt(csprintf(temporary, "What is %d?", terminal->state));\r                    break;\r }\r\r     return;\r}\r\rstatic boolean previous_terminal_group(\r     short player_index,\r    struct static_preprocessed_terminal_data *terminal_text)\r{\r     struct player_terminal_data *terminal_data= get_player_terminal_data(player_index);\r    boolean success= FALSE;\r        \r       if(terminal_data->state==_reading_terminal)\r    {\r              short new_group_index= terminal_data->current_group-1;\r         boolean use_new_group= TRUE;\r           boolean done= TRUE;\r            \r               do \r            {\r                      if(new_group_index>=0)\r                 {\r                              struct terminal_groupings *new_group= get_indexed_grouping(terminal_text, new_group_index);\r                            switch(new_group->type)\r                                {\r                                      case _logon_group:\r                                     case _end_group:\r                                               use_new_group= FALSE;\r                                          break;\r                                         \r                                       case _interlevel_teleport_group:\r                                       case _intralevel_teleport_group:\r                                               dprintf("This shouldn't happen!");\r                                             break;\r\r                                        case _sound_group:\r                                     case _tag_group:\r                                               new_group_index--;\r                                             done= FALSE;\r                                           break;\r                                 \r                                       case _movie_group:\r                                     case _track_group:\r                                     case _checkpoint_group:\r                                        case _pict_group:\r                                      case _information_group:\r                                               break;\r                                         \r                                       case _camera_group:\r                                            break;\r                                         \r                                       case _unfinished_group:\r                                        case _success_group:\r                                   case _failure_group:\r                                   case _static_group:\r                                            use_new_group= FALSE;\r                                          break;\r                                 \r                                       default:\r                                               halt();\r                                                break;\r                         }\r                      } else {\r                               done= TRUE;\r                            use_new_group= FALSE;\r                  }\r              } while(!done);\r                \r               if(use_new_group)\r              {\r                      /* Go there.. */\r                       goto_terminal_group(player_index, terminal_text, new_group_index);\r                     success= TRUE;\r         }\r      }\r      \r       return success;\r}\r\rstatic void next_terminal_group(\r    short player_index,\r    struct static_preprocessed_terminal_data *terminal_text)\r{\r     struct player_terminal_data *terminal_data= get_player_terminal_data(player_index);\r    boolean update_line_count= FALSE;\r      \r       if(terminal_data->current_group==NONE)\r {\r              update_line_count= TRUE;\r\r              switch(terminal_data->level_completion_state)\r          {\r                      case _level_unfinished:\r                                terminal_data->current_group= find_group_type(terminal_text, _unfinished_group);\r                               break;\r                         \r                       case _level_finished:\r                          terminal_data->current_group= find_group_type(terminal_text, _success_group);\r                          if(terminal_data->current_group==terminal_text->grouping_count) \r                               {\r                                      /* Fallback. */\r                                        terminal_data->current_group= find_group_type(terminal_text, _unfinished_group);\r                                       assert(terminal_data->current_group != terminal_text->grouping_count);\r                         }\r                              break;\r                         \r                       case _level_failed:\r                            terminal_data->current_group= find_group_type(terminal_text, _failure_group);\r                          if(terminal_data->current_group==terminal_text->grouping_count) \r                               {\r                                      /* Fallback. */\r                                        terminal_data->current_group= find_group_type(terminal_text, _unfinished_group);\r                                       assert(terminal_data->current_group != terminal_text->grouping_count);\r                         }\r                              break;\r                 \r                       default:\r                               vhalt(csprintf(temporary, "What is type %d?", \r                                 terminal_data->level_completion_state));\r                               break;\r         }\r\r             /* Note that the information groups are now keywords, and can have no data associated with them */\r             next_terminal_group(player_index, terminal_text);\r      } else {\r               terminal_data->current_group++;\r                if(terminal_data->current_group>=terminal_text->grouping_count)\r                {\r                      next_terminal_state(player_index);\r             } else {\r                       update_line_count= TRUE;\r               }\r      }\r      \r       if(update_line_count)\r  {\r              goto_terminal_group(player_index, terminal_text, terminal_data->current_group);\r        }\r      \r       SET_TERMINAL_IS_DIRTY(terminal_data, TRUE);\r\r   return;\r}\r\rstatic void goto_terminal_group(\r    short player_index, \r   struct static_preprocessed_terminal_data *terminal_text, \r      short new_group_index)\r{\r       struct player_terminal_data *terminal_data= get_player_terminal_data(player_index);\r    struct player_data *player= get_player_data(player_index);\r     struct terminal_groupings *current_group;\r      \r       terminal_data->current_group= new_group_index;\r \r       current_group= get_indexed_grouping(terminal_text, terminal_data->current_group);\r\r     terminal_data->current_line= 0;\r                \r       switch(current_group->type)\r    {\r              case _logon_group:\r#ifndef PREPROCESSING_CODE\r                  play_object_sound(player->object_index, _snd_computer_interface_logon);\r#endif\r                 terminal_data->phase= LOG_DURATION_BEFORE_TIMEOUT;\r                     terminal_data->maximum_line= current_group->maximum_line_count;\r                        break;\r                 \r               case _logoff_group:\r#ifndef PREPROCESSING_CODE\r                 play_object_sound(player->object_index, _snd_computer_interface_logout);\r#endif\r                        terminal_data->phase= LOG_DURATION_BEFORE_TIMEOUT;\r                     terminal_data->maximum_line= current_group->maximum_line_count;\r                        break;\r                 \r               case _interlevel_teleport_group:\r               case _intralevel_teleport_group:\r               case _sound_group:\r             case _tag_group:\r               case _movie_group:\r             case _track_group:\r             case _camera_group:\r                    terminal_data->phase= NONE;\r                    terminal_data->maximum_line= current_group->maximum_line_count;\r                        break;\r\r                case _checkpoint_group:\r                case _pict_group:\r                      terminal_data->phase= NONE;\r                    if(dynamic_world->player_count>1)\r                      {\r                              /* Use what the server told us */\r                              terminal_data->maximum_line= current_group->maximum_line_count;\r                        } else {\r                               /* Calculate this for ourselves. */\r                            Rect text_bounds, bounds;\r      \r                               /* The only thing we care about is the width. */\r                               SetRect(&bounds, 0, 0, 640, 480);\r                              InsetRect(&bounds, BORDER_INSET, BORDER_HEIGHT+BORDER_INSET);\r                          calculate_bounds_for_text_box(&bounds, current_group->flags, &text_bounds);\r                            terminal_data->maximum_line= count_total_lines(get_text_base(terminal_text),\r                                   RECTANGLE_WIDTH(&text_bounds), current_group->start_index, \r                                    current_group->start_index+current_group->length);\r                     }\r                      break;\r                 \r               case _information_group:\r                       terminal_data->phase= NONE;\r                    if(dynamic_world->player_count>1)\r                      {\r                              /* Use what the server told us */\r                              terminal_data->maximum_line= current_group->maximum_line_count;\r                        } else {\r                               /* Calculate this for ourselves. */\r                            short width= 640; // ¥¥¥ sync (Must guarantee 100 high res!)\r   \r                               width-= 2*(72-BORDER_INSET); /* 1 inch in from each side */                             \r                               terminal_data->maximum_line= count_total_lines(get_text_base(terminal_text), \r                                  width, current_group->start_index, \r                                    current_group->start_index+current_group->length);\r                     }\r                      break;\r\r                case _static_group:\r                    terminal_data->phase= current_group->permutation;\r                      terminal_data->maximum_line= current_group->maximum_line_count;\r                        break;\r\r                case _end_group:\r                       /* Get Out! */\r                 next_terminal_state(player_index);\r                     terminal_data->maximum_line= 1; // any click or keypress will get us out...\r                    break;\r\r                case _unfinished_group:\r                case _success_group:\r           case _failure_group:\r                   vwarn(0, "You shouldn't be coming to this group");\r                     break;\r                 \r               default:\r                       halt();\r                        break;\r }\r\r     return;\r}\r\r/* I'll use this function, almost untouched.. */\rstatic get_date_string(\r    char *date_string)\r{\r   char temp_string[101];\r long seconds, game_time_passed;\r        DateTimeRec converted_date;\r    struct tm game_time;\r   \r       /* Treat the date as if it were recent. */\r     game_time_passed= LONG_MAX - dynamic_world->game_information.game_time_remaining;       \r       seconds = 2882914937;\r  \r       /* convert the game seconds to machine seconds */\r      seconds += (game_time_passed/TICKS_PER_SECOND)*MACINTOSH_TICKS_PER_SECOND; \r    Secs2Date(seconds, &converted_date);\r   \r       game_time.tm_sec= converted_date.second;\r       game_time.tm_min= converted_date.minute;\r       game_time.tm_hour= converted_date.hour;\r        game_time.tm_mday= converted_date.day;\r game_time.tm_mon= converted_date.month-1;\r      game_time.tm_year= 437;\r        game_time.tm_wday= converted_date.dayOfWeek;\r   game_time.tm_yday= 0;\r  game_time.tm_isdst= 0;\r\r        getcstr(temp_string, strCOMPUTER_LABELS, _date_format);\r        strftime(date_string, 100, temp_string, &game_time);\r}\r\rstatic void present_checkpoint_text(\r   Rect *frame,\r   struct static_preprocessed_terminal_data *terminal_text,\r       short current_group_index,\r     short current_line)\r{\r  Rect bounds;\r   struct overhead_map_data overhead_data;\r        struct terminal_groupings *current_group;\r      \r       current_group= get_indexed_grouping(terminal_text, current_group_index);\r\r      // draw the overhead map.\r      bounds= *frame;\r        calculate_bounds_for_object(frame, current_group->flags, &bounds, NULL);\r       overhead_data.scale =  1;\r      \r       if(find_checkpoint_location(current_group->permutation, &overhead_data.origin, \r                &overhead_data.origin_polygon_index))\r  {\r              overhead_data.top= bounds.top;\r         overhead_data.left= bounds.left;\r               overhead_data.half_width= RECTANGLE_WIDTH(&bounds)/2;\r          overhead_data.half_height= RECTANGLE_HEIGHT(&bounds)/2;\r                overhead_data.width= RECTANGLE_WIDTH(&bounds);\r         overhead_data.height= RECTANGLE_HEIGHT(&bounds);\r               overhead_data.mode= _rendering_checkpoint_map;\r         _render_overhead_map(&overhead_data);\r  } else {\r               char format_string[128];\r               short width;\r   \r               EraseRect(&bounds);\r            getcstr(format_string, strERRORS, checkpointNotFound);\r         sprintf(temporary, format_string, current_group->permutation);\r         width= TextWidth(temporary, 0, strlen(temporary));\r\r            /* Center the error message.. */\r               MoveTo(bounds.left+(RECTANGLE_WIDTH(&bounds)-width)/2, \r                        bounds.top+RECTANGLE_HEIGHT(&bounds)/2);\r               DrawText(temporary, 0, strlen(temporary));\r     }\r\r     // draw the text\r       calculate_bounds_for_text_box(frame, current_group->flags, &bounds);\r   draw_computer_text(&bounds, terminal_text, current_group_index, current_line);\r\r        return;\r}\r\rstatic boolean find_checkpoint_location(\r    short checkpoint_index, \r       world_point2d *location, \r      short *polygon_index)\r{\r        boolean success= FALSE;\r#ifndef PREPROCESSING_CODE\r     short ii;\r      struct map_object *saved_object;\r       short match_count;\r     \r       location->x= location->y= match_count= 0;\r      for (ii = 0, saved_object= saved_objects; ii < dynamic_world->initial_objects_count; ii++, saved_object++)\r     {\r              if (saved_object->type==_saved_goal && saved_object->index==checkpoint_index)\r          {\r                      location->x+= saved_object->location.x;\r                        location->y+= saved_object->location.y;\r//                      *polygon_index= saved_object->polygon_index;\r                   match_count++;\r         }\r      }\r      \r       if(match_count)\r        {\r              /* Now average.. */     \r               location->x /= match_count;\r            location->y /= match_count;\r            *polygon_index= world_point_to_polygon_index(location);\r                assert(*polygon_index);\r                success= TRUE;\r }\r#else\r#pragma unused(checkpoint_index, location, polygon_index)\r#endif\r       \r       return success;         \r}\r\rstatic void handle_reading_terminal_keys(\r  short player_index,\r    long action_flags)\r{\r   struct player_terminal_data *terminal= get_player_terminal_data(player_index);\r struct static_preprocessed_terminal_data *terminal_text= get_indexed_terminal_data(terminal->terminal_id);\r     struct terminal_groupings *current_group;\r      short initial_group= terminal->current_group;\r  short initial_line= terminal->current_line;\r    boolean aborted= FALSE;\r        struct player_data *player= get_player_data(player_index);\r     short line_delta= 0;\r   boolean change_state= FALSE;\r   \r       current_group= get_indexed_grouping(terminal_text, terminal->current_group);\r   switch(current_group->type)\r    {\r              case _logon_group:\r             case _logoff_group:\r            case _unfinished_group:\r                case _success_group:\r           case _failure_group:\r           case _information_group:\r               case _checkpoint_group:\r                case _pict_group:\r              case _camera_group:\r            case _static_group:\r                    if(action_flags & _terminal_up_arrow) \r                 {\r                              line_delta= -1;\r                        } \r                     \r                       if(action_flags & _terminal_down_arrow)\r                        {\r                              line_delta= 1;\r                 } \r                     \r                       if(action_flags & _terminal_page_down)\r                 {\r#ifndef PREPROCESSING_CODE\r                           play_object_sound(player->object_index, _snd_computer_interface_page);\r#endif\r                          line_delta= terminal_text->lines_per_page;\r                     } \r                     \r                       if(action_flags & _terminal_page_up)\r                   {\r#ifndef PREPROCESSING_CODE\r                           play_object_sound(player->object_index, _snd_computer_interface_page);\r#endif\r                          line_delta= -terminal_text->lines_per_page;\r                    }\r\r                     /* this one should change state, if necessary */\r                       if(action_flags & _terminal_next_state)\r                        {\r#ifndef PREPROCESSING_CODE\r                           play_object_sound(player->object_index, _snd_computer_interface_page);\r#endif\r                          /* Force a state change. */\r                            line_delta= terminal_text->lines_per_page;\r                             change_state= TRUE;\r                    }\r                      \r                       if(action_flags & _any_abort_key_mask)\r                 {\r                              /* Abort! */\r                           initialize_player_terminal_info(player_index);\r                         aborted= TRUE;\r                 }\r                      break;\r\r                case _movie_group:\r             case _track_group:\r                     break;\r                 \r               case _end_group:\r                       next_terminal_state(player_index);\r                     aborted= TRUE;\r                 break;\r         \r               case _interlevel_teleport_group: // permutation is level to go to\r#ifndef PREPROCESSING_CODE\r                   teleport_to_level(current_group->permutation);\r#else    \r                       dprintf("Terminal Editor: Teleporting to level: %d", current_group->permutation);\r#endif\r                       initialize_player_terminal_info(player_index);\r                 aborted= TRUE;\r                 break;\r\r                case _intralevel_teleport_group: // permutation is polygon to go to.\r#ifndef PREPROCESSING_CODE\r                        teleport_to_polygon(player_index, current_group->permutation);\r#else    \r                       dprintf("Terminal Editor: Teleporting to polygon: %d", current_group->permutation);\r#endif\r                     initialize_player_terminal_info(player_index);\r                 aborted= TRUE;\r                 break;\r\r                case _sound_group: // permutation is the sound id to play\r                      /* Play the sound immediately, and then go to the next level.. */\r                      {\r                              struct player_data *player= get_player_data(player_index);\r#ifndef PREPROCESSING_CODE\r                          play_object_sound(player->object_index, current_group->permutation);\r#endif\r                            next_terminal_group(player_index, terminal_text);\r                              aborted= TRUE;\r                 }\r                      break;\r\r                case _tag_group:\r                       set_tagged_light_statuses(current_group->permutation, TRUE);\r                   try_and_change_tagged_platform_states(current_group->permutation, TRUE);\r                       next_terminal_group(player_index, terminal_text);\r                      aborted= TRUE;\r                 break;\r\r                default:\r                       vhalt(csprintf(temporary, "What is group: %d", current_group->type));\r                  break;\r }\r\r     /* If we are dirty.. */\r        terminal->current_line+= line_delta;\r   if(!aborted && initial_group != terminal->current_group ||  \r           initial_line != terminal->current_line)\r        {\r              if(terminal->current_line<0)\r           {\r                      if(!previous_terminal_group(player_index, terminal_text))\r                      {\r                              terminal->current_line= 0;\r                     }\r              }\r              \r               if(terminal->current_line>=terminal->maximum_line)\r             {\r                      if(terminal->current_group+1>=terminal_text->grouping_count)\r                   {\r                              if(change_state)\r                               {\r                                      /* Go ahead an let the terminal group deal with it.. */\r                                        next_terminal_group(player_index, terminal_text);\r                              } \r                             else \r                          {\r                                      /* renumber the lines */\r                                       terminal->current_line-= line_delta;\r                           }\r                      } \r                     else \r                  {\r                              next_terminal_group(player_index, terminal_text);\r                      }\r              }\r\r             SET_TERMINAL_IS_DIRTY(terminal, TRUE);\r }\r}\r    \rstatic void calculate_bounds_for_object(\r      Rect *frame,\r   short flags,\r   Rect *bounds,\r  Rect *source)\r{\r        *bounds= *frame;\r       \r       if(source && flags & _center_object)\r   {\r              if(RECTANGLE_WIDTH(source)>RECTANGLE_WIDTH(frame) \r                     || RECTANGLE_HEIGHT(source)>RECTANGLE_HEIGHT(frame))\r           {\r                      /* Just return the normal frame.  Aspect ratio will take care of us.. */\r               } else {\r                       InsetRect(bounds, (RECTANGLE_WIDTH(frame)-RECTANGLE_WIDTH(source))/2,\r                          (RECTANGLE_HEIGHT(frame)-RECTANGLE_WIDTH(source))/2);\r          }\r      } \r     else if(flags & _draw_object_on_right)\r {\r              bounds->left= bounds->right - RECTANGLE_WIDTH(bounds)/2 + BORDER_INSET/2;\r      } \r     else \r  {\r              bounds->right= bounds->left + RECTANGLE_WIDTH(bounds)/2 - BORDER_INSET/2;\r      }\r}\r\r#ifdef PREPROCESSING_CODE\r/*------------ */\r/* -----> Preprocessing code... */\rstruct group_header_data {\r char *name;\r    boolean has_permutation;\r};\r\rstatic struct group_header_data group_data[]= {\r   {"LOGON", TRUE }, // permutation is the logo id to draw...\r     {"UNFINISHED", FALSE },\r        {"FINISHED", FALSE },\r  {"FAILED", FALSE },\r    {"INFORMATION", FALSE },\r       {"END", FALSE },\r       {"INTERLEVEL TELEPORT", TRUE },\r        {"INTRALEVEL TELEPORT", TRUE },\r        {"CHECKPOINT", TRUE },\r {"SOUND", TRUE },\r      {"MOVIE", TRUE },\r      {"TRACK", TRUE },\r      {"PICT", TRUE},\r        {"LOGOFF", TRUE }, // permutation is the logo id to draw...\r    {"CAMERA", TRUE}, // permutation is the object index\r   {"STATIC", TRUE}, // permutation is the duration of static.\r    {"TAG", TRUE} // permutation is the tag to activate\r};\r\r#define MAXIMUM_GROUPS_PER_TERMINAL 15\r\rstatic void calculate_maximum_lines_for_groups(struct terminal_groupings *groups, \r     short group_count, char *text_base);\r\r/* Note that this is NOT a marathon function, but an editor function... */\rstruct static_preprocessed_terminal_data *preprocess_text(\r    char *text, \r   short length)\r{\r        short group_count, text_face_count;\r    struct terminal_groupings groups[MAXIMUM_GROUPS_PER_TERMINAL];\r struct text_face_data text_faces[MAXIMUM_FACE_CHANGES_PER_TEXT_GROUPING];\r      short new_length;\r      struct static_preprocessed_terminal_data *data_structure;\r      long total_length;\r     short index;\r   char *text_destination;\r\r       new_length= length;\r    pre_build_groups(groups, &group_count, text_faces, &text_face_count,\r           text, &new_length);\r\r   /* Allocate our conglomerated structure */\r     total_length= sizeof(struct static_preprocessed_terminal_data)+\r                group_count*sizeof(struct terminal_groupings)+\r         text_face_count*sizeof(struct text_face_data)+\r         new_length;\r\r   data_structure= (struct static_preprocessed_terminal_data *) malloc(total_length);\r     assert(data_structure);\r\r       /* set these up.. */\r   data_structure->total_length= total_length;\r    data_structure->flags= 0; /* Don't encode (yet) */\r     data_structure->grouping_count= group_count;\r   data_structure->font_changes_count= text_face_count;\r\r  /* Calculate the default lines per page for this font */\r       data_structure->lines_per_page= calculate_lines_per_page();\r\r   /* Calculate the maximum lines for each group */\r       calculate_maximum_lines_for_groups(groups, group_count, text);\r\r        for(index= 0; index<group_count; ++index)\r      {\r              struct terminal_groupings *destination;\r                \r               destination= get_indexed_grouping(data_structure, index);\r              memcpy(destination, &groups[index], sizeof(struct terminal_groupings));\r        }\r\r     for(index= 0; index<text_face_count; ++index)\r  {\r              struct text_face_data *destination;\r            \r               destination= get_indexed_font_changes(data_structure, index);\r          memcpy(destination, &text_faces[index], sizeof(struct text_face_data));\r\r// dprintf("%d/%d index: %d face: %d color: %d;g", index, text_face_count, text_faces[index].index, text_faces[index].face, text_faces[index].color);\r }\r\r     text_destination= get_text_base(data_structure);\r       memcpy(text_destination, text, new_length);\r//dprintf("Base: %x new_length: %d", text_destination, new_length);\r\r       /* We be done! */\r      return data_structure;\r}\r\r/* Life would be better if these were encoded like this for me.. */\rstatic void pre_build_groups(\r    struct terminal_groupings *groups, \r    short *group_count,\r    struct text_face_data *text_faces,\r     short *text_face_count,\r        char *base_text,\r       short *base_length)\r{\r  long index, current_length;\r    boolean in_group= FALSE;\r       short current_face, face_count, color_index, grp_count, data_length;\r   boolean last_was_return= TRUE; /* in case the first line is a comment */\r\r      /* Initial color, and face (plain) */\r  color_index= current_face= 0;\r\r grp_count= face_count= 0;\r      data_length= (*base_length);\r   current_length= index= 0;\r      /* Find the text groupings! */\r while(index<data_length)\r       {\r              if(base_text[index]=='#')\r              {\r                      short possible_group;\r                  char first_char;\r\r                      /* This is some form of descriptive keyword.. */\r                       first_char= toupper(base_text[index+1]);\r                       for(possible_group= 0; possible_group<NUMBER_OF_GROUP_TYPES; ++possible_group)\r                 {\r                              if(first_char==group_data[possible_group].name[0])\r                             {\r                                      short start_index, permutation;\r                                        \r                                       start_index= matches_group(base_text, data_length, index+1, possible_group, \r                                           &permutation);\r                                 if(start_index != NONE)\r                                        {\r                                              short destination_index;\r                                               \r                                               if(in_group) \r                                          {\r                                                      /* Minus one, because we have the # included.. */\r                                                      assert(grp_count+1<MAXIMUM_GROUPS_PER_TERMINAL);\r                                                       groups[grp_count++].length= current_length;\r                                                    base_text[index]= 0; // null out the end of each group.\r                                                        destination_index= index+1;\r                                            } else {        \r                                                       destination_index= index;\r                                              }\r                                              \r                                               assert(data_length-start_index>=0);\r                                            /* move it down-> check this! */\r                                               memmove(&base_text[destination_index], \r                                                        &base_text[start_index], data_length-start_index);\r                                             data_length -= (start_index-destination_index);\r                                                groups[grp_count].flags= 0;\r                                            groups[grp_count].type= possible_group;\r                                                groups[grp_count].permutation= permutation;\r                                            groups[grp_count].start_index= destination_index;\r                                              current_length= 0;\r                                             in_group= TRUE;\r                                                break; /* out of for loop */\r                                   }\r                              }\r                      }\r\r                     /* If we didn't match it, continue on..... */\r                  if(possible_group==NUMBER_OF_GROUP_TYPES)\r                      {\r                              index++;\r                               current_length++;\r                      }\r//                    vassert(possible_group==NUMBER_OF_GROUP_TYPES || base_text[index]!='#', \r//                             csprintf(temporary, "Base: %x index: %d", base_text, index));\r          } \r             else if(base_text[index]=='$')\r         {\r                      boolean changed_font= TRUE;\r                    short move_down_by;\r                    \r                       move_down_by= 2;\r                       switch(base_text[index+1])\r                     {\r                              case 'B': /* Bold on! */\r                                       current_face |= _bold_text;\r                                    break;\r                                 \r                               case 'b': /* bold off */\r                                       current_face &= ~_bold_text;\r                                   break;\r\r                                case 'I': /* Italic on */\r                                      current_face |= _italic_text;\r                                  break;\r                                 \r                               case 'i': /* Italic off */\r                                     current_face &= ~_italic_text;\r                                 break;\r                                 \r                               case 'U': /* Underline on */\r                                   current_face |= _underline_text;\r                                       break;\r                                 \r                               case 'u': /* Underline off */\r                                  current_face &= ~_underline_text;\r                                      break;\r\r                                case 'C':\r                                      switch(base_text[index+2])\r                                     {\r                                              case '0':\r                                              case '1':\r                                              case '2':\r                                              case '3':\r                                              case '4':\r                                              case '5':\r                                              case '6':\r                                              case '7':\r                                                      color_index= base_text[index+2]-'0';\r                                                   move_down_by= 3;\r                                                       break;\r                                                 \r                                               default:\r                                                       break;\r                                 }\r                                      break;\r                                 \r                               default:\r                                       /* Pass it on through, unchanged */\r                                    changed_font= FALSE;\r                                   move_down_by= 0;\r                                       break;\r                 }\r                      \r                       /* If we changed the font, move the text down.. */\r                     if(changed_font)\r                       {\r                              assert(face_count+1<MAXIMUM_FACE_CHANGES_PER_TEXT_GROUPING);\r                           text_faces[face_count].index= index;\r                           text_faces[face_count].color= color_index;\r                             text_faces[face_count++].face= current_face;\r                           \r                               /* And move the data down by 2 characters.. */\r                         memmove(&base_text[index], \r                                    &base_text[index+move_down_by], data_length-index-move_down_by);\r                               data_length -= move_down_by;\r   \r                               /* Note that index doesn't change.. */\r                 } else {\r                               index++;\r                               current_length++;\r                      }\r              } \r             else if (base_text[index]==';' && last_was_return)\r             {\r                      short destination_index, start_index;\r\r                 /* this is a comment */\r                        destination_index= start_index= index;\r                 while(start_index<data_length && base_text[start_index] != '\n') start_index++;\r\r                       /* Eat the return on the comment line. */\r                      if(start_index<data_length && base_text[start_index]=='\n') start_index++;\r                     \r                       /* Nix the comment */                   \r                       memmove(&base_text[destination_index], &base_text[start_index], data_length-start_index);\r                      data_length -= (start_index-destination_index);\r                } else {\r                       if(base_text[index]=='\n')\r                     {\r                              last_was_return= TRUE;\r                 } else {\r                               last_was_return= FALSE;\r                        }\r                      index++;\r                       current_length++;\r              }\r      }\r\r     /* Save the proper positions.. */\r      (*text_face_count)= face_count;\r        (*group_count)= grp_count;\r     (*base_length)= data_length;\r   if(in_group) groups[grp_count].length= current_length;\r\r        return;\r}\r\r/* Return NONE if it doesn't matches.. */\rstatic short matches_group(\r       char *base_text, \r      short length,\r  short index, \r  short possible_group, \r short *permutation)\r{\r  short start_index= NONE;\r\r      if(memcmp(&base_text[index], group_data[possible_group].name, \r         strlen(group_data[possible_group].name))==0)\r   {\r              /* This is a match.  find the end... */\r                start_index= index+strlen(group_data[possible_group].name);\r            \r               if(group_data[possible_group].has_permutation)\r         {\r                      /* Find the permutation... */\r                  *permutation= atoi(&base_text[start_index]);\r           }\r              \r               /* Eat the rest of it.. */\r             while(start_index<length && base_text[start_index] != '\n') start_index++;\r             if(base_text[start_index]=='\n') start_index++;\r        }\r      \r       return start_index;\r}\r\rstatic void find_all_permutations_of_type(\r      byte *terminals,\r       short terminal_count,\r  short group_type,\r      short *permutations,\r   short *permutation_count)\r{\r    short terminal_index;\r  struct static_preprocessed_terminal_data *data;\r        long offset= 0l;\r       short count= 0;\r\r       for(terminal_index= 0; terminal_index<terminal_count; terminal_index++)\r        {\r              short group_index;\r     \r               data= (struct static_preprocessed_terminal_data *) (terminals+offset);\r         for(group_index= 0; group_index<data->grouping_count; ++group_index)\r           {\r                      struct terminal_groupings *group= get_indexed_grouping(data, group_index);\r                     if(group->type==group_type)\r                    {\r                              permutations[count++]= group->permutation;\r                     }\r              }\r              \r               offset+= data->total_length;\r   }\r\r     *permutation_count= count;\r}\r\rvoid find_all_picts_references_by_terminals(\r     byte *compiled_text, \r  short terminal_count,\r  short *picts, \r short *picture_count)\r{\r        find_all_permutations_of_type((byte *) compiled_text, terminal_count, _pict_group, picts, \r             picture_count);\r}\r\rvoid find_all_checkpoints_references_by_terminals(\r  byte *compiled_text, \r  short terminal_count,\r  short *checkpoints, \r   short *checkpoint_count)\r{\r     find_all_permutations_of_type((byte *) compiled_text, terminal_count, _checkpoint_group, \r              checkpoints, checkpoint_count);\r}\r\rboolean terminal_has_finished_text_type(\r    short terminal_id,\r     short finished_type)\r{\r boolean has_type= FALSE;\r       struct static_preprocessed_terminal_data *terminal_text= get_indexed_terminal_data(terminal_id);\r       short index;\r   \r       index= find_group_type(terminal_text, finished_type);\r  if(index==terminal_text->grouping_count) \r      {\r              has_type= FALSE;\r       } else {\r               has_type= TRUE;\r        }\r\r     return has_type;\r}\r\rstatic void calculate_maximum_lines_for_groups(\r    struct terminal_groupings *groups,\r     short group_count,\r     char *text_base)\r{\r     short index;\r   \r       for(index= 0; index<group_count; ++index)\r      {\r              switch(groups[index].type)\r             {\r                      case _logon_group:\r                     case _logoff_group:\r                    case _interlevel_teleport_group:\r                       case _intralevel_teleport_group:\r                       case _sound_group:\r                     case _tag_group:\r                       case _movie_group:\r                     case _track_group:\r                     case _camera_group:\r                    case _static_group:\r                    case _end_group:\r                               groups[index].maximum_line_count= 1; // any click or keypress gets us out.\r                             break;\r \r                       case _unfinished_group:\r                        case _success_group:\r                   case _failure_group:\r                           groups[index].maximum_line_count= 0; // should never get to one of these groups.\r                               break;\r \r                       case _checkpoint_group:\r                        case _pict_group:\r                              {\r                                      Rect text_bounds, bounds;\r              \r                                       /* The only thing we care about is the width. */\r                                       SetRect(&bounds, 0, 0, 640, 480);\r                                      InsetRect(&bounds, BORDER_INSET, BORDER_HEIGHT+BORDER_INSET);\r                                  calculate_bounds_for_text_box(&bounds, groups[index].flags, &text_bounds);\r                                     groups[index].maximum_line_count= count_total_lines(text_base,\r                                         RECTANGLE_WIDTH(&text_bounds), groups[index].start_index, \r                                             groups[index].start_index+groups[index].length);\r                               }\r                              break;\r                         \r                       case _information_group:\r                               {\r                                      short width= 640; // ¥¥¥ sync (Must guarantee 100 high res!)\r   \r                                       width-= 2*(72-BORDER_INSET); /* 1 inch in from each side */                             \r                                       groups[index].maximum_line_count= count_total_lines(text_base, \r                                                width, groups[index].start_index, \r                                             groups[index].start_index+groups[index].length);\r                               }\r                              break;\r                         \r                       default:\r                               halt();\r                                break;\r\r                }\r      }\r\r     return;\r}\r#endif\r\rstatic struct terminal_groupings *get_indexed_grouping(\r      struct static_preprocessed_terminal_data *data,\r        short index)\r{\r byte *start;\r   \r       assert(index>=0 && index<data->grouping_count);\r        start= (byte *) data;\r  start += sizeof(struct static_preprocessed_terminal_data) + \r           index*sizeof(struct terminal_groupings);\r\r      return (struct terminal_groupings *) start;\r}\r\rstatic struct text_face_data *get_indexed_font_changes(\r struct static_preprocessed_terminal_data *data,\r        short index)\r{\r byte *start;\r\r  assert(index>=0 && index<data->font_changes_count);\r    start= (byte *) data;\r  start += sizeof(struct static_preprocessed_terminal_data) + \r           data->grouping_count*sizeof(struct terminal_groupings)+\r                index*sizeof(struct text_face_data);\r\r  return (struct text_face_data *) start;\r}\r\rstatic char *get_text_base(\r struct static_preprocessed_terminal_data *data)\r{\r      byte *start;\r\r  start= (byte *) data;\r  start += sizeof(struct static_preprocessed_terminal_data) + \r           data->grouping_count*sizeof(struct terminal_groupings)+\r                data->font_changes_count*sizeof(struct text_face_data);\r\r       return (char *) start;\r}\r\rstatic short calculate_lines_per_page(\r       void)\r{\r        Rect bounds;\r   short lines_per_page;\r\r calculate_destination_frame(_100_percent, TRUE, &bounds);\r      lines_per_page= (RECTANGLE_HEIGHT(&bounds)-2*BORDER_HEIGHT)/_get_font_line_height(_computer_interface_font);\r   lines_per_page-= FUDGE_FACTOR;\r\r        return lines_per_page;\r}
\ No newline at end of file
diff --git a/marathon2/computer_interface.h b/marathon2/computer_interface.h
new file mode 100644 (file)
index 0000000..835946b
--- /dev/null
@@ -0,0 +1 @@
+/*\r    computer_interface.h\r   Tuesday, August 23, 1994 11:25:40 PM (ajr)\r     Thursday, May 25, 1995 5:18:03 PM- rewriting.\r\r New paradigm:\r  Groups each start with one of the following groups:\r     #UNFINISHED, #SUCCESS, #FAILURE\r\r      First is shown the\r     #LOGON XXXXX\r   \r       Then there are any number of groups with:\r      #INFORMATION, #CHECKPOINT, #SOUND, #MOVIE, #TRACK\r      \r       And a final:\r   #INTERLEVEL TELEPORT, #INTRALEVEL TELEPORT              \r       \r       Each group ends with:\r  #END\r\r  Groupings:\r     #logon XXXX- login message (XXXX is shape for login screen)\r    #unfinished- unfinished message\r        #success- success message\r      #failure- failure message\r      #information- information\r      #briefing XX- briefing, then load XX\r   #checkpoint XX- Checkpoint xx (associated with goal) \r  #sound XXXX- play sound XXXX\r   #movie XXXX- play movie XXXX (from Movie file)\r #track XXXX- play soundtrack XXXX (from Music file)\r    #interlevel teleport XXX- go to level XXX\r      #intralevel teleport XXX- go to polygon XXX\r    #pict XXXX- diplay the pict resource XXXX\r\r     Special embedded keys:   \r      $B- Bold on\r    $b- bold off\r   $I- Italic on\r  $i- italic off\r $U- underline on\r       $u- underline off\r      $- anything else is passed through unchanged\r\r  Preprocessed format:\r   static:\r                long total_length;\r             short grouping_count;\r          short font_changes_count;\r              short total_text_length;\r       dynamic:\r               struct terminal_groupings groups[grouping_count];\r              struct text_face_data[font_changes_count];\r             char text;\r*/\r\r/* ------------ structures */\rstruct static_preprocessed_terminal_data {\r        short total_length;\r    short flags;\r   short lines_per_page; /* Added for internationalization/sync problems */\r       short grouping_count;\r  short font_changes_count;\r};\r\rstruct view_terminal_data {\r      short top, left, bottom, right;\r        short vertical_offset;\r};\r\rextern byte *map_terminal_data;\rextern long map_terminal_data_length;\r\r/* ------------ prototypes */\rvoid initialize_terminal_manager(void);\rvoid initialize_player_terminal_info(short player_index);\rvoid enter_computer_interface(short player_index, short text_number, short completion_flag);\rvoid _render_computer_interface(struct view_terminal_data *data);\rvoid update_player_for_terminal_mode(short player_index);\rvoid update_player_keys_for_terminal(short player_index, long action_flags);\rlong build_terminal_action_flags(char *keymap);\rvoid dirty_terminal_view(short player_index);\rvoid abort_terminal_mode(short player_index);\r\rboolean player_in_terminal_mode(short player_index);\r\rvoid *get_terminal_data_for_save_game(void);\rlong calculate_terminal_data_length(void);\r\r/* This returns the text.. */\rvoid *get_terminal_information_array(void);\rlong calculate_terminal_information_length(void);\r\r#ifdef PREPROCESSING_CODE\rstruct static_preprocessed_terminal_data *preprocess_text(char *text, short length);\rstruct static_preprocessed_terminal_data *get_indexed_terminal_data(short id);\rvoid encode_text(struct static_preprocessed_terminal_data *terminal_text);\rvoid decode_text(struct static_preprocessed_terminal_data *terminal_text);\rvoid find_all_picts_references_by_terminals(byte *compiled_text, short terminal_count,\r    short *picts, short *picture_count);\rvoid find_all_checkpoints_references_by_terminals(byte *compiled_text, \r   short terminal_count, short *checkpoints, short *checkpoint_count);\rboolean terminal_has_finished_text_type(short terminal_id, short finished_type);\r#endif
\ No newline at end of file
diff --git a/marathon2/crc.c b/marathon2/crc.c
new file mode 100644 (file)
index 0000000..e2a64d9
--- /dev/null
@@ -0,0 +1 @@
+/*\r    crc.c\r  Sunday, March 5, 1995 6:21:30 PM\r\r      CRC Checksum generation for a file.\r*/\r\r#include "cseries.h"\r#include "portable_files.h"\r#include "crc.h"\r\r#ifdef mpwc\r #pragma segment file_io\r#endif\r\r/* ---------- constants */\r#define TABLE_SIZE (256)\r#define CRC32_POLYNOMIAL 0xEDB88320L\r#define BUFFER_SIZE 1024\r\r/* ---------- local data */\rstatic unsigned long *crc_table= NULL;\r\r/* ---------- local prototypes ------- */\rstatic unsigned long calculate_file_crc(unsigned char *buffer, \r       short buffer_size, short refnum);\rstatic unsigned long calculate_buffer_crc(long count, unsigned long crc, void *buffer);\rstatic boolean build_crc_table(void);\rstatic void free_crc_table(void);\r\r/* -------------- Entry Point ----------- */\runsigned long calculate_crc_for_file(\r  FileDesc *file) \r{\r     short refnum;\r  unsigned long crc;\r     \r       refnum= open_file_for_reading(file);\r   if(refnum!=NONE)\r       {\r              crc= calculate_crc_for_opened_file(refnum);\r            close_file(refnum);\r    }\r      \r       return crc;\r}\r\runsigned long calculate_crc_for_opened_file(\r    short refnum) \r{\r       unsigned long crc;\r     unsigned char *buffer;\r\r        /* Build the crc table */\r      if(build_crc_table())\r  {\r              buffer= (unsigned char *) malloc(BUFFER_SIZE*sizeof(unsigned char));\r           if(buffer) \r            {\r                      crc= calculate_file_crc(buffer, BUFFER_SIZE, refnum);\r                  \r                       free(buffer);\r          }\r              \r               /* free the crc table! */\r              free_crc_table();\r      }\r\r     return crc;\r}\r\r/* Calculate the crc for a file using the given buffer.. */\runsigned long calculate_data_crc(\r   unsigned char *buffer,\r long length)\r{\r unsigned long crc= 0l;\r\r        assert(buffer);\r        \r       /* Build the crc table */\r      if(build_crc_table())\r  {\r              /* The odd permutions ensure that we get the same crc as for a file */\r         crc = 0xFFFFFFFFL;\r             crc = calculate_buffer_crc(length, crc, buffer);\r               crc ^= 0xFFFFFFFFL;\r\r           /* free the crc table! */\r              free_crc_table();\r      }\r\r     return crc;\r}\r\r/* ---------------- Private Code --------------- */\rstatic boolean build_crc_table(\r     void)\r{\r        boolean success= FALSE;\r\r       assert(!crc_table);\r    crc_table= (unsigned long *) malloc(TABLE_SIZE*sizeof(unsigned long));\r if(crc_table)\r  {\r              /* Build the table */\r          short index, j;\r                unsigned long crc;\r\r            for(index= 0; index<TABLE_SIZE; ++index)\r               {\r                      crc= index;\r                    for(j=0; j<8; j++)\r                     {\r                              if(crc & 1) crc=(crc>>1) ^ CRC32_POLYNOMIAL;\r                           else crc>>=1;\r                  }\r                      crc_table[index] = crc;\r                }\r              \r               success= TRUE;\r }\r      \r       return success;\r}\r\rstatic void free_crc_table(\r void)\r{\r        assert(crc_table);\r     free(crc_table);\r       crc_table= NULL;\r}\r\r/* Calculate for a block of data incrementally */\rstatic unsigned long calculate_buffer_crc(\r       long count, \r   unsigned long crc, \r    void *buffer)\r{\r        unsigned char *p;\r      unsigned long a;\r       unsigned long b;\r\r      p= (unsigned char *) buffer;\r   while (count--) \r       {\r              a= (crc >> 8) & 0x00FFFFFFL;\r           b= crc_table[((int) crc ^ *p++) & 0xff];\r               crc= a^b;\r      }\r      return crc;\r}\r\r/* Calculate the crc for a file using the given buffer.. */\rstatic unsigned long calculate_file_crc(\r    unsigned char *buffer, \r        short buffer_size,\r     short refnum)\r{\r        unsigned long crc;\r     long count;\r    FileError err;\r long file_length, initial_position;\r    \r       /* Save and restore the initial file position */\r       initial_position= get_fpos(refnum);\r\r   /* Get the file_length */\r      file_length= get_file_length(refnum);\r  \r       /* Set to the start of the file */\r     set_fpos(refnum, 0l);\r\r crc = 0xFFFFFFFFL;\r     while(file_length) \r    {\r              if(file_length>buffer_size)\r            {\r                      count= buffer_size;\r            } else {\r                       count= file_length;\r            }\r\r             err= read_file(refnum, count, buffer);\r         vassert(!err, csprintf(temporary, "Error: %d", err));\r          \r               crc = calculate_buffer_crc(count, crc, buffer);\r                file_length -= count;\r  }\r      \r       /* Restore the file position */\r        set_fpos(refnum, initial_position);\r\r   return (crc ^= 0xFFFFFFFFL);\r}\r
\ No newline at end of file
diff --git a/marathon2/crc.h b/marathon2/crc.h
new file mode 100644 (file)
index 0000000..8ff2d07
--- /dev/null
@@ -0,0 +1 @@
+/*\r    crc.h\r  Sunday, March 5, 1995 6:25:36 PM\r       \r       Calculate the 32 bit CRC for a given file.\r*/\r\runsigned long calculate_crc_for_file(FileDesc *file);\runsigned long calculate_crc_for_opened_file(short refnum);\runsigned long calculate_data_crc(unsigned char *buffer, long length);\r
\ No newline at end of file
diff --git a/marathon2/demos.demo/.AppleDouble/.Parent b/marathon2/demos.demo/.AppleDouble/.Parent
new file mode 100644 (file)
index 0000000..1cce632
Binary files /dev/null and b/marathon2/demos.demo/.AppleDouble/.Parent differ
diff --git a/marathon2/demos.make b/marathon2/demos.make
new file mode 100644 (file)
index 0000000..76758db
--- /dev/null
@@ -0,0 +1 @@
+DemosResource= :demos:demos.resource\rDemosDemoResource= :demos.demo:demos.resource\r\rDemos ÄÄ {DemoFiles}\r      Set Echo 0\r     set id 128\r     delete -i "{DemosResource}"  # to make sure that any old demos are gone\r        for fileName in {DemoFiles}\r            echo Adding demo from "{fileName}"...\r          Echo "Read 'film' (DEMO_ID, DEMO_NAME) DEMO_FILE;" | Rez -append -define DEMO_ID="{id}" -define DEMO_NAME=¶""{fileName}"¶" -define DEMO_FILE=¶""{fileName}"¶" -c 'RSED' -t 'RSRC' -o "{DemosResource}"\r         set id `Evaluate ({id} + 1)`\r   end\r\rDemos.demo ÄÄ {DemoFiles}\r Set Echo 0\r     set id 128\r     delete -i "{DemosDemoResource}"  # to make sure that any old demos are gone\r    for fileName in {DemoFiles}\r            echo Adding demo from "{fileName}"...\r          Echo "Read 'film' (DEMO_ID, DEMO_NAME) DEMO_FILE;" | Rez -append -define DEMO_ID="{id}" -define DEMO_NAME=¶""{fileName}"¶" -define DEMO_FILE=¶""{fileName}"¶" -c 'RSED' -t 'RSRC' -o "{DemosDemoResource}"\r             set id `Evaluate ({id} + 1)`\r   end\r
\ No newline at end of file
diff --git a/marathon2/demos/.AppleDouble/.Parent b/marathon2/demos/.AppleDouble/.Parent
new file mode 100644 (file)
index 0000000..11d4ffb
Binary files /dev/null and b/marathon2/demos/.AppleDouble/.Parent differ
diff --git a/marathon2/demos/.AppleDouble/L00.demo b/marathon2/demos/.AppleDouble/L00.demo
new file mode 100644 (file)
index 0000000..f986d4f
Binary files /dev/null and b/marathon2/demos/.AppleDouble/L00.demo differ
diff --git a/marathon2/demos/.AppleDouble/L01.demo b/marathon2/demos/.AppleDouble/L01.demo
new file mode 100644 (file)
index 0000000..d53512c
Binary files /dev/null and b/marathon2/demos/.AppleDouble/L01.demo differ
diff --git a/marathon2/demos/.AppleDouble/L05.demo b/marathon2/demos/.AppleDouble/L05.demo
new file mode 100644 (file)
index 0000000..11a374c
Binary files /dev/null and b/marathon2/demos/.AppleDouble/L05.demo differ
diff --git a/marathon2/demos/.AppleDouble/demos.resource b/marathon2/demos/.AppleDouble/demos.resource
new file mode 100644 (file)
index 0000000..84f3970
Binary files /dev/null and b/marathon2/demos/.AppleDouble/demos.resource differ
diff --git a/marathon2/demos/L00.demo b/marathon2/demos/L00.demo
new file mode 100644 (file)
index 0000000..ad51e14
Binary files /dev/null and b/marathon2/demos/L00.demo differ
diff --git a/marathon2/demos/L01.demo b/marathon2/demos/L01.demo
new file mode 100644 (file)
index 0000000..4ab9baa
Binary files /dev/null and b/marathon2/demos/L01.demo differ
diff --git a/marathon2/demos/L05.demo b/marathon2/demos/L05.demo
new file mode 100644 (file)
index 0000000..0c5637a
Binary files /dev/null and b/marathon2/demos/L05.demo differ
diff --git a/marathon2/demos/demos.resource b/marathon2/demos/demos.resource
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/marathon2/devices.c b/marathon2/devices.c
new file mode 100644 (file)
index 0000000..6ee5ffb
--- /dev/null
@@ -0,0 +1 @@
+/*\rDEVICES.C\rSunday, December 5, 1993 2:48:44 PM\r\rTuesday, December 7, 1993 11:12:25 PM\r       changed to be Jason compatible, open/close doors, and nixed gratuitous enum.\rTuesday, January 4, 1994 10:36:08 AM\r      opening doors can wake monsters.\rSunday, September 18, 1994 6:23:04 PM  (alain)\r        much of control panel code has been rewritten. no longer use composite sides,\r  but a flag in the side data structure. some control panels work over time (refueling)\r  and there are on/off textures associated with each control panel. and sounds.\rFriday, June 9, 1995 11:43:37 AM  (Jason')\r       destroy-able switches.\rWednesday, June 21, 1995 8:31:57 AM  (Jason)\r    tag switches.\r*/\r\r#include "cseries.h"\r\r#include "map.h"\r#include "monsters.h"\r#include "interface.h"\r#include "player.h"\r#include "platforms.h"\r#include "sound.h"\r#include "computer_interface.h"\r//#include "music.h"\r#include "lightsource.h"\r#include "game_window.h"\r#include "items.h"\r\r#ifdef mpwc\r#pragma segment marathon\r#endif\r\r/* ---------- constants */\r\r#define OXYGEN_RECHARGE_FREQUENCY 0\r#define ENERGY_RECHARGE_FREQUENCY 0\r\r#define MAXIMUM_ACTIVATION_RANGE (3*WORLD_ONE)\r#define MAXIMUM_PLATFORM_ACTIVATION_RANGE (3*WORLD_ONE)\r#define MAXIMUM_CONTROL_ACTIVATION_RANGE (WORLD_ONE+WORLD_ONE_HALF)\r#define OBJECT_RADIUS 50\r\r#define MINIMUM_RESAVE_TICKS (2*TICKS_PER_SECOND)\r\renum\r{\r        _target_is_platform,\r   _target_is_control_panel\r};\r\r/* ---------- structures */\r\renum // control panel sounds\r{\r       _activating_sound,\r     _deactivating_sound,\r   _unusuable_sound,\r      \r       NUMBER_OF_CONTROL_PANEL_SOUNDS\r};\r\rstruct control_panel_definition\r{\r   short class;\r   word flags;\r    \r       short collection;\r      short active_shape, inactive_shape;\r\r   short sounds[NUMBER_OF_CONTROL_PANEL_SOUNDS];   \r       fixed sound_frequency;\r \r       short item;\r};\r\r/* ---------- globals */\r\r#define NUMBER_OF_CONTROL_PANEL_DEFINITIONS (sizeof(control_panel_definitions)/sizeof(struct control_panel_definition))\rstatic struct control_panel_definition control_panel_definitions[]=\r{\r        // _collection_walls1\r  {_panel_is_oxygen_refuel, 0, _collection_walls1, 2, 3, {_snd_oxygen_refuel, NONE, NONE}, FIXED_ONE, NONE},\r     {_panel_is_shield_refuel, 0, _collection_walls1, 2, 3, {_snd_energy_refuel, NONE, NONE}, FIXED_ONE, NONE},\r     {_panel_is_double_shield_refuel, 0, _collection_walls1, 2, 3, {_snd_energy_refuel, NONE, NONE}, FIXED_ONE+FIXED_ONE/8, NONE},\r  {_panel_is_tag_switch, 0, _collection_walls1, 0, 1, {_snd_chip_insertion, NONE, NONE}, FIXED_ONE, _i_uplink_chip},\r     {_panel_is_light_switch, 0, _collection_walls1, 0, 1, {_snd_switch_on, _snd_switch_off, _snd_cant_toggle_switch}, FIXED_ONE, NONE},\r    {_panel_is_platform_switch, 0, _collection_walls1, 0, 1, {_snd_switch_on, _snd_switch_off, _snd_cant_toggle_switch}, FIXED_ONE, NONE},\r {_panel_is_tag_switch, 0, _collection_walls1, 0, 1, {_snd_switch_on, _snd_switch_off, _snd_cant_toggle_switch}, FIXED_ONE, NONE},\r      {_panel_is_pattern_buffer, 0, _collection_walls1, 4, 4, {_snd_pattern_buffer, NONE, NONE}, FIXED_ONE, NONE},\r   {_panel_is_computer_terminal, 0, _collection_walls1, 4, 4, {NONE, NONE, NONE}, FIXED_ONE, NONE},\r       {_panel_is_tag_switch, 0, _collection_walls1, 1, 0, {_snd_destroy_control_panel, NONE, NONE}, FIXED_ONE, NONE},\r\r       // _collection_walls2   \r       {_panel_is_shield_refuel, 0, _collection_walls2, 2, 3, {_snd_energy_refuel, NONE, NONE}, FIXED_ONE, NONE},\r     {_panel_is_double_shield_refuel, 0, _collection_walls2, 2, 3, {_snd_energy_refuel, NONE, NONE}, FIXED_ONE+FIXED_ONE/8, NONE},\r  {_panel_is_triple_shield_refuel, 0, _collection_walls2, 2, 3, {_snd_energy_refuel, NONE, NONE}, FIXED_ONE+FIXED_ONE/4, NONE},\r  {_panel_is_light_switch, 0, _collection_walls2, 0, 1, {_snd_switch_on, _snd_switch_off, _snd_cant_toggle_switch}, FIXED_ONE, NONE},\r    {_panel_is_platform_switch, 0, _collection_walls2, 0, 1, {_snd_switch_on, _snd_switch_off, _snd_cant_toggle_switch}, FIXED_ONE, NONE},\r {_panel_is_tag_switch, 0, _collection_walls2, 0, 1, {_snd_switch_on, _snd_switch_off, _snd_cant_toggle_switch}, FIXED_ONE, NONE},\r      {_panel_is_pattern_buffer, 0, _collection_walls2, 4, 4, {_snd_pattern_buffer, NONE, NONE}, FIXED_ONE, NONE},\r   {_panel_is_computer_terminal, 0, _collection_walls2, 4, 4, {NONE, NONE, NONE}, FIXED_ONE, NONE},\r       {_panel_is_oxygen_refuel, 0, _collection_walls2, 2, 3, {_snd_oxygen_refuel, NONE, NONE}, FIXED_ONE, NONE},\r     {_panel_is_tag_switch, 0, _collection_walls2, 0, 1, {_snd_chip_insertion, NONE, NONE}, FIXED_ONE, _i_uplink_chip},\r     {_panel_is_tag_switch, 0, _collection_walls2, 1, 0, {_snd_destroy_control_panel, NONE, NONE}, FIXED_ONE, NONE},\r\r       // _collection_walls3\r  {_panel_is_shield_refuel, 0, _collection_walls3, 2, 3, {_snd_energy_refuel, NONE, NONE}, FIXED_ONE, NONE},\r     {_panel_is_double_shield_refuel, 0, _collection_walls3, 2, 3, {_snd_energy_refuel, NONE, NONE}, FIXED_ONE+FIXED_ONE/8, NONE},\r  {_panel_is_triple_shield_refuel, 0, _collection_walls3, 2, 3, {_snd_energy_refuel, NONE, NONE}, FIXED_ONE+FIXED_ONE/4, NONE},\r  {_panel_is_light_switch, 0, _collection_walls3, 0, 1, {_snd_switch_on, _snd_switch_off, _snd_cant_toggle_switch}, FIXED_ONE, NONE},\r    {_panel_is_platform_switch, 0, _collection_walls3, 0, 1, {_snd_switch_on, _snd_switch_off, _snd_cant_toggle_switch}, FIXED_ONE, NONE},\r {_panel_is_tag_switch, 0, _collection_walls3, 0, 1, {_snd_switch_on, _snd_switch_off, _snd_cant_toggle_switch}, FIXED_ONE, NONE},\r      {_panel_is_pattern_buffer, 0, _collection_walls3, 4, 4, {_snd_pattern_buffer, NONE, NONE}, FIXED_ONE, NONE},\r   {_panel_is_computer_terminal, 0, _collection_walls3, 4, 4, {NONE, NONE, NONE}, FIXED_ONE, NONE},\r       {_panel_is_oxygen_refuel, 0, _collection_walls3, 2, 3, {_snd_oxygen_refuel, NONE, NONE}, FIXED_ONE, NONE},\r     {_panel_is_tag_switch, 0, _collection_walls3, 0, 1, {_snd_chip_insertion, NONE, NONE}, FIXED_ONE, _i_uplink_chip},\r     {_panel_is_tag_switch, 0, _collection_walls3, 1, 0, {_snd_destroy_control_panel, NONE, NONE}, FIXED_ONE, NONE},\r\r       // _collection_walls4\r  {_panel_is_shield_refuel, 0, _collection_walls5, 2, 3, {_snd_energy_refuel, NONE, NONE}, FIXED_ONE, NONE},\r     {_panel_is_double_shield_refuel, 0, _collection_walls5, 2, 3, {_snd_energy_refuel, NONE, NONE}, FIXED_ONE+FIXED_ONE/8, NONE},\r  {_panel_is_triple_shield_refuel, 0, _collection_walls5, 2, 3, {_snd_energy_refuel, NONE, NONE}, FIXED_ONE+FIXED_ONE/4, NONE},\r  {_panel_is_light_switch, 0, _collection_walls5, 0, 1, {_snd_pfhor_switch_on, _snd_pfhor_switch_off, _snd_cant_toggle_switch}, FIXED_ONE, NONE},\r        {_panel_is_platform_switch, 0, _collection_walls5, 0, 1, {_snd_pfhor_switch_on, _snd_pfhor_switch_off, _snd_cant_toggle_switch}, FIXED_ONE, NONE},\r     {_panel_is_tag_switch, 0, _collection_walls5, 0, 1, {_snd_pfhor_switch_on, _snd_pfhor_switch_off, _snd_cant_toggle_switch}, FIXED_ONE, NONE},\r  {_panel_is_pattern_buffer, 0, _collection_walls5, 4, 4, {_snd_pattern_buffer, NONE, NONE}, FIXED_ONE, NONE},\r   {_panel_is_computer_terminal, 0, _collection_walls5, 4, 4, {NONE, NONE, NONE}, FIXED_ONE, NONE},\r       {_panel_is_oxygen_refuel, 0, _collection_walls5, 2, 3, {_snd_oxygen_refuel, NONE, NONE}, FIXED_ONE, NONE},\r     {_panel_is_tag_switch, 0, _collection_walls5, 0, 1, {_snd_chip_insertion, NONE, NONE}, FIXED_ONE, _i_uplink_chip},\r     {_panel_is_tag_switch, 0, _collection_walls5, 1, 0, {_snd_destroy_control_panel, NONE, NONE}, FIXED_ONE, NONE},\r};\r\r/* ------------ private prototypes */\r\r#ifdef DEBUG\rstruct control_panel_definition *get_control_panel_definition(short control_panel_type);\r#else\r#define get_control_panel_definition(i) (control_panel_definitions+(i))\r#endif\r\rstatic short find_action_key_target(short player_index, world_distance range, short *target_type);\rstatic boolean line_side_has_control_panel(short line_index, short polygon_index, short *side_index_with_panel);\rstatic void  change_panel_state(short player_index, short panel_side_index);\rstatic void set_control_panel_texture(struct side_data *side);\r\rstatic boolean line_is_within_range(short monster_index, short line_index, world_distance range);\r\rstatic boolean switch_can_be_toggled(short line_index, boolean player_hit);\r\rstatic void play_control_panel_sound(short side_index, short sound_index);\r\rstatic boolean get_recharge_status(short side_index);\r\r/* ---------- code */\r\r/* set the initial states of all switches based on the objects they control */\rvoid initialize_control_panels_for_level(\r     void)\r{\r        short side_index;\r      struct side_data *side;\r\r       for (side_index= 0, side= map_sides; side_index<dynamic_world->side_count; ++side, ++side_index)\r       {\r              if (SIDE_IS_CONTROL_PANEL(side))\r               {\r                      struct control_panel_definition *definition= get_control_panel_definition(side->control_panel_type);\r                   boolean status= FALSE;\r                 \r                       switch (definition->class)\r                     {\r                              case _panel_is_tag_switch:\r                                     status= GET_CONTROL_PANEL_STATUS(side);\r                                        // use default position\r                                        break;\r                         \r                               case _panel_is_light_switch:\r                                   status= get_light_status(side->control_panel_permutation);\r                                     break;\r                         \r                               case _panel_is_platform_switch:\r                                        if (platform_is_on(get_polygon_data(side->control_panel_permutation)->permutation)) status= TRUE;\r                                      break;\r                 }\r                      \r                       SET_CONTROL_PANEL_STATUS(side, status);\r                        set_control_panel_texture(side);\r               }\r      }\r\r     return;\r}\r\rvoid update_control_panels(\r void)\r{\r        short player_index;\r    struct player_data *player;\r    \r       for (player_index= 0, player= players; player_index<dynamic_world->player_count; ++player_index, ++player)\r     {\r              short side_index;\r              \r               if ((side_index= player->control_panel_side_index)!=NONE)\r              {\r                      struct side_data *side= get_side_data(player->control_panel_side_index);\r                       struct control_panel_definition *definition= get_control_panel_definition(side->control_panel_type);\r                   boolean still_in_use= FALSE;\r                   \r                       if (player->variables.direction == player->variables.last_direction &&\r                         player->variables.last_position.x == player->variables.position.x &&\r                           player->variables.last_position.y == player->variables.position.y &&\r                           player->variables.last_position.z == player->variables.position.z)\r                     {\r                              switch (definition->class)\r                             {\r                                      case _panel_is_oxygen_refuel:\r                                          if (!(dynamic_world->tick_count&OXYGEN_RECHARGE_FREQUENCY))\r                                            {\r                                                      if (player->suit_oxygen<PLAYER_MAXIMUM_SUIT_OXYGEN)\r                                                    {\r                                                              player->suit_oxygen+= TICKS_PER_SECOND;\r                                                                mark_oxygen_display_as_dirty();\r                                                                still_in_use= TRUE;\r                                                    }\r                                              }\r                                              break;\r                                 \r                                       case _panel_is_shield_refuel:\r                                  case _panel_is_double_shield_refuel:\r                                   case _panel_is_triple_shield_refuel:\r                                           if (!(dynamic_world->tick_count&ENERGY_RECHARGE_FREQUENCY))\r                                            {\r                                                      short maximum, rate;\r                                                   \r                                                       switch (definition->class)\r                                                     {\r                                                              case _panel_is_shield_refuel: maximum= PLAYER_MAXIMUM_SUIT_ENERGY, rate= 1; break;\r                                                             case _panel_is_double_shield_refuel: maximum= 2*PLAYER_MAXIMUM_SUIT_ENERGY, rate= 2; break;\r                                                            case _panel_is_triple_shield_refuel: maximum= 3*PLAYER_MAXIMUM_SUIT_ENERGY, rate= 3; break;\r                                                            default: halt();\r                                                       }\r                                                      if (player->suit_energy<maximum)\r                                                       {\r                                                              player->suit_energy= CEILING(player->suit_energy+rate, maximum);\r                                                               mark_shield_display_as_dirty();\r                                                                still_in_use= TRUE;\r                                                    }\r                                              }\r                                              break;\r                                 \r                                       default:\r                                               halt();\r                                }\r                      }\r                      \r                       if (still_in_use)\r                      {\r                              set_control_panel_texture(side);\r                               play_control_panel_sound(side_index, _activating_sound);\r                       }\r                      else\r                   {\r                              change_panel_state(player_index, side_index);\r                          stop_sound(NONE, definition->sounds[_activating_sound]);\r                       }\r              }\r      }\r      \r       return;\r}\r\rvoid update_action_key(\r     short player_index,\r    boolean triggered)\r{\r   short               object_index;\r      short               minimum_distance= 0;\r       short               target_type;\r       struct player_data  *player= get_player_data(player_index);\r    \r       if(triggered) \r {\r              object_index= find_action_key_target(player_index, MAXIMUM_ACTIVATION_RANGE, &target_type);\r\r           if(object_index != NONE)\r               {\r                      switch(target_type) \r                   {\r                              case _target_is_platform:\r                                      player_touch_platform_state(player_index, object_index);\r                                       break;\r                         case _target_is_control_panel:\r                                 change_panel_state(player_index, object_index);\r                                        break;\r\r                                default:\r                                       vhalt(csprintf(temporary, "%d is not a valid target type", target_type));\r                                      break;\r                 }\r              }\r      }\r}\r\rboolean untoggled_repair_switches_on_level(\r       void)\r{\r        short side_index;\r      struct side_data *side;\r        boolean untoggled_switch= FALSE;\r       \r       for (side_index= 0, side= map_sides; side_index<dynamic_world->side_count && !untoggled_switch; ++side_index, ++side)\r  {\r              if (SIDE_IS_CONTROL_PANEL(side) && SIDE_IS_REPAIR_SWITCH(side))\r                {\r                      struct control_panel_definition *definition= get_control_panel_definition(side->control_panel_type);\r                   \r                       switch (definition->class)\r                     {\r                              case _panel_is_platform_switch:\r                                        untoggled_switch= platform_is_at_initial_state(get_polygon_data(side->control_panel_permutation)->permutation) ? TRUE : FALSE;\r                                 break;\r                         \r                               default:\r                                       untoggled_switch= GET_CONTROL_PANEL_STATUS(side) ? FALSE : TRUE;\r                                       break;\r                 }\r              }\r      }\r      \r       return untoggled_switch;\r}\r\rvoid assume_correct_switch_position(\r       short switch_type, /* platform or light */\r     short permutation, /* platform or light index */\r       boolean new_state)\r{\r   short side_index;\r      struct side_data *side;\r        \r       for (side_index= 0, side= map_sides; side_index<dynamic_world->side_count; ++side_index, ++side)\r       {\r              if (SIDE_IS_CONTROL_PANEL(side) && side->control_panel_permutation==permutation)\r               {\r                      struct control_panel_definition *definition= get_control_panel_definition(side->control_panel_type);\r                   \r                       if (switch_type==definition->class)\r                    {\r                              play_control_panel_sound(side_index, new_state ? _activating_sound : _deactivating_sound);\r                             SET_CONTROL_PANEL_STATUS(side, new_state);\r                             set_control_panel_texture(side);\r                       }\r              }\r      }\r      \r       return;\r}\r\rvoid try_and_toggle_control_panel(\r  short polygon_index,\r   short line_index)\r{\r    struct polygon_data *polygon= get_polygon_data(polygon_index);\r struct line_data *line= get_line_data(line_index);\r     short side_index= find_adjacent_side(polygon_index, line_index);\r       \r       if (side_index!=NONE)\r  {\r              struct side_data *side= get_side_data(side_index);\r\r            if (SIDE_IS_CONTROL_PANEL(side))\r               {\r                      if (switch_can_be_toggled(side_index, FALSE))\r                  {\r                              boolean make_sound, state= GET_CONTROL_PANEL_STATUS(side);\r                             struct control_panel_definition *definition= get_control_panel_definition(side->control_panel_type);\r                           \r                               switch (definition->class)\r                             {\r                                      case _panel_is_tag_switch:\r                                             state= !state;\r                                         make_sound= set_tagged_light_statuses(side->control_panel_permutation, state);\r                                         if (try_and_change_tagged_platform_states(side->control_panel_permutation, state)) make_sound= TRUE;\r                                           if (!side->control_panel_permutation) make_sound= TRUE;\r                                                if (make_sound)\r                                                {\r                                                      SET_CONTROL_PANEL_STATUS(side, state);\r                                                 set_control_panel_texture(side);\r                                               }\r                                              break;\r                                 case _panel_is_light_switch:\r                                           state= !state;\r                                         make_sound= set_light_status(side->control_panel_permutation, state);\r                                          break;\r                                 case _panel_is_platform_switch:\r                                                state= !state;\r                                         make_sound= try_and_change_platform_state(get_polygon_data(side->control_panel_permutation)->permutation, state);\r                                              break;\r                         }\r                              \r                               if (make_sound)\r                                {\r                                      play_control_panel_sound(side_index, state ? _activating_sound : _deactivating_sound);\r                         }\r                      }\r              }\r      }\r      \r       return;\r}\r\r/* ---------- these functions are all used in Vulcan */\rboolean shape_is_control_panel(\r     shape_descriptor texture)\r{\r    boolean is_control_panel= FALSE;\r       short index;\r\r  for(index= 0; index<NUMBER_OF_CONTROL_PANEL_DEFINITIONS; ++index)\r      {\r              struct control_panel_definition *definition= get_control_panel_definition(index);\r\r             if(texture==BUILD_DESCRIPTOR(definition->collection, definition->active_shape) ||\r                      texture==BUILD_DESCRIPTOR(definition->collection, definition->inactive_shape))\r         {\r                      is_control_panel= TRUE;\r                        break;\r         }\r      }\r      \r       return is_control_panel;\r}\r\rshort get_panel_class(\r     short panel_type)\r{\r    struct control_panel_definition *definition= get_control_panel_definition(panel_type);\r \r       return definition->class;\r}\r\r//---------- changed 9.18.95\rboolean control_panel_type_valid_for_texture(\r        shape_descriptor shape,\r        short control_panel_type)\r{\r    struct control_panel_definition *definition= get_control_panel_definition(control_panel_type);\r boolean valid= FALSE;\r  \r       if(GET_DESCRIPTOR_COLLECTION(shape)==definition->collection)\r   {\r              if((GET_DESCRIPTOR_SHAPE(shape)==definition->active_shape) ||\r                  (GET_DESCRIPTOR_SHAPE(shape)==definition->inactive_shape))\r             {\r                      valid= TRUE;\r           }\r      }\r      \r       return valid;\r}\r//------------------\r\r/* ---------- private code */\r\rstatic short find_action_key_target(\r      short player_index,\r    world_distance range,\r  short *target_type)\r{\r  struct player_data *player= get_player_data(player_index);\r     short current_polygon= player->camera_polygon_index;\r   world_point2d destination;\r     boolean done= FALSE;\r   short itemhit, line_index;\r     struct polygon_data *polygon;\r\r /* Should we use this one, the physics one, or the object one? */\r      ray_to_line_segment((world_point2d *) &player->location, &destination, player->facing, range);\r\r//      dprintf("#%d(#%d,#%d) --> (#%d,#%d) (#%d along #%d)", current_polygon, player->location.x, player->location.y, destination.x, destination.y, range, player->facing);\r\r  itemhit= NONE;\r while (!done)\r  {\r              line_index= find_line_crossed_leaving_polygon(current_polygon, (world_point2d *) &player->location, &destination);\r                     \r               if (line_index==NONE)\r          {\r                      done= TRUE;\r            } \r             else \r          {\r                      struct line_data *line;\r                        short original_polygon;\r\r                       line= get_line_data(line_index);\r                       original_polygon= current_polygon;\r                     current_polygon= find_adjacent_polygon(current_polygon, line_index);\r                   \r//                     dprintf("leaving polygon #%d through line #%d to polygon #%d", original_polygon, line_index, current_polygon);\r                 \r                       if (current_polygon!=NONE)\r                     {\r                              polygon= get_polygon_data(current_polygon);\r\r                           /* We hit a platform */                         \r                               if (polygon->type==_polygon_is_platform && line_is_within_range(player->monster_index, line_index, MAXIMUM_PLATFORM_ACTIVATION_RANGE) &&\r                                       platform_is_legal_player_target(polygon->permutation))\r                         {\r//                                    dprintf("found platform #%d in %p", polygon->permutation, polygon);\r                                    itemhit= polygon->permutation;\r                                 *target_type= _target_is_platform;\r                                     done= TRUE;\r                            } \r                     } \r                     else \r                  {\r                              done= TRUE;\r                    }\r\r                     /* Slammed a wall */\r                   if (line_is_within_range(player->monster_index, line_index, MAXIMUM_CONTROL_ACTIVATION_RANGE))\r                 {\r                              if (line_side_has_control_panel(line_index, original_polygon, &itemhit))\r                               {\r                                      if (switch_can_be_toggled(itemhit, TRUE))\r                                      {\r                                              *target_type= _target_is_control_panel;\r                                                done= TRUE;\r                                    }\r                                      else\r                                   {\r                                              itemhit= NONE;\r                                 }\r                              }\r                      }\r              }\r      }\r      \r       return itemhit;\r}\r\rstatic boolean line_is_within_range(\r        short monster_index,\r   short line_index,\r      world_distance range)\r{\r        world_point3d monster_origin= get_object_data(get_monster_data(monster_index)->object_index)->location;\r        world_point3d line_origin;\r     world_distance radius, height;\r world_distance dx, dy, dz;\r     \r       calculate_line_midpoint(line_index, &line_origin);\r     get_monster_dimensions(monster_index, &radius, &height);\r       monster_origin.z+= height>>1;\r  \r       dx= monster_origin.x-line_origin.x;\r    dy= monster_origin.y-line_origin.y;\r    dz= 2*(monster_origin.z-line_origin.z); /* dz is weighted */\r   \r       return isqrt(dx*dx + dy*dy + dz*dz)<range ? TRUE : FALSE;\r}\r\rstatic boolean line_side_has_control_panel(\r       short line_index, \r     short polygon_index,\r   short *side_index_with_panel)\r{\r        short             side_index = NONE;\r   boolean           has_panel = FALSE;\r   struct line_data  *line = get_line_data(line_index);\r   struct side_data  *side = NULL;\r        \r       if (line->clockwise_polygon_owner==polygon_index)\r      {\r              side_index = line->clockwise_polygon_side_index;\r               if (side_index != NONE)\r                {\r                      side = get_side_data(side_index);\r              }\r      } \r     else\r   {\r              assert(line->counterclockwise_polygon_owner==polygon_index);\r           side_index = line->counterclockwise_polygon_side_index;\r                if (side_index != NONE)\r                {\r                      side= get_side_data(side_index);\r               }\r      }\r\r     if (side != NULL && SIDE_IS_CONTROL_PANEL(side))\r       {\r              *side_index_with_panel = side_index;\r           has_panel = TRUE;\r      }\r      \r       return has_panel;\r}\r\rstatic void        change_panel_state(\r    short player_index,\r    short panel_side_index)\r{\r      short state, make_sound= FALSE;\r        struct side_data *side= get_side_data(panel_side_index);\r       struct player_data *player= get_player_data(player_index);\r     struct control_panel_definition *definition= get_control_panel_definition(side->control_panel_type);\r\r  state= GET_CONTROL_PANEL_STATUS(side);\r \r       /* Do the right thing, based on the panel type.. */\r    switch (definition->class)\r     {\r              case _panel_is_oxygen_refuel:\r          case _panel_is_shield_refuel:\r          case _panel_is_double_shield_refuel:\r           case _panel_is_triple_shield_refuel:\r                   player->control_panel_side_index= player->control_panel_side_index==panel_side_index ? NONE : panel_side_index;\r                        state= get_recharge_status(panel_side_index);\r                  SET_CONTROL_PANEL_STATUS(side, state);\r                 if (!state) set_control_panel_texture(side);\r                   break;\r         case _panel_is_computer_terminal:\r                      if (get_game_state()==_game_in_progress && !PLAYER_HAS_CHEATED(player) && !PLAYER_HAS_MAP_OPEN(player))\r                        {\r                              /* this will handle changing levels, if necessary (i.e., if weÕre finished) */\r                         enter_computer_interface(player_index, side->control_panel_permutation, calculate_level_completion_state());\r                   }\r                      break;\r         case _panel_is_tag_switch:\r                     if (definition->item==NONE || (!state && try_and_subtract_player_item(player_index, definition->item)))\r                        {\r                              state= !state;\r                         make_sound= set_tagged_light_statuses(side->control_panel_permutation, state);\r                         if (try_and_change_tagged_platform_states(side->control_panel_permutation, state)) make_sound= TRUE;\r                           if (!side->control_panel_permutation) make_sound= TRUE;\r                                if (make_sound)\r                                {\r                                      SET_CONTROL_PANEL_STATUS(side, state);\r                                 set_control_panel_texture(side);\r                               }\r                      }\r                      break;\r         case _panel_is_light_switch:\r                   state= !state;\r                 make_sound= set_light_status(side->control_panel_permutation, state);\r                  break;\r         case _panel_is_platform_switch:\r                        state= !state;\r                 make_sound= try_and_change_platform_state(get_polygon_data(side->control_panel_permutation)->permutation, state);\r                      break;\r         case _panel_is_pattern_buffer:\r                 if (dynamic_world->tick_count-player->ticks_at_last_successful_save>MINIMUM_RESAVE_TICKS &&\r                            player_controlling_game() && !PLAYER_HAS_CHEATED(local_player) && !game_is_networked)\r                  {\r                              play_control_panel_sound(panel_side_index, _activating_sound);\r//                               fade_out_background_music(30);\r\r                                /* Assume a successful save- prevents vidding of the save game key.. */\r                                player->ticks_at_last_successful_save= dynamic_world->tick_count;\r                              if (!save_game()) \r                             {\r                                      player->ticks_at_last_successful_save= 0;\r                              }\r//                            fade_in_background_music(30);\r                  }\r                      break;\r\r                default:\r                       halt();\r        }\r      \r       if (make_sound)\r        {\r              play_control_panel_sound(panel_side_index, state ? _activating_sound : _deactivating_sound);\r   }\r      \r       return; \r}\r\rstatic void set_control_panel_texture(\r     struct side_data *side)\r{\r      struct control_panel_definition *definition= get_control_panel_definition(side->control_panel_type);\r   \r       side->primary_texture.texture= BUILD_DESCRIPTOR(definition->collection,\r                GET_CONTROL_PANEL_STATUS(side) ? definition->active_shape : definition->inactive_shape);\r\r      return;\r}\r\r#ifdef DEBUG\rstatic struct control_panel_definition *get_control_panel_definition(\r  short control_panel_type)\r{\r    assert(control_panel_type>=0 && control_panel_type<NUMBER_OF_CONTROL_PANEL_DEFINITIONS);\r       \r       return control_panel_definitions + control_panel_type;\r}\r#endif\r\rstatic boolean switch_can_be_toggled(\r short side_index,\r      boolean player_hit)\r{\r  boolean valid_toggle= TRUE;\r    struct side_data *side= get_side_data(side_index);\r     struct control_panel_definition *definition= get_control_panel_definition(side->control_panel_type);\r   \r       if (side->flags&_side_is_lighted_switch)\r       {\r              valid_toggle= get_light_intensity(side->primary_lightsource_index)>(3*FIXED_ONE/4) ? TRUE : FALSE;\r     }\r\r     if (definition->item!=NONE && !player_hit) valid_toggle= FALSE;\r        if (player_hit && (side->flags&_side_switch_can_only_be_hit_by_projectiles)) valid_toggle= FALSE;\r      \r       if (valid_toggle && (side->flags&_side_switch_can_be_destroyed))\r       {\r              // destroy switch\r              SET_SIDE_CONTROL_PANEL(side, FALSE);\r   }\r      \r       if (!valid_toggle && player_hit) play_control_panel_sound(side_index, _unusuable_sound);\r       \r       return valid_toggle;\r}\r\rstatic void play_control_panel_sound(\r  short side_index,\r      short sound_index)\r{\r   struct side_data *side= get_side_data(side_index);\r     struct control_panel_definition *definition= get_control_panel_definition(side->control_panel_type);\r   \r       assert(sound_index>=0 && sound_index<NUMBER_OF_CONTROL_PANEL_SOUNDS);\r  \r       _play_side_sound(side_index, definition->sounds[sound_index], definition->sound_frequency);\r    \r       return;\r}\r\rstatic boolean get_recharge_status(\r short side_index)\r{\r    short player_index;\r    boolean status= FALSE;\r \r       for (player_index= 0; player_index<dynamic_world->player_count; ++player_index)\r        {\r              struct player_data *player= get_player_data(player_index);\r             \r               if (player->control_panel_side_index==side_index) status= TRUE;\r        }\r      \r       return status;\r}
\ No newline at end of file
diff --git a/marathon2/editor code/.AppleDouble/.Parent b/marathon2/editor code/.AppleDouble/.Parent
new file mode 100644 (file)
index 0000000..07d3c71
Binary files /dev/null and b/marathon2/editor code/.AppleDouble/.Parent differ
diff --git a/marathon2/editor code/.AppleDouble/editor.h b/marathon2/editor code/.AppleDouble/editor.h
new file mode 100644 (file)
index 0000000..6613646
Binary files /dev/null and b/marathon2/editor code/.AppleDouble/editor.h differ
diff --git a/marathon2/editor code/editor.h b/marathon2/editor code/editor.h
new file mode 100644 (file)
index 0000000..c2b03c0
--- /dev/null
@@ -0,0 +1 @@
+/*\r    EDITOR.H\r       Sunday, April 17, 1994 10:50:25 PM\r*/\r\r#ifndef __EDITOR_H_\r#define __EDITOR_H_\r\r#define MARATHON_ONE_DATA_VERSION 0\r#define MARATHON_TWO_DATA_VERSION 1\r#define EDITOR_MAP_VERSION (MARATHON_TWO_DATA_VERSION)\r\rtypedef world_point2d saved_map_pt;\rtypedef struct line_data saved_line;\rtypedef struct side_data saved_side;\rtypedef struct polygon_data saved_poly;\rtypedef struct map_annotation saved_annotation;\rtypedef struct map_object saved_object;\rtypedef struct static_data saved_map_data;\r\r#define MINIMUM_MAP_X_COORDINATE SHORT_MIN\r#define MAXIMUM_MAP_X_COORDINATE SHORT_MAX\r#define MINIMUM_MAP_Y_COORDINATE SHORT_MIN\r#define MAXIMUM_MAP_Y_COORDINATE SHORT_MAX\r\r#define MINIMUM_FLOOR_HEIGHT (-8*WORLD_ONE)\r#define MINIMUM_CEILING_HEIGHT (MINIMUM_FLOOR_HEIGHT+WORLD_ONE)\r\r#define MAXIMUM_FLOOR_HEIGHT (8*WORLD_ONE)\r#define MAXIMUM_CEILING_HEIGHT (MAXIMUM_FLOOR_HEIGHT+WORLD_ONE)\r\r#define INVALID_HEIGHT (MINIMUM_FLOOR_HEIGHT-1)\r\renum {\r        _saved_guard_path_is_random= 0x0001\r};\r\rstruct map_index_data \r{\r       char level_name[LEVEL_NAME_LENGTH];\r    char unused;\r   long level_flags;\r};\r\r#define MAXIMUM_GUARD_PATH_CONTROL_POINTS 20\r\rstruct saved_path\r{\r        short point_count;\r     word flags;\r    world_point2d points[MAXIMUM_GUARD_PATH_CONTROL_POINTS];\r       short polygon_indexes[MAXIMUM_GUARD_PATH_CONTROL_POINTS];\r};\r\r/* Prevent ridiculous maps.. */\r#define MAX_LINES_PER_VERTEX 15\r#endif
\ No newline at end of file
diff --git a/marathon2/effect_definitions.h b/marathon2/effect_definitions.h
new file mode 100644 (file)
index 0000000..3db3168
--- /dev/null
@@ -0,0 +1 @@
+/*\rEFFECT_DEFINITIONS.H\rTuesday, May 31, 1994 5:21:28 PM\r*/\r\r/* ---------- constants */\r\renum /* flags */\r{\r   _end_when_animation_loops= 0x0001,\r     _end_when_transfer_animation_loops= 0x0002,\r    _sound_only= 0x0004, /* play the animationÕs initial sound and nothing else */\r _make_twin_visible= 0x0008,\r    _media_effect= 0x0010\r};\r\r/* ---------- structures */\r\rstruct effect_definition\r{\r      short collection, shape;\r\r      fixed sound_pitch;\r     \r       word flags;\r    short delay, delay_sound;\r};\r\r/* ---------- effect definitions */\r\rstruct effect_definition effect_definitions[NUMBER_OF_EFFECT_TYPES]=\r{\r      /* rocket explosion, contrail */\r       {_collection_rocket, 1, _normal_frequency, _end_when_animation_loops, 0, NONE},\r        {_collection_rocket, 2, _normal_frequency, _end_when_animation_loops, 0, NONE},\r\r       /* grenade explosion, contrail */\r      {_collection_rocket, 9, _normal_frequency, _end_when_animation_loops, 0, NONE},\r        {_collection_rocket, 4, _normal_frequency, _end_when_animation_loops, 0, NONE},\r\r       /* bullet ricochet */\r  {_collection_rocket, 13, _normal_frequency, _end_when_animation_loops, 0, NONE},\r\r      /* _effect_alien_weapon_ricochet */\r    {_collection_rocket, 5, _normal_frequency, _end_when_animation_loops, 0, NONE},\r\r       /* flame thrower burst */\r      {_collection_rocket, 6, _normal_frequency, _end_when_animation_loops, 0, NONE},\r        \r       /* fighter blood splash */\r     {_collection_fighter, 8, _normal_frequency, _end_when_animation_loops, 0, NONE},\r       \r       /* player blood splash */\r      {_collection_rocket, 10, _normal_frequency, _end_when_animation_loops, 0, NONE},\r       \r       /* civilian blood splash, assimilated civilian blood splash */\r {_collection_civilian, 7, _normal_frequency, _end_when_animation_loops, 0, NONE},\r      {BUILD_COLLECTION(_collection_civilian, 3), 12, _normal_frequency, _end_when_animation_loops, 0, NONE},\r        \r       /* enforcer blood splash */\r    {_collection_enforcer, 5, _normal_frequency, _end_when_animation_loops, 0, NONE},\r      \r       /* _effect_compiler_bolt_minor_detonation, _effect_compiler_bolt_major_detonation,\r             _effect_compiler_bolt_major_contrail */\r        {_collection_compiler, 6, _normal_frequency, _end_when_animation_loops, 0, NONE},\r      {BUILD_COLLECTION(_collection_compiler, 1), 6, _normal_frequency, _end_when_animation_loops, 0, NONE},\r {BUILD_COLLECTION(_collection_compiler, 1), 5, _normal_frequency, _end_when_animation_loops, 0, NONE},\r \r       /* _effect_fighter_projectile_detonation, _effect_fighter_melee_detonation */\r  {BUILD_COLLECTION(_collection_fighter, 0), 10, _normal_frequency, _end_when_animation_loops, 0, NONE},\r {BUILD_COLLECTION(_collection_fighter, 0), 11, _normal_frequency, _sound_only, 0, NONE},\r       \r       /* _effect_hunter_projectile_detonation, _effect_hunter_spark */\r       {BUILD_COLLECTION(_collection_hunter, 0), 4, _normal_frequency, _end_when_animation_loops, 0, NONE},\r   {BUILD_COLLECTION(_collection_hunter, 0), 8, _normal_frequency, _end_when_animation_loops, 0, NONE},\r   \r       /* _effect_minor_fusion_detonation, _effect_major_fusion_detonation, _effect_major_fusion_contrail */\r  {BUILD_COLLECTION(_collection_rocket, 0), 14, _normal_frequency, _end_when_animation_loops, 0, NONE},\r  {BUILD_COLLECTION(_collection_rocket, 0), 15, _higher_frequency, _end_when_animation_loops, 0, NONE},\r  {BUILD_COLLECTION(_collection_rocket, 0), 16, _higher_frequency, _end_when_animation_loops, 0, NONE},\r  \r       /* _effect_fist_detonation */\r  {_collection_rocket, 17, _normal_frequency, _sound_only, 0, NONE},\r\r    /* _effect_minor_defender_detonation, _effect_major_defender_detonation, _effect_defender_spark */\r     {BUILD_COLLECTION(_collection_defender, 0), 5, _normal_frequency, _end_when_animation_loops, 0, NONE},\r {BUILD_COLLECTION(_collection_defender, 1), 5, _normal_frequency, _end_when_animation_loops, 0, NONE},\r {BUILD_COLLECTION(_collection_defender, 0), 7, _normal_frequency, _end_when_animation_loops, 0, NONE},\r \r       /* _effect_trooper_blood_splash */\r     {_collection_trooper, 8, _normal_frequency, _end_when_animation_loops, 0, NONE},\r       \r       /* _effect_lamp_breaking */\r    {_collection_scenery1, 22, _normal_frequency, _end_when_animation_loops, 0, NONE},\r     {_collection_scenery2, 18, _normal_frequency, _end_when_animation_loops, 0, NONE},\r     {_collection_scenery3, 16, _normal_frequency, _end_when_animation_loops, 0, NONE},\r     {_collection_scenery5, 8, _normal_frequency, _end_when_animation_loops, 0, NONE},\r      \r       /* _effect_metallic_clang */\r   {_collection_rocket, 23, _normal_frequency, _sound_only, 0, NONE},\r     \r       /* _effect_teleport_in, _effect_teleport_out */\r        {_collection_items, 0, _normal_frequency, _end_when_transfer_animation_loops|_make_twin_visible, TICKS_PER_SECOND, _snd_teleport_in},\r  {_collection_items, 0, _normal_frequency, _end_when_transfer_animation_loops, 0, NONE},\r        \r       /* _effect_small_water_splash, _effect_medium_water_splash, _effect_large_water_splash, _effect_large_water_emergence */\r       {_collection_scenery1, 0, _normal_frequency, _end_when_animation_loops|_media_effect, 0, NONE},\r        {_collection_scenery1, 1, _normal_frequency, _end_when_animation_loops|_media_effect, 0, NONE},\r        {_collection_scenery1, 2, _normal_frequency, _end_when_animation_loops|_sound_only, NONE},\r     {_collection_scenery1, 3, _normal_frequency, _end_when_animation_loops|_sound_only, NONE},\r     \r       /* _effect_small_lava_splash, _effect_medium_lava_splash, _effect_large_lava_splash, _effect_large_lava_emergence */\r   {_collection_scenery2, 0, _normal_frequency, _end_when_animation_loops|_media_effect, 0, NONE},\r        {_collection_scenery2, 1, _normal_frequency, _end_when_animation_loops|_media_effect, 0, NONE},\r        {_collection_scenery2, 2, _normal_frequency, _end_when_animation_loops|_sound_only, 0, NONE},\r  {_collection_scenery2, 17, _normal_frequency, _end_when_animation_loops|_sound_only, 0, NONE},\r\r        /* _effect_small_sewage_splash, _effect_medium_sewage_splash, _effect_large_sewage_splash, _effect_large_sewage_emergence */\r   {_collection_scenery3, 0, _normal_frequency, _end_when_animation_loops|_media_effect, 0, NONE},\r        {_collection_scenery3, 1, _normal_frequency, _end_when_animation_loops|_media_effect, 0, NONE},\r        {_collection_scenery3, 2, _normal_frequency, _end_when_animation_loops|_sound_only, 0, NONE},\r  {_collection_scenery3, 3, _normal_frequency, _end_when_animation_loops|_sound_only, 0, NONE},\r\r /* _effect_small_goo_splash, _effect_medium_goo_splash, _effect_large_goo_splash, _effect_large_goo_emergence */\r       {_collection_scenery5, 0, _normal_frequency, _end_when_animation_loops|_media_effect, 0, NONE},\r        {_collection_scenery5, 1, _normal_frequency, _end_when_animation_loops|_media_effect, 0, NONE},\r        {_collection_scenery5, 2, _normal_frequency, _end_when_animation_loops|_sound_only, 0, NONE},\r  {_collection_scenery5, 3, _normal_frequency, _end_when_animation_loops|_sound_only, 0, NONE},\r  \r       /* _effect_minor_hummer_projectile_detonation, _effect_major_hummer_projectile_detonation,\r             _effect_durandal_hummer_projectile_detonation, _effect_hummer_spark */\r {BUILD_COLLECTION(_collection_hummer, 0), 6, _normal_frequency, _end_when_animation_loops, 0, NONE},\r   {BUILD_COLLECTION(_collection_hummer, 1), 6, _higher_frequency, _end_when_animation_loops, 0, NONE},\r   {BUILD_COLLECTION(_collection_hummer, 4), 6, _lower_frequency, _end_when_animation_loops, 0, NONE},\r    {BUILD_COLLECTION(_collection_hummer, 0), 7, _normal_frequency, _end_when_animation_loops, 0, NONE},\r   \r       /* _effect_cyborg_projectile_detonation, _effect_cyborg_blood_splash */\r        {_collection_cyborg, 7, _normal_frequency, _end_when_animation_loops, 0, NONE},\r        {_collection_cyborg, 8, _normal_frequency, _end_when_animation_loops, 0, NONE},\r\r       /*      _effect_minor_fusion_dispersal, _effect_major_fusion_dispersal, _effect_overloaded_fusion_dispersal */\r {BUILD_COLLECTION(_collection_rocket, 0), 19, _normal_frequency, _end_when_animation_loops|_sound_only, 0, NONE},\r      {BUILD_COLLECTION(_collection_rocket, 0), 20, _higher_frequency, _end_when_animation_loops|_sound_only, 0, NONE},\r      {BUILD_COLLECTION(_collection_rocket, 0), 21, _lower_frequency, _end_when_animation_loops|_sound_only, 0, NONE},\r\r      /* _effect_sewage_yeti_blood_splash, _effect_sewage_yeti_projectile_detonation */\r      {BUILD_COLLECTION(_collection_yeti, 0), 5, _normal_frequency, _end_when_animation_loops, 0, NONE},\r     {BUILD_COLLECTION(_collection_yeti, 0), 11, _normal_frequency, _end_when_animation_loops, 0, NONE},\r    \r       /* _effect_water_yeti_blood_splash */\r  {BUILD_COLLECTION(_collection_yeti, 1), 5, _normal_frequency, _end_when_animation_loops, 0, NONE},\r     \r       /* _effect_lava_yeti_blood_splash, _effect_lava_yeti_projectile_detonation */\r  {BUILD_COLLECTION(_collection_yeti, 2), 5, _normal_frequency, _end_when_animation_loops, 0, NONE},\r     {BUILD_COLLECTION(_collection_yeti, 2), 7, _normal_frequency, _end_when_animation_loops, 0, NONE},\r\r    /* _effect_yeti_melee_detonation */\r    {_collection_yeti, 8, _normal_frequency, _sound_only, 0, NONE},\r        \r       /* _effect_juggernaut_spark, _effect_juggernaut_missile_contrail */\r    {_collection_juggernaut, 3, _normal_frequency, _end_when_animation_loops, 0, NONE},\r    {_collection_rocket, 24, _normal_frequency, _end_when_animation_loops, 0, NONE},\r};\r
\ No newline at end of file
diff --git a/marathon2/effects.c b/marathon2/effects.c
new file mode 100644 (file)
index 0000000..c233288
--- /dev/null
@@ -0,0 +1 @@
+/*\rEFFECTS.C\rFriday, May 27, 1994 10:40:13 AM\r\rSaturday, May 28, 1994 2:13:08 AM\r      hopefully effects can be used for sparks.  most effects disappear when their animations\r        terminate.\rFriday, September 30, 1994 5:48:25 PM (Jason)\r       hopefully.  ha.  added sound-only effects.\rWednesday, February 1, 1995 12:58:17 AM  (Jason')\r   teleporting item effects.\r*/\r\r#include "cseries.h"\r#include "map.h"\r#include "interface.h"\r#include "effects.h"\r#include "sound.h"\r\r#ifdef mpwc\r#pragma segment objects\r#endif\r\r/*\rryan reports get_object_data() failing on effect->data after a teleport effect terminates\r*/\r\r/* ---------- macros */\r\r/* ---------- structures */\r\r/* ---------- private prototypes */\r\r#ifdef DEBUG\rstruct effect_definition *get_effect_definition(short type);\r#else\r#define get_effect_definition(i) (effect_definitions+(i))\r#endif\r\r/* ---------- globals */\r\r/* import effect definition constants, structures and globals */\r#include "effect_definitions.h"\r\rstruct effect_data *effects;\r\r/* ---------- code */\r\rshort new_effect(\r       world_point3d *origin,\r short polygon_index,\r   short type,\r    angle facing)\r{\r        short effect_index= NONE;\r\r     if (polygon_index!=NONE)\r       {\r              struct effect_data *effect;\r            struct effect_definition *definition;\r  \r               definition= get_effect_definition(type);\r               if (definition->flags&_sound_only)\r             {\r                      struct shape_animation_data *animation= get_shape_animation_data(BUILD_DESCRIPTOR(definition->collection, definition->shape));\r                 \r                       play_world_sound(polygon_index, origin, animation->first_frame_sound);\r         }\r              else\r           {\r                      for (effect_index= 0,effect= effects; effect_index<MAXIMUM_EFFECTS_PER_MAP; ++effect_index, ++effect)\r                  {\r                              if (SLOT_IS_FREE(effect))\r                              {\r                                      short object_index= new_map_object3d(origin, polygon_index, BUILD_DESCRIPTOR(definition->collection, definition->shape), facing);\r                                      \r                                       if (object_index!=NONE)\r                                        {\r                                              struct object_data *object= get_object_data(object_index);\r                                             \r                                               effect->type= type;\r                                            effect->flags= 0;\r                                              effect->object_index= object_index;\r                                            effect->data= 0;\r                                               effect->delay= definition->delay ? random()%definition->delay : 0;\r                                             MARK_SLOT_AS_USED(effect);\r                                             \r                                               SET_OBJECT_OWNER(object, _object_is_effect);\r                                           object->sound_pitch= definition->sound_pitch;\r                                          if (effect->delay) SET_OBJECT_INVISIBILITY(object, TRUE);\r                                              if (definition->flags&_media_effect) SET_OBJECT_IS_MEDIA_EFFECT(object);\r                                       }\r                                      else\r                                   {\r                                              effect_index= NONE;\r                                    }\r                                      \r                                       break;\r                         }\r                      }\r                      if (effect_index==MAXIMUM_EFFECTS_PER_MAP) effect_index= NONE;\r         }\r      }\r      \r       return effect_index;\r}\r\r/* assumes ¶t==1 tick */\rvoid update_effects(\r  void)\r{\r        struct effect_data *effect;\r    short effect_index;\r    \r       for (effect_index= 0, effect= effects; effect_index<MAXIMUM_EFFECTS_PER_MAP; ++effect_index, ++effect)\r {\r              if (SLOT_IS_USED(effect))\r              {\r                      struct object_data *object= get_object_data(effect->object_index);\r                     struct effect_definition *definition= get_effect_definition(effect->type);\r                     \r                       if (effect->delay)\r                     {\r                              /* handle invisible, delayed effects */\r                                if (!(effect->delay-= 1))\r                              {\r                                      SET_OBJECT_INVISIBILITY(object, FALSE);\r                                        play_object_sound(effect->object_index, definition->delay_sound);\r                              }\r                      }\r                      else\r                   {\r                              /* update our objectÕs animation */\r                            animate_object(effect->object_index);\r                          \r                               /* if the effectÕs animation has terminated and weÕre supposed to deactive it, do so */\r                                if (((GET_OBJECT_ANIMATION_FLAGS(object)&_obj_last_frame_animated)&&(definition->flags&_end_when_animation_loops)) ||\r                                  ((GET_OBJECT_ANIMATION_FLAGS(object)&_obj_transfer_mode_finished)&&(definition->flags&_end_when_transfer_animation_loops)))\r                            {\r                                      remove_effect(effect_index);\r                                   \r                                       /* if weÕre supposed to make another item visible, do so */\r                                    if (definition->flags&_make_twin_visible)\r                                      {\r                                              struct object_data *object= get_object_data(effect->data);\r                                             \r                                               SET_OBJECT_INVISIBILITY(object, FALSE);\r                                        }\r                              }\r                      }\r              }\r      }\r      \r       return;\r}\r\rvoid remove_effect(\r short effect_index)\r{\r  struct effect_data *effect;\r    \r       effect= get_effect_data(effect_index);\r remove_map_object(effect->object_index);\r       MARK_SLOT_AS_FREE(effect);\r     \r       return;\r}\r\rvoid remove_all_nonpersistent_effects(\r      void)\r{\r        struct effect_data *effect;\r    short effect_index;\r    \r       for (effect_index= 0, effect= effects; effect_index<MAXIMUM_EFFECTS_PER_MAP; ++effect_index, ++effect)\r {\r              if (SLOT_IS_USED(effect))\r              {\r                      struct effect_definition *definition= get_effect_definition(effect->type);\r                     \r                       if (definition->flags&(_end_when_animation_loops|_end_when_transfer_animation_loops))\r                  {\r                              remove_effect(effect_index);\r                   }\r              }\r      }\r      \r       return;\r}\r\rvoid mark_effect_collections(\r       short effect_type,\r     boolean loading)\r{\r     if (effect_type!=NONE)\r {\r              struct effect_definition *definition= get_effect_definition(effect_type);\r\r             /* mark the effect collection */\r               loading ? mark_collection_for_loading(definition->collection) : mark_collection_for_unloading(definition->collection);\r }\r      \r       return;\r}\r\rvoid teleport_object_out(\r   short object_index)\r{\r  struct object_data *object= get_object_data(object_index);\r     \r       if (!OBJECT_IS_INVISIBLE(object))\r      {\r              short effect_index= new_effect(&object->location, object->polygon, _effect_teleport_object_out, object->facing);\r               \r               if (effect_index!=NONE)\r                {\r                      struct effect_data *effect= get_effect_data(effect_index);\r                     struct object_data *effect_object= get_object_data(effect->object_index);\r                      \r                       // make the effect look like the object\r                        effect_object->shape= object->shape;\r                   effect_object->sequence= object->sequence;\r                     effect_object->transfer_mode= _xfer_fold_out;\r                  effect_object->transfer_period= TELEPORTING_MIDPOINT;\r                  effect_object->transfer_phase= 0;\r                      effect_object->flags|= object->flags&(_object_is_enlarged|_object_is_tiny);\r                    \r                       // make the object invisible\r                   SET_OBJECT_INVISIBILITY(object, TRUE);\r\r                        play_object_sound(effect->object_index, _snd_teleport_out); /* teleport in sound, at destination */\r            }\r      }\r      \r       return;\r}\r\r// if the given object isnÕt already teleporting in, do so\rvoid teleport_object_in(\r short object_index)\r{\r  struct effect_data *effect;\r    short effect_index;\r\r   for (effect_index= 0, effect= effects; effect_index<MAXIMUM_EFFECTS_PER_MAP; ++effect_index, ++effect)\r {\r              if (SLOT_IS_USED(effect))\r              {\r                      if (effect->type==_effect_teleport_object_in && effect->data==object_index)\r                    {\r                              object_index= NONE;\r                            break;\r                 }\r              }\r      }\r      \r       if (object_index!=NONE)\r        {\r              struct object_data *object= get_object_data(object_index);\r\r            effect_index= new_effect(&object->location, object->polygon, _effect_teleport_object_in, object->facing);\r              if (effect_index!=NONE)\r                {\r                      struct object_data *effect_object;\r                     \r                       effect= get_effect_data(effect_index);\r                 effect->data= object_index;\r                    \r                       effect_object= get_object_data(effect->object_index);\r                  effect_object->shape= object->shape;\r                   effect_object->transfer_mode= _xfer_fold_in;\r                   effect_object->transfer_period= TELEPORTING_MIDPOINT;\r                  effect_object->transfer_phase= 0;\r                      effect_object->flags|= object->flags&(_object_is_enlarged|_object_is_tiny);\r            }\r      }\r      \r       return;\r}\r\r#ifdef DEBUG\rstruct effect_data *get_effect_data(\r   short effect_index)\r{\r  struct effect_data *effect;\r    \r       vassert(effect_index>=0&&effect_index<MAXIMUM_EFFECTS_PER_MAP, csprintf(temporary, "effect index #%d is out of range", effect_index));\r \r       effect= effects+effect_index;\r  vassert(SLOT_IS_USED(effect), csprintf(temporary, "effect index #%d (%p) is unused", effect_index, effect));\r   \r       return effect;\r}\r#endif\r\r/* ---------- private code */\r\r#ifdef DEBUG\rstruct effect_definition *get_effect_definition(\r  short type)\r{\r  assert(type>=0&&type<NUMBER_OF_EFFECT_TYPES);\r  \r       return effect_definitions+type;\r}\r#endif\r
\ No newline at end of file
diff --git a/marathon2/effects.h b/marathon2/effects.h
new file mode 100644 (file)
index 0000000..1aafa5d
--- /dev/null
@@ -0,0 +1 @@
+/*\rEFFECTS.H\rSaturday, June 18, 1994 10:44:10 PM\r*/\r\r/* ---------- effect structure */\r\renum /* effect types */\r{\r     _effect_rocket_explosion,\r      _effect_rocket_contrail,\r       _effect_grenade_explosion,\r     _effect_grenade_contrail,\r      _effect_bullet_ricochet,\r       _effect_alien_weapon_ricochet,\r _effect_flamethrower_burst,\r    _effect_fighter_blood_splash,\r  _effect_player_blood_splash,\r   _effect_civilian_blood_splash,\r _effect_assimilated_civilian_blood_splash,\r     _effect_enforcer_blood_splash,\r _effect_compiler_bolt_minor_detonation,\r        _effect_compiler_bolt_major_detonation,\r        _effect_compiler_bolt_major_contrail,\r  _effect_fighter_projectile_detonation,\r _effect_fighter_melee_detonation,\r      _effect_hunter_projectile_detonation,\r  _effect_hunter_spark,\r  _effect_minor_fusion_detonation,\r       _effect_major_fusion_detonation,\r       _effect_major_fusion_contrail,\r _effect_fist_detonation,\r       _effect_minor_defender_detonation,\r     _effect_major_defender_detonation,\r     _effect_defender_spark,\r        _effect_trooper_blood_splash,\r  _effect_water_lamp_breaking,\r   _effect_lava_lamp_breaking,\r    _effect_sewage_lamp_breaking,\r  _effect_alien_lamp_breaking,\r   _effect_metallic_clang,\r        _effect_teleport_object_in,\r    _effect_teleport_object_out,\r   _effect_small_water_splash,\r    _effect_medium_water_splash,\r   _effect_large_water_splash,\r    _effect_large_water_emergence,\r _effect_small_lava_splash,\r     _effect_medium_lava_splash,\r    _effect_large_lava_splash,\r     _effect_large_lava_emergence,\r  _effect_small_sewage_splash,\r   _effect_medium_sewage_splash,\r  _effect_large_sewage_splash,\r   _effect_large_sewage_emergence,\r        _effect_small_goo_splash,\r      _effect_medium_goo_splash,\r     _effect_large_goo_splash,\r      _effect_large_goo_emergence,\r   _effect_minor_hummer_projectile_detonation,\r    _effect_major_hummer_projectile_detonation,\r    _effect_durandal_hummer_projectile_detonation,\r _effect_hummer_spark,\r  _effect_cyborg_projectile_detonation,\r  _effect_cyborg_blood_splash,\r   _effect_minor_fusion_dispersal,\r        _effect_major_fusion_dispersal,\r        _effect_overloaded_fusion_dispersal,\r   _effect_sewage_yeti_blood_splash,\r      _effect_sewage_yeti_projectile_detonation,\r     _effect_water_yeti_blood_splash,\r       _effect_lava_yeti_blood_splash,\r        _effect_lava_yeti_projectile_detonation,\r       _effect_yeti_melee_detonation,\r _effect_juggernaut_spark,\r      _effect_juggernaut_missile_contrail,\r   NUMBER_OF_EFFECT_TYPES\r};\r\r#define MAXIMUM_EFFECTS_PER_MAP 64\r\r/* uses SLOT_IS_USED(), SLOT_IS_FREE(), MARK_SLOT_AS_FREE(), MARK_SLOT_AS_USED() macros (0x8000 bit) */\r\rstruct effect_data /* 16 bytes */\r{\r    short type;\r    short object_index;\r    \r       word flags; /* [slot_used.1] [unused.15] */\r\r   short data; /* used for special effects (effects) */\r   short delay; /* the effect is invisible and inactive for this many ticks */\r    \r       short unused[11];\r};\r\r/* ---------- globals */\r\rextern struct effect_data *effects;\r\r/* ---------- prototypes/EFFECTS.C */\r\rshort new_effect(world_point3d *origin, short polygon_index, short type, angle facing);\rvoid update_effects(void); /* assumes ¶t==1 tick */\r\rvoid remove_all_nonpersistent_effects(void);\rvoid remove_effect(short effect_index);\r\rvoid mark_effect_collections(short type, boolean loading);\r\rvoid teleport_object_in(short object_index);\rvoid teleport_object_out(short object_index);\r\r#ifdef DEBUG\rstruct effect_data *get_effect_data(short effect_index);\r#else\r#define get_effect_data(i) (effects+(i))\r#endif\r
\ No newline at end of file
diff --git a/marathon2/export_definitions b/marathon2/export_definitions
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/marathon2/export_definitions.c b/marathon2/export_definitions.c
new file mode 100644 (file)
index 0000000..cc95544
--- /dev/null
@@ -0,0 +1 @@
+/*\rEXPORT_DEFINITIONS.C\rSunday, October 2, 1994 12:35:58 PM  (Jason')\rTuesday, October 31, 1995 11:02:24 AM (Ryan)\r*/\r\r#include "macintosh_cseries.h"\r\r#include "map.h"\r#include "effects.h"\r#include "projectiles.h"\r#include "monsters.h"\r#include "weapons.h"\r#include "wad.h"\r#include "items.h"\r#include "sound.h"\r#include "media.h"\r#include "tags.h"\r\r/* ---------- globals */\r\r#define EXPORT_STRUCTURE 1\r\r#include "weapon_definitions.h"\r#include "monster_definitions.h"\r#include "projectile_definitions.h"\r#include "effect_definitions.h"\r#include "physics_models.h"\r\r#include "extensions.h"\r\r/* ---------- private code */\rstatic boolean create_physics_file(FileDesc *file);\r\r/* ---------- code */\r\rvoid main(\r   int argc,\r      char **argv)\r{\r if (argc<=1)\r   {\r              fprintf(stderr, "Usage: %s <destination>\n", argv[0]);\r         exit(1);\r       }\r      else\r   {\r              FSSpec physics_spec;\r           OSErr error;\r\r          initialize_debugger(TRUE);\r\r            /* Get the Marathon FSSpec */\r          error= get_my_fsspec(&physics_spec);\r           strcpy(temporary, argv[1]);\r            c2pstr(temporary);\r             error= FSMakeFSSpec(0, 0, temporary, &physics_spec);\r           if(!error || error==fnfErr)\r            {\r                      if(!create_physics_file((FileDesc *) &physics_spec))\r                   {\r                              fprintf(stderr, "Unable to create the physics file!\n");\r                       }\r              } \r             else\r           {\r                      fprintf(stderr, "%s: Error opening '%s' (Err: %d)", argv[0], argv[1], error);\r                  exit(1);\r               }\r      }\r      \r       exit(0);\r}\r\r/* ---------- private code */\rstatic boolean create_physics_file(\r  FileDesc *file)\r{\r      boolean success= FALSE;\r        FileError error= 0;\r\r   error= create_wadfile(file, PHYSICS_FILE_TYPE);\r        if(!error)\r     {\r              fileref file_ref;\r              \r               file_ref= open_wad_file_for_writing(file);\r             if(file_ref != NONE)\r           {\r                      struct wad_header header;\r                      struct directory_entry entries[MAXIMUM_DIRECTORY_ENTRIES_PER_FILE];\r\r                   /* Create the header.. */               \r                       fill_default_wad_header(file, CURRENT_WADFILE_VERSION,\r                         BUNGIE_PHYSICS_DATA_VERSION, 1, 0, &header);\r                   \r                       if(write_wad_header(file_ref, &header))\r                        {\r                              struct wad_data *wad= create_empty_wad();\r\r                             if(wad)\r                                {\r                                      short index;\r                                   \r                                       for (index= 0; index<NUMBER_OF_DEFINITIONS; ++index)\r                                   {\r                                              struct definition_data *definition= definitions+index;\r                                         \r                                               wad= append_data_to_wad(wad, definition->tag, definition->data,\r                                                        definition->size*definition->count, 0l);\r                                       }\r                              \r                                       if(write_wad(file_ref, &header, wad, sizeof(struct wad_header)))\r                                       {\r                                              /* Update the header.. */\r                                              entries[0].offset_to_start= sizeof(struct wad_header);\r                                         entries[0].index= 0;\r                                           entries[0].length= calculate_wad_length(&header, wad);\r\r                                                /* Write the directory.. */\r                                            header.directory_offset= sizeof(struct wad_header)+entries[0].length;\r                                          header.wad_count= 1;\r                                           write_wad_header(file_ref, &header);\r\r                                          write_directorys(file_ref, &header, entries);\r                                  \r                                               /* We win.. */\r                                         success= TRUE;\r                                 }\r                              } else {\r                                       error= memory_error();\r                         }\r                      }\r\r                     /* Save the crc.. */\r                   calculate_and_store_wadfile_checksum(file_ref);\r\r                       close_wad_file(file_ref);\r\r                     fprintf(stderr, "Physics File: %P Checksum: 0x%x\n", file->name, \r                              read_wad_file_checksum(file));\r         }\r      }\r      \r       return success;\r}\r
\ No newline at end of file
diff --git a/marathon2/export_definitions.make b/marathon2/export_definitions.make
new file mode 100644 (file)
index 0000000..b751525
--- /dev/null
@@ -0,0 +1 @@
+#   File:       patchtest.make\r#   Target:     patchtest\r#   Sources:    patch.c\r#               test.c\r#   Created:    Tuesday, October 25, 1994 10:34:03 PM\r\r\rCOptions= -i {CSeriesInterfaces} -opt full -b2 -r -mbg on -d DEBUG -d PREPROCESSING_CODE -d TERMINAL_EDITOR -mc68020 -k {CSeriesLibraries}\r\rOBJECTS = ¶\r               export_definitions.c.o\r         \rexport_definitions ÄÄ export_definitions.make  {OBJECTS}\r      Link ¶\r         -t 'MPST' ¶\r            -c 'MPS ' ¶\r            {OBJECTS} ¶\r            "{CLibraries}"StdClib.o ¶\r              "{Libraries}"Runtime.o ¶\r               "{Libraries}"Interface.o ¶\r             ":Objects:Game:68k:Beta:wad.lib" ¶\r             {CSeriesLibraries}cseries.debug.lib ¶\r          -o export_definitions\r  delete export_definitions.c.o\r          \rexport_definitions.c.o Ä export_definitions.make extensions.h ¶\r       weapon_definitions.h projectile_definitions.h monster_definitions.h ¶\r  effect_definitions.h physics_models.h ":Objects:Game:68k:Beta:wad.lib"
\ No newline at end of file
diff --git a/marathon2/extensions.h b/marathon2/extensions.h
new file mode 100644 (file)
index 0000000..413a543
--- /dev/null
@@ -0,0 +1 @@
+/*\r\r   extensions.h\r   Tuesday, October 31, 1995 11:42:19 AM- rdm created.\r\r*/\r\r#define BUNGIE_PHYSICS_DATA_VERSION 0\r#define PHYSICS_DATA_VERSION 1\r\r#ifdef EXPORT_STRUCTURE\rstruct definition_data\r{\r        long tag;\r      void *data;\r    short count;\r   short size;\r};\r\rstatic struct definition_data definitions[]=\r{\r {MONSTER_PHYSICS_TAG, monster_definitions, NUMBER_OF_MONSTER_TYPES, sizeof(struct monster_definition)},\r        {EFFECTS_PHYSICS_TAG, effect_definitions, NUMBER_OF_EFFECT_TYPES, sizeof(struct effect_definition)},\r   {PROJECTILE_PHYSICS_TAG, projectile_definitions, NUMBER_OF_PROJECTILE_TYPES, sizeof(struct projectile_definition)},\r    {PHYSICS_PHYSICS_TAG, physics_models, NUMBER_OF_PHYSICS_MODELS, sizeof(struct physics_constants)},\r     {WEAPONS_PHYSICS_TAG, weapon_definitions, NUMBER_OF_WEAPONS, sizeof(struct weapon_definition)}\r};\r#define NUMBER_OF_DEFINITIONS (sizeof(definitions)/sizeof(definitions[0]))\r#else\r#ifdef IMPORT_STRUCTURE\rstruct definition_data \r{\r   long tag;\r      void *data;\r};\r\rstatic struct definition_data definitions[]=\r{\r {MONSTER_PHYSICS_TAG, monster_definitions},\r    {EFFECTS_PHYSICS_TAG, effect_definitions},\r     {PROJECTILE_PHYSICS_TAG, projectile_definitions},\r      {PHYSICS_PHYSICS_TAG, physics_models},\r {WEAPONS_PHYSICS_TAG, weapon_definitions},\r};\r#define NUMBER_OF_DEFINITIONS (sizeof(definitions)/sizeof(definitions[0]))\r#endif\r#endif\r\r/* ------------- prototypes */\r\r/* Set the physics file to read from.. */\rvoid set_physics_file(FileDesc *file);\r\rvoid set_to_default_physics_file(void);\r\r/* Proceses the entire physics file.. */\rvoid import_definition_structures(void);\r\rvoid *get_network_physics_buffer(long *physics_length);\rvoid process_network_physics_model(void *data);
\ No newline at end of file
diff --git a/marathon2/extract/.AppleDouble/.Parent b/marathon2/extract/.AppleDouble/.Parent
new file mode 100644 (file)
index 0000000..914c534
Binary files /dev/null and b/marathon2/extract/.AppleDouble/.Parent differ
diff --git a/marathon2/extract/.AppleDouble/shapeextract b/marathon2/extract/.AppleDouble/shapeextract
new file mode 100644 (file)
index 0000000..61ab993
Binary files /dev/null and b/marathon2/extract/.AppleDouble/shapeextract differ
diff --git a/marathon2/extract/.AppleDouble/shapeextract.c b/marathon2/extract/.AppleDouble/shapeextract.c
new file mode 100644 (file)
index 0000000..356fe0f
Binary files /dev/null and b/marathon2/extract/.AppleDouble/shapeextract.c differ
diff --git a/marathon2/extract/.AppleDouble/shapeextract.make b/marathon2/extract/.AppleDouble/shapeextract.make
new file mode 100644 (file)
index 0000000..289688f
Binary files /dev/null and b/marathon2/extract/.AppleDouble/shapeextract.make differ
diff --git a/marathon2/extract/.AppleDouble/sndextract b/marathon2/extract/.AppleDouble/sndextract
new file mode 100644 (file)
index 0000000..05b7065
Binary files /dev/null and b/marathon2/extract/.AppleDouble/sndextract differ
diff --git a/marathon2/extract/.AppleDouble/sndextract.c b/marathon2/extract/.AppleDouble/sndextract.c
new file mode 100644 (file)
index 0000000..90ee040
Binary files /dev/null and b/marathon2/extract/.AppleDouble/sndextract.c differ
diff --git a/marathon2/extract/.AppleDouble/sndextract.make b/marathon2/extract/.AppleDouble/sndextract.make
new file mode 100644 (file)
index 0000000..f9eee01
Binary files /dev/null and b/marathon2/extract/.AppleDouble/sndextract.make differ
diff --git a/marathon2/extract/shapeextract b/marathon2/extract/shapeextract
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/marathon2/extract/shapeextract.c b/marathon2/extract/shapeextract.c
new file mode 100644 (file)
index 0000000..9f2baee
--- /dev/null
@@ -0,0 +1 @@
+/*\rSHAPEEXTRACT.C\rTuesday, August 29, 1995 9:54:17 AM  (Jason)\r*/\r\r#include "macintosh_cseries.h"\r\r#include <string.h>\r\r#include "::shape_descriptors.h"\r#include "::shape_definitions.h"\r\r/* ---------- macros */\r\r/* ---------- private code */\r\rstatic void extract_shape_resources(FILE *stream);\rstatic void add_resource(short id, long *offset, long *length, FILE *stream);\r\r/* ---------- code */\r\rvoid main(\r        int argc,\r      char **argv)\r{\r Str255 filename;\r       short reference_number;\r\r       if (argc<=2)\r   {\r              fprintf(stderr, "Usage: %s <source> <destination>\n", argv[0]);\r                exit(1);\r       }\r      else\r   {\r              strcpy(filename, argv[1]);\r             c2pstr(filename);\r              reference_number= OpenResFile(filename);\r               if (reference_number!=NONE)\r            {\r                      FILE *stream= fopen(argv[2], "wb");\r                    \r                       if (stream)\r                    {\r                              extract_shape_resources(stream);\r                               fclose(stream);\r                        }\r                      else\r                   {\r                              fprintf(stderr, "Error #%d opening %s.\n", -1, argv[2]);\r                               exit(1);\r                       }\r                      \r                       CloseResFile(reference_number);\r                }\r              else\r           {\r                      fprintf(stderr, "Error #%d opening %s.\n", ResError(), argv[1]);\r                       exit(1);\r               }\r      }\r      \r       exit(0);\r}\r\r/* ---------- private code */\r\rstatic void extract_shape_resources(\r        FILE *stream)\r{\r        short i;\r\r      fwrite(collection_headers, sizeof(struct collection_header), MAXIMUM_COLLECTIONS, stream);\r     \r       for (i= 0; i<MAXIMUM_COLLECTIONS; ++i)\r {\r              struct collection_header *header= collection_headers + i;\r\r             add_resource(128+i, &header->offset, &header->length, stream);\r         add_resource(1128+i, &header->offset16, &header->length16, stream);\r    }\r\r     fseek(stream, 0, SEEK_SET);\r    fwrite(collection_headers, sizeof(struct collection_header), MAXIMUM_COLLECTIONS, stream);\r     \r       return;\r}\r\rstatic void add_resource(\r   short id,\r      long *offset,\r  long *length,\r  FILE *stream)\r{\r        Handle collection= GetResource('.256', id);\r    \r       if (collection)\r        {\r              HLock(collection);\r             *offset= ftell(stream), *length= GetHandleSize(collection);\r            fwrite(*collection, *length, 1, stream);\r\r              ReleaseResource(collection);\r   }\r      else\r   {\r              *offset= -1, *length= 0;\r       }\r\r     return;\r}\r
\ No newline at end of file
diff --git a/marathon2/extract/shapeextract.make b/marathon2/extract/shapeextract.make
new file mode 100644 (file)
index 0000000..83020c0
--- /dev/null
@@ -0,0 +1 @@
+# {TOOLNAME}.MAKE\r# Saturday, July 3, 1993 8:18:48 AM\r# Friday, August 25, 1995 4:15:45 PM  (Jason)\r\rToolName= shapeextract\r\rCOptions= -i "{CSeriesInterfaces}" -d DEBUG -opt full -b2 -r -mc68020 -k "{CSeriesLibraries}"\r\r{ToolName}.c.o Ä {ToolName}.make\r\rOBJECTS= {ToolName}.c.o {CSeriesLibraries}"cseries.debug.lib"\r{ToolName} Ä {OBJECTS}\r    Link -w -c 'MPS ' -t MPST {OBJECTS} -sn STDIO=Main -sn INTENV=Main -sn %A5Init=Main ¶\r          "{Libraries}"Stubs.o "{Libraries}"Runtime.o "{Libraries}"Interface.o "{CLibraries}"StdCLib.o ¶\r         "{CLibraries}"CSANELib.o "{CLibraries}"Math.o "{Libraries}"ToolLibs.o ¶\r                -o {ToolName}\r
\ No newline at end of file
diff --git a/marathon2/extract/sndextract b/marathon2/extract/sndextract
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/marathon2/extract/sndextract.c b/marathon2/extract/sndextract.c
new file mode 100644 (file)
index 0000000..ca34792
--- /dev/null
@@ -0,0 +1 @@
+/*\rNORESNAMES.C\rSaturday, July 3, 1993 8:19:20 AM\r*/\r\r#include "macintosh_cseries.h"\r#include "byte_swapping.h"\r\r#include <string.h>\r\r#include "::world.h"\r#include "::sound.h"\r\r#define STATIC_DEFINITIONS\r#include "::sound_definitions.h"\r\r/* ---------- macros */\r\r#define ALIGN_LONG(x) ((((x)-1)&0xfffffffc)+4)\r                                 \r/* ---------- private code */\r\rstatic void build_sounds_file(char *destination_filename, short source_count, char **source_filenames);\rstatic void extract_sound_resources(FILE *stream, long *definition_offset, short base_resource,\r        struct sound_definition *original_definitions, struct sound_definition *working_definitions);\r\r/* ---------- code */\r\rvoid main(\r       int argc,\r      char **argv)\r{\r if (argc<=2)\r   {\r              fprintf(stderr, "Usage: %s <source> <destination>\n", argv[0]);\r                exit(1);\r       }\r      else\r   {\r              build_sounds_file(argv[1], argc-2, argv+2);\r    }\r      \r       exit(0);\r}\r\r/* ---------- private code */\r\rvoid build_sounds_file(\r     char *destination_filename,\r    short source_count,\r    char **source_filenames)\r{\r     FILE *stream= fopen(destination_filename, "wb");\r       \r       if (stream)\r    {\r              struct sound_definition *original_definitions, *working_definitions;\r           long definition_offset= sizeof(struct sound_file_header);\r              short source;\r          \r               original_definitions= malloc(NUMBER_OF_SOUND_DEFINITIONS*sizeof(struct sound_definition));\r             working_definitions= malloc(NUMBER_OF_SOUND_DEFINITIONS*sizeof(struct sound_definition));\r              assert(original_definitions && working_definitions);\r           \r               // write the file header and enough room for each of the sound_definition arrays\r               {\r                      struct sound_file_header header;\r                       short source_index;\r                    \r                       memset(&header, 0, sizeof(struct sound_file_header));\r                  header.version= SOUND_FILE_VERSION;\r                    header.tag= SOUND_FILE_TAG;\r                    header.source_count= source_count;\r                     header.sound_count= NUMBER_OF_SOUND_DEFINITIONS;\r                       \r                       fwrite(&header, sizeof(struct sound_file_header), 1, stream);\r                  \r