From a05e54f00cb523e2849468924464703575c3c10d Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Tue, 4 May 2021 11:45:03 +0300 Subject: [PATCH] JANITORIAL: Remove trailing whitespaces --- .clang-format | 2 +- .github/pull_request_template.md | 2 +- README.md | 8 +- audio/audiostream.h | 8 +- audio/mididrv.cpp | 2 +- audio/mididrv.h | 4 +- audio/mixer.h | 4 +- audio/mt32gm.cpp | 8 +- audio/mt32gm.h | 46 +- backends/cloud/basestorage.cpp | 4 +- backends/cloud/basestorage.h | 2 +- backends/dialogs/amigaos/amigaos-dialogs.cpp | 2 +- backends/dialogs/amigaos/amigaos-dialogs.h | 2 +- backends/dialogs/morphos/morphos-dialogs.cpp | 4 +- backends/dialogs/morphos/morphos-dialogs.h | 2 +- backends/dialogs/win32/mingw-compat.h | 2 +- backends/events/psp2sdl/psp2sdl-events.cpp | 2 +- .../events/switchsdl/switchsdl-events.cpp | 2 +- backends/fs/morphos/morphos-fs.cpp | 24 +- backends/graphics/windowed.h | 2 +- backends/keymapper/input-watcher.h | 2 +- backends/networking/curl/sessionrequest.cpp | 2 +- backends/networking/curl/sessionrequest.h | 2 +- backends/platform/3ds/README.md | 4 +- backends/platform/3ds/shader.v.pica | 2 +- backends/platform/androidsdl/androidsdl.mk | 2 +- backends/platform/dingux/module.mk | 2 +- backends/platform/gph/build/gp2x-config.sh | 2 +- backends/platform/ios7/ios7_app_delegate.mm | 2 +- backends/platform/ios7/ios7_video.mm | 2 +- backends/platform/null/null.cpp | 2 +- backends/platform/psp/README.PSP | 6 +- backends/platform/psp/README.PSP.in | 6 +- backends/platform/psp/display_manager.cpp | 2 +- backends/platform/psp/osys_psp.cpp | 2 +- backends/platform/sdl/amigaos/amigaos.mk | 2 +- backends/platform/sdl/morphos/morphos.cpp | 6 +- backends/platform/sdl/morphos/morphos.mk | 2 +- backends/platform/sdl/psp2/psp2-main.cpp | 2 +- backends/platform/sdl/switch/switch.cpp | 2 +- backends/platform/sdl/win32/win32.h | 2 +- backends/platform/symbian/AdaptAllMMPs.pl | 2 +- backends/platform/symbian/README | 6 +- backends/platform/symbian/help/ScummVM.xml | 2 +- backends/platform/symbian/help/build_help.mk | 2 +- backends/platform/symbian/src/portdefs.h | 4 +- .../symbian/symbian_builder/common_names.py | 2 +- .../symbian/symbian_builder/mmp_gen.py | 8 +- .../symbian/symbian_builder/prj_generator.py | 4 +- backends/plugins/psp/plugin.ld | 2 +- backends/plugins/wii/plugin.ld | 4 +- .../windows/windows-text-to-speech.cpp | 2 +- common/algorithm.h | 28 +- common/archive.h | 2 +- common/base-str.cpp | 4 +- common/cosinetables.cpp | 2 +- common/dcl.h | 6 +- common/debug.h | 2 +- common/endian.h | 4 +- common/hashmap.h | 2 +- common/huffman.h | 4 +- common/iff_container.h | 2 +- common/ini-file.h | 2 +- common/installshield_cab.h | 2 +- common/keyboard.h | 2 +- common/language.h | 2 +- common/localization.h | 2 +- common/ptr.h | 2 +- common/rect.h | 10 +- common/savefile.h | 10 +- common/sinetables.cpp | 4 +- common/sinetables.h | 2 +- common/str-enc.cpp | 4 +- common/stream.h | 14 +- common/ustr.h | 4 +- common/util.h | 2 +- common/xmlparser.h | 2 +- common/zlib.h | 2 +- devtools/README | 4 +- .../create_bladerunner/subtitles/README.md | 28 +- .../common/subtlsVersTextResource.py | 7 +- .../subtitles/common/vqasTextResource.py | 5 +- .../subtitles/fontCreator/fonFileLib.py | 70 +- .../fontCreator/grabberFromPNG17BR.py | 50 +- .../packBladeRunnerMIXFromPCTLKXLS04.py | 4 +- .../create_bladerunner/subtitles/module.mk | 4 +- .../quotesSpreadsheetCreator/audFileDecode.py | 16 +- .../quotesSpreadsheetCreator/audFileLib.py | 66 +- .../devCommentaryText.py | 10 +- .../pogoTextResource.py | 7 +- .../quoteSpreadsheetCreator.py | 4 +- .../sortBladeRunnerWavs02.py | 88 +- .../quotesSpreadsheetCreator/treFileLib.py | 20 +- devtools/create_encoding/create_encoding.py | 2 +- devtools/create_glk/create_glk.cpp | 2 +- devtools/create_hugo/README | 4 +- devtools/create_project/msvc.cpp | 2 +- devtools/create_project/msvc.h | 4 +- devtools/create_project/scripts/installer.vbs | 2 +- devtools/create_project/scripts/revision.vbs | 6 +- devtools/create_supernova/create_image/README | 2 +- .../create_image/create_image.cpp | 2 +- .../create_supernova/create_supernova.cpp | 4 +- devtools/create_supernova/gametext.h | 28 +- devtools/create_supernova/msn.doc-it | 16 +- devtools/create_supernova/msn.inf-it | 4 +- devtools/create_titanic/tag_maps.cpp | 2 +- devtools/create_ultima/file.h | 2 +- .../files/ultima4/conf/armors.xml | 14 +- .../files/ultima4/conf/config.xml | 2 +- .../files/ultima4/conf/creatures.xml | 2 +- .../files/ultima4/conf/dtd/creatures.dtd | 4 +- .../files/ultima4/conf/dtd/maps.dtd | 2 +- .../files/ultima4/conf/dtd/tileRules.dtd | 2 +- .../files/ultima4/conf/dtd/tileset.dtd | 4 +- .../files/ultima4/conf/egaPalette.xml | 6 +- .../files/ultima4/conf/graphics.xml | 104 +- .../create_ultima/files/ultima4/conf/maps.xml | 42 +- .../files/ultima4/conf/tileRules.xml | 2 +- .../files/ultima4/conf/tilemap-base.xml | 8 +- .../files/ultima4/conf/tilemap-dungeon.xml | 2 +- .../files/ultima4/conf/tileset-base.xml | 12 +- .../files/ultima4/conf/tileset-dungeon.xml | 2 +- .../files/ultima4/conf/vendorScript.xml | 250 ++-- .../files/ultima4/mid/minstrel/Readme.txt | 4 +- .../files/ultima8/Vera_copyright.txt | 8 +- devtools/create_xeen/constants.cpp | 2 +- devtools/create_xeen/create_xeen.cpp | 2 +- devtools/make-www-archive.py | 4 +- devtools/sci/scifx/scifx_to_cpp.py | 2 +- devtools/tasmrecover/dreamweb/backdrop.asm | 24 +- devtools/tasmrecover/dreamweb/debug.asm | 16 +- devtools/tasmrecover/dreamweb/dreamweb.asm | 272 ++-- devtools/tasmrecover/dreamweb/keypad.asm | 20 +- devtools/tasmrecover/dreamweb/monitor.asm | 4 +- devtools/tasmrecover/dreamweb/newplace.asm | 14 +- devtools/tasmrecover/dreamweb/object.asm | 58 +- devtools/tasmrecover/dreamweb/print.asm | 6 +- devtools/tasmrecover/dreamweb/saveload.asm | 32 +- devtools/tasmrecover/dreamweb/sblaster.asm | 112 +- devtools/tasmrecover/dreamweb/sprite.asm | 126 +- devtools/tasmrecover/dreamweb/talk.asm | 18 +- devtools/tasmrecover/dreamweb/titles.asm | 32 +- devtools/tasmrecover/dreamweb/use.asm | 36 +- devtools/tasmrecover/dreamweb/vars.asm | 4 +- devtools/tasmrecover/dreamweb/vgafades.asm | 18 +- devtools/tasmrecover/dreamweb/vgagrafx.asm | 32 +- devtools/tasmrecover/tasm/lex.py | 6 +- devtools/tasmrecover/tasm/parser.py | 30 +- devtools/tasmrecover/tasm/proc.py | 14 +- devtools/update-version.pl | 2 +- .../res/drawable/ic_scummvm_background.xml | 2 +- .../res/layout/keyboard_key_preview.xml | 20 +- dists/androidsdl/How_to_Build.txt | 6 +- dists/androidsdl/build.sh | 2 +- .../androidsdl/scummvm/AndroidAppSettings.cfg | 6 +- .../scummvm/AndroidAppSettings.cfg.in | 6 +- dists/debian/changelog | 18 +- dists/gph/README-GPH | 2 +- dists/gph/README-GPH.in | 2 +- dists/gph/gp2x/mmuhack/README | 2 +- dists/gph/gp2x/scummvm.gpe | 2 +- dists/gph/gp2xwiz/scummvm.gpe | 2 +- dists/openpandora/PXML_schema.xsd | 52 +- dists/openpandora/README-OPENPANDORA | 2 +- dists/openpandora/README-OPENPANDORA.in | 2 +- dists/openpandora/pnd_make.sh | 2 +- dists/psp2/template.xml | 2 +- dists/snap/README.md | 2 +- dists/snap/snap/snapcraft.yaml | 4 +- dists/wii/READMII | 2 +- dists/win32/ScummVM.iss | 8 +- doc/de/NEUES.md | 2 +- doc/docportal/_static/custom.css | 4 +- doc/docportal/_static/version.js | 4 +- .../advanced_topics/configuration_file.rst | 8 +- .../advanced_topics/understand_graphics.rst | 26 +- doc/docportal/help/release.rst | 2 +- doc/docportal/index.rst | 2 +- doc/docportal/other_platforms/android.rst | 2 +- .../other_platforms/playstation_portable.rst | 4 +- doc/docportal/settings/graphics.rst | 6 +- doc/docportal/settings/misc.rst | 4 +- doc/docportal/use_scummvm/game_files.rst | 2 +- .../use_scummvm/taskbar_integration.rst | 12 +- doc/doxygen/buildfiles/doxygen_layout.xml | 4 +- engines/adl/disk.cpp | 2 +- engines/adl/disk.h | 2 +- engines/adl/display_a2.cpp | 2 +- engines/agi/loader_v2.cpp | 2 +- engines/agi/text.cpp | 4 +- engines/ags/console.cpp | 2 +- engines/ags/detection.cpp | 2 +- engines/ags/detection.h | 2 +- engines/ags/engine/main/config.cpp | 4 +- engines/ags/engine/resource/tintshader.fx | 6 +- .../ags/engine/resource/tintshaderLegacy.fx | 8 +- engines/ags/engine/resource/version.rc | 6 +- engines/ags/plugins/ags_tcp_ip/ags_tcp_ip.h | 2 +- engines/bladerunner/game_constants.h | 4 +- engines/bladerunner/script/ai/bullet_bob.cpp | 4 +- engines/bladerunner/script/ai/hanoi.cpp | 2 +- engines/bladerunner/script/ai/isabella.cpp | 2 +- engines/bladerunner/script/ai/izo.cpp | 4 +- engines/bladerunner/script/ai/mutant2.cpp | 4 +- engines/bladerunner/script/ai/mutant3.cpp | 2 +- engines/bladerunner/script/scene/hf05.cpp | 6 +- engines/bladerunner/script/scene/ug12.cpp | 2 +- engines/buried/avi_frames.cpp | 2 +- engines/buried/biochip_view.cpp | 12 +- engines/buried/demo/demo_menu.cpp | 2 +- engines/buried/environ/agent3_lair.cpp | 4 +- engines/buried/environ/da_vinci.cpp | 2 +- engines/buried/environ/future_apartment.cpp | 2 +- engines/buried/environ/scene_common.h | 4 +- engines/buried/inventory_info.cpp | 4 +- engines/buried/main_menu.cpp | 4 +- engines/buried/resources.h | 2 +- engines/cine/anim.cpp | 2 +- engines/cine/cine.h | 2 +- engines/cine/gfx.h | 4 +- engines/cine/metaengine.cpp | 2 +- engines/cine/pal.h | 2 +- engines/cine/script_fw.cpp | 2 +- engines/cine/sound.cpp | 2 +- engines/composer/graphics.cpp | 6 +- engines/composer/saveload.cpp | 8 +- engines/cryo/eden.cpp | 2 +- engines/cryo/eden.h | 8 +- engines/cryo/eden_graphics.cpp | 12 +- engines/cryo/eden_graphics.h | 12 +- engines/director/detection.cpp | 2 +- engines/director/lingo/lingo-builtins.cpp | 2 +- engines/director/lingo/lingo-events.cpp | 4 +- engines/director/lingo/lingo-lex.cpp | 84 +- engines/director/lingo/lingo.cpp | 4 +- engines/director/lingo/tests/d3.menus.txt | 4 +- engines/dm/dm.cpp | 2 +- engines/glk/agt/agil.cpp | 2 +- engines/glk/agt/agility.h | 6 +- engines/glk/agt/interp.h | 4 +- engines/glk/agt/metacommand.cpp | 2 +- engines/glk/alan2/parse.h | 2 +- engines/glk/alan3/act.cpp | 2 +- engines/glk/alan3/parse.cpp | 6 +- engines/glk/archetype/archetype.cpp | 10 +- engines/glk/archetype/linked_list.cpp | 2 +- engines/glk/archetype/parser.cpp | 2 +- engines/glk/archetype/semantic.h | 2 +- engines/glk/archetype/string.h | 2 +- engines/glk/archetype/timestamp.h | 6 +- engines/glk/blorb.cpp | 4 +- engines/glk/comprehend/game.cpp | 2 +- engines/glk/comprehend/game_data.h | 2 +- engines/glk/conf.cpp | 2 +- engines/glk/glk_dispa.cpp | 2 +- engines/glk/hugo/heexpr.cpp | 10 +- engines/glk/hugo/hemisc.cpp | 40 +- engines/glk/hugo/heobject.cpp | 4 +- engines/glk/hugo/heparse.cpp | 54 +- engines/glk/hugo/heres.cpp | 2 +- engines/glk/hugo/herun.cpp | 42 +- engines/glk/hugo/heset.cpp | 2 +- engines/glk/hugo/htokens.h | 8 +- engines/glk/hugo/hugo.cpp | 14 +- engines/glk/jacl/csv.h | 2 +- engines/glk/magnetic/detection_tables.h | 2 +- engines/glk/magnetic/glk.cpp | 2 +- engines/glk/picture.cpp | 2 +- engines/glk/quest/geas_glk.cpp | 2 +- engines/glk/quest/geas_state.cpp | 4 +- engines/glk/quest/quest.cpp | 2 +- engines/glk/quetzal.cpp | 2 +- engines/glk/quetzal.h | 2 +- engines/glk/sound.cpp | 2 +- engines/glk/streams.h | 2 +- engines/glk/tads/os_banners.cpp | 2 +- engines/glk/tads/os_banners.h | 202 +-- engines/glk/tads/os_filetype.h | 4 +- engines/glk/tads/os_frob_tads.cpp | 2 +- engines/glk/tads/os_frob_tads.h | 88 +- engines/glk/tads/os_glk.cpp | 136 +- engines/glk/tads/os_glk.h | 868 ++++++------ engines/glk/tads/tads2/appctx.h | 48 +- engines/glk/tads/tads2/built_in.cpp | 558 ++++---- engines/glk/tads/tads2/built_in.h | 2 +- engines/glk/tads/tads2/character_map.cpp | 52 +- engines/glk/tads/tads2/character_map.h | 24 +- engines/glk/tads/tads2/command_line.cpp | 16 +- engines/glk/tads/tads2/command_line.h | 4 +- engines/glk/tads/tads2/data.cpp | 2 +- engines/glk/tads/tads2/debug.cpp | 60 +- engines/glk/tads/tads2/debug.h | 88 +- engines/glk/tads/tads2/error.cpp | 18 +- engines/glk/tads/tads2/error.h | 16 +- engines/glk/tads/tads2/error_handling.cpp | 16 +- engines/glk/tads/tads2/error_handling.h | 34 +- engines/glk/tads/tads2/error_message.cpp | 2 +- engines/glk/tads/tads2/execute_command.cpp | 572 ++++---- engines/glk/tads/tads2/file_io.cpp | 254 ++-- engines/glk/tads/tads2/file_io.h | 8 +- engines/glk/tads/tads2/get_string.cpp | 28 +- engines/glk/tads/tads2/lib.h | 6 +- engines/glk/tads/tads2/line_source.h | 2 +- engines/glk/tads/tads2/line_source_file.cpp | 182 +-- engines/glk/tads/tads2/line_source_file.h | 14 +- engines/glk/tads/tads2/ltk.cpp | 2 +- engines/glk/tads/tads2/ltk.h | 20 +- engines/glk/tads/tads2/memory_cache.cpp | 214 +-- engines/glk/tads/tads2/memory_cache.h | 22 +- engines/glk/tads/tads2/memory_cache_swap.h | 4 +- engines/glk/tads/tads2/object.cpp | 186 +-- engines/glk/tads/tads2/object.h | 34 +- engines/glk/tads/tads2/opcode.h | 8 +- engines/glk/tads/tads2/os.h | 92 +- engines/glk/tads/tads2/output.cpp | 608 ++++---- engines/glk/tads/tads2/play.cpp | 46 +- engines/glk/tads/tads2/property.h | 6 +- engines/glk/tads/tads2/qa_scriptor.cpp | 10 +- engines/glk/tads/tads2/regex.cpp | 324 ++--- engines/glk/tads/tads2/regex.h | 26 +- engines/glk/tads/tads2/run.h | 8 +- engines/glk/tads/tads2/runtime_app.h | 10 +- engines/glk/tads/tads2/runtime_driver.cpp | 126 +- engines/glk/tads/tads2/string_resources.h | 10 +- engines/glk/tads/tads2/text_io.h | 22 +- engines/glk/tads/tads2/tokenizer.cpp | 188 +-- engines/glk/tads/tads2/tokenizer.h | 14 +- engines/glk/tads/tads2/tokenizer_hash.cpp | 50 +- engines/glk/tads/tads2/vocabulary.cpp | 94 +- engines/glk/tads/tads2/vocabulary.h | 56 +- engines/glk/tads/tads2/vocabulary_parser.cpp | 1218 ++++++++--------- engines/glk/window_text_buffer.cpp | 2 +- engines/glk/zcode/bitmap_font.h | 2 +- engines/glk/zcode/config.cpp | 6 +- engines/glk/zcode/config.h | 28 +- engines/glk/zcode/glk_interface.cpp | 4 +- engines/glk/zcode/mem.cpp | 2 +- engines/glk/zcode/processor_screen.cpp | 4 +- engines/glk/zcode/quetzal.cpp | 6 +- engines/glk/zcode/sound_folder.cpp | 2 +- engines/glk/zcode/windows.cpp | 4 +- engines/gob/sound/sound.cpp | 2 +- engines/grim/actor.cpp | 8 +- engines/grim/emi/lua_v2.cpp | 2 +- engines/grim/emi/lua_v2_sound.cpp | 2 +- engines/grim/emi/modelemi.cpp | 2 +- engines/grim/emi/sound/mp3track.cpp | 2 +- engines/grim/gfx_opengl.cpp | 14 +- engines/grim/gfx_tinygl.cpp | 6 +- engines/grim/grim.h | 8 +- engines/grim/lua/lauxlib.cpp | 2 +- engines/grim/lua/lopcodes.h | 252 ++-- engines/grim/lua_v1.cpp | 2 +- engines/grim/lua_v1_graphics.cpp | 2 +- engines/grim/material.cpp | 2 +- engines/grim/movie/codecs/codec48.cpp | 6 +- engines/grim/patchr.cpp | 2 +- engines/grim/registry.h | 2 +- engines/grim/remastered/commentary.cpp | 2 +- engines/grim/remastered/lua_remastered.cpp | 28 +- engines/grim/remastered/overlay.h | 4 +- engines/grim/shaders/grim_actor.fragment | 6 +- .../grim/shaders/grim_actorlights.fragment | 6 +- engines/grim/shaders/grim_smush.vertex | 2 +- engines/grim/shaders/grim_text.vertex | 2 +- engines/groovie/music.cpp | 2 +- engines/hadesch/ambient.cpp | 6 +- engines/hadesch/ambient.h | 2 +- engines/hadesch/gfx_context.cpp | 4 +- engines/hadesch/hadesch.cpp | 8 +- engines/hadesch/hadesch.h | 4 +- engines/hadesch/herobelt.cpp | 4 +- engines/hadesch/hotzone.cpp | 6 +- engines/hadesch/persistent.cpp | 4 +- engines/hadesch/persistent.h | 4 +- engines/hadesch/pod_image.cpp | 8 +- engines/hadesch/rooms/argo.cpp | 4 +- engines/hadesch/rooms/catacombs.cpp | 6 +- engines/hadesch/rooms/crete.cpp | 18 +- engines/hadesch/rooms/daedalus.cpp | 4 +- engines/hadesch/rooms/ferry.cpp | 4 +- engines/hadesch/rooms/minos.cpp | 2 +- engines/hadesch/rooms/minotaur.cpp | 4 +- engines/hadesch/rooms/monster.cpp | 2 +- engines/hadesch/rooms/monster.h | 4 +- engines/hadesch/rooms/monster/illusion.cpp | 6 +- engines/hadesch/rooms/monster/projectile.cpp | 8 +- engines/hadesch/rooms/options.cpp | 10 +- engines/hadesch/rooms/riverstyx.cpp | 4 +- engines/hadesch/rooms/troy.cpp | 2 +- engines/hadesch/rooms/walloffame.cpp | 8 +- engines/hadesch/video.cpp | 18 +- engines/hadesch/video.h | 2 +- engines/illusions/actor.cpp | 2 +- engines/illusions/bbdou/bbdou_bubble.cpp | 2 +- engines/illusions/bbdou/menusystem_bbdou.cpp | 2 +- .../illusions/duckman/duckman_videoplayer.cpp | 2 +- .../illusions/duckman/duckman_videoplayer.h | 2 +- engines/illusions/resources/midiresource.h | 2 +- engines/illusions/saveload.cpp | 2 +- engines/kingdom/logic1.cpp | 4 +- engines/metaengine.h | 6 +- engines/mohawk/myst_stacks/myst.cpp | 2 +- engines/mohawk/myst_state.h | 2 +- engines/mohawk/riven_graphics.cpp | 4 +- engines/mohawk/riven_stacks/domespit.cpp | 2 +- engines/myst3/archive.cpp | 4 +- engines/myst3/console.cpp | 2 +- engines/myst3/gfx_opengl_shaders.cpp | 4 +- engines/myst3/gfx_opengl_texture.cpp | 2 +- engines/myst3/movie.cpp | 2 +- engines/myst3/myst3.h | 2 +- engines/myst3/shaders/myst3_box.vertex | 2 +- engines/myst3/shaders/myst3_cube.vertex | 2 +- engines/myst3/shaders/myst3_text.vertex | 2 +- engines/nancy/action/leverpuzzle.cpp | 2 +- engines/nancy/action/primaryvideo.cpp | 4 +- engines/nancy/action/sliderpuzzle.cpp | 4 +- engines/nancy/constants.cpp | 2 +- engines/nancy/cursor.cpp | 2 +- engines/nancy/dialogs.cpp | 2 +- engines/nancy/graphics.cpp | 2 +- engines/nancy/metaengine.cpp | 4 +- engines/nancy/nancy.cpp | 4 +- engines/nancy/sound.cpp | 2 +- engines/nancy/state/logo.cpp | 2 +- engines/nancy/state/mainmenu.cpp | 6 +- engines/nancy/ui/scrollbar.cpp | 2 +- engines/nancy/ui/viewport.cpp | 6 +- engines/nancy/ui/viewport.h | 2 +- engines/pink/objects/actions/action_talk.cpp | 2 +- engines/pink/objects/actions/action_talk.h | 2 +- engines/plumbers/plumbers.cpp | 10 +- engines/plumbers/plumbers.h | 4 +- engines/private/grammar.cpp | 24 +- engines/private/lexer.cpp | 84 +- engines/saga/gfx.h | 2 +- engines/sci/console.cpp | 2 +- engines/sci/detection.cpp | 4 +- engines/sci/engine/features.cpp | 4 +- engines/sci/engine/features.h | 2 +- engines/sci/engine/file.cpp | 6 +- engines/sci/engine/hoyle5poker.cpp | 2 +- engines/sci/engine/kmisc.cpp | 4 +- engines/sci/engine/kpathing.cpp | 4 +- engines/sci/engine/ksound.cpp | 4 +- engines/sci/engine/script_patches.cpp | 28 +- engines/sci/engine/scriptdebug.cpp | 4 +- engines/sci/graphics/maccursor32.h | 2 +- engines/sci/graphics/scifx.cpp | 186 +-- engines/sci/graphics/video32.h | 6 +- engines/sci/metaengine.cpp | 10 +- engines/sci/resource/resource.cpp | 6 +- engines/sci/resource/resource_audio.cpp | 6 +- engines/sci/sound/audio32.cpp | 2 +- engines/sci/sound/drivers/amigamac0.cpp | 2 +- engines/sci/sound/drivers/amigamac1.cpp | 4 +- engines/sci/sound/drivers/cms.cpp | 24 +- engines/sci/sound/drivers/fb01.cpp | 2 +- engines/sci/sound/drivers/pc9801.cpp | 38 +- engines/scumm/imuse_digi/dimuse.cpp | 6 +- engines/scumm/imuse_digi/dimuse.h | 2 +- engines/scumm/imuse_digi/dimuse_track.cpp | 6 +- engines/scumm/imuse_digi/dimuse_track.h | 4 +- engines/scumm/palette.cpp | 2 +- engines/scumm/script_v6.cpp | 6 +- engines/sky/sky.cpp | 4 +- engines/sludge/module.mk | 10 +- engines/stark/gfx/openglsactor.h | 2 +- engines/stark/metaengine.cpp | 2 +- engines/stark/resources/command.h | 2 +- engines/stark/resources/image.cpp | 2 +- engines/stark/resources/item.cpp | 2 +- engines/stark/scene.h | 2 +- engines/stark/services/gamechapter.cpp | 2 +- engines/stark/services/gamechapter.h | 2 +- engines/stark/services/gamemessage.h | 2 +- engines/stark/services/settings.h | 6 +- engines/stark/services/staticprovider.cpp | 2 +- engines/stark/services/userinterface.cpp | 2 +- engines/stark/ui/menu/dialogmenu.cpp | 14 +- engines/stark/ui/menu/diarypages.cpp | 2 +- engines/stark/ui/menu/fmvmenu.cpp | 2 +- engines/stark/ui/menu/locationscreen.h | 2 +- engines/stark/ui/menu/saveloadmenu.h | 8 +- engines/stark/ui/menu/settingsmenu.cpp | 30 +- engines/stark/ui/menu/settingsmenu.h | 6 +- engines/stark/ui/world/dialogpanel.cpp | 2 +- engines/startrek/bridge.cpp | 2 +- engines/startrek/console.cpp | 18 +- engines/startrek/module.mk | 2 +- engines/startrek/resource.cpp | 2 +- engines/startrek/room.cpp | 2 +- engines/startrek/rooms/demon1.cpp | 2 +- engines/startrek/rooms/demon6.cpp | 2 +- engines/startrek/rooms/love4.cpp | 2 +- engines/startrek/rooms/mudd3.cpp | 2 +- engines/startrek/rooms/trial5.cpp | 2 +- engines/startrek/startrek.cpp | 2 +- engines/startrek/startrek.h | 2 +- engines/supernova/game-manager.cpp | 2 +- engines/supernova/resman.cpp | 6 +- engines/supernova/supernova2/state.cpp | 44 +- engines/sword2/detection_internal.h | 2 +- engines/sword25/gfx/renderobjectmanager.cpp | 2 +- engines/sword25/module.mk | 2 +- engines/tinsel/background.cpp | 2 +- engines/tinsel/music.cpp | 2 +- engines/tinsel/saveload.cpp | 2 +- engines/tinsel/tinsel.cpp | 2 +- engines/titanic/core/game_object.h | 2 +- engines/titanic/core/view_item.cpp | 2 +- engines/titanic/game/sweet_bowl.cpp | 2 +- engines/titanic/npcs/doorbot.cpp | 2 +- engines/titanic/npcs/starlings.cpp | 2 +- engines/titanic/pet_control/pet_inventory.h | 2 +- .../pet_control/pet_inventory_glyphs.cpp | 2 +- .../pet_control/pet_inventory_glyphs.h | 2 +- engines/titanic/pet_control/pet_sound.cpp | 2 +- engines/titanic/star_control/base_stars.cpp | 2 +- engines/titanic/star_control/camera.cpp | 8 +- engines/titanic/star_control/camera.h | 8 +- engines/titanic/star_control/fpose.cpp | 2 +- engines/titanic/star_control/frect.cpp | 2 +- engines/titanic/star_control/fvector.h | 4 +- .../titanic/star_control/star_crosshairs.cpp | 2 +- engines/titanic/star_control/star_view.cpp | 2 +- engines/titanic/star_control/viewport.cpp | 4 +- engines/titanic/true_talk/bellbot_script.cpp | 2 +- engines/titanic/true_talk/tt_npc_script.cpp | 2 +- engines/ultima/nuvie/core/debug.cpp | 2 +- engines/ultima/nuvie/core/game.cpp | 2 +- engines/ultima/nuvie/core/look.cpp | 2 +- engines/ultima/nuvie/core/timed_event.cpp | 2 +- engines/ultima/nuvie/files/nuvie_bmp_file.cpp | 2 +- engines/ultima/nuvie/gui/gui_font.cpp | 4 +- engines/ultima/nuvie/misc/sdl_compat.cpp | 4 +- engines/ultima/nuvie/nuvie.cpp | 4 +- engines/ultima/nuvie/screen/screen.cpp | 2 +- engines/ultima/nuvie/screen/surface.cpp | 2 +- engines/ultima/shared/core/map.cpp | 2 +- engines/ultima/shared/core/map.h | 4 +- engines/ultima/shared/core/str.cpp | 2 +- engines/ultima/shared/early/game.h | 2 +- engines/ultima/shared/engine/data_archive.cpp | 6 +- engines/ultima/shared/engine/events.cpp | 2 +- engines/ultima/shared/gfx/bitmap.cpp | 2 +- engines/ultima/shared/gfx/font.cpp | 2 +- engines/ultima/shared/gfx/sprites.h | 2 +- .../ultima/shared/gfx/viewport_dungeon.cpp | 4 +- engines/ultima/shared/gfx/viewport_map.h | 2 +- engines/ultima/shared/gfx/visual_surface.h | 2 +- engines/ultima/shared/maps/map.h | 2 +- engines/ultima/shared/maps/map_base.cpp | 2 +- engines/ultima/shared/maps/map_tile.h | 2 +- engines/ultima/shared/maps/map_widget.h | 2 +- engines/ultima/ultima0/core/resources.h | 2 +- engines/ultima/ultima0/resources.h | 2 +- engines/ultima/ultima1/actions/move.cpp | 2 +- engines/ultima/ultima1/core/party.cpp | 2 +- engines/ultima/ultima1/core/resources.cpp | 2 +- .../ultima/ultima1/maps/map_city_castle.cpp | 8 +- engines/ultima/ultima1/maps/map_dungeon.cpp | 4 +- engines/ultima/ultima1/maps/map_overworld.cpp | 2 +- engines/ultima/ultima1/spells/spell.h | 2 +- .../ultima1/u1dialogs/full_screen_dialog.cpp | 2 +- engines/ultima/ultima1/u1dialogs/tavern.h | 2 +- engines/ultima/ultima1/u1dialogs/transports.h | 2 +- .../ultima/ultima1/u1gfx/drawing_support.cpp | 2 +- engines/ultima/ultima1/u1gfx/sprites.h | 2 +- engines/ultima/ultima1/u1gfx/text_cursor.cpp | 2 +- .../ultima/ultima1/u1gfx/view_char_gen.cpp | 4 +- engines/ultima/ultima1/u1gfx/view_char_gen.h | 2 +- engines/ultima/ultima1/u1gfx/view_game.cpp | 2 +- engines/ultima/ultima1/u1gfx/view_game.h | 2 +- engines/ultima/ultima1/u1gfx/view_title.cpp | 4 +- engines/ultima/ultima1/u1gfx/viewport_map.cpp | 2 +- engines/ultima/ultima1/u1gfx/viewport_map.h | 2 +- engines/ultima/ultima1/u6gfx/game_view.h | 2 +- .../ultima1/widgets/dungeon_monster.cpp | 2 +- engines/ultima/ultima1/widgets/king.cpp | 2 +- .../ultima1/widgets/overworld_monster.cpp | 4 +- engines/ultima/ultima1/widgets/princess.cpp | 2 +- engines/ultima/ultima1/widgets/wench.cpp | 2 +- .../ultima4/controllers/combat_controller.cpp | 2 +- engines/ultima/ultima4/core/debugger.cpp | 2 +- engines/ultima/ultima4/core/settings.cpp | 2 +- engines/ultima/ultima4/game/codex.cpp | 10 +- engines/ultima/ultima4/map/maploader.cpp | 2 +- engines/ultima/ultima8/audio/audio_mixer.cpp | 2 +- engines/ultima/ultima8/audio/midi_player.cpp | 2 +- .../crusader/convert_shape_crusader.cpp | 4 +- .../ultima8/convert/u8/convert_shape_u8.cpp | 8 +- engines/ultima/ultima8/filesys/savegame.cpp | 2 +- .../graphics/fonts/font_shape_archive.h | 2 +- .../ultima/ultima8/graphics/fonts/tt_font.cpp | 2 +- .../ultima8/graphics/soft_render_surface.cpp | 2 +- .../ultima8/graphics/soft_render_surface.inl | 16 +- engines/ultima/ultima8/gumps/gump.cpp | 2 +- .../ultima/ultima8/gumps/message_box_gump.cpp | 2 +- .../ultima8/gumps/shape_viewer_gump.cpp | 6 +- engines/ultima/ultima8/kernel/mouse.cpp | 2 +- .../ultima/ultima8/kernel/object_manager.cpp | 2 +- engines/ultima/ultima8/misc/debugger.cpp | 2 +- .../world/actors/avatar_mover_process.h | 2 +- .../world/actors/u8_avatar_mover_process.cpp | 6 +- engines/voyeur/files_threads.cpp | 2 +- engines/wintermute/achievements_tables.h | 2 +- engines/wintermute/ad/ad_game.cpp | 10 +- engines/wintermute/base/base_file_manager.cpp | 4 +- engines/wintermute/base/base_game.cpp | 8 +- engines/wintermute/base/base_game.h | 2 +- .../wintermute/base/base_keyboard_state.cpp | 16 +- engines/wintermute/base/base_object.cpp | 2 +- .../wintermute/base/file/base_disk_file.cpp | 2 +- engines/wintermute/base/file/base_package.cpp | 4 +- engines/wintermute/base/gfx/base_renderer.cpp | 2 +- .../base/gfx/opengl/base_render_opengl3d.cpp | 2 +- .../wintermute/base/scriptables/script.cpp | 6 +- .../base/scriptables/script_engine.cpp | 2 +- .../base/scriptables/script_ext_array.cpp | 4 +- .../base/scriptables/script_ext_file.cpp | 2 +- .../base/scriptables/script_ext_string.cpp | 2 +- engines/wintermute/dctypes.h | 4 +- engines/wintermute/detection_tables.h | 70 +- engines/wintermute/ext/scene_hooks.h | 2 +- engines/wintermute/ext/wme_3fstatistics.cpp | 2 +- engines/wintermute/keymapper_tables.h | 6 +- engines/wintermute/ui/ui_edit.cpp | 2 +- engines/wintermute/utils/path_util.h | 2 +- engines/wintermute/utils/utils.cpp | 2 +- engines/xeen/combat.cpp | 2 +- engines/xeen/locations.h | 2 +- engines/xeen/party.cpp | 2 +- engines/xeen/resources.h | 2 +- engines/xeen/swordsofxeen/swordsofxeen.h | 2 +- graphics/font.h | 2 +- graphics/fontman.h | 2 +- graphics/opengl/context.cpp | 2 +- graphics/opengl/context.h | 2 +- graphics/scaler/aspect.h | 2 +- graphics/scaler/hq.cpp | 2 +- graphics/tinygl/Changelog | 4 +- graphics/tinygl/LICENSE | 2 +- graphics/tinygl/vertex.cpp | 2 +- graphics/tinygl/zblit.cpp | 38 +- graphics/tinygl/zblit.h | 2 +- graphics/tinygl/zbuffer.h | 12 +- graphics/tinygl/zdirtyrect.cpp | 22 +- graphics/tinygl/zdirtyrect.h | 6 +- graphics/tinygl/zgl.h | 6 +- graphics/tinygl/zline.cpp | 2 +- graphics/tinygl/zmath.cpp | 158 +-- graphics/tinygl/ztriangle.cpp | 2 +- image/iff.h | 2 +- math/angle.h | 2 +- math/matrix3.h | 2 +- math/matrix4.cpp | 2 +- math/matrix4.h | 6 +- math/quat.h | 2 +- test/common/encoding.h | 8 +- test/common/math.h | 2 +- test/cxxtest/cxxtestgen.py | 6 +- test/null_osystem.cpp | 2 +- 665 files changed, 5896 insertions(+), 5899 deletions(-) diff --git a/.clang-format b/.clang-format index 76814b20422..4eba7ce6dda 100644 --- a/.clang-format +++ b/.clang-format @@ -14,7 +14,7 @@ SpaceAfterTemplateKeyword: false, SpaceBeforeAssignmentOperators: true, SpaceBeforeCtorInitializerColon: true, - SpaceBeforeInheritanceColon: true, + SpaceBeforeInheritanceColon: true, SpaceInEmptyParentheses: false, SpacesInAngles: false, SpacesInParentheses: false, diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 6279fbad3f4..886398222db 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -4,7 +4,7 @@ Thank you for contributing to ScummVM. Please read the following carefully befor Make sure your individual commits follow the guidelines found in the ScummVM Wiki: https://wiki.scummvm.org/index.php?title=Commit_Guidelines. If they're not please edit them before submitting the Pull Request. -Proper documentation must also be included for common code and changes impacting user facing elements. +Proper documentation must also be included for common code and changes impacting user facing elements. Commits and Pull Requests should use the following template: diff --git a/README.md b/README.md index df59e1b7fe4..e931b29472e 100644 --- a/README.md +++ b/README.md @@ -26,9 +26,9 @@ For the impatient among you, here is how to get ScummVM running in five simple s 5. Select the game you want to play in the list, and press Start. To play a game next time, skip to step 5, unless you want to add more games. -> -> Hint: -> +> +> Hint: +> > To add multiple games in one go, press and hold the shift key, then click 'Add game' -- the label will change to 'Mass Add' and if you press it, you are again asked to select a directory, only this time ScummVM will search through all subdirectories for supported games. @@ -59,7 +59,7 @@ For everything you need to know about how to use ScummVM, see our [user document ### The ScummVM Wiki -[The wiki](https://wiki.scummvm.org/) is the place to go for information about every game supported by ScummVM. If you're a developer, there's also some very handy information in the Developer section. +[The wiki](https://wiki.scummvm.org/) is the place to go for information about every game supported by ScummVM. If you're a developer, there's also some very handy information in the Developer section. ### Changelog diff --git a/audio/audiostream.h b/audio/audiostream.h index b32cb9d922f..8ac05727266 100644 --- a/audio/audiostream.h +++ b/audio/audiostream.h @@ -66,7 +66,7 @@ public: * * @note You *must* check whether the returned value is less than what you requested. * This indicates that the stream is fully used up. - * + * */ virtual int readBuffer(int16 *buffer, const int numSamples) = 0; @@ -81,7 +81,7 @@ public: * * If this returns true, it indicates that at this time there is no data * available in the stream. However, there might be more data in the future. - * + * * This is used by e.g. a rate converter to decide whether to keep on * converting data or to stop. */ @@ -92,7 +92,7 @@ public: * * If this returns true, it indicates that all data in this stream is used up * and no additional data will appear in it in the future. - * + * * This is used by the mixer to decide whether a given stream shall be * removed from the list of active streams (and thus be destroyed). * By default, this maps to endOfData(). @@ -129,7 +129,7 @@ public: * Create a looping audio stream object. * * On creation of the LoopingAudioStream object, the underlying stream will be rewound. - * + * * @see makeLoopingAudioStream * * @param stream The stream to loop. diff --git a/audio/mididrv.cpp b/audio/mididrv.cpp index c2c15ee0680..fd1da5483f7 100644 --- a/audio/mididrv.cpp +++ b/audio/mididrv.cpp @@ -534,7 +534,7 @@ void MidiDriver_BASE::midiDumpFinish() { midiDumpFile->write("\0\xff\x2f\0", 4); // meta event - end of track midiDumpFile->write("MTrk", 4); // start of second track midiDumpFile->writeUint32BE(_midiDumpCache.size() + 4); // track size (+4 because of the 'end of track' event) - midiDumpFile->write(_midiDumpCache.data(), _midiDumpCache.size()); + midiDumpFile->write(_midiDumpCache.data(), _midiDumpCache.size()); midiDumpFile->write("\0\xff\x2f\0", 4); // meta event - end of track midiDumpFile->finalize(); midiDumpFile->close(); diff --git a/audio/mididrv.h b/audio/mididrv.h index b198a1e4878..05e2f840e4b 100644 --- a/audio/mididrv.h +++ b/audio/mididrv.h @@ -164,7 +164,7 @@ public: * method below. */ void send(byte status, byte firstOp, byte secondOp); - + /** * Send a MIDI command from a specific source. If the MIDI driver * does not support multiple sources, the source parameter is @@ -191,7 +191,7 @@ public: * This can be used to implement an alternate delay method than the * OSystem::delayMillis function used by most sysEx implementations. * Note that not every driver needs a delay, or supports this method. - * In this case, 0 is returned and the driver itself will do a delay + * In this case, 0 is returned and the driver itself will do a delay * if necessary. * * For information on the SysEx data requirements, see the sysEx method. diff --git a/audio/mixer.h b/audio/mixer.h index f322d502ac2..5db2c6c3de4 100644 --- a/audio/mixer.h +++ b/audio/mixer.h @@ -110,8 +110,8 @@ public: * @param volume Volume with which to play the sound, ranging from 0 to 255. * @param balance Balance with which to play the sound, ranging from -127 to 127 (full left to full right). * 0 is balanced, -128 is invalid. - * @param autofreeStream If set, the stream will be freed after the playback is finished. - * @param permanent If set, a plain stopAll call will not stop this particular stream. + * @param autofreeStream If set, the stream will be freed after the playback is finished. + * @param permanent If set, a plain stopAll call will not stop this particular stream. * @param reverseStereo If set, left and right channels will be swapped. */ virtual void playStream( diff --git a/audio/mt32gm.cpp b/audio/mt32gm.cpp index 1567206cc5c..53eb55c7694 100644 --- a/audio/mt32gm.cpp +++ b/audio/mt32gm.cpp @@ -51,12 +51,12 @@ const byte MidiDriver_MT32GM::MT32_DEFAULT_INSTRUMENTS[8] = { // here; the driver is expected to flip these values based on the _midiDeviceReversePanning // variable. const byte MidiDriver_MT32GM::MT32_DEFAULT_PANNING[8] = { - // 7, 8, 7, 8, 4, A, 0, E + // 7, 8, 7, 8, 4, A, 0, E 0x40, 0x49, 0x40, 0x49, 0x25, 0x5B, 0x00, 0x7F }; -// This is the drum map for the Roland Sound Canvas SC-55 v1.xx. It had a fallback mechanism -// to correct invalid drumkit selections. Some games rely on this mechanism to select the +// This is the drum map for the Roland Sound Canvas SC-55 v1.xx. It had a fallback mechanism +// to correct invalid drumkit selections. Some games rely on this mechanism to select the // correct Roland GS drumkit. Use this map to emulate this mechanism. // E.g. correct invalid drumkit 50: GS_DRUMKIT_FALLBACK_MAP[50] == 48 const uint8 MidiDriver_MT32GM::GS_DRUMKIT_FALLBACK_MAP[128] = { @@ -697,7 +697,7 @@ byte MidiDriver_MT32GM::correctInstrumentBank(byte instrumentBank, byte patchId) switch (patchId) { case 25: // Steel-String Guitar / 12-string Guitar / Mandolin - // This instrument has 2 sub-capital tones. Bank selects 17-63 + // This instrument has 2 sub-capital tones. Bank selects 17-63 // are corrected to the second sub-capital tone at 16. if (instrumentBank >= 16) { correctedBank = 16; diff --git a/audio/mt32gm.h b/audio/mt32gm.h index 229dfb6ef5b..0e8dbee7144 100644 --- a/audio/mt32gm.h +++ b/audio/mt32gm.h @@ -37,13 +37,13 @@ /** * MIDI driver for MT-32 and GM compatible emulators and devices. - * + * * This class contains some commonly needed functionality for these devices and - * the MIDI data that targets them. It wraps the MidiDriver instance that does + * the MIDI data that targets them. It wraps the MidiDriver instance that does * the actual communication with the MT-32 or GM device. - * + * * This driver has the following features: - * + * * - MIDI device initialization * Construct the driver with the type of MIDI data that will be sent to it. * When the driver is opened, it will create an output MIDI driver appropriate @@ -51,7 +51,7 @@ * create the output MIDI driver yourself and pass it to the open function. * The driver will take care of initializing the MIDI device and setting up * for playback of MT-32 data on a GM/GS device or the other way around. - * + * * - MT-32 <> GM conversion * If the incoming MIDI data has been set to MT-32 and the output device is * GM, the driver will map MT-32 instruments to GM equivalents. GM playback @@ -59,25 +59,25 @@ * _gmToMT32InstrumentMap variables to override the standard instrument maps, * or override the mapMT32InstrumentToGM and mapGMInstrumentToMT32 functions * for more advanced mapping algorithms. - * + * * - User volume settings * The driver will scale the MIDI channel volume using the user specified * volume settings. Just call syncSoundSettings when the user has changed the * volume settings. Set the USER_VOLUME_SCALING property to false to disable * this functionality. - * + * * - Reverse stereo * If the game has MIDI data with reversed stereo compared to the targeted * output device, set the MIDI_DATA_REVERSE_PANNING property to reverse * stereo. The driver wil automatically reverse stereo when MT-32 data is * sent to a GM/GS device or the other way around. - * + * * - Correct Roland GS bank and drumkit selects * Some games' MIDI data relies on a feature of the Roland SC-55 MIDI module * which automatically corrects invalid bank selects and drumkit program * changes. The driver replicates this feature to ensure correct instrument * banks and drumkits on other hardware or softsynths. - * + * * - SysEx queue * The sysExQueue function will queue a SysEx message and return immediately. * You can send more messages to the queue while the driver sends the @@ -88,7 +88,7 @@ * necessary amount of time for the MIDI device to process the message. * Use clearSysExQueue to remove all messages from the queue, in case device * initialization has to be aborted. -* +* * - Multiple MIDI sources * If the game plays multiple streams of MIDI data at the same time, each * stream can be marked with a source number. This enables the following @@ -317,7 +317,7 @@ public: /** * Write data to an MT-32 memory location using a SysEx message. * This function will add the necessary header and checksum bytes. - * + * * @param msg Pointer to the data to write to a memory location * @param length The data length * @param targetAddress The start memory address in 8 bit format. @@ -362,7 +362,7 @@ public: * volume will remain at the current value or be set to the start or end * volume. If there is no active fade for the specified source, this * function does nothing. - * + * * @param source The source that should have its fade aborted * @param abortType How to set the volume when aborting the fade (default: * set to the target fade volume). @@ -395,7 +395,7 @@ public: * Note that sources are not required to allocate channels, so if sources * use conflicting MIDI channels, make sure to use this function * consistently. - * + * * @param source The source for which to allocate channels * @param numChannels The number of channels to allocate * @return True if allocation was successful, false otherwise (usually @@ -420,7 +420,7 @@ public: */ void setSourceVolume(uint16 volume); /** - * Sets the volume for this source. The volume values in the MIDI data sent + * Sets the volume for this source. The volume values in the MIDI data sent * by this source will be scaled by the source volume. */ virtual void setSourceVolume(uint8 source, uint16 volume); @@ -463,7 +463,7 @@ protected: /** * Initializes the MT-32 MIDI device. The device will be reset and, * if the parameter is specified, set up for General MIDI data. - * + * * @param initForGM True if the MT-32 should be initialized for GM mapping */ virtual void initMT32(bool initForGM); @@ -472,7 +472,7 @@ protected: * If the initForMT32 parameter is specified, the device will be set up for * MT-32 MIDI data. If the device supports Roland GS, the enableGS * parameter can be specified for enhanced GS MT-32 compatiblity. - * + * * @param initForMT32 True if the device should be initialized for MT-32 mapping * @param enableGS True if the device should be initialized for GS MT-32 mapping */ @@ -483,7 +483,7 @@ protected: * This function is called after mapping the MIDI data channel to an output * channel, so the specified output channel is used and not the channel in * the event bytes. - * + * * @param source The source of the event * @param b The event MIDI bytes * @param outputChannel The output channel for the event @@ -498,7 +498,7 @@ protected: * Processes a note on or off MIDI event. * This will apply source volume if necessary, update the active note * registration and send the event to the MIDI device. - * + * * @param outputChannel The MIDI output channel for the event * @param command The MIDI command byte * @param controlData The control data set that will be used for applying @@ -510,7 +510,7 @@ protected: * Process a control change MIDI event. * This will update the specified control data set and apply other * processing if necessary, and then send the event to the MIDI device. - * + * * @param outputChannel The MIDI output channel for the event * @param controlData The control data set that the new controller value * should be stored on @@ -524,9 +524,9 @@ protected: * This will update the specified control data set, apply MT-32 <> GM * instrument mapping and other processing, and send the event to the MIDI * device. - * + * * @param outputChannel The MIDI output channel for the event - * @param controlData The control data set that the new program value + * @param controlData The control data set that the new program value * should be stored on * @param channelLockedByOtherSource True if the output channel is locked * by another source. Default is false. @@ -582,7 +582,7 @@ protected: * Returns the MIDI output channel mapped to the specified data channel. * If the data channel has not been mapped yet, a new mapping to one of the * output channels available to the source will be created. - * + * * @param source The source using the data channel * @param dataChannel The data channel to map * @return The mapped output channel, or -1 if no mapping is possible @@ -649,7 +649,7 @@ protected: // The current number of microseconds that have to elapse before the next // SysEx message can be sent. uint32 _sysExDelay; - // Queue of SysEx messages to be sent to the MIDI device. + // Queue of SysEx messages to be sent to the MIDI device. Common::Queue _sysExQueue; // Mutex for write access to the SysEx queue. Common::Mutex _sysExQueueMutex; diff --git a/backends/cloud/basestorage.cpp b/backends/cloud/basestorage.cpp index 074c8596ec4..830d3fa6dae 100644 --- a/backends/cloud/basestorage.cpp +++ b/backends/cloud/basestorage.cpp @@ -34,7 +34,7 @@ BaseStorage::BaseStorage() {} BaseStorage::BaseStorage(Common::String token, Common::String refreshToken, bool enabled): _token(token), _refreshToken(refreshToken) { - _isEnabled = enabled; + _isEnabled = enabled; } BaseStorage::~BaseStorage() {} @@ -189,7 +189,7 @@ void BaseStorage::tokenRefreshed(BoolCallback callback, Networking::JsonResponse Common::JSONObject oauth; bool requiresRefreshToken = !canReuseRefreshToken(); if (success) { - oauth = result.getVal("oauth")->asObject(); + oauth = result.getVal("oauth")->asObject(); if (!Networking::CurlJsonRequest::jsonContainsString(oauth, "access_token", "BaseStorage::tokenRefreshed") || !Networking::CurlJsonRequest::jsonContainsString(oauth, "refresh_token", "BaseStorage::tokenRefreshed", !requiresRefreshToken)) { warning("BaseStorage: bad response, no 'access_token' or 'refresh_token' attribute passed"); diff --git a/backends/cloud/basestorage.h b/backends/cloud/basestorage.h index de287fcba35..819ff7ca060 100644 --- a/backends/cloud/basestorage.h +++ b/backends/cloud/basestorage.h @@ -40,7 +40,7 @@ protected: virtual void getAccessToken(Common::String code, Networking::ErrorCallback callback); /** - * Handles JSON response which should contain access token requested + * Handles JSON response which should contain access token requested * with getAccessToken(). */ virtual void codeFlowComplete(Networking::ErrorCallback callback, Networking::JsonResponse response); diff --git a/backends/dialogs/amigaos/amigaos-dialogs.cpp b/backends/dialogs/amigaos/amigaos-dialogs.cpp index 2fe8f41be58..058dfdf7a3a 100644 --- a/backends/dialogs/amigaos/amigaos-dialogs.cpp +++ b/backends/dialogs/amigaos/amigaos-dialogs.cpp @@ -78,7 +78,7 @@ Common::DialogManager::DialogResult AmigaOSDialogManager::showFileBrowser(const } AslBase = nullptr; IAsl = nullptr; - IExec->CloseLibrary(AslBase); + IExec->CloseLibrary(AslBase); IExec->DropInterface((struct Interface*)IAsl); } diff --git a/backends/dialogs/amigaos/amigaos-dialogs.h b/backends/dialogs/amigaos/amigaos-dialogs.h index b290c6b3379..44149f55a32 100644 --- a/backends/dialogs/amigaos/amigaos-dialogs.h +++ b/backends/dialogs/amigaos/amigaos-dialogs.h @@ -23,7 +23,7 @@ #ifndef BACKEND_AMIGAOS_DIALOGS_H #define BACKEND_AMIGAOS_DIALOGS_H -#if defined(__amigaos4__) && defined(USE_SYSDIALOGS) +#if defined(__amigaos4__) && defined(USE_SYSDIALOGS) #include "common/dialogs.h" #include "common/fs.h" diff --git a/backends/dialogs/morphos/morphos-dialogs.cpp b/backends/dialogs/morphos/morphos-dialogs.cpp index 765a16347bb..8f8a0ec4e3f 100644 --- a/backends/dialogs/morphos/morphos-dialogs.cpp +++ b/backends/dialogs/morphos/morphos-dialogs.cpp @@ -54,7 +54,7 @@ Common::DialogManager::DialogResult MorphosDialogManager::showFileBrowser(const if (!fr) return result; - + if (AslRequestTags(fr, ASLFR_TitleText, (IPTR)newTitle.c_str(), ASLFR_RejectIcons, TRUE, ASLFR_InitialDrawer, (IPTR)pathBuffer, ASLFR_DrawersOnly, (isDirBrowser ? TRUE : FALSE), TAG_DONE)) { if (strlen(fr->fr_Drawer) < sizeof(pathBuffer)) { @@ -63,7 +63,7 @@ Common::DialogManager::DialogResult MorphosDialogManager::showFileBrowser(const if (!isDirBrowser) { AddPart(pathBuffer, fr->fr_File, sizeof(pathBuffer)); } - choice = Common::FSNode(pathBuffer); + choice = Common::FSNode(pathBuffer); result = kDialogOk; } FreeAslRequest((APTR)fr); diff --git a/backends/dialogs/morphos/morphos-dialogs.h b/backends/dialogs/morphos/morphos-dialogs.h index 7bc12725840..e27bfaf54d6 100644 --- a/backends/dialogs/morphos/morphos-dialogs.h +++ b/backends/dialogs/morphos/morphos-dialogs.h @@ -23,7 +23,7 @@ #ifndef BACKEND_MORPHOS_DIALOGS_H #define BACKEND_MORPHOS_DIALOGS_H -#if defined(__MORPHOS__) && defined(USE_SYSDIALOGS) +#if defined(__MORPHOS__) && defined(USE_SYSDIALOGS) #include "common/fs.h" #include "common/dialogs.h" diff --git a/backends/dialogs/win32/mingw-compat.h b/backends/dialogs/win32/mingw-compat.h index e9c55a106df..1963a372588 100644 --- a/backends/dialogs/win32/mingw-compat.h +++ b/backends/dialogs/win32/mingw-compat.h @@ -70,7 +70,7 @@ typedef DWORD SICHINTF; // Shell item #define INTERFACE IShellItem -DECLARE_INTERFACE_(IShellItem, IUnknown) { +DECLARE_INTERFACE_(IShellItem, IUnknown) { STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE; STDMETHOD_(ULONG,AddRef) (THIS) PURE; STDMETHOD_(ULONG,Release) (THIS) PURE; diff --git a/backends/events/psp2sdl/psp2sdl-events.cpp b/backends/events/psp2sdl/psp2sdl-events.cpp index baaa0cd54cc..0dfa97ba10d 100644 --- a/backends/events/psp2sdl/psp2sdl-events.cpp +++ b/backends/events/psp2sdl/psp2sdl-events.cpp @@ -321,7 +321,7 @@ void PSP2EventSource::preprocessFingerMotion(SDL_Event *event) { } } if (numFingersDownLong >= 2) { - // starting drag, so push mouse down at current location (back) + // starting drag, so push mouse down at current location (back) // or location of "oldest" finger (front) int mouseDownX = _mouseX; int mouseDownY = _mouseY; diff --git a/backends/events/switchsdl/switchsdl-events.cpp b/backends/events/switchsdl/switchsdl-events.cpp index 05238d4b1ae..f0b2b118560 100644 --- a/backends/events/switchsdl/switchsdl-events.cpp +++ b/backends/events/switchsdl/switchsdl-events.cpp @@ -290,7 +290,7 @@ void SwitchEventSource::preprocessFingerMotion(SDL_Event *event) { } } if (numFingersDownLong >= 2) { - // starting drag, so push mouse down at current location (back) + // starting drag, so push mouse down at current location (back) // or location of "oldest" finger (front) int mouseDownX = _mouseX; int mouseDownY = _mouseY; diff --git a/backends/fs/morphos/morphos-fs.cpp b/backends/fs/morphos/morphos-fs.cpp index 3eebea800fc..d30ca919e5e 100644 --- a/backends/fs/morphos/morphos-fs.cpp +++ b/backends/fs/morphos/morphos-fs.cpp @@ -78,10 +78,10 @@ MorphOSFilesystemNode::MorphOSFilesystemNode(const Common::String &p) { _bIsValid = false; struct FileInfoBlock *fib = (struct FileInfoBlock*) AllocDosObject(DOS_FIB, NULL); - + if (fib == NULL) { debug(6,"Failed..."); - return; + return; } BPTR pLock = Lock((CONST_STRPTR)_sPath.c_str(), SHARED_LOCK); @@ -133,10 +133,10 @@ MorphOSFilesystemNode::MorphOSFilesystemNode(BPTR pLock, const char *pDisplayNam _bIsDirectory = false; FileInfoBlock *fib = (FileInfoBlock*) AllocDosObject(DOS_FIB, NULL); - + if (fib == NULL) { debug(6,"Failed..."); - return; + return; } if (Examine(pLock, fib) != DOSFALSE) { @@ -223,14 +223,14 @@ bool MorphOSFilesystemNode::getChildren(AbstractFSList &myList, ListMode mode, b } FileInfoBlock *fib = (FileInfoBlock*) AllocDosObject(DOS_FIB, NULL); - + if (fib == NULL) { debug(6, "Failed to allocate memory for FileInfoBLock"); return false; } - + if (Examine(_pFileLock, fib) != DOSFALSE) { - + MorphOSFilesystemNode *entry; while (ExNext(_pFileLock, fib) != DOSFALSE) { @@ -246,7 +246,7 @@ bool MorphOSFilesystemNode::getChildren(AbstractFSList &myList, ListMode mode, b myList.push_back(entry); } UnLock(pLock); - } + } } } if (ERROR_NO_MORE_ENTRIES != IoErr() ) { @@ -299,18 +299,18 @@ AbstractFSList MorphOSFilesystemNode::listVolumes() const { char buffer[MAXPATHLEN]; dosList = LockDosList(kLockFlags); - + if (dosList == NULL) { debug(6, "Cannot lock the DOS list"); return myList; } dosList = NextDosEntry(dosList, LDF_VOLUMES); - + MorphOSFilesystemNode *entry; - + while (dosList) { - + if (dosList->dol_Type == DLT_VOLUME && dosList->dol_Name && dosList->dol_Task) { diff --git a/backends/graphics/windowed.h b/backends/graphics/windowed.h index d88d64256a2..f261c0f032b 100644 --- a/backends/graphics/windowed.h +++ b/backends/graphics/windowed.h @@ -401,7 +401,7 @@ private: width = fracToInt(height * displayAspect); } } - + drawRect.left = ((_windowWidth - width) / 2) + _gameScreenShakeXOffset * width / getWidth(); drawRect.top = ((_windowHeight - height) / 2) + _gameScreenShakeYOffset * height / getHeight(); drawRect.setWidth(width); diff --git a/backends/keymapper/input-watcher.h b/backends/keymapper/input-watcher.h index 672edb6bafd..1d4c7e9386a 100644 --- a/backends/keymapper/input-watcher.h +++ b/backends/keymapper/input-watcher.h @@ -34,7 +34,7 @@ struct HardwareInput; /** * Watches events for inputs that can be bound to actions - * + * * When the watch mode is enabled, the watcher disables the Keymapper * and sets itself as an event observer. Once an event corresponding * to an hardware input is received, it is saved for later retrieval. diff --git a/backends/networking/curl/sessionrequest.cpp b/backends/networking/curl/sessionrequest.cpp index 42afd6387bf..368fd3bc363 100644 --- a/backends/networking/curl/sessionrequest.cpp +++ b/backends/networking/curl/sessionrequest.cpp @@ -125,7 +125,7 @@ void SessionRequest::handle() { if (_contentsStream.write(_buffer, readBytes) != readBytes) warning("SessionRequest: unable to write all the bytes into MemoryWriteStreamDynamic"); - if (_stream->eos()) { + if (_stream->eos()) { finishSuccess(); } } diff --git a/backends/networking/curl/sessionrequest.h b/backends/networking/curl/sessionrequest.h index fd2757fcd29..53f5fd447bb 100644 --- a/backends/networking/curl/sessionrequest.h +++ b/backends/networking/curl/sessionrequest.h @@ -59,7 +59,7 @@ public: virtual void restart(); /** This request DOES NOT delete automatically after calling callbacks. It gets PAUSED, and in order to make it FINISHED (i.e. delete), this method MUST be called. */ - void close(); + void close(); bool complete(); bool success(); diff --git a/backends/platform/3ds/README.md b/backends/platform/3ds/README.md index a85dee1116f..f912a1528b0 100644 --- a/backends/platform/3ds/README.md +++ b/backends/platform/3ds/README.md @@ -24,7 +24,7 @@ Table of Contents: 1.0) Installation ----------------- There are two possible formats to be used: 3DSX and CIA. -The 3DSX format is considered more ethical because it does not make use of +The 3DSX format is considered more ethical because it does not make use of invalid title IDs, which get logged. It is also compatible with homebrew loading methods that do not involve CFW. The 3DSX format is exclusively used by the Homebrew Launcher and its derivatives. @@ -35,7 +35,7 @@ Installing the Homebrew Launcher or any CFW is beyond the scope of this README. 1.1) 3DSX installation ---------------- -You need to merely extract the ScummVM 3DSX files to your SD card so that all +You need to merely extract the ScummVM 3DSX files to your SD card so that all files reside in the `/3ds/scummvm/` directory. It can then be launched by Homebrew Launcher or a similar implementation. diff --git a/backends/platform/3ds/shader.v.pica b/backends/platform/3ds/shader.v.pica index 2d189856228..e1915126208 100644 --- a/backends/platform/3ds/shader.v.pica +++ b/backends/platform/3ds/shader.v.pica @@ -39,7 +39,7 @@ ; Force the w component of inpos to be 1.0 mov r0.xyz, inpos mov r0.w, ones - + ; r1 = modelView * inpos dp4 r1.x, modelView[0], r0 dp4 r1.y, modelView[1], r0 diff --git a/backends/platform/androidsdl/androidsdl.mk b/backends/platform/androidsdl/androidsdl.mk index 2872101bdad..c1fdd71d55f 100644 --- a/backends/platform/androidsdl/androidsdl.mk +++ b/backends/platform/androidsdl/androidsdl.mk @@ -1,5 +1,5 @@ # Special target to create an AndroidSDL snapshot -androidsdl: +androidsdl: $(MKDIR) release $(INSTALL) -c -m 644 $(DIST_FILES_THEMES) $(DIST_FILES_NETWORKING) $(DIST_FILES_VKEYBD) $(DIST_FILES_ENGINEDATA) release $(INSTALL) -c -m 644 $(DIST_FILES_DOCS) release diff --git a/backends/platform/dingux/module.mk b/backends/platform/dingux/module.mk index b924fec1cfb..c7ae8db48af 100644 --- a/backends/platform/dingux/module.mk +++ b/backends/platform/dingux/module.mk @@ -2,7 +2,7 @@ MODULE := backends/platform/dingux MODULE_OBJS := \ main.o \ - dingux.o + dingux.o # We don't use rules.mk but rather manually update OBJS and MODULE_DIRS. MODULE_OBJS := $(addprefix $(MODULE)/, $(MODULE_OBJS)) diff --git a/backends/platform/gph/build/gp2x-config.sh b/backends/platform/gph/build/gp2x-config.sh index a9b28b2fd0d..31e1d50e2b3 100644 --- a/backends/platform/gph/build/gp2x-config.sh +++ b/backends/platform/gph/build/gp2x-config.sh @@ -26,6 +26,6 @@ cd ../../../.. --enable-vkeybd # --enable-plugins --default-dynamic -# --disable-release --enable-debug +# --disable-release --enable-debug echo Generating config for GP2X complete. Check for errors. diff --git a/backends/platform/ios7/ios7_app_delegate.mm b/backends/platform/ios7/ios7_app_delegate.mm index eeea48b4ed8..8837087e679 100644 --- a/backends/platform/ios7/ios7_app_delegate.mm +++ b/backends/platform/ios7/ios7_app_delegate.mm @@ -78,7 +78,7 @@ dispatch_async(dispatch_get_global_queue(0, 0), ^{ iOS7_main(iOS7_argc, iOS7_argv); }); - + if (_restoreState) [_view restoreApplicationState]; else diff --git a/backends/platform/ios7/ios7_video.mm b/backends/platform/ios7/ios7_video.mm index 0be0adf6821..b443209f67a 100644 --- a/backends/platform/ios7/ios7_video.mm +++ b/backends/platform/ios7/ios7_video.mm @@ -685,7 +685,7 @@ uint getSizeNextPOT(uint size) { GLfloat ratio = adjustedHeight / adjustedWidth; int height = (int)(screenWidth * ratio); //printf("Making rect (%u, %u)\n", screenWidth, height); - + _gameScreenRect = CGRectMake(0, 0, screenWidth, height); overlayPortraitRatio = (_videoContext.overlayHeight * ratio) / _videoContext.overlayWidth; diff --git a/backends/platform/null/null.cpp b/backends/platform/null/null.cpp index 2112e8e9325..9ca41f17314 100644 --- a/backends/platform/null/null.cpp +++ b/backends/platform/null/null.cpp @@ -106,7 +106,7 @@ private: OSystem_NULL::OSystem_NULL() { #if defined(__amigaos4__) _fsFactory = new AmigaOSFilesystemFactory(); - #elif defined(__MORPHOS__) + #elif defined(__MORPHOS__) _fsFactory = new MorphOSFilesystemFactory(); #elif defined(POSIX) _fsFactory = new POSIXFilesystemFactory(); diff --git a/backends/platform/psp/README.PSP b/backends/platform/psp/README.PSP index a8796a545f9..a9beecdbbfe 100644 --- a/backends/platform/psp/README.PSP +++ b/backends/platform/psp/README.PSP @@ -42,13 +42,13 @@ Analog - Moves in a direction (left/right/up/down) (Useful to k Image Viewer ============ -For your convenience, I've included a simple image viewer in the PSP port. +For your convenience, I've included a simple image viewer in the PSP port. You can view anything you want while playing a game. There are a few simple rules to follow: -- Images must be of PNG format. If you have images in another format, many +- Images must be of PNG format. If you have images in another format, many graphics utilities will convert them for you. -- Images must be named psp_image1.png, psp_image2.png etc. This is to make +- Images must be named psp_image1.png, psp_image2.png etc. This is to make sure there's no possible conflict between image files and game files. - Images must be placed in the game directories. When using the image viewer, only the images of the particular game being played will be available for viewing. diff --git a/backends/platform/psp/README.PSP.in b/backends/platform/psp/README.PSP.in index 4dc9513220c..7503f7662f8 100644 --- a/backends/platform/psp/README.PSP.in +++ b/backends/platform/psp/README.PSP.in @@ -42,13 +42,13 @@ Analog - Moves in a direction (left/right/up/down) (Useful to k Image Viewer ============ -For your convenience, I've included a simple image viewer in the PSP port. +For your convenience, I've included a simple image viewer in the PSP port. You can view anything you want while playing a game. There are a few simple rules to follow: -- Images must be of PNG format. If you have images in another format, many +- Images must be of PNG format. If you have images in another format, many graphics utilities will convert them for you. -- Images must be named psp_image1.png, psp_image2.png etc. This is to make +- Images must be named psp_image1.png, psp_image2.png etc. This is to make sure there's no possible conflict between image files and game files. - Images must be placed in the game directories. When using the image viewer, only the images of the particular game being played will be available for viewing. diff --git a/backends/platform/psp/display_manager.cpp b/backends/platform/psp/display_manager.cpp index 4139ac38d03..ea7cff1b028 100644 --- a/backends/platform/psp/display_manager.cpp +++ b/backends/platform/psp/display_manager.cpp @@ -364,7 +364,7 @@ void DisplayManager::calculateScaleParams() { _displayParams.screenOutput.width = (uint32)(PSP_SCREEN_HEIGHT * aspectRatio); if (_displayParams.screenOutput.width > PSP_SCREEN_WIDTH) { // shrink if wider than screen - _displayParams.screenOutput.height = (uint32)(((float)PSP_SCREEN_HEIGHT * (float)PSP_SCREEN_WIDTH) / (float)_displayParams.screenOutput.width); + _displayParams.screenOutput.height = (uint32)(((float)PSP_SCREEN_HEIGHT * (float)PSP_SCREEN_WIDTH) / (float)_displayParams.screenOutput.width); _displayParams.screenOutput.width = PSP_SCREEN_WIDTH; } } diff --git a/backends/platform/psp/osys_psp.cpp b/backends/platform/psp/osys_psp.cpp index b5a612d41c3..b8a81f1bc6c 100644 --- a/backends/platform/psp/osys_psp.cpp +++ b/backends/platform/psp/osys_psp.cpp @@ -108,7 +108,7 @@ void OSystem_PSP::engineDone() { } bool OSystem_PSP::hasFeature(Feature f) { - return (f == kFeatureOverlaySupportsAlpha || f == kFeatureCursorPalette || + return (f == kFeatureOverlaySupportsAlpha || f == kFeatureCursorPalette || f == kFeatureKbdMouseSpeed || f == kFeatureJoystickDeadzone); } diff --git a/backends/platform/sdl/amigaos/amigaos.mk b/backends/platform/sdl/amigaos/amigaos.mk index 8c96f074075..59f9162e102 100644 --- a/backends/platform/sdl/amigaos/amigaos.mk +++ b/backends/platform/sdl/amigaos/amigaos.mk @@ -6,7 +6,7 @@ # Once a vanilla installation was created, none of the special subdirectories # are found/accessible (extras, themes, plugins), instead ScummVM reports # missing theme files and a missing valid translation.dat. -# Switching to AmigaOS' own "makedir" until there is a fix or other solution. +# Switching to AmigaOS' own "makedir" until there is a fix or other solution. # amigaosdist: $(EXECUTABLE) $(PLUGINS) makedir all $(AMIGAOSPATH) diff --git a/backends/platform/sdl/morphos/morphos.cpp b/backends/platform/sdl/morphos/morphos.cpp index 405fe854e30..fc556cf679b 100644 --- a/backends/platform/sdl/morphos/morphos.cpp +++ b/backends/platform/sdl/morphos/morphos.cpp @@ -35,7 +35,7 @@ void OSystem_MorphOS::init() { // Invoke parent implementation of this method OSystem_SDL::init(); - + #if defined(USE_SYSDIALOGS) _dialogManager = new MorphosDialogManager(); #endif @@ -44,12 +44,12 @@ void OSystem_MorphOS::init() { bool OSystem_MorphOS::hasFeature(Feature f) { if (f == kFeatureOpenUrl) return true; - + #if defined(USE_SYSDIALOGS) if (f == kFeatureSystemBrowserDialog) return true; #endif - + return OSystem_SDL::hasFeature(f); } diff --git a/backends/platform/sdl/morphos/morphos.mk b/backends/platform/sdl/morphos/morphos.mk index 1469f702a62..98ad0463434 100644 --- a/backends/platform/sdl/morphos/morphos.mk +++ b/backends/platform/sdl/morphos/morphos.mk @@ -21,5 +21,5 @@ ifdef DIST_FILES_THEMES mkdir -p $(MORPHOSPATH)themes cp $(DIST_FILES_THEMES) $(MORPHOSPATH)themes/ endif -# Strip +# Strip $(STRIP) $(EXECUTABLE) -o $(MORPHOSPATH)$(EXECUTABLE) diff --git a/backends/platform/sdl/psp2/psp2-main.cpp b/backends/platform/sdl/psp2/psp2-main.cpp index 0ebe692b9a4..607846a80ea 100644 --- a/backends/platform/sdl/psp2/psp2-main.cpp +++ b/backends/platform/sdl/psp2/psp2-main.cpp @@ -81,7 +81,7 @@ int main(int argc, char *argv[]) { game_id[path_param-gameid_param] = 0; snprintf(path, 256, path_param + 6); } - + const char* args[4]; args[0] = "ux0:app/VSCU00001/eboot.bin"; args[1] = "-p"; diff --git a/backends/platform/sdl/switch/switch.cpp b/backends/platform/sdl/switch/switch.cpp index 36c61773554..92b59f374cf 100644 --- a/backends/platform/sdl/switch/switch.cpp +++ b/backends/platform/sdl/switch/switch.cpp @@ -64,7 +64,7 @@ static const Common::AxisTableEntry switchJoystickAxes[] = { }; void OSystem_Switch::init() { - + DrivesPOSIXFilesystemFactory *fsFactory = new DrivesPOSIXFilesystemFactory(); fsFactory->addDrive("sdmc:"); fsFactory->configureBuffering(DrivePOSIXFilesystemNode::kBufferingModeScummVM, 2048); diff --git a/backends/platform/sdl/win32/win32.h b/backends/platform/sdl/win32/win32.h index e7fa7858f92..00fe53b9ff3 100644 --- a/backends/platform/sdl/win32/win32.h +++ b/backends/platform/sdl/win32/win32.h @@ -52,7 +52,7 @@ protected: // Override createAudioCDManager() to get our Windows-specific // version. virtual AudioCDManager *createAudioCDManager() override; - + HWND getHwnd() { return ((SdlWindow_Win32*)_window)->getHwnd(); } }; diff --git a/backends/platform/symbian/AdaptAllMMPs.pl b/backends/platform/symbian/AdaptAllMMPs.pl index a25c6f12380..9ff8c89f9f8 100644 --- a/backends/platform/symbian/AdaptAllMMPs.pl +++ b/backends/platform/symbian/AdaptAllMMPs.pl @@ -128,7 +128,7 @@ my @excludes_snd = ( "TVP.cpp" ); -my @excludes_graphics = ( +my @excludes_graphics = ( ); my @excludes_gui = ( diff --git a/backends/platform/symbian/README b/backends/platform/symbian/README index 2c32fa953e0..db855fff31d 100644 --- a/backends/platform/symbian/README +++ b/backends/platform/symbian/README @@ -10,7 +10,7 @@ Using parts of snprintf.c by Mark Martinec , April 1999, June 2000 -Copyright © 1999,2000,2001,2002 Mark Martinec. All rights reserved. +Copyright � 1999,2000,2001,2002 Mark Martinec. All rights reserved. under these conditions: "Terms and conditions ... This program is free software; it is dual licensed, the terms of the "Frontier Artistic License" or @@ -30,10 +30,10 @@ Release version: 2.2.0 For engines layout see ScummVM in OS help menu Release version: 1.7.0 * Nothing significant in the Symbian port, except SDL improvements (new SDL version used) - + Release version: 1.6.0 * Nothing significant in the Symbian port, except SDL improvements (new SDL version used) - + Release version: 1.5.0 * Nothing significant in the Symbian port, except SDL improvements (new SDL version used) diff --git a/backends/platform/symbian/help/ScummVM.xml b/backends/platform/symbian/help/ScummVM.xml index a1a787012a3..75b7969be12 100644 --- a/backends/platform/symbian/help/ScummVM.xml +++ b/backends/platform/symbian/help/ScummVM.xml @@ -1,7 +1,7 @@ - + 0x100039ce diff --git a/backends/platform/symbian/help/build_help.mk b/backends/platform/symbian/help/build_help.mk index b2910f9c11f..2091557db5e 100644 --- a/backends/platform/symbian/help/build_help.mk +++ b/backends/platform/symbian/help/build_help.mk @@ -3,7 +3,7 @@ # Part of : ScummVM # # Description: This is file for creating .hlp file -# +# # ============================================================================ diff --git a/backends/platform/symbian/src/portdefs.h b/backends/platform/symbian/src/portdefs.h index e2a918911bb..18adc1ee54b 100644 --- a/backends/platform/symbian/src/portdefs.h +++ b/backends/platform/symbian/src/portdefs.h @@ -37,7 +37,7 @@ #pragma GCC diagnostic ignored "-Wnarrowing" #endif #include -#if !defined(__IGNORE__E32STD_H__) // TKey type from system header +#if !defined(__IGNORE__E32STD_H__) // TKey type from system header #include // doesn't meets with lua ones. #endif #if (__GNUC__ && __cplusplus) @@ -178,7 +178,7 @@ namespace std ((sizeof (x) == sizeof (float)) ? __signbitf(x) \ : (sizeof (x) == sizeof (double)) ? __signbit(x) \ : __signbitl(x)) -#endif +#endif // Functions from openlibm not declared in Symbian math.h extern "C"{ diff --git a/backends/platform/symbian/symbian_builder/common_names.py b/backends/platform/symbian/symbian_builder/common_names.py index 3a86e22f15a..75fb53a7f47 100644 --- a/backends/platform/symbian/symbian_builder/common_names.py +++ b/backends/platform/symbian/symbian_builder/common_names.py @@ -47,7 +47,7 @@ active_config = ("DISABLE_NUKED_OPL", "USE_A52", "USE_MPEG2", "USE_BINK", "USE_ "ENABLE_VKEYBD") #activate USE_SCALERS USE_ARM_SCALER_ASM USE_TTS USE_SPEECH_DISPATCHER USE_CLOUD USE_LIBCURL # USE_SDL_NET USE_DISCORD USE_UPDATES USE_LUA -disabled_config = ("USE_ALSA", "ENABLE_OPL2LPT", "USE_SCALERS", "USE_ARM_SCALER_ASM", +disabled_config = ("USE_ALSA", "ENABLE_OPL2LPT", "USE_SCALERS", "USE_ARM_SCALER_ASM", "USE_HQ_SCALERS", "USE_NASM", "USE_ELF_LOADER", "USE_SDL2", "USE_FLUIDSYNTH", "USE_TTS", "USE_SPEECH_DISPATCHER", "USE_CLOUD", "USE_LIBCURL", "USE_SDL_NET", "USE_OPENGL", "USE_DISCORD", "USE_LINUXCD", "ENABLE_EVENTRECORDER", "USE_UPDATES", "USE_LUA") diff --git a/backends/platform/symbian/symbian_builder/mmp_gen.py b/backends/platform/symbian/symbian_builder/mmp_gen.py index 13643cf8986..d22d5bafdaa 100644 --- a/backends/platform/symbian/symbian_builder/mmp_gen.py +++ b/backends/platform/symbian/symbian_builder/mmp_gen.py @@ -321,7 +321,7 @@ def check_cashed(): macros = os.path.join(local, "macros.mmh") engines = os.path.join(local, "engines.mmh") engines_new = os.path.join(local, "engines.mmh.new") - + macros_dump = data_dump(macros) macros_dump_new = data_dump(macros_new) macros_diff = set(macros_dump).symmetric_difference(set(macros_dump_new)) @@ -330,12 +330,12 @@ def check_cashed(): SafeWriteFile(build_log, 'a', "new macro found: ") SafeWriteFile(build_log, 'a', list(macros_diff)) SafeWriteFile(macros, 'a', list(macros_diff)) - + engines_dump = data_dump(engines) engines_dump_new = data_dump(engines_new) engines_diff = set(engines_dump).symmetric_difference(set(engines_dump_new)) SafeWriteFile(engines, 'a', list(engines_diff)) - + os.chmod(macros, stat.S_IREAD) os.chmod(engines, stat.S_IREAD) @@ -365,7 +365,7 @@ def create_engine_mmps(arg = 'full'): except: macros = os.path.join(local, "macros.mmh") engines = os.path.join(local, "engines.mmh") - + macros_new = os.path.join(local, "macros.mmh.new") engines_new = os.path.join(local, "engines.mmh.new") SafeWriteFile(macros_new, 'w', ro_warning) diff --git a/backends/platform/symbian/symbian_builder/prj_generator.py b/backends/platform/symbian/symbian_builder/prj_generator.py index 1a63e9d4723..732110054d2 100644 --- a/backends/platform/symbian/symbian_builder/prj_generator.py +++ b/backends/platform/symbian/symbian_builder/prj_generator.py @@ -143,7 +143,7 @@ TARGET ScummVM%s.exe TARGETPATH sys\\bin TARGETTYPE exe OPTION GCCE -Wno-multichar -Wno-reorder -Wno-unused -Wno-format -fsigned-char \ - -fno-asynchronous-unwind-tables -std=c++11 // -ffreestanding -fno-sized-deallocation //--verbose //-flto -fuse-linker-plugin //-Wl, -v -fbuiltin + -fno-asynchronous-unwind-tables -std=c++11 // -ffreestanding -fno-sized-deallocation //--verbose //-flto -fuse-linker-plugin //-Wl, -v -fbuiltin // fixes error "section .data loaded at [...] overlaps section .text loaded at [...]" LINKEROPTION GCCE -Tdata 0xAA00000 // -v -flto -fuse-linker-plugin //--print-gc-sections --stats --gc-sections --strip-all// removes unused code @@ -198,7 +198,7 @@ def SafeWriteFile(path, data, mode = 'w'): f.write(s + '\n') else: f.write(data) - + def create_mmps(build, path = ''): uids = get_UIDs(build) bld_inf = os.path.join(path, "bld.inf") diff --git a/backends/plugins/psp/plugin.ld b/backends/plugins/psp/plugin.ld index a4456d199d5..a3c8acbeec4 100644 --- a/backends/plugins/psp/plugin.ld +++ b/backends/plugins/psp/plugin.ld @@ -209,7 +209,7 @@ SECTIONS .debug_varnames 0 : { *(.debug_varnames) } /DISCARD/ : { *(.comment) *(.pdr) } /DISCARD/ : { *(.note.GNU-stack) } - + . = __plugin_hole_start; .got : { *(.got.plt) *(.got) } : shorts /* We want the small data sections together, so single-instruction offsets diff --git a/backends/plugins/wii/plugin.ld b/backends/plugins/wii/plugin.ld index b64fef7f819..2d0bf992116 100644 --- a/backends/plugins/wii/plugin.ld +++ b/backends/plugins/wii/plugin.ld @@ -92,7 +92,7 @@ SECTIONS KEEP (*(.fini)) . = ALIGN(32); /* REQUIRED. LD is flaky without it. */ } = 0 - + PROVIDE (__etext = .); PROVIDE (_etext = .); PROVIDE (etext = .); @@ -179,7 +179,7 @@ SECTIONS _edata = .; PROVIDE (edata = .); - + .sbss : { __sbss_start = .; diff --git a/backends/text-to-speech/windows/windows-text-to-speech.cpp b/backends/text-to-speech/windows/windows-text-to-speech.cpp index 5018db4bf5e..b5a1963bb0f 100644 --- a/backends/text-to-speech/windows/windows-text-to-speech.cpp +++ b/backends/text-to-speech/windows/windows-text-to-speech.cpp @@ -52,7 +52,7 @@ ISpAudio *_audio; WindowsTextToSpeechManager::WindowsTextToSpeechManager() : _speechState(BROKEN){ - init(); + init(); _threadParams.queue = &_speechQueue; _threadParams.state = &_speechState; _threadParams.mutex = &_speechMutex; diff --git a/common/algorithm.h b/common/algorithm.h index d3cf7d5e1d6..2cec6555a68 100644 --- a/common/algorithm.h +++ b/common/algorithm.h @@ -41,11 +41,11 @@ namespace Common { /** * @name Copy templates * @{ - */ + */ /** * Copy data from the range [first, last) to [dst, dst + (last - first)). - * + * * The function requires the range [dst, dst + (last - first)) to be valid. * It also requires dst not to be in the range [first, last). */ @@ -58,7 +58,7 @@ Out copy(In first, In last, Out dst) { /** * Copy data from the range [first, last) to [dst - (last - first), dst). - * + * * The function requires the range [dst - (last - first), dst) to be valid. * It also requires dst not to be in the range [first, last). * @@ -93,21 +93,21 @@ Out copy_if(In first, In last, Out dst, Op op) { /** * @} - */ + */ /** * @name Fill templates * @{ - */ + */ /** * A 'fill' template for signed char arrays. * - * Since C++ does not currently support partial specialized template functions, + * Since C++ does not currently support partial specialized template functions, * this solution is implemented. * With this template, the usage of memset is assured, which is * faster than a simple loop like for the generic 'fill'. - */ + */ template signed char *fill(signed char *first, signed char *last, Value val) { memset(first, (val & 0xFF), last - first); @@ -117,11 +117,11 @@ signed char *fill(signed char *first, signed char *last, Value val) { /** * A 'fill' template for unsigned char arrays. * - * Since C++ does not currently support partial specialized template functions, + * Since C++ does not currently support partial specialized template functions, * this solution is implemented. * With this template, the usage of memset is assured, which is * faster than a simple loop like for the generic 'fill'. - */ + */ template unsigned char *fill(unsigned char *first, unsigned char *last, Value val) { memset(first, (val & 0xFF), last - first); @@ -131,11 +131,11 @@ unsigned char *fill(unsigned char *first, unsigned char *last, Value val) { /** * A 'fill' template for char arrays. * - * Since C++ does not currently support partial specialized template functions, + * Since C++ does not currently support partial specialized template functions, * this solution is implemented. * With this template, the usage of memset is assured, which is * faster than a simple loop like for the generic 'fill'. - */ + */ template char *fill(char *first, char *last, Value val) { memset(first, (val & 0xFF), last - first); @@ -149,7 +149,7 @@ char *fill(char *first, char *last, Value val) { /** * @name Range templates * @{ - */ + */ /** * Set all elements in the range [first, last) to val. @@ -202,7 +202,7 @@ Op for_each(In first, In last, Op f) { /** * @} - */ + */ template unsigned int distance(T *first, T *last) { @@ -256,7 +256,7 @@ T sortPartition(T first, T last, T pivot, StrictWeakOrdering &comp) { /** * @name Sorting templates * @{ - */ + */ /** * Simple sorting function, modeled after std::sort. diff --git a/common/archive.h b/common/archive.h index 5e4794fc101..4bf01b73dff 100644 --- a/common/archive.h +++ b/common/archive.h @@ -35,7 +35,7 @@ namespace Common { * @ingroup common * * @brief The Archive module allows for managing the members of arbitrary containers in a uniform - * fashion. + * fashion. * It also supports looking up by names and file names, opening a file, and returning a usable input stream. * @{ */ diff --git a/common/base-str.cpp b/common/base-str.cpp index 0073c110538..f9b98734107 100644 --- a/common/base-str.cpp +++ b/common/base-str.cpp @@ -489,7 +489,7 @@ TEMPLATE void BASESTRING::clear() { _storage[0] = 0; } - + TEMPLATE void BASESTRING::setChar(value_type c, uint32 p) { assert(p < _size); @@ -610,7 +610,7 @@ TEMPLATE uint64 BASESTRING::asUint64Ext() const { uint64 result = 0; uint64 base = 10; uint32 skip = 0; - + if (_size >= 3 && _str[0] == '0' && _str[1] == 'x') { base = 16; skip = 2; diff --git a/common/cosinetables.cpp b/common/cosinetables.cpp index 92b1723c89a..b6cb8dd05f3 100644 --- a/common/cosinetables.cpp +++ b/common/cosinetables.cpp @@ -46,7 +46,7 @@ CosineTable::CosineTable(int nPoints) { _tableEOS[i] = cos(i * _radResolution); for (int i = 1; i < _nPoints / 4; i++) - _tableEOS[_nPoints / 2 - i] = _tableEOS[i]; + _tableEOS[_nPoints / 2 - i] = _tableEOS[i]; } float CosineTable::at(int index) const { diff --git a/common/dcl.h b/common/dcl.h index 31da9da9485..6debb1dc4f8 100644 --- a/common/dcl.h +++ b/common/dcl.h @@ -55,7 +55,7 @@ bool decompressDCL(ReadStream *sourceStream, byte *dest, uint32 packedSize, uint * @overload * * Decompress a PKWARE DCL compressed stream. - * + * * @return Returns a valid pointer if successful or 0 otherwise. */ SeekableReadStream *decompressDCL(SeekableReadStream *sourceStream, uint32 packedSize, uint32 unpackedSize); @@ -64,10 +64,10 @@ SeekableReadStream *decompressDCL(SeekableReadStream *sourceStream, uint32 packe * @overload * * Decompress a PKWARE DCL compressed stream. - * + * * This method is meant for cases, where the unpacked size is not known. * - * @return Returns a valid pointer if successful or 0 otherwise. + * @return Returns a valid pointer if successful or 0 otherwise. */ SeekableReadStream *decompressDCL(SeekableReadStream *sourceStream); diff --git a/common/debug.h b/common/debug.h index a0f0d7f4674..17ac5a743d4 100644 --- a/common/debug.h +++ b/common/debug.h @@ -99,7 +99,7 @@ void debugC(int level, uint32 debugChannels, const char *s, ...) GCC_PRINTF(3, 4 * @param level Debug level that must be active for the message to be printed. * @param debugChannels Bitfield of channels to check against. * @param s Message to print. - * + * */ void debugCN(int level, uint32 debugChannels, const char *s, ...) GCC_PRINTF(3, 4); diff --git a/common/endian.h b/common/endian.h index dfddd2d0d89..260f24e1ee5 100644 --- a/common/endian.h +++ b/common/endian.h @@ -32,7 +32,7 @@ * * @brief Functions and macros for endian conversions and byteswap conversions. * - * @details + * @details * - SWAP_BYTES_??(a) - Reverse byte order * - SWAP_CONSTANT_??(a) - Reverse byte order, implemented as a macro. * Use with compile-time constants only, the result will be a compile-time constant as well. @@ -393,7 +393,7 @@ /** @name Map functions for reading/writing BE/LE integers depending on native endianess * @{ */ - + #if defined(SCUMM_LITTLE_ENDIAN) #define READ_LE_UINT16(a) READ_UINT16(a) diff --git a/common/hashmap.h b/common/hashmap.h index e565558df3e..d411e07cc8c 100644 --- a/common/hashmap.h +++ b/common/hashmap.h @@ -29,7 +29,7 @@ // Enable the following #define if you want to check how many collisions the // code produces (many collisions indicate either a bad hash function, or a // hash table that is too small). - + //#define DEBUG_HASH_COLLISIONS /** diff --git a/common/huffman.h b/common/huffman.h index 5462807115e..2f98e5eec40 100644 --- a/common/huffman.h +++ b/common/huffman.h @@ -36,10 +36,10 @@ namespace Common { * @ingroup common * * @brief API for operations related to Huffman bit stream decoding. - * + * * @details Used in engines: * - SCUMM - * + * * @{ */ diff --git a/common/iff_container.h b/common/iff_container.h index 83bb62ac742..e15c018a101 100644 --- a/common/iff_container.h +++ b/common/iff_container.h @@ -37,7 +37,7 @@ namespace Common { * * @brief API for operations on IFF container files. * - * + * * @{ */ diff --git a/common/ini-file.h b/common/ini-file.h index 74665fb0fd5..c652e07c9e1 100644 --- a/common/ini-file.h +++ b/common/ini-file.h @@ -35,7 +35,7 @@ namespace Common { * * @brief API for operations on INI configuration files. * - * + * * @{ */ diff --git a/common/installshield_cab.h b/common/installshield_cab.h index af2699a70b4..8cdba32ca06 100644 --- a/common/installshield_cab.h +++ b/common/installshield_cab.h @@ -33,7 +33,7 @@ namespace Common { * * @brief API for managing the InstallShield. * - * + * * @{ */ diff --git a/common/keyboard.h b/common/keyboard.h index 4947ceced70..09526fbf7a1 100644 --- a/common/keyboard.h +++ b/common/keyboard.h @@ -42,7 +42,7 @@ namespace Common { * * @brief API for keyboard operations. * - * + * * @{ */ diff --git a/common/language.h b/common/language.h index e787fe79f12..75349a64833 100644 --- a/common/language.h +++ b/common/language.h @@ -33,7 +33,7 @@ namespace Common { * * @brief API for managing game language. * - * + * * @{ */ diff --git a/common/localization.h b/common/localization.h index f5c63a2db71..e3723277916 100644 --- a/common/localization.h +++ b/common/localization.h @@ -34,7 +34,7 @@ namespace Common { * * @brief Functions for managing localized elements of the GUI. * - * + * * @{ */ diff --git a/common/ptr.h b/common/ptr.h index 1357604d95a..84552f7f67c 100644 --- a/common/ptr.h +++ b/common/ptr.h @@ -255,7 +255,7 @@ class WeakPtr; * as for a normal pointer. If you need to access the plain pointer value * itself later on use the get method. The class also supplies a operator * ->, which does the same as the -> operator on a normal pointer. - * + * * Be sure you are using new to initialize the pointer you want to manage. * If you do not use new for allocating, you have to supply a deleter as * second parameter when creating a SharedPtr object. The deleter has to diff --git a/common/rect.h b/common/rect.h index 020a9cbe90d..96437d752f2 100644 --- a/common/rect.h +++ b/common/rect.h @@ -48,7 +48,7 @@ struct Point { int16 y; /*!< The vertical position of the point. */ Point() : x(0), y(0) {} - + /** * Create a point with position defined by @p x1 and @p y1. */ @@ -154,7 +154,7 @@ struct Rect { /** * Create a rectangle with the top-left corner at the given position (x1, y1) * and the bottom-right corner at the position (x2, y2). - * + * * The @p x2 value must be greater or equal @p x1 and @p y2 must be greater or equal @p y1. */ Rect(int16 x1, int16 y1, int16 x2, int16 y2) : top(y1), left(x1), bottom(y2), right(x2) { @@ -324,7 +324,7 @@ struct Rect { } /** - * Move this rectangle to the position defined by @p x, @p y. + * Move this rectangle to the position defined by @p x, @p y. */ void moveTo(int16 x, int16 y) { bottom += y - top; @@ -342,14 +342,14 @@ struct Rect { } /** - * Move this rectangle to the position of the point @p p. + * Move this rectangle to the position of the point @p p. */ void moveTo(const Point &p) { moveTo(p.x, p.y); } /** - * Print debug messages related to this class. + * Print debug messages related to this class. */ void debugPrint(int debuglevel = 0, const char *caption = "Rect:") const { debug(debuglevel, "%s %d, %d, %d, %d", caption, left, top, right, bottom); diff --git a/common/savefile.h b/common/savefile.h index c674306c7de..69279717514 100644 --- a/common/savefile.h +++ b/common/savefile.h @@ -66,12 +66,12 @@ public: * you must call clearErr() explicitly. */ virtual bool err() const; - + /** * Reset the I/O error status as returned by err(). */ virtual void clearErr(); - + /** * Finalize and close this stream. To be called right before this * stream instance is deleted. The goal here is to enable calling @@ -185,7 +185,7 @@ public: * * @param name Name of the save file. * @param compress Whether to compress the resulting save file (default) or not. - * + * * @return Pointer to an OutSaveFile, or NULL if an error occurred. */ virtual OutSaveFile *openForSaving(const String &name, bool compress = true) = 0; @@ -221,7 +221,7 @@ public: * @param oldName Old name. * @param newName New name. * @param compress Whether to compress the resulting save file (default) or not. - * + * * @return True if no error occurred, false otherwise. */ virtual bool renameSavefile(const String &oldName, const String &newName, bool compress = true); @@ -232,7 +232,7 @@ public: * @param oldName Old name. * @param newName New name. * @param compress Whether to compress the resulting save file (default) or not. - * + * * @return true if no error occurred. false otherwise. */ virtual bool copySavefile(const String &oldName, const String &newName, bool compress = true); diff --git a/common/sinetables.cpp b/common/sinetables.cpp index 4c0ee626e35..303b9089991 100644 --- a/common/sinetables.cpp +++ b/common/sinetables.cpp @@ -54,14 +54,14 @@ float SineTable::at(int index) const { return _table[index]; } -float SineTable::atLegacy(int index) const { +float SineTable::atLegacy(int index) const { assert((index >= 0) && (index < _nPoints)); if (index < _refSize) // [0,pi/2) return _tableEOS[index]; if (index == _refSize) // pi/2 - return 1.0f; // sin(pi/2) = 1.0 + return 1.0f; // sin(pi/2) = 1.0 if ((index > _refSize) && (index < 2 * _refSize)) // (pi/2,pi) return _tableEOS[2 * _refSize - index]; diff --git a/common/sinetables.h b/common/sinetables.h index 321983ec0fc..a7076b5b492 100644 --- a/common/sinetables.h +++ b/common/sinetables.h @@ -68,7 +68,7 @@ public: * Returns sin(2*pi * index / nPoints ) * Index must be in range [0, nPoints - 1] */ - float atLegacy(int index) const; + float atLegacy(int index) const; private: float *_tableEOS; diff --git a/common/str-enc.cpp b/common/str-enc.cpp index f78ee39c993..c990529e492 100644 --- a/common/str-enc.cpp +++ b/common/str-enc.cpp @@ -797,7 +797,7 @@ void U32String::decodeOneByte(const char *src, uint32 len, CodePage page) { } void String::encodeOneByte(const U32String &src, CodePage page, bool transliterate) { - const ReverseTablePrefixTreeLevel1 *conversionTable = + const ReverseTablePrefixTreeLevel1 *conversionTable = getReverseConversionTable(page); ensureCapacity(src.size(), false); @@ -848,7 +848,7 @@ void String::encodeInternal(const U32String &src, CodePage page) { break; case kWindows932: encodeWindows932(src); - break; + break; case kWindows949: encodeWindows949(src); break; diff --git a/common/stream.h b/common/stream.h index 1e13d690d95..8b92a94a5a0 100644 --- a/common/stream.h +++ b/common/stream.h @@ -102,11 +102,11 @@ public: virtual bool flush() { return true; } /** - * Finalize and close this stream. + * Finalize and close this stream. * * Call this method right before this stream instance is deleted. * The goal is to enable the client code to detect - * and handle I/O errors that might occur when closing + * and handle I/O errors that might occur when closing * (and flushing, if buffered) the stream. * * After this method has been called, no further writes can be @@ -132,7 +132,7 @@ public: * Subclasses need not (and should not) overload them. * @{ */ - + /** * Write the given byte to the current position in the stream. */ @@ -240,7 +240,7 @@ public: /** * Write a 32-bit floating point value - * stored in big endian order into the stream. + * stored in big endian order into the stream. */ FORCEINLINE void writeFloatBE(float value) { uint32 n; @@ -264,7 +264,7 @@ public: /** - * Write the given 64-bit floating point value (with decimals) + * Write the given 64-bit floating point value (with decimals) * stored in big endian order into the stream. */ FORCEINLINE void writeDoubleBE(double value) { @@ -304,7 +304,7 @@ public: class SeekableWriteStream : public WriteStream { public: /** - * Set the stream position indicator for the stream. + * Set the stream position indicator for the stream. * * The new position, measured in bytes, is obtained by adding offset bytes * to the position specified by whence. If whence is set to SEEK_SET, SEEK_CUR, @@ -700,7 +700,7 @@ public: /** * Skip the given number of bytes in the stream. - * + * * This is equivalent to calling: * @code * seek(offset, SEEK_CUR) diff --git a/common/ustr.h b/common/ustr.h index 83559f5adcb..82906df3020 100644 --- a/common/ustr.h +++ b/common/ustr.h @@ -37,7 +37,7 @@ namespace Common { * * @{ */ - + class String; /** @@ -190,7 +190,7 @@ private: void decodeWindows949(const char *src, uint32 len); void decodeWindows950(const char *src, uint32 len); void decodeUTF8(const char *str, uint32 len); - + friend class String; }; diff --git a/common/util.h b/common/util.h index 0f634464c0f..9250192d326 100644 --- a/common/util.h +++ b/common/util.h @@ -307,7 +307,7 @@ bool isBlank(int c); /** * Represent the size of a file in bytes as a number with floating point and * largest suitable units. For example, 1474560 bytes as 1.4 MB. - * + * * @param[in] bytes Size in bytes to be represented. * @param[out] unitsOut String with units. * diff --git a/common/xmlparser.h b/common/xmlparser.h index f555e64cead..58b7bf40e88 100644 --- a/common/xmlparser.h +++ b/common/xmlparser.h @@ -41,7 +41,7 @@ namespace Common { * @ingroup common * * @brief The XML parser allows for parsing XML-like files. - * + * * @{ */ diff --git a/common/zlib.h b/common/zlib.h index 839c23ba173..2782f31e94c 100644 --- a/common/zlib.h +++ b/common/zlib.h @@ -32,7 +32,7 @@ namespace Common { * @ingroup common * * @brief API for zlib operations. - * + * * @{ */ diff --git a/devtools/README b/devtools/README index a6006cd4aec..e4920acd746 100644 --- a/devtools/README +++ b/devtools/README @@ -98,9 +98,9 @@ create_supernova (criezy) create_toon (Strangerke) ----------- - This tool creates toon.dat, which contains all the game's texts + This tool creates toon.dat, which contains all the game's texts hardcoded in original game executable. This includes English, French, - German, Russian and Spanish texts. + German, Russian and Spanish texts. create_translations (criezy) diff --git a/devtools/create_bladerunner/subtitles/README.md b/devtools/create_bladerunner/subtitles/README.md index 384fd1b7439..ee1578e468a 100644 --- a/devtools/create_bladerunner/subtitles/README.md +++ b/devtools/create_bladerunner/subtitles/README.md @@ -59,7 +59,7 @@ You need to follow these instructions: 3. Create an overrideEncodingSUBLTS.txt file in the sampleInput folder. This is a configuration file for the font file creation. A sample is provided in the sampleInput folder and documentation about this is below in this document (see "override encoding text file" in fontCreator). -4. Create a configureFontsTranslation.txt in the sampleInput folder. A configuration file for the MIX file creation. A sample is provided in the sampleInput folder and documentation about this is below in this document (see "text configuration file" in mixResourceCreator). +4. Create a configureFontsTranslation.txt in the sampleInput folder. A configuration file for the MIX file creation. A sample is provided in the sampleInput folder and documentation about this is below in this document (see "text configuration file" in mixResourceCreator). 5. From the ScummVM root folder run: ```bash @@ -93,7 +93,7 @@ Syntax Notes: 3. The "-ian" optional switch is followed by the path to the actornames.txt file -- if this is omitted then the file is assumed to reside in the current working directory. 4. The "-ld" optional switch is followed by a language description for the language of the game you are exporting Text Resources from. This switch is meaningful when you also use the "-xtre" switch to export Text Resource files. - * Valid language values are: EN\_ANY, DE\_DEU, FR\_FRA, IT\_ITA, ES\_ESP, RU\_RUS + * Valid language values are: EN\_ANY, DE\_DEU, FR\_FRA, IT\_ITA, ES\_ESP, RU\_RUS * Default language value is: EN\_ANY (English) @@ -107,7 +107,7 @@ Syntax Notes: 9. You may use all, a subset or none of the "-xwav", "-xtre", "-xpogo", "-xdevs" switches, depending on what you need to do. -10. The "--trace" optional switch enables extra debug messages to be printed. +10. The "--trace" optional switch enables extra debug messages to be printed. Usage: ```bash @@ -128,7 +128,7 @@ python2.7 mixResourceCreator.py -x excelWithTranscriptSheets.xlsx [-ian pathToAc The tool __requires__ a valid path to the actornames.txt file, which is included in the samples folder. -Syntax Notes: +Syntax Notes: 1. The "-x" switch is followed by the path to the input Excel file (xls or xlsx) which should contain the transcript sheet(s). @@ -141,7 +141,7 @@ Syntax Notes: * Default language value is: EN\_ANY (English) -5. The "--trace" optional switch enables extra debug messages to be printed. +5. The "--trace" optional switch enables extra debug messages to be printed. The __text configuration file "configureFontsTranslation.txt"__ is a __text file that should be saved in a UTF-8 encoding (no BOM)__, that contains the following: @@ -157,7 +157,7 @@ The __text configuration file "configureFontsTranslation.txt"__ is a __text file * a list of comma separated tuples that specify the mapping of special (out of order) character to placeholder characters from the selected codepage. See fontCreator section for more details on this. - * For example: + * For example: ```text fontNameAndOutOfOrderGlyphs=SUBTLS_E#windows-1253#í:Ά,ñ:Â¥,â:¦,é:§,Ά:£ fontNameAndOutOfOrderGlyphs=KIA6PT#cp437# @@ -165,9 +165,9 @@ The __text configuration file "configureFontsTranslation.txt"__ is a __text file fontNameAndOutOfOrderGlyphs=SYSTEM#latin-1# ``` -Note: for font files (FON) that you have created or edited with the fontCreator tool (e.g for the "SUBTLS\_E.FON" file for subtitles, or another in-game font file eg. KIA6PT, TAHOMA) you __should copy the 8-bit encoding and the comma separated out of order character tuples from the respective "override encoding" text file that you used with the fontCreator tool for each new/ edited font in the configureFontsTranslation.txt fields__. +Note: for font files (FON) that you have created or edited with the fontCreator tool (e.g for the "SUBTLS\_E.FON" file for subtitles, or another in-game font file eg. KIA6PT, TAHOMA) you __should copy the 8-bit encoding and the comma separated out of order character tuples from the respective "override encoding" text file that you used with the fontCreator tool for each new/ edited font in the configureFontsTranslation.txt fields__. -Additionally, __all the new and edited fonts (FON files that were output by the fontCreator script) should be in your working directory__ in order to include them in the SUBTITLES.MIX. +Additionally, __all the new and edited fonts (FON files that were output by the fontCreator script) should be in your working directory__ in order to include them in the SUBTITLES.MIX. It's important to keep the naming of those files unchanged. __Supported name values for imported FON files__ are: SUBTLS\_E.FON, KIA6PT.FON, TAHOMA18.FON, TAHOMA24.FON and SYSTEM.FON (practically you won't be using the last one). @@ -205,7 +205,7 @@ The override encoding file is a __text file that should be saved in a UTF-8 enco * You don't need to use all the characters of the specified codepage in your "all-characters" string. - * For any special characters that don't appear in the target codepage (eg ñ, é, í, â don't appear in the Greek codepage), you'll have to decide on an ASCII value for them (one not used by another character appearing in-game). + * For any special characters that don't appear in the target codepage (eg ñ, é, í, â don't appear in the Greek codepage), you'll have to decide on an ASCII value for them (one not used by another character appearing in-game). * In the "all-characters" string you should put as placeholders the actual characters from the specified codepage that correspond to the ASCII values you have decided above; The placeholder characters should also be in the proper order (by their ASCII value) inside the string. @@ -220,7 +220,7 @@ The override encoding file is a __text file that should be saved in a UTF-8 enco * Don't use space(s) between the tuples! 5. A key "originalFontName" with the FON file's original name in the game (the one that it should replace). Use SUBLTS for the subtitles FON. - * Example: originalFontName=SUBLTS + * Example: originalFontName=SUBLTS 6. A key "specialOutOfOrderGlyphsUTF8ToAsciiTargetEncoding" with value a list of comma separated tuples that indicates which character glyphs should replace the placeholder glyphs in your all-character string above. * Example: specialOutOfOrderGlyphsUTF8ToAsciiTargetEncoding=í:Ά,ñ:Â¥,â:¦,é:§,Ά:£ @@ -258,12 +258,12 @@ __For the creation of subtitles' font mode__, there are six (6) mandatory launch 6. whiteSpaceWidthInPixels: This is a positive integer value that sets the width in pixels for the single white space between words for the subtitles in-game. -The "--trace" optional switch enables extra debug messages to be printed. +The "--trace" optional switch enables extra debug messages to be printed. A suggested method of creating decent looking PNG with the row of glyphs for your subtitles' font is the following: 1. Create the font row in __GIMP__ - * Start with a __new__ empty image, with transparent background. Choose a large enough canvas width (you can adjust it later) + * Start with a __new__ empty image, with transparent background. Choose a large enough canvas width (you can adjust it later) * Paste as a new layer a tab separated alphanumeric sequence with all your glyphs (as specified above). Choose white as the font's color. @@ -281,9 +281,9 @@ A suggested method of creating decent looking PNG with the row of glyphs for you 6. Finally, place this completely black colored layer underneath the other one and __merge the visible__ layers. -7. Export your image to a PNG file. +7. Export your image to a PNG file. -This should get rid of semi-transparent pixels while maintaining the "aliasing" effect. +This should get rid of semi-transparent pixels while maintaining the "aliasing" effect. There could be a better way but this should work ok. ## Credits and Special Thanks diff --git a/devtools/create_bladerunner/subtitles/common/subtlsVersTextResource.py b/devtools/create_bladerunner/subtitles/common/subtlsVersTextResource.py index 1df1c41ae3c..e6d54bb9109 100644 --- a/devtools/create_bladerunner/subtitles/common/subtlsVersTextResource.py +++ b/devtools/create_bladerunner/subtitles/common/subtlsVersTextResource.py @@ -21,12 +21,12 @@ class sbtlVersTextResource: def __init__(self, traceModeEnabled = True): self.m_traceModeEnabled = traceModeEnabled return - + def printSbtlVersTemplate(self): for (idTre, textTre) in SBTLVERS_TEXT_RESOURCE_TUPLE_LIST: print "%s\t%s" % (idTre, textTre) return - + def getSbtlVersEntriesList(self): return SBTLVERS_TEXT_RESOURCE_TUPLE_LIST @@ -36,9 +36,8 @@ if __name__ == '__main__': traceModeEnabled = False sbtlVersTRInstance = sbtlVersTextResource(traceModeEnabled) sbtlVersTRInstance.printSbtlVersTemplate() - + else: #debug #print "[Debug] Running %s imported from another module" % (my_module_name) pass - \ No newline at end of file diff --git a/devtools/create_bladerunner/subtitles/common/vqasTextResource.py b/devtools/create_bladerunner/subtitles/common/vqasTextResource.py index e2f93f2ad27..78b77326334 100644 --- a/devtools/create_bladerunner/subtitles/common/vqasTextResource.py +++ b/devtools/create_bladerunner/subtitles/common/vqasTextResource.py @@ -468,7 +468,7 @@ class vqasTextResource(object): def __init__(self, traceModeEnabled = True): self.m_traceModeEnabled = traceModeEnabled return - + def printAllVqasTextResource(self): if self.m_traceModeEnabled: print "[Trace] printing all VQAs Text" @@ -477,7 +477,7 @@ class vqasTextResource(object): for (startFrameTre, endFrameTre, textTre, timeStartTre, timeEndTre, byActorTre) in vqaTreList: print "%s\t%s\t%s\t%s\t%s\t%s" % (startFrameTre, endFrameTre, textTre, timeStartTre, timeEndTre, byActorTre) return - + def getVqaEntriesList(self, sVQASheetPrefix): if self.m_traceModeEnabled: print "[Trace] getVqaEntriesList()" @@ -498,4 +498,3 @@ else: #debug #print "[Debug] Running %s imported from another module" % (my_module_name) pass - \ No newline at end of file diff --git a/devtools/create_bladerunner/subtitles/fontCreator/fonFileLib.py b/devtools/create_bladerunner/subtitles/fontCreator/fonFileLib.py index 9e3c7472a4f..a4307b25990 100644 --- a/devtools/create_bladerunner/subtitles/fontCreator/fonFileLib.py +++ b/devtools/create_bladerunner/subtitles/fontCreator/fonFileLib.py @@ -13,7 +13,7 @@ except ImportError: print "[Error] os python library is required to be installed!" else: osLibFound = True - + try: import sys except ImportError: @@ -27,7 +27,7 @@ except ImportError: print "[Error] struct python library is required to be installed!" else: structLibFound = True - + try: from PIL import Image except ImportError: @@ -52,23 +52,23 @@ class FonHeader(object): maxGlyphWidth = -1 # in pixels maxGlyphHeight = -1 # in pixels graphicSegmentByteSize = -1 # Graphic segment byte size - + def __init__(self): return class fonFile(object): m_header = FonHeader() - + simpleFontFileName = 'GENERIC.FON' realNumOfCharactersInImageSegment = 0 # this is used for the workaround for the corrupted TAHOME18.FON nonEmptyCharacters = 0 - + glyphDetailEntriesLst = [] # list of 5-value tuples. Tuple values are (X-offset, Y-offset, Width, Height, Offset in Graphics segment) glyphPixelData = None # buffer of pixel data for glyphs - + m_traceModeEnabled = False - + # traceModeEnabled is bool to enable more printed debug messages def __init__(self, traceModeEnabled = True): del self.glyphDetailEntriesLst[:] @@ -77,12 +77,12 @@ class fonFile(object): self.realNumOfCharactersInImageSegment = 0 # this is used for the workaround for the corrupted TAHOME18.FON self.nonEmptyCharacters = 0 self.m_traceModeEnabled = traceModeEnabled - + return - + def loadFonFile(self, fonBytesBuff, maxLength, fonFileName): self.simpleFontFileName = fonFileName - + offsInFonFile = 0 localLstOfDataOffsets = [] del localLstOfDataOffsets[:] @@ -93,26 +93,26 @@ class fonFile(object): tmpTuple = struct.unpack_from('I', fonBytesBuff, offsInFonFile) # unsigned integer 4 bytes self.header().maxEntriesInTableOfDetails = tmpTuple[0] offsInFonFile += 4 - + if self.simpleFontFileName == 'TAHOMA18.FON': # deal with corrupted original 'TAHOMA18.FON' file self.realNumOfCharactersInImageSegment = 176 if self.m_traceModeEnabled: print "[Debug] SPECIAL CASE. WORKAROUND FOR CORRUPTED %s FILE. Only %d characters supported!" % (self.simpleFontFileName, self.realNumOfCharactersInImageSegment) else: self.realNumOfCharactersInImageSegment = self.header().maxEntriesInTableOfDetails - + tmpTuple = struct.unpack_from('I', fonBytesBuff, offsInFonFile) # unsigned integer 4 bytes self.header().maxGlyphWidth = tmpTuple[0] offsInFonFile += 4 - + tmpTuple = struct.unpack_from('I', fonBytesBuff, offsInFonFile) # unsigned integer 4 bytes self.header().maxGlyphHeight = tmpTuple[0] offsInFonFile += 4 - + tmpTuple = struct.unpack_from('I', fonBytesBuff, offsInFonFile) # unsigned integer 4 bytes self.header().graphicSegmentByteSize = tmpTuple[0] offsInFonFile += 4 - + if self.m_traceModeEnabled: print "[Debug] Font file (FON) Header Info: " print "[Debug] Number of entries: %d, Glyph max-Width: %d, Glyph max-Height: %d, Graphic Segment size: %d" % (self.header().maxEntriesInTableOfDetails, self.header().maxGlyphWidth, self.header().maxGlyphHeight, self.header().graphicSegmentByteSize) @@ -127,23 +127,23 @@ class fonFile(object): tmpTuple = struct.unpack_from('i', fonBytesBuff, offsInFonFile) # unsigned integer 4 bytes tmpXOffset = tmpTuple[0] offsInFonFile += 4 - + tmpTuple = struct.unpack_from('I', fonBytesBuff, offsInFonFile) # unsigned integer 4 bytes tmpYOffset = tmpTuple[0] offsInFonFile += 4 - + tmpTuple = struct.unpack_from('I', fonBytesBuff, offsInFonFile) # unsigned integer 4 bytes tmpWidth = tmpTuple[0] offsInFonFile += 4 - + tmpTuple = struct.unpack_from('I', fonBytesBuff, offsInFonFile) # unsigned integer 4 bytes tmpHeight = tmpTuple[0] offsInFonFile += 4 - + tmpTuple = struct.unpack_from('I', fonBytesBuff, offsInFonFile) # unsigned integer 4 bytes tmpDataOffset = tmpTuple[0] offsInFonFile += 4 - + if tmpWidth == 0 or tmpHeight == 0: if self.m_traceModeEnabled: print "Index: %d\t UNUSED *****************************************************************" % (idx) @@ -157,9 +157,9 @@ class fonFile(object): # This never happens in the original files. Offsets are "re-used" but not really because it happens only for empty (height = 0) characters which all seem to point to the next non-empty character if self.m_traceModeEnabled: print "Index: %d\t RE-USING ANOTHER GLYPH *****************************************************************" % (idx) - + self.glyphDetailEntriesLst.append( ( tmpXOffset, tmpYOffset, tmpWidth, tmpHeight, tmpDataOffset) ) - + offsInFonFile = (4 * 4) + (self.header().maxEntriesInTableOfDetails * 5 * 4) # we need the total self.header().maxEntriesInTableOfDetails here and not self.realNumOfCharactersInImageSegment self.glyphPixelData = fonBytesBuff[offsInFonFile:] return True @@ -167,31 +167,31 @@ class fonFile(object): print "[Error] Loading Font file (FON) %s failed!" % (self.simpleFontFileName) raise return False - + def outputFonToPNG(self): print "[Info] Exporting font file (FON) to PNG: %s" % (self.simpleFontFileName + ".PNG") - + targWidth = 0 targHeight = 0 paddingFromTopY = 2 paddingBetweenGlyphsX = 10 - + if len(self.glyphDetailEntriesLst) == 0 or (len(self.glyphDetailEntriesLst) != self.realNumOfCharactersInImageSegment and len(self.glyphDetailEntriesLst) != self.header().maxEntriesInTableOfDetails) : print "[Error] Font file (FON) loading process did not complete correctly. Missing important data in structures. Cannot output image!" return - + # TODO asdf refine this code here. the dimensions calculation is very crude for now if self.header().maxGlyphWidth > 0 : targWidth = (self.header().maxGlyphWidth + paddingBetweenGlyphsX) * (self.realNumOfCharactersInImageSegment + 1) else: targWidth = 1080 - + # TODO asdf refine this code here. the dimensions calculation is very crude for now if self.header().maxGlyphHeight > 0 : targHeight = self.header().maxGlyphHeight * 2 else: targHeight = 480 - + imTargetGameFont = Image.new("RGBA",(targWidth, targHeight), (0,0,0,0)) #print imTargetGameFont.getbands() # @@ -213,12 +213,12 @@ class fonFile(object): if (glyphWidth == 0 or glyphHeight == 0): drawIdxDeductAmount += 1 drawIdx = idx - drawIdxDeductAmount - + for colorIdx in range(0, glyphWidth*glyphHeight): tmpTuple = struct.unpack_from('H', self.glyphPixelData, glyphDataOffs) # unsigned short 2 bytes pixelColor = tmpTuple[0] glyphDataOffs += 2 - + # if pixelColor > 0x8000: # print "[Debug] WEIRD CASE" # NEVER HAPPENS - TRANSPARENCY IS ON/OFF. There's no grades of transparency rgbacolour = (0,0,0,0) @@ -230,18 +230,18 @@ class fonFile(object): tmp8bitB1 = ( (pixelColor & 0x1f) ) << 3 rgbacolour = (tmp8bitR1,tmp8bitG1,tmp8bitB1, 255) # alpha: 1.0 fully opaque #rgbacolour = (255,255,255, 255) # alpha: 1.0 fully opaque - + if currX == glyphWidth: currX = 0 currY += 1 - + imTargetGameFont.putpixel(( (drawIdx + 1) * (self.header().maxGlyphWidth + paddingBetweenGlyphsX ) + currX, paddingFromTopY + glyphYoffs + currY), rgbacolour) currX += 1 try: imTargetGameFont.save(os.path.join('.', self.simpleFontFileName + ".PNG"), "PNG") except Exception as e: print '[Error] Unable to write to output PNG file. ' + str(e) - + def header(self): return self.m_header # @@ -259,7 +259,7 @@ if __name__ == '__main__': # 'SUBTLS_E.FON' # OUR EXTRA FONT USED FOR SUBTITLES inFONFile = None inFONFileName = 'SUBTLS_E.FON' # Subtitles font custom - + if len(sys.argv[1:]) > 0 \ and os.path.isfile(os.path.join('.', sys.argv[1])) \ and len(sys.argv[1]) >= 5 \ @@ -271,7 +271,7 @@ if __name__ == '__main__': else: print "[Error] No valid input file argument was specified and default input file %s is missing." % (inFONFileName) errorFound = True - + if not errorFound: try: print "[Info] Opening %s" % (inFONFileName) diff --git a/devtools/create_bladerunner/subtitles/fontCreator/grabberFromPNG17BR.py b/devtools/create_bladerunner/subtitles/fontCreator/grabberFromPNG17BR.py index 34035e2ba27..182f41cb412 100644 --- a/devtools/create_bladerunner/subtitles/fontCreator/grabberFromPNG17BR.py +++ b/devtools/create_bladerunner/subtitles/fontCreator/grabberFromPNG17BR.py @@ -74,46 +74,46 @@ imagePilLibFound = False reLibFound = False try: - import os + import os except ImportError: - print "[Error] os python library is required to be installed!" + print "[Error] os python library is required to be installed!" else: osLibFound = True - + try: - import sys + import sys except ImportError: - print "[Error] sys python library is required to be installed!" + print "[Error] sys python library is required to be installed!" else: sysLibFound = True try: - import shutil + import shutil except ImportError: - print "[Error] Shutil python library is required to be installed!" + print "[Error] Shutil python library is required to be installed!" else: shutilLibFound = True try: - import struct + import struct except ImportError: - print "[Error] struct python library is required to be installed!" + print "[Error] struct python library is required to be installed!" else: structLibFound = True - + try: from PIL import Image except ImportError: - print "[Error] Image python library (PIL) is required to be installed!" + print "[Error] Image python library (PIL) is required to be installed!" else: imagePilLibFound = True try: - import re + import re except ImportError: - print "[Error] re (Regular expression operations) python library is required to be installed!" + print "[Error] re (Regular expression operations) python library is required to be installed!" else: - reLibFound = True + reLibFound = True if (not osLibFound) \ or (not sysLibFound) \ @@ -244,7 +244,7 @@ class grabberFromPNG: if linesLst is None or len(linesLst) == 0: overrideFailed = True else: - if gTraceModeEnabled: + if gTraceModeEnabled: print "[Debug] Parsing Override Encoding file info..." involvedTokensLst =[] del involvedTokensLst[:] # unneeded @@ -578,20 +578,20 @@ class grabberFromPNG: # print "[Debug] xOffSet: ", startCol - (self.startOfAllLettersIncludingTheExtraDoubleAndWithKern + (self.lettersFound + 1) * self.tabSpaceWidth) else: self.listOfXOffsets.append(0) - - + + self.listOfBaselines.append(endRow) self.listOfWidths.append(endCol-startCol + 1) # includes the last col (TODO this was without the +1 for MI:SE translator -- possible bug? did we compensate?) self.listOfHeights.append(endRow - startRow + 1) # +1 includes the last row self.listOfLetterBoxes.append((startCol, startRow, endCol, endRow)) - + self.startColOfPrevFontLetter = startCol #update for next pass #delete the letter - even in the case of ignoring the first double letter for x in range(startCol, endCol+1): for y in range(startRow - trimTopPixels, endRow+1 + trimBottomPixels): loadedImag[x, y] = 0, 0, 0, 0 return 0 - else: + else: return -1 # # @@ -743,7 +743,7 @@ class grabberFromPNG: print '[Error] Failed to create target font (FON) file: ' + self.targetFONFilename + '::' + str(e) errorFound = True if not errorFound: - print '[Info] Creating target font (FON) file: ' + self.targetFONFilename + print '[Info] Creating target font (FON) file: ' + self.targetFONFilename # reopen the image with our Fonts because we deleted the letters in the in-mem copy im = None if os.access(self.imageRowFilePNG, os.F_OK) : @@ -1019,11 +1019,11 @@ class grabberFromPNG: if filename.upper() == mixFileName: inputMIXFilesFound.append(mixFileName) break - + if len(inputMIXFilesFound) == 0: print "[Error] No supported game archive resource files (MIX) were found in the specified input path (-ip switch)" sys.exit(1) - + for tmpMIXfileName in inputMIXFilesFound: print "[Info] Found MIX file: %s" % ('"' + tmpMIXfileName + '"') errorFound = False @@ -1063,7 +1063,7 @@ class grabberFromPNG: # if gTraceModeEnabled: print "[Debug] Checking for supported font file (FON) entries in MIX file..." - + for i in range(0, numOfEntriesToExport): foundFONFile = False currFonFileName = 'UNKNOWN.FON' @@ -1213,7 +1213,7 @@ def main(argsCL): elif argsCL[i][:1] == '-': invalidSyntax = True break - + if (exportFonMode == False) and (not TMPTargetFONfilename or not TMPimageRowFilePNG or TMPminSpaceBetweenLettersInRowLeftToLeft <= 0 or TMPminSpaceBetweenLettersInColumnTopToTop <= 0 or TMPkerningForFirstDummyFontLetter <= 0 or TMPSpaceWidthInPixels <= 0) : # this argument is mandatory invalidSyntax = True @@ -1260,7 +1260,7 @@ def main(argsCL): continue print "Argument: %s" % (tmpArg) tmpi+=1 - + # # ######################### diff --git a/devtools/create_bladerunner/subtitles/mixResourceCreator/packBladeRunnerMIXFromPCTLKXLS04.py b/devtools/create_bladerunner/subtitles/mixResourceCreator/packBladeRunnerMIXFromPCTLKXLS04.py index bfc9d61e925..3103c30eef9 100644 --- a/devtools/create_bladerunner/subtitles/mixResourceCreator/packBladeRunnerMIXFromPCTLKXLS04.py +++ b/devtools/create_bladerunner/subtitles/mixResourceCreator/packBladeRunnerMIXFromPCTLKXLS04.py @@ -97,7 +97,7 @@ except ImportError: print "[Error] struct python library is required to be installed!" else: structLibFound = True - + if (not osLibFound) \ @@ -793,7 +793,7 @@ def inputXLS(pathtoInputExcelFilename): if gTraceModeEnabled: print '[Debug] Sheet: %s was not found. Creating a temporary sheet for version info...' % (SUPPORTED_DIALOGUE_VERSION_SHEET) sbtlVersTRInstance = sbtlVersTextResource(gTraceModeEnabled) - bookCopy = copy(xl_workbook) + bookCopy = copy(xl_workbook) xl_sheet = bookCopy.add_sheet(SUPPORTED_DIALOGUE_VERSION_SHEET) n = 0 col1_name = 'Subtitles Version Info' diff --git a/devtools/create_bladerunner/subtitles/module.mk b/devtools/create_bladerunner/subtitles/module.mk index f978bd78287..28c65826590 100644 --- a/devtools/create_bladerunner/subtitles/module.mk +++ b/devtools/create_bladerunner/subtitles/module.mk @@ -14,7 +14,7 @@ INPUT_TRANSCRIPT_FILEPATH := $(BLADERUNNER_SUBTITLES_SAMPLE_INPUT_FOLDER)/$(INPU ifeq (,$(wildcard $(INPUT_TRANSCRIPT_FILEPATH))) INPUT_TRANSCRIPT_FILENAME := englishTranscript.xlsx -INPUT_TRANSCRIPT_FILEPATH := $(BLADERUNNER_SUBTITLES_SAMPLE_INPUT_FOLDER)/$(INPUT_TRANSCRIPT_FILENAME) +INPUT_TRANSCRIPT_FILEPATH := $(BLADERUNNER_SUBTITLES_SAMPLE_INPUT_FOLDER)/$(INPUT_TRANSCRIPT_FILENAME) endif INPUT_TRANSCRIPT_AUX_CONF_FILENAME := configureFontsTranslation.txt @@ -38,7 +38,7 @@ $(FONT_OUTPUT): $(BLADERUNNER_SUBTITLES_SAMPLE_INPUT_FOLDER)/$(INPUT_FONT_GLYPHS $(info This is an intermediate file. You don't need to copy this in your Blade Runner game directory) $(info ---------) $(BLADERUNNER_SUBTITLES_SCRIPTS_ROOT_FOLDER)/fontCreator/fontCreator.py -im $(BLADERUNNER_SUBTITLES_SAMPLE_INPUT_FOLDER)/$(INPUT_FONT_GLYPHS_PNG_FILENAME) -oe $(BLADERUNNER_SUBTITLES_SAMPLE_INPUT_FOLDER)/$(INPUT_FONT_GLYPHS_PNG_AUX_CONF_FILENAME) -om $(FONT_OUTPUT) -pxLL 42 -pxTT 30 -pxKn 1 -pxWS 7 - + # Creation of final output mix file SUBTILES.MIX # The MIX file will pack the fonts file $(FONT_OUTPUT) as well as resources created from the transcript (EXCEL) file $(INPUT_TRANSCRIPT_FILENAME) # The $(INPUT_TRANSCRIPT_AUX_CONF_FILENAME) file is used to configure the creation of the mix file diff --git a/devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator/audFileDecode.py b/devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator/audFileDecode.py index 06e6925b603..cce4ef3add7 100644 --- a/devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator/audFileDecode.py +++ b/devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator/audFileDecode.py @@ -14,7 +14,7 @@ else: if (not ctypesLibFound): sys.stdout.write("[Error] Errors were found when trying to import required python libraries\n") sys.exit(1) - + from struct import * MY_MODULE_VERSION = "0.60" @@ -49,12 +49,12 @@ def aud_decode_ima_chunk(audioBufferIn, index, sample, cs_chunk): code = -1 delta = -1 step = -1 - + audioBufferOut = [] #for i in range(0, len(audioBufferIn)): #if self.m_traceModeEnabled: # print '[Debug] %d: %d'%(i, int(audioBufferIn[i])) - + for sample_index in range (0, cs_chunk): try: code = audioBufferIn[sample_index >> 1] @@ -117,7 +117,7 @@ def aud_decode_ws_chunk(inputChunkBuffer, cb_s, cb_d): #binDataOut = struct.pack('b'*len(outputChunkBuffer), *outputChunkBuffer) #return binDataOut return outputChunkBuffer - + # const xccTHA::byte* s_end = inputChunkBuffer + cb_s; # FIX s_end = inpChBuffIter + cb_s @@ -197,17 +197,17 @@ class audFileDecode(object): m_index = -1 m_sample = -1 m_traceModeEnabled = False - + # traceModeEnabled is bool to enable more printed debug messages def __init__(self, traceModeEnabled = True, index = 0, sample = 0): self.m_traceModeEnabled = traceModeEnabled self.m_index = index; self.m_sample = sample; return - + def index(self): return self.m_index - + # (const xccTHA::byte* audio_in, short* audio_out, int cs_chunk) def decode_chunk(self, audio_in, cs_chunk): (audio_Out, outIndex, outSample) = aud_decode_ima_chunk(audio_in, self.m_index, self.m_sample, cs_chunk) @@ -220,7 +220,7 @@ if __name__ == '__main__': decodeInstance = audFileDecode() if decodeInstance.m_traceModeEnabled: print "[Debug] Running %s (%s) as main module" % (MY_MODULE_NAME, MY_MODULE_VERSION) - + else: #debug #print "[Debug] Running %s (%s) imported from another module" % (MY_MODULE_NAME, MY_MODULE_VERSION) diff --git a/devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator/audFileLib.py b/devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator/audFileLib.py index 232ebd67661..f3e196e6952 100644 --- a/devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator/audFileLib.py +++ b/devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator/audFileLib.py @@ -14,7 +14,7 @@ except ImportError: print "[Error] os python library is required to be installed!" else: osLibFound = True - + try: import sys except ImportError: @@ -61,21 +61,21 @@ class AudHeader(object): m_flags = 0 # bit 0=stereo, bit 1=16bit // int8_t m_compression = 0 # 1=WW compressed, 99=IMA ADPCM (0x63) // int8_t m_populated = False - + def __init__(self): return - - + + # The rest of the AUD files is divided in chunks. # These are usually 512 bytes long, except for the last one. class AudChunkHeader(object): m_ch_size_in = 0 # Size of compressed data // int16_t // TODO should be unsigned (?) m_ch_size_out = 0 # Size of output data // int16_t // TODO should be unsigned (?) m_ch_id = 0x0000FFFF # Always 0x0000DEAF // int32_t - + def __init__(self): return - + # # # @@ -83,21 +83,21 @@ class audFile(object): m_header = AudHeader() m_traceModeEnabled = False m_simpleAudioFileName = 'GENERIC.AUD' - + # traceModeEnabled is bool to enable more printed debug messages def __init__(self, traceModeEnabled = True): self.m_simpleAudioFileName = 'GENERIC.AUD' self.m_traceModeEnabled = traceModeEnabled return - + # std::fstream& fs, AudFileNS::pos_type startAudFilepos, AudFileNS::pos_type endAudFilepos, const std::string& filename def export_as_wav(self, audBytesBuff, filename): if (not self.header().m_populated): print "[Error] file was not loaded properly (header info missing): " + filename return 1 - + print "[Info] Exporting to wav: " + filename - + cvirtualBinaryD = None if self.header().m_compression > 0: cvirtualBinaryD = self.decode(self.header().m_compression, audBytesBuff) @@ -114,16 +114,16 @@ class audFile(object): cbinaryDataOutLst.append(tmpTupleL[0]) cbinaryDataOutLst.append(tmpTupleH[0]) cvirtualBinaryD = struct.pack('B'*len(cbinaryDataOutLst), *cbinaryDataOutLst) - + if (not cvirtualBinaryD and (len(audBytesBuff) - SIZE_OF_AUD_HEADER_IN_BYTES) > 0): print "[Error] audio file could not be exported properly (0 data read): %s" % (filename) return 1 elif (len(audBytesBuff) - SIZE_OF_AUD_HEADER_IN_BYTES) == 0: print "[Warning] Creating empty wav file: %s" % (filename) - + cb_sample = self.get_cb_sample() cs_remaining = self.get_c_samples() - + waveWritFile = wave.open(filename, 'wb') waveWritFile.setnchannels(self.get_c_channels()) waveWritFile.setsampwidth(cb_sample) @@ -132,7 +132,7 @@ class audFile(object): #waveWritFile.setcomptype(None, '') waveWritFile.writeframesraw(cvirtualBinaryD) waveWritFile.close() - + # t_wav_header header; # memset(&header, 0, sizeof(t_wav_header)); # header.file_header.id = wav_file_id; // # "RIFF" @@ -151,8 +151,8 @@ class audFile(object): # error = f.write(&header, sizeof(t_wav_header)); # return error ? error : f.write(d); return 0 # TODO fix - - + + def loadAudFile(self, audBytesBuff, maxLength, audFileName): self.m_simpleAudioFileName = audFileName offsInAudFile = 0 @@ -171,10 +171,10 @@ class audFile(object): tmpTuple = struct.unpack_from('B', audBytesBuff, offsInAudFile) self.header().m_compression = tmpTuple[0] offsInAudFile += 1 - + if self.m_traceModeEnabled: print "[Debug] Sample rate: %d\tsizeIn: %d\tsizeOut: %d\tflags: %d\tcompression: %d" % (self.get_samplerate(), self.header().m_size_in, self.header().m_size_out, self.header().m_flags, self.header().m_compression) - + if self.get_samplerate() < 8000 or self.get_samplerate() > 48000 or self.header().m_size_in > (maxLength - SIZE_OF_AUD_HEADER_IN_BYTES ): print "[Warning] Bad AUD Header info in file %s, size_in: %d, maxLen: %d" % (self.m_simpleAudioFileName, self.header().m_size_in, (maxLength - SIZE_OF_AUD_HEADER_IN_BYTES)) if self.header().m_size_in == 0: @@ -200,7 +200,7 @@ class audFile(object): return False self.header().m_populated = True return True - + # int AudFile::get_chunk_header(int i, std::fstream& fs, AudFileNS::pos_type startAudFilepos, AudFileNS::pos_type endAudFilepos, AudChunkHeader& outAudChunkHeader) def get_chunk_header(self, chunkIdx, inAudFileBytesBuffer, inAudFileSize): #fs.seekg(int(startAudFilepos) + int(SIZE_OF_AUD_HEADER_IN_BYTES), fs.beg); @@ -208,7 +208,7 @@ class audFile(object): #rAudPos = fs.tellg(); outAudChunkHeader = AudChunkHeader() rAudPos = SIZE_OF_AUD_HEADER_IN_BYTES - + if (self.m_traceModeEnabled): print "[Trace] Getting chunk header at %d" % (rAudPos) #AudChunkHeader tmpInremediateChunkheader; @@ -218,7 +218,7 @@ class audFile(object): chunkIdx -= 1 if (rAudPos + SIZE_OF_AUD_CHUNK_HEADER_IN_BYTES > inAudFileSize): return (-1, rAudPos, None) - + tmpAudFileOffset = rAudPos tmpTuple = struct.unpack_from('H', inAudFileBytesBuffer, tmpAudFileOffset) tmpInremediateChunkheader.m_ch_size_in = tmpTuple[0] @@ -232,7 +232,7 @@ class audFile(object): #fs.read((char*)&tmpInremediateChunkheader, SIZE_OF_AUD_CHUNK_HEADER_IN_BYTES); rAudPos += SIZE_OF_AUD_CHUNK_HEADER_IN_BYTES + tmpInremediateChunkheader.m_ch_size_in #fs.seekg(int(rAudPos), fs.beg); - + if (rAudPos + SIZE_OF_AUD_CHUNK_HEADER_IN_BYTES > inAudFileSize ): return (-1, rAudPos, None) # write to FINAL output chunk header @@ -251,7 +251,7 @@ class audFile(object): return (-1, rAudPos, None) rAudPos += SIZE_OF_AUD_CHUNK_HEADER_IN_BYTES return (0, rAudPos, outAudChunkHeader) # //reinterpret_cast(r); - + # int AudFile::get_chunk_data(int i, std::fstream& fs, int sizeToRead, AudFileNS::byte* byteChunkDataPtr) def get_chunk_data(self, inAudFileBytesBuffer, startOffs, sizeToRead): #fs.read((char*)byteChunkDataPtr, sizeToRead) @@ -267,8 +267,8 @@ class audFile(object): #byteChunkDataOut = struct.pack('b'*len(outChunkDataLst), *outChunkDataLst) #return (0, byteChunkDataOut) return (0, outChunkDataLst) - - + + # std::fstream& fs, AudFileNS::pos_type startAudFilepos, AudFileNS::pos_type endAudFilepos # returned Cvirtual_binary def decode(self, speccompression, audBytesBuff): @@ -295,7 +295,7 @@ class audFile(object): if self.m_traceModeEnabled: print "[Trace] Error OR End file case while getting uncompressed chunk header!" break - + if self.m_traceModeEnabled: print "[Trace] Get uncompressed chunk header returned: %d " % (out_chunk_header.m_ch_id) #Cvirtual_binary out_chunk_data; @@ -347,20 +347,20 @@ class audFile(object): else: #if binaryDataOutBuff is None: print "[Error] Decoding yielded errors (data out buffer is null)." return binaryDataOutBuff - + def header(self): return self.m_header - + def get_c_samples(self): return self.m_header.m_size_out / self.get_cb_sample() - + def get_samplerate(self): return self.m_header.m_samplerate; - + # flag bit 0 is stereo(set) mono(clear) def get_c_channels(self): return 2 if (self.m_header.m_flags & 0x01) else 1; - + # flag bit 1 is 16bit(set) 8bit (clear) def get_cb_sample(self): return 2 if (self.m_header.m_flags & 0x02) else 1 @@ -374,7 +374,7 @@ if __name__ == '__main__': # otherwise tries to use the first command line argument as input file inAUDFile = None inAUDFileName = '00000000.AUD' - + if len(sys.argv[1:]) > 0 \ and os.path.isfile(os.path.join('.', sys.argv[1])) \ and len(sys.argv[1]) >= 5 \ @@ -386,7 +386,7 @@ if __name__ == '__main__': else: print "[Error] No valid input file argument was specified and default input file %s is missing." % (inAUDFileName) errorFound = True - + if not errorFound: try: print "[Info] Opening %s" % (inAUDFileName) diff --git a/devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator/devCommentaryText.py b/devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator/devCommentaryText.py index 4d4e1a98c3c..6060fa3a637 100644 --- a/devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator/devCommentaryText.py +++ b/devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator/devCommentaryText.py @@ -56,7 +56,7 @@ class devCommentaryText(object): def __init__(self, traceModeEnabled = True): self.m_traceModeEnabled = traceModeEnabled return - + def printTexts(self): if self.m_traceModeEnabled: print "[Trace] Printing all dev commentary text" @@ -73,18 +73,18 @@ class devCommentaryText(object): for (idTre, textTre) in DEV_ISEZ_QUOTES_TUPLE_LIST: print "%s\t%s" % (idTre, textTre) return - + def getAudioCommentaryTextEntriesList(self): if self.m_traceModeEnabled: print "[Trace] getAudioCommentaryTextEntriesList" return DEV_AUDIO_COMMENTARY_TUPLE_LIST - + def getISEZTextEntriesList(self): - + if self.m_traceModeEnabled: print "[Trace] getISEZTextEntriesList" return DEV_ISEZ_QUOTES_TUPLE_LIST - + def getExtraSpeechAudioEntriesList(self): if self.m_traceModeEnabled: print "[Trace] getExtraSpeechAudioEntriesList" diff --git a/devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator/pogoTextResource.py b/devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator/pogoTextResource.py index 3d306e3b211..e164b2123f6 100644 --- a/devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator/pogoTextResource.py +++ b/devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator/pogoTextResource.py @@ -175,19 +175,19 @@ class pogoTextResource(object): def __init__(self, traceModeEnabled = True): self.m_traceModeEnabled = traceModeEnabled return - + def printPogo(self): if self.m_traceModeEnabled: print "[Trace] printing Pogo..." for (idTre, textTre) in POGO_TEXT_RESOURCE_TUPLE_LIST: print "%s\t%s" % (idTre, textTre) return - + def getPogoEntriesList(self): if self.m_traceModeEnabled: print "[Trace] getPogoEntriesList()" return POGO_TEXT_RESOURCE_TUPLE_LIST - + # # # @@ -201,4 +201,3 @@ else: #debug #print "[Debug] Running %s imported from another module" % (my_module_name) pass - \ No newline at end of file diff --git a/devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator/quoteSpreadsheetCreator.py b/devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator/quoteSpreadsheetCreator.py index ea3069f6a92..7a7e1f369a6 100644 --- a/devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator/quoteSpreadsheetCreator.py +++ b/devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator/quoteSpreadsheetCreator.py @@ -7,11 +7,11 @@ except ImportError: print ("[Error] sys python library is required to be installed!") else: sysLibFound = True - + if (not sysLibFound): sys.stdout.write("[Error] Errors were found when trying to import required python libraries\n") sys.exit(1) - + if not (sys.version_info[0] == 2 and sys.version_info[1] == 7): sys.stdout.write("[Error] Blade Runner Quotes Spreadsheet Creator script requires Python 2.7\n") sys.exit(1) diff --git a/devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator/sortBladeRunnerWavs02.py b/devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator/sortBladeRunnerWavs02.py index fac75a73c9b..e8da9739faa 100644 --- a/devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator/sortBladeRunnerWavs02.py +++ b/devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator/sortBladeRunnerWavs02.py @@ -14,19 +14,19 @@ xlwtLibFound = False csvLibFound = False try: - import os + import os except ImportError: - print "[Error] os python library is required to be installed!" + print "[Error] os python library is required to be installed!" else: osLibFound = True - + try: - import sys + import sys except ImportError: - print "[Error] sys python library is required to be installed!" + print "[Error] sys python library is required to be installed!" else: sysLibFound = True - + try: import shutil except ImportError: @@ -409,7 +409,7 @@ def inputTLKsExport(inputTLKpath, outputWAVpath, pExportWavFilesMode, pExtractDe if not fileIsMIX: # TLK file (actorID, actorSName, localQuoteId) = getActorShortNameAndLocalQuoteIdByAUDHashID(idOfAUDEntry) targetSimpleWavFileName = actorSName + '_' + str(localQuoteId).zfill(4) + '_' + ''.join('{:08X}'.format(idOfAUDEntry)).upper()+'.WAV' - + audFileBuffer = inTLKorMIXFile.read(sizeOfAUDEntry) if (len(audFileBuffer) == sizeOfAUDEntry): # load audio file (AUD) file @@ -469,7 +469,7 @@ def appendVQAPlaceHolderSheets(excelOutBook = None): # Fill in with placeholder content n+=1 vqaTRInstance = vqasTextResource(gTraceModeEnabled) - + objUTF8Unicode = None for m, e1 in enumerate(vqaTRInstance.getVqaEntriesList(currVQAFileNameDesc[0]), n): sh.write(m, 0, e1[0]) # start frame @@ -502,7 +502,7 @@ def appendPOGOTextSheet(excelOutBook = None): sh.write(n, 1, col2_name) n+=1 pogoTRInstance = pogoTextResource(gTraceModeEnabled) - + objUTF8Unicode = None for m, e1 in enumerate(pogoTRInstance.getPogoEntriesList(), n): sh.write(m, 0, e1[0]) @@ -522,7 +522,7 @@ def auxPopulateExtraSpeechAudioRow(sh = None, n = 0, pFilenameStr = '', pTextStr or pListOfExtraWavsForDevSheet is None \ or len(pListOfExtraWavsForDevSheet) == 0: return False - + foundMatch = False for dcAUDFilename, dcArchiveMIXFile in SUPPORTED_EXPORTED_AUD_FROM_MIX_FILES: if dcAUDFilename == pFilenameStr: @@ -542,7 +542,7 @@ def auxPopulateExtraSpeechAudioRow(sh = None, n = 0, pFilenameStr = '', pTextStr if smArchiveMIXFile == dcArchiveMIXFile: sh.write(n, 5, smArchiveMIXShort) # Resource - proper break - + for extraWavFDS in pListOfExtraWavsForDevSheet: twoTokensOfRelDirnameAndFilenameXLS = extraWavFDS.split('&', 2) if len(twoTokensOfRelDirnameAndFilenameXLS) == 3: @@ -565,16 +565,16 @@ def auxPopulateExtraSpeechAudioRow(sh = None, n = 0, pFilenameStr = '', pTextStr foundMatch = True break return foundMatch - + def appendDevCommentarySheet(excelOutBook = None, listOfExtraWavsForDevSheet = None ): - + if excelOutBook != None \ and listOfExtraWavsForDevSheet != None \ and len(listOfExtraWavsForDevSheet) > 0: - + objUTF8Unicode = None print "[Info] Appending Developer Commentary sheet..." - + sh = excelOutBook.add_sheet("DEV AUDIO") devCommentaryTextInstance = devCommentaryText(gTraceModeEnabled) # @@ -587,7 +587,7 @@ def appendDevCommentarySheet(excelOutBook = None, listOfExtraWavsForDevSheet = N sh.write(n, colIdx, colNameIt) colIdx+=1 n+= 1 - + col_names = ['Filename', 'Quote', 'By Actor', 'Notes', 'To Actor', 'Resource', 'ShortHandFileName'] colIdx = 0 for colNameIt in col_names: @@ -609,14 +609,14 @@ def appendDevCommentarySheet(excelOutBook = None, listOfExtraWavsForDevSheet = N sh.write(n, colIdx, colNameIt) colIdx+=1 n+= 1 - + col_names = ['Filename', 'Quote', 'By Actor', 'Notes', 'To Actor', 'Resource', 'ShortHandFileName'] colIdx = 0 for colNameIt in col_names: sh.write(n, colIdx, colNameIt) colIdx+=1 n+= 1 - + # populate extra speech audio rows for pFilenameStr, pTextStr in devCommentaryTextInstance.getExtraSpeechAudioEntriesList(): if auxPopulateExtraSpeechAudioRow(sh, n, pFilenameStr, pTextStr, listOfExtraWavsForDevSheet) == True: @@ -638,8 +638,8 @@ def appendDevCommentarySheet(excelOutBook = None, listOfExtraWavsForDevSheet = N for colNameIt in col_names: sh.write(n, colIdx, colNameIt) colIdx+=1 - n+= 1 - + n+= 1 + for idStr, textStr in devCommentaryTextInstance.getISEZTextEntriesList(): sh.write(n, 0, idStr) # We assume utf-8 charset for I_SEZ Commentary (since we get the text from a python script) @@ -763,20 +763,20 @@ def inputMIXExtractTREs(inputMIXpath, excelOutBook = None): sh.write(n, 0, col1_name) sh.write(n, 1, col2_name) n+=1 - + for m, e1 in enumerate(thisTreFile.stringEntriesLst, n): sh.write(m, 0, e1[0]) objStr = e1[1] if ( currTreFileName[:-1] == 'ERRORMSG.TR'): - # ERRORMSG.TRx uses different font than the others + # ERRORMSG.TRx uses different font than the others # and there are conflicts (with the other in-game fonts) # Supposedly these messages would be printed by an OS font - # They seem to mostly use the Latin-1 codepage, although there are a few + # They seem to mostly use the Latin-1 codepage, although there are a few # characters that don't encode right (but they do with a IBM437 like the rest of the TRx # Probably, these are forgotten (buggy) characters from a previous plan (print error messages with in-game font?) - # So we treat them as bugs and fix them. + # So we treat them as bugs and fix them. # Further proof that they are buggy, there are language versions that have two codes for the same character - # in ERRORMSG TRx. + # in ERRORMSG TRx. # Eg. in Spanish version they use \xa2 (correct with IBM437) and \xf3 (correct with Latin-1) for the 'ó' character # or in French version 'è' uses both \x8a and \xe8 objEncodeSafeStr = "" @@ -834,7 +834,7 @@ def inputMIXExtractTREs(inputMIXpath, excelOutBook = None): # -# Creating the OUTPUT XLS file with one sheet named as the @param sheet with entries based on the +# Creating the OUTPUT XLS file with one sheet named as the @param sheet with entries based on the # listTlkWavs (wav files from TLK files, without duplicates) # and /or # listDevsWavs (extra (supported) wav files practicaclly from the SFX.MIX file), without duplicates) @@ -888,7 +888,7 @@ def outputXLS(filename, sheet, listTlkWavs, listDevsWavs, parseTREResourcesAlso #z_desc = 'Test' #desc = [x_desc, y_desc, z_desc] # - # + # # You may need to group the variables together #for n, (v_desc, v) in enumerate(zip(desc, variables)): #sh.write(n, 0, v_desc) @@ -989,13 +989,13 @@ def outputXLS(filename, sheet, listTlkWavs, listDevsWavs, parseTREResourcesAlso print "[Error] Could not save the output Excel file:: " + str(e) # -# Aux function to weed out duplicates from wav file lists +# Aux function to weed out duplicates from wav file lists # valid listTypes: 'TLKWAVS', 'EXTRAMIXWAVS' def wavDupsRemove(listOfWavFiles, listType): if listType != 'TLKWAVS' and listType != 'EXTRAMIXWAVS': print '[Error] Invalid listtype %s specified to remove duplicate wav files' % (listType) sys.exit(1) - + listOfWavFilesNoDups = [] for filenameSrcTmp in listOfWavFiles: duplicateFound = False @@ -1005,20 +1005,20 @@ def wavDupsRemove(listOfWavFiles, listType): tmpRelDirNameSrc = twoTokensOfRelDirnameAndFilenameSrc[1] # eg. TLK1 keyForDuplicateSearchSrc = None keyForDuplicateSearchTarg = None - + if (listType == 'EXTRAMIXWAVS'): - keyForDuplicateSearchSrc = twoTokensOfRelDirnameAndFilenameSrc[0] + keyForDuplicateSearchSrc = twoTokensOfRelDirnameAndFilenameSrc[0] else: threeTokensOfQuoteFilenameSrc = twoTokensOfRelDirnameAndFilenameSrc[0].split('#', 2) #concatenate actorID and quoteID for search key keyForDuplicateSearchSrc = threeTokensOfQuoteFilenameSrc[0] + threeTokensOfQuoteFilenameSrc[1] - + for fileTargIdx, filenameTargTmp in enumerate(listOfWavFilesNoDups): twoTokensOfRelDirnameAndFilenameTarg = filenameTargTmp.split('&', 2) tmpRelDirNameTarg = twoTokensOfRelDirnameAndFilenameTarg[1] if (listType == 'EXTRAMIXWAVS'): - keyForDuplicateSearchTarg = twoTokensOfRelDirnameAndFilenameTarg[0] + keyForDuplicateSearchTarg = twoTokensOfRelDirnameAndFilenameTarg[0] else: threeTokensOfQuoteFilenameTarg = twoTokensOfRelDirnameAndFilenameTarg[0].split('#', 2) #concatenate actorID and quoteID for search key @@ -1068,7 +1068,7 @@ def main(argsCL): global gMIXWavFilesNoDups global gTLKWavFiles global gTLKWavFilesNoDups - + gTraceModeEnabled = False gActiveLanguageDescriptionCodeTuple = DEFAULT_LANG_DESC_CODE @@ -1221,8 +1221,8 @@ def main(argsCL): if (len(nameTmp) > 4) \ and nameTmp.upper()[-4:] == '.WAV' \ and len(nameTmp.split('.', 1)) == 2: # radical heal (but practical) - don't allow cases like .AUD.WAV or any intermediate dots in the filename! - relDirName = '' - # os.path.split would Split the pathname path into a pair, + relDirName = '' + # os.path.split would Split the pathname path into a pair, # (head, tail) where tail is the last pathname component and head is everything leading up to that. The tail part will never contain a slash pathTokens = dirpath.split(os.path.sep) idxOfLastTLKToken = -1 @@ -1230,12 +1230,12 @@ def main(argsCL): for tokenIdx, pTokenTmp in enumerate(pathTokens): posOfTLKWithinRightmostToken = pTokenTmp.find("TLK") posOfSFXWithinRightmostToken = pTokenTmp.find("SFX") - + if posOfTLKWithinRightmostToken != -1: idxOfLastTLKToken = tokenIdx if posOfSFXWithinRightmostToken != -1: idxOfLastSFXToken = tokenIdx - + if (posOfTLKWithinRightmostToken != -1 \ or posOfSFXWithinRightmostToken != -1): relDirName = pTokenTmp # don't break, we are interested in right-most matching token in the path @@ -1246,7 +1246,7 @@ def main(argsCL): if (idxOfLastSFXToken > idxOfLastTLKToken \ and (nameTmp.upper()[:-4] + '.AUD') in zip(*SUPPORTED_EXPORTED_AUD_FROM_MIX_FILES)[0]): gMIXWavFiles.append(filenames[nameIdx] +'&' + relDirName + '&' + os.path.join(dirpath, nameTmp)) - else: + else: gTLKWavFiles.append(filenames[nameIdx] +'&' + relDirName + '&' + os.path.join(dirpath, nameTmp)) #break for fileIdx, filenameTmp in enumerate(gTLKWavFiles): @@ -1294,10 +1294,10 @@ def main(argsCL): else: print "[Error] in splitting tokens on _: %s" % (filenameTmp) sys.exit(0) - # + # # Now handle the extra speech files (-xdevs mode) - for fileIdx, filenameTmp in enumerate(gMIXWavFiles): # - # if it's a AUD file from a MIX archive, we treat it differently here + for fileIdx, filenameTmp in enumerate(gMIXWavFiles): # + # if it's a AUD file from a MIX archive, we treat it differently here # (we will put it in another sheet) twoTokensOfFilenameAndRelDirname = filenameTmp.split('&', 1) if len(twoTokensOfFilenameAndRelDirname) != 2: @@ -1314,7 +1314,7 @@ def main(argsCL): gMIXWavFiles.sort() # # - # Remove duplicates from TLK AUD speech files (-xwav mode) + # Remove duplicates from TLK AUD speech files (-xwav mode) # gTLKWavFilesNoDups = wavDupsRemove(gTLKWavFiles, 'TLKWAVS') if len(gTLKWavFilesNoDups) == 0: @@ -1327,7 +1327,7 @@ def main(argsCL): if extractDevCommAndExtraSFXMode and len(gMIXWavFilesNoDups) == 0: print "[Error] No supported extra speech audio files (WAV) were found in the output folder path (-op switch)." sys.exit(1) - + constructedOutputFilename = "%s-%s%s" % (OUTPUT_XLS_FILENAME, gActiveLanguageDescriptionCodeTuple[2], OUTPUT_XLS_FILENAME_EXT) print "[Info] Creating output excel %s file..." % (constructedOutputFilename) outputXLS(constructedOutputFilename, OUTPUT_XLS_QUOTES_SHEET + gActiveLanguageDescriptionCodeTuple[1] + '.TR' + gActiveLanguageDescriptionCodeTuple[1], gTLKWavFilesNoDups, gMIXWavFilesNoDups, extractTreFilesMode, extractDevCommAndExtraSFXMode, extractPOGOTextMode, TMProotFolderWithInputTLKFiles) diff --git a/devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator/treFileLib.py b/devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator/treFileLib.py index a8c787c4f42..f1250e06e7e 100644 --- a/devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator/treFileLib.py +++ b/devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator/treFileLib.py @@ -12,7 +12,7 @@ except ImportError: print "[Error] os python library is required to be installed!" else: osLibFound = True - + try: import sys except ImportError: @@ -32,7 +32,7 @@ if (not osLibFound) \ or (not structLibFound): sys.stdout.write("[Error] Errors were found when trying to import required python libraries\n") sys.exit(1) - + from struct import * MY_MODULE_VERSION = "0.50" @@ -51,7 +51,7 @@ class treFile(object): stringEntriesLst = [] # list of two-value tuples. First value is ID, second value is String content stringOffsets = [] m_traceModeEnabled = False - + # traceModeEnabled is bool to enable more printed debug messages def __init__(self, traceModeEnabled = True): del self.stringEntriesLst[:] @@ -59,7 +59,7 @@ class treFile(object): self.simpleTextResourceFileName = 'GENERIC.TRE' self.m_traceModeEnabled = traceModeEnabled return - + def loadTreFile(self, treBytesBuff, maxLength, treFileName): self.simpleTextResourceFileName = treFileName offsInTreFile = 0 @@ -79,7 +79,7 @@ class treFile(object): tmpTuple = struct.unpack_from('I', treBytesBuff, offsInTreFile) # unsigned integer 4 bytes self.stringEntriesLst.append( (tmpTuple[0], '') ) offsInTreFile += 4 - + # string offsets table (each entry is unsigned integer 4 bytes) for idx in range(0, self.header().numOfTextResources): tmpTuple = struct.unpack_from('I', treBytesBuff, offsInTreFile) # unsigned integer 4 bytes @@ -91,9 +91,9 @@ class treFile(object): absStartOfIndexTable = 4 #absStartOfOffsetTable = absStartOfIndexTable + (self.header().numOfTextResources * 4) #absStartOfStringTable = absStartOfOffsetTable + ((self.header().numOfTextResources+1) * 4) - + #print "[Debug] buffer type: " , type(treBytesBuff) # it is str - + for idx in range(0, self.header().numOfTextResources): currOffset = self.stringOffsets[idx] + absStartOfIndexTable # the buffer (treBytesBuff) where we read the TRE file into, is "str" type but contains multiple null terminated strings @@ -114,7 +114,7 @@ class treFile(object): except: print "[Error] Loading Text Resource %s failed!" % (self.simpleTextResourceFileName) return False - + def header(self): return self.m_header # @@ -127,7 +127,7 @@ if __name__ == '__main__': # otherwise tries to use the first command line argument as input file inTREFile = None inTREFileName = 'ACTORS.TRE' - + if len(sys.argv[1:]) > 0 \ and os.path.isfile(os.path.join('.', sys.argv[1])) \ and len(sys.argv[1]) >= 5 \ @@ -139,7 +139,7 @@ if __name__ == '__main__': else: print "[Error] No valid input file argument was specified and default input file %s is missing." % (inTREFileName) errorFound = True - + if not errorFound: try: print "[Info] Opening %s" % (inTREFileName) diff --git a/devtools/create_encoding/create_encoding.py b/devtools/create_encoding/create_encoding.py index 4c267ff45de..ed8a0d07f82 100755 --- a/devtools/create_encoding/create_encoding.py +++ b/devtools/create_encoding/create_encoding.py @@ -12,7 +12,7 @@ def merge_ranges(*ranges): def processtable(inputfilename, outfile, highrange, lowrange): with open(inputfilename) as f: - res = dict(((x << 8) | y, 0) for x in highrange for y in lowrange) + res = dict(((x << 8) | y, 0) for x in highrange for y in lowrange) for line in f: if line.startswith('#'): diff --git a/devtools/create_glk/create_glk.cpp b/devtools/create_glk/create_glk.cpp index c3c1de7c684..dd4f553e901 100644 --- a/devtools/create_glk/create_glk.cpp +++ b/devtools/create_glk/create_glk.cpp @@ -150,7 +150,7 @@ private: const byte *_ptr; public: MemoryReadStream(const byte *ptr) : _ptr(ptr) {} - + byte readByte() { return *_ptr++; } diff --git a/devtools/create_hugo/README b/devtools/create_hugo/README index 0d57d5eae52..1a15bac92ed 100644 --- a/devtools/create_hugo/README +++ b/devtools/create_hugo/README @@ -1,5 +1,5 @@ -This tool creates hugo.dat. -This file contains all the hardcoded strings, logic, fonts, and bitmaps and +This tool creates hugo.dat. +This file contains all the hardcoded strings, logic, fonts, and bitmaps and is used by the engine depending on the version of the game started. In order to work properly, the content of the DATA sub-directory has to be diff --git a/devtools/create_project/msvc.cpp b/devtools/create_project/msvc.cpp index 6ccfee37d50..ea43f2bb7c5 100644 --- a/devtools/create_project/msvc.cpp +++ b/devtools/create_project/msvc.cpp @@ -121,7 +121,7 @@ std::string MSVCProvider::getLibraryFromFeature(const char *feature, const Build libs += basename; } } - + return libs; } diff --git a/devtools/create_project/msvc.h b/devtools/create_project/msvc.h index 8b9804f8ccb..43c88b0a754 100644 --- a/devtools/create_project/msvc.h +++ b/devtools/create_project/msvc.h @@ -38,8 +38,8 @@ protected: StringList _disableEditAndContinue; std::list _archs; - std::map _arch_disabled_features; - + std::map _arch_disabled_features; + /** * MSVC properties for a library required by a feature */ diff --git a/devtools/create_project/scripts/installer.vbs b/devtools/create_project/scripts/installer.vbs index 6fe781358e5..b50c8aca8f5 100644 --- a/devtools/create_project/scripts/installer.vbs +++ b/devtools/create_project/scripts/installer.vbs @@ -31,7 +31,7 @@ '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' '================================================================ -' TODO: Reduce duplication with revision.vbs script +' TODO: Reduce duplication with revision.vbs script ' (ReadRegistryKey and ParseCommandLine are identical) '================================================================ diff --git a/devtools/create_project/scripts/revision.vbs b/devtools/create_project/scripts/revision.vbs index 7f0655dae18..eed10791088 100644 --- a/devtools/create_project/scripts/revision.vbs +++ b/devtools/create_project/scripts/revision.vbs @@ -99,9 +99,9 @@ Sub DetermineRevision() End If End If End If - + Dim outputInfo : outputInfo = "Found revision " & revision & " on branch " & branch - + ' Setup our revision string Dim revisionString : revisionString = revision @@ -120,7 +120,7 @@ Sub DetermineRevision() revisionString = revisionString & "-" & tool outputInfo = outputInfo & " using " & tool End If - + Wscript.StdErr.WriteLine outputInfo & vbCrLf OutputRevisionHeader revisionString diff --git a/devtools/create_supernova/create_image/README b/devtools/create_supernova/create_image/README index 80c898f8bfc..d4d756e3ee1 100644 --- a/devtools/create_supernova/create_image/README +++ b/devtools/create_supernova/create_image/README @@ -75,7 +75,7 @@ for storing the color of each pixel (Image -> Mode -> Indexed... in gimp). Running the tool The tool needs 3 comand line arguments when running it: -- Prefix of the file to be created (use "ms2_data" to create "ms2_data.###") --- Number of the file to be created and also the number of a folder to read all the +-- Number of the file to be created and also the number of a folder to read all the files from (use "15" to create prefix.015) -- Number of bytes to skip in each .bmp file. At the begining of each .bmp file is a header with information about the file and after that is stored the palette. This diff --git a/devtools/create_supernova/create_image/create_image.cpp b/devtools/create_supernova/create_image/create_image.cpp index 2c6937ab1ce..fa3532e82e1 100644 --- a/devtools/create_supernova/create_image/create_image.cpp +++ b/devtools/create_supernova/create_image/create_image.cpp @@ -182,7 +182,7 @@ int main(int argc, char *argv[]) { for (int i = 0; i < numImages; i++) { totalLength += writePixelData(output, i, bytesSkip); if (oldLength == totalLength) { - std::cerr << "Error while reading the image number: " << i << std::endl; + std::cerr << "Error while reading the image number: " << i << std::endl; return 1; } oldLength = totalLength; diff --git a/devtools/create_supernova/create_supernova.cpp b/devtools/create_supernova/create_supernova.cpp index d7a7d0b460d..78ed883b594 100644 --- a/devtools/create_supernova/create_supernova.cpp +++ b/devtools/create_supernova/create_supernova.cpp @@ -52,7 +52,7 @@ void writeDatafile(File& outputFile, int fileNumber, const char* language, int p } // Write block size - + dataFile.seek(0, SEEK_END); int length = dataFile.pos(); dataFile.seek(0, SEEK_SET); @@ -101,7 +101,7 @@ void writeDocFile(File& outputFile, const char *fileExtension, const char* langu } // Write block size - + docFile.seek(0, SEEK_END); int length = docFile.pos(); docFile.seek(0, SEEK_SET); diff --git a/devtools/create_supernova/gametext.h b/devtools/create_supernova/gametext.h index 0d2ed0b8f7c..e5dc866de46 100644 --- a/devtools/create_supernova/gametext.h +++ b/devtools/create_supernova/gametext.h @@ -844,20 +844,20 @@ const char *gameText2[] = { "Rede", //Talk "Gib", //Give // 10 - "Gehe zu ", //Go to - "Schau ", //Look at - "Nimm ", //Take - "\231ffne ", //Open - "Schlie\341e ", //Close + "Gehe zu ", //Go to + "Schau ", //Look at + "Nimm ", //Take + "\231ffne ", //Open + "Schlie\341e ", //Close // 15 - "Dr\201cke ", //Push - "Ziehe ", //Pull - "Benutze ", //Use - "Rede mit ", //Talk to - "Gib ", //Give + "Dr\201cke ", //Push + "Ziehe ", //Pull + "Benutze ", //Use + "Rede mit ", //Talk to + "Gib ", //Give // 20 - " an ", // to - " mit ", // with + " an ", // to + " mit ", // with "Es ist nichts Besonderes daran.", //There's nothing special about it. "|", //Dialog separator "Gespr\204ch beenden", //End of conversation @@ -1091,7 +1091,7 @@ const char *gameText2[] = { "(Taxi verlassen)", //(Leave the taxi) // 215 "(Bezahlen)", //(Pay) - "Adresse:| ", //Address:| + "Adresse:| ", //Address:| "Fuddeln gilt nicht!|Zu diesem Zeitpunkt kannst du diese|Adresse noch gar nicht kennen!", //Fiddling with the system doesn't work!|At this time you can not|even know this address! "Du hast nicht|mehr genug Geld.", //You do not|have enough money left. "Du merkst, da\341 das Taxi stark beschleunigt.", //You notice the taxi is accelerating rapidly. @@ -1459,7 +1459,7 @@ const char *gameText2[] = { "Stecken Sie sich Ihre|Tomaten an den Hut!", //You can keep your tomatoes! "Das kann ja jeder sagen!", //Anyone can say that! "Niemand \224ffnet.", //Nobody answers. - "Welche Zahl willst du eingeben: ", //What number do you want to enter: + "Welche Zahl willst du eingeben: ", //What number do you want to enter: "Falsche Eingabe", //Invalid input // 525 "Der Aufzug bewegt sich.", //The elevator is moving. diff --git a/devtools/create_supernova/msn.doc-it b/devtools/create_supernova/msn.doc-it index 8c7a23dc64e..93fe5c30b8f 100644 --- a/devtools/create_supernova/msn.doc-it +++ b/devtools/create_supernova/msn.doc-it @@ -24,13 +24,13 @@ Puoi selezionare un oggetto in due modi: -Cliccandoci sopra nella schermata grafica. Gli oggetti importanti vengono indicati nella riga-registro quando passi sopra il puntatore. --Cliccando su un oggetto nell'inventario. L'inventario si +-Cliccando su un oggetto nell'inventario. L'inventario si trova in basso sullo schermo e mostra tutti gli oggetti che stai portando con te. Puoi raccogliere tutti gli oggetti che desideri. Se possiedi piu` di otto oggetti, verranno visualizzate delle freccette sulla destra, che puoi usare per scorrere la lista completa. - + Dopo avere selezionato un verbo ed un oggetto, l'azione prescelta verra` subito eseguita (solitamente). Esempi: @@ -39,7 +39,7 @@ Puoi selezionare un oggetto in due modi: Prendi Scacchiera Guarda Tesserino Puoi provare questi esempi nella stanza dove inizia il - gioco. + gioco. Il verbo "Usa" talvolta richiede due oggetti. Il verbo "Dai" richiede sempre due "oggetti". @@ -49,7 +49,7 @@ Esempio: dal tuo inventario. La riga del testo indichera` "Usa Tesserino con". Ora clicca sullo slot dell'armadietto centrale per aprirlo. - + Informazioni aggiuntive per i comandi: -Dopo avere eseguito un comando, il gioco passa sempre al verbo "Vai verso". @@ -59,7 +59,7 @@ Informazioni aggiuntive per i comandi: -Premere pulsanti -Parlare con persone -Guardare oggetti - Esempio: + Esempio: Desideri aprire un portello chiuso. Sposta il puntatore del mouse sopra al portello e premi il tasto destro. Il portello si aprira`. @@ -80,9 +80,9 @@ Puoi spostarti in due modi. dove ti trovi. -Puoi anche cliccare su di un'uscita direttamente nella schermata grafica (per es. un portello aperto). - - Importante: La schermata grafica non mostra sempre tutte - le uscite di una stanza. Alcune uscite + + Importante: La schermata grafica non mostra sempre tutte + le uscite di una stanza. Alcune uscite potrebbero essere accessibili solo tramite la "mappa" in basso a destra. diff --git a/devtools/create_supernova/msn.inf-it b/devtools/create_supernova/msn.inf-it index 82a48118dc0..f24a32b4271 100644 --- a/devtools/create_supernova/msn.inf-it +++ b/devtools/create_supernova/msn.inf-it @@ -1,6 +1,6 @@ Informazioni Programma -------------------- - + La prima parte del gioco "Mission Supernova" e` shareware, quindi puoi (devi!) copiarla e distribuirla a chi desideri. Se il gioco ti piace, registrati per 30,- DM! @@ -37,7 +37,7 @@ Assicurati di avere specificato: - indirizzo - formato disco desiderato (5.25"/1.2MB o 3.5"/1.44MB) - + Le seguenti opzioni sono disponibili per il pagamento di 30,- DM: diff --git a/devtools/create_titanic/tag_maps.cpp b/devtools/create_titanic/tag_maps.cpp index 7e96c6f6758..a176fb604db 100644 --- a/devtools/create_titanic/tag_maps.cpp +++ b/devtools/create_titanic/tag_maps.cpp @@ -650,7 +650,7 @@ static const TagMapping LIFTBOT_MAP_DE[119] = { { 0x46d47, 0x07536 }, { 0x46d4a, 0x3360c }, { 0x46d4e, 0x337fc }, { 0x46d50, 0x337fd }, { 0x46d56, 0x33800 }, { 0x46d58, 0x33694 }, { 0x46dc2, 0x337f3 }, { 0x46dc6, 0x337fb }, { 0x46dc7, 0x337f9 }, - { 0x46dca, 0x33802 }, { 0x46dd3, 0x33775 } + { 0x46dca, 0x33802 }, { 0x46dd3, 0x33775 } }; #define MAITRED_COUNT_DE 105 diff --git a/devtools/create_ultima/file.h b/devtools/create_ultima/file.h index f3fd0687ece..9546e877538 100644 --- a/devtools/create_ultima/file.h +++ b/devtools/create_ultima/file.h @@ -140,7 +140,7 @@ struct Surface { _pixels = new byte[w * h]; memset(_pixels, 0xff, w * h); - // Set a default palette + // Set a default palette for (int idx = 0; idx < 256; ++idx) { memset(_palette + idx * 3, idx, 3); } diff --git a/devtools/create_ultima/files/ultima4/conf/armors.xml b/devtools/create_ultima/files/ultima4/conf/armors.xml index 06a91b3c1bd..2752ae8c8f7 100644 --- a/devtools/create_ultima/files/ultima4/conf/armors.xml +++ b/devtools/create_ultima/files/ultima4/conf/armors.xml @@ -8,31 +8,31 @@ - - + + - + - + - + - + - + diff --git a/devtools/create_ultima/files/ultima4/conf/config.xml b/devtools/create_ultima/files/ultima4/conf/config.xml index 4685df13704..d540ee74af2 100644 --- a/devtools/create_ultima/files/ultima4/conf/config.xml +++ b/devtools/create_ultima/files/ultima4/conf/config.xml @@ -33,7 +33,7 @@ - + diff --git a/devtools/create_ultima/files/ultima4/conf/creatures.xml b/devtools/create_ultima/files/ultima4/conf/creatures.xml index 72fc4fe61fe..68c42be3474 100644 --- a/devtools/create_ultima/files/ultima4/conf/creatures.xml +++ b/devtools/create_ultima/files/ultima4/conf/creatures.xml @@ -18,7 +18,7 @@ - + diff --git a/devtools/create_ultima/files/ultima4/conf/dtd/creatures.dtd b/devtools/create_ultima/files/ultima4/conf/dtd/creatures.dtd index 2374c0dcf31..250b767f5b9 100644 --- a/devtools/create_ultima/files/ultima4/conf/dtd/creatures.dtd +++ b/devtools/create_ultima/files/ultima4/conf/dtd/creatures.dtd @@ -6,7 +6,7 @@ diff --git a/devtools/create_ultima/files/ultima4/conf/dtd/maps.dtd b/devtools/create_ultima/files/ultima4/conf/dtd/maps.dtd index 4d402c9b404..04d54292254 100644 --- a/devtools/create_ultima/files/ultima4/conf/dtd/maps.dtd +++ b/devtools/create_ultima/files/ultima4/conf/dtd/maps.dtd @@ -1,7 +1,7 @@ - diff --git a/devtools/create_ultima/files/ultima4/conf/dtd/tileRules.dtd b/devtools/create_ultima/files/ultima4/conf/dtd/tileRules.dtd index 575c54fbd1a..81ab7300edc 100644 --- a/devtools/create_ultima/files/ultima4/conf/dtd/tileRules.dtd +++ b/devtools/create_ultima/files/ultima4/conf/dtd/tileRules.dtd @@ -20,7 +20,7 @@ effect %effect; #IMPLIED horse %bool; #IMPLIED lockeddoor %bool; #IMPLIED - creatureunwalkable %bool; #IMPLIED + creatureunwalkable %bool; #IMPLIED replacement %bool; #IMPLIED onWaterOnlyReplacement %bool; #IMPLIED sailable %bool; #IMPLIED diff --git a/devtools/create_ultima/files/ultima4/conf/dtd/tileset.dtd b/devtools/create_ultima/files/ultima4/conf/dtd/tileset.dtd index 3ba0651bb4d..e89c3ec624b 100644 --- a/devtools/create_ultima/files/ultima4/conf/dtd/tileset.dtd +++ b/devtools/create_ultima/files/ultima4/conf/dtd/tileset.dtd @@ -16,9 +16,9 @@ index NMTOKEN #IMPLIED frames NMTOKEN #IMPLIED directions CDATA #IMPLIED - animation %anim; #IMPLIED + animation %anim; #IMPLIED rowtoswap NMTOKEN #IMPLIED - opaque %bool; #IMPLIED + opaque %bool; #IMPLIED frame NMTOKEN #IMPLIED tiledInDungeon %bool; #IMPLIED usesReplacementTileAsBackground %bool; #IMPLIED diff --git a/devtools/create_ultima/files/ultima4/conf/egaPalette.xml b/devtools/create_ultima/files/ultima4/conf/egaPalette.xml index 938f3d29732..80a8dd8f0a1 100644 --- a/devtools/create_ultima/files/ultima4/conf/egaPalette.xml +++ b/devtools/create_ultima/files/ultima4/conf/egaPalette.xml @@ -6,8 +6,8 @@ - - + + @@ -21,6 +21,6 @@ - + diff --git a/devtools/create_ultima/files/ultima4/conf/graphics.xml b/devtools/create_ultima/files/ultima4/conf/graphics.xml index 79954feb744..976c27284dc 100644 --- a/devtools/create_ultima/files/ultima4/conf/graphics.xml +++ b/devtools/create_ultima/files/ultima4/conf/graphics.xml @@ -23,13 +23,13 @@ - + - + @@ -114,7 +114,7 @@ - + @@ -424,13 +424,13 @@ - + - + @@ -515,7 +515,7 @@ - + @@ -756,13 +756,13 @@ - + - + @@ -847,7 +847,7 @@ - + @@ -927,12 +927,12 @@ - + - + @@ -980,7 +980,7 @@ - + @@ -1003,13 +1003,13 @@ - + - + @@ -1122,7 +1122,7 @@ - + @@ -1183,7 +1183,7 @@ - + @@ -1198,17 +1198,17 @@ - + - + - - - - + - - @@ -1279,7 +1279,7 @@ - + @@ -1309,13 +1309,13 @@ - + - + @@ -1400,7 +1400,7 @@ - + @@ -1452,7 +1452,7 @@ - + @@ -1511,7 +1511,7 @@ - + @@ -1706,7 +1706,7 @@ - + @@ -1744,15 +1744,15 @@ - + - + - + @@ -1760,7 +1760,7 @@ - + @@ -1815,15 +1815,15 @@ - + - + - + @@ -1874,11 +1874,11 @@ - + - + @@ -1933,11 +1933,11 @@ - + - + @@ -1992,11 +1992,11 @@ - + - + @@ -2052,16 +2052,16 @@ - + - + - - + + @@ -2112,15 +2112,15 @@ - + - + - + diff --git a/devtools/create_ultima/files/ultima4/conf/maps.xml b/devtools/create_ultima/files/ultima4/conf/maps.xml index c5064ea4e3a..7a03e6350c0 100644 --- a/devtools/create_ultima/files/ultima4/conf/maps.xml +++ b/devtools/create_ultima/files/ultima4/conf/maps.xml @@ -3,7 +3,7 @@ - @@ -23,7 +23,7 @@ - + @@ -69,7 +69,7 @@ - @@ -82,7 +82,7 @@ - @@ -90,7 +90,7 @@ - @@ -98,7 +98,7 @@ - @@ -241,7 +241,7 @@ - + @@ -251,7 +251,7 @@ - + @@ -259,7 +259,7 @@ - + @@ -268,12 +268,12 @@ - + - + @@ -281,8 +281,8 @@ - - + + @@ -294,11 +294,11 @@ - + - + @@ -307,23 +307,23 @@ - + - - + + - + - + @@ -368,7 +368,7 @@ + borderbehavior="fixed" nolineofsight="true" music="8" tileset="base" tilemap="base"/> - + diff --git a/devtools/create_ultima/files/ultima4/conf/tilemap-base.xml b/devtools/create_ultima/files/ultima4/conf/tilemap-base.xml index 34bad91155f..f4405a1bfd5 100644 --- a/devtools/create_ultima/files/ultima4/conf/tilemap-base.xml +++ b/devtools/create_ultima/files/ultima4/conf/tilemap-base.xml @@ -21,13 +21,13 @@ - + - + @@ -112,8 +112,8 @@ - - + + diff --git a/devtools/create_ultima/files/ultima4/conf/tilemap-dungeon.xml b/devtools/create_ultima/files/ultima4/conf/tilemap-dungeon.xml index c2f7376e6b8..08ba15db8e5 100644 --- a/devtools/create_ultima/files/ultima4/conf/tilemap-dungeon.xml +++ b/devtools/create_ultima/files/ultima4/conf/tilemap-dungeon.xml @@ -11,7 +11,7 @@ - + - + + + diff --git a/devtools/create_ultima/files/ultima4/conf/tileset-dungeon.xml b/devtools/create_ultima/files/ultima4/conf/tileset-dungeon.xml index 6d18a3388b2..3b2b3e39299 100644 --- a/devtools/create_ultima/files/ultima4/conf/tileset-dungeon.xml +++ b/devtools/create_ultima/files/ultima4/conf/tileset-dungeon.xml @@ -7,7 +7,7 @@ - + diff --git a/devtools/create_ultima/files/ultima4/conf/vendorScript.xml b/devtools/create_ultima/files/ultima4/conf/vendorScript.xml index 026d60e2f17..c6276b9cf45 100644 --- a/devtools/create_ultima/files/ultima4/conf/vendorScript.xml +++ b/devtools/create_ultima/files/ultima4/conf/vendorScript.xml @@ -5,10 +5,10 @@ @@ -316,7 +316,7 @@ + --> - + */ + --> - + diff --git a/devtools/create_ultima/files/ultima4/mid/minstrel/Readme.txt b/devtools/create_ultima/files/ultima4/mid/minstrel/Readme.txt index ed054d8fcbf..83834cfbf3e 100644 --- a/devtools/create_ultima/files/ultima4/mid/minstrel/Readme.txt +++ b/devtools/create_ultima/files/ultima4/mid/minstrel/Readme.txt @@ -1,7 +1,7 @@ ULTIMA IV - Quest of the Avatar - + (C) 1985 Origin Systems, Inc. - + Music by Kenneth W. Arnold diff --git a/devtools/create_ultima/files/ultima8/Vera_copyright.txt b/devtools/create_ultima/files/ultima8/Vera_copyright.txt index e651be1c4fe..40e356290c3 100644 --- a/devtools/create_ultima/files/ultima8/Vera_copyright.txt +++ b/devtools/create_ultima/files/ultima8/Vera_copyright.txt @@ -71,8 +71,8 @@ Copyright FAQ 2. I want to package these fonts separately for distribution and sale as part of a larger software package or system. Can I do so? - Yes. A RPM or Debian package is a "larger software package" to begin - with, and you aren't selling them independently by themselves. + Yes. A RPM or Debian package is a "larger software package" to begin + with, and you aren't selling them independently by themselves. See 1. above. 3. Are derivative works allowed? @@ -91,7 +91,7 @@ Copyright FAQ opening). You must include the Bitstream copyright. Additional copyrights can be added, as per copyright law. Happy Font Hacking! - 6. If I have improvements for Bitstream Vera, is it possible they might get + 6. If I have improvements for Bitstream Vera, is it possible they might get adopted in future versions? Yes. The contract between the Gnome Foundation and Bitstream has @@ -110,7 +110,7 @@ Copyright FAQ Sure. Bundle the fonts with your software and sell your software with the fonts. That is the intent of the copyright. - 8. If applications have built the names "Bitstream Vera" into them, + 8. If applications have built the names "Bitstream Vera" into them, can I override this somehow to use fonts of my choosing? This depends on exact details of the software. Most open source diff --git a/devtools/create_xeen/constants.cpp b/devtools/create_xeen/constants.cpp index 27d99810bb2..ef977b21abb 100644 --- a/devtools/create_xeen/constants.cpp +++ b/devtools/create_xeen/constants.cpp @@ -1453,7 +1453,7 @@ static const char *QUEST_ITEM_NAMES_SWORDS[51] = { "Holy Wheel", "Double Cross", "Sky Hook", "Sacred Cow", "Staff of the Mountain", "Hard Rock", "Soft Rock", "Rock Candy", "Ivy Plant", "Spirit Gem", "Temple of Sun holy lamp oil", "Noams Hammer", "Positive Orb", "Negative Orb", "FireBane Staff", "Diamond Edged Pick", - "Monga Melon", "Energy Disk", "Old XEEN Quest Item" + "Monga Melon", "Energy Disk", "Old XEEN Quest Item" }; static const int WEAPON_BASE_COSTS[35] = { diff --git a/devtools/create_xeen/create_xeen.cpp b/devtools/create_xeen/create_xeen.cpp index fef1412af90..d18ba178f5a 100644 --- a/devtools/create_xeen/create_xeen.cpp +++ b/devtools/create_xeen/create_xeen.cpp @@ -56,7 +56,7 @@ void NORETURN_PRE error(const char *s, ...) { static void writeVersion(CCArchive &cc) { Common::MemFile f; f.writeLong(VERSION_NUMBER); - cc.add("VERSION", f); + cc.add("VERSION", f); } int main(int argc, char *argv[]) { diff --git a/devtools/make-www-archive.py b/devtools/make-www-archive.py index 95aeb1533f5..06f8240502c 100755 --- a/devtools/make-www-archive.py +++ b/devtools/make-www-archive.py @@ -39,9 +39,9 @@ def main(): if not os.path.isdir(args.path): print ("Directory '" + args.path + "' does not exist!") return - else: + else: os.chdir(args.path) - + buildArchive("wwwroot") if __name__ == "__main__": diff --git a/devtools/sci/scifx/scifx_to_cpp.py b/devtools/sci/scifx/scifx_to_cpp.py index fb97b2981d0..36e3d68adaa 100644 --- a/devtools/sci/scifx/scifx_to_cpp.py +++ b/devtools/sci/scifx/scifx_to_cpp.py @@ -142,7 +142,7 @@ for F in sys.argv[1:]: l = l[3:] else: assert(False) - + ids = [] loops = [-1] cels = [-1] diff --git a/devtools/tasmrecover/dreamweb/backdrop.asm b/devtools/tasmrecover/dreamweb/backdrop.asm index f588e7d02b1..a662d22c65a 100644 --- a/devtools/tasmrecover/dreamweb/backdrop.asm +++ b/devtools/tasmrecover/dreamweb/backdrop.asm @@ -113,7 +113,7 @@ Calcmapad proc near Getdimension proc near ;Routine finds width, length ;and top corner of room - + mov es,buffers mov bx,mapflags mov ch,0 @@ -315,7 +315,7 @@ Eraseoldobs proc near mov es,buffers mov bx,spritetable - + mov cx,16 oberase: push cx bx mov ax,[es:bx+20] @@ -361,7 +361,7 @@ Showallobs proc near mov cx,128*5 mov al,255 rep stosb - + mov es,setframes mov frsegment,es mov ax,framedata @@ -372,7 +372,7 @@ Showallobs proc near mov ds,setdat mov si,0 - + mov cx,128 showobsloop: push cx si @@ -509,7 +509,7 @@ Showallfree proc near mov ds,freedat mov si,2 - + mov cx,0 loop127: push cx si @@ -526,7 +526,7 @@ loop127: push cx si add ax,ax add ax,dx mov currentframe,ax - + push es si call calcfrframe mov es,mapstore @@ -599,7 +599,7 @@ Showallex proc near mov currentex,0 mov si,exdata+2 - + mov cx,0 exloop: push cx si @@ -623,7 +623,7 @@ notinroom: pop si add ax,ax add ax,dx mov currentframe,ax - + push es si call calcfrframe mov es,mapstore @@ -673,7 +673,7 @@ finex: ret Calcfrframe proc near - + mov dx,frsegment mov ax,framesad push ax @@ -727,7 +727,7 @@ nullframe: pop ax Finalframe proc near - + mov ax,objecty add ax,offsety mov bx,objectx @@ -741,7 +741,7 @@ Finalframe proc near endp - + @@ -785,7 +785,7 @@ Getmapad proc near mov objecty,ax mov ch,1 over146: ret - + endp diff --git a/devtools/tasmrecover/dreamweb/debug.asm b/devtools/tasmrecover/dreamweb/debug.asm index f4321de7bf0..2a96cab37ac 100644 --- a/devtools/tasmrecover/dreamweb/debug.asm +++ b/devtools/tasmrecover/dreamweb/debug.asm @@ -71,7 +71,7 @@ Debuggreen proc near out dx,al pop dx ax ret - + endp @@ -96,7 +96,7 @@ Debugred proc near out dx,al pop dx ax ret - + endp @@ -117,7 +117,7 @@ Debugblue proc near out dx,al pop dx ax ret - + endp @@ -137,9 +137,9 @@ Debugblack proc near out dx,al mov al,0 out dx,al - pop ax dx + pop ax dx ret - + endp @@ -299,7 +299,7 @@ debugtextex: db "00000b",0 debugtextex2: db "00000b",0 - + @@ -351,7 +351,7 @@ debugtextr: db "00000",0 ; pop ax ; mov di,offset cs:debugaxtext ; call showword -; +; ; mov di,204 ; mov bx,14 ; mov al,0 @@ -369,7 +369,7 @@ debugtextr: db "00000",0 ; ret ; ;debugaxtext db "00000 ",0 -; +; ; endp diff --git a/devtools/tasmrecover/dreamweb/dreamweb.asm b/devtools/tasmrecover/dreamweb/dreamweb.asm index 28165a51ab4..0ffcda9e2ad 100644 --- a/devtools/tasmrecover/dreamweb/dreamweb.asm +++ b/devtools/tasmrecover/dreamweb/dreamweb.asm @@ -10,21 +10,21 @@ -;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ -;³ ³ -;³ DREAMWEB ³ -;³ ³ -;³ ³ -;³ ³ -;³ ³ -;³ Written by Neil Dodwell. Graphics by Dave Dew. ³ -;³ ³ -;³ Started on Friday 28 December 1990 at 1:20 pm ³ -;³ ³ -;³ Copyright 1990/1991 Creative Reality ³ ³ -;³ ³ -;³ ³ -;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ +;�������������������������������������������������������������������Ŀ +;� � +;� DREAMWEB � +;� � +;� � +;� � +;� � +;� Written by Neil Dodwell. Graphics by Dave Dew. � +;� � +;� Started on Friday 28 December 1990 at 1:20 pm � +;� � +;� Copyright 1990/1991 Creative Reality � � +;� � +;� � +;��������������������������������������������������������������������� @@ -124,7 +124,7 @@ Dreamweb proc near cmp al,0 jnz dodecisions endif - + call setmode call loadpalfromiff @@ -265,7 +265,7 @@ exitgame: if demo Changeroomnums proc near - + mov di,offset cs:roomdata+10 mov cx,50 changenumloop: mov al,[cs:di] @@ -437,7 +437,7 @@ makedoorsopen: mov al,4 call placesetobject ret nottopchurch: cmp location,47 - jnz notdreamcentre + jnz notdreamcentre mov al,4 call placesetobject mov al,5 @@ -503,7 +503,7 @@ Initialinv proc near mov al,16 mov ah,2 call pickupob - + mov al,2 mov ah,4 call pickupob @@ -564,7 +564,7 @@ isedens: mov al,11 endp - endif + endif @@ -608,13 +608,13 @@ Pickupob proc near Setupemm proc near - + cmp soundint,255 jz noneedforemm call checkforemm - + mov ah,43h ;allocate handle and 160 pages - mov bx,176 ;was 176 + mov bx,176 ;was 176 int 67h cmp ah,0 jnz emmerror1 ;if there's an error drop to DOS @@ -642,7 +642,7 @@ emmerror1: mov gameerror,1 Removeemm proc near - + cmp soundint,255 jz noneedtoremove mov ah,45h @@ -679,7 +679,7 @@ enoughmem: ret Allocatebuffers proc near - + mov bx,lengthofextra/16 call allocatemem mov extras,ax @@ -722,7 +722,7 @@ Allocatebuffers proc near endif call allocatework - + mov bx,2048/16 call allocatemem mov sounddata,ax @@ -764,7 +764,7 @@ Clearbuffers proc near mov si,offset cs:reelroutines mov cx,lenofreelrouts rep movsb - + mov es,buffers mov di,initialvars push cs @@ -804,7 +804,7 @@ Clearchanges proc near mov di,offset cs:startvars mov cx,lengthofvars rep movsb - + mov expos,0 mov exframepos,0 mov extextpos,0 @@ -955,17 +955,17 @@ Seecommandtail proc near mov soundint,5 mov sounddmachannel,1 mov brightness,0 - + mov bx,2 mov ax,[es:bx] mov dx,es sub ax,dx mov howmuchalloc,ax - + mov bx,02ch mov ax,[es:bx] push es bx - + mov es,ax mov bx,0 findblaster: mov ax,[es:bx] @@ -990,7 +990,7 @@ findblaster: mov ax,[es:bx] jmp endofenvironment notblast: inc bx jmp findblaster - + endofenvironment: pop bx es mov bx,81h call parseblaster @@ -1001,7 +1001,7 @@ endofenvironment: pop bx es Parseblaster proc near - + lookattail: mov al,[es:bx] cmp al,0 jz endtail @@ -1330,7 +1330,7 @@ Showtime proc near jz nowatch mov al,secondcount - mov cl,0 + mov cl,0 call twodigitnum push ax mov al,ah @@ -1372,7 +1372,7 @@ Showtime proc near call twodigitnum push ax mov al,ah - mov ah,0 + mov ah,0 add ax,91*3 mov ds,charset1 mov di,256+5 @@ -1393,7 +1393,7 @@ Showtime proc near call showframe nowatch: ret - + endp @@ -1648,7 +1648,7 @@ Identifyob proc near cmp watchingtime,0 jnz blank - + mov ax,mousex sub ax,mapadx cmp ax,22*8 @@ -2015,7 +2015,7 @@ Turnpathon proc near ;turns path on permanently push ax ax mov cl,255 - mov ch,roomnum + mov ch,roomnum add ch,100 call findormake pop ax @@ -2289,23 +2289,23 @@ atmospherelist: db 0,33,10,15,255 db 10,33,30,6,255 db 10,22,30,6,255 - + db 9,22,10,6,255 db 9,22,20,16,255 db 9,22,30,16,255 db 9,22,40,16,255 db 9,22,50,16,255 - + db 6,11,30,6,255 db 6,0,10,15,255 db 6,0,20,15,255 db 6,11,20,15,255 db 6,22,20,15,255 - + db 7,11,20,6,255 db 7,0,20,6,255 db 7,0,30,6,255 - + db 55,44,0,5,255 db 55,44,10,5,255 @@ -2332,12 +2332,12 @@ atmospherelist: db 0,33,10,15,255 db 8,33,40,6,255 db 8,22,40,6,255 db 8,11,40,6,255 - + db 11,11,20,12,255 db 11,11,30,12,255 db 11,22,20,12,255 db 11,22,30,12,255 - + db 12,22,20,12,255 db 13,22,20,12,255 db 13,33,20,12,255 @@ -2349,7 +2349,7 @@ atmospherelist: db 0,33,10,15,255 db 14,33,30,12,255 db 14,33,40,12,255 db 14,22,0,16,255 - + db 19,0,0,12,255 db 20,0,20,16,255 @@ -2438,7 +2438,7 @@ atmospherelist: db 0,33,10,15,255 Walkintoroom proc near - + cmp location,14 jnz notlair cmp mapx,22 @@ -2630,7 +2630,7 @@ Commandwithob proc near push ax bx cx dx es ds si di call deltextline pop di si ds es dx cx bx ax - + push bx mov ah,0 add ax,ax @@ -2639,7 +2639,7 @@ Commandwithob proc near mov ax,[es:bx] add ax,textstart mov si,ax - + mov di,textaddressx mov bx,textaddressy mov dl,textlen @@ -2665,10 +2665,10 @@ noadd: mov bx,textaddressy mov ah,0 call printdirect mov newtextline,1 - ret + ret commandline: db "OBJECT NAME ONE ",0 - + endp @@ -2679,7 +2679,7 @@ Commandonly proc near push ax bx cx dx es ds si di call deltextline pop di si ds es dx cx bx ax - + mov ah,0 add ax,ax mov bx,ax @@ -2687,7 +2687,7 @@ Commandonly proc near mov ax,[es:bx] add ax,textstart mov si,ax - + mov di,textaddressx mov bx,textaddressy mov dl,textlen @@ -3241,7 +3241,7 @@ Getroomspaths proc near - + @@ -3332,7 +3332,7 @@ notfreename: cmp ah,1 add ax,settext mov si,ax ret - + notsetname: mov ds,blockdesc add bx,blocktextdat mov ax,[bx] @@ -3682,7 +3682,7 @@ nowristwatch: ret Gettime proc near - + mov ah,2ch int 21h mov secondcount,dh @@ -3925,7 +3925,7 @@ hangloop: push cx cmp ax,oldbutton jnz getoutofit notpressed: loop hangloop - + getoutofit: call delpointer pop ax mov pointerframe,al @@ -4153,7 +4153,7 @@ notsmally2: mov pointerxs,cl mov ah,128 call showframe ret - + endp @@ -4728,72 +4728,72 @@ Randomnum2 proc near Randomnumber proc near - mov al,seed - and al,48h - add al,38h - sal al,1 - sal al,1 - rcl seed+2,1 - rcl seed+1,1 - rcl seed+0,1 - mov al,seed - and al,48h - add al,38h - sal al,1 - sal al,1 - rcl seed+2,1 - rcl seed+1,1 - rcl seed+0,1 - mov al,seed - and al,48h - add al,38h - sal al,1 - sal al,1 - rcl seed+2,1 - rcl seed+1,1 - rcl seed+0,1 - mov al,seed - and al,48h - add al,38h - sal al,1 - sal al,1 - rcl seed+2,1 - rcl seed+1,1 - rcl seed+0,1 - mov al,seed - and al,48h - add al,38h - sal al,1 - sal al,1 - rcl seed+2,1 - rcl seed+1,1 - rcl seed+0,1 - mov al,seed - and al,48h - add al,38h - sal al,1 - sal al,1 - rcl seed+2,1 - rcl seed+1,1 - rcl seed+0,1 - mov al,seed - and al,48h - add al,38h - sal al,1 - sal al,1 - rcl seed+2,1 - rcl seed+1,1 - rcl seed+0,1 - mov al,seed - and al,48h - add al,38h - sal al,1 - sal al,1 - rcl seed+2,1 - rcl seed+1,1 - rcl seed+0,1 - - mov al,seed + mov al,seed + and al,48h + add al,38h + sal al,1 + sal al,1 + rcl seed+2,1 + rcl seed+1,1 + rcl seed+0,1 + mov al,seed + and al,48h + add al,38h + sal al,1 + sal al,1 + rcl seed+2,1 + rcl seed+1,1 + rcl seed+0,1 + mov al,seed + and al,48h + add al,38h + sal al,1 + sal al,1 + rcl seed+2,1 + rcl seed+1,1 + rcl seed+0,1 + mov al,seed + and al,48h + add al,38h + sal al,1 + sal al,1 + rcl seed+2,1 + rcl seed+1,1 + rcl seed+0,1 + mov al,seed + and al,48h + add al,38h + sal al,1 + sal al,1 + rcl seed+2,1 + rcl seed+1,1 + rcl seed+0,1 + mov al,seed + and al,48h + add al,38h + sal al,1 + sal al,1 + rcl seed+2,1 + rcl seed+1,1 + rcl seed+0,1 + mov al,seed + and al,48h + add al,38h + sal al,1 + sal al,1 + rcl seed+2,1 + rcl seed+1,1 + rcl seed+0,1 + mov al,seed + and al,48h + add al,38h + sal al,1 + sal al,1 + rcl seed+2,1 + rcl seed+1,1 + rcl seed+0,1 + + mov al,seed ret endp @@ -4879,7 +4879,7 @@ Loadtempcharset proc near call standardload mov tempcharset,ax ret - + endp @@ -5069,7 +5069,7 @@ dontrestore: ret Restoreall proc near - + mov al,location call getroomdata mov dx,bx @@ -5171,7 +5171,7 @@ Restoreall proc near call loadseg call closefile - + call setallchanges ret @@ -5180,7 +5180,7 @@ Restoreall proc near Sortoutmap proc near - + push es di mov ds,workspace mov si,0 @@ -5469,7 +5469,7 @@ Getroomdata proc near - + Readheader proc near @@ -5485,8 +5485,8 @@ Readheader proc near ret endp - - + + @@ -5629,7 +5629,7 @@ Getridoftempsp proc near - + Readsetdata proc near mov dx,offset cs:characterset1 @@ -5731,7 +5731,7 @@ Openfilefromc proc near pop dx mov handle,ax ret - + endp endif @@ -5839,7 +5839,7 @@ Setkeyboardint proc near Resetkeyboard proc near cmp oldint9add,-1 - jz noreset + jz noreset mov dx,oldint9add ;Restore old interupt vector mov ax,oldint9seg ;for keys mov ds,ax @@ -5890,7 +5890,7 @@ Keyboardread proc near mov di,offset cs:keybuffer mov dx,bufferin add di,dx - mov [cs:di],al + mov [cs:di],al same: in al,61h mov ah,al or al,80h ; Mask for Akn @@ -6002,7 +6002,7 @@ Roomdata db "DREAMWEB.R00",0 ;Ryan's apartment db 32 dup (0) db 32 dup (0) db 32 dup (0) - + db "DREAMWEB.R19",0 db 19,255,0,0 db 255,255,255,0 @@ -6206,7 +6206,7 @@ Roomdata db "DREAMWEB.R00",0 ;Ryan's apartment db 255,255,255,0 db 0,0,255,255,255,255,255,255,255,255,55 - + Madeuproomdat db 32 dup (0) Roomscango db 1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/devtools/tasmrecover/dreamweb/keypad.asm b/devtools/tasmrecover/dreamweb/keypad.asm index 29542937c19..2c525fa4841 100644 --- a/devtools/tasmrecover/dreamweb/keypad.asm +++ b/devtools/tasmrecover/dreamweb/keypad.asm @@ -102,7 +102,7 @@ keypadlist: dw keypadx+9,keypadx+30,keypady+9,keypady+22,buttonone Loadkeypad proc near - + mov dx,offset cs:extragraphics1 call loadintotemp ret @@ -793,7 +793,7 @@ notaristoadd: ret Lastfolder proc near - + cmp folderpage,0 jnz canlastf call blank @@ -875,7 +875,7 @@ Showfolder proc near mov ah,0 call showframe call folderexit - + cmp folderpage,1 jz noleftpage call showleftpage @@ -939,7 +939,7 @@ Showleftpage proc near mov bx,12+5 mov cx,9 -leftpageloop: push cx bx +leftpageloop: push cx bx mov ds,tempgraphics2 mov di,0 mov al,4 @@ -1002,7 +1002,7 @@ flipfolderline: mov al,[es:di] add di,320 loop flipfolder ret - + endp @@ -1018,7 +1018,7 @@ Showrightpage proc near mov bx,12+37 mov cx,7 -rightpageloop: push cx bx +rightpageloop: push cx bx mov ds,tempgraphics2 mov di,143 mov al,1 @@ -1350,7 +1350,7 @@ topwrap: mov al,0 ret botwrap: mov al,6 ret - + endp @@ -1560,7 +1560,7 @@ gotkeyn: mov ah,0 call showframe cmp presscount,1 jnz notshown - call showdiarypage + call showdiarypage notshown: ret nokeyn: mov al,5 @@ -1602,7 +1602,7 @@ Dumpdiarykeys proc near jz notsartadd mov al,6 call setlocation - + call delpointer mov al,12 call findtext1 @@ -1622,7 +1622,7 @@ Dumpdiarykeys proc near call worktoscreenm call showpointer ret - + notsartadd: mov di,diaryx+48 mov bx,diaryy+15 mov cl,200 diff --git a/devtools/tasmrecover/dreamweb/monitor.asm b/devtools/tasmrecover/dreamweb/monitor.asm index 25075e7eb7c..9cee3b58447 100644 --- a/devtools/tasmrecover/dreamweb/monitor.asm +++ b/devtools/tasmrecover/dreamweb/monitor.asm @@ -53,7 +53,7 @@ keyloop: mov byte ptr [es:di],0 mov monadx,76 mov monady,141 mov al,1 - call monmessage + call monmessage mov cx,120 call hangoncurs mov al,2 @@ -728,7 +728,7 @@ dirroot: mov logonum,0 rep movsb call monitorlogo call scrollmonitor - + mov al,9 call monmessage diff --git a/devtools/tasmrecover/dreamweb/newplace.asm b/devtools/tasmrecover/dreamweb/newplace.asm index d2f54509dd4..924d292a197 100644 --- a/devtools/tasmrecover/dreamweb/newplace.asm +++ b/devtools/tasmrecover/dreamweb/newplace.asm @@ -31,9 +31,9 @@ Selectlocation proc near call clearbeforeload mov getback,0 mov pointerframe,22 - + call readcitypic - call showcity + call showcity call getridoftemp call readdesticon call loadtraveltext @@ -123,9 +123,9 @@ Showcity proc near endp - - - + + + Lookatplace proc near cmp commandtype,224 @@ -184,7 +184,7 @@ $2: mov dl,191 mov al,0 mov ah,0 - call printdirect + call printdirect call worktoscreenm mov cx,500 @@ -560,7 +560,7 @@ Readdesticon proc near mov dx,offset cs:travelgraphic2 call loadintotemp2 - + mov dx,offset cs:icongraphics8 call loadintotemp3 ret diff --git a/devtools/tasmrecover/dreamweb/object.asm b/devtools/tasmrecover/dreamweb/object.asm index f7068d2cb03..bd291c17a48 100644 --- a/devtools/tasmrecover/dreamweb/object.asm +++ b/devtools/tasmrecover/dreamweb/object.asm @@ -3,7 +3,7 @@ ;See LICENSE file for full license text ;---------------------------------------------------------Inventory printer---- -Fillryan proc near +Fillryan proc near ; cx=what to search for mov es,buffers mov di,ryaninvlist @@ -14,7 +14,7 @@ Fillryan proc near mov cx,20 mul cx add si,ax - + mov di,inventx mov bx,inventy @@ -49,7 +49,7 @@ ryanloop1: push cx di bx -Fillopen proc near +Fillopen proc near call deltextline @@ -103,13 +103,13 @@ nextopenslot: pop es si Findallryan proc near - + push di mov cx,30 mov ax,0ffffh rep stosw pop di - + mov cl,4 mov ds,extras mov bx,exdata @@ -142,7 +142,7 @@ notinryaninv: add bx,16 Findallopen proc near - + push di mov cx,16 mov ax,0ffffh @@ -303,7 +303,7 @@ examineagain: mov inmaparea,0 mov objecttype,al mov itemframe,0 mov pointerframe,0 - + call createpanel call showpanel call showman @@ -541,13 +541,13 @@ Openob proc near mov ah,openedtype mov di,offset cs:commandline call copyname - + mov di,inventx mov bx,inventy+86 mov al,62 mov dl,240 call printmessage - + mov di,lastxpos add di,5 mov bx,inventy+86 @@ -558,7 +558,7 @@ Openob proc near mov al,0 mov ah,0 call printdirect - + call fillopen call getopenedsize mov al,ah @@ -704,7 +704,7 @@ notsetd2: call additionaltext ret - + endp @@ -839,7 +839,7 @@ findsometext: call searchforsame Searchforsame proc near - + mov si,cx searchagain: inc si mov al,[es:bx] @@ -1212,7 +1212,7 @@ sizeok2: mov ah,objecttype mov ax,[es:bx] mov itemframe,al mov objecttype,ah - + cmp ah,4 jnz makeswapex call geteitherad @@ -1273,7 +1273,7 @@ actuallyswap: mov bl,itemframe Intoinv proc near cmp pickup,0 - jnz notout + jnz notout call outofinv ret @@ -1351,7 +1351,7 @@ notinhere: add si,16 loop takenloop ret - + endp @@ -1407,7 +1407,7 @@ dograb: call delpointer call worktoscreen call delpointer ret - + endp @@ -1422,7 +1422,7 @@ Getfreead proc near mov bx,ax mov es,freedat ret - + endp @@ -1441,7 +1441,7 @@ Getexad proc near mov es,extras add bx,exdata ret - + endp @@ -1546,7 +1546,7 @@ Getsetad proc near mov bx,ax mov es,setdat ret - + endp @@ -1872,7 +1872,7 @@ Useopened proc near cmp openedob,255 jz cannotuseopen cmp pickup,0 - jnz notout2 + jnz notout2 call outofopen ret @@ -2135,7 +2135,7 @@ dogrb: call delpointer mov ax,[es:bx] mov itemframe,al mov objecttype,ah - + cmp ah,4 jnz makeintoex call geteitherad @@ -2149,7 +2149,7 @@ makeintoex: call transfertoex call geteitherad mov byte ptr [es:bx+2],20 ; means it is in transit mov byte ptr [es:bx+3],255 - + actuallyout: call fillopen call undertextline call readmouse @@ -2412,7 +2412,7 @@ dontpurge: add di,16 - + Emergencypurge proc near @@ -2458,7 +2458,7 @@ cantpurge: add di,16 inc cx cmp cx,numexobjects jnz lookforpurge - + mov di,exdata mov bl,reallocation mov cx,0 @@ -2507,7 +2507,7 @@ Deleteexobject proc near ;es:di holds data ad mov di,exdata mov cx,0 deleteconts: cmp [es:di+2],bx - jnz notinsideex + jnz notinsideex push bx cx di call deleteexobject ;Oooh missus! pop di cx bx ;Recursive code! @@ -2539,7 +2539,7 @@ Deleteexframe proc near ;al holds frame to delete ;frame in bytes mov si,[es:di+2] push si - add si,exframes + add si,exframes mov cx,exframeslen sub cx,[es:di+2] mov di,si ;di/si hold start of frame @@ -2550,7 +2550,7 @@ Deleteexframe proc near ;al holds frame to delete rep movsb pop bx ;bx holds size now sub exframepos,bx - pop si ;si holds start of frame + pop si ;si holds start of frame ;(offset only) mov cx,numexobjects*3 mov di,exframedata @@ -2584,7 +2584,7 @@ findlenextext: mov cl,[es:si] inc ax inc si cmp cl,0 - jnz findlenextext + jnz findlenextext mov cx,extextlen mov bx,si @@ -2594,7 +2594,7 @@ findlenextext: mov cl,[es:si] rep movsb pop bx sub extextpos,bx - + pop si mov cx,numexobjects mov di,extextdat diff --git a/devtools/tasmrecover/dreamweb/print.asm b/devtools/tasmrecover/dreamweb/print.asm index 22ca61b8b12..7a6fb9b15ea 100644 --- a/devtools/tasmrecover/dreamweb/print.asm +++ b/devtools/tasmrecover/dreamweb/print.asm @@ -117,7 +117,7 @@ kernit: dec cl ; call getnumber ; pop es ; mov ch,0 -;printloop1: mov ax,[cs:si] +;printloop1: mov ax,[cs:si] ; inc si ; cmp al,0 ; jz finishprint @@ -248,7 +248,7 @@ Printdirect proc near mov lastxpos,di mov ds,currentset -printloop6: push bx di dx +printloop6: push bx di dx call getnumber mov ch,0 printloop5: mov ax,[es:si] @@ -585,7 +585,7 @@ not173: cmp al,129 not129: ret nomod: ret - + endp endif diff --git a/devtools/tasmrecover/dreamweb/saveload.asm b/devtools/tasmrecover/dreamweb/saveload.asm index a49b527d019..e4838bd8b6b 100644 --- a/devtools/tasmrecover/dreamweb/saveload.asm +++ b/devtools/tasmrecover/dreamweb/saveload.asm @@ -109,7 +109,7 @@ restartops: call showopbox call showmainops call worktoscreenm donefirstops: mov getback,0 -waitops: +waitops: cmp quitrequested, 0 jnz justret @@ -264,7 +264,7 @@ doload: mov loadingorsave,1 call namestoold mov getback,0 -loadops: +loadops: cmp quitrequested, 0 jnz quitloaded @@ -655,7 +655,7 @@ Showopbox proc near mov al,0 mov ah,0 call showframe - + mov ds,tempgraphics mov di,opsx mov bx,opsy+55 @@ -935,13 +935,13 @@ quickquit: if recording mov ax,4c00h int 21h ret - + endp Error proc near - + cmp gameerror,1 jz error1 cmp gameerror,2 @@ -959,7 +959,7 @@ Error proc near cmp gameerror,8 jz error8 ret - + error1: mov dx,offset cs:gameerror1 jmp generalerror @@ -980,10 +980,10 @@ error3: mov dx,offset cs:gameerror3 error4: mov dx,offset cs:gameerror4 jmp generalerror - + error5: mov dx,offset cs:gameerror5 jmp generalerror - + error6: mov al,soundint add al,"0" mov bx,offset cs:error6patch @@ -1006,7 +1006,7 @@ generalerror: mov ah,9h ret nodos: ret - + gameerror1: db 13,10,13,10 db "Dreamweb has an Error:",13,10 db "Unable to allocate Expanded Memory." @@ -1160,7 +1160,7 @@ Saveposition proc near mov ds,dx mov dx,offset startvars call saveseg - + mov ds,extras mov dx,exframedata call saveseg @@ -1217,7 +1217,7 @@ Loadposition proc near push cs pop es mov di,offset cs:filedata - + pop ax mov cx,17 mul cx @@ -1226,7 +1226,7 @@ Loadposition proc near mov dx,offset savenames add dx,ax call loadseg - + mov dx,seg startvars mov ds,dx mov dx,offset startvars @@ -1325,7 +1325,7 @@ Saveseg proc near mov bx,handle mov ah,40h int 21h - pop es di + pop es di ret endp @@ -1402,7 +1402,7 @@ Decide proc near call setmode call loadpalfromiff - call clearpalette + call clearpalette mov pointermode,0 mov watchingtime,0 mov pointerframe,0 @@ -1416,7 +1416,7 @@ Decide proc near call fadescreenup mov getback,0 -waitdecide: +waitdecide: cmp quitrequested, 0 jz $1 ret @@ -1491,7 +1491,7 @@ nonewgame: ret - + Loadold proc near cmp commandtype,252 diff --git a/devtools/tasmrecover/dreamweb/sblaster.asm b/devtools/tasmrecover/dreamweb/sblaster.asm index 5eef2dbfd8d..96966b0ad77 100644 --- a/devtools/tasmrecover/dreamweb/sblaster.asm +++ b/devtools/tasmrecover/dreamweb/sblaster.asm @@ -4,7 +4,7 @@ ; Creative Reality Sound Blaster Drivers . (C) 1994 Creative Reality ; Very sparsly commented. - + ;These drivers are not stand alone. We had them as an integral part of the @@ -32,7 +32,7 @@ ;------------------------------------------- Initial sound set up and end --- Loadspeech proc near - + cmp soundint,255 jz dontbother8 @@ -40,7 +40,7 @@ Loadspeech proc near mov speechloaded,0 call createname - + mov speechlength,0 mov dx,offset cs:speechfilename call openfilenocheck @@ -49,7 +49,7 @@ Loadspeech proc near mov bx,speechemmpage moreloadspeech: push dx bx - + push es di bx mov al,2 mov dx,emmhandle @@ -73,7 +73,7 @@ moreloadspeech: push dx bx mov cx,4000h mov ax,0 rep stosw - pop di es + pop di es mov cx,8000h mov dx,8000h @@ -83,7 +83,7 @@ moreloadspeech: push dx bx add speechlength,ax pop bx dx add bx,2 - cmp ax,0 + cmp ax,0 jnz moreloadspeech call closefile @@ -111,7 +111,7 @@ Createname proc near mov di,offset cs:speechfile mov byte ptr [cs:di+0],dl ;"R" mov [cs:di+3],cl - + mov al,dh ;reallocation mov ah,"0"-1 findten: inc ah @@ -121,7 +121,7 @@ findten: inc ah add al,10+"0" mov [cs:di+2],al pop ax - + mov cl,"0"-1 thousandsc: inc cl sub ax,1000 @@ -155,7 +155,7 @@ Loadsample proc near cmp soundint,255 jz dontbother - + call openfile call readheader mov bx,[es:di] @@ -171,11 +171,11 @@ Loadsample proc near mov dx,[es:di] add dx,1 shr dx,1 - + mov soundemmpage,0 moreload: push dx bx - + push es di bx mov al,2 mov dx,emmhandle @@ -194,7 +194,7 @@ moreload: push dx bx cmp ah,0 jnz emmerror mov ds,emmpageframe - pop di es + pop di es mov cx,8000h mov dx,8000h @@ -202,7 +202,7 @@ moreload: push dx bx pop bx dx add bx,2 add soundemmpage,2 - dec dx + dec dx jnz moreload ;inc soundemmpage call closefile @@ -265,7 +265,7 @@ adjustemmpage: mov al,[es:di] shr dx,1 moreload2: push dx bx - + push es di bx mov al,2 mov dx,emmhandle @@ -284,7 +284,7 @@ moreload2: push dx bx cmp ah,0 jnz emmerror2 mov ds,emmpageframe - pop di es + pop di es mov cx,8000h mov dx,8000h @@ -292,7 +292,7 @@ moreload2: push dx bx pop bx dx add bx,2 add speechemmpage,2 - dec dx + dec dx jnz moreload2 call closefile dontbother9: ret @@ -318,7 +318,7 @@ Soundstartup proc near mov dx,soundbaseadd add dx,0ch mov DSP_write,dx - + mov al,1 mov dx,soundbaseadd add dx,0006h @@ -368,7 +368,7 @@ dspready: call trysoundalloc int 21h ; Set to new call enablesoundint - + mov al,sounddmachannel xor ah,ah mov bx,offset cs:dmaaddresses @@ -440,7 +440,7 @@ Setsoundoff proc near mov soundbufferwrite,4096 call startdmablock sti -dontbother28: ret +dontbother28: ret endp @@ -450,7 +450,7 @@ dontbother28: ret Checksoundint proc near - + mov ah,0d3h ;speaker off call out22c @@ -470,7 +470,7 @@ Checksoundint proc near int 21h call enablesoundint - + mov ah,0f2h call out22c @@ -479,7 +479,7 @@ Checksoundint proc near call disablesoundint - mov dx,oldsoundintseg + mov dx,oldsoundintseg mov ds,dx mov dx,oldsoundintadd ;Restore old interupt vector mov ah,25h @@ -542,7 +542,7 @@ Interupttest proc near out 20h,al pop dx ax iret - + endp @@ -558,7 +558,7 @@ Soundend proc near mov ah,0d0h call out22c - + call disablesoundint mov ds,oldsoundintseg ;for keys @@ -601,7 +601,7 @@ Playchannel0 proc near ;al=sound no ;ah=times to repeat cmp soundint,255 jz dontbother4 - + push es ds bx cx di si mov ch0playing,al @@ -624,7 +624,7 @@ notsecondbank: mov ch0repeat,ah mov ch0offset,ax mov ax,[es:bx+3] mov ch0blockstocopy,ax - + cmp ch0repeat,0 jz nosetloop mov ax,ch0emmpage @@ -673,7 +673,7 @@ notsecondbank1: mov ah,0 mov ch1offset,ax mov ax,[es:bx+3] mov ch1blockstocopy,ax - + pop si di cx bx ds es dontbother5: ret @@ -688,7 +688,7 @@ dontbother5: ret Makenextblock proc near - + call volumeadjust call loopchannel0 @@ -723,7 +723,7 @@ notch0only: mov es,soundbuffer and di,16384-1 mov soundbufferwrite,di ret - + endp @@ -737,7 +737,7 @@ Volumeadjust proc near mov al,volume cmp al,volumeto jz volfinish - add volumecount,64 + add volumecount,64 jnz volok mov al,volume add al,volumedirection @@ -766,7 +766,7 @@ endlessloop: mov ax,ch0oldemmpage mov ax,ch0blockstocopy add ax,ch0oldblockstocopy mov ch0blockstocopy,ax - ret + ret notloop: ret endp @@ -807,12 +807,12 @@ Channel0only proc near mov dx,emmhandle mov ah,44h int 67h - + mov es,soundbuffer mov ds,emmpageframe mov di,soundbufferwrite mov si,ch0offset - + call channel0tran call restoreems @@ -838,7 +838,7 @@ Channel1only proc near mov dx,emmhandle mov ah,44h int 67h - + mov es,soundbuffer mov ds,emmpageframe mov di,soundbufferwrite @@ -884,7 +884,7 @@ volloop: lodsw stosw loop volloop ret - + endp @@ -922,7 +922,7 @@ Bothchannels proc near ;rather slow routine call domix call restoreems - + and di,16384-1 mov soundbufferwrite,di @@ -980,7 +980,7 @@ Domix proc near slow: lodsb mov ah,[bx] - inc bx + inc bx cmp al,dh jnc toplot @@ -990,11 +990,11 @@ botlot: cmp ah,dh js botok xor al,al stosb - loop slow + loop slow jmp doneit botok: xor al,dh stosb - loop slow + loop slow jmp doneit toplot: cmp ah,dh @@ -1003,13 +1003,13 @@ toplot: cmp ah,dh jns topok mov al,dl stosb - loop slow + loop slow jmp doneit topok: xor al,dh stosb - loop slow + loop slow jmp doneit - + nodistort: add al,ah xor al,dh stosb @@ -1026,7 +1026,7 @@ lowvolumemix: lodsb pop bx mov ah,[bx] - inc bx + inc bx cmp al,dh jnc toplotv @@ -1036,11 +1036,11 @@ botlotv: cmp ah,dh js botokv xor al,al stosb - loop lowvolumemix + loop lowvolumemix jmp doneit botokv: xor al,dh stosb - loop lowvolumemix + loop lowvolumemix jmp doneit toplotv: cmp ah,dh @@ -1049,13 +1049,13 @@ toplotv: cmp ah,dh jns topokv mov al,dl stosb - loop lowvolumemix + loop lowvolumemix jmp doneit topokv: xor al,dh stosb - loop lowvolumemix + loop lowvolumemix jmp doneit - + nodistortv: add al,ah xor al,dh stosb @@ -1072,7 +1072,7 @@ doneit: ret Dmaend proc near - + cli push ax cx dx call startdmablock @@ -1107,7 +1107,7 @@ Startdmablock proc near out 0ah,al xor al,al out 0ch,al - + mov al,48h or al,sounddmachannel out 0bh,al @@ -1136,7 +1136,7 @@ Startdmablock proc near mov al,sounddmachannel out 0ah,al ;dmac programmed - + mov dx,DSP_write notclear1: in al,dx or al,al @@ -1186,7 +1186,7 @@ SetupPIT proc near mov ah,25h mov al,8 int 21h ; Set to new - + mov al,34h out 43h,al mov al,0h @@ -1207,8 +1207,8 @@ Getridofpit proc near cmp oldint8seg,-1 jz noresetPIT mov dx,oldint8add - mov ax,oldint8seg - mov ds,ax + mov ax,oldint8seg + mov ds,ax mov ah,25h mov al,8 int 21h @@ -1231,7 +1231,7 @@ PITinterupt proc near cli push ax dx cx - + xor dh,dh mov dl,sounddmachannel shl dl,1 @@ -1248,7 +1248,7 @@ PITinterupt proc near jnc mustgo cmp ax,2048 jnc nopitflip - + mustgo: push bx si di es ds call makenextblock pop ds es di si bx diff --git a/devtools/tasmrecover/dreamweb/sprite.asm b/devtools/tasmrecover/dreamweb/sprite.asm index c6a75063a06..22bc205dd46 100644 --- a/devtools/tasmrecover/dreamweb/sprite.asm +++ b/devtools/tasmrecover/dreamweb/sprite.asm @@ -64,7 +64,7 @@ Reelroutines db 1,44,0 ;Room number and x,y db 23,0,50 dw 0 db 3,0,0 - + db 28,11,20 dw 250 db 4,0,0 @@ -228,11 +228,11 @@ Reelroutines db 1,44,0 ;Room number and x,y db 11,11,20 dw 0 db 50,20,0 - + db 11,11,30 dw 0 db 50,20,0 - + db 11,22,20 dw 0 db 50,20,0 @@ -345,7 +345,7 @@ gotrecep: call showgamereel jz nottalkedrecep mov talkedtorecep,1 nottalkedrecep: ret - + endp @@ -487,7 +487,7 @@ notlouis1: ret Louischair proc near - + cmp rockstardead,0 jz notlouis2 call checkspeed @@ -636,7 +636,7 @@ Barwoman proc near Interviewer proc near - + cmp reeltowatch,68 jnz notgeneralstart inc word ptr [es:bx+3] @@ -669,7 +669,7 @@ Soldier1 proc near mov mandead,2 jmp gotsoldframe notaftersshot: call checkspeed - jnz gotsoldframe + jnz gotsoldframe inc word ptr [es:bx+3] jmp gotsoldframe soldierwait: cmp lastweapon,1 @@ -734,7 +734,7 @@ rockspeed: call showgamereel mov pointermode,2 mov watchingtime,0 ret - + notalkrock: mov watchingtime,2 mov pointermode,0 mov al,mapy @@ -755,7 +755,7 @@ rockcombatend: mov newlocation,45 - + @@ -860,7 +860,7 @@ endmugger1: push es bx mov al,"W" mov ah,"E" mov cl,"T" - mov ch,"A" + mov ch,"A" call findexobject mov command,al mov objecttype,4 @@ -868,7 +868,7 @@ endmugger1: push es bx mov al,"W" mov ah,"E" mov cl,"T" - mov ch,"B" + mov ch,"B" call findexobject mov command,al mov objecttype,4 @@ -885,7 +885,7 @@ endmugger1: push es bx ret endmugger2: ret - + endp @@ -1057,7 +1057,7 @@ guardspeed: call showgamereel mov watchingtime,2 ret iswaitingpool: mov pointermode,2 - mov watchingtime,0 + mov watchingtime,0 ret combatover1: mov watchingtime,0 @@ -1090,7 +1090,7 @@ doneover2: ret Security proc near - + cmp word ptr [es:bx+3],32 jz securwait cmp word ptr [es:bx+3],69 @@ -1098,7 +1098,7 @@ Security proc near ret notaftersec: mov watchingtime,10 call checkspeed - jnz gotsecurframe + jnz gotsecurframe inc word ptr [es:bx+3] jmp gotsecurframe securwait: cmp lastweapon,1 @@ -1137,7 +1137,7 @@ Heavy proc near mov mandead,2 jmp gotheavyframe notafterhshot: call checkspeed - jnz gotheavyframe + jnz gotheavyframe inc word ptr [es:bx+3] jmp gotheavyframe heavywait: cmp lastweapon,1 @@ -1196,7 +1196,7 @@ notboss: call showgamereel jz nottalkedboss mov talkedtoboss,1 nottalkedboss: ret - + endp @@ -1743,7 +1743,7 @@ gotmonks2text: mov dx,1 endp - + endif else @@ -2007,7 +2007,7 @@ gotendseq: mov [es:bx+3],ax cmp ax,134 jnz notfadedown push es bx ax - call fadescreendownhalf + call fadescreendownhalf pop ax bx es jmp notendseq notfadedown: cmp ax,324 @@ -2029,7 +2029,7 @@ notendseq: call showgamereel mov word ptr [es:bx+3],146 call rollendcredits notendcreds: ret - + endp @@ -2078,7 +2078,7 @@ endcredits2: push cx si di es bx call vsync pop bx es di si push si di es bx - + mov cx,18 onelot: push cx mov di,75 @@ -2242,7 +2242,7 @@ ryansded: mov mandead,2 if cd Madmantext proc near - + cmp speechcount,63 jnc nomadtext cmp ch1playing,255 @@ -2260,11 +2260,11 @@ Madmantext proc near nomadtext: ret endp - + else Madmantext proc near - + cmp combatcount,61 jnc nomadtext mov al,combatcount @@ -2304,7 +2304,7 @@ Madmode proc near cmp combatcount,68 endif jnc iswatchmad - mov pointermode,2 + mov pointermode,2 iswatchmad: ret endp @@ -2314,7 +2314,7 @@ iswatchmad: ret Priesttext proc near - + cmp word ptr [es:bx+3],2 jc nopriesttext cmp word ptr [es:bx+3],7 @@ -2554,7 +2554,7 @@ gotadvframe: mov [es:bx+3],ax noadvisor: call showgamereel call addtopeoplelist ret - + endp @@ -2627,7 +2627,7 @@ finishsparky: call showgamereel jz nottalkedsparky mov talkedtosparky,1 nottalkedsparky: ret - + endp @@ -2671,7 +2671,7 @@ Addtopeoplelist proc near mov es,buffers mov [es:bx],ax ;reel pointer position pop ax - mov [es:bx+2],ax + mov [es:bx+2],ax mov [es:bx+4],cl ;coversation number pop bx es add listpos,5 @@ -3017,7 +3017,7 @@ notquickp: call showframe - + @@ -3038,7 +3038,7 @@ Checkone proc near ;cx=x,y to check mov cl,4 shr ax,cl mov ah,dl ; al,ah holds x,y in blocks - + push ax mov ch,0 mov cl,al @@ -3361,7 +3361,7 @@ Checkforexit proc near mov flagx,dl mov flagy,dh mov al,lastflag - + test al,64 jz notnewdirect mov al,lastflagex @@ -3383,7 +3383,7 @@ notnewdirect: test al,32 pop bx jz noshoe1 inc bl -noshoe1: push bx +noshoe1: push bx mov al,"W" mov ah,"E" mov cl,"T" @@ -3393,7 +3393,7 @@ noshoe1: push bx jz noshoe2 inc bl noshoe2: cmp bl,2 - jz notlouis + jz notlouis mov al,42 cmp bl,0 jz notravmessage @@ -3446,7 +3446,7 @@ notanup: ret Adjustdown proc near - push es bx + push es bx add mapy,10 mov al,lastflagex mov cl,16 @@ -3462,7 +3462,7 @@ Adjustdown proc near Adjustup proc near - + push es bx sub mapy,10 mov al,lastflagex @@ -3500,7 +3500,7 @@ Adjustleft proc near Adjustright proc near - + push es bx add mapx,11 mov al,lastflagex @@ -3550,7 +3550,7 @@ Reminders proc nar mov dh,"S" xchg al,ah call compare - jnz forgotone ;is it in wallet? + jnz forgotone ;is it in wallet? havegotcard: inc progresspoints notfirst: ret @@ -3568,7 +3568,7 @@ notinedenslift: ret - + ;--------------------------------------------------------------------------- ; ; Sprite update routines for rain effect @@ -3576,7 +3576,7 @@ notinedenslift: ret ;--------------------------------------------------------------------------- - + Initrain proc near @@ -3619,8 +3619,8 @@ initrainside: mov cl,mapxsize initrainside2: call randomnumber and al,31 add al,3 - cmp al,rainspace - jnc initrainside2 + cmp al,rainspace + jnc initrainside2 add ch,al cmp ch,mapysize jnc finishinitrain @@ -3657,16 +3657,16 @@ rainlocations: db 1,44,10,16 ;location,map x,y,seed db 8,33,40,18 db 8,22,40,18 db 8,11,40,18 - + db 21,44,20,18 db 255 endp - - + + @@ -3681,7 +3681,7 @@ lookforlinestart: call getblockofpixel dec cl inc ch cmp cl,0 - jz endofthisline + jz endofthisline cmp ch,mapysize jnc endofthisline jmp lookforlinestart @@ -3700,7 +3700,7 @@ lookforlineend: call getblockofpixel inc bh jmp lookforlineend -foundlineend: push cx +foundlineend: push cx mov [es:di+2],bh call randomnumber mov [es:di+3],al @@ -3713,7 +3713,7 @@ foundlineend: push cx add di,6 pop cx cmp cl,0 - jz endofthisline + jz endofthisline cmp ch,mapysize jnc endofthisline jmp lookforlinestart @@ -3726,7 +3726,7 @@ endofthisline: ret Getblockofpixel proc near - + push cx es di mov ax,mapxstart add cl,al @@ -3801,7 +3801,7 @@ rainloop: lodsb jmp morerain noplot: add di,320-1 loop rainloop - pop si + pop si jmp morerain finishrain: cmp ch1blockstocopy,0 @@ -3826,10 +3826,10 @@ nothunder: ret - - - + + + ;--------------------------------------------------------------------------- ; ; Sprite update routines for background objects @@ -3842,7 +3842,7 @@ nothunder: ret Backobject proc near - + mov ds,setdat mov di,[es:bx+20] @@ -3992,7 +3992,7 @@ hissnoise: if demo endif call playchannel1 ret - + endp @@ -4433,7 +4433,7 @@ notplot: pop si es cx Soundonreels proc near - + mov bl,reallocation add bl,bl xor bh,bh @@ -4446,10 +4446,10 @@ reelsoundloop: mov al,[cs:si] mov ax,[cs:si+1] cmp ax,reelpointer jnz skipreelsound - + cmp ax,lastsoundreel jz skipreelsound - + mov lastsoundreel,ax mov al,[cs:si] cmp al,64 @@ -4499,7 +4499,7 @@ r6 db 18 db 19 dw 23 db 255 - + r8 db 12 dw 51 db 13 @@ -4521,7 +4521,7 @@ r9 db 12 r10 db 13 dw 16 db 255 - + r11 db 13 dw 20 db 255 @@ -4643,7 +4643,7 @@ r26 db 12 db 15 dw 102 ; was 90, should be mine cart db 255 - + r27 db 22 dw 36 db 13 @@ -4866,7 +4866,7 @@ notmapup2: cmp ah,16 jnz notmapupspec sub mapy,10 mov nowinnewroom,1 - ret + ret notmapupspec: cmp ah,8 jnz notmapdownspec @@ -4957,7 +4957,7 @@ bigroom: sub mapysize,8 call maptopanel add mapysize,8 ret - + endp diff --git a/devtools/tasmrecover/dreamweb/talk.asm b/devtools/tasmrecover/dreamweb/talk.asm index 91cbb96c6e6..3a56d02f324 100644 --- a/devtools/tasmrecover/dreamweb/talk.asm +++ b/devtools/tasmrecover/dreamweb/talk.asm @@ -2,7 +2,7 @@ ;Released with permission from Neil Dodwell under GPLv2 ;See LICENSE file for full license text Talk proc near - + mov talkpos,0 mov inmaparea,0 mov al,command @@ -245,7 +245,7 @@ dospeech: mov al,talkpos mov si,ax cmp byte ptr [es:si],0 jz endheartalk - + push es si call createpanel call showpanel @@ -287,7 +287,7 @@ noplay1: mov pointermode,3 $1: inc talkpos - + mov al,talkpos mov al,character and al,127 @@ -314,7 +314,7 @@ $1: jz skiptalk2 cmp byte ptr [es:si],32 jz skiptalk2 - + push es si call createpanel call showpanel @@ -359,7 +359,7 @@ skiptalk2: inc talkpos endheartalk: mov pointermode,0 ret - + else watchtalk: mov al,talkpos @@ -384,7 +384,7 @@ watchtalk: mov al,talkpos mov si,ax cmp byte ptr [es:si],0 jz endwatchtalk - + push es si call createpanel call showpanel @@ -409,7 +409,7 @@ watchtalk: mov al,talkpos $1: inc talkpos - + mov al,talkpos mov al,character and al,127 @@ -436,7 +436,7 @@ $1: jz skiptalk cmp byte ptr [es:si],32 jz skiptalk - + push es si call createpanel call showpanel @@ -509,7 +509,7 @@ finishconv: call delpointer mov pointermode,0 clc ret - + quitconv: call delpointer mov pointermode,0 call cancelch1 diff --git a/devtools/tasmrecover/dreamweb/titles.asm b/devtools/tasmrecover/dreamweb/titles.asm index f2e96f9c782..280fd2a53c0 100644 --- a/devtools/tasmrecover/dreamweb/titles.asm +++ b/devtools/tasmrecover/dreamweb/titles.asm @@ -3,7 +3,7 @@ ;See LICENSE file for full license text Titles proc near - + if demo ret else @@ -67,7 +67,7 @@ loadspeech2: push ax call loadspeech mov al,50+12 call playchannel1 -notloadspeech2: +notloadspeech2: call vsync cmp ch1playing,255 jnz notloadspeech2 @@ -85,7 +85,7 @@ notloadspeech2: ret endp - + else Monkspeaking proc near @@ -169,7 +169,7 @@ Gettingshot proc near call loadintroroom call fadescreenups mov volumeto,0 - mov volumedirection,-1 + mov volumedirection,-1 call runendseq call clearbeforeload ret @@ -177,16 +177,16 @@ Gettingshot proc near endp - - - - + + + + Credits proc near call clearpalette call realcredits - ret - + ret + endp @@ -210,7 +210,7 @@ Biblequote proc near call hangone cmp lasthardkey,1 jz biblequotearly - call cancelch0 + call cancelch0 biblequotearly: mov lasthardkey,0 ret @@ -267,21 +267,21 @@ Intro proc near ;waitsound: cmp ch1blockstoplay,0 ; jnz waitsound call clearbeforeload - + mov newlocation,52 call loadintroroom call runintroseq cmp lasthardkey,1 jz introearly call clearbeforeload - + mov newlocation,53 call loadintroroom call runintroseq cmp lasthardkey,1 jz introearly call clearbeforeload - + call allpalette mov newlocation,54 call loadintroroom @@ -346,7 +346,7 @@ earlyendrun: Runendseq proc near - + call atmospheres mov getback,0 moreendseq: call vsync @@ -422,7 +422,7 @@ set16palloop2: push ax bx cx inc bl inc bh loop set16palloop2 - + mov bl,31h mov al,1 mov ah,12h diff --git a/devtools/tasmrecover/dreamweb/use.asm b/devtools/tasmrecover/dreamweb/use.asm index f8c64f6f453..85d8acc39be 100644 --- a/devtools/tasmrecover/dreamweb/use.asm +++ b/devtools/tasmrecover/dreamweb/use.asm @@ -202,7 +202,7 @@ Uselist: db "NETW" db "HOLY" dw usechurchhole - + db "WALL" dw usewall db "BOOK" @@ -230,12 +230,12 @@ Uselist: db "NETW" dw usewindow db "PAPR" dw viewfolder - + db "UWTA" dw usetrainer db "UWTB" dw usetrainer - + db "STAT" dw entersymbol db "TLID" @@ -270,7 +270,7 @@ Uselist: db "NETW" db "GUMA" dw chewy - + db "SQEE" dw wheelsound db "TAPP" @@ -463,7 +463,7 @@ Nothelderror proc near Usepipe proc near - + cmp withobject,255 jnz pipewith call withwhat @@ -669,7 +669,7 @@ Slabdoorb proc near call isryanholding jnz gotcrystal mov al,44 - mov cx,200 + mov cx,200 call showpuztext call putbackobstuff ret @@ -798,7 +798,7 @@ slabfwrong: mov watchingtime,40 Useslab proc near - + cmp withobject,255 jnz slabwith call withwhat @@ -848,7 +848,7 @@ notlastslab: inc progresspoints Usecart proc near - + cmp withobject,255 jnz cartwith call withwhat @@ -920,7 +920,7 @@ openbox: inc progresspoints mov speedcount,1 mov getback,1 ret - + endp @@ -1056,7 +1056,7 @@ Wearshades proc near wearingshades: call showseconduse call putbackobstuff ret - + endp @@ -1283,7 +1283,7 @@ Usewindow proc near jnz notonbalc inc progresspoints call showfirstuse - mov newlocation,29 + mov newlocation,29 mov getback,1 ret notonbalc: call showseconduse @@ -1908,7 +1908,7 @@ $1: push cs pop es mov si,offset cs:money1poke - mov charshift,91*2+75 + mov charshift,91*2+75 mov al,0 mov ah,0 mov dl,240 @@ -1934,7 +1934,7 @@ $1: money1poke: db "0000",0 money2poke: db "00",0 - + endp @@ -2001,7 +2001,7 @@ Lookatcard proc near Moneypoke proc near - + mov bx,offset cs:money1poke mov cl,48-1 numberpoke0: inc cl @@ -2867,7 +2867,7 @@ Putbackobstuff proc near Showpuztext proc near push cx - call findpuztext + call findpuztext push es si call createpanel call showpanel @@ -3153,7 +3153,7 @@ edenspart2: cmp sartaindead,1 mov al,55 call placesetobject inc sartaindead -notedens2: ret +notedens2: ret notinedens: cmp reallocation,25 jnz notonsartroof mov newsitem,3 @@ -3491,8 +3491,8 @@ gatewith: mov al,withobject mov al,14 call showpuztext call putbackobstuff - ret - + ret + cutgate: call showfirstuse mov watchingtime,64*2 mov reeltowatch,4 diff --git a/devtools/tasmrecover/dreamweb/vars.asm b/devtools/tasmrecover/dreamweb/vars.asm index 99592233d33..41e4a399a98 100644 --- a/devtools/tasmrecover/dreamweb/vars.asm +++ b/devtools/tasmrecover/dreamweb/vars.asm @@ -56,7 +56,7 @@ Rainlist equ undertimedtext+(256*undertimedysize) Initialreelrouts equ rainlist+(6*64) Initialvars equ initialreelrouts+lenofreelrouts Lengthofbuffer equ initialvars+lengthofvars - + Flags equ 0 ;offsets of items in backdrop segment Blocks equ flags+192 Map equ 0 @@ -138,7 +138,7 @@ liftpath db 0 lockstatus db 1 doorpath db 0 counttoopen db 0 -counttoclose db 0 +counttoclose db 0 rockstardead db 0 generaldead db 0 sartaindead db 0 diff --git a/devtools/tasmrecover/dreamweb/vgafades.asm b/devtools/tasmrecover/dreamweb/vgafades.asm index a39ae5d297c..b68abc64ce8 100644 --- a/devtools/tasmrecover/dreamweb/vgafades.asm +++ b/devtools/tasmrecover/dreamweb/vgafades.asm @@ -101,12 +101,12 @@ Clearendpal proc near Clearpalette proc near - + mov fadedirection,0 call clearstartpal call dumpcurrent ret - + endp @@ -309,11 +309,11 @@ Showgun proc near mov addtored,0 ;12 mov addtogreen,0 - mov addtoblue,0 + mov addtoblue,0 call paltostartpal call paltoendpal call greyscalesum - + ; mov es,buffers ; mov di,endpal+3 ; mov cx,255 @@ -322,7 +322,7 @@ Showgun proc near ; inc di ; stosw ; loop reds - + mov fadedirection,1 mov fadecount,63 mov colourpos,0 @@ -419,7 +419,7 @@ endcredits22: push cx si di es bx call vsync pop bx es di si push si di es bx - + mov cx,18 onelot2: push cx mov di,25 ;75 @@ -453,7 +453,7 @@ looknext2: mov al,[es:si] gotnext2: cmp lasthardkey,1 jz endearly loop endcredits21 - + mov cx,120 call hangone ret @@ -686,7 +686,7 @@ Paltoendpal proc near - + @@ -834,7 +834,7 @@ Fadeupyellows proc near mov fadedirection,1 mov fadecount,63 mov colourpos,0 - mov numtofade,128 + mov numtofade,128 mov cx,128 call hangon ret diff --git a/devtools/tasmrecover/dreamweb/vgagrafx.asm b/devtools/tasmrecover/dreamweb/vgagrafx.asm index 368ad3c5013..6cb7a36e11b 100644 --- a/devtools/tasmrecover/dreamweb/vgagrafx.asm +++ b/devtools/tasmrecover/dreamweb/vgagrafx.asm @@ -50,7 +50,7 @@ pcxpal: push cx mov cx,480 convertpcx: push cx push di - mov ds,workspace + mov ds,workspace mov es,buffers mov di,pointerback mov bx,0 @@ -130,7 +130,7 @@ Readabyte proc near mov si,0 notendblock: lodsb ret - + endp @@ -209,7 +209,7 @@ Setmode proc near mov ah,0 mov al,13h int 10h - + mov al,6 ; sets graphic controller mov dx,3ceh ; register 6 (MM) to 1 - 64K out dx,al @@ -263,7 +263,7 @@ Setmode proc near mov al,3fh out dx,al ret - + endp @@ -461,7 +461,7 @@ Dumpmap proc near endp - + Pixelcheckset proc near ;al=x, ah=y, es:bx=setlist pos @@ -673,7 +673,7 @@ loop1: in al,dx endif pop es ds di si dx cx bx ax ret - + endp @@ -1110,7 +1110,7 @@ width42: movsw width41: movsw width40: movsw width39: movsw -width38: movsw +width38: movsw width37: movsw width36: movsw width35: movsw @@ -1158,7 +1158,7 @@ width0: ret - + Doblocks proc near @@ -1214,10 +1214,10 @@ firstbitofblock: movsw mov bh,12 loop125: movsw - movsw movsw movsw - movsw + movsw + movsw movsw movsw movsw @@ -1228,7 +1228,7 @@ loop125: movsw add di,screenwidth-20 dec bh jnz loop125 - + add di,4 mov ax,0dfdfh stosw @@ -1269,7 +1269,7 @@ loop125: movsw zeroblock: pop si - + pop di cx add di,16 loop loop124 @@ -1278,7 +1278,7 @@ zeroblock: pop si add di,screenwidth*16 loop loop120 ret - + endp @@ -1523,7 +1523,7 @@ nextline: add di,dx dec ch jnz bhloop2 ret - + endp @@ -1595,7 +1595,7 @@ Transferinv proc near mov bx,exframedata add bx,ax add di,exframes - + push bx mov al,itemtotran mov ah,0 @@ -1656,7 +1656,7 @@ Transfermap proc near mov bx,exframedata add bx,ax add di,exframes - + push bx mov al,itemtotran mov ah,0 diff --git a/devtools/tasmrecover/tasm/lex.py b/devtools/tasmrecover/tasm/lex.py index 9728c149caf..b2e7f8d261e 100644 --- a/devtools/tasmrecover/tasm/lex.py +++ b/devtools/tasmrecover/tasm/lex.py @@ -35,7 +35,7 @@ def parse_args(text): if escape: if not string: raise SyntaxError("escape found in no string: %s" %text); - + #print "escaping[%s]" %c escape = False token += c @@ -47,7 +47,7 @@ def parse_args(text): token += c continue - + if c == '\'' or c == '"': string = True token += c @@ -60,7 +60,7 @@ def parse_args(text): if c == ';': #comment, bailing out break - + token += c #token = token.strip() if len(token): diff --git a/devtools/tasmrecover/tasm/parser.py b/devtools/tasmrecover/tasm/parser.py index 0782fff22f0..5ce8c9d0d8b 100644 --- a/devtools/tasmrecover/tasm/parser.py +++ b/devtools/tasmrecover/tasm/parser.py @@ -91,22 +91,22 @@ class parser: def get_offset(self, name): name = name.lower() return self.__offsets[name] - + def include(self, basedir, fname): path = fname.split('\\')[self.strip_path:] path = os.path.join(basedir, os.path.pathsep.join(path)) #print "including %s" %(path) - + self.parse(path) def eval(self, stmt): - try: + try: return self.parse_int(stmt) except: pass value = self.__globals[stmt.lower()].value return int(value) - + def expr_callback(self, match): name = match.group(1).lower() g = self.get_global(name) @@ -114,16 +114,16 @@ class parser: return g.value else: return "0x%04x" %g.offset - + def eval_expr(self, expr): n = 1 while n > 0: expr, n = re.subn(r'\b([a-zA-Z_]+[a-zA-Z0-9_]*)', self.expr_callback, expr) return eval(expr) - + def expand_globals(self, text): return text - + def fix_dollar(self, v): print("$ = %d" %len(self.binary_data)) return re.sub(r'\$', "%d" %len(self.binary_data), v) @@ -134,7 +134,7 @@ class parser: if re.match(r'[\+-]?[0-9a-f]+h$', v): v = int(v[:-1], 16) return int(v) - + def compact_data(self, width, data): #print "COMPACTING %d %s" %(width, data) r = [] @@ -148,7 +148,7 @@ class parser: for i in xrange(1, len(v) - 1): r.append(ord(v[i])) continue - + m = re.match(r'(\w+)\s+dup\s+\((\s*\S+\s*)\)', v) if m is not None: #we should parse that @@ -163,7 +163,7 @@ class parser: r.append(v & 0xff); v >>= 8 continue - + try: v = self.parse_int(v) if v < 0: @@ -178,7 +178,7 @@ class parser: print "unknown address %s" %(v) self.link_later.append((len(self.binary_data) + len(r), v)) v = 0 - + for b in xrange(0, width): r.append(v & 0xff); v >>= 8 @@ -214,7 +214,7 @@ class parser: cmd = line.split() if len(cmd) == 0: continue - + cmd0 = str(cmd[0]) if cmd0 == 'if': self.push_if(cmd[1]) @@ -225,7 +225,7 @@ class parser: elif cmd0 == 'endif': self.pop_if() continue - + if not self.visible(): continue @@ -249,7 +249,7 @@ class parser: self.proc.add(cmd0) self.proc.add(" ".join(cmd[1:])) continue - + if len(cmd) >= 3: cmd1 = cmd[1] if cmd1 == 'equ': @@ -285,7 +285,7 @@ class parser: else: #print line pass - + fd.close() return self diff --git a/devtools/tasmrecover/tasm/proc.py b/devtools/tasmrecover/tasm/proc.py index 50a394413f4..c443f2c7756 100644 --- a/devtools/tasmrecover/tasm/proc.py +++ b/devtools/tasmrecover/tasm/proc.py @@ -24,7 +24,7 @@ import op class proc: last_addr = 0xc000 - + def __init__(self, name): self.name = name self.calls = [] @@ -48,7 +48,7 @@ class proc: if isinstance(self.stmts[i], op.label) and self.stmts[i].name == label: self.stmts[i] = op._nop(None) return - + def optimize_sequence(self, cls): i = 0 stmts = self.stmts @@ -88,7 +88,7 @@ class proc: stmts[i] = op._nop(None) i += 1 return - + def optimize(self, keep_labels=[]): print "optimizing..." #trivial simplifications @@ -126,7 +126,7 @@ class proc: self.stmts.pop(i) else: i += 1 - + #eliminating unused labels for s in list(self.stmts): if not isinstance(s, op.label): @@ -156,7 +156,7 @@ class proc: self.optimize_sequence(op._stosw); self.optimize_sequence(op._movsb); self.optimize_sequence(op._movsw); - + def add(self, stmt): #print stmt comment = stmt.rfind(';') @@ -173,14 +173,14 @@ class proc: if len(stmt) == 0: return - + s = stmt.split(None) cmd = s[0] cl = getattr(op, '_' + cmd) arg = " ".join(s[1:]) if len(s) > 1 else str() o = cl(arg) self.stmts.append(o) - + def __str__(self): r = [] for i in self.stmts: diff --git a/devtools/update-version.pl b/devtools/update-version.pl index 72a5e9ad89b..22175def397 100755 --- a/devtools/update-version.pl +++ b/devtools/update-version.pl @@ -40,7 +40,7 @@ my @subs_files = qw( dists/iphone/Info.plist dists/ios7/Info.plist dists/irix/scummvm.spec - dists/wii/meta.xml + dists/wii/meta.xml dists/openpandora/PXML.xml dists/openpandora/README-OPENPANDORA dists/openpandora/README-PND.txt diff --git a/dists/android/res/drawable/ic_scummvm_background.xml b/dists/android/res/drawable/ic_scummvm_background.xml index 8a83ff24c31..75609e082a6 100644 --- a/dists/android/res/drawable/ic_scummvm_background.xml +++ b/dists/android/res/drawable/ic_scummvm_background.xml @@ -4,7 +4,7 @@ android:viewportHeight="108" xmlns:android="http://schemas.android.com/apk/res/android"> - Sat, 14 Jan 2012 11:39:15 +0100 @@ -166,7 +166,7 @@ scummvm (1.4.0-1) unstable; urgency=low * Remove Build-Conflicts on liboss-salsa-dev and disable ALSA on kfreebsd (Closes: #647124) * Bump debhelper level to 9, which enables default build flags - and thus hardened compiler flags + and thus hardened compiler flags -- Moritz Muehlenhoff Sat, 05 Nov 2011 10:29:43 +0100 @@ -220,7 +220,7 @@ scummvm (1.2.0-1) unstable; urgency=low * Update to standards version 3.9.1: - Modify asound build dep to linux-any * Unversion several build deps even supported in oldstable - + -- Moritz Muehlenhoff Tue, 12 Oct 2010 21:49:29 +0200 scummvm (1.1.1-1) unstable; urgency=low @@ -228,7 +228,7 @@ scummvm (1.1.1-1) unstable; urgency=low * New upstream release * Switch to bz2 upstream tarball * Disable SCI engine as requested by upstream, it's not yet ready to - replace FreeSCI + replace FreeSCI -- Moritz Muehlenhoff Fri, 07 May 2010 18:57:09 +0200 @@ -280,14 +280,14 @@ scummvm (1.0.0~rc1-1-1) unstable; urgency=low * Remove dh_desktop * Version the dependency on debhelper * Bump Standards-Version to 3.8.1, no changes needed - * Update copyright file + * Update copyright file -- Moritz Muehlenhoff Tue, 01 Sep 2009 22:11:17 +0200 scummvm (0.13.1-1) unstable; urgency=low * New upstream release (Closes: #530863) - * Bump Standards-Version to 3.8.1, add Homepage field + * Bump Standards-Version to 3.8.1, add Homepage field * Bump debhelper level to 7 * Build-depend on ghostscript instead of gs-gpl * Build-depend on texlive-base instead of tetex-bin @@ -301,7 +301,7 @@ scummvm (0.13.0-1) unstable; urgency=low * Move maintainer to Debian Games Team, add myself and David as uploaders * Fix link to compability matrix in package description - (Closes: #508894) + (Closes: #508894) -- Moritz Muehlenhoff Sat, 07 Mar 2009 01:18:12 +0100 @@ -341,7 +341,7 @@ scummvm (0.9.1-1) unstable; urgency=low * New upstream release * debian/prepare: refer to me instead - * debian/copyright: add the date I adopted the package + * debian/copyright: add the date I adopted the package -- David Weinehall Mon, 30 Oct 2006 16:44:12 +0200 @@ -581,7 +581,7 @@ scummvm (0.5.0-1) unstable; urgency=low * Restructure 00buildopts somewhat, to ease future maintenance. * Standards-Version 3.6.0, no changes required. * Revised the description. - * Sponsored by Joey Hess. (Tore fed me all the beer I could take .. + * Sponsored by Joey Hess. (Tore fed me all the beer I could take .. and then asked me to do this. ;-) -- Tore Anderson Fri, 1 Aug 2003 21:45:06 +0200 diff --git a/dists/gph/README-GPH b/dists/gph/README-GPH index 9b28490e508..460313f8115 100644 --- a/dists/gph/README-GPH +++ b/dists/gph/README-GPH @@ -23,7 +23,7 @@ WiKi: (Select your device) for the most current information on the port and any updates to this documentation. -The wiki includes detailed instructions on how to use the port and +The wiki includes detailed instructions on how to use the port and control information. ------------------------------------------------------------------------ diff --git a/dists/gph/README-GPH.in b/dists/gph/README-GPH.in index a3c2e7d7029..942d7bf2bac 100644 --- a/dists/gph/README-GPH.in +++ b/dists/gph/README-GPH.in @@ -23,7 +23,7 @@ WiKi: (Select your device) for the most current information on the port and any updates to this documentation. -The wiki includes detailed instructions on how to use the port and +The wiki includes detailed instructions on how to use the port and control information. ------------------------------------------------------------------------ diff --git a/dists/gph/gp2x/mmuhack/README b/dists/gph/gp2x/mmuhack/README index 6db7d818457..401fa1b09b6 100644 --- a/dists/gph/gp2x/mmuhack/README +++ b/dists/gph/gp2x/mmuhack/README @@ -1,4 +1,4 @@ -PLEASE NOTE: +PLEASE NOTE: The binary object 'mmuhack.o' is stored in the source tree as it is very awkward to build it manually each time and would require the use of 2 toolchains to do so. diff --git a/dists/gph/gp2x/scummvm.gpe b/dists/gph/gp2x/scummvm.gpe index 51a49f7560e..97dea847c9f 100644 --- a/dists/gph/gp2x/scummvm.gpe +++ b/dists/gph/gp2x/scummvm.gpe @@ -8,7 +8,7 @@ mount -o sync,remount /dev/mmcsd/disc0/part1 /mnt/sd/ export LD_LIBRARY_PATH=`pwd`/lib:$LD_LIBRARY_PATH # Run ScummVM, important this bit. -./scummvm.gph --fullscreen --gfx-mode=1x --config=$(pwd)/.scummvmrc +./scummvm.gph --fullscreen --gfx-mode=1x --config=$(pwd)/.scummvmrc # Sync the SD card to check that everything is written. sync diff --git a/dists/gph/gp2xwiz/scummvm.gpe b/dists/gph/gp2xwiz/scummvm.gpe index 59ff562aebe..37d0f65d189 100644 --- a/dists/gph/gp2xwiz/scummvm.gpe +++ b/dists/gph/gp2xwiz/scummvm.gpe @@ -5,7 +5,7 @@ export LD_LIBRARY_PATH=`pwd`/lib:$LD_LIBRARY_PATH # Run ScummVM, important this bit. -./scummvm.gph --fullscreen --gfx-mode=1x --config=$(pwd)/.scummvmrc +./scummvm.gph --fullscreen --gfx-mode=1x --config=$(pwd)/.scummvmrc # Sync the SD card to check that everything is written. sync diff --git a/dists/openpandora/PXML_schema.xsd b/dists/openpandora/PXML_schema.xsd index 7c0d6350163..b66e75c54e7 100644 --- a/dists/openpandora/PXML_schema.xsd +++ b/dists/openpandora/PXML_schema.xsd @@ -1,9 +1,9 @@ - - + + - + @@ -12,7 +12,7 @@ - + @@ -20,7 +20,7 @@ - + @@ -28,7 +28,7 @@ - + @@ -37,14 +37,14 @@ - + - + @@ -56,7 +56,7 @@ - + @@ -69,7 +69,7 @@ - + @@ -82,7 +82,7 @@ - + @@ -99,25 +99,25 @@ - - - + + + - + - + - + @@ -132,7 +132,7 @@ - + @@ -142,7 +142,7 @@ - + @@ -158,30 +158,30 @@ - + - + - + - - - + + + - + diff --git a/dists/openpandora/README-OPENPANDORA b/dists/openpandora/README-OPENPANDORA index 37f9fc249e6..a6803acab04 100644 --- a/dists/openpandora/README-OPENPANDORA +++ b/dists/openpandora/README-OPENPANDORA @@ -8,7 +8,7 @@ WiKi: for the most current information on the port and any updates to this documentation. -The wiki includes detailed instructions on how to use the port and +The wiki includes detailed instructions on how to use the port and control information. ------------------------------------------------------------------------ diff --git a/dists/openpandora/README-OPENPANDORA.in b/dists/openpandora/README-OPENPANDORA.in index 40ac5047fac..a8a500342d6 100644 --- a/dists/openpandora/README-OPENPANDORA.in +++ b/dists/openpandora/README-OPENPANDORA.in @@ -8,7 +8,7 @@ WiKi: for the most current information on the port and any updates to this documentation. -The wiki includes detailed instructions on how to use the port and +The wiki includes detailed instructions on how to use the port and control information. ------------------------------------------------------------------------ diff --git a/dists/openpandora/pnd_make.sh b/dists/openpandora/pnd_make.sh index a24beaf5d44..f1630f1aba7 100755 --- a/dists/openpandora/pnd_make.sh +++ b/dists/openpandora/pnd_make.sh @@ -52,7 +52,7 @@ cecho () # Color-echo. Argument $1 = message, Argument $2 = color echo "$message" fi return -} +} print_help() diff --git a/dists/psp2/template.xml b/dists/psp2/template.xml index a4d43f01306..fa61463436c 100644 --- a/dists/psp2/template.xml +++ b/dists/psp2/template.xml @@ -4,7 +4,7 @@ bg.png - + startup.png diff --git a/dists/snap/README.md b/dists/snap/README.md index e33f0da58ae..439214b2d3d 100644 --- a/dists/snap/README.md +++ b/dists/snap/README.md @@ -53,7 +53,7 @@ upstream so ScummVM can authoritatively publish future releases. - [ ] Post an announcement in the [Snapcraft Forum](https://forum.snapcraft.io) - [link]() - [ ] Submit a pull request or patch upstream that adds snap install documentation - [link]() - [ ] Submit a pull request or patch upstream that adds the `snapcraft.yaml` and any required assets/launchers - [link]() - - [ ] Add upstream contact information to the `README.md` + - [ ] Add upstream contact information to the `README.md` - If upstream accept the PR: - [ ] Request upstream create a Snap store account - [ ] Contact the Snap Advocacy team to request the snap be transferred to upstream diff --git a/dists/snap/snap/snapcraft.yaml b/dists/snap/snap/snapcraft.yaml index 25490b34064..2e3f8b45a86 100644 --- a/dists/snap/snap/snapcraft.yaml +++ b/dists/snap/snap/snapcraft.yaml @@ -12,7 +12,7 @@ description: | Currently, ScummVM supports a huge library of adventures with over 250 games in total. - + It supports many classics published by legendary studios like LucasArts, Sierra On-Line, Revolution Software, Cyan, Inc. and Westwood Studios. Next to ground-breaking titles like the Monkey Island series, @@ -115,7 +115,7 @@ parts: #fi snapcraftctl build strip --strip-all $SNAPCRAFT_PART_INSTALL/bin/scummvm - + plugin: autotools configflags: - --enable-release diff --git a/dists/wii/READMII b/dists/wii/READMII index d4bf6ea43bc..44c45f9ea7a 100644 --- a/dists/wii/READMII +++ b/dists/wii/READMII @@ -1,4 +1,4 @@ -README for the Wii/Gamecube port of ScummVM +README for the Wii/Gamecube port of ScummVM ------------------------------------------- REQUIREMENTS diff --git a/dists/win32/ScummVM.iss b/dists/win32/ScummVM.iss index 8dc43bc5174..a57b8294508 100644 --- a/dists/win32/ScummVM.iss +++ b/dists/win32/ScummVM.iss @@ -1,5 +1,5 @@ #define AppName "ScummVM" -#define FileVersion=GetFileVersion('scummvm.exe') +#define FileVersion=GetFileVersion('scummvm.exe') #define ProductVersion=GetStringFileInfo('scummvm.exe', 'ProductVersion') #define Copyright=GetStringFileInfo('scummvm.exe', 'LegalCopyright') @@ -191,7 +191,7 @@ Name: ukrainian; MessagesFile: compiler:Languages\Ukrainian.isl Name: hebrew; MessagesFile: compiler:Languages\Hebrew.isl [Tasks] -Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}" +Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}" [Icons] ; Optional desktop icon @@ -204,9 +204,9 @@ Name: {group}\ScummVM; Filename: {app}\scummvm.exe; WorkingDir: {app}; Comment: Name: {group}\ScummVM (noconsole); Filename: {app}\scummvm.exe; Parameters: "--no-console"; WorkingDir: {app}; Comment: scummvm; Flags: createonlyiffileexists; IconIndex: 0; Languages: not german Name: {group}\ScummVM (ohne Konsolenfenster); Filename: {app}\scummvm.exe; Parameters: "--no-console"; WorkingDir: {app}; Comment: scummvm; Flags: createonlyiffileexists; IconIndex:0; Languages: german Name: {group}\Saved Games\Saved Games; Filename: {userappdata}\ScummVM\Saved Games; WorkingDir: {userappdata}\ScummVM\Saved Games; Comment: Saved Games; IconIndex: 0; MinVersion: 0, 1; Languages: not german -Name: {group}\Spielstände\Spielstände; Filename: {userappdata}\ScummVM\Saved Games; WorkingDir: {userappdata}\ScummVM\Saved Games; Comment: Spielstände; IconIndex: 0; MinVersion: 0, 1; Languages: german +Name: {group}\Spielst�nde\Spielst�nde; Filename: {userappdata}\ScummVM\Saved Games; WorkingDir: {userappdata}\ScummVM\Saved Games; Comment: Spielst�nde; IconIndex: 0; MinVersion: 0, 1; Languages: german Name: {group}\Saved Games\Saved Games (old default); Filename: {app}; WorkingDir: {app}; Comment: Saved Games (old default); IconIndex: 0; MinVersion: 0, 1; Languages: not german -Name: {group}\Spielstände\Spielstände (alter Standard); Filename: {app}; WorkingDir: {app}; Comment: Spielstände (alter Standard); IconIndex: 0; MinVersion: 0, 1; Languages: german +Name: {group}\Spielst�nde\Spielst�nde (alter Standard); Filename: {app}; WorkingDir: {app}; Comment: Spielst�nde (alter Standard); IconIndex: 0; MinVersion: 0, 1; Languages: german ; DOCUMENTATION Name: {group}\Authors; Filename: {app}\AUTHORS.txt; WorkingDir: {app}; Comment: AUTHORS; Flags: createonlyiffileexists; Languages: not german diff --git a/doc/de/NEUES.md b/doc/de/NEUES.md index b6bf77b7e64..8c4b9da8d29 100644 --- a/doc/de/NEUES.md +++ b/doc/de/NEUES.md @@ -187,7 +187,7 @@ Programmcodes finden Sie auf Englisch unter: - Unterstützung für die SegaCD-Version von Eye of the Beholder I (mit CD-Audio, animierten Zwischensequenzen und der Karten-Funktion) hinzugefügt. - Unterstützung für die PC-98-Version von Eye of the Beholder I hinzugefügt. - - Unterstützung für die spanische Version von Eye of the Beholder I und II, Legend of Kyrandia + - Unterstützung für die spanische Version von Eye of the Beholder I und II, Legend of Kyrandia (Fan-Übersetzung auf CD-ROM) und Legend of Kyrandia 2 (Disketten-Version und Fan-Übersetzung auf CD-ROM hinzugefügt. Unterstützung für die spanische Version von Lands of Lore (Disketten-Version und Fan-Übersetzung auf CD-ROM) korrigiert. diff --git a/doc/docportal/_static/custom.css b/doc/docportal/_static/custom.css index f9cabb5bc22..74f88e9c620 100644 --- a/doc/docportal/_static/custom.css +++ b/doc/docportal/_static/custom.css @@ -51,9 +51,9 @@ p { .touch td:nth-of-type(1):before { content: "Touch"} .touch td:nth-of-type(2):before { content: "Action"} - + } - + /* override table width */ @media (min-width: 385px) { diff --git a/doc/docportal/_static/version.js b/doc/docportal/_static/version.js index ef75e63f8c7..274b56fbea7 100644 --- a/doc/docportal/_static/version.js +++ b/doc/docportal/_static/version.js @@ -4,10 +4,10 @@ window.addEventListener("load", function(){ var start = url.indexOf("/", 27); var end = url.indexOf("/", start+1); var endMinus = url.indexOf("-", start+1); - var versionNumber = url.substring(start+1, endMinus); + var versionNumber = url.substring(start+1, endMinus); var found = url.substring(start+1, end); var version = null; - + switch(found) { case 'latest': version = "development build" diff --git a/doc/docportal/advanced_topics/configuration_file.rst b/doc/docportal/advanced_topics/configuration_file.rst index bcb713f8d7c..88756ca1052 100755 --- a/doc/docportal/advanced_topics/configuration_file.rst +++ b/doc/docportal/advanced_topics/configuration_file.rst @@ -159,7 +159,7 @@ There are many recognized configuration keys. In the table below, each key is ei cdrom,integer,0, "Sets which CD drive to play CD audio from (as a numeric index). If a negative number is set, ScummVM does not access the CD drive." ":ref:`color `",boolean,, ":ref:`commandpromptwindow `",boolean,false, - ":ref:`confirm_exit `",boolean,false, + ":ref:`confirm_exit `",boolean,false, console,boolean,true, Enables the console window for Win32/Symbian32. controller_map_db,string,"``gamecontrollerdb.txt`` is loaded from the specified extrapath", "Specifies the custom controller mapping file to load to complete the default database (SDL backend only)." copy_protection,boolean,false, Enables copy protection @@ -209,7 +209,7 @@ There are many recognized configuration keys. In the table below, each key is ei ":ref:`frames_per_secondfl `",boolean,false, :ref:`frontpanel_touchpad_mode `,boolean, false ":ref:`fullscreen `",boolean,false, - gameid,string,,"Short name of the game. For internal use only, do not edit." + gameid,string,,"Short name of the game. For internal use only, do not edit." gamepath,string,,Specifies the path to the game ":ref:`gfx_mode `",string,normal (1x)," - 1x @@ -246,7 +246,7 @@ There are many recognized configuration keys. In the table below, each key is ei ":ref:`herculesfont `",boolean,false, ":ref:`hpbargraphs `",boolean,true, ":ref:`hypercheat `",boolean,false, - ":ref:`iconspath `",string,, + ":ref:`iconspath `",string,, ":ref:`improved `",boolean,true, ":ref:`InvObjectsAnimated `",boolean,true, ":ref:`joystick_deadzone `",integer, 3 @@ -368,7 +368,7 @@ There are many recognized configuration keys. In the table below, each key is ei ":ref:`platform `",string,, ":ref:`portaits_on `",boolean,true, ":ref:`prefer_digitalsfx `",boolean,true, - ":ref:`renderer `",string,default," + ":ref:`renderer `",string,default," - opengl - opengl_shaders - software" diff --git a/doc/docportal/advanced_topics/understand_graphics.rst b/doc/docportal/advanced_topics/understand_graphics.rst index e9e25813e50..1cd29a14937 100644 --- a/doc/docportal/advanced_topics/understand_graphics.rst +++ b/doc/docportal/advanced_topics/understand_graphics.rst @@ -58,7 +58,7 @@ A comparison of graphics modes .. figure:: ../images/graphics/graphics_mode/advmame2x.png - **AdvMAME2x**: Expands each pixel into 4 new pixels based on the surrounding pixels. Doesn't rely on blurring like 2xSAI, fast. + **AdvMAME2x**: Expands each pixel into 4 new pixels based on the surrounding pixels. Doesn't rely on blurring like 2xSAI, fast. .. figure:: ../images/graphics/graphics_mode/advmame3x.png @@ -66,11 +66,11 @@ A comparison of graphics modes .. figure:: ../images/graphics/graphics_mode/advmame4x.png - **AdvMAME3x**: Expands each pixel into 4 new pixels based on the surrounding pixels. Doesn't rely on blurring like 2xSAI, fast. + **AdvMAME3x**: Expands each pixel into 4 new pixels based on the surrounding pixels. Doesn't rely on blurring like 2xSAI, fast. .. figure:: ../images/graphics/graphics_mode/sai2x.png - **SaI2x**: Uses bilinear filtering to interpolate pixels. + **SaI2x**: Uses bilinear filtering to interpolate pixels. .. figure:: ../images/graphics/graphics_mode/supersai2x.png @@ -82,7 +82,7 @@ A comparison of graphics modes .. figure:: ../images/graphics/graphics_mode/pm2x.png - **PM2x**: Analyzes the eight neighboring pixels to create smoother diagonal lines and rounded edges. + **PM2x**: Analyzes the eight neighboring pixels to create smoother diagonal lines and rounded edges. .. figure:: ../images/graphics/graphics_mode/dotmatrix2x.png @@ -193,24 +193,24 @@ To toggle between bilinear interpolation and nearest neighbor, press :kbd:`Ctrl+ Vsync ******* -V-sync, or vertical sync, synchronizes the frame rate of the game with the monitor's refresh rate, or the video capture refresh rate. This helps to prevent screen "tearing", where the screen displays parts of multiple frames at once, which looks like a horizontal line where the image appears to split. +V-sync, or vertical sync, synchronizes the frame rate of the game with the monitor's refresh rate, or the video capture refresh rate. This helps to prevent screen "tearing", where the screen displays parts of multiple frames at once, which looks like a horizontal line where the image appears to split. -This setting is enabled by default. +This setting is enabled by default. Renderers ********* There are three options for rendering 3D games: OpenGL, OpenGL with shaders, or software. -- OpenGL uses the graphics card (GPU) to render the game. -- OpenGL with shaders also uses the GPU, but also uses shaders, if available, to render the game. Shaders are small programs running on the GPU which transform certain graphics inputs to outputs. They control things such as how the pixels are drawn on the 3D shapes. -- The software option uses the computer's CPU, instead of a graphics card, to render the game. +- OpenGL uses the graphics card (GPU) to render the game. +- OpenGL with shaders also uses the GPU, but also uses shaders, if available, to render the game. Shaders are small programs running on the GPU which transform certain graphics inputs to outputs. They control things such as how the pixels are drawn on the 3D shapes. +- The software option uses the computer's CPU, instead of a graphics card, to render the game. -Not all render options are available for all games. If in doubt, leave the setting at ****. +Not all render options are available for all games. If in doubt, leave the setting at ****. Anti-aliasing *************** -Without anti-aliasing, the computer takes the color it finds at the center of the pixel, and applies that color to the entire pixel. This results in jagged, pixelated lines at the edges of objects. Anti-aliasing, in a nutshell, is how we get nice, smooth lines on a 3D game. +Without anti-aliasing, the computer takes the color it finds at the center of the pixel, and applies that color to the entire pixel. This results in jagged, pixelated lines at the edges of objects. Anti-aliasing, in a nutshell, is how we get nice, smooth lines on a 3D game. -Historically, anti-aliasing was done using a method called Supersampling. With this method, each frame is rendered behind-the-scenes to a higher resolution, and then downscaled to produce a much smoother, better looking image. Unfortunately, this method is very GPU-intensive, and too slow. +Historically, anti-aliasing was done using a method called Supersampling. With this method, each frame is rendered behind-the-scenes to a higher resolution, and then downscaled to produce a much smoother, better looking image. Unfortunately, this method is very GPU-intensive, and too slow. -Multisampling Anti-Aliasing, or MSAA for short, was developed as a much faster alternative; the computer renders as much of the image as possible without anti-aliasing, and then only applies anti-aliasing to the edges. It samples each pixel to find out where the edge is, and how to blend the colors to create a smooth edge. The numbered options in the ScummVM :doc:`../settings/graphics` tab (2x, 4x and 8x), refer to how many samples are taken. 8x MSAA produces a better image than 2x MSAA, but is also more GPU-intensive. \ No newline at end of file +Multisampling Anti-Aliasing, or MSAA for short, was developed as a much faster alternative; the computer renders as much of the image as possible without anti-aliasing, and then only applies anti-aliasing to the edges. It samples each pixel to find out where the edge is, and how to blend the colors to create a smooth edge. The numbered options in the ScummVM :doc:`../settings/graphics` tab (2x, 4x and 8x), refer to how many samples are taken. 8x MSAA produces a better image than 2x MSAA, but is also more GPU-intensive. \ No newline at end of file diff --git a/doc/docportal/help/release.rst b/doc/docportal/help/release.rst index a3f8699d2ed..28680206183 100644 --- a/doc/docportal/help/release.rst +++ b/doc/docportal/help/release.rst @@ -2,5 +2,5 @@ Release notes --------------- -.. mdinclude:: ../../../NEWS.md +.. mdinclude:: ../../../NEWS.md diff --git a/doc/docportal/index.rst b/doc/docportal/index.rst index b8046f3a07c..f9a29d5d679 100644 --- a/doc/docportal/index.rst +++ b/doc/docportal/index.rst @@ -223,7 +223,7 @@ If you are having problems with any aspect of ScummVM, take a look at our help s What's changed since I was last here? ====================================== -Check out the :doc:`Release notes ` for both current and past releases. +Check out the :doc:`Release notes ` for both current and past releases. The ScummVM Project diff --git a/doc/docportal/other_platforms/android.rst b/doc/docportal/other_platforms/android.rst index 40cf83ada90..eac6dbbc58a 100644 --- a/doc/docportal/other_platforms/android.rst +++ b/doc/docportal/other_platforms/android.rst @@ -108,7 +108,7 @@ To do a two finger tap, hold one finger down and then tap with a second finger. Three finger tap ^^^^^^^^^^^^^^^^^^ -To do a three finger tap, start with holding down one finger and progressively touch down the other two fingers, one at a time, while still holding down the previous fingers. Imagine you are impatiently tapping your fingers on a surface, but then slow down that movement so it is rhythmic, but not too slow. +To do a three finger tap, start with holding down one finger and progressively touch down the other two fingers, one at a time, while still holding down the previous fingers. Imagine you are impatiently tapping your fingers on a surface, but then slow down that movement so it is rhythmic, but not too slow. Immersive Sticky fullscreen mode ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/doc/docportal/other_platforms/playstation_portable.rst b/doc/docportal/other_platforms/playstation_portable.rst index 444fbd4cfa0..f1834357376 100644 --- a/doc/docportal/other_platforms/playstation_portable.rst +++ b/doc/docportal/other_platforms/playstation_portable.rst @@ -82,7 +82,7 @@ Virtual Keyboard Mode .. csv-table:: :class: controls - + START,Enter. Also exits virtual keyboard mode SELECT,Exits the virtual keyboard mode R button,Input: lowercase/uppercase letters (press to toggle) @@ -102,7 +102,7 @@ Image Viewer Analog stick,Moves around the image "L/R buttons + START",Exits image viewer -1st Person Game Mode +1st Person Game Mode ************************** .. csv-table:: :class: controls diff --git a/doc/docportal/settings/graphics.rst b/doc/docportal/settings/graphics.rst index b9b14dd2ca3..925951231ce 100644 --- a/doc/docportal/settings/graphics.rst +++ b/doc/docportal/settings/graphics.rst @@ -75,17 +75,17 @@ V-Sync in 3D games .. _renderer: Game 3D renderer - Changes how a 3D game is rendered. This setting has no effect on 2D games. + Changes how a 3D game is rendered. This setting has no effect on 2D games. - OpenGL: renders on hardware (uses the GPU) - OpenGL with shaders: renders on hardware with shader support - - Software: renders on software (uses the CPU). + - Software: renders on software (uses the CPU). *renderer* .. _antialiasing: 3D Anti-aliasing - Changes the anti-aliasing method. The number refers to how many samples are taken per pixel; 8x takes 8 samples per pixel and is the most accurate, but is also the most processor-intensive option. + Changes the anti-aliasing method. The number refers to how many samples are taken per pixel; 8x takes 8 samples per pixel and is the most accurate, but is also the most processor-intensive option. *antialiasing* \ No newline at end of file diff --git a/doc/docportal/settings/misc.rst b/doc/docportal/settings/misc.rst index 5a39e06b7d4..b7c4dab2c1c 100644 --- a/doc/docportal/settings/misc.rst +++ b/doc/docportal/settings/misc.rst @@ -56,13 +56,13 @@ Use native system file browser .. _guireturn: Always return to the launcher when leaving a game - If ticked, removes the **Quit** option from the Global Main Menu. Only the **Return to Launcher** option remains. + If ticked, removes the **Quit** option from the Global Main Menu. Only the **Return to Launcher** option remains. *gui_return_to_launcher_at_exit* .. _guiconfirm: Ask for confirmation on exit - If ticked, a confirmation dialog appears when you choose **Quit** or **Return to Launcher** from the Global Main Menu. + If ticked, a confirmation dialog appears when you choose **Quit** or **Return to Launcher** from the Global Main Menu. *confirm_exit* diff --git a/doc/docportal/use_scummvm/game_files.rst b/doc/docportal/use_scummvm/game_files.rst index d2af4df7cb7..7dd08d2dad1 100644 --- a/doc/docportal/use_scummvm/game_files.rst +++ b/doc/docportal/use_scummvm/game_files.rst @@ -35,7 +35,7 @@ For macOS or Linux users without access to a Windows machine, you can get the da Multi-disc games =================== -ScummVM needs access to all the data files, so it will not be able to run directly from a CD if the game has multiple discs. To add a multi-CD game, copy the required data files from the CD to a folder on your hard drive. For a list of required files, see the `wiki entry ` for the game you're playing. +ScummVM needs access to all the data files, so it will not be able to run directly from a CD if the game has multiple discs. To add a multi-CD game, copy the required data files from the CD to a folder on your hard drive. For a list of required files, see the `wiki entry ` for the game you're playing. As a general guideline, where there are duplicate, identical files (same name, same file size) on more than one disc, only one copy of the file is required. Where there are files that have the same name but are different on each disc, rename them. For example, where there is a ``music.clu`` on two discs, rename the file on the first disc to ``music1.clu`` and the file on the second disc to ``music2.clu``. diff --git a/doc/docportal/use_scummvm/taskbar_integration.rst b/doc/docportal/use_scummvm/taskbar_integration.rst index a883317fc86..941573c52c6 100644 --- a/doc/docportal/use_scummvm/taskbar_integration.rst +++ b/doc/docportal/use_scummvm/taskbar_integration.rst @@ -9,12 +9,12 @@ The taskbar integration has several features: - Shows a progress bar when doing a mass add of games, and shows the number of games found at the end (Windows, macOS and Linux). - Shows an error state in the taskbar if an error occurs when running a game (Windows only). -.. _iconspath: +.. _iconspath: Setting up the icon overlay ================================ -Icons for many games can be found on our `Github repository `__. +Icons for many games can be found on our `Github repository `__. Place the icons in a folder, and either change the *iconspath* in the :doc:`configuration file <../advanced_topics/configuration_file>` to point to this folder, or add the folder to the :ref:`Extra Path ` on the Paths settings tab. @@ -27,7 +27,7 @@ The icon files must be ICO files for Windows, or PNG files for macOS. They must To find the gameid and the engineid, open the :doc:`configuration file <../advanced_topics/configuration_file>`. The game entry will be similar to this: -.. code:: +.. code:: [lure] description=Lure of the Temptress (VGA/DOS/English) @@ -38,11 +38,11 @@ To find the gameid and the engineid, open the :doc:`configuration file <../advan .. figure:: ../images/taskbar/game_icon.png - macOS dock with a custom icon overlay for Beneath a Steel Sky. - + macOS dock with a custom icon overlay for Beneath a Steel Sky. + Launching recently played games ======================================= -To start a recently played game, right click on the ScummVM icon in the taskbar or dock, and select the game you want to play. +To start a recently played game, right click on the ScummVM icon in the taskbar or dock, and select the game you want to play. diff --git a/doc/doxygen/buildfiles/doxygen_layout.xml b/doc/doxygen/buildfiles/doxygen_layout.xml index 65003b7ae5a..4d3d585c933 100644 --- a/doc/doxygen/buildfiles/doxygen_layout.xml +++ b/doc/doxygen/buildfiles/doxygen_layout.xml @@ -11,7 +11,7 @@ - + @@ -19,7 +19,7 @@ - + diff --git a/engines/adl/disk.cpp b/engines/adl/disk.cpp index 7361387decd..dacccf2e1a3 100644 --- a/engines/adl/disk.cpp +++ b/engines/adl/disk.cpp @@ -394,7 +394,7 @@ static Common::SeekableReadStream *readTrack_WOZ(Common::File &f, uint track, bo return nullptr; } - Common::BitStreamMemory8MSB bitStream(new Common::BitStreamMemoryStream(inBuf, byteSize, DisposeAfterUse::YES), DisposeAfterUse::YES); + Common::BitStreamMemory8MSB bitStream(new Common::BitStreamMemoryStream(inBuf, byteSize, DisposeAfterUse::YES), DisposeAfterUse::YES); byte nibble = 0; bool stop = false; diff --git a/engines/adl/disk.h b/engines/adl/disk.h index 7160c4382e6..4de23e9aea6 100644 --- a/engines/adl/disk.h +++ b/engines/adl/disk.h @@ -180,7 +180,7 @@ public: DataBlock_PC(DiskImage *disk, byte track, byte sector, uint16 offset = 0) : _disk(disk), _track(track), - _sector(sector), + _sector(sector), _offset(offset) { } ~DataBlock_PC() override { } diff --git a/engines/adl/display_a2.cpp b/engines/adl/display_a2.cpp index 787d88e5151..85d62bfc461 100644 --- a/engines/adl/display_a2.cpp +++ b/engines/adl/display_a2.cpp @@ -288,7 +288,7 @@ public: g = 255; b = 255; } - #endif + #endif #ifdef NTSC_REMOVE_BLACK_GHOSTING if ((s & 0xf) == 0) { diff --git a/engines/agi/loader_v2.cpp b/engines/agi/loader_v2.cpp index fed17ac11af..f8351117ef4 100644 --- a/engines/agi/loader_v2.cpp +++ b/engines/agi/loader_v2.cpp @@ -276,7 +276,7 @@ int AgiLoader_v2::loadObjects(const char *fname) { } int AgiLoader_v2::loadWords(const char *fname) { - if (_vm->getLanguage() != Common::HE_ISR) + if (_vm->getLanguage() != Common::HE_ISR) return _vm->_words->loadDictionary(fname); else return _vm->_words->loadExtendedDictionary(fname); diff --git a/engines/agi/text.cpp b/engines/agi/text.cpp index 5e332ab8da6..6e68d6fcc42 100644 --- a/engines/agi/text.cpp +++ b/engines/agi/text.cpp @@ -290,7 +290,7 @@ void TextMgr::displayText(const char *textPtr, bool disabledLook) { if (_vm->getLanguage() == Common::HE_ISR) textString = Common::convertBiDiStringByLines(textString, Common::kWindows1255); - if (textString.contains('\n')) + if (textString.contains('\n')) textString = textString.forEachLine(rightAlign, (uint)_messageState.textSize_Width); textPtr = textString.c_str(); @@ -935,7 +935,7 @@ void TextMgr::stringEdit(int16 stringMaxLen) { _inputStringCursorPos++; } } else { - while (_inputStringCursorPos < inputStringLen) + while (_inputStringCursorPos < inputStringLen) _inputStringCursorPos++; if (stringMaxLen == 30) // called from askForSaveGameDescription diff --git a/engines/ags/console.cpp b/engines/ags/console.cpp index b81991a05a7..345e3b8a619 100644 --- a/engines/ags/console.cpp +++ b/engines/ags/console.cpp @@ -117,7 +117,7 @@ bool AGSConsole::Cmd_setDebugGroupLevel(int argc, const char **argv) { debugPrintf("\n"); return true; } - + _agsDebuggerOutput->SetGroupFilter(group, level); return true; } diff --git a/engines/ags/detection.cpp b/engines/ags/detection.cpp index 78ed984868d..22c2139b922 100644 --- a/engines/ags/detection.cpp +++ b/engines/ags/detection.cpp @@ -89,7 +89,7 @@ AGSOptionsWidget::AGSOptionsWidget(GuiObject *boss, const Common::String &name, // Language GUI::StaticTextWidget *textWidget = new GUI::StaticTextWidget(widgetsBoss(), _dialogLayout + ".translation_desc", _("Game language:"), _("Language to use for multilingual games")); textWidget->setAlign(Graphics::kTextAlignRight); - + _langPopUp = new GUI::PopUpWidget(widgetsBoss(), _dialogLayout + ".translation"); _langPopUp->appendEntry(_(""), (uint32)-1); diff --git a/engines/ags/detection.h b/engines/ags/detection.h index bcdc4e0c5df..398d83bacea 100644 --- a/engines/ags/detection.h +++ b/engines/ags/detection.h @@ -76,7 +76,7 @@ public: bool canPlayUnknownVariants() const override { return true; } - + GUI::OptionsContainerWidget *buildEngineOptionsWidgetStatic(GUI::GuiObject *boss, const Common::String &name, const Common::String &target) const override; }; diff --git a/engines/ags/engine/main/config.cpp b/engines/ags/engine/main/config.cpp index fcca470d5b9..3fed22d131f 100644 --- a/engines/ags/engine/main/config.cpp +++ b/engines/ags/engine/main/config.cpp @@ -335,7 +335,7 @@ void override_config_ext(ConfigTree &cfg) { INIwriteint(cfg, "misc", "antialias", _G(psp_gfx_smooth_sprites) != 0); INIwritestring(cfg, "language", "translation", _G(psp_translation)); - + } void apply_config(const ConfigTree &cfg) { @@ -499,7 +499,7 @@ void save_config_file() { ConfMan.getActiveDomain()->erase("translation"); } else ConfMan.getActiveDomain()->setVal("translation", _GP(usetup).translation); - + ConfMan.flushToDisk(); String cfg_file = find_user_cfg_file(); diff --git a/engines/ags/engine/resource/tintshader.fx b/engines/ags/engine/resource/tintshader.fx index 90ad5000a03..cdecbe77422 100644 --- a/engines/ags/engine/resource/tintshader.fx +++ b/engines/ags/engine/resource/tintshader.fx @@ -3,7 +3,7 @@ float GetLuminance(float4 color) { float colorMax = max (color[0], color[1]); colorMax = max (colorMax, color[2]); - + return colorMax; } @@ -44,9 +44,9 @@ PS_OUTPUT main( in PS_INPUT In ) float amount = tintRGB[3]; float4 pixel = tex2D(Tex0, In.Texture); // tint should be the RGB conversion of the HSL value, with 100% L float lum = GetLuminance(pixel); - + // scale the colour by the luma, alpha blend it with the tint - Out.Color = (tintRGB * lum * amount + pixel*(1-amount)) * transparency[1]; + Out.Color = (tintRGB * lum * amount + pixel*(1-amount)) * transparency[1]; Out.Color[3] = pixel[3] * transparency[0]; return Out; //return output pixel diff --git a/engines/ags/engine/resource/tintshaderLegacy.fx b/engines/ags/engine/resource/tintshaderLegacy.fx index 82f89077c3f..f4c596d438b 100644 --- a/engines/ags/engine/resource/tintshaderLegacy.fx +++ b/engines/ags/engine/resource/tintshaderLegacy.fx @@ -3,7 +3,7 @@ float GetValue(float4 color) { float colorMax = max (color[0], color[1]); colorMax = max (colorMax, color[2]); - + return colorMax; } @@ -60,12 +60,12 @@ PS_OUTPUT main( in PS_INPUT In ) PS_OUTPUT Out; //create an output pixel float amount = tintHSV[3]; - float4 pixel = tex2D(Tex0, In.Texture); + float4 pixel = tex2D(Tex0, In.Texture); float lum = GetValue(pixel); lum = max(lum - (1.0 - transparency[1]), 0.0); - + // scale the colour by the luma, alpha blend it with the tint - Out.Color = (hsv_to_rgb(float3(tintHSV[0],tintHSV[1],lum)) * amount + pixel*(1-amount)); + Out.Color = (hsv_to_rgb(float3(tintHSV[0],tintHSV[1],lum)) * amount + pixel*(1-amount)); Out.Color[3] = pixel[3] * transparency[0]; return Out; //return output pixel diff --git a/engines/ags/engine/resource/version.rc b/engines/ags/engine/resource/version.rc index 0dd4d1c8a5e..1c882556ced 100644 --- a/engines/ags/engine/resource/version.rc +++ b/engines/ags/engine/resource/version.rc @@ -79,12 +79,12 @@ END // TEXTINCLUDE // -1 TEXTINCLUDE +1 TEXTINCLUDE BEGIN "resource.h\0" END -2 TEXTINCLUDE +2 TEXTINCLUDE BEGIN "//include \r\n" "#define IDC_STATIC -1\r\n" @@ -92,7 +92,7 @@ BEGIN "\0" END -3 TEXTINCLUDE +3 TEXTINCLUDE BEGIN "\r\n" "\0" diff --git a/engines/ags/plugins/ags_tcp_ip/ags_tcp_ip.h b/engines/ags/plugins/ags_tcp_ip/ags_tcp_ip.h index e7e34efcdec..199b97a03e2 100644 --- a/engines/ags/plugins/ags_tcp_ip/ags_tcp_ip.h +++ b/engines/ags/plugins/ags_tcp_ip/ags_tcp_ip.h @@ -34,7 +34,7 @@ class AGSTcpIp : public PluginBase { private: static const char *AGS_GetPluginName(); static void AGS_EngineStartup(IAGSEngine *engine); - + public: AGSTcpIp(); }; diff --git a/engines/bladerunner/game_constants.h b/engines/bladerunner/game_constants.h index 951e9784fdf..5439ef917ce 100644 --- a/engines/bladerunner/game_constants.h +++ b/engines/bladerunner/game_constants.h @@ -2050,7 +2050,7 @@ enum GameModelAnimations { kModelAnimationTwinsSitIdle = 346, kModelAnimationTwinsSitTyping = 347, // UNUSED kModelAnimationTwinsSitLancePutsSomethingToTheLeft = 348, - kModelAnimationTwinsSitLanceShortCalmTalk = 349, // Mostly looks like Lance is talking. Probably could be used for both. + kModelAnimationTwinsSitLanceShortCalmTalk = 349, // Mostly looks like Lance is talking. Probably could be used for both. kModelAnimationTwinsSitLanceLongerCalmTalk = 350, // Mostly looks like Lance is talking. Probably could be used for both. kModelAnimationTwinsSitLutherCalmTalk = 351, // Mostly looks like Luther is talking. Probably could be used for both. kModelAnimationTwinsSitLutherMoreCalmTalk = 352, // Mostly looks like Luther is talking. Probably could be used for both. @@ -2140,7 +2140,7 @@ enum GameModelAnimations { kModelGenWalkerPunkPersonWithGlassesStandsStill = 433, // Standing - Same model as 432 kModelGenWalkerHattedChild = 434, // Walking - Frame 11 used for standing still kModelGenWalkerChild = 435, // Walking - Frame 0 (or 5) used for standing still - kModelGenWalkerHattedPersonWithWoodenUmbrella = 436, // Walking - Frame 4 used for standing still + kModelGenWalkerHattedPersonWithWoodenUmbrella = 436, // Walking - Frame 4 used for standing still kModelGenWalkerHattedLadyWithWoodenUmbrellaStandsStill = 437, // Standing - *Not the same model with 436* - Just single frame // 438 - 439: Dancer model animations (UNUSED - RESTORED) kModelAnimationHysteriaPatron3DanceHandsDownLeanBackForth = 438, // UNUSED - 27 frames - RESTORED diff --git a/engines/bladerunner/script/ai/bullet_bob.cpp b/engines/bladerunner/script/ai/bullet_bob.cpp index 9bd83b68f5a..df4ef06ace1 100644 --- a/engines/bladerunner/script/ai/bullet_bob.cpp +++ b/engines/bladerunner/script/ai/bullet_bob.cpp @@ -208,9 +208,9 @@ bool AIScriptBulletBob::UpdateAnimation(int *animation, int *frame) { case 0: if (_varChooseIdleAnimation == 1) { #if BLADERUNNER_ORIGINAL_BUGS - // TODO a bug? Why use kModelAnimationBulletBobSittingHeadMoveDownThink (516) here + // TODO a bug? Why use kModelAnimationBulletBobSittingHeadMoveDownThink (516) here // and leave kModelAnimationBulletBobSittingHeadMoveAround (515) unused? - // Also below kModelAnimationBulletBobSittingHeadMoveAround (515) is used + // Also below kModelAnimationBulletBobSittingHeadMoveAround (515) is used // in Slice_Animation_Query_Number_Of_Frames(), // even though the count of frames is identical in both 515 and 516 framesets *animation = kModelAnimationBulletBobSittingHeadMoveDownThink; diff --git a/engines/bladerunner/script/ai/hanoi.cpp b/engines/bladerunner/script/ai/hanoi.cpp index 2ee548c9d7a..2798610fee7 100644 --- a/engines/bladerunner/script/ai/hanoi.cpp +++ b/engines/bladerunner/script/ai/hanoi.cpp @@ -715,7 +715,7 @@ bool AIScriptHanoi::ChangeAnimationMode(int mode) { break; case 16: - // Used when Hanoi says "You're real cute" to McCoy (in NR03), + // Used when Hanoi says "You're real cute" to McCoy (in NR03), // when McCoy first tries to sit on the rotating couch #if BLADERUNNER_ORIGINAL_BUGS // TODO a bug? uses kModelAnimationHanoiSlightBowingTalk (654) again like case 15 diff --git a/engines/bladerunner/script/ai/isabella.cpp b/engines/bladerunner/script/ai/isabella.cpp index b24ee585b4e..585be3daca1 100644 --- a/engines/bladerunner/script/ai/isabella.cpp +++ b/engines/bladerunner/script/ai/isabella.cpp @@ -27,7 +27,7 @@ namespace BladeRunner { AIScriptIsabella::AIScriptIsabella(BladeRunnerEngine *vm) : AIScriptBase(vm) { _var1 = 0; _varNumOfTimesToHoldCurrentFrame = 0; - // _varChooseIdleAnimation can have valid values: 0, + // _varChooseIdleAnimation can have valid values: 0, _varChooseIdleAnimation = 0; _var4 = 1; } diff --git a/engines/bladerunner/script/ai/izo.cpp b/engines/bladerunner/script/ai/izo.cpp index 3f848b384fd..d1800a5556a 100644 --- a/engines/bladerunner/script/ai/izo.cpp +++ b/engines/bladerunner/script/ai/izo.cpp @@ -585,7 +585,7 @@ bool AIScriptIzo::UpdateAnimation(int *animation, int *frame) { case 7: // TODO why calculate current animation by adding animationState to kModelAnimationIzoAwkwardPlayWithHands (298)? // seems prone to error. - // This (based on the switch cases), results in "talking" animation framesets 300 - 305, + // This (based on the switch cases), results in "talking" animation framesets 300 - 305, // excepting the kModelAnimationIzoCalmTalk (299) which is used as the default or "ending" talking animation. *animation = _animationState + kModelAnimationIzoAwkwardPlayWithHands; ++_animationFrame; @@ -845,7 +845,7 @@ bool AIScriptIzo::UpdateAnimation(int *animation, int *frame) { } if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(kModelAnimationIzoIdle)) { // TODO a bug? Adding 3 to animationFrame when it is >= the num of frames of the frameset - // will still keep it >= the num of frame of the frameset. + // will still keep it >= the num of frame of the frameset. // so why check again in the if clause below? _animationFrame += 3; if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(kModelAnimationIzoIdle)) { diff --git a/engines/bladerunner/script/ai/mutant2.cpp b/engines/bladerunner/script/ai/mutant2.cpp index 76de5e6ee51..a14331efb90 100644 --- a/engines/bladerunner/script/ai/mutant2.cpp +++ b/engines/bladerunner/script/ai/mutant2.cpp @@ -364,7 +364,7 @@ bool AIScriptMutant2::GoalChanged(int currentGoalNumber, int newGoalNumber) { } // code repeated also in case 599 which precedes this one - // redundant? + // redundant? // results in additional reduction in friendliness and increase of aggressiveness for the other two mutants Actor_Modify_Friendliness_To_Other(kActorMutant1, kActorMcCoy, -15); Actor_Modify_Friendliness_To_Other(kActorMutant3, kActorMcCoy, -20); @@ -488,7 +488,7 @@ bool AIScriptMutant2::UpdateAnimation(int *animation, int *frame) { case 7: *animation = kModelAnimationMutant2ShotDead; - // TODO why "- 2" here? + // TODO why "- 2" here? _animationFrame = Slice_Animation_Query_Number_Of_Frames(kModelAnimationMutant2ShotDead) - 2; break; diff --git a/engines/bladerunner/script/ai/mutant3.cpp b/engines/bladerunner/script/ai/mutant3.cpp index f4357541729..b36aa0fc0bc 100644 --- a/engines/bladerunner/script/ai/mutant3.cpp +++ b/engines/bladerunner/script/ai/mutant3.cpp @@ -375,7 +375,7 @@ bool AIScriptMutant3::GoalChanged(int currentGoalNumber, int newGoalNumber) { } // code repeated also in case 599 which precedes this one - // redundant? + // redundant? // results in additional reduction in friendliness and increase of aggressiveness for the other two mutants Actor_Modify_Friendliness_To_Other(kActorMutant1, kActorMcCoy, 20); Actor_Modify_Friendliness_To_Other(kActorMutant2, kActorMcCoy, 15); diff --git a/engines/bladerunner/script/scene/hf05.cpp b/engines/bladerunner/script/scene/hf05.cpp index f1208c6f789..9bbb12114c1 100644 --- a/engines/bladerunner/script/scene/hf05.cpp +++ b/engines/bladerunner/script/scene/hf05.cpp @@ -466,7 +466,7 @@ void SceneScriptHF05::dialogueWithCrazylegs1() { Actor_Says(kActorCrazylegs, 550, 16); Actor_Says(kActorMcCoy, 1940, 15); Actor_Says(kActorMcCoy, 1945, -1); - // CrazyLegs cuts his sentence short here. He is not interrupted. + // CrazyLegs cuts his sentence short here. He is not interrupted. Actor_Says(kActorCrazylegs, 560, 15); Actor_Says(kActorCrazylegs, 570, 16); Actor_Says(kActorMcCoy, 1950, 17); @@ -691,7 +691,7 @@ void SceneScriptHF05::talkWithCrazylegs3(int affectionTowardsActor) { Actor_Says(kActorMcCoy, 1725, kAnimationModeTalk); Actor_Says(kActorCrazylegs, 40, 16); Actor_Says(kActorCrazylegs, 50, kAnimationModeTalk); - // CrazyLegs cuts his sentence short here. He is not interrupted. + // CrazyLegs cuts his sentence short here. He is not interrupted. Actor_Says(kActorCrazylegs, 60, 12); Actor_Says(kActorCrazylegs, 70, 13); Actor_Says(kActorMcCoy, 1730, kAnimationModeTalk); @@ -732,7 +732,7 @@ void SceneScriptHF05::talkWithCrazyLegs1() { ADQ_Flush(); ADQ_Add(kActorCrazylegs, 130, 18); ADQ_Add(kActorCrazylegs, 140, 18); - // CrazyLegs cuts his sentence short here. He is not interrupted. + // CrazyLegs cuts his sentence short here. He is not interrupted. ADQ_Add(kActorCrazylegs, 150, 18); ADQ_Add(kActorCrazylegs, 160, 17); } diff --git a/engines/bladerunner/script/scene/ug12.cpp b/engines/bladerunner/script/scene/ug12.cpp index f53d918a023..a17a7e98156 100644 --- a/engines/bladerunner/script/scene/ug12.cpp +++ b/engines/bladerunner/script/scene/ug12.cpp @@ -121,7 +121,7 @@ void SceneScriptUG12::PlayerWalkedIn() { // thus kItemChair is still present and with a bit of pixel hunt also visible in this scene // fix: remove rogue clickable chair item in this scene only. // This code has to be in PlayerWalkedIn() (which is executed after SceneLoaded() when player enters the scene) - // and not in SceneLoaded(), as in that method, the item is not yet available in the sceneObjects + // and not in SceneLoaded(), as in that method, the item is not yet available in the sceneObjects // (SceneObjects::findById() returns -1 for it, in SceneLoaded()) Item_Remove_From_Current_Scene(kItemChair); #endif // !BLADERUNNER_ORIGINAL_BUGS diff --git a/engines/buried/avi_frames.cpp b/engines/buried/avi_frames.cpp index 5b7b9d55662..f84b0d9f65d 100644 --- a/engines/buried/avi_frames.cpp +++ b/engines/buried/avi_frames.cpp @@ -189,7 +189,7 @@ void AVIFrames::addFrameToCache(int frameIndex, Graphics::Surface *frame) { cachedFrame.frame->free(); delete cachedFrame.frame; } - + _cachedFrames.pop_front(); } diff --git a/engines/buried/biochip_view.cpp b/engines/buried/biochip_view.cpp index 58022cd519d..48351d34e51 100644 --- a/engines/buried/biochip_view.cpp +++ b/engines/buried/biochip_view.cpp @@ -151,7 +151,7 @@ void JumpBiochipViewWindow::onPaint() { const Graphics::Surface *frame = _stillFrames.getFrame(0); _vm->_gfx->blit(frame, absoluteRect.left, absoluteRect.top); - if (_curSelection >= 0) { + if (_curSelection >= 0) { frame = _stillFrames.getFrame(1); Common::Rect highlightRect(11, _curSelection * 30 + 50, 11 + 23, _curSelection * 30 + 50 + 23); @@ -246,7 +246,7 @@ void JumpBiochipViewWindow::onLButtonUp(const Common::Point &point, uint flags) _currentMissionReviewed = false; ((GameUIWindow *)getParent()->getParent()->getParent())->_liveTextWindow->updateLiveText(_vm->getString(IDS_JUMP_BC_REVIEW_MISSION_TEXT_A)); } - + _curSelection = 0; invalidateWindow(false); } @@ -260,7 +260,7 @@ void JumpBiochipViewWindow::onLButtonUp(const Common::Point &point, uint flags) _currentMissionReviewed = false; ((GameUIWindow *)getParent()->getParent()->getParent())->_liveTextWindow->updateLiveText(_vm->getString(IDS_JUMP_BC_REVIEW_MISSION_TEXT_B)); } - + _curSelection = 1; invalidateWindow(false); } @@ -274,7 +274,7 @@ void JumpBiochipViewWindow::onLButtonUp(const Common::Point &point, uint flags) _currentMissionReviewed = false; ((GameUIWindow *)getParent()->getParent()->getParent())->_liveTextWindow->updateLiveText(_vm->getString(IDS_JUMP_BC_REVIEW_MISSION_TEXT_C)); } - + _curSelection = 2; invalidateWindow(false); } @@ -288,7 +288,7 @@ void JumpBiochipViewWindow::onLButtonUp(const Common::Point &point, uint flags) _currentMissionReviewed = false; ((GameUIWindow *)getParent()->getParent()->getParent())->_liveTextWindow->updateLiveText(_vm->getString(IDS_JUMP_BC_REVIEW_MISSION_TEXT_D)); } - + _curSelection = 3; invalidateWindow(false); } @@ -673,7 +673,7 @@ void InterfaceBioChipViewWindow::onMouseMove(const Common::Point &point, uint fl class FilesBioChipViewWindow : public Window { public: FilesBioChipViewWindow(BuriedEngine *vm, Window *parent); - + void onPaint(); void onLButtonUp(const Common::Point &point, uint flags); diff --git a/engines/buried/demo/demo_menu.cpp b/engines/buried/demo/demo_menu.cpp index e7cb5171f54..640a2532f34 100644 --- a/engines/buried/demo/demo_menu.cpp +++ b/engines/buried/demo/demo_menu.cpp @@ -57,7 +57,7 @@ DemoMainMenuWindow::DemoMainMenuWindow(BuriedEngine *vm, Window *parent) : Windo _interactive = Common::Rect(324, 155, 463, 325); _gallery = Common::Rect(471, 155, 610, 325); _quit = Common::Rect(552, 439, 640, 480); - + if (_vm->isTrueColor()) _background = _vm->_gfx->getBitmap("MISC/24BPP/MAINMENU.BMP"); else diff --git a/engines/buried/environ/agent3_lair.cpp b/engines/buried/environ/agent3_lair.cpp index d27a6f177bb..ffb75b52422 100644 --- a/engines/buried/environ/agent3_lair.cpp +++ b/engines/buried/environ/agent3_lair.cpp @@ -291,7 +291,7 @@ int LairEntry::onCharacter(Window *viewWindow, const Common::KeyState &character _passwordEntered.deleteLastChar(); } else if ((character.keycode == Common::KEYCODE_SPACE || (character.keycode >= Common::KEYCODE_a && character.keycode <= Common::KEYCODE_z) || (character.keycode >= Common::KEYCODE_0 && character.keycode <= Common::KEYCODE_9)) && _passwordEntered.size() < 15) { - + if (character.keycode == Common::KEYCODE_SPACE) _passwordEntered += ' '; else if (character.keycode >= Common::KEYCODE_a && character.keycode <= Common::KEYCODE_z) @@ -952,7 +952,7 @@ int PlayTransporterClosing::postExitRoom(Window *viewWindow, const Location &new return SC_TRUE; } - + bool SceneViewWindow::initializeAgent3LairTimeZoneAndEnvironment(Window *viewWindow, int environment) { if (environment == -1) ((SceneViewWindow *)viewWindow)->getGlobalFlags().alNMWrongAlienPrefixCode = 0; diff --git a/engines/buried/environ/da_vinci.cpp b/engines/buried/environ/da_vinci.cpp index 058adf019c5..c78f10a1674 100644 --- a/engines/buried/environ/da_vinci.cpp +++ b/engines/buried/environ/da_vinci.cpp @@ -1166,7 +1166,7 @@ public: int mouseUp(Window *viewWindow, const Common::Point &pointLocation); int locateAttempted(Window *viewWindow, const Common::Point &pointLocation); int specifyCursor(Window *viewWindow, const Common::Point &pointLocation); - + private: Common::Rect _leftCodex; Common::Rect _middleCodex; diff --git a/engines/buried/environ/future_apartment.cpp b/engines/buried/environ/future_apartment.cpp index 7358e1180f0..1735c84368f 100644 --- a/engines/buried/environ/future_apartment.cpp +++ b/engines/buried/environ/future_apartment.cpp @@ -1186,7 +1186,7 @@ int ClickZoomToyShelf::specifyCursor(Window *viewWindow, const Common::Point &po class ToyClick : public SceneBase { public: ToyClick(BuriedEngine *vm, Window *viewWindow, const LocationStaticData &sceneStaticData, const Location &priorLocation, - int left = -1, int top = -1, int right = -1, int bottom = -1, int returnDepth = -1, int clickAnimation = -1, int returnAnimation = -1); + int left = -1, int top = -1, int right = -1, int bottom = -1, int returnDepth = -1, int clickAnimation = -1, int returnAnimation = -1); int mouseUp(Window *viewWindow, const Common::Point &pointLocation); int specifyCursor(Window *viewWindow, const Common::Point &pointLocation); diff --git a/engines/buried/environ/scene_common.h b/engines/buried/environ/scene_common.h index c55fa2f8430..461c715a5b6 100644 --- a/engines/buried/environ/scene_common.h +++ b/engines/buried/environ/scene_common.h @@ -297,7 +297,7 @@ private: class ClickPlayVideoSwitch : public SceneBase { public: ClickPlayVideoSwitch(BuriedEngine *vm, Window *viewWindow, const LocationStaticData &sceneStaticData, const Location &priorLocation, - int animID = 0, int cursorID = -1, int flagOffset = 0, int left = 0, int top = 0, int right = 0, int bottom = 0); + int animID = 0, int cursorID = -1, int flagOffset = 0, int left = 0, int top = 0, int right = 0, int bottom = 0); int mouseUp(Window *viewWindow, const Common::Point &pointLocation); int specifyCursor(Window *viewWindow, const Common::Point &pointLocation); @@ -312,7 +312,7 @@ private: class ClickPlayVideo : public SceneBase { public: ClickPlayVideo(BuriedEngine *vm, Window *viewWindow, const LocationStaticData &sceneStaticData, const Location &priorLocation, - int animID = 0, int cursorID = -1, int left = 0, int top = 0, int right = 0, int bottom = 0); + int animID = 0, int cursorID = -1, int left = 0, int top = 0, int right = 0, int bottom = 0); int mouseUp(Window *viewWindow, const Common::Point &pointLocation); int specifyCursor(Window *viewWindow, const Common::Point &pointLocation); diff --git a/engines/buried/inventory_info.cpp b/engines/buried/inventory_info.cpp index c0b493272d9..ef142b99394 100644 --- a/engines/buried/inventory_info.cpp +++ b/engines/buried/inventory_info.cpp @@ -203,7 +203,7 @@ void BurnedLetterViewWindow::onLButtonUp(const Common::Point &point, uint flags) TempCursorChange cursorChange(kCursorWait); Graphics::Surface *newFrame = _stillFrames->getFrameCopy(_curView); - + for (int i = 0; i < 189; i += offset) { _preBuffer->move(0, offset, _preBuffer->h); @@ -291,7 +291,7 @@ void BurnedLetterViewWindow::onMouseMove(const Common::Point &point, uint flags) bool BurnedLetterViewWindow::onSetCursor(uint message) { Cursor cursorID = kCursorArrow; - if (_top.contains(_curMousePos) && _curView > 0) + if (_top.contains(_curMousePos) && _curView > 0) cursorID = kCursorMoveUp; if (_bottom.contains(_curMousePos) && _curView < (_viewCount - 1)) diff --git a/engines/buried/main_menu.cpp b/engines/buried/main_menu.cpp index 34faf8ff399..fa2bcf5c456 100644 --- a/engines/buried/main_menu.cpp +++ b/engines/buried/main_menu.cpp @@ -62,10 +62,10 @@ MainMenuWindow::MainMenuWindow(BuriedEngine *vm, Window *parent) : Window(vm, pa _buttons[2] = Common::Rect(335, 309, 610, 369); _buttons[3] = Common::Rect(344, 375, 471, 407); _buttons[4] = Common::Rect(471, 375, 598, 407); - + _playMode[0] = Common::Rect(345, 235, 465, 263); _playMode[1] = Common::Rect(478, 235, 598, 263); - + _intro[0] = Common::Rect(345, 268, 465, 296); _intro[1] = Common::Rect(478, 268, 598, 296); diff --git a/engines/buried/resources.h b/engines/buried/resources.h index dc0f145345d..41308a46521 100644 --- a/engines/buried/resources.h +++ b/engines/buried/resources.h @@ -394,7 +394,7 @@ namespace Buried { #define RESID_SOUNDDB_BASE 16640 #define RESID_ANIMDB_BASE 16896 #define RESID_AI_DB_BASE 17152 - + #define RESID_FILENAMES_BASE 17408 #define RESID_STRINGS_BASE 21504 #define RESID_TRANSLATOR_TEXT_BASE 8192 diff --git a/engines/cine/anim.cpp b/engines/cine/anim.cpp index 35f41ff37b2..d7a70cbe0fe 100644 --- a/engines/cine/anim.cpp +++ b/engines/cine/anim.cpp @@ -439,7 +439,7 @@ void freeAnimDataRange(byte startIdx, byte numIdx) { assert(startIdx < g_cine->_animDataTable.size()); assert(startIdx + numIdx <= g_cine->_animDataTable.size()); } - + for (byte i = 0; i < numIdx; i++) { g_cine->_animDataTable[startIdx + i].clear(); } diff --git a/engines/cine/cine.h b/engines/cine/cine.h index 2ae6208c6c8..447554c7591 100644 --- a/engines/cine/cine.h +++ b/engines/cine/cine.h @@ -146,7 +146,7 @@ private: void showSplashScreen(); void resetEngine(); bool checkSaveHeaderData(const ChunkHeader& hdr); - bool loadPlainSaveFW(Common::SeekableReadStream &in, CineSaveGameFormat saveGameFormat, uint32 version); + bool loadPlainSaveFW(Common::SeekableReadStream &in, CineSaveGameFormat saveGameFormat, uint32 version); bool loadVersionedSaveFW(Common::SeekableReadStream &in); bool loadVersionedSaveOS(Common::SeekableReadStream &in); bool makeLoad(const Common::String &saveName); diff --git a/engines/cine/gfx.h b/engines/cine/gfx.h index 5349f300d07..421c4dd3543 100644 --- a/engines/cine/gfx.h +++ b/engines/cine/gfx.h @@ -206,7 +206,7 @@ public: virtual void popSavedBackBuffer(BackBufferSource source); - /** Restores back buffer content without palette. */ + /** Restores back buffer content without palette. */ virtual void restoreSavedBackBuffer(BackBufferSource source); virtual void removeSavedBackBuffer(BackBufferSource source); @@ -222,7 +222,7 @@ public: virtual uint getScroll() const; virtual void removeBg(unsigned int idx); virtual void saveBgNames(Common::OutSaveFile &fHandle); - virtual const char *getBgName(uint idx = 0) const; + virtual const char *getBgName(uint idx = 0) const; virtual void setBlackPalette(bool updateChangePal); virtual void setPalette(); diff --git a/engines/cine/metaengine.cpp b/engines/cine/metaengine.cpp index 0bd4c7486a5..9783596027d 100644 --- a/engines/cine/metaengine.cpp +++ b/engines/cine/metaengine.cpp @@ -225,7 +225,7 @@ SaveStateDescriptor CineMetaEngine::querySaveMetaInfos(const char *target, int s SaveStateDescriptor desc; desc.setDescription(_("Empty autosave")); desc.setSaveSlot(slot); - desc.setAutosave(true); + desc.setAutosave(true); desc.setWriteProtectedFlag(true); return desc; } diff --git a/engines/cine/pal.h b/engines/cine/pal.h index 482715acee3..416f0a73932 100644 --- a/engines/cine/pal.h +++ b/engines/cine/pal.h @@ -148,7 +148,7 @@ public: Palette &saturatedAddNormalizedGray(Palette &output, byte firstIndex, byte lastIndex, signed grayDividend, signed grayDenominator) const; bool empty() const; - uint colorCount() const; + uint colorCount() const; Palette &fillWithBlack(); /** Is the palette valid? (Mostly just checks the color format for correctness) */ diff --git a/engines/cine/script_fw.cpp b/engines/cine/script_fw.cpp index d020bef00b7..25b811ff677 100644 --- a/engines/cine/script_fw.cpp +++ b/engines/cine/script_fw.cpp @@ -3215,7 +3215,7 @@ void decompileScript(const byte *scriptPtr, uint16 scriptSize, uint16 scriptIdx) position++; sprintf(lineBuffer, "o2_wasZoneChecked(%d)\n", param1); - + break; } diff --git a/engines/cine/sound.cpp b/engines/cine/sound.cpp index d22982cca66..e76ac182b7b 100644 --- a/engines/cine/sound.cpp +++ b/engines/cine/sound.cpp @@ -110,7 +110,7 @@ public: MusicType musicType() const override { return MT_ADLIB; } // PCSoundDriver interface void setUpdateCallback(UpdateCallback upCb, void *ref) override; - void setupChannel(int channel, const byte *data, int instrument, int volume) override; + void setupChannel(int channel, const byte *data, int instrument, int volume) override; void stopAll() override; void initCard(); diff --git a/engines/composer/graphics.cpp b/engines/composer/graphics.cpp index aa7ed7c1434..e6d9aaa5175 100644 --- a/engines/composer/graphics.cpp +++ b/engines/composer/graphics.cpp @@ -44,9 +44,9 @@ bool Sprite::contains(const Common::Point &pos) const { } enum { - kAnimOpEvent = 1, - kAnimOpPlayWave = 2, - kAnimOpPlayAnim = 3, + kAnimOpEvent = 1, + kAnimOpPlayWave = 2, + kAnimOpPlayAnim = 3, kAnimOpDrawSprite = 4 }; diff --git a/engines/composer/saveload.cpp b/engines/composer/saveload.cpp index 464760602c0..231e6870805 100644 --- a/engines/composer/saveload.cpp +++ b/engines/composer/saveload.cpp @@ -155,7 +155,7 @@ void ComposerEngine::sync(Common::Serializer &ser, OldScript *&data template<> void ComposerEngine::sync(Common::Serializer &ser, QueuedScript &data, Common::Serializer::Version minVersion, Common::Serializer::Version maxVersion) { ser.syncAsUint32LE(data._baseTime); - ser.syncAsUint32LE(data._duration); + ser.syncAsUint32LE(data._duration); ser.syncAsUint32LE(data._count); ser.syncAsUint16LE(data._scriptId); if (ser.isLoading()) data._baseTime += _timeDelta; @@ -280,7 +280,7 @@ Common::Error ComposerEngine::loadGameState(int slot) { Common::Serializer ser(in, NULL); byte magic[4]; ser.syncBytes(magic, 4); - if (magic[0] != 'C' || magic[1] != 'M' || magic[2] != 'P' || magic[3] != 'S') + if (magic[0] != 'C' || magic[1] != 'M' || magic[2] != 'P' || magic[3] != 'S') return Common::kUnknownError; ser.syncVersion(0); @@ -297,9 +297,9 @@ Common::Error ComposerEngine::loadGameState(int slot) { // Unload all Libraries Common::Array libIds; - for (Common::List::iterator i = _libraries.begin(); i != _libraries.end(); i++) + for (Common::List::iterator i = _libraries.begin(); i != _libraries.end(); i++) libIds.push_back((*i)._id); - for (uint32 i = 0; i < libIds.size(); i++) + for (uint32 i = 0; i < libIds.size(); i++) unloadLibrary(libIds[i]); syncListReverse(ser, _libraries); diff --git a/engines/cryo/eden.cpp b/engines/cryo/eden.cpp index 5491e14ffc4..8addb7a858e 100644 --- a/engines/cryo/eden.cpp +++ b/engines/cryo/eden.cpp @@ -93,7 +93,7 @@ EdenGame::EdenGame(CryoEngine *vm) : _vm(vm), kMaxMusicSize(2200000) { _lastPhrasesFile = 0; _dialogSkipFlags = 0; _voiceSamplesBuffer = nullptr; - + _mainBankBuf = nullptr; _musicBuf = nullptr; _gameLipsync = nullptr; diff --git a/engines/cryo/eden.h b/engines/cryo/eden.h index 50b22ee069f..19c4a83996c 100644 --- a/engines/cryo/eden.h +++ b/engines/cryo/eden.h @@ -44,7 +44,7 @@ class EdenGraphics; class EdenGame { private: - + EdenGraphics *_graphics; public: @@ -81,7 +81,7 @@ public: byte getActionCursor(byte value); int16 getNumTextLines(); int16 getScrollPos(); - /* + /* * Identify person based on current video number */ perso_t *personSubtitles(); @@ -238,7 +238,7 @@ private: void my_bulle(); void my_pr_bulle(); void drawSubtitleChar(byte c, byte color, int16 width); - + void patchSentence(); void vavapers(); void citadelle(); @@ -718,7 +718,7 @@ private: uint8 tab_2CB1E[8][4]; - const unsigned int kMaxMusicSize; // largest .mus file size + const unsigned int kMaxMusicSize; // largest .mus file size // Loaded from cryo.dat Follower _followerList[15]; diff --git a/engines/cryo/eden_graphics.cpp b/engines/cryo/eden_graphics.cpp index 31b2e1b250d..a2bf4483d30 100644 --- a/engines/cryo/eden_graphics.cpp +++ b/engines/cryo/eden_graphics.cpp @@ -36,7 +36,7 @@ namespace Cryo { EdenGraphics::EdenGraphics(EdenGame *game) : _game(game) { _glowH = _glowW = _glowY = _glowX = 0; _showVideoSubtitle = false; - _showBlackBars = false; + _showBlackBars = false; _mainView = nullptr; _mainViewBuf = nullptr; _hnmView = nullptr; @@ -211,25 +211,25 @@ void EdenGraphics::loadMouthRectFromCurChar() { void EdenGraphics::paneltobuf() { setSrcRect(0, 16, 320 - 1, 169 - 1); setDestRect(320, 16, 640 - 1, 169 - 1); - CLBlitter_CopyViewRect(getMainView(), getMainView(), &_rect_src, &_rect_dst); + CLBlitter_CopyViewRect(getMainView(), getMainView(), &_rect_src, &_rect_dst); } void EdenGraphics::cursbuftopanel() { setSrcRect(434, 40, 525 - 1, 111 - 1); setDestRect(114, 40, 205 - 1, 111 - 1); - CLBlitter_CopyViewRect(getMainView(), getMainView(), &_rect_src, &_rect_dst); + CLBlitter_CopyViewRect(getMainView(), getMainView(), &_rect_src, &_rect_dst); } void EdenGraphics::langbuftopanel() { setSrcRect(328, 42, 407 - 1, 97 - 1); setDestRect(8, 42, 87 - 1, 97 - 1); - CLBlitter_CopyViewRect(getMainView(), getMainView(), &_rect_src, &_rect_dst); + CLBlitter_CopyViewRect(getMainView(), getMainView(), &_rect_src, &_rect_dst); } // Original name: sauvefondbouche void EdenGraphics::saveMouthBackground() { loadMouthRectFromCurChar(); - CLBlitter_CopyViewRect(getMainView(), getMainView(), &_rect_src, &_rect_dst); + CLBlitter_CopyViewRect(getMainView(), getMainView(), &_rect_src, &_rect_dst); } // Original name: restaurefondbouche @@ -1329,7 +1329,7 @@ void EdenGraphics::initGlobals() { _underSubtitlesBackupRect.top = 0; _underSubtitlesBackupRect.left = _subtitlesXScrMargin; _underSubtitlesBackupRect.right = _subtitlesXScrMargin + _subtitlesXWidth - 1; - _underSubtitlesBackupRect.bottom = 60 - 1; + _underSubtitlesBackupRect.bottom = 60 - 1; } // Original name: sauvefondbulle diff --git a/engines/cryo/eden_graphics.h b/engines/cryo/eden_graphics.h index 4fcc1effa34..30d726c1a3b 100644 --- a/engines/cryo/eden_graphics.h +++ b/engines/cryo/eden_graphics.h @@ -53,7 +53,7 @@ public: void setGlowX(int16 value); - void setGlowY(int16 value); + void setGlowY(int16 value); // Original name : blackbars void drawBlackBars(); @@ -170,16 +170,16 @@ private: View *_underBarsView; Common::Rect _underSubtitlesScreenRect; - Common::Rect _underSubtitlesBackupRect; + Common::Rect _underSubtitlesBackupRect; Common::Rect _underTopBarScreenRect; Common::Rect _underBottomBarBackupRect; Common::Rect _underBottomBarScreenRect; Common::Rect _underTopBarBackupRect; - byte *_underSubtitlesViewBuf; // CHECKME: Useless? + byte *_underSubtitlesViewBuf; // CHECKME: Useless? - byte *_mainViewBuf; + byte *_mainViewBuf; View *_hnmView; byte *_hnmViewBuf; @@ -189,7 +189,7 @@ private: Common::Rect _rect_dst, _rect_src; - View *_view2; + View *_view2; int _hnmFrameNum; @@ -205,7 +205,7 @@ private: color_t _oldPalette[256]; // TODO palette_t ? color_t _newPalette[256]; - bool _showBlackBars; + bool _showBlackBars; void saveUnderSubtitles(int16 y); diff --git a/engines/director/detection.cpp b/engines/director/detection.cpp index 9d029c2e645..144fbc868b5 100644 --- a/engines/director/detection.cpp +++ b/engines/director/detection.cpp @@ -72,7 +72,7 @@ static const PlainGameDescriptor directorGames[] = { { "gundam0079", "Gundam 0079: The War for Earth" }, { "hamsterland1", "Busy People of Hamsterland" }, { "hamsterland2", "Hamsterland: The Time Machine" }, - { "hhouse", "Gahan Wilson's The Ultimate Haunted House" }, + { "hhouse", "Gahan Wilson's The Ultimate Haunted House" }, { "horrortour1", "Zeddas: Servant of Sheol"}, { "horrortour2", "Zeddas: Horror Tour 2"}, { "horrortour3", "Labyrinthe"}, diff --git a/engines/director/lingo/lingo-builtins.cpp b/engines/director/lingo/lingo-builtins.cpp index f5122f878d4..3e082b0b209 100644 --- a/engines/director/lingo/lingo-builtins.cpp +++ b/engines/director/lingo/lingo-builtins.cpp @@ -1853,7 +1853,7 @@ void LB::b_puppetSound(int nargs) { warning("b_puppetSound(): needs 1 or 2 args"); return; } - + DirectorSound *sound = g_director->getSoundManager(); Datum castMember = g_lingo->pop(); Score *score = g_director->getCurrentMovie()->getScore(); diff --git a/engines/director/lingo/lingo-events.cpp b/engines/director/lingo/lingo-events.cpp index af1db189f5a..8559cdd768b 100644 --- a/engines/director/lingo/lingo-events.cpp +++ b/engines/director/lingo/lingo-events.cpp @@ -254,7 +254,7 @@ void Movie::registerEvent(LEvent event, int targetId) { case kEventEnterFrame: queueFrameEvent(event, eventId); break; - + case kEventIdle: case kEventStartUp: case kEventStartMovie: @@ -264,7 +264,7 @@ void Movie::registerEvent(LEvent event, int targetId) { break; default: - warning("registerEvent: Unhandled event %s", _lingo->_eventHandlerTypes[event]); + warning("registerEvent: Unhandled event %s", _lingo->_eventHandlerTypes[event]); } } else { /* In D4+, queue any objects that responds to this event, in order of precedence. diff --git a/engines/director/lingo/lingo-lex.cpp b/engines/director/lingo/lingo-lex.cpp index 51b2f34ad43..663074c9474 100644 --- a/engines/director/lingo/lingo-lex.cpp +++ b/engines/director/lingo/lingo-lex.cpp @@ -34,7 +34,7 @@ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. + * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 @@ -51,7 +51,7 @@ typedef uint32_t flex_uint32_t; typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; +typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; @@ -162,10 +162,10 @@ extern FILE *yyin, *yyout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 - + #define YY_LESS_LINENO(n) #define YY_LINENO_REWIND_TO(ptr) - + /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ @@ -899,9 +899,9 @@ extern int yywrap ( void ); #endif #ifndef YY_NO_UNPUT - + static void yyunput ( int c, char *buf_ptr ); - + #endif #ifndef yytext_ptr @@ -1031,7 +1031,7 @@ YY_DECL yy_state_type yy_current_state; char *yy_cp, *yy_bp; int yy_act; - + if ( !(yy_init) ) { (yy_init) = 1; @@ -1998,7 +1998,7 @@ static int yy_get_next_buffer (void) { yy_state_type yy_current_state; char *yy_cp; - + yy_current_state = (yy_start); yy_current_state += YY_AT_BOL(); @@ -2055,7 +2055,7 @@ static int yy_get_next_buffer (void) static void yyunput (int c, char * yy_bp ) { char *yy_cp; - + yy_cp = (yy_c_buf_p); /* undo effects of setting up yytext */ @@ -2100,7 +2100,7 @@ static int yy_get_next_buffer (void) { int c; - + *(yy_c_buf_p) = (yy_hold_char); if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) @@ -2169,12 +2169,12 @@ static int yy_get_next_buffer (void) /** Immediately switch to a different input stream. * @param input_file A readable stream. - * + * * @note This function does not reset the start condition to @c INITIAL . */ void yyrestart (FILE * input_file ) { - + if ( ! YY_CURRENT_BUFFER ){ yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = @@ -2187,11 +2187,11 @@ static int yy_get_next_buffer (void) /** Switch to a different input buffer. * @param new_buffer The new input buffer. - * + * */ void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) { - + /* TODO. We should be able to replace this entire function body * with * yypop_buffer_state(); @@ -2231,13 +2231,13 @@ static void yy_load_buffer_state (void) /** Allocate and initialize an input buffer state. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. - * + * * @return the allocated buffer state. */ YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) { YY_BUFFER_STATE b; - + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); @@ -2260,11 +2260,11 @@ static void yy_load_buffer_state (void) /** Destroy the buffer. * @param b a buffer created with yy_create_buffer() - * + * */ void yy_delete_buffer (YY_BUFFER_STATE b ) { - + if ( ! b ) return; @@ -2285,7 +2285,7 @@ static void yy_load_buffer_state (void) { int oerrno = errno; - + yy_flush_buffer( b ); b->yy_input_file = file; @@ -2301,13 +2301,13 @@ static void yy_load_buffer_state (void) } b->yy_is_interactive = 0; - + errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. - * + * */ void yy_flush_buffer (YY_BUFFER_STATE b ) { @@ -2336,7 +2336,7 @@ static void yy_load_buffer_state (void) * the current state. This function will allocate the stack * if necessary. * @param new_buffer The new state. - * + * */ void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) { @@ -2366,7 +2366,7 @@ void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) /** Removes and deletes the top of the stack, if present. * The next element becomes the new top. - * + * */ void yypop_buffer_state (void) { @@ -2390,7 +2390,7 @@ void yypop_buffer_state (void) static void yyensure_buffer_stack (void) { yy_size_t num_to_alloc; - + if (!(yy_buffer_stack)) { /* First allocation is just for 2 elements, since we don't know if this @@ -2433,13 +2433,13 @@ static void yyensure_buffer_stack (void) /** Setup the input buffer state to scan directly from a user-specified character buffer. * @param base the character buffer * @param size the size in bytes of the character buffer - * + * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) { YY_BUFFER_STATE b; - + if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) @@ -2468,14 +2468,14 @@ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) /** Setup the input buffer state to scan a string. The next call to yylex() will * scan from a @e copy of @a str. * @param yystr a NUL-terminated string to scan - * + * * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use * yy_scan_bytes() instead. */ YY_BUFFER_STATE yy_scan_string (const char * yystr ) { - + return yy_scan_bytes( yystr, (int) strlen(yystr) ); } @@ -2483,7 +2483,7 @@ YY_BUFFER_STATE yy_scan_string (const char * yystr ) * scan from a @e copy of @a bytes. * @param yybytes the byte buffer to scan * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. - * + * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len ) @@ -2492,7 +2492,7 @@ YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len ) char *buf; yy_size_t n; int i; - + /* Get memory for full buffer, including space for trailing EOB's. */ n = (yy_size_t) (_yybytes_len + 2); buf = (char *) yyalloc( n ); @@ -2546,16 +2546,16 @@ static void yynoreturn yy_fatal_error (const char* msg ) /* Accessor methods (get/set functions) to struct members. */ /** Get the current line number. - * + * */ int yyget_lineno (void) { - + return yylineno; } /** Get the input stream. - * + * */ FILE *yyget_in (void) { @@ -2563,7 +2563,7 @@ FILE *yyget_in (void) } /** Get the output stream. - * + * */ FILE *yyget_out (void) { @@ -2571,7 +2571,7 @@ FILE *yyget_out (void) } /** Get the length of the current token. - * + * */ int yyget_leng (void) { @@ -2579,7 +2579,7 @@ int yyget_leng (void) } /** Get the current token. - * + * */ char *yyget_text (void) @@ -2589,18 +2589,18 @@ char *yyget_text (void) /** Set the current line number. * @param _line_number line number - * + * */ void yyset_lineno (int _line_number ) { - + yylineno = _line_number; } /** Set the input stream. This does not discard the current * input buffer. * @param _in_str A readable stream. - * + * * @see yy_switch_to_buffer */ void yyset_in (FILE * _in_str ) @@ -2654,7 +2654,7 @@ static int yy_init_globals (void) /* yylex_destroy is for both reentrant and non-reentrant scanners. */ int yylex_destroy (void) { - + /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ yy_delete_buffer( YY_CURRENT_BUFFER ); @@ -2680,7 +2680,7 @@ int yylex_destroy (void) #ifndef yytext_ptr static void yy_flex_strncpy (char* s1, const char * s2, int n ) { - + int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; @@ -2705,7 +2705,7 @@ void *yyalloc (yy_size_t size ) void *yyrealloc (void * ptr, yy_size_t size ) { - + /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter diff --git a/engines/director/lingo/lingo.cpp b/engines/director/lingo/lingo.cpp index 6733746cc24..8167a4ec965 100644 --- a/engines/director/lingo/lingo.cpp +++ b/engines/director/lingo/lingo.cpp @@ -584,7 +584,7 @@ void Lingo::execute(uint pc) { _vm->getCurrentMovie()->getScore()->_playState = kPlayStopped; break; } - + Common::String instr = decodeInstruction(_currentArchive, _currentScript, _pc); uint current = _pc; @@ -1042,7 +1042,7 @@ int Datum::asCastId() const { CastMember *member = movie->getCastMemberByName(asString()); if (member) return member->getID(); - + g_lingo->lingoError("Datum::asCastId: reference to non-existent cast member: %s", asString().c_str()); return 0; } diff --git a/engines/director/lingo/tests/d3.menus.txt b/engines/director/lingo/tests/d3.menus.txt index 601fd1dfbbb..66bb4f6f980 100644 --- a/engines/director/lingo/tests/d3.menus.txt +++ b/engines/director/lingo/tests/d3.menus.txt @@ -9,9 +9,9 @@ machineType;marker;memorySize;mouseCast;mouseChar;mouseItem;mouseLine;mouseDown; menu: Keywords exit;factory;global;if;instance;macro;menu:;method;on;on idle;on startMovie;on stepMovie;on stopMovie;repeat while;repeat with;return menu: Operators -() ;sprite s within ;sprite s intersects ; - ;not ;and ;or ;* ;/ ;mod ;+ ; - ;& ;&& ;< ;<= ;> ;>= ;<> ;contains ;starts ;= +() ;sprite s within ;sprite s intersects ; - ;not ;and ;or ;* ;/ ;mod ;+ ; - ;& ;&& ;< ;<= ;> ;>= ;<> ;contains ;starts ;= menu: Constants -BACKSPACE ;EMPTY ;ENTER ;FALSE ;QUOTE ;RETURN ;TAB ;TRUE +BACKSPACE ;EMPTY ;ENTER ;FALSE ;QUOTE ;RETURN ;TAB ;TRUE menu: Properties beepOn;buttonStyle;centerStage;checkBoxAccess;checkBoxType;colorDepth;exitLock;fixStageSize;floatPrecision;fullColorPermit;imageDirect;keyDownScript;maxInteger;mouseDownScript;mouseUpScript;perFrameHook;romanLingo;soundEnabled;soundLevel;stageColor;switchColorDepth;timeoutKeydown;timeoutLapsed;timeoutLength;timeoutMouse;timeoutPlay;timeoutScript;timer menu: Sprite Properties diff --git a/engines/dm/dm.cpp b/engines/dm/dm.cpp index 73ef939d813..fd4ad2b5dc2 100644 --- a/engines/dm/dm.cpp +++ b/engines/dm/dm.cpp @@ -120,7 +120,7 @@ int16 DMEngine::getDistance(int16 mapx1, int16 mapy1, int16 mapx2, int16 mapy2) return ABS(mapx1 - mapx2) + ABS(mapy1 - mapy2); } -DMEngine::DMEngine(OSystem *syst, const DMADGameDescription *desc) : +DMEngine::DMEngine(OSystem *syst, const DMADGameDescription *desc) : Engine(syst), _console(nullptr), _gameVersion(desc), _thingNone(0), _thingEndOfList(0xFFFE), _thingFirstExplosion(0xFF80), _thingExplFireBall(0xFF80), _thingExplSlime(0xFF81), _thingExplLightningBolt(0xFF82), diff --git a/engines/glk/agt/agil.cpp b/engines/glk/agt/agil.cpp index 981a017e09f..908b50de90a 100644 --- a/engines/glk/agt/agil.cpp +++ b/engines/glk/agt/agil.cpp @@ -53,7 +53,7 @@ char **dict; /* dict[n] points to the nth dictionary word */ long dp; /* Dictionary pointer: number of words in dict */ #define DICT_INIT 12*1024 /* Starting size of dictstr */ -#define DICT_GRAN 1024 /* Granularity of dictstr size requests +#define DICT_GRAN 1024 /* Granularity of dictstr size requests must be at least 4. */ char *dictstr; /* Pointer to memory block containing dict words */ long dictstrptr, dictstrsize; diff --git a/engines/glk/agt/agility.h b/engines/glk/agt/agility.h index 89d562882c2..b7ad932ab45 100644 --- a/engines/glk/agt/agility.h +++ b/engines/glk/agt/agility.h @@ -157,7 +157,7 @@ typedef enum {fNONE, -#define OLD_VERB 59 /* Number of built in verbs in original interpreters-- +#define OLD_VERB 59 /* Number of built in verbs in original interpreters-- this number includes ANY, which is verb 0. */ #define DIR_ADDR_CODE (OLD_VERB+17) /* Verb ID used for direct address */ #define AUX_VERB 18 /* Additional verbs supported by the interpreter */ @@ -654,7 +654,7 @@ global char **dict; /* dict[n] points to the nth dictionary word */ global long dp; /* Dictionary pointer: number of words in dict */ #define DICT_INIT 12*1024 /* Starting size of dictstr */ -#define DICT_GRAN 1024 /* Granularity of dictstr size requests +#define DICT_GRAN 1024 /* Granularity of dictstr size requests must be at least 4. */ global char *dictstr; /* Pointer to memory block containing dict words */ global long dictstrptr, dictstrsize; @@ -823,7 +823,7 @@ global rbool open_as_binary; /* Open text files as binary, anyhow. */ #define FT_DICTPTR 13 /* Pointer into dictionary text */ #define FT_TLINE 14 /* TextLine */ #define FT_CHAR 15 /* Characters. */ -#define FT_CFG 16 /* Configuration byte; 0=false, 1=true, +#define FT_CFG 16 /* Configuration byte; 0=false, 1=true, 2=none (don't change) */ #define DT_DEFAULT 0 /* Default internal type for */ diff --git a/engines/glk/agt/interp.h b/engines/glk/agt/interp.h index dd140732341..73cd36552d4 100644 --- a/engines/glk/agt/interp.h +++ b/engines/glk/agt/interp.h @@ -60,7 +60,7 @@ global rbool DEBUG_DISAMBIG; /* Print out dismabiguation debugging info */ global rbool DEBUG_SMSG; /* Print out STANDARD message info */ #define DEBUG_AGT_CMD flag[0] /* This sends metacommand execution information - to either the screen or debugfile, depending on + to either the screen or debugfile, depending on whether DEBUG_OUT is true or false. */ global rbool debug_disambig, debug_any; @@ -99,7 +99,7 @@ global rbool PURE_DOT; /* Treats period as a letter-character and not even if there are no words in the dictionary containing periods. The only reason to set this was if you were concerned that knowledge - about the presence or absence of periods in the + about the presence or absence of periods in the dictionary would give puzzles away. */ diff --git a/engines/glk/agt/metacommand.cpp b/engines/glk/agt/metacommand.cpp index f4756d91ac1..ab872963369 100644 --- a/engines/glk/agt/metacommand.cpp +++ b/engines/glk/agt/metacommand.cpp @@ -40,7 +40,7 @@ namespace AGT { many */ #define MAX_SUBCALL 2047 /* Maximum number of subroutine calls. - If this is 0, no limit (except for the + If this is 0, no limit (except for the program's stack size). */ diff --git a/engines/glk/alan2/parse.h b/engines/glk/alan2/parse.h index 1cfdcf13642..aea68035377 100644 --- a/engines/glk/alan2/parse.h +++ b/engines/glk/alan2/parse.h @@ -30,7 +30,7 @@ namespace Glk { namespace Alan2 { -extern Aword wrds[]; // List of Parsed Word +extern Aword wrds[]; // List of Parsed Word extern int wrdidx; // and an index into it extern ParamElem *params; // List of parameters diff --git a/engines/glk/alan3/act.cpp b/engines/glk/alan3/act.cpp index 13ca56aa273..720a35d2cee 100644 --- a/engines/glk/alan3/act.cpp +++ b/engines/glk/alan3/act.cpp @@ -113,7 +113,7 @@ void action(CONTEXT, int verb, Parameter parameters[], Parameter multipleMatches context._break = false; if (context._break) return; - + if (multipleMatches[i + 1].instance != EOD) para(); } diff --git a/engines/glk/alan3/parse.cpp b/engines/glk/alan3/parse.cpp index e6e3aa24791..4a7129f2a71 100644 --- a/engines/glk/alan3/parse.cpp +++ b/engines/glk/alan3/parse.cpp @@ -567,7 +567,7 @@ static void parseExceptions(CONTEXT, ParameterPosition *parameterPosition, Param currentWordIndex++; parameterPosition->exceptions = ensureParameterArrayAllocated(parameterPosition->exceptions); CALL1(simpleParameterParser, parameterPosition->exceptions) - + if (lengthOfParameterArray(parameterPosition->exceptions) == 0) errorAfterExcept(context, exceptWordIndex); } @@ -1086,7 +1086,7 @@ static void handleMultiplePosition(CONTEXT, ParameterPosition parameterPositions /* If the player used ALL, try to find out what was applicable */ CALL3(disambiguateCandidatesForPosition, parameterPositions, multiplePosition, parameterPositions[multiplePosition].parameters) - + if (lengthOfParameterArray(parameterPositions[multiplePosition].parameters) == 0) CALL1(errorWhat, parameterPositions[multiplePosition].parameters[0].firstWord) @@ -1322,7 +1322,7 @@ static void disambiguate(CONTEXT, ParameterPosition parameterPositions[], Elemen Parameter *parameter = ¶meters[p]; Parameter *candidates = parameter->candidates; CALL4(disambiguateCandidates, candidates, omni, reachable, disambiguationHandlerTable) - + parameter->instance = candidates[0].instance; } } diff --git a/engines/glk/archetype/archetype.cpp b/engines/glk/archetype/archetype.cpp index fb1d277bb1c..432d6414de2 100644 --- a/engines/glk/archetype/archetype.cpp +++ b/engines/glk/archetype/archetype.cpp @@ -63,7 +63,7 @@ bool Archetype::initialize() { saveload_init(); sys_object_init(); timestamp_init(); - + // keywords new_xarray(Literals); new_xarray(Vocabulary); @@ -166,11 +166,11 @@ String Archetype::readLine() { if (text.contains("save") || text.contains("load")) { writeln(); return ""; - + } else if (loadingSavegame()) { // Automatically trigger a load action if a savegame needs loading from the launcher return String("load"); - + } else if (_saveSlot == -2) { _saveSlot = -1; return String("look"); @@ -315,7 +315,7 @@ bool Archetype::send_message(int transport, int message_sent, int recipient, bool done, find_other; ObjectPtr op, original; ResultType r; - NodePtr np; + NodePtr np; StatementPtr st; void *p; ContextType c; @@ -332,7 +332,7 @@ bool Archetype::send_message(int transport, int message_sent, int recipient, r._kind = IDENT; r._data._ident.ident_kind = OBJECT_ID; r._data._ident.ident_int = context.self; - + debugN(" : "); display_result(r); diff --git a/engines/glk/archetype/linked_list.cpp b/engines/glk/archetype/linked_list.cpp index 0965e65bdeb..5e5943893a5 100644 --- a/engines/glk/archetype/linked_list.cpp +++ b/engines/glk/archetype/linked_list.cpp @@ -84,7 +84,7 @@ void insert_item(ListType &the_list, NodePtr the_item) { NodePtr find_item(ListType &the_list, int the_key) { NodePtr p; for (p = the_list->next; p != the_list && the_key < p->key; p = p->next) {} - + return (p == the_list || the_key != p->key) ? nullptr : p; } diff --git a/engines/glk/archetype/parser.cpp b/engines/glk/archetype/parser.cpp index 18fad82c5bf..b451de8a76f 100644 --- a/engines/glk/archetype/parser.cpp +++ b/engines/glk/archetype/parser.cpp @@ -73,7 +73,7 @@ void normalize_string(const String &first, String &second) { if (i > lfirst) done = true; - + } else if (in_word) { if (j < g_vm->Abbreviate) { second = second + locase(first[i]); diff --git a/engines/glk/archetype/semantic.h b/engines/glk/archetype/semantic.h index 2166e81220b..947410232c3 100644 --- a/engines/glk/archetype/semantic.h +++ b/engines/glk/archetype/semantic.h @@ -70,7 +70,7 @@ extern int classify_as(progfile &f, int id_number, ClassifyType interpretation, /** * Given an ID_Table index, finds what it represents and returns an appropriate enumerated * type and index. - * + * * If /K is asserted, default return is UNDEFINED_ID; else it is ENUMERATE_ID. * @param id_number integer index to ID_Table * @param meaning Output classification of ID diff --git a/engines/glk/archetype/string.h b/engines/glk/archetype/string.h index 5afa4d60378..94ca26ae20f 100644 --- a/engines/glk/archetype/string.h +++ b/engines/glk/archetype/string.h @@ -100,7 +100,7 @@ public: /** * Converts a string to a value - * @param code Optional returns non-value of character index + * @param code Optional returns non-value of character index */ int val(int *code); diff --git a/engines/glk/archetype/timestamp.h b/engines/glk/archetype/timestamp.h index 893ba438cec..8316890662f 100644 --- a/engines/glk/archetype/timestamp.h +++ b/engines/glk/archetype/timestamp.h @@ -37,7 +37,7 @@ extern void timestamp_init(); /** * Creates a compressed long integer that contains all the necessary time information. * There are enough bits in a 32-bit word to do this : - * + * * Variable Range Bits * -------- ----- ---- * Year 0-63 6 @@ -46,11 +46,11 @@ extern void timestamp_init(); * Hour 0-23 5 * Minute 0-59 6 * Second 0-59 6 - * + * * Note that Year does not quite fit comfortably into this scheme.The actual returned value * is 1980-2099, a span of 119 years; but we are using only 63. Year 0 is considered 1992 * and the upper limit is 2055 before it goes back to year 0 (1992) again. - * + * * The DayOfWeek information is thrown away because it is redundant, and the Sec100 information * is thrown away because it is unnecessarily precise */ diff --git a/engines/glk/blorb.cpp b/engines/glk/blorb.cpp index 386f06c7e22..611e5660cc7 100644 --- a/engines/glk/blorb.cpp +++ b/engines/glk/blorb.cpp @@ -75,7 +75,7 @@ Common::SeekableReadStream *Blorb::createReadStreamForMember(const Common::Strin f.seek(ce._offset); Common::SeekableReadStream *result; - + if (ce._id == ID_FORM) { // AIFF chunks need to be wrapped in a FORM chunk for ScummVM decoder byte *sound = (byte *)malloc(ce._size + 8); @@ -134,7 +134,7 @@ Common::ErrorCode Blorb::load() { else if (ce._id == ID_AIFF || ce._id == ID_FORM) ce._filename += ".aiff"; else if (ce._id == ID_OGG) - ce._filename += ".ogg"; + ce._filename += ".ogg"; else if (ce._id == ID_MOD) ce._filename += ".mod"; diff --git a/engines/glk/comprehend/game.cpp b/engines/glk/comprehend/game.cpp index 911077ee727..054a9213206 100644 --- a/engines/glk/comprehend/game.cpp +++ b/engines/glk/comprehend/game.cpp @@ -848,7 +848,7 @@ turn: beforePrompt(); for (;;) { - _redoLine = REDO_NONE; + _redoLine = REDO_NONE; g_comprehend->print("> "); g_comprehend->readLine(_inputLine, INPUT_LINE_SIZE); if (g_comprehend->shouldQuit()) diff --git a/engines/glk/comprehend/game_data.h b/engines/glk/comprehend/game_data.h index 37312b45cb2..2a6a3b97ea3 100644 --- a/engines/glk/comprehend/game_data.h +++ b/engines/glk/comprehend/game_data.h @@ -327,7 +327,7 @@ struct StringFile { uint32 _endOffset; StringFile() : _baseOffset(0), _endOffset(0) { - } + } StringFile(const char *fname, uint32 baseOfs = 0, uint32 endO = 0) : _filename(fname), _baseOffset(baseOfs), _endOffset(endO) { } diff --git a/engines/glk/conf.cpp b/engines/glk/conf.cpp index d1ed3fe496e..4943bbbca4e 100644 --- a/engines/glk/conf.cpp +++ b/engines/glk/conf.cpp @@ -197,7 +197,7 @@ void Conf::synchronize() { _monoInfo._caretShape = _propInfo._caretShape; _monoInfo._linkStyle = _propInfo._linkStyle; } - + syncAsInt("scrollwidth", _scrollWidth); syncAsColor("scrollbg", _scrollBg); syncAsColor("scrollfg", _scrollFg); diff --git a/engines/glk/glk_dispa.cpp b/engines/glk/glk_dispa.cpp index 2fb8b87b873..92f8afca0f2 100644 --- a/engines/glk/glk_dispa.cpp +++ b/engines/glk/glk_dispa.cpp @@ -1228,7 +1228,7 @@ void GlkAPI::gidispatch_call(uint32 funcnum, uint32 numargs, gluniversal_t *argl glktimeval_t timeval; glktimeval_t *timeptr = nullptr; timeval.high_sec = timeval.low_sec = timeval.microsec = 0; - + int ix = 0; if (arglist[ix++]._ptrflag) { dateptr = &date; diff --git a/engines/glk/hugo/heexpr.cpp b/engines/glk/hugo/heexpr.cpp index 604fa7f6ca2..0219a44e736 100644 --- a/engines/glk/hugo/heexpr.cpp +++ b/engines/glk/hugo/heexpr.cpp @@ -478,7 +478,7 @@ int Hugo::GetVal() { /* The array element we're after: */ element = arrayaddr+a + j*2; - + defseg = arraytable; #if defined (DEBUGGER) CheckinRange(element, debug_workspace, "array data"); @@ -519,7 +519,7 @@ int Hugo::GetVal() { { codeptr += 2; /* skip the "(" */ val = GetValue(); - if (val!=0) + if (val!=0) #if !defined (RANDOM) val = (hugo_rand() % val)+1; #else @@ -538,7 +538,7 @@ int Hugo::GetVal() { val = words; break; } - + val = wd[GetValue()]; if (MEM(codeptr)==CLOSE_SQUARE_T) codeptr++; break; @@ -672,14 +672,14 @@ int Hugo::GetVal() { codeptr++; break; } - + case SYSTEM_T: { val = RunSystem(); codeptr++; break; } - + default: { #if defined (DEBUGGER) diff --git a/engines/glk/hugo/hemisc.cpp b/engines/glk/hugo/hemisc.cpp index 224d8a10448..51cd80f16eb 100644 --- a/engines/glk/hugo/hemisc.cpp +++ b/engines/glk/hugo/hemisc.cpp @@ -119,7 +119,7 @@ void Hugo::AP(const char *a) { for (i=0; i= ' ') { SETMEM(arraytable*16L + textto*2 + n, c); @@ -544,7 +544,7 @@ void Hugo::ContextCommand() { ContextCommandLoop: codeptr++; - + n = GetValue(); #if !defined (COMPILE_V25) if (n==0) @@ -611,7 +611,7 @@ unsigned int Hugo::Dict() { pos += Peek(pos) + 1; loc = pos - 2; - + if ((long)(pos+strlen(line)) > (long)(codeend-dicttable*16L)) { #ifdef DEBUGGER @@ -759,7 +759,7 @@ void Hugo::FileIO() { if (game_version>=23) codeptr++; /* eol */ ioerror = 0; - + /* Make sure the filename is legal, 8 alphanumeric characters or less */ strcpy(line, GetWord(fnameval)); if (strlen(line) > 8) goto LeaveFileIO; @@ -891,7 +891,7 @@ void Hugo::GetCommand() { physical_windowleft+width, y+lineheight-1); hugo_getline(a); - + /* If hugo_scrollwindowup() called by hugo_getline() shifted things */ if (current_text_y > y) { @@ -905,7 +905,7 @@ void Hugo::GetCommand() { if (buffer[i]==' ') { buffer[i] = '\0'; - TB_AddWord(buffer+start, physical_windowleft+width, y-lineheight, + TB_AddWord(buffer+start, physical_windowleft+width, y-lineheight, physical_windowleft+width+hugo_textwidth(buffer+start), y-1); width += hugo_textwidth(buffer+start) + hugo_textwidth(" "); start = i+1; @@ -913,7 +913,7 @@ void Hugo::GetCommand() { } } /* Add the final word */ - TB_AddWord(buffer+start, physical_windowleft+width, y-lineheight, + TB_AddWord(buffer+start, physical_windowleft+width, y-lineheight, physical_windowleft+width+hugo_textwidth(buffer+start), y-1); #else hugo_getline(a); @@ -1050,25 +1050,25 @@ void Hugo::InitGame() { context_commands = 0; #endif game_reset = false; - + SetStackFrame(stack_depth, RUNROUTINE_BLOCK, 0, 0); /* Figure out which objects have either a noun or an adjective property; store it in obj_parselist, one bit per object */ if ((!obj_parselist) && (obj_parselist = (char *)hugo_blockalloc(sizeof(char)*((objects+7)/8)))) { - + for (i=0; i and processing each code or printed character, as the case may be: */ - + l = 0; /* physical length of string */ for (i=0; i<(int)strlen(a); i++) @@ -1651,7 +1651,7 @@ void Hugo::Printout(char *a, int no_scrollback_linebreak) { if (!playback) skipping_more = false; ++full; - + /* The after-check of the linecount: */ if ((full) && full >= physical_windowheight/lineheight) { @@ -1678,14 +1678,14 @@ void Hugo::PromptMore() { char temp_during_player_input; int k, tempcurrentfont; int temp_current_text_y = current_text_y; - + if (playback && skipping_more) { full = 0; return; } skipping_more = false; - + /* Clear the key buffer */ while (hugo_iskeywaiting()) hugo_getkey(); @@ -2367,7 +2367,7 @@ void srandom(int seed) rand_table[54] = seed; rand_index1 = 0; rand_index2 = 31; - + for (i = 0; i < 55; i++) { int ii = (21 * i) % 55; @@ -2376,7 +2376,7 @@ void srandom(int seed) k = seed - k; seed = rand_table[ii]; } - + for (loop = 0; loop < 4; loop++) { for (i = 0; i < 55; i++) diff --git a/engines/glk/hugo/heobject.cpp b/engines/glk/hugo/heobject.cpp index 72a9e76d6bf..03fa84c207a 100644 --- a/engines/glk/hugo/heobject.cpp +++ b/engines/glk/hugo/heobject.cpp @@ -382,10 +382,10 @@ GetNextProp: /* Prevent premature stopping */ if (debugger_step_over && !debugger_finish) debugger_run = true; - + if (IsBreakpoint(orig_inprop)) complex_prop_breakpoint = true; - + sprintf(debug_line, "Calling: %s.%s", objectname[obj], propertyname[p]); trace_complex_prop_routine = true; diff --git a/engines/glk/hugo/heparse.cpp b/engines/glk/hugo/heparse.cpp index ad968070029..c5a939ddab9 100644 --- a/engines/glk/hugo/heparse.cpp +++ b/engines/glk/hugo/heparse.cpp @@ -89,7 +89,7 @@ void Hugo::AddPossibleObject(int obj, char type, unsigned int w) { also a noun for that same object */ if (ObjWordType(obj, w, noun)) type = (char)noun; - + pobjlist[pobjcount].obj = obj; pobjlist[pobjcount].type = type; @@ -145,7 +145,7 @@ void Hugo::AdvanceGrammar() { int Hugo::AnyObjWord(int wn) { int i; - + if (objword_cache[wn]) return objword_cache[wn]; @@ -308,7 +308,7 @@ unsigned int Hugo::FindWord(const char *a) { ptr += (p + 1); } - + /* As a last resort, see if the first 6 characters of the word (if it has at least six characters) match a dictionary word: */ @@ -318,14 +318,14 @@ unsigned int Hugo::FindWord(const char *a) { int posscount = 0; ptr = 0; - + for (i=1; i<=dictcount; i++) { if (alen<=(p = Peek(ptr+2)) && (unsigned char)MEM(dicttable*16L+ptr+3)-CHAR_TRANSLATION==a[0]) { if (!strncmp(GetString(ptr + 2), a, alen)) { - /* As long as the dictionary word + /* As long as the dictionary word doesn't contain a space */ if (!strrchr(GetString(ptr+2), ' ')) { @@ -336,7 +336,7 @@ unsigned int Hugo::FindWord(const char *a) { } ptr += (p + 1); } - + if (posscount==1) return possible; } @@ -384,7 +384,7 @@ int Hugo::MatchCommand() { #endif odomain = 0; - + /* Reset these for command-matching */ if (!speaking) { @@ -494,7 +494,7 @@ MatchVerb: verbptr = ptr + 2; for (i=1; i<=numverbs; i++) { - /* 0xffff signals something other than a + /* 0xffff signals something other than a dictionary word--see BuildVerb() in hcbuild.c. This will be the case, like, 1% of the time. */ @@ -614,10 +614,10 @@ MatchVerb: obj_match_state = 5; i = 1; recursive_call = 0; - + if (MatchObject(&i) != true) return 0; /* unsuccessful */ - + speaking = pobj; /* successful */ gotspeaker = true; @@ -625,7 +625,7 @@ MatchVerb: for (i=1; i<=objfinish; i++) KillWord(1); if (word[1][0]=='~') KillWord(1); - + /* If it's a name and that's all...*/ if (words==0) return true; @@ -985,7 +985,7 @@ Clarify: if (!strcmp(word[*wordnum], "~all")) /* if "~all" is specified */ { parse_allflag = true; - + /* If one or more words were already matched, however... */ if (mobjs > 0) @@ -1057,7 +1057,7 @@ Clarify: pobj = i; } - else if ((Peek(grammaraddr)==NOTHELD_T || Peek(grammaraddr)==MULTINOTHELD_T) + else if ((Peek(grammaraddr)==NOTHELD_T || Peek(grammaraddr)==MULTINOTHELD_T) && Parent(i)==var[actor]) { SubtractPossibleObject(i); @@ -1349,7 +1349,7 @@ Clarify: if (!strcmp(word[1], "~all")) flag = 1; - /* If not, tell MatchCommand() that there's a + /* If not, tell MatchCommand() that there's a new command coming down the hopper. */ if (flag==0) @@ -1686,7 +1686,7 @@ CheckWord: default: { - + /* Some manifestation of an object (or objects) before domain is found, since is initially set to 0: */ @@ -1733,7 +1733,7 @@ CheckWordorString: AdvanceGrammar(); nextsyntax = grammaraddr; grammaraddr = thissyntax; - + goto CheckWordorString; } } @@ -1763,7 +1763,7 @@ CheckWordorString: if (word[*wordnum][0]=='~') { int multicheck = Peek(grammaraddr); - + (*wordnum)++; flag = 1; @@ -1809,7 +1809,7 @@ CheckWordorString: } p = Peek(grammaraddr); - + /* If the xobject is specifically a parent of the object(s) to be matched later: */ @@ -1849,7 +1849,7 @@ CheckXobjectFinish: AdvanceGrammar(); nextsyntax = grammaraddr; grammaraddr = thissyntax; - + goto CheckXobjectFinish; } else if ((p==NUMBER_T && STARTS_AS_NUMBER(word[*wordnum])) && @@ -1904,20 +1904,20 @@ CheckXobjectFinish: } } } - + return 0; } int Hugo::ObjWordType(int obj, unsigned int w, int type) { int j, num; unsigned int pa; - + pa = PropAddr(obj, type, 0); if (pa) { defseg = proptable; num = Peek(pa + 1); - + if (num==PROP_ROUTINE) { if ((unsigned int)GetProp(obj, type, 1, false)==w) @@ -1950,10 +1950,10 @@ int Hugo::ObjWord(int obj, unsigned int w) { if (ObjWordType(obj, w, adjective)) return adjective; - + if (ObjWordType(obj, w, noun)) return noun; - + return 0; } @@ -2128,7 +2128,7 @@ NextSyn: ParseError(0,0); /* What? */ return false; } - + return true; } @@ -2329,7 +2329,7 @@ void Hugo::SeparateWords() { /* Begin the word-splitting proper: */ - + words = 1; /* Setup a blank string */ for (i=0; i address_scale) FatalError(UNKNOWN_OP_E); } - + #if !defined (DEBUGGER) #if defined (DEBUG_CODE) if (!inwindow) @@ -1548,7 +1548,7 @@ ProcessToken: */ for (i=0; i= physical_windowheight/lineheight) full = 0; - + if (ypos > physical_windowheight/lineheight) { ypos = physical_windowheight/lineheight; @@ -1743,16 +1743,16 @@ LeaveBreak: codeptr++; i = inexpr; /* don't reuse tempinexpr */ inexpr = 1; - + /* Let 'return Routine()' or 'return obj.prop' set tail_recursion */ tail_recursion = 0; tail_recursion_addr = 0; - + SetupExpr(); inexpr = (char)i; - + /* If either a routine or property routine call has determined it's valid, we can use tail-recursion (with tail_recursion_addr having been set up) @@ -1882,7 +1882,7 @@ LeaveBreak: hugo_settextcolor(fcolor); hugo_setbackcolor(bgcolor); } - + if (inwindow) default_bgcolor = bgcolor; @@ -2274,7 +2274,7 @@ int Hugo::RunString() { int Hugo::RunSystem() { codeptr++; - /* Since the obsolete form of the system command is unimplemented, + /* Since the obsolete form of the system command is unimplemented, simply get the parameter (in order to skip it), and exit the function. */ @@ -2283,15 +2283,15 @@ int Hugo::RunSystem() { GetValue(); return 0; } - + /* Otherwise, process the following system calls: */ - + codeptr++; /* skip opening bracket */ - + var[system_status] = 0; Flushpbuffer(); - + switch (GetValue()) { case 11: /* READ_KEY */ @@ -2319,12 +2319,12 @@ int Hugo::RunSystem() { SRANDOM((unsigned int)time((time_t *)&seed)); #endif break; - } + } case 31: /* PAUSE_SECOND */ if (!hugo_timewait(1)) var[system_status] = STAT_UNAVAILABLE; break; - + case 32: /* PAUSE_100TH_SECOND */ if (!hugo_timewait(100)) var[system_status] = STAT_UNAVAILABLE; @@ -2363,7 +2363,7 @@ int Hugo::RunSystem() { default: var[system_status] = STAT_UNAVAILABLE; } - + return 0; } diff --git a/engines/glk/hugo/heset.cpp b/engines/glk/hugo/heset.cpp index 09dbea70525..38322245882 100644 --- a/engines/glk/hugo/heset.cpp +++ b/engines/glk/hugo/heset.cpp @@ -525,7 +525,7 @@ ModifyAttribute: unsigned int Hugo::GetAnonymousFunction(long addr) { long skipaddr; unsigned int af_addr; - + skipaddr = PeekWord(addr); /* The address of the anonymous function is the next address boundary, calculated as: diff --git a/engines/glk/hugo/htokens.h b/engines/glk/hugo/htokens.h index 08961c7bc05..7c7509989f8 100644 --- a/engines/glk/hugo/htokens.h +++ b/engines/glk/hugo/htokens.h @@ -50,16 +50,16 @@ enum TOKEN_T { NOT_EQUAL_T, AMPERSAND_T, GREATER_T, LESS_T, IF_T, COMMA_T, ELSE_T, ELSEIF_T, WHILE_T, DO_T, SELECT_T, CASE_T, - + /* 0x20 - 0x2f */ FOR_T, RETURN_T, BREAK_T, AND_T, OR_T, JUMP_T, RUN_T, IS_T, NOT_T, TRUE_T, FALSE_T, LOCAL_T, VERB_T, XVERB_T, HELD_T, MULTI_T, - + /* 0x30 - 0x3f */ MULTIHELD_T, NEWLINE_T, ANYTHING_T, PRINT_T, - NUMBER_T, CAPITAL_T, TEXT_T, GRAPHICS_T, + NUMBER_T, CAPITAL_T, TEXT_T, GRAPHICS_T, COLOR_T, REMOVE_T, MOVE_T, TO_T, PARENT_T, SIBLING_T, CHILD_T, YOUNGEST_T, @@ -80,7 +80,7 @@ enum TOKEN_T { RESTART_T, HEX_T, OBJECT_T, XOBJECT_T, STRING_T, ARRAY_T, PRINTCHAR_T, UNDO_T, DICT_T, RECORDON_T, RECORDOFF_T, WRITEFILE_T, - + /* 0x70 - */ READFILE_T, WRITEVAL_T, READVAL_T, PLAYBACK_T, COLOUR_T, PICTURE_T, LABEL_T, SOUND_T, diff --git a/engines/glk/hugo/hugo.cpp b/engines/glk/hugo/hugo.cpp index 3e70d722afd..0eab5d848bb 100644 --- a/engines/glk/hugo/hugo.cpp +++ b/engines/glk/hugo/hugo.cpp @@ -31,7 +31,7 @@ namespace Hugo { Hugo *g_vm; Hugo::Hugo(OSystem *syst, const GlkGameDescription &gameDesc) : GlkAPI(syst, gameDesc), - mainwin(nullptr), currentwin(nullptr), secondwin(nullptr), auxwin(nullptr), + mainwin(nullptr), currentwin(nullptr), secondwin(nullptr), auxwin(nullptr), runtime_warnings(false), dbnest(0), address_scale(16), SCREENWIDTH(0), SCREENHEIGHT(0), FIXEDCHARWIDTH(0), FIXEDLINEHEIGHT(0), // heexpr @@ -41,9 +41,9 @@ Hugo::Hugo(OSystem *syst, const GlkGameDescription &gameDesc) : GlkAPI(syst, gam // hemisc game_version(0), object_size(24), game(nullptr), script(nullptr), playback(nullptr), record(nullptr), io(nullptr), ioblock('\0'), ioerror('\0'), - codestart(0), objtable(0), eventtable(0), proptable(0), arraytable(0), dicttable(0), - syntable(0), initaddr(0), mainaddr(0), parseaddr(0), parseerroraddr(0), - findobjectaddr(0), endgameaddr(0), speaktoaddr(0), performaddr(0), + codestart(0), objtable(0), eventtable(0), proptable(0), arraytable(0), dicttable(0), + syntable(0), initaddr(0), mainaddr(0), parseaddr(0), parseerroraddr(0), + findobjectaddr(0), endgameaddr(0), speaktoaddr(0), performaddr(0), objects(0), events(0), dictcount(0), syncount(0), mem(nullptr), loaded_in_memory(true), defseg(0), gameseg(0), codeptr(0), codeend(0), currentpos(0), currentline(0), full(0), def_fcolor(0), def_bgcolor(0), def_slfcolor(0), def_slbgcolor(0), fcolor(0), bgcolor(0), @@ -94,13 +94,13 @@ Hugo::Hugo(OSystem *syst, const GlkGameDescription &gameDesc) : GlkAPI(syst, gam Common::fill(&resids[0][0], &resids[2][0], 0); numres[0] = numres[1] = 0; - // hemisc + // hemisc Common::fill(&context_command[0][0], &context_command[MAX_CONTEXT_COMMANDS][0], 0); Common::fill(&id[0], &id[3], '\0'); Common::fill(&serial[0], &serial[9], '\0'); Common::fill(&pbuffer[0], &pbuffer[MAXBUFFER * 2 + 1], 0); Common::fill(&undostack[0][0], &undostack[MAXUNDO][0], 0); - + // heparse Common::fill(&buffer[0], &buffer[MAXBUFFER + MAXWORDS], '\0'); Common::fill(&errbuf[0], &errbuf[MAXBUFFER + 1], 0); @@ -248,7 +248,7 @@ Common::Error Hugo::readSaveData(Common::SeekableReadStream *rs) { else undoinvalid = true; return Common::kNoError; - + RestoreError: return Common::kReadingFailed; } diff --git a/engines/glk/jacl/csv.h b/engines/glk/jacl/csv.h index 8aaa186ebb1..e339a40f231 100644 --- a/engines/glk/jacl/csv.h +++ b/engines/glk/jacl/csv.h @@ -44,7 +44,7 @@ namespace JACL { #define CSV_STRICT 1 /* enable strict mode */ #define CSV_REPALL_NL 2 /* report all unquoted carriage returns and linefeeds */ #define CSV_STRICT_FINI 4 /* causes csv_fini to return CSV_EPARSE if last - field is quoted and doesn't containg ending + field is quoted and doesn't containg ending quote */ #define CSV_APPEND_NULL 8 /* Ensure that all fields are null-ternimated */ diff --git a/engines/glk/magnetic/detection_tables.h b/engines/glk/magnetic/detection_tables.h index a0ab3374fd2..777890785c4 100644 --- a/engines/glk/magnetic/detection_tables.h +++ b/engines/glk/magnetic/detection_tables.h @@ -52,7 +52,7 @@ const GlkDetectionEntry MAGNETIC_GAMES[] = { DT_ENTRY0("myth", "9c2a5272a9c0b1e173401ba4df32567a", 99370), DT_ENTRY0("pawn", "4a7847980f9e942acd7aa51ea12a6586", 103466), DT_ENTRY0("wonderland", "2cea8fccf42d570be8836416c2802613", 183916), - + DT_END_MARKER }; diff --git a/engines/glk/magnetic/glk.cpp b/engines/glk/magnetic/glk.cpp index 713fa6e44ef..350fdbaa9d3 100644 --- a/engines/glk/magnetic/glk.cpp +++ b/engines/glk/magnetic/glk.cpp @@ -3643,7 +3643,7 @@ type8 Magnetic::ms_getchar(type8 trans) { if (shouldQuit()) return '\0'; - + if (gms_undo_notification) { /* * Clear the undo notification, and discard buffered input (usually diff --git a/engines/glk/picture.cpp b/engines/glk/picture.cpp index 27266d842ba..a0a0da29db7 100644 --- a/engines/glk/picture.cpp +++ b/engines/glk/picture.cpp @@ -196,7 +196,7 @@ Picture *Pictures::load(const Common::String &name) { for (uint idx = 0; idx < palCount; ++idx) pal[idx] = pic->format.RGBToColor(palette[idx * 3], palette[idx * 3 + 1], palette[idx * 3 + 2]); - + const byte *srcP = (const byte *)img->getPixels(); byte *destP = (byte *)pic->getPixels(); for (int idx = 0; idx < img->w * img->h; ++idx, srcP++, destP += pic->format.bytesPerPixel) { diff --git a/engines/glk/quest/geas_glk.cpp b/engines/glk/quest/geas_glk.cpp index a6324fa197f..169ac04ea85 100644 --- a/engines/glk/quest/geas_glk.cpp +++ b/engines/glk/quest/geas_glk.cpp @@ -125,7 +125,7 @@ String GeasGlkInterface::get_file(const String &fname) const { // Read entirety of the file char *buf = new char[f.size()]; f.read(buf, f.size()); - + String result(buf, buf + f.size()); delete[] buf; diff --git a/engines/glk/quest/geas_state.cpp b/engines/glk/quest/geas_state.cpp index 9319772670a..f6745833459 100644 --- a/engines/glk/quest/geas_state.cpp +++ b/engines/glk/quest/geas_state.cpp @@ -42,7 +42,7 @@ void Serializer::sync(String &s) { if (isLoading()) s = String(str.c_str()); } - + void Serializer::sync(PropertyRecord &pr) { sync(pr.name); sync(pr.data); @@ -89,7 +89,7 @@ void Serializer::sync(GeasState &gs) { void SVarRecord::sync(Serializer &s) { s.sync(name); - + uint count = data.size(); s.syncAsUint32LE(count); if (s.isLoading()) diff --git a/engines/glk/quest/quest.cpp b/engines/glk/quest/quest.cpp index 06e4c96a650..2121108d3a6 100644 --- a/engines/glk/quest/quest.cpp +++ b/engines/glk/quest/quest.cpp @@ -109,7 +109,7 @@ void Quest::playGame() { case evtype_Redraw: draw_banner(); break; - + default: break; } diff --git a/engines/glk/quetzal.cpp b/engines/glk/quetzal.cpp index 33bd5226394..c15b2900c28 100644 --- a/engines/glk/quetzal.cpp +++ b/engines/glk/quetzal.cpp @@ -206,7 +206,7 @@ Common::WriteStream &QuetzalWriter::add(uint32 chunkId) { void QuetzalWriter::save(Common::WriteStream *out, const Common::String &saveName, uint32 formType) { // Add chunks common to all Glk savegames addCommonChunks(saveName); - + // Calculate the size of the chunks uint size = 4; for (uint idx = 0; idx < _chunks.size(); ++idx) diff --git a/engines/glk/quetzal.h b/engines/glk/quetzal.h index 802d4ade6cf..ba54f998725 100644 --- a/engines/glk/quetzal.h +++ b/engines/glk/quetzal.h @@ -84,7 +84,7 @@ public: ++_index; return *this; } - + /** * Decrementer */ diff --git a/engines/glk/sound.cpp b/engines/glk/sound.cpp index 2c8bf319fae..0b8d770f584 100644 --- a/engines/glk/sound.cpp +++ b/engines/glk/sound.cpp @@ -170,7 +170,7 @@ void SoundChannel::setVolume(uint volume, uint duration, uint notify) { if (notify) { warning("TODO: Gradual volume change"); - g_vm->_events->store(evtype_VolumeNotify, nullptr, 0, notify); + g_vm->_events->store(evtype_VolumeNotify, nullptr, 0, notify); } } diff --git a/engines/glk/streams.h b/engines/glk/streams.h index de7eb9b5769..8af8758f561 100644 --- a/engines/glk/streams.h +++ b/engines/glk/streams.h @@ -468,7 +468,7 @@ public: Stream(streams, true, false, rock, false), _inStream(inStream), _outStream(nullptr), _lastOp(0), _textFile(false) {} IOStream(Streams *streams, Common::WriteStream *outStream, uint rock = 0) : Stream(streams, false, true, rock, false), _inStream(nullptr), _outStream(outStream), _lastOp(0), _textFile(false) {} - + /** * Sets the stream to use */ diff --git a/engines/glk/tads/os_banners.cpp b/engines/glk/tads/os_banners.cpp index 40dd8d037f6..db83081cb25 100644 --- a/engines/glk/tads/os_banners.cpp +++ b/engines/glk/tads/os_banners.cpp @@ -390,7 +390,7 @@ void banner_contents_display(contentid_t contents) char ch = '\n'; os_put_buffer(&ch, 1); } - + if (len && (contents->chars[len-1] == '\n')) { len --; diff --git a/engines/glk/tads/os_banners.h b/engines/glk/tads/os_banners.h index 6b73d9a2033..16a20c442f3 100644 --- a/engines/glk/tads/os_banners.h +++ b/engines/glk/tads/os_banners.h @@ -39,7 +39,7 @@ namespace TADS { * External Banner Interface. This interface provides the ability to * divide the display window into multiple sub-windows, each with its own * independent contents. - * + * * To determine where a new banner is displayed, we look at the banners as * a tree, rooted at the "main window," the special banner that the system * automatically creates initially for the main game text. We start by @@ -50,7 +50,7 @@ namespace TADS { * area, according to the child's alignment and size settings, and deduct * this space from the parent window's size. We then lay out the children * of the child. - * + * * For each banner window, we take its requested space out of the parent * window's area by starting at the edge of the parent window rectangle as * indicated by the banner's alignment, and taking the requested `width @@ -59,7 +59,7 @@ namespace TADS { * banner the full extent of the parent's space in its other dimension (so * a left/right banner gets the full height of the parent space, and a * top/bottom banner gets the full width). - * + * * Note that the layout proceeds exclusively down the tree (i.e., from the * root to children to grandchildren, and so on). It *appears* that a * child affects its parent, because of the deduction step: a child @@ -72,7 +72,7 @@ namespace TADS { * a child can do to a parent is carve out a chunk of the parent for * itself, which doesn't affect the boundaries of the union of the parent * plus its children. - * + * * Note also that if the banner has a border, and the implementation * actually draws borders, the border must be drawn for the *full* area of * the banner, as defined above. For example, suppose we have two @@ -92,27 +92,27 @@ namespace TADS { * border is always to be drawn exactly the same way, regardless of * whether or not the banner has children - simply draw the banner as it * would be drawn if the banner had no children. - * + * * Each time a banner is added or removed, we must recalculate the layout * of the remaining banners and main text area. The os_banner_xxx() * implementation is responsible for this layout refiguring. - * + * * The entire external banner window interface is optional, although the * functions must at least be defined as dummies to avoid linker errors * when building. If a platform doesn't implement this feature, * os_banner_create() should simply return null, and the other routines - * can do nothing. + * can do nothing. */ -/* +/* * Create a banner window. 'info' gives the desired parameters for the new * banner. - * + * * Note that certain requested parameter settings might or might not be * respected, depending on the capabilities of the platform and user * preferences. os_banner_getinfo() can be used after creation to * determine which parameter settings are actually used in the new banner. - * + * * 'parent' gives the parent of this banner; this is the banner handle of * another banner window, or null. If 'parent' is null, then the new * banner is a child of the main window, which the system creates @@ -120,7 +120,7 @@ namespace TADS { * transcript. The new banner's on-screen area is carved out of the * parent's space, according to the alignment and size settings of the new * window, so this determines how the window is laid out on the screen. - * + * * 'where' is OS_BANNER_FIRST to make the new window the first child of its * parent; OS_BANNER_LAST to make it the last child of its parent; * OS_BANNER_BEFORE to insert it immediately before the existing banner @@ -128,20 +128,20 @@ namespace TADS { * immediately after 'other'. When BEFORE or AFTER is used, 'other' must * be another child of the same parent; if it is not, the routine should * act as though 'where' were given as OS_BANNER_LAST. - * + * * 'other' is a banner handle for an existing banner window. This is used * to specify the relative position among children of the new banner's * parent, if 'where' is either OS_BANNER_BEFORE or OS_BANNER_AFTER. If * 'where' is OS_BANNER_FIRST or OS_BANNER_LAST, 'other' is ignored. - * + * * 'wintype' is the type of the window. This is one of the * OS_BANNER_TYPE_xxx codes indicating what kind of window is desired. - * + * * 'align' is the banner's alignment, given as an OS_BANNER_ALIGN_xxx * value. Top/bottom banners are horizontal: they run across the full * width of the existing main text area. Left/right banners are vertical: * they run down the full height of the existing main text area. - * + * * 'siz' is the requested size of the new banner. The meaning of 'siz' * depends on the value of 'siz_units', which can be OS_BANNER_SIZE_PCT to * set the size as a percentage of the REMAINING space, or @@ -153,29 +153,29 @@ namespace TADS { * margins and borders when determining the actual pixel size of the * window; in other words, the window should be large enough that it can * actually display the given number or rows or columns. - * + * * The size is interpreted as a width or height according to the window's * orientation. For a TOP or BOTTOM banner, the size is the height; for a * LEFT or RIGHT banner, the size is the width. A banner has only one * dimension's size given, since the other dimension's size is determined * automatically by the layout rules. - * + * * Note that the window's size can be changed later using * banner_size_to_contents() or banner_set_size(). - * + * * 'style' is a combination of OS_BANNER_STYLE_xxx flags - see below. The * style flags give the REQUESTED style for the banner, which might or * might not be respected, depending on the platform's capabilities, user * preferences, and other factors. os_banner_getinfo() can be used to * determine which style flags are actually used. - * + * * Returns the "handle" to the new banner window, which is an opaque value * that is used in subsequent os_banner_xxx calls to operate on the window. * Returns null if the window cannot be created. An implementation is not * required to support this functionality at all, and can subset it if it * does support it (for example, an implementation could support only * top/bottom-aligned banners, but not left/right-aligned), so callers must - * be prepared for this routine to return null. + * be prepared for this routine to return null. */ void *os_banner_create(void *parent, int where, void *other, int wintype, int align, int siz, int siz_units, @@ -183,7 +183,7 @@ void *os_banner_create(void *parent, int where, void *other, int wintype, /* - * insertion positions + * insertion positions */ #define OS_BANNER_FIRST 1 #define OS_BANNER_LAST 2 @@ -191,52 +191,52 @@ void *os_banner_create(void *parent, int where, void *other, int wintype, #define OS_BANNER_AFTER 4 /* - * banner types + * banner types */ -/* +/* * Normal text stream window. This is a text stream that behaves * essentially like the main text window: text is displayed to this * through os_banner_disp(), always in a stream-like fashion by adding new * text to the end of any exiting text. - * + * * Systems that use proportional fonts should usually simply use the same * font they use by default in the main text window. However, note that * the OS_BANNER_STYLE_TAB_ALIGN style flag might imply that a fixed-pitch * font should be used even when proportional fonts are available, because * a fixed-pitch font will allow the calling code to rely on using spaces - * to align text within the window. + * to align text within the window. */ #define OS_BANNER_TYPE_TEXT 1 -/* +/* * "Text grid" window. This type of window is similar to an normal text * window (OS_BANNER_TYPE_TEXT), but is guaranteed to arrange its text in * a regular grid of character cells, all of the same size. This means * that the output position can be moved to an arbitrary point within the * window at any time, so the calling program can precisely control the * layout of the text in the window. - * + * * Because the output position can be moved to arbitrary positions in the * window, it is possible to overwrite text previously displayed. When * this happens, the old text is completely obliterated by the new text, * leaving no trace of the overwritten text. - * + * * In order to guarantee that character cells are all the same size, this * type of window does not allow any text attributes. The implementation * should simply ignore any attempts to change text attributes in this * type of window. However, colors can be used to the same degree they * can be used in an ordinary text window. - * + * * To guarantee the regular spacing of character cells, all * implementations must use fixed-pitch fonts for these windows. This - * applies even to platforms where proportional fonts are available. + * applies even to platforms where proportional fonts are available. */ #define OS_BANNER_TYPE_TEXTGRID 2 -/* - * banner alignment types +/* + * banner alignment types */ #define OS_BANNER_ALIGN_TOP 0 #define OS_BANNER_ALIGN_BOTTOM 1 @@ -244,46 +244,46 @@ void *os_banner_create(void *parent, int where, void *other, int wintype, #define OS_BANNER_ALIGN_RIGHT 3 /* - * size units + * size units */ #define OS_BANNER_SIZE_PCT 1 #define OS_BANNER_SIZE_ABS 2 -/* - * banner style flags +/* + * banner style flags */ -/* +/* * The banner has a visible border; this indicates that a line is to be * drawn to separate the banner from the adjacent window or windows * "inside" the banner. So, a top-aligned banner will have its border * drawn along its bottom edge; a left-aligned banner will show a border * along its right edge; and so forth. - * + * * Note that character-mode platforms generally do NOT respect the border - * style, since doing so takes up too much screen space. + * style, since doing so takes up too much screen space. */ #define OS_BANNER_STYLE_BORDER 0x00000001 /* * The banner has a vertical/horizontal scrollbar. Character-mode - * platforms generally do not support scrollbars. + * platforms generally do not support scrollbars. */ #define OS_BANNER_STYLE_VSCROLL 0x00000002 #define OS_BANNER_STYLE_HSCROLL 0x00000004 -/* +/* * Automatically scroll the banner vertically/horizontally whenever new * text is displayed in the window. In other words, whenever * os_banner_disp() is called, scroll the window so that the text that the * new cursor position after the new text is displayed is visible in the * window. - * + * * Note that this style is independent of the presence of scrollbars. * Even if there are no scrollbars, we can still scroll the window's * contents programmatically. - * + * * Implementations can, if desired, keep an internal buffer of the * window's contents, so that the contents can be recalled via the * scrollbars if the text displayed in the banner exceeds the space @@ -295,7 +295,7 @@ void *os_banner_create(void *parent, int where, void *other, int wintype, * text that the calling program attempts to add to the banner should * simply be discarded. If the AUTO_VSCROLL flag is set, then the OLDEST * text should be discarded instead, so that the most recent text is - * always retained. + * always retained. */ #define OS_BANNER_STYLE_AUTO_VSCROLL 0x00000008 #define OS_BANNER_STYLE_AUTO_HSCROLL 0x00000010 @@ -306,25 +306,25 @@ void *os_banner_create(void *parent, int where, void *other, int wintype, * kind of font to use in the new window, for non-HTML platforms. If this * flag is set on creation, the caller is indicating that it wants to use * tags to align text in the window. - * + * * Character-mode implementations that use a single font with fixed pitch * can simply ignore this. These implementations ALWAYS have a working * capability, because the portable output formatter provides * interpretation for a fixed-pitch window. - * + * * Full HTML TADS implementations can also ignore this. HTML TADS * implementations always have full support via the HTML * parser/renderer. - * + * * Text-only implementations on GUI platforms (i.e., implementations that * are not based on the HTML parser/renderer engine in HTML TADS, but * which run on GUI platforms with proportionally-spaced text) should use * this flag to determine the font to display. If this flag is NOT set, * then the caller doesn't care about , and the implementation is * free to use a proportionally-spaced font in the window if desired. - * + * * When retrieving information on an existing banner, this flag indicates - * that alignment is actually supported on the window. + * that alignment is actually supported on the window. */ #define OS_BANNER_STYLE_TAB_ALIGN 0x00000020 @@ -340,7 +340,7 @@ void *os_banner_create(void *parent, int where, void *other, int wintype, * the user acknowledges a MORE prompt by pressing a key or scrolling with * the mouse, but it's up to the system implementor to decide what's * appropriate for the system. - * + * * Note that MORE mode in ANY banner window should generally override all * other user input focus. In other words, if the game in the main window * would like to read a keystroke from the user, but one of the banner @@ -348,10 +348,10 @@ void *os_banner_create(void *parent, int where, void *other, int wintype, * directed to the banner paused at the MORE prompt, not to the main * window; the main window should not receive any key events until the MORE * prompt has been removed. - * + * * This style requires the auto-vscroll style. Implementations should * assume auto-vscroll when this style is set. This style can be ignored - * with text grid windows. + * with text grid windows. */ #define OS_BANNER_STYLE_MOREMODE 0x00000040 @@ -363,19 +363,19 @@ void *os_banner_create(void *parent, int where, void *other, int wintype, * internal content size to determine the parent's overall content size. * If the banner's orientation is orthogonal to the parent's, then the * parent's overall content size is the larger of the parent's internal - * content size and this banner's content size. + * content size and this banner's content size. */ #define OS_BANNER_STYLE_HSTRUT 0x00000080 #define OS_BANNER_STYLE_VSTRUT 0x00000100 -/* +/* * Delete a banner. This removes the banner from the display, which * requires recalculating the entire screen's layout to reallocate this * banner's space to other windows. When this routine returns, the banner * handle is invalid and can no longer be used in any os_banner_xxx - * function calls. - * + * function calls. + * * If the banner has children, the children will no longer be displayed, * but will remain valid in memory until deleted. A child window's * display area always comes out of its parent's space, so once the parent @@ -384,7 +384,7 @@ void *os_banner_create(void *parent, int where, void *other, int wintype, * once its parent has been deleted. Even though the window's children * will become invisible, their banner handles will remain valid; the * caller is responsible for explicitly deleting the children even after - * deleting their parent. + * deleting their parent. */ void os_banner_delete(void *banner_handle); @@ -394,13 +394,13 @@ void os_banner_delete(void *banner_handle); * termination, for example), but that the calling program does not * actually require that the banner's on-screen display be immediately * removed. - * + * * The osifc implementation can do one of two things: - * + * * 1. Simply call os_banner_delete(). If the osifc implementation * doesn't want to do anything extra with the banner, it can simply delete * the banner, since the caller has no more use for it. - * + * * 2. Take ownership of the banner. If the osifc implementation wishes * to continue displaying the final screen configuration after a program * has terminated, it can simply take over the banner and leave it on the @@ -408,13 +408,13 @@ void os_banner_delete(void *banner_handle); * if it takes this routine; for example, if the osifc subsystem allows * another client program to be loaded into the same window after a * previous program has terminated, it would want to delete any orphaned - * banners from the previous program when loading a new program. + * banners from the previous program when loading a new program. */ void os_banner_orphan(void *banner_handle); /* * Banner information structure. This is filled in by the system-specific - * implementation in os_banner_getinfo(). + * implementation in os_banner_getinfo(). */ struct os_banner_info_t { @@ -424,12 +424,12 @@ struct os_banner_info_t /* style flags - these indicate the style flags actually in use */ unsigned long style; - /* + /* * Actual on-screen size of the banner, in rows and columns. If the * banner is displayed in a proportional font or can display multiple * fonts of different sizes, this is approximated by the number of "0" * characters in the window's default font that will fit in the - * window's display area. + * window's display area. */ int rows; int columns; @@ -438,50 +438,50 @@ struct os_banner_info_t * Actual on-screen size of the banner in pixels. This is meaningful * only for full HTML interpreter; for text-only interpreters, these * are always set to zero. - * + * * Note that even if we're running on a GUI operating system, these * aren't meaningful unless this is a full HTML interpreter. Text-only - * interpreters should always set these to zero, even on GUI OS's. + * interpreters should always set these to zero, even on GUI OS's. */ int pix_width; int pix_height; - /* + /* * OS line wrapping flag. If this is set, the window uses OS-level * line wrapping because the window uses a proportional font, so the * caller does not need to (and should not) perform line breaking in * text displayed in the window. - * + * * Note that OS line wrapping is a PERMANENT feature of the window. * Callers can note this information once and expect it to remain - * fixed through the window's lifetime. + * fixed through the window's lifetime. */ int os_line_wrap; }; typedef struct os_banner_info_t os_banner_info_t; -/* +/* * Get information on the banner - fills in the information structure with * the banner's current settings. Note that this should indicate the * ACTUAL properties of the banner, not the requested properties; this * allows callers to determine how the banner is actually displayed, which * depends upon the platform's capabilities and user preferences. - * + * * Returns true if the information was successfully obtained, false if * not. This can return false if the underlying OS window has already - * been closed by a user action, for example. + * been closed by a user action, for example. */ int os_banner_getinfo(void *banner_handle, os_banner_info_t *info); -/* +/* * Get the character width/height of the banner, for layout purposes. This * gives the size of the banner in character cells. - * + * * These are not meaningful when the underlying window uses a proportional * font or varying fonts of different sizes. When the size of text varies * in the window, the OS layer is responsible for word-wrapping and other * layout, in which case these simply return zero. - * + * * Note that these routines might appear to be redundant with the 'rows' * and 'columns' information returned from os_banner_getinfo(), but these * have two important distinctions. First, these routines return only the @@ -490,7 +490,7 @@ int os_banner_getinfo(void *banner_handle, os_banner_info_t *info); * might need to call these routines frequently while formatting text. * Second, these routines are not required to return an approximation for * windows using proportional fonts, as os_banner_getinfo() does; these can - * simply return zero when a proportional font is in use. + * simply return zero when a proportional font is in use. */ int os_banner_get_charwidth(void *banner_handle); int os_banner_get_charheight(void *banner_handle); @@ -498,74 +498,74 @@ int os_banner_get_charheight(void *banner_handle); /* clear the contents of a banner */ void os_banner_clear(void *banner_handle); -/* +/* * Display output on a banner. Writes the output to the window on the * display at the current output position. - * + * * The following special characters should be recognized and handled: - * + * * '\n' - newline; move output position to the start of the next line. - * + * * '\r' - move output position to start of current line; subsequent text * overwrites any text previously displayed on the current line. It is * permissible to delete the old text immediately on seeing the '\r', * rather than waiting for additional text to actually overwrite it. - * + * * All other characters should simply be displayed as ordinary printing * text characters. Note that tab characters should not be passed to this * routine, but if they are, they can simply be treated as ordinary spaces * if desired. Other control characters (backspace, escape, etc) should * never be passed to this routine; the implementation is free to ignore * any control characters not listed above. - * + * * If any text displayed here overflows the current boundaries of the * window on the screen, the text MUST be "clipped" to the current window * boundaries; in other words, anything this routine tries to display * outside of the window's on-screen rectangle must not actually be shown * on the screen. - * + * * Text overflowing the display boundaries MUST also be retained in an * internal buffer. This internal buffer can be limited to the actual * maximum display size of the terminal screen or application window, if * desired. It is necessary to retain clipped text, because this allows a * window to be expanded to the size of its contents AFTER the contents * have already been displayed. - * + * * If the banner does its own line wrapping, it must indicate this via the * os_line_wrap flag in the os_banner_getinfo() return data. If the * banner doesn't indicate this flag, then it must not do any line * wrapping at all, even if the caller attempts to write text beyond the * right edge of the window - any text overflowing the width of the window * must simply be clipped. - * + * * Text grid banners must ALWAYS clip - these banners should never perform - * any line wrapping. + * any line wrapping. */ void os_banner_disp(void *banner_handle, const char *txt, size_t len); /* * Set the text attributes in a banner, for subsequent text displays. - * 'attr' is a (bitwise-OR'd) combination of OS_ATTR_xxx values. + * 'attr' is a (bitwise-OR'd) combination of OS_ATTR_xxx values. */ void os_banner_set_attr(void *banner_handle, int attr); -/* +/* * Set the text color in a banner, for subsequent text displays. The 'fg' * and 'bg' colors are given as RGB or parameterized colors; see the * definition of os_color_t for details. - * + * * If the underlying renderer is HTML-enabled, then this should not be * used; the appropriate HTML code should simply be displayed to the - * banner instead. + * banner instead. */ void os_banner_set_color(void *banner_handle, os_color_t fg, os_color_t bg); -/* +/* * Set the screen color in the banner - this is analogous to the screen * color in the main text area. - * + * * If the underlying renderer is HTML-enabled, then this should not be - * used; the HTML tag should be used instead. + * used; the HTML tag should be used instead. */ void os_banner_set_screen_color(void *banner_handle, os_color_t color); @@ -575,7 +575,7 @@ void os_banner_flush(void *banner_handle); /* * Set the banner's size. The size has the same meaning as in * os_banner_create(). - * + * * 'is_advisory' indicates whether the sizing is required or advisory only. * If this flag is false, then the size should be set as requested. If * this flag is true, it means that the caller intends to call @@ -587,26 +587,26 @@ void os_banner_flush(void *banner_handle); * information the caller displays in preparation for calling * size-to-contents will be retained. Platforms that do not support * size-to-contents should set the requested size even when 'is_advisory' - * is true. + * is true. */ void os_banner_set_size(void *banner_handle, int siz, int siz_units, int is_advisory); -/* +/* * Set the banner to the size of its current contents. This can be used * to set the banner's size after some text (or other material) has been * displayed to the banner, so that the size can be set according to the * banner's actual space requirements. - * + * * This changes the banner's "requested size" to match the current size. * Subsequent calls to os_banner_getinfo() will thus indicate a requested - * size according to the size set here. + * size according to the size set here. */ void os_banner_size_to_contents(void *banner_handle); -/* +/* * Turn HTML mode on/off in the banner window. If the underlying renderer - * doesn't support HTML, these have no effect. + * doesn't support HTML, these have no effect. */ void os_banner_start_html(void *banner_handle); void os_banner_end_html(void *banner_handle); @@ -617,11 +617,11 @@ void os_banner_end_html(void *banner_handle); * the upper left cell. This function can only be used if the window was * created with type OS_BANNER_TYPE_TEXTGRID; the request should simply be * ignored by other window types. - * + * * Moving the output position has no immediate effect on the display, and * does not itself affect the "content size" for the purposes of * os_banner_size_to_contents(). This simply sets the coordinates where - * any subsequent text is displayed. + * any subsequent text is displayed. */ void os_banner_goto(void *banner_handle, int row, int col); diff --git a/engines/glk/tads/os_filetype.h b/engines/glk/tads/os_filetype.h index 2a48c4b5628..13992b3990a 100644 --- a/engines/glk/tads/os_filetype.h +++ b/engines/glk/tads/os_filetype.h @@ -35,9 +35,9 @@ namespace TADS { * File types. These type codes are used when opening or creating a * file, so that the OS routine can set appropriate file system metadata * to describe or find the file type. - * + * * The type os_filetype_t is defined for documentary purposes; it's - * always just an int. + * always just an int. */ enum os_filetype_t { OSFTGAME = 0, /* a game data file (.gam) */ diff --git a/engines/glk/tads/os_frob_tads.cpp b/engines/glk/tads/os_frob_tads.cpp index 8c8d3f10c01..cf10536e82c 100644 --- a/engines/glk/tads/os_frob_tads.cpp +++ b/engines/glk/tads/os_frob_tads.cpp @@ -31,7 +31,7 @@ static osfildef *openForReading(const char *fname) { Common::File f; if (f.open(fname)) return f.readStream(f.size()); - + Common::InSaveFile *save = g_system->getSavefileManager()->openForLoading(fname); return save; } diff --git a/engines/glk/tads/os_frob_tads.h b/engines/glk/tads/os_frob_tads.h index a8177a3bc0b..0531e388e63 100644 --- a/engines/glk/tads/os_frob_tads.h +++ b/engines/glk/tads/os_frob_tads.h @@ -481,15 +481,15 @@ int os_rename_file(const char *oldname, const char *newname); * systems that have something like Unix environment variables, it might be * desirable to define a TADS-specific variable (TADSPATH, for example) * that provides a list of directories to search for TADS-related files. - * + * * On return, fill in 'buf' with the full filename of the located copy of * the file (if a copy was indeed found), in a format suitable for use with * the osfopxxx() functions; in other words, after this function returns, * the caller should be able to pass the contents of 'buf' to an osfopxxx() * function to open the located file. - * + * * Returns true (non-zero) if a copy of the file was located, false (zero) - * if the file could not be found in any of the standard locations. + * if the file could not be found in any of the standard locations. */ bool os_locate(const char *fname, int flen, const char *arg0, char *buf, size_t bufsiz); @@ -501,13 +501,13 @@ bool os_locate(const char *fname, int flen, const char *arg0, * both reading and writing, and must be in "binary" mode rather than * "text" mode, if the system makes such a distinction. Returns null on * failure. - * + * * If 'fname' is non-null, then this routine should create and open a file * with the given name. When 'fname' is non-null, this routine does NOT * need to store anything in 'buf'. Note that the routine shouldn't try * to put the file in a special directory or anything like that; just open * the file with the name exactly as given. - * + * * If 'fname' is null, this routine must choose a file name and fill in * 'buf' with the chosen name; if possible, the file should be in the * conventional location for temporary files on this system, and should be @@ -523,11 +523,11 @@ bool os_locate(const char *fname, int flen, const char *arg0, * so we can pass it to osfdel_temp() later, but since the system is going * to delete the file automatically, osfdel_temp() doesn't need to do * anything and thus doesn't need the name.) - * + * * After the caller is done with the file, it should close the file (using * osfcls() as normal), then the caller MUST call osfdel_temp() to delete * the temporary file. - * + * * This interface is intended to take advantage of systems that have * automatic support for temporary files, while allowing implementation on * systems that don't have any special temp file support. On systems that @@ -539,10 +539,10 @@ bool os_locate(const char *fname, int flen, const char *arg0, * simply use the same underlying system API that osfoprwbt() normally * uses (although this routine must also generate a name for the temp file * when the caller doesn't supply one). - * + * * This routine can be implemented using ANSI library functions as * follows: if 'fname' is non-null, return fopen(fname,"w+b"); otherwise, - * set buf[0] to '\0' and return tmpfile(). + * set buf[0] to '\0' and return tmpfile(). */ osfildef *os_create_tempfile(const char *fname, char *buf); @@ -553,7 +553,7 @@ osfildef *os_create_tempfile(const char *fname, char *buf); * file manager will automatically delete a file opened as a temporary * file, this routine should do nothing at all, since the system will take * care of deleting the temp file. - * + * * Callers are REQUIRED to call this routine after closing a file opened * with os_create_tempfile(). When os_create_tempfile() is called with a * non-null 'fname' argument, the same value should be passed as 'fname' to @@ -565,33 +565,33 @@ osfildef *os_create_tempfile(const char *fname, char *buf); * here to delete the named file; if the caller lets os_create_tempfile() * generate a filename, then the generated filename must be passed to this * routine. - * + * * If os_create_tempfile() is implemented using ANSI library functions as * described above, then this routine can also be implemented with ANSI * library calls as follows: if 'fname' is non-null and fname[0] != '\0', - * then call remove(fname); otherwise do nothing. + * then call remove(fname); otherwise do nothing. */ int osfdel_temp(const char *fname); /* * Get the temporary file path. This should fill in the buffer with a * path prefix (suitable for strcat'ing a filename onto) for a good - * directory for a temporary file, such as the swap file. + * directory for a temporary file, such as the swap file. */ void os_get_tmp_path(char *buf); -/* +/* * Generate a name for a temporary file. This constructs a random file * path in the system temp directory that isn't already used by an existing * file. - * + * * On systems with long filenames, this can be implemented by selecting a * GUID-strength random name (such as 32 random hex digits) with a decent * random number generator. That's long enough that the odds of a * collision are essentially zero. On systems that only support short * filenames, the odds of a collision are non-zero, so the routine should * actually check that the chosen filename doesn't exist. - * + * * Optionally, before returning, this routine *may* create (and close) an * empty placeholder file to "reserve" the chosen filename. This isn't * required, and on systems with long filenames it's usually not necessary @@ -600,10 +600,10 @@ void os_get_tmp_path(char *buf); * this routine, or a separate process, from using the same filename before * the caller has had a chance to use the returned name to create the * actual temp file. - * + * * Returns true on success, false on failure. This can fail if there's no * system temporary directory defined, or the temp directory is so full of - * other files that we can't find an unused filename. + * other files that we can't find an unused filename. */ int os_gen_temp_filename(char *buf, size_t buflen); @@ -1019,11 +1019,11 @@ bool os_is_file_in_dir(const char *filename, const char *path, * notation, as a series of path elements separated by '/' characters. * Unlike true URLs, we don't use % encoding or a scheme prefix (file://, * etc). - * + * * The result path never ends in a trailing '/', unless the entire result * path is "/". This is for consistency; even if the source path ends with * a local path separator, the result doesn't. - * + * * If the local file system syntax uses '/' characters as ordinary filename * characters, these must be replaced with some other suitable character in * the result, since otherwise they'd be taken as path separators when the @@ -1034,12 +1034,12 @@ bool os_is_file_in_dir(const char *filename, const char *path, * a filename extension on other platforms, replace '/' with '.', since * this will provide reversibility as well as a good mapping if the URL is * read back in on another platform. - * + * * The local equivalents of "." and "..", if they exist, are converted to * "." and ".." in the URL notation. - * + * * Examples: - * + * *. Windows: images\rooms\startroom.jpg -> images/rooms/startroom.jpg *. Windows: ..\startroom.jpg -> ../startroom.jpg *. Mac: :images:rooms:startroom.jpg -> images/rooms/startroom.jpg @@ -1048,7 +1048,7 @@ bool os_is_file_in_dir(const char *filename, const char *path, *. VMS: [-.images]startroom.jpg -> ../images/startroom.jpg *. Unix: images/rooms/startroom.jpg -> images/rooms/startroom.jpg *. Unix: ../images/startroom.jpg -> ../images/startroom.jpg - * + * * If the local name is an absolute path in the local file system (e.g., * Unix /file, Windows C:\file), translate as follows. If the local * operating system uses a volume or device designator (Windows C:, VMS @@ -1057,14 +1057,14 @@ bool os_is_file_in_dir(const char *filename, const char *path, * etc. Include the local syntax for the device prefix. For a system like * Unix with a unified file system root ("/"), simply start with the root * directory. Examples: - * + * *. Windows: C:\games\deep.gam -> /C:/games/deep.gam *. Windows: C:games\deep.gam -> /C:./games/deep.gam *. Windows: \\SERVER\DISK\games\deep.gam -> /\\SERVER/DISK/games/deep.gam *. Mac OS 9: Hard Disk:games:deep.gam -> /Hard Disk:/games/deep.gam *. VMS: SYS$DISK:[games]deep.gam -> /SYS$DISK:/games/deep.gam *. Unix: /games/deep.gam -> /games/deep.gam - * + * * Rationale: it's effectively impossible to create a truly portable * representation of an absolute path. Operating systems are too different * in the way they represent root paths, and even if that were solvable, a @@ -1087,11 +1087,11 @@ bool os_is_file_in_dir(const char *filename, const char *path, * obviously won't reproduce the exact original path, but since that's * impossible anyway, this is probably as good an approximation as we can * create. - * + * * Character sets: the input could be in local or UTF-8 character sets. * The implementation shouldn't care, though - just treat bytes in the * range 0-127 as plain ASCII, and everything else as opaque. I.e., do not - * quote or otherwise modify characters outside the 0-127 range. + * quote or otherwise modify characters outside the 0-127 range. */ void os_cvt_dir_url(char *result_buf, size_t result_buf_size, const char *src_path); @@ -1101,25 +1101,25 @@ void os_cvt_dir_url(char *result_buf, size_t result_buf_size, * file system's syntax. Fills in result_buf with a file path, constructed * using the local file system syntax, that corresponds to the path in * src_url expressed in URL-style syntax. Examples: - * - * images/rooms/startroom.jpg -> + * + * images/rooms/startroom.jpg -> *. Windows -> images\rooms\startroom.jpg *. Mac OS 9 -> :images:rooms:startroom.jpg *. VMS -> [.images.rooms]startroom.jpg - * + * * The source format isn't a true URL; it's simply a series of path * elements separated by '/' characters. Unlike true URLs, our input * format doesn't use % encoding and doesn't have a scheme (file://, etc). * (Any % in the source is treated as an ordinary character and left as-is, * even if it looks like a %XX sequence. Anything that looks like a scheme * prefix is left as-is, with any // treated as path separators. - * + * * images/file%20name.jpg -> *. Windows -> images\file%20name.jpg - * + * * file://images/file.jpg -> *. Windows -> file_\\images\file.jpg - * + * * Any characters in the path that are invalid in the local file system * naming rules are converted to "_", unless "_" is itself invalid, in * which case they're converted to "X". One exception is that if '/' is a @@ -1128,12 +1128,12 @@ void os_cvt_dir_url(char *result_buf, size_t result_buf_size, * that os_cvt_dir_url uses as its replacement for '/', so that this * substitution is reversible when a URL is generated and then read back in * on this same platform. - * + * * images/file:name.jpg -> *. Windows -> images\file_name.jpg *. Mac OS 9 -> :images:file_name.jpg *. Unix -> images/file:name.jpg - * + * * The path elements "." and ".." are specifically defined as having their * Unix meanings: "." is an alias for the preceding path element, or the * working directory if it's the first element, and ".." is an alias for @@ -1146,13 +1146,13 @@ void os_cvt_dir_url(char *result_buf, size_t result_buf_size, * notation, since it will have to be applied later, when the result_buf * path is actually used to open a file, at which point it will combined * with the working directory or another base path. - * + * *. /images/../file.jpg -> [Windows] file.jpg *. ../images/file.jpg -> *. Windows -> ..\images\file.jpg *. Mac OS 9 -> ::images:file.jpg *. VMS -> [-.images]file.jpg - * + * * If the URL path is absolute (starts with a '/'), the routine inspects * the path to see if it was created by the same OS, according to the local * rules for converting absolute paths in os_cvt_dir_url() (see). If so, @@ -1165,20 +1165,20 @@ void os_cvt_dir_url(char *result_buf, size_t result_buf_size, * path, if any, as the root directory name, applying the usual "_" or "X" * substitution for any characters that aren't allowed in local names. The * rest of the path is handled in the usual fashion. - * + * *. /images/file.jpg -> *. Windows -> \images\file.jpg *. Unix -> /images/file.jpg - * + * *. /c:/images/file.jpg -> *. Windows -> c:\images\file.jpg *. Unix -> /c:/images/file.jpg *. VMS -> SYS$DISK:[c__.images]file.jpg - * + * *. /Hard Disk:/images/file.jpg -> *. Windows -> \Hard Disk_\images\file.jpg *. Unix -> SYS$DISK:[Hard_Disk_.images]file.jpg - * + * * Note how the device/volume prefix becomes the top-level directory when * moving a path across machines. It's simply not possible to reconstruct * the exact original path in such cases, since device/volume syntax rules @@ -1188,8 +1188,8 @@ void os_cvt_dir_url(char *result_buf, size_t result_buf_size, * the original source system, if they want to use that approach to port * the data rather than just changing the paths internally in the source * material. - * - * Character sets: use the same rules as for os_cvt_dir_url(). + * + * Character sets: use the same rules as for os_cvt_dir_url(). */ void os_cvt_url_dir(char *result_buf, size_t result_buf_size, const char *src_url); diff --git a/engines/glk/tads/os_glk.cpp b/engines/glk/tads/os_glk.cpp index ff21fe76346..f7e1bcc2371 100644 --- a/engines/glk/tads/os_glk.cpp +++ b/engines/glk/tads/os_glk.cpp @@ -51,10 +51,10 @@ char G_os_gamename[OSFNMAX]; /* ------------------------------------------------------------------------ */ -/* +/* * Initialize. This should be called during program startup to * initialize the OS layer and check OS-specific command-line arguments. - * + * * If 'prompt' and 'buf' are non-null, and there are no arguments on the * given command line, the OS code can use the prompt to ask the user to * supply a filename, then store the filename in 'buf' and set up @@ -62,7 +62,7 @@ char G_os_gamename[OSFNMAX]; * prompting for a filename is obsolescent, and is retained for * compatibility with a small number of existing implementations only; * new implementations should ignore this mechanism and leave the - * argc/argv values unchanged.) + * argc/argv values unchanged.) */ int os_init(int *argc, char *argv[], const char *prompt, char *buf, int bufsiz) @@ -200,9 +200,9 @@ int os_get_sysinfo(int code, void *param, long *result) { /* ------------------------------------------------------------------------ */ /* * Display routines. - * + * * Our display model is a simple stdio-style character stream. - * + * * In addition, we provide an optional "status line," which is a * non-scrolling area where a line of text can be displayed. If the status * line is supported, text should only be displayed in this area when @@ -210,38 +210,38 @@ int os_get_sysinfo(int code, void *param, long *result) { * line mode, text is written to the status line area, otherwise (mode 0) * it's written to the normal main text area. The status line is normally * shown in a different color to set it off from the rest of the text. - * + * * The OS layer can provide its own formatting (word wrapping in * particular) if it wants, in which case it should also provide pagination - * using os_more_prompt(). + * using os_more_prompt(). */ /* * Print a string on the console. These routines come in two varieties: - * + * * os_printz - write a NULL-TERMINATED string *. os_print - write a COUNTED-LENGTH string, which may not end with a null - * + * * These two routines are identical except that os_printz() takes a string * which is terminated by a null byte, and os_print() instead takes an * explicit length, and a string that may not end with a null byte. - * + * * os_printz(str) may be implemented as simply os_print(str, strlen(str)). - * + * * The string is written in one of three ways, depending on the status mode * set by os_status(): - * + * * status mode == 0 -> write to main text window *. status mode == 1 -> write to status line *. anything else -> do not display the text at all - * + * * Implementations are free to omit any status line support, in which case * they should simply suppress all output when the status mode is anything * other than zero. - * + * * The following special characters must be recognized in the displayed * text: - * + * * '\n' - newline: end the current line and move the cursor to the start of * the next line. If the status line is supported, and the current status * mode is 1 (i.e., displaying in the status line), then two special rules @@ -250,16 +250,16 @@ int os_get_sysinfo(int code, void *param, long *result) { * mode to 2, so that all subsequent output is suppressed until the status * mode is changed with an explicit call by the client program to * os_status(). - * + * * '\r' - carriage return: end the current line and move the cursor back to * the beginning of the current line. Subsequent output is expected to * overwrite the text previously on this same line. The implementation * may, if desired, IMMEDIATELY clear the previous text when the '\r' is * written, rather than waiting for subsequent text to be displayed. - * + * * All other characters may be assumed to be ordinary printing characters. * The routine need not check for any other special characters. - * + * */ void os_printz(const char *str) { @@ -292,24 +292,24 @@ void os_print(const char *str, size_t len) { } -/* +/* * Set the status line mode. There are three possible settings: - * + * * 0 -> main text mode. In this mode, all subsequent text written with * os_print() and os_printz() is to be displayed to the main text area. * This is the normal mode that should be in effect initially. This mode * stays in effect until an explicit call to os_status(). - * + * * 1 -> statusline mode. In this mode, text written with os_print() and * os_printz() is written to the status line, which is usually rendered as * a one-line area across the top of the terminal screen or application * window. In statusline mode, leading newlines ('\n' characters) are to * be ignored, and any newline following any other character must change * the mode to 2, as though os_status(2) had been called. - * + * * 2 -> suppress mode. In this mode, all text written with os_print() and * os_printz() must simply be ignored, and not displayed at all. This mode - * stays in effect until an explicit call to os_status(). + * stays in effect until an explicit call to os_status(). */ void os_status(int stat) @@ -335,13 +335,13 @@ int os_get_status() return curwin; } -/* +/* * Set the score value. This displays the given score and turn counts on * the status line. In most cases, these values are displayed at the right * edge of the status line, in the format "score/turns", but the format is * up to the implementation to determine. In most cases, this can simply * be implemented as follows: - * + * */ void os_score(int score, int turncount) { @@ -395,9 +395,9 @@ void oscls(void) /* * Set text attributes. Text subsequently displayed through os_print() and * os_printz() are to be displayed with the given attributes. - * + * * 'attr' is a (bitwise-OR'd) combination of OS_ATTR_xxx values. A value - * of zero indicates normal text, with no extra attributes. + * of zero indicates normal text, with no extra attributes. */ void os_set_text_attr(int attr) { @@ -415,19 +415,19 @@ void os_set_text_attr(int attr) /* * Set the text foreground and background colors. This sets the text * color for subsequent os_printf() and os_vprintf() calls. - * + * * The background color can be OS_COLOR_TRANSPARENT, in which case the * background color is "inherited" from the current screen background. * Note that if the platform is capable of keeping old text for * "scrollback," then the transparency should be a permanent attribute of * the character - in other words, it should not be mapped to the current * screen color in the scrollback buffer, because doing so would keep the - * current screen color even if the screen color changes in the future. - * + * current screen color even if the screen color changes in the future. + * * Text color support is optional. If the platform doesn't support text * colors, this can simply do nothing. If the platform supports text * colors, but the requested color or attributes cannot be displayed, the - * implementation should use the best available approximation. + * implementation should use the best available approximation. */ void os_set_text_color(os_color_t fg, os_color_t bg) { } @@ -437,7 +437,7 @@ void os_set_text_color(os_color_t fg, os_color_t bg) { * background of the screen. If possible, this should immediately redraw * the main text area with this background color. The color is given as an * OS_COLOR_xxx value. - * + * * If the platform is capable of redisplaying the existing text, then any * existing text that was originally displayed with 'transparent' * background color should be redisplayed with the new screen background @@ -445,7 +445,7 @@ void os_set_text_color(os_color_t fg, os_color_t bg) { * drawn text should be a permanent attribute of the character - the color * should not be mapped on display to the then-current background color, * because doing so would lose the transparency and thus retain the old - * screen color on a screen color change. + * screen color on a screen color change. */ void os_set_screen_color(os_color_t color) { @@ -458,7 +458,7 @@ void os_set_screen_color(os_color_t color) * caption, or whatever else makes sense on each system. Most * character-mode implementations will provide an empty implementation, * since there's not usually any standard way to show the current - * application title on a character-mode display. + * application title on a character-mode display. */ void os_set_title(const char *title) { @@ -470,20 +470,20 @@ void os_set_title(const char *title) /* * Show the system-specific MORE prompt, and wait for the user to respond. * Before returning, remove the MORE prompt from the screen. - * + * * This routine is only used and only needs to be implemented when the OS * layer takes responsibility for pagination; this will be the case on * most systems that use proportionally-spaced (variable-pitch) fonts or * variable-sized windows, since on such platforms the OS layer must do * most of the formatting work, leaving the standard output layer unable * to guess where pagination should occur. - * + * * If the portable output formatter handles the MORE prompt, which is the * usual case for character-mode or terminal-style implementations, this * routine is not used and you don't need to provide an implementation. * Note that HTML TADS provides an implementation of this routine, because * the HTML renderer handles line breaking and thus must handle - * pagination. + * pagination. */ void os_more_prompt() { @@ -499,19 +499,19 @@ void os_more_prompt() /* * Ask the user for a filename, using a system-dependent dialog or other * mechanism. Returns one of the OS_AFE_xxx status codes (see below). - * + * * prompt_type is the type of prompt to provide -- this is one of the * OS_AFP_xxx codes (see below). The OS implementation doesn't need to * pay any attention to this parameter, but it can be used if desired to * determine the type of dialog to present if the system provides * different types of dialogs for different types of operations. - * + * * file_type is one of the OSFTxxx codes for system file type. The OS * implementation is free to ignore this information, but can use it to * filter the list of files displayed if desired; this can also be used * to apply a default suffix on systems that use suffixes to indicate * file type. If OSFTUNK is specified, it means that no filtering - * should be performed, and no default suffix should be applied. + * should be performed, and no default suffix should be applied. */ int os_askfile(const char *prompt, char *fname_buf, int fname_buf_len, int prompt_type, os_filetype_t file_type) @@ -542,12 +542,12 @@ int os_askfile(const char *prompt, char *fname_buf, int fname_buf_len, return OS_AFE_SUCCESS; } -/* +/* * Read a string of input. Fills in the buffer with a null-terminated * string containing a line of text read from the standard input. The * returned string should NOT contain a trailing newline sequence. On * success, returns 'buf'; on failure, including end of file, returns a - * null pointer. + * null pointer. */ unsigned char *os_gets(unsigned char *buf, size_t buflen) { @@ -574,28 +574,28 @@ unsigned char *os_gets(unsigned char *buf, size_t buflen) * text under construction during editing. This routine differs from * os_gets() in that it returns if the given timeout interval expires * before the user presses Return (or the local equivalent). - * + * * If the user presses Return before the timeout expires, we store the * command line in the given buffer, just as os_gets() would, and we * return OS_EVT_LINE. We also update the display in the same manner that * os_gets() would, by moving the cursor to a new line and scrolling the * displayed text as needed. - * + * * If a timeout occurs before the user presses Return, we store the * command line so far in the given buffer, statically store the cursor * position, insert mode, buffer text, and anything else relevant to the * editing state, and we return OS_EVT_TIMEOUT. - * + * * If the implementation does not support the timeout operation, this * routine should simply return OS_EVT_NOTIMEOUT immediately when called; * the routine should not allow the user to perform any editing if the * timeout is not supported. Callers must use the ordinary os_gets() * routine, which has no timeout capabilities, if the timeout is not * supported. - * + * * When we return OS_EVT_TIMEOUT, the caller is responsible for doing one * of two things. - * + * * The first possibility is that the caller performs some work that * doesn't require any display operations (in other words, the caller * doesn't invoke os_printf, os_getc, or anything else that would update @@ -606,14 +606,14 @@ unsigned char *os_gets(unsigned char *buf, size_t buflen) * editing without interrupting the user - the extra computation is * transparent to the user, because we act as though we were still in the * midst of the original editing. - * + * * The second possibility is that the caller wants to update the display. * In this case, the caller must call os_gets_cancel() BEFORE making any * display changes. Then, the caller must do any post-input work of its * own, such as updating the display mode (for example, closing HTML font * tags that were opened at the start of the input). The caller is now * free to do any display work it wants. - * + * * If we have information stored from a previous call that was interrupted * by a timeout, and os_gets_cancel(true) was never called, we will resume * editing where we left off when the cancelled call returned; this means @@ -622,16 +622,16 @@ unsigned char *os_gets(unsigned char *buf, size_t buflen) * re-display the command line under construction, but if os_gets_cancel() * was never called, we will not have to make any changes to the display * at all. - * + * * Note that when resuming an interrupted editing session (interrupted via * os_gets_cancel()), the caller must re-display the prompt prior to * invoking this routine. - * + * * Note that we can return OS_EVT_EOF in addition to the other codes * mentioned above. OS_EVT_EOF indicates that an error occurred reading, * which usually indicates that the application is being terminated or - * that some hardware error occurred reading the keyboard. - * + * that some hardware error occurred reading the keyboard. + * * If 'use_timeout' is false, the timeout should be ignored. Without a * timeout, the function behaves the same as os_gets(), except that it * will resume editing of a previously-interrupted command line if @@ -639,7 +639,7 @@ unsigned char *os_gets(unsigned char *buf, size_t buflen) * might not need a timeout, but might still want to resume a previous * input that did time out, in which case the caller would invoke this * routine with use_timeout==false. The regular os_gets() would not - * satisfy this need, because it cannot resume an interrupted input.) + * satisfy this need, because it cannot resume an interrupted input.) */ #if defined GLK_TIMERS && defined GLK_MODULE_LINE_ECHO static char * timebuf = NULL; @@ -722,7 +722,7 @@ int os_gets_timeout(unsigned char *buf, size_t bufl, * Cancel an interrupted editing session. This MUST be called if any * output is to be displayed after a call to os_gets_timeout() returns * OS_EVT_TIMEOUT. - * + * * 'reset' indicates whether or not we will forget the input state saved * by os_gets_timeout() when it last returned. If 'reset' is true, we'll * clear the input state, so that the next call to os_gets_timeout() will @@ -730,14 +730,14 @@ int os_gets_timeout(unsigned char *buf, size_t bufl, * the previous input state, if any; this means that the next call to * os_gets_timeout() will re-display the same input buffer that was under * construction when it last returned. - * + * * This routine need not be called if os_gets_timeout() is to be called * again with no other output operations between the previous * os_gets_timeout() call and the next one. - * + * * Note that this routine needs only a trivial implementation when * os_gets_timeout() is not supported (i.e., the function always returns - * OS_EVT_NOTIMEOUT). + * OS_EVT_NOTIMEOUT). */ void os_gets_cancel(int reset) { @@ -758,14 +758,14 @@ void os_gets_cancel(int reset) #endif } -/* +/* * Read a character from the keyboard. For extended keystrokes, this * function returns zero, and then returns the CMD_xxx code for the * extended keystroke on the next call. For example, if the user * presses the up-arrow key, the first call to os_getc() should return * 0, and the next call should return CMD_UP. Refer to the CMD_xxx * codes below. - * + * * os_getc() should return a high-level, translated command code for * command editing. This means that, where a functional interpretation * of a key and the raw key-cap interpretation both exist as CMD_xxx @@ -775,9 +775,9 @@ void os_gets_cancel(int reset) * os_getc() should return CMD_END for this keystroke, rather than * (CMD_CTRL + 'E' - 'A'), because CMD_END is the high-level command * code for the operation. - * + * * The translation ability of this function allows for system-dependent - * key mappings to functional meanings. + * key mappings to functional meanings. */ static int glktotads(unsigned int key) { @@ -887,7 +887,7 @@ int os_getc(void) * os_getc() for CMD_xxx codes (i.e., when an extended keystroke is * encountered, os_getc_raw() returns zero, then returns the CMD_xxx code * on the subsequent call). - * + * * This function differs from os_getc() in that this function returns the * low-level, untranslated key code whenever possible. This means that, * when a functional interpretation of a key and the raw key-cap @@ -896,11 +896,11 @@ int os_getc(void) * describing os_getc() above, this function should return 5 (the ASCII * code for Ctrl-E), because the CMD_CTRL interpretation is the low-level * key code. - * + * * This function should return all control keys using their ASCII control * codes, whenever possible. Similarly, this function should return ASCII - * 27 for the Escape key, if possible. - * + * 27 for the Escape key, if possible. + * * For keys for which there is no portable ASCII representation, this * should return the CMD_xxx sequence. So, this function acts exactly the * same as os_getc() for arrow keys, function keys, and other special keys @@ -927,12 +927,12 @@ void os_waitc(void) * event. If use_timeout is true, this routine should return * OS_EVT_TIMEOUT after the given number of milliseconds elapses if no * event occurs first. - * + * * This function is not obligated to obey the timeout. If a timeout is * specified and it is not possible to obey the timeout, the function * should simply return OS_EVT_NOTIMEOUT. The trivial implementation * thus checks for a timeout, returns an error if specified, and - * otherwise simply waits for the user to press a key. + * otherwise simply waits for the user to press a key. */ int os_get_event(unsigned long timeout_in_milliseconds, int use_timeout, os_event_info_t *info) diff --git a/engines/glk/tads/os_glk.h b/engines/glk/tads/os_glk.h index c63104ac8fb..183b633b6e9 100644 --- a/engines/glk/tads/os_glk.h +++ b/engines/glk/tads/os_glk.h @@ -78,10 +78,10 @@ typedef uint32 uint32_t; /* ------------------------------------------------------------------------ */ /* * definitions. - * + * * os_time() should act like Unix time(), returning the number of seconds * elapsed since January 1, 1970 at midnight UTC. - * + * * The original Unix package defined time_t as a 32-bit signed * int, and many subsequent C compilers on other platforms followed suit. * A signed 32-bit time_t has the well-known year-2038 problem; some later @@ -98,7 +98,7 @@ typedef uint32 uint32_t; * also define a parallel, transitional set of 64-bit time functions that * you can use by replacing all references to the standard time_t and * related names with the corresponding 64-bit names. - * + * * We'd really like to use a 64-bit time_t wherever we can - the TADS * release cycle can be a bit slow, and we don't want 2038 to sneak up on * us and catch us unawares. So for those compilers that offer a choice of @@ -142,7 +142,7 @@ void os_tzset(void); * precision available, but expressed in terms of the number of * nanoseconds. For example, if you can retrieve milliseconds, you can * convert that to nanoseconds by multiplying by 1,000,000. - * + * * On return, fills in '*seconds' with the number of whole seconds since * the Epoch, and fills in '*nanoseconds' with the fractional portion, * expressed in nanosceconds. Note that '*nanoseconds' is merely the @@ -154,16 +154,16 @@ void os_time_ns(os_time_t *seconds, long *nanoseconds); * Get the local time zone name, as a location name in the IANA zoneinfo * database. For example, locations using US Pacific Time should return * "America/Los_Angeles". - * + * * Returns true if successful, false if not. If the local operating system * doesn't have a way to obtain this information, or if it's not available * in the local machine's configuration, this returns false. - * + * * The zoneinfo database is also known as the Olson or TZ (timezone) * database; it's widely used on Unix systems as the definitive source of * local time zone settings. See http://www.iana.org/time-zones for more * information. - * + * * On many Unix systems, the TZ environment variable contains the zoneinfo * zone name when its first character is ':'. Windows uses a proprietary * list of time zone names that can be mapped to zoneinfo names via a @@ -171,7 +171,7 @@ void os_time_ns(os_time_t *seconds, long *nanoseconds); * Windows implementation uses the CLDR list to generate the mapping). * MacOS X uses zoneinfo keys directly; /etc/localtime is a link to the * zoneinfo file for the local zone as set via the system preferences. - * + * * os_tzset() must be invoked at some point before this routine is called. */ int os_get_zoneinfo_key(char *buf, size_t buflen); @@ -179,30 +179,30 @@ int os_get_zoneinfo_key(char *buf, size_t buflen); /* * Get a description of the local time zone. Fills in '*info' with the * available information. Returns true on success, false on failure. - * + * * See osstzprs.h/.c for a portable implementation of a parser for * POSIX-style TZ strings. That can serve as a full implementation of this * function for systems that use the POSIX TZ environment variable syntax * to specify the timezone. (That routine simply parses a string from any * source, so it can be used to parse the TZ syntax even on systems where * the string comes from somewhere other than the TZ environment variable.) - * + * * os_tzset() must be invoked at some point before this routine is called. - * + * * The following two structures are used for the return information: - * + * * os_tzrule_t - Timezone Rule structure. This describes a rule for an * annual transition between daylight savings time and standard time in a * time zone. Most timezones that have recurring standard/daylight changes * require two of these rules, one for switching to daylight time in the * spring and one for switching to standard time in the fall. - * + * * os_tzinfo_t - Timezone Information structure. This describes a * timezone's clock settings, name(s), and rules for recurring annual * changes between standard time and daylight time, if applicable. */ struct os_tzrule_t { - /* + /* * Day of year, 1-365, NEVER counting Feb 29; set to 0 if not used. * Corresponds to the "J" format in Unix TZ strings. (Called "Julian * day" in the POSIX docs, thus the "J", even though it's a bit of a @@ -239,8 +239,8 @@ struct os_tzrule_t { * completeness... */ int yday; - - /* + + /* * The month (1-12), week of the month, and day of the week (1-7 for * Sunday to Saturday). Week 1 is the first week in which 'day' * occurs, week 2 is the second, etc.; week 5 is the last occurrence of @@ -261,17 +261,17 @@ struct os_tzinfo_t { * daylight time in this zone. These values are positive for zones * east of GMT and negative for zones west: New York standard time * (EST) is 5 hours west of GMT, so its offset is -5*60*60. - * + * * Set both of these fields (if possible) regardless of whether * standard or daylight time is currently in effect in the zone. The * caller will select which offset to use based on the start/end rules, * or based on the 'is_dst' flag if no rules are available. - * + * * If it's only possible to determine the current wall clock offset, be * it standard or daylight time, and it's not possible to determine the * time difference between the two, simply set both of these to the * current offset. This information isn't available from the standard - * C library, and many OS APIs also lack it. + * C library, and many OS APIs also lack it. */ int32_t std_ofs; int32_t dst_ofs; @@ -282,7 +282,7 @@ struct os_tzinfo_t { * and "EDT" for US Eastern Time. If the zone doesn't observe daylight * time (it's on standard time year round), set dst_abbr to an empty * string. - * + * * As with std_ofs and dst_ofs, you can set both of these to the same * string if it's only possible to determine the one that's currently * in effect. @@ -300,10 +300,10 @@ struct os_tzinfo_t { struct os_tzrule_t dst_start; struct os_tzrule_t dst_end; - /* + /* * True -> the zone is CURRENTLY on daylight savings time; false means * it's currently on standard time. - * + * * This is only used if the start/end rules aren't specified. In the * absence of start/end rules, there's no way to know when the current * standard/daylight phase ends, so we'll have to assume that the @@ -328,31 +328,31 @@ int os_get_timezone_info(struct os_tzinfo_t *info); * started running, since 1-1-1970, etc - it doesn't matter what the epoch * is, so the implementation can use whatever's convenient on the local * system. - * + * * True millisecond precision isn't required. Each implementation should * simply use the best precision available on the system. If your system * doesn't have any kind of high-precision clock, you can simply use the * time() function and multiply the result by 1000 (but see the note below * about exceeding 32-bit precision). - * + * * However, it *is* required that the return value be in *units* of * milliseconds, even if your system clock doesn't have that much * precision; so on a system that uses its own internal clock units, this * routine must multiply the clock units by the appropriate factor to yield * milliseconds for the return value. - * + * * It is also required that the values returned by this function be * monotonically increasing. In other words, each subsequent call must * return a value that is equal to or greater than the value returned from * the last call. On some systems, you must be careful of two special * situations. - * + * * First, the system clock may "roll over" to zero at some point; for * example, on some systems, the internal clock is reset to zero at * midnight every night. If this happens, you should make sure that you * apply a bias after a roll-over to make sure that the value returned from * this return continues to increase despite the reset of the system clock. - * + * * Second, a 32-bit signed number can only hold about twenty-three days * worth of milliseconds. While it seems unlikely that a TADS game would * run for 23 days without a break, it's certainly reasonable to expect @@ -362,7 +362,7 @@ int os_get_timezone_info(struct os_tzinfo_t *info); * first time this function is called, and then always subtract this zero * point from the large value returned by the system clock. If you're * using time(0)*1000, you should use this technique, since the result of - * time(0)*1000 will almost certainly not fit in 32 bits in most cases. + * time(0)*1000 will almost certainly not fit in 32 bits in most cases. */ long os_get_sys_clock_ms(); @@ -372,75 +372,75 @@ long os_get_sys_clock_ms(); * Hardware Configuration. Define the following functions appropriately * for your hardware. For efficiency, these functions should be defined * as macros if possible. - * + * * Note that these hardware definitions are independent of the OS, at * least to the extent that your OS can run on multiple types of * hardware. So, rather than combining these definitions into your * osxxx.h header file, we recommend that you put these definitions in a * separate h_yyy.h header file, which can be configured into os.h with * an appropriate "_M_yyy" preprocessor symbol. Refer to os.h for - * details of configuring the hardware include file. + * details of configuring the hardware include file. */ -/* +/* * Round a size up to worst-case alignment boundary. For example, on a * platform where the largest type must be aligned on a 4-byte boundary, * this should round the value up to the next higher mutliple of 4 and - * return the result. + * return the result. */ /* size_t osrndsz(size_t siz); */ -/* - * Round a pointer up to worst-case alignment boundary. +/* + * Round a pointer up to worst-case alignment boundary. */ /* void *osrndpt(void *ptr); */ -/* +/* * Read an unaligned portable unsigned 2-byte value, returning an int * value. The portable representation has the least significant byte * first, so the value 0x1234 is represented as the byte 0x34, followed * by the byte 0x12. - * + * * The source value must be treated as unsigned, but the result is * signed. This is significant on 32- and 64-bit platforms, because it * means that the source value should never be sign-extended to 32-bits. * For example, if the source value is 0xffff, the result is 65535, not - * -1. + * -1. */ /* int osrp2(unsigned char *p); */ -/* +/* * Read an unaligned portable signed 2-byte value, returning int. This * differs from osrp2() in that this function treats the source value as * signed, and returns a signed result; hence, on 32- and 64-bit * platforms, the result must be sign-extended to the int size. For - * example, if the source value is 0xffff, the result is -1. + * example, if the source value is 0xffff, the result is -1. */ /* int osrp2s(unsigned char *p); */ -/* +/* * Write unsigned int to unaligned portable 2-byte value. The portable * representation stores the low-order byte first in memory, so * oswp2(0x1234) should result in storing a byte value 0x34 in the first - * byte, and 0x12 in the second byte. + * byte, and 0x12 in the second byte. */ /* void oswp2(unsigned char *p, unsigned int i); */ /* * Write signed int to unaligned portable 2-byte value. Negative values * must be stored in two's complement notation. E.g., -1 is stored as - * FF.FF, -32768 is stored as 00.80 (little-endian). - * + * FF.FF, -32768 is stored as 00.80 (little-endian). + * * Virtually all modern hardware uses two's complement notation as the * native representation, which makes this routine a trivial synonym of * osrp2() (i.e., #define oswp2s(p,i) oswp2(p,i)). We distinguish the * signed version on the extremely off chance that TADS is ever ported to * wacky hardware with a different representation for negative integers - * (one's complement, sign bit, etc). + * (one's complement, sign bit, etc). */ /* void oswp2s(unsigned char *p, int i); */ -/* +/* * Read an unaligned unsigned portable 4-byte value, returning long. The * underlying value should be considered signed, and the result is signed. * The portable representation stores the bytes starting with the least @@ -451,14 +451,14 @@ long os_get_sys_clock_ms(); /* unsigned long osrp4(unsigned char *p); */ /* - * Read an unaligned signed portable 4-byte value, returning long. + * Read an unaligned signed portable 4-byte value, returning long. */ /* long osrp4s(unsigned char *p); */ -/* +/* * Write an unsigned long to an unaligned portable 4-byte value. The * portable representation stores the low-order byte first in memory, so - * 0x12345678 is written to memory as 0x78, 0x56, 0x34, 0x12. + * 0x12345678 is written to memory as 0x78, 0x56, 0x34, 0x12. */ /* void oswp4(unsigned char *p, unsigned long l); */ @@ -483,7 +483,7 @@ long os_get_sys_clock_ms(); /* ------------------------------------------------------------------------ */ /* * varargs va_copy() extension. - * + * * On some compilers, va_list is a reference type. This means that if a * va_list value is passed to a function that uses va_arg() to step through * the referenced arguments, the caller's copy of the va_list might be @@ -493,12 +493,12 @@ long os_get_sys_clock_ms(); * solution in the form of the va_copy() macro. Unfortunately, this isn't * typically available in pre-C99 compilers, and isn't standard in *any* * C++ version. We thus virtualize it here in a macro. - * + * * os_va_copy() has identical semantics to C99 va_copy(). A matching call * to os_va_copy_end() must be made for each call to os_va_copy() before * the calling function returns; this has identical semantics to C99 * va_end(). - * + * * Because our semantics are identical to the C99 version, we provide a * default definition here for compilers that define va_copy(). Platform * headers must provide suitable definitions only if their compilers don't @@ -521,15 +521,15 @@ long os_get_sys_clock_ms(); /* * Platform Identifiers. You must define the following macros in your * osxxx.h header file: - * + * * OS_SYSTEM_NAME - a string giving the system identifier. This string * must contain only characters that are valid in a TADS identifier: * letters, numbers, and underscores; and must start with a letter or * underscore. For example, on MS-DOS, this string is "MSDOS". - * + * * OS_SYSTEM_LDESC - a string giving the system descriptive name. This * is used in messages displayed to the user. For example, on MS-DOS, - * this string is "MS-DOS". + * this string is "MS-DOS". */ @@ -538,7 +538,7 @@ long os_get_sys_clock_ms(); * Message Linking Configuration. You should #define ERR_LINK_MESSAGES * in your osxxx.h header file if you want error messages linked into * the application. Leave this symbol undefined if you want an external - * message file. + * message file. */ @@ -547,9 +547,9 @@ long os_get_sys_clock_ms(); * Program Exit Codes. These values are used for the argument to exit() * to conform to local conventions. Define the following values in your * OS-specific header: - * + * * OSEXSUCC - successful completion. Usually defined to 0. - *. OSEXFAIL - failure. Usually defined to 1. + *. OSEXFAIL - failure. Usually defined to 1. */ @@ -558,7 +558,7 @@ long os_get_sys_clock_ms(); * Basic memory management interface. These functions are merely * documented here, but no prototypes are defined, because most * platforms #define macros for these functions and types, mapping them - * to malloc or other system interfaces. + * to malloc or other system interfaces. */ /* @@ -568,32 +568,32 @@ long os_get_sys_clock_ms(); * segments, so a single memory allocation can allocate only a subset of * the total addressable memory in the system. This value thus specifies * the maximum amount of memory that can be allocated in one chunk. - * + * * Note that this is an architectural maximum for the hardware and * operating system. It doesn't have anything to do with the total amount * of memory actually available at run-time. - * + * * #define OSMALMAX to a constant long value with theoretical maximum * osmalloc() argument value. For a platform with a flat (unsegmented) * 32-bit memory space, this is usually 0xffffffff; for 16-bit platforms, - * this is usually 0xffff. + * this is usually 0xffff. */ /* #define OSMALMAX 0xffffffff */ -/* +/* * Allocate a block of memory of the given size in bytes. The actual * allocation may be larger, but may be no smaller. The block returned * should be worst-case aligned (i.e., suitably aligned for any type). - * Return null if the given amount of memory is not available. + * Return null if the given amount of memory is not available. */ /* void *osmalloc(size_t siz); */ /* - * Free memory previously allocated with osmalloc(). + * Free memory previously allocated with osmalloc(). */ /* void osfree(void *block); */ -/* +/* * Reallocate memory previously allocated with osmalloc() or * osrealloc(), changing the block's size to the given number of bytes. * If necessary, a new block at a different address can be allocated, in @@ -602,7 +602,7 @@ long os_get_sys_clock_ms(); * the original block is freed. If the new size is less than the old * size, this need not do anything at all, since the returned block can * be larger than the new requested size. If the block cannot be - * enlarged to the requested size, return null. + * enlarged to the requested size, return null. */ /* void *osrealloc(void *block, size_t siz); */ @@ -612,8 +612,8 @@ long os_get_sys_clock_ms(); * Basic file I/O interface. These functions are merely documented here, * but no prototypes are defined, because most platforms #define macros for * these functions and types, mapping them to stdio or other system I/O - * interfaces. - * + * interfaces. + * * When writing a file, writes might or might not be buffered in * application memory; this is up to the OS implementation, which can * perform buffering according to local conventions and what's most @@ -622,7 +622,7 @@ long os_get_sys_clock_ms(); * care that any buffering is invisible to the app. (Porters: note that * the basic C stdio package has the proper behavior here, so you'll get * the correct semantics if you use a simple stdio implementation.) - * + * * Write buffering might be visible to *other* apps, though. In * particular, another process might not see data written to a file (with * osfwb(), os_fprint(), etc) immediately, since the write functions might @@ -633,7 +633,7 @@ long os_get_sys_clock_ms(); * flushed on closing the file with osfcls(). However, if you want other * apps to be able to see updates immediately, you can use osfflush() to * ensure that buffers are flushed to a file before you close it. - * + * * You can also use osfflush() to check for buffered write errors. When * you use osfwb() or other write functions to write data, they will return * a success indication even if the data was only copied into a buffer. @@ -641,23 +641,23 @@ long os_get_sys_clock_ms(); * later, when the buffer is flushed. The only way to know for sure is to * explicitly flush buffers using osfflush(), and check the result code. * If the original write function and a subsequent osfflush() *both* return - * success indications, then the write has definitely succeeded. + * success indications, then the write has definitely succeeded. */ /* * Define the following values in your OS header to indicate local * file/path syntax conventions: - * + * * OSFNMAX - integer indicating maximum length of a filename - * + * * OSPATHCHAR - character giving the normal path separator character *. OSPATHALT - string giving other path separator characters *. OSPATHURL - string giving path separator characters for URL conversions *. OSPATHSEP - directory separator for PATH-style environment variables *. OSPATHPWD - string giving the special path representing the current *. working directory; for Unix or Windows, this is "." - * + * * OSPATHURL is a little different: this specifies the characters that * should be converted to URL-style separators when converting a path from * local notation to URL notation. This is usually the same as the union @@ -672,7 +672,7 @@ long os_get_sys_clock_ms(); * the value is always obtained from an osfopxxx call, and is never * synthesized by portable code, so you can use essentially any type * here that you want. - * + * * For platforms that use C stdio functions to implement the osfxxx * functions, osfildef can simply be defined as FILE. */ @@ -681,14 +681,14 @@ long os_get_sys_clock_ms(); /* * File types. - * + * * These are symbols of the form OSFTxxxx defining various content types, * somewhat aking to MIME types. These were mainly designed for the old * Mac OS (versions up to OS 9), where the file system stored a type tag * with each file's metadata. The type tags were used for things like * filtering file selector dialogs and setting file-to-app associations in * the desktop shell. - * + * * Our OSFTxxx symbols are abstract file types that we define, for types * used within the TADS family of applications. They give us a common, * cross-platform reference point for each type we use. Each port where @@ -698,14 +698,14 @@ long os_get_sys_clock_ms(); * used in the modern Mac OS (OS X and later), since Apple decided to stop * fighting the tide and start using filename suffixes for this sort of * tagging, like everyone else always has. - * - * For the list of file types, see osifctyp.h + * + * For the list of file types, see osifctyp.h */ /* * Local newline convention. - * + * * Because of the pernicious NIH ("Not Invented Here") cultures of the * major technology vendors, basically every platform out there has its own * unique way of expressing newlines in text files. Unix uses LF (ASCII @@ -713,7 +713,7 @@ long os_get_sys_clock_ms(); * past there were heaven-only-knows how many other conventions in use, but * fortunately these three have the market pretty well locked up at this * point. But we do still have to worry about these three. - * + * * Our strategy on input is to be open to just about anything whenever * possible. So, when we're reading something that we believe to be a text * file, we'll treat all of these as line endings: CR, LF, CR-LF, and @@ -721,7 +721,7 @@ long os_get_sys_clock_ms(); * adjacently, it's almost certain that they're intended to be taken * together as a single newline sequence. Likewise, if there's a lone CR * or LF, it's rare for it to mean anything other than a newline. - * + * * On output, though, we can't be as loose. The problem is that other * applications on our big three platforms *don't* tend to aim for the same * flexibility we do on input: other apps usually expect exactly the local @@ -730,24 +730,24 @@ long os_get_sys_clock_ms(); * in the local convention. This means that we sometimes need to know what * the local convention actually is. That's where this definition comes * in. - * + * * Each port must define OS_NEWLINE_SEQ as an ASCII string giving the local * newline sequence to write on output. For example, DOS defines it as * "\r\n" (CR-LF). Always define it as a STRING (not a character * constant), even if it's only one character long. - * + * * (Note that some compilers use wacky mappings for \r and \n. Some older * Mac compilers, for example, defined \n as CR and \r as LF, because of * the Mac convention where newline is represented as CR in a text file. * If there's any such variability on your platform, you can always use the - * octal codes to be unambiguous: \012 for LF and \015 for CR.) + * octal codes to be unambiguous: \012 for LF and \015 for CR.) */ /* #define OS_NEWLINE_SEQ "\r\n" */ /* ------------------------------------------------------------------------ */ /* - * File "stat()" information - mode, size, time stamps + * File "stat()" information - mode, size, time stamps */ /* @@ -760,11 +760,11 @@ long os_get_sys_clock_ms(); * combination of OSFATTR_xxx attribute flags, and returns true; on * failure, simply returns false. Failure can occur if the file doesn't * exist, can't be accessed due to permissions, etc. - * + * * Note that 'mode' and/or 'attr' can be null if the caller doesn't need * that information. Implementations must check these parameters for null * pointers and skip returning the corresponding information if null. - * + * * If the file in 'fname' is a symbolic link, the behavior depends upon * 'follow_links'. If 'follow_links' is true, the function should resolve * the link reference (and if that points to another link, the function @@ -777,7 +777,7 @@ long os_get_sys_clock_ms(); * ignored. Likewise, hard links (on systems that support them) are * generally indistinguishable from regular files, so this function isn't * expected to do anything special with them. - * + * * The '*mode' value returned is a bitwise combination of OSFMODE_xxx flag. * Many of the flags are mutually exclusive; for example, "file" and * "directory" should never be combined. It's also possible for '*mode' to @@ -787,7 +787,7 @@ long os_get_sys_clock_ms(); * accommodate new types. The list below isn't meant to be final; it's * just what we've encountered so far on the platforms where TADS has * already been ported.) - * + * * The OSFMODE_xxx values are left for the OS to define so that they can be * mapped directly to the OS API's equivalent constants, if desired. This * makes the routine easy to write, since you can simply set *mode directly @@ -798,13 +798,13 @@ long os_get_sys_clock_ms(); * libraries, so this usually works automatically if you map these * constants to OS or C library values. However, if a port defines its own * values for these, take care that they're all powers of 2. - * + * * Obviously, a given OS might not have all of the file types listed here. * If any OSFMODE_xxx values aren't applicable on the local OS, you can * simply define them as zero since they'll never be returned. - * + * * Notes on attribute flags: - * + * * OSFATTR_HIDDEN means that the file is conventionally hidden by default * in user interface views or listings, but is still fully accessible to * the user. Hidden files are also usually excluded by default from @@ -822,7 +822,7 @@ long os_get_sys_clock_ms(); * typically only concerned with her own document files. On systems where * there's no such naming convention or attribute metadata, this flag will * never appear. - * + * * OSFATTR_SYSTEM is similar to 'hidden', but means that the file is * specially marked as an operating system file. This is mostly a * DOS/Windows concept, where it corresponds to the SYSTEM bit in the file @@ -831,9 +831,9 @@ long os_get_sys_clock_ms(); * Windows; most 'system' file are also marked as 'hidden', and in * practical terms in the user interface, 'system' files are treated the * same as 'hidden'. - * + * * OSFATTR_READ means that the file is readable by this process. - * + * * OSFATTR_WRITE means that the file is writable by this process. */ /* int osfmode(const char *fname, int follow_links, */ @@ -855,7 +855,7 @@ long os_get_sys_clock_ms(); /* #define OSFATTR_WRITE - the file is writable by this process */ struct os_file_stat_t { - /* + /* * Size of the file, in bytes. For platforms lacking 64-bit types, we * split this into high and low 32-bit portions. Platforms where the * native stat() or equivalent only returns a 32-bit file size can @@ -865,7 +865,7 @@ struct os_file_stat_t { uint32_t sizelo; uint32_t sizehi; - /* + /* * Creation time, modification time, and last access time. If the file * system doesn't keep information on one or more of these, use * (os_time_t)0 to indicate that the timestamp isn't available. It's @@ -888,7 +888,7 @@ struct os_file_stat_t { * Get stat() information. This fills in the portable os_file_stat * structure with the requested file information. Returns true on success, * false on failure (file not found, permissions error, etc). - * + * * 'follow_links' has the same meaning as for osfmode(). */ int os_file_stat(const char *fname, int follow_links, os_file_stat_t *s); @@ -901,7 +901,7 @@ int os_file_stat(const char *fname, int follow_links, os_file_stat_t *s); * (i.e., the object that the link in 'fname' points to). This should * return a fully qualified file system path. Returns true on success, * false on failure. - * + * * This should only resolve a single level of indirection. If the link * target of 'fname' is itself a link to a second target, this should only * resolve the single reference from 'fname' to its direct direct. Callers @@ -918,7 +918,7 @@ int os_resolve_symlink(const char *fname, char *target, size_t target_size); * file-oriented devices on the system. The strings are each null * terminated and are arranged consecutively in the buffer, with an extra * null terminator after the last string to mark the end of the list. - * + * * The return value is the length of the buffer required to hold the * results. If the caller's buffer is null or is too short, the routine * should return the full length required, and leaves the contents of the @@ -927,11 +927,11 @@ int os_resolve_symlink(const char *fname, char *target, size_t target_size); * return value include the null terminators, including the extra null * terminator at the end of the list. If an error occurs, or the system * has no concept of a root directory, returns zero. - * + * * Each result string should be expressed using the syntax for the root * directory on a device. For example, on Windows, "C:\" represents the * root directory on the C: drive. - * + * * "Local" means a device is mounted locally, as opposed to being merely * visible on the network via some remote node syntax; e.g., on Windows * this wouldn't include any UNC-style \\SERVER\SHARE names, and on VMS it @@ -944,11 +944,11 @@ int os_resolve_symlink(const char *fname, char *target, size_t target_size); * accessed via file systems, not as character devices or raw block * devices; so this would exclude /dev/xxx devices on Unix and things like * CON: and LPT1: on Windows. - * + * * Examples ("." represents a null byte): - * + * * Windows: C:\.D:\.E:\.. - * + * * Unix example: /.. */ size_t os_get_root_dirs(char *buf, size_t buflen); @@ -961,7 +961,7 @@ size_t os_get_root_dirs(char *buf, size_t buflen); * returns true, and 'handle' is set to a port-defined handle value that's * used in subsequent calls to os_read_dir() and os_close_dir(). Returns * false on failure. - * + * * If the routine succeeds, the caller must eventually call os_close_dir() * to release the resources associated with the handle. */ @@ -975,12 +975,12 @@ int os_open_dir(const char *dirname, /*OUT*/osdirhdl_t *handle); * that the next call to this function will retrieve the next file, and so * on until all files have been retrieved. If an error occurs, or there * are no more files in the directory, returns false. - * + * * The filename returned is the root filename only, without the path. The * caller can build the full path by calling os_build_full_path() or * os_combine_paths() with the original directory name and the returned * filename as parameters. - * + * * This routine lists all objects in the directory that are visible to the * corresponding native API, and is non-recursive. The listing should thus * include subdirectory objects, but not the contents of subdirectories. @@ -1017,7 +1017,7 @@ void os_close_dir(osdirhdl_t handle); /* * NB - this routine is DEPRECATED as of TADS 2.5.16/3.1.1. Callers should * use os_open_dir(), os_read_dir(), os_close_dir() instead. - * + * * Find the first file matching a given pattern. The returned context * pointer is a pointer to whatever system-dependent context structure is * needed to continue the search with the next file, and is opaque to the @@ -1031,15 +1031,15 @@ void os_close_dir(osdirhdl_t handle); * pattern is a string containing '*' and '?' as wildcard characters, but * not containing any directory separators, and all files in the given * directory matching the pattern should be returned. - * + * * Important: because this routine may allocate memory for the returned * context structure, the caller must either call os_find_next_file until * that routine returns null, or call os_find_close() to cancel the search, * to ensure that the os code has a chance to release the allocated memory. - * + * * 'outbuf' should be set on output to the name of the matching file, * without any path information. - * + * * 'outpathbuf' should be set on output to full path of the matching file. * If possible, 'outpathbuf' should use the same relative or absolute * notation that the search criteria used on input. For example, if dir = @@ -1051,40 +1051,40 @@ void os_close_dir(osdirhdl_t handle); * of the filename; for example, on the Mac, if dir = "resfiles", the * result should be ":resfiles:MyPic.jpg" (note the added leading colon) to * conform to Macintosh relative path notation. - * + * * Note that 'outpathbuf' may be null, in which case the caller is not - * interested in the full path information. + * interested in the full path information. */ -/* +/* * Note the following possible ways this function may be called: - * + * * dir = "", pattern = filename - in this case, pattern is the name of a * file or directory in the current directory. filename *might* be a * relative path specified by the user (on a command line, for example); * for instance, on Unix, it could be something like "resfiles/jpegs". - * + * * dir = path, pattern = filname - same as above, but this time the * filename or directory pattern is relative to the given path, rather * than to the current directory. For example, we could have dir = * "/games/mygame" and pattern = "resfiles/jpegs". - * + * * dir = path, pattern = 0 (NULL) - this should search for all files in * the given path. The path might be absolute or it might be relative. - * + * * dir = path, pattern = "*" - this should have the same result as when * pattern = 0. - * + * * dir = path, pattern = "*.ext" - this should search for all files in * the given path whose names end with ".ext". - * + * * dir = path, pattern = "abc*" - this should search for all files in * the given path whose names start with "abc". - * + * * All of these combinations are possible because callers, for * portability, must generally not manipulate filenames directly; * instead, callers obtain paths and search strings from external * sources, such as from the user, and present them to this routine with - * minimal manipulation. + * minimal manipulation. */ void *os_find_first_file(const char *dir, char *outbuf, size_t outbufsiz, int *isdir, @@ -1092,12 +1092,12 @@ void *os_find_first_file(const char *dir, /* * Implementation notes for porting os_find_first_file: - * + * * The algorithm for this routine should go something like this: - * + * * - If 'path' is null, create a variable real_path and initialize it * with the current directory. Otherwise, copy path to real_path. - * + * * - If 'pattern' contains any directory separators ("/" on Unix, for * example), change real_path so that it reflects the additional leading * subdirectories in the path in 'pattern', and remove the leading path @@ -1106,26 +1106,26 @@ void *os_find_first_file(const char *dir, * real_path to "./subdir/resfiles", and change pattern to "jpegs". * Take care to add and remove path separators as needed to keep the * path strings well-formed. - * + * * - Begin a search using appropriate OS API's for all files in * real_path. - * + * * - Check each file found. Skip any files that don't match 'pattern', * treating "*" as a wildcard that matches any string of zero or more * characters, and "?" as a wildcard that matches any single character * (or matches nothing at the end of a string). For example: - * + * *. "*" matches anything *. "abc?" matches "abc", "abcd", "abce", "abcf", but not "abcde" *. "abc???" matches "abc", "abcd", "abcde", "abcdef", but not "abcdefg" *. "?xyz" matches "wxyz", "axyz", but not "xyz" or "abcxyz" - * + * * - Return the first file that matches, if any, by filling in 'outbuf' * and 'isdir' with appropriate information. Before returning, allocate * a context structure (which is entirely for your own use, and opaque * to the caller) and fill it in with the information necessary for * os_find_next_file to get the next matching file. If no file matches, - * return null. + * return null. */ @@ -1136,15 +1136,15 @@ void *os_find_first_file(const char *dir, * there's no need to call os_find_close() after this routine returns * null). Returns a non-null context pointer, which is to be passed to * this function again to get the next file, if a file was found. - * + * * 'outbuf' and 'outpathbuf' are filled in with the filename (without * path) and full path (relative or absolute, as appropriate), * respectively, in the same manner as they do for os_find_first_file(). - * + * * Implementation note: if os_find_first_file() allocated memory for the * search context, this routine must free the memory if it returs null, * because this indicates that the search is finished and the caller - * need not call os_find_close(). + * need not call os_find_close(). */ void *os_find_next_file(void *ctx, char *outbuf, size_t outbufsiz, int *isdir, char *outpathbuf, size_t outpathbufsiz); @@ -1154,30 +1154,30 @@ void *os_find_next_file(void *ctx, char *outbuf, size_t outbufsiz, * os_find_first_file() or os_find_next_file() is the parameter. There * is no need to call this function if find-first or find-next returned * null, since they will have automatically closed the search. - * + * * Implementation note: if os_find_first_file() allocated memory for the - * search context, this routine should release the memory. + * search context, this routine should release the memory. */ void os_find_close(void *ctx); /* - * Special filename classification + * Special filename classification */ enum os_specfile_t { /* not a special file */ OS_SPECFILE_NONE, - /* + /* * current directory link - this is a file like the "." file on Unix - * or DOS, which is a special link that simply refers to itself + * or DOS, which is a special link that simply refers to itself */ OS_SPECFILE_SELF, - /* + /* * parent directory link - this is a file like the ".." file on Unix * or DOS, which is a special link that refers to the parent - * directory + * directory */ OS_SPECFILE_PARENT }; @@ -1193,8 +1193,8 @@ enum os_specfile_t enum os_specfile_t os_is_special_file(const char *fname); /* ------------------------------------------------------------------------ */ -/* - * Convert string to all-lowercase. +/* + * Convert string to all-lowercase. */ char *os_strlwr(char *s); @@ -1206,21 +1206,21 @@ char *os_strlwr(char *s); * os_dquote() returns true if its argument is any type of double-quote * character; and os_qmatch(a, b) returns true if a and b are matching * open- and close-quote characters. - * + * * These functions allow systems with extended character codes with * weird quote characters (such as the Mac) to match the weird * characters, so that users can use the extended quotes in input. - * + * * These are usually implemented as macros. The most common * implementation simply returns true for the standard ASCII quote * characters: - * + * * #define os_squote(c) ((c) == '\'') *. #define os_dquote(c) ((c) == '"') *. #define os_qmatch(a, b) ((a) == (b)) - * + * * These functions take int arguments to allow for the possibility of - * Unicode input. + * Unicode input. */ /* int os_squote(int c); */ /* int os_dquote(int c); */ @@ -1237,15 +1237,15 @@ char *os_strlwr(char *s); * file, given the argv[0] parameter passed into the main program. This * fills in the buffer with a null-terminated string that can be used in * osfoprb(), for example, to open the executable file. - * + * * Returns non-zero on success. If it's not possible to determine the * name of the executable file, returns zero. - * + * * Some operating systems might not provide access to the executable file * information, so non-trivial implementation of this routine is optional; * if the necessary information is not available, simply implement this to * return zero. If the information is not available, callers should offer - * gracefully degraded functionality if possible. + * gracefully degraded functionality if possible. */ int os_get_exe_filename(char *buf, size_t buflen, const char *argv0); @@ -1256,35 +1256,35 @@ int os_get_exe_filename(char *buf, size_t buflen, const char *argv0); * special paths relative to the program install directory, but this is * entirely up to the system implementation, so the argv[0] parameter can * be ignored if it is not needed. - * + * * The 'id' parameter selects which special path is requested; this is one * of the constants defined below. If the id is not understood, there is * no way of signalling an error to the caller; this routine can fail with * an assert() in such cases, because it indicates that the OS layer code * is out of date with respect to the calling code. - * + * * This routine can be implemented using one of the strategies below, or a * combination of these. These are merely suggestions, though, and systems * are free to ignore these and implement this routine using whatever * scheme is the best fit to local conventions. - * + * * - Relative to argv[0]. Some systems use this approach because it keeps * all of the TADS files together in a single install directory tree, and * doesn't require any extra configuration information to find the install * directory. Since we base the path name on the executable that's * actually running, we don't need any environment variables or parameter * files or registry entries to know where to look for related files. - * + * * - Environment variables or local equivalent. On some systems, it is * conventional to set some form of global system parameter (environment * variables on Unix, for example) for this sort of install configuration * data. In these cases, this routine can look up the appropriate * configuration variables in the system environment. - * + * * - Hard-coded paths. Some systems have universal conventions for the * installation configuration of compiler-like tools, so the paths to our * component files can be hard-coded based on these conventions. - * + * * - Hard-coded default paths with environment variable overrides. Let the * user set environment variables if they want, but use the standard system * paths as hard-coded defaults if the variables aren't set. This is often @@ -1295,22 +1295,22 @@ int os_get_exe_filename(char *buf, size_t buflen, const char *argv0); void os_get_special_path(char *buf, size_t buflen, const char *argv0, int id); -/* +/* * TADS 3 system resource path. This path is used to load system - * resources, such as character mapping files and error message files. + * resources, such as character mapping files and error message files. */ #define OS_GSP_T3_RES 1 -/* +/* * TADS 3 compiler - system headers. This is the #include path for the - * header files included with the compiler. + * header files included with the compiler. */ #define OS_GSP_T3_INC 2 /* * TADS 3 compiler - system library source code. This is the path to the * library source files that the compiler includes in every compilation by - * default (such as _main.t). + * default (such as _main.t). */ #define OS_GSP_T3_LIB 3 @@ -1320,11 +1320,11 @@ void os_get_special_path(char *buf, size_t buflen, * user library files. The TADS 3 compiler uses this as an additional set * of locations to search after the list of "-Fs" options and before the * OS_GSP_T3_LIB directory. - * + * * This path list is intended for the user's use, so no default value is * needed. The value should be user-configurable using local conventions; * on Unix, for example, this might be handled with an environment - * variable. + * variable. */ #define OS_GSP_T3_USER_LIBS 4 @@ -1333,7 +1333,7 @@ void os_get_special_path(char *buf, size_t buflen, * we should store things like option settings: data that we want to store * in a file, global to all games. Depending on local system conventions, * this can be a global shared directory for all users, or can be a - * user-specific directory. + * user-specific directory. */ #define OS_GSP_T3_APP_DATA 5 @@ -1342,7 +1342,7 @@ void os_get_special_path(char *buf, size_t buflen, * that affect all games, and generally all users on the system, so it * should be in a central location. On Windows, for example, we simply * store these files in the install directory containing the intepreter - * binary. + * binary. */ #define OS_GSP_T3_SYSCONFIG 6 @@ -1356,18 +1356,18 @@ void os_get_special_path(char *buf, size_t buflen, #define OS_GSP_LOGFILE 7 -/* +/* * Seek to the resource file embedded in the current executable file, * given the main program's argv[0]. - * + * * On platforms where the executable file format allows additional * information to be attached to an executable, this function can be used * to find the extra information within the executable. - * + * * The 'typ' argument gives a resource type to find. This is an arbitrary * string that the caller uses to identify what type of object to find. * The "TGAM" type, for example, is used by convention to indicate a TADS - * compiled GAM file. + * compiled GAM file. */ osfildef *os_exeseek(const char *argv0, const char *typ); @@ -1376,10 +1376,10 @@ osfildef *os_exeseek(const char *argv0, const char *typ); /* * Load a string resource. Given a string ID number, load the string * into the given buffer. - * + * * Returns zero on success, non-zero if an error occurs (for example, * the buffer is too small, or the requested resource isn't present). - * + * * Whenever possible, implementations should use an operating system * mechanism for loading the string from a user-modifiable resource * store; this will make localization of these strings easier, since the @@ -1387,13 +1387,13 @@ osfildef *os_exeseek(const char *argv0, const char *typ); * application. For example, on the Macintosh, the normal system string * resource mechanism should be used to load the string from the * application's resource fork. - * + * * When no operating system mechanism exists, the resources can be * stored as an array of strings in a static variable; this isn't ideal, * because it makes it much more difficult to localize the application. - * + * * Resource ID's are application-defined. For example, for TADS 2, - * "res.h" defines the resource ID's. + * "res.h" defines the resource ID's. */ int os_get_str_rsc(int id, char *buf, size_t buflen); @@ -1410,7 +1410,7 @@ void os_rand(long *val); * generator). This is an extended version of os_rand() for PRNGs that use * large seed vectors containing many bytes, rather than the simple 32-bit * seed that os_rand() assumes. - * + * * As with os_rand(), this function isn't meant to be used directly as a * random number source for ongoing use - instead, this is intended mostly * for seeding a PRNG, which will then be used as the primary source of @@ -1420,24 +1420,24 @@ void os_rand(long *val); * statistics. Such sources tend to provide reasonable entropy from one * run to the next, but not within a single session, as the underlying data * sources don't change rapidly enough. - * + * * Ideally, this routine should generate *truly* random bytes obtained from * hardware sources. Not all systems can provide that, though, so true * randomness isn't guaranteed. Here are the suggested implementation * options, in descending order of desirability: - * + * * 1. Use a hardware source of true randomness, such as a /dev/rand type * of device. However, note that this call should return reasonably * quickly, so always use a non-blocking source. Some Unix /dev/rand * devices, for example, can block indefinitely to allow sufficient entropy * to accumulate. - * + * * 2. Use a cryptographic random number source provided by the OS. Some * systems provide this as an API service. If going this route, be sure * that the OS generator is itself "seeded" with some kind of true * randomness source, as it defeats the whole purpose if you always return * a fixed pseudo-random sequence each time the program runs. - * + * * 3. Use whatever true random sources are available locally to seed a * software pseudo-random number generator, then generate bytes from your * PRNG. Some commonly available sources of true randomness are a @@ -1454,7 +1454,7 @@ void os_rand(long *val); * another ISAAC's output seems likely to magnify any weaknesses in the * ISAAC algorithm.) Note that this option is basically the DIY version of * option 2. Option 2 is better because the OS probably has access to - * better sources of true randomness than an application does. + * better sources of true randomness than an application does. */ void os_gen_rand_bytes(unsigned char *buf, size_t len); @@ -1462,9 +1462,9 @@ void os_gen_rand_bytes(unsigned char *buf, size_t len); /* ------------------------------------------------------------------------ */ /* * Display routines. - * + * * Our display model is a simple stdio-style character stream. - * + * * In addition, we provide an optional "status line," which is a * non-scrolling area where a line of text can be displayed. If the status * line is supported, text should only be displayed in this area when @@ -1472,10 +1472,10 @@ void os_gen_rand_bytes(unsigned char *buf, size_t len); * line mode, text is written to the status line area, otherwise (mode 0) * it's written to the normal main text area. The status line is normally * shown in a different color to set it off from the rest of the text. - * + * * The OS layer can provide its own formatting (word wrapping in * particular) if it wants, in which case it should also provide pagination - * using os_more_prompt(). + * using os_more_prompt(). */ /* @@ -1484,37 +1484,37 @@ void os_gen_rand_bytes(unsigned char *buf, size_t len); * OS-level line wrapping, then the true width of a text line is * irrelevant, and the portable code will use this merely for setting its * internal buffer sizes. - * + * * This must be defined in the os_xxx.h header file for each platform. */ /*#define OS_MAXWIDTH 135 - example only: define for real in os_xxx.h header*/ /* * Print a string on the console. These routines come in two varieties: - * + * * os_printz - write a NULL-TERMINATED string *. os_print - write a COUNTED-LENGTH string, which may not end with a null - * + * * These two routines are identical except that os_printz() takes a string * which is terminated by a null byte, and os_print() instead takes an * explicit length, and a string that may not end with a null byte. - * + * * os_printz(str) may be implemented as simply os_print(str, strlen(str)). - * + * * The string is written in one of three ways, depending on the status mode * set by os_status(): - * + * * status mode == 0 -> write to main text window *. status mode == 1 -> write to status line *. anything else -> do not display the text at all - * + * * Implementations are free to omit any status line support, in which case * they should simply suppress all output when the status mode is anything * other than zero. - * + * * The following special characters must be recognized in the displayed * text: - * + * * '\n' - newline: end the current line and move the cursor to the start of * the next line. If the status line is supported, and the current status * mode is 1 (i.e., displaying in the status line), then two special rules @@ -1523,16 +1523,16 @@ void os_gen_rand_bytes(unsigned char *buf, size_t len); * mode to 2, so that all subsequent output is suppressed until the status * mode is changed with an explicit call by the client program to * os_status(). - * + * * '\r' - carriage return: end the current line and move the cursor back to * the beginning of the current line. Subsequent output is expected to * overwrite the text previously on this same line. The implementation * may, if desired, IMMEDIATELY clear the previous text when the '\r' is * written, rather than waiting for subsequent text to be displayed. - * + * * All other characters may be assumed to be ordinary printing characters. * The routine need not check for any other special characters. - * + * */ void os_printz(const char *str); void os_print(const char *str, size_t len); @@ -1545,10 +1545,10 @@ void os_print(const char *str, size_t len); * session (such as compiler/build output, breakpoint status messages, * etc). For example, TADS Workbench on Windows displays these messages in * its "Debug Log" window. - * + * * These routines only need to be implemented for interactive debugger * builds, such as TADS Workbench on Windows. These can be omitted for - * regular interpreter builds. + * regular interpreter builds. */ void os_dbg_printf(const char *fmt, ...); void os_dbg_vprintf(const char *fmt, va_list args); @@ -1559,54 +1559,54 @@ void os_dbg_vprintf(const char *fmt, va_list args); * big enough to hold the result, rather than formatting into a caller's * buffer. This protects against buffer overruns and ensures that the * result isn't truncated. - * + * * On return, '*bufptr' is filled in with a pointer to a buffer allocated * with osmalloc(). This buffer contains the formatted string result. The * caller is responsible for freeing the buffer by calling osfree(). * *bufptr can be null on return if an error occurs. - * + * * The return value is the number of bytes written to the allocated buffer, * not including the null terminator. If an error occurs, the return value * is -1 and *bufptr is undefined. - * + * * Many modern C libraries provide equivalents of these, usually called - * asprintf() and vasprintf(), respectively. + * asprintf() and vasprintf(), respectively. */ /* int os_asprintf(char **bufptr, const char *fmt, ...); */ int os_vasprintf(char **bufptr, const char *fmt, va_list ap); -/* +/* * Set the status line mode. There are three possible settings: - * + * * 0 -> main text mode. In this mode, all subsequent text written with * os_print() and os_printz() is to be displayed to the main text area. * This is the normal mode that should be in effect initially. This mode * stays in effect until an explicit call to os_status(). - * + * * 1 -> statusline mode. In this mode, text written with os_print() and * os_printz() is written to the status line, which is usually rendered as * a one-line area across the top of the terminal screen or application * window. In statusline mode, leading newlines ('\n' characters) are to * be ignored, and any newline following any other character must change * the mode to 2, as though os_status(2) had been called. - * + * * 2 -> suppress mode. In this mode, all text written with os_print() and * os_printz() must simply be ignored, and not displayed at all. This mode - * stays in effect until an explicit call to os_status(). + * stays in effect until an explicit call to os_status(). */ void os_status(int stat); /* get the status line mode */ int os_get_status(); -/* +/* * Set the score value. This displays the given score and turn counts on * the status line. In most cases, these values are displayed at the right * edge of the status line, in the format "score/turns", but the format is * up to the implementation to determine. In most cases, this can simply * be implemented as follows: - * + * *. void os_score(int score, int turncount) *. { *. char buf[40]; @@ -1633,19 +1633,19 @@ void os_flush(void); * only needs to be implemented for operating systems that use * event-driven drawing based on window invalidations; the Windows and * Macintosh GUI's both use this method for drawing window contents. - * + * * The purpose of this routine is to refresh the display prior to a * potentially long-running computation, to avoid the appearance that the * application is frozen during the computation delay. - * + * * Platforms that don't need to process events in the main thread in order * to draw their window contents do not need to do anything here. In * particular, text-mode implementations generally don't need to implement * this routine. - * + * * This routine doesn't absolutely need a non-empty implementation on any * platform, but it will provide better visual feedback if implemented for - * those platforms that do use event-driven drawing. + * those platforms that do use event-driven drawing. */ void os_update_display(); @@ -1654,9 +1654,9 @@ void os_update_display(); /* * Set text attributes. Text subsequently displayed through os_print() and * os_printz() are to be displayed with the given attributes. - * + * * 'attr' is a (bitwise-OR'd) combination of OS_ATTR_xxx values. A value - * of zero indicates normal text, with no extra attributes. + * of zero indicates normal text, with no extra attributes. */ void os_set_text_attr(int attr); @@ -1671,19 +1671,19 @@ void os_set_text_attr(int attr); * for these by #defining them before this point, in the OS-specific header * (osdos.h, osmac.h, etc). We provide *default* definitions in case the * platform doesn't define these. - * + * * For compatibility with past versions, we treat HILITE, EM, and BOLD as * equivalent. Platforms that can display multiple kinds of text * attributes (boldface and italic, say) should feel free to use more - * conventional HTML mappings, such as EM->italic and STRONG->bold. + * conventional HTML mappings, such as EM->italic and STRONG->bold. */ -/* +/* * "Highlighted" text, as appropriate to the local platform. On most * text-mode platforms, the only kind of rendering variation possible is a * brighter or intensified color. If actual bold-face is available, that * can be used instead. This is the attribute used for text enclosed in a - * TADS2 "\( \)" sequence. + * TADS2 "\( \)" sequence. */ #ifndef OS_ATTR_HILITE # define OS_ATTR_HILITE OS_ATTR_BOLD @@ -1703,7 +1703,7 @@ void os_set_text_attr(int attr); /* ------------------------------------------------------------------------ */ /* * Colors. - * + * * There are two ways of encoding a color. First, a specific color can be * specified as an RGB (red-green-blue) value, with discreet levels for * each component's intensity, ranging from 0 to 255. Second, a color can @@ -1711,27 +1711,27 @@ void os_set_text_attr(int attr); * rather specified one of a number of pre-defined *types* of colors; * these pre-defined types can be chosen by the OS implementation, or, on * some systems, selected by the user via a preferences mechanism. - * + * * The os_color_t type encodes a color in 32 bits. The high-order 8 bits * of a color value give the parameterized color identifier, or are set to * zero to indicate an RGB color. An RGB color is encoded in the * low-order 24 bits, via the following formula: - * + * * (R << 16) + (G << 8) + B - * + * * R specifies the intensity of the red component of the color, G green, - * and B blue. Each of R, G, and B must be in the range 0-255. + * and B blue. Each of R, G, and B must be in the range 0-255. */ typedef unsigned long os_color_t; /* encode an R, G, B triplet into an os_color_t value */ #define os_rgb_color(r, g, b) (((r) << 16) + ((g) << 8) + (b)) -/* +/* * Determine if a color is given as an RGB value or as a parameterized * color value. Returns true if the color is given as a parameterized * color (one of the OS_COLOR_xxx values), false if it's given as an - * absolute RGB value. + * absolute RGB value. */ #define os_color_is_param(color) (((color) & 0xFF000000) != 0) @@ -1742,12 +1742,12 @@ typedef unsigned long os_color_t; /* * Parameterized color codes. These are os_color_t values that indicate - * colors by type, rather than by absolute RGB values. + * colors by type, rather than by absolute RGB values. */ -/* +/* * "transparent" - applicable to backgrounds only, this specifies that the - * current screen background color should be used + * current screen background color should be used */ #define OS_COLOR_P_TRANSPARENT ((os_color_t)0x01000000) @@ -1769,19 +1769,19 @@ typedef unsigned long os_color_t; /* * Set the text foreground and background colors. This sets the text * color for subsequent os_printf() and os_vprintf() calls. - * + * * The background color can be OS_COLOR_TRANSPARENT, in which case the * background color is "inherited" from the current screen background. * Note that if the platform is capable of keeping old text for * "scrollback," then the transparency should be a permanent attribute of * the character - in other words, it should not be mapped to the current * screen color in the scrollback buffer, because doing so would keep the - * current screen color even if the screen color changes in the future. - * + * current screen color even if the screen color changes in the future. + * * Text color support is optional. If the platform doesn't support text * colors, this can simply do nothing. If the platform supports text * colors, but the requested color or attributes cannot be displayed, the - * implementation should use the best available approximation. + * implementation should use the best available approximation. */ void os_set_text_color(os_color_t fg, os_color_t bg); @@ -1790,7 +1790,7 @@ void os_set_text_color(os_color_t fg, os_color_t bg); * background of the screen. If possible, this should immediately redraw * the main text area with this background color. The color is given as an * OS_COLOR_xxx value. - * + * * If the platform is capable of redisplaying the existing text, then any * existing text that was originally displayed with 'transparent' * background color should be redisplayed with the new screen background @@ -1798,30 +1798,30 @@ void os_set_text_color(os_color_t fg, os_color_t bg); * drawn text should be a permanent attribute of the character - the color * should not be mapped on display to the then-current background color, * because doing so would lose the transparency and thus retain the old - * screen color on a screen color change. + * screen color on a screen color change. */ void os_set_screen_color(os_color_t color); /* ------------------------------------------------------------------------ */ -/* +/* * os_plain() - Use plain ascii mode for the display. If possible and * necessary, turn off any text formatting effects, such as cursor * positioning, highlighting, or coloring. If this routine is called, * the terminal should be treated as a simple text stream; users might * wish to use this mode for things like text-to-speech converters. - * + * * Purely graphical implementations that cannot offer a textual mode * (such as Mac OS or Windows) can ignore this setting. - * + * * If this routine is to be called, it must be called BEFORE os_init(). * The implementation should set a flag so that os_init() will know to - * set up the terminal for plain text output. + * set up the terminal for plain text output. */ #ifndef os_plain -/* +/* * some platforms (e.g. Mac OS) define this to be a null macro, so don't - * define a prototype in those cases + * define a prototype in those cases */ void os_plain(void); #endif @@ -1833,37 +1833,37 @@ void os_plain(void); * caption, or whatever else makes sense on each system. Most * character-mode implementations will provide an empty implementation, * since there's not usually any standard way to show the current - * application title on a character-mode display. + * application title on a character-mode display. */ void os_set_title(const char *title); /* * Show the system-specific MORE prompt, and wait for the user to respond. * Before returning, remove the MORE prompt from the screen. - * + * * This routine is only used and only needs to be implemented when the OS * layer takes responsibility for pagination; this will be the case on * most systems that use proportionally-spaced (variable-pitch) fonts or * variable-sized windows, since on such platforms the OS layer must do * most of the formatting work, leaving the standard output layer unable * to guess where pagination should occur. - * + * * If the portable output formatter handles the MORE prompt, which is the * usual case for character-mode or terminal-style implementations, this * routine is not used and you don't need to provide an implementation. * Note that HTML TADS provides an implementation of this routine, because * the HTML renderer handles line breaking and thus must handle - * pagination. + * pagination. */ void os_more_prompt(); /* * Interpreter Class Configuration. - * + * * If this is a TEXT-ONLY interpreter: DO NOT define USE_HTML. - * + * * If this is a MULTIMEDIA (HTML TADS) intepreter: #define USE_HTML - * + * * (This really should be called something like OS_USE_HTML - the USE_ name * is for historical reasons. This purpose of this macro is to configure * the tads 2 VM-level output formatter's line breaking and MORE mode @@ -1874,7 +1874,7 @@ void os_more_prompt(); * itself. The tads 3 output layer does NOT use this macro for its * equivalent configuration, but instead has different .cpp files for the * different modes, and you simply link in the one for the configuration - * you want.) + * you want.) */ /* #define USE_HTML */ @@ -1885,7 +1885,7 @@ void os_more_prompt(); * that HTML sequences should be parsed; until this call is made, the * renderer should not interpret output as HTML. Non-HTML * implementations do not need to define this routine, since the - * run-time will not call it if USE_HTML is not defined. + * run-time will not call it if USE_HTML is not defined. */ void os_start_html(void); @@ -1899,22 +1899,22 @@ void os_end_html(void); * columns, respectively. The portable code can use these values to * format text for display via os_printf(); for example, the caller can * use the width to determine where to put line breaks. - * + * * These values are only needed for systems where os_printf() doesn't * perform its own word-wrap formatting. On systems such as the Mac, * where os_printf() performs word wrapping, these sizes aren't really * important because the portable code doesn't need to perform any real * formatting. - * + * * These variables reflect the size of the "main text area," which is the * area of the screen excluding the status line and any "banner" windows * (as created with the os_banner_xxx() interfaces). - * + * * The OS code must initialize these variables during start-up, and must * adjust them whenever the display size is changed by user action or * other external events (for example, if we're running inside a terminal * window, and the user resizes the window, the OS code must recalculate - * the layout and adjust these accordingly). + * the layout and adjust these accordingly). */ extern int G_os_pagelength; extern int G_os_linewidth; @@ -1927,13 +1927,13 @@ extern int G_os_linewidth; * counted. This variable should be set to false when displaying text * that doesn't count against the current page, such as status line * information. - * + * * This flag should not be modified by OS code. Instead, the output * formatter will set this flag according to its current state; the OS * code can use this flag to determine whether or not to display a MORE * prompt during os_printf()-type operations. Note that this flag is * normally interesting to the OS code only when the OS code itself is - * handling the MORE prompt. + * handling the MORE prompt. */ extern int G_os_moremode; @@ -1943,38 +1943,38 @@ extern int G_os_moremode; * generally means in TADS Interpreter builds. In other application * builds, this is simply left empty. The application is responsible for * setting this during start-up (or wherever else the byte-code filename - * becomes known or changes). + * becomes known or changes). */ extern char G_os_gamename[OSFNMAX]; /* * Set non-stop mode. This tells the OS layer that it should disable any * MORE prompting it would normally do. - * + * * This routine is needed only when the OS layer handles MORE prompting; on * character-mode platforms, where the prompting is handled in the portable - * console layer, this can be a dummy implementation. + * console layer, this can be a dummy implementation. */ void os_nonstop_mode(int flag); -/* +/* * Update progress display with current info, if appropriate. This can * be used to provide a status display during compilation. Most * command-line implementations will just ignore this notification; this * can be used for GUI compiler implementations to provide regular - * display updates during compilation to show the progress so far. + * display updates during compilation to show the progress so far. */ /* void os_progress(const char *fname, unsigned long linenum); */ -/* +/* * Set busy cursor. If 'flag' is true, provide a visual representation * that the system or application is busy doing work. If 'flag' is * false, remove any visual "busy" indication and show normal status. - * + * * We provide a prototype here if your osxxx.h header file does not * #define a macro for os_csr_busy. On many systems, this function has * no effect at all, so the osxxx.h header file simply #define's it to - * do an empty macro. + * do an empty macro. */ #ifndef os_csr_busy void os_csr_busy(int flag); @@ -1989,61 +1989,61 @@ void os_csr_busy(int flag); /* * Ask the user for a filename, using a system-dependent dialog or other * mechanism. Returns one of the OS_AFE_xxx status codes (see below). - * + * * prompt_type is the type of prompt to provide -- this is one of the * OS_AFP_xxx codes (see below). The OS implementation doesn't need to * pay any attention to this parameter, but it can be used if desired to * determine the type of dialog to present if the system provides * different types of dialogs for different types of operations. - * + * * file_type is one of the OSFTxxx codes for system file type. The OS * implementation is free to ignore this information, but can use it to * filter the list of files displayed if desired; this can also be used * to apply a default suffix on systems that use suffixes to indicate * file type. If OSFTUNK is specified, it means that no filtering - * should be performed, and no default suffix should be applied. + * should be performed, and no default suffix should be applied. */ int os_askfile(const char *prompt, char *fname_buf, int fname_buf_len, int prompt_type, os_filetype_t file_type); -/* - * os_askfile status codes +/* + * os_askfile status codes */ /* success */ -#define OS_AFE_SUCCESS 0 +#define OS_AFE_SUCCESS 0 -/* +/* * Generic failure - this is largely provided for compatibility with * past versions, in which only zero and non-zero error codes were * meaningful; since TRUE is defined as 1 on most platforms, we assume * that 1 is probably the generic non-zero error code that most OS * implementations have traditionally used. In addition, this can be * used to indicate any other error for which there is no more specific - * error code. + * error code. */ #define OS_AFE_FAILURE 1 /* user cancelled */ #define OS_AFE_CANCEL 2 -/* +/* * os_askfile prompt types - * + * * Important note: do not change these values when porting TADS. These * values can be used by games, so they must be the same on all - * platforms. + * platforms. */ #define OS_AFP_OPEN 1 /* choose an existing file to open for reading */ #define OS_AFP_SAVE 2 /* choose a filename for saving to a file */ -/* +/* * Read a string of input. Fills in the buffer with a null-terminated * string containing a line of text read from the standard input. The * returned string should NOT contain a trailing newline sequence. On * success, returns 'buf'; on failure, including end of file, returns a - * null pointer. + * null pointer. */ unsigned char *os_gets(unsigned char *buf, size_t bufl); @@ -2054,28 +2054,28 @@ unsigned char *os_gets(unsigned char *buf, size_t bufl); * text under construction during editing. This routine differs from * os_gets() in that it returns if the given timeout interval expires * before the user presses Return (or the local equivalent). - * + * * If the user presses Return before the timeout expires, we store the * command line in the given buffer, just as os_gets() would, and we return * OS_EVT_LINE. We also update the display in the same manner that * os_gets() would, by moving the cursor to a new line and scrolling the * displayed text as needed. - * + * * If a timeout occurs before the user presses Return, we store the command * line so far in the given buffer, statically store the cursor position, * insert mode, buffer text, and anything else relevant to the editing * state, and we return OS_EVT_TIMEOUT. - * + * * If the implementation does not support the timeout operation, this * routine should simply return OS_EVT_NOTIMEOUT immediately when called; * the routine should not allow the user to perform any editing if the * timeout is not supported. Callers must use the ordinary os_gets() * routine, which has no timeout capabilities, if the timeout is not * supported. - * + * * When we return OS_EVT_TIMEOUT, the caller is responsible for doing one * of two things. - * + * * The first possibility is that the caller performs some work that doesn't * require any display operations (in other words, the caller doesn't * invoke os_printf, os_getc, or anything else that would update the @@ -2086,14 +2086,14 @@ unsigned char *os_gets(unsigned char *buf, size_t bufl); * without interrupting the user - the extra computation is transparent to * the user, because we act as though we were still in the midst of the * original editing. - * + * * The second possibility is that the caller wants to update the display. * In this case, the caller must call os_gets_cancel() BEFORE making any * display changes. Then, the caller must do any post-input work of its * own, such as updating the display mode (for example, closing HTML font * tags that were opened at the start of the input). The caller is now * free to do any display work it wants. - * + * * If we have information stored from a previous call that was interrupted * by a timeout, and os_gets_cancel(TRUE) was never called, we will resume * editing where we left off when the cancelled call returned; this means @@ -2102,16 +2102,16 @@ unsigned char *os_gets(unsigned char *buf, size_t bufl); * re-display the command line under construction, but if os_gets_cancel() * was never called, we will not have to make any changes to the display at * all. - * + * * Note that when resuming an interrupted editing session (interrupted via * os_gets_cancel()), the caller must re-display the prompt prior to * invoking this routine. - * + * * Note that we can return OS_EVT_EOF in addition to the other codes * mentioned above. OS_EVT_EOF indicates that an error occurred reading, * which usually indicates that the application is being terminated or that - * some hardware error occurred reading the keyboard. - * + * some hardware error occurred reading the keyboard. + * * If 'use_timeout' is false, the timeout should be ignored. Without a * timeout, the function behaves the same as os_gets(), except that it will * resume editing of a previously-interrupted command line if appropriate. @@ -2120,10 +2120,10 @@ unsigned char *os_gets(unsigned char *buf, size_t bufl); * out, in which case the caller would invoke this routine with * use_timeout==FALSE. The regular os_gets() would not satisfy this need, * because it cannot resume an interrupted input.) - * + * * Note that a zero timeout has the same meaning as for os_get_event(): if * input is available IMMEDIATELY, return the input, otherwise return - * immediately with the OS_EVT_TIMEOUT result code. + * immediately with the OS_EVT_TIMEOUT result code. */ int os_gets_timeout(unsigned char *buf, size_t bufl, unsigned long timeout_in_milliseconds, int use_timeout); @@ -2132,7 +2132,7 @@ int os_gets_timeout(unsigned char *buf, size_t bufl, * Cancel an interrupted editing session. This MUST be called if any * output is to be displayed after a call to os_gets_timeout() returns * OS_EVT_TIMEOUT. - * + * * 'reset' indicates whether or not we will forget the input state saved * by os_gets_timeout() when it last returned. If 'reset' is true, we'll * clear the input state, so that the next call to os_gets_timeout() will @@ -2140,24 +2140,24 @@ int os_gets_timeout(unsigned char *buf, size_t bufl, * the previous input state, if any; this means that the next call to * os_gets_timeout() will re-display the same input buffer that was under * construction when it last returned. - * + * * This routine need not be called if os_gets_timeout() is to be called * again with no other output operations between the previous * os_gets_timeout() call and the next one. - * + * * Note that this routine needs only a trivial implementation when * os_gets_timeout() is not supported (i.e., the function always returns - * OS_EVT_NOTIMEOUT). + * OS_EVT_NOTIMEOUT). */ void os_gets_cancel(int reset); -/* +/* * Read a character from the keyboard. For extended keystrokes, this * function returns zero, and then returns the CMD_xxx code for the * extended keystroke on the next call. For example, if the user presses * the up-arrow key, the first call to os_getc() should return 0, and the * next call should return CMD_UP. Refer to the CMD_xxx codes below. - * + * * os_getc() should return a high-level, translated command code for * command editing. This means that, where a functional interpretation of * a key and the raw key-cap interpretation both exist as CMD_xxx codes, @@ -2167,9 +2167,9 @@ void os_gets_cancel(int reset); * CMD_END for this keystroke, rather than a single 0x05 character (ASCII * Ctrl-E), because CMD_END is the high-level command code for the * operation. - * + * * The translation ability of this function allows for system-dependent key - * mappings to functional meanings. + * mappings to functional meanings. */ int os_getc(void); @@ -2178,7 +2178,7 @@ int os_getc(void); * os_getc() for CMD_xxx codes (i.e., when an extended keystroke is * encountered, os_getc_raw() returns zero, then returns the CMD_xxx code * on the subsequent call). - * + * * This function differs from os_getc() in that this function returns the * low-level, untranslated key code whenever possible. This means that, * when a functional interpretation of a key and the raw key-cap @@ -2187,18 +2187,18 @@ int os_getc(void); * describing os_getc() above, this function should return 5 (the ASCII * code for Ctrl-E), because the ASCII control character interpretation is * the low-level key code. - * + * * This function should return all control keys using their ASCII control * codes, whenever possible. Similarly, this function should return ASCII - * 27 for the Escape key, if possible. - * + * 27 for the Escape key, if possible. + * * For keys for which there is no portable ASCII representation, this * should return the CMD_xxx sequence. So, this function acts exactly the * same as os_getc() for arrow keys, function keys, and other special keys * that have no ASCII representation. This function returns a * non-translated version ONLY when an ASCII representation exists - in * practice, this means that this function and os_getc() vary only for CTRL - * keys and Escape. + * keys and Escape. */ int os_getc_raw(void); @@ -2212,7 +2212,7 @@ void os_waitc(void); * os_getc() to return 0, and return the appropriate CMD_ value on the * NEXT call. Hence, os_getc() must keep the appropriate information * around statically for the next call when a command key is issued. - * + * * The comments indicate which CMD_xxx codes are "translated" codes and * which are "raw"; the difference is that, when a particular keystroke * could be interpreted as two different CMD_xxx codes, one translated @@ -2258,8 +2258,8 @@ void os_waitc(void); /* * ALT-keys - add alphabetical code to CMD_ALT: ALT-A == CMD_ALT + 0, * ALT-B == CMD_ALT + 1, ALT-C == CMD_ALT + 2, etc - * - * These keys are all raw (untranslated). + * + * These keys are all raw (untranslated). */ #define CMD_ALT 128 /* start of ALT keys */ @@ -2268,22 +2268,22 @@ void os_waitc(void); /* * Event information structure for os_get_event. The appropriate union * member should be filled in, depending on the type of event that - * occurs. + * occurs. */ union os_event_info_t { - /* + /* * OS_EVT_KEY - this returns the one or two characters of the * keystroke. If the key is an extended key, so that os_getc() would * return a two-character sequence for the keystroke, the first * character should be zero and the second the extended key code. * Otherwise, the first character should simply be the ASCII key code. - * + * * The key code here is the "raw" keycode, equivalent to the codes * returned by os_getc_raw(). Note in particular that this means that * CTRL and Escape keys are presented as one-byte ASCII control - * characters, not as two-byte CMD_xxx sequences. - * + * characters, not as two-byte CMD_xxx sequences. + * * For multi-byte character sets (Shift-JIS, for example), note that * os_get_event() must NOT return a complete two-byte character here. * The two bytes here are exclusively used to represent special @@ -2295,13 +2295,13 @@ union os_event_info_t * separate OS_EVT_KEY as the next event; and so on for any additional * bytes. This will allow callers that are not multibyte-aware to * treat multi-byte characters as though they were sequences of - * one-byte characters. + * one-byte characters. */ int key[2]; /* * OS_EVT_HREF - this returns the text of the HREF as a - * null-terminated string. + * null-terminated string. */ char href[256]; @@ -2311,7 +2311,7 @@ union os_event_info_t typedef union os_event_info_t os_event_info_t; /* - * Event types for os_get_event + * Event types for os_get_event */ /* invalid/no event */ @@ -2323,26 +2323,26 @@ typedef union os_event_info_t os_event_info_t; /* OS_EVT_TIMEOUT - no event occurred before the timeout elapsed */ #define OS_EVT_TIMEOUT 0x0002 -/* +/* * OS_EVT_HREF - user clicked on a link. This only applies to - * the HTML-enabled run-time. + * the HTML-enabled run-time. */ #define OS_EVT_HREF 0x0003 -/* +/* * OS_EVT_NOTIMEOUT - caller requested a timeout, but timeout is not - * supported by this version of the run-time + * supported by this version of the run-time */ #define OS_EVT_NOTIMEOUT 0x0004 /* * OS_EVT_EOF - an error occurred reading the event. This generally * means that the application is quitting or we can no longer read from - * the keyboard or terminal. + * the keyboard or terminal. */ #define OS_EVT_EOF 0x0005 -/* +/* * OS_EVT_LINE - user entered a line of text on the keyboard. This event * is not returned from os_get_event(), but rather from os_gets_timeout(). */ @@ -2355,20 +2355,20 @@ typedef union os_event_info_t os_event_info_t; * recognizes occurs, then return the appropriate information on the event. * If use_timeout is true, this routine should return OS_EVT_TIMEOUT after * the given number of milliseconds elapses if no event occurs first. - * + * * This function is not obligated to obey the timeout. If a timeout is * specified and it is not possible to obey the timeout, the function * should simply return OS_EVT_NOTIMEOUT. The trivial implementation thus * checks for a timeout, returns an error if specified, and otherwise * simply waits for the user to press a key. - * + * * A timeout value of 0 does *not* mean that there's no timeout (i.e., it * doesn't mean we should wait indefinitely) - that's specified by passing * FALSE for use_timeout. A zero timeout also doesn't meant that the * function should unconditionally return OS_EVT_TIMEOUT. Instead, a zero * timeout specifically means that IF an event is available IMMEDIATELY, * without blocking the thread, we should return that event; otherwise we - * should immediately return a timeout event. + * should immediately return a timeout event. */ int os_get_event(unsigned long timeout_in_milliseconds, int use_timeout, os_event_info_t *info); @@ -2377,10 +2377,10 @@ int os_get_event(unsigned long timeout_in_milliseconds, int use_timeout, /* ------------------------------------------------------------------------ */ /* * Extended os_get_event() codes. - * + * * THESE ARE NOT USED in the basic osifc implementation - these are only * used if the interpreter supports the "extended" interface defined in - * osifcext.h. + * osifcext.h. */ /* @@ -2394,7 +2394,7 @@ int os_get_event(unsigned long timeout_in_milliseconds, int use_timeout, * extended OS interface, and the player selects the command via a menu (or * toolbar button, etc) during a call to os_get_event(), os_get_event() * returns this event code, with the menu ID stored in the cmd_id field of - * the event structure. + * the event structure. */ #define OS_EVT_COMMAND 0x0100 @@ -2414,27 +2414,27 @@ int os_get_event(unsigned long timeout_in_milliseconds, int use_timeout, /* ------------------------------------------------------------------------ */ /* * Ask for input through a dialog. - * + * * 'prompt' is a text string to display as a prompting message. For * graphical systems, this message should be displayed in the dialog; * for text systems, this should be displayed on the terminal after a * newline. - * + * * 'standard_button_set' is one of the OS_INDLG_xxx values defined * below, or zero. If this value is zero, no standard button set is to * be used; the custom set of buttons defined in 'buttons' is to be used * instead. If this value is non-zero, the appropriate set of standard * buttons, with labels translated to the local language if possible, is * to be used. - * + * * 'buttons' is an array of strings to use as button labels. * 'button_count' gives the number of entries in the 'buttons' array. * 'buttons' and 'button_count' are ignored if 'standard_button_set' is * non-zero, since a standard set of buttons is used instead. If * 'buttons' and 'button_count' are to be used, each entry contains the - * label of a button to show. + * label of a button to show. */ -/* +/* * An ampersand ('&') character in a label string indicates that the * next character after the '&' is to be used as the short-cut key for * the button, if supported. The '&' should NOT be displayed in the @@ -2443,42 +2443,42 @@ int os_get_event(unsigned long timeout_in_milliseconds, int use_timeout, * character should be shown underlined; on a text display, the response * might be shown with the short-cut character enclosed in parentheses. * If there is no local convention for displaying a short-cut character, - * then the '&' should simply be removed from the displayed text. - * + * then the '&' should simply be removed from the displayed text. + * * The short-cut key specified by each '&' character should be used in * processing responses. If the user presses the key corresponding to a * button's short-cut, the effect should be the same as if the user * clicked the button with the mouse. If local system conventions don't * allow for short-cut keys, any short-cut keys can be ignored. - * + * * 'default_index' is the 1-based index of the button to use as the * default. If this value is zero, there is no default response. If * the user performs the appropriate system-specific action to select * the default response for the dialog, this is the response that is to * be selected. On Windows, for example, pressing the "Return" key * should select this item. - * + * * 'cancel_index' is the 1-based index of the button to use as the * cancel response. If this value is zero, there is no cancel response. * This is the response to be used if the user cancels the dialog using * the appropriate system-specific action. On Windows, for example, - * pressing the "Escape" key should select this item. + * pressing the "Escape" key should select this item. */ /* * icon_id is one of the OS_INDLG_ICON_xxx values defined below. If * possible, an appropriate icon should be displayed in the dialog. * This can be ignored in text mode, and also in GUI mode if there is no * appropriate system icon. - * + * * The return value is the 1-based index of the response selected. If - * an error occurs, return 0. + * an error occurs, return 0. */ int os_input_dialog(int icon_id, const char *prompt, int standard_button_set, const char **buttons, int button_count, int default_index, int cancel_index); /* - * Standard button set ID's + * Standard button set ID's */ /* OK */ @@ -2494,7 +2494,7 @@ int os_input_dialog(int icon_id, const char *prompt, int standard_button_set, #define OS_INDLG_YESNOCANCEL 4 /* - * Dialog icons + * Dialog icons */ /* no icon */ @@ -2516,7 +2516,7 @@ int os_input_dialog(int icon_id, const char *prompt, int standard_button_set, * OBSOLETE - Get filename from startup parameter, if possible; returns * true and fills in the buffer with the parameter filename on success, * false if no parameter file could be found. - * + * * (This was used until TADS 2.2.5 for the benefit of the Mac interpreter, * and interpreters on systems with similar desktop shells, to allow the * user to launch the terp by double-clicking on a saved game file. The @@ -2526,14 +2526,14 @@ int os_input_dialog(int icon_id, const char *prompt, int standard_button_set, * in 2.2.5 with a command-line parameter: the terp now uses the desktop * launch data to synthesize a suitable argv[] vectro to pass to os0main() * or os0main2(). This function should now simply be stubbed out - it - * should simply return FALSE.) + * should simply return FALSE.) */ int os_paramfile(char *buf); -/* +/* * Initialize. This should be called during program startup to * initialize the OS layer and check OS-specific command-line arguments. - * + * * If 'prompt' and 'buf' are non-null, and there are no arguments on the * given command line, the OS code can use the prompt to ask the user to * supply a filename, then store the filename in 'buf' and set up @@ -2541,7 +2541,7 @@ int os_paramfile(char *buf); * prompting for a filename is obsolescent, and is retained for * compatibility with a small number of existing implementations only; * new implementations should ignore this mechanism and leave the - * argc/argv values unchanged.) + * argc/argv values unchanged.) */ int os_init(int *argc, char *argv[], const char *prompt, char *buf, int bufsiz); @@ -2553,7 +2553,7 @@ int os_init(int *argc, char *argv[], const char *prompt, * that these functions have completely independent purposes; they should * never call one another, and they should never do any of the work that's * intended for the others. - * + * * os_uninit() is meant to undo the effects of os_init(). On many * systems, os_init() has some global effect, such as setting the terminal * to some special input or output mode. os_uninit's purpose is to undo @@ -2563,7 +2563,7 @@ int os_init(int *argc, char *argv[], const char *prompt, * ever called os_init(). Note that this routine DOES NOT terminate the * program - it should simply undo anything that os_init() did and return, * to let the caller do any additional termination work of its own. - * + * * os_expause() optionally pauses before termination, to allow the user to * acknowledge any text the program displays just before exiting. This * doesn't have to do anything at all, but it's useful on systems where @@ -2582,7 +2582,7 @@ int os_init(int *argc, char *argv[], const char *prompt, * the program; it simply pauses if necessary to allow the user to * acknowledge the last bit of text the program displayed, then returns to * allow the caller to carry on with its own termination work. - * + * * os_term() is meant to perform the same function as the C standard * library routine exit(): this actually terminates the program, exiting * to the operating system. This routine is not meant to return to its @@ -2594,7 +2594,7 @@ int os_init(int *argc, char *argv[], const char *prompt, * might not have ever called os_init(); callers are required to call * os_uninit() if they ever called os_init(), before calling os_term(), so * this routine can simply assume that any global modes set by os_init() - * have already been undone by the time this is called. + * have already been undone by the time this is called. */ /* @@ -2603,11 +2603,11 @@ int os_init(int *argc, char *argv[], const char *prompt, * os_init() put the terminal in raw mode, this should restore the * previous terminal mode. This routine should not terminate the * program (so don't call exit() here) - the caller might have more - * processing to perform after this routine returns. + * processing to perform after this routine returns. */ void os_uninit(void); -/* +/* * Pause prior to exit, if desired. This is meant to be called by * portable code just before the program is to be terminated; it can be * implemented to show a prompt and wait for user acknowledgment before @@ -2616,7 +2616,7 @@ void os_uninit(void); * operating system: this gives the implementation a chance to pause * before exiting, so that the window doesn't just disappear * unceremoniously. - * + * * This is allowed to do nothing at all. For regular character-mode * systems, this routine usually doesn't do anything, because when the * program exits, the terminal will simply return to the OS command @@ -2625,32 +2625,32 @@ void os_uninit(void); * graphical systems where the window will remain open, even after the * program exits, until the user explicitly closes the window, there's no * need to do anything here. - * + * * If this is implemented to pause, then this routine MUST show some kind * of prompt to let the user know we're waiting. In the simple case of a * text-mode terminal window on a graphical OS, this should simply print * out some prompt text ("Press a key to exit...") and then wait for the * user to acknowledge the prompt (by pressing a key, for example). For * graphical systems, the prompt could be placed in the window's title - * bar, or status-bar, or wherever is appropriate for the OS. + * bar, or status-bar, or wherever is appropriate for the OS. */ void os_expause(void); -/* +/* * Terminate. This should exit the program with the given exit status. * In general, this should be equivalent to the standard C library * exit() function, but we define this interface to allow the OS code to - * do any necessary pre-termination cleanup. + * do any necessary pre-termination cleanup. */ void os_term(int status); -/* +/* * Install/uninstall the break handler. If possible, the OS code should * set (if 'install' is true) or clear (if 'install' is false) a signal * handler for keyboard break signals (control-C, etc, depending on * local convention). The OS code should set its own handler routine, * which should note that a break occurred with an internal flag; the - * portable code uses os_break() from time to time to poll this flag. + * portable code uses os_break() from time to time to poll this flag. */ void os_instbrk(int install); @@ -2658,7 +2658,7 @@ void os_instbrk(int install); * Check for user break ("control-C", etc) - returns true if a break is * pending, false if not. If this returns true, it should "consume" the * pending break (probably by simply clearing the OS code's internal - * break-pending flag). + * break-pending flag). */ bool os_break(void); @@ -2667,7 +2667,7 @@ bool os_break(void); * number of milliseconds, then return. On multi-tasking systems, this * should use a system API to suspend the current process for the desired * delay; on single-tasking systems, this can simply sit in a wait loop - * until the desired interval has elapsed. + * until the desired interval has elapsed. */ void os_sleep_ms(long delay_in_milliseconds); @@ -2677,7 +2677,7 @@ void os_sleep_ms(long delay_in_milliseconds); * Portable code should call this routine from time to time during lengthy * computations that don't involve any UI operations; if practical, this * routine should be invoked roughly every 10 to 100 milliseconds. - * + * * The purpose of this routine is to support "cooperative multitasking" * systems, such as pre-X MacOS, where it's necessary for each running * program to call the operating system explicitly in order to yield the @@ -2692,7 +2692,7 @@ void os_sleep_ms(long delay_in_milliseconds); * Yielding the CPU at least every 100 milliseconds or so will generally * allow the UI to remain responsive; yielding more frequently than every * 10 ms or so will probably start adding noticeable overhead. - * + * * On single-tasking systems (such as MS-DOS), there's only one program * running at a time, so there's no need to yield the CPU; on virtually * every modern system, the OS automatically schedules CPU time without @@ -2701,10 +2701,10 @@ void os_sleep_ms(long delay_in_milliseconds); * isn't needed, the system header should simply #define os_yield to * something like "((void)0)" - this will allow the compiler to completely * ignore calls to this routine for systems where they aren't needed. - * + * * Note that this routine is NOT meant to provide scheduling hinting to * modern systems with true multitasking, so a trivial implementation is - * fine for any modern system. + * fine for any modern system. */ #ifndef os_yield int os_yield(void); @@ -2716,19 +2716,19 @@ int os_yield(void); * invoked only if we're running as a stand-alone game, and the game author * specified a non-standard saved-game extension when creating the * stand-alone game. - * + * * This routine is not required if the system does not use the standard, * semi-portable os0.c implementation. Even if the system uses the * standard os0.c implementation, it can provide an empty routine here if * the system code doesn't need to do anything special with this * information. - * + * * The extension is specified as a null-terminated string. The extension - * does NOT include the leading period. + * does NOT include the leading period. */ void os_set_save_ext(const char *ext); -/* +/* * Get the saved game extension previously set with os_set_save_ext(). * Returns null if no custom extension has been set. */ @@ -2740,30 +2740,30 @@ const char *os_get_save_ext(); * Translate a character from the HTML 4 Unicode character set to the * current character set used for display. Takes an HTML 4 character * code and returns the appropriate local character code. - * + * * The result buffer should be filled in with a null-terminated string * that should be used to represent the character. Multi-character * results are possible, which may be useful for certain approximations * (such as using "(c)" for the copyright symbol). - * + * * Note that we only define this prototype if this symbol isn't already * defined as a macro, which may be the case on some platforms. * Alternatively, if the function is already defined (for example, as an * inline function), the defining code can define OS_XLAT_HTML4_DEFINED, * in which case we'll also omit this prototype. - * + * * Important: this routine provides the *default* mapping that is used * when no external character mapping file is present, and for any named * entities not defined in the mapping file. Any entities in the * mapping file, if used, will override this routine. - * + * * A trivial implementation of this routine (that simply returns a * one-character result consisting of the original input character, * truncated to eight bits if necessary) can be used if you want to * require an external mapping file to be used for any game that * includes HTML character entities. The DOS version implements this * routine so that games will still look reasonable when played with no - * mapping file present, but other systems are not required to do this. + * mapping file present, but other systems are not required to do this. */ #ifndef os_xlat_html4 # ifndef OS_XLAT_HTML4_DEFINED @@ -2779,9 +2779,9 @@ void os_xlat_html4(unsigned int html4_char, * conventions, that we should attempt to load to get a mapping between * the current native character set and the internal character set * identified by 'internal_id'. - * + * * The internal character set ID is a string of up to 4 characters. - * + * * On DOS, the native character set is a DOS code page. DOS code pages * are identified by 3- or 4-digit identifiers; for example, code page * 437 is the default US ASCII DOS code page. We generate the @@ -2789,16 +2789,16 @@ void os_xlat_html4(unsigned int html4_char, * set identifier to the DOS code page number, then appending ".TCP" to * the result. So, to map between ISO Latin-1 (internal ID = "La1") and * DOS code page 437, we would generate the filename "437La1.TCP". - * + * * Note that this function should do only two things. First, determine * the current native character set that's in use. Second, generate a * filename based on the current native code page and the internal ID. * This function is NOT responsible for figuring out the mapping or * anything like that -- it's simply where we generate the correct * filename based on local convention. - * + * * 'filename' is a buffer of at least OSFNMAX characters. - * + * * 'argv0' is the executable filename from the original command line. * This parameter is provided so that the system code can look for * mapping files in the original TADS executables directory, if desired. @@ -2814,13 +2814,13 @@ void os_gen_charmap_filename(char *filename, char *internal_id, char *argv0); * 'ldesc' is the display name of the character set. 'sysinfo' is the * extra system information string that is stored in the mapping file; * the interpretation of this information is up to this routine. - * + * * For reference, the Windows version uses the extra information as a * code page identifier, and chooses its default font character set to * match the code page. On DOS, the run-time requires the player to * activate an appropriate code page using a DOS command (MODE CON CP * SELECT) prior to starting the run-time, so this routine doesn't do - * anything at all on DOS. + * anything at all on DOS. */ void os_advise_load_charmap(const char *id, const char *ldesc, const char *sysinfo); @@ -2829,7 +2829,7 @@ void os_advise_load_charmap(const char *id, const char *ldesc, const char *sysin * characters to and from the given local character set. Fills in the * buffer with the implementation-dependent name of the desired * character set map. See below for the character set ID codes. - * + * * For example, on Windows, the implementation would obtain the * appropriate active code page (which is simply a Windows character set * identifier number) from the operating system, and build the name of @@ -2837,13 +2837,13 @@ void os_advise_load_charmap(const char *id, const char *ldesc, const char *sysin * Macintosh, the implementation would look up the current script system * and return the name of the Unicode mapping for that script system, * such as "ROMAN" or "CENTEURO". - * + * * If it is not possible to determine the specific character set that is * in use, this function should return "asc7dflt" (ASCII 7-bit default) * as the character set identifier on an ASCII system, or an appropriate * base character set name on a non-ASCII system. "asc7dflt" is the * generic character set mapping for plain ASCII characters. - * + * * The given buffer must be at least 32 bytes long; the implementation * must limit the result it stores to 32 bytes. (We use a fixed-size * buffer in this interface for simplicity, and because there seems no @@ -2852,10 +2852,10 @@ void os_advise_load_charmap(const char *id, const char *ldesc, const char *sysin * long. Note that this function doesn't generate a filename, but * simply a mapping name; in practice, a map name will be used to * construct a mapping file name.) - * + * * Because this function obtains the Unicode mapping name, there is no * need to specify the internal character set to be used: the internal - * character set is Unicode. + * character set is Unicode. */ /* * Implementation note: when porting this routine, the convention that @@ -2867,29 +2867,29 @@ void os_advise_load_charmap(const char *id, const char *ldesc, const char *sysin * these listings can be used as the basis of the mapping files that you * include with your release. For example, on Windows, the convention * is to use the code page number to construct the map name, as in - * CP1252 or CP1250. + * CP1252 or CP1250. */ void os_get_charmap(char *mapname, int charmap_id); /* * Character map for the display (i.e., for the user interface). This * is the character set which is used for input read from the keyboard, - * and for output displayed on the monitor or terminal. + * and for output displayed on the monitor or terminal. */ #define OS_CHARMAP_DISPLAY 1 -/* +/* * Character map for mapping filename strings. This should identify the * character set currently in use on the local system for filenames * (i.e., for strings identifying objects in the local file system), * providing a suitable name for use in opening a mapping file. - * + * * On many platforms, the entire system uses only one character set at * the OS level, so the file system character set is the same as the * display character set. Some systems define a particular character * set for file system use, though, because different users might be * running applications on terminals that display different character - * sets. + * sets. */ #define OS_CHARMAP_FILENAME 2 @@ -2901,7 +2901,7 @@ void os_get_charmap(char *mapname, int charmap_id); * translation from a different type of computer using a different * character set. So, this isn't meant to provide a reliable choice of * character set for any arbitrary file; it's simply meant to be a good - * guess that most files on this system are likely to use. + * guess that most files on this system are likely to use. */ #define OS_CHARMAP_FILECONTENTS 3 @@ -2932,11 +2932,11 @@ int os_get_sysinfo(int code, void *param, long *result); /* get operating system name - os_get_sysinfo never gets this */ #define SYSINFO_OS_NAME 3 -/* +/* * Can the system process HTML directives? returns 1 if so, 0 if not. * Note that if this returns false, then all of the codes below from * JPEG to LINKS are implicitly false as well, since TADS can only use - * images, sounds, and links through HTML. + * images, sounds, and links through HTML. */ #define SYSINFO_HTML 4 @@ -2960,13 +2960,13 @@ int os_get_sysinfo(int code, void *param, long *result); /* * GENERAL NOTES ON PREFERENCE SETTINGS: - * + * * Several of the selectors below refer to the preference settings. We're * talking about user-settable options to control various aspects of the * interpreter. The conventional GUI for this kind of thing is a dialog * box reachable through a menu command named something like "Options" or * "Preferences". A couple of general notes about these: - * + * * 1. The entire existence of a preferences mechanism is optional - * interpreter writers aren't required to implement anything along these * lines. In some cases the local platforms might not have any suitable @@ -2974,14 +2974,14 @@ int os_get_sysinfo(int code, void *param, long *result); * applications), and in other cases the terp developer might just want to * omit a prefs mechanism because of the work involved to implement it, or * to keep the UI simpler. - * + * * 2. If a given SYSINFO_PREF_xxx selector refers to a preference item * that's not implemented in the local interpreter, the terp should simply * return a suitable default result. For example, if the interpreter * doesn't have a preference item to allow the user to turn sounds off, the * selector SYSINFO_PREF_SOUNDS should return 1 to indicate that the user * has not in fact turned off sounds (because there's no way to do so). - * + * * 3. The various SYSINFO_PREF_xxx selectors are purely queries - they're * NOT a mechanism for enforcing the preferences. For example, if the * interpreter provides a "Sounds On/Off" option, it's up to the terp to @@ -2994,16 +2994,16 @@ int os_get_sysinfo(int code, void *param, long *result); * cares*. For example, the game might determine whether or not sounds are * actually being heard just before playing a sound effect that's important * to the progress of the game, so that it can provide a visual alternative - * if the effect won't be heard. + * if the effect won't be heard. */ -/* +/* * Get image preference setting - 1 = images can be displayed, 0 = images * are not being displayed because the user turned off images in the * preferences. This is, of course, irrelevant if images can't be * displayed at all. - * - * See the general notes on preferences queries above. + * + * See the general notes on preferences queries above. */ #define SYSINFO_PREF_IMAGES 11 @@ -3011,8 +3011,8 @@ int os_get_sysinfo(int code, void *param, long *result); * Get digitized sound effect (WAV) preference setting - 1 = sounds can be * played, 0 = sounds are not being played because the user turned off * sounds in the preferences. - * - * See the general notes on preferences queries above. + * + * See the general notes on preferences queries above. */ #define SYSINFO_PREF_SOUNDS 12 @@ -3020,8 +3020,8 @@ int os_get_sysinfo(int code, void *param, long *result); * Get music (MIDI) preference setting - 1 = music can be played, 0 = music * is not being played because the user turned off music in the * preferences. - * - * See the general notes on preferences queries above. + * + * See the general notes on preferences queries above. */ #define SYSINFO_PREF_MUSIC 13 @@ -3031,9 +3031,9 @@ int os_get_sysinfo(int code, void *param, long *result); * doesn't actually hide them, but merely displays them and otherwise * treats them as ordinary text). 1 = links are to be displayed normally. * 2 = links can be displayed temporarily by the user by pressing a key or - * some similar action, but aren't being displayed at all times. - * - * See the general note on preferences queries above. + * some similar action, but aren't being displayed at all times. + * + * See the general note on preferences queries above. */ #define SYSINFO_PREF_LINKS 14 @@ -3045,13 +3045,13 @@ int os_get_sysinfo(int code, void *param, long *result); #define SYSINFO_MPEG2 17 #define SYSINFO_MPEG3 18 -/* +/* * is the system *currently* in HTML mode? os_get_sysinfo never gets - * this code, since the portable output layer keeps track of this + * this code, since the portable output layer keeps track of this */ #define SYSINFO_HTML_MODE 19 -/* +/* * Does the system allow following external URL links of the various * types? These return true if the system is capable of following these * types of hypertext links, false if not. Note that, if the system is @@ -3060,7 +3060,7 @@ int os_get_sysinfo(int code, void *param, long *result); * sensitive to the current HTML mode or the current link display mode, * since the question is not whether a link now displayed can be * followed by the user, but rather whether the system has the - * capability to follow these types of links at all. + * capability to follow these types of links at all. */ #define SYSINFO_LINKS_HTTP 20 #define SYSINFO_LINKS_FTP 21 @@ -3089,13 +3089,13 @@ int os_get_sysinfo(int code, void *param, long *result); /* can we display highlighted text in its own appearance? */ #define SYSINFO_TEXT_HILITE 31 -/* +/* * Can we display text colors? This returns a SYSINFO_TXC_xxx code * indicating the level of color support. - * + * * The os_xxx interfaces don't presently support anything beyond the ANSI * colors; however, HTML-enabled interpreters generally support full RGB - * colors, so we call this out as a separate level. + * colors, so we call this out as a separate level. */ #define SYSINFO_TEXT_COLORS 32 @@ -3105,9 +3105,9 @@ int os_get_sysinfo(int code, void *param, long *result); /* parameterized color names only (OS_COLOR_P_TEXT, etc) */ #define SYSINFO_TXC_PARAM 1 -/* +/* * we support only the basic ANSI colors, foreground control only (white, - * black, blue, red, green, yellow, cyan, magenta) + * black, blue, red, green, yellow, cyan, magenta) */ #define SYSINFO_TXC_ANSI_FG 2 @@ -3123,23 +3123,23 @@ int os_get_sysinfo(int code, void *param, long *result); /* Interpreter Class - this returns one of the SYSINFO_ICLASS_xxx codes */ #define SYSINFO_INTERP_CLASS 34 -/* +/* * Interpreter class: Character-mode Text-Only. Interpreters of this class * use a single, fixed-pitch font to display all text, and use the * text-only HTML subset, and cannot display graphics. */ #define SYSINFO_ICLASS_TEXT 1 -/* +/* * Interpreter class: Text-Only GUI. Interpreters of this class are * traditional text-only interpreters running on graphical operating * systems. These interpreters might use multiple fonts (for example, they * might display highlighted text in boldface), and might use * proportionally-spaced text for some windows. These interpreters support * the text-only HTML subset, and cannot display graphics. - * + * * Text-only GUI interpreters act essentially the same as character-mode - * text-only interpreters, from the perspective of the client program. + * text-only interpreters, from the perspective of the client program. */ #define SYSINFO_ICLASS_TEXTGUI 2 @@ -3147,31 +3147,31 @@ int os_get_sysinfo(int code, void *param, long *result); * Interpreter class: HTML. Interpreters of this class can display * graphics and sounds, can display multiple fonts and font sizes, can use * proportional fonts, and support the full HTML TADS markup language for - * formatting. + * formatting. */ #define SYSINFO_ICLASS_HTML 3 /* * Audio fade information. - * + * * SYSINFO_AUDIO_FADE: basic fade-in and fade-out support. Interpreters * that don't support audio fade at all should return 0. Interpreters that * support fades should return a bitwise OR'd combination of * SYSINFO_AUDIOFADE_xxx flags below indicating which formats can be used * with fades. - * + * * SYSINFO_AUDIO_CROSSFADE: cross-fades are supported (i.e., simultaneous * play of overlapping tracks, one fading out while the other fades in). * If cross-fades aren't supported, return 0. If they're supported, return * a combination of SYSINFO_AUDIOFADE_xxx flags indicating which formats - * can be used with cross-fades. + * can be used with cross-fades. */ #define SYSINFO_AUDIO_FADE 35 #define SYSINFO_AUDIO_CROSSFADE 36 -/* +/* * Specific audio fading features. These are bit flags that can be - * combined to indicate the fading capabilities of the interpreter. + * combined to indicate the fading capabilities of the interpreter. */ #define SYSINFO_AUDIOFADE_MPEG 0x0001 /* supported for MPEG audio */ #define SYSINFO_AUDIOFADE_OGG 0x0002 /* supported for Ogg Vorbis */ @@ -3187,22 +3187,22 @@ int os_get_sysinfo(int code, void *param, long *result); * compiler does not follow ANSI standards with respect to integer * division of negative numbers, you must provide implementations of * these routines that produce the correct results. - * + * * Division must "truncate towards zero," which means that any * fractional part is dropped from the result. If the result is * positive, the result must be the largest integer less than the * algebraic result: 11/3 yields 3. If the result is negative, the * result must be the smallest integer less than the result: (-11)/3 * yields -3. - * + * * The remainder must obey the relationship (a/b)*b + a%b == a, for any * integers a and b (b != 0). - * + * * If your compiler does not obey the ANSI rules for the division * operators, make the following changes in your osxxx.h file - * + * * - define the symbol OS_NON_ANSI_DIVIDE in the osxxx.h file - * + * * - either define your own macros for os_divide_long() and * os_remainder_long(), or put actual prototypes for these functions * into your osxxx.h file and write appropriate implementations of these diff --git a/engines/glk/tads/tads2/appctx.h b/engines/glk/tads/tads2/appctx.h index 50f131a4a13..8a661c27c12 100644 --- a/engines/glk/tads/tads2/appctx.h +++ b/engines/glk/tads/tads2/appctx.h @@ -38,16 +38,16 @@ namespace TADS2 { * between operating systems. The application container context is an * optional mechanism that the main application can use to provide * structured interaction between itself and the TADS run-time subsystem. - * + * * The function pointers contained herein are intended to allow the * run-time subsystem to call the host system to notify it of certain * events, or obtain optional services from the host system. Any of * these function pointers can be null, in which case the run-time * subsystem will skip calling them. - * + * * Note that each function has an associated callback context. This * allows the host system to recover any necessary context information - * when the callback is invoked. + * when the callback is invoked. */ struct appctxdef { /** @@ -61,9 +61,9 @@ struct appctxdef { * system, for example, to display a dialog prompting the user to * select a game file to open. A trivial implementation of this * routine (that merely returns false) is okay. - * + * * This routine should return true (any non-zero value) if it - * provides the name of a file to open, false (zero) if not. + * provides the name of a file to open, false (zero) if not. */ int (*get_game_name)(void *appctxdat, char *buf, size_t buflen); void *get_game_name_ctx; @@ -72,7 +72,7 @@ struct appctxdef { * Set the .GAM file name. When the run-time determines the name of * the file it will use to read the game, it calls this routine. * The host system should note the game filename if it will need to - * access the game file itself (for example, to load resources). + * access the game file itself (for example, to load resources). */ void (*set_game_name)(void *appctxdat, const char *fname); void *set_game_name_ctx; @@ -80,7 +80,7 @@ struct appctxdef { /** * Set the root path for individual resources. By default, we use the * directory containing the game file, but this can be used to override - * that. + * that. */ void (*set_res_dir)(void *appctxdat, const char *fname); void *set_res_dir_ctx; @@ -90,9 +90,9 @@ struct appctxdef { * reader encounters a resource map in the file, it calls this * routine with the seek offset of the first resource. Each * resource's address is given as an offset from this point. - * + * * fileno is the file number assigned by the host system in - * add_resfile. File number zero is always the .GAM file. + * add_resfile. File number zero is always the .GAM file. */ void (*set_resmap_seek)(void *appctxdat, unsigned long seekpos, int fileno); void *set_resmap_seek_ctx; @@ -106,7 +106,7 @@ struct appctxdef { * added before the resource map seek position is set, so the host * system must simply store the resource information for later use. * The 'fileno' is zero for the .GAM file, or the number assigned by - * the host system in add_resfile for other resource files. + * the host system in add_resfile for other resource files. */ void (*add_resource)(void *appctxdat, unsigned long ofs, unsigned long siz, const char *nm, size_t nmlen, @@ -125,7 +125,7 @@ struct appctxdef { * copying the resource data into the .GAM file, but still allows the * game to load resources by .GAM resource name, to create a testing * environment that's consistent with the full build version (where the - * resources would actually be copied). + * resources would actually be copied). */ void (*add_resource_link)(void *appctxdat, const char *fname, size_t fnamelen, @@ -135,7 +135,7 @@ struct appctxdef { /** * Add a resource path. 'path' is a string giving a directory prefix * in local system notation. - * + * * This adds a directory to the list of directories that we'll search * when we're looking for an individual resource as an external file * (such as a ".jpg" image file or ".ogg" sound file). This can be @@ -143,7 +143,7 @@ struct appctxdef { * search after any previous directories. We'll always search the * default directory first (this is the directory containing the game * file); then we'll search directories added with this call in the - * order in which the directories were added. + * order in which the directories were added. */ void (*add_res_path)(void *appctxdat, const char *path, size_t len); void *add_res_path_ctx; @@ -153,7 +153,7 @@ struct appctxdef { * return an osfildef* handle to the resource, with its seek position * set to the first byte of the resource data, and set *res_size to * the size in bytes of the resource data in the file. If the - * resource cannot be found, returns null. + * resource cannot be found, returns null. */ osfildef *(*find_resource)(void *appctxdat, const char *resname, size_t resnamelen, @@ -164,9 +164,9 @@ struct appctxdef { * Add a resource file. The return value is a non-zero file number * assigned by the host system; we'll use this number in subsequent * calls to add_resource to add the resources from this file. - * + * * After calling this routine to add the file, we'll parse the file - * and add any resources using add_resource. + * and add any resources using add_resource. */ int (*add_resfile)(void *appctxdat, const char *fname); void *add_resfile_ctx; @@ -174,7 +174,7 @@ struct appctxdef { /** * Determine if a resource exists. Returns true if the resource can * be loaded, false if not. The resource name is in the standard - * URL-style format. + * URL-style format. */ int (*resfile_exists)(void *appctxdat, const char *res_name, size_t res_name_len); @@ -188,7 +188,7 @@ struct appctxdef { * file. Note that if the path is provided, it must be set up with * a trailing path separator character, so that we can directly * append a name to this path to form a valid fully-qualified - * filename. + * filename. */ const char *ext_res_path; @@ -204,9 +204,9 @@ struct appctxdef { * function), we'll call the host system to ask it for the current * setting, and use this new setting rather than the original command * line setting. - * + * * Refer to bif.c for information on the meanings of the file safety - * levels. + * levels. */ void (*set_io_safety_level)(void *ctx, int read, int write); void (*get_io_safety_level)(void *ctx, int *read, int *write); @@ -222,13 +222,13 @@ struct appctxdef { * controls the game's ability to create servers of its own and accept * incoming connections. Each component can be set to one of the * following: - * + * *. 0 = no restrictions (least "safety"): all network access granted *. 1 = 'localhost' access only *. 2 = no network access - * + * * This only applies to the TADS 3 VM. TADS 2 doesn't support any - * network features, so this doesn't apply. + * network features, so this doesn't apply. */ void (*set_net_safety_level)(void *ctx, int client_level, int srv_level); void (*get_net_safety_level)(void *ctx, int *client_level, int *srv_level); @@ -237,7 +237,7 @@ struct appctxdef { /** * Name of run-time application for usage messages. If this is * null, the default run-time application name will be used for - * usage messages. + * usage messages. */ const char *usage_app_name; }; diff --git a/engines/glk/tads/tads2/built_in.cpp b/engines/glk/tads/tads2/built_in.cpp index afb6703cd63..134d4d10ab3 100644 --- a/engines/glk/tads/tads2/built_in.cpp +++ b/engines/glk/tads/tads2/built_in.cpp @@ -56,7 +56,7 @@ void bifyon(bifcxdef *ctx, int argc) strcpy(yesbuf, "[Yy].*"); if (os_get_str_rsc(RESID_YORN_NO, nobuf, sizeof(nobuf))) strcpy(nobuf, "[Nn].*"); - + /* if we're in HTML mode, switch to input font */ if (tio_is_html_mode()) tioputs(ctx->bifcxtio, ""); @@ -111,16 +111,16 @@ void bifsfs(bifcxdef *ctx, int argc) uint tm; runsdef val; voccxdef *voc = ctx->bifcxrun->runcxvoc; - + bifcntargs(ctx, 3, argc); /* check for proper argument count */ func = runpopfn(ctx->bifcxrun); tm = runpopnum(ctx->bifcxrun); runpop(ctx->bifcxrun, &val); - + /* limitation: don't allow string or list for value */ if (val.runstyp == DAT_LIST || val.runstyp == DAT_SSTRING) runsig(ctx->bifcxrun, ERR_FUSEVAL); - + vocsetfd(voc, voc->voccxfus, func, (prpnum)0, tm, &val, ERR_MANYFUS); } @@ -131,7 +131,7 @@ void bifrfs(bifcxdef *ctx, int argc) objnum func; runsdef val; voccxdef *voc = ctx->bifcxrun->runcxvoc; - + bifcntargs(ctx, 2, argc); func = runpopfn(ctx->bifcxrun); runpop(ctx->bifcxrun, &val); @@ -145,15 +145,15 @@ void bifsdm(bifcxdef *ctx, int argc) objnum func; runsdef val; voccxdef *voc = ctx->bifcxrun->runcxvoc; - + bifcntargs(ctx, 2, argc); /* check for proper argument count */ func = runpopfn(ctx->bifcxrun); runpop(ctx->bifcxrun, &val); - + /* limitation: don't allow string or list for value */ if (val.runstyp == DAT_LIST || val.runstyp == DAT_SSTRING) runsig(ctx->bifcxrun, ERR_FUSEVAL); - + vocsetfd(voc, voc->voccxdmn, func, (prpnum)0, 0, &val, ERR_MANYDMN); } @@ -164,7 +164,7 @@ void bifrdm(bifcxdef *ctx, int argc) objnum func; runsdef val; voccxdef *voc = ctx->bifcxrun->runcxvoc; - + bifcntargs(ctx, 2, argc); func = runpopfn(ctx->bifcxrun); runpop(ctx->bifcxrun, &val); @@ -176,7 +176,7 @@ void bifrdm(bifcxdef *ctx, int argc) void bifinc(bifcxdef *ctx, int argc) { int turncnt; - + if (argc == 1) { /* get the number of turns to skip */ @@ -302,7 +302,7 @@ void bifsav(bifcxdef *ctx, int argc) char buf[OSFNMAX]; int err; runsdef val; - + bifcntargs(ctx, 1, argc); fn = runpopstr(ctx->bifcxrun); bifcstr(ctx, buf, (size_t)sizeof(buf), fn); @@ -318,9 +318,9 @@ void bifrso(bifcxdef *ctx, int argc) char buf[OSFNMAX]; int err; voccxdef *vctx = ctx->bifcxrun->runcxvoc; - + bifcntargs(ctx, 1, argc); - + /* check for special restore(nil) - restore game given as parameter */ if (runtostyp(ctx->bifcxrun) == DAT_NIL) { @@ -358,7 +358,7 @@ void biflog(bifcxdef *ctx, int argc) { char buf[OSFNMAX]; uchar *str; - + bifcntargs(ctx, 1, argc); if (runtostyp(ctx->bifcxrun) == DAT_NIL) { @@ -401,7 +401,7 @@ void bifres(bifcxdef *ctx, int argc) /* * If a restart function was provided, call it. Note that we left * the argument for the function on the stack, so there's no need to - * re-push it! + * re-push it! */ if (fn != MCMONINV) runfn(ctx->bifcxrun, fn, 1); @@ -438,7 +438,7 @@ void bifnfy(bifcxdef *ctx, int argc) prpnum prp; uint tm; voccxdef *voc = ctx->bifcxrun->runcxvoc; - + bifcntargs(ctx, 3, argc); /* check for proper argument count */ objn = runpopobj(ctx->bifcxrun); prp = runpopprp(ctx->bifcxrun); @@ -447,7 +447,7 @@ void bifnfy(bifcxdef *ctx, int argc) /* a time of zero means every turn */ if (tm == 0) tm = VOCDTIM_EACH_TURN; - + vocsetfd(voc, voc->voccxalm, objn, prp, tm, (runsdef *)0, ERR_MANYNFY); } @@ -459,7 +459,7 @@ void bifunn(bifcxdef *ctx, int argc) objnum objn; prpnum prop; voccxdef *voc = ctx->bifcxrun->runcxvoc; - + bifcntargs(ctx, 2, argc); objn = runpopobj(ctx->bifcxrun); prop = runpopprp(ctx->bifcxrun); @@ -513,7 +513,7 @@ void bifsay(bifcxdef *ctx, int argc) char numbuf[30]; if (argc != 2) bifcntargs(ctx, 1, argc); - + switch(runtostyp(ctx->bifcxrun)) { case DAT_NUMBER: @@ -521,16 +521,16 @@ void bifsay(bifcxdef *ctx, int argc) sprintf(numbuf, "%ld", num); tioputs(ctx->bifcxtio, numbuf); break; - + case DAT_SSTRING: str = runpopstr(ctx->bifcxrun); outfmt(ctx->bifcxtio, str); break; - + case DAT_NIL: (void)runpoplog(ctx->bifcxrun); break; - + default: runsig1(ctx->bifcxrun, ERR_INVTBIF, ERRTSTR, "say"); } @@ -542,16 +542,16 @@ void bifcar(bifcxdef *ctx, int argc) uchar *lstp; uint lstsiz; runsdef val; - + bifcntargs(ctx, 1, argc); bifchkarg(ctx, DAT_LIST); - + lstp = runpoplst(ctx->bifcxrun); - + /* get list's size, and point to its data string */ lstsiz = osrp2(lstp) - 2; lstp += 2; - + /* push first element if one is present, otherwise push nil */ if (lstsiz) runpbuf(ctx->bifcxrun, *lstp, lstp+1); @@ -567,18 +567,18 @@ void bifcdr(bifcxdef *ctx, int argc) uint lstsiz; runsdef val; runsdef stkval; - + bifcntargs(ctx, 1, argc); bifchkarg(ctx, DAT_LIST); - + lstp = runpoplst(ctx->bifcxrun); stkval.runstyp = DAT_LIST; stkval.runsv.runsvstr = lstp; - + /* get list's size, and point to its data string */ lstsiz = osrp2(lstp) - 2; lstp += 2; - + if (lstsiz != 0) { /* deduct size of first element from size of list */ @@ -595,7 +595,7 @@ void bifcdr(bifcxdef *ctx, int argc) /* write out size followed by list value string */ oswp2(ctx->bifcxrun->runcxhp, lstsiz); memcpy(ctx->bifcxrun->runcxhp+2, lstp, (size_t)(lstsiz-2)); - + val.runsv.runsvstr = ctx->bifcxrun->runcxhp; val.runstyp = DAT_LIST; ctx->bifcxrun->runcxhp += lstsiz; @@ -626,7 +626,7 @@ void biflen(bifcxdef *ctx, int argc) runsdef val; long len = 0; int l; - + bifcntargs(ctx, 1, argc); switch(runtostyp(ctx->bifcxrun)) { @@ -639,12 +639,12 @@ void biflen(bifcxdef *ctx, int argc) p = runpoplst(ctx->bifcxrun); l = osrp2(p) - 2; p += 2; - + /* count all elements in list */ for (len = 0 ; l ; ++len) { int cursiz; - + /* get size of this element, and move past it */ cursiz = datsiz(*p, p+1) + 1; l -= cursiz; @@ -655,7 +655,7 @@ void biflen(bifcxdef *ctx, int argc) default: runsig1(ctx->bifcxrun, ERR_INVTBIF, ERRTSTR, "length"); } - + val.runsv.runsvnum = len; runpush(ctx->bifcxrun, DAT_NUMBER, &val); } @@ -669,7 +669,7 @@ void biffnd(bifcxdef *ctx, int argc) runsdef val; int typ = 0; int siz; - + bifcntargs(ctx, 2, argc); switch(runtostyp(ctx->bifcxrun)) { @@ -677,7 +677,7 @@ void biffnd(bifcxdef *ctx, int argc) p1 = runpopstr(ctx->bifcxrun); len1 = osrp2(p1) - 2; p1 += 2; - + p2 = runpopstr(ctx->bifcxrun); len2 = osrp2(p2) - 2; p2 += 2; @@ -692,7 +692,7 @@ void biffnd(bifcxdef *ctx, int argc) } } break; - + case DAT_LIST: p1 = runpoplst(ctx->bifcxrun); len1 = osrp2(p1) - 2; @@ -700,18 +700,18 @@ void biffnd(bifcxdef *ctx, int argc) /* get second item: any old datatype */ runpop(ctx->bifcxrun, &val); - + for (typ = DAT_NIL, outv = 1 ; len1 ; ++outv, p1 += siz, len1 -= siz) { siz = datsiz(*p1, p1 + 1) + 1; /* get size of this element */ if (val.runstyp != *p1) continue; /* types don't match */ - + switch(val.runstyp) { case DAT_NUMBER: if (val.runsv.runsvnum != osrp4s(p1 + 1)) continue; break; - + case DAT_SSTRING: case DAT_LIST: if (osrp2(p1 + 1) != osrp2(val.runsv.runsvstr) || @@ -719,30 +719,30 @@ void biffnd(bifcxdef *ctx, int argc) (size_t)(osrp2(p1 + 1) - 2))) continue; break; - + case DAT_PROPNUM: if (osrp2(p1 + 1) != val.runsv.runsvprp) continue; break; - + case DAT_OBJECT: case DAT_FNADDR: if (osrp2(p1 + 1) != val.runsv.runsvobj) continue; break; - + default: break; } - + /* if we got here, it means we found a match */ typ = DAT_NUMBER; /* use the value in outv */ break; /* that's it - we've found it */ } break; - + default: runsig1(ctx->bifcxrun, ERR_INVTBIF, ERRTSTR, "find"); } - + /* push the value given by typ and outv */ val.runsv.runsvnum = outv; runpush(ctx->bifcxrun, typ, &val); @@ -754,7 +754,7 @@ void bifsit(bifcxdef *ctx, int argc) objnum obj; int typ; voccxdef *vcx = ctx->bifcxrun->runcxvoc; - + /* check for extended version that allows setting him/her */ if (argc == 2) { @@ -858,7 +858,7 @@ void bifrnd(bifcxdef *ctx, int argc) * randomize(), use the new, improved random number generator. If * not, use the old random number generator to ensure that the same * sequence of numbers is generated as always (to prevent breaking - * existing test scripts based on the old sequence). + * existing test scripts based on the old sequence). */ if (!ctx->bifcxrndset) { @@ -872,7 +872,7 @@ void bifrnd(bifcxdef *ctx, int argc) /* adjust the result to be in the requested range */ result = ( randseed % max ) + 1; - + /* save the new seed value, and return the value */ ctx->bifcxrnd = randseed; val.runsv.runsvnum = result; @@ -899,8 +899,8 @@ void bifrnd(bifcxdef *ctx, int argc) } } -/* - * case-insensitive substring matching +/* + * case-insensitive substring matching */ static const char *bif_stristr(const char *s1, const char *s2) { @@ -920,12 +920,12 @@ static const char *bif_stristr(const char *s1, const char *s2) } /* - * askfile flags + * askfile flags */ #define BIF_ASKF_EXT_RET 1 /* extended return codes */ -/* - * askfile +/* + * askfile */ void bifask(bifcxdef *ctx, int argc) { @@ -975,7 +975,7 @@ void bifask(bifcxdef *ctx, int argc) }; const char **sp; - /* + /* * No prompt type or file type were specified. Try to infer the * dialog type and file type from the text of the prompt. (This * is mostly to support older games, in particular those based @@ -983,14 +983,14 @@ void bifask(bifcxdef *ctx, int argc) * provide explicit values for the file type and dialog type. * We are thus inferring the types based on the prompt strings * that older adv.t's used when calling askfile.) - * + * * If the prompt contains any substring such as "save" or * "write", specify that we're saving; otherwise, assume that * we're opening an existing file for reading. - * + * * If the prompt contains the substrings "restore" AND "game", * assume that we're opening a game file; otherwise, don't make - * any assumptions, and use the "unknown" file type. + * any assumptions, and use the "unknown" file type. */ /* presume we're going to open a saved-game file */ @@ -1011,18 +1011,18 @@ void bifask(bifcxdef *ctx, int argc) } } - /* + /* * look for *all* of the "restore game" strings - if we fail to * find any of them, be conservative and make no assumptions - * about the file type + * about the file type */ for (sp = game_strs ; *sp != 0 ; ++sp) { if (bif_stristr(pbuf, *sp) == 0) { - /* + /* * this one doesn't match - don't make assumptions about - * the file type + * the file type */ file_type = OSFTUNK; @@ -1044,18 +1044,18 @@ void bifask(bifcxdef *ctx, int argc) /* ask for a file */ err = tio_askfile(pbuf, buf, (int)sizeof(buf), prompt_type, (os_filetype_t)file_type); - /* + /* * if the caller requested extended return codes, return a list * containing the return code as the first element and, if - * successful, the string as the second element + * successful, the string as the second element */ if ((flags & BIF_ASKF_EXT_RET) != 0) { ushort len; runsdef val; uchar *p; - - /* + + /* * Allocate space for the starter list - if we have a string to * return, just allocate space for the number element for now; * otherwise, allocate space for the number plus a nil second @@ -1095,7 +1095,7 @@ void bifask(bifcxdef *ctx, int argc) if (err == OS_AFE_SUCCESS) { runsdef val2; - + /* push the string value, converting to our string format */ runpushcstr(ctx->bifcxrun, buf, strlen(buf), 1); @@ -1110,9 +1110,9 @@ void bifask(bifcxdef *ctx, int argc) } else { - /* + /* * use the traditional return codes - if askfile failed, return - * nil; otherwise, return the filename + * nil; otherwise, return the filename */ if (err) runpnil(ctx->bifcxrun); @@ -1131,7 +1131,7 @@ void bifssc(bifcxdef *ctx, int argc) { char buf[80]; uchar *p; - + p = runpopstr(ctx->bifcxrun); bifcstr(ctx, buf, (size_t)sizeof(buf), p); tiostrsc(ctx->bifcxtio, buf); @@ -1162,12 +1162,12 @@ void bifsub(bifcxdef *ctx, int argc) p = runpopstr(ctx->bifcxrun); len = osrp2(p) - 2; p += 2; - + /* get the offset argument */ bifchkarg(ctx, DAT_NUMBER); ofs = runpopnum(ctx->bifcxrun); if (ofs < 1) runsig1(ctx->bifcxrun, ERR_INVVBIF, ERRTSTR, "substr"); - + /* get the length argument */ bifchkarg(ctx, DAT_NUMBER); asklen = runpopnum(ctx->bifcxrun); @@ -1182,7 +1182,7 @@ void bifsub(bifcxdef *ctx, int argc) outlen = len - ofs; /* just use rest of string */ else outlen = asklen; /* requested length can be provided */ - + runpstr(ctx->bifcxrun, (char *)p, outlen, 3); } @@ -1192,7 +1192,7 @@ void bifcvs(bifcxdef *ctx, int argc) const char *p = nullptr; int len = 0; char buf[30]; - + bifcntargs(ctx, 1, argc); switch(runtostyp(ctx->bifcxrun)) { @@ -1201,13 +1201,13 @@ void bifcvs(bifcxdef *ctx, int argc) len = 3; (void)runpoplog(ctx->bifcxrun); break; - + case DAT_TRUE: p = "true"; len = 4; (void)runpoplog(ctx->bifcxrun); break; - + case DAT_NUMBER: sprintf(buf, "%ld", runpopnum(ctx->bifcxrun)); p = buf; @@ -1222,7 +1222,7 @@ void bifcvs(bifcxdef *ctx, int argc) /* throw the RUNEXITOBJ error */ runsig1(ctx->bifcxrun, ERR_INVTBIF, ERRTSTR, "cvtstr"); } - + runpstr(ctx->bifcxrun, p, len, 0); } @@ -1235,12 +1235,12 @@ void bifcvn(bifcxdef *ctx, int argc) int typ; long acc; int neg; - + bifcntargs(ctx, 1, argc); p = runpopstr(ctx->bifcxrun); len = osrp2(p) - 2; p += 2; - + if (len == 3 && !memcmp(p, "nil", (size_t)3)) typ = DAT_NIL; else if (len == 4 && !memcmp(p, "true", (size_t)4)) @@ -1263,7 +1263,7 @@ void bifcvn(bifcxdef *ctx, int argc) if (neg) acc = -acc; val.runsv.runsvnum = acc; } - + runpush(ctx->bifcxrun, typ, &val); } @@ -1274,21 +1274,21 @@ static void bifcvtstr(bifcxdef *ctx, void (*cvtfn)(uchar *, int), int argc) int len; runsdef val; runsdef stkval; - + bifcntargs(ctx, 1, argc); bifchkarg(ctx, DAT_SSTRING); - + p = runpopstr(ctx->bifcxrun); stkval.runstyp = DAT_SSTRING; stkval.runsv.runsvstr = p; len = osrp2(p); - + /* allocate space in heap for the string and convert */ runhres1(ctx->bifcxrun, len, 1, &stkval); p = stkval.runsv.runsvstr; memcpy(ctx->bifcxrun->runcxhp, p, (size_t)len); (*cvtfn)(ctx->bifcxrun->runcxhp + 2, len - 2); - + val.runsv.runsvstr = ctx->bifcxrun->runcxhp; val.runstyp = DAT_SSTRING; ctx->bifcxrun->runcxhp += len; @@ -1354,7 +1354,7 @@ void bifisc(bifcxdef *ctx, int argc) objnum cls; runsdef val; voccxdef *voc = ctx->bifcxrun->runcxvoc; - + bifcntargs(ctx, 2, argc); /* if checking for nil, return nil */ @@ -1404,7 +1404,7 @@ void biffob(bifcxdef *ctx, int argc) cls = runpopobj(ctx->bifcxrun); else runsig(ctx->bifcxrun, ERR_BIFARGC); - + for (vpg = voc->voccxinh, i = 0 ; i < VOCINHMAX ; ++vpg, ++i) { if (!*vpg) continue; @@ -1413,13 +1413,13 @@ void biffob(bifcxdef *ctx, int argc) if (!*v || ((*v)->vociflg & VOCIFCLASS) || (cls != MCMONINV && !bifinh(voc, *v, cls))) continue; - + /* this is an object we can use - push it */ runpobj(ctx->bifcxrun, obj); return; } } - + /* no objects found at all - return nil */ runpnil(ctx->bifcxrun); } @@ -1438,7 +1438,7 @@ void bifnob(bifcxdef *ctx, int argc) /* get last position in search */ prv = runpopobj(ctx->bifcxrun); - + /* get class to search for, if one is specified */ if (argc == 1) cls = MCMONINV; @@ -1446,14 +1446,14 @@ void bifnob(bifcxdef *ctx, int argc) cls = runpopobj(ctx->bifcxrun); else runsig(ctx->bifcxrun, ERR_BIFARGC); - + /* start at previous object plus 1 */ i = (prv >> 8); vpg = voc->voccxinh + i; j = (prv & 255); obj = prv; v = (*vpg) + j; - + for (;;) { ++j; @@ -1477,11 +1477,11 @@ void bifnob(bifcxdef *ctx, int argc) runpnil(ctx->bifcxrun); return; } - + if (!*v || ((*v)->vociflg & VOCIFCLASS) || (cls != MCMONINV && !bifinh(voc, *v, cls))) continue; - + /* this is an object we can use - push it */ runpobj(ctx->bifcxrun, obj); return; @@ -1500,10 +1500,10 @@ void bifsvn(bifcxdef *ctx, int argc) void bifarg(bifcxdef *ctx, int argc) { int argnum; - + bifcntargs(ctx, 1, argc); bifchkarg(ctx, DAT_NUMBER); - + /* get and verify argument number */ argnum = runpopnum(ctx->bifcxrun); if (argnum < 1) runsig1(ctx->bifcxrun, ERR_INVVBIF, ERRTSTR, "getarg"); @@ -1515,9 +1515,9 @@ void bifarg(bifcxdef *ctx, int argc) void biftyp(bifcxdef *ctx, int argc) { runsdef val; - + bifcntargs(ctx, 1, argc); - + /* get whatever it is, and push the type */ runpop(ctx->bifcxrun, &val); val.runsv.runsvnum = val.runstyp; /* new value is the datatype */ @@ -1608,7 +1608,7 @@ void bifdef(bifcxdef *ctx, int argc) /* if the property is defined directly by the object, return true */ runpush(ctx->bifcxrun, runclog(ofs != 0 && def_objn == objn), &val); break; - + case BIFDEF_DEFINED_INHERITS: /* if the property is inherited, return true */ runpush(ctx->bifcxrun, runclog(ofs != 0 && def_objn != objn), &val); @@ -1640,12 +1640,12 @@ void bifpty(bifcxdef *ctx, int argc) prpdef *propptr; bifcntargs(ctx, 2, argc); - + /* get offset of obj.prop */ objn = runpopobj(ctx->bifcxrun); prpn = runpopprp(ctx->bifcxrun); ofs = objgetap(ctx->bifcxrun->runcxmem, objn, prpn, &orn, FALSE); - + if (ofs) { /* lock the object, read the prpdef, and unlock it */ @@ -1659,7 +1659,7 @@ void bifpty(bifcxdef *ctx, int argc) /* property is not defined by object - indicate that type is nil */ val.runsv.runsvnum = DAT_NIL; } - + /* special case: DAT_DEMAND -> DAT_LIST (for contents properties) */ if (val.runsv.runsvnum == DAT_DEMAND) val.runsv.runsvnum = DAT_LIST; @@ -1680,7 +1680,7 @@ void bifoph(bifcxdef *ctx, int argc) { /* throw away the flag */ rundisc(ctx->bifcxrun); - + /* figure out appropriate return value */ if (!hidden) val.runsv.runsvnum = 0; @@ -1725,7 +1725,7 @@ void bifoph(bifcxdef *ctx, int argc) * Output was hidden, and output had already occurred. If * more output has occurred, return true, else return nil. * In either case, set the output_occurred flag back to - * true, since it was true before the outhide(true). + * true, since it was true before the outhide(true). */ runpush(ctx->bifcxrun, runclog(output_occurred), &val); outsethidden(); @@ -1773,17 +1773,17 @@ void biftim(bifcxdef *ctx, int argc) { switch(typ) { case 1: - /* + /* * default information format - list format with current system - * time and date + * time and date */ /* make sure the time zone is set up properly */ os_tzset(); - + /* get the local time information */ g_system->getTimeAndDate(tm); - + /* adjust values for return format */ tm.tm_wday++; @@ -1799,7 +1799,7 @@ void biftim(bifcxdef *ctx, int argc) { // TODO: Convert dae/tme to Unix style local time timer = 0; - + /* build return list value */ oswp2(ret, 47); p = ret + 2; @@ -1813,7 +1813,7 @@ void biftim(bifcxdef *ctx, int argc) { p = bifputnum(p, tm.tm_sec); *p++ = DAT_NUMBER; oswp4s(p, (long)timer); - + val.runstyp = DAT_LIST; val.runsv.runsvstr = ret; runpush(ctx->bifcxrun, DAT_LIST, &val); @@ -1822,7 +1822,7 @@ void biftim(bifcxdef *ctx, int argc) { case 2: /* * High-precision system timer value - returns the system time - * in milliseconds, relative to an arbitrary zero point + * in milliseconds, relative to an arbitrary zero point */ runpnum(ctx->bifcxrun, os_get_sys_clock_ms()); break; @@ -1846,7 +1846,7 @@ void bifgfu(bifcxdef *ctx, int argc) voccxdef *vcx = ctx->bifcxrun->runcxvoc; bifcntargs(ctx, 2, argc); - + if (runtostyp(rcx) == DAT_FNADDR) { /* check on a setfuse()-style fuse: get fnaddr, parm */ @@ -1876,11 +1876,11 @@ void bifgfu(bifcxdef *ctx, int argc) goto ret_num; } } - + /* didn't find anything - return nil */ runpush(rcx, DAT_NIL, &val); return; - + ret_num: /* return current daem->vocdtim */ runpnum(rcx, (long)daem->vocdtim); @@ -1921,7 +1921,7 @@ void bifsct(bifcxdef *bifctx, int argc) uint dsz2; runsdef val; runsdef stk1, stk2; - + bifcntargs(bifctx, 2, argc); l1 = runpoplst(ctx); siz1 = osrp2(l1); @@ -1931,7 +1931,7 @@ void bifsct(bifcxdef *bifctx, int argc) /* make sure the first list is smaller - if not, switch them */ if (siz1 > siz2) l3 = l1, l1 = l2, l2 = l3, siz3 = siz1, siz1 = siz2, siz2 = siz3; - + /* size of result is at most size of smaller list (which is now siz1) */ stk1.runstyp = stk2.runstyp = DAT_LIST; stk1.runsv.runsvstr = l1; @@ -1960,7 +1960,7 @@ void bifsct(bifcxdef *bifctx, int argc) } } } - + /* set up return value, take it out of the heap, and push value */ val.runsv.runsvstr = ctx->runcxhp; val.runstyp = DAT_LIST; @@ -1971,7 +1971,7 @@ void bifsct(bifcxdef *bifctx, int argc) /* * Portable keystroke mappings. We map the extended key codes to these - * strings, so that the TADS code can access arrow keys and the like. + * strings, so that the TADS code can access arrow keys and the like. */ static const char *ext_key_names[] = { @@ -2018,25 +2018,25 @@ static const char *ext_key_names[] = * the keystroke; if 'c' is zero, then 'extc' is the character returned * by the second call to os_getc() to get the CMD_xxx code for the * keystroke. - * + * * The name buffer should be 20 characters long - this will ensure that - * any name will fit. - * + * any name will fit. + * * For ordinary, printable characters, we'll simply return the * character; the letter 'a', for example, is returned as the string "a". - * + * * For extended keys, we'll look up the CMD_xxx code and return the name * of the command, enclosed in square brackets; see the ext_key_names * table for the mappings. The left-arrow cursor key, for example, * returns "[left]". - * + * * For control characters, we'll generate a name like "[ctrl-a]", except * for the following characters: - * + * *. ascii 10 returns "\n" *. ascii 13 returns "\n" *. ascii 9 returns "\t" - *. ascii 8 returns "[bksp]" + *. ascii 8 returns "[bksp]" */ static int get_ext_key_name(char *namebuf, int c, int extc) { @@ -2081,7 +2081,7 @@ static int get_ext_key_name(char *namebuf, int c, int extc) namebuf[1] = '\0'; return TRUE; } - + /* if it's in the key name array, use the array entry */ if (extc >= 1 && extc <= (int)(sizeof(ext_key_names)/sizeof(ext_key_names[0]))) @@ -2113,7 +2113,7 @@ void bifink(bifcxdef *ctx, int argc) int extc; char str[20]; size_t len; - + bifcntargs(ctx, 0, argc); tioflushn(ctx->bifcxtio, 0); @@ -2146,7 +2146,7 @@ void bifwrd(bifcxdef *ctx, int argc) const uchar *src; uint len; runsdef val; - + bifcntargs(ctx, 1, argc); /* figure out what word list to get */ @@ -2266,7 +2266,7 @@ static void bifgtw_cb(void *ctx0, vocdef *voc, vocwdef *vocw) /* ignore objects of the inappropriate type */ if (vocw->vocwtyp != ctx->typ) return; - + /* the datatype is string */ *ctx->p = DAT_SSTRING; @@ -2305,7 +2305,7 @@ void bifgtw(bifcxdef *ctx, int argc) /* get the arguments */ objn = runpopobj(ctx->bifcxrun); prpn = runpopprp(ctx->bifcxrun); - + /* make sure the property is a valid part of speech property */ if (!prpisvoc(prpn)) runsig1(ctx->bifcxrun, ERR_INVVBIF, ERRTSTR, "delword"); @@ -2318,7 +2318,7 @@ void bifgtw(bifcxdef *ctx, int argc) * these words: 2 bytes for the list length header; plus, for each * entry, 1 byte for the type header, 2 bytes for the string size * header, and possibly one extra byte for the two-word separator -- - * a total of 4 bytes extra per word. + * a total of 4 bytes extra per word. */ siz += 2 + 4*cnt; @@ -2360,7 +2360,7 @@ void bifvin(bifcxdef *ctx, int argc) /* get the verb */ verb = runpopobj(ctx->bifcxrun); - + /* check for the presence of a preposition */ if (argc == 1) { @@ -2393,7 +2393,7 @@ void bifvin(bifcxdef *ctx, int argc) /* * figure space for the return value: if there's a prep, three * property pointers plus a boolean, otherwise just two property - * pointers + * pointers */ siz = 2 + 2*(2+1); if (prep != MCMONINV) @@ -2445,34 +2445,34 @@ void bifcls(bifcxdef *ctx, int argc) /* flush any pending output */ tioflushn(ctx->bifcxtio, 0); - + /* clear the screen */ oscls(); } /* - * File operations + * File operations */ /* * fopen(file, mode). - * + * * Operations are allowed only if they conform to the current I/O safety * level. The safety level can be set by the user on the command line * when running the game, and some implementations may allow the setting * to be saved as a preference. The possible levels are: - * + * *. 0 - minimum safety - read and write in any directory *. 1 - read in any directory, write in current directory *. 2 - read/write access in current directory only *. 3 - read-only access in current directory only *. 4 - maximum safety - no file I/O allowed - * + * * When operations are allowed only in the current directory, the * operations will fail if the filename contains any sort of path * specifier (for example, on Unix, any file that contains a '/' is * considered to have a path specifier, and will always fail if - * operations are only allowed in the current directory). + * operations are only allowed in the current directory). */ void biffopen(bifcxdef *ctx, int argc) { @@ -2487,18 +2487,18 @@ void biffopen(bifcxdef *ctx, int argc) char main_mode; /* 'r' for read, 'w' for write */ int in_same_dir; /* flag: file is in current directory */ appctxdef *appctx; - + bifcntargs(ctx, 2, argc); /* get the filename */ p = runpopstr(ctx->bifcxrun); bifcstr(ctx, fname, (size_t)sizeof(fname), p); - /* + /* * If it's a relative path, combine it with the game file path to form * the absolute path. This ensures that relative paths are always * relative to the original working directory if the OS-level working - * directory has changed. + * directory has changed. */ if (!os_is_file_absolute(fname)) { @@ -2592,21 +2592,21 @@ void biffopen(bifcxdef *ctx, int argc) /* * If we have a host application context, and it provides a file * safety level callback function, ask the host system for its - * current file safety level, which overrides our current setting. + * current file safety level, which overrides our current setting. */ appctx = ctx->bifcxappctx; if (appctx != 0 && appctx->get_io_safety_level != 0) { - /* + /* * ask the host system for the current level, and override any - * setting we previously had + * setting we previously had */ (*appctx->get_io_safety_level)( appctx->io_safety_level_ctx, &ctx->bifcxsafetyr, &ctx->bifcxsafetyw); } - /* + /* * Check to see if the file is in the current working directory - if * not, we may have to disallow the operation based on safety level * settings. @@ -2618,10 +2618,10 @@ void biffopen(bifcxdef *ctx, int argc) switch(main_mode) { case 'w': - /* + /* * writing - we must be at a safety level no higher than 2 * (read/write current directory) to write at all, and we must be - * level 0 to write a file that's not in the current directory + * level 0 to write a file that's not in the current directory */ if (ctx->bifcxsafetyw > 2 || (!in_same_dir && ctx->bifcxsafetyw > 0)) @@ -2637,7 +2637,7 @@ void biffopen(bifcxdef *ctx, int argc) * reading - we must be at a safety level no higher than 3 (read * current directory) to read at all, and we must be at safety * level 1 (read any directory) or lower to read a file that's not - * in the current directory + * in the current directory */ if (ctx->bifcxsafetyr > 3 || (!in_same_dir && ctx->bifcxsafetyr > 1)) @@ -2649,11 +2649,11 @@ void biffopen(bifcxdef *ctx, int argc) break; default: - /* + /* * fail the operation, as a code maintenance measure to make * sure that we add appropriate cases to this switch (even if * merely to allow the operation unconditionally) in the event - * that more modes are added in the future + * that more modes are added in the future */ goto bad_mode; } @@ -2665,10 +2665,10 @@ void biffopen(bifcxdef *ctx, int argc) /* check for binary vs text mode */ if (bin_mode) { - /* + /* * binary mode -- allow read/write or just writing, but in * either case truncate the file if it already exists, and - * create a new file if it doesn't exist + * create a new file if it doesn't exist */ if (rw_mode) fp = osfoprwtb(fname, OSFTDATA); @@ -2744,7 +2744,7 @@ void biffopen(bifcxdef *ctx, int argc) bad_mode: runsig1(ctx->bifcxrun, ERR_INVVBIF, ERRTSTR, "fopen"); } - + /* service routine for file routines - get and validate a file number */ static osfildef *bif_get_file(bifcxdef *ctx, int *fnump, int *bin_modep) { @@ -2780,7 +2780,7 @@ void biffclose(bifcxdef *ctx, int argc) osfcls(fp); ctx->bifcxfile[fnum].fp = 0; } - + void bifftell(bifcxdef *ctx, int argc) { osfildef *fp; @@ -2792,7 +2792,7 @@ void bifftell(bifcxdef *ctx, int argc) /* return the seek position */ runpnum(ctx->bifcxrun, osfpos(fp)); } - + void biffseek(bifcxdef *ctx, int argc) { osfildef *fp; @@ -2806,7 +2806,7 @@ void biffseek(bifcxdef *ctx, int argc) pos = runpopnum(ctx->bifcxrun); osfseek(fp, pos, OSFSK_SET); } - + void biffseekeof(bifcxdef *ctx, int argc) { osfildef *fp; @@ -2818,7 +2818,7 @@ void biffseekeof(bifcxdef *ctx, int argc) /* seek to the end */ osfseek(fp, 0L, OSFSK_END); } - + void biffwrite(bifcxdef *ctx, int argc) { osfildef *fp; @@ -2826,7 +2826,7 @@ void biffwrite(bifcxdef *ctx, int argc) char buf[32]; runsdef val; int bin_mode; - + /* get the file */ bifcntargs(ctx, 2, argc); fp = bif_get_file(ctx, (int *)0, &bin_mode); @@ -2840,7 +2840,7 @@ void biffwrite(bifcxdef *ctx, int argc) /* put a byte indicating the type */ if (osfwb(fp, &typ, 1)) goto ret_error; - + /* see what type of data we want to put */ switch(typ) { @@ -2849,17 +2849,17 @@ void biffwrite(bifcxdef *ctx, int argc) if (osfwb(fp, buf, 4)) goto ret_error; break; - + case DAT_SSTRING: /* write the string, including the length prefix */ if (osfwb(fp, val.runsv.runsvstr, osrp2(val.runsv.runsvstr))) goto ret_error; break; - + case DAT_TRUE: /* all we need for this is the type prefix */ break; - + default: /* other types are not acceptable */ runsig1(ctx->bifcxrun, ERR_INVTBIF, ERRTSTR, "fwrite"); @@ -2869,14 +2869,14 @@ void biffwrite(bifcxdef *ctx, int argc) { uint rem; uchar *p; - + switch(typ) { case DAT_SSTRING: /* * Copy and translate the string to our buffer, in pieces if * the size of the string exceeds that of our buffer. If we - * encounter any escape codes, translate them. + * encounter any escape codes, translate them. */ rem = osrp2(val.runsv.runsvstr) - 2; p = val.runsv.runsvstr + 2; @@ -2945,7 +2945,7 @@ ret_error: val.runstyp = DAT_TRUE; runpush(ctx->bifcxrun, DAT_TRUE, &val); } - + void biffread(bifcxdef *ctx, int argc) { osfildef *fp; @@ -2964,7 +2964,7 @@ void biffread(bifcxdef *ctx, int argc) /* binary file - read the type byte */ if (osfrb(fp, &typ, 1)) goto ret_error; - + /* read the data according to the type */ switch(typ) { @@ -2973,37 +2973,37 @@ void biffread(bifcxdef *ctx, int argc) goto ret_error; runpnum(ctx->bifcxrun, osrp4s(buf)); break; - + case DAT_SSTRING: /* get the size */ if (osfrb(fp, buf, 2)) goto ret_error; len = osrp2(buf); - + /* reserve space */ runhres(ctx->bifcxrun, len, 0); - + /* read the string into the reserved space */ if (osfrb(fp, ctx->bifcxrun->runcxhp + 2, len - 2)) goto ret_error; - + /* set up the string */ oswp2(ctx->bifcxrun->runcxhp, len); val.runstyp = DAT_SSTRING; val.runsv.runsvstr = ctx->bifcxrun->runcxhp; - + /* consume the space */ ctx->bifcxrun->runcxhp += len; - + /* push the value */ runrepush(ctx->bifcxrun, &val); break; - + case DAT_TRUE: val.runstyp = DAT_TRUE; runpush(ctx->bifcxrun, DAT_TRUE, &val); break; - + default: goto ret_error; } @@ -3017,7 +3017,7 @@ void biffread(bifcxdef *ctx, int argc) uint res_total; int found_nl; - /* + /* * reserve some space in the heap - we'll initially reserve * space for twice our buffer, in case every single character * needs to be expanded into an escape sequence @@ -3036,22 +3036,22 @@ void biffread(bifcxdef *ctx, int argc) /* text-mode - read the result into our buffer */ if (!osfgets((char *)dbuf, sizeof(dbuf) - 1, fp)) { - /* + /* * if we found a newline, return what we have; - * otherwise, return an error + * otherwise, return an error */ if (found_nl) break; else goto ret_error; } - - /* + + /* * make sure it's null-terminated, in case the buffer was - * full + * full */ dbuf[256] = '\0'; - + /* translate into the heap area we've reserved */ for (src = dbuf ; *src != '\0' ; ++src, ++dst) { @@ -3063,17 +3063,17 @@ void biffread(bifcxdef *ctx, int argc) /* translate to a newline sequence */ *dst++ = '\\'; *dst = 'n'; - + /* note that we've found our newline */ found_nl = TRUE; break; - + case '\t': /* translate to a tab sequence */ *dst++ = '\\'; *dst = 't'; break; - + case '\\': /* expand to a double-backslash sequence */ *dst++ = '\\'; @@ -3093,7 +3093,7 @@ void biffread(bifcxdef *ctx, int argc) * up may move if we compact the heap while asking for more * space. So, remember our current length, reserve another * buffer-full of space, and set everything up at the new - * output location if necessary. + * output location if necessary. */ if (!found_nl) { @@ -3107,11 +3107,11 @@ void biffread(bifcxdef *ctx, int argc) /* ask for the space */ runhres(ctx->bifcxrun, res_total, 0); - /* + /* * Since we were at the top of the heap before, we * should still be at the top of the heap. If not, * we'll have to copy from our old location to the new - * top of the heap. + * top of the heap. */ if (val.runsv.runsvstr != ctx->bifcxrun->runcxhp) { @@ -3164,7 +3164,7 @@ void bifcapture(bifcxdef *ctx, int argc) /* * The return value is a status code used to restore the * original status on the bracketing call to turn off output. - * The only status necessary is the current output size. + * The only status necessary is the current output size. */ siz = tiocapturesize(ctx->bifcxtio); runpnum(ctx->bifcxrun, (long)siz); @@ -3201,7 +3201,7 @@ void bifcapture(bifcxdef *ctx, int argc) /* push the string onto the stack */ runpstr(ctx->bifcxrun, (char *)p, siz, 0); - + ERRCLEAN(ctx->bifcxerr) /* done with the object - unlock it */ mcmunlck(mcx, obj); @@ -3217,7 +3217,7 @@ void bifcapture(bifcxdef *ctx, int argc) } /* - * systemInfo + * systemInfo */ void bifsysinfo(bifcxdef *ctx, int argc) { @@ -3247,7 +3247,7 @@ void bifsysinfo(bifcxdef *ctx, int argc) bifcntargs(ctx, 1, argc); runpushcstr(ctx->bifcxrun, OS_SYSTEM_NAME, strlen(OS_SYSTEM_NAME), 0); break; - + case SYSINFO_HTML: case SYSINFO_JPEG: case SYSINFO_PNG: @@ -3276,9 +3276,9 @@ void bifsysinfo(bifcxdef *ctx, int argc) case SYSINFO_MNG_ALPHA: case SYSINFO_TEXT_HILITE: case SYSINFO_INTERP_CLASS: - /* + /* * these information types are all handled by the OS layer, and - * take no additional arguments + * take no additional arguments */ bifcntargs(ctx, 1, argc); if (os_get_sysinfo(id, 0, &result)) @@ -3301,23 +3301,23 @@ void bifsysinfo(bifcxdef *ctx, int argc) break; case SYSINFO_TEXT_COLORS: - /* + /* * Text colors are only supported in full HTML interpreters. If * this is an HTML interpreter, ask the underlying OS layer about * color support; otherwise, colors are not available, since we * don't handle colors in our text-only HTML subset. - * + * * Colors are NOT supported in the HTML mini-parser in text-only * interpreters in TADS 2. So, even if we're running in HTML * mode, if this is a text-only interpreter, we can't display text - * colors. + * colors. */ bifcntargs(ctx, 1, argc); if (os_get_sysinfo(SYSINFO_HTML, 0, &result) && result != 0) { - /* + /* * we're in HTML mode, so ask the underlying HTML OS - * implementation for its level of text color support + * implementation for its level of text color support */ if (os_get_sysinfo(id, 0, &result)) { @@ -3342,11 +3342,11 @@ void bifsysinfo(bifcxdef *ctx, int argc) bifcntargs(ctx, 1, argc); runpnum(ctx->bifcxrun, 0); break; - + default: - /* + /* * Other codes fail harmlessly with a nil return value. Pop all - * remaining arguments and return nil. + * remaining arguments and return nil. */ for ( ; argc > 1 ; --argc) rundisc(ctx->bifcxrun); @@ -3356,7 +3356,7 @@ void bifsysinfo(bifcxdef *ctx, int argc) } /* - * morePrompt - display the more prompt and wait for the user to respond + * morePrompt - display the more prompt and wait for the user to respond */ void bifmore(bifcxdef *ctx, int argc) { @@ -3369,12 +3369,12 @@ void bifmore(bifcxdef *ctx, int argc) } /* - * parserSetMe + * parserSetMe */ void bifsetme(bifcxdef *ctx, int argc) { objnum new_me; - + /* this function takes one argument */ bifcntargs(ctx, 1, argc); @@ -3390,7 +3390,7 @@ void bifsetme(bifcxdef *ctx, int argc) } /* - * parserGetMe + * parserGetMe */ void bifgetme(bifcxdef *ctx, int argc) { @@ -3402,7 +3402,7 @@ void bifgetme(bifcxdef *ctx, int argc) } /* - * reSearch + * reSearch */ void bifresearch(bifcxdef *ctx, int argc) { @@ -3412,7 +3412,7 @@ void bifresearch(bifcxdef *ctx, int argc) size_t searchlen; int result_len; int match_ofs; - + /* this function takes two parameters: pattern, string */ bifcntargs(ctx, 2, argc); @@ -3432,9 +3432,9 @@ void bifresearch(bifcxdef *ctx, int argc) (char *)searchstr, searchlen, &result_len); - /* + /* * if we didn't match, return nil; otherwise, return a list with the - * match offset and length + * match offset and length */ if (match_ofs < 0) { @@ -3446,13 +3446,13 @@ void bifresearch(bifcxdef *ctx, int argc) ushort listsiz; runsdef val; uchar *p; - - /* + + /* * build a list consisting of two numbers and a string: two * bytes for the list header, then two elements at (one byte for * the datatype header, four bytes for the number), then the * string element with (one byte for the datatype, two bytes for - * the string length prefix, and the bytes of the string) + * the string length prefix, and the bytes of the string) */ listsiz = 2 + (1+4)*2 + (1 + 2 + (ushort)(result_len)); @@ -3467,11 +3467,11 @@ void bifresearch(bifcxdef *ctx, int argc) oswp2(p, listsiz); p += 2; - /* + /* * Add the offset element. For consistency with TADS * conventions, use 1 as the offset of the first character in * the string - this makes it easy to use the offset value with - * substr(). + * substr(). */ *p++ = DAT_NUMBER; oswp4s(p, match_ofs + 1); @@ -3506,7 +3506,7 @@ void bifregroup(bifcxdef *ctx, int argc) runsdef val; uchar *p; long numval; - + /* this function takes one parameter: the group number to retrieve */ bifcntargs(ctx, 1, argc); @@ -3540,12 +3540,12 @@ void bifregroup(bifcxdef *ctx, int argc) /* calculate the length of the string in this group */ len = reg->end_ofs - reg->start_ofs; - /* + /* * reserve the necessary heap space: two bytes for the list length * prefix, two number elements (one byte each for the type, four * bytes each for the value), and the string element (one byte for * the type, two bytes for the length prefix, plus the string - * itself). + * itself). */ hplen = (ushort)(2 + 2*(1+4) + (1 + 2 + len)); runhres(ctx->bifcxrun, hplen, 0); @@ -3585,7 +3585,7 @@ void bifregroup(bifcxdef *ctx, int argc) /* - * inputevent + * inputevent */ void bifinpevt(bifcxdef *ctx, int argc) { @@ -3598,7 +3598,7 @@ void bifinpevt(bifcxdef *ctx, int argc) runsdef val; size_t paramlen = 0; char keyname[20]; - + /* check for a timeout value */ if (argc == 0) { @@ -3626,10 +3626,10 @@ void bifinpevt(bifcxdef *ctx, int argc) /* ask the OS code for an event */ evt = os_get_event(timeout, use_timeout, &info); - /* + /* * the list always minimally needs two bytes of length prefix plus a * number with the event code (one byte for the type, four bytes for - * the value) + * the value) */ lstsiz = 2 + (1 + 4); @@ -3637,11 +3637,11 @@ void bifinpevt(bifcxdef *ctx, int argc) switch(evt) { case OS_EVT_KEY: - /* + /* * we need space for a string with one or two bytes (depending * on whether or not we have an extended key code) - 1 byte for * type code, 2 for length prefix, and 1 or 2 for the string's - * contents + * contents */ paramlen = (info.key[0] == 0 ? 2 : 1); @@ -3656,9 +3656,9 @@ void bifinpevt(bifcxdef *ctx, int argc) break; case OS_EVT_HREF: - /* + /* * we need space for the href string - 1 byte for type code, 2 - * for length prefix, plus the string's contents + * for length prefix, plus the string's contents */ paramlen = strlen(info.href); lstsiz += 1 + 2 + (ushort)paramlen; @@ -3718,7 +3718,7 @@ void bifinpevt(bifcxdef *ctx, int argc) void bifdelay(bifcxdef *ctx, int argc) { long delay; - + /* ensure we have the right number of arguments */ bifcntargs(ctx, 1, argc); @@ -3764,7 +3764,7 @@ void bifsetoutfilter(bifcxdef *ctx, int argc) * Get an optional object argument. If the next argument is not an * object value, or we're out of arguments, we'll return MCMONINV. * Otherwise, we'll pop the object value and return it, decrementing the - * remaining argument counter provided. + * remaining argument counter provided. */ static objnum bif_get_optional_obj_arg(bifcxdef *ctx, int *rem_argc) { @@ -3772,9 +3772,9 @@ static objnum bif_get_optional_obj_arg(bifcxdef *ctx, int *rem_argc) if (*rem_argc == 0) return MCMONINV; - /* + /* * if the next argument is not an object or nil, we're out of object - * arguments + * arguments */ if (runtostyp(ctx->bifcxrun) != DAT_OBJECT && runtostyp(ctx->bifcxrun) != DAT_NIL) @@ -3788,7 +3788,7 @@ static objnum bif_get_optional_obj_arg(bifcxdef *ctx, int *rem_argc) } /* - * execCommand flag values + * execCommand flag values */ #define EC_HIDE_SUCCESS 0x00000001 #define EC_HIDE_ERROR 0x00000002 @@ -3796,7 +3796,7 @@ static objnum bif_get_optional_obj_arg(bifcxdef *ctx, int *rem_argc) #define EC_SKIP_VALIDIO 0x00000008 /* - * execCommand - execute a recursive command + * execCommand - execute a recursive command */ void bifexec(bifcxdef *ctx, int argc) { @@ -3812,10 +3812,10 @@ void bifexec(bifcxdef *ctx, int argc) ulong flags; int hide_any; int rem_argc; - - /* + + /* * Check for the correct argument count. The first two arguments - * are required; additional arguments are optional. + * are required; additional arguments are optional. */ if (argc < 2 || argc > 6) runsig(ctx->bifcxrun, ERR_BIFARGC); @@ -3824,10 +3824,10 @@ void bifexec(bifcxdef *ctx, int argc) actor = runpopobjnil(ctx->bifcxrun); verb = runpopobjnil(ctx->bifcxrun); - /* + /* * The other object arguments are optional. If we run into a * numeric argument, it's the flags value, in which case we're out - * of objects. + * of objects. */ rem_argc = argc - 2; dobj = bif_get_optional_obj_arg(ctx, &rem_argc); @@ -3849,11 +3849,11 @@ void bifexec(bifcxdef *ctx, int argc) flags = 0; } - /* + /* * make sure we don't have any arguments left - if we do, then it * means that we got an incorrect type and skipped an argument when * we were trying to sense the meanings of the arguments from their - * types + * types */ if (rem_argc != 0) runsig1(ctx->bifcxrun, ERR_INVTBIF, ERRTSTR, "execCommand"); @@ -3880,7 +3880,7 @@ void bifexec(bifcxdef *ctx, int argc) { uchar *p; int hide; - + /* get the capture buffer size */ capture_end = tiocapturesize(ctx->bifcxtio); @@ -3897,27 +3897,27 @@ void bifexec(bifcxdef *ctx, int argc) /* show or hide the result, as appropriate */ if (hide) { - /* + /* * We're hiding this result, so do not display the string. * If there's an enclosing capture, remove the string from - * the enclosing capture. + * the enclosing capture. */ if (capture_start != 0) tiopopcapture(ctx->bifcxtio, capture_start); } else { - /* + /* * We're showing the text. If we're in an enclosing * capture, do nothing - simply leave the string in the - * enclosing capture buffer; otherwise, actually display it + * enclosing capture buffer; otherwise, actually display it */ if (capture_start == 0) { /* lock the capture object */ capture_obj = tiogetcapture(ctx->bifcxtio); p = mcmlck(ctx->bifcxrun->runcxmem, capture_obj); - + ERRBEGIN(ctx->bifcxerr) { /* display the string */ @@ -3935,7 +3935,7 @@ void bifexec(bifcxdef *ctx, int argc) mcmunlck(ctx->bifcxrun->runcxmem, capture_obj); } } - + /* clear the capture buffer if it wasn't on when we started */ if (capture_start == 0) tioclrcapture(ctx->bifcxtio); @@ -3945,15 +3945,15 @@ void bifexec(bifcxdef *ctx, int argc) runpnum(ctx->bifcxrun, err); } -/* - * parserGetObj - get one of the objects associated with the command +/* + * parserGetObj - get one of the objects associated with the command */ void bifgetobj(bifcxdef *ctx, int argc) { int id; objnum obj = 0; voccxdef *voc = ctx->bifcxrun->runcxvoc; - + /* check the argument count */ bifcntargs(ctx, 1, argc); @@ -4013,9 +4013,9 @@ void bifgetobj(bifcxdef *ctx, int argc) /* them */ voc_push_objlist(voc, voc->voccxthm, voc->voccxthc); - /* + /* * return directly, since we've already pushed the result (it's - * a list, not an object) + * a list, not an object) */ return; @@ -4031,9 +4031,9 @@ void bifgetobj(bifcxdef *ctx, int argc) /* * parseNounList - parse a noun list. Call like this: - * + * * parserParseNounList(wordlist, typelist, starting_index, complain, - * multi, check_actor); + * multi, check_actor); */ void bifparsenl(bifcxdef *ctx, int argc) { @@ -4047,8 +4047,8 @@ void bifparsenl(bifcxdef *ctx, int argc) /* * parserTokenize - given a string, produce a list of tokens. Returns * nil on error, or a list of token strings. - * - * parserTokenize(commandString); + * + * parserTokenize(commandString); */ void bifprstok(bifcxdef *ctx, int argc) { @@ -4062,8 +4062,8 @@ void bifprstok(bifcxdef *ctx, int argc) /* * parserGetTokTypes - given a list of tokens (represented as strings), * get a corresponding list of token types. - * - * parserGetTokTypes(tokenList); + * + * parserGetTokTypes(tokenList); */ void bifprstoktyp(bifcxdef *ctx, int argc) { @@ -4077,8 +4077,8 @@ void bifprstoktyp(bifcxdef *ctx, int argc) /* * parserDictLookup - given a list of tokens and their types, produce a * list of all of the objects that match all of the words. - * - * parserDictLookup(tokenList, typeList); + * + * parserDictLookup(tokenList, typeList); */ void bifprsdict(bifcxdef *ctx, int argc) { @@ -4092,9 +4092,9 @@ void bifprsdict(bifcxdef *ctx, int argc) /* * parserResolveObjects - resolve an object list of the sort returned by * parseNounList. Validates and disambiguates the objects. - * + * * parserResolveObjects(actor, verb, prep, otherobj, usageType, - * verprop, tokenList, objList, silent) + * verprop, tokenList, objList, silent) */ void bifprsrslv(bifcxdef *ctx, int argc) { @@ -4107,7 +4107,7 @@ void bifprsrslv(bifcxdef *ctx, int argc) /* * parserReplaceCommand - replace the current command line with a new - * string. Aborts the current command. + * string. Aborts the current command. */ void bifprsrplcmd(bifcxdef *ctx, int argc) { @@ -4119,7 +4119,7 @@ void bifprsrplcmd(bifcxdef *ctx, int argc) } /* - * exitobj - throw a RUNEXITOBJ error + * exitobj - throw a RUNEXITOBJ error */ void bifexitobj(bifcxdef *ctx, int argc) { @@ -4131,7 +4131,7 @@ void bifexitobj(bifcxdef *ctx, int argc) } /* - * Standard system button labels for bifinpdlg() + * Standard system button labels for bifinpdlg() */ #define BIFINPDLG_LBL_OK 1 #define BIFINPDLG_LBL_CANCEL 2 @@ -4139,7 +4139,7 @@ void bifexitobj(bifcxdef *ctx, int argc) #define BIFINPDLG_LBL_NO 4 /* - * inputdialog + * inputdialog */ void bifinpdlg(bifcxdef *ctx, int argc) { @@ -4183,12 +4183,12 @@ void bifinpdlg(bifcxdef *ctx, int argc) { /* we're not using standard buttons */ std_btns = 0; - + /* get the response string list */ p = runpoplst(ctx->bifcxrun); len = osrp2(p); p += 2; - + /* build our internal button list */ for (bcnt = 0, dst = lblbuf ; len != 0 ; lstadv(&p, &len)) { @@ -4201,10 +4201,10 @@ void bifinpdlg(bifcxdef *ctx, int argc) /* translate from internal to local characters */ for (xp = dst ; *xp != '\0' ; xp++) *xp = (char)cmap_i2n(*xp); - + /* set this button to point to the converted text */ labels[bcnt++] = dst; - + /* move past this label in the button buffer */ dst += strlen(dst) + 1; } @@ -4212,7 +4212,7 @@ void bifinpdlg(bifcxdef *ctx, int argc) { int id; int resid; - + /* it's a standard system label ID - get the ID */ id = (int)osrp4s(p + 1); @@ -4222,15 +4222,15 @@ void bifinpdlg(bifcxdef *ctx, int argc) case BIFINPDLG_LBL_OK: resid = RESID_BTN_OK; break; - + case BIFINPDLG_LBL_CANCEL: resid = RESID_BTN_CANCEL; break; - + case BIFINPDLG_LBL_YES: resid = RESID_BTN_YES; break; - + case BIFINPDLG_LBL_NO: resid = RESID_BTN_NO; break; @@ -4240,7 +4240,7 @@ void bifinpdlg(bifcxdef *ctx, int argc) break; } - /* + /* * if we got a valid resource ID, load the resource; * otherwise, skip this button */ @@ -4255,7 +4255,7 @@ void bifinpdlg(bifcxdef *ctx, int argc) dst += strlen(dst) + 1; } } - + /* if we have exhausted our label array, stop now */ if (bcnt >= sizeof(labels)/sizeof(labels[0]) || dst >= lblbuf + sizeof(lblbuf)) @@ -4294,7 +4294,7 @@ void bifinpdlg(bifcxdef *ctx, int argc) } /* - * Determine if a resource exists + * Determine if a resource exists */ void bifresexists(bifcxdef *ctx, int argc) { @@ -4303,7 +4303,7 @@ void bifresexists(bifcxdef *ctx, int argc) appctxdef *appctx; int found; runsdef val; - + /* check for proper arguments */ bifcntargs(ctx, 1, argc); @@ -4311,12 +4311,12 @@ void bifresexists(bifcxdef *ctx, int argc) p = runpopstr(ctx->bifcxrun); bifcstr(ctx, resname, (size_t)sizeof(resname), p); - /* + /* * if we have a host application context, and it provides a resource * finder function, ask the resource finder if the resource is * available; otherwise, report that the resource is not loadable, * since we must not be running a version of the interpreter that - * supports external resource loading + * supports external resource loading */ appctx = ctx->bifcxappctx; found = (appctx != 0 diff --git a/engines/glk/tads/tads2/built_in.h b/engines/glk/tads/tads2/built_in.h index 2b6efcc5de7..949d04accdf 100644 --- a/engines/glk/tads/tads2/built_in.h +++ b/engines/glk/tads/tads2/built_in.h @@ -81,7 +81,7 @@ struct bifcxdef { /* * argument list checking routines - can be disabled for faster - * run-time + * run-time */ /* check for proper number of arguments */ diff --git a/engines/glk/tads/tads2/character_map.cpp b/engines/glk/tads/tads2/character_map.cpp index 4cf24c86d62..623b1a26505 100644 --- a/engines/glk/tads/tads2/character_map.cpp +++ b/engines/glk/tads/tads2/character_map.cpp @@ -35,7 +35,7 @@ namespace TADS2 { /* ------------------------------------------------------------------------ */ /* - * Global variables for character mapping tables + * Global variables for character mapping tables */ unsigned char G_cmap_input[256]; @@ -44,20 +44,20 @@ char G_cmap_id[5]; char G_cmap_ldesc[CMAP_LDESC_MAX_LEN + 1]; -/* - * static variables +/* + * static variables */ -/* +/* * flag: true -> a character set has been explicitly loaded, so we - * should ignore any game character set setting + * should ignore any game character set setting */ static int S_cmap_loaded; /* ------------------------------------------------------------------------ */ /* - * Initialize the default character mappings + * Initialize the default character mappings */ void cmap_init_default(void) { @@ -83,7 +83,7 @@ void cmap_init_default(void) /* ------------------------------------------------------------------------ */ /* - * Internal routine to load a character map from a file + * Internal routine to load a character map from a file */ static int cmap_load_internal(char *filename) { @@ -103,7 +103,7 @@ static int cmap_load_internal(char *filename) /* return success */ return 0; } - + /* open the file */ fp = osfoprb(filename, OSFTCMAP); if (fp == 0) @@ -170,9 +170,9 @@ static int cmap_load_internal(char *filename) sysblk = FALSE; } - /* + /* * call the OS code, so that it can do any system-dependent - * initialization for the new character mapping + * initialization for the new character mapping */ os_advise_load_charmap(G_cmap_id, G_cmap_ldesc, sysblk ? buf : ""); @@ -192,12 +192,12 @@ static int cmap_load_internal(char *filename) size_t blen; unsigned int cval; char expansion[CMAP_MAX_ENTITY_EXPANSION]; - + /* read the next item's length and character value */ if (osfrb(fp, buf, 4)) { osfcls(fp); - return 9; + return 9; } /* decode the values */ @@ -221,7 +221,7 @@ static int cmap_load_internal(char *filename) } } - /* + /* * ignore anything else we find - if the file format is updated to * include extra information in the future, and this old code tries * to load an updated file, we'll just ignore the new information, @@ -240,20 +240,20 @@ static int cmap_load_internal(char *filename) * Explicitly load a character set from a file. This character set * mapping will override any implicit character set mapping that we read * from a game file. This should be called when the player explicitly - * loads a character set (via a command line option or similar action). + * loads a character set (via a command line option or similar action). */ int cmap_load(char *filename) { int err; - + /* try loading the file */ if ((err = cmap_load_internal(filename)) != 0) return err; - /* + /* * note that we've explicitly loaded a character set, if they named * a character set (if not, this simply establishes the default - * setting, so we haven't explicitly loaded anything) + * setting, so we haven't explicitly loaded anything) */ if (filename != 0) S_cmap_loaded = TRUE; @@ -266,14 +266,14 @@ int cmap_load(char *filename) /* ------------------------------------------------------------------------ */ /* * Explicitly override any game character set and use no character set - * instead. + * instead. */ void cmap_override(void) { /* apply the default mapping */ cmap_init_default(); - /* + /* * pretend we have a character map loaded, so that we don't try to * load another one if the game specifies a character set */ @@ -284,15 +284,15 @@ void cmap_override(void) /* ------------------------------------------------------------------------ */ /* * Set the game's internal character set. This is called when a game is - * loaded, and the game specifies a character set. + * loaded, and the game specifies a character set. */ void cmap_set_game_charset(errcxdef *ec, char *internal_id, char *internal_ldesc, char *argv0) { char filename[OSFNMAX]; - - /* + + /* * If a character set is already explicitly loaded, ignore the * game's character set - the player asked us to use a particular * mapping, so ignore what the game wants. (This will probably @@ -300,16 +300,16 @@ void cmap_set_game_charset(errcxdef *ec, * the player is most likely to use this to avoid errors when an * appropriate mapping file for the game is not available. In this * case, the player informs us by setting the option that he or she - * knows and accepts that the game will not look exactly right.) + * knows and accepts that the game will not look exactly right.) */ if (S_cmap_loaded) return; - /* + /* * ask the operating system to name the mapping file -- this routine * will determine, if possible, the current native character set, * and apply a system-specific naming convention to tell us what - * mapping file we should open + * mapping file we should open */ os_gen_charmap_filename(filename, internal_id, argv0); @@ -330,7 +330,7 @@ void cmap_set_game_charset(errcxdef *ec, * mapping file for the new character set isn't available. So, we * may need to provide the same explanation later that we needed to * provide here. Save the game's character set ldesc for that - * eventuality, since it describes exactly what the *game* wanted. + * eventuality, since it describes exactly what the *game* wanted. */ strcpy(G_cmap_ldesc, internal_ldesc); } diff --git a/engines/glk/tads/tads2/character_map.h b/engines/glk/tads/tads2/character_map.h index 589cf3fef78..1fdb9dd1713 100644 --- a/engines/glk/tads/tads2/character_map.h +++ b/engines/glk/tads/tads2/character_map.h @@ -33,7 +33,7 @@ struct errcxdef; /* * Initialize the default character mappings. If no mapping file is to * be read, this function will establish identify mappings that leave - * characters untranslated. + * characters untranslated. */ void cmap_init_default(void); @@ -47,7 +47,7 @@ int cmap_load(char *filename); /* * Turn off character translation. This overrides any game character - * set that we find and simply uses the default translation. + * set that we find and simply uses the default translation. */ void cmap_override(void); @@ -62,10 +62,10 @@ void cmap_override(void); * already been explicitly loaded, since an explicitly-loaded character * set overrides the automatic character set selection that we attempt * when loading a game. - * + * * argv0 must be provided so that we know where to look for our mapping * file on systems where mapping files are stored in the same directory - * as the TADS executables. + * as the TADS executables. */ void cmap_set_game_charset(struct errcxdef *errctx, char *internal_id, char *internal_ldesc, @@ -74,7 +74,7 @@ void cmap_set_game_charset(struct errcxdef *errctx, /* ------------------------------------------------------------------------ */ /* - * Mapping macros + * Mapping macros */ /* map a native character (read externally) into an internal character */ @@ -87,18 +87,18 @@ void cmap_set_game_charset(struct errcxdef *errctx, /* ------------------------------------------------------------------------ */ /* * Global character mapping tables. The character map is established at - * start-up. + * start-up. */ -/* +/* * input-mapping table - for native character 'n', cmap_input[n] yields - * the internal character code + * the internal character code */ extern unsigned char G_cmap_input[256]; /* * output-mapping table - for internal character 'n', cmap_output[n] - * yields the output character code + * yields the output character code */ extern unsigned char G_cmap_output[256]; @@ -110,15 +110,15 @@ extern char G_cmap_id[5]; extern char G_cmap_ldesc[CMAP_LDESC_MAX_LEN + 1]; /* - * Maximum expansion for an HTML entity mapping + * Maximum expansion for an HTML entity mapping */ #define CMAP_MAX_ENTITY_EXPANSION 50 /* ------------------------------------------------------------------------ */ -/* +/* * Signatures for character map files. The signature is stored at the - * beginning of the file. + * beginning of the file. */ /* single-byte character map version 1.0.0 */ diff --git a/engines/glk/tads/tads2/command_line.cpp b/engines/glk/tads/tads2/command_line.cpp index 3e62f8e616c..d5ec617444b 100644 --- a/engines/glk/tads/tads2/command_line.cpp +++ b/engines/glk/tads/tads2/command_line.cpp @@ -34,13 +34,13 @@ int cmdtog(errcxdef *ec, int prv, char *argp, int ofs, { case '+': return(TRUE); - + case '-': return(FALSE); - + case '\0': return(!prv); - + default: /* invalid - display usage if we have a callback for it */ if (usagefn != 0) @@ -56,23 +56,23 @@ char *cmdarg(errcxdef *ec, char ***argpp, int *ip, int argc, int ofs, { char *ret; - /* + /* * check to see if the argument is appended directly to the option; - * if not, look at the next string + * if not, look at the next string */ ret = (**argpp) + ofs + 1; if (*ret == '\0') { - /* + /* * it's not part of this string - get the argument from the next - * string in the vector + * string in the vector */ ++(*ip); ++(*argpp); ret = (*ip >= argc ? 0 : **argpp); } - /* + /* * if we didn't find the argument, it's an error - display usage if * we have a valid usage callback */ diff --git a/engines/glk/tads/tads2/command_line.h b/engines/glk/tads/tads2/command_line.h index 3a23f41eb94..c9768bdec06 100644 --- a/engines/glk/tads/tads2/command_line.h +++ b/engines/glk/tads/tads2/command_line.h @@ -43,7 +43,7 @@ namespace TADS2 { * including the '-') in this option flag; most options will have ofs==1 * since they are of the form '-x'. usagefn is a function to call if * the parsing fails; it is not expected to return, but should signal an - * error instead. + * error instead. */ char *cmdarg(errcxdef *ec, char ***argpp, int *ip, int argc, int ofs, void (*usagefn)(errcxdef*)); @@ -58,7 +58,7 @@ char *cmdarg(errcxdef *ec, char ***argpp, int *ip, int argc, * TRUE; if it's followed by '-', the value is FALSE; if followed by * nothing, the option is the logical inverse of the previous value. If * it's followed by any other character, we call the usage callback, - * which is not expected to return, but should signal an error. + * which is not expected to return, but should signal an error. */ int cmdtog(struct errcxdef *ec, int prv, char *argp, int ofs, void (*usagefn)(errcxdef*)); diff --git a/engines/glk/tads/tads2/data.cpp b/engines/glk/tads/tads2/data.cpp index 8d9771fc680..024d2621302 100644 --- a/engines/glk/tads/tads2/data.cpp +++ b/engines/glk/tads/tads2/data.cpp @@ -56,7 +56,7 @@ uint datsiz(dattyp typ, const void *val) case DAT_FNADDR: case DAT_REDIR: return(2); - + case DAT_TPL: /* template is counted array of 10-byte entries, plus length byte */ return(1 + ((*(const uchar *)val) * VOCTPLSIZ)); diff --git a/engines/glk/tads/tads2/debug.cpp b/engines/glk/tads/tads2/debug.cpp index 9e92529aa0c..8f46a79242f 100644 --- a/engines/glk/tads/tads2/debug.cpp +++ b/engines/glk/tads/tads2/debug.cpp @@ -62,7 +62,7 @@ void dbgent(dbgcxdef *ctx, runsdef *bp, objnum self, objnum target, prpnum prop, int binum, int argc) { dbgfdef *p; - + ++(ctx->dbgcxdep); /* increment actual depth */ if (ctx->dbgcxfcn == DBGMAXFRAME) { @@ -102,21 +102,21 @@ void dbglv(dbgcxdef *ctx, int exittype) --(ctx->dbgcxdep); /* decrement actual depth */ if (ctx->dbgcxfcn) --(ctx->dbgcxfcn); /* decrement frame pointer */ - /* + /* * if we're in STEP OUT/OVER mode, and the target context is level * 0, and we're now at level 0, it means that we are stepping out of * a routine called directly by the system and the debugger is * supposed to break when that happens -- return to single-stepping * mode so that we break into the debugger the next time the system - * calls a method + * calls a method */ if ((ctx->dbgcxflg & DBGCXFSS) != 0 && (ctx->dbgcxflg & DBGCXFSO) != 0 && ctx->dbgcxsof == 0 && ctx->dbgcxdep == 0) { - /* + /* * stepping out/over at level 0 - go to normal single-step mode - * (clear the out/over flag) + * (clear the out/over flag) */ ctx->dbgcxflg &= ~DBGCXFSO; } @@ -161,7 +161,7 @@ int dbgnam(dbgcxdef *ctx, char *outbuf, int typ, int val) memcpy(outbuf, "", (size_t)17); return(17); } - + if (tokthfind((toktdef *)ctx->dbgcxtab, typ, val, &sym)) { memcpy(outbuf, sym.toksnam, (size_t)sym.tokslen); @@ -202,16 +202,16 @@ static void dbgpbval(dbgcxdef *ctx, dattyp typ, const uchar *val, sprintf(buf, "%ld", (long)osrp4s(val)); len = strlen(buf); break; - + case DAT_OBJECT: len = dbgnam(ctx, buf, TOKSTOBJ, osrp2(val)); break; - + case DAT_SSTRING: len = osrp2(val) - 2; p = (const char *)val + 2; break; - + case DAT_NIL: p = "nil"; len = 3; @@ -230,22 +230,22 @@ static void dbgpbval(dbgcxdef *ctx, dattyp typ, const uchar *val, (*dispfn)(dispctx, "]", 1); len = 0; break; - + case DAT_TRUE: p = "true"; len = 4; break; - + case DAT_FNADDR: (*dispfn)(dispctx, "&", 1); len = dbgnam(ctx, buf, TOKSTFUNC, osrp2(val)); break; - + case DAT_PROPNUM: (*dispfn)(dispctx, "&", 1); len = dbgnam(ctx, buf, TOKSTPROP, osrp2(val)); break; - + default: p = "[unknown type]"; len = 14; @@ -267,7 +267,7 @@ void dbgpval(dbgcxdef *ctx, runsdef *val, uint len; const uchar *p = buf; const char *typ = 0; - + switch(val->runstyp) { case DAT_NUMBER: @@ -275,18 +275,18 @@ void dbgpval(dbgcxdef *ctx, runsdef *val, len = strlen((char *)buf); typ = "number"; break; - + case DAT_OBJECT: len = dbgnam(ctx, (char *)buf, TOKSTOBJ, val->runsv.runsvobj); typ = "object"; break; - + case DAT_SSTRING: len = osrp2(val->runsv.runsvstr) - 2; p = val->runsv.runsvstr + 2; typ = "string"; break; - + case DAT_NIL: p = (const uchar *)"nil"; len = 3; @@ -307,22 +307,22 @@ void dbgpval(dbgcxdef *ctx, runsdef *val, len = 0; p = up; break; - } + } case DAT_TRUE: p = (const uchar *)"true"; len = 4; break; - + case DAT_FNADDR: len = dbgnam(ctx, (char *)buf, TOKSTFUNC, val->runsv.runsvobj); typ = "function pointer"; break; - + case DAT_PROPNUM: len = dbgnam(ctx, (char *)buf, TOKSTPROP, val->runsv.runsvprp); typ = "property pointer"; break; - + default: p = (const uchar *)"[unknown type]"; len = 14; @@ -342,11 +342,11 @@ void dbgpval(dbgcxdef *ctx, runsdef *val, (*dispfn)(dispctx, "'", 1); } - /* + /* * if possible, null-terminate the buffer - do this only if the * length is actually within the buffer, which won't be the case if * the text comes from someplace outside the buffer (which is the - * case if it's a string, for example) + * case if it's a string, for example) */ if (len < sizeof(buf)) buf[len] = '\0'; @@ -417,7 +417,7 @@ void dbgstktr(dbgcxdef *ctx, *p++ = '.'; p += dbgnam(ctx, p, TOKSTPROP, (int)f->dbgfprop); } - + /* display what we have so far */ *p++ = '\0'; (*dispfn)(dispctx, buf, (int)strlen(buf)); @@ -433,7 +433,7 @@ void dbgstktr(dbgcxdef *ctx, } (*dispfn)(dispctx, ")", 1); } - + /* send out a newline, then move on to next frame */ (*dispfn)(dispctx, "\n", 1); @@ -469,10 +469,10 @@ void dbglget(dbgcxdef *ctx, uchar *buf) dbglgetlvl(ctx, buf, 0); } -/* +/* * Get information about a source line at a particular stack level into * the buffer; leaves out frame info. level 0 is the currently - * executing line, 1 is the first enclosing level, and so on. + * executing line, 1 is the first enclosing level, and so on. */ int dbglgetlvl(dbgcxdef *ctx, uchar *buf, int level) { @@ -489,7 +489,7 @@ int dbglgetlvl(dbgcxdef *ctx, uchar *buf, int level) /* if we're in an intrinsic, go to enclosing frame */ if (fr->dbgftarg == MCMONINV) --fr; - + /* make sure we've encountered an OPCLINE in this frame */ if (fr->dbgflin == 0) return 1; @@ -499,7 +499,7 @@ int dbglgetlvl(dbgcxdef *ctx, uchar *buf, int level) linrec = obj + fr->dbgflin; memcpy(buf, linrec + 3, (size_t)(*linrec - 3)); - + /* no longer need the target object locked */ mcmunlck(ctx->dbgcxmem, (mcmon)fr->dbgftarg); @@ -511,7 +511,7 @@ int dbglgetlvl(dbgcxdef *ctx, uchar *buf, int level) void dbgclin(tokcxdef *tokctx, objnum objn, uint ofs) { uchar buf[4]; - + /* package the information and send it to the line source */ oswp2(buf, objn); oswp2(buf + 2, ofs); diff --git a/engines/glk/tads/tads2/debug.h b/engines/glk/tads/tads2/debug.h index 2bad916dd6c..f206c1b1a65 100644 --- a/engines/glk/tads/tads2/debug.h +++ b/engines/glk/tads/tads2/debug.h @@ -126,7 +126,7 @@ struct dbgcxdef uint dbgcxhstl; /* history buffer length */ uint dbgcxhstf; /* offset of next free byte of history */ - /* + /* * This member is for the use of the user interface code. If the * user interface implementation needs to store additional context, * it can allocate a structure of its own (it should probably do @@ -136,7 +136,7 @@ struct dbgcxdef * recover its extra context information by following this pointer * and casting it to its private structure type. The TADS code * won't do anything with this pointer except initialize it to null - * when initializing the debugger context. + * when initializing the debugger context. */ void *dbgcxui; }; @@ -147,14 +147,14 @@ typedef struct dbgcxdef dbgcxdef; /* * Compiler interface. These routines are called by the compiler to * inform the debug record generator about important events as - * compilation proceeds. + * compilation proceeds. */ /* * Tell the current line source that we're compiling an executable * line, and tell it the object number and offset of the code within the - * object. + * object. */ void dbgclin(struct tokcxdef *tokctx, objnum objn, uint ofs); @@ -176,7 +176,7 @@ void dbgclin(struct tokcxdef *tokctx, objnum objn, uint ofs); * executable that isn't linked with the debugger. If this returns * true, dbgucmd() must not have a trivial implementation -- dbgucmd() * must at least let the user quit out of the game. - * + * * This can be switched at either link time or compile time. If DBG_OFF * is defined, we'll force this to return false; otherwise, we'll let * the program define the appropriate implementation through the linker. @@ -190,12 +190,12 @@ int dbgpresent(); /* add a debug tracing record */ /* void dbgenter(dbgcxdef *ctx, runsdef *bp, objnum self, objnum target, - prpnum prop, int binum, int argc); */ + prpnum prop, int binum, int argc); */ /* tell debugger where the current line's local frame table is located */ /* void dbgframe(dbgcxdef *ctx, uint ofsfr, ofslin); */ -/* +/* * Single-step interrupt: the run-time has reached a new source line. * ofs is the offset from the start of the object of the line record, * and p is the current execution pointer. *p can be changed upon @@ -227,7 +227,7 @@ void dbgaddhist(dbgcxdef *ctx, char *buf, int bufl); /* * Find a base pointer, given the object+offset of the frame. If the * frame is not active, this routine signals ERR_INACTFR; otherwise, the - * bp value for the frame is returned. + * bp value for the frame is returned. */ struct runsdef *dbgfrfind(dbgcxdef *ctx, objnum frobj, uint frofs); @@ -236,7 +236,7 @@ struct runsdef *dbgfrfind(dbgcxdef *ctx, objnum frobj, uint frofs); /* * User Interface Support routines. These routines are called by the * user interface layer to get information from the debugger and perform - * debugging operations. + * debugging operations. */ @@ -252,7 +252,7 @@ void dbglget(dbgcxdef *ctx, uchar *buf); /* * Get information about a line in an enclosing stack frame. Level 0 is * the current line, level 1 is the first enclosing frame, and so on. - * Returns 0 on success, non-zero if the frame level is invalid. + * Returns 0 on success, non-zero if the frame level is invalid. */ int dbglgetlvl(dbgcxdef *ctx, uchar *buf, int level); @@ -263,26 +263,26 @@ int dbglgetlvl(dbgcxdef *ctx, uchar *buf, int level); * the error number is returned. bpnum returns with the breakpoint * number if err == 0. If the condition string is given (and is not an * empty string), the condition is compiled in the scope of the - * breakpoint and attached as the breakpoint condition. + * breakpoint and attached as the breakpoint condition. */ int dbgbpset(dbgcxdef *ctx, char *addr, int *bpnum); -/* +/* * Set a breakpoint at an object + offset location. If 'toggle' is * true, and there's already a breakpoint at the given location, we'll * clear the breakpoint; in this case, *did_set will return false to * indicate that an existing breakpoint was cleared rather than a new * breakpoint created. *did_set will return true if a new breakpoint - * was set. + * was set. */ int dbgbpat(dbgcxdef *ctx, objnum objn, objnum self, uint ofs, int *bpnum, char *bpname, int toggle, char *condition, int *did_set); -/* +/* * Set a breakpoint at an object + offset location, optionally with a * condition, using an existing breakpoint slot. If the slot is already - * in use, we'll return an error. + * in use, we'll return an error. */ int dbgbpatid(dbgcxdef *ctx, int bpnum, objnum target, objnum self, uint ofs, char *bpname, int toggle, char *cond, @@ -292,18 +292,18 @@ int dbgbpatid(dbgcxdef *ctx, int bpnum, objnum target, objnum self, * Determine if there's a breakpoint at a given code location. Fills in * *bpnum with the breakpoint identifier and returns true if a * breakpoint is found at the given location; returns false if there are - * no breakpoints matching the description. + * no breakpoints matching the description. */ int dbgisbp(dbgcxdef *ctx, objnum target, objnum self, uint ofs, int *bpnum); /* - * Determine if the given breakpoint is enabled + * Determine if the given breakpoint is enabled */ int dbgisbpena(dbgcxdef *ctx, int bpnum); /* * Delete a breakpoint by breakpoint number (as returned from - * dbgbpset). Returns error number, or 0 for success. + * dbgbpset). Returns error number, or 0 for success. */ int dbgbpdel(dbgcxdef *ctx, int bpnum); @@ -314,7 +314,7 @@ int dbgbpdis(dbgcxdef *ctx, int bpnum, int disable); * Set a new condition for the given breakpoint. Replaces any existing * condition. If an error occurs, we'll leave the old condition as it * was and return a non-zero error code; on success, we'll update the - * condition and return zero. + * condition and return zero. */ int dbgbpsetcond(dbgcxdef *ctx, int bpnum, char *cond); @@ -333,19 +333,19 @@ void dbgbpeach(dbgcxdef *ctx, void (*fn)(void *, int, uchar *, uint), void *fnctx); -/* +/* * Get information on a specific breakpoint. Returns zero on success, - * non-zero on failure. + * non-zero on failure. */ int dbgbpgetinfo(dbgcxdef *ctx, int bpnum, char *descbuf, size_t descbuflen, char *condbuf, size_t condbuflen); -/* +/* * Evaluate an expression (a text string to be parsed) at a particular * stack context level; returns error number. Invokes the callback * function repeatedly to display the value string, and ends the display * with a newline. If showtype is true, we'll include a type name - * prefix, otherwise we'll simply display the value. + * prefix, otherwise we'll simply display the value. */ int dbgeval(dbgcxdef *ctx, char *expr, void (*dispfn)(void *dispctx, const char *str, int strl), @@ -360,7 +360,7 @@ int dbgeval(dbgcxdef *ctx, char *expr, * name to form the full subitem expression; for objects, it's ".", and * for lists it's null (because for lists the subitem names will include * brackets). 'speculative' is passed to dbgcompile; see the comments - * there for information on the purpose of this flag. + * there for information on the purpose of this flag. */ int dbgevalext(dbgcxdef *ctx, char *expr, void (*dispfn)(void *dispctx, const char *str, int strl), @@ -369,20 +369,20 @@ int dbgevalext(dbgcxdef *ctx, char *expr, int subnamelen, const char *relationship), void *aggctx, int speculative); -/* +/* * enumerate local variables at a given stack context level by calling - * the given function once for each local variable + * the given function once for each local variable */ void dbgenumlcl(dbgcxdef *ctx, int level, void (*func)(void *ctx, const char *lclnam, size_t lclnamlen), void *cbctx); -/* +/* * Compile an expression in a given frame context. Returns an error * number. Allocates a new object to contain the compiled code, and * returns the object number in *objn; the caller is responsible for * freeing the object when done with it. - * + * * If 'speculative' is set to true, we'll prohibit the expression from * making any assignments or calling any methods or functions. This * mode can be used to try compiling an expression that the user could @@ -393,7 +393,7 @@ void dbgenumlcl(dbgcxdef *ctx, int level, * hovering over some text for a few moments. In such cases, since the * user hasn't explicitly requested evaluation, it would be bad to make * any changes to game state, hence the prohibition of assignments or - * calls. + * calls. */ int dbgcompile(dbgcxdef *ctx, char *expr, dbgfdef *fr, objnum *objn, int speculative); @@ -428,11 +428,11 @@ void dbgswitch(struct lindef **linp, struct lindef *newlin); * to perform user interaction. */ -/* +/* * Debugger user interface initialization, phase one. TADS calls this * routine during startup, before reading the .GAM file, to let the user * interface perform any initialization it requires before the .GAM file - * is loaded. + * is loaded. */ void dbguini(dbgcxdef *ctx, const char *game_filename); @@ -440,7 +440,7 @@ void dbguini(dbgcxdef *ctx, const char *game_filename); * Debugger user interface initialization, phase two. TADS calls this * routine during startup, after read the .GAM file. The debugger user * interface code can perform any required initialization that depends - * on the .GAM file having been read. + * on the .GAM file having been read. */ void dbguini2(dbgcxdef *ctx); @@ -459,7 +459,7 @@ void dbguini2(dbgcxdef *ctx); * instruction pointer set back to the start of the line containing the * error, and will thus re-try the same line of code when the debugger * returns, unless the debugger explicitly moves the instruction pointer - * before returning. + * before returning. */ int dbgu_err_resume(dbgcxdef *ctx); @@ -470,7 +470,7 @@ int dbgu_err_resume(dbgcxdef *ctx); * path to the file in fullname. The debugger calls this after it * exhausts all of its other methods of finding a source file (such as * searching the include path). - * + * * Return true if the source file should be considered valid, false if * not. Most implementations will simply return true if the file was * found, false if not; however, this approach will cause the debugger @@ -479,23 +479,23 @@ int dbgu_err_resume(dbgcxdef *ctx); * implementations, in particular GUI implementations, may wish to wait * to find a file until the file is actually needed, rather than pester * the user with file search dialogs repeatedly at start-up. - * + * * must_find_file specifies how to respond if we can't find the file. * If must_find_file is true, we should always return false if we can't * find the file. If must_find_file is false, however, we can * optionally return true even if we can't find the file. Doing so * indicates that the debugger UI will defer locating the file until it * is actually needed. - * + * * If this routine returns true without actually finding the file, it * should set fullname[0] to '\0' to indicate that fullname doesn't - * contain a valid filename. + * contain a valid filename. */ int dbgu_find_src(const char *origname, int origlen, char *fullname, size_t full_len, int must_find_file); -/* +/* * Debugger user interface main command loop. If err is non-zero, the * debugger was entered because a run-time error occurred; otherwise, if * bphit is non-zero, it's the number of the breakpoint that was @@ -504,7 +504,7 @@ int dbgu_find_src(const char *origname, int origlen, * target object of the next instruction to be executed. This can be * changed upon return, in which case execution will continue from the * new offset, but the offset must be within the same method of the same - * object (or within the same function) as it was upon entry. + * object (or within the same function) as it was upon entry. */ void dbgucmd(dbgcxdef *ctx, int bphit, int err, unsigned int *exec_ofs); @@ -516,21 +516,21 @@ void dbgucmd(dbgcxdef *ctx, int bphit, int err, unsigned int *exec_ofs); * If the debugger wants to restart the game, it should call bifrst(). * If this routine returns without signalling a RUN_RESTART error, TADS * will terminate. If a RUN_RESTART error is signalled, TADS will - * resume the play loop. + * resume the play loop. */ void dbguquitting(dbgcxdef *ctx); -/* +/* * debugger user interface termination - this routine is called when the * debugger is about to terminate, so that the user interface can close - * itself down (close windows, release memory, etc) + * itself down (close windows, release memory, etc) */ void dbguterm(dbgcxdef *ctx); /* * Debugger user interface: display an error. This is called mainly so * that the debugger can display an error using special output - * formatting if the error occurs while debugging. + * formatting if the error occurs while debugging. */ void dbguerr(dbgcxdef *ctx, int errnum, char *msg); @@ -542,7 +542,7 @@ void trcsho(void); /* ======================================================================== */ /* * optional debugger macros - these compile to nothing when compiling a - * version for use without the debugger + * version for use without the debugger */ #ifdef DBG_OFF diff --git a/engines/glk/tads/tads2/error.cpp b/engines/glk/tads/tads2/error.cpp index e06f9128614..3ed5c54681e 100644 --- a/engines/glk/tads/tads2/error.cpp +++ b/engines/glk/tads/tads2/error.cpp @@ -60,7 +60,7 @@ int errfmt(char *outbuf, int outbufl, const char *fmt, int argc, const erradef * break; } break; - + case '%': ++fmt; fmtchar = *fmt; @@ -70,23 +70,23 @@ int errfmt(char *outbuf, int outbufl, const char *fmt, int argc, const erradef * case '\0': --fmt; break; - + case '%': p = "%"; len = 1; break; - + case 'd': sprintf(buf, "%d", argv[argi].erraint); len = strlen(buf); p = buf; break; - + case 's': p = argv[argi].errastr; len = strlen(p); break; - + case 't': { int i; @@ -108,7 +108,7 @@ int errfmt(char *outbuf, int outbufl, const char *fmt, int argc, const erradef * { TOKTEQ, "'='" }, { 0, (const char *)nullptr } }; - + for (i = 0 ; toklist[i].toknam ; ++i) { if (toklist[i].tokid == argv[argi].erraint) @@ -122,7 +122,7 @@ int errfmt(char *outbuf, int outbufl, const char *fmt, int argc, const erradef * len = strlen(p); break; } - + default: p = ""; len = 0; @@ -131,7 +131,7 @@ int errfmt(char *outbuf, int outbufl, const char *fmt, int argc, const erradef * } ++argi; break; - + default: p = fmt; len = 1; @@ -156,7 +156,7 @@ int errfmt(char *outbuf, int outbufl, const char *fmt, int argc, const erradef * } ++fmt; } - + if (outbufl) *outbuf++ = '\0'; return(outlen); } diff --git a/engines/glk/tads/tads2/error.h b/engines/glk/tads/tads2/error.h index 96831068d77..096da12dcf8 100644 --- a/engines/glk/tads/tads2/error.h +++ b/engines/glk/tads/tads2/error.h @@ -25,7 +25,7 @@ * handle exceptions.A macro is provided which signals an error, which * does a non - local goto to the innermost enclosing exception handler. * A set of macros sets up exception handling code. - * + * * To catch exceptions that occur inside a block of code(i.e., in the * code or in any subroutines called by the code), begin the block with * ERRBEGIN.At the end of the protected code, place the exception @@ -33,7 +33,7 @@ * handler, place ERREND.If no exception occurs, execution goes * through the protected code, then resumes at the code following * the ERREND. - * + * * The exception handler can signal another error, which will cause * the next enclosing frame to catch the error.Alternatively, if * the exception handler doesn't signal an error or return, execution @@ -41,14 +41,14 @@ * signalled during exception handling will be caught by the next * enclosing frame, unless the exception handler code is itself * protected by another ERRBEGIN - ERREND block. - * + * * To signal an error, use errsig(). - * + * * To use a string argument in a signalled error, cover the string * with errstr(ctx, str, len); for example: - * + * * errsig1(ctx, ERR_XYZ, ERRTSTR, errstr(ctx, buf, strlen(buf))); - * + * * This copies the string into a buffer that is unaffected by * stack resetting during error signalling. */ @@ -64,7 +64,7 @@ namespace TADS2 { /* * for compatility with old facility-free mechanism, signal with - * facility "TADS" + * facility "TADS" */ #define errsig(ctx, err) errsigf(ctx, "TADS", err) #define errsig1(c, e, t, a) errsigf1(c,"TADS",e,t,a) @@ -378,7 +378,7 @@ namespace TADS2 { /* * Special error flag - this is returned from execmd() when preparseCmd * returns a command list. This indicates to voc1cmd that it should try - * the command over again, using the words in the new list. + * the command over again, using the words in the new list. */ #define ERR_PREPRSCMDREDO 30000 /* preparseCmd returned a list */ #define ERR_PREPRSCMDCAN 30001 /* preparseCmd returned 'nil' to cancel */ diff --git a/engines/glk/tads/tads2/error_handling.cpp b/engines/glk/tads/tads2/error_handling.cpp index 124bd7f762f..d4231a44b2f 100644 --- a/engines/glk/tads/tads2/error_handling.cpp +++ b/engines/glk/tads/tads2/error_handling.cpp @@ -60,7 +60,7 @@ int errfmt(char *outbuf, int outbufl, char *fmt, int argc, erradef *argv) break; } break; - + case '%': ++fmt; fmtchar = *fmt; @@ -71,29 +71,29 @@ int errfmt(char *outbuf, int outbufl, char *fmt, int argc, erradef *argv) --fmt; len = 0; break; - + case '%': p = "%"; len = 1; break; - + case 'd': sprintf(buf, "%d", argv[argi].erraint); len = strlen(buf); p = buf; break; - + case 'u': sprintf(buf, "%u", argv[argi].erraint); len = strlen(buf); p = buf; break; - + case 's': p = argv[argi].errastr; len = strlen(p); break; - + default: p = ""; len = 0; @@ -102,7 +102,7 @@ int errfmt(char *outbuf, int outbufl, char *fmt, int argc, erradef *argv) } ++argi; break; - + default: p = fmt; len = 1; @@ -168,7 +168,7 @@ void errsigf(errcxdef *ctx, const char *facility, int e) char *errstr(errcxdef *ctx, const char *str, int len) { char *ret = &ctx->errcxbuf[ctx->errcxofs]; - + memcpy(ret, str, (size_t)len); ret[len] = '\0'; ctx->errcxofs += len + 1; diff --git a/engines/glk/tads/tads2/error_handling.h b/engines/glk/tads/tads2/error_handling.h index fc30084a176..221e8c4c6cf 100644 --- a/engines/glk/tads/tads2/error_handling.h +++ b/engines/glk/tads/tads2/error_handling.h @@ -24,12 +24,12 @@ * All of the functions and macros in here are named ERRxxx because * this file was based on the TADS err.h, which used the ERRxxx naming * convention, and it would be a lot of trouble to change. - * + * * This package defines a set of macros that allows code to raise and * handle exceptions. A macro is provided which signals an error, which * does a non-local goto to the innermost enclosing exception handler. * A set of macros sets up exception handling code. - * + * * To catch exceptions that occur inside a block of code (i.e., in the * code or in any subroutines called by the code), begin the block with * ERRBEGIN. At the end of the protected code, place the exception @@ -37,7 +37,7 @@ * handler, place ERREND. If no exception occurs, execution goes * through the protected code, then resumes at the code following * the ERREND. - * + * * The exception handler can signal another error, which will cause * the next enclosing frame to catch the error. Alternatively, if * the exception handler doesn't signal an error or return, execution @@ -45,14 +45,14 @@ * signalled during exception handling will be caught by the next * enclosing frame, unless the exception handler code is itself * protected by another ERRBEGIN-ERREND block. - * + * * To signal an error, use errsig(). - * + * * To use a string argument in a signalled error, cover the string * with errstr(ctx, str, len); for example: - * + * * errsig1(ctx, ERR_XYZ, ERRTSTR, errstr(ctx, buf, strlen(buf))); - * + * * This copies the string into a buffer that is unaffected by * stack resetting during error signalling. */ @@ -133,12 +133,12 @@ struct errcxdef { assert(2==2 && (ctx)->errcxptr != fr_.errprv); \ (e) = fr_.errcode; \ (ctx)->errcxptr = fr_.errprv; - + /* retrieve argument (int, string) in current error frame */ #define errargint(argnum) (fr_.erraav[argnum].erraint) #define errargstr(argnum) (fr_.erraav[argnum].errastr) - + #define ERREND(ctx) \ } \ } @@ -171,7 +171,7 @@ struct errcxdef { #ifdef ERR_NO_MACRO char *errstr(errcxdef *ctx, const char *str, int len); #else /* ERR_NO_MACRO */ - + #define errstr(ctx,str,len) \ ((memcpy(&(ctx)->errcxbuf[(ctx)->errcxofs],str,(size_t)len), \ (ctx)->errcxofs += (len), \ @@ -209,7 +209,7 @@ void errsigf(errcxdef *ctx, const char *facility, int err); #else /* ERR_NO_MACRO */ #define errsigf(ctx, fac, e) (errargc(ctx,0),errsign(ctx,e,fac)) #endif /* ERR_NO_MACRO */ - + /* signal an error with one argument */ #define errsigf1(ctx, fac, e, typ1, arg1) \ (errargv(ctx,0,typ1,arg1),errargc(ctx,1),errsign(ctx,e,fac)) @@ -239,16 +239,16 @@ void errrse1(errcxdef *ctx, errdef *fr); * parameters from the error currently being handled to the enclosing * frame. This is useful when "keeping" an error being handled - i.e., * the arguments will continue to be used outside of the - * ERRCATCH..ERREND code. + * ERRCATCH..ERREND code. */ /* void errkeepargs(errcxdef *ctx); */ #define errkeepargs(ctx) errcopyargs(ctx, &fr_) -/* +/* * copy the parameters for an error from another frame into the current * frame - this can be used when we want to be able to display an error * that occurred in an inner frame within code that is protected by a - * new enclosing error frame + * new enclosing error frame */ /* void errcopyargs(errcxdef *ctx, errdef *fr); */ #define errcopyargs(ctx, fr) \ @@ -292,7 +292,7 @@ void errlogf(errcxdef *ctx, const char *facility, int err); /* log an error with one argument */ #define errlogf1(ctx, fac, e, typ1, arg1) \ (errargv(ctx,0,typ1,arg1),errargc(ctx,1),errlogn(ctx,e,fac)) - + /* log an error with two arguments */ #define errlogf2(ctx, fac, e, typ1, arg1, typ2, arg2) \ (errargv(ctx,0,typ1,arg1),errargv(ctx,1,typ2,arg2),\ @@ -310,10 +310,10 @@ void errlogf(errcxdef *ctx, const char *facility, int err); */ int errfmt(char *outbuf, int outbufl, char *fmt, int argc, erradef *argv); - + /* get the text of an error */ void errmsg(errcxdef *ctx, char *outbuf, uint outbufl, uint err); - + /* initialize error subsystem, opening error message file if necessary */ void errini(errcxdef *ctx, osfildef *fp); diff --git a/engines/glk/tads/tads2/error_message.cpp b/engines/glk/tads/tads2/error_message.cpp index ace36136254..1f383db3c92 100644 --- a/engines/glk/tads/tads2/error_message.cpp +++ b/engines/glk/tads/tads2/error_message.cpp @@ -29,7 +29,7 @@ namespace TADS2 { errcxdef *lerini() { errcxdef *errcx; /* error context */ - + // allocate an error context if (!(errcx = (errcxdef *)ltk_suballoc(sizeof(errcxdef)))) { // failure diff --git a/engines/glk/tads/tads2/execute_command.cpp b/engines/glk/tads/tads2/execute_command.cpp index 9ea8b135cb4..9fd82c029a2 100644 --- a/engines/glk/tads/tads2/execute_command.cpp +++ b/engines/glk/tads/tads2/execute_command.cpp @@ -27,15 +27,15 @@ * Executes a user command after it has been parsed * Notes * TADS 2.0 version - * + * * This module contains the implementation of the entire "turn" sequence, * which is: - * + * * preCommand(actor, verb, dobj-list, prep, iobj) * verb.verbAction(actor, do, prep, io) * actor.actorAction( verb, do, prep, io ) * actor.location.roomAction( actor, verb, do, prep, io ) - * if ( io ) + * if ( io ) * { * io.iobjCheck(actor, verb, dobj, prep) * if (io does not define verIo directly) @@ -66,12 +66,12 @@ * daemons * fuses * endCommand(actor, verb, dobj-list, prep, iobj, error_code) - * + * * If an 'exit' or 'exitobj' is encountered, we skip straight to the * daemons. If an abort is encountered, we skip to endCommand. If * askio, or askdo is encountered, we skip everything remaining. Under * any of these exit scenarios, we return success to our caller. - * + * * This module also contains code to set and remove fuses and daemons, * since they are part of the player turn sequence. * Returns @@ -92,7 +92,7 @@ namespace TADS2 { /* allocate and initialize a fuse/daemon/notifier array */ void vocinialo(voccxdef *ctx, vocddef **what, int cnt) { vocddef *p; - + *what = (vocddef *)mchalo(ctx->voccxerr, (cnt * sizeof(vocddef)), "vocinialo"); @@ -121,19 +121,19 @@ static void vocdusav(voccxdef *ctx, vocddef *what) uchar *p; objucxdef *uc = ctx->voccxundo; ushort siz = sizeof(what) + sizeof(*what) + 1; - + /* if we don't need to save undo, quit now */ if (uc == 0 || !objuok(uc)) return; /* reserve space for our record */ p = objures(uc, OBJUCLI, siz); - + /* set up our undo record */ *p = VOC_UNDO_DAEMON; memcpy(p + 1, &what, (size_t)sizeof(what)); memcpy(p + 1 + sizeof(what), what, (size_t)sizeof(*what)); - + uc->objucxhead += siz; } @@ -203,7 +203,7 @@ void vocdundo(void *ctx0, uchar *data) /* add the word */ vocadd2(ctx, data[0], objn, data[1], data+6, len1, data+6+len1, len2); - + /* remove this object from the word size */ wrdsiz -= 6 + len1 + len2; data += 6 + len1 + len2; @@ -301,13 +301,13 @@ struct delobj_cb_ctx /* * Iteration callback to write vocabulary words for an object being * deleted to an undo stream, so that they can be restored if the - * deletion is undone. + * deletion is undone. */ static void delobj_cb(void *ctx0, vocdef *voc, vocwdef *vocw) { struct delobj_cb_ctx *ctx = (struct delobj_cb_ctx *)ctx0; uchar *p = ctx->p; - + /* write this object's header to the stream */ p[0] = vocw->vocwtyp; p[1] = vocw->vocwflg; @@ -341,7 +341,7 @@ void vocdusave_delobj(voccxdef *ctx, objnum objn) /* * we need to store an additional 6 bytes (2-length1, 2-length2, - * 1-type, 1-flags) for each word + * 1-type, 1-flags) for each word */ wrdsiz += wrdcnt*6; @@ -405,7 +405,7 @@ void vocdusave_delwrd(voccxdef *ctx, objnum objn, prpnum typ, int flags, uc->objucxhead += 5 + wrdsiz; } - + /* set a fuse/daemon/notifier */ @@ -413,7 +413,7 @@ void vocsetfd(voccxdef *ctx, vocddef *what, objnum func, prpnum prop, uint tm, runsdef *val, int err) { int slots = 0; - + if (what == ctx->voccxdmn) slots = ctx->voccxdmc; else if (what == ctx->voccxalm) @@ -422,7 +422,7 @@ void vocsetfd(voccxdef *ctx, vocddef *what, objnum func, prpnum prop, slots = ctx->voccxfuc; else errsig(ctx->voccxerr, ERR_BADSETF); - + /* find a free slot, and set up our fuse/daemon */ for ( ; slots ; ++what, --slots) { @@ -430,7 +430,7 @@ void vocsetfd(voccxdef *ctx, vocddef *what, objnum func, prpnum prop, { /* save an undo record for this slot before changing */ vocdusav(ctx, what); - + /* record the information */ what->vocdfn = func; if (val != 0) @@ -438,9 +438,9 @@ void vocsetfd(voccxdef *ctx, vocddef *what, objnum func, prpnum prop, what->vocdprp = prop; what->vocdtim = tm; - /* + /* * the fuse/notifier/daemon is set - no need to look further - * for an open slot + * for an open slot */ return; } @@ -455,12 +455,12 @@ void vocremfd(voccxdef *ctx, vocddef *what, objnum func, prpnum prop, runsdef *val, int err) { int slots = 0; - + if (what == ctx->voccxdmn) slots = ctx->voccxdmc; else if (what == ctx->voccxalm) slots = ctx->voccxalc; else if (what == ctx->voccxfus) slots = ctx->voccxfuc; else errsig(ctx->voccxerr, ERR_BADREMF); - + /* find the slot with this same fuse/daemon/notifier, and remove it */ for ( ; slots ; ++what, --slots) { @@ -488,7 +488,7 @@ void vocremfd(voccxdef *ctx, vocddef *what, objnum func, prpnum prop, * not any that expire at the end of the last turn counted here. (If * incrementing by one turn only, no fuses will be executed.) If the * do_fuses flag is false, fuses are simply deleted if they burn down - * within the interval. + * within the interval. */ void vocturn(voccxdef *ctx, int turncnt, int do_fuses) { @@ -500,7 +500,7 @@ void vocturn(voccxdef *ctx, int turncnt, int do_fuses) { /* presume we won't find anything to execute */ do_exe = FALSE; - + /* go through notifiers, looking for fuse-type notifiers */ for (i = ctx->voccxalc, p = ctx->voccxalm ; i ; ++p, --i) { @@ -510,12 +510,12 @@ void vocturn(voccxdef *ctx, int turncnt, int do_fuses) { /* save an undo record for this slot before changing */ vocdusav(ctx, p); - + if (--(p->vocdtim) == 0) do_exe = TRUE; } } - + /* now go through the fuses */ for (i = ctx->voccxfuc, p = ctx->voccxfus ; i ; ++p, --i) { @@ -531,7 +531,7 @@ void vocturn(voccxdef *ctx, int turncnt, int do_fuses) /* * if we'll be doing more, and anything burned down, run - * current fuses before going on to the next turn + * current fuses before going on to the next turn */ if ((!do_fuses || turncnt) && do_exe) exefuse(ctx, do_fuses); @@ -559,10 +559,10 @@ static void exeperr(voccxdef *ctx, objnum verb, objnum dobj, runfn(ctx->voccxrun, ctx->voccxper2, 4); return; } - + vocerr(ctx, VOCERR(110), "I don't know how to "); runppr(ctx->voccxrun, verb, PRP_SDESC, 0); - + if (dobj != MCMONINV) { vocerr(ctx, VOCERR(111), " "); @@ -583,7 +583,7 @@ static void exeperr(voccxdef *ctx, objnum verb, objnum dobj, /* - * Execute daemons + * Execute daemons */ void exedaem(voccxdef *ctx) { @@ -598,13 +598,13 @@ void exedaem(voccxdef *ctx) if (daemon->vocdfn != MCMONINV) { objnum thisd = daemon->vocdfn; - + ERRBEGIN(ctx->voccxerr) OSCPYSTRUCT(val, daemon->vocdarg); runpush(rcx, val.runstyp, &val); runfn(rcx, thisd, 1); - + ERRCATCH(ctx->voccxerr, err) if (err != ERR_RUNEXIT && err != ERR_RUNEXITOBJ) errrse(ctx->voccxerr); @@ -619,7 +619,7 @@ void exedaem(voccxdef *ctx) ERRBEGIN(ctx->voccxerr) runppr(rcx, daemon->vocdfn, daemon->vocdprp, 0); - + ERRCATCH(ctx->voccxerr, err) if (err != ERR_RUNEXIT && err != ERR_RUNEXITOBJ) errrse(ctx->voccxerr); @@ -630,7 +630,7 @@ void exedaem(voccxdef *ctx) /* * Execute any pending fuses. Return TRUE if any fuses were executed, - * FALSE otherwise. + * FALSE otherwise. */ int exefuse(voccxdef *ctx, int do_run) { @@ -647,7 +647,7 @@ int exefuse(voccxdef *ctx, int do_run) if (daemon->vocdfn != MCMONINV && daemon->vocdtim == 0) { objnum thisf = daemon->vocdfn; - + found = TRUE; ERRBEGIN(ctx->voccxerr) @@ -663,7 +663,7 @@ int exefuse(voccxdef *ctx, int do_run) runpush(rcx, val.runstyp, &val); runfn(rcx, thisf, 1); } - + ERRCATCH(ctx->voccxerr, err) if (err != ERR_RUNEXIT && err != ERR_RUNEXITOBJ) errrse(ctx->voccxerr); @@ -689,7 +689,7 @@ int exefuse(voccxdef *ctx, int do_run) if (do_run) runppr(rcx, thisa, daemon->vocdprp, 0); - + ERRCATCH(ctx->voccxerr, err) if (err != ERR_RUNEXIT && err != ERR_RUNEXITOBJ) errrse(ctx->voccxerr); @@ -727,7 +727,7 @@ static void exe_get_tpl(voccxdef *ctx, objnum verb, /* ------------------------------------------------------------------------ */ /* * Execute fuses and daemons. Returns zero on success, or ERR_ABORT if - * 'abort' was thrown during execution. + * 'abort' was thrown during execution. */ int exe_fuses_and_daemons(voccxdef *ctx, int err, int do_fuses, objnum actor, objnum verb, @@ -738,7 +738,7 @@ int exe_fuses_and_daemons(voccxdef *ctx, int err, int do_fuses, /* presume no error */ err2 = 0; - + /* execute fuses and daemons if desired - trap any errors that occur */ if (do_fuses) { @@ -746,20 +746,20 @@ int exe_fuses_and_daemons(voccxdef *ctx, int err, int do_fuses, { /* execute daemons */ exedaem(ctx); - + /* execute fuses */ (void)exefuse(ctx, TRUE); } ERRCATCH(ctx->voccxerr, err2) { - /* + /* * if 'abort' was invoked, ignore it, since it's now had the * desired effect of skipping any remaining fuses and - * daemons; resignal any other error + * daemons; resignal any other error */ if (err2 != ERR_RUNABRT) errrse(ctx->voccxerr); - + /* replace any previous error with the new error code */ err = err2; } @@ -786,8 +786,8 @@ int exe_fuses_and_daemons(voccxdef *ctx, int err, int do_fuses, } /* ------------------------------------------------------------------------ */ -/* - * execute iobjGen/dobjGen methods, if appropriate +/* + * execute iobjGen/dobjGen methods, if appropriate */ static int exegen(voccxdef *ctx, objnum obj, prpnum genprop, prpnum verprop, prpnum actprop) @@ -798,7 +798,7 @@ static int exegen(voccxdef *ctx, objnum obj, prpnum genprop, objnum verobj; /* object with verXoVerb property */ int hasact; /* has xoVerb property */ objnum actobj; /* object with xoVerb property */ - + /* ignore it if there's no object here */ if (obj == MCMONINV) return(FALSE); @@ -814,14 +814,14 @@ static int exegen(voccxdef *ctx, objnum obj, prpnum genprop, if ((hasver && !bifinh(ctx, vocinh(ctx, genobj), verobj)) || (hasact && !bifinh(ctx, vocinh(ctx, genobj), actobj))) return FALSE; - + /* all conditions are met - execute dobjGen */ return TRUE; } /* ------------------------------------------------------------------------ */ /* - * Save "again" information for a direct or indirect object + * Save "again" information for a direct or indirect object */ static void exe_save_again_obj(vocoldef *againv, const vocoldef *objv, char **bufp) @@ -836,13 +836,13 @@ static void exe_save_again_obj(vocoldef *againv, const vocoldef *objv, if (objv->vocolfst != 0 && objv->vocollst != 0) { size_t copylen; - - /* + + /* * Compute the length of the entire list. The words are * arranged consecutively in the buffer, separated by null * bytes, so we must copy everything from the first word to * the start of the last word, plus the length of the last - * word, plus the last word's trailing null byte. + * word, plus the last word's trailing null byte. */ copylen = objv->vocollst - objv->vocolfst + strlen(objv->vocollst) + 1; @@ -850,9 +850,9 @@ static void exe_save_again_obj(vocoldef *againv, const vocoldef *objv, /* copy the text */ memcpy(*bufp, objv->vocolfst, copylen); - /* + /* * set the new structure to point into the copy, not the - * original + * original */ againv->vocolfst = *bufp; againv->vocollst = *bufp + (objv->vocollst - objv->vocolfst); @@ -874,7 +874,7 @@ static void exe_save_again_obj(vocoldef *againv, const vocoldef *objv, * terminating element after each restored element - other code * occasionally expects these structures to be stored in the standard * object list array format. Returns a pointer to the restored object - * list, which is the same as the first argument. + * list, which is the same as the first argument. */ static vocoldef *exe_restore_again_obj(vocoldef again_array[2], const vocoldef *saved_obj) @@ -891,14 +891,14 @@ static vocoldef *exe_restore_again_obj(vocoldef again_array[2], } /* ------------------------------------------------------------------------ */ -/* +/* * Execute a single command. 'recursive' indicates whether the routine * is being called for normal command processing or as a recursive call * from within the game; if this flag is true, we'll bypass certain * operations that are only appropriate for normal direct player * commands: we won't remember the command for "again" processing, we * won't do end-of-turn processing, and we won't reset the system stack - * before each function invocation. + * before each function invocation. */ static int exe1cmd(voccxdef *ctx, objnum actor, objnum verb, vocoldef *dobjv, objnum *prepptr, vocoldef *iobjv, int endturn, uchar *tpl, @@ -929,11 +929,11 @@ static int exe1cmd(voccxdef *ctx, objnum actor, objnum verb, vocoldef *dobjv, /* presume no error will occur */ err = 0; - /* + /* * Presume we'll run fuses and daemons if this is the end of the * turn. We only do fuses and daemons once per command, even if the * command contains multiple objects; 'endturn' will be true only - * when this is the last object of the command. + * when this is the last object of the command. */ do_fuses = endturn; @@ -966,7 +966,7 @@ static int exe1cmd(voccxdef *ctx, objnum actor, objnum verb, vocoldef *dobjv, tpl = ctx->voccxlst; newstyle = ctx->voccxlssty; - /* + /* * If we have a direct or indirect object, restore the full * object information structure pointers (in particular, this * restores the word lists). @@ -978,15 +978,15 @@ static int exe1cmd(voccxdef *ctx, objnum actor, objnum verb, vocoldef *dobjv, /* * make sure the command is repeatable: there must have been a - * verb, and the objects specified must still be accessible + * verb, and the objects specified must still be accessible */ if (verb == MCMONINV) { - /* + /* * if the last command was lost due to an object deletion, * show the message "you can't repeat that command"; * otherwise, show the message "there's no command to - * repeat" + * repeat" */ if ((ctx->voccxflg & VOCCXAGAINDEL) != 0) vocerr(ctx, VOCERR(27), "You can't repeat that command."); @@ -1031,11 +1031,11 @@ static int exe1cmd(voccxdef *ctx, objnum actor, objnum verb, vocoldef *dobjv, vocerr(ctx, VOCERR(38), "You don't see that here any more."); } - + /* indicate the error */ return ERR_PRS_VAL_DO_FAIL; } - + /* verify the indirect object if present */ if (validate_iobj && iobj != MCMONINV @@ -1057,20 +1057,20 @@ static int exe1cmd(voccxdef *ctx, objnum actor, objnum verb, vocoldef *dobjv, vocerr(ctx, VOCERR(38), "You don't see that here any more."); } - + /* indicate the error */ return ERR_PRS_VAL_IO_FAIL; } - /* + /* * save the command, unless this is a recursive call from the * game, so that we can repeat this command if the next is - * "again" + * "again" */ if (!recursive) { char *dst; - + /* save the command parameters */ ctx->voccxlsa = actor; ctx->voccxlsv = verb; @@ -1089,15 +1089,15 @@ static int exe1cmd(voccxdef *ctx, objnum actor, objnum verb, vocoldef *dobjv, /* save the indirect object information */ exe_save_again_obj(&ctx->voccxlsi, iobjv, &dst); - /* + /* * clear the flag indicating that "again" was lost due to * object deletion, because we obviously have a valid - * "again" at this point + * "again" at this point */ ctx->voccxflg &= ~VOCCXAGAINDEL; } } - + /* remember the flags */ tplflags = (tpl != 0 && newstyle ? voctplflg(tpl) : 0); dobj_first = (tplflags & VOCTPLFLG_DOBJ_FIRST); @@ -1113,16 +1113,16 @@ static int exe1cmd(voccxdef *ctx, objnum actor, objnum verb, vocoldef *dobjv, ctx->voccxactor = actor; ctx->voccxverb = verb; ctx->voccxprep = prep; - + ERRBEGIN(ctx->voccxerr) /* reset the run-time context if this is a top-level call */ if (!recursive) runrst(rcx); - /* + /* * if this is the first object, invoke the game's preCommand - * function, passing the list of all of the direct objects + * function, passing the list of all of the direct objects */ if (cur_dobj_idx == 0 && ctx->voccxprecmd != MCMONINV) { @@ -1141,11 +1141,11 @@ static int exe1cmd(voccxdef *ctx, objnum actor, objnum verb, vocoldef *dobjv, // } // ERRCATCH(ctx->voccxerr, err) // { - /* + /* * if the error was 'exit', translate it to EXITPRECMD so * that we handle the outer loop correctly (exiting from * preCommand skips execution for all subsequent objects, - * but doesn't skip fuses and daemons) + * but doesn't skip fuses and daemons) */ if (err == ERR_RUNEXIT) errsig(ctx->voccxerr, ERR_RUNEXITPRECMD); @@ -1160,7 +1160,7 @@ static int exe1cmd(voccxdef *ctx, objnum actor, objnum verb, vocoldef *dobjv, voc_multi_prefix(ctx, dobj, show_multi_prefix, multi_flags, cur_dobj_idx, dobj_cnt); - /* + /* * check to see if the verb has verbAction defined - if so, invoke * the method */ @@ -1208,7 +1208,7 @@ static int exe1cmd(voccxdef *ctx, objnum actor, objnum verb, vocoldef *dobjv, /* the location isn't an object, so discard it */ rundisc(rcx); } - + /* if there's an indirect object, execute iobjCheck */ if (iobj != MCMONINV) { @@ -1227,7 +1227,7 @@ static int exe1cmd(voccxdef *ctx, objnum actor, objnum verb, vocoldef *dobjv, /* * If there's an indirect object, and the indirect object doesn't * directly define io, call iobj.iobjGen(actor, verb, dobj, - * prep) + * prep) */ if (iobj != MCMONINV && exegen(ctx, iobj, PRP_IOBJGEN, voctplvi(tpl), voctplio(tpl))) @@ -1259,10 +1259,10 @@ static int exe1cmd(voccxdef *ctx, objnum actor, objnum verb, vocoldef *dobjv, runppr(rcx, dobj, PRP_DOBJCHECK, 4); } - /* + /* * If there's a direct object, and the direct object doesn't * directly define do, call dobj.dobjGen(actor, verb, iobj, - * prep) + * prep) */ if (dobj != MCMONINV && exegen(ctx, dobj, PRP_DOBJGEN, voctplvd(tpl), voctpldo(tpl))) @@ -1285,15 +1285,15 @@ static int exe1cmd(voccxdef *ctx, objnum actor, objnum verb, vocoldef *dobjv, /* * Now do what needs to be done, depending on the sentence structure: - * + * * No objects ==> cmdVerb.action( cmdActor ) - * + * * Direct object only ==> cmdDobj.verDo( actor ) *. cmdDobj.do( actor ) - * + * * Indirect + direct ==> cmdDobj.verDo( actor, cmdIobj ) *. cmdIobj.verIo( actor, cmdDobj ) - *. cmdIobj.io( actor, cmdDobj ) + *. cmdIobj.io( actor, cmdDobj ) */ if (dobj == MCMONINV) { @@ -1318,7 +1318,7 @@ static int exe1cmd(voccxdef *ctx, objnum actor, objnum verb, vocoldef *dobjv, /* we're done with this command */ goto skipToFuses; } - + /* reset the stack for top-level calls */ if (!recursive) runrst(rcx); @@ -1400,7 +1400,7 @@ static int exe1cmd(voccxdef *ctx, objnum actor, objnum verb, vocoldef *dobjv, /* reset the stack for top-level calls */ if (!recursive) runrst(rcx); - + /* no error from verDoVerb or verIoVerb - call ioVerb */ runpobj(rcx, dobj); runpobj(rcx, actor); @@ -1418,7 +1418,7 @@ static int exe1cmd(voccxdef *ctx, objnum actor, objnum verb, vocoldef *dobjv, err = ERR_PRS_VERDO_FAIL; } } - + skipToFuses: ERRCATCH(ctx->voccxerr, err) { @@ -1428,30 +1428,30 @@ static int exe1cmd(voccxdef *ctx, objnum actor, objnum verb, vocoldef *dobjv, /* * If we executed 'abort', we'll skip straight to endCommand. - * + * * If we executed askDo or askIo, we won't execute anything * more, because the command is being interrupted. - * + * * If 'exit' or 'exitobj' was executed, proceed through * postAction and subsequent steps. - * + * * If any error occurred other than 'exit' or 'exitobj' being * invoked, resignal the error. - * + * * We don't need to do anything more at this point if 'exit' was * invoked, because 'exit' merely skips to the end-of-turn * phase, which is where we'll go next from here. - * + * * If 'exitobj' was invoked, we don't want to return an error at * all, since we just want to skip the remainder of the normal * processing for the current object and proceed to the next - * object (in a command with multiple direct objects). + * object (in a command with multiple direct objects). */ if (err == ERR_RUNABRT) { - /* + /* * aborting - we're going to call postAction, but we're not - * going to execute fuses and daemons + * going to execute fuses and daemons */ do_fuses = FALSE; endturn = TRUE; @@ -1465,24 +1465,24 @@ static int exe1cmd(voccxdef *ctx, objnum actor, objnum verb, vocoldef *dobjv, } else if (err == ERR_RUNEXIT) { - /* + /* * Proceed with the remainder of the processing for this * turn, but retain the error code to return to our caller, * so they know that the rest of the turn is to be skipped. - * + * * In addition, set 'do_fuses' to true, since we want to go * directly to the fuse and daemon processing for this turn, * regardless of whether any other objects are present - * (because we'll skip any remaining objects). + * (because we'll skip any remaining objects). */ endturn = TRUE; do_fuses = TRUE; } else if (err == ERR_RUNEXITPRECMD) { - /* + /* * exited from preCommand - end the turn, but do not run the - * postAction routine + * postAction routine */ do_fuses = TRUE; do_postact = FALSE; @@ -1490,19 +1490,19 @@ static int exe1cmd(voccxdef *ctx, objnum actor, objnum verb, vocoldef *dobjv, } else if (err == ERR_RUNEXITOBJ) { - /* + /* * Proceed with the remainder of processing for this turn - * we want to proceed to the next object, if any, and * process it as normal. We don't need to update 'endturn' * or 'do_fuses', since we want to do all of those in the - * normal fashion. + * normal fashion. */ } else { /* * We can't handle any other errors. Restore the enclosing - * command context, and resignal the error. + * command context, and resignal the error. */ /* restore the previous tio actor setting */ @@ -1525,12 +1525,12 @@ static int exe1cmd(voccxdef *ctx, objnum actor, objnum verb, vocoldef *dobjv, /* * If desired, call postAction(actor, verb, dobj, prep, iobj, - * error_status). + * error_status). */ if (do_postact && ctx->voccxpostact != MCMONINV) { int err2; - + ERRBEGIN(ctx->voccxerr) { /* push the arguments */ @@ -1558,7 +1558,7 @@ static int exe1cmd(voccxdef *ctx, objnum actor, objnum verb, vocoldef *dobjv, } ERREND(ctx->voccxerr); } - + /* restore the original context iobj and dobj settings */ ctx->voccxdobj = old_ctx_dobj; ctx->voccxiobj = old_ctx_iobj; @@ -1571,10 +1571,10 @@ static int exe1cmd(voccxdef *ctx, objnum actor, objnum verb, vocoldef *dobjv, if (!recursive) runrst(rcx); - /* + /* * If this is the end of the turn, execute fuses and daemons. Skip * fuses on recursive calls, since we want to count them as part of - * the enclosing turn. + * the enclosing turn. */ if (endturn && !recursive) { @@ -1618,19 +1618,19 @@ static void exesaveit(voccxdef *ctx, vocoldef *dolist) { /* * check to make sure they're not referring to a number or a - * string; if so, it doesn't make any sense to save it + * string; if so, it doesn't make any sense to save it */ if (dolist[0].vocolflg == VOCS_STR || dolist[0].vocolflg == VOCS_NUM) { - /* + /* * As of 2.5.11, don't clear 'it' on a number or string; * rather, just leave it as it was from the prior command. * Players will almost never expect a number or string to have * anything to do with pronoun antecedents, and in fact some * players reported finding it confusing to have the antecedant * implied by the second-most-recent command disappear when the - * most recent command used a number of string. + * most recent command used a number of string. */ #if 0 /* save a nil 'it' */ @@ -1705,9 +1705,9 @@ void voc_multi_prefix(voccxdef *ctx, objnum objn, if (objn == MCMONINV) return; - /* + /* * if there's a prefixdesc method defined, call it rather than the - * older multisdesc (or even older sdesc) approach + * older multisdesc (or even older sdesc) approach */ if (objgetap(ctx->voccxmem, objn, PRP_PREFIXDESC, (objnum *)0, FALSE) != 0) @@ -1717,13 +1717,13 @@ void voc_multi_prefix(voccxdef *ctx, objnum objn, /* push the word flags */ runpnum(rcx, multi_flags); - /* + /* * push the object count and the current index (adjusted to a - * 1-based value) + * 1-based value) */ runpnum(rcx, count); runpnum(rcx, cur_index + 1); - + /* push the 'show' flag */ val.runstyp = runclog(show_prefix); runpush(rcx, val.runstyp, &val); @@ -1735,16 +1735,16 @@ void voc_multi_prefix(voccxdef *ctx, objnum objn, return; } - /* + /* * if we're not showing the prefix, don't use the multisdesc/sdesc - * display + * display */ if (!show_prefix) return; - + /* * use multisdesc if defined (for compatibility with older games, - * use sdesc if multisdesc doesn't exist for this object) + * use sdesc if multisdesc doesn't exist for this object) */ if (objgetap(ctx->voccxmem, objn, PRP_MULTISDESC, (objnum *)0, FALSE) == 0) @@ -1774,15 +1774,15 @@ static int exeloop(voccxdef *ctx, objnum actor, objnum verb, int exec_cnt; vocoldef *dobj; - /* + /* * count the direct objects; we'll iterate over the direct objects, - * so we execute the command once per direct object + * so we execute the command once per direct object */ exec_cnt = dobj_cnt = (dolist != 0 ? voclistlen(dolist) : 0); - /* + /* * if there are no direct objects, we still must execute the command - * once + * once */ if (exec_cnt < 1) exec_cnt = 1; @@ -1793,7 +1793,7 @@ static int exeloop(voccxdef *ctx, objnum actor, objnum verb, * words are acceptable: call verb.rejectMultiDobj, and see what it * returns; if it returns true, don't allow multiple words, and * expect that rejectMultiDobj displayed an error message. - * Otherwise, proceed. + * Otherwise, proceed. */ if (((multi_flags & VOCS_ALL) != 0 || dobj_cnt > 1) && dolist && dolist[0].vocolobj != MCMONINV) @@ -1822,8 +1822,8 @@ static int exeloop(voccxdef *ctx, objnum actor, objnum verb, return 0; } - /* - * execute the command the required number of times + /* + * execute the command the required number of times */ for (i = 0 ; i < exec_cnt ; ++i) { @@ -1834,7 +1834,7 @@ static int exeloop(voccxdef *ctx, objnum actor, objnum verb, /* * If we have a number or string, set the current one in - * numObj/strObj + * numObj/strObj */ if (dolist != 0) { @@ -1860,16 +1860,16 @@ static int exeloop(voccxdef *ctx, objnum actor, objnum verb, * For cases where we have a bunch of direct objects (or even * one when "all" was used), we want to preface the output from * each iteration with the name of the object we're acting on - * currently. In other cases, there is no prefix. + * currently. In other cases, there is no prefix. */ show_multi_prefix = ((multi_flags != 0 || dobj_cnt > 1) && dobj != 0); - /* + /* * Execute the command for this object. For every object except * the first, re-validate the direct and indirect objects. * There's no need to re-validate the objects on the first * object in a command, because that will already have been done - * during object resolution. + * during object resolution. */ err = exe1cmd(ctx, actor, verb, dobj, prep, iobj, (i + 1 == exec_cnt), tpl, newstyle, FALSE, @@ -1890,9 +1890,9 @@ static int exeloop(voccxdef *ctx, objnum actor, objnum verb, break; case ERR_RUNEXITPRECMD: - /* + /* * exited from preCommand - skip execution of subsequent - * objects, but return success + * objects, but return success */ return 0; @@ -1940,7 +1940,7 @@ int execmd_recurs(voccxdef *ctx, objnum actor, objnum verb, * 'exit' or 'abort' in the course of executing the command. To make * sure we don't leave any aborted frames on the stack before * returning to our caller, we simply need to restore the stack and - * frame pointers on the way out as they were on the way in. + * frame pointers on the way out as they were on the way in. */ orig_sp = ctx->voccxrun->runcxsp; orig_bp = ctx->voccxrun->runcxbp; @@ -1949,9 +1949,9 @@ int execmd_recurs(voccxdef *ctx, objnum actor, objnum verb, ctx_copy = *ctx; ctx = &ctx_copy; - /* + /* * there are no unknown words in the recursive command, since the - * command was prepared directly from resolved objects + * command was prepared directly from resolved objects */ ctx->voccxunknown = 0; @@ -1970,16 +1970,16 @@ int execmd_recurs(voccxdef *ctx, objnum actor, objnum verb, iobjv.vocolfst = iobjv.vocollst = ""; iobjv.vocolflg = 0; } - + /* figure out which template we need, based on the objects provided */ if (dobj == MCMONINV) { uint actofs; uint tplofs; - - /* + + /* * No objects were provided - use the verb's "action" method. - * Make sure that there is in fact an "action" method. + * Make sure that there is in fact an "action" method. */ exe_get_tpl(ctx, verb, &tplofs, &actofs); if (actofs != 0) @@ -1997,10 +1997,10 @@ int execmd_recurs(voccxdef *ctx, objnum actor, objnum verb, } else if (iobj == MCMONINV) { - /* + /* * No indirect object was provided, but a direct object is * present - use the one-object template. First, look up the - * template. + * template. */ if (voctplfnd(ctx, verb, MCMONINV, tpl, &newstyle)) { @@ -2017,7 +2017,7 @@ int execmd_recurs(voccxdef *ctx, objnum actor, objnum verb, } else { - /* + /* * Both a direct and indirect object were provided - find the * two-object template for the given preposition. */ @@ -2035,18 +2035,18 @@ int execmd_recurs(voccxdef *ctx, objnum actor, objnum verb, } } - /* + /* * if the error was EXITPRECMD, change it to EXIT - EXITPRECMD is a * special flag indicating that we exited from a preCommand * function, which is different than normal exiting internally but - * not to the game + * not to the game */ if (err == ERR_RUNEXITPRECMD) err = ERR_RUNEXIT; /* * restore the original stack and base pointers, to ensure that we - * don't leave any aborted frames on the stack + * don't leave any aborted frames on the stack */ ctx->voccxrun->runcxsp = orig_sp; ctx->voccxrun->runcxbp = orig_bp; @@ -2059,7 +2059,7 @@ int execmd_recurs(voccxdef *ctx, objnum actor, objnum verb, /* * Check for ALL, ANY, or THEM in the list - use multi-mode if found, * even if we have only one object. Returns a combination of any of the - * VOCS_ALL, VOCS_ANY, or VOCS_THEM flags that we find. + * VOCS_ALL, VOCS_ANY, or VOCS_THEM flags that we find. */ static int check_for_multi(vocoldef *dolist) { @@ -2070,9 +2070,9 @@ static int check_for_multi(vocoldef *dolist) /* presume we won't find any flags */ result = 0; - /* + /* * scan the list for ALL, ANY, or THEM flags, combining any such - * flags we find into the result + * flags we find into the result */ dolen = voclistlen(dolist); for (i = 0 ; i < dolen ; ++i) @@ -2088,7 +2088,7 @@ static int check_for_multi(vocoldef *dolist) * function doesn't exist or returns 'true', ERR_PREPRSCMDCAN if it * returns 'nil' (and thus wants to cancel the command), and * ERR_PREPRSCMDREDO if it returns a list (and thus wants to redo the - * command). + * command). */ int try_preparse_cmd(voccxdef *ctx, char **cmd, int wrdcnt, uchar **preparse_list) @@ -2104,19 +2104,19 @@ int try_preparse_cmd(voccxdef *ctx, char **cmd, int wrdcnt, /* if there's no preparseCmd, keep processing */ if (ctx->voccxppc == MCMONINV) return 0; - + /* build a list of the words */ for (p = listbuf + 2, i = 0 ; i < wrdcnt ; ++i) { char *src; int add_quote; - + /* check for strings - they require special handling */ if (cmd[i][0] == '"') { - /* + /* * it's a string - what follows is a run-time style string, - * with a length prefix followed by the text of the string + * with a length prefix followed by the text of the string */ len = osrp2(cmd[i] + 1) - 2; src = cmd[i] + 3; @@ -2155,11 +2155,11 @@ int try_preparse_cmd(voccxdef *ctx, char **cmd, int wrdcnt, if (add_quote) *p++ = '"'; } - + /* set the length of the whole list */ len = p - listbuf; oswp2(listbuf, len); - + /* push the list as the argument, and call the user's preparseCmd */ val.runstyp = DAT_LIST; val.runsv.runsvstr = listbuf; @@ -2176,9 +2176,9 @@ int try_preparse_cmd(voccxdef *ctx, char **cmd, int wrdcnt, } ERRCATCH(ctx->voccxerr, err) { - /* + /* * if it's abort/exit/exitobj, just return it; for any other - * errors, just re-throw the same error + * errors, just re-throw the same error */ switch(err) { @@ -2201,16 +2201,16 @@ int try_preparse_cmd(voccxdef *ctx, char **cmd, int wrdcnt, /* get the result */ typ = runtostyp(ctx->voccxrun); - + /* if they returned a list, it's a new command to execute */ if (typ == DAT_LIST) { /* get the list and give it to the caller */ *preparse_list = runpoplst(ctx->voccxrun); - - /* + + /* * indicate that the command is to be reparsed with the new word - * list + * list */ return ERR_PREPRSCMDREDO; } @@ -2228,7 +2228,7 @@ int try_preparse_cmd(voccxdef *ctx, char **cmd, int wrdcnt, /* ------------------------------------------------------------------------ */ /* - * Call parseAskobjIndirect + * Call parseAskobjIndirect */ static void voc_askobj_indirect(voccxdef *ctx, vocoldef *dolist, objnum actor, objnum verb, objnum prep) @@ -2237,7 +2237,7 @@ static void voc_askobj_indirect(voccxdef *ctx, vocoldef *dolist, int i; size_t len; uchar *lstp; - + /* * Generate the direct object list argument. This argument is a * list of lists. For each noun phrase, we generate one sublist in @@ -2245,12 +2245,12 @@ static void voc_askobj_indirect(voccxdef *ctx, vocoldef *dolist, * sub-sublists: first, a list of strings giving the words in the * noun phrase; second, a list of the objects matching the noun * phrase; third, a list of the flags for the matching objects. - * + * * So, if the player typed "put red box and blue ball", we might * generate a list something like this: - * + * * [ [ ['red', 'box'], [redBox1, redBox2], [0, 0] ], [ ['blue', - * 'ball'], [blueBall], [0, 0] ] ] + * 'ball'], [blueBall], [0, 0] ] ] */ /* @@ -2264,53 +2264,53 @@ static void voc_askobj_indirect(voccxdef *ctx, vocoldef *dolist, const char *p; size_t curlen; int j; - - /* + + /* * we need the sublist type prefix (one byte) plus the sublist * length prefix (two bytes), plus the type and length prefixes - * (one plus two bytes) for each of the three sub-sublist + * (one plus two bytes) for each of the three sub-sublist */ len += (1+2) + 3*(1+2); - /* + /* * we need space to store the strings for the words in this noun - * phrase + * phrase */ for (p = dolist[i].vocolfst ; p != 0 && p <= dolist[i].vocollst ; p += curlen + 1) { - /* + /* * add in the space needed for this string element in the * sub-sublist - we need one byte for the type prefix, two * bytes for the length prefix, and the bytes for the string - * itself + * itself */ curlen = strlen(p); len += (1+2) + curlen; } - /* + /* * scan each object for this same noun phrase (i.e., for which - * the vocabulary words are the same) + * the vocabulary words are the same) */ for (j = i ; j < cnt && dolist[j].vocolfst == dolist[i].vocolfst ; ++j) { - /* + /* * Add in space for this object in the sub-sublist for the * current noun phrase. If this object is nil, we need only * one byte for the type; otherwise, we need one byte for - * the type prefix plus two bytes for the object ID. + * the type prefix plus two bytes for the object ID. */ if (dolist[i].vocolobj == MCMONINV) len += 1; else len += (1 + 2); - + /* * Add in space for the flags sub-sublist for the current * object. We need one byte for the type and four for the - * integer value. + * integer value. */ len += (1 + 4); } @@ -2322,9 +2322,9 @@ static void voc_askobj_indirect(voccxdef *ctx, vocoldef *dolist, /* allocate the list */ lstp = voc_push_list_siz(ctx, len); - /* + /* * Go through our object array again, and this time actually build - * the list. + * the list. */ for (i = 0 ; i < cnt ; ) { @@ -2375,9 +2375,9 @@ static void voc_askobj_indirect(voccxdef *ctx, vocoldef *dolist, for (j = i ; j < cnt && dolist[j].vocolfst == dolist[i].vocolfst ; ++j) { - /* + /* * if this object isn't nil, write it to the sub-sublist; - * otherwise, just put nil in the sub-sublist + * otherwise, just put nil in the sub-sublist */ if (dolist[j].vocolobj != MCMONINV) { @@ -2441,7 +2441,7 @@ static void voc_askobj_indirect(voccxdef *ctx, vocoldef *dolist, * matches, we try (using default objects and, if that fails, requests * to the player for objects) to fill in any missing information in the * player's command. If that still fails, we will say we don't - * understand the sentence and leave it at that. + * understand the sentence and leave it at that. */ int execmd(voccxdef *ctx, objnum actor, objnum prep, char *vverb, char *vprep, vocoldef *dolist, vocoldef *iolist, @@ -2520,9 +2520,9 @@ int execmd(voccxdef *ctx, objnum actor, objnum prep, } else { - /* + /* * parseUnknownVerb failed or aborted - end the command with - * an error + * an error */ return 1; } @@ -2534,7 +2534,7 @@ int execmd(voccxdef *ctx, objnum actor, objnum prep, /* default actor is "Me" */ if (actor == MCMONINV) actor = ctx->voccxme; - + /* set a savepoint, if we're keeping undo information */ if (ctx->voccxundo) objusav(ctx->voccxundo); @@ -2542,7 +2542,7 @@ int execmd(voccxdef *ctx, objnum actor, objnum prep, /* * Check that the room will allow this command -- it may not * due to darkness or other ailment. We can find out with the - * roomCheck(verb) message, sent to the meobj. + * roomCheck(verb) message, sent to the meobj. */ { int t; @@ -2560,7 +2560,7 @@ int execmd(voccxdef *ctx, objnum actor, objnum prep, /* look for a new-style template first, then the old-style template */ exe_get_tpl(ctx, verb, &tplofs, &actofs); - + /* make sure we found a verb */ if (tplofs == 0 && actofs == 0 && verb != ctx->voccxvag) { @@ -2576,11 +2576,11 @@ int execmd(voccxdef *ctx, objnum actor, objnum prep, /* * Check to see if we have an "all" - if we do, we'll need to * display the direct object's name even if only one direct object - * comes of it. + * comes of it. */ multi_flags = check_for_multi(dolist); - /* + /* * set up dobj word list in case objwords is used in doDefault (the * game may want to check for "all" and disallow it, for example) */ @@ -2603,9 +2603,9 @@ int execmd(voccxdef *ctx, objnum actor, objnum prep, for ( ;; ) { askflags = err = 0; - + ERRBEGIN(ctx->voccxerr) - + /* * Now see what kind of sentence we have. If we have no * objects and an action, use the action. If we have a direct @@ -2614,7 +2614,7 @@ int execmd(voccxdef *ctx, objnum actor, objnum prep, * use the ioAction. If we have an indirect object and no * matching ioAction, complain. If we have a direct object and * no doAction or ioAction, complain. If we have fewer objects - * than we really want, ask the user for more of them. + * than we really want, ask the user for more of them. */ if (voclistlen(dolist) == 0 && voclistlen(iolist) == 0) { @@ -2630,14 +2630,14 @@ int execmd(voccxdef *ctx, objnum actor, objnum prep, /* * The player has not specified any objects, but the * verb seems to require one. See if there's a unique - * default. + * default. */ runrst(rcx); runpnil(rcx); runpobj(rcx, prep); runpobj(rcx, actor); runppr(rcx, verb, PRP_DODEFAULT, 3); - + if (runtostyp(rcx) == DAT_LIST) { uchar *l = runpoplst(rcx); @@ -2647,12 +2647,12 @@ int execmd(voccxdef *ctx, objnum actor, objnum prep, objnum newprep; runsdef val; objnum o; - + /* push list back on stack, to keep in heap */ val.runsv.runsvstr = l; val.runstyp = DAT_LIST; runrepush(rcx, &val); - + /* get list size out of list */ lstsiz = osrp2(l) - 2; l += 2; @@ -2666,7 +2666,7 @@ int execmd(voccxdef *ctx, objnum actor, objnum prep, newprep = MCMONINV; rundisc(rcx); } - + if (!voctplfnd(ctx, verb, newprep, tpl, &newstyle)) { for (objcnt = 0 ; lstsiz && objcnt < 2 @@ -2682,11 +2682,11 @@ int execmd(voccxdef *ctx, objnum actor, objnum prep, else { int dobj_first; - + /* * Get the template flags. If we must * disambiguate the direct object first for this - * verb, do so now. + * verb, do so now. */ tplflags = (newstyle ? voctplflg(tpl) : 0); dobj_first = (tplflags & VOCTPLFLG_DOBJ_FIRST); @@ -2700,7 +2700,7 @@ int execmd(voccxdef *ctx, objnum actor, objnum prep, if (!objgetap(ctx->voccxmem, o, voctplvd(tpl), (objnum *)0, FALSE)) continue; - + tiohide(ctx->voccxtio); if (newprep != MCMONINV && !dobj_first) runpnil(rcx); @@ -2708,7 +2708,7 @@ int execmd(voccxdef *ctx, objnum actor, objnum prep, runppr(rcx, o, voctplvd(tpl), ((newprep != MCMONINV && !dobj_first) ? 2 : 1)); - + if (!tioshow(ctx->voccxtio)) { ++objcnt; @@ -2716,10 +2716,10 @@ int execmd(voccxdef *ctx, objnum actor, objnum prep, } } } - + /* no longer need list in heap, so discard it */ rundisc(rcx); - + /* use default object if there's exactly one */ if (objcnt == 1) { @@ -2760,11 +2760,11 @@ int execmd(voccxdef *ctx, objnum actor, objnum prep, } else rundisc(rcx); - + /* * No unique default; ask the player for a direct * object, and try the command again if he is kind - * enough to provide one. + * enough to provide one. */ askflags = ERR_RUNASKD; } @@ -2786,7 +2786,7 @@ int execmd(voccxdef *ctx, objnum actor, objnum prep, /* * save the disambiguated direct object list, in case - * we hit an askio in the course of processing it + * we hit an askio in the course of processing it */ memcpy(dolist, dolist1, (size_t)(voclistlen(dolist1) + 1)*sizeof(dolist[0])); @@ -2794,7 +2794,7 @@ int execmd(voccxdef *ctx, objnum actor, objnum prep, /* re-check for multi-mode */ if (multi_flags == 0) multi_flags = check_for_multi(dolist1); - + /* save it/them/him/her, and execute the command */ exesaveit(ctx, dolist1); if ((err = exeloop(ctx, actor, verb, dolist1, &prep, @@ -2828,12 +2828,12 @@ int execmd(voccxdef *ctx, objnum actor, objnum prep, goto exit_error; } prep = runpopobj(rcx); - + runrst(rcx); runpobj(rcx, prep); runpobj(rcx, actor); runppr(rcx, verb, PRP_IODEFAULT, 2); - + if (runtostyp(rcx) == DAT_LIST) { uchar *l = runpoplst(rcx); @@ -2842,16 +2842,16 @@ int execmd(voccxdef *ctx, objnum actor, objnum prep, int objcnt; runsdef val; objnum o; - + /* push list back on stack, to keep in heap */ val.runsv.runsvstr = l; val.runstyp = DAT_LIST; runrepush(rcx, &val); - + /* get list size out of list */ lstsiz = osrp2(l) - 2; l += 2; - + if (!voctplfnd(ctx, verb, prep, tpl, &newstyle)) { for (objcnt = 0 ; lstsiz && objcnt < 2 @@ -2867,11 +2867,11 @@ int execmd(voccxdef *ctx, objnum actor, objnum prep, else { int dobj_first; - + /* * Get the template flags. If we must * disambiguate the direct object first for this - * verb, do so now. + * verb, do so now. */ tplflags = (newstyle ? voctplflg(tpl) : 0); dobj_first = (tplflags & VOCTPLFLG_DOBJ_FIRST); @@ -2900,7 +2900,7 @@ int execmd(voccxdef *ctx, objnum actor, objnum prep, memcpy(dolist, dolist1, (size_t)(2 * sizeof(dolist[0]))); } - + for (objcnt = 0 ; lstsiz && objcnt < 2 ; lstadv(&l, &lstsiz)) { @@ -2910,7 +2910,7 @@ int execmd(voccxdef *ctx, objnum actor, objnum prep, if (!objgetap(ctx->voccxmem, o, voctplvi(tpl), (objnum *)0, FALSE)) continue; - + tiohide(ctx->voccxtio); if (dobj_first) runpobj(rcx, dolist[0].vocolobj); @@ -2925,7 +2925,7 @@ int execmd(voccxdef *ctx, objnum actor, objnum prep, } } } - + /* no longer need list in heap, so discard it */ rundisc(rcx); @@ -2938,7 +2938,7 @@ int execmd(voccxdef *ctx, objnum actor, objnum prep, iolist[1].vocolobj = MCMONINV; iolist[1].vocolflg = 0; iolist[1].vocolfst = iolist[1].vocollst = 0; - + /* tell the user what we're assuming */ runrst(rcx); if (ctx->voccxpdef2 != MCMONINV) @@ -2970,11 +2970,11 @@ int execmd(voccxdef *ctx, objnum actor, objnum prep, } else rundisc(rcx); - + /* * We didn't get a unique default indirect object, so * we should ask the player for an indirct object, and - * repeat the command should he provide one. + * repeat the command should he provide one. */ askflags = ERR_RUNASKI; } @@ -2982,31 +2982,31 @@ int execmd(voccxdef *ctx, objnum actor, objnum prep, else { objnum otherobj; - + /* find the template for this verb/prep combination */ if (!voctplfnd(ctx, verb, prep, tpl, &newstyle)) { vocoldef *np1; - - /* + + /* * If we could have used the preposition in the first noun * phrase rather than in the verb, and this would have * yielded a valid verb phrase, the error is "I don't see * any here". - * + * * Otherwise, it's a verb phrasing error. In this case, * call parseUnknownVerb to handle the error; the default - * error is "I don't recognize that sentence". + * error is "I don't recognize that sentence". */ np1 = dolist[0].vocolfst < iolist[0].vocolfst ? dolist : iolist; if ((np1->vocolflg & VOCS_TRIMPREP) != 0) { char namebuf[VOCBUFSIZ]; - - /* + + /* * it's a trimmed prep phrase, so we actually have an - * unmatched object - report the error + * unmatched object - report the error */ voc_make_obj_name_from_list( ctx, namebuf, cmd, np1->vocolfst, np1->vocolhlst); @@ -3036,7 +3036,7 @@ int execmd(voccxdef *ctx, objnum actor, objnum prep, /* * We have both direct and indirect objects. If we don't - * yet have the direct object, go ask for it + * yet have the direct object, go ask for it */ if (voclistlen(dolist) == 0) { @@ -3067,7 +3067,7 @@ int execmd(voccxdef *ctx, objnum actor, objnum prep, /* * only one direct object is allowed if it's - * disambiguated first + * disambiguated first */ if (voclistlen(dolist1) > 1) { @@ -3113,20 +3113,20 @@ int execmd(voccxdef *ctx, objnum actor, objnum prep, err = -1; goto exit_error; } - + /* re-check for multi-mode */ if (multi_flags == 0) multi_flags = check_for_multi(dolist1); - + /* save it/them/him/her, and execute the command */ exesaveit(ctx, dolist1); if ((err = exeloop(ctx, actor, verb, dolist1, &prep, iolist1, multi_flags, tpl, newstyle)) != 0) goto exit_error; } - + exit_error: ; - + ERRCATCH(ctx->voccxerr, err) if (err == ERR_RUNASKI) prep = errargint(0); if (err != ERR_RUNASKD && err != ERR_RUNASKI) @@ -3137,23 +3137,23 @@ int execmd(voccxdef *ctx, objnum actor, objnum prep, { case 0: break; - + case ERR_RUNABRT: /* "abort" executed - return the ABORT code */ VOC_RETVAL(ctx, save_sp, err); - + case ERR_RUNEXIT: - /* + /* * "exit" executed - terminate the command, but return - * success, since we want to process any additional commands + * success, since we want to process any additional commands */ VOC_RETVAL(ctx, save_sp, 0); case ERR_RUNEXITOBJ: - /* + /* * "exitobj" executed - indicate success, since this merely * indicates that the game decided it was done processing an - * object early + * object early */ VOC_RETVAL(ctx, save_sp, 0); @@ -3161,7 +3161,7 @@ int execmd(voccxdef *ctx, objnum actor, objnum prep, case ERR_RUNASKD: askflags = err; break; - + case -2: /* special code: continue with main loop */ continue; @@ -3169,29 +3169,29 @@ int execmd(voccxdef *ctx, objnum actor, objnum prep, default: VOC_RETVAL(ctx, save_sp, 1); } - + /* * If we got this far, we probably want more information. The - * askflags can tell us what to do from here. + * askflags can tell us what to do from here. */ if (askflags) { int old_unknown; int exenewpos; - - /* + + /* * if we had unknown words, don't ask for more information - * at this point; simply give up and report the unknown word + * at this point; simply give up and report the unknown word */ if (ctx->voccxunknown != 0) { VOC_RETVAL(ctx, save_sp, 1); } - + /* find new template indicated by the additional object */ foundtpl = voctplfnd(ctx, verb, prep, tpl, &newstyle); tplflags = (newstyle ? voctplflg(tpl) : 0); - + /* find a default object of the type requested */ runrst(rcx); if (askflags == ERR_RUNASKD) runpnil(rcx); @@ -3201,14 +3201,14 @@ int execmd(voccxdef *ctx, objnum actor, objnum prep, (prpnum)(askflags == ERR_RUNASKD ? PRP_DODEFAULT : PRP_IODEFAULT), (askflags == ERR_RUNASKD ? 3 : 2)); - + /* * If we got a list back from ?oDefault, and we have a new * template for the command, process the list normally with * the object verification routine for this template. If we * end up with exactly one object, we will assume it is the * object to be used; otherwise, make no assumption and ask - * the user for guidance. + * the user for guidance. */ if (runtostyp(rcx) == DAT_LIST && foundtpl) { @@ -3218,27 +3218,27 @@ int execmd(voccxdef *ctx, objnum actor, objnum prep, objnum defobj = 0; objnum o; runsdef val; - + /* push list back on stack, to keep it in the heap */ val.runsv.runsvstr = l; val.runstyp = DAT_LIST; runrepush(rcx, &val); - + /* get list size out of list */ lstsiz = osrp2(l) - 2; l += 2; - + for (objcnt = 0 ; lstsiz && objcnt < 2 ; lstadv(&l, &lstsiz)) { if (*l == DAT_OBJECT) { prpnum verprop; int argc = 1; - + o = osrp2(l + 1); verprop = (askflags == ERR_RUNASKD ? voctplvd(tpl) : voctplvi(tpl)); - + if (!objgetap(ctx->voccxmem, o, verprop, (objnum *)0, FALSE)) continue; @@ -3249,7 +3249,7 @@ int execmd(voccxdef *ctx, objnum actor, objnum prep, * In the unlikely event that we have an * indirect object but no direct object, push * the iobj. This can happen when the player - * types a sentence such as "verb prep iobj". + * types a sentence such as "verb prep iobj". */ if (voclistlen(iolist) != 0 && askflags == ERR_RUNASKD @@ -3266,7 +3266,7 @@ int execmd(voccxdef *ctx, objnum actor, objnum prep, * If this is a disambigDobjFirst verb, and * we're validating an indirect object list, * then we must push the direct object argument - * to the indirect object validation routine. + * to the indirect object validation routine. */ if (askflags == ERR_RUNASKI && (tplflags & VOCTPLFLG_DOBJ_FIRST) != 0) @@ -3289,10 +3289,10 @@ int execmd(voccxdef *ctx, objnum actor, objnum prep, } } - + /* no longer need list in heap, so discard it */ rundisc(rcx); - + /* if we found exactly one object, it's the default */ if (objcnt == 1) { @@ -3314,7 +3314,7 @@ int execmd(voccxdef *ctx, objnum actor, objnum prep, iolist[1].vocolflg = 0; iolist[1].vocolfst = iolist[1].vocollst = 0; } - + /* tell the user what we're assuming */ if (ctx->voccxpdef2 != MCMONINV) { @@ -3357,14 +3357,14 @@ int execmd(voccxdef *ctx, objnum actor, objnum prep, /* make sure output capturing is off for the prompt */ tiocapture(ctx->voccxtio, (mcmcxdef *)0, FALSE); tioclrcapture(ctx->voccxtio); - + /* * If we're asking for an indirect object, and we have a * list of direct objects, and parseAskobjIndirect is * defined, call it. Otherwise, if there's a * parseAskobjActor routine, call it. Otherwise, if there's * a parseAskobj routine, use that. Finally, if none of - * those are defined, generate the default phrasing. + * those are defined, generate the default phrasing. */ if (ctx->voccxpask3 != MCMONINV && askflags == ERR_RUNASKI @@ -3397,7 +3397,7 @@ int execmd(voccxdef *ctx, objnum actor, objnum prep, * Phrase the question: askDo: "What do you want * to ?" askIo: "What do you want * to it ?" If the actor is Me, leave the - * actor out of it. + * actor out of it. */ if (actor != MCMONINV && actor != ctx->voccxme) { @@ -3417,7 +3417,7 @@ int execmd(voccxdef *ctx, objnum actor, objnum prep, /* * add an appropriate pronoun for the direct object, * and the preposition, if we're asking for an indirect - * object + * object */ if (askflags == ERR_RUNASKI) { @@ -3433,7 +3433,7 @@ int execmd(voccxdef *ctx, objnum actor, objnum prep, * with the possible single objects about "him" or * "her", use that. Otherwise, use "it". If "all" * was specified for any word, automatically assume - * multiple distinct objects were specified. + * multiple distinct objects were specified. */ vcnt = voclistlen(dolist); for (distinct = 0, i = 0, lastfst = 0 ; i < vcnt ; ++i) @@ -3457,7 +3457,7 @@ int execmd(voccxdef *ctx, objnum actor, objnum prep, /* * If we have multiple words, use "them"; * otherwise, see if we can find agreement about - * using "him" or "her". + * using "him" or "her". */ if (distinct > 1) { @@ -3488,7 +3488,7 @@ int execmd(voccxdef *ctx, objnum actor, objnum prep, runppr(rcx, dolist[i].vocolobj, PRP_ISHIM, 0); him1 = (runtostyp(rcx) == DAT_TRUE); rundisc(rcx); - + /* check for "her" */ runppr(rcx, dolist[i].vocolobj, PRP_ISHER, 0); her1 = (runtostyp(rcx) == DAT_TRUE); @@ -3505,7 +3505,7 @@ int execmd(voccxdef *ctx, objnum actor, objnum prep, * if this is the first object, it * definitely agrees; otherwise, keep going * only if it agrees with what we found on - * the last pass + * the last pass */ if (i == 0) { @@ -3530,7 +3530,7 @@ int execmd(voccxdef *ctx, objnum actor, objnum prep, * If we could agree on "him", "her", or "them", * use that pronoun; otherwise, use "it". If we * found both "him" and "her" are acceptable for - * all objects, use "them". + * all objects, use "them". */ if ((is_him && is_her) || is_them) vocerr_info(ctx, VOCERR(147), " them "); @@ -3551,13 +3551,13 @@ int execmd(voccxdef *ctx, objnum actor, objnum prep, vocerr_info(ctx, VOCERR(143), "?"); } tioflush(ctx->voccxtio); - + /* * Get a new command line. If the player gives us * something that looks like a noun list, and nothing more, * he anwered our question; otherwise, he's typing a new * command, so we must return to the caller with the reparse - * flag set. + * flag set. */ if (askflags == ERR_RUNASKD) { @@ -3578,16 +3578,16 @@ int execmd(voccxdef *ctx, objnum actor, objnum prep, if (vocread(ctx, actor, verb, exenewcmd, VOCBUFSIZ, askflags == ERR_RUNASKD ? 3 : 4) == VOCREAD_REDO) { - /* + /* * we got an input line, but we want to treat it as a brand * new command line - copy the new text to the command - * buffer, set the 'redo' flag, and give up + * buffer, set the 'redo' flag, and give up */ strcpy(cmdbuf, exenewcmd); ctx->voccxredo = TRUE; VOC_RETVAL(ctx, save_sp, 1); } - + if (!(cnt = voctok(ctx, exenewcmd, exenewbuf, exenewlist, TRUE, FALSE, TRUE))) { @@ -3601,13 +3601,13 @@ int execmd(voccxdef *ctx, objnum actor, objnum prep, VOC_RETVAL(ctx, save_sp, 1); } - /* + /* * Save the unknown word count while getting types, and set * the count to a non-zero value - this will force the type * checker to generate an error on an unknown word. This * removes a little control from the game (since * parseUnknownXobj won't be called), but there's not much - * else we can do here. + * else we can do here. */ old_unknown = ctx->voccxunknown; ctx->voccxunknown = 1; @@ -3616,10 +3616,10 @@ int execmd(voccxdef *ctx, objnum actor, objnum prep, exenewlist[cnt] = 0; if (vocgtyp(ctx, exenewlist, exenewtype, cmdbuf)) { - /* + /* * clear the unknown word count so that we fail with * this error rather than trying to deal with unknown - * words + * words */ ctx->voccxunknown = 0; @@ -3633,18 +3633,18 @@ int execmd(voccxdef *ctx, objnum actor, objnum prep, /* start at the first word */ exenewpos = 0; - /* + /* * if we're asking for an indirect object, and the first * word is a preposition, and matches the preposition that * we supplied to precede the indirect object, skip the - * preposition + * preposition */ if (askflags == ERR_RUNASKI && prep != MCMONINV && (exenewtype[0] & VOCT_PREP) != 0) { vocwdef *vp; - + /* get the preposition */ vp = vocffw(ctx, exenewlist[0], (int)strlen(exenewlist[0]), (char *)0, 0, PRP_PREP, (vocseadef *)0); @@ -3656,7 +3656,7 @@ int execmd(voccxdef *ctx, objnum actor, objnum prep, newnoun = (askflags == ERR_RUNASKD ? dolist : iolist); cnt = vocchknoun(ctx, exenewlist, exenewtype, exenewpos, &next, newnoun, FALSE); - + if (cnt < 0) { VOC_RETVAL(ctx, save_sp, 1); } /* invalid syntax */ if (cnt == 0 || (exenewlist[next] && !vocspec(exenewlist[next], VOCW_THEN) @@ -3669,7 +3669,7 @@ int execmd(voccxdef *ctx, objnum actor, objnum prep, /* re-check the 'multi' flags */ multi_flags = check_for_multi(newnoun); - + /* give it another go by going back to the top of the loop */ } else diff --git a/engines/glk/tads/tads2/file_io.cpp b/engines/glk/tads/tads2/file_io.cpp index b498df66a20..be839f3415d 100644 --- a/engines/glk/tads/tads2/file_io.cpp +++ b/engines/glk/tads/tads2/file_io.cpp @@ -51,7 +51,7 @@ void OS_LOADDS fioldobj(void *ctx0, mclhd handle, uchar *ptr, ushort siz) char buf[7]; errcxdef *ec = ctx->fiolcxerr; uint rdsiz = 0; - + /* figure out what type of object is to be loaded */ osfseek(fp, seekpos + ctx->fiolcxst, OSFSK_SET); if (osfrb(fp, buf, 7)) errsig(ec, ERR_LDGAM); @@ -64,13 +64,13 @@ void OS_LOADDS fioldobj(void *ctx0, mclhd handle, uchar *ptr, ushort siz) case TOKSTOBJ: rdsiz = osrp2(buf + 5); break; - + case TOKSTFWDOBJ: case TOKSTFWDFN: default: errsig(ec, ERR_UNKOTYP); } - + if (siz < rdsiz) errsig(ec, ERR_LDBIG); if (osfrb(fp, ptr, rdsiz)) errsig(ec, ERR_LDGAM); if (ctx->fiolcxflg & FIOFCRYPT) @@ -91,21 +91,21 @@ void fiorcls(fiolcxdef *ctx) } /* - * Read an HTMLRES resource map + * Read an HTMLRES resource map */ static void fiordhtml(errcxdef *ec, osfildef *fp, appctxdef *appctx, int resfileno, const char *resfilename) { uchar buf[256]; - /* - * resource map - if the host system is interested, tell it about it + /* + * resource map - if the host system is interested, tell it about it */ if (appctx != 0) { ulong entry_cnt; ulong i; - + /* read the index table header */ if (osfrb(fp, buf, 8)) errsig1(ec, ERR_RDRSC, ERRTSTR, @@ -113,14 +113,14 @@ static void fiordhtml(errcxdef *ec, osfildef *fp, appctxdef *appctx, /* get the number of entries in the table */ entry_cnt = osrp4(buf); - + /* read the index entries */ for (i = 0 ; i < entry_cnt ; ++i) { ulong res_ofs; ulong res_siz; ushort res_namsiz; - + /* read this entry */ if (osfrb(fp, buf, 10)) errsig1(ec, ERR_RDRSC, ERRTSTR, @@ -130,12 +130,12 @@ static void fiordhtml(errcxdef *ec, osfildef *fp, appctxdef *appctx, res_ofs = osrp4(buf); res_siz = osrp4(buf + 4); res_namsiz = osrp2(buf + 8); - + /* read this entry's name */ if (osfrb(fp, buf, res_namsiz)) errsig1(ec, ERR_RDRSC, ERRTSTR, errstr(ec, resfilename, strlen(resfilename))); - + /* tell the host system about this entry */ if (appctx->add_resource) (*appctx->add_resource)(appctx->add_resource_ctx, @@ -144,7 +144,7 @@ static void fiordhtml(errcxdef *ec, osfildef *fp, appctxdef *appctx, (size_t)res_namsiz, resfileno); } - + /* tell the host system where the resources start */ if (appctx->set_resmap_seek != 0) { @@ -158,7 +158,7 @@ static void fiordhtml(errcxdef *ec, osfildef *fp, appctxdef *appctx, /* * Read an external resource file. This is a limited version of the * general file reader that can only read resource files, not full game - * files. + * files. */ static void fiordrscext(errcxdef *ec, osfildef *fp, appctxdef *appctx, int resfileno, char *resfilename) @@ -169,7 +169,7 @@ static void fiordrscext(errcxdef *ec, osfildef *fp, appctxdef *appctx, /* note the starting offset */ startofs = osfpos(fp); - + /* check file and version headers, and get flags and timestamp */ if (osfrb(fp, buf, (int)(sizeof(FIOFILHDR) + sizeof(FIOVSNHDR) + 2))) errsig1(ec, ERR_RDRSC, ERRTSTR, @@ -204,9 +204,9 @@ static void fiordrscext(errcxdef *ec, osfildef *fp, appctxdef *appctx, /* read the HTML resource map */ fiordhtml(ec, fp, appctx, resfileno, resfilename); - /* + /* * skip the resources - they're entirely for the host - * application's use + * application's use */ osfseek(fp, endpos + startofs, OSFSK_SET); } @@ -271,10 +271,10 @@ static void fiord1(mcmcxdef *mctx, voccxdef *vctx, tokcxdef *tctx, errsig(ec, ERR_BADVSN); if (osfrb(fp, vctx->voccxtim, (size_t)26)) errsig(ec, ERR_RDGAM); - /* + /* * if the game wasn't compiled with 2.2 or later, make a note, * because we need to ignore certain property flags (due to a bug in - * the old compiler) + * the old compiler) */ if (memcmp(buf + sizeof(FIOFILHDR), FIOVSNHDR2, (size_t)sizeof(FIOVSNHDR2)) == 0 @@ -284,7 +284,7 @@ static void fiord1(mcmcxdef *mctx, voccxdef *vctx, tokcxdef *tctx, setupctx->fiolcxflg = *flagp = osrp2(buf + sizeof(FIOFILHDR) + sizeof(FIOVSNHDR)); - + /* now read resources from the file */ for (;;) { @@ -293,7 +293,7 @@ static void fiord1(mcmcxdef *mctx, voccxdef *vctx, tokcxdef *tctx, || osfrb(fp, buf + 1, (int)(buf[0] + 4))) errsig(ec, ERR_RDGAM); endpos = osrp4(buf + 1 + buf[0]); - + if (fioisrsc(buf, "OBJ")) { /* skip regular objects if fast-load records are included */ @@ -318,7 +318,7 @@ static void fiord1(mcmcxdef *mctx, voccxdef *vctx, tokcxdef *tctx, mcmrsrv(mctx, (ushort)osrp2(buf + 3), (mcmon)obj, (mclhd)curpos); curpos += osrp2(buf + 5) + 7; - + /* load object if preloading */ if (flags & 2) { @@ -329,13 +329,13 @@ static void fiord1(mcmcxdef *mctx, voccxdef *vctx, tokcxdef *tctx, /* seek past this object */ osfseek(fp, curpos + startofs, OSFSK_SET); break; - + case TOKSTFWDOBJ: case TOKSTFWDFN: { ushort bsiz; uchar *p; - + if (osfrb(fp, buf+3, 2)) errsig(ec, ERR_RDGAM); bsiz = osrp2(buf+3); p = mcmalonum(mctx, bsiz, (mcmon)obj); @@ -344,7 +344,7 @@ static void fiord1(mcmcxdef *mctx, voccxdef *vctx, tokcxdef *tctx, curpos += 5 + bsiz; break; } - + case TOKSTEXTERN: if (!vctx->voccxrun->runcxext) errsig(ec, ERR_UNXEXT); @@ -356,7 +356,7 @@ static void fiord1(mcmcxdef *mctx, voccxdef *vctx, tokcxdef *tctx, ex->runxnam[buf[3]] = '\0'; curpos += buf[3] + 4; break; - + default: errsig(ec, ERR_UNKOTYP); } @@ -367,13 +367,13 @@ static void fiord1(mcmcxdef *mctx, voccxdef *vctx, tokcxdef *tctx, uchar *p; uchar *bufp; ulong bsiz; - + if (!(*flagp & FIOFFAST)) { osfseek(fp, endpos + startofs, OSFSK_SET); continue; } - + curpos = osfpos(fp) - startofs; bsiz = endpos - curpos; if (bsiz && bsiz < OSMALMAX @@ -400,7 +400,7 @@ static void fiord1(mcmcxdef *mctx, voccxdef *vctx, tokcxdef *tctx, (mclhd)osrp4(p + 7)); p += 11; bsiz -= 11; - + /* preload object if desired */ if (flags & 2) { @@ -408,23 +408,23 @@ static void fiord1(mcmcxdef *mctx, voccxdef *vctx, tokcxdef *tctx, mcmunlck(mctx, (mcmon)obj); } break; - + case TOKSTEXTERN: if (!vctx->voccxrun->runcxext) errsig(ec, ERR_UNXEXT); ex = &vctx->voccxrun->runcxext[obj]; - + memcpy(ex->runxnam, p + 4, (size_t)p[3]); ex->runxnam[p[3]] = '\0'; bsiz -= p[3] + 4; p += p[3] + 4; break; - + default: errsig(ec, ERR_UNKOTYP); } } - + /* done with temporary block; free it */ osfree(bufp); osfseek(fp, endpos + startofs, OSFSK_SET); @@ -443,7 +443,7 @@ static void fiord1(mcmcxdef *mctx, voccxdef *vctx, tokcxdef *tctx, mcmrsrv(mctx, (ushort)osrp2(buf + 3), (mcmon)obj, (mclhd)osrp4(buf + 7)); curpos += 11; - + /* preload object if desired */ if (flags & 2) { @@ -452,19 +452,19 @@ static void fiord1(mcmcxdef *mctx, voccxdef *vctx, tokcxdef *tctx, osfseek(fp, curpos + startofs, OSFSK_SET); } break; - + case TOKSTEXTERN: if (!vctx->voccxrun->runcxext) errsig(ec, ERR_UNXEXT); ex = &vctx->voccxrun->runcxext[obj]; - + if (osfrb(fp, buf + 3, 1) || osfrb(fp, ex->runxnam, (int)buf[3])) errsig(ec, ERR_RDGAM); ex->runxnam[buf[3]] = '\0'; curpos += buf[3] + 4; break; - + default: errsig(ec, ERR_UNKOTYP); } @@ -488,9 +488,9 @@ static void fiord1(mcmcxdef *mctx, voccxdef *vctx, tokcxdef *tctx, siz = osrp2(buf); #if 0 -/* +/* * external functions are now obsolete - do not load - */ + */ /* look for an external function with the same name */ for (i = vctx->voccxrun->runcxexc, ex = vctx->voccxrun->runcxext @@ -522,9 +522,9 @@ static void fiord1(mcmcxdef *mctx, voccxdef *vctx, tokcxdef *tctx, /* read the resources */ fiordhtml(ec, fp, appctx, 0, fname); - /* + /* * skip the resources - they're entirely for the host - * application's use + * application's use */ osfseek(fp, endpos + startofs, OSFSK_SET); } @@ -533,7 +533,7 @@ static void fiord1(mcmcxdef *mctx, voccxdef *vctx, tokcxdef *tctx, uchar *p; uchar *bufp; ulong bsiz; - + /* do it in a single file read, if we can, for speed */ curpos = osfpos(fp) - startofs; bsiz = endpos - curpos; @@ -554,15 +554,15 @@ static void fiord1(mcmcxdef *mctx, voccxdef *vctx, tokcxdef *tctx, { i = osrp2(p + 7); obj = osrp2(p + 1); - + vociadd(vctx, (objnum)obj, (objnum)osrp2(p+3), i, (objnum *)(p + 9), p[0] | VOCIFXLAT); vocinh(vctx, obj)->vociilc = osrp2(p + 5); - + p += 9 + (2 * i); bsiz -= 9 + (2 * i); } - + /* done with temporary block; free it */ osfree(bufp); } @@ -574,11 +574,11 @@ static void fiord1(mcmcxdef *mctx, voccxdef *vctx, tokcxdef *tctx, i = osrp2(buf + 7); /* get number of superclasses */ obj = osrp2(buf + 1); /* get object number */ if (i && osfrb(fp, buf + 9, 2 * i)) errsig(ec, ERR_RDGAM); - + vociadd(vctx, (objnum)obj, (objnum)osrp2(buf+3), i, (objnum *)(buf + 9), buf[0] | VOCIFXLAT); vocinh(vctx, obj)->vociilc = osrp2(buf + 5); - + curpos += 9 + (2 * i); } } @@ -598,7 +598,7 @@ static void fiord1(mcmcxdef *mctx, voccxdef *vctx, tokcxdef *tctx, vctx->voccxini = osrp2(buf+12); vctx->voccxpre = osrp2(buf+14); vctx->voccxper = osrp2(buf+16); - + /* if we have a cmdPrompt function, read it */ if (siz >= 20) vctx->voccxprom = osrp2(buf + 18); @@ -649,9 +649,9 @@ static void fiord1(mcmcxdef *mctx, voccxdef *vctx, tokcxdef *tctx, vctx->voccxperp = MCMONINV; } - /* + /* * if we have commandAfterRead and initRestore, read them as - * well + * well */ if (siz >= 38) { @@ -716,7 +716,7 @@ static void fiord1(mcmcxdef *mctx, voccxdef *vctx, tokcxdef *tctx, ulong bsiz; int len1 = 0; int len2 = 0; - + /* do it in a single file read, if we can, for speed */ curpos = osfpos(fp) - startofs; bsiz = endpos - curpos; @@ -732,7 +732,7 @@ static void fiord1(mcmcxdef *mctx, voccxdef *vctx, tokcxdef *tctx, sizcur = (siz2 > (uint)0xffff ? (uint)0xffff : siz2); if (osfrb(fp, p1, sizcur)) errsig(ec, ERR_RDGAM); } - + while (bsiz) { len1 = osrp2(p); @@ -743,11 +743,11 @@ static void fiord1(mcmcxdef *mctx, voccxdef *vctx, tokcxdef *tctx, vocadd2(vctx, (prpnum)osrp2(p+4), (objnum)osrp2(p+6), osrp2(p+8), p + 10, len1, (len2 ? p + 10 + len1 : (uchar*)0), len2); - + p += 10 + len1 + len2; bsiz -= 10 + len1 + len2; } - + /* done with the temporary block; free it up */ osfree(bufp); } @@ -760,7 +760,7 @@ static void fiord1(mcmcxdef *mctx, voccxdef *vctx, tokcxdef *tctx, || osfrb(fp, buf + 10, (len1 = osrp2(buf)) + (len2 = osrp2(buf + 2)))) errsig(ec, ERR_RDGAM); - + if (*flagp & FIOFCRYPT) fioxor(buf + 10, (uint)(len1 + len2), xor_seed, xor_inc); @@ -775,14 +775,14 @@ static void fiord1(mcmcxdef *mctx, voccxdef *vctx, tokcxdef *tctx, { uchar *fmts; uint fmtl; - + if (osfrb(fp, buf, 2)) errsig(ec, ERR_RDGAM); fmtl = osrp2(buf); fmts = mchalo(vctx->voccxerr, fmtl, "fiord1"); if (osfrb(fp, fmts, fmtl)) errsig(ec, ERR_RDGAM); if (*flagp & FIOFCRYPT) fioxor(fmts, fmtl, xor_seed, xor_inc); tiosetfmt(vctx->voccxtio, vctx->voccxrun, fmts, fmtl); - + if (fmtsp) *fmtsp = fmts; if (fmtlp) *fmtlp = fmtl; } @@ -813,14 +813,14 @@ static void fiord1(mcmcxdef *mctx, voccxdef *vctx, tokcxdef *tctx, else if (fioisrsc(buf, "SYMTAB")) { tokthdef *symtab; - + /* if there's no debugger context, don't bother with this */ if (!vctx->voccxrun->runcxdbg) { osfseek(fp, endpos + startofs, OSFSK_SET); continue; } - + if (!(symtab = vctx->voccxrun->runcxdbg->dbgcxtab)) { symtab = (tokthdef *)mchalo(ec, sizeof(tokthdef), @@ -828,18 +828,18 @@ static void fiord1(mcmcxdef *mctx, voccxdef *vctx, tokcxdef *tctx, tokthini(ec, mctx, (toktdef *)symtab); vctx->voccxrun->runcxdbg->dbgcxtab = symtab; } - + /* read symbols until we find a zero-length symbol */ for (;;) { int hash; - + if (osfrb(fp, buf, 4)) errsig(ec, ERR_RDGAM); if (buf[0] == 0) break; if (osfrb(fp, buf + 4, (int)buf[0])) errsig(ec, ERR_RDGAM); buf[4 + buf[0]] = '\0'; hash = tokhsh((char *)buf + 4); - + (*symtab->tokthsc.toktfadd)((toktdef *)symtab, (char *)buf + 4, (int)buf[0], (int)buf[1], @@ -854,7 +854,7 @@ static void fiord1(mcmcxdef *mctx, voccxdef *vctx, tokcxdef *tctx, osfseek(fp, endpos + startofs, OSFSK_SET); continue; } - + while ((osfpos(fp) - startofs) != endpos) { /* the only thing we know how to read is linfdef's */ @@ -864,10 +864,10 @@ static void fiord1(mcmcxdef *mctx, voccxdef *vctx, tokcxdef *tctx, } else if (fioisrsc(buf, "SRC2")) { - /* + /* * this is simply a marker indicating that we have new-style * (line-number-based) source debugging information in the - * file -- set the new-style debug info flag + * file -- set the new-style debug info flag */ if (vctx->voccxrun->runcxdbg != 0) vctx->voccxrun->runcxdbg->dbgcxflg |= DBGCXFLIN2; @@ -933,7 +933,7 @@ static void fiord1(mcmcxdef *mctx, voccxdef *vctx, tokcxdef *tctx, else if (fioisrsc(buf, "CHRSET")) { size_t len; - + /* read the character set ID and LDESC */ if (osfrb(fp, buf, 6) || (len = osrp2(buf+4)) > CMAP_LDESC_MAX_LEN @@ -971,13 +971,13 @@ void fiord(mcmcxdef *mctx, voccxdef *vctx, tokcxdef *tctx, const char *fname, osfildef *fp; ulong startofs; const char *display_fname; - + /* presume there will be no need to run preinit */ *preinit = MCMONINV; - /* + /* * get the display filename - use the real filename if one is - * provided, otherwise use the name of the executable file itself + * provided, otherwise use the name of the executable file itself */ display_fname = (fname != 0 ? fname : exename); @@ -996,16 +996,16 @@ void fiord(mcmcxdef *mctx, voccxdef *vctx, tokcxdef *tctx, const char *fname, } else G_os_gamename[0] = '\0'; - + /* open the file and read and check file header */ fp = (fname != 0 ? osfoprb(fname, OSFTGAME) : os_exeseek(exename, "TGAM")); if (fp == 0) errsig(vctx->voccxerr, ERR_OPRGAM); - /* + /* * we've identified the .GAM file source - tell the host system - * about it, if it's interested + * about it, if it's interested */ if (appctx != 0 && appctx->set_game_name != 0) (*appctx->set_game_name)(appctx->set_game_name_ctx, display_fname); @@ -1015,9 +1015,9 @@ void fiord(mcmcxdef *mctx, voccxdef *vctx, tokcxdef *tctx, const char *fname, ERRBEGIN(vctx->voccxerr) - /* + /* * Read the game file. Note that the .GAM file always has resource - * file number zero. + * file number zero. */ fiord1(mctx, vctx, tctx, fp, display_fname, setupctx, startofs, preinit, flagp, path, @@ -1027,7 +1027,7 @@ void fiord(mcmcxdef *mctx, voccxdef *vctx, tokcxdef *tctx, const char *fname, * If the host system accepts additional resource files, look for * additional resource files. These are files in the same directory * as the .GAM file, with the .GAM suffix replaced by suffixes from - *. RS0 to .RS9. + *. RS0 to .RS9. */ if (appctx != 0 && appctx->add_resfile != 0) { @@ -1054,17 +1054,17 @@ void fiord(mcmcxdef *mctx, voccxdef *vctx, tokcxdef *tctx, const char *fname, osfildef *fpres; int resfileno; - /* + /* * Build the next resource filename. If there's an explicit * resource path, use it, otherwise use the same directory - * that contains the .GAM file. + * that contains the .GAM file. */ if (appctx->ext_res_path != 0) { /* * There's an explicit resource path - append the root * (filename-only, minus path) portion of the .GAM file - * name to the resource path. + * name to the resource path. */ os_build_full_path(resname, sizeof(resname), appctx->ext_res_path, @@ -1072,10 +1072,10 @@ void fiord(mcmcxdef *mctx, voccxdef *vctx, tokcxdef *tctx, const char *fname, } else { - /* + /* * there's no resource path - use the entire .GAM * filename, including directory, so that we look in the - * same directory that contains the .GAM file + * same directory that contains the .GAM file */ if (base_name != 0) strcpy(resname, base_name); @@ -1131,12 +1131,12 @@ void fiord(mcmcxdef *mctx, voccxdef *vctx, tokcxdef *tctx, const char *fname, /* save game header prefix - .GAM file information */ #define FIOSAVHDR_PREFIX "TADS2 save/g\012\015\032" -/* +/* * Saved game format version string - note that the length of the * version string must be fixed, so when this is updated, it must be * updated to another string of the same length. This should be updated * whenever a change is made to the format that can't be otherwise - * detected from the data stream in the saved game file. + * detected from the data stream in the saved game file. */ #define FIOSAVVSN "v2.2.1" @@ -1149,18 +1149,18 @@ static int fiorfda(osfildef *fp, vocddef *p, uint cnt) vocddef *q; uint i; uchar buf[14]; - + /* start by clearing out entire record */ for (i = 0, q = p ; i < cnt ; ++q, ++i) q->vocdfn = MCMONINV; - + /* now restore all the records from the file */ for (;;) { /* read a record, and quit if it's the last one */ if (osfrb(fp, buf, 13)) return(TRUE); if ((i = osrp2(buf)) == 0xffff) return(FALSE); - + /* restore this record */ q = p + i; q->vocdfn = osrp2(buf+2); @@ -1187,7 +1187,7 @@ static int fiorfda(osfildef *fp, vocddef *p, uint cnt) * Look in a saved game file to determine if it has information on which * GAM file created it. If the GAM file information is available, this * routine returns true and stores the game file name in the given - * buffer; if the information isn't available, we'll return false. + * buffer; if the information isn't available, we'll return false. */ int fiorso_getgame(char *saved_file, char *fnamebuf, size_t buflen) { @@ -1203,9 +1203,9 @@ int fiorso_getgame(char *saved_file, char *fnamebuf, size_t buflen) if (osfrb(fp, buf, (int)(sizeof(FIOSAVHDR_PREFIX) + 2)) || memcmp(buf, FIOSAVHDR_PREFIX, sizeof(FIOSAVHDR_PREFIX)) != 0) { - /* + /* * there's no game file information - close the file and - * indicate that we have no information + * indicate that we have no information */ osfcls(fp); return FALSE; @@ -1263,26 +1263,26 @@ int fiorso(voccxdef *vctx, char *fname) && memcmp(buf, FIOSAVHDR_PREFIX, sizeof(FIOSAVHDR_PREFIX)) == 0) { ulong skip_len; - + /* * The prefix header is present - skip it. The 2-byte value * following the header is the length of the prefix data block * (not including the header), so simply skip the additional - * number of bytes specified. + * number of bytes specified. */ skip_len = (ulong)osrp2(buf + sizeof(FIOSAVHDR_PREFIX)); osfseek(fp, skip_len, OSFSK_CUR); } else { - /* + /* * there's no prefix header - seek back to the start of the file * and read the standard header information */ osfseek(fp, 0, OSFSK_SET); } - + /* read headers and check */ if (osfrb(fp, buf, (int)(sizeof(FIOSAVHDR) + sizeof(FIOSAVVSN))) || memcmp(buf, FIOSAVHDR, (size_t)sizeof(FIOSAVHDR))) @@ -1307,20 +1307,20 @@ int fiorso(voccxdef *vctx, char *fname) } else { - /* + /* * this isn't a recognized version - the file must have been * saved by a newer version of the system, so we can't assume we - * will be able to parse the format + * will be able to parse the format */ result = FIORSO_BAD_FMT_VSN; goto ret_error; } - - /* + + /* * Read timestamp and check - the game must have been saved by the * same .GAM file that we are now running, because the .SAV file is * written entirely in terms of the contents of the .GAM file; any - * change in the .GAM file invalidates the .SAV file. + * change in the .GAM file invalidates the .SAV file. */ if (osfrb(fp, timestamp, 26) || memcmp(timestamp, vctx->voccxtim, (size_t)26)) @@ -1328,15 +1328,15 @@ int fiorso(voccxdef *vctx, char *fname) result = FIORSO_BAD_GAME_VSN; goto ret_error; } - + /* first revert every object to original (post-compilation) state */ vocrevert(vctx); - /* + /* * the most common error from here on is simply a file read error, * so presume that this is what will happen; if we are successful or * encounter a different error, we'll change the status at that - * point + * point */ result = FIORSO_READ_ERROR; @@ -1357,7 +1357,7 @@ int fiorso(voccxdef *vctx, char *fname) { int sccnt; objnum sc; - + /* create the object */ mutsiz = osrp2(buf + 3); p = mcmalonum(mctx, (ushort)mutsiz, (mcmon)obj); @@ -1386,17 +1386,17 @@ int fiorso(voccxdef *vctx, char *fname) int len1; int len2; char wrd[80]; - + /* read the header */ if (osfrb(fp, buf, 6)) goto ret_error; len1 = osrp2(buf+2); len2 = osrp2(buf+4); - + /* read the word text */ if (osfrb(fp, wrd, len1 + len2)) goto ret_error; - + /* add the word */ vocadd2(vctx, buf[0], obj, buf[1], wrd, len1, wrd + len1, len2); @@ -1410,7 +1410,7 @@ int fiorso(voccxdef *vctx, char *fname) /* get the remaining data from the header */ propcnt = osrp2(buf + 3); mutsiz = osrp2(buf + 5); - + /* expand object if it's not big enough for mutsiz */ p = mcmlck(mctx, (mcmon)obj); oldmutsiz = mcmobjsiz(mctx, (mcmon)obj) - objrst(p); @@ -1419,14 +1419,14 @@ int fiorso(voccxdef *vctx, char *fname) newsiz = mutsiz - oldmutsiz; p = (uchar *)objexp(mctx, obj, &newsiz); } - + /* reset statistics, and read mutable part from file */ mut = p + objrst(p); objsnp(p, propcnt); objsfree(p, mutsiz + objrst(p)); if (osfrb(fp, mut, mutsiz)) err = TRUE; - + /* reset ignore flags as needed */ objsetign(mctx, obj); } @@ -1437,7 +1437,7 @@ int fiorso(voccxdef *vctx, char *fname) if (err) goto ret_error; } - + /* read fuses/daemons/alarms */ if (fiorfda(fp, vctx->voccxdmn, vctx->voccxdmc) || fiorfda(fp, vctx->voccxfus, vctx->voccxfuc) @@ -1452,7 +1452,7 @@ int fiorso(voccxdef *vctx, char *fname) char wrd[80]; int flags; int typ; - + /* read the header */ if (osfrb(fp, buf, 8)) goto ret_error; @@ -1465,7 +1465,7 @@ int fiorso(voccxdef *vctx, char *fname) /* check to see if this is the end marker */ if (obj == MCMONINV) break; - + /* read the word text */ if (osfrb(fp, wrd+2, len1)) goto ret_error; @@ -1478,7 +1478,7 @@ int fiorso(voccxdef *vctx, char *fname) } else oswp2(wrd, len1 + 2); - + /* add or delete the word as appropriate */ if (flags & VOCFDEL) vocdel1(vctx, obj, (char *)wrd, (prpnum)typ, FALSE, FALSE, FALSE); @@ -1487,9 +1487,9 @@ int fiorso(voccxdef *vctx, char *fname) (uchar *)wrd+len1, len2); } - /* + /* * the following was added in save format version "v2.2.1", so skip - * it if the save version is older than that + * it if the save version is older than that */ if (version != 1) { @@ -1514,11 +1514,11 @@ static int fiowfda(osfildef *fp, vocddef *p, uint cnt) { uchar buf[14]; uint i; - + for (i = 0 ; i < cnt ; ++i, ++p) { if (p->vocdfn == MCMONINV) continue; /* not set - ignore */ - + oswp2(buf, i); /* element in array to be set */ oswp2(buf+2, p->vocdfn); /* object number for function/target */ buf[4] = p->vocdarg.runstyp; /* type of argument */ @@ -1537,11 +1537,11 @@ static int fiowfda(osfildef *fp, vocddef *p, uint cnt) } oswp2(buf+9, p->vocdprp); oswp2(buf+11, p->vocdtim); - + /* write this record to file */ if (osfwb(fp, buf, 13)) return(TRUE); } - + /* write end record - -1 for array element number */ oswp2(buf, 0xffff); return(osfwb(fp, buf, 13)); @@ -1558,13 +1558,13 @@ struct fiosav_cb_ctx /* * callback for vocabulary saver - called by voc_iterate for each word * defined for a particular object, allowing us to write all the words - * attached to a dynamically allocated object to the save file + * attached to a dynamically allocated object to the save file */ static void fiosav_cb(struct fiosav_cb_ctx *ctx, vocdef *voc, vocwdef *vocw) { char buf[10]; - + /* write the part of speech, flags, and word lengths */ buf[0] = vocw->vocwtyp; buf[1] = vocw->vocwflg; @@ -1581,13 +1581,13 @@ static void fiosav_cb(struct fiosav_cb_ctx *ctx, /* * Callback for vocabulary saver - called by voc_iterate for every * word. We'll write the word if it was dynamically added or deleted, - * so that we can restore that status when the game is restored. + * so that we can restore that status when the game is restored. */ static void fiosav_voc_cb(void *ctx0, vocdef *voc, vocwdef *vocw) { struct fiosav_cb_ctx *ctx = (struct fiosav_cb_ctx *)ctx0; char buf[10]; - + /* if the word was dynamically allocated or deleted, save it */ if ((vocw->vocwflg & VOCFNEW) || (vocw->vocwflg & VOCFDEL)) { @@ -1632,12 +1632,12 @@ int fiosav(voccxdef *vctx, char *fname, char *game_fname) * If we have game file information, save the game file information * with the saved game file. This lets the player start the * run-time and restore the game by specifying only the saved game - * file. + * file. */ if (game_fname != 0) { size_t len; - + /* write the prefix header */ len = strlen(game_fname); oswp2(buf, len); @@ -1646,7 +1646,7 @@ int fiosav(voccxdef *vctx, char *fname, char *game_fname) || osfwb(fp, game_fname, (int)len)) goto ret_error; } - + /* write save game header and timestamp */ if (osfwb(fp, FIOSAVHDR, (int)sizeof(FIOSAVHDR)) || osfwb(fp, FIOSAVVSN, (int)sizeof(FIOSAVVSN)) @@ -1674,7 +1674,7 @@ int fiosav(voccxdef *vctx, char *fname, char *game_fname) /* * If the object was dynamically allocated, write * the whole object. Otherwise, write just the - * mutable part. + * mutable part. */ if ((*v)->vociflg & VOCIFNEW) { @@ -1692,13 +1692,13 @@ int fiosav(voccxdef *vctx, char *fname, char *game_fname) #ifdef NEVER { int wrdcnt; - + /* count the words, and write the count */ voc_count(vctx, obj, 0, &wrdcnt, (int *)0); oswp2(buf, wrdcnt); if (osfwb(fp, buf, 2)) err = TRUE; - + /* write the words */ fnctx.err = 0; fnctx.fp = fp; @@ -1719,7 +1719,7 @@ int fiosav(voccxdef *vctx, char *fname, char *game_fname) || osfwb(fp, mut, mutsiz)) err = TRUE; } - + mcmunlck(mctx, (mcmon)obj); if (err != 0) goto ret_error; diff --git a/engines/glk/tads/tads2/file_io.h b/engines/glk/tads/tads2/file_io.h index 02d0754aee2..e425853734b 100644 --- a/engines/glk/tads/tads2/file_io.h +++ b/engines/glk/tads/tads2/file_io.h @@ -79,18 +79,18 @@ void fiorcls(fiolcxdef *ctx); /* loader callback - load an object on demand */ void OS_LOADDS fioldobj(void *ctx, mclhd handle, uchar *ptr, ushort siz); -/* +/* * Save a game - returns TRUE on failure. We'll save the file to * 'fname'. 'game_fname' is the name of the game file; if this is not * null, we'll save it to the saved game file so that the player can * later start the game by specifying only the saved game file to the * run-time. 'game_fname' can be null, in which case we'll omit the - * game file information. + * game file information. */ int fiosav(voccxdef *vctx, char *fname, char *game_fname); /* - * fiorso() result codes + * fiorso() result codes */ #define FIORSO_SUCCESS 0 /* success */ #define FIORSO_FILE_NOT_FOUND 1 /* file not found */ @@ -107,7 +107,7 @@ int fiorso(voccxdef *vctx, char *fname); * Look in a saved game file to determine if it has information on which * GAM file created it. If the GAM file information is available, this * routine returns true and stores the game file name in the given - * buffer; if the information isn't available, we'll return false. + * buffer; if the information isn't available, we'll return false. */ int fiorso_getgame(char *saved_file, char *buf, size_t buflen); diff --git a/engines/glk/tads/tads2/get_string.cpp b/engines/glk/tads/tads2/get_string.cpp index 55aa0937f2b..c7d39d23446 100644 --- a/engines/glk/tads/tads2/get_string.cpp +++ b/engines/glk/tads/tads2/get_string.cpp @@ -31,14 +31,14 @@ namespace TADS2 { /* * Global variable with the current command logging file. If this is - * not null, we'll log each command that we read to this file. + * not null, we'll log each command that we read to this file. */ osfildef *cmdfile; /* * External global with the current script input file. If this is * non-null, we'll read commands from this file rather than from the - * keyboard. + * keyboard. */ extern osfildef *scrfp; @@ -47,7 +47,7 @@ extern osfildef *scrfp; * a script input file (i.e., scrfp is non-null), and this variable is * true, it indicates that we're in "quiet" mode reading the script, so * we will not echo commands that we read from the script file to the - * display. + * display. */ extern int scrquiet; @@ -79,7 +79,7 @@ int getstring(const char *prompt, char *buf, int bufl) if (scrfp != 0) { int quiet = scrquiet; - + /* try reading from command input file */ if ((result = qasgets(buf, bufl)) == 0) { @@ -87,11 +87,11 @@ int getstring(const char *prompt, char *buf, int bufl) * End of command input file; return to reading the * keyboard. If we didn't already show the prompt, show it * now. - * + * * Note that qasgets() will have closed the script file * before returning eof, so we won't directly read the * command here but instead handle it later when we check to - * see if we need to read from the keyboard. + * see if we need to read from the keyboard. */ if (quiet && prompt != 0) outformat(prompt); @@ -103,7 +103,7 @@ int getstring(const char *prompt, char *buf, int bufl) * be turned off for one of two reasons: we're printing the * prompt, or we're reading from a script with no pauses. * In either case, moremode should be turned back on at this - * point. -CDN) + * point. -CDN) */ savemoremode = 1; @@ -120,14 +120,14 @@ int getstring(const char *prompt, char *buf, int bufl) { /* update the status line */ runstat(); - + /* read a line from the keyboard */ result = (char *)os_gets((uchar *)buf, bufl); - - /* + + /* * if the result is null, we're at eof, so return a non-zero * value; otherwise, we successfully read a command, so return - * zero + * zero */ retval = (result == 0); } @@ -144,12 +144,12 @@ int getstring(const char *prompt, char *buf, int bufl) else { char *p; - - /* + + /* * we got a command, or at least a partial command (if we timed * out, we may still have a partial line in the buffer) - write * the input line to the log and/or command files, as - * appropriate + * appropriate */ out_logfile_print(buf, TRUE); if (cmdfile != 0) diff --git a/engines/glk/tads/tads2/lib.h b/engines/glk/tads/tads2/lib.h index 3df447518a6..7167c589aa3 100644 --- a/engines/glk/tads/tads2/lib.h +++ b/engines/glk/tads/tads2/lib.h @@ -80,9 +80,9 @@ typedef int eword; # define noreg # define NOREG(arglist) -/* +/* * Linting directives. You can define these before including this file - * if you have a fussy compiler. + * if you have a fussy compiler. */ #ifdef LINT # ifndef NOTREACHED @@ -120,7 +120,7 @@ void varused(); /* * Define our own version of isspace(), so that we don't try to interpret - * anything outside of the normal ASCII set as spaces. + * anything outside of the normal ASCII set as spaces. */ #define t_isspace(c) \ (((unsigned char)(c)) <= 127 && Common::isSpace((unsigned char)(c))) diff --git a/engines/glk/tads/tads2/line_source.h b/engines/glk/tads/tads2/line_source.h index 61bfe6ff205..3894d459b88 100644 --- a/engines/glk/tads/tads2/line_source.h +++ b/engines/glk/tads/tads2/line_source.h @@ -91,7 +91,7 @@ struct lindef { /** * Maximum allowed value for linlln, in bytes. This allows subsystems * that need to maintain local copies of seek locations to know how big - * an area to allocate for them. + * an area to allocate for them. */ #define LINLLNMAX 20 diff --git a/engines/glk/tads/tads2/line_source_file.cpp b/engines/glk/tads/tads2/line_source_file.cpp index 67a18ddd830..193ca72037b 100644 --- a/engines/glk/tads/tads2/line_source_file.cpp +++ b/engines/glk/tads/tads2/line_source_file.cpp @@ -75,11 +75,11 @@ void linfini2(mcmcxdef *mctx, linfdef *linf, linf->linfcrec = 0; /* no debugger records written yet */ } -/* +/* * Initialize a file line source object. If must_find_file is true, * we'll fail if we can't find the file. Otherwise, we'll create the * linfdef even if we can't find the file, reserving the maximum space - * for its path name to be filled in later. + * for its path name to be filled in later. */ linfdef *linfini(mcmcxdef *mctx, errcxdef *ec, const char *filename, int flen, tokpdef *path, int must_find_file, @@ -92,7 +92,7 @@ linfdef *linfini(mcmcxdef *mctx, errcxdef *ec, const char *filename, char fbuf[OSFNMAX + 1]; tokpdef fakepath; int len; - + if (!path) { path = &fakepath; @@ -123,16 +123,16 @@ linfdef *linfini(mcmcxdef *mctx, errcxdef *ec, const char *filename, /* add the filename and null-terminate */ memcpy(fbuf + len, filename, (size_t)flen); fbuf[len + flen] = '\0'; - + /* attempt to open this file */ if ((fp = osfoprs(fbuf, OSFTTEXT)) != 0) break; } - /* + /* * If no file opened yet, search tads path; if that doesn't work, * let the debugger UI try to find the file. If nothing works, give - * up and return failure. + * up and return failure. */ if (fp == 0 && (!os_locate(filename, flen, (char *)0, fbuf, sizeof(fbuf)) @@ -140,7 +140,7 @@ linfdef *linfini(mcmcxdef *mctx, errcxdef *ec, const char *filename, { /* * Ask the debugger UI for advice. If the debugger isn't - * present, we'll get a failure code from this routine. + * present, we'll get a failure code from this routine. */ if (!dbgu_find_src(filename, flen, fbuf, sizeof(fbuf), must_find_file)) @@ -149,9 +149,9 @@ linfdef *linfini(mcmcxdef *mctx, errcxdef *ec, const char *filename, /* try opening the file */ if (fbuf[0] == '\0') { - /* + /* * we didn't get a filename - the UI wants to defer finding - * the file until later + * the file until later */ fp = 0; } @@ -161,31 +161,31 @@ linfdef *linfini(mcmcxdef *mctx, errcxdef *ec, const char *filename, fp = osfoprs(fbuf, OSFTTEXT); } - /* + /* * if the file isn't present, and we're required to find it, - * return failure + * return failure */ if (fp == 0 && must_find_file) return 0; } - + /* figure out how much space we need for the file's full name */ if (fp == 0) { - /* + /* * we didn't find the file, so we don't yet know its name - use * the maximum possible filename length for the buffer size, so * that we can store the final filename if we should figure out - * where the file is later on + * where the file is later on */ fbuf[0] = '\0'; len = sizeof(fbuf); } else { - /* + /* * we found the file, so we have its final name - allocate space - * for the known name + * for the known name */ len = (int)strlen(fbuf); } @@ -199,7 +199,7 @@ linfdef *linfini(mcmcxdef *mctx, errcxdef *ec, const char *filename, memcpy(linf->linfnam + flen + 1, fbuf, (size_t)len); linf->linfnam[flen + 1 + len] = '\0'; - + /* set all debugger pages to not-yet-allocated */ for (i = LINFPGMAX, objp = linf->linfpg ; i ; ++objp, --i) *objp = MCMONINV; @@ -228,47 +228,47 @@ int linfget(lindef *lin) memmove(linf->linfbuf, linf->linfbuf + linf->linfbufnxt, linf->linfnxtlen); - /* + /* * adjust the seek position to account for the fact that we've - * read ahead in the file + * read ahead in the file */ linf->linfseek -= linf->linfnxtlen; - /* + /* * Fill up the rest of the buffer. Leave one byte for a null * terminator and one byte for a possible extra newline pair - * character (see below), hence fill to sizeof(buf)-2. + * character (see below), hence fill to sizeof(buf)-2. */ rdlen = osfrbc(linf->linffp, linf->linfbuf + linf->linfnxtlen, sizeof(linf->linfbuf) - linf->linfnxtlen - 2); - /* + /* * the total space is the amount we had left over plus the - * amount we just read + * amount we just read */ rdlen += linf->linfnxtlen; } else { - /* + /* * We have nothing in the buffer - fill it up. Fill to * sizeof(buf)-2 to leave room for a null terminator plus a - * possible extra newline pair character (see below). + * possible extra newline pair character (see below). */ rdlen = osfrbc(linf->linffp, linf->linfbuf, sizeof(linf->linfbuf) - 2); } - /* + /* * if there's nothing in the buffer at this point, we've reached the - * end of the file + * end of the file */ if (rdlen == 0) return TRUE; - /* + /* * if the last line was not a continuation line, increment the line - * counter for the start of a new line + * counter for the start of a new line */ if (!(lin->linflg & LINFMORE)) ++(linf->linfnum); @@ -280,9 +280,9 @@ int linfget(lindef *lin) for (p = linf->linfbuf + linf->linfnxtlen ; *p != '\0' ; ++p) *p = cmap_n2i(*p); - /* + /* * scan the for the first newline in the buffer, allowing newline - * conventions that involve either CR or LF + * conventions that involve either CR or LF */ for (p = linf->linfbuf ; *p != '\n' && *p != '\r' && *p != '\0' ; ++p) ; @@ -290,18 +290,18 @@ int linfget(lindef *lin) * Check to see if this character is followed by its newline pair * complement, to allow for either CR-LF or LF-CR sequences, as well * as plain single-byte newline (CR or LF) sequences. - * + * * First, though, one weird special case: if this character is at * the read limit in the buffer, the complementary character might * be lurking in the next byte that we haven't read. In this case, * use that one-byte reserve we have left (we filled the buffer only - * to length-2 so far) and read the next byte. + * to length-2 so far) and read the next byte. */ if (*p != '\0' && p + 1 == linf->linfbuf + sizeof(linf->linfbuf) - 2) { - /* + /* * we've filled the buffer to but not including the reserve for - * just this case - fetch the extra character + * just this case - fetch the extra character */ if (osfrbc(linf->linffp, p + 1, 1) == 1) { @@ -311,9 +311,9 @@ int linfget(lindef *lin) } } - /* + /* * now we can check for the newline type, since we have definitely - * read the full paired sequence + * read the full paired sequence */ if (*p == '\0') { @@ -346,18 +346,18 @@ int linfget(lindef *lin) /* this is the end of a line */ lin->linflg &= ~LINFMORE; - /* + /* * return only the part of the buffer up to, but not including, - * the newline + * the newline */ lin->linlen = (p - linf->linfbuf); /* null-terminate the buffer at the newline */ *p = '\0'; - /* + /* * anything remaining after the newline sequence is available - * for reading the next time through + * for reading the next time through */ linf->linfbufnxt = ((p + nl_len) - linf->linfbuf); linf->linfnxtlen = rdlen - linf->linfbufnxt; @@ -378,7 +378,7 @@ int linfget(lindef *lin) void linfppos(lindef *lin, char *buf, uint buflen) { VARUSED(buflen); - + sprintf(buf, "%s(%lu): ", ((linfdef *)lin)->linfnam, ((linfdef *)lin)->linfnum); } @@ -419,18 +419,18 @@ int linfwrt(lindef *lin, osfildef *fp) oswp4(buf + 2, linf->linfcrec); memcpy(buf + 6, linf->linfnam, (size_t)buf[1]); if (osfwb(fp, buf, (int)(buf[1] + 6))) return(TRUE); - + /* write the debug source pages */ if (!linf->linfcrec) return(FALSE); /* no debug records at all */ pgcnt = 1 + ((linf->linfcrec - 1) >> 10); /* figure number of pages */ - + for (objn = linf->linfpg ; pgcnt ; ++objn, --pgcnt) { objp = mcmlck(linf->linfmem, *objn); if (osfwb(fp, objp, (1024 * DBGLINFSIZ))) return(TRUE); mcmunlck(linf->linfmem, *objn); } - + return(FALSE); # undef linf @@ -444,12 +444,12 @@ int linfload(osfildef *fp, dbgcxdef *dbgctx, errcxdef *ec, tokpdef *path) uint pgcnt; uchar *objp; mcmon *objn; - + /* read the source's description from the file */ if (osfrb(fp, buf, 6) || osfrb(fp, buf + 6, (int)buf[1])) return TRUE; - + /* initialize the linfdef */ if (!(linf = linfini(dbgctx->dbgcxmem, ec, (char *)buf + 6, (int)buf[1], path, FALSE, FALSE))) @@ -458,31 +458,31 @@ int linfload(osfildef *fp, dbgcxdef *dbgctx, errcxdef *ec, tokpdef *path) errstr(ec, (char *)buf+6, (int)buf[1])); return TRUE; } - + /* if we opened the file, close it - don't hold all files open */ if (linf->linffp != 0) { osfcls(linf->linffp); linf->linffp = 0; } - + /* link into debug line source chain */ linf->linflin.linnxt = dbgctx->dbgcxlin; dbgctx->dbgcxlin = &linf->linflin; linf->linflin.linid = buf[0]; linf->linfcrec = osrp4(buf + 2); - + /* make sure the max line id is set above current line */ if (buf[0] >= dbgctx->dbgcxfid) dbgctx->dbgcxfid = buf[0] + 1; - + /* make sure we have some debug records */ if (!linf->linfcrec) return FALSE; /* figure number of pages */ pgcnt = 1 + ((linf->linfcrec - 1) >> 10); - + /* allocate and read the debug source pages */ for (objn = linf->linfpg ; pgcnt ; ++objn, --pgcnt) { @@ -511,25 +511,25 @@ void linfcmp(lindef *lin, uchar *buf) &linf->linfpg[pg]); else objptr = mcmlck(linf->linfmem, linf->linfpg[pg]); - + /* write the record to the appropriate offset within the page */ memcpy(objptr + (linf->linfcrec & 1023) * DBGLINFSIZ, buf, (size_t)DBGLINFSIZ); - + /* increment counter of line records so far */ ++(linf->linfcrec); - + /* done with page - touch it and unlock it */ mcmtch(linf->linfmem, linf->linfpg[pg]); mcmunlck(linf->linfmem, linf->linfpg[pg]); - + # undef linf } /* * Renumber an existing object. Searches through all line records for * any with the given object number, and changes the number to the new - * number if found. + * number if found. */ void linfren(lindef *lin, objnum oldnum, objnum newnum) { @@ -580,7 +580,7 @@ void linfren(lindef *lin, objnum oldnum, objnum newnum) /* * Delete an existing object. Searches through all line records for any * with the given object number, and removes line records for the object - * number if found. + * number if found. */ void linfdelnum(lindef *lin, objnum objn) { @@ -614,7 +614,7 @@ void linfdelnum(lindef *lin, objnum objn) for (i = 0 ; i < pgtot ; ++i, objp += DBGLINFSIZ) { int j; - + /* check this one */ if (osrp2(objp) == objn) { @@ -622,16 +622,16 @@ void linfdelnum(lindef *lin, objnum objn) uint pg; int delcnt; int totrem; - - /* + + /* * it matches - delete it, along with any subsequent - * contiguous entries that also match it + * contiguous entries that also match it */ for (delcnt = 1, j = i + 1 ; j < pgtot ; ++j, ++delcnt) { - /* + /* * if this one doesn't match, we've found the end of - * the contiguous records for this object + * the contiguous records for this object */ if (osrp2(objp + (j - i)*DBGLINFSIZ) != objn) break; @@ -642,18 +642,18 @@ void linfdelnum(lindef *lin, objnum objn) memmove(objp, objp + delcnt*DBGLINFSIZ, (pgtot - j)*DBGLINFSIZ); - /* + /* * if this isn't the last page, copy the bottom of the - * next page to the gap at the top of this page + * next page to the gap at the top of this page */ if (pgcnt > 1) { /* lock the next page */ nxtp = mcmlck(linf->linfmem, *(pgobjn + 1)); - /* + /* * copy from the beginning of the next page to the - * end of this page + * end of this page */ memcpy(objp_orig + (pgtot - delcnt)*DBGLINFSIZ, nxtp, delcnt*DBGLINFSIZ); @@ -663,17 +663,17 @@ void linfdelnum(lindef *lin, objnum objn) } else { - /* + /* * this is the last page, so there's no next page to * copy items from - reduce the count of items on - * this page accordingly + * this page accordingly */ pgtot -= delcnt; } /* * Now rearrange all subsequent pages to accommodate the - * gap we just created + * gap we just created */ for (totrem = tot, pg = 1 ; pg < pgcnt ; totrem -= 1024, ++pg) @@ -683,7 +683,7 @@ void linfdelnum(lindef *lin, objnum objn) /* figure how many we have on this page */ curtot = (totrem > 1024 ? 1024 : totrem); - + /* lock this page */ curp = mcmlck(linf->linfmem, *(pgobjn + pg)); @@ -697,9 +697,9 @@ void linfdelnum(lindef *lin, objnum objn) /* lock the next page */ nxtp = mcmlck(linf->linfmem, *(pgobjn + pg + 1)); - /* + /* * copy from the start of the next page to the - * end of this page + * end of this page */ memcpy(curp + (curtot - delcnt)*DBGLINFSIZ, nxtp, delcnt*DBGLINFSIZ); @@ -748,7 +748,7 @@ void linffind(lindef *lin, char *buf, objnum *objp, uint *ofsp) /* we haven't traversed any records yet */ objn = MCMONINV; ofs = 0; - + /* run a binary search for the indicated line record */ first = 0; last = linf->linfcrec - 1; @@ -771,7 +771,7 @@ void linffind(lindef *lin, char *buf, objnum *objp, uint *ofsp) /* calculate the page containing this item */ pg = cur >> 10; - + /* get object + offset corresponding to current source line */ objptr = mcmlck(linf->linfmem, linf->linfpg[pg]); bufptr = objptr + ((cur & 1023) * DBGLINFSIZ); @@ -797,12 +797,12 @@ void linffind(lindef *lin, char *buf, objnum *objp, uint *ofsp) else last = (cur == last ? last - 1 : cur); } - + # undef linf } -/* - * copy line records to an array of linfinfo structures +/* + * copy line records to an array of linfinfo structures */ void linf_copy_linerecs(linfdef *linf, struct linfinfo *info) { @@ -829,7 +829,7 @@ void linf_copy_linerecs(linfdef *linf, struct linfinfo *info) for (cur = 0 ; cur < last ; ++cur, ++info) { uchar *codeptr; - + /* calculate the page containing this item */ pg = cur >> 10; @@ -845,7 +845,7 @@ void linf_copy_linerecs(linfdef *linf, struct linfinfo *info) /* this is now the previous page */ prvpg = pg; } - + /* get object + offset corresponding to current source line */ bufptr = objptr + ((cur & 1023) * DBGLINFSIZ); info->objn = osrp2(bufptr); @@ -872,7 +872,7 @@ void linfdis(lindef *lin) osfcls(linf->linffp); linf->linffp = (osfildef *)0; } - + # undef linf } @@ -890,7 +890,7 @@ void linfact(lindef *lin) * If the full path name is empty, it means that the UI told us to * defer searching for the file until we actually need the file. At * this point, we actually need the file. Ask the UI again to find - * the file. + * the file. */ if (fname[0] != '\0' || dbgu_find_src(linf->linfnam, strlen(linf->linfnam), @@ -925,7 +925,7 @@ void linfseek(lindef *lin, uchar *pos) { # define linf ((linfdef *)lin) long seekpos; - + seekpos = osrp4(pos); osfseek(linf->linffp, seekpos, OSFSK_SET); @@ -987,21 +987,21 @@ int linfgets(lindef *lin, uchar *buf, uint siz) if (*p != '\0') { uchar *nxt; - - /* + + /* * Scan for non-line-ending characters after this line-ending * character. If we find any, we must have non-standard newline * conventions in this file. To be tolerant of these, seek back * to the start of the next line in these cases and read the - * next line from the new location. + * next line from the new location. */ for (nxt = p + 1 ; *nxt == '\r' || *nxt == '\n' ; ++nxt) ; if (*nxt == '\0') { - /* + /* * we had only line-ending characters after the first * line-ending character -- simply end the line after the - * first line-ending character + * first line-ending character */ *(p+1) = '\0'; } @@ -1013,7 +1013,7 @@ int linfgets(lindef *lin, uchar *buf, uint siz) * local newline conventions. Seek back to the next * character following the last line-ending character so * that we start the next line here, and end the current - * line after the first line-ending character. + * line after the first line-ending character. */ *(p+1) = '\0'; osfseek(linf->linffp, startpos + (nxt - buf), OSFSK_SET); @@ -1062,7 +1062,7 @@ long linfofs(lindef *lin) # define linf ((linfdef *)lin) return(osfpos(linf->linffp)); - + # undef linf } diff --git a/engines/glk/tads/tads2/line_source_file.h b/engines/glk/tads/tads2/line_source_file.h index 6658387f7b9..dd3b8a1672c 100644 --- a/engines/glk/tads/tads2/line_source_file.h +++ b/engines/glk/tads/tads2/line_source_file.h @@ -37,19 +37,19 @@ struct tokpdef; /* maximum number of pages of debugging records we can keep */ #define LINFPGMAX 128 -/* +/* * executable line information structure: this record relates one * executable line to the object containing the p-code, and the offset - * in the object of the p-code for the start of the line + * in the object of the p-code for the start of the line */ struct linfinfo { - /* + /* * OPCLINE data (file seek position or line number, depending on how * the game was compiled: -ds -> file seek offset, -ds2 -> line - * number) + * number) */ ulong fpos; - + /* object number */ objnum objn; @@ -57,8 +57,8 @@ struct linfinfo { uint ofs; }; -/* - * file line source +/* + * file line source */ struct linfdef { lindef linflin; /* superclass data */ diff --git a/engines/glk/tads/tads2/ltk.cpp b/engines/glk/tads/tads2/ltk.cpp index 6e32359312a..6fe74e7fd28 100644 --- a/engines/glk/tads/tads2/ltk.cpp +++ b/engines/glk/tads/tads2/ltk.cpp @@ -119,7 +119,7 @@ void *ltk_sigalloc(errcxdef *errcx, size_t siz) { /* * ltk_free - free a block of memory allocated by ltk_alloc. This * takes the memory handle stashed just behind the allocation, and frees - * the block of memory. + * the block of memory. */ void ltk_free(void *mem) { free(mem); diff --git a/engines/glk/tads/tads2/ltk.h b/engines/glk/tads/tads2/ltk.h index fa66b8a7c72..32b96cb0b6f 100644 --- a/engines/glk/tads/tads2/ltk.h +++ b/engines/glk/tads/tads2/ltk.h @@ -38,13 +38,13 @@ namespace TADS2 { /* * ltkini - allocate and INItialize ltk context. 'heapsiz' is the * requested size for the local heap. Returns 0 if the request cannot be - * satisfied. + * satisfied. */ extern void ltkini(unsigned short heapsiz); /* - * ltkfre - FREe ltk context. + * ltkfre - FREe ltk context. */ extern void ltkfre(); @@ -54,7 +54,7 @@ extern void ltkfre(); * 'title' specifies the title to use in the dialog box, 'msg' is the * text message, which may contain printf-style formatting. * printf-style arguments must be passed in also, if the message - * requires them. + * requires them. */ extern void ltk_dlg(const char *title, const char *msg, ...); @@ -67,7 +67,7 @@ extern void ltk_errlog(void *ctx, const char *fac, int errCode, int agrc, errade /* * ltk_alloc - ALLOCate permanent global memory. Returns 0 if the - * request cannot be satisfied. + * request cannot be satisfied. */ extern void *ltk_alloc(size_t siz); @@ -77,7 +77,7 @@ extern void *ltk_realloc(void *ptr, size_t siz); /* * ltk_sigalloc - ALLOCate permanent global memory, signals error on - * failure. + * failure. */ extern void *ltk_sigalloc(struct errcxdef *errcx, size_t siz); @@ -90,33 +90,33 @@ extern void ltk_free(void *ptr); /* * ltk_suballoc - SUB-ALLOCate memory from user heap. Returns 0 if the - * request cannot be satisfied. + * request cannot be satisfied. */ extern void *ltk_suballoc(size_t siz); /* * ltk_sigsuballoc - SUB-ALLOCate memory from user heap, signals error - * on failure. + * on failure. */ extern void *ltk_sigsuballoc(struct errcxdef *errcx, size_t siz); /* * ltk_subfree - SUBsegment FREE. Frees memory allocated by - * ltk_suballoc. + * ltk_suballoc. */ extern void ltk_subfree(void *ptr); /* - * ltk_beep - BEEP the user. + * ltk_beep - BEEP the user. */ extern void ltk_beep(void); /* - * ltk_beg_wait - signal that the user needs to wait. + * ltk_beg_wait - signal that the user needs to wait. */ extern void ltk_beg_wait(void); diff --git a/engines/glk/tads/tads2/memory_cache.cpp b/engines/glk/tads/tads2/memory_cache.cpp index 8e26dd303f6..8bd9f1cffd6 100644 --- a/engines/glk/tads/tads2/memory_cache.cpp +++ b/engines/glk/tads/tads2/memory_cache.cpp @@ -98,10 +98,10 @@ mcmcxdef *mcmcini(mcmcx1def *globalctx, uint pages, { mcmcxdef *ret; ushort siz; - + siz = sizeof(mcmcxdef) + sizeof(mcmon *) * (pages - 1); IF_DEBUG(siz += sizeof(ulong)); - + ret = (mcmcxdef *)mchalo(globalctx->mcmcxerr, siz, "mcm client context"); IF_DEBUG((*(ulong *)ret = 0x02020202, ret = (mcmcxdef *)((uchar *)ret + sizeof(ulong)))); @@ -134,22 +134,22 @@ mcmcx1def *mcmini(ulong max, uint pages, ulong swapsize, ushort siz; /* size of current thing being allocated */ ushort rem; /* bytes remaining in chunk */ int err; - + NOREG((&chunk)) - + /* make sure 'max' is big enough - must be at least one chunk */ if (max < (ulong)MCMCHUNK) max = (ulong)MCMCHUNK; - + /* allocate space for control structures from low-level heap */ rem = MCMCHUNK; - + IF_DEBUG(rem += sizeof(long)); chunk = mchalo(errctx, rem, "mcmini"); IF_DEBUG((*(ulong *)chunk = 0x01010101, chunk += sizeof(ulong), rem -= sizeof(ulong))); - + ctx = (mcmcx1def *)chunk; /* put context at start of chunk */ - + /* initialize swapper; clean up if it fails */ ERRBEGIN(errctx) mcsini(&ctx->mcmcxswc, ctx, swapsize, swapfp, swapfilename, errctx); @@ -158,7 +158,7 @@ mcmcx1def *mcmini(ulong max, uint pages, ulong swapsize, mchfre(chunk); errsig(errctx, err); ERREND(errctx) - + chunk += sizeof(mcmcx1def); /* rest of chunk is after context */ rem -= sizeof(mcmcx1def); /* remove from remaining size counter */ @@ -175,7 +175,7 @@ mcmcx1def *mcmini(ulong max, uint pages, ulong swapsize, chunk += sizeof(mcmhdef); rem -= sizeof(mcmhdef); ctx->mcmcxhpch->mcmhnxt = (mcmhdef *)0; /* no next heap in chain yet */ - + /* allocate the first page */ *(mcmon *)chunk = 0; /* set object number header in chunk */ chunk += osrndsz(sizeof(mcmon)); @@ -185,13 +185,13 @@ mcmcx1def *mcmini(ulong max, uint pages, ulong swapsize, memset(ctx->mcmcxtab[0], 0, (size_t)MCMPAGESIZE); chunk += MCMPAGESIZE; /* reflect size of page */ rem -= MCMPAGESIZE; /* take it out of the remainder */ - + /* set up the first page with an entry for itself */ obj = mcmgobje(ctx, (mcmon)0); /* point to first page entry */ obj->mcmoflg = MCMOFPRES | MCMOFNODISC | MCMOFPAGE | MCMOFNOSWAP; obj->mcmoptr = (uchar *)ctx->mcmcxtab[0]; obj->mcmosiz = MCMPAGESIZE; - + /* set up the rest of the context */ ctx->mcmcxlru = ctx->mcmcxmru = MCMONINV; /* no mru/lru list yet */ ctx->mcmcxmax = max - (ulong)MCMCHUNK; @@ -199,7 +199,7 @@ mcmcx1def *mcmini(ulong max, uint pages, ulong swapsize, ctx->mcmcxpgmx = pages; /* max number of pages we can allocate */ ctx->mcmcxerr = errctx; ctx->mcmcxcsw = mcmcswf; - + /* set up the free list with the remainder of the chunk */ ctx->mcmcxfre = 1; /* we've allocated object 0; obj 1 is free space */ obj = mcmgobje(ctx, ctx->mcmcxfre); /* point to free object entry */ @@ -215,28 +215,28 @@ mcmcx1def *mcmini(ulong max, uint pages, ulong swapsize, /* set flag for end of chunk (invalid object header) */ *((mcmon *)(chunk + rem - osrndsz(sizeof(mcmon)))) = MCMONINV; - + /* set up the unused entry list with the remaining headers in the page */ mcmadpg(ctx, 0, 2); - + return(ctx); } /* * Uninitialize the cache manager. Frees the memory allocated for the - * cache, including the context structure itself. + * cache, including the context structure itself. */ void mcmterm(mcmcx1def *ctx) { mcmhdef *cur, *nxt; - - /* + + /* * Free each chunk in the cache block list, *except* the last one. The * last one is special: it's actually the first chunk allocated, since * we build the list in reverse order, and the first chunk pointer * points into the middle of the actual allocation block, since we * sub-allocated the context structure itself and the page table out of - * that memory. + * that memory. */ for (cur = ctx->mcmcxhpch ; cur != 0 && cur->mcmhnxt != 0 ; cur = nxt) { @@ -245,13 +245,13 @@ void mcmterm(mcmcx1def *ctx) mchfre(cur); } - /* + /* * As described above, the last chunk in the list is the first * allocated, and it points into the middle of the actual allocated * memory block. Luckily, we do have a handy pointer to the start of * the memory block, namely the context pointer - it's the first thing * allocated out of the block, so it's the same as the block pointer. - * Freeing the context frees this last/first chunk. + * Freeing the context frees this last/first chunk. */ mchfre(ctx); } @@ -266,7 +266,7 @@ static uchar *mcmalo1(mcmcx1def *ctx, ushort siz, mcmon *nump) mcmon n; mcmodef *o; uchar *chunk; - + MCMGLBCTX(ctx); /* round size to appropriate multiple */ @@ -287,7 +287,7 @@ startover: *nump = n; return(o->mcmoptr); } - + /* nothing found; we must get space out of the heap if possible */ chunk = mcmhalo(ctx); /* get space from heap */ if (!chunk) goto error; /* can't get any more space from heap */ @@ -299,7 +299,7 @@ startover: mchfre(chunk_hdr); goto error; /* any error means we can't allocate the memory */ } - + *(mcmon *)chunk = n; /* set object header */ chunk += osrndsz(sizeof(mcmon)); o->mcmoptr = chunk; @@ -307,7 +307,7 @@ startover: o->mcmoflg = MCMOFFREE; mcmlnkhd(ctx, &ctx->mcmcxfre, n); goto startover; /* try again, now that we have some memory */ - + error: *nump = MCMONINV; return((uchar *)0); @@ -321,7 +321,7 @@ static void mcmcliexp(mcmcxdef *cctx, mcmon clinum) mcmcx1def *ctx = cctx->mcmcxgl; int i; mcmon *p; - + /* this page is not allocated - allocate it */ p = (mcmon *)mchalo(ctx->mcmcxerr, (256 * sizeof(mcmon)), "client mapping page"); @@ -337,17 +337,17 @@ uchar *mcmalo0(mcmcxdef *cctx, ushort siz, mcmon *nump, uchar *ret; mcmcx1def *ctx = cctx->mcmcxgl; /* global context */ mcmon glb; /* global object number allocated */ - + MCMCLICTX(cctx); MCMGLBCTX(ctx); - + /* try once */ if ((ret = mcmalo1(ctx, siz, &glb)) != 0) goto done; /* collect some garbage */ mcmgarb(ctx); - + /* try swapping until we get the memory or have nothing left to swap */ for ( ;; ) { @@ -363,25 +363,25 @@ uchar *mcmalo0(mcmcxdef *cctx, ushort siz, mcmon *nump, if ((ret = mcmalo1(ctx, siz, &glb)) != 0) goto done; - /* collect garbage once again */ + /* collect garbage once again */ mcmgarb(ctx); } - + /* try again */ if ((ret = mcmalo1(ctx, siz, &glb)) != 0) goto done; - + /* we have no other way of getting more memory, so signal an error */ errsig(ctx->mcmcxerr, ERR_NOMEM1); NOTREACHEDV(uchar *); - + done: if (noclitrans) { *nump = glb; return(ret); } - + /* we have an object - generate client number */ if (clinum == MCMONINV) { @@ -392,7 +392,7 @@ done: mcmon *q; int found = FALSE; int unused = -1; - + for (i = 0, p = cctx->mcmcxmtb ; i < cctx->mcmcxmsz ; ++i, ++p) { if (*p) @@ -411,7 +411,7 @@ done: if (found) break; } - + if (found) clinum = (i << 8) + j; else if (unused != -1) @@ -438,21 +438,21 @@ void mcmrsrv(mcmcxdef *cctx, ushort siz, mcmon clinum, mclhd loadhd) mcmcx1def *ctx = cctx->mcmcxgl; /* global context */ mcmon glb; /* global object number allocated */ mcmodef *o; - + MCMCLICTX(cctx); MCMGLBCTX(ctx); - + o = mcmoal(ctx, &glb); /* get a new object header */ if (!o) errsig(ctx->mcmcxerr, ERR_NOHDR); /* can't get a new header */ - + o->mcmoldh = loadhd; o->mcmoflg = 0; o->mcmosiz = siz; - + mcmcliexp(cctx, clinum); if (mcmc2g(cctx, clinum) != MCMONINV) errsig(ctx->mcmcxerr, ERR_CLIUSE); - + cctx->mcmcxmtb[clinum >> 8][clinum & 255] = glb; } @@ -460,24 +460,24 @@ void mcmrsrv(mcmcxdef *cctx, ushort siz, mcmon clinum, mclhd loadhd) uchar *mcmrealo(mcmcxdef *cctx, mcmon cliobj, ushort newsize) { mcmcx1def *ctx = cctx->mcmcxgl; /* global context */ - mcmon obj = mcmc2g(cctx, cliobj); + mcmon obj = mcmc2g(cctx, cliobj); mcmodef *o = mcmgobje(ctx, obj); mcmon nxt; mcmodef *nxto; uchar *p; int local_lock; - + MCMCLICTX(cctx); MCMGLBCTX(ctx); - + newsize = osrndsz(newsize); - + /* make sure the object is locked, and note if we locked it */ if ((local_lock = !(o->mcmoflg & MCMOFLOCK)) != 0) (void)mcmlck(cctx, cliobj); - + ERRBEGIN(ctx->mcmcxerr) - + if (newsize < o->mcmosiz) mcmsplt(ctx, obj, newsize); /* smaller; just split block */ else @@ -486,7 +486,7 @@ uchar *mcmrealo(mcmcxdef *cctx, mcmon cliobj, ushort newsize) p = o->mcmoptr; nxt = *(mcmon *)(p + o->mcmosiz); nxto = (nxt == MCMONINV) ? (mcmodef *)0 : mcmgobje(ctx, nxt); - + if (nxto && ((nxto->mcmoflg & MCMOFFREE) && nxto->mcmosiz >= newsize - o->mcmosiz)) { @@ -499,21 +499,21 @@ uchar *mcmrealo(mcmcxdef *cctx, mcmon cliobj, ushort newsize) nxto->mcmonxt = ctx->mcmcxunu; ctx->mcmcxunu = nxt; nxto->mcmoflg = 0; - + /* split the newly grown block if necessary */ mcmsplt(ctx, obj, newsize); } else { /* can't annex; allocate new memory and copy */ - + if (o->mcmolcnt != 1) /* if anyone else has a lock... */ errsig(ctx->mcmcxerr, ERR_REALCK); /* we can't move it */ - + p = mcmalo0(cctx, newsize, &nxt, MCMONINV, TRUE); if (nxt == MCMONINV) errsig(ctx->mcmcxerr, ERR_NOMEM2); memcpy(p, o->mcmoptr, (size_t)o->mcmosiz); - + /* adjust the object entries */ nxto = mcmgobje(ctx, nxt); /* get pointer to new entry */ newsize = nxto->mcmosiz; /* get actual size of new block */ @@ -521,7 +521,7 @@ uchar *mcmrealo(mcmcxdef *cctx, mcmon cliobj, ushort newsize) nxto->mcmosiz = o->mcmosiz; o->mcmoptr = p; /* copy new block info to original entry */ o->mcmosiz = newsize; - + /* now fix up the heap pointers, and free the temp object */ *(mcmon *)(p - osrndsz(sizeof(mcmon))) = obj; *(mcmon *)(nxto->mcmoptr - osrndsz(sizeof(mcmon))) = nxt; @@ -529,12 +529,12 @@ uchar *mcmrealo(mcmcxdef *cctx, mcmon cliobj, ushort newsize) mcmgfre(ctx, nxt); } } - + ERRCLEAN(ctx->mcmcxerr) /* release our lock, if we had to obtain one */ if (local_lock) mcmunlck(cctx, cliobj); ERRENDCLN(ctx->mcmcxerr) - + /* return the address of the object */ return(o->mcmoptr); } @@ -545,22 +545,22 @@ uchar *mcmrealo(mcmcxdef *cctx, mcmon cliobj, ushort newsize) void mcmgfre(mcmcx1def *ctx, mcmon obj) { mcmodef *o = mcmgobje(ctx, obj); - + MCMGLBCTX(ctx); - + /* signal an error if the object is locked */ if (o->mcmolcnt) errsig(ctx->mcmcxerr, ERR_LCKFRE); /* take out of LRU chain if it's in the chain */ if (o->mcmoflg & MCMOFLRU) mcmunl(ctx, obj, &ctx->mcmcxlru); - + /* put it in the free list */ mcmlnkhd(ctx, &ctx->mcmcxfre, obj); o->mcmoflg = MCMOFFREE; } /* - * load and lock an object that has been swapped out or discarded + * load and lock an object that has been swapped out or discarded */ uchar *mcmload(mcmcxdef *cctx, mcmon cnum) { @@ -569,14 +569,14 @@ uchar *mcmload(mcmcxdef *cctx, mcmon cnum) mcmodef *newdef; mcmon newn; mcmon num = mcmc2g(cctx, cnum); - + MCMCLICTX(cctx); MCMGLBCTX(ctx); /* we first need to obtain some memory for this object */ (void)mcmalo0(cctx, o->mcmosiz, &newn, MCMONINV, TRUE); newdef = mcmgobje(ctx, newn); - + /* use memory block from our new object */ o->mcmoptr = newdef->mcmoptr; o->mcmosiz = newdef->mcmosiz; @@ -607,7 +607,7 @@ uchar *mcmload(mcmcxdef *cctx, mcmon cnum) o->mcmoflg &= ~MCMOFDIRTY; /* not written since last swapped in */ o->mcmoflg |= MCMOFNODISC; /* don't discard once it's been to swap file */ o->mcmolcnt = 1; /* one locker so far */ - + /* if the object is to be reverted upon loading, revert it now */ if (o->mcmoflg & MCMOFREVRT) { @@ -620,15 +620,15 @@ uchar *mcmload(mcmcxdef *cctx, mcmon cnum) /* * Allocate a new object header. This doesn't allocate an object, just - * the header for one. + * the header for one. */ static mcmodef *mcmoal(mcmcx1def *ctx, mcmon *nump) { mcmodef *ret; uint pagenum; - + MCMGLBCTX(ctx); - + /* look first in list of unused headers */ startover: if (ctx->mcmcxunu != MCMONINV) @@ -640,7 +640,7 @@ startover: ret->mcmoswh = MCSSEGINV; return(ret); } - + /* * No unused entries: we must create a new page. To do so, we * simply allocate memory for a new page. Allocate the memory @@ -649,7 +649,7 @@ startover: */ if (ctx->mcmcxpage == ctx->mcmcxpgmx) goto error; /* no more pages */ pagenum = ctx->mcmcxpage++; /* get a new page slot */ - + ctx->mcmcxtab[pagenum] = (mcmodef *)mchalo(ctx->mcmcxerr, MCMPAGESIZE, "mcmoal"); mcmadpg(ctx, pagenum, MCMONINV); @@ -668,7 +668,7 @@ static mcmodef *mcmffb(mcmcx1def *ctx, ushort siz, mcmon *nump) mcmon minn; mcmodef *mino; ushort min = 0; - + MCMGLBCTX(ctx); for (minn = MCMONINV, mino = 0, n = ctx->mcmcxfre ; n != MCMONINV ; @@ -695,7 +695,7 @@ static mcmodef *mcmffb(mcmcx1def *ctx, ushort siz, mcmon *nump) } } } - + /* if we found something, remove from the free list */ if (minn != MCMONINV) { @@ -703,20 +703,20 @@ static mcmodef *mcmffb(mcmcx1def *ctx, ushort siz, mcmon *nump) mino->mcmoflg &= ~MCMOFFREE; mino->mcmoswh = MCSSEGINV; } - + *nump = minn; return mino; } /* - * unlink an object header from one of the doubly-linked lists + * unlink an object header from one of the doubly-linked lists */ static void mcmunl(mcmcx1def *ctx, mcmon n, mcmon *lst) { mcmodef *o = mcmgobje(ctx, n); mcmodef *nxt; mcmodef *prv; - + MCMGLBCTX(ctx); /* see if this is LRU chain - must deal with MRU pointer if so */ @@ -733,17 +733,17 @@ static void mcmunl(mcmcx1def *ctx, mcmon n, mcmon *lst) } o->mcmoflg &= ~MCMOFLRU; } - + nxt = o->mcmonxt == MCMONINV ? (mcmodef *)0 : mcmgobje(ctx, o->mcmonxt); prv = o->mcmoprv == MCMONINV ? (mcmodef *)0 : mcmgobje(ctx, o->mcmoprv); - + /* set back link for next object, if there is a next object */ if (nxt) nxt->mcmoprv = o->mcmoprv; - + /* set forward link for previous object, or head if no previous object */ if (prv) prv->mcmonxt = o->mcmonxt; else *lst = o->mcmonxt; - + o->mcmonxt = o->mcmoprv = MCMONINV; } @@ -764,7 +764,7 @@ static void mcmadpg(mcmcx1def *ctx, uint pagenum, mcmon firstunu) mcmon unu; mcmodef *obj; mcmon lastunu; - + MCMGLBCTX(ctx); unu = (firstunu == MCMONINV ? pagenum * MCMPAGECNT : firstunu); @@ -777,14 +777,14 @@ static void mcmadpg(mcmcx1def *ctx, uint pagenum, mcmon firstunu) /* * split a previously-free block into two chunks, adding the remainder - * back into the free list, if there's enough left over - */ + * back into the free list, if there's enough left over + */ static void mcmsplt(mcmcx1def *ctx, mcmon n, ushort siz) { mcmodef *o = mcmgobje(ctx, n); mcmon newn; mcmodef *newp; - + MCMGLBCTX(ctx); if (o->mcmosiz < siz + MCMSPLIT) return; /* don't split; we're done */ @@ -798,7 +798,7 @@ static void mcmsplt(mcmcx1def *ctx, mcmon n, ushort siz) newp->mcmosiz = o->mcmosiz - siz - osrndsz(sizeof(mcmon)); newp->mcmoflg = MCMOFFREE; mcmlnkhd(ctx, &ctx->mcmcxfre, newn); - + o->mcmosiz = siz; /* size of new object is now exactly as request */ } @@ -821,7 +821,7 @@ static uchar *mcmhalo(mcmcx1def *ctx) ERREND(ctx->mcmcxerr) ctx->mcmcxmax -= MCMCHUNK; - + /* link into heap chain */ ((mcmhdef *)chunk)->mcmhnxt = ctx->mcmcxhpch; ctx->mcmcxhpch = (mcmhdef *)chunk; @@ -838,22 +838,22 @@ static uchar *mcmhalo(mcmcx1def *ctx) void mcmuse(mcmcx1def *ctx, mcmon obj) { mcmodef *o = mcmgobje(ctx, obj); - + MCMGLBCTX(ctx); if (ctx->mcmcxmru == obj) return; /* already MRU; nothing to do */ - + /* remove from LRU chain if it's in it */ if (o->mcmoflg & MCMOFLRU) mcmunl(ctx, obj, &ctx->mcmcxlru); /* set forward pointer of last block, if there is one */ if (ctx->mcmcxmru != MCMONINV) mcmgobje(ctx, ctx->mcmcxmru)->mcmonxt = obj; - + o->mcmoprv = ctx->mcmcxmru; /* point back to previous MRU */ o->mcmonxt = MCMONINV; /* nothing in list after this one */ ctx->mcmcxmru = obj; /* point MRU to new block */ - + /* if there's nothing in the chain at all, set LRU to this block, too */ if (ctx->mcmcxlru == MCMONINV) ctx->mcmcxlru = obj; @@ -882,7 +882,7 @@ static uchar *mcmffh(mcmcx1def *ctx, uchar *p) static void mcmmove(mcmcx1def *ctx, mcmodef *o, uchar *newpage) { mcmodef **page; - + MCMGLBCTX(ctx); /* see if we need to update page table (we do if moving a page) */ @@ -935,19 +935,19 @@ static void mcmconsol(mcmcx1def *ctx, uchar *p) { uchar *q; mcmodef *obj1, *obj2; - + MCMGLBCTX(ctx); q = mcmnxh(ctx, p); obj1 = mcmgobje(ctx, *(mcmon *)p); obj2 = mcmgobje(ctx, *(mcmon *)q); - + assert(obj1->mcmoptr == p + osrndsz(sizeof(mcmon))); assert(obj2->mcmoptr == q + osrndsz(sizeof(mcmon))); obj1->mcmosiz += osrndsz(sizeof(mcmon)) + obj2->mcmosiz; mcmunl(ctx, *(mcmon *)q, &ctx->mcmcxfre); - + /* add second object entry to unused list */ obj2->mcmonxt = ctx->mcmcxunu; ctx->mcmcxunu = *(mcmon *)q; @@ -962,7 +962,7 @@ static void mcmgarb(mcmcx1def *ctx) uchar *q; uchar *nxt; ushort flags; - + MCMGLBCTX(ctx); for (h = ctx->mcmcxhpch ; h ; h = h->mcmhnxt) @@ -971,7 +971,7 @@ static void mcmgarb(mcmcx1def *ctx) p = mcmffh(ctx, p); /* get first free block in heap */ if (!p) continue; /* can't do anything - no free blocks */ nxt = mcmnxh(ctx, p); /* remember immediate next block */ - + for (q=p ;; ) { q = mcmnxh(ctx, q); /* find next chunk in heap */ @@ -994,7 +994,7 @@ static void mcmgarb(mcmcx1def *ctx) { if (q != nxt) p = mcmreloc(ctx, p, q); /* relocate */ mcmconsol(ctx, p); /* consolidate two free blocks */ - + /* resume looking, starting with consolidated block */ nxt = mcmnxh(ctx, p); q = p; @@ -1022,7 +1022,7 @@ static int mcmtoss(mcmcx1def *ctx, mcmon n) if (o->mcmoflg & (MCMOFNODISC | MCMOFDIRTY)) { mcsseg old_swap_seg; - + /* * If this object was last loaded out of the load file, rather * than the swap file, don't attempt to find it in the swap file @@ -1032,11 +1032,11 @@ static int mcmtoss(mcmcx1def *ctx, mcmon n) old_swap_seg = o->mcmoswh; else old_swap_seg = MCSSEGINV; - + o->mcmoswh = mcsout(&ctx->mcmcxswc, (uint)n, o->mcmoptr, o->mcmosiz, old_swap_seg, o->mcmoflg & MCMOFDIRTY); } - + /* give the object's space to the newly created block */ newp->mcmoptr = o->mcmoptr; newp->mcmosiz = o->mcmosiz; @@ -1044,7 +1044,7 @@ static int mcmtoss(mcmcx1def *ctx, mcmon n) /*@@@*/ *(mcmon *)(o->mcmoptr - osrndsz(sizeof(mcmon))) = newn; mcmlnkhd(ctx, &ctx->mcmcxfre, newn); - + o->mcmoflg &= ~MCMOFPRES; /* object is no longer in memory */ mcmunl(ctx, n, &ctx->mcmcxlru); /* remove from LRU list */ return(TRUE); /* successful, so return TRUE */ @@ -1076,7 +1076,7 @@ static int mcmswap(mcmcx1def *ctx, ushort siz) } } } - + /* if we managed to remove anything, return TRUE, otherwise FALSE */ return(tot != 0); } @@ -1087,14 +1087,14 @@ ulong mcmcsiz(mcmcxdef *cctx) mcmcx1def *ctx = cctx->mcmcxgl; mcmhdef *p; ulong tot; - + MCMCLICTX(cctx); MCMGLBCTX(ctx); - + /* count number of heaps, adding in chunk size for each */ for (tot = 0, p = ctx->mcmcxhpch ; p ; p = p->mcmhnxt) tot += MCMCHUNK; - + return(tot); } @@ -1123,7 +1123,7 @@ uchar *mcmlck(mcmcxdef *ctx, mcmon objnum) void mcmunlck(mcmcxdef *ctx, mcmon obj) { mcmodef *o = mcmobje(ctx, obj); - + if (o->mcmoflg & MCMOFLOCK) { if (!(--(o->mcmolcnt))) @@ -1137,7 +1137,7 @@ void mcmunlck(mcmcxdef *ctx, mcmon obj) void mcmgunlck(mcmcx1def *ctx, mcmon obj) { mcmodef *o = mcmgobje(ctx, obj); - + if (o->mcmoflg & MCMOFLOCK) { if (!(--(o->mcmolcnt))) @@ -1153,19 +1153,19 @@ void mcmgunlck(mcmcx1def *ctx, mcmon obj) /* * Change an object's swap file handle. This routine will only be * called for an object that is either present or swapped out (i.e., an - * object with a valid mcsseg number in its swap state). + * object with a valid mcsseg number in its swap state). */ void mcmcswf(mcmcx1def *ctx, mcmon objn, mcsseg swapn, mcsseg oldswapn) { mcmodef *o = mcmgobje(ctx, objn); - + MCMGLBCTX(ctx); - + /* * Reset the swap number only if the object is swapped out and its * swap file number matches the old one, or the object is currently * present (in which case the swap file number is irrelevant and can - * be replaced). + * be replaced). */ if (((o->mcmoflg & (MCMOFDIRTY | MCMOFNODISC)) && o->mcmoswh == oldswapn) || (o->mcmoflg & MCMOFPRES)) diff --git a/engines/glk/tads/tads2/memory_cache.h b/engines/glk/tads/tads2/memory_cache.h index 0eb1626acdf..4bda39aa46e 100644 --- a/engines/glk/tads/tads2/memory_cache.h +++ b/engines/glk/tads/tads2/memory_cache.h @@ -66,7 +66,7 @@ union mcmodefloc { * set of flag bits is provided, as is the size of the object and its * location (which is a memory pointer for objects in memory, a swap * file handle for swapped-out objects, or a load-file handle for - * objects that are unloaded). + * objects that are unloaded). */ struct mcmodef { uchar *mcmoptr; /* memory pointer (if object is present) */ @@ -136,7 +136,7 @@ struct mcmcxdef { * FREE LIST: this is a list, headed by context->mcmcxfre and chained * forward and back by mcmonxt and mcmoprv, consisting of free memory * blocks. These refer to blocks in the heap that are not used by any - * client objects. + * client objects. */ /* * UNUSED LIST: this is a list, headed by context->mcmcxunu and chained @@ -145,7 +145,7 @@ struct mcmcxdef { * backwards), of unused cache object entries. These entries are not * associated with any client object or with any heap memory. This list * is used to get a new cache object header, and deleted cache objects - * are placed onto this list. + * are placed onto this list. */ /* * LRU LIST: this is a list of in-memory blocks in ascending order of @@ -155,7 +155,7 @@ struct mcmcxdef { * to the end of the list as well as to the beginning. The start of the * list is at context->mcmcxlru, and is the least recently unlocked * block still in memory. The end of the list is at context->mcmcxmru, - * and is the most recently unlocked block. + * and is the most recently unlocked block. */ /* @@ -166,7 +166,7 @@ struct mcmcxdef { * can ever allocate on behalf of this context (of course, it can * overcommit the heap through swapping). If 'max' is less than the * size of a single heap allocation, it is adjusted upwards to that - * minimum. + * minimum. */ mcmcx1def *mcmini(ulong max, uint pages, ulong swapsize, osfildef *swapfp, char *swapfilename, errcxdef *errctx); @@ -244,7 +244,7 @@ void mcmunlck(mcmcxdef *ctx, mcmon objnum); * Reserve space for an object, giving it a particular client object * number. This doesn't actually allocate any space for the object, but * just sets it up so that it can be loaded by the client when it's - * needed. + * needed. */ void mcmrsrv(mcmcxdef *ctx, ushort siz, mcmon clinum, mclhd loadhd); @@ -272,7 +272,7 @@ uchar *mcmrealo(mcmcxdef *ctx, mcmon objnum, ushort newsize); * activity by not writing objects that can be reconstructed from the * load or swap file. Touching the object informs the cache manager * that the object is different from any version it has in a swap or - * load file. + * load file. */ /* void mcmtch(mcmcxdef *ctx, mcmon objnum); */ #define mcmtch(ctx,obj) \ @@ -294,7 +294,7 @@ uchar *mcmrealo(mcmcxdef *ctx, mcmon objnum, ushort newsize); /* * Free an object. The memory occupied by the object is discarded, and - * the object may no longer be referenced. + * the object may no longer be referenced. */ void mcmfre(mcmcxdef *ctx, mcmon obj); @@ -303,7 +303,7 @@ void mcmfre(mcmcxdef *ctx, mcmon obj); * routine just invokes a client callback to do the actual reversion * work. The callback is called immediately if the object is already * present in memory, but is deferred until the object is loaded/swapped - * in if the object is not in memory. + * in if the object is not in memory. */ /* void mcmrevert(mcmcxdef *ctx, mcmon objn); */ #define mcmrevert(ctx, objn) \ @@ -357,13 +357,13 @@ uchar *mcmload(mcmcxdef *ctx, mcmon objnum); * Size of each chunk of memory we'll request from the heap manager. * To cut down on wasted memory from the heap manager, we'll always make * our requests in this large size, then sub-allocate out of these - * chunks. + * chunks. */ #define MCMCHUNK 32768 /* * number of cache entries in a page - make this a power of 2 to keep - * the arithmetic to find a cache object entry simple + * the arithmetic to find a cache object entry simple */ #define MCMPAGECNT 256 diff --git a/engines/glk/tads/tads2/memory_cache_swap.h b/engines/glk/tads/tads2/memory_cache_swap.h index 950291fa983..f99844ddcc7 100644 --- a/engines/glk/tads/tads2/memory_cache_swap.h +++ b/engines/glk/tads/tads2/memory_cache_swap.h @@ -56,7 +56,7 @@ struct mcsdsdef { /** * mcsseg - swap segment handle. All swap-file segments are addressed - * through this handle type. + * through this handle type. */ typedef ushort mcsseg; @@ -98,7 +98,7 @@ void mcsclose(struct mcscxdef *ctx); */ mcsseg mcsout(struct mcscxdef *ctx, uint objid, uchar *objptr, ushort objsize, mcsseg oldswapseg, int dirty); - + /* Swap an object in */ void mcsin(struct mcscxdef *ctx, mcsseg swapseg, uchar *objptr, ushort size); diff --git a/engines/glk/tads/tads2/object.cpp b/engines/glk/tads/tads2/object.cpp index 4d2f83a0ee6..c1881dc3939 100644 --- a/engines/glk/tads/tads2/object.cpp +++ b/engines/glk/tads/tads2/object.cpp @@ -47,13 +47,13 @@ uint objgetp(mcmcxdef *mctx, objnum objn, prpnum prop, dattyp *typptr) int last; int first; int cur = 0; - + oswp2(pbuf, prop); /* get property number in portable foramt */ objptr = (objdef *)mcmlck(mctx, objn); /* get a lock on the object */ ignprop = 0; /* assume we won't find ignored property */ cnt = objnprop(objptr); /* get number of properties defined */ retval = 0; /* presume failure */ - + if (objflg(objptr) & OBJFINDEX) { /* there's an index -> do a binary search through the index */ @@ -114,7 +114,7 @@ uint objgetp(mcmcxdef *mctx, objnum objn, prpnum prop, dattyp *typptr) if (!retval) retval = ignprop; /* use ignored value if nothing else */ if (retval && typptr) *typptr = prptype(objofsp(objptr, retval)); - + mcmunlck(mctx, objn); /* done with object, so unlock it */ return(retval); } @@ -126,7 +126,7 @@ uint objgetp_end(mcmcxdef *ctx, objnum objn, prpnum prop) prpdef *propptr; uint ofs; uint valsiz; - + /* get the start of the object */ ofs = objgetp(ctx, objn, prop, 0); if (ofs == 0) @@ -144,9 +144,9 @@ uint objgetp_end(mcmcxdef *ctx, objnum objn, prpnum prop) /* done with the object */ mcmunlck(ctx, (mcmon)objn); - /* + /* * return the ending offset - it's the starting offset plus the - * property header size plus the size of the property data + * property header size plus the size of the property data */ return ofs + PRPHDRSIZ + valsiz; } @@ -156,16 +156,16 @@ static int objisd(mcmcxdef *ctx, objdef *objptr, objnum parentnum) { uchar *sc; int cnt; - + for (sc = objsc(objptr), cnt = objnsc(objptr) ; cnt ; sc += 2, --cnt) { int cursc = osrp2(sc); int ret; objdef *curptr; - + if (cursc == parentnum) return(TRUE); - + curptr = (objdef *)mcmlck(ctx, (mcmon)cursc); ret = objisd(ctx, curptr, parentnum); mcmunlck(ctx, (mcmon)cursc); @@ -183,9 +183,9 @@ static int objisd(mcmcxdef *ctx, objdef *objptr, objnum parentnum) * NOT locked upon return, but we will NOT unlock the object passed in * (in other words, all object locking status is the same as it was on * entry). If the offset is zero, the property was not found. - * + * * This is an internal helper routine - it's not meant to be called - * except by objgetap(). + * except by objgetap(). */ static uint objgetap0(mcmcxdef *ctx, noreg objnum obj, prpnum prop, objnum *orn, int inh, dattyp *ortyp) @@ -203,15 +203,15 @@ static uint objgetap0(mcmcxdef *ctx, noreg objnum obj, prpnum prop, dattyp typ; uchar sclist[100]; /* up to 50 superclasses */ objdef *objptr; - + NOREG((&obj)) - + /* see if the property is in the current object first */ if (!inh && (retval = objgetp(ctx, obj, prop, &typ)) != 0) { - /* + /* * tell the caller which object this came from, if the caller - * wants to know + * wants to know */ if (orn != 0) *orn = obj; @@ -223,14 +223,14 @@ static uint objgetap0(mcmcxdef *ctx, noreg objnum obj, prpnum prop, /* return the property offset */ return retval; } - + /* lock the object, cache its superclass list, and unlock it */ objptr = (objdef *)mcmlck(ctx, (mcmon)obj); sccnt = objnsc(objptr); memcpy(sclist, objsc(objptr), (size_t)(sccnt << 1)); sc = sclist; mcmunlck(ctx, (mcmon)obj); - + /* try to inherit the property */ for (found = FALSE ; sccnt != 0 ; sc += 2, --sccnt) { @@ -241,7 +241,7 @@ static uint objgetap0(mcmcxdef *ctx, noreg objnum obj, prpnum prop, if (poff != 0) { int isdesc = 0; - + /* if we have a previous object, determine lineage */ if (found) { @@ -249,13 +249,13 @@ static uint objgetap0(mcmcxdef *ctx, noreg objnum obj, prpnum prop, isdesc = objisd(ctx, o1, osavn); mcmunlck(ctx, o1n); } - + /* * if we don't already have a property, or the new object * is a descendant of the previously found object (meaning * that the new object's property should override the * previously found object's property), use this new - * property + * property */ if (!found || isdesc) { @@ -287,7 +287,7 @@ static uint objgetap0(mcmcxdef *ctx, noreg objnum obj, prpnum prop, * object in which the prpdef is found; the superclass object itself is * NOT locked upon return, but we will NOT unlock the object passed in * (in other words, all object locking status is the same as it was on - * entry). If the offset is zero, the property was not found. + * entry). If the offset is zero, the property was not found. */ uint objgetap(mcmcxdef *ctx, noreg objnum obj, prpnum prop, objnum *ornp, int inh) @@ -296,9 +296,9 @@ uint objgetap(mcmcxdef *ctx, noreg objnum obj, prpnum prop, dattyp typ; objnum orn; - /* + /* * even if the caller doesn't care about the original object number, - * we do, so provide our own location to store it if necessary + * we do, so provide our own location to store it if necessary */ if (ornp == 0) ornp = &orn; @@ -308,10 +308,10 @@ uint objgetap(mcmcxdef *ctx, noreg objnum obj, prpnum prop, { /* look up the property */ retval = objgetap0(ctx, obj, prop, ornp, inh, &typ); - - /* + + /* * If we found something (i.e., retval != 0), check to see if we - * have a synonym; if so, synonym translation is required + * have a synonym; if so, synonym translation is required */ if (retval != 0 && typ == DAT_SYN) { @@ -319,11 +319,11 @@ uint objgetap(mcmcxdef *ctx, noreg objnum obj, prpnum prop, objdef *objptr; prpdef *p; - /* + /* * Translation is required - get new property and try again. * First, remember the original property, so we can make * sure we're not going to loop (at least, not in this one - * synonym definition). + * synonym definition). */ prvprop = prop; @@ -355,7 +355,7 @@ objdef *objexp(mcmcxdef *ctx, objnum obj, ushort *siz) { ushort oldsiz; uchar *p; - + oldsiz = mcmobjsiz(ctx, (mcmon)obj); p = mcmrealo(ctx, (mcmon)obj, (ushort)(oldsiz + *siz)); *siz = mcmobjsiz(ctx, (mcmon)obj) - oldsiz; @@ -371,7 +371,7 @@ objdef *objexp(mcmcxdef *ctx, objnum obj, ushort *siz) * 'mark_only' is true, we'll only mark the property as deleted without * actually reclaiming the space; this is necessary when deleting a * method when other methods may follow, since p-code is not entirely - * self-relative and thus can't always be relocated within an object. + * self-relative and thus can't always be relocated within an object. */ void objdelp(mcmcxdef *mctx, objnum objn, prpnum prop, int mark_only) { @@ -380,14 +380,14 @@ void objdelp(mcmcxdef *mctx, objnum objn, prpnum prop, int mark_only) prpdef *p; prpdef *nxt; size_t movsiz; - + pofs = objgetp(mctx, objn, prop, (dattyp *)0); /* try to find property */ if (!pofs) return; /* not defined - nothing to delete */ - + objptr = (objdef *)mcmlck(mctx, objn); /* get lock on object */ p = objofsp(objptr, pofs); /* get actual prpdef pointer */ nxt = objpnxt(p); /* find next prpdef after this one */ - + /* if this is original, just mark 'ignore' */ if (prpflg(p) & PRPFORG) { @@ -406,7 +406,7 @@ void objdelp(mcmcxdef *mctx, objnum objn, prpnum prop, int mark_only) objsnp(objptr, objnprop(objptr)-1); objsfree(objptr, objfree(objptr) - (((uchar *)nxt) - ((uchar *)p))); } - + /* tell cache manager this object has been changed, and unlock it */ mcmtch(mctx, objn); mcmunlck(mctx, objn); @@ -416,7 +416,7 @@ void objdelp(mcmcxdef *mctx, objnum objn, prpnum prop, int mark_only) * Set a property of an object to a new value, overwriting the original * value (if any); the object must be unlocked coming in. If an undo * context is provided, an undo record is written; if the undo context - * pointer is null, no undo information is kept. + * pointer is null, no undo information is kept. */ void objsetp(mcmcxdef *ctx, objnum objn, prpnum prop, dattyp typ, const void *val, objucxdef *undoctx) @@ -428,7 +428,7 @@ void objsetp(mcmcxdef *ctx, objnum objn, prpnum prop, dattyp typ, ushort newsiz; int indexed; int prop_was_set; - + /* get a lock on the object */ objptr = (objdef *)mcmlck(ctx, objn); indexed = objflg(objptr) & OBJFINDEX; @@ -497,7 +497,7 @@ void objsetp(mcmcxdef *ctx, objnum objn, prpnum prop, dattyp typ, objdelp(ctx, objn, prop, FALSE); /* get the top of the property area */ - p = objpfre(objptr); + p = objpfre(objptr); /* make sure there's room at the top */ avail = mcmobjsiz(ctx, (mcmon)objn) - objfree(objptr); @@ -526,7 +526,7 @@ void objsetp(mcmcxdef *ctx, objnum objn, prpnum prop, dattyp typ, mcmunlck(ctx, objn); /* unlock the object */ } ERRENDCLN(ctx->mcmcxgl->mcmcxerr) - + /* dirty the object, and release lock on object before return */ mcmtch(ctx, objn); /* mark the object as changed */ mcmunlck(ctx, objn); /* unlock it */ @@ -547,13 +547,13 @@ uchar *objures(objucxdef *undoctx, uchar cmd, ushort siz) { ushort prv; uchar *p; - + /* adjust size to include header information */ siz += 1 + sizeof(ushort); - + /* make sure there's enough room overall for the record */ if (siz > undoctx->objucxsiz) errsig(undoctx->objucxerr, ERR_UNDOVF); - + /* if there's no information, reset buffers */ if (undoctx->objucxhead == undoctx->objucxprv) { @@ -561,50 +561,50 @@ uchar *objures(objucxdef *undoctx, uchar cmd, ushort siz) undoctx->objucxtop = 0; goto done; } - + /* if tail is below head, we can use to top of entire buffer */ if (undoctx->objucxtail < undoctx->objucxhead) { /* if there's enough space left after head, we're done */ if (undoctx->objucxsiz - undoctx->objucxhead >= siz) goto done; - + /* insufficient space: wrap head down to bottom of buffer */ undoctx->objucxtop = undoctx->objucxprv; /* last was top */ undoctx->objucxhead = 0; } - + /* head is below tail: delete records until we have enough room */ while (undoctx->objucxtail - undoctx->objucxhead < siz) { objutadv(undoctx); - + /* if the tail wrapped, advancing won't do any more good */ if (undoctx->objucxtail <= undoctx->objucxhead) { /* if there's enough room at the top, we're done */ if (undoctx->objucxsiz - undoctx->objucxhead >= siz) goto done; - + /* still not enough room; wrap the head this time */ undoctx->objucxtop = undoctx->objucxprv; /* last was top */ undoctx->objucxhead = 0; } } - + done: /* save back-link, and set objucxprv pointer to the new record */ prv = undoctx->objucxprv; undoctx->objucxprv = undoctx->objucxhead; - + /* write the header: command byte, back-link to previous record */ p = &undoctx->objucxbuf[undoctx->objucxhead]; *p++ = cmd; memcpy(p, &prv, sizeof(prv)); - + /* advance the head pointer past the header */ undoctx->objucxhead += 1 + sizeof(prv); - + /* set the high-water mark if we've exceeded the old one */ if (undoctx->objucxprv > undoctx->objucxtop) undoctx->objucxtop = undoctx->objucxprv; @@ -620,7 +620,7 @@ void objutadv(objucxdef *undoctx) ushort siz; uchar pr[PRPHDRSIZ]; /* space for a property header */ uchar cmd; - + /* if we're at the most recently written record, flush buffer */ if (undoctx->objucxtail == undoctx->objucxprv) { @@ -636,14 +636,14 @@ void objutadv(objucxdef *undoctx) undoctx->objucxtail = 0; return; } - + /* determine size by inspecting current record */ p = undoctx->objucxbuf + undoctx->objucxtail; siz = 1 + sizeof(ushort); /* basic header size */ - + cmd = *p++; p += sizeof(ushort); /* skip the previous pointer */ - + switch(cmd) { case OBJUCHG: @@ -657,7 +657,7 @@ void objutadv(objucxdef *undoctx) /* add/override: property header only */ siz += sizeof(mcmon) + sizeof(prpnum); break; - + case OBJUCLI: siz += (*undoctx->objucxcsz)(undoctx->objucxccx, p); break; @@ -665,7 +665,7 @@ void objutadv(objucxdef *undoctx) case OBJUSAV: break; } - + undoctx->objucxtail += siz; } @@ -685,24 +685,24 @@ void obj1undo(mcmcxdef *mctx, objucxdef *undoctx) /* if there's no more undo, signal an error */ if (undoctx->objucxprv == undoctx->objucxhead) errsig(undoctx->objucxerr, ERR_NOUNDO); - + /* move back to previous record */ undoctx->objucxhead = undoctx->objucxprv; p = &undoctx->objucxbuf[undoctx->objucxprv]; - + /* get command, and set undocxprv to previous record */ cmd = *p++; memcpy(&prv, p, sizeof(prv)); p += sizeof(prv); - + /* if we're at the tail, no more undo; otherwise, use back link */ if (undoctx->objucxprv == undoctx->objucxtail) undoctx->objucxprv = undoctx->objucxhead; else undoctx->objucxprv = prv; - + if (cmd == OBJUSAV) return; /* savepointer marker - nothing to do */ - + /* get object/property information for property-changing undo */ if (cmd != OBJUCLI) { @@ -714,14 +714,14 @@ void obj1undo(mcmcxdef *mctx, objucxdef *undoctx) indexed = (objflg(objptr) & OBJFINDEX); mcmunlck(mctx, objn); } - + switch(cmd) { case OBJUADD: objdelp(mctx, objn, prop, FALSE); if (indexed) objindx(mctx, objn); break; - + case OBJUOVR: objdelp(mctx, objn, prop, FALSE); /* delete the non-original value */ pofs = objgetp(mctx, objn, prop, (dattyp *)0); /* get ignored prop */ @@ -729,13 +729,13 @@ void obj1undo(mcmcxdef *mctx, objucxdef *undoctx) prpflg(objofsp(objptr, pofs)) &= ~PRPFIGN; /* no longer ignored */ mcmunlck(mctx, objn); /* unlock the object */ break; - + case OBJUCHG: memcpy(pr, p, (size_t)PRPHDRSIZ); p += PRPHDRSIZ; objsetp(mctx, objn, prop, prptype(pr), (void *)p, (objucxdef *)0); break; - + case OBJUCLI: (*undoctx->objucxcun)(undoctx->objucxccx, p); break; @@ -744,7 +744,7 @@ void obj1undo(mcmcxdef *mctx, objucxdef *undoctx) /* * Determine if it's ok to add undo records - returns TRUE if a - * savepoint has been stored in the undo log, FALSE if not. + * savepoint has been stored in the undo log, FALSE if not. */ int objuok(objucxdef *undoctx) { @@ -774,7 +774,7 @@ int objuok(objucxdef *undoctx) * the undo list, NOTHING will be undone. This prevents reaching an * inconsistent state in which some, but not all, of the operations * between two savepoints are undone: either all operations between two - * savepoints will be undone, or none will. + * savepoints will be undone, or none will. */ void objundo(mcmcxdef *mctx, objucxdef *undoctx) { @@ -793,7 +793,7 @@ void objundo(mcmcxdef *mctx, objucxdef *undoctx) sav = prv; break; } - + /* if we've reached the tail, there are no more undo records */ if (prv == undoctx->objucxtail) errsig(undoctx->objucxerr, ERR_ICUNDO); @@ -801,14 +801,14 @@ void objundo(mcmcxdef *mctx, objucxdef *undoctx) /* get previous record */ memcpy(&prv, &undoctx->objucxbuf[prv+1], sizeof(prv)); } - + /* now undo everything until we get to the savepoint */ do { obj1undo(mctx, undoctx); } while (undoctx->objucxhead != sav); } /* initialize undo context */ objucxdef *objuini(mcmcxdef *ctx, ushort siz, - void (*undocb)(void *, uchar *), + void (*undocb)(void *, uchar *), ushort (*sizecb)(void *, uchar *), void *callctx) { @@ -823,17 +823,17 @@ objucxdef *objuini(mcmcxdef *ctx, ushort siz, ret = (objucxdef *)mchalo(ctx->mcmcxgl->mcmcxerr, (sizeof(objucxdef) + siz - 1), "objuini"); - + ret->objucxmem = ctx; ret->objucxerr = ctx->mcmcxgl->mcmcxerr; ret->objucxsiz = siz; ret->objucxhead = ret->objucxprv = ret->objucxtail = ret->objucxtop = 0; - + /* set client callback functions */ ret->objucxcun = undocb; /* callback to apply client undo */ ret->objucxcsz = sizecb; /* callback to get size of client undo */ ret->objucxccx = callctx; /* context for client callback functions */ - + return(ret); } @@ -862,11 +862,11 @@ void objrevert(void *ctx0, mcmon objn) prpdef *pr; int cnt; int indexed; - + p = mcmlck(mctx, objn); pr = objprp(p); indexed = objflg(p) & OBJFINDEX; - + /* restore original settings */ objsfree(p, objrst(p)); objsnp(p, objstat(p)); @@ -874,11 +874,11 @@ void objrevert(void *ctx0, mcmon objn) /* go through original properties and remove 'ignore' flag if set */ for (cnt = objnprop(p) ; cnt ; pr = objpnxt(pr), --cnt) prpflg(pr) &= ~PRPFIGN; - + /* touch object and unlock it */ mcmtch(mctx, objn); mcmunlck(mctx, objn); - + /* if it's indexed, rebuild the index */ if (indexed) objindx(mctx, objn); } @@ -893,7 +893,7 @@ void objsetign(mcmcxdef *mctx, objnum objn) int cnt; int indexed; prpdef *p1; - + objptr = (objdef *)mcmlck(mctx, (mcmon)objn); p1 = objprp(objptr); indexed = objflg(objptr) & OBJFINDEX; @@ -914,14 +914,14 @@ void objsetign(mcmcxdef *mctx, objnum objn) } } } - + mcmtch(mctx, (mcmon)objn); mcmunlck(mctx, (mcmon)objn); if (indexed) objindx(mctx, objn); } /* - * Build or rebuild a property index for an object. + * Build or rebuild a property index for an object. */ void objindx(mcmcxdef *mctx, objnum objn) { @@ -936,31 +936,31 @@ void objindx(mcmcxdef *mctx, objnum objn) uint first; uint last; uint cur = 0; - + objptr = (objdef *)mcmlck(mctx, objn); /* get object pointer */ cnt = objnprop(objptr); /* get number of properties */ p = objprp(objptr); /* get pointer to properties (or old index) */ newsiz = 2 + 4*cnt; /* figure size needed for the index */ - + avail = mcmobjsiz(mctx, objn) - objfree(objptr); - + /* insert space for the index; expand the object if necessary */ if (avail < newsiz) { ushort need; - + newsiz += 10*4; /* add some extra space for later */ need = newsiz - avail; /* compute amount of space needed */ objptr = objexp(mctx, objn, &need); p = objprp(objptr); } - + /* now build the index */ indbase = objpfre(objptr); for (icnt = 0 ; cnt ; p = objpnxt(p), --cnt, ++icnt) { uint ofs = (uchar *)p - (uchar *)objptr; - + if (icnt) { /* figure out where to insert this property */ @@ -979,7 +979,7 @@ void objindx(mcmcxdef *mctx, objnum objn) else last = (cur == last ? last - 1 : cur); } - + /* make sure we're positioned just before insertion point */ while (cur < icnt && (indp[0] <= p[0] @@ -988,20 +988,20 @@ void objindx(mcmcxdef *mctx, objnum objn) indp += 4; ++cur; } - + /* move elements above if any */ if (cur < icnt) memmove(indp + 4, indp, (size_t)((icnt - cur) * 4)); } else indp = indbase; - + /* insert property into index */ indp[0] = p[0]; indp[1] = p[1]; oswp2(indp+2, ofs); } - + /* set the index flag, and dirty and free the object */ objsflg(objptr, objflg(objptr) | OBJFINDEX); mcmtch(mctx, (mcmon)objn); @@ -1018,7 +1018,7 @@ objdef *objnew(mcmcxdef *mctx, int sccnt, ushort propspace, /* allocate cache object */ o = (objdef *)mcmalo(mctx, (ushort)(OBJDEFSIZ + sccnt * 2 + propspace), &objn); - + /* set up object descriptor for the new object */ objini(mctx, sccnt, (objnum)objn, classflg); @@ -1034,11 +1034,11 @@ void objini(mcmcxdef *mctx, int sccnt, objnum objn, int classflg) /* get a lock on the object */ o = (objdef *)mcmlck(mctx, objn); - + memset(o, 0, (size_t)10); objsnsc(o, sccnt); objsfree(o, ((uchar *)objsc(o) + 2*sccnt) - (uchar *)o); - + /* set up flags */ if (classflg) flags |= OBJFCLASS; objsflg(o, flags); diff --git a/engines/glk/tads/tads2/object.h b/engines/glk/tads/tads2/object.h index 324396aec23..234164d9fc0 100644 --- a/engines/glk/tads/tads2/object.h +++ b/engines/glk/tads/tads2/object.h @@ -41,7 +41,7 @@ typedef ushort objnum; * For non-class objects, we'll leave some space free in the object so * that a few properties can be added without having to resize the * object. Class objects will probably never have anything added, so - * there's no need for extra space. + * there's no need for extra space. */ #define OBJEXTRA 64 @@ -51,7 +51,7 @@ typedef ushort objnum; * The object structure is actually laid out portably, using unaligned * 2-byte arrays, stored least significant byte first, for each ushort * (including the objnum array for the superclasses). The actual - * entries are at these offsets on all machines: + * entries are at these offsets on all machines: * * objws 0 * objflg 2 @@ -63,7 +63,7 @@ typedef ushort objnum; * objsc[0] 14 * objsc[1] 16 * etc - * + * * If the OBJFINDEX flag is set, the object has a property index. * The index occurs after the last superclass (so it's where the * property data would go if there were no index), and the property @@ -79,7 +79,7 @@ typedef ushort objnum; * only the active instance of a particular property is stored. * The index must be maintained by all routines that can change * property information: setp, delp, revert, etc. - * + * * Preceding the index table is a two-byte entry that gives the * offset of the properties. Since the properties immediately * follow the index, this can be used to deduce how large a space @@ -128,7 +128,7 @@ struct objucxdef { * becomes higher than the tail's), the tail is advanced by discarding * as many of the least recent undo records as necessary to make room * for the new head position. When the head and the previous head point - * to the same place, we have no undo records in the buffer. + * to the same place, we have no undo records in the buffer. */ /** * The first byte of an undo record specifies what action is to be @@ -136,7 +136,7 @@ struct objucxdef { * property. If a property was changed, it is undone by setting the * property back to its old value. An additional special flag indicates * a "savepoint." Normally, all changes back to a savepoint will be - * undone. + * undone. */ #define OBJUADD 1 /* a property was added (undo by deleting) */ #define OBJUCHG 2 /* a property was changed (change back to old value) */ @@ -147,7 +147,7 @@ struct objucxdef { /* * After the control byte (OBJUxxx), the object number, property * number, datatype, and data value will follow; some or all of these - * may be omitted, depending on the control byte. + * may be omitted, depending on the control byte. */ /* get object flags */ @@ -191,7 +191,7 @@ struct objucxdef { /* set reset size */ /* void objsetrst(objdef *objptr, uint newrst); */ #define objsetrst(o,n) oswp2(((char *)(o)) + 12, n) - + /* given an object pointer, get first superclass pointer */ /* uchar *objsc(objdef *objptr); */ #define objsc(o) (((uchar *)(o)) + OBJDEFSIZ) @@ -241,7 +241,7 @@ uint objgetp(mcmcxdef *ctx, objnum objn, prpnum prop, /* * Get the *ending* offset of the given property's value, without any * inheritance. Returns the byte offset one past the end of the - * property's data. + * property's data. */ uint objgetp_end(mcmcxdef *ctx, objnum objn, prpnum prop); @@ -272,17 +272,17 @@ objdef *objexp(mcmcxdef *ctx, objnum obj, ushort *siz); * Set an object's property, deleting the original value of the * property if it existed. If an undo context is provided, write an * undo record for the change; if the undo context pointer is null, no - * undo information is retained. + * undo information is retained. */ void objsetp(mcmcxdef *ctx, objnum obj, prpnum prop, dattyp typ, const void *val, objucxdef *undoctx); -/* +/* * Delete a property. If mark_only is true, we'll only mark the * property as deleted without actually reclaiming its space; this is * necessary when removing a code property (type DAT_CODE) any time * other code properties may follow, because p-code is not entirely - * self-relative and thus can't always be relocated within an object. + * self-relative and thus can't always be relocated within an object. */ void objdelp(mcmcxdef *mctx, objnum objn, prpnum prop, int mark_only); @@ -303,13 +303,13 @@ void objendemt(mcmcxdef *ctx, objnum objn, prpnum prop, uint endofs); * Determine if undo records should be kept. Undo records should be * kept only if a savepoint is present in the undo log. If no savepoint * is present, adding undo records would be useless, since it will not - * be possible to apply the undo information. + * be possible to apply the undo information. */ int objuok(objucxdef *undoctx); /* * Reserve space in an undo buffer, deleting old records as needed. - * Returns a pointer to the reserved space. + * Returns a pointer to the reserved space. */ uchar *objures(objucxdef *undoctx, uchar cmd, ushort siz); @@ -324,7 +324,7 @@ void obj1undo(mcmcxdef *mctx, objucxdef *undoctx); * the undo list, NOTHING will be undone. This prevents reaching an * inconsistent state in which some, but not all, of the operations * between two savepoints are undone: either all operations between two - * savepoints will be undone, or none will. + * savepoints will be undone, or none will. */ void objundo(mcmcxdef *mctx, objucxdef *undoctx); @@ -353,7 +353,7 @@ void objulose(objucxdef *undoctx); */ objdef *objnew(mcmcxdef *mctx, int sccnt, ushort propspace, objnum *objnptr, int classflg); - + /* initialize an already allocated object */ void objini(mcmcxdef *mctx, int sccnt, objnum objn, int classflg); @@ -372,7 +372,7 @@ void objaddsc(mcmcxdef *mctx, int sccnt, objnum objn); * store the source for an object as a special system property in the * object; when the object is recompiled, all of the object's properties * and superclasses must be deleted except the source property, which is - * retained even after recompilation. + * retained even after recompilation. */ void objclr(mcmcxdef *mctx, objnum objn, prpnum mindel); diff --git a/engines/glk/tads/tads2/opcode.h b/engines/glk/tads/tads2/opcode.h index 9af62ee8307..ecaae45b101 100644 --- a/engines/glk/tads/tads2/opcode.h +++ b/engines/glk/tads/tads2/opcode.h @@ -57,7 +57,7 @@ namespace TADS2 { #define OPCGETP 18 /* get property */ #define OPCGETPDATA 19 /* get a property, allowing only data values */ #define OPCGETLCL 20 /* get a local variable's value */ -#define OPCPTRGETPDATA 21 /* get property via pointer; only allow data */ +#define OPCPTRGETPDATA 21 /* get property via pointer; only allow data */ #define OPCRETURN 22 /* return without a value */ #define OPCRETVAL 23 /* return a value */ #define OPCENTER 24 /* enter a function */ @@ -156,13 +156,13 @@ ASSIGNMENT OPERATIONS (Note that this means that opcodes from 0xc0 up are all reserved for assignment operations.) The low six bits of the opcode specify exactly what kind of operation is to be performed: - + bits 0-1: specifies destination type: 00 2-byte operand is local number 01 2-byte operand is property to set in obj at tos 10 tos is index, [sp-1] is list to be indexed and set 11 tos is property pointer, [sp-1] is object - + bits 2-4: specifies assignment operation: 000 := (direct assignment) 001 += (add tos to destination) @@ -172,7 +172,7 @@ ASSIGNMENT OPERATIONS 101 ++ (increment tos) 110 -- (decrement tos) 111 *reserved* - + bit 5: specifies what to do with value computed by assignment 0 leave on stack (implies pre increment/decrement) 1 discard (implies post increment/decrement) diff --git a/engines/glk/tads/tads2/os.h b/engines/glk/tads/tads2/os.h index fd3a074547c..0d0fd44b6b7 100644 --- a/engines/glk/tads/tads2/os.h +++ b/engines/glk/tads/tads2/os.h @@ -43,19 +43,19 @@ namespace TADS2 { /* ------------------------------------------------------------------------ */ /* * A note on character sets: - * + * * Except where noted, all character strings passed to and from the * osxxx functions defined herein use the local operating system * representation. On a Windows machine localized to Eastern Europe, * for example, the character strings passed to and from the osxxx * functions would use single-byte characters in the Windows code page * 1250 representation. - * + * * Callers that use multiple character sets must implement mappings to * and from the local character set when calling the osxxx functions. * The osxxx implementations are thus free to ignore any issues related * to character set conversion or mapping. - * + * * The osxxx implementations are specifically not permitted to use * double-byte Unicode as the native character set, nor any other * character set where a null byte could appear as part of a non-null @@ -65,7 +65,7 @@ namespace TADS2 { * mixed single-byte and double-byte characters) may be used as long as * a null byte is never part of any multi-byte character, since this * would guarantee that a null byte could always be taken as a null - * character without knowledge of the encoding or context. + * character without knowledge of the encoding or context. */ /* ------------------------------------------------------------------------ */ @@ -76,33 +76,33 @@ namespace TADS2 { * qualification to indicate that they use a non-default addressing * model, the keyword OSFAR should be defined to the appropriate * compiler-specific extension keyword. - * + * * If you don't know what I'm talking about here, you should just ignore * it, because your platform probably doesn't have anything this * sinister. As of this writing, this applies only to MS-DOS, and then * only to 16-bit implementations that must interact with other 16-bit - * programs via dynamic linking or other mechanisms. + * programs via dynamic linking or other mechanisms. */ /* ------------------------------------------------------------------------ */ /* * ANSI C99 exact-size integer types. - * + * * C99 defines a set of integer types with exact bit sizes, named intXX_t * for a signed integer with XX bits, and uintXX_t for unsigned. XX can be * 8, 16, 32, or 64. TADS uses the 16- and 32-bit sizes, so each platform * is responsible for defining the following types: - * + * *. int16_t - a signed integer type storing EXACTLY 16 bits *. uint16_t - an unsigned integer type storing EXACTLY 16 bits *. int32_t - a signed integer type storing EXACTLY 32 bits *. uint32_t - an unsigned integer type storing EXACTLY 32 bits - * + * * Many modern compilers provide definitions for these types via the * standard header stdint.h. Where stdint.h is provided, the platform code * can merely #include . - * + * * For compilers where stdint.h isn't available, you must provide suitable * typedefs. Note that the types must be defined with the exact bit sizes * specified; it's not sufficient to use a bigger type, because we depend @@ -114,12 +114,12 @@ namespace TADS2 { /* ------------------------------------------------------------------------ */ /* * Thread-local storage (TLS). - * + * * When TADS is compiled with threading support, it requires some variables * to be "thread-local". This means that the variables have global scope * (so they're not stored in "auto" variables on the stack), but each * thread has a private copy of each such variable. - * + * * Nearly all systems that support threads also support thread-local * storage. Like threading support itself, though, TLS support is at * present implemented only in non-portable OS APIs rather than standard C @@ -129,7 +129,7 @@ namespace TADS2 { * since these features are optional, systems that don't have threading and * TLS support will simply need to disable the network features, which will * allow all of the threading and TLS definitions in osifc to be omitted. - * + * * There appear to be two common styles of TLS programming models. The * first provides non-standard compiler syntax for declarative creation of * thread-local variables. The Microsoft (on Windows) and Gnu compilers @@ -140,14 +140,14 @@ namespace TADS2 { * needs to add the special TLS storage class qualifier to an otherwise * ordinary global variable declaration, and then can access the thread * local as though it were an ordinary global. - * + * * The second programming model is via explicit OS API calls to create, * initialize, and access thread locals. pthreads provides such an API, as * does Win32. In fact, when you use the declarative syntax with MSVC or * gcc, the compiler generates the appropriate API calls, but the details * are transparent to the program; in contrast, when using pthreads * directly, the program must actively call the relevant APIs. - * + * * It's probably the case that every system that has compiler-level support * for declarative thread local creation also has procedural APIs, so the * simplest way to abstract the platform differences would be to do @@ -157,19 +157,19 @@ namespace TADS2 { * like to use declarative syntax whenever it's available, but fall back on * explicit API calls when it's not. So our programming model is a union * of the two styles: - * + * * 1. For each thread local, declare the thread local: *. OS_DECL_TLS(char *, my_local); - * + * * 2. At main program startup (for the main thread only), initialize each * thread local: *. os_tls_create(my_local); - * + * * 3. Never get or set the value of a thread local directly; instead, use * the get/set functions: *. char *x = os_tls_get(char *, my_local); *. os_tls_set(my_local, "hello"); - * + * * One key feature of this implementation is that each thread local is * stored as a (void *) value. We do it this way to allow a simple direct * mapping to the pthreads APIs, since that's going to be the most common @@ -184,20 +184,20 @@ namespace TADS2 { * the structure at thread exit. */ -/* - * +/* + * * Declare a thread local. - * + * * - For compilers that support declarative TLS variables, the local OS * headers should use the compiler support by #defining OS_DECL_TLS to the * appropriate local declarative keyword. - * + * * - For systems without declarative TLS support but with TLS APIs, the * global declared by this macro actually stores the slot ID (what pthreads * calls the "key") for the variable. This macro should therefore expand * to a declaration of the appropriate API type for a slot ID; for example, * on pthreads, #define OS_DECL_TLS(t, v) pthread_key_t v. - * + * * - For builds with no thread support, simply #define this to declare the * variable as an ordinary global: #define OS_DECL_TLS(t, v) t v. */ @@ -212,10 +212,10 @@ namespace TADS2 { * name in this case as an ordinary global of the slot ID type. The * os_tls_create() macro should therefore expand to a call to the slot * creation API, storing the new slot ID in the global. - * + * * Correspondingly, before the main thread exits, it should delete each * slot it created, b calling os_tls_delete(). - * + * * For declarative systems, there's no action required here, so these * macros can be defined to empty. */ @@ -229,7 +229,7 @@ namespace TADS2 { * get the per-thread instance of the variable's storage. *. #define os_tls_get(typ, varname) ((typ)pthread_getspecific(varname)) *. #define os_tls_set(varname, val) pthread_setspecific(varname, val) - * + * * On declarative systems, the global variable itself is the thread local, * so get/set can be implemented as direct access to the variable. *. #define os_tls_get(typ, varname) varname @@ -238,7 +238,7 @@ namespace TADS2 { /* * Common TLS definitions - declarative thread locals - * + * * For systems with declarative TLS support in the compiler, the OS header * can #define OS_DECLARATIVE_TLS to pick up suitable definitions for the * os_tls_xxx() macros. The OS header must separately define OS_DECL_TLS @@ -253,10 +253,10 @@ namespace TADS2 { /* * Common TLS definitions - pthreads - * + * * For pthreads systems without declarative TLS support in the compiler, * the OS header can simply #define OS_PTHREAD_TLS to pick up the standard - * definitions below. + * definitions below. */ #ifdef OS_PTHREAD_TLS #include @@ -268,15 +268,15 @@ namespace TADS2 { #endif /* ------------------------------------------------------------------------ */ -/* - * OS main entrypoint +/* + * OS main entrypoint */ int os0main(int oargc, char **oargv, - int (*mainfn)(int, char **, char *), + int (*mainfn)(int, char **, char *), const char *before, const char *config); -/* - * new-style OS main entrypoint - takes an application container context +/* + * new-style OS main entrypoint - takes an application container context */ int os0main2(int oargc, char **oargv, int (*mainfn)(int, char **, appctxdef *, char *), @@ -292,7 +292,7 @@ osfildef *oserrop(const char *arg0); * Special "switch" statement optimization flags. These definitions are * OPTIONAL - if a platform doesn't provide these definitions, suitable * code that's fully portable will be used. - * + * * On some compilers, the performance of a "switch" statement can be * improved by fully populating the switch with all possible "case" * values. When the compiler can safely assume that every possible "case" @@ -301,12 +301,12 @@ osfildef *oserrop(const char *arg0); * controlling expression of the switch: a range check is unnecessary * because the compiler knows that the value can never be outside the * "case" table. - * + * * This type of optimization doesn't apply to all compilers. When a given * platform's compiler can be coerced to produce faster "switch" * statements, though, there might be some benefit in defining these * symbols according to local platform rules. - * + * * First, #define OS_FILL_OUT_CASE_TABLES if you want this type of switch * optimization at all. This symbol is merely a flag, so it doesn't need * a value - #defining it is enough to activate the special code. If you @@ -316,7 +316,7 @@ osfildef *oserrop(const char *arg0); * #define OS_FILL_OUT_CASE_TABLES, then the portable code will know to * fill out case tables with all possible alternatives where it's possible * and potentially beneficial to do so. - * + * * Second, if you #define OS_FILL_OUT_CASE_TABLES, you MUST ALSO #define * OS_IMPOSSIBLE_DEFAULT_CASE. The value for this symbol must be some * code to insert into a "switch" statement at the point where a @@ -327,11 +327,11 @@ osfildef *oserrop(const char *arg0); * for it to do in many cases anyway). You can use an empty definition * for this symbol if your compiler doesn't have any special construct for * indicating a fully-populated case table. - * + * * Note that *most* switch statements in portable code won't care one way * or the other about these definitions. There's a time/space trade-off * in fully populating a switch's case table, so only the most - * time-critical code will bother trying. + * time-critical code will bother trying. */ @@ -341,7 +341,7 @@ osfildef *oserrop(const char *arg0); * TADS 2 swapping configuration. Define OS_DEFAULT_SWAP_ENABLED to 0 * if you want swapping turned off, 1 if you want it turned on. If we * haven't defined a default swapping mode yet, turn swapping on by - * default. + * default. */ #ifndef OS_DEFAULT_SWAP_ENABLED # define OS_DEFAULT_SWAP_ENABLED 1 @@ -349,7 +349,7 @@ osfildef *oserrop(const char *arg0); /* * If the system "long description" (for the banner) isn't defined, make - * it the same as the platform ID string. + * it the same as the platform ID string. */ #ifndef OS_SYSTEM_LDESC # define OS_SYSTEM_LDESC OS_SYSTEM_NAME @@ -357,7 +357,7 @@ osfildef *oserrop(const char *arg0); /* * TADS 2 Usage Lines - * + * * If the "usage" lines (i.e., the descriptive lines of text describing * how to run the various programs) haven't been otherwise defined, * define defaults for them here. Some platforms use names other than @@ -365,7 +365,7 @@ osfildef *oserrop(const char *arg0); * tadsc, tadsr, and tadsdb), so the usage lines should be adjusted * accordingly; simply define them earlier than this point (in this file * or in one of the files included by this file, such as osunixt.h) for - * non-default text. + * non-default text. */ #ifndef OS_TC_USAGE # define OS_TC_USAGE "usage: tc [options] file" @@ -380,7 +380,7 @@ osfildef *oserrop(const char *arg0); /* * Ports can define a special TDB startup message, which is displayed * after the copyright/version banner. If it's not defined at this - * point, define it to an empty string. + * point, define it to an empty string. */ #ifndef OS_TDB_STARTUP_MSG # define OS_TDB_STARTUP_MSG "" diff --git a/engines/glk/tads/tads2/output.cpp b/engines/glk/tads/tads2/output.cpp index ae9c74abffb..a56007c0656 100644 --- a/engines/glk/tads/tads2/output.cpp +++ b/engines/glk/tads/tads2/output.cpp @@ -37,9 +37,9 @@ namespace TADS2 { /* Forward declarations */ struct out_stream_info; -/* +/* * use our own isxxx - anything outside the US ASCII range is not reliably - * classifiable by the normal C isxxx routines + * classifiable by the normal C isxxx routines */ #define outissp(c) (((uchar)(c)) <= 127 && Common::isSpace((uchar)(c))) #define outisal(c) (((uchar)(c)) <= 127 && Common::isAlpha((uchar)(c))) @@ -51,29 +51,29 @@ struct out_stream_info; /* * Turn on formatter-level MORE mode, EXCEPT under any of the following * conditions: - * + * * - this is a MAC OS port *. - this is an HTML TADS interpreter *. - USE_OS_LINEWRAP is defined - * + * * Formatter-level MORE mode and formatter-level line wrapping go together; * you can't have one without the other. So, if USE_OS_LINEWRAP is * defined, we must also use OS-level MORE mode, which means we don't want * formatter-level MORE mode. - * + * * For historical reasons, we check specifically for MAC_OS. This was the * first platform for which OS-level MORE mode and OS-level line wrapping * were invented; at the time, we foolishly failed to anticipate that more * platforms might eventually come along with the same needs, so we coded a * test for MAC_OS rather than some more abstract marker. For * compatibility, we retain this specific test. - * + * * USE_OS_LINEWRAP is intended as the more abstract marker we should * originally have used. A port should #define USE_OS_LINEWRAP in its * system-specific os_xxx.h header to turn on OS-level line wrapping and * OS-level MORE mode. Ports should avoid adding new #ifndef tests for * specific platforms here; we've only retained the MAC_OS test because we - * don't want to break the existing MAC_OS port. + * don't want to break the existing MAC_OS port. */ #ifndef MAC_OS # ifndef USE_HTML @@ -83,7 +83,7 @@ struct out_stream_info; # endif /* USE_HTML */ #endif /* MAC_OS */ -/* +/* * In HTML mode, don't use MORE mode. Note that we explicitly turn MORE * mode OFF, even though we won't have turned it on above, because it might * have been turned on by an os_xxx.h header. This is here for historical @@ -91,7 +91,7 @@ struct out_stream_info; * headers that were originally written for the normal builds for those * same platforms, and those original headers explicitly #define USE_MORE * somewhere. So, to be absolutely sure we get it right here, we have to - * explicitly turn off USE_MORE when compiling for HTML mode. + * explicitly turn off USE_MORE when compiling for HTML mode. */ #ifdef USE_HTML # ifdef USE_MORE @@ -112,7 +112,7 @@ struct out_stream_info; * QTAB is a special hard tab character indicator. We use this when we * need to generate a hard tab to send to the underlying output layer * (in particular, we use this to send hard tabs to the HTML formatter - * when we're in HTML mode). + * when we're in HTML mode). */ #define QTAB 25 @@ -126,7 +126,7 @@ struct out_stream_info; * Globals and statics. These should really be moved into a context * structure, so that the output formatter subsystem could be shared * among multiple clients. For now, there's no practical problem using - * statics, because we only need a single output subsystem at one time. + * statics, because we only need a single output subsystem at one time. */ /* current script (command input) file */ @@ -135,13 +135,13 @@ extern osfildef *scrfp; /* * This should be TRUE if the output should have two spaces after a * period (or other such punctuation. It should generally be TRUE for - * fixed-width fonts, and FALSE for proportional fonts. + * fixed-width fonts, and FALSE for proportional fonts. */ static int doublespace = 1; /* * Log file handle and name. If we're copying output to a log file, - * these will tell us about the file. + * these will tell us about the file. */ osfildef *logfp; static char logfname[OSFNMAX]; @@ -178,13 +178,13 @@ static objnum G_user_filter = MCMONINV; /* ------------------------------------------------------------------------ */ -/* +/* * Hack to run with TADS 2.0 with minimal reworking. Rather than using * an allocated output layer context, store our subsystem context * information in some statics. This is less clean than using a real * context, but doesn't create any practical problems as we don't need * to share the output formatter subsystem among multiple simultaneous - * callers. + * callers. */ static runcxdef *runctx; /* execution context */ static uchar *fmsbase; /* format string area base */ @@ -211,7 +211,7 @@ static char out_parse_entity(char *outbuf, size_t outbuf_size, const char **sp, * read the full tag in order to obey an HEIGHT attribute we find. When * we encounter a
, we figure out whether we think we'll need a * flush or a blank line; if we find a HEIGHT attribute, we may change - * this opinion. + * this opinion. */ #define HTML_DEFER_BR_NONE 0 /* no pending
*/ #define HTML_DEFER_BR_FLUSH 1 /* only need an outflush() */ @@ -221,7 +221,7 @@ static char out_parse_entity(char *outbuf, size_t outbuf_size, const char **sp, * If we're compiling for an HTML-enabled underlying output subsystem, * we want to call the underlying OS layer when switching in and out of * HTML mode. If the underlying system doesn't process HTML, we don't - * need to let it know anything about HTML mode. + * need to let it know anything about HTML mode. */ #ifdef USE_HTML # define out_start_html(stream) os_start_html() @@ -235,12 +235,12 @@ static char out_parse_entity(char *outbuf, size_t outbuf_size, const char **sp, /* ------------------------------------------------------------------------ */ /* * Output formatter stream state structure. This structure encapsulates - * the state of an individual output stream. + * the state of an individual output stream. */ struct out_stream_info { /* low-level display routine (va_list version) */ void (*do_print)(out_stream_info *stream, const char *str); - + /* current line position and output column */ uchar linepos; uchar linecol; @@ -251,9 +251,9 @@ struct out_stream_info { /* output buffer */ char linebuf[MAXWIDTH]; - /* + /* * attribute buffer - we keep one attribute entry for each character in - * the line buffer + * the line buffer */ int attrbuf[MAXWIDTH]; @@ -287,39 +287,39 @@ struct out_stream_info { /* this output stream uses "MORE" mode */ int use_more_mode; - /* + /* * This output stream uses OS-level line wrapping - if this is set, * the output formatter will not insert a newline at the end of a * line that it's flushing for word wrapping, but will instead let - * the underlying OS display layer handle the wrapping. + * the underlying OS display layer handle the wrapping. */ int os_line_wrap; /* * Flag indicating that the underlying output system wants to * receive its output as HTML. - * + * * If this is true, we'll pass through HTML to the underlying output * system, and in addition generate HTML sequences for certain * TADS-native escapes (for example, we'll convert the "\n" sequence * to a
sequence). - * + * * If this is false, we'll do just the opposite: we'll remove HTML - * from the output stream and convert it into normal text sequences. + * from the output stream and convert it into normal text sequences. */ int html_target; /* * Flag indicating that the target uses plain text. If this flag is - * set, we won't add the OS escape codes for highlighted characters. + * set, we won't add the OS escape codes for highlighted characters. */ int plain_text_target; - - /* + + /* * Flag indicating that the caller is displaying HTML. We always * start off in text mode; the client can switch to HTML mode by * displaying a special escape sequence, and can switch back to text - * mode by displaying a separate special escape sequence. + * mode by displaying a separate special escape sequence. */ int html_mode; @@ -329,9 +329,9 @@ struct out_stream_info { /*
defer mode */ unsigned int html_defer_br; - /* + /* * HTML "ignore" mode - we suppress all output when parsing the - * contents of a or <ABOUTBOX> tag + * contents of a <TITLE> or <ABOUTBOX> tag */ int html_in_ignore; @@ -340,7 +340,7 @@ struct out_stream_info { * title (i.e., we're inside a <TITLE> tag's contents). We'll copy * characters to the title buffer rather than the normal output * buffer, and then call os_set_title() when we reach the - * tag. + * tag. */ int html_in_title; @@ -359,7 +359,7 @@ struct out_stream_info { /* * Parsing mode flag for ALT attributes. If we're parsing a tag * that allows ALT, such as IMG or SOUND, we'll set this flag, then - * insert the ALT text if we encounter it during parsing. + * insert the ALT text if we encounter it during parsing. */ int html_allow_alt; }; @@ -367,7 +367,7 @@ struct out_stream_info { /* * Default output converter. This is the output converter for the * standard display. Functions in the public interface that do not - * specify an output converter will use this converter by default. + * specify an output converter will use this converter by default. */ static out_stream_info G_std_disp; @@ -375,7 +375,7 @@ static out_stream_info G_std_disp; * Log file converter. This is the output converter for a log file. * Whenever we open a log file, we'll initialize this converter; as we * display text to the main display, we'll also copy it to the log file. - * + * * We maintain an entire separate conversion context for the log file, * so that we can perform a different set of conversions on it. We may * want, for example, to pass HTML text through to the OS display @@ -383,21 +383,21 @@ static out_stream_info G_std_disp; * we'll still want to convert log file output to text. By keeping a * separate display context for the log file, we can format output to * the log file using an entirely different style than we do for the - * display. + * display. */ static out_stream_info G_log_disp; /* ------------------------------------------------------------------------ */ /* - * low-level output handlers for the standard display and log file + * low-level output handlers for the standard display and log file */ /* standard display printer */ static void do_std_print(out_stream_info *stream, const char *str) { VARUSED(stream); - + /* display the text through the OS layer */ os_printz(str); } @@ -417,8 +417,8 @@ static void do_log_print(out_stream_info *stream, const char *str) /* ------------------------------------------------------------------------ */ -/* - * initialize a generic output formatter state structure +/* + * initialize a generic output formatter state structure */ static void out_state_init(out_stream_info *stream) { @@ -487,13 +487,13 @@ static void out_state_init(out_stream_info *stream) /* ------------------------------------------------------------------------ */ /* - * initialize a standard display stream + * initialize a standard display stream */ static void out_init_std(out_stream_info *stream) { /* there's no user output filter function yet */ out_set_filter(MCMONINV); - + /* initialize the basic stream state */ out_state_init(stream); @@ -501,33 +501,33 @@ static void out_init_std(out_stream_info *stream) G_std_disp.do_print = do_std_print; #ifdef USE_MORE - /* + /* * We're compiled for MORE mode, and we're not compiling for an * underlying HTML formatting layer, so use MORE mode for the - * standard display stream. + * standard display stream. */ stream->use_more_mode = TRUE; #else /* * We're compiled for OS-layer (or HTML-layer) MORE handling. For - * this case, use OS-layer (or HTML-layer) line wrapping as well. + * this case, use OS-layer (or HTML-layer) line wrapping as well. */ stream->os_line_wrap = TRUE; #endif #ifdef USE_HTML - /* + /* * if we're compiled for HTML mode, set the standard output stream * so that it knows it has an HTML target - this will ensure that * HTML tags are passed through to the underlying stream, and that - * we generate HTML equivalents for our own control sequences + * we generate HTML equivalents for our own control sequences */ stream->html_target = TRUE; #endif } /* - * initialize a standard log file stream + * initialize a standard log file stream */ static void out_init_log(out_stream_info *stream) { @@ -544,8 +544,8 @@ static void out_init_log(out_stream_info *stream) /* ------------------------------------------------------------------------ */ -/* - * table of '&' character name sequences +/* + * table of '&' character name sequences */ struct amp_tbl_t { /* entity name */ @@ -562,10 +562,10 @@ struct amp_tbl_t { * HTML entity mapping table. When we're in non-HTML mode, we keep our * own expansion table so that we can map HTML entity names into the * local character set. - * + * * The entries in this table must be in sorted order (by HTML entity * name), because we use a binary search to find an entity name in the - * table. + * table. */ static struct amp_tbl_t amp_tbl[] = { { "AElig", 198, 0 }, @@ -879,7 +879,7 @@ static struct amp_tbl_t amp_tbl[] = { /* ------------------------------------------------------------------------ */ /* - * turn on CAPS mode for a stream + * turn on CAPS mode for a stream */ static void outcaps_stream(out_stream_info *stream) { @@ -892,7 +892,7 @@ static void outcaps_stream(out_stream_info *stream) } /* - * turn on NOCAPS mode for a stream + * turn on NOCAPS mode for a stream */ static void outnocaps_stream(out_stream_info *stream) { @@ -905,7 +905,7 @@ static void outnocaps_stream(out_stream_info *stream) } /* - * turn on or off ALLCAPS mode for a stream + * turn on or off ALLCAPS mode for a stream */ static void outallcaps_stream(out_stream_info *stream, int all_caps) { @@ -919,7 +919,7 @@ static void outallcaps_stream(out_stream_info *stream, int all_caps) /* ------------------------------------------------------------------------ */ /* - * write a string to a stream + * write a string to a stream */ static void stream_print(out_stream_info *stream, char *str) { @@ -928,26 +928,26 @@ static void stream_print(out_stream_info *stream, char *str) } /* - * Write out a line + * Write out a line */ static void t_outline(out_stream_info *stream, int nl, const char *txt, const int *attr) { extern int scrquiet; - /* + /* * Check the "script quiet" mode - this indicates that we're reading * a script and not echoing output to the display. If this mode is * on, and we're writing to the display, suppress this write. If * the mode is off, or we're writing to another stream (such as the - * log file), show the output as normal. + * log file), show the output as normal. */ if (!scrquiet || stream != &G_std_disp) { size_t i; char buf[MAXWIDTH]; char *dst; - + /* * Check to see if we've reached the end of the screen, and if * so run the MORE prompt. Note that we don't make this check @@ -955,13 +955,13 @@ static void t_outline(out_stream_info *stream, int nl, * layer code is taking responsibility for pagination issues. * We also don't display a MORE prompt when reading from a * script file. - * + * * Note that we suppress the MORE prompt if nl == 0, since this * is used to flush a partial line of text without starting a * new line (for example, when displaying a prompt where the * input will appear on the same line following the prompt). - * - * Skip the MORE prompt if this stream doesn't use it. + * + * Skip the MORE prompt if this stream doesn't use it. */ if (stream->use_more_mode && scrfp == 0 @@ -975,7 +975,7 @@ static void t_outline(out_stream_info *stream, int nl, /* * Display the text. Run through the text in pieces; each time the - * attributes change, set attributes at the osifc level. + * attributes change, set attributes at the osifc level. */ for (i = 0, dst = buf ; txt[i] != '\0' ; ++i) { @@ -1016,27 +1016,27 @@ static void t_outline(out_stream_info *stream, int nl, /* * Flush the current line to the display. The 'nl' argument specifies * what kind of flushing to do: - * + * * 0: flush the current line but do not start a new line; more text will * follow on the current line. This is used, for example, to flush text * after displaying a prompt and before waiting for user input. - * + * * 1: flush the line and start a new line. - * + * * 2: flush the line as though starting a new line, but don't add an * actual newline character to the output, since the underlying OS * display code will handle this. Instead, add a space after the line. * (This differs from mode 0 in that mode 0 shouldn't add anything at * all after the line.) - * + * * 3: "preview" mode. Flush the line, but do not start a new line, and * retain the current text in the buffer. This is used for systems that * handle the line wrapping in the underlying system code to flush a * partially filled line that will need to be flushed again later. - * + * * 4: same as mode 0, but used for internal buffer flushes only. Do not * involve the underlying OS layer in this type of flush - simply flush - * our buffers with no separation. + * our buffers with no separation. */ /* flush a given output stream */ @@ -1060,7 +1060,7 @@ static void outflushn_stream(out_stream_info *stream, int nl) /* check the output mode */ if (nl == 3) { - /* + /* * this is the special "preview" mode -- only display the part * that we haven't already previewed for this same line */ @@ -1093,7 +1093,7 @@ static void outflushn_stream(out_stream_info *stream, int nl) break; case 1: - /* + /* * Add a newline. If there's nothing in the current line, * or we just wrote out a newline, do not add an extra * newline. Keep all newlines in PRE mode. @@ -1103,7 +1103,7 @@ static void outflushn_stream(out_stream_info *stream, int nl) { /* add a newline after the text */ suffix = "\n"; - + /* count the line in the page size */ countnl = 1; } @@ -1115,22 +1115,22 @@ static void outflushn_stream(out_stream_info *stream, int nl) break; case 2: - /* + /* * we're going to depend on the underlying OS output layer * to do line breaking, so don't add a newline, but do add a * space, so that the underlying OS layer knows we have a - * word break here + * word break here */ suffix = " "; break; } - /* + /* * display the line, as long as we have something buffered to * display; even if we don't, display it if our column is * non-zero and we didn't just do a newline, since this must * mean that we've flushed a partial line and are just now doing - * the newline + * the newline */ if (stream->linebuf[stream->preview] != '\0' || (stream->linecol != 0 && !stream->just_did_nl) @@ -1163,11 +1163,11 @@ static void outflushn_stream(out_stream_info *stream, int nl) /* reset the line output buffer position */ stream->linepos = stream->preview = 0; - /* + /* * If we just output a newline, note it. If we didn't just * output a newline, but we did write out anything else, note * that we're no longer at the start of a line on the underlying - * output device. + * output device. */ if (nl == 1) stream->just_did_nl = TRUE; @@ -1175,7 +1175,7 @@ static void outflushn_stream(out_stream_info *stream, int nl) stream->just_did_nl = FALSE; } - /* + /* * If the osifc-level attributes don't match the current attributes, * bring the osifc layer up to date. This is necessary in cases where * we set attributes immediately before asking for input - we @@ -1195,7 +1195,7 @@ static void outflushn_stream(out_stream_info *stream, int nl) /* * Determine if we're showing output. Returns true if output should be * displayed, false if it should be suppressed. We'll note the output - * for hidden display accounting as needed. + * for hidden display accounting as needed. */ static int out_is_hidden() { @@ -1209,9 +1209,9 @@ static int out_is_hidden() /* note the hidden output */ hidout = 1; - /* + /* * unless we're showing hidden text in the debugger, we're - * suppressing output, so return true + * suppressing output, so return true */ if (!dbghid) return TRUE; @@ -1223,7 +1223,7 @@ static int out_is_hidden() /* ------------------------------------------------------------------------ */ /* - * Display a blank line to the given stream + * Display a blank line to the given stream */ static void outblank_stream(out_stream_info *stream) { @@ -1241,14 +1241,14 @@ static void outblank_stream(out_stream_info *stream) /* ------------------------------------------------------------------------ */ /* * Generate a tab for a "\t" sequence in the game text. - * + * * Standard (non-HTML) version: we'll generate enough spaces to take us * to the next tab stop. - * + * * HTML version: if we're in native HTML mode, we'll just generate a * ; if we're not in HTML mode, we'll generate a hard * tab character, which the HTML formatter will interpret as a . + * MULTIPLE=4>. */ static void outtab_stream(out_stream_info *stream) { @@ -1271,10 +1271,10 @@ static void outtab_stream(out_stream_info *stream) { int maxcol; - /* + /* * We're not in HTML mode - expand the tab with spaces. Figure * the maximum column: if we're doing our own line wrapping, never - * go beyond the actual display width. + * go beyond the actual display width. */ maxcol = (stream->os_line_wrap ? OS_MAXWIDTH : G_os_linewidth); @@ -1292,13 +1292,13 @@ static void outtab_stream(out_stream_info *stream) /* ------------------------------------------------------------------------ */ /* - * Flush a line + * Flush a line */ static void out_flushline(out_stream_info *stream, int padding) { - /* + /* * check to see if we're using the underlying display layer's line - * wrapping + * wrapping */ if (stream->os_line_wrap) { @@ -1310,16 +1310,16 @@ static void out_flushline(out_stream_info *stream, int padding) * enough information here to figure out actual line breaks. * So, we'll just flush out our buffer whenever it fills up, and * suppress newlines. - * + * * Similarly, if we have OS-level MORE processing, don't try to * figure out where the line breaks go -- just flush our buffer * without a trailing newline whenever the buffer is full, and * let the OS layer worry about formatting lines and paragraphs. - * + * * If we're using padding, use mode 2. If we don't want padding * (which is the case if we completely fill up the buffer * without finding any word breaks), write out in mode 0, which - * just flushes the buffer exactly like it is. + * just flushes the buffer exactly like it is. */ outflushn_stream(stream, padding ? 2 : 4); } @@ -1329,7 +1329,7 @@ static void out_flushline(out_stream_info *stream, int padding) * Normal mode - we process the *MORE* prompt ourselves, and we * are responsible for figuring out where the actual line breaks * go. Use outflush() to generate an actual newline whenever we - * flush out our buffer. + * flush out our buffer. */ outflushn_stream(stream, 1); } @@ -1344,7 +1344,7 @@ static void outchar_noxlat_stream(out_stream_info *stream, char c) { int i; int qspace; - + /* check for the special quoted space character */ if (c == QSPACE) { @@ -1363,7 +1363,7 @@ static void outchar_noxlat_stream(out_stream_info *stream, char c) /* translate any whitespace character to a regular space character */ if (outissp(c)) c = ' '; - + /* it's not a quoted space */ qspace = 0; } @@ -1398,7 +1398,7 @@ static void outchar_noxlat_stream(out_stream_info *stream, char c) { /* lock the object holding the captured text */ p = mcmlck(stream->capture_ctx, stream->capture_obj); - + /* make sure the capture object is big enough */ if (mcmobjsiz(stream->capture_ctx, stream->capture_obj) <= stream->capture_ofs) @@ -1407,10 +1407,10 @@ static void outchar_noxlat_stream(out_stream_info *stream, char c) p = mcmrealo(stream->capture_ctx, stream->capture_obj, (ushort)(stream->capture_ofs + 256)); } - + /* add this character */ *(p + stream->capture_ofs++) = c; - + /* unlock the capture object */ mcmtch(stream->capture_ctx, stream->capture_obj); mcmunlck(stream->capture_ctx, stream->capture_obj); @@ -1418,7 +1418,7 @@ static void outchar_noxlat_stream(out_stream_info *stream, char c) /* * we're done - we don't want to actually display the character - * while capturing + * while capturing */ return; } @@ -1426,10 +1426,10 @@ static void outchar_noxlat_stream(out_stream_info *stream, char c) /* add the character to out output buffer, flushing as needed */ if (stream->linecol + 1 < G_os_linewidth) { - /* - * there's room for this character, so add it to the buffer + /* + * there's room for this character, so add it to the buffer */ - + /* ignore non-quoted space at start of line outside of PRE */ if (outissp(c) && c != '\t' && stream->linecol == 0 && !qspace && stream->html_pre_level == 0) @@ -1458,7 +1458,7 @@ static void outchar_noxlat_stream(out_stream_info *stream, char c) * brackets, and braces.) Don't double the spacing if we're * not in the normal doublespace mode; some people may * prefer single spacing after punctuation, so we make this - * a run-time option. + * a run-time option. */ if (doublespace) { @@ -1493,7 +1493,7 @@ static void outchar_noxlat_stream(out_stream_info *stream, char c) * most recent word break, and output the line up to the previous * word. Note that if we're trying to output a space, we'll just * add it to the line buffer. If the last character of the line - * buffer is already a space, we won't do anything right now. + * buffer is already a space, we won't do anything right now. */ if (outissp(c) && c != '\t' && !qspace) { @@ -1505,32 +1505,32 @@ static void outchar_noxlat_stream(out_stream_info *stream, char c) } return; } - + /* * Find the most recent word break: look for a space or dash, starting - * at the end of the line. - * + * at the end of the line. + * * If we're about to write a hyphen, we want to skip all contiguous * hyphens, because we want to keep them together as a single * punctuation mark; then keep going in the normal manner, which will * keep the hyphens plus the word they're attached to together as a * single unit. If spaces precede the sequence of hyphens, include - * the prior word as well. + * the prior word as well. */ i = stream->linepos - 1; if (c == '-') { /* skip any contiguous hyphens at the end of the line */ for ( ; i >= 0 && stream->linebuf[i] == '-' ; --i) ; - + /* skip any spaces preceding the sequence of hyphens */ for ( ; i >= 0 && outissp(stream->linebuf[i]) ; --i) ; } - /* + /* * Now find the preceding space. If we're doing our own wrapping * (i.e., we're not using OS line wrapping), then look for the - * nearest hyphen as well. + * nearest hyphen as well. */ for ( ; i >= 0 && !outissp(stream->linebuf[i]) && !(!stream->os_line_wrap && stream->linebuf[i] == '-') ; --i) ; @@ -1538,15 +1538,15 @@ static void outchar_noxlat_stream(out_stream_info *stream, char c) /* check to see if we found a good place to break */ if (i < 0) { - /* + /* * we didn't find any good place to break - flush the entire - * line as-is, breaking arbitrarily in the middle of a word + * line as-is, breaking arbitrarily in the middle of a word */ out_flushline(stream, FALSE); - /* + /* * we've completely cleared out the line buffer, so reset all of - * the line buffer counters + * the line buffer counters */ stream->linepos = 0; stream->linecol = 0; @@ -1559,10 +1559,10 @@ static void outchar_noxlat_stream(out_stream_info *stream, char c) int tmpattr[MAXWIDTH]; size_t tmpcnt; - /* remember the word-break character */ + /* remember the word-break character */ brkchar = stream->linebuf[i]; - /* null-terminate the line buffer */ + /* null-terminate the line buffer */ stream->linebuf[stream->linepos] = '\0'; /* the next line starts after the break - save a copy */ @@ -1570,9 +1570,9 @@ static void outchar_noxlat_stream(out_stream_info *stream, char c) memcpy(tmpbuf, &stream->linebuf[i+1], tmpcnt + 1); memcpy(tmpattr, &stream->attrbuf[i+1], tmpcnt * sizeof(tmpattr[0])); - /* + /* * terminate the buffer at the space or after the hyphen, - * depending on where we broke + * depending on where we broke */ if (outissp(brkchar)) stream->linebuf[i] = '\0'; @@ -1587,9 +1587,9 @@ static void outchar_noxlat_stream(out_stream_info *stream, char c) memcpy(stream->attrbuf, tmpattr, tmpcnt * sizeof(tmpattr[0])); stream->linepos = tmpcnt; - /* + /* * figure what column we're now in - count all of the printable - * characters in the new line + * characters in the new line */ for (stream->linecol = 0, i = 0 ; i < stream->linepos ; ++i) { @@ -1598,7 +1598,7 @@ static void outchar_noxlat_stream(out_stream_info *stream, char c) ++(stream->linecol); } } - + /* add the new character to buffer */ stream->attrbuf[stream->linepos] = stream->cur_attr; stream->linebuf[stream->linepos++] = c; @@ -1610,15 +1610,15 @@ static void outchar_noxlat_stream(out_stream_info *stream, char c) /* ------------------------------------------------------------------------ */ /* * Write out a character, translating to the local system character set - * from the game's internal character set. + * from the game's internal character set. */ static void outchar_stream(out_stream_info *stream, char c) { outchar_noxlat_stream(stream, cmap_i2n(c)); } -/* - * write out a string, translating to the local system character set +/* + * write out a string, translating to the local system character set */ static void outstring_stream(out_stream_info *stream, const char *s) { @@ -1627,8 +1627,8 @@ static void outstring_stream(out_stream_info *stream, const char *s) outchar_stream(stream, *s); } -/* - * write out a string without translation +/* + * write out a string without translation */ static void outstring_noxlat_stream(out_stream_info *stream, char *s) { @@ -1640,16 +1640,16 @@ static void outstring_noxlat_stream(out_stream_info *stream, char *s) /* ------------------------------------------------------------------------ */ /* * Write out an HTML character value, translating to the local character - * set. + * set. */ static void outchar_html_stream(out_stream_info *stream, unsigned int htmlchar) { amp_tbl_t *ampptr; - /* + /* * search for a mapping entry for this entity, in case it's defined - * in an external mapping file + * in an external mapping file */ for (ampptr = amp_tbl ; ampptr < amp_tbl + sizeof(amp_tbl)/sizeof(amp_tbl[0]) ; ++ampptr) @@ -1659,27 +1659,27 @@ static void outchar_html_stream(out_stream_info *stream, break; } - /* + /* * If we found a mapping table entry, and the entry has an expansion * from the external character mapping table file, use the external - * expansion; otherwise, use the default expansion. + * expansion; otherwise, use the default expansion. */ if (ampptr >= amp_tbl + sizeof(amp_tbl)/sizeof(amp_tbl[0]) || ampptr->expan == 0) { char xlat_buf[50]; - /* + /* * there's no external mapping table file expansion -- use the - * default OS mapping routine + * default OS mapping routine */ os_xlat_html4(htmlchar, xlat_buf, sizeof(xlat_buf)); outstring_noxlat_stream(stream, xlat_buf); } else { - /* - * use the explicit mapping from the mapping table file + /* + * use the explicit mapping from the mapping table file */ outstring_noxlat_stream(stream, ampptr->expan); } @@ -1690,22 +1690,22 @@ static void outchar_html_stream(out_stream_info *stream, /* * Enter a recursion level. Returns TRUE if the caller should proceed * with the operation, FALSE if not. - * + * * If we're making a recursive call, thereby re-entering the formatter, * and this stream is not the same as the enclosing stream, we want to * ignore this call and suppress any output to this stream, so we'll - * return FALSE. + * return FALSE. */ static int out_push_stream(out_stream_info *stream) { - /* + /* * if we're already in the formatter, and the new stream doesn't * match the enclosing recursion level's stream, tell the caller to - * abort the operation + * abort the operation */ if (G_recurse != 0 && G_cur_stream != stream) return FALSE; - + /* note the active stream */ G_cur_stream = stream; @@ -1717,7 +1717,7 @@ static int out_push_stream(out_stream_info *stream) } /* - * Leave a recursion level + * Leave a recursion level */ static void out_pop_stream() { @@ -1729,7 +1729,7 @@ static void out_pop_stream() /* * nextout() returns the next character in a string, and updates the * string pointer and remaining length. Returns zero if no more - * characters are available in the string. + * characters are available in the string. */ /* static char nextout(char **s, uint *len); */ #define nextout(s, len) ((char)(*(len) == 0 ? 0 : (--(*(len)), *((*(s))++)))) @@ -1738,7 +1738,7 @@ static void out_pop_stream() /* ------------------------------------------------------------------------ */ /* * Get the next character, writing the previous character to the given - * output stream if it's not null. + * output stream if it's not null. */ static char nextout_copy(const char **s, size_t *slen, char prv, out_stream_info *stream) @@ -1761,7 +1761,7 @@ static char read_tag(char *dst, size_t dstlen, int *is_end_tag, const char **s, size_t *slen, out_stream_info *stream) { char c; - + /* skip the opening '<' */ c = nextout_copy(s, slen, '<', stream); @@ -1782,10 +1782,10 @@ static char read_tag(char *dst, size_t dstlen, int *is_end_tag, } else *is_end_tag = FALSE; - - /* + + /* * find the end of the tag name - the tag continues to the next space, - * '>', or end of line + * '>', or end of line */ for ( ; c != '\0' && !outissp(c) && c != '>' ; c = nextout_copy(s, slen, c, stream)) @@ -1797,7 +1797,7 @@ static char read_tag(char *dst, size_t dstlen, int *is_end_tag, --dstlen; } } - + /* null-terminate the tag name */ if (dstlen > 0) *dst = '\0'; @@ -1809,7 +1809,7 @@ static char read_tag(char *dst, size_t dstlen, int *is_end_tag, /* ------------------------------------------------------------------------ */ /* - * display a string of a given length to a given stream + * display a string of a given length to a given stream */ static int outformatlen_stream(out_stream_info *stream, const char *s, size_t slen) @@ -1822,11 +1822,11 @@ static int outformatlen_stream(out_stream_info *stream, char *f1; int infmt = 0; - /* + /* * This routine can recurse because of format strings ("%xxx%" * sequences). When we recurse, we want to ensure that the * recursion is directed to the original stream only. So, note the - * current stream statically in case we re-enter the formatter. + * current stream statically in case we re-enter the formatter. */ if (!out_push_stream(stream)) return 0; @@ -1846,7 +1846,7 @@ static int outformatlen_stream(out_stream_info *stream, * come across an HTML-significant character ('&' or '<') in * HTML mode, we must have a stray percent sign; dump the * whole string so far and act as though we have no format - * string + * string */ if (c == '\\' || f == &fmsbuf[sizeof(fmsbuf)] @@ -1878,15 +1878,15 @@ static int outformatlen_stream(out_stream_info *stream, /* check for an init cap */ if (outisup(fmsbuf[0])) { - /* + /* * note the initial capital, so that we follow the - * original capitalization in the substituted string + * original capitalization in the substituted string */ initcap = TRUE; - /* + /* * if the second letter is capitalized as well, - * capitalize the entire substituted string + * capitalize the entire substituted string */ if (fmsbuf[1] != '\0' && outisup(fmsbuf[1])) { @@ -1898,7 +1898,7 @@ static int outformatlen_stream(out_stream_info *stream, /* convert the entire string to lower case for searching */ strcpy(fmsbuf_srch, fmsbuf); os_strlwr(fmsbuf_srch); - + /* find the string in the format string table */ fmslen = strlen(fmsbuf_srch); for (fms = fmsbase ; fms < fmstop ; ) @@ -1918,19 +1918,19 @@ static int outformatlen_stream(out_stream_info *stream, /* note the current ALLCAPS mode */ old_all_caps = stream->allcapsflag; - - /* + + /* * we have a match - set the appropriate - * capitalization mode + * capitalization mode */ if (allcaps) outallcaps_stream(stream, TRUE); else if (initcap) outcaps_stream(stream); - /* + /* * evaluate the associated property to generate - * the substitution text + * the substitution text */ runppr(runctx, cmdActor, (prpnum)propnum, 0); @@ -1967,19 +1967,19 @@ static int outformatlen_stream(out_stream_info *stream, c = nextout(&s, &slen); continue; } - + /* * If we're parsing HTML here, and we're inside a tag, skip - * characters until we reach the end of the tag. + * characters until we reach the end of the tag. */ if (stream->html_mode_flag != HTML_MODE_NORMAL) { switch(stream->html_mode_flag) { case HTML_MODE_TAG: - /* + /* * keep skipping up to the closing '>', but note when we - * enter any quoted section + * enter any quoted section */ switch(c) { @@ -2050,7 +2050,7 @@ static int outformatlen_stream(out_stream_info *stream, if (c == '=') { char qu; - + /* skip the '=' */ c = nextout(&s, &slen); @@ -2080,13 +2080,13 @@ static int outformatlen_stream(out_stream_info *stream, c = nextout(&s, &slen); if (c == '\0') { - /* + /* * we've reached the end of the * string, and we're still inside * this attribute - abandon the * attribute but note that we're * inside a quoted string if - * necessary + * necessary */ if (qu == '"') stream->html_mode_flag = @@ -2102,10 +2102,10 @@ static int outformatlen_stream(out_stream_info *stream, break; } - /* + /* * if we're looking for a quote, check * for the closing quote; otherwise, - * check for alphanumerics + * check for alphanumerics */ if (qu != 0) { @@ -2134,15 +2134,15 @@ static int outformatlen_stream(out_stream_info *stream, attrval[0] = '\0'; } - /* + /* * see if we recognize it, and it's meaningful - * in the context of the current tag + * in the context of the current tag */ if (!scumm_stricmp(attrname, "height") && stream->html_defer_br != HTML_DEFER_BR_NONE) { int ht; - + /* * If the height is zero, always treat this * as a non-blanking flush. If it's one, @@ -2173,9 +2173,9 @@ static int outformatlen_stream(out_stream_info *stream, outstring_stream(stream, attrval); } - /* + /* * since we already read the next character, - * simply loop back immediately + * simply loop back immediately */ continue; } @@ -2196,9 +2196,9 @@ static int outformatlen_stream(out_stream_info *stream, break; } - /* + /* * move on to the next character, and start over with the - * new character + * new character */ c = nextout(&s, &slen); continue; @@ -2207,7 +2207,7 @@ static int outformatlen_stream(out_stream_info *stream, /* * If we're in a title, and this isn't the start of a new tag, * skip the character - we suppress all regular text output - * inside a ... sequence. + * inside a ... sequence. */ if (stream->html_in_ignore && c != '<') { @@ -2228,10 +2228,10 @@ static int outformatlen_stream(out_stream_info *stream, c = nextout(&s, &slen); } - /* + /* * if we're gathering a title, and there's room in the title * buffer for more (always leaving room for a null - * terminator), add this to the title buffer + * terminator), add this to the title buffer */ if (stream->html_in_title) { @@ -2249,7 +2249,7 @@ static int outformatlen_stream(out_stream_info *stream, /* don't display anything in an ignore section */ continue; } - + if ( c == '%' ) /* translation string? */ { infmt = 1; @@ -2258,7 +2258,7 @@ static int outformatlen_stream(out_stream_info *stream, else if ( c == '\\' ) /* special escape code? */ { c = nextout(&s, &slen); - + if (stream->capturing && c != '^' && c != 'v' && c != '\0') { outchar_stream(stream, '\\'); @@ -2305,13 +2305,13 @@ static int outformatlen_stream(out_stream_info *stream, /* tell the OS layer to switch to HTML mode */ out_start_html(stream); } - + /* switch to HTML mode */ stream->html_mode = TRUE; - /* + /* * if the character wasn't a "+", it's not part - * of the "\H" sequence, so display it normally + * of the "\H" sequence, so display it normally */ if (c != '+' && c != 0) outchar_stream(stream, c); @@ -2324,15 +2324,15 @@ static int outformatlen_stream(out_stream_info *stream, case 'n': /* newline? */ outflushn_stream(stream, 1); /* yes, output line */ break; - + case 't': /* tab? */ outtab_stream(stream); break; - + case 'b': /* blank line? */ outblank_stream(stream); break; - + case '\0': /* line ends here? */ done = 1; break; @@ -2340,18 +2340,18 @@ static int outformatlen_stream(out_stream_info *stream, case ' ': /* quoted space */ if (stream->html_target && stream->html_mode) { - /* + /* * we're generating for an HTML target and we're * in HTML mode - generate the HTML non-breaking - * space + * space */ outstring_stream(stream, " "); } else { - /* + /* * we're not in HTML mode - generate our - * internal quoted space character + * internal quoted space character */ outchar_stream(stream, QSPACE); } @@ -2399,7 +2399,7 @@ static int outformatlen_stream(out_stream_info *stream, outchar_stream(stream, nextout(&s, &slen)); outchar_stream(stream, nextout(&s, &slen)); break; - + default: /* just pass invalid escapes as-is */ outchar_stream(stream, c); break; @@ -2414,7 +2414,7 @@ static int outformatlen_stream(out_stream_info *stream, * We're in HTML mode, but the underlying target does not * accept HTML sequences. It appears we're at the start of * an "&" entity or a tag sequence, so parse it, remove it, - * and replace it (if possible) with a text-only equivalent. + * and replace it (if possible) with a text-only equivalent. */ if (c == '<') { @@ -2427,14 +2427,14 @@ static int outformatlen_stream(out_stream_info *stream, /* * Check to see if we recognize the tag. We only * recognize a few simple tags that map easily to - * character mode. + * character mode. */ if (!scumm_stricmp(tagbuf, "br")) { - /* + /* * line break - if there's anything buffered up, * just flush the current line, otherwise write out - * a blank line + * a blank line */ if (stream->html_in_ignore) /* suppress breaks in ignore mode */; @@ -2449,7 +2449,7 @@ static int outformatlen_stream(out_stream_info *stream, || !scumm_stricmp(tagbuf, "strong")) { int attr = 0; - + /* choose the attribute flag */ switch (tagbuf[0]) { @@ -2473,7 +2473,7 @@ static int outformatlen_stream(out_stream_info *stream, attr = OS_ATTR_STRONG; break; } - + /* bold on/off - send out appropriate os-layer code */ if (stream->html_in_ignore) { @@ -2510,7 +2510,7 @@ static int outformatlen_stream(out_stream_info *stream, else if (!scumm_stricmp(tagbuf, "hr")) { int rem; - + if (!stream->html_in_ignore) { /* start a new line */ @@ -2521,17 +2521,17 @@ static int outformatlen_stream(out_stream_info *stream, { char dashbuf[100]; int cur; - + /* do as much as we can on this pass */ cur = rem; if ((size_t)cur > sizeof(dashbuf) - 1) cur = sizeof(dashbuf) - 1; - + /* do a buffer-full of dashes */ memset(dashbuf, '_', cur); dashbuf[cur] = '\0'; outstring_stream(stream, dashbuf); - + /* deduct this from the total */ rem -= cur; } @@ -2549,7 +2549,7 @@ static int outformatlen_stream(out_stream_info *stream, /* if it's an open quote, increment the level */ if (!is_end_tag) ++(stream->html_quote_level); - + /* add the open quote */ htmlchar = (!is_end_tag @@ -2557,13 +2557,13 @@ static int outformatlen_stream(out_stream_info *stream, ? 8220 : 8216) : ((stream->html_quote_level & 1) == 1 ? 8221 : 8217)); - - /* + + /* * write out the HTML character, translated to - * the local character set + * the local character set */ outchar_html_stream(stream, htmlchar); - + /* if it's a close quote, decrement the level */ if (is_end_tag) --(stream->html_quote_level); @@ -2571,46 +2571,46 @@ static int outformatlen_stream(out_stream_info *stream, } else if (!scumm_stricmp(tagbuf, "title")) { - /* + /* * Turn ignore mode on or off as appropriate, and * turn on or off title mode as well. */ if (is_end_tag) { - /* + /* * note that we're leaving an ignore section and - * a title section + * a title section */ --(stream->html_in_ignore); --(stream->html_in_title); - /* + /* * if we're no longer in a title, call the OS * layer to tell it the title string, in case it * wants to change the window title or otherwise - * make use of the title + * make use of the title */ if (stream->html_in_title == 0) { /* null-terminate the title string */ *stream->html_title_ptr = '\0'; - + /* tell the OS about the title */ os_set_title(stream->html_title_buf); } } else { - /* + /* * if we aren't already in a title, set up to - * capture the title into the title buffer + * capture the title into the title buffer */ if (!stream->html_in_title) stream->html_title_ptr = stream->html_title_buf; - /* + /* * note that we're in a title and in an ignore - * section, since nothing within gets displayed + * section, since nothing within gets displayed */ ++(stream->html_in_ignore); ++(stream->html_in_title); @@ -2641,10 +2641,10 @@ static int outformatlen_stream(out_stream_info *stream, /* suppress everything up to the next '>' */ stream->html_mode_flag = HTML_MODE_TAG; - /* + /* * continue with the current character; since we're in * html tag mode, we'll skip everything until we get to - * the closing '>' + * the closing '>' */ continue; } @@ -2656,7 +2656,7 @@ static int outformatlen_stream(out_stream_info *stream, /* write it out (we've already translated it) */ outstring_noxlat_stream(stream, xlat_buf); - + /* proceed with the next character */ continue; } @@ -2669,7 +2669,7 @@ static int outformatlen_stream(out_stream_info *stream, * However, we do need to keep track of when we're in a PRE * block, so that we can pass whitespaces and newlines through * to the underlying HTML engine without filtering when we're - * in preformatted text. + * in preformatted text. */ char tagbuf[50]; int is_end_tag; @@ -2719,7 +2719,7 @@ static int outformatlen_stream(out_stream_info *stream, /* ------------------------------------------------------------------------ */ /* - * Parse an HTML entity markup + * Parse an HTML entity markup */ static char out_parse_entity(char *outbuf, size_t outbuf_size, const char **sp, size_t *slenp) { char ampbuf[10]; @@ -2730,9 +2730,9 @@ static char out_parse_entity(char *outbuf, size_t outbuf_size, const char **sp, size_t lo, hi, cur; char c; - /* + /* * remember where the part after the '&' begins, so we can come back - * here later if necessary + * here later if necessary */ orig_s = *sp; orig_slen = *slenp; @@ -2744,7 +2744,7 @@ static char out_parse_entity(char *outbuf, size_t outbuf_size, const char **sp, if (c == '#') { uint val; - + /* skip the '#' */ c = nextout(sp, slenp); @@ -2777,14 +2777,14 @@ static char out_parse_entity(char *outbuf, size_t outbuf_size, const char **sp, val += c - '0'; } } - + /* if we found a ';' at the end, skip it */ if (c == ';') c = nextout(sp, slenp); - + /* translate the character into the output buffer */ os_xlat_html4(val, outbuf, outbuf_size); - + /* we're done with this character */ return c; } @@ -2797,28 +2797,28 @@ static char out_parse_entity(char *outbuf, size_t outbuf_size, const char **sp, c != '\0' && (outisdg(c) || outisal(c)) && dst < ampbuf + sizeof(ampbuf) - 1 ; *dst++ = c, c = nextout(sp, slenp)) ; - + /* null-terminate the name */ *dst = '\0'; - + /* do a binary search for the name */ lo = 0; hi = sizeof(amp_tbl)/sizeof(amp_tbl[0]) - 1; for (;;) { int diff; - + /* if we've converged, look no further */ if (lo > hi || lo >= sizeof(amp_tbl)/sizeof(amp_tbl[0])) { ampptr = 0; break; } - + /* split the difference */ cur = lo + (hi - lo)/2; ampptr = &_tbl[cur]; - + /* see where we are relative to the target item */ diff = strcmp(ampptr->cname, ampbuf); if (diff == 0) @@ -2835,7 +2835,7 @@ static char out_parse_entity(char *outbuf, size_t outbuf_size, const char **sp, ampptr = 0; break; } - + /* this one is too high - check the lower half */ hi = (cur == hi ? hi - 1 : cur); } @@ -2845,7 +2845,7 @@ static char out_parse_entity(char *outbuf, size_t outbuf_size, const char **sp, lo = (cur == lo ? lo + 1 : cur); } } - + /* skip to the appropriate next character */ if (c == ';') { @@ -2855,25 +2855,25 @@ static char out_parse_entity(char *outbuf, size_t outbuf_size, const char **sp, else if (ampptr != 0) { int skipcnt; - + /* found the name - skip its exact length */ skipcnt = strlen(ampptr->cname); for (*sp = orig_s, *slenp = orig_slen ; skipcnt != 0 ; c = nextout(sp, slenp), --skipcnt) ; } - + /* if we found the entry, write out the character */ if (ampptr != 0) { - /* + /* * if this one has an external mapping table entry, use the mapping - * table entry; otherwise, use the default OS routine mapping + * table entry; otherwise, use the default OS routine mapping */ if (ampptr->expan != 0) { - /* + /* * we have an explicit expansion from the mapping table file - - * use it + * use it */ size_t copylen = strlen(ampptr->expan); if (copylen > outbuf_size - 1) @@ -2884,18 +2884,18 @@ static char out_parse_entity(char *outbuf, size_t outbuf_size, const char **sp, } else { - /* + /* * there's no mapping table expansion - use the default OS code - * expansion + * expansion */ os_xlat_html4(ampptr->html_cval, outbuf, outbuf_size); } } else { - /* + /* * didn't find it - output the '&' literally, then back up and - * output the entire sequence following + * output the entire sequence following */ *sp = orig_s; *slenp = orig_slen; @@ -2909,12 +2909,12 @@ static char out_parse_entity(char *outbuf, size_t outbuf_size, const char **sp, /* return the next character */ return c; } - + /* ------------------------------------------------------------------------ */ /* - * Initialize the output formatter + * Initialize the output formatter */ void out_init() { @@ -2932,8 +2932,8 @@ void out_init() /* ------------------------------------------------------------------------ */ -/* - * initialize the property translation table +/* + * initialize the property translation table */ void tiosetfmt(tiocxdef *ctx, runcxdef *rctx, uchar *fbase, uint flen) { @@ -2950,10 +2950,10 @@ void tiosetfmt(tiocxdef *ctx, runcxdef *rctx, uchar *fbase, uint flen) * reader will call this routine during initialization if it finds HTML * entities in the mapping table file. We'll remember these mappings * for use in translating HTML entities to the local character set. - * + * * Note that the standard run-time can only display a single character * set, so every HTML entity that we display must be mapped to the - * single active native character set. + * single active native character set. */ void tio_set_html_expansion(unsigned int html_char_val, const char *expansion, size_t expansion_len) @@ -3017,9 +3017,9 @@ int outformatlen(const char *s, uint slen) { /* call the filter */ runfn(runctx, G_user_filter, 1); - /* + /* * note that we called the filter, so that we'll remove the - * result of the filter from the stack before we return + * result of the filter from the stack before we return */ called_filter = TRUE; @@ -3032,18 +3032,18 @@ int outformatlen(const char *s, uint slen) { /* pop the value */ runpop(runctx, &val); - /* + /* * get the text from the string, and use it as a replacement - * for the original string + * for the original string */ p = val.runsv.runsvstr; slen = osrp2(p) - 2; s = (char *)(p + 2); - /* + /* * push the string back onto the stack - this will ensure * that the string stays referenced while we're working, so - * that the garbage collector won't delete it + * that the garbage collector won't delete it */ runrepush(runctx, &val); } @@ -3089,7 +3089,7 @@ done: /* ------------------------------------------------------------------------ */ /* - * Display a blank line + * Display a blank line */ void outblank() { @@ -3116,7 +3116,7 @@ void outblank() /* * outcaps() - sets an internal flag which makes the next letter output * a capital, whether it came in that way or not. Set the same state in - * both formatters (standard and log). + * both formatters (standard and log). */ void outcaps(void) { @@ -3126,7 +3126,7 @@ void outcaps(void) /* * outnocaps() - sets the next letter to a miniscule, whether it came in - * that way or not. + * that way or not. */ void outnocaps(void) { @@ -3136,7 +3136,7 @@ void outnocaps(void) /* ------------------------------------------------------------------------ */ /* - * Open a log file + * Open a log file */ int tiologopn(tiocxdef *ctx, char *fn) { @@ -3150,17 +3150,17 @@ int tiologopn(tiocxdef *ctx, char *fn) /* open the new file */ logfp = osfopwt(fn, OSFTLOG); - /* + /* * Reset the log file's output formatter state, since we're opening - * a new file. + * a new file. */ out_init_log(&G_log_disp); - /* + /* * Set the log file's HTML source mode flag to the same value as is * currently being used in the main display stream, so that it will * interpret source markups the same way that the display stream is - * going to. + * going to. */ G_log_disp.html_mode = G_std_disp.html_mode; @@ -3169,7 +3169,7 @@ int tiologopn(tiocxdef *ctx, char *fn) } /* - * Close the log file + * Close the log file */ int tiologcls(tiocxdef *ctx) { @@ -3198,10 +3198,10 @@ int tiologcls(tiocxdef *ctx) * automatically copy text to the log file; any text that the caller * knows should be in the log file during times when more mode is turned * off can be explicitly added with this function. - * + * * If nl is true, we'll add a newline at the end of this text. The * caller should not include any newlines in the text being displayed - * here. + * here. */ void out_logfile_print(const char *txt, int nl) { @@ -3229,12 +3229,12 @@ void out_logfile_print(const char *txt, int nl) /* ------------------------------------------------------------------------ */ /* - * Set the current MORE mode + * Set the current MORE mode */ int setmore(int state) { int oldstate = G_os_moremode; - + G_os_moremode = state; return oldstate; } @@ -3245,14 +3245,14 @@ int setmore(int state) * pagination issues (i.e., USE_MORE is defined), we'll simply display * the prompt and wait for input. Otherwise, the OS layer controls the * MORE prompt, so we'll call the OS-layer function to display the - * prompt. + * prompt. */ void out_more_prompt() { #ifdef USE_MORE /* * USE_MORE defined - we take responsibility for pagination. Show - * our default MORE prompt and wait for a keystroke. + * our default MORE prompt and wait for a keystroke. */ int done; @@ -3266,7 +3266,7 @@ void out_more_prompt() for (done = FALSE ; !done ; ) { os_event_info_t evt; - + /* get an event */ switch(os_get_event(0, FALSE, &evt)) { @@ -3278,7 +3278,7 @@ void out_more_prompt() done = TRUE; next_page = TRUE; break; - + case '\r': case '\n': /* stop waiting, show one line */ @@ -3307,21 +3307,21 @@ void out_more_prompt() } } - /* + /* * Remove the prompt from the screen by backing up and overwriting * it with spaces. (Note that this assumes that we're running in * some kind of terminal or character mode with a fixed-pitch font; * if that's not the case, the OS layer should be taking * responsibility for pagination anyway, so this code shouldn't be - * in use in the first place.) + * in use in the first place.) */ os_printz("\r \r"); - /* + /* * if they pressed the space key, it means that we should show an * entire new page, so reset the line count to zero; otherwise, * we'll want to display another MORE prompt at the very next line, - * so leave the line count alone + * so leave the line count alone */ if (next_page) G_std_disp.linecnt = 0; @@ -3332,7 +3332,7 @@ void out_more_prompt() * USE_MORE is undefined - this means that the OS layer is taking * all responsibility for pagination. We must ask the OS layer to * display the MORE prompt, because we can't make any assumptions - * about what the prompt looks like. + * about what the prompt looks like. */ os_more_prompt(); @@ -3342,7 +3342,7 @@ void out_more_prompt() /* ------------------------------------------------------------------------ */ /* - * reset output + * reset output */ void outreset(void) { @@ -3354,7 +3354,7 @@ void outreset(void) * Determine if HTML mode is active. Returns true if so, false if not. * Note that this merely indicates whether an "\H+" sequence is * currently active -- this will return true after an "\H+" sequence, - * even on text-only interpreters. + * even on text-only interpreters. */ int tio_is_html_mode() { @@ -3367,11 +3367,11 @@ int tio_is_html_mode() /* * Capture routines. Capture affects only the standard display output * stream; there's no need to capture information redundantly in the log - * file stream. + * file stream. */ /* - * Begin/end capturing + * Begin/end capturing */ void tiocapture(tiocxdef *tioctx, mcmcxdef *memctx, int flag) { @@ -3388,9 +3388,9 @@ void tiocapture(tiocxdef *tioctx, mcmcxdef *memctx, int flag) G_std_disp.capture_ctx = memctx; } - /* + /* * remember capture status in the standard output stream as well as - * the log stream + * the log stream */ G_std_disp.capturing = flag; G_log_disp.capturing = flag; @@ -3421,8 +3421,8 @@ uint tiocapturesize(tiocxdef *ctx) } /* ------------------------------------------------------------------------ */ -/* - * set the current actor +/* + * set the current actor */ void tiosetactor(tiocxdef *ctx, objnum actor) { @@ -3431,18 +3431,18 @@ void tiosetactor(tiocxdef *ctx, objnum actor) } /* - * get the current actor + * get the current actor */ objnum tiogetactor(tiocxdef *ctx) { VARUSED(ctx); return cmdActor; } - + /* ------------------------------------------------------------------------ */ /* * Flush the output line. We'll write to both the standard display and - * the log file, as needed. + * the log file, as needed. */ void outflushn(int nl) { @@ -3458,7 +3458,7 @@ void outflushn(int nl) } /* - * flush the current line, and start a new line + * flush the current line, and start a new line */ void outflush(void) { @@ -3471,8 +3471,8 @@ void outflush(void) * Hidden text routines */ -/* - * outhide - hide output in the standard display stream +/* + * outhide - hide output in the standard display stream */ void outhide(void) { @@ -3483,7 +3483,7 @@ void outhide(void) /* * Check output status. Indicate whether output is currently hidden, - * and whether any hidden output has occurred. + * and whether any hidden output has occurred. */ void outstat(int *hidden, int *output_occurred) { @@ -3520,7 +3520,7 @@ int outshow(void) /* ------------------------------------------------------------------------ */ /* - * start/end watchpoint evaluation - suppress all dstring output + * start/end watchpoint evaluation - suppress all dstring output */ void outwx(int flag) { @@ -3531,7 +3531,7 @@ void outwx(int flag) /* ------------------------------------------------------------------------ */ /* * Set the user filter function. Setting this to MCMONINV clears the - * filter. + * filter. */ void out_set_filter(objnum filter_fn) { @@ -3541,7 +3541,7 @@ void out_set_filter(objnum filter_fn) /* ------------------------------------------------------------------------ */ /* - * Set the double-space mode + * Set the double-space mode */ void out_set_doublespace(int dbl) { diff --git a/engines/glk/tads/tads2/play.cpp b/engines/glk/tads/tads2/play.cpp index 25ce28125b2..1fa9a08723f 100644 --- a/engines/glk/tads/tads2/play.cpp +++ b/engines/glk/tads/tads2/play.cpp @@ -39,13 +39,13 @@ void plygo(runcxdef *run, voccxdef *voc, tiocxdef *tio, objnum preinit, char *re first_time = TRUE; - /* + /* * Write out the special HTML sequence, in case we're on an HTML * system. This tells the HTML parser to use the parsing rules for - * TADS 2 callers. + * TADS 2 callers. */ outformat("\\H+\\H-"); - + startover: if (!inited) { @@ -90,11 +90,11 @@ startover: } ERREND(ec); } - - /* + + /* * Run the "init" function. Do NOT run init if we're restoring * a game directly from the command line AND there's an - * initRestore function defined. + * initRestore function defined. */ if (restore_fname == 0 || voc->voccxinitrestore == MCMONINV) { @@ -114,21 +114,21 @@ startover: /* if they restarted, go back and start over */ if (err == ERR_RUNRESTART) goto startover; - + /* resignal the error */ errrse(ec); } ERREND(ec); } } - + /* next time through, we'll need to run init again */ inited = FALSE; - /* + /* * check for startup parameter file to restore - if there's a * system-specific parameter file specified, pretend that it was - * specified as the restore file + * specified as the restore file */ if (os_paramfile(filbuf)) restore_fname = filbuf; @@ -139,14 +139,14 @@ startover: /* * Check to see if the game file supports the initRestore * function. If so, call it to restore the game. If not, - * restore the game directly. + * restore the game directly. */ if (voc->voccxinitrestore != MCMONINV) { char restore_buf[OSFNMAX*2]; char *src; char *dst; - + /* convert any backslashes to double backslashes */ for (src = restore_fname, dst = restore_buf ; *src != '\0' && dst + 2 < restore_buf + sizeof(restore_buf) ; @@ -165,10 +165,10 @@ startover: *dst++ = *src; } } - - /* + + /* * all the game's initRestore function with the name of - * saved game file to restore as the argument + * saved game file to restore as the argument */ /* reset the interpreter */ @@ -202,15 +202,15 @@ startover: /* clear out the redo command buffer */ voc->voccxredobuf[0] = '\0'; - + /* read and execute commands */ for (;;) { char buf[128]; - + err = 0; ERRBEGIN(ec) - + /* read a new command if there's nothing to redo */ if (!voc->voccxredo) { @@ -229,7 +229,7 @@ startover: { int quiet = FALSE; char *p; - + p = buf + 1; if (*p == '@') { @@ -266,7 +266,7 @@ startover: } } - /* + /* * If there's redo in the redo buffer, use it now. If the * buffer is empty and the redo flag is set, we'll just * re-execute whatever's in our internal buffer. @@ -288,7 +288,7 @@ startover: /* execute the command */ (void)voccmd(voc, buf, (uint)sizeof(buf)); - + end_loop: ERRCATCH(ec, err) { @@ -309,7 +309,7 @@ startover: errrse(ec); ERREND(ec) } - + /* if they want to quit, we're done */ if (err == ERR_RUNQUIT) break; @@ -321,7 +321,7 @@ startover: * If we're quitting, give the debugger one last chance at taking * control. If it just returns, we can go ahead and terminate, but * if it wants it can restart the game by calling bifrst() as - * normal. + * normal. */ ERRBEGIN(ec) { diff --git a/engines/glk/tads/tads2/property.h b/engines/glk/tads/tads2/property.h index 86a4b69d679..39feb39de60 100644 --- a/engines/glk/tads/tads2/property.h +++ b/engines/glk/tads/tads2/property.h @@ -26,12 +26,12 @@ * stored in objects, which must be binary-portable. Hence, the internal * structure of a property header is not a C structure, but a portable * sequence of bytes. Multi-byte quantities are stored in Intel format. - * + * * property number - 2 bytes * property datatype - 1 byte * property size - 2 bytes * property flags - 1 byte - * + * * This header is followed immediately by the property value. For * convenience, a set of macros is defined to provide access to the * fields of a property header. @@ -71,7 +71,7 @@ typedef uchar prpdef; /* prpdef is just an array of bytes */ /** * Invalid property number - this number will never be used as an actual - * property, so it can be used to signify the lack of a valid property + * property, so it can be used to signify the lack of a valid property */ #define PRP_INVALID 0 diff --git a/engines/glk/tads/tads2/qa_scriptor.cpp b/engines/glk/tads/tads2/qa_scriptor.cpp index aec06910d0e..794b0ffb060 100644 --- a/engines/glk/tads/tads2/qa_scriptor.cpp +++ b/engines/glk/tads/tads2/qa_scriptor.cpp @@ -65,11 +65,11 @@ char *qasgets(char *buf, int bufl) { for (;;) { char c; - + /* * Read the next character of input. If it's not a newline, * there's more on the same line, so read the rest and see what - * to do. + * to do. */ c = osfgetc(scrfp); if (c != '\n' && c != '\r') @@ -81,7 +81,7 @@ char *qasgets(char *buf, int bufl) { qasclose(); return 0; } - + /* if the line started with '>', strip '\n' and return line */ if (c == '>') { @@ -92,9 +92,9 @@ char *qasgets(char *buf, int bufl) { && (buf[l-1] == '\n' || buf[l-1] == '\r')) buf[l-1] = 0; - /* + /* * if we're not in quiet mode, echo the command to the - * display + * display */ if (!scrquiet) outformat(buf); diff --git a/engines/glk/tads/tads2/regex.cpp b/engines/glk/tads/tads2/regex.cpp index dfbe160ac33..d94c4a454ec 100644 --- a/engines/glk/tads/tads2/regex.cpp +++ b/engines/glk/tads/tads2/regex.cpp @@ -82,17 +82,17 @@ namespace TADS2 { * transition. The condition is simply the character that we must match * to make the transition, or a special distinguished symbol "epsilon," * which refers to a transition with no input character consumed. - * + * * The primitive elements of our machines guarantee that we never have * more than two transitions out of a particular state, so we can * denormalize the representation of a state by storing the two possible * tuples for that state in a single combined tuple. This has the * performance advantage that we can use the state ID as an index into * an array of state tuples. - * + * * A particular machine always has a single initial and single final * (successful) state, so we can define a machine by its initial and - * final state ID's. + * final state ID's. */ enum { // the special symbol value for "epsilon" @@ -129,7 +129,7 @@ enum { /* ------------------------------------------------------------------------ */ /* * A machine description. Machines are fully described by their initial - * and final state ID's. + * and final state ID's. */ struct re_machine { /* the machine's initial state */ @@ -142,13 +142,13 @@ struct re_machine { /* ------------------------------------------------------------------------ */ /* * Initialize the context. The memory for the context structure itself - * is allocated and maintained by the caller. + * is allocated and maintained by the caller. */ void re_init(re_context *ctx, errcxdef *errctx) { /* save the error context */ ctx->errctx = errctx; - + /* no tuple array yet */ ctx->tuple_arr = 0; ctx->tuples_alloc = 0; @@ -165,12 +165,12 @@ void re_init(re_context *ctx, errcxdef *errctx) /* ------------------------------------------------------------------------ */ /* - * Reset compiler - clears states and tuples + * Reset compiler - clears states and tuples */ static void re_reset(re_context *ctx) { int i; - + /* delete any range tables we've allocated */ for (i = 0 ; i < ctx->next_state ; ++i) { @@ -191,13 +191,13 @@ static void re_reset(re_context *ctx) /* ------------------------------------------------------------------------ */ /* * Delete the context - frees structures associated with the context. - * Does NOT free the memory used by the context structure itself. + * Does NOT free the memory used by the context structure itself. */ void re_delete(re_context *ctx) { /* reset state */ re_reset(ctx); - + /* if we've allocated an array, delete it */ if (ctx->tuple_arr != 0) { @@ -215,20 +215,20 @@ void re_delete(re_context *ctx) /* ------------------------------------------------------------------------ */ /* - * Allocate a new state ID + * Allocate a new state ID */ static re_state_id re_alloc_state(re_context *ctx) { /* - * If we don't have enough room for another state, expand the array + * If we don't have enough room for another state, expand the array */ if (ctx->next_state >= ctx->tuples_alloc) { uint new_alloc; - + /* bump the size by a bit */ new_alloc = ctx->tuples_alloc + 100; - + /* allocate or expand the array */ if (ctx->tuples_alloc == 0) { @@ -241,12 +241,12 @@ static re_state_id re_alloc_state(re_context *ctx) else { re_tuple *ptr; - + /* allocate a new memory block */ ptr = (re_tuple *)mchalo(ctx->errctx, (new_alloc * sizeof(re_tuple)), "regex"); - + /* copy the old memory to the new memory */ memcpy(ptr, ctx->tuple_arr, ctx->tuples_alloc * sizeof(re_tuple)); @@ -275,35 +275,35 @@ static re_state_id re_alloc_state(re_context *ctx) /* ------------------------------------------------------------------------ */ /* - * Set a transition from a state to a given destination state. + * Set a transition from a state to a given destination state. */ static void re_set_trans(re_context *ctx, re_state_id id, re_state_id dest_id, char ch) { re_tuple *tuple; - - /* + + /* * get the tuple containing the transitions for this state ID - the * state ID is the index of the state's transition tuple in the - * array + * array */ tuple = &ctx->tuple_arr[id]; /* * If the first state pointer hasn't been set yet, set it to the new * destination. Otherwise, set the second state pointer. - * + * * Only set the character on setting the first state. When setting * the second state, we must assume that the character for the state * has already been set, since any given state can have only one - * character setting. + * character setting. */ if (tuple->next_state_1 == RE_STATE_INVALID) { - /* + /* * set the character ID, unless the state has been marked with a * special flag which indicates that the character value has - * another meaning (in particular, a group marker) + * another meaning (in particular, a group marker) */ if (!(tuple->flags & (RE_STATE_GROUP_BEGIN | RE_STATE_GROUP_END))) tuple->ch = ch; @@ -320,7 +320,7 @@ static void re_set_trans(re_context *ctx, /* ------------------------------------------------------------------------ */ /* - * Initialize a new machine, giving it an initial and final state + * Initialize a new machine, giving it an initial and final state */ static void re_init_machine(re_context *ctx, re_machine *machine) { @@ -342,13 +342,13 @@ static void re_build_char(re_context *ctx, re_machine *machine, char ch) /* * Build a character range recognizer. 'range' is a 256-bit (32-byte) - * bit vector. + * bit vector. */ static void re_build_char_range(re_context *ctx, re_machine *machine, unsigned char *range, int exclusion) { unsigned char *range_copy; - + /* initialize our new machine */ re_init_machine(ctx, machine); @@ -365,12 +365,12 @@ static void re_build_char_range(re_context *ctx, re_machine *machine, /* store it in the tuple */ ctx->tuple_arr[machine->init].char_range = range_copy; } - + /* * Build a group recognizer. This is almost the same as a character * recognizer, but matches a previous group rather than a literal - * character. + * character. */ static void re_build_group_matcher(re_context *ctx, re_machine *machine, int group_num) @@ -378,10 +378,10 @@ static void re_build_group_matcher(re_context *ctx, /* initialize our new machine */ re_init_machine(ctx, machine); - /* + /* * Allocate a transition tuple for the new state, using the group ID * as the character code. Store the special code for a group - * recognizer rather than the normal literal character code. + * recognizer rather than the normal literal character code. */ re_set_trans(ctx, machine->init, machine->final_state, (char)(group_num + RE_GROUP_MATCH_0)); @@ -389,7 +389,7 @@ static void re_build_group_matcher(re_context *ctx, /* - * Build a concatenation recognizer + * Build a concatenation recognizer */ static void re_build_concat(re_context *ctx, re_machine *new_machine, re_machine *lhs, re_machine *rhs) @@ -397,21 +397,21 @@ static void re_build_concat(re_context *ctx, re_machine *new_machine, /* initialize the new machine */ re_init_machine(ctx, new_machine); - /* + /* * set up an epsilon transition from the new machine's initial state - * to the first submachine's initial state + * to the first submachine's initial state */ re_set_trans(ctx, new_machine->init, lhs->init, RE_EPSILON); /* * Set up an epsilon transition from the first submachine's final - * state to the second submachine's initial state + * state to the second submachine's initial state */ re_set_trans(ctx, lhs->final_state, rhs->init, RE_EPSILON); /* * Set up an epsilon transition from the second submachine's final - * state to our new machine's final state + * state to our new machine's final state */ re_set_trans(ctx, rhs->final_state, new_machine->final_state, RE_EPSILON); } @@ -419,7 +419,7 @@ static void re_build_concat(re_context *ctx, re_machine *new_machine, /* * Build a group machine. sub_machine contains the machine that * expresses the group's contents; we'll fill in new_machine with a - * newly-created machine that encloses and marks the group. + * newly-created machine that encloses and marks the group. */ static void re_build_group(re_context *ctx, re_machine *new_machine, re_machine *sub_machine, int group_id) @@ -427,17 +427,17 @@ static void re_build_group(re_context *ctx, re_machine *new_machine, /* initialize the container machine */ re_init_machine(ctx, new_machine); - /* + /* * set up an epsilon transition from the new machine's initial state * into the initial state of the group, and another transition from - * the group's final state into the container's final state + * the group's final state into the container's final state */ re_set_trans(ctx, new_machine->init, sub_machine->init, RE_EPSILON); re_set_trans(ctx, sub_machine->final_state, new_machine->final_state, RE_EPSILON); /* * Mark the initial and final states of the group machine as being - * group markers. + * group markers. */ ctx->tuple_arr[new_machine->init].flags |= RE_STATE_GROUP_BEGIN; ctx->tuple_arr[new_machine->final_state].flags |= RE_STATE_GROUP_END; @@ -448,7 +448,7 @@ static void re_build_group(re_context *ctx, re_machine *new_machine, } /* - * Build an alternation recognizer + * Build an alternation recognizer */ static void re_build_alter(re_context *ctx, re_machine *new_machine, re_machine *lhs, re_machine *rhs) @@ -458,14 +458,14 @@ static void re_build_alter(re_context *ctx, re_machine *new_machine, /* * Set up an epsilon transition from our new machine's initial state - * to the initial state of each submachine + * to the initial state of each submachine */ re_set_trans(ctx, new_machine->init, lhs->init, RE_EPSILON); re_set_trans(ctx, new_machine->init, rhs->init, RE_EPSILON); /* * Set up an epsilon transition from the final state of each - * submachine to our final state + * submachine to our final state */ re_set_trans(ctx, lhs->final_state, new_machine->final_state, RE_EPSILON); re_set_trans(ctx, rhs->final_state, new_machine->final_state, RE_EPSILON); @@ -481,10 +481,10 @@ static void re_build_closure(re_context *ctx, /* initialize the new machine */ re_init_machine(ctx, new_machine); - /* + /* * set up an epsilon transition from our initial state to the * submachine's initial state, and from the submachine's final state - * to our final state + * to our final state */ re_set_trans(ctx, new_machine->init, sub->init, RE_EPSILON); re_set_trans(ctx, sub->final_state, new_machine->final_state, RE_EPSILON); @@ -494,7 +494,7 @@ static void re_build_closure(re_context *ctx, * the loop transition that takes us from the new machine's final * state back to its initial state. We don't do this on the * zero-or-one closure, because we can only match the expression - * once. + * once. */ if (specifier != '?') re_set_trans(ctx, sub->final_state, sub->init, RE_EPSILON); @@ -504,14 +504,14 @@ static void re_build_closure(re_context *ctx, * up an epsilon transition from our initial state to our final * state, since we can skip the entire subexpression. We don't do * this on the one-or-more closure, because we can't skip the - * subexpression in this case. + * subexpression in this case. */ if (specifier != '+') re_set_trans(ctx, new_machine->init, new_machine->final_state, RE_EPSILON); } /* - * Build a null machine + * Build a null machine */ static void re_build_null_machine(re_context *ctx, re_machine *machine) { @@ -520,7 +520,7 @@ static void re_build_null_machine(re_context *ctx, re_machine *machine) /* ------------------------------------------------------------------------ */ /* - * Determine if a machine is null + * Determine if a machine is null */ static int re_is_machine_null(re_context *ctx, re_machine *machine) { @@ -533,7 +533,7 @@ static int re_is_machine_null(re_context *ctx, re_machine *machine) * Concatenate the second machine onto the first machine, replacing the * first machine with the resulting machine. If the first machine is a * null machine (created with re_build_null_machine), we'll simply copy - * the second machine into the first. + * the second machine into the first. */ static void re_concat_onto(re_context *ctx, re_machine *dest, re_machine *rhs) @@ -541,16 +541,16 @@ static void re_concat_onto(re_context *ctx, /* check for a null destination machine */ if (re_is_machine_null(ctx, dest)) { - /* + /* * the first machine is null - simply copy the second machine - * onto the first unchanged + * onto the first unchanged */ *dest = *rhs; } else { re_machine new_machine; - + /* build the concatenated machine */ re_build_concat(ctx, &new_machine, dest, rhs); @@ -564,7 +564,7 @@ static void re_concat_onto(re_context *ctx, * first machine with the resulting machine. If the first machine is a * null machine, this simply replaces the first machine with the second * machine. If the second machine is null, this simply leaves the first - * machine unchanged. + * machine unchanged. */ static void re_alternate_onto(re_context *ctx, re_machine *dest, re_machine *rhs) @@ -572,22 +572,22 @@ static void re_alternate_onto(re_context *ctx, /* check to see if the first machine is null */ if (re_is_machine_null(ctx, dest)) { - /* + /* * the first machine is null - simply copy the second machine - * onto the first + * onto the first */ *dest = *rhs; } else { - /* + /* * if the second machine is null, don't do anything; otherwise, - * build the alternation + * build the alternation */ if (!re_is_machine_null(ctx, rhs)) { re_machine new_machine; - + /* build the alternation */ re_build_alter(ctx, &new_machine, dest, rhs); @@ -605,14 +605,14 @@ static void re_alternate_onto(re_context *ctx, (((unsigned char *)(set))[(bit) >> 3] |= (1 << ((bit) & 7))) /* - * Test a bit in a bit vector + * Test a bit in a bit vector */ #define re_is_bit_set(set, bit) \ ((((unsigned char *)(set))[(bit) >> 3] & (1 << ((bit) & 7))) != 0) /* ------------------------------------------------------------------------ */ /* - * Compile an expression + * Compile an expression */ static re_status_t re_compile(re_context *ctx, const char *expr, size_t exprlen, @@ -649,7 +649,7 @@ static re_status_t re_compile(re_context *ctx, * beginning of line - if we're not at the beginning of the * current expression (i.e., we already have some * concatentations accumulated), treat it as an ordinary - * character + * character */ if (!re_is_machine_null(ctx, &cur_machine)) goto normal_char; @@ -657,9 +657,9 @@ static re_status_t re_compile(re_context *ctx, /* build a new start-of-text recognizer */ re_build_char(ctx, &new_machine, RE_TEXT_BEGIN); - /* + /* * concatenate it onto the string - note that this can't - * have any postfix operators + * have any postfix operators */ re_concat_onto(ctx, &cur_machine, &new_machine); break; @@ -668,7 +668,7 @@ static re_status_t re_compile(re_context *ctx, /* * End of line specifier - if there's anything left after * the '$' other than a close parens or alternation - * specifier, great it as a normal character + * specifier, great it as a normal character */ if (exprlen > 1 && (*(expr+1) != ')' && *(expr+1) != '|')) @@ -677,18 +677,18 @@ static re_status_t re_compile(re_context *ctx, /* build a new end-of-text recognizer */ re_build_char(ctx, &new_machine, RE_TEXT_END); - /* + /* * concatenate it onto the string - note that this can't - * have any postfix operators + * have any postfix operators */ re_concat_onto(ctx, &cur_machine, &new_machine); break; - + case '(': - /* + /* * Add a nesting level. Push the current machine and * alternate machines onto the group stack, and clear - * everything out for the new group. + * everything out for the new group. */ if (group_stack_level > sizeof(group_stack)/sizeof(group_stack[0])) @@ -701,13 +701,13 @@ static re_status_t re_compile(re_context *ctx, group_stack[group_stack_level].old_cur = cur_machine; group_stack[group_stack_level].old_alter = alter_machine; - /* + /* * Assign the group a group ID - groups are numbered in * order of their opening (left) parentheses, so we want to * assign a group number now. We won't actually need to * know the group number until we get to the matching close * paren, but we need to assign it now, so store it in the - * group stack. + * group stack. */ group_stack[group_stack_level].group_id = ctx->cur_group; @@ -730,12 +730,12 @@ static re_status_t re_compile(re_context *ctx, /* take a level off the stack */ --group_stack_level; - /* + /* * Remove a nesting level. If we have a pending alternate * expression, build the alternation expression. This will * leave the entire group expression in alter_machine, * regardless of whether an alternation was in progress or - * not. + * not. */ re_alternate_onto(ctx, &alter_machine, &cur_machine); @@ -744,48 +744,48 @@ static re_status_t re_compile(re_context *ctx, * it with a group number. We assigned the group number * when we parsed the open paren, so read that group number * from the stack. - * + * * Note that this will leave 'new_machine' with the entire - * group machine. + * group machine. */ re_build_group(ctx, &new_machine, &alter_machine, group_stack[group_stack_level].group_id); /* * Pop the stack - restore the alternation and current - * machines that were in progress before the group started. + * machines that were in progress before the group started. */ cur_machine = group_stack[group_stack_level].old_cur; alter_machine = group_stack[group_stack_level].old_alter; /* * Check the group expression (in new_machine) for postfix - * expressions + * expressions */ goto apply_postfix; case '|': - /* + /* * Start a new alternation. This ends the current * alternation; if we have a previous pending alternate, * build an alternation machine out of the previous * alternate and the current machine and move that to the * alternate; otherwise, simply move the current machine to - * the pending alternate. + * the pending alternate. */ re_alternate_onto(ctx, &alter_machine, &cur_machine); - /* + /* * the alternation starts out with a blank slate, so null - * out the current machine + * out the current machine */ re_build_null_machine(ctx, &cur_machine); break; case '%': - /* + /* * quoted character - skip the quote mark and see what we - * have + * have */ ++expr; --exprlen; @@ -793,10 +793,10 @@ static re_status_t re_compile(re_context *ctx, /* check to see if we're at the end of the expression */ if (exprlen == 0) { - /* + /* * end of the string - ignore it, but undo the extra * increment of the expression index so that we exit the - * enclosing loop properly + * enclosing loop properly */ --expr; ++exprlen; @@ -873,10 +873,10 @@ static re_status_t re_compile(re_context *ctx, break; case '.': - /* + /* * wildcard character - build a single character recognizer * for the special wildcard symbol, then go check it for a - * postfix operator + * postfix operator */ re_build_char(ctx, &new_machine, RE_WILDCARD); goto apply_postfix; @@ -906,9 +906,9 @@ static re_status_t re_compile(re_context *ctx, is_exclusive = TRUE; } - /* + /* * if the first character is a ']', include it in the - * range + * range */ if (exprlen != 0 && *expr == ']') { @@ -919,7 +919,7 @@ static re_status_t re_compile(re_context *ctx, /* * if the next character is a '-', include it in the - * range + * range */ if (exprlen != 0 && *expr == '-') { @@ -932,7 +932,7 @@ static re_status_t re_compile(re_context *ctx, while (exprlen != 0 && *expr != ']') { int ch; - + /* note this character */ ch = (int)(unsigned char)*expr; @@ -947,7 +947,7 @@ static re_status_t re_compile(re_context *ctx, if (exprlen != 0 && *expr == '-') { int ch2; - + /* skip the '-' */ ++expr; --exprlen; @@ -980,15 +980,15 @@ static re_status_t re_compile(re_context *ctx, /* apply any postfix operator */ goto apply_postfix; - } + } break; default: normal_char: - /* + /* * it's an ordinary character - build a single character * recognizer machine, and then concatenate it onto any - * existing machine + * existing machine */ re_build_char(ctx, &new_machine, *expr); @@ -997,7 +997,7 @@ static re_status_t re_compile(re_context *ctx, * Check for a postfix operator, and apply it to the machine * in 'new_machine' if present. In any case, concatenate * the 'new_machine' (modified by a postix operator or not) - * to the current machien. + * to the current machien. */ if (exprlen > 1) { @@ -1008,25 +1008,25 @@ static re_status_t re_compile(re_context *ctx, case '?': /* * We have a postfix closure operator. Build a new - * closure machine out of 'new_machine'. + * closure machine out of 'new_machine'. */ { re_machine closure_machine; - + /* move onto the closure operator */ ++expr; --exprlen; - + /* build the closure machine */ re_build_closure(ctx, &closure_machine, &new_machine, *expr); - + /* replace the original machine with the closure */ new_machine = closure_machine; - - /* + + /* * skip any redundant closure symbols, keeping - * only the first one we saw + * only the first one we saw */ while (exprlen > 1 && (*(expr+1) == '?' || *(expr+1) == '+' @@ -1037,7 +1037,7 @@ static re_status_t re_compile(re_context *ctx, } } break; - + default: /* no postfix operator */ break; @@ -1046,7 +1046,7 @@ static re_status_t re_compile(re_context *ctx, /* * Concatenate the new machine onto the current machine - * under construction. + * under construction. */ re_concat_onto(ctx, &cur_machine, &new_machine); break; @@ -1066,11 +1066,11 @@ static re_status_t re_compile(re_context *ctx, /* ------------------------------------------------------------------------ */ /* - * Pattern recognizer + * Pattern recognizer */ /* - * Note a group position if appropriate + * Note a group position if appropriate */ static void re_note_group(re_context *ctx, re_group_register *regs, re_state_id id, const char *p) @@ -1079,7 +1079,7 @@ static void re_note_group(re_context *ctx, re_group_register *regs, /* * Check to see if this is a valid state and it's a group marker - - * if not, there's nothing to do + * if not, there's nothing to do */ if (id == RE_STATE_INVALID || !(ctx->tuple_arr[id].flags @@ -1088,7 +1088,7 @@ static void re_note_group(re_context *ctx, re_group_register *regs, return; /* - * It's a valid group marker - note the appropriate register value + * It's a valid group marker - note the appropriate register value */ if ((ctx->tuple_arr[id].flags & RE_STATE_GROUP_BEGIN) != 0) regs[group_index].start_ofs = p; @@ -1098,7 +1098,7 @@ static void re_note_group(re_context *ctx, re_group_register *regs, /* * Determine if a character is part of a word. We consider letters and - * numbers to be word characters. + * numbers to be word characters. */ static int re_is_word_char(char c) { return Common::isAlnum((unsigned char)c); @@ -1106,7 +1106,7 @@ static int re_is_word_char(char c) { /* * Match a string to a compiled expression. Returns the length of the - * match if successful, or -1 if no match was found. + * match if successful, or -1 if no match was found. */ static int re_match(re_context *ctx, const char *entire_str, const char *str, size_t origlen, @@ -1126,9 +1126,9 @@ static int re_match(re_context *ctx, const char *entire_str, /* note any group involved in the initial state */ re_note_group(ctx, regs, cur_state, p); - /* + /* * if we're starting in the final state, immediately return success - * with a zero-length match + * with a zero-length match */ if (cur_state == machine->final_state) { @@ -1146,7 +1146,7 @@ static int re_match(re_context *ctx, const char *entire_str, /* if this is a group state, adjust the group registers */ re_note_group(ctx, regs, cur_state, p); - + /* see what kind of state we're in */ if (!(tuple->flags & (RE_STATE_GROUP_BEGIN | RE_STATE_GROUP_END)) && tuple->ch != RE_EPSILON) @@ -1172,32 +1172,32 @@ static int re_match(re_context *ctx, const char *entire_str, int group_num; re_group_register *group_reg; size_t reg_len; - + /* it's a group - get the group number */ group_num = tuple->ch - RE_GROUP_MATCH_0; group_reg = ®s[group_num]; - - /* + + /* * if this register isn't defined, there's nothing - * to match, so fail + * to match, so fail */ if (group_reg->start_ofs == 0 || group_reg->end_ofs == 0) return -1; - + /* calculate the length of the register value */ reg_len = group_reg->end_ofs - group_reg->start_ofs; - + /* if we don't have enough left to match, it fails */ if (curlen < reg_len) return -1; - + /* if the string doesn't match exactly, we fail */ if (memcmp(p, group_reg->start_ofs, reg_len) != 0) return -1; - + /* * It matches exactly - skip the entire length of - * the register in the source string + * the register in the source string */ p += reg_len; curlen -= reg_len; @@ -1205,10 +1205,10 @@ static int re_match(re_context *ctx, const char *entire_str, break; case RE_TEXT_BEGIN: - /* + /* * Match only the exact beginning of the string - if * we're anywhere else, this isn't a match. If this - * succeeds, we don't skip any characters. + * succeeds, we don't skip any characters. */ if (p != entire_str) return -1; @@ -1218,24 +1218,24 @@ static int re_match(re_context *ctx, const char *entire_str, /* * Match only the exact end of the string - if we're * anywhere else, this isn't a match. Don't skip any - * characters on success. + * characters on success. */ if (curlen != 0) return -1; break; case RE_WORD_BEGIN: - /* + /* * if the previous character is a word character, we're - * not at the beginning of a word + * not at the beginning of a word */ if (p != entire_str && re_is_word_char(*(p-1))) return -1; - /* + /* * if we're at the end of the string, or the current * character isn't the start of a word, we're not at the - * beginning of a word + * beginning of a word */ if (curlen == 0 || !re_is_word_char(*p)) return -1; @@ -1244,7 +1244,7 @@ static int re_match(re_context *ctx, const char *entire_str, case RE_WORD_END: /* * if the current character is a word character, we're not - * at the end of a word + * at the end of a word */ if (curlen != 0 && re_is_word_char(*p)) return -1; @@ -1252,7 +1252,7 @@ static int re_match(re_context *ctx, const char *entire_str, /* * if we're at the beginning of the string, or the * previous character is not a word character, we're not - * at the end of a word + * at the end of a word */ if (p == entire_str || !re_is_word_char(*(p-1))) return -1; @@ -1289,7 +1289,7 @@ static int re_match(re_context *ctx, const char *entire_str, * Determine if the previous character is a word * character -- if we're at the beginning of the * string, it's obviously not, otherwise check its - * classification + * classification */ prev_is_word = (p != entire_str && re_is_word_char(*(p-1))); @@ -1300,13 +1300,13 @@ static int re_match(re_context *ctx, const char *entire_str, /* * Determine if this is a boundary - it is if the - * two states are different + * two states are different */ boundary = ((prev_is_word != 0) ^ (next_is_word != 0)); - /* + /* * make sure it matches what was desired, and return - * failure if not + * failure if not */ if ((tuple->ch == RE_WORD_BOUNDARY && !boundary) || (tuple->ch == RE_NON_WORD_BOUNDARY && boundary)) @@ -1328,15 +1328,15 @@ static int re_match(re_context *ctx, const char *entire_str, case RE_RANGE_EXCL: { int match; - + /* make sure we have a character to match */ if (curlen == 0) return -1; - + /* see if we match */ match = re_is_bit_set(tuple->char_range, (int)(unsigned char)*p); - + /* make sure we got what we wanted */ if ((tuple->ch == RE_RANGE && !match) || (tuple->ch == RE_RANGE_EXCL && match)) @@ -1359,9 +1359,9 @@ static int re_match(re_context *ctx, const char *entire_str, break; } - /* + /* * if we got this far, we were successful - move on to the - * next state + * next state */ cur_state = tuple->next_state_1; } @@ -1369,7 +1369,7 @@ static int re_match(re_context *ctx, const char *entire_str, { /* * We have only one transition, so this state is entirely - * deterministic. Simply move on to the next state. + * deterministic. Simply move on to the next state. */ cur_state = tuple->next_state_1; } @@ -1380,13 +1380,13 @@ static int re_match(re_context *ctx, const char *entire_str, re_group_register regs2[RE_GROUP_REG_CNT]; int ret1; int ret2; - + /* * This state has two possible transitions, and we don't * know which one to take. So, try both, see which one * works better, and return the result. Try the first * transition first. Note that each separate attempt must - * use a separate copy of the registers. + * use a separate copy of the registers. */ memcpy(regs1, regs, sizeof(regs1)); sub_machine.init = tuple->next_state_1; @@ -1394,7 +1394,7 @@ static int re_match(re_context *ctx, const char *entire_str, ret1 = re_match(ctx, entire_str, p, curlen, &sub_machine, regs1); /* - * Now try the second transition + * Now try the second transition */ memcpy(regs2, regs, sizeof(regs2)); sub_machine.init = tuple->next_state_2; @@ -1405,7 +1405,7 @@ static int re_match(re_context *ctx, const char *entire_str, * If they both failed, the whole thing failed. Otherwise, * return the longer of the two, plus the length we * ourselves matched previously. Note that we return the - * register set from the winning match. + * register set from the winning match. */ if (ret1 < 0 && ret2 < 0) { @@ -1427,13 +1427,13 @@ static int re_match(re_context *ctx, const char *entire_str, } /* - * If we're in the final state, return success + * If we're in the final state, return success */ if (cur_state == machine->final_state) { /* finish off any group involved in the final state */ re_note_group(ctx, regs, cur_state, p); - + /* return the length we matched */ return p - str; } @@ -1445,23 +1445,23 @@ static int re_match(re_context *ctx, const char *entire_str, * Search for a regular expression within a string. Returns -1 if the * string cannot be found, otherwise returns the offset from the start * of the string to be searched of the start of the first match for the - * pattern. + * pattern. */ static int re_search(re_context *ctx, const char *str, size_t len, const re_machine *machine, re_group_register *regs, int *result_len) { int ofs; - + /* * Starting at the first character in the string, search for the * pattern at each subsequent character until we either find the - * pattern or run out of string to test. + * pattern or run out of string to test. */ for (ofs = 0 ; ofs < (int)len ; ++ofs) { int matchlen; - + /* check for a match */ matchlen = re_match(ctx, str, str + ofs, len - ofs, machine, regs); @@ -1490,22 +1490,22 @@ static void re_save_search_str(re_context *ctx, const char *str, size_t len) ctx->curlen = 0; return; } - + /* if the current buffer isn't big enough, allocate a new one */ if (ctx->strbuf == 0 || ctx->strbufsiz < len) { - /* + /* * free any previous buffer - its contents are no longer * important, since we're about to overwrite it with a new - * string + * string */ if (ctx->strbuf != 0) mchfre(ctx->strbuf); - /* + /* * allocate a new buffer; round up to the next 256-byte * increment to make sure we're not constantly reallocating to - * random sizes + * random sizes */ ctx->strbufsiz = ((len + 255) & ~255); @@ -1524,7 +1524,7 @@ static void re_save_search_str(re_context *ctx, const char *str, size_t len) /* ------------------------------------------------------------------------ */ /* * Compile an expression and search for a match within the given string. - * Returns the offset of the match, or -1 if no match was found. + * Returns the offset of the match, or -1 if no match was found. */ int re_compile_and_search(re_context *ctx, const char *pattern, size_t patlen, @@ -1532,7 +1532,7 @@ int re_compile_and_search(re_context *ctx, int *result_len) { re_machine machine; - + /* compile the expression - return failure if we get an error */ if (re_compile(ctx, pattern, patlen, &machine) != RE_STATUS_SUCCESS) return -1; @@ -1545,7 +1545,7 @@ int re_compile_and_search(re_context *ctx, ctx->regs[i].clear(); } - /* + /* * search for the pattern in our copy of the string - use the copy * so that the group registers stay valid even if the caller * deallocates the original string after we return @@ -1559,7 +1559,7 @@ int re_compile_and_search(re_context *ctx, * Compile an expression and check for a match. Returns the length of * the match if we found a match, -1 if we found no match. This is not * a search function; we merely match the leading substring of the given - * string to the given pattern. + * string to the given pattern. */ int re_compile_and_match(re_context *ctx, const char *pattern, size_t patlen, diff --git a/engines/glk/tads/tads2/regex.h b/engines/glk/tads/tads2/regex.h index 7fcf3a49ce2..8260d3c57fa 100644 --- a/engines/glk/tads/tads2/regex.h +++ b/engines/glk/tads/tads2/regex.h @@ -44,7 +44,7 @@ typedef int re_state_id; /* ------------------------------------------------------------------------ */ /* * Group register structure. Each register keeps track of the starting - * and ending offset of the group's text. + * and ending offset of the group's text. */ typedef struct _re_group_register { @@ -64,12 +64,12 @@ typedef struct _re_group_register /* ------------------------------------------------------------------------ */ -/* +/* * Denormalized state transition tuple. Each tuple represents the * complete set of transitions out of a particular state. A particular * state can have one character transition, or two epsilon transitions. * Note that we don't need to store the state ID in the tuple, because - * the state ID is the index of the tuple in an array of state tuples. + * the state ID is the index of the tuple in an array of state tuples. */ typedef struct { @@ -89,7 +89,7 @@ typedef struct /* - * Tuple flags + * Tuple flags */ /* this state is the start of a group - the 'ch' value is the group ID */ @@ -103,7 +103,7 @@ typedef struct /* * Regular expression compilation context structure. This tracks the * state of the compilation and stores the resources associated with the - * compiled expression. + * compiled expression. */ typedef struct _re_context { @@ -115,7 +115,7 @@ typedef struct _re_context /* * The array of transition tuples. We'll allocate this array and - * expand it as necessary. + * expand it as necessary. */ re_tuple *tuple_arr; @@ -128,12 +128,12 @@ typedef struct _re_context /* group registers */ re_group_register regs[RE_GROUP_REG_CNT]; - /* + /* * Buffer for retaining a copy of the last string we scanned. We * retain our own copy of each string, and point the group registers * into this copy rather than the caller's original string -- this * ensures that the group registers remain valid even after the - * caller has deallocated the original string. + * caller has deallocated the original string. */ char *strbuf; @@ -149,7 +149,7 @@ typedef struct _re_context /* ------------------------------------------------------------------------ */ /* - * Status codes + * Status codes */ typedef enum { @@ -164,19 +164,19 @@ typedef enum /* ------------------------------------------------------------------------ */ /* * Initialize the context. The memory for the context structure itself - * must be allocated and maintained by the caller. + * must be allocated and maintained by the caller. */ void re_init(re_context *ctx, errcxdef *errctx); /* * Delete the context - frees structures associated with the context. - * Does NOT free the memory used by the context structure itself. + * Does NOT free the memory used by the context structure itself. */ void re_delete(re_context *ctx); /* * Compile an expression and search for a match within the given string. - * Returns the offset of the match, or -1 if no match was found. + * Returns the offset of the match, or -1 if no match was found. */ int re_compile_and_search(re_context *ctx, const char *pattern, size_t patlen, @@ -187,7 +187,7 @@ int re_compile_and_search(re_context *ctx, * Compile an expression and check for a match. Returns the length of * the match if we found a match, -1 if we found no match. This is not * a search function; we merely match the leading substring of the given - * string to the given pattern. + * string to the given pattern. */ int re_compile_and_match(re_context *ctx, const char *pattern, size_t patlen, diff --git a/engines/glk/tads/tads2/run.h b/engines/glk/tads/tads2/run.h index 3f45c087252..49a755969a8 100644 --- a/engines/glk/tads/tads2/run.h +++ b/engines/glk/tads/tads2/run.h @@ -126,7 +126,7 @@ void runfn(runcxdef *ctx, noreg objnum objn, int argc); * to the first byte of code to be executed. self is the object to be * used for the special 'self' pseudo-object, and target is the object * whose data are actually being executed. targprop is the property being - * executed; 0 is used for functions. + * executed; 0 is used for functions. */ void runexe(runcxdef *ctx, uchar *p, objnum self, objnum target, prpnum targprop, int argc); @@ -271,12 +271,12 @@ int runeq(runcxdef *ctx); /* check for stack overflow */ /* void runstkovf(runcxdef *ctx); */ -/* +/* * Check to ensure we have enough arguments to pass to a function or method * call - this simply ensures we have enough data in the current frame. * This is important because the called function will be able to write to * our frame. If we don't have enough arguments, we'll push enough 'nil' - * values to meet the need. + * values to meet the need. */ #define runcheckargc(ctx, nargc) \ while ((ctx)->runcxsp - (ctx)->runcxbp < *(nargc)) \ @@ -330,7 +330,7 @@ void runadd(runcxdef *ctx, runsdef *val, runsdef *val2, uint below); /* * subtract val2 from val, returning result in *val; return TRUE if * value changed, FALSE otherwise (this is returned when subtracting - * something from a list that isn't in the list) + * something from a list that isn't in the list) */ int runsub(runcxdef *ctx, runsdef *val, runsdef *val2, uint below); diff --git a/engines/glk/tads/tads2/runtime_app.h b/engines/glk/tads/tads2/runtime_app.h index e6f36d27293..1ed0807233e 100644 --- a/engines/glk/tads/tads2/runtime_app.h +++ b/engines/glk/tads/tads2/runtime_app.h @@ -34,7 +34,7 @@ namespace TADS2 { struct runcxdef; /* - * Run-time version number + * Run-time version number */ #define TADS_RUNTIME_VERSION "2.5.17" @@ -49,18 +49,18 @@ extern int G_tads_oem_copyright_prefix; * Main run-time subsystem entrypoint. Runs the game specified in the * argument vector; does not return until the game terminates. The * application container context is optional; pass null if no context is - * required. + * required. */ int trdmain(int argc, char **argv, appctxdef *appctx, const char *save_ext); /* * Main debugger subsystem entrypoint. Works like trdmain(), but starts - * the game under the debugger. + * the game under the debugger. */ int tddmain(int argc, char **argv, appctxdef *appctx, const char *save_ext); /* - * close and delete the swap file + * close and delete the swap file */ void trd_close_swapfile(struct runcxdef *runctx); @@ -99,7 +99,7 @@ void trd_close_swapfile(struct runcxdef *runctx); * messages, set up a dummy list. The usage display routine will show * messages starting from the lower number up to and including the higher * number; by default we'll make the ending number lower than the starting - * number so that we don't display any messages at all. + * number so that we don't display any messages at all. */ #ifndef ERR_TRUS_OS_FIRST # define ERR_TRUS_OS_FIRST 100 diff --git a/engines/glk/tads/tads2/runtime_driver.cpp b/engines/glk/tads/tads2/runtime_driver.cpp index c263c64a201..dc5c827de5e 100644 --- a/engines/glk/tads/tads2/runtime_driver.cpp +++ b/engines/glk/tads/tads2/runtime_driver.cpp @@ -175,7 +175,7 @@ static void trdptf(const char *fmt, ...) /* - * display a range of usage messages + * display a range of usage messages */ static void trdusage_show_range(errcxdef *ec, int msg_first, int msg_last) { @@ -203,15 +203,15 @@ static void trdusage_range(errcxdef *ec, int msg_first, int msg_last) } /* - * display general run-time usage information + * display general run-time usage information */ static void trdusage(errcxdef *ec) { int first; - /* + /* * if we have an app display name, display it instead of the - * hard-coded text in the message identifying the app + * hard-coded text in the message identifying the app */ first = ERR_TRUS1; if (ec->errcxappctx != 0 && ec->errcxappctx->usage_app_name != 0) @@ -219,14 +219,14 @@ static void trdusage(errcxdef *ec) char buf[128]; char buf2[128]; erradef argv[1]; - + /* get the parameterized usage message */ errmsg(ec, buf, (uint)sizeof(buf), ERR_TRUSPARM); /* format in the application name */ argv[0].errastr = ec->errcxappctx->usage_app_name; errfmt(buf2, (int)sizeof(buf2), buf, 1, argv); - + /* display it */ trdptf("%s\n", buf2); @@ -245,7 +245,7 @@ static void trdusage(errcxdef *ec) } /* - * display -s suboptions + * display -s suboptions */ static void trdusage_s(errcxdef *ec) { @@ -299,7 +299,7 @@ static void trdmain1(errcxdef *ec, int argc, char *argv[], char *charmap = 0; /* character map file */ int charmap_none; /* explicitly do not use a character set */ int doublespace = TRUE; /* formatter double-space setting */ - + NOREG((&loadopen)) /* initialize the output formatter */ @@ -333,21 +333,21 @@ static void trdmain1(errcxdef *ec, int argc, char *argv[], else trdusage(ec); break; - + case 'r': /* restore a game */ restore_file = cmdarg(ec, &argp, &i, argc, 1, trdusage); break; - + case 'i': qasopn(cmdarg(ec, &argp, &i, argc, 1, trdusage), TRUE); break; - + case 'o': cmdfile = osfopwt(cmdarg(ec, &argp, &i, argc, 1, trdusage), OSFTCMD); break; - + case 'l': logfp = osfopwt(cmdarg(ec, &argp, &i, argc, 1, trdusage), OSFTCMD); @@ -402,25 +402,25 @@ static void trdmain1(errcxdef *ec, int argc, char *argv[], safety_read, safety_write); } break; - + case 'm': switch(*(arg + 2)) { case 's': stksiz = atoi(cmdarg(ec, &argp, &i, argc, 2, trdusage)); break; - + case 'h': heapsiz = atoi(cmdarg(ec, &argp, &i, argc, 2, trdusage)); break; - + default: cachelimit = atol(cmdarg(ec, &argp, &i, argc, 1, trdusage)); break; } break; - + case 't': /* swap file options: -tf file, -ts size, -t- (no swap) */ switch(*(arg+2)) @@ -428,25 +428,25 @@ static void trdmain1(errcxdef *ec, int argc, char *argv[], case 'f': swapname = cmdarg(ec, &argp, &i, argc, 2, trdusage); break; - + case 's': swapsize = atol(cmdarg(ec, &argp, &i, argc, 2, trdusage)); break; - + case 'p': preload = cmdtog(ec, preload, arg, 2, trdusage); break; - + default: swapena = cmdtog(ec, swapena, arg, 1, trdusage); break; } break; - + case 'u': undosiz = atoi(cmdarg(ec, &argp, &i, argc, 1, trdusage)); break; - + default: trdusage(ec); } @@ -472,16 +472,16 @@ static void trdmain1(errcxdef *ec, int argc, char *argv[], * encoded into it. Next, look to see if there's a game * attached to the executable file; if so, use it. If not, see * if the host system wants to provide a name through its - * callback. + * callback. */ - + /* presume we won't find a game attached to the executable file */ infile = 0; use_exe = FALSE; - /* + /* * see if we have a saved game to restore, and it specifies the - * GAM file that saved it + * GAM file that saved it */ if (restore_file != 0) { @@ -492,10 +492,10 @@ static void trdmain1(errcxdef *ec, int argc, char *argv[], infile = inbuf; } } - - /* + + /* * it that didn't work, try to read from os-dependent part of - * program being executed + * program being executed */ if (infile == 0) { @@ -509,22 +509,22 @@ static void trdmain1(errcxdef *ec, int argc, char *argv[], osfseek(fp, 0L, OSFSK_END); endpos = osfpos(fp); osfcls(fp); - + /* if we found it, use it */ if (endpos != curpos) use_exe = TRUE; } } - - /* + + /* * if we didn't find a game in the executable, try the host - * system callback + * system callback */ if (infile == 0 && !use_exe) { - /* + /* * ask the host system callback what to do - if we don't - * have a host system callback, or the callback + * have a host system callback, or the callback */ if (appctx != 0 && appctx->get_game_name != 0) { @@ -537,10 +537,10 @@ static void trdmain1(errcxdef *ec, int argc, char *argv[], } else { - /* + /* * the host didn't provide a name - simply display a * message indicating that no game file has been - * chosen, and return + * chosen, and return */ trdptf("\n"); trdptf("(No game has been selected.)\n"); @@ -549,9 +549,9 @@ static void trdmain1(errcxdef *ec, int argc, char *argv[], } else { - /* + /* * we've run out of ways to get a filename - give the - * user the usage message and quit + * user the usage message and quit */ trdusage(ec); } @@ -568,7 +568,7 @@ static void trdmain1(errcxdef *ec, int argc, char *argv[], * If original name exists, use it; otherwise, try adding .GAM. * Note that this code is ifdef'd so that platforms that don't * use filename extensions in the manner conventional for DOS - * and Unix won't use this code. + * and Unix won't use this code. */ if (osfacc(infile)) { @@ -578,7 +578,7 @@ static void trdmain1(errcxdef *ec, int argc, char *argv[], } #endif /* !defined(OS_HATES_EXTENSIONS) */ } - + /* open up the swap file */ if (swapena && swapsize) { @@ -586,7 +586,7 @@ static void trdmain1(errcxdef *ec, int argc, char *argv[], if (swapname == 0) swapname = swapbuf; if (swapfp == 0) errsig(ec, ERR_OPSWAP); } - + /* load the character map */ if (charmap_none) cmap_override(); @@ -613,10 +613,10 @@ static void trdmain1(errcxdef *ec, int argc, char *argv[], /* * save a pointer to the voc context globally, so that certain * external routines (such as Unix-style signal handlers) can reach - * it + * it */ main_voc_ctx = &vocctx; - + /* allocate stack and heap */ totsize = (ulong)stksiz * (ulong)sizeof(runsdef); if (totsize != (size_t)totsize) @@ -663,7 +663,7 @@ static void trdmain1(errcxdef *ec, int argc, char *argv[], supctx.supcxlen = 0; supctx.supcxvoc = &vocctx; supctx.supcxrun = &runctx; - + /* set up debug context */ dbg.dbgcxtio = (tiocxdef *)0; dbg.dbgcxmem = mctx; @@ -673,7 +673,7 @@ static void trdmain1(errcxdef *ec, int argc, char *argv[], dbg.dbgcxdep = 0; dbg.dbgcxflg = 0; dbg.dbgcxlin = (lindef *)0; /* no line sources yet */ - + /* set up built-in function context */ bifctx.bifcxerr = ec; bifctx.bifcxrun = &runctx; @@ -687,16 +687,16 @@ static void trdmain1(errcxdef *ec, int argc, char *argv[], /* initialize the regular expression parser context */ re_init(&bifctx.bifcxregex, ec); - + /* add the built-in functions, keywords, etc */ supbif(&supctx, bif, (int)(sizeof(bif)/sizeof(bif[0]))); - + /* set up status line hack */ runistat(&vocctx, &runctx, (tiocxdef *)0); /* turn on the "busy" cursor before loading */ os_csr_busy(TRUE); - + /* read the game from the binary file */ fiord(mctx, &vocctx, (struct tokcxdef *)0, infile, exefile, &fiolctx, &preinit, &flags, @@ -706,20 +706,20 @@ static void trdmain1(errcxdef *ec, int argc, char *argv[], /* turn off the "busy" cursor */ os_csr_busy(FALSE); - + /* play the game */ plygo(&runctx, &vocctx, (tiocxdef *)0, preinit, restore_file); - + /* close load file */ fiorcls(&fiolctx); - + if (pause) { trdptf("[press a key to exit]"); os_waitc(); trdptf("\n"); } - + /* close and delete swapfile, if one was opened */ trd_close_swapfile(&runctx); @@ -729,7 +729,7 @@ static void trdmain1(errcxdef *ec, int argc, char *argv[], ERRCLEAN(ec) /* close and delete swapfile, if one was opened */ trd_close_swapfile(&runctx); - + /* close the load file if one was opened */ if (loadopen) fiorcls(&fiolctx); @@ -771,7 +771,7 @@ static void trdmain1(errcxdef *ec, int argc, char *argv[], * run-time error messages by leaving out the numeric error code. Note * that we'll only do this if the error messages are linked directly * into the run-time, since we need the numeric code as a last resort - * when the error message may not be present. + * when the error message may not be present. */ #ifdef OS_SKIP_ERROR_CODES # ifdef ERR_LINK_MESSAGES @@ -781,7 +781,7 @@ static void trdmain1(errcxdef *ec, int argc, char *argv[], /* * If we didn't define a different error prefix format, use the default - * format with the numeric error code. + * format with the numeric error code. */ #ifndef TRDLOGERR_PREFIX # define TRDLOGERR_PREFIX "\n[%s-%d: " @@ -808,7 +808,7 @@ static void trdlogerr(void *ctx0, const char *fac, int err, int argc, erradef *a /* - * close and delete the swap file + * close and delete the swap file */ void trd_close_swapfile(runcxdef *runctx) { @@ -861,7 +861,7 @@ int trdmain(int argc, char *argv[], appctxdef *appctx, const char *save_ext) errcxdef errctx; int err; osfildef *fp; - + errctx.errcxlog = trdlogerr; errctx.errcxlgc = &errctx; errctx.errcxfp = (osfildef *)0; @@ -869,7 +869,7 @@ int trdmain(int argc, char *argv[], appctxdef *appctx, const char *save_ext) errctx.errcxappctx = appctx; fp = oserrop(argv[0]); errini(&errctx, fp); - + /* copyright-date-string */ #ifndef NO_T2_COPYRIGHT_NOTICE trdptf("%s - A %s TADS %s Interpreter.\n", @@ -879,17 +879,17 @@ int trdmain(int argc, char *argv[], appctxdef *appctx, const char *save_ext) G_tads_oem_copyright_prefix ? "TADS c" : "C"); trdptf("%s\n", G_tads_oem_author); #endif - + ERRBEGIN(&errctx) trdmain1(&errctx, argc, argv, appctx, save_ext); ERRCATCH(&errctx, err) - /* + /* * log the error, unless it's usage (in which case we logged it - * already) or we're simply quitting the game + * already) or we're simply quitting the game */ if (err != ERR_USAGE && err != ERR_RUNQUIT) errclog(&errctx); - + /* close the error file */ if (errctx.errcxfp != 0) osfcls(errctx.errcxfp); @@ -900,7 +900,7 @@ int trdmain(int argc, char *argv[], appctxdef *appctx, const char *save_ext) /* return failure unless we're simply quitting the game */ return (err == ERR_RUNQUIT ? OSEXSUCC : OSEXFAIL); ERREND(&errctx) - + /* close the error file if we opened it */ if (errctx.errcxfp != 0) osfcls(errctx.errcxfp); diff --git a/engines/glk/tads/tads2/string_resources.h b/engines/glk/tads/tads2/string_resources.h index 76f245e3483..d4cb2bc9d6a 100644 --- a/engines/glk/tads/tads2/string_resources.h +++ b/engines/glk/tads/tads2/string_resources.h @@ -30,14 +30,14 @@ namespace TADS2 { /* * Dialog buttons. These provide the text for standard buttons in * dialogs created with os_input_dialog(). - * + * * These labels can use "&" to indicate a shortcut letter, per the * normal os_input_dialog() interface; for example, if the Yes button * label is "&Yes", the button has the shortcut letter "Y". - * + * * The text of these buttons may vary by system, since these should * conform to local conventions where there are local conventions. In - * addition, of course, these strings will vary by language. + * addition, of course, these strings will vary by language. */ /* OK and Cancel buttons */ @@ -54,10 +54,10 @@ namespace TADS2 { * English, for example, the "yes" string would be "[Yy].*" and the "no" * string would be "[Nn].*". For German, it might be desirable to * accept both "Ja" and "Yes", so the "Yes" string might be "[JjYy].*". - * + * * It's not necessary in these patterns to consider leading spaces, * since the yorn() function will skip any leading spaces before - * performing the pattern match. + * performing the pattern match. */ #define RESID_YORN_YES 5 #define RESID_YORN_NO 6 diff --git a/engines/glk/tads/tads2/text_io.h b/engines/glk/tads/tads2/text_io.h index 6fbc1a636da..3e459bde728 100644 --- a/engines/glk/tads/tads2/text_io.h +++ b/engines/glk/tads/tads2/text_io.h @@ -49,7 +49,7 @@ struct tiocxdef { /** * Initialize the output formatter subsystem. This must be called once - * at startup. + * at startup. */ void out_init(); @@ -106,10 +106,10 @@ void outflush(void); /* reset output state */ void outreset(void); -/* +/* * Get a string from the keyboard. Returns non-zero if an error occurs * (in particular, if no more input is available from the keyboard), - * zero on success. + * zero on success. */ int getstring(const char *prompt, char *buf, int bufl); @@ -128,17 +128,17 @@ int tiologcls(tiocxdef *ctx); * automatically copy text to the log file; any text that the caller * knows should be in the log file during times when more mode is turned * off can be explicitly added with this function. - * + * * If nl is true, we'll add a newline at the end of this text. The * caller should not include any newlines in the text being displayed - * here. + * here. */ void out_logfile_print(const char *txt, int nl); /* * Check output status. Indicate whether output is currently hidden, - * and whether any hidden output has occurred. + * and whether any hidden output has occurred. */ void outstat(int *hidden, int *output_occurred); @@ -161,9 +161,9 @@ void tiocapture(tiocxdef *tioctx, mcmcxdef *memctx, int flag); /* clear all captured output */ void tioclrcapture(tiocxdef *tioctx); -/* +/* * clear captured output back to a given point -- this can be used to - * remove captured output in an inner capture from an enclosing capture + * remove captured output in an inner capture from an enclosing capture */ void tiopopcapture(tiocxdef *tioctx, uint orig_size); @@ -192,7 +192,7 @@ char *qasgets(char *buf, int bufl); * expansions. The HTML run-time uses its own expansion mechanism, so * it will ignore this information. The standard character-mode TADS * run-time, however, uses this information to map HTML entities to the - * local character set. + * local character set. */ void tio_set_html_expansion(unsigned int html_char_val, const char *expansion, size_t expansion_len); @@ -210,7 +210,7 @@ void out_set_doublespace(int dbl); * Ask for a filename, using a system-defined dialog (via os_askfile) if * possible. Uses the same interface as os_askfile(), which we will * call directly for graphical implementations. We'll use formatted - * text for text-only implementations. + * text for text-only implementations. */ int tio_askfile(const char *prompt, char *reply, int replen, int prompt_type, os_filetype_t file_type); @@ -218,7 +218,7 @@ int tio_askfile(const char *prompt, char *reply, int replen, int prompt_type, os * Display a dialog, using a system-defined dialog (via os_input_dialog) * if possible. Uses the same interface as os_input_dialog(), which we * will call directly for graphical implementations. We'll use - * formatted text for text-only implementations. + * formatted text for text-only implementations. */ int tio_input_dialog(int icon_id, const char *prompt, int standard_button_set, const char **buttons, int button_count, diff --git a/engines/glk/tads/tads2/tokenizer.cpp b/engines/glk/tads/tads2/tokenizer.cpp index 674d367040e..5ad41ebcc3a 100644 --- a/engines/glk/tads/tads2/tokenizer.cpp +++ b/engines/glk/tads/tads2/tokenizer.cpp @@ -64,9 +64,9 @@ static tokdfdef *tok_find_define(tokcxdef *ctx, const char *sym, int len) { size_t elen; - /* + /* * put in the opening single quote, since we want - * the expanded result to be a string + * the expanded result to be a string */ df->expan[0] = '\''; @@ -77,12 +77,12 @@ static tokdfdef *tok_find_define(tokcxdef *ctx, const char *sym, int len) elen = strlen(df->expan); df->expan[elen] = '\''; - /* + /* * set the length of the expansion, including the * quotes (the first quote was measured in the * length originally, but the second quote hasn't * been counted yet, so add one to our original - * length) + * length) */ df->explen = (int)elen + 1; @@ -108,7 +108,7 @@ static tokdfdef *tok_find_define(tokcxdef *ctx, const char *sym, int len) errsig(ctx->tokcxerr, ERR_LONG_LINE_MACRO); } } - + /* return it */ return df; } @@ -119,7 +119,7 @@ static tokdfdef *tok_find_define(tokcxdef *ctx, const char *sym, int len) } /* - * Write preprocessor state to a file + * Write preprocessor state to a file */ void tok_write_defines(tokcxdef *ctx, osfildef *fp, errcxdef *ec) { @@ -184,7 +184,7 @@ static const char *tok_casefold_defsym(tokcxdef *ctx, char *outbuf, } /* - * convert a token to lower-case if we're folding case + * convert a token to lower-case if we're folding case */ void tok_case_fold(tokcxdef *ctx, tokdef *tok) { @@ -209,7 +209,7 @@ void tok_add_define_cvtcase(tokcxdef *ctx, const char *sym, int len, const char *expan, int explen) { char mysym[TOKNAMMAX]; - + /* convert to lower-case if necessary */ sym = tok_casefold_defsym(ctx, mysym, sym, len); @@ -252,7 +252,7 @@ void tok_add_define(tokcxdef *ctx, const char *sym, int len, void tok_add_define_num_cvtcase(tokcxdef *ctx, char *sym, int len, int num) { char buf[20]; - + /* convert the value to a string */ sprintf(buf, "%d", num); @@ -266,7 +266,7 @@ void tok_del_define(tokcxdef *ctx, const char *sym, int len) int hsh; tokdfdef *df; tokdfdef *prv; - + /* find the appropriate chain the hash table */ hsh = tokdfhsh(sym, len); @@ -313,7 +313,7 @@ static void tokdefine(tokcxdef *ctx, const char *p, int len) int symlen; const char *expan; char mysym[TOKNAMMAX]; - + /* get the symbol */ sym = p; if (!(symlen = tok_scan_defsym(ctx, p, len))) @@ -338,12 +338,12 @@ static void tokdefine(tokcxdef *ctx, const char *p, int len) tok_add_define(ctx, sym, symlen, expan, len); } -/* +/* * Update the #if status for the current nesting. Any enclosing * negative #if will override everything inside, so we need to look * through the nesting from the outside in until we either determine * that everything is affirmative or we find a negative anywhere in the - * nesting. + * nesting. */ static void tok_update_if_stat(tokcxdef *ctx) { @@ -360,9 +360,9 @@ static void tok_update_if_stat(tokcxdef *ctx) { case TOKIF_IF_NO: case TOKIF_ELSE_NO: - /* + /* * this level is off, hence everything inside is off -- stop - * here with the current (negative) determination + * here with the current (negative) determination */ return; @@ -450,7 +450,7 @@ static void tokelif(tokcxdef *ctx, const char *p, int len) static void tokelse(tokcxdef *ctx, const char *p, int len) { int cnt; - + /* if we're not expecting #else, it's an error */ cnt = ctx->tokcxifcnt; if (cnt == 0 || ctx->tokcxif[cnt-1] == TOKIF_ELSE_YES @@ -493,7 +493,7 @@ static void tokundef(tokcxdef *ctx, const char *p, int len) const char *sym; int symlen; char mysym[TOKNAMMAX]; - + /* get the symbol */ sym = p; if (!(symlen = tok_scan_defsym(ctx, p, len))) @@ -569,7 +569,7 @@ static void tokinclude(tokcxdef *ctx, const char *p, int len) errlog(ctx->tokcxerr, ERR_INCNOFN); return; } - + switch(*p) { case '<': @@ -584,24 +584,24 @@ static void tokinclude(tokcxdef *ctx, const char *p, int len) for (++p, --len ; len && *p != match ; --len, ++p) ; if (len == 0 || *p != match) errlog(ctx->tokcxerr, ERR_INCMTCH); break; - + default: errlog(ctx->tokcxerr, ERR_INCSYN); return; } - + flen = p - fname; /* compute length of filename */ for (q = p, flen2 = 0 ; q > fname && *(q-1) != OSPATHCHAR && !strchr(OSPATHALT, *(q-1)) ; --q, ++flen2) ; - + /* check to see if this file has already been included */ for (lin = ctx->tokcxhdr ; lin ; lin = (linfdef *)lin->linflin.linnxt) { char *p2 = lin->linfnam; - + p2 += strlen(p2); - + while (p2 > lin->linfnam && *(p2-1) != OSPATHCHAR && !strchr(OSPATHALT, *(p2-1))) --p2; @@ -613,15 +613,15 @@ static void tokinclude(tokcxdef *ctx, const char *p, int len) return; } } - + /* initialize the line source */ child = linfini(ctx->tokcxmem, ctx->tokcxerr, fname, flen, path, TRUE, (ctx->tokcxflg & TOKCXFLIN2) != 0); - + /* if not found, signal an error */ if (!child) errsig1(ctx->tokcxerr, ERR_INCSEAR, ERRTSTR, errstr(ctx->tokcxerr, fname, flen)); - + /* link into tokenizer list of line records */ child->linflin.linnxt = (lindef *)ctx->tokcxhdr; ctx->tokcxhdr = child; @@ -638,7 +638,7 @@ static void tokinclude(tokcxdef *ctx, const char *p, int len) ctx->tokcxlin->linflg |= LINFCMODE; else ctx->tokcxlin->linflg &= ~LINFCMODE; - + child->linflin.linpar = ctx->tokcxlin; /* remember parent line source */ ctx->tokcxlin = &child->linflin; /* make the child the current source */ } @@ -654,7 +654,7 @@ static int tokgetlin(tokcxdef *ctx, int dopound) if (ctx->tokcxlin->linpar) { lindef *parent; - + parent = ctx->tokcxlin->linpar; /* remember parent */ lincls(ctx->tokcxlin); /* close included file */ if (!ctx->tokcxdbg) /* if no debug context... */ @@ -676,14 +676,14 @@ static int tokgetlin(tokcxdef *ctx, int dopound) return TRUE; } } - + /* if this is a multi-segment line, copy it into our own buffer */ if (ctx->tokcxlin->linflg & LINFMORE) { char *p; uint rem; int done; - + if (!ctx->tokcxbuf) { /* allocate 1k as a default buffer */ @@ -692,7 +692,7 @@ static int tokgetlin(tokcxdef *ctx, int dopound) ctx->tokcxbsz = 1024; } ctx->tokcxlen = 0; - + for (done = FALSE, p = ctx->tokcxbuf, rem = ctx->tokcxbsz ; !done ; ) { @@ -700,7 +700,7 @@ static int tokgetlin(tokcxdef *ctx, int dopound) /* add the current segment's length into line length */ ctx->tokcxlen += len; - + /* we're done after this piece if the last fetch was all */ done = !(ctx->tokcxlin->linflg & LINFMORE); if (len + 1 > rem) @@ -712,29 +712,29 @@ static int tokgetlin(tokcxdef *ctx, int dopound) errsig(ctx->tokcxerr, ERR_LONGLIN); rem += 4096; ctx->tokcxbsz += 4096; - + /* allocate a new buffer and copy line into it */ newp = (char *)mchalo(ctx->tokcxerr, ctx->tokcxbsz, "tok"); memcpy(newp, ctx->tokcxbuf, (size_t)(p - ctx->tokcxbuf)); - + /* free the original buffer, and use the new one */ p = (p - ctx->tokcxbuf) + newp; mchfre(ctx->tokcxbuf); ctx->tokcxbuf = newp; } - + /* add the line to the buffer */ memcpy(p, ctx->tokcxlin->linbuf, len); p += len; rem -= len; - + /* get the next piece of the line if there is one */ if (!done) { if (linget(ctx->tokcxlin)) break; } } - + /* null-terminate the buffer, and use it for input */ *p = '\0'; ctx->tokcxptr = ctx->tokcxbuf; @@ -744,7 +744,7 @@ static int tokgetlin(tokcxdef *ctx, int dopound) ctx->tokcxptr = ctx->tokcxlin->linbuf; ctx->tokcxlen = ctx->tokcxlin->linlen; } - + /* check for preprocessor directives */ if (dopound && ctx->tokcxlen != 0 && ctx->tokcxptr[0] == '#' && !(ctx->tokcxlin->linflg & LINFNOINC)) @@ -787,11 +787,11 @@ static int tokgetlin(tokcxdef *ctx, int dopound) { int cnt; int stat; - + /* * if we're not in a #if's false part, or if the * directive is processed even in #if false parts, - * process the line, otherwise skip it + * process the line, otherwise skip it */ cnt = ctx->tokcxifcnt; if (dirp->ok_in_if || cnt == 0 @@ -824,7 +824,7 @@ static int tokgetlin(tokcxdef *ctx, int dopound) /* * Check the #if level. If we're in an #if, and we're to * ignore lines (because of a false condition or an #else - * part for a true condition), skip this line. + * part for a true condition), skip this line. */ if (ctx->tokcxifcnt != 0) { @@ -840,7 +840,7 @@ static int tokgetlin(tokcxdef *ctx, int dopound) break; } } - + ctx->tokcxlin->linflg &= ~LINFDBG; /* no debug record yet */ return(FALSE); /* return the line we found */ } @@ -854,18 +854,18 @@ int toknext(tokcxdef *ctx) tokdef *tok = &ctx->tokcxcur; int len; - /* + /* * Check for the special case that we pushed an open paren prior to * a string containing an embedded expression. If this is the case, - * immediately return the string we previously parsed. + * immediately return the string we previously parsed. */ if ((ctx->tokcxflg & TOKCXF_EMBED_PAREN_PRE) != 0) { - /* + /* * convert the token to a string - note that the offset * information for the string is already in the current token * structure, since we set everything up for it on the previous - * call where we actually parsed the beginning of the string + * call where we actually parsed the beginning of the string */ tok->toktyp = TOKTDSTRING; @@ -906,7 +906,7 @@ int toknext(tokcxdef *ctx) } } while (len && t_isspace(*p)) ++p, --len; /* scan off whitespace */ - + /* check for comments, and remove if present */ if (len >= 2 && *p == '/' && *(p+1) == '/') len = 0; @@ -943,7 +943,7 @@ int toknext(tokcxdef *ctx) goto skipblanks; } } while (len == 0); - + nexttoken: if (Common::isAlpha((uchar)*p) || *p == '_' || *p == '$') { @@ -955,7 +955,7 @@ nexttoken: int found = FALSE; uchar thischar; tokdfdef *df; - + for (hash = 0, l = 0, tq = tok->toknam ; len != 0 && TOKISSYM(*p) && l < TOKNAMMAX ; (thischar = ((Common::isUpper((uchar)*p) @@ -974,7 +974,7 @@ nexttoken: tok->tokhash = hash; /* - * check for the special defined() preprocessor operator + * check for the special defined() preprocessor operator */ if (l == 9 && !memcmp(tok->toknam, ((ctx->tokcxflg & TOKCXCASEFOLD) @@ -985,7 +985,7 @@ nexttoken: { int symlen; char mysym[TOKNAMMAX]; - + /* find the matching ')', allowing only symbolic characters */ ++p, --len; for (symlen = 0, q = p ; len && *p != ')' && TOKISSYM(*p) ; @@ -1020,7 +1020,7 @@ nexttoken: len = df->explen; goto nexttoken; } - + /* look up in symbol table(s), if any */ for (tab = ctx->tokcxstab ; tab ; tab = tab->toktnxt) { @@ -1028,7 +1028,7 @@ nexttoken: &tok->toksym)) != 0) break; } - + if (found && tok->toksym.tokstyp == TOKSTKW) tok->toktyp = tok->toksym.toksval; else @@ -1041,7 +1041,7 @@ nexttoken: else if (Common::isDigit((uchar)*p)) { long acc = 0; - + /* check for octal/hex */ if (*p == '0') { @@ -1084,7 +1084,7 @@ nexttoken: char delim; /* closing delimiter we're looking for */ const char *strstart; /* pointer to start of string */ int warned; - + delim = *p; --len; strstart = ++p; @@ -1098,9 +1098,9 @@ nexttoken: ctx->tokcxmsvl[ctx->tokcxmlvl] = len - 2; ctx->tokcxmlvl++; - /* + /* * read from the special "<<" expansion string - use the - * version for a "<<" at the very beginning of the string + * version for a "<<" at the very beginning of the string */ p = tokmac1s; len = strlen(p); @@ -1108,7 +1108,7 @@ nexttoken: goto nexttoken; } tok->toktyp = (delim == '"' ? TOKTDSTRING : TOKTSSTRING); - + tok->tokofs = (*ctx->tokcxsst)(ctx->tokcxscx); /* start the string */ for (warned = FALSE ;; ) { @@ -1139,7 +1139,7 @@ nexttoken: } else (*ctx->tokcxsad)(ctx->tokcxscx, " ", (ushort)1); - + while (len == 0) { if (tokgetlin(ctx, FALSE)) @@ -1171,9 +1171,9 @@ nexttoken: /* check to see how it ended */ if (len != 0 && *p == delim) { - /* + /* * We ended with the matching delimiter. Move past the - * closing delimiter. + * closing delimiter. */ ++p; --len; @@ -1181,7 +1181,7 @@ nexttoken: /* * If we have a pending close paren we need to put in * because of an embedded expression that occurred earlier - * in the string, parse the macro to provide the paren. + * in the string, parse the macro to provide the paren. */ if ((ctx->tokcxflg & TOKCXF_EMBED_PAREN_AFT) != 0 && !(ctx->tokcxflg & TOKCXFINMAC)) @@ -1215,7 +1215,7 @@ nexttoken: len = strlen(p); ctx->tokcxflg |= TOKCXFINMAC; - /* + /* * Set the special push-a-paren flag: we'll return an open * paren now, so that we have an open paren before the * string, and then on the next call to toknext() we'll @@ -1223,10 +1223,10 @@ nexttoken: * This will ensure that everything in the string is * properly grouped together as a single indivisible * expression. - * + * * Note that we only need to do this for the first embedded * expression in a string. Once we have a close paren - * pending, we don't need more open parens. + * pending, we don't need more open parens. */ if (!(ctx->tokcxflg & TOKCXF_EMBED_PAREN_AFT)) { @@ -1257,19 +1257,19 @@ nexttoken: --(ctx->tokcxmsvl[ctx->tokcxmlvl - 1]); p = tokmac3; - /* + /* * we won't need an extra closing paren now, since tokmac3 - * provides it + * provides it */ ctx->tokcxflg &= ~TOKCXF_EMBED_PAREN_AFT; } else { - /* + /* * The string is continuing. Set a flag to note that we * need to provide a close paren after the end of the * string, and parse the glue (tokmac2) that goes between - * the expression and the resumption of the string. + * the expression and the resumption of the string. */ ctx->tokcxflg |= TOKCXF_EMBED_PAREN_AFT; p = tokmac2; @@ -1281,7 +1281,7 @@ nexttoken: else { tokscdef *sc; - + for (sc = ctx->tokcxsc[ctx->tokcxinx[(uchar)*p]] ; sc ; sc = sc->tokscnxt) { @@ -1295,7 +1295,7 @@ nexttoken: } errsig(ctx->tokcxerr, ERR_INVTOK); } - + done: ctx->tokcxptr = p; ctx->tokcxlen = len; @@ -1306,14 +1306,14 @@ done: void toktlini(errcxdef *errctx, toktldef *toktab, uchar *mem, uint siz) { CLRSTRUCT(*toktab); - + /* initialize superclass data */ toktab->toktlsc.toktfadd = toktladd; /* set add-symbol method */ toktab->toktlsc.toktfsea = toktlsea; /* set search-table method */ toktab->toktlsc.toktfeach = toktleach; /* set 'each' method */ toktab->toktlsc.toktfset = toktlset; /* set 'update' method */ toktab->toktlsc.tokterr = errctx; /* set error handling context */ - + /* initialize class data */ toktab->toktlptr = mem; toktab->toktlnxt = mem; @@ -1327,12 +1327,12 @@ void toktladd(toktdef *toktab1, char *name, int namel, uint siz = sizeof(toks1def) + namel; toksdef *sym; toktldef *toktab = (toktldef *)toktab1; - + VARUSED(hash); - + if (toktab->toktlsiz < siz) errsig(toktab->toktlsc.tokterr, ERR_NOLCLSY); - + sym = (toksdef *)toktab->toktlnxt; siz = osrndsz(siz); toktab->toktlnxt += siz; @@ -1345,7 +1345,7 @@ void toktladd(toktdef *toktab1, char *name, int namel, sym->tokstyp = typ; sym->toksfr = 0; memcpy(sym->toksnam, name, (size_t)(namel + 1)); - + /* indicate there's one more symbol in the table */ ++(toktab->toktlcnt); } @@ -1365,7 +1365,7 @@ void toktleach(toktdef *tab1, toksdef *p; uint cnt; toktldef *tab = (toktldef *)tab1; - + for (p = (toksdef *)tab->toktlptr, cnt = tab->toktlcnt ; cnt ; --cnt ) { (*cb)(ctx, p); @@ -1380,9 +1380,9 @@ int toktlsea(toktdef *tab1, char *name, int namel, int hash, toksdef *ret) toksdef *p; uint cnt; toktldef *tab = (toktldef *)tab1; - + VARUSED(hash); - + for (p = (toksdef *)tab->toktlptr, cnt = tab->toktlcnt ; cnt ; --cnt ) { if (p->tokslen == namel && !memcmp(p->toksnam, name, (size_t)namel)) @@ -1390,7 +1390,7 @@ int toktlsea(toktdef *tab1, char *name, int namel, int hash, toksdef *ret) memcpy(ret, p, (size_t)(sizeof(toks1def) + namel)); return(TRUE); } - + p = (toksdef *)(((uchar *)p) + osrndsz(p->tokslen + sizeof(toks1def))); } @@ -1405,7 +1405,7 @@ void toktlset(toktdef *tab1, toksdef *newsym) toksdef *p; uint cnt; toktldef *tab = (toktldef *)tab1; - + for (p = (toksdef *)tab->toktlptr, cnt = tab->toktlcnt ; cnt ; --cnt ) { if (p->tokslen == newsym->tokslen @@ -1415,7 +1415,7 @@ void toktlset(toktdef *tab1, toksdef *newsym) p->tokstyp = newsym->tokstyp; return; } - + p = (toksdef *)(((uchar *)p) + osrndsz(p->tokslen + sizeof(toks1def))); } @@ -1431,18 +1431,18 @@ tokcxdef *tokcxini(errcxdef *errctx, mcmcxdef *mcmctx, tokldef *sctab) tokcxdef *ret; tokscdef *sc; ushort siz; - + /* set up index table: finds tokcxsc entry from character value */ memset(index, 0, (size_t)sizeof(index)); for (i = cnt = 0, p = sctab ; (c = p->toklstr[0]) != 0 ; ++cnt, ++p) if (!index[c]) index[c] = ++i; - + /* allocate memory for table plus the tokscdef's */ siz = sizeof(tokcxdef) + (i * sizeof(tokscdef *)) + ((cnt + 1) * sizeof(tokscdef)); ret = (tokcxdef *)mchalo(errctx, siz, "tokcxini"); memset(ret, 0, (size_t)siz); - + /* copy the index, set up fixed part */ memcpy(ret->tokcxinx, index, sizeof(ret->tokcxinx)); ret->tokcxerr = errctx; @@ -1450,25 +1450,25 @@ tokcxdef *tokcxini(errcxdef *errctx, mcmcxdef *mcmctx, tokldef *sctab) /* start out without an #if */ ret->tokcxifcur = TOKIF_IF_YES; - + /* force the first toknext() to read a line */ ret->tokcxptr = "\000"; - + /* figure where the tokscdef's go (right after sc pointer array) */ sc = (tokscdef *)&ret->tokcxsc[i+1]; - + /* set up the individual tokscdef entries, and link into lists */ for (p = sctab ; (c = p->toklstr[0]) != 0 ; ++p, ++sc) { size_t len; - + sc->toksctyp = p->tokltyp; len = sc->toksclen = strlen(p->toklstr); memcpy(sc->tokscstr, p->toklstr, len); sc->tokscnxt = ret->tokcxsc[index[c]]; ret->tokcxsc[index[c]] = sc; } - + return(ret); } @@ -1477,11 +1477,11 @@ void tokaddinc(tokcxdef *ctx, char *path, int pathlen) { tokpdef *newpath; tokpdef *last; - + /* find the tail of the include path list, if any */ for (last = ctx->tokcxinc ; last && last->tokpnxt ; last = last->tokpnxt) ; - + /* allocate storage for and set up a new path structure */ newpath = (tokpdef *)mchalo(ctx->tokcxerr, (sizeof(tokpdef) + pathlen - 1), @@ -1489,7 +1489,7 @@ void tokaddinc(tokcxdef *ctx, char *path, int pathlen) newpath->tokplen = pathlen; newpath->tokpnxt = (tokpdef *)0; memcpy(newpath->tokpdir, path, (size_t)pathlen); - + /* link in at end of list (if no list yet, newpath becomes first entry) */ if (last) last->tokpnxt = newpath; diff --git a/engines/glk/tads/tads2/tokenizer.h b/engines/glk/tads/tads2/tokenizer.h index f177b42f9de..55ab65f1f12 100644 --- a/engines/glk/tads/tads2/tokenizer.h +++ b/engines/glk/tads/tads2/tokenizer.h @@ -76,11 +76,11 @@ namespace TADS2 { #define TOKTSHR 18 #define TOKTTILDE 30 -/* +/* * special 'dot' replacement for speculative evaluation mode -- this is * strictly for marking parse tree nodes, and has the same meaning in a * parse tree node as a regular TOKTDOT, but generates code that can't - * call methods + * call methods */ #define TOKTDOTSPEC 31 @@ -371,11 +371,11 @@ void tokaddinc(tokcxdef *ctx, char *path, int pathlen); /* compute the hash value of a string */ uint tokhsh(char *nam); -/* +/* * Fold case of a token if we're in case-insensitive mode. This should * be called any time a token is constructed artificially; it need not * be used the token is read through the tokenizer, because the - * tokenizer will always adjust a token as needed before returning it. + * tokenizer will always adjust a token as needed before returning it. */ void tok_case_fold(tokcxdef *ctx, tokdef *tok); @@ -407,7 +407,7 @@ void toktlini(errcxdef *errctx, toktldef *toktab, /* add a symbol to a linear symbol table */ void toktladd(toktdef *toktab, char *name, int namel, int typ, int val, int hash); - + /* search a linear symbol table */ int toktlsea(toktdef *tab, char *name, int namel, int hash, toksdef *ret); @@ -432,9 +432,9 @@ int tokget1(tokcxdef *ctx, tokdef *tok, int consume); void tok_add_define(tokcxdef *ctx, const char *sym, int len, const char *expan, int explen); -/* +/* * add a symbol to the #define symbol table, folding case if we're - * operating in case-insensitive mode + * operating in case-insensitive mode */ void tok_add_define_cvtcase(tokcxdef *ctx, const char *sym, int len, const char *expan, int explen); diff --git a/engines/glk/tads/tads2/tokenizer_hash.cpp b/engines/glk/tads/tads2/tokenizer_hash.cpp index 105a4b18af7..39d0bb95016 100644 --- a/engines/glk/tads/tads2/tokenizer_hash.cpp +++ b/engines/glk/tads/tads2/tokenizer_hash.cpp @@ -26,7 +26,7 @@ * a table of pointers to linked lists of symbols; each entry in * the table corresponds to a hash value, allowing a large table * to be searched for a symbol rapidly. - * + * * Notes: Separated from tokenizer.cpp to allow the run-time to link the hashed * symbol table functions without needing to link the rest of the * lexical analysis subsystem. @@ -45,7 +45,7 @@ namespace TADS2 { uint tokhsh(char *nam) { uint hash = 0; - + while (*nam) hash = ((hash + *nam++) & (TOKHASHSIZE - 1)); return(hash); } @@ -89,11 +89,11 @@ void tokthadd(toktdef *toktab1, char *name, int namel, toksdef *sym; tokshdef *symh; tokthdef *toktab = (tokthdef *)toktab1; - + if (toktab->tokthsize < siz) { mcmcxdef *mctx = toktab->tokthmem; - + /* insufficient space in current pool; add a new pool */ if (toktab->tokthpcnt >= TOKPOOLMAX) errsig(toktab->tokthsc.tokterr, ERR_MANYSYM); @@ -110,12 +110,12 @@ void tokthadd(toktdef *toktab1, char *name, int namel, } symh = (tokshdef *)(toktab->tokthcpool + toktab->tokthofs); sym = &symh->tokshsc; - + /* link into list for this hash value */ OSCPYSTRUCT(symh->tokshnxt, toktab->tokthhsh[hash]); toktab->tokthhsh[hash].tokthpobj = toktab->tokthpool[toktab->tokthpcnt]; toktab->tokthhsh[hash].tokthpofs = toktab->tokthofs; - + /* fill in rest of toksdef */ sym->toksval = val; sym->tokslen = namel; @@ -123,7 +123,7 @@ void tokthadd(toktdef *toktab1, char *name, int namel, sym->tokshsh = hash; sym->toksfr = 0; memcpy(sym->toksnam, name, (size_t)namel); - + /* update free pool pointer */ siz = osrndsz(siz); toktab->tokthofs += siz; @@ -135,10 +135,10 @@ void tokthadd(toktdef *toktab1, char *name, int namel, * Scan a hash chain, calling a callback for each entry. If the * callback returns TRUE for any symbol, we stop there, and return TRUE. * If the callback returns FALSE for a symbol, we keep going. If the - * callback returns FALSE for all symbols, we return FALSE. + * callback returns FALSE for all symbols, we return FALSE. */ static int tokthscan(tokthdef *tab, uint hash, - int (*cb)(void *, toksdef *, mcmon), + int (*cb)(void *, toksdef *, mcmon), void *cbctx) { tokshdef *symh; @@ -167,7 +167,7 @@ static int tokthscan(tokthdef *tab, uint hash, mcmunlck(mctx, p.tokthpobj); return(TRUE); } - + /* if the next page is different from this one, get new lock */ if (nxt.tokthpobj != curobj && nxt.tokthpobj != MCMONINV) { @@ -195,9 +195,9 @@ typedef struct tokseadef tokseadef; static int tokthsea1(void *ctx0, toksdef *sym, mcmon objn) { tokseadef *ctx = (tokseadef *)ctx0; - + VARUSED(objn); - + if (sym->tokslen == ctx->tokseasym.tokslen && !memcmp(sym->toksnam, ctx->tokseanam, ctx->tokseasym.tokslen)) { @@ -224,14 +224,14 @@ int tokthsea(toktdef *tab1, char *name, int namel, int hash, toksdef *ret) static int tokthset1(void *ctx0, toksdef *sym, mcmon objn) { tokseadef *ctx = (tokseadef *)ctx0; - + if (sym->tokslen == ctx->tokseasym.tokslen && !memcmp(sym->toksnam, ctx->tokseasym.toksnam, ctx->tokseasym.tokslen)) { sym->toksval = ctx->tokseasym.toksval; sym->tokstyp = ctx->tokseasym.tokstyp; - + /* touch object, since it's been changed */ mcmtch(ctx->tokseamctx, objn); return(TRUE); @@ -245,7 +245,7 @@ void tokthset(toktdef *tab1, toksdef *newsym) { tokseadef ctx; tokthdef *tab = (tokthdef *)tab1; - + OSCPYSTRUCT(ctx.tokseasym, *newsym); ctx.tokseamctx = tab->tokthmem; tokthscan((tokthdef *)tab1, newsym->tokshsh, tokthset1, &ctx); @@ -255,9 +255,9 @@ void tokthset(toktdef *tab1, toksdef *newsym) static int tokthfind1(void *ctx0, toksdef *sym, mcmon objn) { tokseadef *ctx = (tokseadef *)ctx0; - + VARUSED(objn); - + if (sym->toksval == ctx->tokseasym.toksval && sym->tokstyp == ctx->tokseasym.tokstyp) { @@ -274,11 +274,11 @@ int tokthfind(toktdef *tab1, int typ, uint val, toksdef *ret) { tokseadef ctx; int i; - + ctx.tokseasym.tokstyp = typ; ctx.tokseasym.toksval = val; ctx.toksearet = ret; - + for (i = 0 ; i < TOKHASHSIZE ; ++i) { if (tokthscan((tokthdef *)tab1, i, tokthfind1, &ctx)) @@ -299,12 +299,12 @@ void toktheach(toktdef *tab1, toksdef *sym; uint siz; uint i; - + for (i = 0 ; i <= tab->tokthpcnt ; ++i) { /* lock the current page */ p = mcmlck(tab->tokthmem, tab->tokthpool[i]); - + ERRBEGIN(tab1->tokterr) max = (i == tab->tokthpcnt ? tab->tokthofs : tab->tokthfinal[i]); @@ -313,19 +313,19 @@ void toktheach(toktdef *tab1, /* get this symbol */ symh = (tokshdef *)(p + ofs); sym = &symh->tokshsc; - + /* call the user callback */ (*cb)(ctx, sym); - + /* advance to the next symbol on this page */ siz = sizeof(toksh1def) + sym->tokslen; ofs += osrndsz(siz); } - + ERRCLEAN(tab1->tokterr) mcmunlck(tab->tokthmem, tab->tokthpool[i]); ERRENDCLN(tab1->tokterr) - + /* done with current page; unlock it */ mcmunlck(tab->tokthmem, tab->tokthpool[i]); } diff --git a/engines/glk/tads/tads2/vocabulary.cpp b/engines/glk/tads/tads2/vocabulary.cpp index 034b871d14c..585ceb64480 100644 --- a/engines/glk/tads/tads2/vocabulary.cpp +++ b/engines/glk/tads/tads2/vocabulary.cpp @@ -42,7 +42,7 @@ voccxdef *main_voc_ctx = 0; vocwdef *vocwget(voccxdef *ctx, uint idx) { uint pg; - + if (idx == VOCCXW_NONE) return 0; @@ -71,7 +71,7 @@ vocwdef *vocwget(voccxdef *ctx, uint idx) uint vochsh(const uchar *t, int len) { uint ret = 0; - + if (len > 6) len = 6; for ( ; len ; --len, ++t) ret = (ret + (uint)(vocisupper(*t) ? tolower(*t) : *t)) @@ -96,7 +96,7 @@ static void vocwset(voccxdef *ctx, vocdef *v, prpnum p, objnum objn, /* * look through the vocdef list to see if there's an existing entry - * with the DELETED marker -- if so, simply undelete it + * with the DELETED marker -- if so, simply undelete it */ for (inx = v->vocwlst, vw = vocwget(ctx, inx) ; vw ; inx = vw->vocwnxt, vw = vocwget(ctx, inx)) @@ -109,7 +109,7 @@ static void vocwset(voccxdef *ctx, vocdef *v, prpnum p, objnum objn, * Remove the deleted flag. We will otherwise leave the * flags unchanged, since the VOCFDEL flag applies only to * statically allocated objects, and hence the original - * flags should take precedence over any run-time flags. + * flags should take precedence over any run-time flags. */ vw->vocwflg &= ~VOCFDEL; @@ -129,7 +129,7 @@ static void vocwset(voccxdef *ctx, vocdef *v, prpnum p, objnum objn, return; } } - + /* look in the free list for an available vocwdef */ if (ctx->voccxwfre != VOCCXW_NONE) { @@ -143,10 +143,10 @@ static void vocwset(voccxdef *ctx, vocdef *v, prpnum p, objnum objn, if ((ctx->voccxwalocnt % VOCWPGSIZ) == 0) { int pg = ctx->voccxwalocnt / VOCWPGSIZ; - + /* make sure we haven't exceeded the available page count */ if (pg >= VOCWPGMAX) errsig(ctx->voccxerr, ERR_VOCMNPG); - + /* allocate on the new page */ #ifdef VOCW_IN_CACHE mcmalo(ctx->voccxmem, (ushort)(VOCWPGSIZ * sizeof(vocwdef)), @@ -174,9 +174,9 @@ static void vocwset(voccxdef *ctx, vocdef *v, prpnum p, objnum objn, vw->vocwobj = objn; vw->vocwflg = classflg; - /* + /* * Scan the list and make sure we're not adding a redundant verb. - * Don't bother with the warning if this is a class. + * Don't bother with the warning if this is a class. */ if (p == PRP_VERB && (ctx->voccxflg & VOCCXFVWARN) && (vw->vocwflg & VOCFCLASS) == 0) @@ -184,9 +184,9 @@ static void vocwset(voccxdef *ctx, vocdef *v, prpnum p, objnum objn, for (vw2 = vocwget(ctx, v->vocwlst) ; vw2 ; vw2 = vocwget(ctx, vw2->vocwnxt)) { - /* + /* * if this is a different object, and it's not a class, and - * it's defined as a verb, warn about it + * it's defined as a verb, warn about it */ if (vw2 != vw && (vw2->vocwflg & VOCFCLASS) == 0 @@ -217,10 +217,10 @@ static void vocset(voccxdef *ctx, vocdef *v, prpnum p, objnum objn, uchar *wrd2, int len2) { uint hshval = vochsh(wrdtxt, len); - + v->vocnxt = ctx->voccxhsh[hshval]; ctx->voccxhsh[hshval] = v; - + v->voclen = len; v->vocln2 = len2; voccpy(v->voctxt, wrdtxt, len); @@ -261,19 +261,19 @@ void vocadd2(voccxdef *ctx, prpnum p, objnum objn, int classflg, /* look for a free vocdef entry of the same size */ for (prv = (vocdef *)0, v = ctx->voccxfre ; v ; prv = v, v = v->vocnxt) if (v->voclen == len + len2) break; - + if (v) { /* we found something - unlink from free list */ if (prv) prv->vocnxt = v->vocnxt; else ctx->voccxfre = v->vocnxt; - + /* reuse the entry */ v->vocwlst = VOCCXW_NONE; vocset(ctx, v, p, objn, classflg, wrdtxt, len, wrd2, len2); return; } - + /* didn't find an existing vocdef; allocate a new one */ need = sizeof(vocdef) + len + len2 - 1; if (ctx->voccxrem < need) @@ -282,14 +282,14 @@ void vocadd2(voccxdef *ctx, prpnum p, objnum objn, int classflg, ctx->voccxpool = mchalo(ctx->voccxerr, VOCPGSIZ, "vocadd2"); ctx->voccxrem = VOCPGSIZ; } - + /* use top of current pool, and update pool pointer and size */ v = (vocdef *)ctx->voccxpool; need = osrndsz(need); ctx->voccxpool += need; if (ctx->voccxrem > need) ctx->voccxrem -= need; else ctx->voccxrem = 0; - + /* set up new vocdef */ v->vocwlst = VOCCXW_NONE; vocset(ctx, v, p, objn, classflg, wrdtxt, len, wrd2, len2); @@ -300,7 +300,7 @@ static void voc_parse_words(char **wrdtxt, int *len, char **wrd2, int *len2) /* get length and pointer to actual text */ *len = osrp2(*wrdtxt) - 2; *wrdtxt += 2; - + /* see if there's a second word - look for a space */ for (*wrd2 = *wrdtxt, *len2 = *len ; *len2 && !vocisspace(**wrd2) ; ++*wrd2, --*len2) ; @@ -369,11 +369,11 @@ void vociadd(voccxdef *ctx, objnum obj, objnum loc, } } } - + if (!min) { uint need; - + /* nothing in free list; allocate a new entry */ need = osrndsz(sizeof(vocidef) + (numsc - 1)*sizeof(objnum)); if (ctx->voccxilst + need >= VOCISIZ) @@ -409,7 +409,7 @@ void vociadd(voccxdef *ctx, objnum obj, objnum loc, if (flags & VOCIFXLAT) { int i; - + for (i = 0 ; i < numsc ; ++i) v->vocisc[i] = osrp2(&sc[i]); } @@ -431,7 +431,7 @@ void vocrevert(voccxdef *vctx) /* * Go through the inheritance records. Delete each dynamically * allocated object, and revert each static object to its original - * load state. + * load state. */ for (vpg = vctx->voccxinh, i = 0 ; i < VOCINHMAX ; ++vpg, ++i) { @@ -461,7 +461,7 @@ void vocrevert(voccxdef *vctx) /* * Revert the vocabulary list: delete all newly added words, and - * undelete all original words marked as deleted. + * undelete all original words marked as deleted. */ vocdel1(vctx, MCMONINV, (char *)0, 0, TRUE, TRUE, FALSE); } @@ -480,7 +480,7 @@ void vocini(voccxdef *vocctx, errcxdef *errctx, mcmcxdef *memctx, vocctx->voccxundo = undoctx; vocctx->voccxme = - vocctx->voccxme_init = + vocctx->voccxme_init = vocctx->voccxvtk = vocctx->voccxstr = vocctx->voccxnum = @@ -559,7 +559,7 @@ void voctermfree(vocddef *what) /* * Iterate through all words for a particular object, calling a * function with each vocwdef found. If objn == MCMONINV, we'll call - * the callback for every word. + * the callback for every word. */ void voc_iterate(voccxdef *ctx, objnum objn, void (*fn)(void *, vocdef *, vocwdef *), void *fnctx) @@ -602,19 +602,19 @@ struct voc_count_ctx static void voc_count_cb(void *ctx0, vocdef *voc, vocwdef *vocw) { struct voc_count_ctx *ctx = (struct voc_count_ctx *)ctx0; - + VARUSED(vocw); /* * If it matches the property (or we want all properties), count - * it. Don't count deleted objects. + * it. Don't count deleted objects. */ if ((ctx->prp == 0 || ctx->prp == vocw->vocwtyp) && !(vocw->vocwflg & VOCFDEL)) { /* count the word */ ctx->cnt++; - + /* count the size */ ctx->siz += voc->voclen + voc->vocln2; } @@ -623,7 +623,7 @@ static void voc_count_cb(void *ctx0, vocdef *voc, vocwdef *vocw) /* * Get the number and size of words defined for an object. The size * returns the total byte count from all the words involved. Do not - * include deleted words in the count. + * include deleted words in the count. */ void voc_count(voccxdef *ctx, objnum objn, prpnum prp, int *cnt, int *siz) { @@ -651,7 +651,7 @@ void voc_count(voccxdef *ctx, objnum objn, prpnum prp, int *cnt, int *siz) * However, if the 'really_delete' flag is set, the word is actually * deleted. If the 'revert' flag is true, this routine deletes _every_ * dynamically created word, and undeletes all dynamically deleted words - * that were in the original vocabulary. + * that were in the original vocabulary. */ void vocdel1(voccxdef *ctx, objnum objn, char *wrd1, prpnum prp, int really_delete, int revert, int keep_undo) @@ -676,7 +676,7 @@ void vocdel1(voccxdef *ctx, objnum objn, char *wrd1, prpnum prp, orgwrd = wrd1; if (wrd1) voc_parse_words(&wrd1, &len1, &wrd2, &len2); - + /* go through each hash value looking for matching words */ for (i = VOCHASHSIZ, vp = ctx->voccxhsh ; i ; ++vp, --i) { @@ -709,7 +709,7 @@ void vocdel1(voccxdef *ctx, objnum objn, char *wrd1, prpnum prp, /* presume we're not going to delete this vocdef */ deleted_vocdef = FALSE; - + /* go through all object relations for this word */ for (prvw = 0, idx = v->vocwlst, vw = vocwget(ctx, idx) ; vw ; vw = nxtw, idx = nxtidx) @@ -720,7 +720,7 @@ void vocdel1(voccxdef *ctx, objnum objn, char *wrd1, prpnum prp, /* * figure out whether to delete this word, based on the - * caller's specified operating mode + * caller's specified operating mode */ if (revert) { @@ -738,7 +738,7 @@ void vocdel1(voccxdef *ctx, objnum objn, char *wrd1, prpnum prp, * vocabulary word (in which case wrd1 will be null) * or the word matches the vocabulary word we're * seeking (in which case the part of speech must - * match) + * match) */ do_del = (vw->vocwobj == objn && (wrd1 == 0 || vw->vocwtyp == prp)); @@ -748,7 +748,7 @@ void vocdel1(voccxdef *ctx, objnum objn, char *wrd1, prpnum prp, * matches and it wasn't dynamically added at * run-time, simply mark it as deleted -- this will * allow it to be undeleted if the game is reverted - * to RESTART conditions + * to RESTART conditions */ if (do_del && !really_delete && !(vw->vocwflg & VOCFNEW)) { @@ -756,7 +756,7 @@ void vocdel1(voccxdef *ctx, objnum objn, char *wrd1, prpnum prp, if (keep_undo && orgwrd) vocdusave_delwrd(ctx, objn, prp, vw->vocwflg, orgwrd); - + /* just mark the word for deletion, but keep vw */ vw->vocwflg |= VOCFDEL; do_del = FALSE; @@ -769,7 +769,7 @@ void vocdel1(voccxdef *ctx, objnum objn, char *wrd1, prpnum prp, /* geneate undo for the operation */ if (keep_undo && orgwrd) vocdusave_delwrd(ctx, objn, prp, vw->vocwflg, orgwrd); - + /* unlink this vocwdef from the vocdef's list */ if (prvw) prvw->vocwnxt = vw->vocwnxt; @@ -782,13 +782,13 @@ void vocdel1(voccxdef *ctx, objnum objn, char *wrd1, prpnum prp, /* * if there's nothing left in the vocdef's list, - * delete the entire vocdef as well + * delete the entire vocdef as well */ if (v->vocwlst == VOCCXW_NONE) { if (prv) prv->vocnxt = v->vocnxt; else *vp = v->vocnxt; - + /* link into free chain */ v->vocnxt = ctx->voccxfre; ctx->voccxfre = v; @@ -821,11 +821,11 @@ void vocdel(voccxdef *ctx, objnum objn) void vocidel(voccxdef *ctx, objnum obj) { vocidef *v; - + /* get entry out of page table, and clear page table slot */ v = vocinh(ctx, obj); vocinh(ctx, obj) = (vocidef *)0; - + /* link into free list */ if (v) { @@ -872,14 +872,14 @@ int voctplfnd(voccxdef *ctx, objnum verb_in, objnum prep, /* figure the size of this template style */ siz = (*newstyle ? VOCTPL2SIZ : VOCTPLSIZ); - + /* lock the verb object, and get the property value pointer */ tplptr = mcmlck(ctx->voccxmem, verb); thistpl = prpvalp(tplptr + tplofs); - + /* first byte is number of templates in array */ tplcnt = *thistpl++; - + /* look for a template that matches the preposition object */ for (found = FALSE ; tplcnt ; thistpl += siz, --tplcnt) { @@ -889,7 +889,7 @@ int voctplfnd(voccxdef *ctx, objnum verb_in, objnum prep, break; } } - + /* unlock the object and return the value if we found one */ mcmunlck(ctx->voccxmem, verb); if (found) @@ -919,7 +919,7 @@ int voctplfnd(voccxdef *ctx, objnum verb_in, objnum prep, } /* - * Set the "Me" object + * Set the "Me" object */ void voc_set_me(voccxdef *ctx, objnum new_me) { diff --git a/engines/glk/tads/tads2/vocabulary.h b/engines/glk/tads/tads2/vocabulary.h index 1c228352b4d..4ede9d217a7 100644 --- a/engines/glk/tads/tads2/vocabulary.h +++ b/engines/glk/tads/tads2/vocabulary.h @@ -41,7 +41,7 @@ namespace TADS2 { * Cover macro for parser errors. Any parser error should be covered * with this macro for documentation and search purposes. (The macro * doesn't do anything - this is just something to search for when we're - * trying to enumerate parser error codes.) + * trying to enumerate parser error codes.) */ #define VOCERR(errcode) errcode @@ -127,7 +127,7 @@ struct vocidef { * vocwdef's are fixed in size. They're allocated in a set of arrays * (the voccxwp member of the voc context has the list of arrays). Each * array is of a fixed number of vocwdef entries; a maximum number of - * vocwdef arrays is possible. + * vocwdef arrays is possible. */ #define VOCWPGSIZ 2000 /* number of vocwdef's per array */ #define VOCWPGMAX 16 /* maximum number of vocwdef arrays */ @@ -135,7 +135,7 @@ struct vocidef { /* * To find a vocwdef entry given its index, divide the index by the * number of entries per array to find the array number, and use the - * remainder to find the index within that array. + * remainder to find the index within that array. */ /*#define VOCW_IN_CACHE*/ #ifdef VOCW_IN_CACHE @@ -148,7 +148,7 @@ vocwdef *vocwget(struct voccxdef *ctx, uint idx); /* * Special values for vocdtim - these values indicate that the daemon - * does not have a normal turn-based expiration time. + * does not have a normal turn-based expiration time. */ #define VOCDTIM_EACH_TURN 0xffff /* the daemon fires every turn */ @@ -190,17 +190,17 @@ struct voccxdef { uint voccxilst; /* next unused byte in last inheritance page */ int voccxredo; /* flag: redo command in buffer */ - /* + /* * redo buffer - if voccxredo is set, and this buffer is not empty, * we'll redo the command in this buffer rather than the one in our - * internal stack buffer + * internal stack buffer */ char voccxredobuf[VOCBUFSIZ]; /* * "again" buffer - when we save the last command for repeating via * the "again" command, we'll save the direct and indirect object - * words here, so that they can be recovered if "again" is used + * words here, so that they can be recovered if "again" is used */ char voccxagainbuf[VOCBUFSIZ]; @@ -225,7 +225,7 @@ struct voccxdef { vocddef *voccxalm; /* array of alarm slots */ uint voccxalc; /* number of slots in alarm array */ char voccxtim[26]; /* game's timestamp (asctime value) */ - + objnum voccxvtk; /* object number of "take" deepverb */ objnum voccxme; /* object number of "Me" actor */ objnum voccxme_init; /* initial setting of "Me" */ @@ -268,7 +268,7 @@ struct voccxdef { objnum voccxactor; /* current actor */ objnum voccxverb; /* current command deepverb */ objnum voccxprep; /* current command preposition */ - + /* previous command values - used by "again" */ objnum voccxlsa; /* previous actor */ objnum voccxlsv; /* previous verb */ @@ -412,26 +412,26 @@ int try_preparse_cmd(voccxdef *ctx, char **cmd, int wrdcnt, * recognize the sentence structure (for example, an indirect object is * present, but we don't have a template defined using an indirect * object for the verb). - * + * * 'wrdcnt' is the number of words in the cmd[] array. If wrdcnt is * zero, we'll automatically count the array entries, with the end of * the array indicated by a null pointer entry. - * + * * If do_fuses is true, we'll execute the fuses and daemons if the * function exists and doesn't throw an ABORT error, or any other * run-time error other than EXIT. - * + * * This function calls the game-defined function parseUnknownVerb, if it * exists. If the function doesn't exist, we'll simply display the * given error message, using the normal parseError mechanism. The * function should use "abort" or "exit" if it wants to cancel further * processing of the command. - * + * * We'll return true if the function exists and executes successfully, * in which case normal processing should continue with any remaining * command on the command line. We'll return false if the function * doesn't exist or throws an error other than EXIT, in which case the - * remainder of the command should be aborted. + * remainder of the command should be aborted. */ int try_unknown_verb(voccxdef *ctx, objnum actor, char **cmd, int *typelist, int wrdcnt, int *next_start, @@ -573,7 +573,7 @@ struct vocspdef { /* int vocspec(char *wordptr, int speccode); */ #define vocspec(w, s) (*(w) == (s)) -/* +/* * Set a fuse/daemon/notifier. */ void vocsetfd(voccxdef *ctx, vocddef *what, objnum func, prpnum prop, @@ -611,11 +611,11 @@ void vocdmnclr(voccxdef *ctx); /* display a parser error message */ void vocerr(voccxdef *ctx, int err, const char *f, ...); -/* +/* * display a parser informational error message - this will display the * message whether or not we're suppressing messages due to unknown * words, and should be used when providing information, such as objects - * we're assuming by default + * we're assuming by default */ void vocerr_info(voccxdef *ctx, int err, const char *f, ...); @@ -654,7 +654,7 @@ uint vochsh(const uchar *t, int len); /* - * Undo types for voc subsystem + * Undo types for voc subsystem */ #define VOC_UNDO_DAEMON 1 /* fuse/daemon status change */ #define VOC_UNDO_NEWOBJ 2 /* object creation */ @@ -671,7 +671,7 @@ uint vochsh(const uchar *t, int len); * some machines have relatively restrictive limitations on stack usage. * To provide some elbow room, we'll use a stack-like structure of our * own: we'll allocate out of this structure as needed, and whenever we - * leave a C stack frame, we'll also leave our own stack frame. + * leave a C stack frame, we'll also leave our own stack frame. */ /* re-initialize the stack, allocating space for it if needed */ @@ -704,7 +704,7 @@ void *voc_stk_alo(voccxdef *ctx, uint siz); * the defined VOCMAXAMBIG parameter, since it is the number of elements * usually allocated. The actual amount of space needed depends on how * the functions in vocab.c and execmd.c work, so this parameter may - * need to be adjusted for changes to the player command parser. + * need to be adjusted for changes to the player command parser. */ #define VOC_STACK_SIZE (16 * VOCMAXAMBIG * sizeof(vocoldef)) @@ -714,8 +714,8 @@ void *voc_stk_alo(voccxdef *ctx, uint siz); * thrown during execution. This is a convenient cover single function * to do all end-of-turn processing; this calls exefuse() and exedaem() * as needed, trapping any 'abort' or 'exit' errors that occur. - * - * If 'do_fuses' is true, we'll run fuses and daemons. Otherwise, + * + * If 'do_fuses' is true, we'll run fuses and daemons. Otherwise, */ int exe_fuses_and_daemons(voccxdef *ctx, int err, int do_fuses, objnum actor, objnum verb, @@ -724,26 +724,26 @@ int exe_fuses_and_daemons(voccxdef *ctx, int err, int do_fuses, /* * Execute any pending fuses. Return TRUE if any fuses were executed, - * FALSE otherwise. + * FALSE otherwise. */ int exefuse(voccxdef *ctx, int do_run); /* - * Execute daemons + * Execute daemons */ void exedaem(voccxdef *ctx); /* * Get the number and size of words defined for an object. The size * returns the total byte count from all the words involved. Do not - * include deleted words in the count. + * include deleted words in the count. */ void voc_count(voccxdef *ctx, objnum objn, prpnum prp, int *cnt, int *siz); /* * Iterate through all words for a particular object, calling a * function with each vocwdef found. If objn == MCMONINV, we'll call - * the callback for every word. + * the callback for every word. */ void voc_iterate(voccxdef *ctx, objnum objn, void (*fn)(void *, vocdef *, vocwdef *), void *fnctx); @@ -772,7 +772,7 @@ void voc_iterate(voccxdef *ctx, objnum objn, /* ------------------------------------------------------------------------ */ /* - * parseNounPhrase status codes + * parseNounPhrase status codes */ /* parse error occurred */ @@ -787,7 +787,7 @@ void voc_iterate(voccxdef *ctx, objnum objn, /* ------------------------------------------------------------------------ */ /* - * parserResolveObjects usage codes + * parserResolveObjects usage codes */ #define VOC_PRO_RESOLVE_DOBJ 1 /* direct object */ #define VOC_PRO_RESOLVE_IOBJ 2 /* indirect object */ diff --git a/engines/glk/tads/tads2/vocabulary_parser.cpp b/engines/glk/tads/tads2/vocabulary_parser.cpp index dd983ba0f79..167f716771a 100644 --- a/engines/glk/tads/tads2/vocabulary_parser.cpp +++ b/engines/glk/tads/tads2/vocabulary_parser.cpp @@ -45,7 +45,7 @@ static int voctype[] = /* ------------------------------------------------------------------------ */ /* * Allocate and push a list, given the number of bytes needed for the - * elements of the list. + * elements of the list. */ uchar *voc_push_list_siz(voccxdef *ctx, uint lstsiz) { @@ -79,16 +79,16 @@ uchar *voc_push_list_siz(voccxdef *ctx, uint lstsiz) /* * Allocate and push a list. Returns a pointer to the space for the - * list's first element in the heap. + * list's first element in the heap. */ static uchar *voc_push_list(voccxdef *ctx, int ele_count, int ele_size) { uint lstsiz; - /* + /* * Figure the list size - we need space for the given number of * elements of the given size; in addition, each element requires - * one byte of overhead for its type prefix. + * one byte of overhead for its type prefix. */ lstsiz = (uint)(ele_count * (1 + ele_size)); @@ -97,7 +97,7 @@ static uchar *voc_push_list(voccxdef *ctx, int ele_count, int ele_size) } /* - * Push a list of numbers + * Push a list of numbers */ static void voc_push_numlist(voccxdef *ctx, uint numlist[], int cnt) { @@ -120,7 +120,7 @@ static void voc_push_numlist(voccxdef *ctx, uint numlist[], int cnt) } /* - * Push a list of object ID's obtained from a vocoldef array + * Push a list of object ID's obtained from a vocoldef array */ void voc_push_vocoldef_list(voccxdef *ctx, vocoldef *objlist, int cnt) { @@ -128,9 +128,9 @@ void voc_push_vocoldef_list(voccxdef *ctx, vocoldef *objlist, int cnt) uchar *lstp; uint lstsiz; - /* + /* * count the size - we need 3 bytes per object (1 for type plus 2 - * for the value), and 1 byte per nil + * for the value), and 1 byte per nil */ for (lstsiz = 0, i = 0 ; i < cnt ; ++i) lstsiz += (objlist[i].vocolobj == MCMONINV ? 1 : 3); @@ -159,7 +159,7 @@ void voc_push_vocoldef_list(voccxdef *ctx, vocoldef *objlist, int cnt) } /* - * Push a list of object ID's + * Push a list of object ID's */ void voc_push_objlist(voccxdef *ctx, objnum objlist[], int cnt) { @@ -167,9 +167,9 @@ void voc_push_objlist(voccxdef *ctx, objnum objlist[], int cnt) uchar *lstp; uint lstsiz; - /* + /* * count the size - we need 3 bytes per object (1 for type plus 2 - * for the value), and 1 byte per nil + * for the value), and 1 byte per nil */ for (lstsiz = 0, i = 0 ; i < cnt ; ++i) lstsiz += (objlist[i] == MCMONINV ? 1 : 3); @@ -189,7 +189,7 @@ void voc_push_objlist(voccxdef *ctx, objnum objlist[], int cnt) { /* add the type prefix */ *lstp++ = DAT_OBJECT; - + /* add the value */ oswp2(lstp, objlist[i]); lstp += 2; @@ -201,7 +201,7 @@ void voc_push_objlist(voccxdef *ctx, objnum objlist[], int cnt) * Push a list of strings, where the strings are stored in memory, one * after the other, each string separated from the next with a null * byte. The list is bounded by firstwrd and lastwrd, inclusive of - * both. + * both. */ static void voc_push_strlist(voccxdef *ctx, const char *firstwrd, const char *lastwrd) { @@ -213,7 +213,7 @@ static void voc_push_strlist(voccxdef *ctx, const char *firstwrd, const char *la /* * Determine how much space we need for the word list. For each * entry, we need one byte for the type prefix, two bytes for the - * length prefix, and the bytes of the string itself. + * length prefix, and the bytes of the string itself. */ for (lstsiz = 0, p = firstwrd ; p != 0 && p <= lastwrd ; p += curlen + 1) { @@ -242,7 +242,7 @@ static void voc_push_strlist(voccxdef *ctx, const char *firstwrd, const char *la } /* - * Push a list of strings, taking the strings from an array. + * Push a list of strings, taking the strings from an array. */ static void voc_push_strlist_arr(voccxdef *ctx, char *wordlist[], int cnt) { @@ -251,10 +251,10 @@ static void voc_push_strlist_arr(voccxdef *ctx, char *wordlist[], int cnt) uint lstsiz; uchar *lstp; - /* + /* * Add up the lengths of the strings in the array. For each * element, we need space for the string's bytes, plus two bytes for - * the length prefix, plus one byte for the type prefix. + * the length prefix, plus one byte for the type prefix. */ for (lstsiz = 0, p = wordlist, i = 0 ; i < cnt ; ++i, ++p) lstsiz += strlen(*p) + 3; @@ -285,7 +285,7 @@ static void voc_push_strlist_arr(voccxdef *ctx, char *wordlist[], int cnt) * Push a list of strings, taking the strings from an array that was * prepared by the parser tokenizer. This is almost the same as pushing * a regular string array, with the difference that we must recognize - * the special format that the tokenizer uses to store string tokens. + * the special format that the tokenizer uses to store string tokens. */ static void voc_push_toklist(voccxdef *ctx, char *wordlist[], int cnt) { @@ -295,21 +295,21 @@ static void voc_push_toklist(voccxdef *ctx, char *wordlist[], int cnt) uchar *lstp; size_t cur_len; - /* + /* * Add up the lengths of the strings in the array. For each * element, we need space for the string's bytes, plus two bytes for - * the length prefix, plus one byte for the type prefix. + * the length prefix, plus one byte for the type prefix. */ for (lstsiz = 0, p = wordlist, i = 0 ; i < cnt ; ++i, ++p) { - /* + /* * get the length of the current token - check what kind of * token we have, since we must sense the length of different - * token types in different ways + * token types in different ways */ if (**p == '"') { - /* + /* * It's a string token - the string follows with a two-byte * length prefix; add two bytes for the open and close quote * characters that we'll add to the output string. Note @@ -338,16 +338,16 @@ static void voc_push_toklist(voccxdef *ctx, char *wordlist[], int cnt) { char *cur_ptr; size_t copy_len; - + /* add the type prefix */ *lstp++ = DAT_SSTRING; /* get the information for the string based on the type */ if (**p == '"') { - /* + /* * it's a string - use the length prefix (deducting two - * bytes for the prefix itself, which we're not copying) + * bytes for the prefix itself, which we're not copying) */ copy_len = osrp2(*p + 1) - 2; @@ -400,14 +400,14 @@ int vocread(voccxdef *ctx, objnum actor, objnum verb, tiocapture(ctx->voccxtio, (mcmcxdef *)0, FALSE); tioclrcapture(ctx->voccxtio); - /* + /* * Clear out the command buffer. This is important for the * timeout-based command reader, since it will take what's in the * buffer as the initial contents of the command line; this lets us * remember any partial line that the player entered before a * timeout interrupted their typing and redisplay the original * partial line on the next command line. Initially, there's no - * partial line, so clear it out. + * partial line, so clear it out. */ buf[0] = '\0'; @@ -425,24 +425,24 @@ int vocread(voccxdef *ctx, objnum actor, objnum verb, tioblank(tio); prompt = ">"; } - + /* get a line of input */ if (tiogets(ctx->voccxtio, prompt, buf, bufl)) errsig(ctx->voccxerr, ERR_RUNQUIT); - + /* abort immediately if we see the special panic command */ if (!strcmp(buf, "$$ABEND")) { /* make sure any script file is closed */ qasclose(); - + /* use the OS-level termination */ os_term(OSEXFAIL); /* if that returned, signal a quit */ errsig(ctx->voccxerr, ERR_RUNQUIT); } - + /* call the post-prompt function if defined */ if (ctx->voccxpostprom != MCMONINV) { @@ -450,10 +450,10 @@ int vocread(voccxdef *ctx, objnum actor, objnum verb, runfn(ctx->voccxrun, ctx->voccxpostprom, 1); } - /* + /* * If this isn't a type "0" input, and preparseExt() is defined, call * it. Don't call preparseExt() for type "0" inputs, since these will - * be handled via the conventional preparse(). + * be handled via the conventional preparse(). */ if (ctx->voccxpre2 != MCMONINV && type != 0) { @@ -473,18 +473,18 @@ int vocread(voccxdef *ctx, objnum actor, objnum verb, switch(runtostyp(ctx->voccxrun)) { case DAT_SSTRING: - /* + /* * They returned a string. Replace the input buffer we read * with the new string. Pop the new string and scan its length - * prefix. + * prefix. */ s = runpopstr(ctx->voccxrun); len = osrp2(s) - 2; s += 2; - /* + /* * limit the size we copy to our buffer length (leaving space - * for null termination) + * for null termination) */ if (len > (size_t)bufl - 1) len = bufl - 1; @@ -499,19 +499,19 @@ int vocread(voccxdef *ctx, objnum actor, objnum verb, break; case DAT_TRUE: - /* + /* * they simply want to keep the current string as it is - - * proceed as normal + * proceed as normal */ break; case DAT_NIL: - /* + /* * They want to skip the special interpretation of the input * and proceed directly to treating the input as a brand new * command. The caller will have to take care of the details; * we need only indicate this to the caller through our "redo" - * result code. + * result code. */ ret = VOCREAD_REDO; break; @@ -567,7 +567,7 @@ vocwdef *vocfnw(voccxdef *voccx, vocseadef *search_ctx) * on the first time through, vw has already been set up * with the next vocwdef in the current list; on subsequent * times through the loop, start at the head of the current - * word's list + * word's list */ if (!first) vw = vocwget(voccx, v->vocwlst); @@ -582,7 +582,7 @@ vocwdef *vocfnw(voccxdef *voccx, vocseadef *search_ctx) /* * remember the first vocdef that we found, and * remember this, the first matching vocwdef, then - * stop scanning + * stop scanning */ vf = v; vwf = vw; @@ -627,7 +627,7 @@ vocwdef *vocffw(voccxdef *ctx, const char *wrd, int len, const char *wrd2, int l /* * remember the first vocdef that we found, and * remember this, the first matching vocwdef; then - * stop scanning, since we have a match + * stop scanning, since we have a match */ vf = v; vwf = vw; @@ -657,9 +657,9 @@ vocwdef *vocffw(voccxdef *ctx, const char *wrd, int len, const char *wrd2, int l } /* ------------------------------------------------------------------------ */ -/* +/* * vocerr_va information structure. This is initialized in the call to - * vocerr_va_prep(), and must then be passed to vocerr_va(). + * vocerr_va_prep(), and must then be passed to vocerr_va(). */ struct vocerr_va_info { @@ -669,10 +669,10 @@ struct vocerr_va_info /* the sprintf-style format string to display */ const char *fmt; - /* + /* * Pointer to the output buffer to use to format the string 'fmt' with * its arguments, using vsprintf. The prep function will set this up - * to point to user_msg[]. + * to point to user_msg[]. */ char *outp; @@ -683,14 +683,14 @@ struct vocerr_va_info /* * General parser error formatter - preparation. This must be called to * initialize the context before the message can be displayed with - * vocerr_va(). + * vocerr_va(). */ static void vocerr_va_prep(voccxdef *ctx, struct vocerr_va_info *info, int err, const char *f, va_list argptr) { - /* + /* * presume that we'll use the given format string, instead of one - * provided by the program + * provided by the program */ info->fmt = f; @@ -698,9 +698,9 @@ static void vocerr_va_prep(voccxdef *ctx, struct vocerr_va_info *info, info->outp = info->user_msg; info->outsiz = sizeof(info->user_msg); - /* + /* * if the user has a parseError or parseErrorParam function, see if it - * provides a msg + * provides a msg */ if (ctx->voccxper != MCMONINV || ctx->voccxperp != MCMONINV) { @@ -712,9 +712,9 @@ static void vocerr_va_prep(voccxdef *ctx, struct vocerr_va_info *info, /* start off with the two arguments that are always present */ argc = 2; - /* + /* * if we're calling parseErrorParam, and we have additional - * arguments, push them as well + * arguments, push them as well */ if (ctx->voccxperp != MCMONINV) { @@ -736,11 +736,11 @@ static void vocerr_va_prep(voccxdef *ctx, struct vocerr_va_info *info, struct argbuf_t *argp; const char *p; - /* + /* * Retrieve the arguments by examining the format string. We * must buffer up the arguments before pushing them, because * we need to push them in reverse order (last to first); so, - * we must scan all arguments before we push the first one. + * we must scan all arguments before we push the first one. */ for (p = f, argp = args ; *p != '\0' ; ++p) { @@ -778,9 +778,9 @@ static void vocerr_va_prep(voccxdef *ctx, struct vocerr_va_info *info, break; default: - /* + /* * ignore other types (there shouldn't be any - * other types anyway) + * other types anyway) */ break; } @@ -789,7 +789,7 @@ static void vocerr_va_prep(voccxdef *ctx, struct vocerr_va_info *info, /* * Push the arguments - keep looping until we get back to the - * first argument slot + * first argument slot */ while (argp != args) { @@ -834,10 +834,10 @@ static void vocerr_va_prep(voccxdef *ctx, struct vocerr_va_info *info, if (typ == DAT_SSTRING) { char *p; - - /* + + /* * they returned a string - use it as the error message - * instead of the default message + * instead of the default message */ p = (char *)runpopstr(rcx); len = osrp2(p) - 2; @@ -863,21 +863,21 @@ static void vocerr_va_prep(voccxdef *ctx, struct vocerr_va_info *info, } -/* +/* * General parser error formatter. - * + * * Before calling this routine, callers MUST invoke vocerr_va_prep() to * prepare the information structure. Because both this routine and the * prep routine need to look at the varargs list ('argptr'), the caller * must call va_start/va_end around the prep call, and then AGAIN on this * call. va_start/va_end must be used twice to ensure that the argptr is - * property re-initialized for the call to this routine. + * property re-initialized for the call to this routine. */ static void vocerr_va(voccxdef *ctx, struct vocerr_va_info *info, int err, const char *f, va_list argptr) { char *buf; - + /* turn on output */ (void)tioshow(ctx->voccxtio); @@ -893,8 +893,8 @@ static void vocerr_va(voccxdef *ctx, struct vocerr_va_info *info, } /* ------------------------------------------------------------------------ */ -/* - * display a parser informational message +/* + * display a parser informational message */ void vocerr_info(voccxdef *ctx, int err, const char *f, ...) { @@ -912,8 +912,8 @@ void vocerr_info(voccxdef *ctx, int err, const char *f, ...) va_end(argptr); } -/* - * display a parser error +/* + * display a parser error */ void vocerr(voccxdef *ctx, int err, const char *f, ...) { @@ -923,7 +923,7 @@ void vocerr(voccxdef *ctx, int err, const char *f, ...) /* * If the unknown word flag is set, suppress this error, because * we're going to be trying the whole parsing from the beginning - * again anyway. + * again anyway. */ if (ctx->voccxunknown > 0) return; @@ -946,22 +946,22 @@ void vocerr(voccxdef *ctx, int err, const char *f, ...) * recognize the sentence structure (for example, an indirect object is * present, but we don't have a template defined using an indirect * object for the verb). - * + * * This function calls the game-defined function parseUnknownVerb, if it * exists. If the function doesn't exist, we'll simply display the * given error message, using the normal parseError mechanism. The * function should use "abort" or "exit" if it wants to cancel further * processing of the command. - * + * * We'll return true if the function exists, in which case normal * processing should continue with any remaining command on the command * line. We'll return false if the function doesn't exist, in which - * case the remainder of the command should be aborted. - * + * case the remainder of the command should be aborted. + * * 'wrdcnt' is the number of words in the cmd[] array. If wrdcnt is * zero, we'll automatically count the array entries, with the end of * the array indicated by a null pointer entry. - * + * * 'next_start' is a variable that we may fill in with the index of the * next word in the command to be parsed. If the user function * indicates the number of words it consumes, we'll use 'next_start' to @@ -1030,21 +1030,21 @@ int try_unknown_verb(voccxdef *ctx, objnum actor, /* consume the entire command */ *next_start = wrdcnt; - /* + /* * since the command has now been handled, forget about - * any unknown words + * any unknown words */ ctx->voccxunknown = 0; break; case DAT_NUMBER: - /* + /* * The command was handled, and the function indicated * the number of words it wants to skip. Communicate * this information back to the caller in *next_start. * Since the routine returns the 1-based index of the * next entry, we must subtract one to get the number of - * words actually consumed. + * words actually consumed. */ *next_start = runpopnum(ctx->voccxrun); if (*next_start > 0) @@ -1056,9 +1056,9 @@ int try_unknown_verb(voccxdef *ctx, objnum actor, else if (*next_start > wrdcnt) *next_start = wrdcnt; - /* + /* * forget about any unknown words in the list up to the - * next word + * next word */ for (i = 0 ; i < *next_start ; ++i) { @@ -1086,19 +1086,19 @@ int try_unknown_verb(voccxdef *ctx, objnum actor, { case ERR_RUNEXIT: case ERR_RUNEXITOBJ: - /* + /* * Exit or exitobj was executed - skip to the fuses. * Forget about any unknown words, since we've finished * processing this command and we don't want to allow - * "oops" processing. + * "oops" processing. */ ctx->voccxunknown = 0; break; case ERR_RUNABRT: - /* + /* * abort was executed - skip to the end of the command, - * but do not execute the fuses + * but do not execute the fuses */ do_fuses = FALSE; @@ -1106,7 +1106,7 @@ int try_unknown_verb(voccxdef *ctx, objnum actor, * Since we're aborting the command, ignore any * remaining unknown words - we're skipping out of the * command entirely, so we don't care that there were - * unknown words in the command. + * unknown words in the command. */ ctx->voccxunknown = 0; break; @@ -1126,10 +1126,10 @@ int try_unknown_verb(voccxdef *ctx, objnum actor, actor, MCMONINV, 0, 0, MCMONINV, MCMONINV) != 0) { - /* + /* * aborted from fuses and daemons - return false to tell * the caller not to execute anything left on the - * command line + * command line */ return FALSE; } @@ -1139,7 +1139,7 @@ int try_unknown_verb(voccxdef *ctx, objnum actor, } } - /* + /* * If we made it here, it means we're showing the default message. * If we have unknown words, suppress the message so that we show * the unknown word error instead after returning. @@ -1201,7 +1201,7 @@ static int voc_check_special(voccxdef *ctx, const char *wrd, int checktyp) char typ; int len; int wrdlen = strlen(wrd); - + for (p = ctx->voccxspp, endp = p + ctx->voccxspl ; p < endp ; ) { @@ -1220,7 +1220,7 @@ static int voc_check_special(voccxdef *ctx, const char *wrd, int checktyp) else { const vocspdef *x; - + for (x = vocsptab ; x->vocspin ; ++x) { /* if it matches in type and text, we have a match */ @@ -1265,7 +1265,7 @@ int voctok(voccxdef *ctx, char *cmd, char *outbuf, char **wrd, *outbuf++ = (vocisupper(*cmd) && lower) ? tolower(*cmd) : *cmd; ++cmd; } - + /* * Check for a special case: abbreviations that end in a * period. For example, "Mr. Patrick J. Wayne." We wish @@ -1304,7 +1304,7 @@ int voctok(voccxdef *ctx, char *cmd, char *outbuf, char **wrd, uint l2 = osrp2(p2); char *p3 = p2 + l2; /* get compound word */ uint l3 = osrp2(p3); - + if (i > 1 && len == (l2 - 2) && !memcmp(w, p2 + 2, (size_t)len) && strlen((char *)wrd[i-2]) == (l1 - 2) @@ -1325,7 +1325,7 @@ int voctok(voccxdef *ctx, char *cmd, char *outbuf, char **wrd, * Find any special keywords, and set to appropriate flag * char. Note that we no longer convert "of" in this * fashion; "of" is now handled separately in order to - * facilitate its use as an ordinary preposition. + * facilitate its use as an ordinary preposition. */ if (ctx->voccxspp) { @@ -1334,7 +1334,7 @@ int voctok(voccxdef *ctx, char *cmd, char *outbuf, char **wrd, char typ; //int len; uint wrdlen = strlen((char *)wrd[i-1]); - + for (p = ctx->voccxspp, endp = p + ctx->voccxspl ; p < endp ; ) { @@ -1400,7 +1400,7 @@ int voctok(voccxdef *ctx, char *cmd, char *outbuf, char **wrd, char *lenptr; char quote = *cmd++; - /* + /* * remember that this is a quoted string (it doesn't * matter whether they're actually using single or * double quotes - in either case, we use '"' as the @@ -1419,7 +1419,7 @@ int voctok(voccxdef *ctx, char *cmd, char *outbuf, char **wrd, /* get this character */ c = *cmd++; - + /* escape the character if necessary */ switch(c) { @@ -1431,7 +1431,7 @@ int voctok(voccxdef *ctx, char *cmd, char *outbuf, char **wrd, /* copy this character */ *outbuf++ = c; } - + oswp2(lenptr, ((int)(outbuf - lenptr))); if (*cmd == quote) cmd++; break; @@ -1443,14 +1443,14 @@ int voctok(voccxdef *ctx, char *cmd, char *outbuf, char **wrd, { int hmode = tio_is_html_mode(); - /* + /* * if we're in HTML mode, switch out momentarily, so that * we show the character literally, even if it's a - * markup-significant character (such as '<' or '&') + * markup-significant character (such as '<' or '&') */ if (hmode) tioputs(ctx->voccxtio, "\\H-"); - + /* show the message */ vocerr(ctx, VOCERR(1), "I don't understand the punctuation \"%c\".", *cmd); @@ -1473,12 +1473,12 @@ int voctok(voccxdef *ctx, char *cmd, char *outbuf, char **wrd, /* ------------------------------------------------------------------------ */ /* * Look up a word's type. If 'of_is_spec' is true, we'll treat OF as - * being of type special if it's not otherwise defined. + * being of type special if it's not otherwise defined. */ static int voc_lookup_type(voccxdef *ctx, char *p, int len, int of_is_spec) { int t; - + /* check for a special word */ if (vocisspec(p)) { @@ -1498,7 +1498,7 @@ static int voc_lookup_type(voccxdef *ctx, char *p, int len, int of_is_spec) * flag can only be set if the plural word matches exactly. * Note that this pass only matches the first word in two-word * verbs; the second word is considered later during the - * semantic analysis. + * semantic analysis. */ for (t = 0, v = ctx->voccxhsh[vochsh((uchar *)p, len)] ; v != 0 ; v = v->vocnxt) @@ -1549,13 +1549,13 @@ static int voc_lookup_type(voccxdef *ctx, char *p, int len, int of_is_spec) * user to respond with the special OOPS command to correct the unknown * word. Returns a pointer to the start of the replacement text if the * player entered a correction via OOPS, or a null pointer if the player - * simply entered a new command. + * simply entered a new command. */ static char *voc_read_oops(voccxdef *ctx, char *oopsbuf, size_t oopsbuflen, const char *unknown_word) { char *p; - + /* display the error */ vocerr(ctx, VOCERR(2), "I don't know the word \"%s\".", unknown_word); @@ -1563,9 +1563,9 @@ static char *voc_read_oops(voccxdef *ctx, char *oopsbuf, size_t oopsbuflen, if (vocread(ctx, MCMONINV, MCMONINV, oopsbuf, (int)oopsbuflen, 1) == VOCREAD_REDO) { - /* + /* * we've already decided it's not an OOPS input - return null to - * indicate to the caller that we have a new command + * indicate to the caller that we have a new command */ return 0; } @@ -1577,9 +1577,9 @@ static char *voc_read_oops(voccxdef *ctx, char *oopsbuf, size_t oopsbuflen, /* skip leading spaces */ for (p = oopsbuf ; vocisspace(*p) ; ++p) ; - /* + /* * See if they are saying "oops". Allow "oops" or simply "o", - * followed by either a space or a comma. + * followed by either a space or a comma. */ if ((strlen(p) > 5 && memcmp(p, "oops ", 5) == 0) || (strlen(p) > 5 && memcmp(p, "oops,", 5) == 0)) @@ -1595,9 +1595,9 @@ static char *voc_read_oops(voccxdef *ctx, char *oopsbuf, size_t oopsbuflen, } else { - /* + /* * we didn't find any form of "OOPS" response - return null to - * indicate to the caller that the player entered a new command + * indicate to the caller that the player entered a new command */ return 0; } @@ -1621,7 +1621,7 @@ int vocgtyp(voccxdef *ctx, char *cmd[], int types[], char *orgbuf) char *p; int len; int unknown_count = 0; - + startover: if (ctx->voccxflg & VOCCXFDBG) tioputs(ctx->vocxtio, ". Checking words:\\n"); @@ -1634,11 +1634,11 @@ startover: /* look it up */ t = voc_lookup_type(ctx, p, len, FALSE); - + /* see if the word was found */ if (t == 0 && !voc_check_special(ctx, p, VOCW_OF)) { - /* + /* * We didn't find the word. For now, set its type to * "unknown". */ @@ -1650,7 +1650,7 @@ startover: * the parseUnknownDobj/Iobj mechanism, but it wasn't able * to do so, thus we've come back here to use the normal * "oops" processing instead. - * + * * Don't generate a message until we get to the first * unknown word from the original list that we weren't able * to resolve. We may have been able to handle one or more @@ -1658,15 +1658,15 @@ startover: * parseNounPhrase or other means), so we don't want to * generate a message for any words we ended up handling. * The number we resolved is the last full unknown count - * minus the remaining unknown count. + * minus the remaining unknown count. */ if (ctx->voccxunknown != 0 && unknown_count >= ctx->voccxlastunk - ctx->voccxunknown) { char oopsbuf[VOCBUFSIZ]; char *p1; - - /* + + /* * we can try using the parseUnknownDobj/Iobj again * after this, so clear the unknown word count for now */ @@ -1684,23 +1684,23 @@ startover: int wc; char **w; char *outp; - - /* + + /* * copy words from the original string, replacing * the unknown word with what follows the "oops" in - * the new command + * the new command */ for (outp = redobuf, i = 0, w = cmd ; *w != 0 ; ++i, ++w) { - + /* see what we have */ if (i == cur) { - /* + /* * We've reached the word to be replaced. * Ignore the original token, and replace it * with the word or words from the OOPS - * command + * command */ for (q = p1, len = 0 ; *q != '\0' && *q != '.' && *q != ',' @@ -1715,7 +1715,7 @@ startover: char qu; int rem; - /* + /* * It's a string - add a quote mark, then * copy the string as indicated by the * length prefix, then add another quote @@ -1723,7 +1723,7 @@ startover: * length prefix following the quote mark, * and get a pointer to the text of the * string, which immediately follows the - * length prefix. + * length prefix. */ len = osrp2(*w + 1) - 2; strp = *w + 3; @@ -1735,15 +1735,15 @@ startover: * to delimit the string; otherwise, use * double quotes. Presume we'll use double * quotes as the delimiter, then scan the - * string for embedded double quotes. + * string for embedded double quotes. */ for (qu = '"', p2 = strp, rem = len ; rem != 0 ; --rem, ++p2) { - /* + /* * if this is an embedded double quote, * use single quotes to delimite the - * string + * string */ if (*p2 == '"') { @@ -1767,10 +1767,10 @@ startover: } else { - /* + /* * it's an ordinary token - copy the * null-terminated string for the token from - * the original command list + * the original command list */ len = strlen(*w); memcpy(outp, *w, (size_t)len); @@ -1780,10 +1780,10 @@ startover: /* add a space between words */ *outp++ = ' '; } - + /* terminate the new string */ *outp = '\0'; - + /* try tokenizing the string */ *(cmd[0]) = '\0'; if ((wc = voctok(ctx, redobuf, cmd[0], @@ -1796,28 +1796,28 @@ startover: } else { - /* + /* * They didn't start the command with "oops", so * this must be a brand new command. Replace the - * original command with the new command. + * original command with the new command. */ strcpy(orgbuf, oopsbuf); - /* + /* * forget we had an unknown word so that we're sure - * to start over with a new command + * to start over with a new command */ ctx->voccxunknown = 0; - - /* + + /* * set the "redo" flag to start over with the new - * command + * command */ ctx->voccxredo = 1; - - /* + + /* * return an error to indicate the current command - * has been aborted + * has been aborted */ return 1; } @@ -1830,7 +1830,7 @@ startover: * count the unknown word in the context when we return * (do so only locally for now, since we may encounter * more unknown words before we return, in which case we - * want to know that this is still the first pass). + * want to know that this is still the first pass). */ ++unknown_count; } @@ -1843,7 +1843,7 @@ startover: size_t i; //char *p; int cnt; - + (void)tioshow(ctx->voccxtio); sprintf(buf, "... %s (", cmd[cur]); p = buf + strlen(buf); @@ -1864,14 +1864,14 @@ startover: *p = '\0'; tioputs(ctx->voccxtio, buf); } - + types[cur] = t; /* record type of this word */ } /* if we found any unknown words, note this in our context */ ctx->voccxunknown = unknown_count; ctx->voccxlastunk = unknown_count; - + /* successful acquisition of types */ return 0; } @@ -1901,7 +1901,7 @@ static int vocisect(objnum *list1, objnum *list2) /* * Intersect lists, including parallel flags lists. The flags from the - * two lists for any matching object are OR'd together. + * two lists for any matching object are OR'd together. */ static int vocisect_flags(objnum *list1, uint *flags1, objnum *list2, uint *flags2) @@ -1958,10 +1958,10 @@ static int vocgol(voccxdef *ctx, objnum *list, uint *flags, char **wrdlst, * as either a noun/plural or an adjective, we will treat it as a * noun/plural if it is the last word in the name or the last word * before "of", otherwise as an adjective. - * + * * If the word is unknown, treat it as a noun or adjective - treat * it as part of the current noun phrase. One unknown word renders - * the whole noun phrase unknown. + * the whole noun phrase unknown. */ try_plural = (typ & VOCT_PLURAL); @@ -1980,25 +1980,25 @@ static int vocgol(voccxdef *ctx, objnum *list, uint *flags, char **wrdlst, /* * This can be either an adjective or a plural/noun. If this is * the last word in the noun phrase, treat it as a noun/plural if - * possible. Otherwise, treat it as an adjective. + * possible. Otherwise, treat it as an adjective. */ if (cur + 1 == last || cur == ofword - 1) { - /* + /* * This is the last word in the entire phrase, or the last word * before an 'of' (which makes it the last word of its * subphrase). Treat it as a noun if possible, otherwise as a - * plural + * plural */ wrdtyp = ((typ & VOCT_NOUN) ? PRP_NOUN : PRP_PLURAL); - /* + /* * If this can be an adjective, too, make a note to come back * and try it again as an adjective. We prefer not to end a * noun phrase with an adjective, but we allow it, since it's * often convenient to abbreviate a noun phrase to just the * adjectives (as in TAKE RED, where there's only one object - * nearby to which RED applies). + * nearby to which RED applies). */ if ((typ & VOCT_ADJ) != 0) try_endadj = TRUE; @@ -2010,16 +2010,16 @@ static int vocgol(voccxdef *ctx, objnum *list, uint *flags, char **wrdlst, * This is the second-to-last word, and the last word is * numeric. In this case, try this word as BOTH a noun and an * adjective. Try it as an adjective first, but make a note to - * go back and try it again as a noun. + * go back and try it again as a noun. */ wrdtyp = PRP_ADJ; try_noun_before_num = TRUE; } else { - /* + /* * This isn't the last word, so it can only be an adjective. - * Look at it only as an adjective. + * Look at it only as an adjective. */ wrdtyp = PRP_ADJ; } @@ -2033,9 +2033,9 @@ static int vocgol(voccxdef *ctx, objnum *list, uint *flags, char **wrdlst, /* it's just an adjective */ wrdtyp = PRP_ADJ; - /* + /* * if this is the last word in the phrase, flag it as an ending - * adjective + * adjective */ if (cur + 1 == last || cur == ofword - 1) trying_endadj = TRUE; @@ -2084,9 +2084,9 @@ add_words: if (wrdtyp == PRP_ADJ && trying_endadj) flags[cnt] |= VOCS_ENDADJ; - /* + /* * if this is not an exact match for the word, but is merely a - * long-enough leading substring, flag it as truncated + * long-enough leading substring, flag it as truncated */ if (len < search_ctx.v->voclen) flags[cnt] |= VOCS_TRUNC; @@ -2094,9 +2094,9 @@ add_words: /* count the additional word in the list */ ++cnt; - /* + /* * if this object is already in the list with the same flags, - * don't add it again + * don't add it again */ for (i = 0 ; i < cnt - 1 ; ++i) { @@ -2123,7 +2123,7 @@ add_words: /* * if we want to go back and try the word again as a noun before a - * number (as in "button 5"), do so now + * number (as in "button 5"), do so now */ if (try_noun_before_num && wrdtyp == PRP_ADJ) { @@ -2139,7 +2139,7 @@ add_words: /* * if we're interpreting the word as a noun, and the word can be a - * plural, add in the plural interpretation as well + * plural, add in the plural interpretation as well */ if (try_plural && wrdtyp != PRP_PLURAL) { @@ -2153,9 +2153,9 @@ add_words: goto add_words; } - /* + /* * if this was the last word in the phrase, and it could have been - * an adjective, try it again as an adjective + * an adjective, try it again as an adjective */ if (try_endadj && wrdtyp != PRP_ADJ) { @@ -2176,7 +2176,7 @@ add_words: * If we're interpreting the word as an adjective, and it's * numeric, include objects with "#" in their adjective list -- * these objects allow arbitrary numbers as adjectives. Don't do - * this if there's only the one word. + * this if there's only the one word. */ if (vocisdigit(wrd[0]) && wrdtyp == PRP_ADJ && first + 1 != last) { @@ -2191,7 +2191,7 @@ add_words: /* * Add the user-defined word for "of" to a buffer. If no such word is - * defined by the user (with the specialWords construct), add "of". + * defined by the user (with the specialWords construct), add "of". */ static void vocaddof(voccxdef *ctx, char *buf) { @@ -2210,11 +2210,11 @@ static void vocaddof(voccxdef *ctx, char *buf) /* * Call the parseNounPhrase user function, if defined, to attempt to * parse a noun phrase. - * + * * Returns VOC_PNP_ERROR if the hook function indicates that an error * occurred; PNP_DEFAULT if the hook function told us to use the default * list; or PNP_SUCCESS to indicate that the hook function provided a - * list to use. + * list to use. */ static int voc_pnp_hook(voccxdef *ctx, char *cmd[], int typelist[], int cur, int *next, int complain, @@ -2267,7 +2267,7 @@ static int voc_pnp_hook(voccxdef *ctx, char *cmd[], int typelist[], { uchar *lstp; uint lstsiz; - + /* pop the list */ lstp = runpoplst(rcx); @@ -2282,11 +2282,11 @@ static int voc_pnp_hook(voccxdef *ctx, char *cmd[], int typelist[], /* set the 'next' pointer, adjusting to 0-based indexing */ *next = osrp4(lstp+1) - 1; - /* + /* * If 'next' is out of range, force it into range. We can't * go backwards (so 'next' must always be at least 'cur'), * and we can't go past the null element at the end of the - * list. + * list. */ if (*next < cur) *next = cur; @@ -2308,7 +2308,7 @@ static int voc_pnp_hook(voccxdef *ctx, char *cmd[], int typelist[], /* make sure we have room for another entry */ if (outcnt >= VOCMAXAMBIG - 1) break; - + /* get the next list entry, and store it in the output array */ if (*lstp == DAT_NIL) { @@ -2338,7 +2338,7 @@ static int voc_pnp_hook(voccxdef *ctx, char *cmd[], int typelist[], { /* set the flags */ outp->vocolflg = (int)osrp4(lstp+1); - + /* skip the number */ lstadv(&lstp, &lstsiz); } @@ -2364,9 +2364,9 @@ static int voc_pnp_hook(voccxdef *ctx, char *cmd[], int typelist[], /* set the output count */ *out_nouncount = outcnt; - /* + /* * set "no_match" appropriately -- set "no_match" true if we're - * returning an empty list and we parsed one or more words + * returning an empty list and we parsed one or more words */ if (no_match != 0) *no_match = (outcnt == 0 && *next > cur); @@ -2378,7 +2378,7 @@ static int voc_pnp_hook(voccxdef *ctx, char *cmd[], int typelist[], * these have now been dealt with. If the return list contains * any objects flagged as having unknown words, add the count of * such objects back into the context, since we must still - * resolve these at disambiguation time. + * resolve these at disambiguation time. */ for (i = cur ; i < *next ; ++i) { @@ -2398,9 +2398,9 @@ static int voc_pnp_hook(voccxdef *ctx, char *cmd[], int typelist[], } else { - /* + /* * ignore any other return value - consider others equivalent to - * DEFAULT + * DEFAULT */ rundisc(rcx); return VOC_PNP_DEFAULT; @@ -2409,13 +2409,13 @@ static int voc_pnp_hook(voccxdef *ctx, char *cmd[], int typelist[], /* ------------------------------------------------------------------------ */ /* - * Build an object name from the words in a command + * Build an object name from the words in a command */ void voc_make_obj_name(voccxdef *ctx, char *namebuf, char *cmd[], int firstwrd, int lastwrd) { int i; - + /* run through the range of words, and add them to the buffer */ for (i = firstwrd, namebuf[0] = '\0' ; i < lastwrd ; ++i) { @@ -2423,7 +2423,7 @@ void voc_make_obj_name(voccxdef *ctx, char *namebuf, char *cmd[], vocaddof(ctx, namebuf); else strcat(namebuf, cmd[i]); - + if (cmd[i][strlen(cmd[i])-1] == '.' && i + 1 < lastwrd) strcat(namebuf, "\\"); @@ -2433,13 +2433,13 @@ void voc_make_obj_name(voccxdef *ctx, char *namebuf, char *cmd[], } /* - * Make an object name from a list entry + * Make an object name from a list entry */ void voc_make_obj_name_from_list(voccxdef *ctx, char *namebuf, char *cmd[], const char *firstwrd, const char *lastwrd) { int i, i1, i2; - + /* find the cmd indices */ for (i = i1 = i2 = 0 ; cmd[i] != 0 && *cmd[i] != 0 ; ++i) { @@ -2466,13 +2466,13 @@ void voc_make_obj_name_from_list(voccxdef *ctx, char *namebuf, * Note that plurals are treated basically like nouns, except that we * will flag them so that the disambiguator knows to include all objects * that work with the plural. - * + * * Note that we also allow the special constructs "all [of] * " and "both [of] "; these are treated * identically to normal plurals. - * + * * If no_match is not null, we'll set it to true if we found valid - * syntax but no matching objects, false otherwise. + * syntax but no matching objects, false otherwise. */ static int vocg1o(voccxdef *ctx, char *cmd[], int typelist[], int cur, int *next, int complain, vocoldef *nounlist, @@ -2542,7 +2542,7 @@ static int vocg1o(voccxdef *ctx, char *cmd[], int typelist[], { /* can't use a quoted string as an actor */ if (chkact) { VOC_RETVAL(ctx, save_sp, 0); } - + if (ctx->voccxflg & VOCCXFDBG) tioputs(ctx->vocxtio, "... found quoted string\\n"); @@ -2582,7 +2582,7 @@ static int vocg1o(voccxdef *ctx, char *cmd[], int typelist[], { const char *p; int ver; - + if (vocspec(cmd[cur], VOCW_ALL)) { ver = VOCERR(4); @@ -2633,7 +2633,7 @@ static int vocg1o(voccxdef *ctx, char *cmd[], int typelist[], * if either we don't have an OF (ANY NOUN is okay even without * a plural), or if we have OF and a plural. (More simply put, * accept the ALL or ANY if the last word is a plural, or if we - * have ANY but not OF). + * have ANY but not OF). */ if (n > cur && ((typelist[n-1] & VOCT_PLURAL) || (has_any && !has_of))) @@ -2645,7 +2645,7 @@ static int vocg1o(voccxdef *ctx, char *cmd[], int typelist[], cur = nxt; } } - + if (vocspec(cmd[cur], VOCW_ALL) && !has_any) { /* can't use ALL as an actor */ @@ -2653,7 +2653,7 @@ static int vocg1o(voccxdef *ctx, char *cmd[], int typelist[], { VOC_RETVAL(ctx, save_sp, 0); } - + if (ctx->voccxflg & VOCCXFDBG) tioputs(ctx->vocxtio, "... found ALL\\n"); @@ -2677,17 +2677,17 @@ static int vocg1o(voccxdef *ctx, char *cmd[], int typelist[], VOC_MAX_ARRAY(ctx, vocoldef, xlist); cur++; - cnt = vocgobj(ctx, cmd, typelist, cur, next, complain, xlist, 1, + cnt = vocgobj(ctx, cmd, typelist, cur, next, complain, xlist, 1, chkact, 0); if (cnt < 0) { - /* + /* * An error occurred - return it. Note that, since * we're returning from the entire function, we're * popping the save_sp frame, NOT the inner_save_sp * frame -- the inner frame is nested within the save_sp * frame, and we want to pop the entire way out since - * we're exiting the entire function. + * we're exiting the entire function. */ VOC_RETVAL(ctx, save_sp, cnt); } @@ -2706,7 +2706,7 @@ static int vocg1o(voccxdef *ctx, char *cmd[], int typelist[], nounlist[outcnt].vocolflg = 0; VOC_RETVAL(ctx, save_sp, outcnt); } - + switch(*cmd[cur]) { case VOCW_IT: @@ -2767,7 +2767,7 @@ static int vocg1o(voccxdef *ctx, char *cmd[], int typelist[], ++cur; else if (typelist[cur] & VOCT_UNKNOWN) { - /* + /* * Remember that we found an unknown word, but include it in * the noun phrase - this will render the entire noun phrase * unknown, but we'll resolve that later. @@ -2807,9 +2807,9 @@ static int vocg1o(voccxdef *ctx, char *cmd[], int typelist[], } try_again: - /* + /* * build a printable string consisting of the words in the noun - * phrase, for displaying error messages + * phrase, for displaying error messages */ voc_make_obj_name(ctx, namebuf, cmd, firstwrd, cur); @@ -2820,7 +2820,7 @@ try_again: * If we have any unknown words, we won't be able to match any * objects for the noun phrase. Return with one entry in the list, * but use an invalid object and mark the object as containing - * unknown words. + * unknown words. */ if (unknown_count > 0) { @@ -2829,7 +2829,7 @@ try_again: * communicate the number of unknown words that we found to the * disambiguator, which will later attempt to resolve the * reference. Each object we add is the same; they're here only - * for the word count. + * for the word count. */ for ( ; unknown_count > 0 ; --unknown_count) { @@ -2851,7 +2851,7 @@ try_again: /* * Allow retrying with a count plus a plural if the first word is a * number, and we have something plural in the list. Only treat "1" - * this way if more words follow in the noun phrase. + * this way if more words follow in the noun phrase. */ retry_with_count = ((vocisdigit(*cmd[firstwrd]) && found_plural) || (vocisdigit(*cmd[firstwrd]) @@ -2889,10 +2889,10 @@ try_again: } else { - /* + /* * display a message if we didn't already (if vocgol * returned less than zero, it already displayed its own - * error message) + * error message) */ if (l1 == 0) vocerr(ctx, VOCERR(9), "I don't see any %s here.", namebuf); @@ -2906,7 +2906,7 @@ retry_exclude_first: for (i = firstwrd + 1 ; i < cur ; ++i) { int l2; - + if (voc_check_special(ctx, cmd[i], VOCW_OF) || (typelist[i] & VOCT_ARTICLE)) continue; @@ -2927,7 +2927,7 @@ retry_exclude_first: * list didn't have anything in it, it must mean that the word * list started with a number, in which case we're trying to * interpret this as a count plus a plural. So, don't intersect - * the list if there was nothing in the first list. + * the list if there was nothing in the first list. */ if (l1 == 0) { @@ -2935,7 +2935,7 @@ retry_exclude_first: l1 = l2; memcpy(list1, list2, (size_t)((l1+1) * sizeof(list1[0]))); memcpy(flags1, flags2, (size_t)(l1 * sizeof(flags1[0]))); - } + } else { /* intersect the two lists */ @@ -2944,7 +2944,7 @@ retry_exclude_first: /* * If there's nothing in the list, it means that there's no - * object that defines all of these words. + * object that defines all of these words. */ if (l1 == 0) { @@ -2963,9 +2963,9 @@ retry_exclude_first: tioputs(ctx->vocxtio, "... dropping the part after OF and retrying\\n"); - /* + /* * drop the part from 'of' on - scan only from firstwrd - * to the word before 'of' + * to the word before 'of' */ hypothetical_last = cur; trim_flags |= VOCS_TRIMPREP; @@ -2980,7 +2980,7 @@ retry_exclude_first: /* * Try again with the count + plural interpretation, if - * possible + * possible */ if (retry_with_count) { @@ -2999,7 +2999,7 @@ retry_exclude_first: /* * If one of the words will work as a preposition, and we * took it as an adjective, go back and try the word again - * as a preposition. + * as a preposition. */ for (i = cur - 1; i > firstwrd ; --i) { @@ -3019,9 +3019,9 @@ retry_exclude_first: /* if just checking actor, don't display an error */ if (chkact) { VOC_RETVAL(ctx, save_sp, 0); } - /* + /* * tell the player about it unless supressing complaints, - * and return an error + * and return an error */ if (complain) vocerr(ctx, VOCERR(9), "I don't see any %s here.", namebuf); @@ -3097,9 +3097,9 @@ retry_exclude_first: * we should allow multiple lists). We use vocg1o() to read noun lists * one at a time, and keep going (if "multi" is true) as long as there * are more "and " clauses. - * + * * If no_match is not null, we'll set it to true if the syntax was okay - * but we didn't find any match for the list of words, false otherwise. + * but we didn't find any match for the list of words, false otherwise. */ int vocgobj(voccxdef *ctx, char *cmd[], int typelist[], int cur, int *next, int complain, vocoldef *nounlist, @@ -3151,10 +3151,10 @@ int vocgobj(voccxdef *ctx, char *cmd[], int typelist[], break; } - /* + /* * if the caller only wanted a single object (or is getting an * actor, in which case they implicitly want only a single - * object), stop looking for additional noun phrases + * object), stop looking for additional noun phrases */ if (!multi || chkact) break; @@ -3162,9 +3162,9 @@ int vocgobj(voccxdef *ctx, char *cmd[], int typelist[], /* skip past the previous noun phrase */ cur = *next; - /* + /* * if we're looking at a noun phrase separator ("and" or a - * comma), get the next noun phrase; otherwise, we're done + * comma), get the next noun phrase; otherwise, we're done */ if (cur != -1 && cmd[cur] != 0 && vocspec(cmd[cur], VOCW_AND)) { @@ -3190,7 +3190,7 @@ int vocgobj(voccxdef *ctx, char *cmd[], int typelist[], /* ------------------------------------------------------------------------ */ /* * TADS program code interface - tokenize a string. Returns a list of - * strings, with each string giving a token in the command. + * strings, with each string giving a token in the command. */ void voc_parse_tok(voccxdef *ctx) { @@ -3213,12 +3213,12 @@ void voc_parse_tok(voccxdef *ctx) len = osrp2(p) - 2; p += 2; - /* + /* * Allocate space for the original string, and space for the token * pointers and the tokenized string buffer. We could potentially * have one token per character in the original string, and we could * potentially need one extra null terminator for each character in - * the original string; allocate accordingly. + * the original string; allocate accordingly. */ VOC_STK_ARRAY(ctx, char, inbuf, len + 1); VOC_STK_ARRAY(ctx, char, outbuf, len*2); @@ -3252,7 +3252,7 @@ void voc_parse_tok(voccxdef *ctx) * TADS program code interface - get the list of types for a list words. * The words are simply strings of the type returned from the tokenizer. * The return value is a list of types, with each entry in the return - * list giving the types of the corresponding entry in the word list. + * list giving the types of the corresponding entry in the word list. */ void voc_parse_types(voccxdef *ctx) { @@ -3332,7 +3332,7 @@ void voc_parse_types(voccxdef *ctx) * parser, and returns a list of matching objects. The object list is * not disambiguated, but merely reflects all matching objects. The * entire standard parsing algorithm applies, including parseNounPhrase - * invocation if appropriate. + * invocation if appropriate. */ void voc_parse_np(voccxdef *ctx) { @@ -3365,10 +3365,10 @@ void voc_parse_np(voccxdef *ctx) voc_enter(ctx, &save_sp); VOC_MAX_ARRAY(ctx, vocoldef, objlist); - /* + /* * Save the original context unknown values, since we don't want to * affect the context information in this game-initiated call, then - * clear the unknown word count for the duration of the call. + * clear the unknown word count for the duration of the call. */ old_unknown = ctx->voccxunknown; old_lastunk = ctx->voccxlastunk; @@ -3400,9 +3400,9 @@ void voc_parse_np(voccxdef *ctx) /* count the word */ ++wordcnt; - /* + /* * count the space needed for the word - count the bytes of the - * string plus a null terminator + * string plus a null terminator */ if (*lstp == DAT_SSTRING) wordcharsiz += osrp2(lstp+1) + 1; @@ -3421,7 +3421,7 @@ void voc_parse_np(voccxdef *ctx) if (*lstp == DAT_SSTRING) { uint len; - + /* add this entry to the word array */ wordarr[i] = p; @@ -3472,17 +3472,17 @@ void voc_parse_np(voccxdef *ctx) } else if (cnt == 0) { - /* + /* * No objects found. Return a list consisting only of the next * index. If the next index is equal to the starting index, * this will tell the caller that no noun phrase is * syntactically present; otherwise, it will tell the caller * that a noun phrase is present but there are no matching * objects. - * + * * Note that we must increment the returned element index to * conform with the 1-based index values that the game function - * uses. + * uses. */ ++next; voc_push_numlist(ctx, (uint *)&next, 1); @@ -3499,25 +3499,25 @@ void voc_parse_np(voccxdef *ctx) * last word of its noun phrase, and then the objects. For each * object, there is a pair of entries: the object itself, and * the flags for the object. - * + * * First, figure out how much space we need by scanning the - * return list. + * return list. */ for (lstsiz = 0, i = 0 ; i < cnt ; ) { int j; - /* + /* * count the entries in this sublist by looking for the next - * entry whose starting word is different + * entry whose starting word is different */ for (j = i ; j < cnt && objlist[j].vocolfst == objlist[i].vocolfst ; ++j) { - /* + /* * for this entry, we need space for the object (1 + 2 - * for an object, or just 1 for nil) and flags (1 + 4) + * for an object, or just 1 for nil) and flags (1 + 4) */ if (objlist[j].vocolobj == MCMONINV) lstsiz += 1; @@ -3526,12 +3526,12 @@ void voc_parse_np(voccxdef *ctx) lstsiz += 5; } - /* + /* * For this sublist, we need space for the first index (type * prefix + number = 1 + 4 = 5) and the last index (5). * We've already counted space for the objects in the list. * Finally, we need space for the list type and length - * prefixes (1 + 2) for the sublist itself. + * prefixes (1 + 2) for the sublist itself. */ lstsiz += (5 + 5) + 3; @@ -3539,7 +3539,7 @@ void voc_parse_np(voccxdef *ctx) i = j; } - /* + /* * finally, we need space for the first element of the list, * which is the index of the next word to be parsed (1+4) */ @@ -3548,9 +3548,9 @@ void voc_parse_np(voccxdef *ctx) /* allocate space for the list */ lstp = voc_push_list_siz(ctx, lstsiz); - /* + /* * store the first element - the index of the next word to parse - * (adjusting to 1-based indexing) + * (adjusting to 1-based indexing) */ *lstp++ = DAT_NUMBER; oswp4s(lstp, next + 1); @@ -3567,9 +3567,9 @@ void voc_parse_np(voccxdef *ctx) /* store the list type prefix */ *lstp++ = DAT_LIST; - /* + /* * remember where the length prefix is, then skip it - we'll - * come back and fill it in when we're done with the sublist + * come back and fill it in when we're done with the sublist */ sublstp = lstp; lstp += 2; @@ -3587,10 +3587,10 @@ void voc_parse_np(voccxdef *ctx) /* remember the index */ lastidx = j; - /* + /* * we can stop looking now, since the words are * always in order (so the first index will never be - * after the last index) + * after the last index) */ break; } @@ -3605,7 +3605,7 @@ void voc_parse_np(voccxdef *ctx) lstp += 4; /* add the objects */ - for (j = i ; + for (j = i ; j < cnt && objlist[j].vocolfst == objlist[i].vocolfst ; ++j) { @@ -3645,7 +3645,7 @@ void voc_parse_np(voccxdef *ctx) /* ------------------------------------------------------------------------ */ /* * TADS program code interface - given a list of words and a list of - * their types, produce a list of objects that match all of the words. + * their types, produce a list of objects that match all of the words. */ void voc_parse_dict_lookup(voccxdef *ctx) { @@ -3664,7 +3664,7 @@ void voc_parse_dict_lookup(voccxdef *ctx) voc_enter(ctx, &save_sp); VOC_MAX_ARRAY(ctx, objnum, list1); VOC_MAX_ARRAY(ctx, objnum, list2); - + /* get the word list, and read and skip its size prefix */ wrdp = runpoplst(rcx); wrdsiz = osrp2(wrdp) - 2; @@ -3691,7 +3691,7 @@ void voc_parse_dict_lookup(voccxdef *ctx) char *p; uint len; vocseadef search_ctx; - + /* if this entry is a string, consider it */ if (*wrdp == DAT_SSTRING) { @@ -3721,9 +3721,9 @@ void voc_parse_dict_lookup(voccxdef *ctx) /* presume we won't find a valid type property */ type_prop = PRP_INVALID; - /* + /* * get this type entry, if there's another entry in the - * list, and it's of the appropriate type + * list, and it's of the appropriate type */ if (typsiz > 0 && *typp == DAT_NUMBER) { @@ -3732,7 +3732,7 @@ void voc_parse_dict_lookup(voccxdef *ctx) * consider only one meaning for each word, and we'll * arbitrarily pick one if the type code has more than * one type, because we expect the caller to provide - * exactly one type per word. + * exactly one type per word. */ int i; struct typemap_t @@ -3778,7 +3778,7 @@ void voc_parse_dict_lookup(voccxdef *ctx) v = vocfnw(ctx, &search_ctx)) { int i; - + /* make sure we have room in our list */ if (cnt2 >= VOCMAXAMBIG - 1) break; @@ -3802,9 +3802,9 @@ void voc_parse_dict_lookup(voccxdef *ctx) /* terminate the list */ list2[cnt2] = MCMONINV; - /* + /* * if there's nothing in the first list, simply copy this - * into the first list; otherwise, intersect the two lists + * into the first list; otherwise, intersect the two lists */ if (cnt1 == 0) { @@ -3818,15 +3818,15 @@ void voc_parse_dict_lookup(voccxdef *ctx) cnt1 = vocisect(list1, list2); } - /* + /* * if there's nothing in the result list now, there's no * need to look any further, because further intersection - * will yield nothing + * will yield nothing */ if (cnt1 == 0) break; } - + /* advance the word list */ lstadv(&wrdp, &wrdsiz); @@ -3846,7 +3846,7 @@ void voc_parse_dict_lookup(voccxdef *ctx) /* * TADS program code interface - disambiguate a noun list. We take the * kind of complex object list returned by voc_parse_np(), and produce a - * fully-resolved list of objects. + * fully-resolved list of objects. */ void voc_parse_disambig(voccxdef *ctx) { @@ -3891,9 +3891,9 @@ void voc_parse_disambig(voccxdef *ctx) prep = runpopobjnil(rcx); otherobj = runpopobjnil(rcx); - /* + /* * get the usage parameter, and use it to select the appropriate - * defprop and accprop + * defprop and accprop */ switch(runpopnum(rcx)) { @@ -3913,7 +3913,7 @@ void voc_parse_disambig(voccxdef *ctx) accprop = PRP_VALIDACTOR; break; } - + /* get the verprop argument */ verprop = runpopprp(rcx); @@ -3950,7 +3950,7 @@ void voc_parse_disambig(voccxdef *ctx) if (*lstp == DAT_SSTRING) { uint len; - + /* store a pointer to the word in the command buffer */ cmd[i++] = p; @@ -3972,14 +3972,14 @@ void voc_parse_disambig(voccxdef *ctx) * returned by voc_parse_np(), but the leading index number is * optional. We don't need the leading index for anything, so if * it's there, simply skip it so that we can start with the first - * sublist. + * sublist. */ if (objsiz > 0 && *objp == DAT_NUMBER) lstadv(&objp, &objsiz); /* * Count the objects in the object list, so that we can figure out - * how much we need to allocate for the input object list. + * how much we need to allocate for the input object list. */ for (lstp = objp, lstsiz = objsiz, objcnt = 0 ; lstsiz != 0 ; lstadv(&lstp, &lstsiz)) @@ -4034,9 +4034,9 @@ void voc_parse_disambig(voccxdef *ctx) firstwrd = 0; lastwrd = 0; - /* + /* * the first two elements of the list are the token indices - * of the first and last words of this object's noun phrase + * of the first and last words of this object's noun phrase */ if (subsiz > 0 && *subp == DAT_NUMBER) { @@ -4121,9 +4121,9 @@ void voc_parse_disambig(voccxdef *ctx) inlist[i].vocolobj = MCMONINV; inlist[i].vocolflg = 0; - /* + /* * make a copy of our context, so the disambiguation can't make any - * global changes + * global changes */ memcpy(&ctx_copy, ctx, sizeof(ctx_copy)); @@ -4131,7 +4131,7 @@ void voc_parse_disambig(voccxdef *ctx) * Count the unknown words and set the count in the context. This * will allow us to determine after we call the resolver whether the * resolution process cleared up the unknown words (via - * parseUnknownDobj/Iobj). + * parseUnknownDobj/Iobj). */ ctx_copy.voccxunknown = ctx_copy.voccxlastunk = unknown_count; @@ -4147,7 +4147,7 @@ void voc_parse_disambig(voccxdef *ctx) * chance to use "oops" to correct the problem. If we're in silent * mode, don't display an error and don't allow interactive * correction via "oops." - * + * * It is possible that the unknown word is not in the input list, * but in the user's response to an interactive disambiguation * query. This is why we must check to see if the unknown word is @@ -4159,23 +4159,23 @@ void voc_parse_disambig(voccxdef *ctx) int unk_idx = 0; char *rpl_text; - /* + /* * forget we have unknown words, since we're going to handle * them now */ ctx_copy.voccxunknown = 0; - /* + /* * find the unknown word - look up each word until we find one - * that's not in the dictionary + * that's not in the dictionary */ for (i = 0, unk = 0 ; cmd[i] != 0 ; ++i) { int t; - - /* + + /* * get this word's type - if the word has no type, it's an - * unknown word + * unknown word */ t = voc_lookup_type(ctx, cmd[i], strlen(cmd[i]), TRUE); if (t == 0) @@ -4187,9 +4187,9 @@ void voc_parse_disambig(voccxdef *ctx) } } - /* + /* * if we didn't find any unknown words, assume the first word - * was unknown + * was unknown */ if (unk == 0) { @@ -4200,15 +4200,15 @@ void voc_parse_disambig(voccxdef *ctx) /* display an error, and read a new command */ rpl_text = voc_read_oops(&ctx_copy, oopsbuf, VOCBUFSIZ, unk); - /* + /* * if they didn't respond with "oops," treat the response as a - * brand new command to replace the current command + * brand new command to replace the current command */ if (rpl_text == 0) { - /* + /* * it's a replacement command - set the redo flag to - * indicate that we should process the replacement command + * indicate that we should process the replacement command */ ctx_copy.voccxredo = TRUE; @@ -4220,16 +4220,16 @@ void voc_parse_disambig(voccxdef *ctx) /* indicate the correction via the result code */ err = VOCERR(45); - /* + /* * Build the new command string. The new command string * consists of all of the tokens up to the unknown token, * then the replacement text, then all of the remaining - * tokens. + * tokens. */ for (p = cmdbuf, i = 0 ; cmd[i] != 0 ; ++i) { size_t needed; - + /* figure the size needs for this token */ if (i == unk_idx) { @@ -4241,10 +4241,10 @@ void voc_parse_disambig(voccxdef *ctx) /* we need to insert this token string */ needed = strlen(cmd[i]); } - - /* + + /* * if more tokens follow, we need a space after the - * replacement text to separate it from what follows + * replacement text to separate it from what follows */ if (cmd[i+1] != 0 && needed != 0) needed += 1; @@ -4256,7 +4256,7 @@ void voc_parse_disambig(voccxdef *ctx) if (needed > (size_t)(VOCBUFSIZ - (p - cmdbuf))) break; - /* + /* * if we've reached the unknown token, insert the * replacement text; otherwise, insert this token */ @@ -4269,15 +4269,15 @@ void voc_parse_disambig(voccxdef *ctx) { char *p1; char qu; - - /* + + /* * Scan the quoted string for embedded double quotes * - if it has any, use single quotes as the * delimiter; otherwise, use double quotes as the * delimiter. Note that we ignore the first and * last characters in the string, since these are * always the delimiting double quotes in the - * original token text. + * original token text. */ for (qu = '"', p1 = cmd[i] + 1 ; *p1 != '\0' && *(p1 + 1) != '\0' ; ++p1) @@ -4296,9 +4296,9 @@ void voc_parse_disambig(voccxdef *ctx) /* add the open quote */ *p++ = qu; - /* + /* * add the text, leaving out the first and last - * characters (which are the original quotes) + * characters (which are the original quotes) */ if (strlen(cmd[i]) > 2) { @@ -4331,9 +4331,9 @@ void voc_parse_disambig(voccxdef *ctx) } } - /* + /* * Count the objects. An object list is returned only on success or - * VOCERR(44), which indicates that the list is still ambiguous. + * VOCERR(44), which indicates that the list is still ambiguous. */ if (err == 0 || err == VOCERR(44)) { @@ -4349,23 +4349,23 @@ void voc_parse_disambig(voccxdef *ctx) /* figure out how much space we need for the objects */ lstsiz = (1+2) * objcnt; - + /* add space for the first element, which contains the status code */ lstsiz += (1 + 4); /* if there's a new command string, we'll store it, so make room */ if (ctx_copy.voccxredo || err == VOCERR(45)) { - /* + /* * add space for the type prefix (1), length prefix (2), and the - * string bytes (with no null terminator, of course) + * string bytes (with no null terminator, of course) */ lstsiz += (1 + 2 + strlen(cmdbuf)); - /* + /* * if we're retrying due to the redo flag, always return the * RETRY error code, regardless of what caused us to retry the - * command + * command */ if (ctx_copy.voccxredo) err = VOCERR(43); @@ -4394,7 +4394,7 @@ void voc_parse_disambig(voccxdef *ctx) else if (ctx_copy.voccxredo || err == VOCERR(45)) { uint len; - + /* there's a new command - return it as the second element */ *lstp++ = DAT_SSTRING; @@ -4415,7 +4415,7 @@ void voc_parse_disambig(voccxdef *ctx) /* ------------------------------------------------------------------------ */ /* * TADS program code interface - replace the current command line with a - * new string, aborting the current command. + * new string, aborting the current command. */ void voc_parse_replace_cmd(voccxdef *ctx) { @@ -4469,7 +4469,7 @@ static objnum vocgetactor(voccxdef *ctx, char *cmd[], int typelist[], voc_enter(ctx, &save_sp); VOC_MAX_ARRAY(ctx, vocoldef, nounlist); VOC_MAX_ARRAY(ctx, vocoldef, actlist); - + *next = cur; /* assume no error will occur */ cnt = vocchknoun(ctx, cmd, typelist, cur, next, nounlist, TRUE); if (cnt > 0 && *next != -1 && cmd[*next] && vocspec(cmd[*next], VOCW_AND)) @@ -4478,18 +4478,18 @@ static objnum vocgetactor(voccxdef *ctx, char *cmd[], int typelist[], /* make a note as to whether the list contains an unknown word */ have_unknown = ((nounlist[0].vocolflg & VOCS_UNKNOWN) != 0); - + /* * If validActor is defined for any of the actors, use it; * otherwise, for compatibility with past versions, use the * takeVerb disambiguation mechanism. If we have a pronoun, we * can't decide yet how to do this, so presume that we'll use * the new mechanism and switch later if necessary. - * + * * If we have don't have a valid object (which will be the case * for a pronoun), we can't decide until we get into the * disambiguation process, so presume we'll use validActor for - * now. + * now. */ verprop = PRP_VERACTOR; if (nounlist[0].vocolobj == MCMONINV @@ -4498,16 +4498,16 @@ static objnum vocgetactor(voccxdef *ctx, char *cmd[], int typelist[], valprop = PRP_VALIDACTOR; else valprop = PRP_VALIDDO; - + /* disambiguate it using the selected properties */ if (vocdisambig(ctx, actlist, nounlist, PRP_DODEFAULT, valprop, verprop, cmd, MCMONINV, ctx->voccxme, ctx->voccxvtk, MCMONINV, cmdbuf, FALSE)) { - /* + /* * if we have an unknown word in the list, assume for the * moment that this isn't an actor phrase after all, but a - * verb + * verb */ if (have_unknown) { @@ -4550,7 +4550,7 @@ static objnum vocgetactor(voccxdef *ctx, char *cmd[], int typelist[], int voclistlen(vocoldef *lst) { int i; - + for (i = 0 ; lst->vocolobj != MCMONINV || lst->vocolflg != 0 ; ++lst, ++i) ; return(i); @@ -4572,9 +4572,9 @@ int voclistlen(vocoldef *lst) int vocchkaccess(voccxdef *ctx, objnum obj, prpnum verprop, int seqno, objnum cmdActor, objnum cmdVerb) { - /* + /* * special case: the special "string" and "number" objects are - * always accessible + * always accessible */ if (obj == ctx->voccxstr || obj == ctx->voccxnum) return TRUE; @@ -4583,7 +4583,7 @@ int vocchkaccess(voccxdef *ctx, objnum obj, prpnum verprop, * If the access method is validActor, make sure the object in fact * has a validActor method defined; if it doesn't, we must be * running a game from before validActor's invention, so use the old - * ValidXo mechanism instead. + * ValidXo mechanism instead. */ if (verprop == PRP_VALIDACTOR) { @@ -4647,7 +4647,7 @@ static void vocout(vocoldef *outobj, objnum obj, int flg, * Generate an appropriate error message saying that the objects in the * command are visible, but can't be used with the command for some * reason. Use the cantReach method of the verb (the new way), or if - * there is no cantReach in the verb, of each object in the list. + * there is no cantReach in the verb, of each object in the list. */ void vocnoreach(voccxdef *ctx, objnum *list1, int cnt, objnum actor, objnum verb, objnum prep, prpnum defprop, @@ -4681,10 +4681,10 @@ void vocnoreach(voccxdef *ctx, objnum *list1, int cnt, /* use the old way - call obj.cantReach() for each object */ for (i = 0 ; i < cnt ; ++i) { - /* + /* * display this object's name if there's more than one, so * that the player can tell to which object this message - * applies + * applies */ voc_multi_prefix(ctx, list1[i], show_multi_prefix, multi_flags, multi_base_index + i, multi_total_count); @@ -4700,7 +4700,7 @@ void vocnoreach(voccxdef *ctx, objnum *list1, int cnt, /* * Get the specialWords string for a given special word entry. Returns - * the first string if multiple strings are defined for the entry. + * the first string if multiple strings are defined for the entry. */ static void voc_get_spec_str(voccxdef *ctx, char vocw_id, char *buf, size_t buflen, @@ -4727,9 +4727,9 @@ static void voc_get_spec_str(voccxdef *ctx, char vocw_id, /* note that we found it */ found = TRUE; - /* + /* * get the length, and limit it to the buffer size, - * leaving room for null termination + * leaving room for null termination */ len = *p++; if (len + 1 > buflen) @@ -4743,9 +4743,9 @@ static void voc_get_spec_str(voccxdef *ctx, char vocw_id, break; } - /* + /* * move on to the next one - skip the length prefix plus the - * length + * length */ p += *p + 1; } @@ -4772,7 +4772,7 @@ static int vocsetit(voccxdef *ctx, objnum obj, int accprop, /* get the display name for this specialWords entry */ voc_get_spec_str(ctx, vocw_id, nambuf, sizeof(nambuf), default_name); - + /* show the error if appropriate */ if (!silent) { @@ -4799,7 +4799,7 @@ static int vocsetit(voccxdef *ctx, objnum obj, int accprop, * Get a new numbered object, given a number. This is used for objects * that define '#' as one of their adjectives; we call the object, * asking it to create an object with a particular number. The object - * can return nil, in which case we'll reject the command. + * can return nil, in which case we'll reject the command. */ static objnum voc_new_num_obj(voccxdef *ctx, objnum objn, objnum actor, objnum verb, @@ -4849,7 +4849,7 @@ static int has_gen_num_adj(voccxdef *ctx, objnum objn) /* ------------------------------------------------------------------------ */ /* * Call the deepverb's disambigDobj or disambigIobj method to perform - * game-controlled disambiguation. + * game-controlled disambiguation. */ static int voc_disambig_hook(voccxdef *ctx, objnum verb, objnum actor, objnum prep, objnum otherobj, @@ -4866,7 +4866,7 @@ static int voc_disambig_hook(voccxdef *ctx, objnum verb, objnum actor, uint lstsiz; int ret; int i; - + /* check for actor disambiguation */ if (verprop == PRP_VERACTOR) { @@ -4949,7 +4949,7 @@ static int voc_disambig_hook(voccxdef *ctx, objnum verb, objnum actor, if (*lstp == DAT_SSTRING) { uint len; - + /* get the length, and limit it to our buffer size */ len = osrp2(lstp+1) - 2; if (len > VOCBUFSIZ - 1) @@ -4975,16 +4975,16 @@ static int voc_disambig_hook(voccxdef *ctx, objnum verb, objnum actor, objlist[i] = osrp2(lstp+1); else objlist[i] = MCMONINV; - + /* skip the list entry */ lstadv(&lstp, &lstsiz); - + /* check for flags */ if (lstsiz > 0 && *lstp == DAT_NUMBER) { /* store the flags */ flags[i] = (int)osrp4(lstp+1); - + /* skip the flags elements */ lstadv(&lstp, &lstsiz); } @@ -4998,7 +4998,7 @@ static int voc_disambig_hook(voccxdef *ctx, objnum verb, objnum actor, /* store a terminator at the end of the list */ objlist[i] = MCMONINV; flags[i] = 0; - + /* store the output count for the caller */ *objcount = i; } @@ -5030,10 +5030,10 @@ static int voc_disambig_hook(voccxdef *ctx, objnum verb, objnum actor, * Prune a list of matches by keeping only the matches without the given * flag value, if we have a mix of entries with and without the flag. * This is a service routine for voc_prune_matches. - * + * * The flag indicates a lower quality of matching, so this routine can * be used to reduce ambiguity by keeping only the best-quality matches - * when matches of mixed quality are present. + * when matches of mixed quality are present. */ static int voc_remove_objs_with_flag(voccxdef *ctx, objnum *list, uint *flags, int cnt, @@ -5055,26 +5055,26 @@ static int voc_remove_objs_with_flag(voccxdef *ctx, ++special_cnt; } - /* + /* * If all of the objects didn't have the flag, omit the ones that * did, so that we reduce the ambiguity to those without the flag. * Don't include the special objects (numObj and strObj) in the - * count, since they will never have any of these flags set. + * count, since they will never have any of these flags set. */ if (flag_cnt != 0 && flag_cnt < cnt - special_cnt) { int dst; - /* + /* * Remove the flagged objects. Note that we can make this * adjustment to the arrays in place, because they can only - * shrink - there's no need to make an extra temporary copy. + * shrink - there's no need to make an extra temporary copy. */ for (i = 0, dst = 0 ; i < cnt ; ++i) { - /* + /* * If this one doesn't have the flag, keep it. Always keep - * the special objects (numObj and strObj). + * the special objects (numObj and strObj). */ if ((flags[i] & flag_to_remove) == 0 || list[i] == ctx->voccxnum @@ -5101,17 +5101,17 @@ static int voc_remove_objs_with_flag(voccxdef *ctx, /* * Prune a list of matches by keeping only the best matches when matches * of different qualities are present. - * + * * If we have a mix of objects matching noun phrases that end in * adjectives and phrases ending in nouns with the same words, remove * those elements that end in adjectives, keeping only the better * matches that end in nouns. - * + * * If we have a mix of objects where the words match exactly, and others * where the words are only leading substrings of longer dictionary * words, keep only the exact matches. - * - * Returns the number of elements in the result list. + * + * Returns the number of elements in the result list. */ static int voc_prune_matches(voccxdef *ctx, objnum *list, uint *flags, int cnt) @@ -5129,43 +5129,43 @@ static int voc_prune_matches(voccxdef *ctx, /* ------------------------------------------------------------------------ */ /* * Count indistinguishable items. - * + * * If 'keep_all' is true, we'll keep all of the items, whether or not * some are indistinguishable from one another. If 'keep_all' is false, - * we'll keep only one item from each set of indistinguishable items. + * we'll keep only one item from each set of indistinguishable items. */ static int voc_count_diff(voccxdef *ctx, objnum *list, uint *flags, int *cnt, int keep_all) { int i; int diff_cnt; - - /* + + /* * Presume all items will be distinguishable from one another. As * we scan the list for indistinguishable items, we'll decrement * this count each time we find an item that can't be distinguished - * from another item. + * from another item. */ diff_cnt = *cnt; - /* + /* * Look for indistinguishable items. - * + * * An object is distinguishable if it doesn't have the special * property marking it as one of a group of equivalent objects * (PRP_ISEQUIV), or if it has the property but there is no object * following it in the list which has the same immediate superclass. - * + * * Note that we want to keep the duplicates if we're looking for * plurals, because the player is explicitly referring to all - * matching objects. + * matching objects. */ for (i = 0 ; i < *cnt ; ++i) { - /* + /* * check to see if this object might have indistinguishable * duplicates - it must be marked with isEquiv for this to be - * possible + * possible */ runppr(ctx->voccxrun, list[i], PRP_ISEQUIV, 0); if (runpoplog(ctx->voccxrun)) @@ -5173,21 +5173,21 @@ static int voc_count_diff(voccxdef *ctx, objnum *list, uint *flags, int *cnt, int j; int dst; objnum sc; - + /* get the superclass, if possible */ sc = objget1sc(ctx->voccxmem, list[i]); if (sc == MCMONINV) continue; - - /* + + /* * run through the remainder of the list, and remove any - * duplicates of this item + * duplicates of this item */ for (j = i + 1, dst = i + 1 ; j < *cnt ; ++j) { - /* + /* * see if it matches our object - if not, keep it in the - * list by copying it to our destination position + * list by copying it to our destination position */ if (objget1sc(ctx->voccxmem, list[j]) != sc) { @@ -5199,13 +5199,13 @@ static int voc_count_diff(voccxdef *ctx, objnum *list, uint *flags, int *cnt, { /* * This item is indistinguishable from the list[i]. - * First, reduce the count of different items. + * First, reduce the count of different items. */ --diff_cnt; - + /* * Keep this object only if we're keeping all - * redundant indistinguishable items. + * redundant indistinguishable items. */ if (keep_all) { @@ -5215,7 +5215,7 @@ static int voc_count_diff(voccxdef *ctx, objnum *list, uint *flags, int *cnt, } } } - + /* adjust the count to reflect the updated list */ *cnt = dst; @@ -5270,9 +5270,9 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, /* loop through all of the objects in the input list */ for (inpos = outpos = 0 ; inpos < listlen ; ++inpos) { - /* + /* * reset the stack to our entrypoint value, since our stack - * variables are all temporary for a single iteration + * variables are all temporary for a single iteration */ voc_leave(ctx, save_sp); voc_enter(ctx, &save_sp); @@ -5288,7 +5288,7 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, { long v1; char vbuf[4]; - + v1 = atol(inlist[inpos].vocolfst); oswp4s(vbuf, v1); vocsetobj(ctx, ctx->voccxnum, DAT_NUMBER, vbuf, @@ -5341,7 +5341,7 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, err = VOCERR(11); goto done; } - + /* add object only if it's still accessible */ if (vocchkaccess(ctx, ctx->voccxthm[i], accprop, 0, cmdActor, cmdVerb)) @@ -5359,7 +5359,7 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, tioflush(ctx->voccxtio); } } - + /* make sure we found at least one acceptable object */ if (outpos == thempos) { @@ -5390,13 +5390,13 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, runpobj(ctx->voccxrun, cmdActor); runppr(ctx->voccxrun, cmdVerb, defprop, defprop == PRP_DODEFAULT ? 3 : 2); - + if (runtostyp(ctx->voccxrun) == DAT_LIST) { l = runpoplst(ctx->voccxrun); len = osrp2(l) - 2; l += 2; - + while (len) { /* add list element to output if it's an object */ @@ -5407,7 +5407,7 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, /* move on to next list element */ lstadv(&l, &len); } - + vocout(&outlist[outpos], MCMONINV, 0, (char *)0, (char *)0); } else @@ -5519,13 +5519,13 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, * single, unambiguous match for a given singular noun * phrase. Under certain circumstances, we'll want to keep * all of the words that match the noun phrase, in which - * case we'll set this flag accordingly. + * case we'll set this flag accordingly. */ use_all_objs = FALSE; - /* + /* * go through the objects matching the current noun phrase - * and add them into our list + * and add them into our list */ while (inlist[lpos].vocolfst == inlist[inpos].vocolfst && lpos < listlen) @@ -5533,10 +5533,10 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, /* add this object to the list of nouns */ list1[i] = inlist[lpos].vocolobj; - /* + /* * note whether this object matched a plural, whether it * matched adjective-at-end usage, and whether it - * matched a truncated dictionary word + * matched a truncated dictionary word */ flags1[i] = inlist[lpos].vocolflg & (VOCS_PLURAL | VOCS_ANY | VOCS_COUNT @@ -5565,16 +5565,16 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, /* * If this noun phrase contained an unknown word, check to * see if the verb defines the parseUnknownXobj() method. - * If so, call the method and check the result. + * If so, call the method and check the result. */ if (unknown_count > 0) { prpnum prp; - /* + /* * figure out which method to call - use * parseUnknownDobj if we're disambiguating the direct - * object, parseUnknownIobj for the indirect object + * object, parseUnknownIobj for the indirect object */ prp = (defprop == PRP_DODEFAULT ? PRP_PARSEUNKNOWNDOBJ : PRP_PARSEUNKNOWNIOBJ); @@ -5607,9 +5607,9 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, switch(runtostyp(ctx->voccxrun)) { case DAT_OBJECT: - /* + /* * use the object they returned as the match for - * the noun phrase + * the noun phrase */ list1[cnt++] = runpopobj(ctx->voccxrun); @@ -5620,7 +5620,7 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, case DAT_LIST: /* * use the list of objects they returned as the - * match for the noun phrase + * match for the noun phrase */ lstp = runpoplst(ctx->voccxrun); @@ -5635,19 +5635,19 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, if (*lstp == DAT_OBJECT && i < VOCMAXAMBIG) list1[cnt++] = osrp2(lstp+1); - + /* move on to the next element */ lstadv(&lstp, &lstlen); } - /* + /* * Note that we want to use all of these objects * without disambiguation, since the game code * has explicitly said that this is the list - * that matches the given noun phrase. + * that matches the given noun phrase. */ use_all_objs = TRUE; - + /* terminate the new list */ list1[cnt] = MCMONINV; break; @@ -5659,7 +5659,7 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, * the command. They don't want anything more * to be done with these words. Simply remove * the unknown words and continue with any other - * words in the list. + * words in the list. */ rundisc(ctx->voccxrun); @@ -5673,9 +5673,9 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, * word" flag is set, we'll reparse the * sentence, this time rejecting unknown words * from the outset. - * + * * Return error 2, since that's the generic "I - * don't know the word..." error code. + * don't know the word..." error code. */ rundisc(ctx->voccxrun); err = VOCERR(2); @@ -5685,7 +5685,7 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, /* * If we made it this far, it means that they've * resolved the object for us, so we can consider - * the previously unknown words to be known now. + * the previously unknown words to be known now. */ ctx->voccxunknown -= unknown_count; } @@ -5703,13 +5703,13 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, * failure, and we'll reparse the sentence to reject * the unknown word in the usual fashion. Return * error 2, since that's the generic "I don't know - * the word..." error code. + * the word..." error code. */ err = VOCERR(2); goto done; } } - + /* * Use a new method to cut down on the time it will take to * iterate through the verprop's on all of those words. @@ -5719,11 +5719,11 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, * We'll intersect that list with the list we're about to * disambiguate, which should provide a list of objects that * are already qualified, in that validDo should return true - * for every one of them. - * + * for every one of them. + * * The calling sequence is: * verb.validXoList(actor, prep, otherobj) - * + * * For reverse compatibility, if the return value is nil, * we use the old algorithm and consider all objects * that match the vocabulary. The return value must be @@ -5738,7 +5738,7 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, listprop = PRP_VALDOLIST; else listprop = PRP_VALIOLIST; - + /* push the arguments: the actor, prep, and other object */ runpobj(ctx->voccxrun, otherobj); runpobj(ctx->voccxrun, cmdPrep); @@ -5752,33 +5752,33 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, /* presume we won't keep numObj */ kept_numobj = FALSE; - + /* read the list length prefix, and skip it */ l = runpoplst(ctx->voccxrun); len = osrp2(l) - 2; l += 2; - + /* * For each element of the return value, see if * it's in list1. If so, copy the object into - * list2, unless it's already in list2. + * list2, unless it's already in list2. */ for (cnt2 = 0 ; len != 0 ; ) { if (*l == DAT_OBJECT) { objnum o = osrp2(l+1); - + for (i = 0 ; i < cnt ; ++i) { if (list1[i] == o) { int j; - + /* check to see if o is already in list2 */ for (j = 0 ; j < cnt2 ; ++j) if (list2[j] == o) break; - + /* if o is not in list2 yet, add it */ if (j == cnt2) { @@ -5787,11 +5787,11 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, flags2[cnt2] = flags1[i]; ++cnt2; - /* + /* * if it's numObj, note that * we've already included it in * the output list, so that we - * don't add it again later + * don't add it again later */ if (o == ctx->voccxnum) kept_numobj = TRUE; @@ -5800,7 +5800,7 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, } } } - + /* move on to next element */ lstadv(&l, &len); } @@ -5813,7 +5813,7 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, * single number as a noun phrase, even when the * number matches an object. Note that we can skip * this special step if we already kept numObj in - * the valid list. + * the valid list. */ if (!kept_numobj) { @@ -5825,13 +5825,13 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, { /* keep it in the accessible list */ list2[cnt2++] = ctx->voccxnum; - + /* no need to look any further */ break; } } } - + /* copy list2 into list1 */ memcpy(list1, list2, (size_t)(cnt2 * sizeof(list1[0]))); memcpy(flags1, flags2, (size_t)cnt2 * sizeof(flags1[0])); @@ -5845,7 +5845,7 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, /* * Determine accessibility and visibility. First, limit * list1 to those objects that are visible OR accessible, - * and limit list3 to those objects that are visible. + * and limit list3 to those objects that are visible. */ for (cnt = cnt3 = i = 0 ; list1[i] != MCMONINV ; ++i) { @@ -5866,8 +5866,8 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, flags1[cnt] = flags1[i]; ++cnt; } - - /* + + /* * put items that are visible (regardless of whether or * not they're accessible) in list3 */ @@ -5891,7 +5891,7 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, * discard the short-hand version so that we don't treat it * as ambiguous with the long-name version. Likewise, if we * have some exact matches and some truncations, keep only - * the exact matches. + * the exact matches. */ cnt = voc_prune_matches(ctx, list1, flags1, cnt); cnt3 = voc_prune_matches(ctx, list3, flags3, cnt3); @@ -5907,7 +5907,7 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, * as far as the player is concerned, the visible objects * are part of the current location, so the player should be * able to refer to them regardless of whether they're - * accessible. + * accessible. */ for (dst = 0, i = 0 ; i < cnt ; ++i) { @@ -5918,7 +5918,7 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, /* keep it in the final list */ list1[dst] = list1[i]; flags1[dst] = flags1[i]; - + /* count the new list entry */ ++dst; } @@ -5931,7 +5931,7 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, /* * Go through the list of accessible objects, and perform * the sensible-object (verXoVerb) check on each. Copy each - * sensible object to list2. + * sensible object to list2. */ for (i = 0, cnt2 = 0 ; i < cnt ; ++i) { @@ -5956,11 +5956,11 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, runpobj(ctx->voccxrun, cmdActor); runppr(ctx->voccxrun, list1[i], verprop, (otherobj != MCMONINV ? 2 : 1)); - + /* * If that didn't result in a message, this object * passed the tougher test of ver?oX, so include it - * in list2. + * in list2. */ if (!tioshow(ctx->voccxtio)) { @@ -6006,12 +6006,12 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, * about the number itself, rather than one of the objects * that happened to use the number -- none of those objects * make any sense, it seems, so fall back on the number. - * + * * Note that we may also have only numObj in the YES list, * because the noun phrase parser normally adds numObj when * the player types a noun phrase consisting only of a * number. Do the same thing in this case -- just return - * the number object. + * the number object. */ if ((cnt2 == 0 || (cnt2 == 1 && list2[0] == ctx->voccxnum)) @@ -6039,14 +6039,14 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, /* * Check if we found anything in either the YES (list2) or * MAYBE (list1) lists. If there's nothing in either list, - * complain and return. + * complain and return. */ if (cnt2 == 0 && cnt == 0) { /* * We have nothing sensible, and nothing even * accessible. If there's anything merely visible, - * complain about those items. + * complain about those items. */ if (cnt3 != 0) { @@ -6060,10 +6060,10 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, } else { - /* + /* * explain that there's nothing visible or * accessible matching the noun phrase, and abort - * the command with an error + * the command with an error */ if (!silent) vocerr(ctx, VOCERR(9), @@ -6078,13 +6078,13 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, * in list2), use this as our proposed resolution for the * noun phrase. If nothing passed the stronger test (i.e., * list2 is empty), simply keep the list of accessible - * objects in list1. + * objects in list1. */ if (cnt2 != 0) { - /* + /* * we have items passing the stronger test -- copy the - * stronger list (list2) to list1 + * stronger list (list2) to list1 */ cnt = cnt2; memcpy(list1, list2, (size_t)(cnt2 * sizeof(list1[0]))); @@ -6099,19 +6099,19 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, * same object, because of the parser's leniency with * matching leading substrings of 6 characters or longer. * To avoid unnecessary "which x do you mean..." errors, - * simply discard any duplicates in the list. + * simply discard any duplicates in the list. */ for (dst = 0, i = 0 ; i < cnt ; ++i) { int dup; int j; - + /* presume we won't find a duplicate of this object */ dup = FALSE; - - /* + + /* * look for duplicates of this object in the remainder - * of the list + * of the list */ for (j = i + 1 ; j < cnt ; ++j) { @@ -6120,32 +6120,32 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, { /* note that this object has a duplicate */ dup = TRUE; - + /* we don't need to look any further */ break; } } - /* + /* * if this object has no duplicate, retain it in the - * output list + * output list */ if (!dup) { /* copy the element to the output */ list1[dst] = list1[i]; flags1[dst] = flags1[i]; - + /* count the output */ ++dst; } } - + /* update the count to the new list's size */ cnt = dst; list1[cnt] = MCMONINV; - /* + /* * If we have more than one object in the list, and numObj * is still in the list, remove numObj - we don't want to * consider numObj to be considered ambiguous with another @@ -6171,7 +6171,7 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, * Check for a generic numeric adjective ('#' in the * adjective list for the object) in each object. If we * find it, we need to make sure there's a number in the - * name of the object. + * name of the object. */ for (i = 0 ; i < cnt ; ++i) { @@ -6185,20 +6185,20 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, * numeric adjective property in the object to nil * to so indicate. Otherwise, look for the number, * and set the numeric adjective property - * accordingly. + * accordingly. */ if ((flags1[i] & (VOCS_ANY | VOCS_COUNT)) != 0) { int n = (user_count ? user_count : 1); int j; objnum objn = list1[i]; - - /* + + /* * They specified a count, so we want to create * n-1 copies of the numbered object. Make room * for the n-1 new copies of this object by * shifting any elements that follow up n-1 - * slots. + * slots. */ if (i + 1 != cnt && n > 1) { @@ -6207,21 +6207,21 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, memmove(&flags1[i + n - 1], &flags1[i], (cnt - i) * sizeof(flags1[i])); } - + /* create n copies of this object */ for (j = 0 ; j < n ; ++j) { long l; - - /* + + /* * Generate a number for the new object, * asking the object to tell us what value - * to use for an "any". + * to use for an "any". */ runpnum(ctx->voccxrun, (long)(j + 1)); runppr(ctx->voccxrun, objn, PRP_ANYVALUE, 1); l = runpopnum(ctx->voccxrun); - + /* try creating the new object */ list1[i+j] = voc_new_num_obj(ctx, objn, @@ -6238,7 +6238,7 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, { /* * get the plural object by asking for the - * numbered object with a nil number parameter + * numbered object with a nil number parameter */ list1[i] = voc_new_num_obj(ctx, list1[i], cmdActor, cmdVerb, @@ -6253,12 +6253,12 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, { //char *p; int found; - - /* + + /* * No plural, no "any" - we just want to create * one numbered object, using the number that * the player must have specified. Make sure - * the player did, in fact, specify a number. + * the player did, in fact, specify a number. */ for (found = FALSE, p = inlist[inpos].vocolfst ; p != 0 && p <= inlist[inpos].vocollst ; @@ -6271,7 +6271,7 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, /* get the number */ l = atol(p); - + /* create the object with this number */ list1[i] = voc_new_num_obj(ctx, list1[i], cmdActor, cmdVerb, @@ -6281,13 +6281,13 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, err = VOCERR(40); goto done; } - + /* the command looks to be valid */ found = TRUE; break; } } - + /* if we didn't find it, stop now */ if (!found) { @@ -6304,7 +6304,7 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, /* * We still have an ambiguous word - ask the user which of - * the possible objects they meant to use + * the possible objects they meant to use */ trying_again = FALSE; for (;;) @@ -6318,32 +6318,32 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, int num_wanted; int is_ambig; int all_plural; - - /* + + /* * check for usage - determine if we have singular * definite, singular indefinite, counted, or plural - * usage + * usage */ if ((flags1[0] & (VOCS_PLURAL | VOCS_ANY | VOCS_COUNT)) != 0) { //int i; - /* + /* * loop through the objects to AND together the * flags from all of the objects; we only care about * the plural flags (PLURAL, ANY, and COUNT), so * start out with only those, then AND off any that - * aren't in all of the objects + * aren't in all of the objects */ for (all_plural = VOCS_PLURAL | VOCS_ANY | VOCS_COUNT, i = 0 ; i < cnt ; ++i) { /* AND out this object's flags */ all_plural &= flags1[i]; - - /* + + /* * if we've ANDed down to zero, there's no need - * to look any further + * to look any further */ if (!all_plural) break; @@ -6351,23 +6351,23 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, } else { - /* + /* * it looks like we want just a single object - - * clear the various plural flags + * clear the various plural flags */ all_plural = 0; } /* * Count the distinguishable items. - * + * * If we're looking for a single object, don't keep * duplicate indistinguishable items (i.e., keep only * one item from each set of mutually indistinguishable * items), since we could equally well use any single * one of those items. If we're looking for multiple * objects, keep all of the items, since the user is - * referring to all of them. + * referring to all of them. */ diff_cnt = voc_count_diff(ctx, list1, flags1, &cnt, all_plural != 0 || use_all_objs); @@ -6379,7 +6379,7 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, * just want to pick one object arbitrarily. If we have * all plurals, we can keep all of the objects. If the * 'use_all_objs' flag is true, it means that we can use - * everything in the list. + * everything in the list. */ if (use_all_objs) { @@ -6389,40 +6389,40 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, } else if ((all_plural & VOCS_COUNT) != 0) { - /* + /* * we have a count - we want exactly the given * number of objects, but we can pick an arbitrary * subset, so it's not ambiguous even if we have too - * many at the moment + * many at the moment */ num_wanted = user_count; is_ambig = FALSE; } else if ((all_plural & VOCS_ANY) != 0) { - /* + /* * they specified "any", so we want exactly one, but * we can pick one arbitrarily, so there's no - * ambiguity + * ambiguity */ num_wanted = 1; is_ambig = FALSE; } else if (all_plural != 0) { - /* + /* * we have a simple plural, so we can use all of the - * provided objects without ambiguity + * provided objects without ambiguity */ num_wanted = cnt; is_ambig = FALSE; } else { - /* + /* * it's a singular, definite usage, so we want * exactly one item; if we have more than one in our - * list, it's ambiguous + * list, it's ambiguous */ num_wanted = 1; is_ambig = (cnt != 1); @@ -6445,44 +6445,44 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, vocout(&outlist[outpos++], list1[i], flags1[i], inlist[inpos].vocolfst, inlist[inpos].vocollst); - + /* we're done */ break; } else if (stat == VOC_DISAMBIG_CONT) { - /* + /* * Continue with the new list (which is the same as * the old list, if it wasn't actually updated by * the hook routine) - proceed with remaining * processing, but using the new list. - * + * * Because the list has been updated, we must once * again count the number of distinguishable items, - * since that may have changed. + * since that may have changed. */ diff_cnt = voc_count_diff(ctx, list1, flags1, &cnt, TRUE); } else if (stat == VOC_DISAMBIG_PARSE_RESP || stat == VOC_DISAMBIG_PROMPTED) { - /* + /* * The status indicates one of the following: - * + * * - the hook prompted for more information and read * a response from the player, but decided not to * parse it; we will continue with the current list, * and parse the player's response as provided by * the hook. - * + * * - the hook prompted for more information, but * left the reading to us. We'll proceed with the * current list and read a response as normal, but * without displaying another prompt. - * + * * In any case, just continue processing; we'll take * appropriate action on the prompting and reading - * when we reach those steps. + * when we reach those steps. */ } else @@ -6495,7 +6495,7 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, /* * If we found only one word, or a plural/ANY, we are * finished. If we found a count, use that count if - * possible. + * possible. */ if (cnt == 1 || all_plural || use_all_objs) { @@ -6537,18 +6537,18 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, tiocapture(ctx->voccxtio, (mcmcxdef *)0, FALSE); tioclrcapture(ctx->voccxtio); - /* + /* * if we're in "silent" mode, we can't ask the player - * for help, so return an error + * for help, so return an error */ if (silent) { - /* + /* * We can't disambiguate the list. Fill in the * return list with what's left, which is still * ambiguous, and note that we need to return an * error code indicating that the list remains - * ambiguous. + * ambiguous. */ for (i = 0 ; i < cnt && outpos < VOCMAXAMBIG ; ++i) vocout(&outlist[outpos++], list1[i], 0, @@ -6565,33 +6565,33 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, /* * We need to prompt for more information interactively. * Figure out how we're going to display the prompt. - * + * * - If the disambigXobj hook status (stat) indicates * that the hook already displayed a prompt of its own, * we don't need to add anything here. - * + * * - Otherwise, if there's a parseDisambig function * defined in the game, call it to display the prompt. - * - * - Otherwise, display our default prompt. + * + * - Otherwise, display our default prompt. */ if (stat == VOC_DISAMBIG_PARSE_RESP || stat == VOC_DISAMBIG_PROMPTED) { - /* + /* * the disambigXobj hook already asked for a - * response, so don't display any prompt of our own + * response, so don't display any prompt of our own */ } else if (ctx->voccxpdis != MCMONINV) { uint l; - - /* + + /* * There's a parseDisambig function defined in the * game - call it to display the prompt, passing the * list of possible objects and the player's - * original noun phrase text as parameters. + * original noun phrase text as parameters. */ for (i = 0, pu = lstbuf+2 ; i < cnt ; ++i, pu += 2) { @@ -6618,13 +6618,13 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, int eqcnt; int j; objnum sc; - + /* * See if we have multiple instances of an * identical object. All such instances should * be grouped together (this was done above), so * we can just count the number of consecutive - * equivalent objects. + * equivalent objects. */ eqcnt = 1; runppr(ctx->voccxrun, list1[i], PRP_ISEQUIV, 0); @@ -6649,7 +6649,7 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, /* * Display this object's name. If we have only * one such object, display its thedesc, - * otherwise display its adesc. + * otherwise display its adesc. */ runppr(ctx->voccxrun, list1[i], (prpnum)(eqcnt == 1 ? @@ -6667,10 +6667,10 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, vocerr_info(ctx, VOCERR(104), "?"); } - /* + /* * Read the response. If the disambigXobj hook already * read the response, we don't need to read anything - * more. + * more. */ if (stat != VOC_DISAMBIG_PARSE_RESP && vocread(ctx, cmdActor, cmdVerb, disnewbuf, @@ -6685,7 +6685,7 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, } /* - * parse the response + * parse the response */ /* tokenize the list */ @@ -6712,7 +6712,7 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, * unknown words; if there are any unknown words, the * tokenizer will parse them and set the unknown count. * If we find any unknown words in the input, we'll - * simply treat the input as an entirely new command. + * simply treat the input as an entirely new command. */ old_unknown = ctx->voccxunknown; old_lastunk = ctx->voccxlastunk; @@ -6726,9 +6726,9 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, if (vocgtyp(ctx, diswordlist, distypelist, cmdbuf) || ctx->voccxunknown != 0) { - /* + /* * there's an unknown word or other problem - retry - * the input as an entirely new command + * the input as an entirely new command */ strcpy(cmdbuf, disnewbuf); ctx->voccxunknown = 0; @@ -6756,7 +6756,7 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, (VOCT_ADJ | VOCT_NOUN | VOCT_ARTICLE))) break; } - + if (i && (distypelist[i-1] & VOCT_ADJ) && (distypelist[i-1] & VOCT_NOUN)) { @@ -6766,7 +6766,7 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, * noun flag cleared, we'll put the noun flag back * in and give it another try (by adding VOCT_NOUN * back into distypelist[cleared_noun], and coming - * back to the label below). + * back to the label below). */ cleared_noun = i-1; distypelist[i-1] &= ~VOCT_NOUN; @@ -6787,7 +6787,7 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, nam = all_name; else nam = both_name; - + for (i = 0 ; i < cnt ; ++i) vocout(&outlist[outpos++], list1[i], 0, nam, nam); if (noreach) @@ -6810,11 +6810,11 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, 0, &next, disnounlist, FALSE); if (cnt2 > 0) { - /* + /* * if that didn't consume the entire phrase, or * at least up to "one" or "ones" or a period, * disallow it, since they must be entering - * something more complicated + * something more complicated */ if (diswordlist[next] != 0 && !vocspec(diswordlist[next], VOCW_ONE) @@ -6826,10 +6826,10 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, } else if (cnt2 < 0) { - /* + /* * There was a syntax error in the phrase. * vocchknoun() will have displayed a message in - * this case, so we're done parsing this command. + * this case, so we're done parsing this command. */ err = VOCERR(45); goto done; @@ -6847,9 +6847,9 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, int j; int found; - /* + /* * make sure this object isn't already in - * our list - we want each object only once + * our list - we want each object only once */ for (j = 0, found = FALSE ; j < newcnt ; ++j) { @@ -6861,9 +6861,9 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, } } - /* + /* * add it to our list only if it wasn't - * already there + * already there */ if (!found) { @@ -6903,7 +6903,7 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, i = j - 1; } } - + /* * If the count of items in the intersection of * the original list and the typed-in list is no @@ -6911,18 +6911,18 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, * the typed-in list, we've successfully * disambiguated the object, because the user's * new list matches only one object for each set - * of words the user typed. + * of words the user typed. */ if (newcnt && (newcnt <= cnt3 || (diswordlist[next] && vocspec(diswordlist[next], VOCW_ONES)))) - { + { for (i = 0 ; i < cnt ; ++i) vocout(&outlist[outpos++], list2[i], 0, one_name, one_name); - + if (noreach) { cnt = newcnt; @@ -6954,7 +6954,7 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, * the noun flag back in and give it another * go. If we didn't clear the noun, there's * nothing left to try, so explain that we - * don't see any such object and give up. + * don't see any such object and give up. */ if (cleared_noun != -1) { @@ -6971,23 +6971,23 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, break; } - /* + /* * if we found a noun phrase, build a string * out of the words used; otherwise, just - * use "such" + * use "such" */ if (i != cnt2) { const char *last; /* clear the word buffer */ newobj[0] = '\0'; - + /* build a string out of the words */ p = disnounlist[i].vocolfst; last = disnounlist[i].vocollst; for ( ; p <= last ; p += strlen(p) + 1) { - /* + /* * If this is a special word, we * probably can't construct a * sensible sentence - special words @@ -6998,24 +6998,24 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, * thing into "I don't see any * *such* object" rather than trying * to make do with pronouns or other - * special words. + * special words. */ if (vocisspec(p)) { - /* + /* * replace the entire adjective - * phrase with "such" + * phrase with "such" */ strcpy(newobj, "such"); - /* + /* * stop here - don't add any * more, since "such" is the - * whole thing + * whole thing */ break; } - + /* add a space if we have a prior word */ if (newobj[0] != '\0') strcat(newobj, " "); @@ -7037,13 +7037,13 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, err = VOCERR(16); goto done; } - + /* * If we get here, it means that we have still * more than one object per noun phrase typed in * the latest sentence. Limit the list to the * intersection (by copying list2 to list1), and - * try again. + * try again. */ memcpy(list1, list2, (size_t)((newcnt + 1) * sizeof(list1[0]))); @@ -7052,13 +7052,13 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, } else { - /* + /* * We didn't find a noun phrase, so it's probably a * new command. However, check first to see if we * were making a trial run with the noun flag * cleared: if so, go back and make another pass * with the noun flag added back in to see if that - * works any better. + * works any better. */ if (cleared_noun != -1) { @@ -7066,7 +7066,7 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, cleared_noun = -1; goto try_current_flags; } - + /* retry as an entire new command */ strcpy(cmdbuf, disnewbuf); ctx->voccxunknown = 0; @@ -7083,10 +7083,10 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, /* terminate the output list */ vocout(&outlist[outpos], MCMONINV, 0, (char *)0, (char *)0); - /* + /* * If we still have ambiguous objects, so indicate. This can only * happen when we operate in "silent" mode, because only then can we - * give up without fully resolving a list. + * give up without fully resolving a list. */ if (still_ambig) err = VOCERR(44); @@ -7097,9 +7097,9 @@ int vocdisambig(voccxdef *ctx, vocoldef *outlist, vocoldef *inlist, done: ERRCLEAN(ctx->voccxerr) { - /* + /* * reset the stack before we return, in case the caller handles - * the error without aborting the command + * the error without aborting the command */ voc_leave(ctx, save_sp); } @@ -7123,7 +7123,7 @@ static int vocready(voccxdef *ctx, char *cmd[], int *typelist, int cur, if (ctx->voccxflg & VOCCXFDBG) { char buf[128]; - + sprintf(buf, ". executing verb: %s %s\\n", vverb, vprep ? vprep : ""); tioputs(ctx->vocxtio, buf); @@ -7202,12 +7202,12 @@ static int voc1cmd(voccxdef *ctx, char *cmd[], char *cmdbuf, /* start off at the first word */ cur = next = first_word = 0; - /* + /* * Presume we will be in control of the next word - when execmd() or * another routine we call decides where the command ends, it will * fill in a new value here. When this value is non-zero, it will * tell us where the next sentence start is relative to the previous - * sentence start. + * sentence start. */ next_start = 0; @@ -7219,7 +7219,7 @@ static int voc1cmd(voccxdef *ctx, char *cmd[], char *cmdbuf, { /* * if preparseCmd sent us back a list, parse that list as a new - * command + * command */ if (err == ERR_PREPRSCMDREDO) { @@ -7237,7 +7237,7 @@ static int voc1cmd(voccxdef *ctx, char *cmd[], char *cmdbuf, retval = 1; goto done; } - + /* save our status prior to processing the preparseCmd list */ preparseCmd_stat.active = TRUE; preparseCmd_stat.cur = cur; @@ -7301,7 +7301,7 @@ static int voc1cmd(voccxdef *ctx, char *cmd[], char *cmdbuf, /* * this is not a new command - it's just further processing - * of the current command + * of the current command */ again = FALSE; @@ -7324,16 +7324,16 @@ static int voc1cmd(voccxdef *ctx, char *cmd[], char *cmdbuf, } skip_leading_stuff: - /* + /* * If someone updated the sentence start point, jump there. The - * sentence start is relative to the previous sentence start. + * sentence start is relative to the previous sentence start. */ if (next_start != 0) cur = first_word + next_start; /* clear next_start, so we can tell if someone updates it */ next_start = 0; - + /* skip any leading THEN's and AND's */ while (cmd[cur] && (vocspec(cmd[cur], VOCW_THEN) || vocspec(cmd[cur], VOCW_AND))) @@ -7344,7 +7344,7 @@ static int voc1cmd(voccxdef *ctx, char *cmd[], char *cmdbuf, { /* * if we've been off doing preparseCmd work, return to the - * original command list + * original command list */ if (preparseCmd_stat.active) { @@ -7353,7 +7353,7 @@ static int voc1cmd(voccxdef *ctx, char *cmd[], char *cmdbuf, cmd = preparseCmd_stat.cmd; cmdbuf = preparseCmd_stat.cmdbuf; preparseCmd_stat.active = FALSE; - + /* get the type list for the original list again */ if (vocgtyp(ctx, cmd, typelist, cmdbuf)) { @@ -7373,10 +7373,10 @@ static int voc1cmd(voccxdef *ctx, char *cmd[], char *cmdbuf, } } - /* + /* * display a blank line if this is not the first command on this * command line, so that we visually separate the results of the - * new command from the results of the previous command + * new command from the results of the previous command */ if (again) outformat("\\b"); /* tioblank(ctx->voccxtio); */ @@ -7459,7 +7459,7 @@ static int voc1cmd(voccxdef *ctx, char *cmd[], char *cmdbuf, * iobj dobj". Note that we do *not* do this if the * word is also a noun, or it's an adjective and a noun * (possibly separated by one or more adjectives) - * follows. + * follows. */ if ((v = vocffw(ctx, cmd[cur], (int)strlen(cmd[cur]), (char *)0, 0, PRP_PREP, (vocseadef *)0)) != 0) @@ -7508,10 +7508,10 @@ static int voc1cmd(voccxdef *ctx, char *cmd[], char *cmdbuf, } else if (no_match) { - /* + /* * we found a valid noun phrase, but we didn't find any * objects that matched the words -- get the noun again, - * this time showing the error + * this time showing the error */ vocgetnoun(ctx, cmd, typelist, cur, &next, dolist); @@ -7531,7 +7531,7 @@ static int voc1cmd(voccxdef *ctx, char *cmd[], char *cmdbuf, * If we thought we were going to get a two-object * sentence, and we got a zero-object sentence, and it looks * like the word we took as a preposition is also an - * adjective or noun, go back and treat it as such. + * adjective or noun, go back and treat it as such. */ if (swapObj && ((typelist[cur-1] & VOCT_NOUN) @@ -7546,7 +7546,7 @@ static int voc1cmd(voccxdef *ctx, char *cmd[], char *cmdbuf, bad_sentence: /* find the last word */ while (cmd[cur]) ++cur; - + /* try running the sentence through preparseCmd */ err = try_preparse_cmd(ctx, &cmd[first_word], cur - first_word, &preparse_list); @@ -7588,7 +7588,7 @@ static int voc1cmd(voccxdef *ctx, char *cmd[], char *cmdbuf, &err, cmdbuf, first_word, &preparse_list, &next_start)) continue; - + /* * Check for an indirect object, which may or may not be preceded * by a preposition. (Note that the lack of a preposition implies @@ -7627,7 +7627,7 @@ static int voc1cmd(voccxdef *ctx, char *cmd[], char *cmdbuf, continue; } } - + if ((err = execmd(ctx, cmdActor, cmdPrep, vverb, vprep, dolist, iolist, &cmd[first_word], &typelist[first_word], @@ -7647,19 +7647,19 @@ static int voc1cmd(voccxdef *ctx, char *cmd[], char *cmdbuf, * it as a sentence of the form "pry box open with crowbar" * (where the current word is "with"). We also must have at * least one more word after that, since there will have to - * be an indirect object. + * be an indirect object. */ if (cmd[cur] && (typelist[cur] & VOCT_PREP) && cmd[cur+1] && vprep == 0 && vocffw(ctx, vverb, vvlen, p1, (int)strlen(p1), PRP_VERB, (vocseadef *)0)) { - /* + /* * check to make sure that the next word, which we're * about to take for a prep (the "with" in "pry box open * with crowbar") is actually not part of an object name * - if it is, use it as the object name rather than as - * the prep + * the prep */ if (vocgobj(ctx, cmd, typelist, cur, &next, FALSE, iolist, FALSE, FALSE, 0) <= 0) @@ -7744,9 +7744,9 @@ static int voc1cmd(voccxdef *ctx, char *cmd[], char *cmdbuf, * this assumption now: add the preposition back to the * noun phrase and explain that there's no such thing * present. - * + * * Otherwise, we simply have an unknown verb phrasing, - * so let parseUnknownVerb handle it. + * so let parseUnknownVerb handle it. */ vocoldef *np1 = (dolist[0].vocolflg & VOCS_TRIMPREP) != 0 @@ -7757,7 +7757,7 @@ static int voc1cmd(voccxdef *ctx, char *cmd[], char *cmdbuf, if (np1 != 0) { char namebuf[VOCBUFSIZ]; - + /* show the name, adding the prep back in */ voc_make_obj_name_from_list( ctx, namebuf, cmd, np1->vocolfst, np1->vocolhlst); @@ -7787,19 +7787,19 @@ static int voc1cmd(voccxdef *ctx, char *cmd[], char *cmdbuf, } else if (cnt < 0) { - /* + /* * the noun phrase syntax was invalid - we've already - * displayed an error about it, so simply return failure + * displayed an error about it, so simply return failure */ retval = 1; goto done; } else if (no_match) { - /* + /* * we found a valid noun phrase, but we didn't find any * matching objects - we've already generated an error, - * so simply return failure + * so simply return failure */ retval = 1; goto done; @@ -7844,12 +7844,12 @@ static int voc1cmd(voccxdef *ctx, char *cmd[], char *cmdbuf, continue; } } - + /* * If we don't have a preposition yet, we need to find the * verb's default. If the verb object has a nilPrep * property defined, use that prep object; otherwise, look - * up the word "to" and use that. + * up the word "to" and use that. */ if (cmdPrep == MCMONINV && (v = vocffw(ctx, vverb, vvlen, @@ -7893,7 +7893,7 @@ done: /* copy back the command if we need to redo */ if (ctx->voccxredo && cmdbuf != origcmdbuf) strcpy(origcmdbuf, cmdbuf); - + /* return the status */ VOC_RETVAL(ctx, save_sp, retval); } @@ -7909,17 +7909,17 @@ int voccmd(voccxdef *ctx, char *cmd, uint cmdlen) objnum cmdActor; int first; - /* + /* * Make sure the stack is set up, resetting the stack on entry. Note * that this makes this routine non-reentrant - recursively calling - * this routine will wipe out the enclosing caller's stack. + * this routine will wipe out the enclosing caller's stack. */ voc_stk_ini(ctx, (uint)VOC_STACK_SIZE); /* allocate our stack arrays */ VOC_STK_ARRAY(ctx, char, buffer, 2*VOCBUFSIZ); VOC_STK_ARRAY(ctx, char *, wordlist, VOCBUFSIZ); - + /* until further notice, the actor for formatStrings is Me */ tiosetactor(ctx->voccxtio, ctx->voccxme); @@ -7954,10 +7954,10 @@ int voccmd(voccxdef *ctx, char *cmd, uint cmdlen) case ERR_RUNEXIT: case ERR_RUNEXITOBJ: case ERR_RUNABRT: - /* + /* * if we encountered abort, exit, or exitobj, treat it * the same as a nil result code - simply cancel the - * entire current command + * entire current command */ break; @@ -7976,15 +7976,15 @@ int voccmd(voccxdef *ctx, char *cmd, uint cmdlen) typ = runtostyp(ctx->voccxrun); if (typ == DAT_SSTRING) { - /* + /* * It's a string - replace the command with the new string. - * Pop the new string and scan its length prefix. + * Pop the new string and scan its length prefix. */ s = runpopstr(ctx->voccxrun); len = osrp2(s) - 2; s += 2; - /* + /* * limit the size of the command to our buffer length, * leaving space for null termination */ @@ -8021,10 +8021,10 @@ int voccmd(voccxdef *ctx, char *cmd, uint cmdlen) } } - /* + /* * if we found no words, or we found only useless leading "and" and * "then" separators, run the "pardon" function to tell the player - * that we didn't find any command on the line + * that we didn't find any command on the line */ if (wrdcnt == 0 || (wrdcnt > 0 && cur >= wrdcnt)) { @@ -8032,10 +8032,10 @@ int voccmd(voccxdef *ctx, char *cmd, uint cmdlen) return 0; } - /* + /* * if we got an error tokenizing the word list, return - we've * already displayed an error message, so there's nothing more for - * us to do here + * us to do here */ if (wrdcnt < 0) return 0; @@ -8058,16 +8058,16 @@ int voccmd(voccxdef *ctx, char *cmd, uint cmdlen) /* try processing the command */ if (voc1cmd(ctx, &wordlist[next], cmd, &cmdActor, first)) { - /* + /* * If the unknown word flag is set, try the command * again from the beginning. This flag means that we * tried using parseUnknownDobj/Iobj to resolve the * unknown word, but that failed and we need to try - * again with the normal "oops" processing. + * again with the normal "oops" processing. */ if (ctx->voccxunknown > 0) continue; - + /* return an error */ return 1; } @@ -8086,10 +8086,10 @@ int voccmd(voccxdef *ctx, char *cmd, uint cmdlen) || vocspec(wordlist[cur+1], VOCW_AND))) ++cur; - /* + /* * if another command follows, add a blank line to separate the * results from the previous command and those from the next - * command + * command */ if (cur + 1 < wrdcnt) outformat("\\b"); @@ -8101,7 +8101,7 @@ int voccmd(voccxdef *ctx, char *cmd, uint cmdlen) /* - * Off-stack stack management + * Off-stack stack management */ /* allocate/reset the stack */ @@ -8113,7 +8113,7 @@ void voc_stk_ini(voccxdef *ctx, uint siz) ctx->voc_stk_ptr = mchalo(ctx->voccxerr, siz, "voc_stk_ini"); ctx->voc_stk_end = ctx->voc_stk_ptr + siz; } - + /* reset the stack */ ctx->voc_stk_cur = ctx->voc_stk_ptr; } @@ -8122,7 +8122,7 @@ void voc_stk_ini(voccxdef *ctx, uint siz) void *voc_stk_alo(voccxdef *ctx, uint siz) { void *ret; - + /* round size up to allocation units */ siz = osrndsz(siz); @@ -8143,7 +8143,7 @@ void *voc_stk_alo(voccxdef *ctx, uint siz) if (ctx->voc_stk_cur - ctx->voc_stk_ptr > maxsiz) { char buf[20]; - + maxsiz = ctx->voc_stk_cur - ctx->voc_stk_ptr; sprintf(buf, "%u\n", maxsiz); os_printz(buf); diff --git a/engines/glk/window_text_buffer.cpp b/engines/glk/window_text_buffer.cpp index 9809997a7dd..f03d04e4a7c 100644 --- a/engines/glk/window_text_buffer.cpp +++ b/engines/glk/window_text_buffer.cpp @@ -1574,7 +1574,7 @@ void TextBufferWindow::scrollOneLine(bool forced) { _lines[0]._rPic = nullptr; _lines[0]._lHyper = 0; _lines[0]._rHyper = 0; - + Common::fill(_chars, _chars + TBLINELEN, ' '); Attributes *a = _attrs; for (int i = 0; i < TBLINELEN; ++i, ++a) diff --git a/engines/glk/zcode/bitmap_font.h b/engines/glk/zcode/bitmap_font.h index e7ee26c278e..3341416e133 100644 --- a/engines/glk/zcode/bitmap_font.h +++ b/engines/glk/zcode/bitmap_font.h @@ -41,7 +41,7 @@ private: Common::Point _size; protected: /** - * Calculate a character width + * Calculate a character width */ int getSourceCharacterWidth(uint charIndex, const Graphics::Surface &src, const Common::Rect &charBounds); diff --git a/engines/glk/zcode/config.cpp b/engines/glk/zcode/config.cpp index 5714495d7d0..c73d9eb641d 100644 --- a/engines/glk/zcode/config.cpp +++ b/engines/glk/zcode/config.cpp @@ -84,7 +84,7 @@ Header::Header() : h_version(0), h_config(0), h_release(0), h_resident_size(0), Common::fill(&h_user_name[0], &h_user_name[8], '\0'); h_interpreter_number = getConfigInt("interpreter_number", INTERP_AMIGA, INTERP_TANDY); - + if (ConfMan.hasKey("username")) { Common::String username = ConfMan.get("username"); @@ -112,7 +112,7 @@ void Header::loadHeader(Common::SeekableReadStream &f) { h_dynamic_size = f.readUint16BE(); h_flags = f.readUint16BE(); f.read(h_serial, 6); - + /* Auto-detect buggy story files that need special fixes */ _storyId = UNKNOWN; @@ -128,7 +128,7 @@ void Header::loadHeader(Common::SeekableReadStream &f) { h_abbreviations = f.readUint16BE(); h_file_size = f.readUint16BE(); h_checksum = f.readUint16BE(); - + f.seek(H_FUNCTIONS_OFFSET); h_functions_offset = f.readUint16BE(); h_strings_offset = f.readUint16BE(); diff --git a/engines/glk/zcode/config.h b/engines/glk/zcode/config.h index 184f6a8e780..b6883f000b8 100644 --- a/engines/glk/zcode/config.h +++ b/engines/glk/zcode/config.h @@ -32,32 +32,32 @@ namespace ZCode { * Configuration flags */ enum ConfigFlag { - CONFIG_BYTE_SWAPPED = 0x01, ///< Story file is byte swapped - V3 - CONFIG_TIME = 0x02, ///< Status line displays time - V3 - CONFIG_TWODISKS = 0x04, ///< Story file occupied two disks - V3 - CONFIG_TANDY = 0x08, ///< Tandy licensed game - V3 - CONFIG_NOSTATUSLINE = 0x10, ///< Interpr can't support status lines - V3 - CONFIG_SPLITSCREEN = 0x20, ///< Interpr supports split screen mode - V3 - CONFIG_PROPORTIONAL = 0x40, ///< Interpr uses proportional font - V3 - + CONFIG_BYTE_SWAPPED = 0x01, ///< Story file is byte swapped - V3 + CONFIG_TIME = 0x02, ///< Status line displays time - V3 + CONFIG_TWODISKS = 0x04, ///< Story file occupied two disks - V3 + CONFIG_TANDY = 0x08, ///< Tandy licensed game - V3 + CONFIG_NOSTATUSLINE = 0x10, ///< Interpr can't support status lines - V3 + CONFIG_SPLITSCREEN = 0x20, ///< Interpr supports split screen mode - V3 + CONFIG_PROPORTIONAL = 0x40, ///< Interpr uses proportional font - V3 + CONFIG_COLOUR = 0x01, ///< Interpr supports colour - V5+ - CONFIG_PICTURES = 0x02, ///< Interpr supports pictures - V6 + CONFIG_PICTURES = 0x02, ///< Interpr supports pictures - V6 CONFIG_BOLDFACE = 0x04, ///< Interpr supports boldface style - V4+ CONFIG_EMPHASIS = 0x08, ///< Interpr supports emphasis style - V4+ CONFIG_FIXED = 0x10, ///< Interpr supports fixed width style - V4+ - CONFIG_SOUND = 0x20, ///< Interpr supports sound - V6 + CONFIG_SOUND = 0x20, ///< Interpr supports sound - V6 CONFIG_TIMEDINPUT = 0x80, ///< Interpr supports timed input - V4+ - + SCRIPTING_FLAG = 0x0001, ///< Outputting to transscription file - V1+ FIXED_FONT_FLAG = 0x0002, ///< Use fixed width font - V3+ - REFRESH_FLAG = 0x0004, ///< Refresh the screen - V6 + REFRESH_FLAG = 0x0004, ///< Refresh the screen - V6 GRAPHICS_FLAG = 0x0008, ///< Game wants to use graphics - V5+ - OLD_SOUND_FLAG = 0x0010, ///< Game wants to use sound effects - V3 + OLD_SOUND_FLAG = 0x0010, ///< Game wants to use sound effects - V3 UNDO_FLAG = 0x0010, ///< Game wants to use UNDO feature - V5+ MOUSE_FLAG = 0x0020, ///< Game wants to use a mouse - V5+ COLOUR_FLAG = 0x0040, ///< Game wants to use colours - V5+ SOUND_FLAG = 0x0080, ///< Game wants to use sound effects - V5+ - MENU_FLAG = 0x0100 ///< Game wants to use menus - V6 + MENU_FLAG = 0x0100 ///< Game wants to use menus - V6 }; /** diff --git a/engines/glk/zcode/glk_interface.cpp b/engines/glk/zcode/glk_interface.cpp index 3289d769fd1..9b7ada7fc9c 100644 --- a/engines/glk/zcode/glk_interface.cpp +++ b/engines/glk/zcode/glk_interface.cpp @@ -180,7 +180,7 @@ void GlkInterface::initialize() { _wp[i][TRUE_FG_COLOR] = zcolors[h_default_foreground]; _wp[i][TRUE_BG_COLOR] = zcolors[h_default_background]; } - + /* * Icky magic bit setting */ @@ -392,7 +392,7 @@ void GlkInterface::erase_window(zword w) { else if (_wp._upper) { //os_set_reverse_video(glk_window_get_stream(_wp._upper), true); - + memset(statusline, ' ', sizeof statusline); _wp._upper.clear(); reset_status_ht(); diff --git a/engines/glk/zcode/mem.cpp b/engines/glk/zcode/mem.cpp index fa520064709..2db1d930e1a 100644 --- a/engines/glk/zcode/mem.cpp +++ b/engines/glk/zcode/mem.cpp @@ -122,7 +122,7 @@ zword Mem::get_header_extension(int entry) { addr = h_extension_table + 2 * entry; LOW_WORD(addr, val); - return val; + return val; } void Mem::set_header_extension(int entry, zword val) { diff --git a/engines/glk/zcode/processor_screen.cpp b/engines/glk/zcode/processor_screen.cpp index e05ac1a0ea4..f3daf0dd95b 100644 --- a/engines/glk/zcode/processor_screen.cpp +++ b/engines/glk/zcode/processor_screen.cpp @@ -214,7 +214,7 @@ void Processor::erase_window(zword win) { _wp[win].updateColors(); _wp[win].clear(); - + if (h_version == V6 && win != _wp._cwin && h_interpreter_number != INTERP_AMIGA) _wp[_wp._cwin].updateColors(); } @@ -243,7 +243,7 @@ void Processor::z_erase_line() { void Processor::z_erase_window() { short w = (short)zargs[0]; - + flush_buffer(); if (w == -1 || w == -2) diff --git a/engines/glk/zcode/quetzal.cpp b/engines/glk/zcode/quetzal.cpp index 52c126c3df4..e46c6b39ff7 100644 --- a/engines/glk/zcode/quetzal.cpp +++ b/engines/glk/zcode/quetzal.cpp @@ -322,7 +322,7 @@ int Quetzal::restore(Common::SeekableReadStream *sv, Processor *proc) { } if (currlen < (uint)tmpw * 2) return fatal; - + for (i = 0; i < tmpw; ++i) *--p._sp = s->readUint16BE(); currlen -= tmpw * 2; @@ -335,7 +335,7 @@ int Quetzal::restore(Common::SeekableReadStream *sv, Processor *proc) { case ID_CMem: if (!(progress & GOT_MEMORY)) { _storyFile->seek(0); - + i = 0; // Bytes written to data area for (; currlen > 0; --currlen) { x = s->readByte(); @@ -393,7 +393,7 @@ int Quetzal::restore(Common::SeekableReadStream *sv, Processor *proc) { } else { p.print_string("`UMem' chunk wrong size!\n"); } - + // Fall into default action (skip chunk) on errors } break; diff --git a/engines/glk/zcode/sound_folder.cpp b/engines/glk/zcode/sound_folder.cpp index 25431718906..a40e8be00ec 100644 --- a/engines/glk/zcode/sound_folder.cpp +++ b/engines/glk/zcode/sound_folder.cpp @@ -84,7 +84,7 @@ void SoundZip::check(const Common::FSNode &gameDir, Story story) { if (story != LURKING_HORROR && story != SHERLOCK) return; Common::String zipName = (story == LURKING_HORROR) ? "lhsound.zip" : "shsound.zip"; - + // Check for the existance of the zip Common::FSNode zipNode = gameDir.getChild(zipName); if (!zipNode.exists()) diff --git a/engines/glk/zcode/windows.cpp b/engines/glk/zcode/windows.cpp index 0e209f1cfe0..90f6b7eaee1 100644 --- a/engines/glk/zcode/windows.cpp +++ b/engines/glk/zcode/windows.cpp @@ -131,7 +131,7 @@ void Window::update() { _properties[RIGHT_MARGIN] = (win ? win->_radjw : 0) / cellW; _properties[FONT_SIZE] = (g_conf->_monoInfo._cellH << 8) | g_conf->_monoInfo._cellW; } - + Window &Window::operator=(winid_t win) { _win = win; @@ -380,7 +380,7 @@ void Window::createGlkWindow() { if (g_vm->h_version == V6) _windows->showTextWindows(); - // Create a new window + // Create a new window if (_index != 0 || (_currStyle & FIXED_WIDTH_STYLE)) { // Text grid window _win = g_vm->glk_window_open(g_vm->glk_window_get_root(), diff --git a/engines/gob/sound/sound.cpp b/engines/gob/sound/sound.cpp index 76f33da3741..4c358f5c31b 100644 --- a/engines/gob/sound/sound.cpp +++ b/engines/gob/sound/sound.cpp @@ -626,7 +626,7 @@ void Sound::cdPlay(const Common::String &trackName) { if ((_vm->getGameType() == kGameTypeFascination) && trackName.equalsIgnoreCase("boscle")) _cdrom->startTrack("bosscle"); // WORKAROUND - In Goblins 3 CD, in the chess room, a couple of tracks have the wrong name -// in the scripts, and therefore don't play. This fixes the problem (ticket #11335). +// in the scripts, and therefore don't play. This fixes the problem (ticket #11335). else if ((_vm->getGameType() == kGameTypeGob3) && trackName.matchString("ECHEQUI?")) { char name[] = "ECHIQUI1"; name[7] = trackName[7]; diff --git a/engines/grim/actor.cpp b/engines/grim/actor.cpp index fe0f2d38b5b..6f32af9f360 100644 --- a/engines/grim/actor.cpp +++ b/engines/grim/actor.cpp @@ -83,7 +83,7 @@ void Actor::restoreStaticState(SaveGame *state) { Actor::Actor() : _talkColor(255, 255, 255), _pos(0, 0, 0), - _lookingMode(false), _followBoxes(false), _running(false), + _lookingMode(false), _followBoxes(false), _running(false), _pitch(0), _yaw(0), _roll(0), _walkRate(0.3f), _turnRateMultiplier(0.f), _talkAnim(0), _reflectionAngle(80), _scale(1.f), _timeScale(1.f), @@ -94,8 +94,8 @@ Actor::Actor() : _sayLineText(0), _talkDelay(0), _attachedActor(0), _attachedJoint(""), _globalAlpha(1.f), _alphaMode(AlphaOff), - _mustPlaceText(false), - _puckOrient(false), _talking(false), + _mustPlaceText(false), + _puckOrient(false), _talking(false), _inOverworld(false), _drawnToClean(false), _backgroundTalk(false), _sortOrder(0), _useParentSortOrder(false), _sectorSortOrder(-1), _fakeUnbound(false), _lightMode(LightFastDyn), @@ -2146,7 +2146,7 @@ bool Actor::handleCollisionWith(Actor *actor, CollisionMode mode, Math::Vector3d // because it seems the original does so. // if you change this code test this places: the rocks in lb and bv (both when booting directly in the // set and when coming in from another one) and the poles in xb. - if (!this->getSphereInfo(true, size1, p1) || + if (!this->getSphereInfo(true, size1, p1) || !actor->getSphereInfo(false, size2, p2)) { return false; } diff --git a/engines/grim/emi/lua_v2.cpp b/engines/grim/emi/lua_v2.cpp index 5841642363d..79fe70ee4c4 100644 --- a/engines/grim/emi/lua_v2.cpp +++ b/engines/grim/emi/lua_v2.cpp @@ -481,7 +481,7 @@ void Lua_V2::ThumbnailFromFile() { } int index = (int)lua_getnumber(texIdObj); Common::String filename(lua_getstring(filenameObj)); - + if (g_grim->getGameType() == GType_MONKEY4 && g_grim->getGamePlatform() == Common::kPlatformPS2) { filename += ".ps2"; diff --git a/engines/grim/emi/lua_v2_sound.cpp b/engines/grim/emi/lua_v2_sound.cpp index bff2de4e42a..1e389b1b43a 100644 --- a/engines/grim/emi/lua_v2_sound.cpp +++ b/engines/grim/emi/lua_v2_sound.cpp @@ -507,7 +507,7 @@ void Lua_V2::UpdateSoundPosition() { if (!lua_isnumber(param2) || !lua_isnumber(param3) || !lua_isnumber(param4)) return; - + float x = lua_getnumber(param2); float y = lua_getnumber(param3); float z = lua_getnumber(param4); diff --git a/engines/grim/emi/modelemi.cpp b/engines/grim/emi/modelemi.cpp index 57771cee843..be03b3add99 100644 --- a/engines/grim/emi/modelemi.cpp +++ b/engines/grim/emi/modelemi.cpp @@ -344,7 +344,7 @@ void EMIModel::updateLighting(const Math::Matrix4 &modelToWorld) { for (uint j = 0; j < activeLights.size(); ++j) { Light *l = activeLights[j]; float shade = l->_intensity; - + if (l->_type != Light::Ambient) { // Direction of incident light Math::Vector3d dir = l->_dir; diff --git a/engines/grim/emi/sound/mp3track.cpp b/engines/grim/emi/sound/mp3track.cpp index 1741534bba5..d544ba38ce3 100644 --- a/engines/grim/emi/sound/mp3track.cpp +++ b/engines/grim/emi/sound/mp3track.cpp @@ -170,7 +170,7 @@ bool MP3Track::openSound(const Common::String &filename, const Common::String &s return true; #else parseRIFFHeader(file); - + MP3Track::JMMCuePoints cuePoints; if (soundName.size() > 4) { cuePoints = parseJMMFile(Common::String(filename.c_str(), filename.size() - 4) + ".jmm"); diff --git a/engines/grim/gfx_opengl.cpp b/engines/grim/gfx_opengl.cpp index aba5ec83c31..a997d86dcf5 100644 --- a/engines/grim/gfx_opengl.cpp +++ b/engines/grim/gfx_opengl.cpp @@ -95,7 +95,7 @@ static char dimFragSrc[] = GfxOpenGL::GfxOpenGL() : _smushNumTex(0), _smushTexIds(nullptr), _smushWidth(0), _smushHeight(0), _useDepthShader(false), _fragmentProgram(0), _useDimShader(0), - _dimFragProgram(0), _maxLights(0), _storedDisplay(nullptr), + _dimFragProgram(0), _maxLights(0), _storedDisplay(nullptr), _emergFont(0), _alpha(1.f) { // GL_LEQUAL as glDepthFunc ensures that subsequent drawing attempts for // the same triangles are not ignored by the depth test. @@ -463,7 +463,7 @@ void GfxOpenGL::getScreenBoundingBox(const EMIModel *model, int *x1, int *y1, in double t = bottom; bottom = _gameHeight - top; top = _gameHeight - t; - + if (left < 0) left = 0; if (right >= _gameWidth) @@ -472,7 +472,7 @@ void GfxOpenGL::getScreenBoundingBox(const EMIModel *model, int *x1, int *y1, in top = 0; if (bottom >= _gameHeight) bottom = _gameHeight - 1; - + if (top >= _gameHeight || left >= _gameWidth || bottom < 0 || right < 0) { *x1 = -1; *y1 = -1; @@ -480,7 +480,7 @@ void GfxOpenGL::getScreenBoundingBox(const EMIModel *model, int *x1, int *y1, in *y2 = -1; return; } - + *x1 = (int)left; *y1 = (int)top; *x2 = (int)right; @@ -930,7 +930,7 @@ void GfxOpenGL::drawOverlay(const Overlay *overlay) { glEnable(GL_TEXTURE_2D); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - + glDisable(GL_LIGHTING); @@ -941,7 +941,7 @@ void GfxOpenGL::drawOverlay(const Overlay *overlay) { glDisable(GL_DEPTH_TEST); - + float height = overlay->getHeight() * _globalScaleH; float width = overlay->getWidth() * _globalScaleW; @@ -1910,7 +1910,7 @@ void GfxOpenGL::drawEmergString(int x, int y, const char *text, const Color &fgC glColor3f(1.0f, 1.0f, 1.0f); glListBase(_emergFont); - + char *list = const_cast(text); glCallLists(strlen(text), GL_UNSIGNED_BYTE, (void *)list); diff --git a/engines/grim/gfx_tinygl.cpp b/engines/grim/gfx_tinygl.cpp index ef9d4c3b2ea..f095a24ce4c 100644 --- a/engines/grim/gfx_tinygl.cpp +++ b/engines/grim/gfx_tinygl.cpp @@ -330,7 +330,7 @@ void GfxTinyGL::getScreenBoundingBox(const EMIModel *model, int *x1, int *y1, in for (uint i = 0; i < model->_numFaces; i++) { uint16 *indices = (uint16 *)model->_faces[i]._indexes; - + for (uint j = 0; j < model->_faces[i]._faceLength * 3; j++) { uint16 index = indices[j]; @@ -1184,10 +1184,10 @@ void GfxTinyGL::createTexture(Texture *texture, const uint8 *data, const CMap *c void GfxTinyGL::selectTexture(const Texture *texture) { TGLuint *textures = (TGLuint *)texture->_texture; tglBindTexture(TGL_TEXTURE_2D, textures[0]); - + if (texture->_hasAlpha && g_grim->getGameType() == GType_MONKEY4) { tglEnable(TGL_BLEND); - } + } // Grim has inverted tex-coords, EMI doesn't if (g_grim->getGameType() != GType_MONKEY4) { diff --git a/engines/grim/grim.h b/engines/grim/grim.h index da387007a5e..dd43aa77ec2 100644 --- a/engines/grim/grim.h +++ b/engines/grim/grim.h @@ -163,10 +163,10 @@ public: int getLanguage() const { return _language; } void setLanguage(int langId) { _language = langId; } Common::String getLanguagePrefix() const; - + bool isConceptEnabled(uint32 number) const; void enableConcept(uint32 number); - + bool isCutsceneEnabled(uint32 number) const; void enableCutscene(uint32 number); @@ -276,11 +276,11 @@ protected: static const uint32 kNumCutscenes = 40; bool _cutsceneEnabled[kNumCutscenes]; // TODO, could probably use a different data structure bool _conceptEnabled[kNumConcepts]; - + Common::String _saveMeta1; int _saveMeta2; Common::String _saveMeta3; - + Commentary *_commentary; public: diff --git a/engines/grim/lua/lauxlib.cpp b/engines/grim/lua/lauxlib.cpp index 332e38a60ab..9f8c52ff11c 100644 --- a/engines/grim/lua/lauxlib.cpp +++ b/engines/grim/lua/lauxlib.cpp @@ -45,7 +45,7 @@ float luaL_check_number(int32 numArg) { float luaL_opt_number(int32 numArg, float def) { return (lua_getparam(numArg) == LUA_NOOBJECT) ? def : luaL_check_number(numArg); -} +} lua_Object luaL_tablearg(int32 arg) { lua_Object o = lua_getparam(arg); diff --git a/engines/grim/lua/lopcodes.h b/engines/grim/lua/lopcodes.h index 18159f61ec8..e050f3d54e7 100644 --- a/engines/grim/lua/lopcodes.h +++ b/engines/grim/lua/lopcodes.h @@ -17,154 +17,154 @@ namespace Grim { typedef enum { // name parm before after side effect //----------------------------------------------------------------------------- - ENDCODE, // - - - + ENDCODE, // - - - - PUSHNIL, // b - nil_0...nil_b - PUSHNIL0, // - - nil + PUSHNIL, // b - nil_0...nil_b + PUSHNIL0, // - - nil - PUSHNUMBER, // b - (float)b - PUSHNUMBER0, // - - 0.0 - PUSHNUMBER1, // - - 1.0 - PUSHNUMBER2, // - - 2.0 - PUSHNUMBERW, // w - (float)w + PUSHNUMBER, // b - (float)b + PUSHNUMBER0, // - - 0.0 + PUSHNUMBER1, // - - 1.0 + PUSHNUMBER2, // - - 2.0 + PUSHNUMBERW, // w - (float)w - PUSHCONSTANT, // b - CNST[b] - PUSHCONSTANT0, // - - CNST[0] - PUSHCONSTANT1, // - - CNST[1] - PUSHCONSTANT2, // - - CNST[2] - PUSHCONSTANT3, // - - CNST[3] - PUSHCONSTANT4, // - - CNST[4] - PUSHCONSTANT5, // - - CNST[5] - PUSHCONSTANT6, // - - CNST[6] - PUSHCONSTANT7, // - - CNST[7] - PUSHCONSTANTW, // w - CNST[w] + PUSHCONSTANT, // b - CNST[b] + PUSHCONSTANT0, // - - CNST[0] + PUSHCONSTANT1, // - - CNST[1] + PUSHCONSTANT2, // - - CNST[2] + PUSHCONSTANT3, // - - CNST[3] + PUSHCONSTANT4, // - - CNST[4] + PUSHCONSTANT5, // - - CNST[5] + PUSHCONSTANT6, // - - CNST[6] + PUSHCONSTANT7, // - - CNST[7] + PUSHCONSTANTW, // w - CNST[w] - PUSHUPVALUE, // b - Closure[b] - PUSHUPVALUE0, // - - Closure[0] - PUSHUPVALUE1, // - - Closure[1] + PUSHUPVALUE, // b - Closure[b] + PUSHUPVALUE0, // - - Closure[0] + PUSHUPVALUE1, // - - Closure[1] - PUSHLOCAL, // b - LOC[b] - PUSHLOCAL0, // - - LOC[0] - PUSHLOCAL1, // - - LOC[1] - PUSHLOCAL2, // - - LOC[2] - PUSHLOCAL3, // - - LOC[3] - PUSHLOCAL4, // - - LOC[4] - PUSHLOCAL5, // - - LOC[5] - PUSHLOCAL6, // - - LOC[6] - PUSHLOCAL7, // - - LOC[7] + PUSHLOCAL, // b - LOC[b] + PUSHLOCAL0, // - - LOC[0] + PUSHLOCAL1, // - - LOC[1] + PUSHLOCAL2, // - - LOC[2] + PUSHLOCAL3, // - - LOC[3] + PUSHLOCAL4, // - - LOC[4] + PUSHLOCAL5, // - - LOC[5] + PUSHLOCAL6, // - - LOC[6] + PUSHLOCAL7, // - - LOC[7] - GETGLOBAL, // b - VAR[CNST[b]] - GETGLOBAL0, // - - VAR[CNST[0]] - GETGLOBAL1, // - - VAR[CNST[1]] - GETGLOBAL2, // - - VAR[CNST[2]] - GETGLOBAL3, // - - VAR[CNST[3]] - GETGLOBAL4, // - - VAR[CNST[4]] - GETGLOBAL5, // - - VAR[CNST[5]] - GETGLOBAL6, // - - VAR[CNST[6]] - GETGLOBAL7, // - - VAR[CNST[7]] - GETGLOBALW, // w - VAR[CNST[w]] + GETGLOBAL, // b - VAR[CNST[b]] + GETGLOBAL0, // - - VAR[CNST[0]] + GETGLOBAL1, // - - VAR[CNST[1]] + GETGLOBAL2, // - - VAR[CNST[2]] + GETGLOBAL3, // - - VAR[CNST[3]] + GETGLOBAL4, // - - VAR[CNST[4]] + GETGLOBAL5, // - - VAR[CNST[5]] + GETGLOBAL6, // - - VAR[CNST[6]] + GETGLOBAL7, // - - VAR[CNST[7]] + GETGLOBALW, // w - VAR[CNST[w]] - GETTABLE, // - i t t[i] + GETTABLE, // - i t t[i] - GETDOTTED, // b t t[CNST[b]] - GETDOTTED0, // - t t[CNST[0]] - GETDOTTED1, // - t t[CNST[1]] - GETDOTTED2, // - t t[CNST[2]] - GETDOTTED3, // - t t[CNST[3]] - GETDOTTED4, // - t t[CNST[4]] - GETDOTTED5, // - t t[CNST[5]] - GETDOTTED6, // - t t[CNST[6]] - GETDOTTED7, // - t t[CNST[7]] - GETDOTTEDW, // w t t[CNST[w]] + GETDOTTED, // b t t[CNST[b]] + GETDOTTED0, // - t t[CNST[0]] + GETDOTTED1, // - t t[CNST[1]] + GETDOTTED2, // - t t[CNST[2]] + GETDOTTED3, // - t t[CNST[3]] + GETDOTTED4, // - t t[CNST[4]] + GETDOTTED5, // - t t[CNST[5]] + GETDOTTED6, // - t t[CNST[6]] + GETDOTTED7, // - t t[CNST[7]] + GETDOTTEDW, // w t t[CNST[w]] - PUSHSELF, // b t t t[CNST[b]] - PUSHSELF0, // - t t t[CNST[0]] - PUSHSELF1, // - t t t[CNST[1]] - PUSHSELF2, // - t t t[CNST[2]] - PUSHSELF3, // - t t t[CNST[3]] - PUSHSELF4, // - t t t[CNST[4]] - PUSHSELF5, // - t t t[CNST[5]] - PUSHSELF6, // - t t t[CNST[6]] - PUSHSELF7, // - t t t[CNST[7]] - PUSHSELFW, // w t t t[CNST[w]] + PUSHSELF, // b t t t[CNST[b]] + PUSHSELF0, // - t t t[CNST[0]] + PUSHSELF1, // - t t t[CNST[1]] + PUSHSELF2, // - t t t[CNST[2]] + PUSHSELF3, // - t t t[CNST[3]] + PUSHSELF4, // - t t t[CNST[4]] + PUSHSELF5, // - t t t[CNST[5]] + PUSHSELF6, // - t t t[CNST[6]] + PUSHSELF7, // - t t t[CNST[7]] + PUSHSELFW, // w t t t[CNST[w]] - CREATEARRAY, // b - newarray(size = b) - CREATEARRAY0, // - - newarray(size = 0) - CREATEARRAY1, // - - newarray(size = 1) - CREATEARRAYW, // w - newarray(size = w) + CREATEARRAY, // b - newarray(size = b) + CREATEARRAY0, // - - newarray(size = 0) + CREATEARRAY1, // - - newarray(size = 1) + CREATEARRAYW, // w - newarray(size = w) - SETLOCAL, // b x - LOC[b]=x - SETLOCAL0, // - x - LOC[0]=x - SETLOCAL1, // - x - LOC[1]=x - SETLOCAL2, // - x - LOC[2]=x - SETLOCAL3, // - x - LOC[3]=x - SETLOCAL4, // - x - LOC[4]=x - SETLOCAL5, // - x - LOC[5]=x - SETLOCAL6, // - x - LOC[6]=x - SETLOCAL7, // - x - LOC[7]=x + SETLOCAL, // b x - LOC[b]=x + SETLOCAL0, // - x - LOC[0]=x + SETLOCAL1, // - x - LOC[1]=x + SETLOCAL2, // - x - LOC[2]=x + SETLOCAL3, // - x - LOC[3]=x + SETLOCAL4, // - x - LOC[4]=x + SETLOCAL5, // - x - LOC[5]=x + SETLOCAL6, // - x - LOC[6]=x + SETLOCAL7, // - x - LOC[7]=x - SETGLOBAL, // b x - VAR[CNST[b]]=x - SETGLOBAL0, // - x - VAR[CNST[0]]=x - SETGLOBAL1, // - x - VAR[CNST[1]]=x - SETGLOBAL2, // - x - VAR[CNST[2]]=x - SETGLOBAL3, // - x - VAR[CNST[3]]=x - SETGLOBAL4, // - x - VAR[CNST[4]]=x - SETGLOBAL5, // - x - VAR[CNST[5]]=x - SETGLOBAL6, // - x - VAR[CNST[6]]=x - SETGLOBAL7, // - x - VAR[CNST[7]]=x - SETGLOBALW, // w x - VAR[CNST[w]]=x + SETGLOBAL, // b x - VAR[CNST[b]]=x + SETGLOBAL0, // - x - VAR[CNST[0]]=x + SETGLOBAL1, // - x - VAR[CNST[1]]=x + SETGLOBAL2, // - x - VAR[CNST[2]]=x + SETGLOBAL3, // - x - VAR[CNST[3]]=x + SETGLOBAL4, // - x - VAR[CNST[4]]=x + SETGLOBAL5, // - x - VAR[CNST[5]]=x + SETGLOBAL6, // - x - VAR[CNST[6]]=x + SETGLOBAL7, // - x - VAR[CNST[7]]=x + SETGLOBALW, // w x - VAR[CNST[w]]=x - SETTABLE0, // - vci t - t[i]=v + SETTABLE0, // - vci t - t[i]=v - SETTABLE, // b v a_b...a_1 i t a_b...a_1 i t t[i]=v + SETTABLE, // b v a_b...a_1 i t a_b...a_1 i t t[i]=v - SETLIST, // b c v_c...v_1 t - t[i+b*FPF]=v_i - SETLIST0, // b v_b...v_1 t - t[i]=v_i - SETLISTW, // w c v_c...v_1 t - t[i+w*FPF]=v_i + SETLIST, // b c v_c...v_1 t - t[i+b*FPF]=v_i + SETLIST0, // b v_b...v_1 t - t[i]=v_i + SETLISTW, // w c v_c...v_1 t - t[i+w*FPF]=v_i - SETMAP, // b v_b k_b ...v_0 k_0 t t t[k_i]=v_i - SETMAP0, // - v_0 k_0 t t t[k_0]=v_0 + SETMAP, // b v_b k_b ...v_0 k_0 t t t[k_i]=v_i + SETMAP0, // - v_0 k_0 t t t[k_0]=v_0 - EQOP, // - y x (x==y)? 1 : nil - NEQOP, // - y x (x~=y)? 1 : nil - LTOP, // - y x (xy)? 1 : nil - GEOP, // - y x (x>=y)? 1 : nil - ADDOP, // - y x x+y - SUBOP, // - y x x-y - MULTOP, // - y x x*y - DIVOP, // - y x x/y - POWOP, // - y x x^y - CONCOP, // - y x x..y - MINUSOP, // - x -x - NOTOP, // - x (x==nil)? 1 : nil + EQOP, // - y x (x==y)? 1 : nil + NEQOP, // - y x (x~=y)? 1 : nil + LTOP, // - y x (xy)? 1 : nil + GEOP, // - y x (x>=y)? 1 : nil + ADDOP, // - y x x+y + SUBOP, // - y x x-y + MULTOP, // - y x x*y + DIVOP, // - y x x/y + POWOP, // - y x x^y + CONCOP, // - y x x..y + MINUSOP, // - x -x + NOTOP, // - x (x==nil)? 1 : nil - ONTJMP, // b x (x!=nil)? x : - (x!=nil)? PC+=b - ONTJMPW, // w x (x!=nil)? x : - (x!=nil)? PC+=w - ONFJMP, // b x (x==nil)? x : - (x==nil)? PC+=b - ONFJMPW, // w x (x==nil)? x : - (x==nil)? PC+=w - JMP, // b - - PC+=b - JMPW, // w - - PC+=w - IFFJMP, // b x - (x==nil)? PC+=b - IFFJMPW, // w x - (x==nil)? PC+=w - IFTUPJMP, // b x - (x!=nil)? PC-=b - IFTUPJMPW, // w x - (x!=nil)? PC-=w - IFFUPJMP, // b x - (x==nil)? PC-=b - IFFUPJMPW, // w x - (x==nil)? PC-=w + ONTJMP, // b x (x!=nil)? x : - (x!=nil)? PC+=b + ONTJMPW, // w x (x!=nil)? x : - (x!=nil)? PC+=w + ONFJMP, // b x (x==nil)? x : - (x==nil)? PC+=b + ONFJMPW, // w x (x==nil)? x : - (x==nil)? PC+=w + JMP, // b - - PC+=b + JMPW, // w - - PC+=w + IFFJMP, // b x - (x==nil)? PC+=b + IFFJMPW, // w x - (x==nil)? PC+=w + IFTUPJMP, // b x - (x!=nil)? PC-=b + IFTUPJMPW, // w x - (x!=nil)? PC-=w + IFFUPJMP, // b x - (x==nil)? PC-=b + IFFUPJMPW, // w x - (x==nil)? PC-=w - CLOSURE, // c f v_c...v_1 closure(f, v_c...v_1) - CLOSURE0, // - f closure(f) - CLOSURE1, // - f v closure(f, v) + CLOSURE, // c f v_c...v_1 closure(f, v_c...v_1) + CLOSURE0, // - f closure(f) + CLOSURE1, // - f v closure(f, v) - CALLFUNC, // b c v_c...v_1 f r_b...r_1 f(v1,...,v_c) - CALLFUNC0, // b v_b...v_1 f - f(v1,...,v_b) - CALLFUNC1, // b v_b...v_1 f r_1 f(v1,...,v_b) + CALLFUNC, // b c v_c...v_1 f r_b...r_1 f(v1,...,v_c) + CALLFUNC0, // b v_b...v_1 f - f(v1,...,v_b) + CALLFUNC1, // b v_b...v_1 f r_1 f(v1,...,v_b) - RETCODE, // b - - + RETCODE, // b - - - SETLINE, // b - - LINE=b - SETLINEW, // w - - LINE=w + SETLINE, // b - - LINE=b + SETLINEW, // w - - LINE=w POP, // b - - TOP-=(b+1) POP0, // - - - TOP-=1 diff --git a/engines/grim/lua_v1.cpp b/engines/grim/lua_v1.cpp index 0eeee37bdc9..24f81eb198d 100644 --- a/engines/grim/lua_v1.cpp +++ b/engines/grim/lua_v1.cpp @@ -580,7 +580,7 @@ void Lua_V1::SubmitSaveGameData() { savedState->write(str, len); } savedState->endSection(); - + //give ps2 saves a human-readable name if (g_grim->getGameType() == GType_MONKEY4 && g_grim->getGamePlatform() == Common::kPlatformPS2) { diff --git a/engines/grim/lua_v1_graphics.cpp b/engines/grim/lua_v1_graphics.cpp index 7107880b36f..166e128f5a7 100644 --- a/engines/grim/lua_v1_graphics.cpp +++ b/engines/grim/lua_v1_graphics.cpp @@ -170,7 +170,7 @@ void Lua_V1::DrawPolygon() { } // This code only supports 4 point polygons because the game doesn't - // use other than that. However, the original engine can support + // use other than that. However, the original engine can support // many points per polygon lua_Object pointObj; Common::Point p[4]; diff --git a/engines/grim/material.cpp b/engines/grim/material.cpp index d8fb7c94c19..c62969d07de 100644 --- a/engines/grim/material.cpp +++ b/engines/grim/material.cpp @@ -52,7 +52,7 @@ void loadPNG(Common::SeekableReadStream *data, Texture *t) { pngDecoder->loadStream(*data); Graphics::Surface *pngSurface =pngDecoder->getSurface()->convertTo(Graphics::PixelFormat(4, 8, 8, 8, 8, 0, 8, 16, 24), pngDecoder->getPalette()); - + t->_width = pngSurface->w; t->_height = pngSurface->h; t->_texture = nullptr; diff --git a/engines/grim/movie/codecs/codec48.cpp b/engines/grim/movie/codecs/codec48.cpp index 7e064caa236..21bf86e5499 100644 --- a/engines/grim/movie/codecs/codec48.cpp +++ b/engines/grim/movie/codecs/codec48.cpp @@ -283,7 +283,7 @@ void Codec48Decoder::decode3(byte *dst, const byte *src, int bufOffset) { for (int i = 0; i < _blockY; i++) { for (int j = 0; j < _blockX; j++) { byte opcode = *src++; - + switch (opcode) { case 0xFF: { @@ -340,7 +340,7 @@ void Codec48Decoder::decode3(byte *dst, const byte *src, int bufOffset) { scaleBuffer[10] = _interTable[(scaleBuffer[11] << 8) | scaleBuffer[9]]; scaleBuffer[12] = _interTable[(dst[_pitch * 4 - 1] << 8) | scaleBuffer[13]]; scaleBuffer[14] = _interTable[(scaleBuffer[15] << 8) | scaleBuffer[13]]; - + scaleBlock(dst, scaleBuffer); src += 4; @@ -453,7 +453,7 @@ void Codec48Decoder::decode3(byte *dst, const byte *src, int bufOffset) { // Copy 16 2x2 blocks using absolute offsets *((uint16 *)dst) = *((uint16 *)(dst + bufOffset + (int16)READ_LE_UINT16(src))); *((uint16 *)(dst + _pitch)) = *((uint16 *)(dst + bufOffset + (int16)READ_LE_UINT16(src) + _pitch)); - + *((uint16 *)(dst + 2)) = *((uint16 *)(dst + bufOffset + (int16)READ_LE_UINT16(src + 2) + 2)); *((uint16 *)(dst + _pitch + 2)) = *((uint16 *)(dst + bufOffset + (int16)READ_LE_UINT16(src + 2) + _pitch + 2)); diff --git a/engines/grim/patchr.cpp b/engines/grim/patchr.cpp index 0c313e84582..d8e1d379884 100644 --- a/engines/grim/patchr.cpp +++ b/engines/grim/patchr.cpp @@ -219,7 +219,7 @@ uint32 PatchedFile::read(void *dataPtr, uint32 dataSize) { WRITE_UINT32((uint32 *)data + i, READ_UINT32((uint32 *)data + i) ^ READ_UINT32((uint32 *)_diffBuffer + i)); for (uint32 i = diffRead - diffRead % 4; i < diffRead; ++i) data[i] ^= _diffBuffer[i]; - + readSize -= diffRead; data += diffRead; } diff --git a/engines/grim/registry.h b/engines/grim/registry.h index 7a48b469566..44488e9e60e 100644 --- a/engines/grim/registry.h +++ b/engines/grim/registry.h @@ -94,7 +94,7 @@ private: Value _spewOnError; Value _transcript; Value _dummy; - + // Remastered (TODO: Fix the type-handling), TODO: Disable for original Value _directorsCommentary; Value _widescreen; diff --git a/engines/grim/remastered/commentary.cpp b/engines/grim/remastered/commentary.cpp index 623f008e8ab..fcd0ed127ac 100644 --- a/engines/grim/remastered/commentary.cpp +++ b/engines/grim/remastered/commentary.cpp @@ -149,7 +149,7 @@ void Commentary::playCurrentCommentary() { warning("Commentary::playCurrentCommentary, no current commentary"); } } - + void Commentary::setCurrentCommentary(const Common::String &name) { warning("Commentary::setCurrentCommentary(%s)", name.c_str()); _currentCommentary = findCommentary(name); diff --git a/engines/grim/remastered/lua_remastered.cpp b/engines/grim/remastered/lua_remastered.cpp index 04f11af7bd0..b72d48cf050 100644 --- a/engines/grim/remastered/lua_remastered.cpp +++ b/engines/grim/remastered/lua_remastered.cpp @@ -416,7 +416,7 @@ void Lua_Remastered::AddHotspot() { } else if (!lua_isnil(param10)) { assert(lua_isnil(param10)); } - warning("Stub function: AddHotspot(%s, %f, %f, %f, %f, %f, %f, %f, %s, %s, %f)", lua_getstring(param1), lua_getnumber(param2), lua_getnumber(param3), lua_getnumber(param4), lua_getnumber(param5), lua_getnumber(param6), lua_getnumber(param7), lua_getnumber(param8), p9str, p10str, lua_getnumber(param11)); + warning("Stub function: AddHotspot(%s, %f, %f, %f, %f, %f, %f, %f, %s, %s, %f)", lua_getstring(param1), lua_getnumber(param2), lua_getnumber(param3), lua_getnumber(param4), lua_getnumber(param5), lua_getnumber(param6), lua_getnumber(param7), lua_getnumber(param8), p9str, p10str, lua_getnumber(param11)); Hotspot *hotspot = new Hotspot(lua_getstring(param1), lua_getnumber(param2), lua_getnumber(param3), lua_getnumber(param4), lua_getnumber(param5)); @@ -437,7 +437,7 @@ void Lua_Remastered::GlobalSaveResolved() { void Lua_Remastered::FindSaveGames() { warning("Stub function: FindSaveGames()"); - + Common::SaveFileManager *saveMan = g_grim->getSaveFileManager(); Common::StringArray saveFiles = saveMan->listSavefiles("grim_r???.sav"); @@ -447,13 +447,13 @@ void Lua_Remastered::FindSaveGames() { } lua_Object result = lua_createtable(); - + Common::StringArray::iterator it = saveFiles.begin(); for (int i = 0; it != saveFiles.end(); ++it) { const char *filename = (*it).c_str(); warning("Savefile: %s", filename); SaveGame *savedState = SaveGame::openForLoading(filename); - + if (!savedState || !savedState->isCompatible()) { if (!savedState) { error("Savegame %s is invalid", filename); @@ -472,7 +472,7 @@ void Lua_Remastered::FindSaveGames() { /*int32 dataSize = */savedState->beginSection('META'); char str[200] = {}; int32 strSize = 0; - + strSize = savedState->readLESint32(); savedState->read(str, strSize); str1 = str; @@ -482,7 +482,7 @@ void Lua_Remastered::FindSaveGames() { str2 = str; savedState->endSection(); delete savedState; - + lua_pushobject(result); lua_pushnumber(i++); @@ -491,7 +491,7 @@ void Lua_Remastered::FindSaveGames() { lua_Object keyVal = lua_createtable(); // The key-value-mapping: { - + lua_pushobject(keyVal); lua_pushstring("slot"); lua_pushnumber(slot); @@ -501,17 +501,17 @@ void Lua_Remastered::FindSaveGames() { lua_pushstring("title"); lua_pushstring(str2.c_str()); lua_settable(); - + lua_pushobject(keyVal); lua_pushstring("timeDateString"); lua_pushstring("Unknown"); lua_settable(); - + lua_pushobject(keyVal); lua_pushstring("mural_info"); lua_pushstring(str1.c_str()); lua_settable(); - + lua_pushobject(keyVal); lua_pushstring("setIndex"); lua_pushnumber(x); @@ -529,7 +529,7 @@ void Lua_Remastered::FindSaveGames() { void Lua_Remastered::Load() { lua_Object fileName = lua_getparam(1); // lua_Object param2 = lua_getparam(2); - + if (lua_isnil(fileName)) { g_grim->loadGame(""); } else if (lua_isnumber(fileName)) { @@ -553,12 +553,12 @@ void Lua_Remastered::Save() { assert(lua_isstring(param2)); assert(lua_isnumber(param3)); assert(lua_isstring(param4)); - + int slot = lua_getnumber(param1); const char *p2Str = lua_getstring(param2); int p3Num = lua_getnumber(param3); const char *p4Str = lua_getstring(param4); - + warning("REMASTERED save: %d, %s, %d, %s", slot, p2Str, p3Num, p4Str); Common::String saveGameFilename = Common::String::format("grim_r%03d.sav", slot); g_grim->setSaveMetaData(p2Str, p3Num, p4Str); @@ -675,7 +675,7 @@ struct luaL_reg remasteredMainOpcodes[] = { { "SetKeyMappingMode", LUA_OPCODE(Lua_Remastered, SetKeyMappingMode) }, { "ResetKeyMappingToDefault", LUA_OPCODE(Lua_Remastered, ResetKeyMappingToDefault) }, { "SaveRemappedKeys", LUA_OPCODE(Lua_Remastered, SaveRemappedKeys) }, - { "SaveRegistryToDisk", LUA_OPCODE(Lua_Remastered, SaveRegistryToDisk) }, + { "SaveRegistryToDisk", LUA_OPCODE(Lua_Remastered, SaveRegistryToDisk) }, { "InitiateFindSaveGames", LUA_OPCODE(Lua_Remastered, InitiateFindSaveGames) }, { "GetFindSaveGameStatus", LUA_OPCODE(Lua_Remastered, GetFindSaveGameStatus) }, { "FindSaveGames", LUA_OPCODE(Lua_Remastered, FindSaveGames) }, diff --git a/engines/grim/remastered/overlay.h b/engines/grim/remastered/overlay.h index deee164eb3a..e94cc954701 100644 --- a/engines/grim/remastered/overlay.h +++ b/engines/grim/remastered/overlay.h @@ -42,10 +42,10 @@ public: void setLayer(int layer) { _layer = layer; } int getWidth() const; int getHeight() const; - + static int32 getStaticTag() { return MKTAG('O','V','E','R'); } - + //private: Material *_material; diff --git a/engines/grim/shaders/grim_actor.fragment b/engines/grim/shaders/grim_actor.fragment index efd78e6f024..a19c9dc5296 100644 --- a/engines/grim/shaders/grim_actor.fragment +++ b/engines/grim/shaders/grim_actor.fragment @@ -19,7 +19,7 @@ const float offsetY = 32.0; OUTPUT -void checkZBuffer() +void checkZBuffer() { #ifndef SGSPLUS_FIX vec2 zCoord = vec2((gl_FragCoord.x-0.5)/screenSize.x, 1.0-(gl_FragCoord.y-offsetY-0.5)/screenSize.y); @@ -27,8 +27,8 @@ void checkZBuffer() vec2 zCoord = vec2((gl_FragCoord.x-0.5)/screenSize.x, (gl_FragCoord.y-offsetY-0.5)/screenSize.y); #endif vec2 sampled = texture(texZBuf, zCoord * texcropZBuf).ra; - float sceneZ = sampled.y + sampled.x / 256.0; - + float sceneZ = sampled.y + sampled.x / 256.0; + if (gl_FragCoord.z * 1.0039 > sceneZ) discard; } diff --git a/engines/grim/shaders/grim_actorlights.fragment b/engines/grim/shaders/grim_actorlights.fragment index efd78e6f024..a19c9dc5296 100644 --- a/engines/grim/shaders/grim_actorlights.fragment +++ b/engines/grim/shaders/grim_actorlights.fragment @@ -19,7 +19,7 @@ const float offsetY = 32.0; OUTPUT -void checkZBuffer() +void checkZBuffer() { #ifndef SGSPLUS_FIX vec2 zCoord = vec2((gl_FragCoord.x-0.5)/screenSize.x, 1.0-(gl_FragCoord.y-offsetY-0.5)/screenSize.y); @@ -27,8 +27,8 @@ void checkZBuffer() vec2 zCoord = vec2((gl_FragCoord.x-0.5)/screenSize.x, (gl_FragCoord.y-offsetY-0.5)/screenSize.y); #endif vec2 sampled = texture(texZBuf, zCoord * texcropZBuf).ra; - float sceneZ = sampled.y + sampled.x / 256.0; - + float sceneZ = sampled.y + sampled.x / 256.0; + if (gl_FragCoord.z * 1.0039 > sceneZ) discard; } diff --git a/engines/grim/shaders/grim_smush.vertex b/engines/grim/shaders/grim_smush.vertex index 07678292d2f..f40719ba8fa 100644 --- a/engines/grim/shaders/grim_smush.vertex +++ b/engines/grim/shaders/grim_smush.vertex @@ -10,7 +10,7 @@ out vec2 Texcoord; void main() { Texcoord = texcoord * texcrop; - + vec2 pos = scale * position + offset; // Coordinates are [0.0;1.0], transform [-1.0; 1.0] and flip Y pos.x = (pos.x * 2.0 - 1.0); diff --git a/engines/grim/shaders/grim_text.vertex b/engines/grim/shaders/grim_text.vertex index c3d2ef2736a..117ba58043d 100644 --- a/engines/grim/shaders/grim_text.vertex +++ b/engines/grim/shaders/grim_text.vertex @@ -6,7 +6,7 @@ out vec2 Texcoord; void main() { Texcoord = texcoord; - + // Coordinates are [0.0;1.0], transform to [-1.0; 1.0] vec2 pos = position; pos.x = pos.x * 2.0 - 1.0; diff --git a/engines/groovie/music.cpp b/engines/groovie/music.cpp index 55e56683068..9ee2822e388 100644 --- a/engines/groovie/music.cpp +++ b/engines/groovie/music.cpp @@ -215,7 +215,7 @@ void MusicPlayer::applyFading() { // the old track would be heard before the new track would start. // To prevent this, playback is actually stopped after fading out, // but _isPlaying remains true. This keeps the original - // interpreter behavior of not starting the background music, but + // interpreter behavior of not starting the background music, but // it prevents the issue when starting playback of a new track. unload(false); } diff --git a/engines/hadesch/ambient.cpp b/engines/hadesch/ambient.cpp index d34891081ae..22184b428e5 100644 --- a/engines/hadesch/ambient.cpp +++ b/engines/hadesch/ambient.cpp @@ -186,12 +186,12 @@ void AmbientAnim::play(bool reschedule) { room->playAnim(_internal->_descs[variant]._animName, _internal->_zValue, params, Common::SharedPtr(new AmbientAnimPlayEnded(*this, reschedule)), - _internal->_offset); - + _internal->_offset); + if (_internal->_descs[variant]._soundName != "") room->playSFX(_internal->_descs[variant]._soundName, -1); } - + void AmbientAnim::schedule() { if (_internal->_minInterval >= 0 && _internal->_maxInterval >= 0) g_vm->addTimer( diff --git a/engines/hadesch/ambient.h b/engines/hadesch/ambient.h index 05d2f50e394..d287f890da9 100644 --- a/engines/hadesch/ambient.h +++ b/engines/hadesch/ambient.h @@ -89,7 +89,7 @@ private: Common::SharedPtr _internal; }; - + class AmbientAnimWeightedSet { public: void readTableFilePriamSFX(const TextTable &table); diff --git a/engines/hadesch/gfx_context.cpp b/engines/hadesch/gfx_context.cpp index 63b7c201bcb..1e2e23e6d97 100644 --- a/engines/hadesch/gfx_context.cpp +++ b/engines/hadesch/gfx_context.cpp @@ -50,13 +50,13 @@ void blendVideo8To8(byte *targetPixels, int targetPitch, int targetW, int target void GfxContext8Bit::blitPodImage(byte *sourcePixels, int sourcePitch, int sourceW, int sourceH, byte *sourcePalette, size_t ncolours, Common::Point offset) { - + blendVideo8To8((byte *) surf.getPixels(), surf.pitch, surf.w, surf.h, sourcePixels, sourceW, sourceH, offset); for (unsigned i = 0; i < ncolours; i++) { int col = sourcePalette[4 * i] & 0xff; - + _palette[3 * col ] = sourcePalette[4 * i + 1]; _palette[3 * col + 1] = sourcePalette[4 * i + 2]; _palette[3 * col + 2] = sourcePalette[4 * i + 3]; diff --git a/engines/hadesch/hadesch.cpp b/engines/hadesch/hadesch.cpp index e5be8273a55..ef731874326 100644 --- a/engines/hadesch/hadesch.cpp +++ b/engines/hadesch/hadesch.cpp @@ -159,7 +159,7 @@ static const struct { 7491209, {0xB8DA2, 0x7246CB, 8691909}, {0x4109C, 0xB4628, 1007616} - } + } }; Common::MemoryReadStream *readWiseFile(Common::File &setupFile, const struct WiseFile &wiseFile) { @@ -638,7 +638,7 @@ Common::Error HadeschEngine::run() { default: break; } - } + } if (_isInOptions) { _currentTime = _system->getMillis() - _optionsEnterTime; @@ -665,7 +665,7 @@ Common::Error HadeschEngine::run() { Common::String oldhotzone = getVideoRoom()->getHotZone(); _mousePos = _eventMan->getMousePos(); getVideoRoom()->computeHotZone(_currentTime, _mousePos); - + Common::String newhotzone = getVideoRoom()->getHotZone(); if (oldhotzone != newhotzone) { @@ -775,7 +775,7 @@ void HadeschEngine::cancelTimer(int eventId) { Common::SharedPtr HadeschEngine::getCurrentHandler() { return _isInOptions ? _optionsHandler : _sceneHandler; } - + Common::SharedPtr HadeschEngine::getVideoRoom() { return _isInOptions ? _optionsRoom : _sceneVideoRoom; } diff --git a/engines/hadesch/hadesch.h b/engines/hadesch/hadesch.h index e4fc4d08936..36d212cf5bd 100644 --- a/engines/hadesch/hadesch.h +++ b/engines/hadesch/hadesch.h @@ -161,7 +161,7 @@ public: Common::SharedPtr getHeroBelt() { return _heroBelt; } - + int firstAvailableSlot(); void newGame(); @@ -202,7 +202,7 @@ private: Common::RandomSource _rnd; Common::String _cdScenesPath; - + Common::SharedPtr _sceneVideoRoom; Common::SharedPtr _sceneHandler; Common::SharedPtr _optionsRoom; diff --git a/engines/hadesch/herobelt.cpp b/engines/hadesch/herobelt.cpp index 3182fdebd23..b8b1a8817e6 100644 --- a/engines/hadesch/herobelt.cpp +++ b/engines/hadesch/herobelt.cpp @@ -247,7 +247,7 @@ void HeroBelt::render(Common::SharedPtr context, int time, Common::P if (_heroBeltY >= kHeroBeltMaxY) { _heroBeltY = kHeroBeltMaxY; _heroBeltSpeed = 0; - } + } } } @@ -360,7 +360,7 @@ void HeroBelt::render(Common::SharedPtr context, int time, Common::P case kNoQuest: case kNumQuests: break; - } + } bg[_colour].render(context, viewPoint); if (text != nullptr) text[_colour].render( diff --git a/engines/hadesch/hotzone.cpp b/engines/hadesch/hotzone.cpp index c5b32022074..ce497b7a882 100644 --- a/engines/hadesch/hotzone.cpp +++ b/engines/hadesch/hotzone.cpp @@ -88,7 +88,7 @@ void HotZoneArray::readHotzones(Common::SharedPtr hz tf.openStoreHot(hzFile); Common::ScopedPtr tcshStream(tf.getFileStream(MKTAG('T', 'C', 'S', 'H'))); int hzCnt = tcshStream->readUint32LE(); - + for (int idx = 0; idx < hzCnt; idx++) { Common::SharedPtr tdshFile(tf.getFileStream(MKTAG('T', 'D', 'S', 'H'), idx)); TagFile tdsh; @@ -114,10 +114,10 @@ void HotZoneArray::readHotzones(Common::SharedPtr hz Common::SharedPtr icshFile(tdsh.getFileStream(MKTAG('I', 'C', 'S', 'H'))); int icsh = icshFile->readUint32LE(); - + _hotZones.push_back(HotZone(polygon, name, enable, icsh)); - delete[] name; + delete[] name; } } diff --git a/engines/hadesch/persistent.cpp b/engines/hadesch/persistent.cpp index d034fb06e13..ebf63db6e79 100644 --- a/engines/hadesch/persistent.cpp +++ b/engines/hadesch/persistent.cpp @@ -212,7 +212,7 @@ bool Persistent::syncGameStream(Common::Serializer &s) { s.syncAsByte(_statuesTouched[i]); for (unsigned i = 0; i < ARRAYSIZE(_statuePhase); i++) s.syncAsByte(_statuePhase[i]); - + s.syncAsByte(_argoSaidTroyFinally); s.syncAsByte(_argoSaidCretePort); @@ -309,5 +309,5 @@ bool Persistent::syncGameStream(Common::Serializer &s) { return true; } - + } diff --git a/engines/hadesch/persistent.h b/engines/hadesch/persistent.h index b5f840d5ac5..d05e5392b52 100644 --- a/engines/hadesch/persistent.h +++ b/engines/hadesch/persistent.h @@ -30,7 +30,7 @@ #define HADESCH_PERSISTENT_H namespace Hadesch { - + struct HadeschSaveDescriptor { HadeschSaveDescriptor(Common::Serializer &s, int slot); @@ -176,7 +176,7 @@ struct Persistent { Persistent(); bool isInInventory(InventoryItem item); - + bool isRoomVisited(RoomId id) const { return _roomVisited[id]; } diff --git a/engines/hadesch/pod_image.cpp b/engines/hadesch/pod_image.cpp index 82f5e795363..80852001efa 100644 --- a/engines/hadesch/pod_image.cpp +++ b/engines/hadesch/pod_image.cpp @@ -78,7 +78,7 @@ bool PodImage::loadImage(const PodFile &col, int index) { for (int i = 0; i < _ncolors; i++) { int color = _palette.get()[4 * i] & 0xff; - + _paletteCursor.get()[3 * color ] = _palette.get()[4 * i + 1]; _paletteCursor.get()[3 * color + 1] = _palette.get()[4 * i + 2]; _paletteCursor.get()[3 * color + 2] = _palette.get()[4 * i + 3]; @@ -166,7 +166,7 @@ bool PodImage::loadImage(const PodFile &col, int index) { linerem = _w; pos = line * _w; } - + return true; } @@ -194,7 +194,7 @@ void PodImage::makeScale(int scale) const { } _scales[scale] = sv; } - + void PodImage::render(Common::SharedPtr context, Common::Point offset, int colourScale, @@ -218,7 +218,7 @@ void PodImage::render(Common::SharedPtr context, if (!_scales.contains(scale)) makeScale(scale); context->blitPodImage(_scales[scale]._pixels.get(), _scales[scale]._w, _scales[scale]._w, _scales[scale]._h, - scaledPalette ? scaledPalette : originalPalette, _ncolors, _pos * (scale / 100.0) + offset); + scaledPalette ? scaledPalette : originalPalette, _ncolors, _pos * (scale / 100.0) + offset); } if (scaledPalette) delete [] scaledPalette; diff --git a/engines/hadesch/rooms/argo.cpp b/engines/hadesch/rooms/argo.cpp index b6d0ac5784f..caba69d5eb8 100644 --- a/engines/hadesch/rooms/argo.cpp +++ b/engines/hadesch/rooms/argo.cpp @@ -239,7 +239,7 @@ public: } } } - + void handleMouseOut(const Common::String &name) override { Common::SharedPtr room = g_vm->getVideoRoom(); for (unsigned i = 0; i < nislands; i++) @@ -337,7 +337,7 @@ public: room->selectFrame("cloudmiddle", kCloudsZ, 1, Common::Point(220, 0) + Common::Point(220, -50) * div); room->selectFrame("cloudleft", kCloudsZ, 2, Common::Point(0, 0) + Common::Point(-200, -50) * div); } - + private: void playMastSound(const TranscribedSound &sound, int event = kMastSoundFinished) { Common::SharedPtr room = g_vm->getVideoRoom(); diff --git a/engines/hadesch/rooms/catacombs.cpp b/engines/hadesch/rooms/catacombs.cpp index 946ebabce7e..3eb1c08d993 100644 --- a/engines/hadesch/rooms/catacombs.cpp +++ b/engines/hadesch/rooms/catacombs.cpp @@ -204,7 +204,7 @@ public: } case 22009: room->playVideo("PhilQuickNameThatTune", 0); - break; + break; case 22012: room->playVideo("PhilWowLowOnTroops", 0); break; @@ -281,7 +281,7 @@ public: room->playSpeech(painSounds[persistent->_catacombLevel]); return; } - + if (level == 0) room->loadHotZones("CaDecode.HOT", false); room->playMusicLoop("T3010eA0"); @@ -440,7 +440,7 @@ private: room->disableMouse(); g_vm->cancelTimer(22007); persistent->_catacombPainAndPanic = true; - g_vm->moveToRoom(kCatacombsRoom); + g_vm->moveToRoom(kCatacombsRoom); break; } } diff --git a/engines/hadesch/rooms/crete.cpp b/engines/hadesch/rooms/crete.cpp index 788985ee1a5..b47a7326d4c 100644 --- a/engines/hadesch/rooms/crete.cpp +++ b/engines/hadesch/rooms/crete.cpp @@ -29,7 +29,7 @@ namespace Hadesch { static const char *kTalusImage = "r1100bb0"; -static const char *kTalusImageWithShip = "r1100bc0"; +static const char *kTalusImageWithShip = "r1100bc0"; static const char *kTalusMovie = "r1100ba0"; static const char *kTalusHotzone = "Talus"; static const char *kTavernImage = "r2190ba0"; @@ -68,7 +68,7 @@ static const char *vaseSegment[] = { "r1220bc0", "r1220bd0", "r1220be0", - "r1220bf0" + "r1220bf0" }; enum { @@ -426,7 +426,7 @@ public: persistent->_creteIntroAtlantisWood = false; } return; - + } if (name == "SmallDisk") { @@ -858,7 +858,7 @@ TODO: persistent->_creteHadesPusnishesPainAndPanic = false; return; } - + room->loadHotZones("Crete.HOT", false); room->addStaticLayer("r1010pa0", kBackgroundZ); // background g_vm->getHeroBelt()->setColour(HeroBelt::kWarm); @@ -871,7 +871,7 @@ TODO: room->playAnimLoop("r1120ba0", 5500); room->playAnimLoop("r1160ba0", 5000); room->playAnimLoop("r1170ba0", 5000); - + room->selectFrame(kTavernImage, kTavernImageZ, 0, kOffsetRightRoom); room->enableMouse(); room->setPannable(true); @@ -886,7 +886,7 @@ TODO: } room->setUserPanCallback(-1, -1, 12140, 12142); - + if (quest == kMedusaQuest && !persistent->_creteAlchemistExploded) { persistent->_creteAlchemistExploded = true; room->disableMouse(); @@ -1090,7 +1090,7 @@ TODO: showWomanDrawing = true; if (quest != kCreteQuest && quest != kTroyQuest) toughGuyPosition = 1; - else + else toughGuyPosition = g_vm->getRnd().getRandomBit(); break; case 7: @@ -1441,7 +1441,7 @@ private: Common::SharedPtr room = g_vm->getVideoRoom(); for(int i = 0; i < 4; i++) room->selectFrame(vaseSegment[i], 1000, _vasePos[i]); - + } void showSandals() { @@ -1493,7 +1493,7 @@ private: void redrawStrongBox() { Common::SharedPtr room = g_vm->getVideoRoom(); Persistent *persistent = g_vm->getPersistent(); - + room->setHotzoneEnabled("Potion", persistent->_creteStrongBoxState == Persistent::BOX_OPEN_POTION); room->setHotzoneEnabled("Latch", persistent->_creteStrongBoxState == Persistent::BOX_CLOSED); room->setHotzoneEnabled("ButtonN", persistent->_creteStrongBoxState == Persistent::BOX_OPEN); diff --git a/engines/hadesch/rooms/daedalus.cpp b/engines/hadesch/rooms/daedalus.cpp index 5593c386a21..08dd52148fd 100644 --- a/engines/hadesch/rooms/daedalus.cpp +++ b/engines/hadesch/rooms/daedalus.cpp @@ -115,7 +115,7 @@ public: labItem = -1; break; } - + if ((name == "daedalus" || name == "chute") && labItem < 0) { playDaedalusVideo("daedalus what to do with that", 13005, Common::Point(10, 40)); return true; @@ -142,7 +142,7 @@ public: room->playAnimWithSFX("dust cloud", "dust cloud sound", 850, PlayAnimParams::disappear()); - if (hasAll) + if (hasAll) playDaedalusVideo("daedalus exclaims", 13008, Common::Point(0, 2)); else { // Original goes to event 4009 diff --git a/engines/hadesch/rooms/ferry.cpp b/engines/hadesch/rooms/ferry.cpp index e2ffc8583cb..b25335e8f47 100644 --- a/engines/hadesch/rooms/ferry.cpp +++ b/engines/hadesch/rooms/ferry.cpp @@ -237,7 +237,7 @@ static const struct { { "V9170tI0", {"V9170nI0", _s("He must sit next to a smoking being") } }, { "V9170tJ0", {"V9170nJ0", _s("He must sit next to a hot being") } }, { "V9170tK0", {"V9170nK0", _s("He simply must sit next to a horned being") } }, // 45 - { "V9170tL0", {"V9170nL0", _s("He must sit next to a flat animal") } }, + { "V9170tL0", {"V9170nL0", _s("He must sit next to a flat animal") } }, { "V9170tM0", {"V9170nM0", _s("He must sit next to a flat being") } }, { "V9170tN0", {"V9170nN0", _s("He must sit next to an animal") } }, { "V9170tO0", {"V9170nO0", _s("He must sit next to a headless being") } }, @@ -872,7 +872,7 @@ private: yuck(); return false; } - + // "Must sit in front of" if (!isAttribMatch(pAfrontOf, cur->tabA) && pAfrontOf != nullptr) { diff --git a/engines/hadesch/rooms/minos.cpp b/engines/hadesch/rooms/minos.cpp index 7e0b0d203e9..fbac9af6719 100644 --- a/engines/hadesch/rooms/minos.cpp +++ b/engines/hadesch/rooms/minos.cpp @@ -199,7 +199,7 @@ public: case kMinosToss4: room->setLayerEnabled(kStatues, false); playMinosMovie("MovMinosToss4", kMinosStatueTossed, Common::Point(0, 191)); - break; + break; case kMinosStatueTossed: playMinosMovie("MovMinosBeGone", kMinosBackToIdleEvent, Common::Point(202, 229)); scheduleNagging(); diff --git a/engines/hadesch/rooms/minotaur.cpp b/engines/hadesch/rooms/minotaur.cpp index 2028da9284d..8782331fbb2 100644 --- a/engines/hadesch/rooms/minotaur.cpp +++ b/engines/hadesch/rooms/minotaur.cpp @@ -49,7 +49,7 @@ static const char *minotaurStates[] = { enum DaedalusDialogState { kMinotaur0 = 0, kMinotaur1 = 1, - kMinotaur2 = 2, + kMinotaur2 = 2, kMinotaurInactive = 3, kMinotaurEncourage = 4, kMinotaurTrapped = 5, @@ -355,7 +355,7 @@ private: // Hence if we have any movable walls then we can make immovable walls outer // and they will not conflict with existing labyrinths. // If we have no movable walls we can easily put all immovable walls as inner - + bool immovableAreOuter = !_current._cells[cell]._movableWalls.empty(); for (int j = 0; j < (int) _current._cells[cell]._immovableWalls.size(); j++) { diff --git a/engines/hadesch/rooms/monster.cpp b/engines/hadesch/rooms/monster.cpp index 7702f620c96..fda50f68641 100644 --- a/engines/hadesch/rooms/monster.cpp +++ b/engines/hadesch/rooms/monster.cpp @@ -81,7 +81,7 @@ public: case 526: g_vm->getHeroBelt()->setThunderboltFrame(kLightning3); break; - + case 15351: room->playAnimWithMusic(kZeusLight, "G0260MA0", kZeusLightZ, PlayAnimParams::keepLastFrame().partial(0, 4), diff --git a/engines/hadesch/rooms/monster.h b/engines/hadesch/rooms/monster.h index a18603182ff..413ecbc7e8f 100644 --- a/engines/hadesch/rooms/monster.h +++ b/engines/hadesch/rooms/monster.h @@ -95,7 +95,7 @@ private: void stopProjectiles(); Common::Array > _projectiles; - int _projectileId; + int _projectileId; }; struct Typhoon { @@ -180,7 +180,7 @@ public: Common::Point _attractor2; int _birdType; - + int _field84; // ? }; diff --git a/engines/hadesch/rooms/monster/illusion.cpp b/engines/hadesch/rooms/monster/illusion.cpp index 6d524534988..af23ea9f544 100644 --- a/engines/hadesch/rooms/monster/illusion.cpp +++ b/engines/hadesch/rooms/monster/illusion.cpp @@ -37,7 +37,7 @@ struct BirdInfo { const char *_interceptAnim; const char *_shootAnim; int _birdShootWidth; - int _birdShootHeight; + int _birdShootHeight; Common::Point getBirdSize() const { return Common::Point(_birdWidth, _birdHeight); @@ -57,7 +57,7 @@ static const TranscribedSound fakePhilReplics[] = { }; static const BirdInfo birdInfo[] = { - { + { 10, "v7220bh2", 151, 111, @@ -194,7 +194,7 @@ void Bird::makeFlightParams() { } _flightLengthMs = _flightLengthFrames * 100; - + _attractor1 = Common::Point( rnd.getRandomNumberRngSigned(-600, 600), rnd.getRandomNumberRngSigned(-600, 600)); diff --git a/engines/hadesch/rooms/monster/projectile.cpp b/engines/hadesch/rooms/monster/projectile.cpp index 71ac44436bc..3d83acf2e9c 100644 --- a/engines/hadesch/rooms/monster/projectile.cpp +++ b/engines/hadesch/rooms/monster/projectile.cpp @@ -45,7 +45,7 @@ Projectile::Projectile(int id, int level, Monster monster, int startScale, Commo _flyAnim = "V7140BC0"; _interceptAnim = "V7130BD2"; _hitAnim = "V7140BF0"; - break; + break; } _isMiss = g_vm->getRnd().getRandomNumberRng(0, getProjectileHitChance()) == 0; _isFlightFinished = false; @@ -82,7 +82,7 @@ void Projectile::stop() { void Projectile::makeFlightParams(int xmomentum) { Common::RandomSource &rnd = g_vm->getRnd(); _flightLengthMs = getProjectileFlightLength(_level) * 100; - + if (_isMiss) { switch (rnd.getRandomNumberRng(0, 2)) { case 0: @@ -103,7 +103,7 @@ void Projectile::makeFlightParams(int xmomentum) { rnd.getRandomNumberRng(100, 500), rnd.getRandomNumberRng(100, 300)); } - + switch (xmomentum) { case 1: _attractor1 = Common::Point( @@ -283,7 +283,7 @@ bool Projectile::tick(Common::SharedPtr backRef) { return true; } - + void Projectile::handleAbsoluteClick(Common::SharedPtr backRef, Common::Point p) { Common::SharedPtr room = g_vm->getVideoRoom(); if (_isFlightFinished || _flightCounterMs >= _flightLengthMs) diff --git a/engines/hadesch/rooms/options.cpp b/engines/hadesch/rooms/options.cpp index e0feda663b3..61aa334fd1a 100644 --- a/engines/hadesch/rooms/options.cpp +++ b/engines/hadesch/rooms/options.cpp @@ -135,7 +135,7 @@ public: if (hotname == "cancel") { switch (_currentMenu) { - case kLoadSlotMenu: + case kLoadSlotMenu: g_vm->resetOptionsRoom(); loadMenuUser(); break; @@ -302,7 +302,7 @@ public: g_vm->exitOptions(); return; } - + if (hotname == "quitgame") { g_vm->resetOptionsRoom(); @@ -413,7 +413,7 @@ public: } private: - void performSave() { + void performSave() { int slot = g_vm->firstAvailableSlot(); Persistent *persistent = g_vm->getPersistent(); Common::String heroNameUTF8 = persistent->_heroName.encode(Common::kUtf8); @@ -559,7 +559,7 @@ private: room->disableHotzone("arrowup"); room->disableHotzone("arrowdown"); } - + room->selectFrame("cancel", kButtonZ, 0); room->selectFrame("restore", kButtonZ, 0); room->selectFrame("delete", kButtonZ, 0); @@ -617,7 +617,7 @@ private: room->disableHotzone("arrowup"); room->disableHotzone("arrowdown"); } - + room->selectFrame("cancel", kButtonZ, 0); room->selectFrame("save", kButtonZ, 0); room->selectFrame("delete", kButtonZ, 0); diff --git a/engines/hadesch/rooms/riverstyx.cpp b/engines/hadesch/rooms/riverstyx.cpp index 30d7b8cf584..7843b7b67c2 100644 --- a/engines/hadesch/rooms/riverstyx.cpp +++ b/engines/hadesch/rooms/riverstyx.cpp @@ -46,7 +46,7 @@ struct StyxShadeInternal { _ambient.unpause(); room->enableMouse(); } - + Common::String _name; int _counter; AmbientAnim _ambient; @@ -135,7 +135,7 @@ public: if (persistent->_styxCharonUsedPotion) { room->playVideo("charon assumes you have gold sound", 0, 28004); } else { - + room->playVideo(_charonSound ? "charon says away 2 sound" : "charon says away 1 sound", 0, 28004); } return; diff --git a/engines/hadesch/rooms/troy.cpp b/engines/hadesch/rooms/troy.cpp index 1254c2c9d2f..51f8bea6793 100644 --- a/engines/hadesch/rooms/troy.cpp +++ b/engines/hadesch/rooms/troy.cpp @@ -440,7 +440,7 @@ public: if (room->isMouseEnabled()) { room->stopAnim(kOdysseusWithMessage); room->playVideo("t2140bc0", kOdysseusZ, 10048, Common::Point(650, 17)); - } + } break; case 10048: room->playAnimLoop(kOdysseusWithMessage, kOdysseusZ, Common::Point(800, 0)); diff --git a/engines/hadesch/rooms/walloffame.cpp b/engines/hadesch/rooms/walloffame.cpp index 630966f38db..f5c16d5a31a 100644 --- a/engines/hadesch/rooms/walloffame.cpp +++ b/engines/hadesch/rooms/walloffame.cpp @@ -104,7 +104,7 @@ static const char *kPanicAndPainSting = "pain and panic sting"; #define kHeroineStatue "heroine statue" static const char *kScroll = "scroll"; static const char *kScrollSound = "scroll sound"; - + static const char *kHeroBelt = "hero belt"; static const char *kHeroBeltUpSound = "hero belt up sound"; static const char *kHeroBeltDownSound = "hero belt down sound"; @@ -591,7 +591,7 @@ public: Common::Point(14, 320)); break; } - + int rnd = g_vm->getRnd().getRandomNumberRng(1, 10); debug("rnd = %d", rnd); switch(rnd) { @@ -813,7 +813,7 @@ public: room->addStaticLayer(kBackground, kBackgroundZ); room->addStaticLayer(kHerculesLintel, 900); room->addStaticLayer(kRope, 900); - Quest quest = persistent->_quest; + Quest quest = persistent->_quest; if (quest != kEndGame) { room->addStaticLayer(kArgo, 950, kOffsetRightRoom); room->enableHotzone("argo"); @@ -867,7 +867,7 @@ public: room->setHotZoneOffset(hz, kOffsetRightRoom); } } - + room->selectFrame(kScroll, kScrollZ, 0, kOffsetRightRoom); room->setPannable(true); if (newGame) { diff --git a/engines/hadesch/video.cpp b/engines/hadesch/video.cpp index 5918904422c..adcdd17798b 100644 --- a/engines/hadesch/video.cpp +++ b/engines/hadesch/video.cpp @@ -57,7 +57,7 @@ PlayAnimParams PlayAnimParams::loop() { PlayAnimParams PlayAnimParams::keepLastFrame() { return PlayAnimParams(false, true); } - + PlayAnimParams PlayAnimParams::disappear() { return PlayAnimParams(false, false); } @@ -77,11 +77,11 @@ int PlayAnimParams::getSpeed() { int PlayAnimParams::getFirstFrame() { return _firstFrame; } - + int PlayAnimParams::getLastFrame() { return _lastFrame; } - + PlayAnimParams PlayAnimParams::partial(int first, int last) const { PlayAnimParams ret(*this); ret._firstFrame = first; @@ -242,7 +242,7 @@ void VideoRoom::startAnimationInternal(const LayerId &name, int zValue, int mspe if (!modifiedZ.empty()) { for (Common::Array::iterator it = modifiedZ.begin(); it != modifiedZ.end(); it++) { _layers.insert(*it); - } + } } } @@ -363,7 +363,7 @@ void VideoRoom::computeHotZone(int time, Common::Point mousePos) { _rightEdge = false; Common::SharedPtr belt = g_vm->getHeroBelt(); - + if (_heroBeltEnabled) belt->computeHotZone(time, mousePos, _mouseEnabled); if (_heroBeltEnabled && belt->isOverHeroBelt()) { @@ -465,7 +465,7 @@ void VideoRoom::nextFrame(Common::SharedPtr context, int time, bool _panCallback = -1; _pan = 640; _panSpeed = 0; - } + } } if (_finalFadeSpeed != 0) { @@ -576,7 +576,7 @@ void VideoRoom::nextFrame(Common::SharedPtr context, int time, bool context->fade(_finalFade); if (!_subtitles.empty()) context->renderSubtitle(_subtitles.front().line, viewPoint); - + context->renderToScreen(viewPoint); } @@ -622,7 +622,7 @@ void VideoRoom::addAnimLayerInternal(const LayerId &name, int zValue, Common::Po pf2.openStore(rs); addLayer(new Renderable(pf2.loadImageArray()), name, zValue, false, - offset); + offset); } Renderable::Renderable(Common::Array images) { @@ -1109,6 +1109,6 @@ void VideoRoom::playSubtitles(const char *text, int subID) { l.maxTime = countTime; _subtitles.push(l); _countQueuedSubtitles[subID]++; - } + } } } diff --git a/engines/hadesch/video.h b/engines/hadesch/video.h index a1e41eb43dc..f80cf1e8594 100644 --- a/engines/hadesch/video.h +++ b/engines/hadesch/video.h @@ -280,7 +280,7 @@ public: Common::Point centerPos, int zVal, int fontDelta = 0, const Common::String &extraId = "letter"); void hideString(const Common::String &font, size_t maxLen, const Common::String &extraId = "letter"); int computeStringWidth(const Common::String &font, const Common::U32String &str, int fontDelta = 0); - + // Misc void playSFX(const Common::String &soundName, EventHandlerWrapper callbackEvent = EventHandlerWrapper()); diff --git a/engines/illusions/actor.cpp b/engines/illusions/actor.cpp index f32b43b49db..10e3578a458 100644 --- a/engines/illusions/actor.cpp +++ b/engines/illusions/actor.cpp @@ -228,7 +228,7 @@ void Control::unpause() { if (_objectId == Illusions::CURSOR_OBJECT_ID) _vm->setCursorControl(this); } - + if (_actor && !(_actor->_flags & Illusions::ACTOR_FLAG_200)) { SurfInfo surfInfo; ActorType *actorType = _vm->_dict->findActorType(_actorTypeId); diff --git a/engines/illusions/bbdou/bbdou_bubble.cpp b/engines/illusions/bbdou/bbdou_bubble.cpp index b2370f0004e..a110a7aee4b 100644 --- a/engines/illusions/bbdou/bbdou_bubble.cpp +++ b/engines/illusions/bbdou/bbdou_bubble.cpp @@ -103,7 +103,7 @@ void BbdouBubble::addBubbleStyle(uint32 showSequenceId, uint32 hideSequenceId, u } void BbdouBubble::show() { - + if (_showingBubbleStyle) { hide(); } diff --git a/engines/illusions/bbdou/menusystem_bbdou.cpp b/engines/illusions/bbdou/menusystem_bbdou.cpp index ab255be40de..5836646b23b 100644 --- a/engines/illusions/bbdou/menusystem_bbdou.cpp +++ b/engines/illusions/bbdou/menusystem_bbdou.cpp @@ -41,7 +41,7 @@ BBDOUMenuSystem::~BBDOUMenuSystem() { void BBDOUMenuSystem::runMenu(MenuChoiceOffsets menuChoiceOffsets, int16 *menuChoiceOffset, uint32 menuId, uint32 duration, uint timeOutMenuChoiceIndex, uint32 menuCallerThreadId) { - + debug(0, "BBDOUMenuSystem::runMenu(%08X)", menuId); setTimeOutDuration(duration, timeOutMenuChoiceIndex); diff --git a/engines/illusions/duckman/duckman_videoplayer.cpp b/engines/illusions/duckman/duckman_videoplayer.cpp index b2ccd630b9a..42defee2a5b 100644 --- a/engines/illusions/duckman/duckman_videoplayer.cpp +++ b/engines/illusions/duckman/duckman_videoplayer.cpp @@ -3,7 +3,7 @@ * ScummVM is the legal property of its developers, whose names * are too numerous to list here. Please refer to the COPYRIGHT * file distributed with this source distribution. - * + * * 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 diff --git a/engines/illusions/duckman/duckman_videoplayer.h b/engines/illusions/duckman/duckman_videoplayer.h index d2d7f1fc23f..0f773eff4a1 100644 --- a/engines/illusions/duckman/duckman_videoplayer.h +++ b/engines/illusions/duckman/duckman_videoplayer.h @@ -38,7 +38,7 @@ public: void stop(); void update(); bool isPlaying() const; -public: +public: IllusionsEngine_Duckman *_vm; Video::VideoDecoder *_videoDecoder; uint32 _callingThreadId; diff --git a/engines/illusions/resources/midiresource.h b/engines/illusions/resources/midiresource.h index 2b881bab9ad..05154e5392b 100644 --- a/engines/illusions/resources/midiresource.h +++ b/engines/illusions/resources/midiresource.h @@ -62,7 +62,7 @@ public: void load(Resource *resource) override; void unload() override; public: - IllusionsEngine *_vm; + IllusionsEngine *_vm; MidiGroupResource *_midiGroupResource; uint32 _resId; }; diff --git a/engines/illusions/saveload.cpp b/engines/illusions/saveload.cpp index a02c080a0e4..f46496abad4 100644 --- a/engines/illusions/saveload.cpp +++ b/engines/illusions/saveload.cpp @@ -133,7 +133,7 @@ Common::Error IllusionsEngine::loadGameState(int slot) { _savegameSlotNum = slot; return Common::kNoError; } - + Common::Error IllusionsEngine::saveGameState(int slot, const Common::String &description, bool isAutosave) { const char *fileName = getSavegameFilename(slot); if (!savegame(fileName, description.c_str())) diff --git a/engines/kingdom/logic1.cpp b/engines/kingdom/logic1.cpp index dc6139204a4..bb12aa90a08 100644 --- a/engines/kingdom/logic1.cpp +++ b/engines/kingdom/logic1.cpp @@ -918,7 +918,7 @@ void Logic::GPL1_161() { _vm->fadeToBlack1(); _vm->drawRect(4, 17, 228, 161, 0); _vm->restoreAS(); - break; + break; default: if (_vm->_userInput) warning("Skipped UserInput %d(0x%04X) for _StatPlay %d", _vm->_userInput, _vm->_userInput, _statPlay); @@ -1457,7 +1457,7 @@ void Logic::GPLogic1_SubSP121() { _vm->playSound(30); _vm->_bTimer = 190; _vm->readMouse(); - + while (_vm->_bTimer != 0 && _vm->_mouseButton == 0) { _vm->checkTimers(); _vm->refreshSound(); diff --git a/engines/metaengine.h b/engines/metaengine.h index b759693ec87..b4075be9763 100644 --- a/engines/metaengine.h +++ b/engines/metaengine.h @@ -156,7 +156,7 @@ public: * * @param target Name of a config manager target. * - * @return A list of extra GUI options for an engine plugin and target. + * @return A list of extra GUI options for an engine plugin and target. */ virtual const ExtraGuiOptions getExtraGuiOptions(const Common::String &target) const { return ExtraGuiOptions(); @@ -415,7 +415,7 @@ public: /** * Feature a thumbnail in savegames. * - * This means that the engine includes a thumbnail in save states + * This means that the engine includes a thumbnail in save states * returned via querySaveMetaInfo. * This flag can only be set when kSavesSupportMetaInfo is set. */ @@ -474,7 +474,7 @@ public: * * @param target Name of a config manager target. * - * @return A list of achievement descriptions for an engine plugin and target. + * @return A list of achievement descriptions for an engine plugin and target. */ virtual const Common::AchievementsInfo getAchievementsInfo(const Common::String &target) const { return Common::AchievementsInfo(); diff --git a/engines/mohawk/myst_stacks/myst.cpp b/engines/mohawk/myst_stacks/myst.cpp index 15eab936b33..de9a375d0c3 100644 --- a/engines/mohawk/myst_stacks/myst.cpp +++ b/engines/mohawk/myst_stacks/myst.cpp @@ -1712,7 +1712,7 @@ void Myst::observatoryIncrementDay(int16 increment) { // Update slider // WORKAROUND: Have the day setting increment at 315/100 rather than x3 so that the slider // will reach the bottom spot on day 31st. Only relevant when using the down button and - // not dragging the slider. Fixes Trac#10572. The original engine incremented it with x3 + // not dragging the slider. Fixes Trac#10572. The original engine incremented it with x3 // and has this bug, but it is less noticeable. _observatoryDaySlider->setPosition(91 + (_state.observatoryDaySetting * 315) / 100 ); _observatoryDaySlider->restoreBackground(); diff --git a/engines/mohawk/myst_state.h b/engines/mohawk/myst_state.h index 533d5eba8cd..fbbc4bc5999 100644 --- a/engines/mohawk/myst_state.h +++ b/engines/mohawk/myst_state.h @@ -94,7 +94,7 @@ enum DniEnding { kAtrusWantsPage = 1, // Player is in Dni with the white page kAtrusLeaves = 2, // Atrus leaves Dni after receiving the white page kForgotPage = 3, // Player has entered Dni without bringing the white page - kBooksDestroyed = 4 // Atrus returns to Dni after previously leaving + kBooksDestroyed = 4 // Atrus returns to Dni after previously leaving // and destroying the books of his sons }; diff --git a/engines/mohawk/riven_graphics.cpp b/engines/mohawk/riven_graphics.cpp index f6ec2c09f07..426c957523a 100644 --- a/engines/mohawk/riven_graphics.cpp +++ b/engines/mohawk/riven_graphics.cpp @@ -704,8 +704,8 @@ void RivenGraphics::updateCredits() { runScheduledTransition(); } else { // Otherwise, we're scrolling - // This is done by 1) moving the screen up one row and - // 2) adding a new row at the bottom that is the current row of the current image or + // This is done by 1) moving the screen up one row and + // 2) adding a new row at the bottom that is the current row of the current image or // not and it defaults to being empty (a black row). // Move the screen up one row diff --git a/engines/mohawk/riven_stacks/domespit.cpp b/engines/mohawk/riven_stacks/domespit.cpp index be577e3f12e..edf8f1c7635 100644 --- a/engines/mohawk/riven_stacks/domespit.cpp +++ b/engines/mohawk/riven_stacks/domespit.cpp @@ -138,7 +138,7 @@ int16 DomeSpit::getSliderSlotClosestToPos(uint16 startHotspot, const Common::Poi Common::Rect srcRect = hotspot->getRect(); // Only the x value of mouse position being in the hotspot matters // the y value of srcRect.top is chosen because it is in the rect. - Common::Point posBounded(pos.x, srcRect.top); + Common::Point posBounded(pos.x, srcRect.top); // Now clip the x value so it lies in the x extremes of the slider hotspots. // If this is not done then the user can move the x position past the // slider area and the slider won't go all the way to that end. diff --git a/engines/myst3/archive.cpp b/engines/myst3/archive.cpp index e4e537c19ef..fd6886da067 100644 --- a/engines/myst3/archive.cpp +++ b/engines/myst3/archive.cpp @@ -36,7 +36,7 @@ void Archive::decryptHeader(Common::SeekableReadStream &inStream, Common::WriteS uint32 size = inStream.readUint32LE(); bool encrypted = size > 1000000; - + inStream.seek(0); if (encrypted) { @@ -199,7 +199,7 @@ bool Archive::open(const char *fileName, const char *room) { readDirectory(); return true; } - + return false; } diff --git a/engines/myst3/console.cpp b/engines/myst3/console.cpp index b2c80d56c3d..fd8fe4781b9 100644 --- a/engines/myst3/console.cpp +++ b/engines/myst3/console.cpp @@ -168,7 +168,7 @@ bool Console::Cmd_Var(int argc, const char **argv) { if (var < 1 || var > 2047) { debugPrintf("Variable out of range %d\n", var); return true; - } + } uint32 value = _vm->_state->getVar(var); if (argc == 3) { diff --git a/engines/myst3/gfx_opengl_shaders.cpp b/engines/myst3/gfx_opengl_shaders.cpp index 4a50de74fa1..14b37ba66bd 100644 --- a/engines/myst3/gfx_opengl_shaders.cpp +++ b/engines/myst3/gfx_opengl_shaders.cpp @@ -289,8 +289,8 @@ void ShaderRenderer::draw2DText(const Common::String &text, const Common::Point float cy = textureRect.top / (float)glFont->internalHeight; const float charData[] = { - cx, cy + ch, x, y, - cx + cw, cy + ch, x + w, y, + cx, cy + ch, x, y, + cx + cw, cy + ch, x + w, y, cx + cw, cy, x + w, y + h, cx, cy, x, y + h, }; diff --git a/engines/myst3/gfx_opengl_texture.cpp b/engines/myst3/gfx_opengl_texture.cpp index 9be83e28662..fc494247862 100644 --- a/engines/myst3/gfx_opengl_texture.cpp +++ b/engines/myst3/gfx_opengl_texture.cpp @@ -109,7 +109,7 @@ void OpenGLTexture::updateTexture(const Graphics::Surface *surface, const Common const Graphics::Surface subArea = surface->getSubArea(rect); glPixelStorei(GL_UNPACK_ROW_LENGTH, surface->pitch / surface->format.bytesPerPixel); - + glTexSubImage2D(GL_TEXTURE_2D, 0, rect.left, rect.top, subArea.w, subArea.h, internalFormat, sourceFormat, const_cast(subArea.getPixels())); glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); } else { diff --git a/engines/myst3/movie.cpp b/engines/myst3/movie.cpp index 719c80cdfd3..9ba4b378fad 100644 --- a/engines/myst3/movie.cpp +++ b/engines/myst3/movie.cpp @@ -525,7 +525,7 @@ void ProjectorMovie::update() { // Compute the blur level from the focus point and the depth of the current point uint8 blurLevel = abs(focus - depth) + 1; - + // No need to compute the effect for transparent pixels byte a = *(dst + 3); if (a != 0) { diff --git a/engines/myst3/myst3.h b/engines/myst3/myst3.h index 9cf6ec1c547..cb205d29caf 100644 --- a/engines/myst3/myst3.h +++ b/engines/myst3/myst3.h @@ -103,7 +103,7 @@ public: Database *_db; Sound *_sound; Ambient *_ambient; - + Common::RandomSource *_rnd; // Used by the projectors on J'nanin, see puzzle #14 diff --git a/engines/myst3/shaders/myst3_box.vertex b/engines/myst3/shaders/myst3_box.vertex index c4d30df69b4..b4b6261e357 100644 --- a/engines/myst3/shaders/myst3_box.vertex +++ b/engines/myst3/shaders/myst3_box.vertex @@ -12,7 +12,7 @@ out vec2 Texcoord; void main() { Texcoord = texOffsetXY + texcoord * texSizeWH; - + // Coordinates are [0.0;1.0], transform to [-1.0; 1.0] vec2 pos = verOffsetXY + position * verSizeWH; pos.x = pos.x * 2.0 - 1.0; diff --git a/engines/myst3/shaders/myst3_cube.vertex b/engines/myst3/shaders/myst3_cube.vertex index d20da6207cb..ca77038db19 100644 --- a/engines/myst3/shaders/myst3_cube.vertex +++ b/engines/myst3/shaders/myst3_cube.vertex @@ -9,6 +9,6 @@ out vec2 Texcoord; void main() { Texcoord = texcoord * texScale; - + gl_Position = mvpMatrix * vec4(position, 1.0); } diff --git a/engines/myst3/shaders/myst3_text.vertex b/engines/myst3/shaders/myst3_text.vertex index c3d2ef2736a..117ba58043d 100644 --- a/engines/myst3/shaders/myst3_text.vertex +++ b/engines/myst3/shaders/myst3_text.vertex @@ -6,7 +6,7 @@ out vec2 Texcoord; void main() { Texcoord = texcoord; - + // Coordinates are [0.0;1.0], transform to [-1.0; 1.0] vec2 pos = position; pos.x = pos.x * 2.0 - 1.0; diff --git a/engines/nancy/action/leverpuzzle.cpp b/engines/nancy/action/leverpuzzle.cpp index 7406f0480f1..c2f2d066e92 100644 --- a/engines/nancy/action/leverpuzzle.cpp +++ b/engines/nancy/action/leverpuzzle.cpp @@ -46,7 +46,7 @@ void LeverPuzzle::init() { void LeverPuzzle::readData(Common::SeekableReadStream &stream) { readFilename(stream, _imageName); - _srcRects.reserve(3); + _srcRects.reserve(3); for (uint leverID = 0; leverID < 3; ++leverID) { _srcRects.push_back(Common::Array()); _srcRects.back().reserve(3); diff --git a/engines/nancy/action/primaryvideo.cpp b/engines/nancy/action/primaryvideo.cpp index 17e8579aaf6..d1ad71903d1 100644 --- a/engines/nancy/action/primaryvideo.cpp +++ b/engines/nancy/action/primaryvideo.cpp @@ -179,7 +179,7 @@ void PlayPrimaryVideoChan0::readData(Common::SeekableReadStream &stream) { if (ser.getVersion() == kGameTypeVampire) { readFilename(stream, _paletteName); } - + ser.skip(2); ser.syncAsUint16LE(_videoFormat); ser.skip(0x13, kGameTypeVampire, kGameTypeVampire); @@ -332,7 +332,7 @@ void PlayPrimaryVideoChan0::execute() { if (!ConfMan.getBool("speech_mute") && ConfMan.getBool("player_speech")) { g_nancy->_sound->playSound(_responseGenericSound); } - + _state = kActionTrigger; } } diff --git a/engines/nancy/action/sliderpuzzle.cpp b/engines/nancy/action/sliderpuzzle.cpp index 120d62fbb8c..beacceb8e7f 100644 --- a/engines/nancy/action/sliderpuzzle.cpp +++ b/engines/nancy/action/sliderpuzzle.cpp @@ -53,12 +53,12 @@ void SliderPuzzle::readData(Common::SeekableReadStream &stream) { for (uint y = 0; y < _height; ++y) { _srcRects.push_back(Common::Array()); _srcRects.back().reserve(_width); - + for (uint x = 0; x < _width; ++x) { _srcRects.back().push_back(Common::Rect()); readRect(stream, _srcRects.back().back()); } - + stream.skip((6 - _width) * 16); } diff --git a/engines/nancy/constants.cpp b/engines/nancy/constants.cpp index 1a853a96c99..5cf822befd6 100644 --- a/engines/nancy/constants.cpp +++ b/engines/nancy/constants.cpp @@ -42,7 +42,7 @@ const GameConstants gameConstants[] { 168, { 9, 10, 11, 666, 888, 1200, 1250, 1666, -1 }, { 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, -1 }, 12, 7, diff --git a/engines/nancy/cursor.cpp b/engines/nancy/cursor.cpp index 0397ae4f848..84784a6123c 100644 --- a/engines/nancy/cursor.cpp +++ b/engines/nancy/cursor.cpp @@ -111,7 +111,7 @@ void CursorManager::setCursor(CursorType type, int16 itemID) { // Create a temporary surface to hold the cursor since giving replaceCursor() a pointer // to the original surface results in garbage. This also makes it so we don't have to deal - // with TVD's palettes + // with TVD's palettes Graphics::ManagedSurface temp; temp.create(bounds.width(), bounds.height(), g_nancy->_graphicsManager->getScreenPixelFormat()); temp.blitFrom(*surf, bounds, Common::Point()); diff --git a/engines/nancy/dialogs.cpp b/engines/nancy/dialogs.cpp index 750d562954c..30e3b72dc6f 100644 --- a/engines/nancy/dialogs.cpp +++ b/engines/nancy/dialogs.cpp @@ -110,7 +110,7 @@ CheatDialog::CheatDialog() : GUI::Dialog(20, 20, 600, 440) { _frame = new GUI::EditTextWidget(_tabs, 35, 100, 45, 20, Common::U32String::format("%u", scene.frameID), Common::U32String(), kInputFrameNr, kInputFrameNr); new GUI::StaticTextWidget(_tabs, 85, 100, 150, 20, _("Frame Number"), Graphics::kTextAlignLeft); _offset = new GUI::EditTextWidget(_tabs, 35, 125, 45, 20, Common::U32String::format("%u", scene.verticalOffset), Common::U32String(), kInputScroll, kInputScroll); - + // I18N: The Y position (a.k.a vertical scroll) of the background new GUI::StaticTextWidget(_tabs, 85, 125, 150, 20, _("Background Top (Y)"), Graphics::kTextAlignLeft); diff --git a/engines/nancy/graphics.cpp b/engines/nancy/graphics.cpp index 6b512146e4c..5dadf47d563 100644 --- a/engines/nancy/graphics.cpp +++ b/engines/nancy/graphics.cpp @@ -34,7 +34,7 @@ namespace Nancy { GraphicsManager::GraphicsManager() : _objects(objectComparator), _inputPixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0), - _screenPixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0), + _screenPixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0), _clut8Format(Graphics::PixelFormat::createFormatCLUT8()) {} void GraphicsManager::init() { diff --git a/engines/nancy/metaengine.cpp b/engines/nancy/metaengine.cpp index d3555908057..472172a62f3 100644 --- a/engines/nancy/metaengine.cpp +++ b/engines/nancy/metaengine.cpp @@ -38,7 +38,7 @@ public: virtual int getMaximumSaveSlot() const override; virtual Common::KeymapArray initKeymaps(const char *target) const override; - + virtual GUI::OptionsContainerWidget *buildEngineOptionsWidgetDynamic(GUI::GuiObject *boss, const Common::String &name, const Common::String &target) const override; }; @@ -64,7 +64,7 @@ Common::Error NancyMetaEngine::createInstance(OSystem *syst, Engine **engine, co if (gd) { *engine = Nancy::NancyEngine::create(((const Nancy::NancyGameDescription *)gd)->gameType, syst, (const Nancy::NancyGameDescription *)gd); } - + if (gd) { return Common::kNoError; } else { diff --git a/engines/nancy/nancy.cpp b/engines/nancy/nancy.cpp index 49d4d5825e0..afc9f8d784d 100644 --- a/engines/nancy/nancy.cpp +++ b/engines/nancy/nancy.cpp @@ -224,7 +224,7 @@ void NancyEngine::setState(NancyState::NancyState state, NancyState::NancyState if (s) { s->onStateExit(); } - + s = getStateObject(_gameFlow.curState); if (s) { s->onStateEnter(); @@ -273,7 +273,7 @@ Common::Error NancyEngine::run() { while (!shouldQuit()) { _cursorManager->setCursorType(CursorManager::kNormalArrow); _input->processEvents(); - + State::State *s = getStateObject(_gameFlow.curState); if (s) { s->process(); diff --git a/engines/nancy/sound.cpp b/engines/nancy/sound.cpp index 0d71ca1da6a..21bca8b87c7 100644 --- a/engines/nancy/sound.cpp +++ b/engines/nancy/sound.cpp @@ -329,7 +329,7 @@ void SoundManager::playSound(const SoundDescription &description) { void SoundManager::playSound(const Common::String &chunkName) { const SoundDescription &desc = _commonSounds[chunkName]; - + if (!isSoundPlaying(desc)) { loadSound(desc); } diff --git a/engines/nancy/state/logo.cpp b/engines/nancy/state/logo.cpp index 67a30930630..9cc53880676 100644 --- a/engines/nancy/state/logo.cpp +++ b/engines/nancy/state/logo.cpp @@ -84,7 +84,7 @@ void Logo::stop() { // The original engine checks for N+D and N+C key combos here. // For the N+C key combo it looks for some kind of cheat file // to initialize the game state with. - + if (ConfMan.getBool("original_menus")) { g_nancy->setState(NancyState::kMainMenu); } else { diff --git a/engines/nancy/state/mainmenu.cpp b/engines/nancy/state/mainmenu.cpp index 25a015d6cd9..626b5c97910 100644 --- a/engines/nancy/state/mainmenu.cpp +++ b/engines/nancy/state/mainmenu.cpp @@ -112,7 +112,7 @@ void MainMenu::run() { g_nancy->_sound->playSound("BUOK"); _playedOKSound = true; } - + _selected = i; _state = kStop; @@ -138,7 +138,7 @@ void MainMenu::stop() { if (Scene::hasInstance()) { NancySceneState.destroy(); // Simply destroy the existing Scene and create a new one } - + g_nancy->setState(NancyState::kScene); break; case 2: @@ -166,7 +166,7 @@ void MainMenu::stop() { // Game Setup, TODO _state = kRun; break; - case 6: + case 6: // Exit Game g_nancy->quitGame(); break; diff --git a/engines/nancy/ui/scrollbar.cpp b/engines/nancy/ui/scrollbar.cpp index c7fa3345a83..ec9abc1c7c7 100644 --- a/engines/nancy/ui/scrollbar.cpp +++ b/engines/nancy/ui/scrollbar.cpp @@ -37,7 +37,7 @@ Scrollbar::Scrollbar(RenderObject &redrawFrom, uint16 zOrder, const Common::Rect _currentPosition(0), _maxDist(scrollDistance) { _drawSurface.create(g_nancy->_graphicsManager->_object0, srcBounds); - + _startPosition = topPosition; _startPosition.x -= srcBounds.width() / 2; diff --git a/engines/nancy/ui/viewport.cpp b/engines/nancy/ui/viewport.cpp index ac262098341..6ed902bf9a1 100644 --- a/engines/nancy/ui/viewport.cpp +++ b/engines/nancy/ui/viewport.cpp @@ -71,7 +71,7 @@ void Viewport::handleInput(NancyInput &input) { } else { viewportActiveZone = _screenPosition; } - + if (viewportActiveZone.contains(input.mousePos)) { g_nancy->_cursorManager->setCursorType(CursorManager::kNormal); @@ -183,7 +183,7 @@ void Viewport::loadVideo(const Common::String &filename, uint frameNr, uint vert if (_decoder.isVideoLoaded()) { _decoder.close(); } - + if (!_decoder.loadFile(filename + ".avf")) { error("Couldn't load video file %s", filename.c_str()); } @@ -274,7 +274,7 @@ void Viewport::scrollDown(uint delta) { } uint16 Viewport::getMaxScroll() const { - return _fullFrame.h - _drawSurface.h - (g_nancy->getGameType() == kGameTypeVampire ? 1 : 0); + return _fullFrame.h - _drawSurface.h - (g_nancy->getGameType() == kGameTypeVampire ? 1 : 0); } Common::Rect Viewport::getBoundsByFormat(uint format) const { diff --git a/engines/nancy/ui/viewport.h b/engines/nancy/ui/viewport.h index e944cb23490..3b307ceedc7 100644 --- a/engines/nancy/ui/viewport.h +++ b/engines/nancy/ui/viewport.h @@ -49,7 +49,7 @@ public: _videoFormat(0), _stickyCursorPos(-1, -1), _dontWrap(kFalse) {} - + virtual ~Viewport() { _decoder.close(); _fullFrame.free(); } virtual void init() override; diff --git a/engines/pink/objects/actions/action_talk.cpp b/engines/pink/objects/actions/action_talk.cpp index 10e5fd4492e..66d1813897a 100644 --- a/engines/pink/objects/actions/action_talk.cpp +++ b/engines/pink/objects/actions/action_talk.cpp @@ -19,7 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * */ - + #include "pink/archive.h" #include "pink/cel_decoder.h" #include "pink/pink.h" diff --git a/engines/pink/objects/actions/action_talk.h b/engines/pink/objects/actions/action_talk.h index dc6dbc04c8c..75b3bfbc22e 100644 --- a/engines/pink/objects/actions/action_talk.h +++ b/engines/pink/objects/actions/action_talk.h @@ -43,7 +43,7 @@ public: protected: void onStart() override; - bool isTalk() override { return true; } + bool isTalk() override { return true; } private: Common::String _vox; diff --git a/engines/plumbers/plumbers.cpp b/engines/plumbers/plumbers.cpp index 1af4d0abcb2..9f937790ef4 100644 --- a/engines/plumbers/plumbers.cpp +++ b/engines/plumbers/plumbers.cpp @@ -433,7 +433,7 @@ void PlumbersGame::loadMikeDecision(const Common::String &dirname, const Common: Common::String nameW = Common::String::format("%s%dW.CEL", baseName.c_str(), i + 1); if (!fileW.open(nameW)) error("unable to load image %s", nameW.c_str()); - + _image->loadStream(fileW); surf->copyRectToSurface(*_image->getSurface(), p.x + sz.x, p.y, Common::Rect(0, 0, sz.x, sz.y)); @@ -479,7 +479,7 @@ void PlumbersGame::drawScreen() { modSurf.create(surface->w, surface->h, pf); modSurf.copyRectToSurface(*surface, 0, 0, Common::Rect(0, 0, surface->w, surface->h)); const Common::Rect rec = _scenes[_curSceneIdx]._choices[_hiLite]._region; - + for (int y = rec.top; y <= rec.bottom; y++) { uint16 *p = (uint16 *) modSurf.getPixels() + modSurf.w * y + rec.left; for (int x = rec.left; x < rec.right; x++, p++) { @@ -885,7 +885,7 @@ void PlumbersGame::readTables3DO(const Common::String &fileName) { if (!firstImg.contains(scene)) firstImg[scene] = bitmapCtr; } - + uint scPtr = 0; makeVideo(_scenes[scPtr++], "kirinweaver", "janp1weaver"); makeVideo(_scenes[scPtr++], "janp1weaver", "janp2weaver"); @@ -898,7 +898,7 @@ void PlumbersGame::readTables3DO(const Common::String &fileName) { _scenes[scPtr]._decisionBitmap = "DEC00"; _scenes[scPtr]._choices[0]._sceneName = "miketest/sc01"; _scenes[scPtr++]._choices[1]._sceneName = "miketest/sc07a"; - + for (uint scNo = 1; scNo <= 13; scNo++, scPtr++) { Common::String imgScene = scNo == 5 ? "sc44" : Common::String::format("sc%02d", scNo); @@ -958,7 +958,7 @@ void PlumbersGame::readTables3DO(const Common::String &fileName) { _scenes[scPtr]._choices[1]._sceneName = "restart"; _scenes[scPtr]._choices[1]._points = 0; scPtr++; - + for (uint scNo = 15; scNo <= 32; scNo++) { // there is no sc19 if (scNo == 19) diff --git a/engines/plumbers/plumbers.h b/engines/plumbers/plumbers.h index be38b5e45f2..38d57256c83 100644 --- a/engines/plumbers/plumbers.h +++ b/engines/plumbers/plumbers.h @@ -60,7 +60,7 @@ struct Choice { Common::Rect _region; Common::String _sceneName; }; - + struct Scene { int _bitmapNum; int _startBitmap; @@ -109,7 +109,7 @@ private: bool _setDurationFl; bool _leftButtonDownFl; bool _endGameFl; - bool _timerInstalled; + bool _timerInstalled; int _curSceneIdx, _prvSceneIdx; int _curBitmapIdx; int _curChoice; diff --git a/engines/private/grammar.cpp b/engines/private/grammar.cpp index a6d0fdf77fd..0eca0072943 100644 --- a/engines/private/grammar.cpp +++ b/engines/private/grammar.cpp @@ -1214,7 +1214,7 @@ yyreduce: case 6: /* line: SETTINGTOK NAME '{' statements '}' */ #line 102 "engines/private/grammar.y" - { g_setts->save((yyvsp[-3].s)); + { g_setts->save((yyvsp[-3].s)); g_setts->init(); } #line 1220 "engines/private/grammar.cpp" break; @@ -1231,7 +1231,7 @@ yyreduce: (yyval.inst) = g_vm->_progp; code2(strpush, (Inst) g_private->maps.constant(STRING, 0, (yyvsp[-1].s))); code2(constpush, (Inst) g_private->maps.constant(NUM, 1, NULL)); - code2(strpush, (Inst) g_private->maps.constant(STRING, 0, "goto")); + code2(strpush, (Inst) g_private->maps.constant(STRING, 0, "goto")); code1(funcpush); } #line 1238 "engines/private/grammar.cpp" @@ -1248,18 +1248,18 @@ yyreduce: { /* else-less if */ ((yyvsp[-3].inst))[1] = (Inst)(yyvsp[-1].inst); /* thenpart */ - ((yyvsp[-3].inst))[3] = (Inst)(yyvsp[0].inst); + ((yyvsp[-3].inst))[3] = (Inst)(yyvsp[0].inst); } #line 1254 "engines/private/grammar.cpp" break; case 14: /* statement: if cond body end ELSETOK body end */ #line 127 "engines/private/grammar.y" - { + { /* if with else */ ((yyvsp[-6].inst))[1] = (Inst)(yyvsp[-4].inst); /* thenpart */ ((yyvsp[-6].inst))[2] = (Inst)(yyvsp[-1].inst); /* elsepart */ - ((yyvsp[-6].inst))[3] = (Inst)(yyvsp[0].inst); + ((yyvsp[-6].inst))[3] = (Inst)(yyvsp[0].inst); } #line 1265 "engines/private/grammar.cpp" break; @@ -1296,10 +1296,10 @@ yyreduce: case 21: /* define: NAME ',' RECT '(' NUM ',' NUM ',' NUM ',' NUM ')' ',' define */ #line 149 "engines/private/grammar.y" - { + { Common::Rect *r = new Common::Rect((yyvsp[-9].sym)->u.val, (yyvsp[-7].sym)->u.val, (yyvsp[-5].sym)->u.val, (yyvsp[-3].sym)->u.val); - assert(r->isValidRect()); - g_private->maps.defineSymbol((yyvsp[-13].s), r); + assert(r->isValidRect()); + g_private->maps.defineSymbol((yyvsp[-13].s), r); } #line 1305 "engines/private/grammar.cpp" break; @@ -1307,8 +1307,8 @@ yyreduce: case 22: /* define: NAME ',' RECT '(' NUM ',' NUM ',' NUM ',' NUM ')' */ #line 154 "engines/private/grammar.y" { - Common::Rect *r = new Common::Rect((yyvsp[-7].sym)->u.val, (yyvsp[-5].sym)->u.val, (yyvsp[-3].sym)->u.val, (yyvsp[-1].sym)->u.val); - g_private->maps.defineSymbol((yyvsp[-11].s), r); + Common::Rect *r = new Common::Rect((yyvsp[-7].sym)->u.val, (yyvsp[-5].sym)->u.val, (yyvsp[-3].sym)->u.val, (yyvsp[-1].sym)->u.val); + g_private->maps.defineSymbol((yyvsp[-11].s), r); } #line 1314 "engines/private/grammar.cpp" break; @@ -1331,7 +1331,7 @@ yyreduce: (yyval.inst) = g_vm->_progp; code2(strpush, (Inst) g_private->maps.constant(STRING, 0, (yyvsp[-1].s))); code2(constpush, (Inst) g_private->maps.constant(NUM, 1, NULL)); - code2(strpush, (Inst) g_private->maps.constant(STRING, 0, "goto")); + code2(strpush, (Inst) g_private->maps.constant(STRING, 0, "goto")); code1(funcpush); } #line 1338 "engines/private/grammar.cpp" @@ -1348,7 +1348,7 @@ yyreduce: { (yyval.inst) = (yyvsp[-2].inst); code2(constpush, (Inst) g_private->maps.constant(NUM, (yyvsp[-1].narg), NULL)); - code2(strpush, (Inst) g_private->maps.constant(STRING, 0, (yyvsp[-4].s))); + code2(strpush, (Inst) g_private->maps.constant(STRING, 0, (yyvsp[-4].s))); code1(funcpush); } #line 1355 "engines/private/grammar.cpp" diff --git a/engines/private/lexer.cpp b/engines/private/lexer.cpp index fcc7e36769d..30a829c4fbf 100644 --- a/engines/private/lexer.cpp +++ b/engines/private/lexer.cpp @@ -293,7 +293,7 @@ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. + * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 @@ -310,7 +310,7 @@ typedef uint32_t flex_uint32_t; typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; +typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; @@ -421,10 +421,10 @@ extern FILE *yyin, *yyout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 - + #define YY_LESS_LINENO(n) #define YY_LINENO_REWIND_TO(ptr) - + /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ @@ -849,9 +849,9 @@ extern int yywrap ( void ); #endif //#ifndef YY_NO_UNPUT -// +// // static void yyunput ( int c, char *buf_ptr ); -// +// //#endif #ifndef yytext_ptr @@ -978,7 +978,7 @@ YY_DECL yy_state_type yy_current_state; char *yy_cp, *yy_bp; int yy_act; - + if ( !(yy_init) ) { (yy_init) = 1; @@ -1461,7 +1461,7 @@ static int yy_get_next_buffer (void) { yy_state_type yy_current_state; char *yy_cp; - + yy_current_state = (yy_start); for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) @@ -1517,7 +1517,7 @@ static int yy_get_next_buffer (void) // static void yyunput (int c, char * yy_bp ) //{ // char *yy_cp; -// +// // yy_cp = (yy_c_buf_p); // // /* undo effects of setting up yytext */ @@ -1562,7 +1562,7 @@ static int yy_get_next_buffer (void) { int c; - + *(yy_c_buf_p) = (yy_hold_char); if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) @@ -1629,12 +1629,12 @@ static int yy_get_next_buffer (void) /** Immediately switch to a different input stream. * @param input_file A readable stream. - * + * * @note This function does not reset the start condition to @c INITIAL . */ void yyrestart (FILE * input_file ) { - + if ( ! YY_CURRENT_BUFFER ){ yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = @@ -1647,11 +1647,11 @@ static int yy_get_next_buffer (void) /** Switch to a different input buffer. * @param new_buffer The new input buffer. - * + * */ void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) { - + /* TODO. We should be able to replace this entire function body * with * yypop_buffer_state(); @@ -1691,13 +1691,13 @@ static void yy_load_buffer_state (void) /** Allocate and initialize an input buffer state. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. - * + * * @return the allocated buffer state. */ YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) { YY_BUFFER_STATE b; - + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); @@ -1720,11 +1720,11 @@ static void yy_load_buffer_state (void) /** Destroy the buffer. * @param b a buffer created with yy_create_buffer() - * + * */ void yy_delete_buffer (YY_BUFFER_STATE b ) { - + if ( ! b ) return; @@ -1745,7 +1745,7 @@ static void yy_load_buffer_state (void) { int oerrno = errno; - + yy_flush_buffer( b ); b->yy_input_file = file; @@ -1761,13 +1761,13 @@ static void yy_load_buffer_state (void) } b->yy_is_interactive = 0; - + errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. - * + * */ void yy_flush_buffer (YY_BUFFER_STATE b ) { @@ -1796,7 +1796,7 @@ static void yy_load_buffer_state (void) * the current state. This function will allocate the stack * if necessary. * @param new_buffer The new state. - * + * */ void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) { @@ -1826,7 +1826,7 @@ void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) /** Removes and deletes the top of the stack, if present. * The next element becomes the new top. - * + * */ void yypop_buffer_state (void) { @@ -1850,7 +1850,7 @@ void yypop_buffer_state (void) static void yyensure_buffer_stack (void) { yy_size_t num_to_alloc; - + if (!(yy_buffer_stack)) { /* First allocation is just for 2 elements, since we don't know if this @@ -1893,13 +1893,13 @@ static void yyensure_buffer_stack (void) /** Setup the input buffer state to scan directly from a user-specified character buffer. * @param base the character buffer * @param size the size in bytes of the character buffer - * + * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) { YY_BUFFER_STATE b; - + if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) @@ -1928,14 +1928,14 @@ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) /** Setup the input buffer state to scan a string. The next call to yylex() will * scan from a @e copy of @a str. * @param yystr a NUL-terminated string to scan - * + * * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use * yy_scan_bytes() instead. */ YY_BUFFER_STATE yy_scan_string (const char * yystr ) { - + return yy_scan_bytes( yystr, (int) strlen(yystr) ); } @@ -1943,7 +1943,7 @@ YY_BUFFER_STATE yy_scan_string (const char * yystr ) * scan from a @e copy of @a bytes. * @param yybytes the byte buffer to scan * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. - * + * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len ) @@ -1952,7 +1952,7 @@ YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len ) char *buf; yy_size_t n; int i; - + /* Get memory for full buffer, including space for trailing EOB's. */ n = (yy_size_t) (_yybytes_len + 2); buf = (char *) yyalloc( n ); @@ -2006,16 +2006,16 @@ static void yynoreturn yy_fatal_error (const char* msg ) /* Accessor methods (get/set functions) to struct members. */ /** Get the current line number. - * + * */ int yyget_lineno (void) { - + return yylineno; } /** Get the input stream. - * + * */ FILE *yyget_in (void) { @@ -2023,7 +2023,7 @@ FILE *yyget_in (void) } /** Get the output stream. - * + * */ FILE *yyget_out (void) { @@ -2031,7 +2031,7 @@ FILE *yyget_out (void) } /** Get the length of the current token. - * + * */ int yyget_leng (void) { @@ -2039,7 +2039,7 @@ int yyget_leng (void) } /** Get the current token. - * + * */ char *yyget_text (void) @@ -2049,18 +2049,18 @@ char *yyget_text (void) /** Set the current line number. * @param _line_number line number - * + * */ void yyset_lineno (int _line_number ) { - + yylineno = _line_number; } /** Set the input stream. This does not discard the current * input buffer. * @param _in_str A readable stream. - * + * * @see yy_switch_to_buffer */ void yyset_in (FILE * _in_str ) @@ -2114,7 +2114,7 @@ static int yy_init_globals (void) /* yylex_destroy is for both reentrant and non-reentrant scanners. */ int yylex_destroy (void) { - + /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ yy_delete_buffer( YY_CURRENT_BUFFER ); @@ -2140,7 +2140,7 @@ int yylex_destroy (void) #ifndef yytext_ptr static void yy_flex_strncpy (char* s1, const char * s2, int n ) { - + int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; @@ -2165,7 +2165,7 @@ void *yyalloc (yy_size_t size ) void *yyrealloc (void * ptr, yy_size_t size ) { - + /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter diff --git a/engines/saga/gfx.h b/engines/saga/gfx.h index d3c6f89e712..5c68c4641ee 100644 --- a/engines/saga/gfx.h +++ b/engines/saga/gfx.h @@ -120,7 +120,7 @@ struct Surface : Graphics::Surface { // This clears a 2x scaled rect (used for Japanese font removal). // The pixels buffer only gets allocated for game versions that actually require it. if (!pixels) - return; + return; fillRect(Common::Rect(r.left << 1, r.top << 1, r.right << 1, r.bottom << 1), 0); } }; diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp index 8cec13e38f0..8b5a44536e0 100644 --- a/engines/sci/console.cpp +++ b/engines/sci/console.cpp @@ -4052,7 +4052,7 @@ bool Console::cmdBreakpointAction(int argc, const char **argv) { for (; bp != end; ++bp) bp->_action = bpaction; _debugState.updateActiveBreakpointTypes(); - return true; + return true; } const int idx = atoi(argv[1]); diff --git a/engines/sci/detection.cpp b/engines/sci/detection.cpp index 69b567634bc..239b6cb7337 100644 --- a/engines/sci/detection.cpp +++ b/engines/sci/detection.cpp @@ -262,7 +262,7 @@ static const ADExtraGuiOptionsMap optionsList[] = { true } }, - + // SCI16 games: use RGB renderer instead of indexed { GAMEOPTION_RGB_RENDERING, @@ -273,7 +273,7 @@ static const ADExtraGuiOptionsMap optionsList[] = { false } }, - + // SCI16 games: use custom per-resource palettes to improve visuals { GAMEOPTION_PALETTE_MODS, diff --git a/engines/sci/engine/features.cpp b/engines/sci/engine/features.cpp index 494db51b09a..910bbbb7156 100644 --- a/engines/sci/engine/features.cpp +++ b/engines/sci/engine/features.cpp @@ -644,7 +644,7 @@ int GameFeatures::detectPlaneIdBase() { else return 20000; } - + bool GameFeatures::autoDetectMoveCountType() { // Look up the script address reg_t addr = getDetectionAddr("Motion", SELECTOR(doit)); @@ -731,7 +731,7 @@ bool GameFeatures::generalMidiOnly() { return (sound.exists() && sound.getTrackByType(/* AdLib */ 0) == nullptr); } default: - if (g_sci->getPlatform() == Common::kPlatformMacintosh && + if (g_sci->getPlatform() == Common::kPlatformMacintosh && getSciVersion() >= SCI_VERSION_2_1_MIDDLE) { return true; } diff --git a/engines/sci/engine/features.h b/engines/sci/engine/features.h index 42de583b880..3c0893fd6aa 100644 --- a/engines/sci/engine/features.h +++ b/engines/sci/engine/features.h @@ -235,7 +235,7 @@ public: MoveCountType detectMoveCountType(); int detectPlaneIdBase(); - + bool handleMoveCount() { return detectMoveCountType() == kIncrementMoveCount; } bool usesCdTrack() { return _usesCdTrack; } diff --git a/engines/sci/engine/file.cpp b/engines/sci/engine/file.cpp index 93d977697fa..7431d171f1f 100644 --- a/engines/sci/engine/file.cpp +++ b/engines/sci/engine/file.cpp @@ -269,7 +269,7 @@ FileHandle *getFileFromHandle(EngineState *s, uint handle) { int fgets_wrapper(EngineState *s, char *dest, int maxsize, int handle) { // always initialize because some scripts don't test for errors and - // just use the results, even from invalid file handles. bug #12060 + // just use the results, even from invalid file handles. bug #12060 memset(dest, 0, maxsize); FileHandle *f = getFileFromHandle(s, handle); @@ -342,7 +342,7 @@ bool fillSavegameDesc(const Common::String &filename, SavegameDesc &desc) { Common::U32String nameU32String = meta.name.decode(Common::kUtf8); nameString = nameU32String.encode(Common::kWindows1255); } - + // At least Phant2 requires use of strncpy, since it creates save game // names of exactly kMaxSaveNameLength strncpy(desc.name, nameString.c_str(), kMaxSaveNameLength); @@ -360,7 +360,7 @@ void listSavegames(Common::Array &saves) { // exclude new game and autosave slots, except for QFG3/4, // whose autosave should appear as a normal saved game - if (g_sci->getGameId() != GID_QFG3 && + if (g_sci->getGameId() != GID_QFG3 && g_sci->getGameId() != GID_QFG4) { const int id = strtol(filename.end() - 3, NULL, 10); if (id == kNewGameId || id == kAutoSaveId) { diff --git a/engines/sci/engine/hoyle5poker.cpp b/engines/sci/engine/hoyle5poker.cpp index 12232365055..f7a72021881 100644 --- a/engines/sci/engine/hoyle5poker.cpp +++ b/engines/sci/engine/hoyle5poker.cpp @@ -363,7 +363,7 @@ reg_t hoyle5PokerEngine(SciArray *data) { error("Unknown Poker logic operation: %d", operation); break; } - + return TRUE_REG; } diff --git a/engines/sci/engine/kmisc.cpp b/engines/sci/engine/kmisc.cpp index 6aae9820017..9c0b75a4e04 100644 --- a/engines/sci/engine/kmisc.cpp +++ b/engines/sci/engine/kmisc.cpp @@ -630,7 +630,7 @@ reg_t kMacKq7RestoreGame(EngineState *s) { return NULL_REG; } - // gamestate_restore() resets s->_kq7MacSaveGameId and + // gamestate_restore() resets s->_kq7MacSaveGameId and // s->_kq7MacSaveGameDescription so save and restore them. int kq7MacSaveGameId = s->_kq7MacSaveGameId; Common::String kq7MacSaveGameDescription = s->_kq7MacSaveGameDescription; @@ -690,7 +690,7 @@ reg_t kMacPlatform32(EngineState *s, int argc, reg_t *argv) { return kMacKq7InitializeSave(s); } else if (argc == 3) { return kMacInitializeSave(s, argc - 1, argv + 1); - } + } break; case 4: if (argc == 1) { diff --git a/engines/sci/engine/kpathing.cpp b/engines/sci/engine/kpathing.cpp index 772665362ca..f148d3e579e 100644 --- a/engines/sci/engine/kpathing.cpp +++ b/engines/sci/engine/kpathing.cpp @@ -319,7 +319,7 @@ static void draw_line(EngineState *s, Common::Point p1, Common::Point p2, int ty // Red : Barred access // Yellow: Contained access int poly_colors[4] = { 0, 0, 0, 0 }; - + if (getSciVersion() <= SCI_VERSION_1_1) { poly_colors[0] = g_sci->_gfxPalette16->kernelFindColor(0, 255, 0); // green poly_colors[1] = g_sci->_gfxPalette16->kernelFindColor(0, 0, 255); // blue @@ -330,7 +330,7 @@ static void draw_line(EngineState *s, Common::Point p1, Common::Point p2, int ty poly_colors[0] = g_sci->_gfxPalette32->matchColor(0, 255, 0); // green poly_colors[1] = g_sci->_gfxPalette32->matchColor(0, 0, 255); // blue poly_colors[2] = g_sci->_gfxPalette32->matchColor(255, 0, 0); // red - poly_colors[3] = g_sci->_gfxPalette32->matchColor(255, 255, 0); // yellow + poly_colors[3] = g_sci->_gfxPalette32->matchColor(255, 255, 0); // yellow #endif } diff --git a/engines/sci/engine/ksound.cpp b/engines/sci/engine/ksound.cpp index 3e898bc3bca..5f60d46c840 100644 --- a/engines/sci/engine/ksound.cpp +++ b/engines/sci/engine/ksound.cpp @@ -193,7 +193,7 @@ reg_t kDoAudio(EngineState *s, int argc, reg_t *argv) { g_sci->_audio->stopAudio(); // In SSCI, kDoAudio handles all samples, even if started by kDoSound. - // We manage samples started by kDoSound in SoundCommandParser. + // We manage samples started by kDoSound in SoundCommandParser. g_sci->_soundCmd->stopAllSamples(); if (argc == 2) { @@ -226,7 +226,7 @@ reg_t kDoAudio(EngineState *s, int argc, reg_t *argv) { debugC(kDebugLevelSound, "kDoAudio: stop"); g_sci->_audio->stopAudio(); // In SSCI, kDoAudio handles all samples, even if started by kDoSound. - // We manage samples started by kDoSound in SoundCommandParser. + // We manage samples started by kDoSound in SoundCommandParser. g_sci->_soundCmd->stopAllSamples(); break; case kSciAudioPause: diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp index 3852b6bb02b..7713062fef4 100644 --- a/engines/sci/engine/script_patches.cpp +++ b/engines/sci/engine/script_patches.cpp @@ -422,7 +422,7 @@ static const uint16 sci21IntArrayPatch[] = { static const uint16 sci2BenchmarkSignature[] = { SIG_MAGICDWORD, 0x76, // push0 - 0x46, SIG_UINT16(0xfd8c), // calle proc64908_0 [ speed test function ] + 0x46, SIG_UINT16(0xfd8c), // calle proc64908_0 [ speed test function ] SIG_UINT16(0x0000), SIG_UINT16(0x0000), SIG_END @@ -1972,7 +1972,7 @@ static const uint16 freddypharkasPatchMacInventory[] = { // only plays once and macThing proceeds. // // This buggy script didn't break in the original because the Mac interpreter -// didn't support looping sounds. It always played sounds just once and then +// didn't support looping sounds. It always played sounds just once and then // signaled when they were complete and ignored the value of the loop property. // This was most apparent in the KQ6 Mac port. All the room music, which was // designed to loop, stopped abruptly after a minute in a room and then @@ -3817,7 +3817,7 @@ static const uint16 gk1MacTalismanInsetSignature[] = { 0x78, // push1 0x78, // push1 0x81, 0x09, // lag 09 - 0x4a, SIG_UINT16(0x0006), // send 06 [ GKInventory hide: 1 ] + 0x4a, SIG_UINT16(0x0006), // send 06 [ GKInventory hide: 1 ] 0x39, SIG_SELECTOR8(doit), // pushi doit 0x38, SIG_MAGICDWORD, // pushi 0008 SIG_UINT16(0x0008), @@ -3997,7 +3997,7 @@ static const uint16 gk2VolumeResetPatch[] = { // Responsible method: GK2:init static const uint16 gk2BenchmarkSignature[] = { 0x76, // push0 - 0x40, SIG_ADDTOOFFSET(+2), // call speed test proc + 0x40, SIG_ADDTOOFFSET(+2), // call speed test proc SIG_MAGICDWORD, SIG_UINT16(0x0000), 0x65, 0x28, // aTop speedRating @@ -4012,7 +4012,7 @@ static const uint16 gk2BenchmarkPatch[] = { }; // GK2 has a complex sound bug which causes seemingly random lockups when -// changing rooms in many areas including the Herrenchiemse Museum, the Hunt +// changing rooms in many areas including the Herrenchiemse Museum, the Hunt // Club, and St. Georg Church. This also occurs in the original. // // SoundManager continuously plays an array of sounds provided to its play @@ -4157,7 +4157,7 @@ static const uint16 gk2XaverBlackWolfkPatch[] = { // Asking Georg about "Ludwig's letter to the Conductor" is required to finish // the chapter. This topic becomes available after looking at the "Ludwig and // Wagner" plaque in Herrenchiemsee and then clicking again to read it aloud. -// The problem is that the rest of the game only cares about looking at the +// The problem is that the rest of the game only cares about looking at the // plaque. If Herrenchiemsee is completed without reading the plaque then the // Hint feature claims everything is done and the player appears to be stuck. // @@ -5605,7 +5605,7 @@ static const uint16 kq6PatchTruncatedMessagesFix[] = { // Responsible method: chink:doVerb static const uint16 kq6SignatureCassimaSecretPassage[] = { SIG_MAGICDWORD, - 0x67, 0x1a, // pTos noun + 0x67, 0x1a, // pTos noun 0x3c, // dup 0x35, 0x04, // ldi 04 0x1a, // eq? @@ -5614,14 +5614,14 @@ static const uint16 kq6SignatureCassimaSecretPassage[] = { 0x78, // push1 0x78, // push1 0x38, SIG_UINT16(0x0321), // pushi 0321 - 0x43, 0x02, 0x02, // callk ScriptID 02 [ ScriptID 801 ] + 0x43, 0x02, 0x02, // callk ScriptID 02 [ ScriptID 801 ] 0x36, // push 0x81, 0x02, // lag 02 0x4a, 0x06, // send 06 [ rm800 setScript: cassimaScript ] 0x33, 0x10, // jmp 10 0x38, SIG_SELECTOR16(setScript), // pushi setScript SIG_ADDTOOFFSET(+5), - 0x43, 0x02, 0x02, // callk ScriptID 02 [ ScriptID 802 ] + 0x43, 0x02, 0x02, // callk ScriptID 02 [ ScriptID 802 ] SIG_END }; @@ -5632,7 +5632,7 @@ static const uint16 kq6PatchCassimaSecretPassage[] = { 0x4a, 0x04, // send 04 [ rm800 script? ] 0x31, 0x01, // bnt 01 0x48, // ret [ do nothing if script is running ] - 0x67, 0x1a, // pTos noun + 0x67, 0x1a, // pTos noun 0x3c, // dup 0x35, 0x04, // ldi 04 0x1a, // eq? @@ -6610,7 +6610,7 @@ static const uint16 kq7SnakeOilSalesmanPatch[] = { 0x76, // push0 0x72, PATCH_UINT16(0x15b4), // lofsa snakeSalesman 0x4a, PATCH_UINT16(0x0004), // send 04 [ snakeSalesman: dispose ] - 0x32, PATCH_UINT16(0xfd26), // jmp fd26 [ KQEgo setHeading and end of method ] + 0x32, PATCH_UINT16(0xfd26), // jmp fd26 [ KQEgo setHeading and end of method ] PATCH_END }; @@ -9799,7 +9799,7 @@ static const uint16 phant1WineCaskHotspotSignature[] = { 0x45, 0x03, SIG_UINT16(0x0002), // callb proc0_3 [ seen barrel video? ] 0x18, // not 0x2f, 0x0f, // bt 0f - 0x89, 0x6a, // lsg 6a + 0x89, 0x6a, // lsg 6a 0x35, 0x06, // ldi 06 0x1c, // ne? [ is not chapter 6? ] 0x31, 0x21, // bnt 21 [ skip hotspot ] @@ -10604,7 +10604,7 @@ static const uint16 phant2ComputerScrollbarCrashPatch[] = { // member of its mouser collection, but User:doit only passes these events on // if User:hogs is empty. Loading the control panel adds its button to the hogs // stack which prevents DItem:track from being called and updating the flag. -// +// // We fix this by setting the global mouse-moved flag whenever a scrollbar arrow // is pressed. ScrollbarArrow:handleEvent already calls DItem:track, so setting // this flag before then causes it to always evaluate the incoming event and @@ -20254,7 +20254,7 @@ static const uint16 sq6SaveDialogMessageSignature[] = { 0x78, // push1 0x8b, 0x04, // lsl 04 0x35, 0x01, // ldi 01 - 0x1a, // eq? + 0x1a, // eq? 0x31, 0x04, // bnt 04 [ skip if not saving ] 0x35, 0x00, // ldi 00 [ message priority: 0 ] SIG_END diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp index d56c3d92916..22a6056680a 100644 --- a/engines/sci/engine/scriptdebug.cpp +++ b/engines/sci/engine/scriptdebug.cpp @@ -129,7 +129,7 @@ reg_t disassemble(EngineState *s, reg_t pos, const Object *obj, bool printBWTag, } for (i = bytecount; i < 5; i++) - if (printCSyntax) + if (printCSyntax) debugN(" "); else debugN(" "); @@ -1124,7 +1124,7 @@ void logBacktrace() { case EXEC_STACK_TYPE_CALL: // Normal function if (call.type == EXEC_STACK_TYPE_CALL) con->debugPrintf(" %x: script %d - ", i, s->_segMan->getScript(call.addr.pc.getSegment())->getScriptNumber()); - + if (call.debugSelector != -1) { con->debugPrintf("%s::%s(", objname, g_sci->getKernel()->getSelectorName(call.debugSelector).c_str()); } else if (call.debugExportId != -1) { diff --git a/engines/sci/graphics/maccursor32.h b/engines/sci/graphics/maccursor32.h index 906c1c135d7..1425e770f31 100644 --- a/engines/sci/graphics/maccursor32.h +++ b/engines/sci/graphics/maccursor32.h @@ -36,7 +36,7 @@ namespace Sci { * * GfxCursor32 was modeled after the PC SSCI structure in which cursors are * views that use the game's palette. It draws the cursor directly to the - * game's frame. Mac cursors have their own individual palettes and are drawn + * game's frame. Mac cursors have their own individual palettes and are drawn * independent of the rest of the game. GfxMacCursor32 uses CursorManager to * handle this, since it supports cursor palettes, and disables the GfxCursor32 * functionality which CursorManager handles. diff --git a/engines/sci/graphics/scifx.cpp b/engines/sci/graphics/scifx.cpp index d296be5d272..a0a678186e9 100644 --- a/engines/sci/graphics/scifx.cpp +++ b/engines/sci/graphics/scifx.cpp @@ -52,66 +52,66 @@ static const PaletteMod paletteModsLSL2[] = { static const PicMod picModsLSL2[] = { // LSL2 per-resource palette configuration // Copyright (C) 2006 Matt Hargett - { 28, 1 }, { 99, 1 }, { 96, 5 }, { 92, 2 }, { 93, 2 }, - { 18, 2 }, { 20, 2 }, { 21, 2 }, { 22, 2 }, { 23, 2 }, - { 24, 2 }, { 25, 2 }, { 26, 2 }, { 134, 2 }, { 40, 2 }, - { 50, 2 }, { 76, 2 }, { 77, 2 }, { 78, 2 }, { 79, 2 }, - { 80, 2 }, { 81, 2 }, { 82, 2 }, { 181, 2 }, { 114, 13 }, - { 115, 13 }, { 116, 13 }, { 117, 13 }, { 118, 13 }, { 125, 13 }, - { 11, 13 }, { 12, 13 }, { 13, 13 }, { 14, 13 }, { 15, 13 }, - { 16, 13 }, { 17, 13 }, { 19, 13 }, { 43, 13 }, { 70, 13 }, - { 71, 13 }, { 72, 13 }, { 73, 13 }, { 74, 13 }, { 44, 13 }, - { 86, 13 }, { 101, 13 }, { 102, 13 }, { 103, 13 }, { 104, 13 }, - { 32, 13 }, { 33, 13 }, { 35, 13 }, { 36, 13 }, { 95, 13 }, - { 10, 15 }, { 90, 15 }, { 91, 15 }, + { 28, 1 }, { 99, 1 }, { 96, 5 }, { 92, 2 }, { 93, 2 }, + { 18, 2 }, { 20, 2 }, { 21, 2 }, { 22, 2 }, { 23, 2 }, + { 24, 2 }, { 25, 2 }, { 26, 2 }, { 134, 2 }, { 40, 2 }, + { 50, 2 }, { 76, 2 }, { 77, 2 }, { 78, 2 }, { 79, 2 }, + { 80, 2 }, { 81, 2 }, { 82, 2 }, { 181, 2 }, { 114, 13 }, + { 115, 13 }, { 116, 13 }, { 117, 13 }, { 118, 13 }, { 125, 13 }, + { 11, 13 }, { 12, 13 }, { 13, 13 }, { 14, 13 }, { 15, 13 }, + { 16, 13 }, { 17, 13 }, { 19, 13 }, { 43, 13 }, { 70, 13 }, + { 71, 13 }, { 72, 13 }, { 73, 13 }, { 74, 13 }, { 44, 13 }, + { 86, 13 }, { 101, 13 }, { 102, 13 }, { 103, 13 }, { 104, 13 }, + { 32, 13 }, { 33, 13 }, { 35, 13 }, { 36, 13 }, { 95, 13 }, + { 10, 15 }, { 90, 15 }, { 91, 15 }, }; static const ViewMod viewModsLSL2[] = { // LSL2 per-resource palette configuration // Copyright (C) 2006 Matt Hargett - { 507, -1, -1, 1 }, { 155, -1, -1, 1 }, { 161, -1, -1, 1 }, { 163, -1, -1, 1 }, { 170, -1, -1, 1 }, - { 197, -1, -1, 1 }, { 198, -1, -1, 1 }, { 431, -1, -1, 1 }, { 432, -1, -1, 1 }, { 145, -1, -1, 1 }, - { 146, -1, -1, 1 }, { 147, -1, -1, 1 }, { 148, -1, -1, 1 }, { 149, -1, -1, 1 }, { 150, -1, -1, 1 }, - { 151, -1, -1, 1 }, { 152, -1, -1, 1 }, { 153, -1, -1, 1 }, { 154, -1, -1, 1 }, { 155, -1, -1, 1 }, - { 156, -1, -1, 1 }, { 157, -1, -1, 1 }, { 158, -1, -1, 1 }, { 159, -1, -1, 1 }, { 131, -1, -1, 1 }, - { 132, -1, -1, 1 }, { 133, -1, -1, 1 }, { 134, -1, -1, 1 }, { 135, -1, -1, 1 }, { 136, -1, -1, 1 }, - { 137, -1, -1, 1 }, { 138, -1, -1, 1 }, { 139, -1, -1, 1 }, { 140, -1, -1, 1 }, { 141, -1, -1, 1 }, - { 191, -1, -1, 1 }, { 104, -1, -1, 1 }, { 244, -1, -1, 1 }, { 215, -1, -1, 1 }, { 217, -1, -1, 1 }, - { 219, -1, -1, 1 }, { 100, -1, -1, 1 }, { 101, -1, -1, 1 }, { 110, -1, -1, 1 }, { 111, -1, -1, 1 }, - { 112, -1, -1, 1 }, { 113, -1, -1, 1 }, { 192, -1, -1, 1 }, { 193, -1, -1, 1 }, { 604, -1, -1, 1 }, - { 704, -1, -1, 1 }, { 705, -1, -1, 1 }, { 706, -1, -1, 1 }, { 717, -1, -1, 1 }, { 718, -1, -1, 1 }, - { 818, -1, -1, 1 }, { 819, -1, -1, 1 }, { 822, -1, -1, 1 }, { 823, -1, -1, 1 }, { 824, -1, -1, 1 }, - { 831, -1, -1, 1 }, { 832, -1, -1, 1 }, { 833, -1, -1, 1 }, { 834, -1, -1, 1 }, { 835, -1, -1, 1 }, - { 218, 3, -1, 1 }, { 218, 0, -1, 2 }, { 218, 1, -1, 2 }, { 218, 2, -1, 2 }, { 820, 0, -1, 2 }, - { 820, 1, -1, 2 }, { 227, -1, -1, 2 }, { 224, -1, -1, 2 }, { 206, -1, -1, 2 }, { 208, -1, -1, 2 }, - { 209, -1, -1, 2 }, { 220, -1, -1, 2 }, { 221, -1, -1, 3 }, { 254, -1, -1, 3 }, { 252, -1, -1, 3 }, - { 820, 2, -1, 4 }, { 820, 3, -1, 4 }, { 820, 4, -1, 4 }, { 816, 5, 0, 4 }, { 516, -1, -1, 5 }, - { 509, -1, -1, 5 }, { 501, -1, -1, 5 }, { 502, -1, -1, 5 }, { 503, -1, -1, 5 }, { 504, -1, -1, 5 }, - { 401, -1, -1, 5 }, { 402, -1, -1, 5 }, { 403, -1, -1, 5 }, { 408, -1, -1, 5 }, { 409, -1, -1, 5 }, - { 411, -1, -1, 5 }, { 413, -1, -1, 5 }, { 414, -1, -1, 5 }, { 417, -1, -1, 5 }, { 418, -1, -1, 5 }, - { 419, -1, -1, 5 }, { 430, -1, -1, 5 }, { 310, -1, -1, 5 }, { 302, -1, -1, 5 }, { 303, -1, -1, 5 }, - { 120, -1, -1, 5 }, { 121, -1, -1, 5 }, { 122, -1, -1, 5 }, { 123, -1, -1, 5 }, { 124, -1, -1, 5 }, - { 232, -1, -1, 5 }, { 223, -1, -1, 5 }, { 208, -1, -1, 5 }, { 710, -1, -1, 5 }, { 716, -1, -1, 5 }, - { 714, -1, -1, 5 }, { 434, -1, -1, 4 }, { 435, -1, -1, 4 }, { 436, -1, -1, 4 }, { 437, -1, -1, 4 }, - { 438, -1, -1, 4 }, { 311, -1, -1, 4 }, { 313, -1, -1, 4 }, { 316, -1, -1, 4 }, { 319, -1, -1, 4 }, - { 321, -1, -1, 4 }, { 323, -1, -1, 4 }, { 324, -1, -1, 4 }, { 306, -1, -1, 4 }, { 307, -1, -1, 4 }, - { 308, -1, -1, 4 }, { 309, -1, -1, 4 }, { 248, -1, -1, 4 }, { 245, -1, -1, 4 }, { 246, -1, -1, 4 }, - { 233, -1, -1, 4 }, { 234, -1, -1, 4 }, { 235, -1, -1, 4 }, { 237, -1, -1, 4 }, { 226, -1, -1, 4 }, - { 229, -1, -1, 4 }, { 222, -1, -1, 4 }, { 203, -1, -1, 4 }, { 204, -1, -1, 4 }, { 205, -1, -1, 4 }, - { 600, -1, -1, 4 }, { 525, -1, -1, 4 }, { 524, -1, -1, 4 }, { 523, -1, -1, 4 }, { 522, -1, -1, 4 }, - { 520, -1, -1, 4 }, { 602, -1, -1, 4 }, { 605, -1, -1, 4 }, { 608, -1, -1, 4 }, { 707, -1, -1, 4 }, - { 708, -1, -1, 4 }, { 305, 4, -1, 5 }, { 305, 0, -1, 6 }, { 305, 1, -1, 6 }, { 305, 2, -1, 6 }, - { 305, 3, -1, 6 }, { 661, 0, -1, 4 }, { 661, 1, -1, 4 }, { 661, 3, -1, 4 }, { 661, 4, -1, 4 }, - { 661, 5, -1, 4 }, { 661, 2, -1, 3 }, { 711, -1, -1, 7 }, { 712, -1, -1, 7 }, { 713, -1, -1, 7 }, - { 60, -1, -1, 7 }, { 816, 0, -1, 2 }, { 816, 1, -1, 2 }, { 816, 2, -1, 2 }, { 816, 3, -1, 2 }, - { 816, 4, -1, 2 }, { 506, -1, -1, 6 }, { 508, -1, -1, 6 }, { 500, -1, -1, 6 }, { 252, -1, -1, 6 }, - { 803, -1, -1, 6 }, { 804, -1, -1, 6 }, { 433, -1, -1, 6 }, { 513, 0, -1, 8 }, { 513, 1, -1, 8 }, - { 513, 2, -1, 8 }, { 513, 3, -1, 8 }, { 513, 4, -1, 8 }, { 513, 5, -1, 8 }, { 240, -1, -1, 9 }, - { 241, -1, -1, 9 }, { 242, -1, -1, 9 }, { 243, -1, -1, 9 }, { 701, -1, -1, 9 }, { 722, -1, -1, 9 }, - { 700, 1, -1, 10 }, { 610, -1, -1, 11 }, { 611, -1, -1, 11 }, { 607, 1, -1, 9 }, { 253, -1, -1, 9 }, - { 228, -1, -1, 9 }, { 247, -1, -1, 9 }, { 300, -1, -1, 9 }, { 326, -1, -1, 9 }, { 412, -1, -1, 12 }, - { 800, -1, -1, 14 }, { 801, -1, -1, 14 }, { 702, -1, -1, 16 }, { 519, -1, -1, 9 }, { 200, 0, -1, 3 }, - { 201, -1, -1, 9 }, { 202, -1, -1, 9 }, + { 507, -1, -1, 1 }, { 155, -1, -1, 1 }, { 161, -1, -1, 1 }, { 163, -1, -1, 1 }, { 170, -1, -1, 1 }, + { 197, -1, -1, 1 }, { 198, -1, -1, 1 }, { 431, -1, -1, 1 }, { 432, -1, -1, 1 }, { 145, -1, -1, 1 }, + { 146, -1, -1, 1 }, { 147, -1, -1, 1 }, { 148, -1, -1, 1 }, { 149, -1, -1, 1 }, { 150, -1, -1, 1 }, + { 151, -1, -1, 1 }, { 152, -1, -1, 1 }, { 153, -1, -1, 1 }, { 154, -1, -1, 1 }, { 155, -1, -1, 1 }, + { 156, -1, -1, 1 }, { 157, -1, -1, 1 }, { 158, -1, -1, 1 }, { 159, -1, -1, 1 }, { 131, -1, -1, 1 }, + { 132, -1, -1, 1 }, { 133, -1, -1, 1 }, { 134, -1, -1, 1 }, { 135, -1, -1, 1 }, { 136, -1, -1, 1 }, + { 137, -1, -1, 1 }, { 138, -1, -1, 1 }, { 139, -1, -1, 1 }, { 140, -1, -1, 1 }, { 141, -1, -1, 1 }, + { 191, -1, -1, 1 }, { 104, -1, -1, 1 }, { 244, -1, -1, 1 }, { 215, -1, -1, 1 }, { 217, -1, -1, 1 }, + { 219, -1, -1, 1 }, { 100, -1, -1, 1 }, { 101, -1, -1, 1 }, { 110, -1, -1, 1 }, { 111, -1, -1, 1 }, + { 112, -1, -1, 1 }, { 113, -1, -1, 1 }, { 192, -1, -1, 1 }, { 193, -1, -1, 1 }, { 604, -1, -1, 1 }, + { 704, -1, -1, 1 }, { 705, -1, -1, 1 }, { 706, -1, -1, 1 }, { 717, -1, -1, 1 }, { 718, -1, -1, 1 }, + { 818, -1, -1, 1 }, { 819, -1, -1, 1 }, { 822, -1, -1, 1 }, { 823, -1, -1, 1 }, { 824, -1, -1, 1 }, + { 831, -1, -1, 1 }, { 832, -1, -1, 1 }, { 833, -1, -1, 1 }, { 834, -1, -1, 1 }, { 835, -1, -1, 1 }, + { 218, 3, -1, 1 }, { 218, 0, -1, 2 }, { 218, 1, -1, 2 }, { 218, 2, -1, 2 }, { 820, 0, -1, 2 }, + { 820, 1, -1, 2 }, { 227, -1, -1, 2 }, { 224, -1, -1, 2 }, { 206, -1, -1, 2 }, { 208, -1, -1, 2 }, + { 209, -1, -1, 2 }, { 220, -1, -1, 2 }, { 221, -1, -1, 3 }, { 254, -1, -1, 3 }, { 252, -1, -1, 3 }, + { 820, 2, -1, 4 }, { 820, 3, -1, 4 }, { 820, 4, -1, 4 }, { 816, 5, 0, 4 }, { 516, -1, -1, 5 }, + { 509, -1, -1, 5 }, { 501, -1, -1, 5 }, { 502, -1, -1, 5 }, { 503, -1, -1, 5 }, { 504, -1, -1, 5 }, + { 401, -1, -1, 5 }, { 402, -1, -1, 5 }, { 403, -1, -1, 5 }, { 408, -1, -1, 5 }, { 409, -1, -1, 5 }, + { 411, -1, -1, 5 }, { 413, -1, -1, 5 }, { 414, -1, -1, 5 }, { 417, -1, -1, 5 }, { 418, -1, -1, 5 }, + { 419, -1, -1, 5 }, { 430, -1, -1, 5 }, { 310, -1, -1, 5 }, { 302, -1, -1, 5 }, { 303, -1, -1, 5 }, + { 120, -1, -1, 5 }, { 121, -1, -1, 5 }, { 122, -1, -1, 5 }, { 123, -1, -1, 5 }, { 124, -1, -1, 5 }, + { 232, -1, -1, 5 }, { 223, -1, -1, 5 }, { 208, -1, -1, 5 }, { 710, -1, -1, 5 }, { 716, -1, -1, 5 }, + { 714, -1, -1, 5 }, { 434, -1, -1, 4 }, { 435, -1, -1, 4 }, { 436, -1, -1, 4 }, { 437, -1, -1, 4 }, + { 438, -1, -1, 4 }, { 311, -1, -1, 4 }, { 313, -1, -1, 4 }, { 316, -1, -1, 4 }, { 319, -1, -1, 4 }, + { 321, -1, -1, 4 }, { 323, -1, -1, 4 }, { 324, -1, -1, 4 }, { 306, -1, -1, 4 }, { 307, -1, -1, 4 }, + { 308, -1, -1, 4 }, { 309, -1, -1, 4 }, { 248, -1, -1, 4 }, { 245, -1, -1, 4 }, { 246, -1, -1, 4 }, + { 233, -1, -1, 4 }, { 234, -1, -1, 4 }, { 235, -1, -1, 4 }, { 237, -1, -1, 4 }, { 226, -1, -1, 4 }, + { 229, -1, -1, 4 }, { 222, -1, -1, 4 }, { 203, -1, -1, 4 }, { 204, -1, -1, 4 }, { 205, -1, -1, 4 }, + { 600, -1, -1, 4 }, { 525, -1, -1, 4 }, { 524, -1, -1, 4 }, { 523, -1, -1, 4 }, { 522, -1, -1, 4 }, + { 520, -1, -1, 4 }, { 602, -1, -1, 4 }, { 605, -1, -1, 4 }, { 608, -1, -1, 4 }, { 707, -1, -1, 4 }, + { 708, -1, -1, 4 }, { 305, 4, -1, 5 }, { 305, 0, -1, 6 }, { 305, 1, -1, 6 }, { 305, 2, -1, 6 }, + { 305, 3, -1, 6 }, { 661, 0, -1, 4 }, { 661, 1, -1, 4 }, { 661, 3, -1, 4 }, { 661, 4, -1, 4 }, + { 661, 5, -1, 4 }, { 661, 2, -1, 3 }, { 711, -1, -1, 7 }, { 712, -1, -1, 7 }, { 713, -1, -1, 7 }, + { 60, -1, -1, 7 }, { 816, 0, -1, 2 }, { 816, 1, -1, 2 }, { 816, 2, -1, 2 }, { 816, 3, -1, 2 }, + { 816, 4, -1, 2 }, { 506, -1, -1, 6 }, { 508, -1, -1, 6 }, { 500, -1, -1, 6 }, { 252, -1, -1, 6 }, + { 803, -1, -1, 6 }, { 804, -1, -1, 6 }, { 433, -1, -1, 6 }, { 513, 0, -1, 8 }, { 513, 1, -1, 8 }, + { 513, 2, -1, 8 }, { 513, 3, -1, 8 }, { 513, 4, -1, 8 }, { 513, 5, -1, 8 }, { 240, -1, -1, 9 }, + { 241, -1, -1, 9 }, { 242, -1, -1, 9 }, { 243, -1, -1, 9 }, { 701, -1, -1, 9 }, { 722, -1, -1, 9 }, + { 700, 1, -1, 10 }, { 610, -1, -1, 11 }, { 611, -1, -1, 11 }, { 607, 1, -1, 9 }, { 253, -1, -1, 9 }, + { 228, -1, -1, 9 }, { 247, -1, -1, 9 }, { 300, -1, -1, 9 }, { 326, -1, -1, 9 }, { 412, -1, -1, 12 }, + { 800, -1, -1, 14 }, { 801, -1, -1, 14 }, { 702, -1, -1, 16 }, { 519, -1, -1, 9 }, { 200, 0, -1, 3 }, + { 201, -1, -1, 9 }, { 202, -1, -1, 9 }, }; static const PaletteMod paletteModsSQ3[] = { @@ -132,49 +132,49 @@ static const PaletteMod paletteModsSQ3[] = { static const PicMod picModsSQ3[] = { // SQ3 per-resource palette configuration // Copyright (C) 2006 Matt Hargett - { 96, 2 }, { 81, 2 }, { 82, 2 }, { 430, 2 }, { 17, 6 }, - { 18, 6 }, { 162, 6 }, { 163, 6 }, { 164, 6 }, { 170, 6 }, - { 180, 6 }, { 191, 6 }, { 300, 6 }, { 1, 4 }, { 926, 4 }, - { 117, 2 }, { 205, 4 }, { 206, 4 }, { 207, 4 }, { 208, 4 }, - { 209, 4 }, { 112, 4 }, { 113, 4 }, { 114, 4 }, { 115, 4 }, - { 60, 4 }, { 61, 4 }, { 62, 4 }, { 63, 4 }, { 64, 4 }, - { 65, 4 }, { 66, 4 }, { 67, 4 }, { 68, 4 }, { 69, 4 }, - { 70, 4 }, { 71, 4 }, { 72, 4 }, { 153, 5 }, { 690, 4 }, - { 1, 6 }, { 2, 6 }, { 3, 6 }, { 4, 6 }, { 5, 6 }, - { 6, 6 }, { 7, 6 }, { 8, 6 }, { 9, 6 }, { 10, 6 }, - { 11, 6 }, { 12, 6 }, { 13, 6 }, { 14, 6 }, { 15, 6 }, - { 16, 6 }, { 17, 6 }, { 18, 6 }, { 19, 6 }, { 20, 6 }, - { 157, 9 }, + { 96, 2 }, { 81, 2 }, { 82, 2 }, { 430, 2 }, { 17, 6 }, + { 18, 6 }, { 162, 6 }, { 163, 6 }, { 164, 6 }, { 170, 6 }, + { 180, 6 }, { 191, 6 }, { 300, 6 }, { 1, 4 }, { 926, 4 }, + { 117, 2 }, { 205, 4 }, { 206, 4 }, { 207, 4 }, { 208, 4 }, + { 209, 4 }, { 112, 4 }, { 113, 4 }, { 114, 4 }, { 115, 4 }, + { 60, 4 }, { 61, 4 }, { 62, 4 }, { 63, 4 }, { 64, 4 }, + { 65, 4 }, { 66, 4 }, { 67, 4 }, { 68, 4 }, { 69, 4 }, + { 70, 4 }, { 71, 4 }, { 72, 4 }, { 153, 5 }, { 690, 4 }, + { 1, 6 }, { 2, 6 }, { 3, 6 }, { 4, 6 }, { 5, 6 }, + { 6, 6 }, { 7, 6 }, { 8, 6 }, { 9, 6 }, { 10, 6 }, + { 11, 6 }, { 12, 6 }, { 13, 6 }, { 14, 6 }, { 15, 6 }, + { 16, 6 }, { 17, 6 }, { 18, 6 }, { 19, 6 }, { 20, 6 }, + { 157, 9 }, }; static const ViewMod viewModsSQ3[] = { // SQ3 per-resource palette configuration // Copyright (C) 2006 Matt Hargett - { 0, -1, -1, 1 }, { 8, -1, -1, 1 }, { 11, -1, -1, 1 }, { 12, -1, -1, 1 }, { 14, -1, -1, 1 }, - { 68, -1, -1, 1 }, { 17, -1, -1, 1 }, { 22, -1, -1, 1 }, { 23, -1, -1, 1 }, { 24, -1, -1, 1 }, - { 25, -1, -1, 1 }, { 26, -1, -1, 1 }, { 32, -1, -1, 1 }, { 35, -1, -1, 1 }, { 751, -1, -1, 1 }, - { 289, -1, -1, 1 }, { 288, -1, -1, 1 }, { 261, -1, -1, 1 }, { 260, -1, -1, 1 }, { 257, -1, -1, 1 }, - { 213, -1, -1, 1 }, { 199, -1, -1, 1 }, { 193, -1, -1, 1 }, { 192, -1, -1, 1 }, { 138, -1, -1, 1 }, - { 137, -1, -1, 1 }, { 134, -1, -1, 1 }, { 109, -1, -1, 1 }, { 110, -1, -1, 1 }, { 113, -1, -1, 1 }, - { 114, -1, -1, 1 }, { 117, -1, -1, 1 }, { 122, -1, -1, 1 }, { 123, -1, -1, 1 }, { 100, -1, -1, 1 }, - { 99, -1, -1, 1 }, { 97, -1, -1, 1 }, { 95, -1, -1, 1 }, { 89, -1, -1, 1 }, { 88, -1, -1, 1 }, - { 87, -1, -1, 1 }, { 85, -1, -1, 1 }, { 84, -1, -1, 1 }, { 82, -1, -1, 1 }, { 76, -1, -1, 1 }, - { 68, -1, -1, 1 }, { 63, -1, -1, 1 }, { 104, -1, -1, 1 }, { 136, -1, -1, 2 }, { 106, 4, -1, 1 }, - { 106, 5, -1, 1 }, { 106, 9, -1, 1 }, { 105, 0, -1, 1 }, { 105, 1, -1, 1 }, { 13, 0, 2, 2 }, - { 31, -1, -1, 2 }, { 15, 3, 0, 1 }, { 16, 0, -1, 1 }, { 19, 0, -1, 1 }, { 57, 5, -1, 1 }, - { 57, 6, -1, 1 }, { 21, 1, -1, 1 }, { 7, -1, -1, 3 }, { 18, -1, -1, 3 }, { 6, -1, -1, 4 }, - { 7, -1, -1, 4 }, { 8, -1, -1, 4 }, { 18, -1, -1, 4 }, { 901, -1, -1, 1 }, { 751, -1, -1, 1 }, - { 750, 1, -1, 1 }, { 92, 4, -1, 1 }, { 83, 0, -1, 1 }, { 83, 1, 2, 2 }, { 83, 2, 2, 2 }, - { 78, 3, -1, 1 }, { 64, 2, -1, 1 }, { 64, 3, -1, 1 }, { 40, -1, -1, 5 }, { 41, -1, -1, 5 }, - { 42, -1, -1, 5 }, { 149, -1, -1, 5 }, { 146, -1, -1, 5 }, { 141, -1, -1, 5 }, { 151, -1, -1, 5 }, - { 152, -1, -1, 5 }, { 70, -1, -1, 4 }, { 2, -1, -1, 4 }, { 900, -1, -1, 4 }, { 593, -1, -1, 7 }, - { 93, -1, -1, 7 }, { 103, -1, -1, 7 }, { 131, -1, -1, 7 }, { 132, -1, -1, 7 }, { 133, -1, -1, 7 }, - { 210, -1, -1, 7 }, { 130, -1, -1, 7 }, { 115, -1, -1, 7 }, { 116, 1, -1, 7 }, { 116, 2, -1, 7 }, - { 39, -1, -1, 4 }, { 1, -1, -1, 6 }, { 96, -1, -1, 4 }, { 77, 0, -1, 8 }, { 77, 1, -1, 8 }, - { 77, 2, -1, 8 }, { 259, -1, -1, 2 }, { 20, 0, -1, 3 }, { 15, 0, -1, 9 }, { 15, 1, -1, 9 }, - { 34, -1, -1, 9 }, { 128, -1, -1, 4 }, { 601, -1, -1, 4 }, { 602, -1, -1, 4 }, { 94, -1, -1, 10 }, - { 91, -1, -1, 11 }, { 73, -1, -1, 11 }, { 57, 3, -1, 11 }, { 57, 4, -1, 11 }, { 15, 4, -1, 11 }, - { 64, 0, -1, 11 }, { 71, 8, -1, 11 }, { 10, 6, -1, 11 }, + { 0, -1, -1, 1 }, { 8, -1, -1, 1 }, { 11, -1, -1, 1 }, { 12, -1, -1, 1 }, { 14, -1, -1, 1 }, + { 68, -1, -1, 1 }, { 17, -1, -1, 1 }, { 22, -1, -1, 1 }, { 23, -1, -1, 1 }, { 24, -1, -1, 1 }, + { 25, -1, -1, 1 }, { 26, -1, -1, 1 }, { 32, -1, -1, 1 }, { 35, -1, -1, 1 }, { 751, -1, -1, 1 }, + { 289, -1, -1, 1 }, { 288, -1, -1, 1 }, { 261, -1, -1, 1 }, { 260, -1, -1, 1 }, { 257, -1, -1, 1 }, + { 213, -1, -1, 1 }, { 199, -1, -1, 1 }, { 193, -1, -1, 1 }, { 192, -1, -1, 1 }, { 138, -1, -1, 1 }, + { 137, -1, -1, 1 }, { 134, -1, -1, 1 }, { 109, -1, -1, 1 }, { 110, -1, -1, 1 }, { 113, -1, -1, 1 }, + { 114, -1, -1, 1 }, { 117, -1, -1, 1 }, { 122, -1, -1, 1 }, { 123, -1, -1, 1 }, { 100, -1, -1, 1 }, + { 99, -1, -1, 1 }, { 97, -1, -1, 1 }, { 95, -1, -1, 1 }, { 89, -1, -1, 1 }, { 88, -1, -1, 1 }, + { 87, -1, -1, 1 }, { 85, -1, -1, 1 }, { 84, -1, -1, 1 }, { 82, -1, -1, 1 }, { 76, -1, -1, 1 }, + { 68, -1, -1, 1 }, { 63, -1, -1, 1 }, { 104, -1, -1, 1 }, { 136, -1, -1, 2 }, { 106, 4, -1, 1 }, + { 106, 5, -1, 1 }, { 106, 9, -1, 1 }, { 105, 0, -1, 1 }, { 105, 1, -1, 1 }, { 13, 0, 2, 2 }, + { 31, -1, -1, 2 }, { 15, 3, 0, 1 }, { 16, 0, -1, 1 }, { 19, 0, -1, 1 }, { 57, 5, -1, 1 }, + { 57, 6, -1, 1 }, { 21, 1, -1, 1 }, { 7, -1, -1, 3 }, { 18, -1, -1, 3 }, { 6, -1, -1, 4 }, + { 7, -1, -1, 4 }, { 8, -1, -1, 4 }, { 18, -1, -1, 4 }, { 901, -1, -1, 1 }, { 751, -1, -1, 1 }, + { 750, 1, -1, 1 }, { 92, 4, -1, 1 }, { 83, 0, -1, 1 }, { 83, 1, 2, 2 }, { 83, 2, 2, 2 }, + { 78, 3, -1, 1 }, { 64, 2, -1, 1 }, { 64, 3, -1, 1 }, { 40, -1, -1, 5 }, { 41, -1, -1, 5 }, + { 42, -1, -1, 5 }, { 149, -1, -1, 5 }, { 146, -1, -1, 5 }, { 141, -1, -1, 5 }, { 151, -1, -1, 5 }, + { 152, -1, -1, 5 }, { 70, -1, -1, 4 }, { 2, -1, -1, 4 }, { 900, -1, -1, 4 }, { 593, -1, -1, 7 }, + { 93, -1, -1, 7 }, { 103, -1, -1, 7 }, { 131, -1, -1, 7 }, { 132, -1, -1, 7 }, { 133, -1, -1, 7 }, + { 210, -1, -1, 7 }, { 130, -1, -1, 7 }, { 115, -1, -1, 7 }, { 116, 1, -1, 7 }, { 116, 2, -1, 7 }, + { 39, -1, -1, 4 }, { 1, -1, -1, 6 }, { 96, -1, -1, 4 }, { 77, 0, -1, 8 }, { 77, 1, -1, 8 }, + { 77, 2, -1, 8 }, { 259, -1, -1, 2 }, { 20, 0, -1, 3 }, { 15, 0, -1, 9 }, { 15, 1, -1, 9 }, + { 34, -1, -1, 9 }, { 128, -1, -1, 4 }, { 601, -1, -1, 4 }, { 602, -1, -1, 4 }, { 94, -1, -1, 10 }, + { 91, -1, -1, 11 }, { 73, -1, -1, 11 }, { 57, 3, -1, 11 }, { 57, 4, -1, 11 }, { 15, 4, -1, 11 }, + { 64, 0, -1, 11 }, { 71, 8, -1, 11 }, { 10, 6, -1, 11 }, }; static const SciFxMod mods[] = { diff --git a/engines/sci/graphics/video32.h b/engines/sci/graphics/video32.h index 63ef4a7a67c..89bdca58cbe 100644 --- a/engines/sci/graphics/video32.h +++ b/engines/sci/graphics/video32.h @@ -181,7 +181,7 @@ protected: bool _needsUpdate; /** - * Current frame rendered by playUntilEvent() + * Current frame rendered by playUntilEvent() */ const Graphics::Surface* _currentFrame; @@ -285,7 +285,7 @@ private: class QuickTimePlayer : public VideoPlayer { public: QuickTimePlayer(EventManager *eventMan); - + /** * Plays a QuickTime animation with the given file name */ @@ -543,7 +543,7 @@ private: } bool isNormallyComposited() const { - return (getSciVersion() == SCI_VERSION_3) || + return (getSciVersion() == SCI_VERSION_3) || (g_sci->getPlatform() == Common::kPlatformMacintosh && getSciVersion() >= SCI_VERSION_2_1_LATE); } diff --git a/engines/sci/metaengine.cpp b/engines/sci/metaengine.cpp index 495d1856804..5e21cc9eac2 100644 --- a/engines/sci/metaengine.cpp +++ b/engines/sci/metaengine.cpp @@ -173,7 +173,7 @@ static bool isSierraDemo(Common::String &sierraId, uint32 resourceCount) { // TODO: distinguish the full version of Phantasmagoria from the demo // TODO: distinguish the full version of RAMA from the demo // TODO: distinguish the full version of SQ6 from the demo - + return resourceCount < demoThreshold; } @@ -234,7 +234,7 @@ static Common::String convertSierraGameId(Common::String sierraId, SciVersion sc // late (PC). return sciVersion < SCI_VERSION_1_1 ? "castlebrain" : "islandbrain"; } - + if (sierraId == "glory") { // QFG1EGA, QFG1VGA, QFG3 and QFG4 all used the "glory" game ID @@ -589,7 +589,7 @@ bool isSciCDVersion(const AdvancedMetaEngine::FileMap &allFiles) { void constructFallbackDetectionEntry(Common::String &gameId, Common::Platform platform, SciVersion sciVersion, Common::Language language, bool hasEgaViews, bool isCD, bool isDemo) { Common::strlcpy(s_fallbackGameIdBuf, gameId.c_str(), sizeof(s_fallbackGameIdBuf)); - + s_fallbackDesc.extra = ""; s_fallbackDesc.language = language; s_fallbackDesc.flags = !isCD ? ADGF_NO_FLAGS : ADGF_CD; @@ -637,7 +637,7 @@ void constructFallbackDetectionEntry(Common::String &gameId, Common::Platform pl s_fallbackDesc.extra = "Demo"; else if (isCD) s_fallbackDesc.extra = "CD"; - } + } } ADDetectedGame SciMetaEngine::fallbackDetectExtern(uint md5Bytes, const FileMap &allFiles, const Common::FSList &fslist) const { @@ -683,7 +683,7 @@ ADDetectedGame SciMetaEngine::fallbackDetectExtern(uint md5Bytes, const FileMap bool isDemo = false; Common::String gameId = convertSierraGameId(sierraGameId, sciVersion, resMan, &isDemo); Common::Language language = Common::EN_ANY; - + // Try to determine the game language // Load up text 0 and start looking for "#" characters // Non-English versions contain strings like XXXX#YZZZZ diff --git a/engines/sci/resource/resource.cpp b/engines/sci/resource/resource.cpp index 83a81c91e79..32947a3309b 100644 --- a/engines/sci/resource/resource.cpp +++ b/engines/sci/resource/resource.cpp @@ -618,7 +618,7 @@ void ResourceSource::loadResource(ResourceManager *resMan, Resource *res) { g_sci && g_sci->getLanguage() == Common::KO_KOR) volVersion = kResVersionSci11; fileStream->seek(res->_fileOffset, SEEK_SET); - + int error = res->decompress(volVersion, fileStream); if (error) { warning("Error %d occurred while reading %s from resource file %s: %s", @@ -2146,8 +2146,8 @@ void MacResourceForkResourceSource::scanSource(ResourceManager *resMan) { Common::String resourceName = _macResMan->getResName(tagArray[i], idArray[j]); // Same as with audio36 above - if (!resourceName.empty() && - (resourceName[0] == '#' || + if (!resourceName.empty() && + (resourceName[0] == '#' || resourceName[0] == 'S' || // Most SCI32 games resourceName[0] == 'T')) // Torin syncs start with T or S resId = convertPatchNameBase36(kResourceTypeSync36, resourceName); diff --git a/engines/sci/resource/resource_audio.cpp b/engines/sci/resource/resource_audio.cpp index e142e816ad3..e868176385c 100644 --- a/engines/sci/resource/resource_audio.cpp +++ b/engines/sci/resource/resource_audio.cpp @@ -574,7 +574,7 @@ int ResourceManager::readAudioMapSCI11(IntMapResourceSource *map) { continue; } - // GK2 has invalid audio36 map entries on CD 1 of the German + // GK2 has invalid audio36 map entries on CD 1 of the German // version and CDs 5-6 of all versions. All are safe to ignore // because their content doesn't apply to the disc's chapter. if (g_sci->getGameId() == GID_GK2) { @@ -603,7 +603,7 @@ int ResourceManager::readAudioMapSCI11(IntMapResourceSource *map) { continue; } } - + // Lighthouse German has invalid audio36 map entries for // content that was cut from the game. These resources // existed in the English version even though they were @@ -791,7 +791,7 @@ bool ResourceManager::isGMTrackIncluded() { return result; } -SoundResource::SoundResource(uint32 resourceNr, ResourceManager *resMan, SciVersion soundVersion) : +SoundResource::SoundResource(uint32 resourceNr, ResourceManager *resMan, SciVersion soundVersion) : _resMan(resMan), _soundVersion(soundVersion), _trackCount(0), _tracks(nullptr), _soundPriority(0xFF) { _resource = _resMan->findResource(ResourceId(kResourceTypeSound, resourceNr), true); if (!_resource) diff --git a/engines/sci/sound/audio32.cpp b/engines/sci/sound/audio32.cpp index 71dbec7a392..81b47eea218 100644 --- a/engines/sci/sound/audio32.cpp +++ b/engines/sci/sound/audio32.cpp @@ -1214,7 +1214,7 @@ reg_t Audio32::kernelPlay(const bool autoPlay, EngineState *s, const int argc, c resourceId = ResourceId(kResourceTypeAudio, audioNumber); loop = false; volume = Audio32::kMaxVolume; - + // SSCI only plays one AIFF file at a time using this method. The game scripts // rely on this and don't stop the previous AIFF before playing another. // This entire scheme is only used in two rooms, so rather than track the diff --git a/engines/sci/sound/drivers/amigamac0.cpp b/engines/sci/sound/drivers/amigamac0.cpp index 0339ed1b3a5..59b593de811 100644 --- a/engines/sci/sound/drivers/amigamac0.cpp +++ b/engines/sci/sound/drivers/amigamac0.cpp @@ -798,7 +798,7 @@ void MidiPlayer_Amiga0::AmigaVoice::noteOn(int8 note, int8 velocity) { const int8 *seg1 = (const int8 *)ins->samples; const int8 *seg2 = seg1; - int16 seg1Size = ins->seg1Size; + int16 seg1Size = ins->seg1Size; seg2 += ins->seg2Offset & 0xfffe; int16 seg2Size = ins->seg2Size; diff --git a/engines/sci/sound/drivers/amigamac1.cpp b/engines/sci/sound/drivers/amigamac1.cpp index 9de0d21a6a0..bac06596bcc 100644 --- a/engines/sci/sound/drivers/amigamac1.cpp +++ b/engines/sci/sound/drivers/amigamac1.cpp @@ -76,7 +76,7 @@ protected: uint16 phase1Start, phase1End; uint16 phase2Start, phase2End; uint16 nativeNote; - + // This table contains frequency data for about one octave with 3 pitch bend positions between semitones // On Mac, this table contains a fixed-point source-samples-per-output-sample value // On Amiga, this table contains how many clock cycles each source sample should be output @@ -96,7 +96,7 @@ protected: const Wave *wave; int16 transpose; - + byte attackSpeed; byte attackTarget; byte decaySpeed; diff --git a/engines/sci/sound/drivers/cms.cpp b/engines/sci/sound/drivers/cms.cpp index 7ab058145b1..f7347616ccf 100644 --- a/engines/sci/sound/drivers/cms.cpp +++ b/engines/sci/sound/drivers/cms.cpp @@ -105,15 +105,15 @@ private: kAttack = 2, kDecay = 3, kSustain = 4, - kRelease = 5 + kRelease = 5 }; - + EnvelopeState _envState; uint8 _envAR; uint8 _envTL; uint8 _envDR; uint8 _envSL; - uint8 _envRR; + uint8 _envRR; uint8 _envSLI; uint8 _envPAC; uint8 _envPA; @@ -263,7 +263,7 @@ void CMSVoice::sendFrequency() { uint8 frequency = 0; uint8 octave = 0; - recalculateFrequency(frequency, octave); + recalculateFrequency(frequency, octave); uint8 octaveData = _octaveRegs[_id >> 1]; octaveData = (_id & 1) ? (octaveData & 0x0F) | (octave << 4) : (octaveData & 0xF0) | octave; @@ -350,7 +350,7 @@ void CMSVoice_V0::programChange(int program) { // I encountered this with PQ2 at the airport (program 204 sent on part 13). The original driver does not really handle that. // In fact, it even interprets this value as signed so it will not point into the instrument data buffer, but into a random // invalid memory location (in the case of 204 it will read a value of 8 from the device init data array). Since there seems - // to be no effect on the sound I don't emulate this (mis)behaviour. + // to be no effect on the sound I don't emulate this (mis)behaviour. warning("CMSVoice_V0::programChange:: Invalid program '%d' requested on midi channel '%d'", program, _assign); program = 0; } else if (program == 127) { @@ -512,7 +512,7 @@ void CMSVoice_V0::recalculateFrequency(uint8 &freq, uint8 &octave) { frequency = 47; } } - + octave = CLIP(octave + _transOct, 0, 7); frequency = _frequencyTable[frequency & 0xFF] + _transFreq + _vbrPhase; @@ -538,7 +538,7 @@ void CMSVoice_V0::recalculateEnvelopeLevels() { } else if (_envTL) { _envTL = chanVol; } - + int volIndexSL = (_envSLI << 4) + (_envTL >> 4); assert(volIndexSL < ARRAYSIZE(_volumeTable)); _envSL = _volumeTable[volIndexSL]; @@ -768,8 +768,8 @@ int MidiDriver_CMS::open() { _rate = _mixer->getOutputRate(); _cms = new CMSEmulator(_rate); - assert(_cms); - + assert(_cms); + for (uint i = 0; i < ARRAYSIZE(_channel); ++i) _channel[i] = Channel(); @@ -779,7 +779,7 @@ int MidiDriver_CMS::open() { else _voice[i] = new CMSVoice_V1(i, this, _cms, *_patchData); } - + _playSwitch = true; _masterVolume = 0; @@ -1104,7 +1104,7 @@ void MidiDriver_CMS::unbindVoices(int channelNr, int voices, bool bindSecondary) for (int i = 0; i < _numVoicesPrimary; ++i) { if (_voice[i]->_assign == channelNr && _voice[i]->_note == 0xFF) { _voice[i]->_assign = 0xFF; - + CMSVoice *sec = _voice[i]->_secondaryVoice; if (sec) { sec->stop(); @@ -1266,7 +1266,7 @@ int MidiDriver_CMS::findVoice(int channelNr, int note) { return voiceNr; } - + return -1; } diff --git a/engines/sci/sound/drivers/fb01.cpp b/engines/sci/sound/drivers/fb01.cpp index b994c1d6bf6..ce9d28055ff 100644 --- a/engines/sci/sound/drivers/fb01.cpp +++ b/engines/sci/sound/drivers/fb01.cpp @@ -680,7 +680,7 @@ void MidiPlayer_Fb01::initTrack(SciSpan& header) { setVoiceParam(i, 1, _voices[i].channel); initVoices(); - + setVolume(_masterVolume); } diff --git a/engines/sci/sound/drivers/pc9801.cpp b/engines/sci/sound/drivers/pc9801.cpp index be936589ba5..42214c86b17 100644 --- a/engines/sci/sound/drivers/pc9801.cpp +++ b/engines/sci/sound/drivers/pc9801.cpp @@ -72,7 +72,7 @@ protected: kChanNgEnable = 0x08, kChanNgRestartEnv = 0x10, kChanNgDecrease = 0x20, - kChanVbrMode = 0x40, + kChanVbrMode = 0x40, kChanVbrDecrease = 0x80 }; @@ -100,7 +100,7 @@ protected: uint16 _vbrDecrStep; uint8 _vbrModulationTimer; uint16 _vbrFrequencyModifier; - uint8 _vbrCur; + uint8 _vbrCur; uint8 _flags; const uint16 *_noteFrequency; @@ -114,14 +114,14 @@ private: virtual bool prepareFrequencyAndVolume(bool updateVolume); virtual void sendSoundOnOff(bool soundOn) = 0; virtual void sendFrequency() = 0; - virtual void sendVolume() = 0; + virtual void sendVolume() = 0; uint8 _velo; uint8 _volume; uint8 _program; bool &_soundOn; - MidiPart_PC9801 **_parts; + MidiPart_PC9801 **_parts; PC98AudioCore *_pc98a; const int _type; }; @@ -150,7 +150,7 @@ class SoundChannel_PC9801_FM2OP : public SoundChannel_PC9801 { public: SoundChannel_PC9801_FM2OP(uint8 id, PC98AudioCore *pc98a, MidiPart_PC9801 **parts, SciVersion version, SciSpan instrumentData, uint8 patchSize, bool &soundOn); ~SoundChannel_PC9801_FM2OP() override {} - + void processNoteEvent(uint8 note, bool soundOn) override; void reset() override; @@ -192,7 +192,7 @@ private: kEnvSSG_decay = 0x01, kEnvSSG_sustain = 0x02, kEnvSSG_attack = 0x03, - kEnvSSG_keyOn = 0x10 + kEnvSSG_keyOn = 0x10 }; void programChange(uint8 program) override; @@ -209,7 +209,7 @@ private: uint8 _chanEnableMask2; uint8 _currentLevel; uint8 _ngPhaseStep; - uint8 _ngPhase; + uint8 _ngPhase; uint8 _ngEnvelopeTimer; uint8 _ngSpeed; uint8 _ssgEnvelopeTimer; @@ -290,7 +290,7 @@ public: void initTrack(SciSpan &header); void setTimerCallback(void *timer_param, Common::TimerManager::TimerProc timer_proc) override; - uint32 getBaseTempo() override; + uint32 getBaseTempo() override; MidiChannel *allocateChannel() override { return 0; } MidiChannel *getPercussionChannel() override { return 0; } @@ -621,7 +621,7 @@ void SoundChannel_PC9801_FM4OP::programChange(uint8 program) { if (_version == SCI_VERSION_1_LATE) { programChangeInit(data); uint8 pos = 8; - + for (uint8 i = 0x40 + _regOffs; i < 0x50 + _regOffs; i += 4) writeReg(_regPrt, i, 0xFF); for (uint8 i = 0x30 + _regOffs; i < 0x40 + _regOffs; i += 4) @@ -687,7 +687,7 @@ void SoundChannel_PC9801_FM4OP::sendVolume() { } else { r = 127 - ((127 - r) * vol / 128); } - } + } writeReg(_regPrt, 0x40 + (i << 2) + _regOffs, r); } } @@ -729,7 +729,7 @@ void SoundChannel_PC9801_FM2OP::programChange(uint8 program) { programChangeInit(data); uint8 pos = 7; - + for (uint8 i = 0x42 + (_regOffs << 2); i < 0x52 + (_regOffs << 2); i += 8) writeReg(_regPrt, i, 0xFF); for (uint8 i = 0x32 + (_regOffs << 2); i < 0x42 + (_regOffs << 2); i += 8) @@ -854,7 +854,7 @@ SoundChannel_PC9801_SSG::SoundChannel_PC9801_SSG(uint8 id, PC98AudioCore *pc98a, : SoundChannel_PC9801(pc98a, parts, version, 2, instrumentData, soundOn), _patchOffset(patchOffset), _patchSize(patchSize), _regOffs(id & 3), _instrumentChanMask(0x3F), _ngPhaseStep(0), _currentLevel(0), _ssgEnvelopeState(kEnvSSG_silent), _ngEnvelopeTimer(0), _ngSpeed(0), _ngPhase(0), _ssgEnvelopeTimer(0), _ssgLevel(0), _ssgSpeed(0), _ccngEnabled(false) { - + static const uint16 courseV0[] = { 0xfcf, 0xef1, 0xe16, 0xd59, 0xc87, 0xbcd, 0xb27, 0xa93, 0x9ee, 0x96a, 0x8da, 0x865, 0x778, 0x70d, 0x6a6, 0x643, 0x5ec, 0x599, 0x545, 0x4f7, 0x4b5, 0x46d, 0x432, 0x3f4, 0x3c5, 0x386, 0x353, 0x325, 0x2f6, 0x2cc, 0x2a3, 0x27d, @@ -984,7 +984,7 @@ void SoundChannel_PC9801_SSG::processSounds() { vol = (uint8)CLIP(vol + (int8)((_selectedInstrument[20] & 0x0F) << 4), 0, 255); } } - + if (_ssgEnvelopeState == kEnvSSG_silent) vol = 0; @@ -1037,7 +1037,7 @@ void SoundChannel_PC9801_SSG::sendSoundOnOff(bool soundOn) { void SoundChannel_PC9801_SSG::sendVolume() { uint8 v1 = getVolume(); uint16 r = 0; - + if (_version == SCI_VERSION_1_LATE) { uint8 vol = v1 + (((v1 >> 1) + v1) >> 2); @@ -1051,7 +1051,7 @@ void SoundChannel_PC9801_SSG::sendVolume() { if (r & 0x100) r = (r + vol) & 0xFF; } - + r = (r + 15) >> 4; } else { @@ -1361,7 +1361,7 @@ int MidiDriver_PC9801::open() { } else if (_patchSize == 60 && _ssgPatchOffset == 37) _internalVersion = 2; else if (_patchSize == 81 && _ssgPatchOffset == 58) - _internalVersion = 3; + _internalVersion = 3; else return MERR_CANNOT_CONNECT; @@ -1556,7 +1556,7 @@ void MidiDriver_PC9801::initTrack(SciSpan &header) { for (int i = 0; i < numChan; ++i) { _parts[i]->controlChangeVolume(103); - + uint8 num = (_internalVersion == 1) ? (header.getInt8At(readPos) & 0x7F) : 1; readPos++; uint8 flags = header.getInt8At(readPos); @@ -1659,7 +1659,7 @@ void MidiDriver_PC9801::reset() { flag = 0x40; } #endif - + _pc98a->writeReg(0, 0x27, 0x38); _pc98a->writeReg(0, 0x27, 0x3a | flag); @@ -1667,7 +1667,7 @@ void MidiDriver_PC9801::reset() { return; for (int i = 0; i < _numChan; ++i) - _chan[i]->reset(); + _chan[i]->reset(); } MidiPlayer_PC9801::MidiPlayer_PC9801(SciVersion version) : MidiPlayer(version) { diff --git a/engines/scumm/imuse_digi/dimuse.cpp b/engines/scumm/imuse_digi/dimuse.cpp index 62b3ec7adf3..3630dc0939a 100644 --- a/engines/scumm/imuse_digi/dimuse.cpp +++ b/engines/scumm/imuse_digi/dimuse.cpp @@ -198,7 +198,7 @@ void IMuseDigital::saveLoadEarly(Common::Serializer &s) { for (int ll = 0; _comiSeqMusicTable[ll].soundId != -1; ll++) { if ((_comiSeqMusicTable[ll].soundId == track->soundId)) { track->loopShiftType = _comiSeqMusicTable[ll].shiftLoop; - break; + break; } } } @@ -258,7 +258,7 @@ void IMuseDigital::runScheduledCrossfades() { Track *newTrack = _track[newTrackId]; newTrack->curRegion = _scheduledCrossfades[l].destRegion; - // WORKAROUND for some files having a little bit earlier + // WORKAROUND for some files having a little bit earlier // loop point set in their iMUSE map; keep in mind we're considering // regionOffset -= (oldTrack->feedSize / _callbackFps) as NO SHIFT. // In COMI we're currently using 4 shift types. @@ -546,7 +546,7 @@ void IMuseDigital::callback() { effVol = int(round(effVol * 1.5)); } else { effVol = int(round(effVol * 1.1)); - } + } } _mixer->setChannelVolume(track->mixChanHandle, effVol); _mixer->setChannelBalance(track->mixChanHandle, effPan); diff --git a/engines/scumm/imuse_digi/dimuse.h b/engines/scumm/imuse_digi/dimuse.h index 29be9e901c4..c82fedc5e7a 100644 --- a/engines/scumm/imuse_digi/dimuse.h +++ b/engines/scumm/imuse_digi/dimuse.h @@ -121,7 +121,7 @@ private: Track *handleFadeOut(Track *track, int fadeDelay); int transformVolumeLinearToEqualPow(int volume, int mode); int transformVolumeEqualPowToLinear(int volume, int mode); - + void setFtMusicState(int stateId); void setFtMusicSequence(int seqId); void setFtMusicCuePoint(int cueId); diff --git a/engines/scumm/imuse_digi/dimuse_track.cpp b/engines/scumm/imuse_digi/dimuse_track.cpp index 3869d087d37..e3f4a1bf406 100644 --- a/engines/scumm/imuse_digi/dimuse_track.cpp +++ b/engines/scumm/imuse_digi/dimuse_track.cpp @@ -97,7 +97,7 @@ int IMuseDigital::startSound(int soundId, const char *soundName, int soundType, } } } - // If the current music state corresponds to the same soundId + // If the current music state corresponds to the same soundId // we're trying to play, we just adjust its volume to the new one. // Otherwise... just flush the old track and start the new one if (alreadyPlayingTrackId != -1) { @@ -319,7 +319,7 @@ void IMuseDigital::setPan(int soundId, int pan) { debug(5, "IMuseDigital::setPan(%d, %d)", soundId, pan); // Sometimes, COMI scumm scripts try to set pan values in the range 0-255 - // instead of 0-128. I sincerely have no idea why and what exactly is the + // instead of 0-128. I sincerely have no idea why and what exactly is the // correct way of handling these cases (does it happen on a sound by sound basis?). // Until someone properly reverse engineers the engine, this fix works fine for // those sounds (e.g. the cannon fire SFX in Part 1 minigame, the bell sound @@ -378,7 +378,7 @@ void IMuseDigital::fadeOutMusicAndStartNew(int fadeDelay, const char *filename, if (track->used && !track->toBeRemoved && (track->volGroupId == IMUSE_VOLGRP_MUSIC)) { debug(5, "IMuseDigital::fadeOutMusicAndStartNew(sound:%d) - starting", soundId); - // Store the fadeDelay in the track: startMusicWithOtherPos will use it to + // Store the fadeDelay in the track: startMusicWithOtherPos will use it to // fade in the new track; this will match fade in and fade out speeds. if (_vm->_game.id == GID_CMI) { track->volFadeDelay = fadeDelay; diff --git a/engines/scumm/imuse_digi/dimuse_track.h b/engines/scumm/imuse_digi/dimuse_track.h index 5d65fd969f8..be1dc63313c 100644 --- a/engines/scumm/imuse_digi/dimuse_track.h +++ b/engines/scumm/imuse_digi/dimuse_track.h @@ -46,7 +46,7 @@ enum { struct Track { int trackId; // used to identify track by value (0-15) - + int8 pan; // panning value of sound int32 vol; // volume level (values 0-127 * 1000) int32 volFadeDest; // volume level which fading target (values 0-127 * 1000) @@ -95,7 +95,7 @@ struct Track { gainRedFadeDest = 0; gainRedFadeUsed = false; alreadyCrossfading = false; - loopShiftType = 0; + loopShiftType = 0; soundId = 0; memset(soundName, 0, sizeof(soundName)); used = false; diff --git a/engines/scumm/palette.cpp b/engines/scumm/palette.cpp index a28cd3fdd97..8cb13d083f4 100644 --- a/engines/scumm/palette.cpp +++ b/engines/scumm/palette.cpp @@ -164,7 +164,7 @@ void ScummEngine::resetPalette() { static const byte tableHercGPalette[] = { 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00 }; - + // Palette based on Apple IIgs Technical Notes: IIgs 2523063 Master Color Values // Rearranged to match C64 color positions static const byte tableApple2gsPalette[] = { diff --git a/engines/scumm/script_v6.cpp b/engines/scumm/script_v6.cpp index 3294a735b45..e29a36c455b 100644 --- a/engines/scumm/script_v6.cpp +++ b/engines/scumm/script_v6.cpp @@ -740,11 +740,11 @@ void ScummEngine_v6::o6_startScript() { // the cannonballs in the Plunder Town Theater, during the juggling show, the game // cuts from room 18 (backstage) to room 19 (stage). // - // Usually, when loading a room script 29 handles the change of background music, + // Usually, when loading a room script 29 handles the change of background music, // based on which room we've just loaded. // Unfortunately, during this particular cutscene, script 29 is not executing, - // therefore the music is unchanged from room 18 to 19 (the muffled backstage - // version is played), and is not coherent with the drums fill played afterwards + // therefore the music is unchanged from room 18 to 19 (the muffled backstage + // version is played), and is not coherent with the drums fill played afterwards // (sequence 2225), which is unmuffled. // // This fix checks for this situation happening (and only this one), and makes a call diff --git a/engines/sky/sky.cpp b/engines/sky/sky.cpp index 12a1382074f..2aa23d9ced4 100644 --- a/engines/sky/sky.cpp +++ b/engines/sky/sky.cpp @@ -201,7 +201,7 @@ Common::Error SkyEngine::go() { bool introSkipped = false; // Clear pastIntro here (set to false) explicilty // It should be false already, but better to ensure it - _systemVars->pastIntro = false; + _systemVars->pastIntro = false; if (_systemVars->gameVersion > 272) { // don't do intro for floppydemos Intro *skyIntro = new Intro(_skyDisk, _skyScreen, _skyMusic, _skySound, _skyText, _mixer, _system); bool floppyIntro = ConfMan.getBool("alt_intro"); @@ -216,7 +216,7 @@ Common::Error SkyEngine::go() { // shows the first scene together with that animation. We can't // call both, as they both load the same scene. if (introSkipped) { - // restart game sets the _systemVars->pastIntro = true; + // restart game sets the _systemVars->pastIntro = true; _skyControl->restartGame(); } else { diff --git a/engines/sludge/module.mk b/engines/sludge/module.mk index ef346f590ea..1580a036bc9 100644 --- a/engines/sludge/module.mk +++ b/engines/sludge/module.mk @@ -1,5 +1,5 @@ MODULE := engines/sludge - + MODULE_OBJS := \ backdrop.o \ bg_effects.o \ @@ -38,16 +38,16 @@ MODULE_OBJS := \ transition.o \ variable.o \ zbuffer.o \ - + MODULE_DIRS += \ engines/sludge - + # This module can be built as a plugin ifeq ($(ENABLE_SLUDGE), DYNAMIC_PLUGIN) PLUGIN := 1 endif - -# Include common rules + +# Include common rules include $(srcdir)/rules.mk # Detection objects diff --git a/engines/stark/gfx/openglsactor.h b/engines/stark/gfx/openglsactor.h index 93c55e54d66..d2790386f71 100644 --- a/engines/stark/gfx/openglsactor.h +++ b/engines/stark/gfx/openglsactor.h @@ -67,7 +67,7 @@ protected: void setLightArrayUniform(const LightEntryArray &lights); void setShadowUniform(const LightEntryArray &lights, const Math::Vector3d &actorPosition, Math::Matrix3 worldToModelRot); - + bool getPointLightContribution(LightEntry *light, const Math::Vector3d &actorPosition, Math::Vector3d &direction, float weight = 1.0f); bool getDirectionalLightContribution(LightEntry *light, Math::Vector3d &direction); diff --git a/engines/stark/metaengine.cpp b/engines/stark/metaengine.cpp index def0324ead7..dce5040f562 100644 --- a/engines/stark/metaengine.cpp +++ b/engines/stark/metaengine.cpp @@ -117,7 +117,7 @@ public: Common::Error createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const override { *engine = new StarkEngine(syst, desc); return Common::kNoError; - } + } }; } // End of namespace Stark diff --git a/engines/stark/resources/command.h b/engines/stark/resources/command.h index c14e74146b2..6202ac79856 100644 --- a/engines/stark/resources/command.h +++ b/engines/stark/resources/command.h @@ -285,7 +285,7 @@ protected: Command *opIsAnimAtTime(const ResourceReference &animRef, int32 time); Command *opIsLocation2D(); Command *opIsInventoryOpen(); - + Common::Array _arguments; }; diff --git a/engines/stark/resources/image.cpp b/engines/stark/resources/image.cpp index 62ab6ea095f..34a01d197c6 100644 --- a/engines/stark/resources/image.cpp +++ b/engines/stark/resources/image.cpp @@ -168,7 +168,7 @@ Common::Point Image::getHotspotPosition(uint index) const { } right /= polygon.size(); - + if (top < 0) { top = 0; } diff --git a/engines/stark/resources/item.cpp b/engines/stark/resources/item.cpp index a28ca2454e8..c9b3b6d4e8d 100644 --- a/engines/stark/resources/item.cpp +++ b/engines/stark/resources/item.cpp @@ -404,7 +404,7 @@ Common::String ItemVisual::getHotspotTitle(uint32 hotspotIndex) { Common::Array ItemVisual::listExitPositionsImpl() { Common::Array pattables = listChildrenRecursive(); - + Common::Array positions; Common::Point invalidPosition(-1, -1); diff --git a/engines/stark/scene.h b/engines/stark/scene.h index 3e62d94c82f..a28cd29b377 100644 --- a/engines/stark/scene.h +++ b/engines/stark/scene.h @@ -36,7 +36,7 @@ class Driver; class RenderEntry; } -/** +/** * Manager for the current game scene */ class Scene { diff --git a/engines/stark/services/gamechapter.cpp b/engines/stark/services/gamechapter.cpp index 7249b91e7be..6f9c92dfa0f 100644 --- a/engines/stark/services/gamechapter.cpp +++ b/engines/stark/services/gamechapter.cpp @@ -37,7 +37,7 @@ GameChapter::GameChapter() : _errorText("Unknown Chapter") { } Common::String section = file.getSections().front().name; - + int index = 0; Common::String key = Common::String::format("%02d", index); Common::String value; diff --git a/engines/stark/services/gamechapter.h b/engines/stark/services/gamechapter.h index 7080d869b9a..fe45d0d960b 100644 --- a/engines/stark/services/gamechapter.h +++ b/engines/stark/services/gamechapter.h @@ -30,7 +30,7 @@ namespace Stark { /** * Game chapter services - * + * * Provide the game chapter's title and subtitle */ class GameChapter { diff --git a/engines/stark/services/gamemessage.h b/engines/stark/services/gamemessage.h index 6959311083d..9c487db7deb 100644 --- a/engines/stark/services/gamemessage.h +++ b/engines/stark/services/gamemessage.h @@ -30,7 +30,7 @@ namespace Stark { /** * Game message service - * + * * Provide message texts and dialogs used in various points */ class GameMessage { diff --git a/engines/stark/services/settings.h b/engines/stark/services/settings.h index 65224340a7f..713deaa91cf 100644 --- a/engines/stark/services/settings.h +++ b/engines/stark/services/settings.h @@ -40,7 +40,7 @@ namespace Stark { /** * Settings services. - * + * * Maintains the settings of the game. */ class Settings { @@ -78,7 +78,7 @@ public: int getIntSetting(IntSettingIndex index) { return ConfMan.getInt(_intKey[index]); } /** Flip the boolean settings */ - void flipSetting(BoolSettingIndex index) { + void flipSetting(BoolSettingIndex index) { ConfMan.setBool(_boolKey[index], !getBoolSetting(index)); } @@ -89,7 +89,7 @@ public: bool hasLowResFMV() { return _hasLowRes; } /** Enable the book of secrets */ - void enableBookOfSecrets() { + void enableBookOfSecrets() { ConfMan.setBool("xoBfOsterceS", true); ConfMan.flushToDisk(); } diff --git a/engines/stark/services/staticprovider.cpp b/engines/stark/services/staticprovider.cpp index abfcb2d41c3..3eb81357634 100644 --- a/engines/stark/services/staticprovider.cpp +++ b/engines/stark/services/staticprovider.cpp @@ -94,7 +94,7 @@ VisualImageXMG *StaticProvider::getUIElement(UIElement element, uint32 index) co anim->selectFrame(index); VisualImageXMG *visualImage = anim->getVisual()->get(); anim->selectFrame(prevIndex); - + return visualImage; } diff --git a/engines/stark/services/userinterface.cpp b/engines/stark/services/userinterface.cpp index f85bdcb57b2..3fb254b6410 100644 --- a/engines/stark/services/userinterface.cpp +++ b/engines/stark/services/userinterface.cpp @@ -414,7 +414,7 @@ void UserInterface::toggleScreen(Screen::Name screenName) { || (currentName == Screen::kScreenSaveMenu && screenName == Screen::kScreenLoadMenu) || (currentName == Screen::kScreenLoadMenu && screenName == Screen::kScreenSaveMenu)) { backPrevScreen(); - } else if (currentName == Screen::kScreenGame + } else if (currentName == Screen::kScreenGame || currentName == Screen::kScreenDiaryIndex || (currentName == Screen::kScreenMainMenu && screenName == Screen::kScreenLoadMenu) || (currentName == Screen::kScreenMainMenu && screenName == Screen::kScreenSettingsMenu)) { diff --git a/engines/stark/ui/menu/dialogmenu.cpp b/engines/stark/ui/menu/dialogmenu.cpp index 44b927548af..ef4da1983f8 100644 --- a/engines/stark/ui/menu/dialogmenu.cpp +++ b/engines/stark/ui/menu/dialogmenu.cpp @@ -65,7 +65,7 @@ void DialogScreen::open() { "BGImage", nullptr, nullptr)); - + _widgets.push_back(new StaticLocationWidget( "Return", CLICK_HANDLER(DialogScreen, backHandler), @@ -75,35 +75,35 @@ void DialogScreen::open() { "Back", CLICK_HANDLER(DialogScreen, backHandler), nullptr)); - + _widgets.push_back(new StaticLocationWidget( "IndexBack", CLICK_HANDLER(DialogScreen, indexBackHandler), nullptr)); - + _widgets.push_back(new StaticLocationWidget( "IndexNext", CLICK_HANDLER(DialogScreen, indexNextHandler), nullptr)); - + _widgets.push_back(new StaticLocationWidget( "LogBack", CLICK_HANDLER(DialogScreen, logBackHandler), nullptr)); _widgets.back()->setVisible(false); - + _widgets.push_back(new StaticLocationWidget( "Index", CLICK_HANDLER(DialogScreen, backIndexHandler), nullptr)); _widgets.back()->setVisible(false); - + _widgets.push_back(new StaticLocationWidget( "LogNext", CLICK_HANDLER(DialogScreen, logNextHandler), nullptr)); _widgets.back()->setVisible(false); - + for (uint i = 1; i < _widgets.size(); ++i) { _widgets[i]->setupSounds(0, 1); } diff --git a/engines/stark/ui/menu/diarypages.cpp b/engines/stark/ui/menu/diarypages.cpp index f31fa9960e4..19ec8d0ed6d 100644 --- a/engines/stark/ui/menu/diarypages.cpp +++ b/engines/stark/ui/menu/diarypages.cpp @@ -44,7 +44,7 @@ DiaryPagesScreen::~DiaryPagesScreen() { void DiaryPagesScreen::open() { StaticLocationScreen::open(); - + _widgets.push_back(new StaticLocationWidget( "BGImage", nullptr, diff --git a/engines/stark/ui/menu/fmvmenu.cpp b/engines/stark/ui/menu/fmvmenu.cpp index c7e14ab6670..2b0756fb2d1 100644 --- a/engines/stark/ui/menu/fmvmenu.cpp +++ b/engines/stark/ui/menu/fmvmenu.cpp @@ -185,7 +185,7 @@ FMVWidget::FMVWidget(Gfx::Driver *gfx, uint fmvIndex) : _width = rect.right - rect.left; _position.x = FMVMenuScreen::_formatRectPos.x; - _position.y = FMVMenuScreen::_formatRectPos.y + + _position.y = FMVMenuScreen::_formatRectPos.y + (fmvIndex % FMVMenuScreen::_fmvPerPage) * (FMVMenuScreen::_fontHeight + 4); } diff --git a/engines/stark/ui/menu/locationscreen.h b/engines/stark/ui/menu/locationscreen.h index 1350a4af9cd..b9a0b318498 100644 --- a/engines/stark/ui/menu/locationscreen.h +++ b/engines/stark/ui/menu/locationscreen.h @@ -87,7 +87,7 @@ typedef Common::Functor2 Wi /** * User interface widget bound to a Location RenderEntry - * + * * Also used without bounding the RenderEntry, as a base class */ class StaticLocationWidget { diff --git a/engines/stark/ui/menu/saveloadmenu.h b/engines/stark/ui/menu/saveloadmenu.h index a60bf923194..9fc10210c2a 100644 --- a/engines/stark/ui/menu/saveloadmenu.h +++ b/engines/stark/ui/menu/saveloadmenu.h @@ -33,7 +33,7 @@ namespace Stark { namespace Gfx { class Texture; -class SurfaceRenderer; +class SurfaceRenderer; } class SaveDataWidget; @@ -76,7 +76,7 @@ private: int _maxPage; void backHandler(); - + void prevPageHandler() { changePage(_page - 1); } void nextPageHandler() { changePage(_page + 1); } @@ -91,7 +91,7 @@ private: */ class SaveMenuScreen : public SaveLoadMenuScreen { public: - SaveMenuScreen(Gfx::Driver *gfx, Cursor *cursor) : + SaveMenuScreen(Gfx::Driver *gfx, Cursor *cursor) : SaveLoadMenuScreen(gfx, cursor, Screen::kScreenSaveMenu), _slotToSaveAfterConfirm(nullptr) {} virtual ~SaveMenuScreen() {} @@ -115,7 +115,7 @@ private: */ class LoadMenuScreen : public SaveLoadMenuScreen { public: - LoadMenuScreen(Gfx::Driver *gfx, Cursor *cursor) : + LoadMenuScreen(Gfx::Driver *gfx, Cursor *cursor) : SaveLoadMenuScreen(gfx, cursor, Screen::kScreenLoadMenu), _slotToLoadAfterConfirm(-1) {} ~LoadMenuScreen() override {} diff --git a/engines/stark/ui/menu/settingsmenu.cpp b/engines/stark/ui/menu/settingsmenu.cpp index 2cbac8f7375..b956ff39890 100644 --- a/engines/stark/ui/menu/settingsmenu.cpp +++ b/engines/stark/ui/menu/settingsmenu.cpp @@ -54,44 +54,44 @@ void SettingsMenuScreen::open() { "The Longest Journey", nullptr, nullptr)); - + _widgets.push_back(new StaticLocationWidget( "Return", CLICK_HANDLER(SettingsMenuScreen, backHandler), nullptr)); _widgets.back()->setupSounds(3, 4); - + _widgets.push_back(new StaticLocationWidget( "Back", CLICK_HANDLER(SettingsMenuScreen, backHandler), nullptr)); _widgets.back()->setupSounds(3, 4); - + _widgets.push_back(new StaticLocationWidget( "GSettings", nullptr, nullptr)); - + _widgets.push_back(new CheckboxWidget( "AprilHighRes", StarkSettings->getBoolSetting(Settings::kHighModel), CLICK_HANDLER(SettingsMenuScreen, flipSettingHandler), MOVE_HANDLER(SettingsMenuScreen, textHandler))); _widgets.back()->setupSounds(3, 4); - + _widgets.push_back(new StaticLocationWidget( "HighResHelp", nullptr, nullptr)); _widgets.back()->setVisible(false); - + _widgets.push_back(new CheckboxWidget( "Subtitles", StarkSettings->getBoolSetting(Settings::kSubtitle), CLICK_HANDLER(SettingsMenuScreen, flipSettingHandler), MOVE_HANDLER(SettingsMenuScreen, textHandler))); _widgets.back()->setupSounds(3, 4); - + _widgets.push_back(new StaticLocationWidget( "SubtitleHelp", nullptr, @@ -104,7 +104,7 @@ void SettingsMenuScreen::open() { CLICK_HANDLER(SettingsMenuScreen, flipSettingHandler), MOVE_HANDLER(SettingsMenuScreen, textHandler))); _widgets.back()->setupSounds(3, 4); - + _widgets.push_back(new StaticLocationWidget( "SpecialFXHelp", nullptr, @@ -117,7 +117,7 @@ void SettingsMenuScreen::open() { CLICK_HANDLER(SettingsMenuScreen, flipSettingHandler), MOVE_HANDLER(SettingsMenuScreen, textHandler))); _widgets.back()->setupSounds(3, 4); - + _widgets.push_back(new StaticLocationWidget( "ShadowsHelp", nullptr, @@ -131,7 +131,7 @@ void SettingsMenuScreen::open() { MOVE_HANDLER(SettingsMenuScreen, textHandler))); _widgets.back()->setupSounds(3, 4); _widgets.back()->setVisible(StarkSettings->hasLowResFMV()); - + _widgets.push_back(new StaticLocationWidget( "FMVHelp", nullptr, @@ -149,7 +149,7 @@ void SettingsMenuScreen::open() { _soundManager, 0, Settings::kVoice, MOVE_HANDLER(SettingsMenuScreen, textHandler))); - + _widgets.push_back(new StaticLocationWidget( "VoiceHelp", nullptr, @@ -162,7 +162,7 @@ void SettingsMenuScreen::open() { _soundManager, 2, Settings::kMusic, MOVE_HANDLER(SettingsMenuScreen, textHandler))); - + _widgets.push_back(new StaticLocationWidget( "MusicHelp", nullptr, @@ -175,7 +175,7 @@ void SettingsMenuScreen::open() { _soundManager, 1, Settings::kSfx, MOVE_HANDLER(SettingsMenuScreen, textHandler))); - + _widgets.push_back(new StaticLocationWidget( "SfxHelp", nullptr, @@ -188,7 +188,7 @@ void SettingsMenuScreen::open() { CLICK_HANDLER(SettingsMenuScreen, flipSettingHandler), MOVE_HANDLER(SettingsMenuScreen, textHandler))); _widgets.back()->setupSounds(3, 4); - + _widgets.push_back(new StaticLocationWidget( "AllowFFHelp", nullptr, @@ -349,7 +349,7 @@ bool VolumeWidget::isMouseInsideBg(const Common::Point &mousePos) const { mousePos.y >= _bgPosition.y && mousePos.y <= _bgPosition.y + _bgHeight; } -TestSoundManager::TestSoundManager() : +TestSoundManager::TestSoundManager() : _currentSound(nullptr), _isLopping(false) { for (int i = 0; i < 3; ++i) { diff --git a/engines/stark/ui/menu/settingsmenu.h b/engines/stark/ui/menu/settingsmenu.h index 84dc71e5d6e..c67d38e9c46 100644 --- a/engines/stark/ui/menu/settingsmenu.h +++ b/engines/stark/ui/menu/settingsmenu.h @@ -143,7 +143,7 @@ private: class VolumeWidget : public StaticLocationWidget { public: VolumeWidget(const char *renderEntryName, Cursor *cursor, - TestSoundManager &soundManager, int soundIndex, + TestSoundManager &soundManager, int soundIndex, Settings::IntSettingIndex settingIndex, WidgetOnMouseMoveCallback *onMouseMoveCallback); virtual ~VolumeWidget() {}; @@ -169,7 +169,7 @@ private: Common::Point _sliderPosition, _bgPosition; int _bgWidth, _bgHeight, _sliderWidth, _minX, _maxX; - + bool _isDragged; const Settings::IntSettingIndex _settingIndex; @@ -180,7 +180,7 @@ private: } int xToVolume(int x) { - return (x - _minX) * _maxVolume / (_maxX - _minX); + return (x - _minX) * _maxVolume / (_maxX - _minX); } }; diff --git a/engines/stark/ui/world/dialogpanel.cpp b/engines/stark/ui/world/dialogpanel.cpp index 26f1dce3a55..e93b602cb96 100644 --- a/engines/stark/ui/world/dialogpanel.cpp +++ b/engines/stark/ui/world/dialogpanel.cpp @@ -219,7 +219,7 @@ void DialogPanel::onMouseMove(const Common::Point &pos) { } } } - + if (_options[_focusedOption]->containsPoint(pos)) { _cursor->setCursorType(Cursor::kActive); } else if (_scrollUpArrowVisible && _scrollUpArrowRect.contains(pos)) { diff --git a/engines/startrek/bridge.cpp b/engines/startrek/bridge.cpp index 8d6749f7f21..978ecf050c9 100644 --- a/engines/startrek/bridge.cpp +++ b/engines/startrek/bridge.cpp @@ -735,7 +735,7 @@ void StarTrekEngine::contactTargetAction() { initStarfieldSprite(&_starfieldSprite, new StubBitmap(0, 0), _starfieldRect); } else { hailTheMasada(); - } + } break; case kPlanetArk7: // Chapter 3: Love's Labor Jeopardized (love) _sound->playSoundEffectIndex(kSfxHailing); diff --git a/engines/startrek/console.cpp b/engines/startrek/console.cpp index b8221563661..4070d4e8945 100644 --- a/engines/startrek/console.cpp +++ b/engines/startrek/console.cpp @@ -98,7 +98,7 @@ bool Console::Cmd_Text(int argc, const char **argv) { Common::String screenName = _vm->getScreenName(); byte *rdfData = _vm->_room->loadRoomRDF(screenName); int index = 0; - + do { uint16 offset = textList[index].offsetEnglishCD; debugPrintf("%i - %i: %s\n", textList[index].id, offset, rdfData+offset); @@ -234,7 +234,7 @@ bool Console::Cmd_DumpText(int argc, const char **argv) { rdfFile->seek(32, SEEK_SET); uint16 messageOffset = rdfFile->readUint16LE(); rdfFile->seek(messageOffset, SEEK_SET); - + while (!rdfFile->eos() && !rdfFile->err()) { Common::String message; uint16 pos = rdfFile->pos(); @@ -246,7 +246,7 @@ bool Console::Cmd_DumpText(int argc, const char **argv) { message += c; c = rdfFile->readByte(); } - + if (!message.empty()) { if (!tableFormat) { debug("%s, %d", message.c_str(), pos); @@ -278,7 +278,7 @@ bool Console::Cmd_DumpText(int argc, const char **argv) { int pos = rdfFile->pos(); byte c = rdfFile->readByte(); bool found = false; - + if (c == '#') { rdfFile->skip(4); c = rdfFile->readByte(); @@ -294,7 +294,7 @@ bool Console::Cmd_DumpText(int argc, const char **argv) { } Common::String prefix = message.substr(1, 3); - + for (uint i = 0; i < ARRAYSIZE(validPrefixes); i++) { if (prefix == validPrefixes[i]) { MessageInfo m; @@ -302,7 +302,7 @@ bool Console::Cmd_DumpText(int argc, const char **argv) { m.value = message; m.pos = pos; keys.push_back(m); - + break; } } @@ -321,7 +321,7 @@ bool Console::Cmd_DumpText(int argc, const char **argv) { Common::String line; Common::sort(keys.begin(), keys.end(), MessageInfoComparator()); - + for (Common::List::const_iterator i = keys.begin(), end = keys.end(); i != end; ++i) { line += "TX_" + (*i).key + ", "; index++; @@ -332,12 +332,12 @@ bool Console::Cmd_DumpText(int argc, const char **argv) { } debug(line.c_str()); - + for (Common::List::const_iterator i = keys.begin(), end = keys.end(); i != end; ++i) { debug("{ TX_%s, %d, 0 },", (*i).key.c_str(), (*i).pos); } } - + delete rdfFile; } diff --git a/engines/startrek/module.mk b/engines/startrek/module.mk index 067edfa345e..7b5b497188e 100644 --- a/engines/startrek/module.mk +++ b/engines/startrek/module.mk @@ -79,7 +79,7 @@ MODULE_OBJS = \ rooms/veng7.o \ rooms/veng8.o \ rooms/venga.o - + # This module can be built as a plugin diff --git a/engines/startrek/resource.cpp b/engines/startrek/resource.cpp index 318793a08df..4a1a4d30438 100644 --- a/engines/startrek/resource.cpp +++ b/engines/startrek/resource.cpp @@ -286,7 +286,7 @@ Common::String Resource::getLoadedText(int textIndex) { curIndex++; str = ""; } - + delete txtFile; return ""; } diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp index 37a9a248a9a..721c5f3b268 100644 --- a/engines/startrek/room.cpp +++ b/engines/startrek/room.cpp @@ -342,7 +342,7 @@ const char *Room::getText(uint16 textId) { return _roomStaticTextList[index].text; } index++; - } while (_roomStaticTextList[index].id != -1); + } while (_roomStaticTextList[index].id != -1); } if (offsets == nullptr) diff --git a/engines/startrek/rooms/demon1.cpp b/engines/startrek/rooms/demon1.cpp index 00ba6e7b733..2f6769cb2f5 100644 --- a/engines/startrek/rooms/demon1.cpp +++ b/engines/startrek/rooms/demon1.cpp @@ -112,7 +112,7 @@ extern const RoomAction demon1ActionList[] = { enum demon1TextIds { TX_SPEAKER_KIRK, TX_SPEAKER_SPOCK, TX_SPEAKER_MCCOY, TX_SPEAKER_EVERTS, TX_SPEAKER_UHURA, - TX_SPEAKER_KLINGON, + TX_SPEAKER_KLINGON, TX_DEM1_001, TX_DEM1_002, TX_DEM1_003, TX_DEM1_004, TX_DEM1_005, TX_DEM1_006, TX_DEM1_007, TX_DEM1_008, TX_DEM1_009, TX_DEM1_011, TX_DEM1_012, TX_DEM1_013, TX_DEM1_014, TX_DEM1_015, TX_DEM1_016, diff --git a/engines/startrek/rooms/demon6.cpp b/engines/startrek/rooms/demon6.cpp index 2ce5a777b44..b51b8c814d7 100644 --- a/engines/startrek/rooms/demon6.cpp +++ b/engines/startrek/rooms/demon6.cpp @@ -776,7 +776,7 @@ int Room::demon6ShowCaseProcessSelection(Sprite *sprites, Sprite *clickedSprite, delete clickedSprite->bitmap; clickedSprite->bitmap = nullptr; visible ^= (0x10 >> (clickedSprite - sprites)); - + return visible; } diff --git a/engines/startrek/rooms/love4.cpp b/engines/startrek/rooms/love4.cpp index 4932405f67a..debaee4b661 100644 --- a/engines/startrek/rooms/love4.cpp +++ b/engines/startrek/rooms/love4.cpp @@ -266,7 +266,7 @@ extern const RoomTextOffsets love4TextOffsets[] = { //{ TX_BRIDU146, 7082, 0 }, //{ TX_BRIDU146, 6918, 0 }, //{ TX_BRIDU146, 6585, 0 }, - { TX_GENER004, 5405, 0 }, + { TX_GENER004, 5405, 0 }, { -1, 0, 0 } }; diff --git a/engines/startrek/rooms/mudd3.cpp b/engines/startrek/rooms/mudd3.cpp index 8f73afdcd1c..96337562df5 100644 --- a/engines/startrek/rooms/mudd3.cpp +++ b/engines/startrek/rooms/mudd3.cpp @@ -127,7 +127,7 @@ extern const RoomTextOffsets mudd3TextOffsets[] = { { TX_MUD3_011, 11631, 0 }, { TX_MUD3_012, 9147, 0 }, { TX_MUD3_013, 12946, 0 }, - { TX_MUD3_014, 11167, 0 }, + { TX_MUD3_014, 11167, 0 }, { TX_MUD3_015, 5526, 0 }, { TX_MUD3_016, 11915, 0 }, { TX_MUD3_017, 4507, 0 }, diff --git a/engines/startrek/rooms/trial5.cpp b/engines/startrek/rooms/trial5.cpp index 96e2e65b0d8..185c0bc58aa 100644 --- a/engines/startrek/rooms/trial5.cpp +++ b/engines/startrek/rooms/trial5.cpp @@ -266,7 +266,7 @@ extern const RoomTextOffsets trial5TextOffsets[] = { { TX_TRI5N018, 6984, 0 }, { TX_TRI5N019, 6389, 0 }, { TX_TRI5N020, 6508, 0 }, - { TX_TRI5N021, 6627, 0 }, + { TX_TRI5N021, 6627, 0 }, { -1, 0, 0 } }; diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp index 348a0d64b4d..4db9a85a7a9 100644 --- a/engines/startrek/startrek.cpp +++ b/engines/startrek/startrek.cpp @@ -181,7 +181,7 @@ Common::Error StarTrekEngine::run() { _bridgeSequenceToLoad = -1; runGameMode(_gameMode, true); } - + return Common::kNoError; } diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h index e2b1ac5f8df..fca238df4db 100644 --- a/engines/startrek/startrek.h +++ b/engines/startrek/startrek.h @@ -688,7 +688,7 @@ public: Common::Platform getPlatform() const; uint8 getGameType() const; Common::Language getLanguage() const; - + // _screenName = _missionName + _roomIndex Common::String getScreenName() const { return _missionName + (char)(_roomIndex + '0'); diff --git a/engines/supernova/game-manager.cpp b/engines/supernova/game-manager.cpp index 47475c05e9e..2c8eba57726 100644 --- a/engines/supernova/game-manager.cpp +++ b/engines/supernova/game-manager.cpp @@ -841,7 +841,7 @@ void GameManager::edit(Common::String &input, int x, int y, uint length) { kScreenWidth - x : (length + 1) * (kFontWidth + 2); background = kColorDarkBlue; } else if (_vm->_MSPart == 2) { - overdrawWidth = ((int)((length + 1) * (kFontWidth2 + 2)) > (kScreenWidth - x)) + overdrawWidth = ((int)((length + 1) * (kFontWidth2 + 2)) > (kScreenWidth - x)) ? kScreenWidth - x : (length + 1) * (kFontWidth2 + 2); background = kColorWhite35; } diff --git a/engines/supernova/resman.cpp b/engines/supernova/resman.cpp index d16cf39e1ec..795134b5d96 100644 --- a/engines/supernova/resman.cpp +++ b/engines/supernova/resman.cpp @@ -125,11 +125,11 @@ ResourceManager::ResourceManager(SupernovaEngine *vm) } ResourceManager::~ResourceManager() { - if (_vm->_MSPart == 1) { + if (_vm->_MSPart == 1) { for (int i = 0; i < 44; i++) delete _images[i]; } - if (_vm->_MSPart == 2) { + if (_vm->_MSPart == 2) { for (int i = 0; i < 47; i++) delete _images[i]; } @@ -344,7 +344,7 @@ void ResourceManager::initSiren() { int length = audioRate / 90; // minimal length of each tone // * 60 for the minimal length, another 20 * length as a spare, for longer tones - byte *buffer = new byte[length * 80]; + byte *buffer = new byte[length * 80]; byte *pBuffer = buffer; Common::SineTable table(audioRate); diff --git a/engines/supernova/supernova2/state.cpp b/engines/supernova/supernova2/state.cpp index e61d4e17791..a3648293357 100644 --- a/engines/supernova/supernova2/state.cpp +++ b/engines/supernova/supernova2/state.cpp @@ -1005,26 +1005,26 @@ void GameManager2::passageConstruction() { }; changeRoom(PYR_ENTRANCE); - _rooms[PYR_ENTRANCE]->setSectionVisible(1, + _rooms[PYR_ENTRANCE]->setSectionVisible(1, !wall(_state._pyraS, _state._pyraZ, _state._pyraDirection, 0, -1)); - _rooms[PYR_ENTRANCE]->setSectionVisible(2, + _rooms[PYR_ENTRANCE]->setSectionVisible(2, !wall(_state._pyraS, _state._pyraZ, _state._pyraDirection, 0, 1)); - _rooms[PYR_ENTRANCE]->setSectionVisible(7, + _rooms[PYR_ENTRANCE]->setSectionVisible(7, wall(_state._pyraS, _state._pyraZ, _state._pyraDirection, 1, 0)); if (!_rooms[PYR_ENTRANCE]->isSectionVisible(7)) { _rooms[PYR_ENTRANCE]->getObject(3)->_type = EXIT; _rooms[PYR_ENTRANCE]->getObject(3)->_click = 0; - _rooms[PYR_ENTRANCE]->setSectionVisible(3, + _rooms[PYR_ENTRANCE]->setSectionVisible(3, !wall(_state._pyraS, _state._pyraZ, _state._pyraDirection, 1, -1)); - _rooms[PYR_ENTRANCE]->setSectionVisible(4, + _rooms[PYR_ENTRANCE]->setSectionVisible(4, !wall(_state._pyraS, _state._pyraZ, _state._pyraDirection, 1, 1)); - _rooms[PYR_ENTRANCE]->setSectionVisible(8, + _rooms[PYR_ENTRANCE]->setSectionVisible(8, wall(_state._pyraS, _state._pyraZ, _state._pyraDirection, 2, 0)); if (!_rooms[PYR_ENTRANCE]->isSectionVisible(8)) { - _rooms[PYR_ENTRANCE]->setSectionVisible(5, + _rooms[PYR_ENTRANCE]->setSectionVisible(5, !wall(_state._pyraS, _state._pyraZ, _state._pyraDirection, 2, -1)); - _rooms[PYR_ENTRANCE]->setSectionVisible(6, + _rooms[PYR_ENTRANCE]->setSectionVisible(6, !wall(_state._pyraS, _state._pyraZ, _state._pyraDirection, 2, 1)); } else { _rooms[PYR_ENTRANCE]->setSectionVisible(5, kShownFalse); @@ -1071,16 +1071,16 @@ void GameManager2::passageConstruction() { break; } } - _rooms[PYR_ENTRANCE]->setSectionVisible(9, + _rooms[PYR_ENTRANCE]->setSectionVisible(9, _rooms[PYR_ENTRANCE]->isSectionVisible(7) && !_rooms[PYR_ENTRANCE]->isSectionVisible(1)); - _rooms[PYR_ENTRANCE]->setSectionVisible(10, + _rooms[PYR_ENTRANCE]->setSectionVisible(10, _rooms[PYR_ENTRANCE]->isSectionVisible(7) && !_rooms[PYR_ENTRANCE]->isSectionVisible(2)); - _rooms[PYR_ENTRANCE]->setSectionVisible(11, + _rooms[PYR_ENTRANCE]->setSectionVisible(11, _rooms[PYR_ENTRANCE]->isSectionVisible(8) && !_rooms[PYR_ENTRANCE]->isSectionVisible(3)); - _rooms[PYR_ENTRANCE]->setSectionVisible(12, + _rooms[PYR_ENTRANCE]->setSectionVisible(12, _rooms[PYR_ENTRANCE]->isSectionVisible(8) && !_rooms[PYR_ENTRANCE]->isSectionVisible(4)); } @@ -1261,25 +1261,25 @@ void GameManager2::caught() { _vm->removeMessage(); if (_currentRoom->getId() < MUS1) { } else if (_currentRoom->getId() <= MUS2) { - _vm->renderImage( 8); + _vm->renderImage( 8); _vm->renderImage(18); } else if (_currentRoom->getId() == MUS3) { - _vm->renderImage(12); + _vm->renderImage(12); _vm->renderImage(30); } else if (_currentRoom->getId() == MUS4) { - _vm->renderImage( 8); + _vm->renderImage( 8); _vm->renderImage(18); } else if (_currentRoom->getId() == MUS5) { - _vm->renderImage( 9); + _vm->renderImage( 9); _vm->renderImage(29); } else if (_currentRoom->getId() <= MUS7) { - _vm->renderImage( 7); + _vm->renderImage( 7); _vm->renderImage(17); } else if (_currentRoom->getId() <= MUS9) { - _vm->renderImage( 1); + _vm->renderImage( 1); _vm->renderImage( 7); } else if (_currentRoom->getId() <= MUS11) { - _vm->renderImage( 2); + _vm->renderImage( 2); _vm->renderImage( 8); } caught2(); @@ -1327,11 +1327,11 @@ void GameManager2::drawClock() { } for (int i = 0; i < 3; i++) { Object *o = r->getObject(i); - if ((o->_id == DOOR || o->_id == ENCRYPTED_DOOR || o->_id == SMALL_DOOR) && + if ((o->_id == DOOR || o->_id == ENCRYPTED_DOOR || o->_id == SMALL_DOOR) && (o->_type & OPENED) && ! _state._alarmOn) alarm(); } - if (!_state._alarmOn && _currentRoom == _rooms[MUS4] && + if (!_state._alarmOn && _currentRoom == _rooms[MUS4] && second >= 21 && second <= 40) alarm(); if (_currentRoom == _rooms[MUS_ENTRANCE] && second >= 22 && second <= 29) { @@ -1470,7 +1470,7 @@ void GameManager2::pressureAlarmCount() { if (!(_state._alarmOn || (_currentRoom == _rooms[MUS22] && _currentRoom->isSectionVisible(6)))) { _state._pressureCounter++; - if ((_currentRoom->getId() >= MUS12 && _state._pressureCounter > 8) || + if ((_currentRoom->getId() >= MUS12 && _state._pressureCounter > 8) || _state._pressureCounter > 16) alarm(); } diff --git a/engines/sword2/detection_internal.h b/engines/sword2/detection_internal.h index 5886a19f289..18b67b44d2a 100644 --- a/engines/sword2/detection_internal.h +++ b/engines/sword2/detection_internal.h @@ -30,7 +30,7 @@ #include "sword2/detection.h" /** - * The contents of this file are helpful in detecting games, + * The contents of this file are helpful in detecting games, * as well as helping to create an instance of the game. */ namespace Sword2 { diff --git a/engines/sword25/gfx/renderobjectmanager.cpp b/engines/sword25/gfx/renderobjectmanager.cpp index cee3aba1a19..f996c37490b 100644 --- a/engines/sword25/gfx/renderobjectmanager.cpp +++ b/engines/sword25/gfx/renderobjectmanager.cpp @@ -52,7 +52,7 @@ void RenderObjectQueue::add(RenderObject *renderObject) { bool RenderObjectQueue::exists(const RenderObjectQueueItem &renderObjectQueueItem) { for (RenderObjectQueue::iterator it = begin(); it != end(); ++it) if ((*it)._renderObject == renderObjectQueueItem._renderObject && - (*it)._version == renderObjectQueueItem._version && + (*it)._version == renderObjectQueueItem._version && (*it)._bbox == renderObjectQueueItem._bbox) return true; return false; diff --git a/engines/sword25/module.mk b/engines/sword25/module.mk index def48b42ad2..f3ff342a934 100644 --- a/engines/sword25/module.mk +++ b/engines/sword25/module.mk @@ -53,7 +53,7 @@ MODULE_OBJS := \ script/luascript.o \ script/lua_extensions.o \ sfx/soundengine.o \ - sfx/soundengine_script.o + sfx/soundengine_script.o # This module can be built as a plugin ifeq ($(ENABLE_SWORD25), DYNAMIC_PLUGIN) diff --git a/engines/tinsel/background.cpp b/engines/tinsel/background.cpp index c3b134a4fc1..2fd700edec8 100644 --- a/engines/tinsel/background.cpp +++ b/engines/tinsel/background.cpp @@ -242,7 +242,7 @@ void Background::DrawBackgnd() { // transfer any new palettes to the video DAC PalettesToVideoDAC(); } - + // update the screen within the clipping rectangles for (RectList::const_iterator r = clipRects.begin(); r != clipRects.end(); ++r) { UpdateScreenRect(*r); diff --git a/engines/tinsel/music.cpp b/engines/tinsel/music.cpp index 22869757cff..498a5fb62fd 100644 --- a/engines/tinsel/music.cpp +++ b/engines/tinsel/music.cpp @@ -1006,7 +1006,7 @@ void PCMMusicPlayer::loadMP3MusicFromSegment(int segmentNum) { #ifdef USE_MAD MusicSegmentNoir *musicSegments = (MusicSegmentNoir *)_vm->_handle->LockMem(_hSegment); - Common::SeekableReadStream *sampleStream = readSampleData(_filename, musicSegments[segmentNum].sampleOffset, + Common::SeekableReadStream *sampleStream = readSampleData(_filename, musicSegments[segmentNum].sampleOffset, musicSegments[segmentNum].sampleLength); delete _curChunk; diff --git a/engines/tinsel/saveload.cpp b/engines/tinsel/saveload.cpp index 1eee8d839e6..5763b43adae 100644 --- a/engines/tinsel/saveload.cpp +++ b/engines/tinsel/saveload.cpp @@ -80,7 +80,7 @@ struct SaveGameHeader { uint32 ver; char desc[SG_DESC_LEN]; TimeDate dateTime; - uint32 playTime; + uint32 playTime; bool scnFlag; byte language; uint16 numInterpreters; // Savegame version 2 or later only diff --git a/engines/tinsel/tinsel.cpp b/engines/tinsel/tinsel.cpp index 59a14814fa0..b1207580d46 100644 --- a/engines/tinsel/tinsel.cpp +++ b/engines/tinsel/tinsel.cpp @@ -956,7 +956,7 @@ TinselEngine::~TinselEngine() { FreeGlobalProcesses(); FreeGlobals(); - delete _dialogs; + delete _dialogs; delete _scroll; delete _handle; delete _actor; diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h index 467c03b8e2a..5904140ad26 100644 --- a/engines/titanic/core/game_object.h +++ b/engines/titanic/core/game_object.h @@ -53,7 +53,7 @@ enum StarControlAction { STAR_VIEW_CONSTELLATIONS, ///< Turn on the constellation lines STAR_VIEW_RANDOM_STAR, ///< Look at a random star STAR_FULL_SPEED, ///< Accellerate to full speed - STAR_TOGGLE_STEREO_PAIR, ///< Enable stero pair vision + STAR_TOGGLE_STEREO_PAIR, ///< Enable stero pair vision STAR_TOGGLE_HOME_PHOTO, ///< Turn on/off the home photo STAR_TOGGLE_SOLAR_RENDERING,///< Turn on/off the solar object rendering STAR_TOGGLE_POS_FRAME, ///< Turn on/off the pilot's position frame diff --git a/engines/titanic/core/view_item.cpp b/engines/titanic/core/view_item.cpp index 489ef810e6a..a2574114bb5 100644 --- a/engines/titanic/core/view_item.cpp +++ b/engines/titanic/core/view_item.cpp @@ -167,7 +167,7 @@ void CViewItem::enterView(CViewItem *newView) { } } - // WORKAROUND: Do a dummy mouse movement, to allow for the correct cursor + // WORKAROUND: Do a dummy mouse movement, to allow for the correct cursor // to be set for the current position in the new view CMouseMoveMsg moveMsg(g_vm->_events->getMousePos(), 0); newView->MouseMoveMsg(&moveMsg); diff --git a/engines/titanic/game/sweet_bowl.cpp b/engines/titanic/game/sweet_bowl.cpp index 81d93939d5d..b8dc86007b4 100644 --- a/engines/titanic/game/sweet_bowl.cpp +++ b/engines/titanic/game/sweet_bowl.cpp @@ -57,7 +57,7 @@ bool CSweetBowl::ActMsg(CActMsg *msg) { if (msg->_action == "Jiggle") { setVisible(true); playMovie(MOVIE_WAIT_FOR_FINISH | MOVIE_NOTIFY_OBJECT); - playSound(getRandomNumber(1) == 1 ? + playSound(getRandomNumber(1) == 1 ? TRANSLATE("b#42.wav", "b#25.wav") : TRANSLATE("b#43.wav", "b#26.wav")); } diff --git a/engines/titanic/npcs/doorbot.cpp b/engines/titanic/npcs/doorbot.cpp index aae1914f95a..4a47a6a37c2 100644 --- a/engines/titanic/npcs/doorbot.cpp +++ b/engines/titanic/npcs/doorbot.cpp @@ -432,7 +432,7 @@ bool CDoorbot::TrueTalkNotifySpeechEndedMsg(CTrueTalkNotifySpeechEndedMsg *msg) CTrueTalkNPC::TrueTalkNotifySpeechEndedMsg(msg); if (_npcFlags & NPCFLAG_DOORBOT_INTRO) { - // Initial speech by Doorbot in + // Initial speech by Doorbot in switch (msg->_dialogueId - TRANSLATE(10552, 10563)) { case 0: playClip("SE Try Buttons", MOVIE_NOTIFY_OBJECT); diff --git a/engines/titanic/npcs/starlings.cpp b/engines/titanic/npcs/starlings.cpp index ff1c40cf290..f820fdd4b0e 100644 --- a/engines/titanic/npcs/starlings.cpp +++ b/engines/titanic/npcs/starlings.cpp @@ -53,7 +53,7 @@ bool CStarlings::EnterViewMsg(CEnterViewMsg *msg) { // Tis but a flesh wound setVisible(false); else - // Repeatedly play the starlings flying + // Repeatedly play the starlings flying playMovie(MOVIE_REPEAT); return true; } diff --git a/engines/titanic/pet_control/pet_inventory.h b/engines/titanic/pet_control/pet_inventory.h index 8dc98578dcc..8a8b4e6d068 100644 --- a/engines/titanic/pet_control/pet_inventory.h +++ b/engines/titanic/pet_control/pet_inventory.h @@ -166,7 +166,7 @@ public: void highlightItem(CGameObject *item); /** - * Gets the object, if any, containing the transformation animation played + * Gets the object, if any, containing the transformation animation played * when pieces of Titania are added to the inventory for the first time. */ CGameObject *getTransformAnimation(int index); diff --git a/engines/titanic/pet_control/pet_inventory_glyphs.cpp b/engines/titanic/pet_control/pet_inventory_glyphs.cpp index 9d0dd518b9c..e69ce65813b 100644 --- a/engines/titanic/pet_control/pet_inventory_glyphs.cpp +++ b/engines/titanic/pet_control/pet_inventory_glyphs.cpp @@ -222,7 +222,7 @@ int CPetInventoryGlyph::populateItem(CGameObject *item, bool isLoading) { if (itemIndex == -1) return -1; - // Some objects can be in multiple different states. These are handled + // Some objects can be in multiple different states. These are handled // below to give each the correct inventory glyph and description switch (ITEM_MODES[itemIndex]) { case 0: diff --git a/engines/titanic/pet_control/pet_inventory_glyphs.h b/engines/titanic/pet_control/pet_inventory_glyphs.h index 520b3d0ad27..3843ef3b6de 100644 --- a/engines/titanic/pet_control/pet_inventory_glyphs.h +++ b/engines/titanic/pet_control/pet_inventory_glyphs.h @@ -50,7 +50,7 @@ private: /** * Start a singular (non-repeating) animation for the item, - * such as an item's transformation into a piece of Titania + * such as an item's transformation into a piece of Titania */ void startSingularMovie(); diff --git a/engines/titanic/pet_control/pet_sound.cpp b/engines/titanic/pet_control/pet_sound.cpp index 6e88d7d35d3..d5b2e5a02b6 100644 --- a/engines/titanic/pet_control/pet_sound.cpp +++ b/engines/titanic/pet_control/pet_sound.cpp @@ -229,7 +229,7 @@ bool CPetSound::MouseButtonDownMsg(const Point &pt) { bool CPetSound::MouseDragStartMsg(CMouseDragStartMsg *msg) { if (_masterVolume.resetThumbFocus()) { - _draggingSlider = &_masterVolume; + _draggingSlider = &_masterVolume; getOwner()->startDragging(this, msg); _draggingSliderNum = MASTER_SLIDER; return true; diff --git a/engines/titanic/star_control/base_stars.cpp b/engines/titanic/star_control/base_stars.cpp index 80c8ae97161..91d3c9d1376 100644 --- a/engines/titanic/star_control/base_stars.cpp +++ b/engines/titanic/star_control/base_stars.cpp @@ -184,7 +184,7 @@ void CBaseStars::draw1(CSurfaceArea *surfaceArea, CCamera *camera, CStarCloseup tempY = vector._x * pose._row1._y + vector._y * pose._row2._y + vector._z * pose._row3._y + pose._vector._y; tempX = vector._x * pose._row1._x + vector._y * pose._row2._x + vector._z * pose._row3._x + pose._vector._x; - total2 = tempY * tempY + tempX * tempX + tempZ * tempZ; + total2 = tempY * tempY + tempX * tempX + tempZ * tempZ; if (total2 < 1.0e12) { closeup->draw(pose, vector, FVector(centroid._x, centroid._y, total2), diff --git a/engines/titanic/star_control/camera.cpp b/engines/titanic/star_control/camera.cpp index 7110fe55395..47c1e280d47 100644 --- a/engines/titanic/star_control/camera.cpp +++ b/engines/titanic/star_control/camera.cpp @@ -60,11 +60,11 @@ void CCamera::deinit() { _newOrientation = nullptr; } -bool CCamera::isLocked() { +bool CCamera::isLocked() { return _motion->isLocked(); } -bool CCamera::isNotInLockingProcess() { +bool CCamera::isNotInLockingProcess() { return !_isInLockingProcess; } @@ -592,7 +592,7 @@ bool CCamera::lockMarker2(CViewport *viewport, const FVector &secondStarPosition FVector newPos = m13._row1; FMatrix oldOr = _viewport.getOrientation(); - // WORKAROUND: set old position to new position (1st argument), this prevents + // WORKAROUND: set old position to new position (1st argument), this prevents // locking issues when locking the 2nd star. Fixes #9961. _motion->transitionBetweenPosOrients(newPos, newPos, oldOr, newOr); CCallbackHandler *callback = new CCallbackHandler(this, secondStarPosition); @@ -611,7 +611,7 @@ bool CCamera::lockMarker3(CViewport *viewport, const FVector &thirdStarPosition) FVector newPos = viewport->_position; //FVector oldPos = _viewport._position; - // WORKAROUND: set old position to new position (1st argument), this prevents + // WORKAROUND: set old position to new position (1st argument), this prevents // locking issues when locking the 3rd star. Fixes #9961. _motion->transitionBetweenPosOrients(newPos, newPos, oldOr, newOr); diff --git a/engines/titanic/star_control/camera.h b/engines/titanic/star_control/camera.h index 5b2d503f426..e14d0ab05ce 100644 --- a/engines/titanic/star_control/camera.h +++ b/engines/titanic/star_control/camera.h @@ -54,7 +54,7 @@ private: private: /** * Creates a motion controller for the camera. This needs to be recreated - * when the number of locked stars changes. + * when the number of locked stars changes. * @param src Contains characteristics to set for the motion */ bool createMotionControl(const CNavigationInfo *src); @@ -88,7 +88,7 @@ public: /** * The mover/view is not currently homing in on a new star - * This can mean it is unmarked, or that it is fully locked + * This can mean it is unmarked, or that it is fully locked * onto one star or more (but not in the process of doing so) */ bool isNotInLockingProcess(); @@ -221,7 +221,7 @@ public: * Second is the x center coordinate relative to z * Third is the first x center pixel offset * Fourth is the second x center pixel offset - */ + */ virtual void getRelativeXCenterPixels(double *v1, double *v2, double *v3, double *v4); /** @@ -236,7 +236,7 @@ public: /** * Calculates the angle of rotation of y that achieves - * the minimum distance to x. + * the minimum distance to x. * The angle is in degrees. * Also returns the minimum distance calculated */ diff --git a/engines/titanic/star_control/fpose.cpp b/engines/titanic/star_control/fpose.cpp index 240aea591fa..1459393f840 100644 --- a/engines/titanic/star_control/fpose.cpp +++ b/engines/titanic/star_control/fpose.cpp @@ -177,7 +177,7 @@ FPose FPose::inverseTransform() const { float B[16]={}; // B contains inverse of A - matrix4Inverse(A,B); + matrix4Inverse(A,B); matrix_inv._vector._x=B[12]; matrix_inv._vector._y=B[13]; matrix_inv._vector._z=B[14]; diff --git a/engines/titanic/star_control/frect.cpp b/engines/titanic/star_control/frect.cpp index f481a6ca343..d182280486b 100644 --- a/engines/titanic/star_control/frect.cpp +++ b/engines/titanic/star_control/frect.cpp @@ -33,7 +33,7 @@ bool FRect::operator!=(const FRect &r) const { } bool FRect::empty() const { - return left == right && top == bottom; + return left == right && top == bottom; } } // End of namespace Titanic diff --git a/engines/titanic/star_control/fvector.h b/engines/titanic/star_control/fvector.h index f266dcbc922..48d0fa4a0aa 100644 --- a/engines/titanic/star_control/fvector.h +++ b/engines/titanic/star_control/fvector.h @@ -103,7 +103,7 @@ public: FVector matProdRowVect(const FPose &pose) const; /** - * Returns a matrix that contains the frame rotation based on this vector and + * Returns a matrix that contains the frame rotation based on this vector and * a vector rotation based on input vector v */ FPose getFrameTransform(const FVector &v); @@ -142,7 +142,7 @@ public: const FVector operator*(const FVector &right) const { return FVector(_x * right._x, _y * right._y, _z * right._z); - } + } void operator+=(const FVector &delta) { _x += delta._x; diff --git a/engines/titanic/star_control/star_crosshairs.cpp b/engines/titanic/star_control/star_crosshairs.cpp index e3edd1bf987..417b2f117c5 100644 --- a/engines/titanic/star_control/star_crosshairs.cpp +++ b/engines/titanic/star_control/star_crosshairs.cpp @@ -170,7 +170,7 @@ void CStarCrosshairs::incMatches() { } FPoint CStarCrosshairs::getPosition() const { - return (_entryIndex >= 0 && _entryIndex <= 2) ? + return (_entryIndex >= 0 && _entryIndex <= 2) ? FPoint(_entries[_entryIndex]) : FPoint(); } diff --git a/engines/titanic/star_control/star_view.cpp b/engines/titanic/star_control/star_view.cpp index 4a76f96fbb8..acf85be9201 100644 --- a/engines/titanic/star_control/star_view.cpp +++ b/engines/titanic/star_control/star_view.cpp @@ -144,7 +144,7 @@ bool CStarView::MouseMoveMsg(int unused, const Point &pt) { if (distance >= threshold) { distance -= threshold; - FPoint angle(tempPt._x * -2.0 * distance / threshold, + FPoint angle(tempPt._x * -2.0 * distance / threshold, tempPt._y * -2.0 * distance / threshold); _camera.setViewportAngle(angle); return true; diff --git a/engines/titanic/star_control/viewport.cpp b/engines/titanic/star_control/viewport.cpp index 3c3b7ce83c5..5ca4a755096 100644 --- a/engines/titanic/star_control/viewport.cpp +++ b/engines/titanic/star_control/viewport.cpp @@ -186,7 +186,7 @@ void CViewport::randomizeOrientation() { } void CViewport::changeStarColorPixel(StarMode mode, double pixelOffSet) { - // pixelOffset is usually 0.0, 30.0, or 28000.0 + // pixelOffset is usually 0.0, 30.0, or 28000.0 if (mode == MODE_PHOTO) { _valArray[0] = pixelOffSet; _valArray[1] = -pixelOffSet; @@ -226,7 +226,7 @@ FPose CViewport::getRawPose() { } -// TODO: should index be used here like +// TODO: should index be used here like // getRelativePosCentering/getRelativePosCentering2? // CCamera::getRelativePosCentering is calling this with an index of // 2 which corresponds to _isZero which has value 0. diff --git a/engines/titanic/true_talk/bellbot_script.cpp b/engines/titanic/true_talk/bellbot_script.cpp index 561cbd2595e..72d850c49f1 100644 --- a/engines/titanic/true_talk/bellbot_script.cpp +++ b/engines/titanic/true_talk/bellbot_script.cpp @@ -1699,7 +1699,7 @@ stateFlag = false; break; case 88: - if (sentence->_category == 6 || + if (sentence->_category == 6 || (g_language != Common::DE_DEU && sentence->contains("upside down"))) { addResponse(getDialogueId(202142)); applyFlag = true; diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp index 83ce50b83cb..15fd33bd962 100644 --- a/engines/titanic/true_talk/tt_npc_script.cpp +++ b/engines/titanic/true_talk/tt_npc_script.cpp @@ -289,7 +289,7 @@ int TTnpcScript::handleQuote(const TTroomScript *roomScript, const TTsentence *s for (uint idx = 3; idx < _quotes.size(); ++idx) { const TThandleQuoteEntry *qe = &_quotes[idx]; - if (qe->_tag1 == tag1 && + if (qe->_tag1 == tag1 && (qe->_tag2 == tag2 || qe->_tag2 < MKTAG('A', 'A', 'A', 'A'))) { uint threshold = qe->_tag2; if (threshold > 0 && threshold < 100) { diff --git a/engines/ultima/nuvie/core/debug.cpp b/engines/ultima/nuvie/core/debug.cpp index 23e23e2c428..acbcb5d024a 100644 --- a/engines/ultima/nuvie/core/debug.cpp +++ b/engines/ultima/nuvie/core/debug.cpp @@ -81,7 +81,7 @@ DebugLevelType debug(const char *func, const char *file, const int line, const b ::debugN("\n"); #endif } - + va_list ap; va_start(ap, format); Common::String buf = Common::String::vformat(format, ap); diff --git a/engines/ultima/nuvie/core/game.cpp b/engines/ultima/nuvie/core/game.cpp index e74040a5e65..f3e6d9e7afa 100644 --- a/engines/ultima/nuvie/core/game.cpp +++ b/engines/ultima/nuvie/core/game.cpp @@ -77,7 +77,7 @@ Game::Game(Configuration *cfg, Events *evt, Screen *scr, GUI *g, nuvie_game_t ty game = this; config = cfg; event = evt; - + gui = g; screen = scr; diff --git a/engines/ultima/nuvie/core/look.cpp b/engines/ultima/nuvie/core/look.cpp index 841a972d1c0..42565244d7c 100644 --- a/engines/ultima/nuvie/core/look.cpp +++ b/engines/ultima/nuvie/core/look.cpp @@ -124,7 +124,7 @@ const char *Look::get_description(uint16 tile_num, bool *plural) { desc = look_tbl[tile_num]; len = strlen(desc); - + for (i = 0, j = 0; i < len;) { if (desc[i] == '\\' || desc[i] == '/') { has_plural = true; diff --git a/engines/ultima/nuvie/core/timed_event.cpp b/engines/ultima/nuvie/core/timed_event.cpp index 5f40fa47aaf..a3aa821a0d5 100644 --- a/engines/ultima/nuvie/core/timed_event.cpp +++ b/engines/ultima/nuvie/core/timed_event.cpp @@ -755,7 +755,7 @@ TimedRest::TimedRest(uint8 hours, Actor *who_will_guard, Obj *campfire_obj) TimedRest::~TimedRest() { //MapCoord loc = Game::get_game()->get_player()->get_actor()->get_location(); assert(campfire != 0); - + campfire->frame_n = 0; // extinguish campfire bool can_heal = (Game::get_game()->get_clock()->get_rest_counter() == 0); //only heal once every 12 hours. diff --git a/engines/ultima/nuvie/files/nuvie_bmp_file.cpp b/engines/ultima/nuvie/files/nuvie_bmp_file.cpp index d2d50111730..cccf7546003 100644 --- a/engines/ultima/nuvie/files/nuvie_bmp_file.cpp +++ b/engines/ultima/nuvie/files/nuvie_bmp_file.cpp @@ -282,7 +282,7 @@ Graphics::ManagedSurface *NuvieBmpFile::getSdlSurface32() { } Graphics::ManagedSurface *surface = new Graphics::ManagedSurface( - infoHeader.width, infoHeader.height, + infoHeader.width, infoHeader.height, Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0) ); diff --git a/engines/ultima/nuvie/gui/gui_font.cpp b/engines/ultima/nuvie/gui/gui_font.cpp index 668dcd5487a..d8dbace5c52 100644 --- a/engines/ultima/nuvie/gui/gui_font.cpp +++ b/engines/ultima/nuvie/gui/gui_font.cpp @@ -98,7 +98,7 @@ GUI_Font::~GUI_Font() { /* determine drawing style */ void GUI_Font::setTransparency(bool on) { _transparent = on; - + if (_transparent) _fontStore->setTransparentColor(0); else @@ -107,7 +107,7 @@ void GUI_Font::setTransparency(bool on) { /* determine foreground and background color values RGB*/ void GUI_Font::setColoring(uint8 fr, uint8 fg, uint8 fb, uint8 br, uint8 bg, uint8 bb) { - const SDL_Color colors[2] = { MAKE_COLOR(br, bg, bb), MAKE_COLOR(fr, fg, fb) }; + const SDL_Color colors[2] = { MAKE_COLOR(br, bg, bb), MAKE_COLOR(fr, fg, fb) }; SDL_SetColors(_fontStore, colors, 0, 2); } diff --git a/engines/ultima/nuvie/misc/sdl_compat.cpp b/engines/ultima/nuvie/misc/sdl_compat.cpp index 7d1b47cf5da..18d7df2a63c 100644 --- a/engines/ultima/nuvie/misc/sdl_compat.cpp +++ b/engines/ultima/nuvie/misc/sdl_compat.cpp @@ -86,12 +86,12 @@ void SDL_UpdateRects(Graphics::ManagedSurface *surf, int count, Common::Rect *re Graphics::ManagedSurface *SDL_LoadBMP(const char *filename) { Common::File f; Image::BitmapDecoder decoder; - + if (!f.open(filename)) error("Could not open file - %s", filename); if (!decoder.loadStream(f)) error("Could not load bitmap - %s", filename); - + const Graphics::Surface *src = decoder.getSurface(); Graphics::ManagedSurface *dest = new Graphics::ManagedSurface(src->w, src->h, src->format); dest->blitFrom(*src); diff --git a/engines/ultima/nuvie/nuvie.cpp b/engines/ultima/nuvie/nuvie.cpp index 9f15147af06..453e5e0f76e 100644 --- a/engines/ultima/nuvie/nuvie.cpp +++ b/engines/ultima/nuvie/nuvie.cpp @@ -258,10 +258,10 @@ bool NuvieEngine::canLoadGameStateCurrently(bool isAutosave) { // the save dialog will result in active gumps being closed Events *events = static_cast(_events); MapWindow *mapWindow = _game->get_map_window(); - + if (isAutosave) { return events->get_mode() == MOVE_MODE; - + } else { events->close_gumps(); diff --git a/engines/ultima/nuvie/screen/screen.cpp b/engines/ultima/nuvie/screen/screen.cpp index 9bbfebd75e2..bf2c0b32689 100644 --- a/engines/ultima/nuvie/screen/screen.cpp +++ b/engines/ultima/nuvie/screen/screen.cpp @@ -1235,7 +1235,7 @@ void Screen::set_screen_mode() { if (scale_factor == 0) scale_factor = 1; scaler = 0; scale_factor = 1; - + Graphics::PixelFormat SCREEN_FORMAT(2, 5, 6, 5, 0, 11, 5, 0, 0); initGraphics(width, height, &SCREEN_FORMAT); _rawSurface = new Graphics::Screen(width, height, SCREEN_FORMAT); diff --git a/engines/ultima/nuvie/screen/surface.cpp b/engines/ultima/nuvie/screen/surface.cpp index c83040dba69..e017a20bfe1 100644 --- a/engines/ultima/nuvie/screen/surface.cpp +++ b/engines/ultima/nuvie/screen/surface.cpp @@ -108,7 +108,7 @@ void RenderSurface::set_format(const Graphics::PixelFormat *fmt) { Gloss16 = Gloss + 8; Bloss16 = Bloss + 8; Rshift = fmt->rShift; - Gshift = fmt->gShift; + Gshift = fmt->gShift; Bshift = fmt->bShift; Rmask = fmt->rMax() << fmt->rShift; Gmask = fmt->gMax() << fmt->gShift; diff --git a/engines/ultima/shared/core/map.cpp b/engines/ultima/shared/core/map.cpp index 49f2eef7772..807a7007d52 100644 --- a/engines/ultima/shared/core/map.cpp +++ b/engines/ultima/shared/core/map.cpp @@ -115,7 +115,7 @@ Point Map::MapBase::getDirectionDelta() const { Point Map::MapBase::getDeltaPosition(const Point &delta) { return _playerWidget->_position + delta; -} +} void Map::MapBase::resetViewport() { // Reset the viewport, so it's position will get recalculated diff --git a/engines/ultima/shared/core/map.h b/engines/ultima/shared/core/map.h index f34b06ca9d2..49b137bac71 100644 --- a/engines/ultima/shared/core/map.h +++ b/engines/ultima/shared/core/map.h @@ -32,7 +32,7 @@ namespace Ultima { namespace Shared { -#define REGISTER_WIDGET(NAME) if (name == #NAME) return new Widgets::NAME(_game, (Ultima1Map::MapBase *)map) +#define REGISTER_WIDGET(NAME) if (name == #NAME) return new Widgets::NAME(_game, (Ultima1Map::MapBase *)map) #define DECLARE_WIDGET(NAME) virtual const char *getClassName() const override { return #NAME; } enum Direction { @@ -59,7 +59,7 @@ public: int _widgetNum; // Widget number, if any MapWidget *_widget; // Widget pointer int _itemNum; // Item number, if any - // Dungeon tile flags + // Dungeon tile flags bool _isDoor, _isSecretDoor; bool _isLadderUp, _isLadderDown; bool _isWall, _isHallway, _isBeams; diff --git a/engines/ultima/shared/core/str.cpp b/engines/ultima/shared/core/str.cpp index d2e03de2cb8..02a8a07e28d 100644 --- a/engines/ultima/shared/core/str.cpp +++ b/engines/ultima/shared/core/str.cpp @@ -38,7 +38,7 @@ int String::indexOf(const String &chars) const { if (charIndex != -1 && charIndex < (int)minIndex) minIndex = charIndex; } - + return minIndex == size() ? -1 : minIndex; } diff --git a/engines/ultima/shared/early/game.h b/engines/ultima/shared/early/game.h index 8ad344b304c..cfd3e76d070 100644 --- a/engines/ultima/shared/early/game.h +++ b/engines/ultima/shared/early/game.h @@ -87,7 +87,7 @@ public: * Constructor */ Game(); - + /** * Destructor */ diff --git a/engines/ultima/shared/engine/data_archive.cpp b/engines/ultima/shared/engine/data_archive.cpp index c0d4844e6c8..a464c681d28 100644 --- a/engines/ultima/shared/engine/data_archive.cpp +++ b/engines/ultima/shared/engine/data_archive.cpp @@ -138,7 +138,7 @@ int UltimaDataArchive::listMatchingMembers(Common::ArchiveMemberList &list, cons it != innerList.end(); ++it) { Common::ArchiveMemberPtr member = Common::ArchiveMemberPtr( new UltimaDataArchiveMember(*it, _innerfolder)); - list.push_back(member); + list.push_back(member); } return result; @@ -197,7 +197,7 @@ Common::FSNode UltimaDataArchiveProxy::getNode(const Common::String &name) const Common::String remainingName = name.substr(_publicFolder.size()); Common::FSNode node = _folder; size_t pos; - + while ((pos = remainingName.findFirstOf('/')) != Common::String::npos) { node = node.getChild(remainingName.substr(0, pos)); if (!node.exists()) @@ -209,7 +209,7 @@ Common::FSNode UltimaDataArchiveProxy::getNode(const Common::String &name) const if (!remainingName.empty()) node = node.getChild(remainingName); - return node; + return node; } #endif diff --git a/engines/ultima/shared/engine/events.cpp b/engines/ultima/shared/engine/events.cpp index d119e513cde..d2b2967f241 100644 --- a/engines/ultima/shared/engine/events.cpp +++ b/engines/ultima/shared/engine/events.cpp @@ -173,7 +173,7 @@ void EventsManager::setButtonDown(MouseButton button, bool isDown) { mask = MK_MBUTTON; break; default: - break; + break; } if (isDown) { diff --git a/engines/ultima/shared/gfx/bitmap.cpp b/engines/ultima/shared/gfx/bitmap.cpp index 6deb49b1045..a12a6836306 100644 --- a/engines/ultima/shared/gfx/bitmap.cpp +++ b/engines/ultima/shared/gfx/bitmap.cpp @@ -52,7 +52,7 @@ void Bitmap::load(const Common::String &filename) { void Bitmap::flipHorizontally() { Graphics::Surface s = getSubArea(Common::Rect(0, 0, this->w, this->h)); - + for (int y = 0; y < h; ++y) { byte *lineStart = (byte *)s.getBasePtr(0, y); byte *lineEnd = (byte *)s.getBasePtr(this->w - 1, y); diff --git a/engines/ultima/shared/gfx/font.cpp b/engines/ultima/shared/gfx/font.cpp index 02914f302ed..8709be1e1a1 100644 --- a/engines/ultima/shared/gfx/font.cpp +++ b/engines/ultima/shared/gfx/font.cpp @@ -45,7 +45,7 @@ int Font::writeString(Graphics::ManagedSurface &surface, const Common::String &m writeChar(surface, (unsigned char)*msgP, pt, color, bgColor); } } - + return total; } diff --git a/engines/ultima/shared/gfx/sprites.h b/engines/ultima/shared/gfx/sprites.h index 1f413c482ea..4b2152a75f3 100644 --- a/engines/ultima/shared/gfx/sprites.h +++ b/engines/ultima/shared/gfx/sprites.h @@ -66,7 +66,7 @@ public: void draw(Graphics::ManagedSurface &dest, const Common::Point &pt); /** - * Return the width of the sprite + * Return the width of the sprite */ uint16 w() const { return _surface.w; } diff --git a/engines/ultima/shared/gfx/viewport_dungeon.cpp b/engines/ultima/shared/gfx/viewport_dungeon.cpp index 4e65cf7020c..c534dffec34 100644 --- a/engines/ultima/shared/gfx/viewport_dungeon.cpp +++ b/engines/ultima/shared/gfx/viewport_dungeon.cpp @@ -95,7 +95,7 @@ void ViewportDungeon::draw() { for (int index = distance; index; --index) { currDelta -= delta; Point pt = currentPos + currDelta; - + if (!isDoor || index > 1) { map->getTileAt(pt + leftDelta, &leftTile); map->getTileAt(pt + rightDelta, &rightTile); @@ -162,7 +162,7 @@ uint ViewportDungeon::distanceToOccupiedCell(const Point &delta) { bool ViewportDungeon::isCellOccupied(const Point &delta) { Maps::Map *map = getGame()->getMap(); Point pt = map->getPosition() + delta; - + Maps::MapTile tile; map->getTileAt(pt, &tile); if (tile.isWallOrDoorway()) diff --git a/engines/ultima/shared/gfx/viewport_map.h b/engines/ultima/shared/gfx/viewport_map.h index 7b35a6d3eda..f8581a0cd95 100644 --- a/engines/ultima/shared/gfx/viewport_map.h +++ b/engines/ultima/shared/gfx/viewport_map.h @@ -40,7 +40,7 @@ public: * Constructor */ ViewportMap(TreeItem *parent) : Gfx::VisualItem("ViewportMap", Rect(8, 8, 312, 152), parent), _sprites(nullptr) {} - + /** * Destructor */ diff --git a/engines/ultima/shared/gfx/visual_surface.h b/engines/ultima/shared/gfx/visual_surface.h index 58496efe86c..1759fe44e01 100644 --- a/engines/ultima/shared/gfx/visual_surface.h +++ b/engines/ultima/shared/gfx/visual_surface.h @@ -32,7 +32,7 @@ namespace Ultima { namespace Shared { class GameBase; - + namespace Gfx { class Font; diff --git a/engines/ultima/shared/maps/map.h b/engines/ultima/shared/maps/map.h index f6428544266..3f504e8c657 100644 --- a/engines/ultima/shared/maps/map.h +++ b/engines/ultima/shared/maps/map.h @@ -38,7 +38,7 @@ class Game; namespace Maps { -#define REGISTER_WIDGET(NAME) if (name == #NAME) return new Widgets::NAME(_game, this) +#define REGISTER_WIDGET(NAME) if (name == #NAME) return new Widgets::NAME(_game, this) #define DECLARE_WIDGET(NAME) virtual const char *getClassName() const override { return #NAME; } /** diff --git a/engines/ultima/shared/maps/map_base.cpp b/engines/ultima/shared/maps/map_base.cpp index 2fd578d9432..d51e378929b 100644 --- a/engines/ultima/shared/maps/map_base.cpp +++ b/engines/ultima/shared/maps/map_base.cpp @@ -127,7 +127,7 @@ Point MapBase::getDirectionDelta() const { Point MapBase::getDeltaPosition(const Point &delta) { return _playerWidget->_position + delta; -} +} void MapBase::resetViewport() { // Reset the viewport, so it's position will get recalculated diff --git a/engines/ultima/shared/maps/map_tile.h b/engines/ultima/shared/maps/map_tile.h index b5d6f0a4a14..29e71f2dcc2 100644 --- a/engines/ultima/shared/maps/map_tile.h +++ b/engines/ultima/shared/maps/map_tile.h @@ -42,7 +42,7 @@ public: Common::Array _widgets; // Widgets on the tile, if any int _widgetNum; // Widget number of first widget, if any MapWidget *_widget; // Pointer tofirst widget on tile, if any - // Dungeon tile flags + // Dungeon tile flags bool _isDoor, _isSecretDoor; bool _isLadderUp, _isLadderDown; bool _isWall, _isHallway, _isBeams; diff --git a/engines/ultima/shared/maps/map_widget.h b/engines/ultima/shared/maps/map_widget.h index b2833dda700..6f49c5e82f1 100644 --- a/engines/ultima/shared/maps/map_widget.h +++ b/engines/ultima/shared/maps/map_widget.h @@ -34,7 +34,7 @@ namespace Ultima { namespace Shared { class Game; - + namespace Maps { enum Direction { diff --git a/engines/ultima/ultima0/core/resources.h b/engines/ultima/ultima0/core/resources.h index 252bbbaaa6d..968ab803d74 100644 --- a/engines/ultima/ultima0/core/resources.h +++ b/engines/ultima/ultima0/core/resources.h @@ -29,7 +29,7 @@ namespace Ultima { namespace Ultima0 { class Resources : public Shared::LocalResourceFile { - + }; } // End of namespace Ultima0 diff --git a/engines/ultima/ultima0/resources.h b/engines/ultima/ultima0/resources.h index 252bbbaaa6d..968ab803d74 100644 --- a/engines/ultima/ultima0/resources.h +++ b/engines/ultima/ultima0/resources.h @@ -29,7 +29,7 @@ namespace Ultima { namespace Ultima0 { class Resources : public Shared::LocalResourceFile { - + }; } // End of namespace Ultima0 diff --git a/engines/ultima/ultima1/actions/move.cpp b/engines/ultima/ultima1/actions/move.cpp index 333c71557ea..8c2623ff3fb 100644 --- a/engines/ultima/ultima1/actions/move.cpp +++ b/engines/ultima/ultima1/actions/move.cpp @@ -36,7 +36,7 @@ END_MESSAGE_MAP() bool Move::MoveMsg(CMoveMsg *msg) { Maps::Ultima1Map *map = getMap(); - + if (map->_mapType == Maps::MAP_DUNGEON) { switch (msg->_direction) { case Shared::Maps::DIR_LEFT: diff --git a/engines/ultima/ultima1/core/party.cpp b/engines/ultima/ultima1/core/party.cpp index 28253927109..3fa32f97ab6 100644 --- a/engines/ultima/ultima1/core/party.cpp +++ b/engines/ultima/ultima1/core/party.cpp @@ -61,7 +61,7 @@ Character::Character(Ultima1Game *game) : Shared::Character(), _armourPlateMail(game, this, ARMOR_PLATE_MAIL), _armourVacuumSuit(game, this, ARMOR_VACUUM_SUIT), _armourReflectSuit(game, this, ARMOR_REFLECT_SUIT), - + _spellBlink(game, this), _spellCreate(game, this), _spellDestroy(game, this), diff --git a/engines/ultima/ultima1/core/resources.cpp b/engines/ultima/ultima1/core/resources.cpp index e71d21de067..0e1c4668a04 100644 --- a/engines/ultima/ultima1/core/resources.cpp +++ b/engines/ultima/ultima1/core/resources.cpp @@ -732,7 +732,7 @@ static const char *const SRC_KING_TEXT[12] = { /*-------------------------------------------------------------------*/ GameResources::GameResources() : LocalResourceFile("ULTIMA1/DATA") { -} +} GameResources::GameResources(Shared::Resources *resManager) : LocalResourceFile(resManager, "ULTIMA1/DATA") { Common::copy(SRC_TITLE_MESSAGES, SRC_TITLE_MESSAGES + 13, TITLE_MESSAGES); diff --git a/engines/ultima/ultima1/maps/map_city_castle.cpp b/engines/ultima/ultima1/maps/map_city_castle.cpp index 83f87a64669..0f57bebd517 100644 --- a/engines/ultima/ultima1/maps/map_city_castle.cpp +++ b/engines/ultima/ultima1/maps/map_city_castle.cpp @@ -115,7 +115,7 @@ void MapCityCastle::loadWidgets() { default: error("Unknown NPC type %d", lp[0]); } - + person->_position = Point(lp[1], lp[2]); addWidget(person); } @@ -315,7 +315,7 @@ void MapCity::dropCoins(uint coins) { // Increase one of the attributes randomly uint *attrList[6] = { &c._strength, &c._agility, &c._stamina, &c._charisma, &c._wisdom, &c._intelligence }; uint &attr = *attrList[_game->getRandomNumber(0, 5)]; - + attr = MIN(attr + coins / 10, 99U); break; } @@ -404,14 +404,14 @@ void MapCastle::dropCoins(uint coins) { if (tile._tileId == CTILE_POND_EDGE1) { uint hp = coins * 3 / 2; c._hitPoints = MIN(c._hitPoints + hp, 9999U); - + if (_game->getRandomNumber(1, 255) > 16) { addInfoMsg(_game->_res->SHAZAM); } else { uint spellNum = _game->getRandomNumber(1, 7); if (spellNum == Spells::SPELL_MAGIC_MISSILE) spellNum = Spells::SPELL_STEAL; - + c._spells[spellNum]->incrQuantity(); addInfoMsg(_game->_res->ALAKAZOT); } diff --git a/engines/ultima/ultima1/maps/map_dungeon.cpp b/engines/ultima/ultima1/maps/map_dungeon.cpp index d3218fb56d9..f58ef9c98a7 100644 --- a/engines/ultima/ultima1/maps/map_dungeon.cpp +++ b/engines/ultima/ultima1/maps/map_dungeon.cpp @@ -285,7 +285,7 @@ void MapDungeon::climb() { addInfoMsg(_game->_res->WHAT); _game->playFX(1); } else if (getDirection() == Shared::Maps::DIR_LEFT || getDirection() == Shared::Maps::DIR_RIGHT) { - addInfoMsg(""); + addInfoMsg(""); addInfoMsg(_game->_res->FACE_THE_LADDER); _game->playFX(1); } else if (tile._isLadderUp) { @@ -303,7 +303,7 @@ void MapDungeon::castSpell(uint spellId) { void MapDungeon::leavingDungeon() { Shared::Character &c = *_game->_party; - + // Don't allow the hit points addition to push the hit point total beyond 9999 if (c._hitPoints + _dungeonExitHitPoints > 9999) _dungeonExitHitPoints = 9999 - c._hitPoints; diff --git a/engines/ultima/ultima1/maps/map_overworld.cpp b/engines/ultima/ultima1/maps/map_overworld.cpp index 5d71b47b0fc..c1b0304e7c4 100644 --- a/engines/ultima/ultima1/maps/map_overworld.cpp +++ b/engines/ultima/ultima1/maps/map_overworld.cpp @@ -205,7 +205,7 @@ uint MapOverworld::getEnemyVesselCount() const { } void MapOverworld::attack(int direction, int effectId, uint maxDistance, uint amount, uint agility, const Common::String &hitWidget) { - + } diff --git a/engines/ultima/ultima1/spells/spell.h b/engines/ultima/ultima1/spells/spell.h index 33e162b8e0d..92420ec347f 100644 --- a/engines/ultima/ultima1/spells/spell.h +++ b/engines/ultima/ultima1/spells/spell.h @@ -34,7 +34,7 @@ class Ultima1Game; class Character; namespace Spells { - + enum SpellId { SPELL_PRAYER = 0, SPELL_OPEN = 1, SPELL_UNLOCK = 2, SPELL_MAGIC_MISSILE = 3, SPELL_STEAL = 4, SPELL_LADDER_DOWN = 5, SPELL_LADDER_UP = 6, SPELL_BLINK = 7, SPELL_CREATE = 8, diff --git a/engines/ultima/ultima1/u1dialogs/full_screen_dialog.cpp b/engines/ultima/ultima1/u1dialogs/full_screen_dialog.cpp index 73732e11a2d..4a0d1bba0be 100644 --- a/engines/ultima/ultima1/u1dialogs/full_screen_dialog.cpp +++ b/engines/ultima/ultima1/u1dialogs/full_screen_dialog.cpp @@ -31,7 +31,7 @@ namespace U1Dialogs { FullScreenDialog::FullScreenDialog(Ultima1Game *game) : Dialog(game) { _bounds = Common::Rect(0, 0, 320, 200); } - + void FullScreenDialog::drawFrame(const Common::String &title) { Shared::Gfx::VisualSurface s = getSurface(); U1Gfx::DrawingSupport ds(s); diff --git a/engines/ultima/ultima1/u1dialogs/tavern.h b/engines/ultima/ultima1/u1dialogs/tavern.h index 8ec6e3ea58c..43378d8cc0f 100644 --- a/engines/ultima/ultima1/u1dialogs/tavern.h +++ b/engines/ultima/ultima1/u1dialogs/tavern.h @@ -30,7 +30,7 @@ namespace Ultima1 { namespace Maps { class MapCityCastle; } - + namespace U1Dialogs { /** diff --git a/engines/ultima/ultima1/u1dialogs/transports.h b/engines/ultima/ultima1/u1dialogs/transports.h index 218d3d38abe..482e728d14f 100644 --- a/engines/ultima/ultima1/u1dialogs/transports.h +++ b/engines/ultima/ultima1/u1dialogs/transports.h @@ -64,7 +64,7 @@ private: uint getBuyCost(int transportIndex) const; /** - * Add a transport to the overworld map + * Add a transport to the overworld map */ void addTransport(int transportIndex); protected: diff --git a/engines/ultima/ultima1/u1gfx/drawing_support.cpp b/engines/ultima/ultima1/u1gfx/drawing_support.cpp index 897c7368f72..fc35a5622b0 100644 --- a/engines/ultima/ultima1/u1gfx/drawing_support.cpp +++ b/engines/ultima/ultima1/u1gfx/drawing_support.cpp @@ -73,7 +73,7 @@ void DrawingSupport::roundFrameCorners(bool skipBottom) { for (int idx = 1; idx <= 4; ++idx) { _surface.drawLine(0, idx, idx, 0, 0); _surface.drawLine(319 - idx, 0, 319, idx, 0); - + if (!skipBottom) { _surface.drawLine(0, 199 - idx, idx, 199, 0); _surface.drawLine(319, 199 - idx, 319 - idx, 199, 0); diff --git a/engines/ultima/ultima1/u1gfx/sprites.h b/engines/ultima/ultima1/u1gfx/sprites.h index 2ddc600b177..b9d204b2006 100644 --- a/engines/ultima/ultima1/u1gfx/sprites.h +++ b/engines/ultima/ultima1/u1gfx/sprites.h @@ -50,7 +50,7 @@ private: void animateWater(); public: CLASSDEF; - + /** * Constructor */ diff --git a/engines/ultima/ultima1/u1gfx/text_cursor.cpp b/engines/ultima/ultima1/u1gfx/text_cursor.cpp index 3fc689bcc02..1d31c27ba17 100644 --- a/engines/ultima/ultima1/u1gfx/text_cursor.cpp +++ b/engines/ultima/ultima1/u1gfx/text_cursor.cpp @@ -64,7 +64,7 @@ void U1TextCursor::draw() { // Get the surface area to draw the cursor on Graphics::ManagedSurface s(8, 8); - + // Loop to draw the cursor for (int y = 0; y < CURSOR_H; ++y) { byte *lineP = (byte *)s.getBasePtr(0, y); diff --git a/engines/ultima/ultima1/u1gfx/view_char_gen.cpp b/engines/ultima/ultima1/u1gfx/view_char_gen.cpp index f1de8e72b9d..fcee871b3e2 100644 --- a/engines/ultima/ultima1/u1gfx/view_char_gen.cpp +++ b/engines/ultima/ultima1/u1gfx/view_char_gen.cpp @@ -170,7 +170,7 @@ void ViewCharacterGeneration::drawRace(Shared::Gfx::VisualSurface &s) { s.fillRect(TextRect(2, 16, 37, 21), game->_bgColor); s.writeString(game->_res->CHAR_GEN_TEXT[6], TextPoint(3, 17)); - s.writeString(Common::String::format(game->_res->CHAR_GEN_TEXT[4], + s.writeString(Common::String::format(game->_res->CHAR_GEN_TEXT[4], game->_res->RACE_NAMES[0], game->_res->RACE_NAMES[1], game->_res->RACE_NAMES[2], game->_res->RACE_NAMES[3]), TextPoint(12, 19)); @@ -370,7 +370,7 @@ bool ViewCharacterGeneration::TextInputMsg(CTextInputMsg *msg) { if (!msg->_escaped && !msg->_text.empty()) { // Name provided _character->_name = msg->_text; - + _textInput->hide(); setMode(FLAG_SAVE); } diff --git a/engines/ultima/ultima1/u1gfx/view_char_gen.h b/engines/ultima/ultima1/u1gfx/view_char_gen.h index effc5700c47..6fd33d6af53 100644 --- a/engines/ultima/ultima1/u1gfx/view_char_gen.h +++ b/engines/ultima/ultima1/u1gfx/view_char_gen.h @@ -142,7 +142,7 @@ public: * Constructor */ ViewCharacterGeneration(Shared::TreeItem *parent = nullptr); - + /** * Destructor */ diff --git a/engines/ultima/ultima1/u1gfx/view_game.cpp b/engines/ultima/ultima1/u1gfx/view_game.cpp index 50a77a5c958..443197c5377 100644 --- a/engines/ultima/ultima1/u1gfx/view_game.cpp +++ b/engines/ultima/ultima1/u1gfx/view_game.cpp @@ -75,7 +75,7 @@ ViewGame::ViewGame(TreeItem *parent) : Shared::Gfx::VisualContainer("Game", Rect Ultima1Game *game = static_cast(getGame()); _viewportMap = new ViewportMap(this); - + _actions.resize(22); _actions[0] = new Actions::Move(this); _actions[1] = new Shared::Actions::Huh(this, game->_res->HUH); diff --git a/engines/ultima/ultima1/u1gfx/view_game.h b/engines/ultima/ultima1/u1gfx/view_game.h index 76e50e65ee6..3e4bd2a313d 100644 --- a/engines/ultima/ultima1/u1gfx/view_game.h +++ b/engines/ultima/ultima1/u1gfx/view_game.h @@ -36,7 +36,7 @@ namespace Actions { class Action; } // End of namespace Actions } // End of namespace Shared - + namespace Ultima1 { namespace U1Gfx { diff --git a/engines/ultima/ultima1/u1gfx/view_title.cpp b/engines/ultima/ultima1/u1gfx/view_title.cpp index a64e243236d..c5e9d105fce 100644 --- a/engines/ultima/ultima1/u1gfx/view_title.cpp +++ b/engines/ultima/ultima1/u1gfx/view_title.cpp @@ -185,7 +185,7 @@ void ViewTitle::drawTrademarksView() { s.writeString(game->_res->TITLE_MESSAGES[10], TextPoint(2, 18)); s.writeString(game->_res->TITLE_MESSAGES[11], TextPoint(11, 19)); s.writeString(game->_res->TITLE_MESSAGES[12], TextPoint(6, 23)); - } + } } void ViewTitle::drawMainMenu() { @@ -219,7 +219,7 @@ bool ViewTitle::FrameMsg(CFrameMsg *msg) { if (time < _expiryTime) return true; setDirty(); - + switch (_mode) { case TITLEMODE_COPYRIGHT: setMode(TITLEMODE_PRESENTS); diff --git a/engines/ultima/ultima1/u1gfx/viewport_map.cpp b/engines/ultima/ultima1/u1gfx/viewport_map.cpp index cb002a7ad60..81f96f03ec2 100644 --- a/engines/ultima/ultima1/u1gfx/viewport_map.cpp +++ b/engines/ultima/ultima1/u1gfx/viewport_map.cpp @@ -33,7 +33,7 @@ BEGIN_MESSAGE_MAP(ViewportMap, Shared::ViewportMap) END_MESSAGE_MAP() ViewportMap::ViewportMap(TreeItem *parent) : Shared::ViewportMap(parent), _mapType(Maps::MAP_OVERWORLD) { - _sprites = new Sprites(this); + _sprites = new Sprites(this); } ViewportMap::~ViewportMap() { diff --git a/engines/ultima/ultima1/u1gfx/viewport_map.h b/engines/ultima/ultima1/u1gfx/viewport_map.h index 1dd89a6d1b6..32b36734bc1 100644 --- a/engines/ultima/ultima1/u1gfx/viewport_map.h +++ b/engines/ultima/ultima1/u1gfx/viewport_map.h @@ -44,7 +44,7 @@ public: * Constructor */ ViewportMap(Shared::TreeItem *parent); - + /** * Destructor */ diff --git a/engines/ultima/ultima1/u6gfx/game_view.h b/engines/ultima/ultima1/u6gfx/game_view.h index 38f93ed21a9..4f4533cb537 100644 --- a/engines/ultima/ultima1/u6gfx/game_view.h +++ b/engines/ultima/ultima1/u6gfx/game_view.h @@ -61,7 +61,7 @@ using Shared::CKeypressMsg; class GameView : public Shared::Gfx::VisualContainer { /** * Simple class encapsulating the logic for drawing the Ultima 6 scroll onto a surface - */ + */ class Scroll : private Graphics::ManagedSurface { public: /** diff --git a/engines/ultima/ultima1/widgets/dungeon_monster.cpp b/engines/ultima/ultima1/widgets/dungeon_monster.cpp index 9a52c4aa975..f72b9dd0d62 100644 --- a/engines/ultima/ultima1/widgets/dungeon_monster.cpp +++ b/engines/ultima/ultima1/widgets/dungeon_monster.cpp @@ -107,7 +107,7 @@ Shared::Maps::MapWidget::CanMove DungeonMonster::canMoveTo(const Point &destPos) Shared::Maps::MapWidget::CanMove DungeonMonster::canMoveTo(Shared::Maps::MapBase *map, MapWidget *widget, const Point &destPos) { // Get the details of the position Shared::Maps::MapTile currTile, destTile; - + map->getTileAt(map->getPosition(), &currTile); map->getTileAt(destPos, &destTile); diff --git a/engines/ultima/ultima1/widgets/king.cpp b/engines/ultima/ultima1/widgets/king.cpp index d856869fe27..3492e9dace0 100644 --- a/engines/ultima/ultima1/widgets/king.cpp +++ b/engines/ultima/ultima1/widgets/king.cpp @@ -45,7 +45,7 @@ void King::talk() { if (areGuardsHostile()) { addInfoMsg(_game->_res->HE_REJECTS_OFFER); _game->endOfTurn(); - + } else { U1Dialogs::King *dialog = new U1Dialogs::King(_game, _map->getMapIndex()); dialog->show(); diff --git a/engines/ultima/ultima1/widgets/overworld_monster.cpp b/engines/ultima/ultima1/widgets/overworld_monster.cpp index a51c16e6e00..2b8ee284cc6 100644 --- a/engines/ultima/ultima1/widgets/overworld_monster.cpp +++ b/engines/ultima/ultima1/widgets/overworld_monster.cpp @@ -36,7 +36,7 @@ OverworldMonster::OverworldMonster(Shared::Game *game, Shared::Maps::MapBase *ma const Point &pt, Shared::Maps::Direction dir) : OverworldWidget(game, map, tileNum, pt, dir), Shared::Maps::Creature(game, map, hitPoints) { _monsterId = (OverworldMonsterId)((tileNum - 19) / 2); - + Ultima1Game *g = static_cast(game); _name = g->_res->OVERWORLD_MONSTER_NAMES[_monsterId]; _attackStrength = g->_res->OVERWORLD_MONSTER_DAMAGE[_monsterId]; @@ -75,7 +75,7 @@ void OverworldMonster::attackParty() { //uint threshold, damage; // Print out the monster attacking - + addInfoMsg(Common::String::format("%s %s %s", _name.c_str(), game->_res->ATTACKS, _name.c_str()), false); /* TODO: Refactor to use attack effects diff --git a/engines/ultima/ultima1/widgets/princess.cpp b/engines/ultima/ultima1/widgets/princess.cpp index f031a1b2c04..6b909ba4599 100644 --- a/engines/ultima/ultima1/widgets/princess.cpp +++ b/engines/ultima/ultima1/widgets/princess.cpp @@ -30,7 +30,7 @@ namespace Widgets { void Princess::movement() { if (!areGuardsHostile()) { - // Until guards turn hostile, the princesses exhibit standard wench behaviour + // Until guards turn hostile, the princesses exhibit standard wench behaviour Wench::movement(); } else { // When the guards are hostile, keep the princess moving towards the player diff --git a/engines/ultima/ultima1/widgets/wench.cpp b/engines/ultima/ultima1/widgets/wench.cpp index 9293d5ee8ba..279694404b0 100644 --- a/engines/ultima/ultima1/widgets/wench.cpp +++ b/engines/ultima/ultima1/widgets/wench.cpp @@ -34,7 +34,7 @@ void Wench::movement() { // Get a random new position Point delta = getRandomMoveDelta(); Point newPos = _position + delta; - + if (canMoveTo(newPos) == YES) { _position = newPos; _game->playFX(4); diff --git a/engines/ultima/ultima4/controllers/combat_controller.cpp b/engines/ultima/ultima4/controllers/combat_controller.cpp index 179b2cd9205..b164232f96d 100644 --- a/engines/ultima/ultima4/controllers/combat_controller.cpp +++ b/engines/ultima/ultima4/controllers/combat_controller.cpp @@ -209,7 +209,7 @@ void CombatController::initDungeonRoom(int room, Direction from) { assertMsg(g_context->_location->_prev->_context & CTX_DUNGEON, "Error: called initDungeonRoom from non-dungeon context"); { Dungeon *dng = dynamic_cast(g_context->_location->_prev->_map); - assert(dng); + assert(dng); DngRoom &dngRoom = dng->_rooms[room]; diff --git a/engines/ultima/ultima4/core/debugger.cpp b/engines/ultima/ultima4/core/debugger.cpp index 5d965002efa..e9481de12e5 100644 --- a/engines/ultima/ultima4/core/debugger.cpp +++ b/engines/ultima/ultima4/core/debugger.cpp @@ -961,7 +961,7 @@ bool Debugger::cmdReadyWeapon(int argc, const char **argv) { PartyMember *p = g_context->_party->member(player); const Weapon *w = g_weapons->get((WeaponType)weapon); - + if (!w) { print(""); return isDebuggerActive(); diff --git a/engines/ultima/ultima4/core/settings.cpp b/engines/ultima/ultima4/core/settings.cpp index 51f489f8f8c..26af7855ffa 100644 --- a/engines/ultima/ultima4/core/settings.cpp +++ b/engines/ultima/ultima4/core/settings.cpp @@ -99,7 +99,7 @@ Settings::Settings() { bool isEnhanced = _videoType != "EGA"; _scale = isEnhanced ? 2 : 1; _filter = isEnhanced ? "Scale2x" : "point"; - + _battleDiffs.push_back("Normal"); _battleDiffs.push_back("Hard"); _battleDiffs.push_back("Expert"); diff --git a/engines/ultima/ultima4/game/codex.cpp b/engines/ultima/ultima4/game/codex.cpp index db024efa14b..70915a5731f 100644 --- a/engines/ultima/ultima4/game/codex.cpp +++ b/engines/ultima/ultima4/game/codex.cpp @@ -64,7 +64,7 @@ void Codex::deinit() { void Codex::start() { init(); - // Disable the whirlpool cursor and black out the screen + // Disable the whirlpool cursor and black out the screen #ifdef IOS_ULTIMA4 U4IOS::IOSHideGameControllerHelper hideControllsHelper; #endif @@ -72,19 +72,19 @@ void Codex::start() { g_screen->screenUpdate(&g_game->_mapArea, false, true); // Make the avatar alone - + g_context->_stats->setView(STATS_PARTY_OVERVIEW); g_context->_stats->update(true); // show just the avatar g_screen->update(); // Change the view mode so the dungeon doesn't get shown - + gameSetViewMode(VIEW_CODEX); g_screen->screenMessage("\n\n\n\nThere is a sudden darkness, and you find yourself alone in an empty chamber.\n"); EventHandler::sleep(4000); - // Check to see if you have the 3-part key + // Check to see if you have the 3-part key if ((g_ultima->_saveGame->_items & (ITEM_KEY_C | ITEM_KEY_L | ITEM_KEY_T)) != (ITEM_KEY_C | ITEM_KEY_L | ITEM_KEY_T)) { eject(CODEX_EJECT_NO_3_PART_KEY); return; @@ -98,7 +98,7 @@ void Codex::start() { g_screen->screenMessage("\nA voice rings out:\n\"What is the Word of Passage?\"\n\n"); - // Get the Word of Passage + // Get the Word of Passage #ifdef IOS_ULTIMA4 U4IOS::IOSConversationHelper::setIntroString("What is the Word of Passage?"); #endif diff --git a/engines/ultima/ultima4/map/maploader.cpp b/engines/ultima/ultima4/map/maploader.cpp index e32305610f4..800b7a5b82a 100644 --- a/engines/ultima/ultima4/map/maploader.cpp +++ b/engines/ultima/ultima4/map/maploader.cpp @@ -422,7 +422,7 @@ bool XMLMapLoader::load(Map *map) { map->_data.resize(map->_width * map->_height); // Split up the text lines - Common::StringArray lines, cols; + Common::StringArray lines, cols; split(text, lines, '\n'); assert(lines.size() == map->_height); diff --git a/engines/ultima/ultima8/audio/audio_mixer.cpp b/engines/ultima/ultima8/audio/audio_mixer.cpp index 5b3658bff45..6c59506d354 100644 --- a/engines/ultima/ultima8/audio/audio_mixer.cpp +++ b/engines/ultima/ultima8/audio/audio_mixer.cpp @@ -41,7 +41,7 @@ static const int TOTAL_CHANNEL_COUNT = BASE_CHANNEL_COUNT + AMBIENT_CHANNEL_COUN AudioMixer::AudioMixer(Audio::Mixer *mixer) : _mixer(mixer), _midiPlayer(nullptr) { _audioMixer = this; - + _channels.resize(TOTAL_CHANNEL_COUNT); for (int idx = 0; idx < TOTAL_CHANNEL_COUNT; ++idx) _channels[idx] = new AudioChannel(_mixer, SAMPLE_RATE, true); diff --git a/engines/ultima/ultima8/audio/midi_player.cpp b/engines/ultima/ultima8/audio/midi_player.cpp index b3176c70ec2..0a05b9460f0 100644 --- a/engines/ultima/ultima8/audio/midi_player.cpp +++ b/engines/ultima/ultima8/audio/midi_player.cpp @@ -93,7 +93,7 @@ void MidiPlayer::play(int trackNo, int branchIndex) { warning("play() invalid track number %i", trackNo); return; } - + if (branchIndex >= 0) { if (!_parser->jumpToIndex(branchIndex, false)) { warning("play() invalid branch index %i", branchIndex); diff --git a/engines/ultima/ultima8/convert/crusader/convert_shape_crusader.cpp b/engines/ultima/ultima8/convert/crusader/convert_shape_crusader.cpp index 9ee4a9f8b8c..2d071dca9fa 100644 --- a/engines/ultima/ultima8/convert/crusader/convert_shape_crusader.cpp +++ b/engines/ultima/ultima8/convert/crusader/convert_shape_crusader.cpp @@ -30,7 +30,7 @@ const ConvertShapeFormat CrusaderShapeFormat = { "Crusader", 6, // header "", // ident - 0, // bytes_ident + 0, // bytes_ident 0, // bytes_special 4, // header_unk 2, // num_frames @@ -58,7 +58,7 @@ const ConvertShapeFormat Crusader2DShapeFormat = { "Crusader 2D", 6, // header "", // ident - 0, // bytes_ident + 0, // bytes_ident 0, // bytes_special 4, // header_unk 2, // num_frames diff --git a/engines/ultima/ultima8/convert/u8/convert_shape_u8.cpp b/engines/ultima/ultima8/convert/u8/convert_shape_u8.cpp index f6f02c640d7..f66aaff5154 100644 --- a/engines/ultima/ultima8/convert/u8/convert_shape_u8.cpp +++ b/engines/ultima/ultima8/convert/u8/convert_shape_u8.cpp @@ -30,7 +30,7 @@ const ConvertShapeFormat U8ShapeFormat = { "Ultima8", 6, // header "", // ident - 0, // bytes_ident + 0, // bytes_ident 0, // bytes_special 4, // header_unk 2, // num_frames @@ -58,7 +58,7 @@ const ConvertShapeFormat U82DShapeFormat = { "Ultima8 2D", 6, // header "", // ident - 0, // bytes_ident + 0, // bytes_ident 0, // bytes_special 4, // header_unk 2, // num_frames @@ -86,7 +86,7 @@ const ConvertShapeFormat U8SKFShapeFormat = { "Ultima8 SKF", 2, // header "\2", // ident - 2, // bytes_ident + 2, // bytes_ident 0, // bytes_special 0, // header_unk 0, // num_frames @@ -114,7 +114,7 @@ const ConvertShapeFormat U8CMPShapeFormat = { "Ultima8 CMP", 11, // header "", // ident - 0, // bytes_ident + 0, // bytes_ident 5, // bytes_special 4, // header_unk 2, // num_frames diff --git a/engines/ultima/ultima8/filesys/savegame.cpp b/engines/ultima/ultima8/filesys/savegame.cpp index 4d2995d6eae..6a8729eb15e 100644 --- a/engines/ultima/ultima8/filesys/savegame.cpp +++ b/engines/ultima/ultima8/filesys/savegame.cpp @@ -110,7 +110,7 @@ bool SavegameWriter::finish() { _file->writeUint32LE(fe.size()); _file->write(&fe[0], fe.size()); } - + return true; } diff --git a/engines/ultima/ultima8/graphics/fonts/font_shape_archive.h b/engines/ultima/ultima8/graphics/fonts/font_shape_archive.h index c4843bed0a5..574bf83f923 100644 --- a/engines/ultima/ultima8/graphics/fonts/font_shape_archive.h +++ b/engines/ultima/ultima8/graphics/fonts/font_shape_archive.h @@ -41,7 +41,7 @@ public: FontShapeArchive(Common::SeekableReadStream *rs, uint16 id, Palette *pal = 0, const ConvertShapeFormat *format = 0) : ShapeArchive(rs, id, pal, format) { } - + ~FontShapeArchive() override { } //! load HVLeads from u8.ini diff --git a/engines/ultima/ultima8/graphics/fonts/tt_font.cpp b/engines/ultima/ultima8/graphics/fonts/tt_font.cpp index 51285e54c85..858451c8df6 100644 --- a/engines/ultima/ultima8/graphics/fonts/tt_font.cpp +++ b/engines/ultima/ultima8/graphics/fonts/tt_font.cpp @@ -261,7 +261,7 @@ RenderedText *TTFont::renderText(const Std::string &text, unsigned int &remainin dG = static_cast((sG * sAlpha + dG * dAlpha) / (sAlpha + dAlpha)); dB = static_cast((sB * sAlpha + dB * dAlpha) / (sAlpha + dAlpha)); dA = static_cast(255. * (sAlpha + dAlpha)); - + texBuf[ty * resultWidth + tx] = PF_RGBA.ARGBToColor(dA, dR, dG, dB); } } diff --git a/engines/ultima/ultima8/graphics/soft_render_surface.cpp b/engines/ultima/ultima8/graphics/soft_render_surface.cpp index 4c078bbff56..77099f88cfc 100644 --- a/engines/ultima/ultima8/graphics/soft_render_surface.cpp +++ b/engines/ultima/ultima8/graphics/soft_render_surface.cpp @@ -240,7 +240,7 @@ template void SoftRenderSurface::Blit(const Graphics::Manage Common::Point dpoint = Common::Point(_ox + dx, _oy + dy); if (alpha_blend) { _surface->transBlitFrom(*tex, srect, dpoint); - } + } else { _surface->blitFrom(*tex, srect, dpoint); } diff --git a/engines/ultima/ultima8/graphics/soft_render_surface.inl b/engines/ultima/ultima8/graphics/soft_render_surface.inl index e9d920a2b91..fee1fd7285e 100644 --- a/engines/ultima/ultima8/graphics/soft_render_surface.inl +++ b/engines/ultima/ultima8/graphics/soft_render_surface.inl @@ -31,12 +31,12 @@ // // #define FLIP_SHAPES to flip rendering // -// #define FLIP_CONDITIONAL to an argument of the function so FLIPPING can be +// #define FLIP_CONDITIONAL to an argument of the function so FLIPPING can be // enabled/disabled with a bool // // #define XFORM_SHAPES to enable XFORMing // -// #define XFORM_CONDITIONAL to an argument of the function so XFORM can be +// #define XFORM_CONDITIONAL to an argument of the function so XFORM can be // enabled/disabled with a bool // // #define BLEND_SHAPES(src,dst) to an a specified blend function. @@ -49,15 +49,15 @@ // Macros defined by this file: // // NOT_CLIPPED_Y - Does Y Clipping check per line -// +// // NOT_CLIPPED_X - Does X Clipping check per Pixel -// +// // LINE_END_ASSIGN - Calcuates the line_end pointer required for X clipping // // XNEG - Negates X values if doing shape flipping -// +// // USE_XFORM_FUNC - Checks to see if we want to use XForm Blending for this pixel -// +// // CUSTOM_BLEND - Final Blend for invisiblity // @@ -100,7 +100,7 @@ const int32 neg = (FLIP_CONDITIONAL)?-1:0; // // No Clipping = TRUE -// +// #ifdef NO_CLIPPING #define LINE_END_ASSIGN // @@ -110,7 +110,7 @@ const int32 neg = (FLIP_CONDITIONAL)?-1:0; // // No Clipping = FALSE -// +// #else const int scrn_width = _clipWindow.width(); diff --git a/engines/ultima/ultima8/gumps/gump.cpp b/engines/ultima/ultima8/gumps/gump.cpp index e0d6a43e725..11d3f6cd1d3 100644 --- a/engines/ultima/ultima8/gumps/gump.cpp +++ b/engines/ultima/ultima8/gumps/gump.cpp @@ -533,7 +533,7 @@ bool Gump::GetLocationOfItem(uint16 itemid, int32 &gx, int32 &gy, return false; } -// Find a child gump that matches the matching function +// Find a child gump that matches the matching function Gump *Gump::FindGump(const FindGumpPredicate predicate, bool recursive) { if (predicate(this)) return this; diff --git a/engines/ultima/ultima8/gumps/message_box_gump.cpp b/engines/ultima/ultima8/gumps/message_box_gump.cpp index 84c2baa376b..086344eef91 100644 --- a/engines/ultima/ultima8/gumps/message_box_gump.cpp +++ b/engines/ultima/ultima8/gumps/message_box_gump.cpp @@ -43,7 +43,7 @@ MessageBoxGump::MessageBoxGump(const Std::string &title, const Std::string &mess ModalGump(0, 0, 100, 100), _title(title), _message(message), _titleColour(titleColour) { if (buttons) buttons->swap(_buttons); - + if (_buttons.empty()) _buttons.push_back(Std::string("Ok")); } diff --git a/engines/ultima/ultima8/gumps/shape_viewer_gump.cpp b/engines/ultima/ultima8/gumps/shape_viewer_gump.cpp index 12126589635..ce5d0ca0fae 100644 --- a/engines/ultima/ultima8/gumps/shape_viewer_gump.cpp +++ b/engines/ultima/ultima8/gumps/shape_viewer_gump.cpp @@ -96,7 +96,7 @@ void ShapeViewerGump::PaintThis(RenderSurface *surf, int32 lerp_factor, bool /*s const Shape *shape = _flex->getShape(_curShape); if (shape && _curFrame < shape->frameCount()) surf->Paint(shape, _curFrame, posx, posy); - + RenderedText *rendtext; Font *font = FontManager::get_instance()->getGameFont(_fontNo, true); if (!font) @@ -119,7 +119,7 @@ void ShapeViewerGump::PaintThis(RenderSurface *surf, int32 lerp_factor, bool /*s rendtext->draw(surf, 20, 10); delete rendtext; } - + { // Dump the pixel val under the mouse cursor: int32 mx = 0; @@ -128,7 +128,7 @@ void ShapeViewerGump::PaintThis(RenderSurface *surf, int32 lerp_factor, bool /*s Mouse::get_instance()->getMouseCoords(mx, my); ScreenSpaceToGump(mx, my); - + int32 relx = mx - (posx - _shapeX); int32 rely = my - (posy - _shapeY); if (shape && relx >= 0 && rely >= 0 && relx < _shapeW && rely < _shapeH) { diff --git a/engines/ultima/ultima8/kernel/mouse.cpp b/engines/ultima/ultima8/kernel/mouse.cpp index 16f6104c134..2877a3054c5 100644 --- a/engines/ultima/ultima8/kernel/mouse.cpp +++ b/engines/ultima/ultima8/kernel/mouse.cpp @@ -517,7 +517,7 @@ void Mouse::handleDelayedEvents() { Gump *parent = gump->GetParent(); if (parent) parent->ScreenSpaceToGump(mx, my); - + gump->onMouseClick(button, mx, my); } diff --git a/engines/ultima/ultima8/kernel/object_manager.cpp b/engines/ultima/ultima8/kernel/object_manager.cpp index 671c547d711..5275fa65c43 100644 --- a/engines/ultima/ultima8/kernel/object_manager.cpp +++ b/engines/ultima/ultima8/kernel/object_manager.cpp @@ -223,7 +223,7 @@ void ObjectManager::save(Common::WriteStream *ws) { saveObject(ws, object); } - + ws->writeUint16LE(0); } diff --git a/engines/ultima/ultima8/misc/debugger.cpp b/engines/ultima/ultima8/misc/debugger.cpp index 1b6b6f93a4f..e3f4c732e6d 100644 --- a/engines/ultima/ultima8/misc/debugger.cpp +++ b/engines/ultima/ultima8/misc/debugger.cpp @@ -1355,7 +1355,7 @@ bool Debugger::cmdStopMoveBack(int argc, const char **argv) { AvatarMoverProcess *proc = engine->getAvatarMoverProcess(); if (proc) { - // Clear both back and forward as avatar turns then moves forward when not in combat + // Clear both back and forward as avatar turns then moves forward when not in combat proc->clearMovementFlag(AvatarMoverProcess::MOVE_BACK | AvatarMoverProcess::MOVE_FORWARD); } return false; diff --git a/engines/ultima/ultima8/world/actors/avatar_mover_process.h b/engines/ultima/ultima8/world/actors/avatar_mover_process.h index 96ee2446848..04558e55ddc 100644 --- a/engines/ultima/ultima8/world/actors/avatar_mover_process.h +++ b/engines/ultima/ultima8/world/actors/avatar_mover_process.h @@ -69,7 +69,7 @@ public: MOVE_STEP = 0x0004, // also side-steps in crusader MOVE_JUMP = 0x0008, // used for roll in crusader (when combined with left/right), and crouch (when combined with back) - // Tank controls + // Tank controls MOVE_TURN_LEFT = 0x0010, MOVE_TURN_RIGHT = 0x0020, MOVE_FORWARD = 0x0040, diff --git a/engines/ultima/ultima8/world/actors/u8_avatar_mover_process.cpp b/engines/ultima/ultima8/world/actors/u8_avatar_mover_process.cpp index b80cb95fa45..7a395c12536 100644 --- a/engines/ultima/ultima8/world/actors/u8_avatar_mover_process.cpp +++ b/engines/ultima/ultima8/world/actors/u8_avatar_mover_process.cpp @@ -199,7 +199,7 @@ void U8AvatarMoverProcess::handleCombatMode() { if (_mouseButton[1].isState(MBS_DOWN) && _mouseButton[1].isState(MBS_HANDLED)) { // Note: Orginal game allowed a move animation on a single right click. - // This implementation needs right mouse to be held. + // This implementation needs right mouse to be held. setMovementFlag(MOVE_MOUSE_DIRECTION); if (checkTurn(mousedir, true)) @@ -251,7 +251,7 @@ void U8AvatarMoverProcess::handleCombatMode() { // want to run while in combat mode? // first sheath weapon nextanim = Animation::readyWeapon; - } + } if (hasMovementFlags(MOVE_RUN)) { // Take a step before running @@ -369,7 +369,7 @@ void U8AvatarMoverProcess::handleNormalMode() { if (_mouseButton[1].isState(MBS_DOWN) && _mouseButton[1].isState(MBS_HANDLED)) { // Note: Orginal game allowed a move animation on a single right click. - // This implementation needs right mouse to be held. + // This implementation needs right mouse to be held. setMovementFlag(MOVE_MOUSE_DIRECTION); } diff --git a/engines/voyeur/files_threads.cpp b/engines/voyeur/files_threads.cpp index 16162821708..53a69b4259c 100644 --- a/engines/voyeur/files_threads.cpp +++ b/engines/voyeur/files_threads.cpp @@ -601,7 +601,7 @@ void ThreadResource::parsePlayCommands() { // Victim selected from command line _vm->_controlPtr->_state->_victimIndex = _vm->_iForceDeath; } - + ConfMan.setInt("lastVictim", _vm->_controlPtr->_state->_victimIndex); ConfMan.flushToDisk(); break; diff --git a/engines/wintermute/achievements_tables.h b/engines/wintermute/achievements_tables.h index 26e9dc5d060..fb4583a8cf6 100644 --- a/engines/wintermute/achievements_tables.h +++ b/engines/wintermute/achievements_tables.h @@ -510,7 +510,7 @@ static const AchievementDescriptionList achievementDescriptionList[] = { ACHIEVEMENTS_LISTEND } }, - + {0, Common::UNK_ACHIEVEMENTS, 0, {ACHIEVEMENTS_LISTEND}} }; diff --git a/engines/wintermute/ad/ad_game.cpp b/engines/wintermute/ad/ad_game.cpp index c6bb4df147d..cdcb234714e 100644 --- a/engines/wintermute/ad/ad_game.cpp +++ b/engines/wintermute/ad/ad_game.cpp @@ -1602,7 +1602,7 @@ bool AdGame::scheduleChangeScene(const char *filename, bool fadeIn) { ////////////////////////////////////////////////////////////////////////// bool AdGame::handleCustomActionStart(BaseGameCustomAction action) { bool isCorrosion = BaseEngine::instance().getGameId() == "corrosion"; - + if (isCorrosion) { // Corrosion Enhanced Edition contain city map screen, which is // mouse controlled and conflicts with those custom actions @@ -1658,7 +1658,7 @@ bool AdGame::handleCustomActionStart(BaseGameCustomAction action) { for (uint32 i = 0; i < objects.size(); i++) { BaseRegion *region; if (objects[i]->getType() != OBJECT_ENTITY || - !objects[i]->_active || + !objects[i]->_active || !objects[i]->_registrable || (!(region = ((AdEntity *)objects[i])->_region)) ) { @@ -1673,7 +1673,7 @@ bool AdGame::handleCustomActionStart(BaseGameCustomAction action) { break; } - // Something at the edge? Available with other actions. + // Something at the edge? Available with other actions. if (region->pointInRegion(xLeft, yCenter) || region->pointInRegion(xRight, yCenter) || region->pointInRegion(xCenter, yBottom) || @@ -1699,7 +1699,7 @@ bool AdGame::handleCustomActionStart(BaseGameCustomAction action) { } BasePlatform::setCursorPos(p.x, p.y); - setActiveObject(_gameRef->_renderer->getObjectAt(p.x, p.y)); + setActiveObject(_gameRef->_renderer->getObjectAt(p.x, p.y)); onMouseLeftDown(); onMouseLeftUp(); return true; @@ -2422,7 +2422,7 @@ bool AdGame::onMouseLeftUp() { } else { handled = DID_SUCCEED(applyEvent("LeftRelease")); } - + if (!handled) { if (_activeObject != nullptr) { _activeObject->applyEvent("LeftRelease"); diff --git a/engines/wintermute/base/base_file_manager.cpp b/engines/wintermute/base/base_file_manager.cpp index 1c12e38eb1a..0f2b410859a 100644 --- a/engines/wintermute/base/base_file_manager.cpp +++ b/engines/wintermute/base/base_file_manager.cpp @@ -408,13 +408,13 @@ int BaseFileManager::listMatchingPackageMembers(Common::ArchiveMemberList &list, ////////////////////////////////////////////////////////////////////////// int BaseFileManager::listMatchingFiles(Common::StringArray &list, const Common::String &pattern) { list = sfmFileList(pattern); - + Common::ArchiveMemberList files; listMatchingDiskFileMembers(files, pattern); for (Common::ArchiveMemberList::const_iterator it = files.begin(); it != files.end(); ++it) { list.push_back((*it)->getName()); } - + return list.size(); } diff --git a/engines/wintermute/base/base_game.cpp b/engines/wintermute/base/base_game.cpp index 950ced64ddf..d7be71e643e 100644 --- a/engines/wintermute/base/base_game.cpp +++ b/engines/wintermute/base/base_game.cpp @@ -2331,7 +2331,7 @@ bool BaseGame::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack // Used at kalimba.script on F9 keypress to reload list of available music // Known params: "*.mb" // Original implementation does not seem to look up at DCP packages - // This implementation looks up at savegame storage and for actual files + // This implementation looks up at savegame storage and for actual files // Return value expected to be an Array of Strings ////////////////////////////////////////////////////////////////////////// else if (strcmp(name, "GetFiles") == 0) { @@ -2340,7 +2340,7 @@ bool BaseGame::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack Common::StringArray fnames; BaseFileManager::getEngineInstance()->listMatchingFiles(fnames, pattern); - + stack->pushInt(0); BaseScriptable *arr = makeSXArray(_gameRef, stack); for (uint32 i = 0; i < fnames.size(); i++) { @@ -3663,7 +3663,7 @@ bool BaseGame::externalCall(ScScript *script, ScStack *stack, ScStack *thisStack else if (strcmp(name, "IsNumber") == 0) { stack->correctParams(1); ScValue *val = stack->pop(); - + bool result = false; if (val->isInt() || val->isFloat()) { result = true; @@ -3725,7 +3725,7 @@ bool BaseGame::externalCall(ScScript *script, ScStack *stack, ScStack *thisStack stack->correctParams(1); const char *str = stack->pop()->getString(); char *copy = new char[strlen(str) + 1]; - strcpy(copy, str); + strcpy(copy, str); char *ptr = copy; if (strcmp(name, "rTrim") != 0) { diff --git a/engines/wintermute/base/base_game.h b/engines/wintermute/base/base_game.h index 7b35f4c089a..3926760eead 100644 --- a/engines/wintermute/base/base_game.h +++ b/engines/wintermute/base/base_game.h @@ -401,7 +401,7 @@ private: Common::RandomSource *_rndHc; // HeroCraft games specific checksum function, used in Papa's Daughters 2 selfcheck - uint8 getFilePartChecksumHc(const char *filename, uint32 begin, uint32 end); + uint8 getFilePartChecksumHc(const char *filename, uint32 begin, uint32 end); #endif }; diff --git a/engines/wintermute/base/base_keyboard_state.cpp b/engines/wintermute/base/base_keyboard_state.cpp index 698ea255a24..3e3f78d2b18 100644 --- a/engines/wintermute/base/base_keyboard_state.cpp +++ b/engines/wintermute/base/base_keyboard_state.cpp @@ -208,7 +208,7 @@ const keyCodeMapping wmeSdlMapping[] = { { Common::KEYCODE_x, 120 }, { Common::KEYCODE_y, 121 }, { Common::KEYCODE_z, 122 }, - + { Common::KEYCODE_KP_ENTER, 13 }, { Common::KEYCODE_NUMLOCK, 1073741907 }, { Common::KEYCODE_KP_DIVIDE, 1073741908 }, @@ -306,8 +306,8 @@ bool BaseKeyboardState::scCallMethod(ScScript *script, ScStack *stack, ScStack * // IsKeyDown(strings) checks if a key with given ASCII code is pressed // Only 1st character of given string is used for the check - // This check must be case insensitive, which means that - // IsKeyDown("a") & IsKeyDown("A") are either both true or both false + // This check must be case insensitive, which means that + // IsKeyDown("a") & IsKeyDown("A") are either both true or both false const char *str = val->getString(); char temp = str[0]; if (temp >= 'A' && temp <= 'Z') { @@ -328,7 +328,7 @@ bool BaseKeyboardState::scCallMethod(ScScript *script, ScStack *stack, ScStack * vKeyCode = Common::KEYCODE_INVALID; uint32 temp = (uint32)val->getInt(); - + for (uint32 i = 0; i < _mappingSize; i++) { if (_mapping[i].engineKeycode == temp) { vKeyCode = _mapping[i].commonKeycode; @@ -503,10 +503,10 @@ bool BaseKeyboardState::readKey(Common::Event *event) { } if (BaseEngine::instance().getTargetExecutable() < WME_LITE) { - _currentPrintable = code == Common::KEYCODE_BACKSPACE || - code == Common::KEYCODE_TAB || - code == Common::KEYCODE_RETURN || - code == Common::KEYCODE_KP_ENTER || + _currentPrintable = code == Common::KEYCODE_BACKSPACE || + code == Common::KEYCODE_TAB || + code == Common::KEYCODE_RETURN || + code == Common::KEYCODE_KP_ENTER || code == Common::KEYCODE_ESCAPE; } else { _currentPrintable = false; diff --git a/engines/wintermute/base/base_object.cpp b/engines/wintermute/base/base_object.cpp index 8cbb6d20d75..77ebd5e071f 100644 --- a/engines/wintermute/base/base_object.cpp +++ b/engines/wintermute/base/base_object.cpp @@ -562,7 +562,7 @@ bool BaseObject::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisSta ////////////////////////////////////////////////////////////////////////// // [FoxTail] GetSoundFilename // Used to save/restore ambient sounds - // Should contain '\\' character, because Split("\\") is called on result + // Should contain '\\' character, because Split("\\") is called on result ////////////////////////////////////////////////////////////////////////// else if (strcmp(name, "GetSoundFilename") == 0) { stack->correctParams(0); diff --git a/engines/wintermute/base/file/base_disk_file.cpp b/engines/wintermute/base/file/base_disk_file.cpp index 6b77d798014..7735672955d 100644 --- a/engines/wintermute/base/file/base_disk_file.cpp +++ b/engines/wintermute/base/file/base_disk_file.cpp @@ -113,7 +113,7 @@ bool diskFileExists(const Common::String &filename) { int listMatchingDiskFileMembers(Common::ArchiveMemberList &list, const Common::String &pattern) { return Common::FSDirectory(ConfMan.get("path")).listMatchingMembers(list, pattern); } - + Common::SeekableReadStream *openDiskFile(const Common::String &filename) { uint32 prefixSize = 0; Common::SeekableReadStream *file = nullptr; diff --git a/engines/wintermute/base/file/base_package.cpp b/engines/wintermute/base/file/base_package.cpp index 3d67d02774f..604d1e95c3f 100644 --- a/engines/wintermute/base/file/base_package.cpp +++ b/engines/wintermute/base/file/base_package.cpp @@ -91,7 +91,7 @@ void TPackageHeader::readFromStream(Common::ReadStream *stream) { _gameVersion = stream->readUint32LE(); _priority = stream->readByte(); - + // HACK: reversion1 and reversion2 for Linux & Mac use some hacked Wintermute // They provide "xlanguage_*.dcp" packages with 0x00 priority and change priority for a single package in runtime // We already filter unwanted "xlanguage_*.dcp" packages at BaseFileManager::registerPackages() @@ -99,7 +99,7 @@ void TPackageHeader::readFromStream(Common::ReadStream *stream) { if (_priority == 0 && BaseEngine::instance().getGameId().hasPrefix("reversion")) { _priority = 0x02; } - + _cd = stream->readByte(); _masterIndex = stream->readByte(); stream->readByte(); // To align the next byte... diff --git a/engines/wintermute/base/gfx/base_renderer.cpp b/engines/wintermute/base/gfx/base_renderer.cpp index f8c02a82f78..2431af2b339 100644 --- a/engines/wintermute/base/gfx/base_renderer.cpp +++ b/engines/wintermute/base/gfx/base_renderer.cpp @@ -403,7 +403,7 @@ bool BaseRenderer::displayIndicator() { return STATUS_OK; } #endif - + displaySaveloadImage(); displaySaveloadLines(); indicatorFlip(); diff --git a/engines/wintermute/base/gfx/opengl/base_render_opengl3d.cpp b/engines/wintermute/base/gfx/opengl/base_render_opengl3d.cpp index d911a4214c2..89639d97238 100644 --- a/engines/wintermute/base/gfx/opengl/base_render_opengl3d.cpp +++ b/engines/wintermute/base/gfx/opengl/base_render_opengl3d.cpp @@ -507,7 +507,7 @@ bool BaseRenderOpenGL3D::setup2D(bool force) { #else glActiveTexture(GL_TEXTURE0); #endif - + glViewport(0, 0, _width, _height); setProjection2D(); } diff --git a/engines/wintermute/base/scriptables/script.cpp b/engines/wintermute/base/scriptables/script.cpp index 09ff121d0ee..3ccb916bfef 100644 --- a/engines/wintermute/base/scriptables/script.cpp +++ b/engines/wintermute/base/scriptables/script.cpp @@ -106,7 +106,7 @@ ScScript::ScScript(BaseGame *inGame, ScEngine *engine) : BaseClass(inGame) { _tracingMode = false; #ifdef ENABLE_FOXTAIL - initOpcodesType(); + initOpcodesType(); #endif } @@ -1365,7 +1365,7 @@ bool ScScript::persist(BasePersistenceManager *persistMgr) { if (!persistMgr->getIsSaving()) { _tracingMode = false; #ifdef ENABLE_FOXTAIL - initOpcodesType(); + initOpcodesType(); #endif } @@ -1473,7 +1473,7 @@ ScScript::TExternalFunction *ScScript::getExternal(char *name) { ////////////////////////////////////////////////////////////////////////// bool ScScript::externalCall(ScStack *stack, ScStack *thisStack, ScScript::TExternalFunction *function) { ////////////////////////////////////////////////////////////////////////// - // Externals: emulate external functions used in known games + // Externals: emulate external functions used in known games ////////////////////////////////////////////////////////////////////////// if (!DID_FAIL(EmulateExternalCall(_gameRef, stack, thisStack, function))) { return STATUS_OK; diff --git a/engines/wintermute/base/scriptables/script_engine.cpp b/engines/wintermute/base/scriptables/script_engine.cpp index e420c17d45e..dff282e62d4 100644 --- a/engines/wintermute/base/scriptables/script_engine.cpp +++ b/engines/wintermute/base/scriptables/script_engine.cpp @@ -455,7 +455,7 @@ int ScEngine::getNumScripts(int *running, int *waiting, int *persistent) { // * SCRIPT_FINISHED, // * SCRIPT_ERROR, // * SCRIPT_WAITING_SCRIPT, - // * SCRIPT_THREAD_FINISHED + // * SCRIPT_THREAD_FINISHED debugN("ScEngine::GetNumScripts - unhandled enum: %d\n", _scripts[i]->_state); // This method calculates thread counts to be shown at debug screen only diff --git a/engines/wintermute/base/scriptables/script_ext_array.cpp b/engines/wintermute/base/scriptables/script_ext_array.cpp index 05effd991ee..f0ac6268021 100644 --- a/engines/wintermute/base/scriptables/script_ext_array.cpp +++ b/engines/wintermute/base/scriptables/script_ext_array.cpp @@ -132,8 +132,8 @@ bool SXArray::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, } return STATUS_OK; - } - + } + #ifdef ENABLE_FOXTAIL ////////////////////////////////////////////////////////////////////////// // [FoxTail] Delete diff --git a/engines/wintermute/base/scriptables/script_ext_file.cpp b/engines/wintermute/base/scriptables/script_ext_file.cpp index 25919aad09b..31a3cf7f4c3 100644 --- a/engines/wintermute/base/scriptables/script_ext_file.cpp +++ b/engines/wintermute/base/scriptables/script_ext_file.cpp @@ -213,7 +213,7 @@ bool SXFile::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, /* const char *dest = */ stack->pop()->getString(); /* bool overwrite = */ stack->pop()->getBool(true); - // Known game that need this: + // Known game that need this: // * Space Madness (to copy bonus wallpapers from data.dcp to /saves/ folder) // * games by Rootfix intertainment (to save temporary screenshot as savegame screenshot) warning("SXFile-Method: Copy not supported"); diff --git a/engines/wintermute/base/scriptables/script_ext_string.cpp b/engines/wintermute/base/scriptables/script_ext_string.cpp index ef842a0a6f2..039ec079a19 100644 --- a/engines/wintermute/base/scriptables/script_ext_string.cpp +++ b/engines/wintermute/base/scriptables/script_ext_string.cpp @@ -275,7 +275,7 @@ bool SXString::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack result = _string[index]; } stack->pushInt(result); - + return STATUS_OK; } #endif diff --git a/engines/wintermute/dctypes.h b/engines/wintermute/dctypes.h index ef26e95d768..aa350677aee 100644 --- a/engines/wintermute/dctypes.h +++ b/engines/wintermute/dctypes.h @@ -198,9 +198,9 @@ enum TTextCharset { CHARSET_BALTIC = 3, CHARSET_CHINESEBIG5 = 4, CHARSET_EASTEUROPE = 5, - CHARSET_GB2312 = 6, + CHARSET_GB2312 = 6, CHARSET_GREEK = 7, - CHARSET_HANGUL = 8, + CHARSET_HANGUL = 8, CHARSET_MAC = 9, CHARSET_RUSSIAN = 10, CHARSET_SHIFTJIS = 11, diff --git a/engines/wintermute/detection_tables.h b/engines/wintermute/detection_tables.h index 6a8b0db8960..db9329a72fe 100644 --- a/engines/wintermute/detection_tables.h +++ b/engines/wintermute/detection_tables.h @@ -1896,7 +1896,7 @@ static const WMEGameDescription gameDescriptions[] = { WME_WINENTRY("reversion1", "", WME_ENTRY2s("data.dcp", "438e04e70a107539a56fcd332d31f04d", 254298579, "data.dcp", "438e04e70a107539a56fcd332d31f04d", 254298579), Common::ES_ESP, ADGF_UNSTABLE, WME_1_9_3), - + // Reversion: The Escape (Steam, July 2014) (German) WME_WINENTRY("reversion1", "", WME_ENTRY2s("data.dcp", "438e04e70a107539a56fcd332d31f04d", 254298579, @@ -2061,7 +2061,7 @@ static const WMEGameDescription gameDescriptions[] = { WME_WINENTRY("reversion1", "", WME_ENTRY2s("data.dcp", "2ab1e724ea83e61049cc46a3604a9a53", 254281202, "data.dcp", "2ab1e724ea83e61049cc46a3604a9a53", 254281202), Common::ES_ESP, ADGF_UNSTABLE, WME_1_9_3), - + // Reversion: The Escape (Steam, January 2016) (German) WME_WINENTRY("reversion1", "", WME_ENTRY2s("data.dcp", "2ab1e724ea83e61049cc46a3604a9a53", 254281202, @@ -3046,12 +3046,12 @@ static const WMEGameDescription gameDescriptions[] = { WME_WINENTRY("reversion2", "", WME_ENTRY2s("data.dcp", "c4aa6295bc6cef6995430232298fdd5f", 255654527, "data.dcp", "c4aa6295bc6cef6995430232298fdd5f", 255654527), Common::ES_ESP, ADGF_UNSTABLE, WME_1_9_3), - + // Reversion: The Meeting (Desura, before April 2014) (English) WME_WINENTRY("reversion2", "", WME_ENTRY2s("data.dcp", "c4aa6295bc6cef6995430232298fdd5f", 255654527, "xlanguage_en.dcp", "74f3c75dc4f62e784682016b37990122", 8440487), Common::EN_ANY, ADGF_UNSTABLE, WME_1_9_3), - + // Reversion: The Meeting (Desura, before April 2014) (Chinese) WME_WINENTRY("reversion2", "", WME_ENTRY2s("data.dcp", "c4aa6295bc6cef6995430232298fdd5f", 255654527, @@ -3357,17 +3357,17 @@ static const WMEGameDescription gameDescriptions[] = { WME_WINENTRY("reversion2", "", WME_ENTRY2s("data.dcp", "28256eacb651a82cb07ffd99d0102988", 272211168, "xlanguage_nz.dcp", "45f52816d5ec5f8e0c1bd70a7aa17f7c", 8847936), Common::ZH_ANY, ADGF_UNSTABLE, WME_1_9_3), - + // Reversion: The Meeting (Steam, August 2019) (Russian) WME_WINENTRY("reversion2", "", WME_ENTRY2s("data.dcp", "28256eacb651a82cb07ffd99d0102988", 272211168, "xlanguage_ru.dcp", "a221b4a924d88c75606963fb66bf043a", 10430422), Common::RU_RUS, ADGF_UNSTABLE, WME_1_9_3), - + // Reversion: The Meeting (Steam, August 2019) (Simplified Chinese) WME_WINENTRY("reversion2", "", WME_ENTRY2s("data.dcp", "28256eacb651a82cb07ffd99d0102988", 272211168, "xlanguage_zh_s.dcp", "f668735372b0dde4b619c4d9d4678e3c", 8498109), Common::ZH_CNA, ADGF_UNSTABLE, WME_1_9_3), - + // Reversion: The Meeting (Steam, August 2019) (Traditional Chinese) WME_WINENTRY("reversion2", "", WME_ENTRY2s("data.dcp", "28256eacb651a82cb07ffd99d0102988", 272211168, @@ -3378,13 +3378,13 @@ static const WMEGameDescription gameDescriptions[] = { WME_ENTRY3s("data.dcp", "3c34d583c658b75650f0c978d47fd59d", 272228767, "data.dcp", "3c34d583c658b75650f0c978d47fd59d", 272228767, "Linux.dcp", "16c3a8627216aab5b31c43186e0dfa70", 984535), Common::ES_ESP, Common::kPlatformLinux, ADGF_UNSTABLE, WME_LITE), - + // Reversion: The Meeting (Steam, August 2019) (English) WME_PLATENTRY("reversion2", "", WME_ENTRY3s("data.dcp", "3c34d583c658b75650f0c978d47fd59d", 272228767, "xlanguage_en.dcp", "fa871d22a10f62b06fc22fc1469baf4e", 8534328, "Linux.dcp", "16c3a8627216aab5b31c43186e0dfa70", 984535), Common::EN_ANY, Common::kPlatformLinux, ADGF_UNSTABLE, WME_LITE), - + // Reversion: The Meeting (Steam, August 2019) (French) WME_PLATENTRY("reversion2", "", WME_ENTRY3s("data.dcp", "3c34d583c658b75650f0c978d47fd59d", 272228767, @@ -3454,17 +3454,17 @@ static const WMEGameDescription gameDescriptions[] = { WME_WINENTRY("reversion2", "", WME_ENTRY2s("data.dcp", "5b1f360d29a650ea202a89903412e539", 272211168, "xlanguage_de.dcp", "38281c6be6b0114aff9251fddcf35c39", 8716897), Common::DE_DEU, ADGF_UNSTABLE, WME_1_9_3), - + // Reversion: The Meeting (Steam, November 2019) (English) WME_WINENTRY("reversion2", "", WME_ENTRY2s("data.dcp", "5b1f360d29a650ea202a89903412e539", 272211168, "xlanguage_en.dcp", "dc35e8240090c5909fb77ea5369294ab", 8534328), Common::EN_ANY, ADGF_UNSTABLE, WME_1_9_3), - + // Reversion: The Meeting (Steam, November 2019) (French) WME_WINENTRY("reversion2", "", WME_ENTRY2s("data.dcp", "5b1f360d29a650ea202a89903412e539", 272211168, "xlanguage_fr.dcp", "51b3579dad9ec26529aa977a6d92a65a", 8844755), Common::FR_FRA, ADGF_UNSTABLE, WME_1_9_3), - + // Reversion: The Meeting (Steam, November 2019) (Italian) WME_WINENTRY("reversion2", "", WME_ENTRY2s("data.dcp", "5b1f360d29a650ea202a89903412e539", 272211168, @@ -3474,27 +3474,27 @@ static const WMEGameDescription gameDescriptions[] = { WME_WINENTRY("reversion2", "", WME_ENTRY2s("data.dcp", "5b1f360d29a650ea202a89903412e539", 272211168, "xlanguage_nz.dcp", "45f52816d5ec5f8e0c1bd70a7aa17f7c", 8847936), Common::ZH_ANY, ADGF_UNSTABLE, WME_1_9_3), - + // Reversion: The Meeting (Steam, November 2019) (Portuguese) WME_WINENTRY("reversion2", "", WME_ENTRY2s("data.dcp", "5b1f360d29a650ea202a89903412e539", 272211168, "xlanguage_pt.dcp", "ee19b2ec802e2028a08b7b2c21a85f09", 8449509), Common::PT_BRA, ADGF_UNSTABLE, WME_1_9_3), - + // Reversion: The Meeting (Steam, November 2019) (Russian) WME_WINENTRY("reversion2", "", WME_ENTRY2s("data.dcp", "5b1f360d29a650ea202a89903412e539", 272211168, "xlanguage_ru.dcp", "bbff71b306ae5081ed556a44b3f18a2f", 10430422), Common::RU_RUS, ADGF_UNSTABLE, WME_1_9_3), - + // Reversion: The Meeting (Steam, November 2019) (Simplified Chinese) WME_WINENTRY("reversion2", "", WME_ENTRY2s("data.dcp", "5b1f360d29a650ea202a89903412e539", 272211168, "xlanguage_zh_s.dcp", "fa6a6f5742184676cd7d967b518db52c", 8498109), Common::ZH_CNA, ADGF_UNSTABLE, WME_1_9_3), - + // Reversion: The Meeting (Steam, November 2019) (Traditional Chinese) WME_WINENTRY("reversion2", "", WME_ENTRY2s("data.dcp", "5b1f360d29a650ea202a89903412e539", 272211168, "xlanguage_zh_t.dcp", "32103394d993d9c6121655ee24a743b9", 8464532), Common::ZH_TWN, ADGF_UNSTABLE, WME_1_9_3), - + // Reversion: The Meeting (Steam, November 2019) (German) WME_PLATENTRY("reversion2", "", WME_ENTRY3s("data.dcp", "3c34d583c658b75650f0c978d47fd59d", 272228767, @@ -3730,17 +3730,17 @@ static const WMEGameDescription gameDescriptions[] = { WME_WINENTRY("reversion2", "", WME_ENTRY2s("data.dcp", "a59f2f4fe04478a3a078f8b84651ab27", 272211206, "xlanguage_de.dcp", "7a5628acf0fc95596b93120d0adb16d2", 8716897), Common::DE_DEU, ADGF_UNSTABLE, WME_1_9_3), - + // Reversion: The Meeting (Steam, May 2020) (English) WME_WINENTRY("reversion2", "", WME_ENTRY2s("data.dcp", "a59f2f4fe04478a3a078f8b84651ab27", 272211206, "xlanguage_en.dcp", "a9a84556bd629fe28244b8dd3dc79d84", 8534328), Common::EN_ANY, ADGF_UNSTABLE, WME_1_9_3), - + // Reversion: The Meeting (Steam, May 2020) (French) WME_WINENTRY("reversion2", "", WME_ENTRY2s("data.dcp", "a59f2f4fe04478a3a078f8b84651ab27", 272211206, "xlanguage_fr.dcp", "05ff17668f416fa4b27caf5157cd0ffe", 8844755), Common::FR_FRA, ADGF_UNSTABLE, WME_1_9_3), - + // Reversion: The Meeting (Steam, May 2020) (Italian) WME_WINENTRY("reversion2", "", WME_ENTRY2s("data.dcp", "a59f2f4fe04478a3a078f8b84651ab27", 272211206, @@ -3750,27 +3750,27 @@ static const WMEGameDescription gameDescriptions[] = { WME_WINENTRY("reversion2", "", WME_ENTRY2s("data.dcp", "a59f2f4fe04478a3a078f8b84651ab27", 272211206, "xlanguage_nz.dcp", "45f52816d5ec5f8e0c1bd70a7aa17f7c", 8847936), Common::ZH_ANY, ADGF_UNSTABLE, WME_1_9_3), - + // Reversion: The Meeting (Steam, May 2020) (Portuguese) WME_WINENTRY("reversion2", "", WME_ENTRY2s("data.dcp", "a59f2f4fe04478a3a078f8b84651ab27", 272211206, "xlanguage_pt.dcp", "7718ef7709044bf85941eec4f2703664", 8449389), Common::PT_BRA, ADGF_UNSTABLE, WME_1_9_3), - + // Reversion: The Meeting (Steam, May 2020) (Russian) WME_WINENTRY("reversion2", "", WME_ENTRY2s("data.dcp", "a59f2f4fe04478a3a078f8b84651ab27", 272211206, "xlanguage_ru.dcp", "212e5c6d93e4ecc57694a25e0c5c10bc", 17512467), Common::RU_RUS, ADGF_UNSTABLE, WME_1_9_3), - + // Reversion: The Meeting (Steam, May 2020) (Serbian) WME_WINENTRY("reversion2", "", WME_ENTRY2s("data.dcp", "a59f2f4fe04478a3a078f8b84651ab27", 272211206, "xlanguage_sr.dcp", "71f1fc086026bb76137cc9b91c642eff", 8541059), Common::SR_SER, ADGF_UNSTABLE, WME_1_9_3), - + // Reversion: The Meeting (Steam, May 2020) (Simplified Chinese) WME_WINENTRY("reversion2", "", WME_ENTRY2s("data.dcp", "a59f2f4fe04478a3a078f8b84651ab27", 272211206, "xlanguage_zh_s.dcp", "7a46d2c1bb6a6ed07583e347d4e13d9c", 8498688), Common::ZH_CNA, ADGF_UNSTABLE, WME_1_9_3), - + // Reversion: The Meeting (Steam, May 2020) (Traditional Chinese) WME_WINENTRY("reversion2", "", WME_ENTRY2s("data.dcp", "a59f2f4fe04478a3a078f8b84651ab27", 272211206, @@ -3785,22 +3785,22 @@ static const WMEGameDescription gameDescriptions[] = { WME_WINENTRY("reversion3", "", WME_ENTRY2s("data.dcp", "326b44d1edfe2cba6e4135bb2dec801f", 1806938525, "xlanguage_de.dcp", "c5d72f4b8ee111fddfe1caee8d97dcea", 10235058), Common::DE_DEU, ADGF_UNSTABLE, WME_1_9_2), - + // Reversion: The Return (Steam, February 2020) (English) WME_WINENTRY("reversion3", "", WME_ENTRY2s("data.dcp", "326b44d1edfe2cba6e4135bb2dec801f", 1806938525, "xlanguage_en.dcp", "f1af088d8eda8ea96e09eb2a3183a782", 10021001), Common::EN_ANY, ADGF_UNSTABLE, WME_1_9_2), - + // Reversion: The Return (Steam, February 2020) (Portuguese) WME_WINENTRY("reversion3", "", WME_ENTRY2s("data.dcp", "326b44d1edfe2cba6e4135bb2dec801f", 1806938525, "xlanguage_pt.dcp", "2b55f9688039912fae450e3f6872c8ce", 10204094), Common::PT_BRA, ADGF_UNSTABLE, WME_1_9_2), - + // Reversion: The Return (Steam, February 2020) (Russian) WME_WINENTRY("reversion3", "", WME_ENTRY2s("data.dcp", "326b44d1edfe2cba6e4135bb2dec801f", 1806938525, "xlanguage_ru.dcp", "660627fa165d1d60135b3fc2e09e333b", 19607612), Common::RU_RUS, ADGF_UNSTABLE, WME_1_9_2), - + // Reversion: The Return (Steam, February 2020) (Simplified Chinese) WME_WINENTRY("reversion3", "", WME_ENTRY2s("data.dcp", "326b44d1edfe2cba6e4135bb2dec801f", 1806938525, @@ -3815,27 +3815,27 @@ static const WMEGameDescription gameDescriptions[] = { WME_WINENTRY("reversion3", "", WME_ENTRY2s("data.dcp", "b8c6bb6a0bc56bc814f336468bf4f660", 1806937965, "xlanguage_de.dcp", "fd1465e8b305fd49854eb15d0caaa3bb", 10318916), Common::DE_DEU, ADGF_UNSTABLE, WME_1_9_2), - + // Reversion: The Return (Steam, April 16th 2020) (English) WME_WINENTRY("reversion3", "", WME_ENTRY2s("data.dcp", "b8c6bb6a0bc56bc814f336468bf4f660", 1806937965, "xlanguage_en.dcp", "690dbc088ccb0e198df17b9b9def3f67", 10104038), Common::EN_ANY, ADGF_UNSTABLE, WME_1_9_2), - + // Reversion: The Return (Steam, April 16th 2020) (Italian) WME_WINENTRY("reversion3", "", WME_ENTRY2s("data.dcp", "b8c6bb6a0bc56bc814f336468bf4f660", 1806937965, "xlanguage_it.dcp", "8b48db31e4a5d5ef54d17c4d672d5ad7", 10309029), Common::IT_ITA, ADGF_UNSTABLE, WME_1_9_2), - + // Reversion: The Return (Steam, April 16th 2020) (Portuguese) WME_WINENTRY("reversion3", "", WME_ENTRY2s("data.dcp", "b8c6bb6a0bc56bc814f336468bf4f660", 1806937965, "xlanguage_pt.dcp", "566e29be1c74e34263562f609f34e49b", 10204094), Common::PT_BRA, ADGF_UNSTABLE, WME_1_9_2), - + // Reversion: The Return (Steam, April 16th 2020) (Russian) WME_WINENTRY("reversion3", "", WME_ENTRY2s("data.dcp", "b8c6bb6a0bc56bc814f336468bf4f660", 1806937965, "xlanguage_ru.dcp", "921555991ce2feee9e83f1d483a001c1", 19607612), Common::RU_RUS, ADGF_UNSTABLE, WME_1_9_2), - + // Reversion: The Return (Steam, April 16th 2020) (Simplified Chinese) WME_WINENTRY("reversion3", "", WME_ENTRY2s("data.dcp", "b8c6bb6a0bc56bc814f336468bf4f660", 1806937965, @@ -5305,7 +5305,7 @@ static const WMEGameDescription gameDescriptions[] = { // Wilma Tetris WME_WINENTRY("wtetris", "", WME_ENTRY1s("data.dcp", "0898412c1d7c5b759089b2408a9591fe", 2779976), Common::EN_ANY, ADGF_UNSTABLE, WME_1_1_39), - + // Wilma Tetris WME_WINENTRY("wtetris", "", WME_ENTRY1s("data.dcp", "946e3a0496e6c12fb344c9ed861ff015", 2780093), Common::EN_ANY, ADGF_UNSTABLE, WME_1_1_39), diff --git a/engines/wintermute/ext/scene_hooks.h b/engines/wintermute/ext/scene_hooks.h index 0a61545ec05..c697d4899e4 100644 --- a/engines/wintermute/ext/scene_hooks.h +++ b/engines/wintermute/ext/scene_hooks.h @@ -40,4 +40,4 @@ void EmulateSceneHook(const char *sceneFilename) { } // End of namespace Wintermute -#endif \ No newline at end of file +#endif \ No newline at end of file diff --git a/engines/wintermute/ext/wme_3fstatistics.cpp b/engines/wintermute/ext/wme_3fstatistics.cpp index bb5d8e29a8c..2c03acdca01 100644 --- a/engines/wintermute/ext/wme_3fstatistics.cpp +++ b/engines/wintermute/ext/wme_3fstatistics.cpp @@ -166,7 +166,7 @@ bool SX3fStatistics::persist(BasePersistenceManager *persistMgr) { persistMgr->transferString(TMEMBER(_language)); persistMgr->transferString(TMEMBER(_buildNum)); persistMgr->transferSint32(TMEMBER(_repeat)); - + return STATUS_OK; } diff --git a/engines/wintermute/keymapper_tables.h b/engines/wintermute/keymapper_tables.h index 8ebcc443dc8..7a87dd154b4 100644 --- a/engines/wintermute/keymapper_tables.h +++ b/engines/wintermute/keymapper_tables.h @@ -1774,14 +1774,14 @@ inline Common::KeymapArray getWintermuteKeymaps(const char *target, const Common act->addDefaultInputMapping("KP5"); // extra keyboard act->addDefaultInputMapping("JOY_UP"); // extra joy extraKeyMap->addAction(act); - + act = new Action(kStandardActionMoveDown, _("Walk backward")); act->setCustomEngineActionEvent(kClickAtBottom); act->addDefaultInputMapping("DOWN"); // extra keyboard act->addDefaultInputMapping("KP2"); // extra keyboard act->addDefaultInputMapping("JOY_DOWN"); // extra joy extraKeyMap->addAction(act); - + act = new Action(kStandardActionMoveLeft, _("Turn left")); act->setCustomEngineActionEvent(kClickAtLeft); act->addDefaultInputMapping("LEFT"); // extra keyboard @@ -1797,7 +1797,7 @@ inline Common::KeymapArray getWintermuteKeymaps(const char *target, const Common extraKeyMap->addAction(act); } result.push_back(extraKeyMap); - + return result; } diff --git a/engines/wintermute/ui/ui_edit.cpp b/engines/wintermute/ui/ui_edit.cpp index d78981a2dbe..a8e712dadc1 100644 --- a/engines/wintermute/ui/ui_edit.cpp +++ b/engines/wintermute/ui/ui_edit.cpp @@ -770,7 +770,7 @@ bool UIEdit::handleKeypress(Common::Event *event, bool printable) { } else { _selEnd++; } - + if (!BaseKeyboardState::isShiftDown()) { _selStart = _selEnd; } diff --git a/engines/wintermute/utils/path_util.h b/engines/wintermute/utils/path_util.h index 8050cdfae2d..d3babdb829e 100644 --- a/engines/wintermute/utils/path_util.h +++ b/engines/wintermute/utils/path_util.h @@ -42,7 +42,7 @@ public: static Common::String getFileName(const Common::String &path); static Common::String getFileNameWithoutExtension(const Common::String &path); static Common::String getExtension(const Common::String &path); - static bool hasTrailingSlash(const Common::String &path); + static bool hasTrailingSlash(const Common::String &path); }; } // End of namespace Wintermute diff --git a/engines/wintermute/utils/utils.cpp b/engines/wintermute/utils/utils.cpp index 4fad599a2e7..7f976a24c33 100644 --- a/engines/wintermute/utils/utils.cpp +++ b/engines/wintermute/utils/utils.cpp @@ -50,7 +50,7 @@ float BaseUtils::normalizeAngle(float angle) { // error, as when normalizing an angle, we expect the number to be between 0 // and 359 (since 360 is 0). This check has been fixed in ScummVM to 359. If // the resulting angle is negative, it will be corrected in the while loop - // below. + // below. while (angle > 359) { angle -= 360; } diff --git a/engines/xeen/combat.cpp b/engines/xeen/combat.cpp index e29a78e0c32..4d655e0234b 100644 --- a/engines/xeen/combat.cpp +++ b/engines/xeen/combat.cpp @@ -69,7 +69,7 @@ static const int ATTACK_TYPE_FX[23] = { 4, 5, 4, 9, 27, 29, 44, 51, 53, 61, 71 }; -static const PowType MONSTER_SHOOT_POW[7] = { +static const PowType MONSTER_SHOOT_POW[7] = { POW_MAGIC_ARROW, POW_SPARKLES, POW_FIREBALL, POW_MEGAVOLTS, POW_COLD_RAY, POW_SPRAY, POW_ENERGY_BLAST }; diff --git a/engines/xeen/locations.h b/engines/xeen/locations.h index d5d593cb729..eb8c8933957 100644 --- a/engines/xeen/locations.h +++ b/engines/xeen/locations.h @@ -288,7 +288,7 @@ private: /** * Get the new location */ - void getNewLocation(); + void getNewLocation(); public: GolemCutscene(); ~GolemCutscene() override {} diff --git a/engines/xeen/party.cpp b/engines/xeen/party.cpp index 73642ad6ddc..69b0ed77453 100644 --- a/engines/xeen/party.cpp +++ b/engines/xeen/party.cpp @@ -1238,7 +1238,7 @@ bool Party::giveTake(int takeMode, uint takeVal, int giveMode, uint giveVal, int } } return true; - } + } case 25: subPartyTime(giveVal); intf.spellFX(&ps); diff --git a/engines/xeen/resources.h b/engines/xeen/resources.h index e0f280aa85b..8a450ad062b 100644 --- a/engines/xeen/resources.h +++ b/engines/xeen/resources.h @@ -42,7 +42,7 @@ class Resources { * Derived file class with sync method aliases so that the same * code from create_xeen can be re-used for both reading and * writing the resource data - */ + */ class ResFile : public File { private: char *_buffer; diff --git a/engines/xeen/swordsofxeen/swordsofxeen.h b/engines/xeen/swordsofxeen/swordsofxeen.h index 3ced3dad3ac..be50ed87b27 100644 --- a/engines/xeen/swordsofxeen/swordsofxeen.h +++ b/engines/xeen/swordsofxeen/swordsofxeen.h @@ -43,7 +43,7 @@ protected: /** * Show the starting sequence/intro */ - void showStartup() override { + void showStartup() override { // Swords of Xeen doesn't have a starting title or intro _gameMode = GMODE_MENU; } diff --git a/graphics/font.h b/graphics/font.h index e8008cac423..4fa231aa588 100644 --- a/graphics/font.h +++ b/graphics/font.h @@ -160,7 +160,7 @@ public: * @param useEllipsis Try to fit the string in the area by inserting an * ellipsis. Note that the default value is false for this * argument, unlike for drawString. - * + * * @return The actual area where the string is drawn. */ Common::Rect getBoundingBox(const Common::String &str, int x = 0, int y = 0, const int w = 0, TextAlign align = kTextAlignLeft, int deltax = 0, bool useEllipsis = false) const; diff --git a/graphics/fontman.h b/graphics/fontman.h index 08afc07c2f5..34eecb95f94 100644 --- a/graphics/fontman.h +++ b/graphics/fontman.h @@ -132,7 +132,7 @@ private: /** @addtogroup graphics_fontman * @{ */ - + /** Shortcut for accessing the font manager. */ #define FontMan (Graphics::FontManager::instance()) /** @} */ diff --git a/graphics/opengl/context.cpp b/graphics/opengl/context.cpp index bc11d3ef550..541c97290ca 100644 --- a/graphics/opengl/context.cpp +++ b/graphics/opengl/context.cpp @@ -100,7 +100,7 @@ void ContextGL::initialize(ContextOGLType contextType) { } else if (token == "GL_OES_depth24") { OESDepth24 = true; } - + } int glslVersion = getGLSLVersion(); diff --git a/graphics/opengl/context.h b/graphics/opengl/context.h index 323aed0f400..833f825f665 100644 --- a/graphics/opengl/context.h +++ b/graphics/opengl/context.h @@ -85,7 +85,7 @@ public: /** Whether specifying a pitch when uploading to textures is available or not */ bool unpackSubImageSupported; - + /** Whether depth component 24 is supported or not */ bool OESDepth24; diff --git a/graphics/scaler/aspect.h b/graphics/scaler/aspect.h index 0efe8738e95..4f694f68c14 100644 --- a/graphics/scaler/aspect.h +++ b/graphics/scaler/aspect.h @@ -48,7 +48,7 @@ void makeRectStretchable(int &x, int &y, int &w, int &h, bool interpolate); /** * TODO: explain */ - + int stretch200To240(uint8 *buf, uint32 pitch, int width, diff --git a/graphics/scaler/hq.cpp b/graphics/scaler/hq.cpp index c0dd6fe8476..14cf2213ee3 100644 --- a/graphics/scaler/hq.cpp +++ b/graphics/scaler/hq.cpp @@ -194,7 +194,7 @@ void HQ2x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, #define PIXEL11_100 *(q+1+nextlineDst) = interpolate_14_1_1(w5, w6, w8); extern "C" uint32 *RGBtoYUV; -#define YUV(x) (sizeof(Pixel) == 2 ? RGBtoYUV[w ## x] : ConvertYUV(w ## x)) +#define YUV(x) (sizeof(Pixel) == 2 ? RGBtoYUV[w ## x] : ConvertYUV(w ## x)) /** * Convert 32 bit RGB values to Yuv diff --git a/graphics/tinygl/Changelog b/graphics/tinygl/Changelog index 5aad7426830..02513ee5cb9 100644 --- a/graphics/tinygl/Changelog +++ b/graphics/tinygl/Changelog @@ -15,8 +15,8 @@ The changes made from the original version of TinyGL 0.4 are: * Added TGL_BGR/TGL_RGB definitions to gl.h, verifying against SDL_opengl.h that the values are ok. * Added additional functions missing, like glColor4ub. (To make the code similar with the GL-code we use) * Added simplistic glColorMask implementation, on/off. -* Applied some C++-isms: - * "for(int i = 0;" instead of "int i; for (i = 0;", +* Applied some C++-isms: + * "for(int i = 0;" instead of "int i; for (i = 0;", * struct structName instead of typedef struct {} structName; * pass-by-const-reference instead of by-value when possible * Changed the math-functions to use const-pointers if possible. diff --git a/graphics/tinygl/LICENSE b/graphics/tinygl/LICENSE index d9862469205..91b5f1a6089 100644 --- a/graphics/tinygl/LICENSE +++ b/graphics/tinygl/LICENSE @@ -16,7 +16,7 @@ Copyright notice: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product and its documentation + in a product, an acknowledgment in the product and its documentation *is* required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. diff --git a/graphics/tinygl/vertex.cpp b/graphics/tinygl/vertex.cpp index 10432312ceb..c66cbdc8f55 100644 --- a/graphics/tinygl/vertex.cpp +++ b/graphics/tinygl/vertex.cpp @@ -252,7 +252,7 @@ void glopVertex(GLContext *c, GLParam *p) { void glopEnd(GLContext *c, GLParam *) { assert(c->in_begin == 1); - + if (c->vertex_cnt > 0) { tglIssueDrawCall(new Graphics::RasterizationDrawCall()); } diff --git a/graphics/tinygl/zblit.cpp b/graphics/tinygl/zblit.cpp index 6746d0b9a1f..f7b3bafdd14 100644 --- a/graphics/tinygl/zblit.cpp +++ b/graphics/tinygl/zblit.cpp @@ -163,7 +163,7 @@ public: width -= (c->_scissorRect.left - dstX); dstX = c->_scissorRect.left; } - + if (dstY < c->_scissorRect.top) { srcY += (c->_scissorRect.top - dstY); height -= (c->_scissorRect.top - dstY); @@ -233,12 +233,12 @@ public: if (kDisableTransform) { if ((kDisableBlending || kEnableAlphaBlending) && kFlipVertical == false && kFlipHorizontal == false) { tglBlitRLE(transform._destinationRectangle.left, - transform._destinationRectangle.top, transform._sourceRectangle.left, transform._sourceRectangle.top, + transform._destinationRectangle.top, transform._sourceRectangle.left, transform._sourceRectangle.top, transform._sourceRectangle.width() , transform._sourceRectangle.height(), transform._aTint, transform._rTint, transform._gTint, transform._bTint); } else { - tglBlitSimple(transform._destinationRectangle.left, - transform._destinationRectangle.top, transform._sourceRectangle.left, transform._sourceRectangle.top, + tglBlitSimple(transform._destinationRectangle.left, + transform._destinationRectangle.top, transform._sourceRectangle.left, transform._sourceRectangle.top, transform._sourceRectangle.width() , transform._sourceRectangle.height(), transform._aTint, transform._rTint, transform._gTint, transform._bTint); } @@ -334,7 +334,7 @@ FORCEINLINE void BlitImage::tglBlitRLE(int dstX, int dstY, int srcX, int srcY, i lineIndex++; } - if (_binaryTransparent || (kDisableBlending || !kEnableAlphaBlending)) { // If bitmap is binary transparent or if we need complex forms of blending (not just alpha) we need to use writePixel, which is slower + if (_binaryTransparent || (kDisableBlending || !kEnableAlphaBlending)) { // If bitmap is binary transparent or if we need complex forms of blending (not just alpha) we need to use writePixel, which is slower while (lineIndex < _lines.size() && _lines[lineIndex]._y < maxY) { const BlitImage::Line &l = _lines[lineIndex]; if (l._x < maxX && l._x + l._length > srcX) { @@ -426,7 +426,7 @@ FORCEINLINE void BlitImage::tglBlitSimple(int dstX, int dstY, int srcX, int srcY } // Those branches are needed to favor speed: avoiding writePixel always yield a huge performance boost when blitting images. - if (kDisableColoring) { + if (kDisableColoring) { if (kDisableBlending && aDst != 0) { dstBuf.setPixelAt((dstX + x) + (dstY + y) * c->fb->xsize, aDst, rDst, gDst, bDst); } else { @@ -543,19 +543,19 @@ template fb->cmode, c->fb->getPixelBuffer()); - + // Transform destination rectangle accordingly. Common::Rect destinationRectangle = rotateRectangle(dstX, dstY, width, height, rotation, originX, originY); - + if (dstX + destinationRectangle.width() > c->fb->xsize) clampWidth = c->fb->xsize - dstX; else @@ -564,36 +564,36 @@ FORCEINLINE void BlitImage::tglBlitRotoScale(int dstX, int dstY, int width, int clampHeight = c->fb->ysize - dstY; else clampHeight = destinationRectangle.height(); - + uint32 invAngle = 360 - (rotation % 360); float invCos = cos(invAngle * (float)M_PI / 180.0f); float invSin = sin(invAngle * (float)M_PI / 180.0f); - + int icosx = (int)(invCos * (65536.0f * srcWidth / width)); int isinx = (int)(invSin * (65536.0f * srcWidth / width)); int icosy = (int)(invCos * (65536.0f * srcHeight / height)); int isiny = (int)(invSin * (65536.0f * srcHeight / height)); - + int xd = (srcX + originX) << 16; int yd = (srcY + originY) << 16; int cx = originX * ((float)width / srcWidth); int cy = originY * ((float)height / srcHeight); - + int ax = -icosx * cx; int ay = -isiny * cx; int sw = width - 1; int sh = height - 1; - + for (int y = 0; y < clampHeight; y++) { int t = cy - y; int sdx = ax + (isinx * t) + xd; int sdy = ay - (icosy * t) + yd; for (int x = 0; x < clampWidth; ++x) { byte aDst, rDst, gDst, bDst; - + int dx = (sdx >> 16); int dy = (sdy >> 16); - + if (kFlipHorizontal) { dx = sw - dx; } @@ -601,7 +601,7 @@ FORCEINLINE void BlitImage::tglBlitRotoScale(int dstX, int dstY, int width, int if (kFlipVertical) { dy = sh - dy; } - + if ((dx >= 0) && (dy >= 0) && (dx < srcWidth) && (dy < srcHeight)) { srcBuf.getARGBAt(dy * _surface.w + dx, aDst, rDst, gDst, bDst); if (kDisableColoring) { diff --git a/graphics/tinygl/zblit.h b/graphics/tinygl/zblit.h index 20535fb3b1f..ff358a22343 100644 --- a/graphics/tinygl/zblit.h +++ b/graphics/tinygl/zblit.h @@ -169,7 +169,7 @@ namespace Internal { @brief Performs a cleanup of disposed blit images. */ void tglCleanupImages(); // This function checks if any blit image is to be cleaned up and deletes it. - + // Documentation for those is the same as the one before, only those function are the one that actually execute the correct code path. void tglBlit(BlitImage *blitImage, const BlitTransform &transform); diff --git a/graphics/tinygl/zbuffer.h b/graphics/tinygl/zbuffer.h index 5fdfbe5ec45..4b68674ebb7 100644 --- a/graphics/tinygl/zbuffer.h +++ b/graphics/tinygl/zbuffer.h @@ -89,12 +89,12 @@ struct ZBufferPoint { bool operator==(const ZBufferPoint &other) const { return x == other.x && - y == other.y && + y == other.y && z == other.z && s == other.s && - t == other.t && - r == other.r && - g == other.g && + t == other.t && + r == other.r && + g == other.g && b == other.b && a == other.a; } @@ -272,7 +272,7 @@ struct FrameBuffer { if (kDepthWrite) { _zbuf[pixel] = z; } - + if (kBlendingEnabled == false) { this->pbuf.setPixelAt(pixel, aSrc, rSrc, gSrc, bSrc); } else { @@ -382,7 +382,7 @@ struct FrameBuffer { void copyFromBuffer(Graphics::PixelBuffer buf) { pbuf.copyBuffer(0, xsize * ysize, buf); } - + void enableBlending(bool enable) { _blendingEnabled = enable; } diff --git a/graphics/tinygl/zdirtyrect.cpp b/graphics/tinygl/zdirtyrect.cpp index 18fc9e253a6..28a6fd45dce 100644 --- a/graphics/tinygl/zdirtyrect.cpp +++ b/graphics/tinygl/zdirtyrect.cpp @@ -47,11 +47,11 @@ static void tglDrawRectangle(Common::Rect rect, int r, int g, int b) { if (rect.left < 0) rect.left = 0; - if (rect.right >= c->fb->xsize) + if (rect.right >= c->fb->xsize) rect.right = c->fb->xsize - 1; if (rect.top < 0) rect.top = 0; - if (rect.bottom >= c->fb->ysize) + if (rect.bottom >= c->fb->ysize) rect.bottom = c->fb->ysize - 1; for(int x = rect.left; x < rect.right; x++) { @@ -460,7 +460,7 @@ RasterizationDrawCall::RasterizationState RasterizationDrawCall::captureState() state.depthWrite = c->fb->getDepthWrite(); state.lightingEnabled = c->lighting_enabled; state.depthTestEnabled = c->fb->getDepthTestEnabled(); - if (c->current_texture != nullptr) + if (c->current_texture != nullptr) state.textureVersion = c->current_texture->versionNumber; memcpy(state.viewportScaling, c->viewport.scale._v, sizeof(c->viewport.scale._v)); @@ -490,7 +490,7 @@ void RasterizationDrawCall::applyState(const RasterizationDrawCall::Rasterizatio c->polygon_mode_front = state.polygonModeFront; c->shadow_mode = state.shadowMode; c->texture_2d_enabled = state.texture2DEnabled; - c->current_texture = state.texture; + c->current_texture = state.texture; c->texture_wrap_s = state.wrapS; c->texture_wrap_t = state.wrapT; c->fb->shadow_mask_buf = state.shadowMaskBuf; @@ -507,9 +507,9 @@ void RasterizationDrawCall::execute(const Common::Rect &clippingRectangle, bool } bool RasterizationDrawCall::operator==(const RasterizationDrawCall &other) const { - if (_vertexCount == other._vertexCount && - _drawTriangleFront == other._drawTriangleFront && - _drawTriangleBack == other._drawTriangleBack && + if (_vertexCount == other._vertexCount && + _drawTriangleFront == other._drawTriangleFront && + _drawTriangleBack == other._drawTriangleBack && _state == other._state) { for (int i = 0; i < _vertexCount; i++) { if ((_vertex[i] != other._vertex[i])) { @@ -598,7 +598,7 @@ void BlittingDrawCall::computeDirtyRegion() { } else { tglGetBlitImageSize(_image, blitWidth, blitHeight); } - } + } if (blitHeight == 0) { if (_transform._sourceRectangle.height() != 0) { blitHeight = _transform._sourceRectangle.height(); @@ -627,7 +627,7 @@ bool BlittingDrawCall::operator==(const BlittingDrawCall &other) const { _imageVersion == tglGetBlitImageVersion(other._image); } -ClearBufferDrawCall::ClearBufferDrawCall(bool clearZBuffer, int zValue, bool clearColorBuffer, int rValue, int gValue, int bValue) +ClearBufferDrawCall::ClearBufferDrawCall(bool clearZBuffer, int zValue, bool clearColorBuffer, int rValue, int gValue, int bValue) : _clearZBuffer(clearZBuffer), _clearColorBuffer(clearColorBuffer), _zValue(zValue), _rValue(rValue), _gValue(gValue), _bValue(bValue), DrawCall(DrawCall_Clear) { TinyGL::GLContext *c = TinyGL::gl_get_context(); if (c->_enableDirtyRectangles) { @@ -657,8 +657,8 @@ bool ClearBufferDrawCall::operator==(const ClearBufferDrawCall &other) const { bool RasterizationDrawCall::RasterizationState::operator==(const RasterizationState &other) const { - return beginType == other.beginType && - currentFrontFace == other.currentFrontFace && + return beginType == other.beginType && + currentFrontFace == other.currentFrontFace && cullFaceEnabled == other.cullFaceEnabled && colorMask == other.colorMask && depthTest == other.depthTest && diff --git a/graphics/tinygl/zdirtyrect.h b/graphics/tinygl/zdirtyrect.h index f579294ad33..c511dd16df5 100644 --- a/graphics/tinygl/zdirtyrect.h +++ b/graphics/tinygl/zdirtyrect.h @@ -107,7 +107,7 @@ private: typedef void (*gl_draw_triangle_func_ptr)(TinyGL::GLContext *c, TinyGL::GLVertex *p0, TinyGL::GLVertex *p1, TinyGL::GLVertex *p2); int _vertexCount; TinyGL::GLVertex *_vertex; - gl_draw_triangle_func_ptr _drawTriangleFront, _drawTriangleBack; + gl_draw_triangle_func_ptr _drawTriangleFront, _drawTriangleBack; struct RasterizationState { int beginType; @@ -161,7 +161,7 @@ public: virtual void execute(const Common::Rect &clippingRectangle, bool restoreState) const; BlittingMode getBlittingMode() const { return _mode; } - + void *operator new(size_t size) { return ::Internal::allocateFrame(size); } @@ -186,7 +186,7 @@ private: sfactor == other.sfactor && dfactor == other.dfactor && alphaTest == other.alphaTest && - alphaFunc == other.alphaFunc && + alphaFunc == other.alphaFunc && alphaRefValue == other.alphaRefValue && depthTestEnabled == other.depthTestEnabled; } diff --git a/graphics/tinygl/zgl.h b/graphics/tinygl/zgl.h index 5cd8904c9f9..e947838660f 100644 --- a/graphics/tinygl/zgl.h +++ b/graphics/tinygl/zgl.h @@ -160,11 +160,11 @@ struct GLVertex { bool operator==(const GLVertex &other) const { return edge_flag == other.edge_flag && normal == other.normal && - coord == other.coord && - tex_coord == other.tex_coord && + coord == other.coord && + tex_coord == other.tex_coord && color == other.color && ec == other.ec && - pc == other.pc && + pc == other.pc && clip_code == other.clip_code && zp == other.zp; } diff --git a/graphics/tinygl/zline.cpp b/graphics/tinygl/zline.cpp index f795e8127d7..a493db1c222 100644 --- a/graphics/tinygl/zline.cpp +++ b/graphics/tinygl/zline.cpp @@ -147,7 +147,7 @@ void FrameBuffer::plot(ZBufferPoint *p) { const unsigned int z = p->z; if (_depthWrite && _depthTestEnabled) putPixel(pixelOffset, col, p->x, p->y, z); - else + else putPixel(pixelOffset, col, p->x, p->y, z); } diff --git a/graphics/tinygl/zmath.cpp b/graphics/tinygl/zmath.cpp index 1563aaa214e..31c388ea61c 100644 --- a/graphics/tinygl/zmath.cpp +++ b/graphics/tinygl/zmath.cpp @@ -34,120 +34,120 @@ namespace TinyGL { // Inversion of a 4x4 matrix. // It's not just unrolling, this is a different implementation that directly -// uses the formula whereas the previous one is using another method (which is generic and thus, slower) +// uses the formula whereas the previous one is using another method (which is generic and thus, slower) int MatrixInverse(float *m) { double inv[16]; - inv[0] = m[5] * m[10] * m[15] - - m[5] * m[11] * m[14] - - m[9] * m[6] * m[15] + + inv[0] = m[5] * m[10] * m[15] - + m[5] * m[11] * m[14] - + m[9] * m[6] * m[15] + m[9] * m[7] * m[14] + - m[13] * m[6] * m[11] - + m[13] * m[6] * m[11] - m[13] * m[7] * m[10]; - inv[4] = -m[4] * m[10] * m[15] + - m[4] * m[11] * m[14] + - m[8] * m[6] * m[15] - - m[8] * m[7] * m[14] - - m[12] * m[6] * m[11] + + inv[4] = -m[4] * m[10] * m[15] + + m[4] * m[11] * m[14] + + m[8] * m[6] * m[15] - + m[8] * m[7] * m[14] - + m[12] * m[6] * m[11] + m[12] * m[7] * m[10]; - inv[8] = m[4] * m[9] * m[15] - - m[4] * m[11] * m[13] - - m[8] * m[5] * m[15] + - m[8] * m[7] * m[13] + - m[12] * m[5] * m[11] - + inv[8] = m[4] * m[9] * m[15] - + m[4] * m[11] * m[13] - + m[8] * m[5] * m[15] + + m[8] * m[7] * m[13] + + m[12] * m[5] * m[11] - m[12] * m[7] * m[9]; - inv[12] = -m[4] * m[9] * m[14] + + inv[12] = -m[4] * m[9] * m[14] + m[4] * m[10] * m[13] + - m[8] * m[5] * m[14] - - m[8] * m[6] * m[13] - - m[12] * m[5] * m[10] + + m[8] * m[5] * m[14] - + m[8] * m[6] * m[13] - + m[12] * m[5] * m[10] + m[12] * m[6] * m[9]; - inv[1] = -m[1] * m[10] * m[15] + - m[1] * m[11] * m[14] + - m[9] * m[2] * m[15] - - m[9] * m[3] * m[14] - - m[13] * m[2] * m[11] + + inv[1] = -m[1] * m[10] * m[15] + + m[1] * m[11] * m[14] + + m[9] * m[2] * m[15] - + m[9] * m[3] * m[14] - + m[13] * m[2] * m[11] + m[13] * m[3] * m[10]; - inv[5] = m[0] * m[10] * m[15] - - m[0] * m[11] * m[14] - - m[8] * m[2] * m[15] + - m[8] * m[3] * m[14] + - m[12] * m[2] * m[11] - + inv[5] = m[0] * m[10] * m[15] - + m[0] * m[11] * m[14] - + m[8] * m[2] * m[15] + + m[8] * m[3] * m[14] + + m[12] * m[2] * m[11] - m[12] * m[3] * m[10]; - inv[9] = -m[0] * m[9] * m[15] + - m[0] * m[11] * m[13] + - m[8] * m[1] * m[15] - - m[8] * m[3] * m[13] - - m[12] * m[1] * m[11] + + inv[9] = -m[0] * m[9] * m[15] + + m[0] * m[11] * m[13] + + m[8] * m[1] * m[15] - + m[8] * m[3] * m[13] - + m[12] * m[1] * m[11] + m[12] * m[3] * m[9]; - inv[13] = m[0] * m[9] * m[14] - - m[0] * m[10] * m[13] - - m[8] * m[1] * m[14] + - m[8] * m[2] * m[13] + - m[12] * m[1] * m[10] - + inv[13] = m[0] * m[9] * m[14] - + m[0] * m[10] * m[13] - + m[8] * m[1] * m[14] + + m[8] * m[2] * m[13] + + m[12] * m[1] * m[10] - m[12] * m[2] * m[9]; - inv[2] = m[1] * m[6] * m[15] - - m[1] * m[7] * m[14] - - m[5] * m[2] * m[15] + - m[5] * m[3] * m[14] + - m[13] * m[2] * m[7] - + inv[2] = m[1] * m[6] * m[15] - + m[1] * m[7] * m[14] - + m[5] * m[2] * m[15] + + m[5] * m[3] * m[14] + + m[13] * m[2] * m[7] - m[13] * m[3] * m[6]; - inv[6] = -m[0] * m[6] * m[15] + - m[0] * m[7] * m[14] + - m[4] * m[2] * m[15] - - m[4] * m[3] * m[14] - - m[12] * m[2] * m[7] + + inv[6] = -m[0] * m[6] * m[15] + + m[0] * m[7] * m[14] + + m[4] * m[2] * m[15] - + m[4] * m[3] * m[14] - + m[12] * m[2] * m[7] + m[12] * m[3] * m[6]; - inv[10] = m[0] * m[5] * m[15] - - m[0] * m[7] * m[13] - - m[4] * m[1] * m[15] + - m[4] * m[3] * m[13] + - m[12] * m[1] * m[7] - + inv[10] = m[0] * m[5] * m[15] - + m[0] * m[7] * m[13] - + m[4] * m[1] * m[15] + + m[4] * m[3] * m[13] + + m[12] * m[1] * m[7] - m[12] * m[3] * m[5]; - inv[14] = -m[0] * m[5] * m[14] + - m[0] * m[6] * m[13] + - m[4] * m[1] * m[14] - - m[4] * m[2] * m[13] - - m[12] * m[1] * m[6] + + inv[14] = -m[0] * m[5] * m[14] + + m[0] * m[6] * m[13] + + m[4] * m[1] * m[14] - + m[4] * m[2] * m[13] - + m[12] * m[1] * m[6] + m[12] * m[2] * m[5]; - inv[3] = -m[1] * m[6] * m[11] + - m[1] * m[7] * m[10] + - m[5] * m[2] * m[11] - - m[5] * m[3] * m[10] - - m[9] * m[2] * m[7] + + inv[3] = -m[1] * m[6] * m[11] + + m[1] * m[7] * m[10] + + m[5] * m[2] * m[11] - + m[5] * m[3] * m[10] - + m[9] * m[2] * m[7] + m[9] * m[3] * m[6]; - inv[7] = m[0] * m[6] * m[11] - - m[0] * m[7] * m[10] - - m[4] * m[2] * m[11] + - m[4] * m[3] * m[10] + - m[8] * m[2] * m[7] - + inv[7] = m[0] * m[6] * m[11] - + m[0] * m[7] * m[10] - + m[4] * m[2] * m[11] + + m[4] * m[3] * m[10] + + m[8] * m[2] * m[7] - m[8] * m[3] * m[6]; - inv[11] = -m[0] * m[5] * m[11] + - m[0] * m[7] * m[9] + - m[4] * m[1] * m[11] - - m[4] * m[3] * m[9] - - m[8] * m[1] * m[7] + + inv[11] = -m[0] * m[5] * m[11] + + m[0] * m[7] * m[9] + + m[4] * m[1] * m[11] - + m[4] * m[3] * m[9] - + m[8] * m[1] * m[7] + m[8] * m[3] * m[5]; - inv[15] = m[0] * m[5] * m[10] - - m[0] * m[6] * m[9] - - m[4] * m[1] * m[10] + - m[4] * m[2] * m[9] + - m[8] * m[1] * m[6] - + inv[15] = m[0] * m[5] * m[10] - + m[0] * m[6] * m[9] - + m[4] * m[1] * m[10] + + m[4] * m[2] * m[9] + + m[8] * m[1] * m[6] - m[8] * m[2] * m[5]; double det = m[0] * inv[0] + m[1] * inv[4] + m[2] * inv[8] + m[3] * inv[12]; diff --git a/graphics/tinygl/ztriangle.cpp b/graphics/tinygl/ztriangle.cpp index 9072a93ecd4..1d86eabd7a9 100644 --- a/graphics/tinygl/ztriangle.cpp +++ b/graphics/tinygl/ztriangle.cpp @@ -664,7 +664,7 @@ void FrameBuffer::fillTriangleDepthOnly(ZBufferPoint *p0, ZBufferPoint *p1, ZBuf const bool interpSTZ = false; if (_depthWrite && _depthTestEnabled) fillTriangle(p0, p1, p2); - else + else fillTriangle(p0, p1, p2); } diff --git a/image/iff.h b/image/iff.h index a94279d2738..f0301fd2db8 100644 --- a/image/iff.h +++ b/image/iff.h @@ -125,7 +125,7 @@ private: void loadBitmap(Common::SeekableReadStream &stream); void packPixels(byte *scanlines, byte *data, const uint16 scanlinePitch, const uint16 outPitch); }; -/** @} */ +/** @} */ } // End of namespace Image #endif diff --git a/math/angle.h b/math/angle.h index 4b138c43d47..ae30eb57777 100644 --- a/math/angle.h +++ b/math/angle.h @@ -52,7 +52,7 @@ public: * \param low The lower bound of the range, in degrees. */ Angle &normalize(float low); - + /** * Clamp the angle to range [-mag, mag] * diff --git a/math/matrix3.h b/math/matrix3.h index a4c7da9d807..d17c07ccbc8 100644 --- a/math/matrix3.h +++ b/math/matrix3.h @@ -37,7 +37,7 @@ public: void transpose(); - + /** * Builds a matrix that maps the given local space forward direction vector to point towards the given * target direction, and the given local up direction towards the given target world up direction. diff --git a/math/matrix4.cpp b/math/matrix4.cpp index c7c12c9e847..a1efde43c75 100644 --- a/math/matrix4.cpp +++ b/math/matrix4.cpp @@ -81,7 +81,7 @@ Matrix3 Matrix<4, 4>::getRotation() const{ m2.setValue(2, 0, getValue(2, 0)); m2.setValue(2, 1, getValue(2, 1)); m2.setValue(2, 2, getValue(2, 2)); - + return m2; } diff --git a/math/matrix4.h b/math/matrix4.h index d1030d50749..91054ce5897 100644 --- a/math/matrix4.h +++ b/math/matrix4.h @@ -42,10 +42,10 @@ public: void transform(Vector3d *v, bool translate) const; void inverseTranslate(Vector3d *v) const; void inverseRotate(Vector3d *v) const; - + Vector3d getPosition() const; void setPosition(const Vector3d &v); - + Matrix3 getRotation() const; void setRotation(const Matrix3 &m); @@ -65,7 +65,7 @@ public: */ void buildFromTargetDir(const Math::Vector3d &modelForward, const Math::Vector3d &targetDirection, const Math::Vector3d &modelUp, const Math::Vector3d &worldUp); - + /** * Inverts a matrix in place. * This function avoid having to do generic Gaussian elimination on the matrix diff --git a/math/quat.h b/math/quat.h index b7f287e0b18..ca7d4e8e71e 100644 --- a/math/quat.h +++ b/math/quat.h @@ -66,7 +66,7 @@ public: * @param q The existing quaternion * @return The new Quaternion */ - Quaternion(const Quaternion &q) : Vector4d(q.x(), q.y(), q.z(), q.w()) {} + Quaternion(const Quaternion &q) : Vector4d(q.x(), q.y(), q.z(), q.w()) {} /** * Constructor from a vector of four floats in the order X,Y,Z,W diff --git a/test/common/encoding.h b/test/common/encoding.h index c6b73f5383d..4819d967183 100644 --- a/test/common/encoding.h +++ b/test/common/encoding.h @@ -26,7 +26,7 @@ public: 0xed, 0x8e, 0x98, 0xec, 0x9d, 0xb4, 0xec, 0x8a, 0xa4, 0xed, 0x82, 0xa4, 0xeb, 0xa5, 0xbc, 0x20, 0xec, 0xb9, 0x98, 0xec, 0x8b, 0x9c, 0xec, 0x98, - 0xa4, 0x2e, 0x00, + 0xa4, 0x2e, 0x00, }; const uint32 utf32[] = { @@ -65,7 +65,7 @@ public: 0x8c, 0x89, 0xe4, 0xb8, 0x8b, 0xe7, 0xa9, 0xba, 0x21, 0xe7, 0x99, 0xbd, 0xe9, 0x8d, 0xb5, 0xe7, 0xb9, 0xbc, 0xe7, 0xba, 0x8c, 0xe9, 0x81, 0x8a, - 0xe6, 0x88, 0xb2, 0xe3, 0x80, 0x82, 0x00, + 0xe6, 0x88, 0xb2, 0xe3, 0x80, 0x82, 0x00, }; const uint32 utf32[] = { @@ -143,7 +143,7 @@ public: #ifdef SCUMM_BIG_ENDIAN //| dolar | cent | euro | unsigned char utf16be[] = {0, 0x24, 0, 0xA2, 0x20, 0xAC, 0, 0}; - //| dolar | cent | euro + //| dolar | cent | euro unsigned char utf32be[] = {0, 0, 0, 0x24, 0, 0, 0, 0xA2, 0, 0, 0x20, 0xAC, 0, 0, 0, 0}; unsigned char *utf16 = utf16be; @@ -227,7 +227,7 @@ public: TS_ASSERT(result16 != NULL); TS_ASSERT_EQUALS(memcmp(result16, utf16le, 8), 0); delete[] result16; - + } void test_cyrillic_transliteration() { diff --git a/test/common/math.h b/test/common/math.h index ae7a7898971..010c6d71aa9 100644 --- a/test/common/math.h +++ b/test/common/math.h @@ -17,7 +17,7 @@ class MathTestSuite : public CxxTest::TestSuite // Some simple test for 2^10 TS_ASSERT_EQUALS(Common::intLog2(1024), 10); } - + void test_rad2deg() { //float verion TS_ASSERT_DELTA(Common::rad2deg(0), 0, MAX_ERROR_FLT); diff --git a/test/cxxtest/cxxtestgen.py b/test/cxxtest/cxxtestgen.py index 5414f830da4..8aa62004ce7 100755 --- a/test/cxxtest/cxxtestgen.py +++ b/test/cxxtest/cxxtestgen.py @@ -288,7 +288,7 @@ def addLineToBlock( suite, lineNo, line ): '''Append the line to the current CXXTEST_CODE() block''' line = fixBlockLine( suite, lineNo, line ) line = re.sub( r'^.*\{\{', '', line ) - + e = re.search( r'\}\}', line ) if e: line = line[:e.start()] @@ -533,11 +533,11 @@ def runBody( suite, test ): def dynamicRun( suite, test ): '''Body of TestDescription::run() for test in a dynamic suite''' return 'if ( ' + suite['object'] + ' ) ' + suite['object'] + '->' + test['name'] + '();' - + def staticRun( suite, test ): '''Body of TestDescription::run() for test in a non-dynamic suite''' return suite['object'] + '.' + test['name'] + '();' - + def writeSuiteDescription( output, suite ): '''Write SuiteDescription object''' if isDynamic( suite ): diff --git a/test/null_osystem.cpp b/test/null_osystem.cpp index ae53ec96b41..134a399b8ef 100644 --- a/test/null_osystem.cpp +++ b/test/null_osystem.cpp @@ -1,7 +1,7 @@ #define USE_NULL_DRIVER 1 #define NULL_DRIVER_USE_FOR_TEST 1 #include "null_osystem.h" -#include "../backends/platform/null/null.cpp" +#include "../backends/platform/null/null.cpp" void Common::install_null_g_system() { g_system = OSystem_NULL_create();