aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
Diffstat (limited to 'backends')
-rw-r--r--backends/audiocd/audiocd.h4
-rw-r--r--backends/audiocd/default/default-audiocd.cpp4
-rw-r--r--backends/audiocd/default/default-audiocd.h4
-rw-r--r--backends/audiocd/sdl/sdl-audiocd.cpp4
-rw-r--r--backends/audiocd/sdl/sdl-audiocd.h4
-rw-r--r--backends/base-backend.h4
-rw-r--r--backends/events/default/default-events.cpp4
-rw-r--r--backends/events/default/default-events.h4
-rw-r--r--backends/events/dinguxsdl/dinguxsdl-events.cpp4
-rw-r--r--backends/events/dinguxsdl/dinguxsdl-events.h4
-rw-r--r--backends/events/gph/gph-events.cpp4
-rw-r--r--backends/events/gph/gph-events.h4
-rw-r--r--backends/events/linuxmotosdl/linuxmotosdl-events.cpp4
-rw-r--r--backends/events/linuxmotosdl/linuxmotosdl-events.h4
-rw-r--r--backends/events/maemosdl/maemosdl-events.cpp6
-rw-r--r--backends/events/maemosdl/maemosdl-events.h4
-rw-r--r--backends/events/openpandora/op-events.cpp4
-rw-r--r--backends/events/openpandora/op-events.h4
-rw-r--r--backends/events/ps3sdl/ps3sdl-events.cpp4
-rw-r--r--backends/events/ps3sdl/ps3sdl-events.h4
-rw-r--r--backends/events/samsungtvsdl/samsungtvsdl-events.cpp4
-rw-r--r--backends/events/samsungtvsdl/samsungtvsdl-events.h4
-rw-r--r--backends/events/sdl/sdl-events.cpp15
-rw-r--r--backends/events/sdl/sdl-events.h4
-rw-r--r--backends/events/symbiansdl/symbiansdl-events.cpp4
-rw-r--r--backends/events/symbiansdl/symbiansdl-events.h4
-rw-r--r--backends/events/webossdl/webossdl-events.cpp4
-rw-r--r--backends/events/webossdl/webossdl-events.h4
-rw-r--r--backends/events/wincesdl/wincesdl-events.cpp4
-rw-r--r--backends/events/wincesdl/wincesdl-events.h4
-rw-r--r--backends/fs/abstract-fs.cpp1
-rw-r--r--backends/fs/abstract-fs.h1
-rw-r--r--backends/fs/amigaos4/amigaos4-fs-factory.cpp1
-rw-r--r--backends/fs/amigaos4/amigaos4-fs-factory.h1
-rw-r--r--backends/fs/amigaos4/amigaos4-fs.cpp28
-rw-r--r--backends/fs/amigaos4/amigaos4-fs.h7
-rw-r--r--backends/fs/ds/ds-fs-factory.cpp1
-rw-r--r--backends/fs/ds/ds-fs-factory.h1
-rw-r--r--backends/fs/ds/ds-fs.cpp4
-rw-r--r--backends/fs/ds/ds-fs.h4
-rw-r--r--backends/fs/fs-factory.h1
-rw-r--r--backends/fs/n64/n64-fs-factory.cpp1
-rw-r--r--backends/fs/n64/n64-fs-factory.h1
-rw-r--r--backends/fs/n64/n64-fs.h1
-rw-r--r--backends/fs/n64/romfsstream.cpp4
-rw-r--r--backends/fs/n64/romfsstream.h4
-rw-r--r--backends/fs/posix/posix-fs-factory.cpp1
-rw-r--r--backends/fs/posix/posix-fs-factory.h1
-rw-r--r--backends/fs/posix/posix-fs.cpp1
-rw-r--r--backends/fs/posix/posix-fs.h1
-rw-r--r--backends/fs/ps2/ps2-fs-factory.cpp1
-rw-r--r--backends/fs/ps2/ps2-fs-factory.h1
-rw-r--r--backends/fs/ps2/ps2-fs.cpp48
-rw-r--r--backends/fs/ps2/ps2-fs.h5
-rw-r--r--backends/fs/ps3/ps3-fs-factory.cpp1
-rw-r--r--backends/fs/ps3/ps3-fs-factory.h1
-rw-r--r--backends/fs/psp/psp-fs-factory.cpp1
-rw-r--r--backends/fs/psp/psp-fs-factory.h1
-rw-r--r--backends/fs/psp/psp-fs.cpp1
-rw-r--r--backends/fs/psp/psp-fs.h1
-rw-r--r--backends/fs/psp/psp-stream.cpp4
-rw-r--r--backends/fs/psp/psp-stream.h4
-rw-r--r--backends/fs/stdiostream.cpp4
-rw-r--r--backends/fs/stdiostream.h4
-rw-r--r--backends/fs/symbian/symbian-fs-factory.cpp1
-rw-r--r--backends/fs/symbian/symbian-fs-factory.h1
-rw-r--r--backends/fs/symbian/symbian-fs.cpp1
-rw-r--r--backends/fs/symbian/symbian-fs.h1
-rw-r--r--backends/fs/symbian/symbianstream.cpp4
-rw-r--r--backends/fs/symbian/symbianstream.h4
-rw-r--r--backends/fs/wii/wii-fs-factory.cpp15
-rw-r--r--backends/fs/wii/wii-fs.cpp44
-rw-r--r--backends/fs/wii/wii-fs.h3
-rw-r--r--backends/fs/windows/windows-fs-factory.cpp1
-rw-r--r--backends/fs/windows/windows-fs-factory.h1
-rw-r--r--backends/fs/windows/windows-fs.cpp1
-rw-r--r--backends/fs/windows/windows-fs.h1
-rw-r--r--backends/graphics/default-palette.h4
-rw-r--r--backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp4
-rw-r--r--backends/graphics/dinguxsdl/dinguxsdl-graphics.h4
-rw-r--r--backends/graphics/gph/gph-graphics.cpp4
-rw-r--r--backends/graphics/gph/gph-graphics.h4
-rw-r--r--backends/graphics/graphics.h4
-rw-r--r--backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp4
-rw-r--r--backends/graphics/linuxmotosdl/linuxmotosdl-graphics.h4
-rw-r--r--backends/graphics/maemosdl/maemosdl-graphics.cpp4
-rw-r--r--backends/graphics/maemosdl/maemosdl-graphics.h4
-rw-r--r--backends/graphics/null/null-graphics.h4
-rw-r--r--backends/graphics/opengl/debug.cpp65
-rw-r--r--backends/graphics/opengl/debug.h39
-rw-r--r--backends/graphics/opengl/extensions.cpp48
-rw-r--r--backends/graphics/opengl/extensions.h (renamed from backends/graphics/opengl/glerrorcheck.h)26
-rw-r--r--backends/graphics/opengl/gltexture.cpp225
-rw-r--r--backends/graphics/opengl/gltexture.h131
-rw-r--r--backends/graphics/opengl/opengl-graphics.cpp1842
-rw-r--r--backends/graphics/opengl/opengl-graphics.h511
-rw-r--r--backends/graphics/opengl/opengl-sys.h (renamed from backends/graphics/opengl/glerrorcheck.cpp)50
-rw-r--r--backends/graphics/opengl/texture.cpp374
-rw-r--r--backends/graphics/opengl/texture.h175
-rw-r--r--backends/graphics/openglsdl/openglsdl-graphics.cpp934
-rw-r--r--backends/graphics/openglsdl/openglsdl-graphics.h132
-rw-r--r--backends/graphics/openpandora/op-graphics.cpp4
-rw-r--r--backends/graphics/openpandora/op-graphics.h4
-rw-r--r--backends/graphics/samsungtvsdl/samsungtvsdl-graphics.cpp4
-rw-r--r--backends/graphics/samsungtvsdl/samsungtvsdl-graphics.h4
-rw-r--r--backends/graphics/sdl/sdl-graphics.cpp13
-rw-r--r--backends/graphics/sdl/sdl-graphics.h24
-rw-r--r--backends/graphics/surfacesdl/surfacesdl-graphics.cpp45
-rw-r--r--backends/graphics/surfacesdl/surfacesdl-graphics.h10
-rw-r--r--backends/graphics/symbiansdl/symbiansdl-graphics.cpp4
-rw-r--r--backends/graphics/symbiansdl/symbiansdl-graphics.h4
-rw-r--r--backends/graphics/wincesdl/wincesdl-graphics.cpp4
-rw-r--r--backends/graphics/wincesdl/wincesdl-graphics.h4
-rw-r--r--backends/keymapper/action.cpp40
-rw-r--r--backends/keymapper/action.h40
-rw-r--r--backends/keymapper/hardware-input.cpp40
-rw-r--r--backends/keymapper/hardware-input.h40
-rw-r--r--backends/keymapper/keymap.cpp40
-rw-r--r--backends/keymapper/keymap.h40
-rw-r--r--backends/keymapper/keymapper-defaults.h40
-rw-r--r--backends/keymapper/keymapper.cpp40
-rw-r--r--backends/keymapper/keymapper.h40
-rw-r--r--backends/keymapper/remap-dialog.cpp7
-rw-r--r--backends/keymapper/remap-dialog.h1
-rw-r--r--backends/midi/alsa.cpp1
-rw-r--r--backends/midi/camd.cpp11
-rw-r--r--backends/midi/coreaudio.cpp1
-rw-r--r--backends/midi/coremidi.cpp1
-rw-r--r--backends/midi/dmedia.cpp1
-rw-r--r--backends/midi/seq.cpp1
-rw-r--r--backends/midi/sndio.cpp1
-rw-r--r--backends/midi/stmidi.cpp1
-rw-r--r--backends/midi/timidity.cpp1
-rw-r--r--backends/midi/windows.cpp1
-rw-r--r--backends/mixer/doublebuffersdl/doublebuffersdl-mixer.cpp4
-rw-r--r--backends/mixer/doublebuffersdl/doublebuffersdl-mixer.h4
-rw-r--r--backends/mixer/nullmixer/nullsdl-mixer.cpp4
-rw-r--r--backends/mixer/nullmixer/nullsdl-mixer.h4
-rw-r--r--backends/mixer/sdl/sdl-mixer.cpp10
-rw-r--r--backends/mixer/sdl/sdl-mixer.h4
-rw-r--r--backends/mixer/sdl13/sdl13-mixer.cpp4
-rw-r--r--backends/mixer/sdl13/sdl13-mixer.h4
-rw-r--r--backends/mixer/symbiansdl/symbiansdl-mixer.cpp4
-rw-r--r--backends/mixer/symbiansdl/symbiansdl-mixer.h4
-rw-r--r--backends/mixer/wincesdl/wincesdl-mixer.cpp4
-rw-r--r--backends/mixer/wincesdl/wincesdl-mixer.h4
-rw-r--r--backends/modular-backend.cpp4
-rw-r--r--backends/modular-backend.h4
-rw-r--r--backends/module.mk25
-rw-r--r--backends/mutex/mutex.h4
-rw-r--r--backends/mutex/null/null-mutex.h4
-rw-r--r--backends/mutex/sdl/sdl-mutex.cpp4
-rw-r--r--backends/mutex/sdl/sdl-mutex.h4
-rw-r--r--backends/platform/android/android.cpp6
-rw-r--r--backends/platform/android/android.h6
-rw-r--r--backends/platform/android/android.mk1
-rw-r--r--backends/platform/android/asset-archive.cpp4
-rw-r--r--backends/platform/android/asset-archive.h4
-rw-r--r--backends/platform/android/events.cpp6
-rw-r--r--backends/platform/android/gfx.cpp23
-rw-r--r--backends/platform/android/jni.cpp6
-rw-r--r--backends/platform/android/jni.h6
-rw-r--r--backends/platform/android/org/scummvm/scummvm/ScummVM.java8
-rw-r--r--backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java10
-rw-r--r--backends/platform/android/org/scummvm/scummvm/ScummVMEvents.java10
-rw-r--r--backends/platform/android/org/scummvm/scummvm/ScummVMEventsHoneycomb.java25
-rw-r--r--backends/platform/android/texture.cpp23
-rw-r--r--backends/platform/android/texture.h16
-rw-r--r--backends/platform/dc/DCLauncherDialog.h4
-rw-r--r--backends/platform/dc/audio.cpp4
-rw-r--r--backends/platform/dc/dc-fs.cpp3
-rw-r--r--backends/platform/dc/dc.h6
-rw-r--r--backends/platform/dc/dcloader.cpp4
-rw-r--r--backends/platform/dc/dcloader.h4
-rw-r--r--backends/platform/dc/dcmain.cpp10
-rw-r--r--backends/platform/dc/display.cpp4
-rw-r--r--backends/platform/dc/icon.cpp8
-rw-r--r--backends/platform/dc/icon.h4
-rw-r--r--backends/platform/dc/input.cpp15
-rw-r--r--backends/platform/dc/ip.txt.in2
-rw-r--r--backends/platform/dc/label.cpp4
-rw-r--r--backends/platform/dc/label.h4
-rw-r--r--backends/platform/dc/plugins.cpp4
-rw-r--r--backends/platform/dc/portdefs.h4
-rw-r--r--backends/platform/dc/selector.cpp4
-rw-r--r--backends/platform/dc/softkbd.cpp4
-rw-r--r--backends/platform/dc/softkbd.h5
-rw-r--r--backends/platform/dc/time.cpp4
-rw-r--r--backends/platform/dc/vmsave.cpp4
-rw-r--r--backends/platform/dingux/dingux.cpp4
-rw-r--r--backends/platform/dingux/dingux.h4
-rw-r--r--backends/platform/dingux/main.cpp4
-rw-r--r--backends/platform/ds/arm7/source/main.cpp4
-rw-r--r--backends/platform/ds/arm9/source/blitters.cpp4
-rw-r--r--backends/platform/ds/arm9/source/blitters.h4
-rw-r--r--backends/platform/ds/arm9/source/cdaudio.cpp4
-rw-r--r--backends/platform/ds/arm9/source/cdaudio.h4
-rw-r--r--backends/platform/ds/arm9/source/dsmain.cpp4
-rw-r--r--backends/platform/ds/arm9/source/dsmain.h4
-rw-r--r--backends/platform/ds/arm9/source/dsoptions.cpp4
-rw-r--r--backends/platform/ds/arm9/source/dsoptions.h4
-rw-r--r--backends/platform/ds/arm9/source/gbampsave.cpp4
-rw-r--r--backends/platform/ds/arm9/source/gbampsave.h4
-rw-r--r--backends/platform/ds/arm9/source/keys.h4
-rw-r--r--backends/platform/ds/arm9/source/osystem_ds.cpp3
-rw-r--r--backends/platform/ds/arm9/source/osystem_ds.h4
-rw-r--r--backends/platform/ds/arm9/source/portdefs.h4
-rw-r--r--backends/platform/ds/arm9/source/scummhelp.cpp4
-rw-r--r--backends/platform/ds/arm9/source/scummhelp.h4
-rw-r--r--backends/platform/ds/arm9/source/touchkeyboard.cpp3
-rw-r--r--backends/platform/ds/arm9/source/touchkeyboard.h4
-rw-r--r--backends/platform/ds/arm9/source/wordcompletion.cpp4
-rw-r--r--backends/platform/ds/arm9/source/wordcompletion.h4
-rw-r--r--backends/platform/ds/arm9/source/zipreader.cpp4
-rw-r--r--backends/platform/ds/arm9/source/zipreader.h4
-rw-r--r--backends/platform/ds/commoninclude/NDS/scummvm_ipc.h1
-rw-r--r--backends/platform/gph/gph-backend.cpp6
-rw-r--r--backends/platform/gph/gph-hw.cpp4
-rw-r--r--backends/platform/gph/gph-hw.h4
-rw-r--r--backends/platform/gph/gph-main.cpp4
-rw-r--r--backends/platform/gph/gph.h4
-rw-r--r--backends/platform/iphone/iphone_common.h4
-rw-r--r--backends/platform/iphone/iphone_keyboard.h4
-rw-r--r--backends/platform/iphone/iphone_keyboard.mm6
-rw-r--r--backends/platform/iphone/iphone_main.mm4
-rw-r--r--backends/platform/iphone/iphone_video.h5
-rw-r--r--backends/platform/iphone/iphone_video.mm25
-rw-r--r--backends/platform/iphone/osys_events.cpp4
-rw-r--r--backends/platform/iphone/osys_main.cpp4
-rw-r--r--backends/platform/iphone/osys_main.h4
-rw-r--r--backends/platform/iphone/osys_sound.cpp4
-rw-r--r--backends/platform/iphone/osys_video.mm4
-rw-r--r--backends/platform/linuxmoto/hardwarekeys.cpp4
-rw-r--r--backends/platform/linuxmoto/linuxmoto-main.cpp4
-rw-r--r--backends/platform/linuxmoto/linuxmoto-sdl.cpp4
-rw-r--r--backends/platform/linuxmoto/linuxmoto-sdl.h4
-rw-r--r--backends/platform/maemo/maemo-common.h4
-rw-r--r--backends/platform/maemo/maemo.cpp4
-rw-r--r--backends/platform/maemo/maemo.h4
-rw-r--r--backends/platform/maemo/main.cpp4
-rw-r--r--backends/platform/n64/framfs_save_manager.cpp4
-rw-r--r--backends/platform/n64/framfs_save_manager.h4
-rw-r--r--backends/platform/n64/nintendo64.cpp4
-rw-r--r--backends/platform/n64/osys_n64.h4
-rw-r--r--backends/platform/n64/osys_n64_base.cpp4
-rw-r--r--backends/platform/n64/osys_n64_events.cpp4
-rw-r--r--backends/platform/n64/osys_n64_utilities.cpp4
-rw-r--r--backends/platform/n64/pakfs_save_manager.cpp4
-rw-r--r--backends/platform/n64/pakfs_save_manager.h4
-rw-r--r--backends/platform/n64/portdefs.h4
-rw-r--r--backends/platform/null/null.cpp20
-rw-r--r--backends/platform/openpandora/op-backend.cpp6
-rw-r--r--backends/platform/openpandora/op-main.cpp4
-rw-r--r--backends/platform/openpandora/op-options.cpp4
-rw-r--r--backends/platform/openpandora/op-options.h4
-rw-r--r--backends/platform/openpandora/op-sdl.h4
-rw-r--r--backends/platform/ps2/DmaPipe.cpp12
-rw-r--r--backends/platform/ps2/DmaPipe.h4
-rw-r--r--backends/platform/ps2/Gs2dScreen.cpp265
-rw-r--r--backends/platform/ps2/Gs2dScreen.h19
-rw-r--r--backends/platform/ps2/GsDefs.h176
-rw-r--r--backends/platform/ps2/Makefile.gdb104
-rw-r--r--backends/platform/ps2/Makefile.ps2232
-rw-r--r--backends/platform/ps2/Makefile.ps2.dev170
-rw-r--r--backends/platform/ps2/README.PS2189
-rw-r--r--backends/platform/ps2/asyncfio.cpp18
-rw-r--r--backends/platform/ps2/asyncfio.h7
-rw-r--r--backends/platform/ps2/cd.c38
-rw-r--r--backends/platform/ps2/eecodyvdfs.h6
-rw-r--r--backends/platform/ps2/fileio.cpp52
-rw-r--r--backends/platform/ps2/fileio.h18
-rw-r--r--backends/platform/ps2/icon.cpp6
-rw-r--r--backends/platform/ps2/icon.h4
-rw-r--r--backends/platform/ps2/iop/CoDyVDfs/common/codyvdirx.h18
-rw-r--r--backends/platform/ps2/iop/CoDyVDfs/iop/cdtypes.h92
-rw-r--r--backends/platform/ps2/iop/CoDyVDfs/iop/codyvdfs.c72
-rw-r--r--backends/platform/ps2/iop/CoDyVDfs/iop/codyvdfs.h32
-rw-r--r--backends/platform/ps2/iop/CoDyVDfs/iop/fiofs.c12
-rw-r--r--backends/platform/ps2/iop/CoDyVDfs/iop/fiofs.h4
-rw-r--r--backends/platform/ps2/iop/CoDyVDfs/iop/irx_imports.h4
-rw-r--r--backends/platform/ps2/iop/CoDyVDfs/iop/rpcfs.c12
-rw-r--r--backends/platform/ps2/iop/rpckbd/include/ps2kbd.h4
-rw-r--r--backends/platform/ps2/iop/rpckbd/src/irx_imports.h4
-rw-r--r--backends/platform/ps2/iop/rpckbd/src/ps2kbd.c4
-rw-r--r--backends/platform/ps2/irxboot.cpp89
-rw-r--r--backends/platform/ps2/irxboot.h17
-rw-r--r--backends/platform/ps2/module.mk20
-rw-r--r--backends/platform/ps2/ps2debug.cpp7
-rw-r--r--backends/platform/ps2/ps2debug.h12
-rw-r--r--backends/platform/ps2/ps2input.cpp74
-rw-r--r--backends/platform/ps2/ps2input.h6
-rw-r--r--backends/platform/ps2/ps2mutex.cpp4
-rw-r--r--backends/platform/ps2/ps2pad.cpp12
-rw-r--r--backends/platform/ps2/ps2pad.h4
-rw-r--r--backends/platform/ps2/ps2temp.h4
-rw-r--r--backends/platform/ps2/ps2time.cpp10
-rw-r--r--backends/platform/ps2/rpckbd.c2
-rw-r--r--backends/platform/ps2/rpckbd.h4
-rw-r--r--backends/platform/ps2/savefilemgr.cpp37
-rw-r--r--backends/platform/ps2/savefilemgr.h4
-rw-r--r--backends/platform/ps2/sysdefs.h38
-rw-r--r--backends/platform/ps2/systemps2.cpp359
-rw-r--r--backends/platform/ps2/systemps2.h37
-rw-r--r--backends/platform/psp/audio.cpp4
-rw-r--r--backends/platform/psp/audio.h4
-rw-r--r--backends/platform/psp/cursor.cpp4
-rw-r--r--backends/platform/psp/cursor.h4
-rw-r--r--backends/platform/psp/default_display_client.cpp4
-rw-r--r--backends/platform/psp/default_display_client.h4
-rw-r--r--backends/platform/psp/display_client.cpp4
-rw-r--r--backends/platform/psp/display_client.h4
-rw-r--r--backends/platform/psp/display_manager.cpp4
-rw-r--r--backends/platform/psp/display_manager.h4
-rw-r--r--backends/platform/psp/dummy.cpp4
-rw-r--r--backends/platform/psp/image_viewer.cpp4
-rw-r--r--backends/platform/psp/image_viewer.h4
-rw-r--r--backends/platform/psp/input.cpp4
-rw-r--r--backends/platform/psp/input.h4
-rw-r--r--backends/platform/psp/memory.cpp4
-rw-r--r--backends/platform/psp/memory.h4
-rw-r--r--backends/platform/psp/mp3.cpp4
-rw-r--r--backends/platform/psp/mp3.h4
-rw-r--r--backends/platform/psp/osys_psp.cpp4
-rw-r--r--backends/platform/psp/osys_psp.h4
-rw-r--r--backends/platform/psp/png_loader.cpp4
-rw-r--r--backends/platform/psp/png_loader.h4
-rw-r--r--backends/platform/psp/portdefs.h4
-rw-r--r--backends/platform/psp/powerman.cpp4
-rw-r--r--backends/platform/psp/powerman.h4
-rw-r--r--backends/platform/psp/psp_main.cpp4
-rw-r--r--backends/platform/psp/pspkeyboard.cpp4
-rw-r--r--backends/platform/psp/pspkeyboard.h4
-rw-r--r--backends/platform/psp/psppixelformat.cpp4
-rw-r--r--backends/platform/psp/psppixelformat.h4
-rw-r--r--backends/platform/psp/rtc.cpp4
-rw-r--r--backends/platform/psp/rtc.h4
-rw-r--r--backends/platform/psp/tests.cpp4
-rw-r--r--backends/platform/psp/tests.h4
-rw-r--r--backends/platform/psp/thread.cpp4
-rw-r--r--backends/platform/psp/thread.h4
-rw-r--r--backends/platform/psp/trace.cpp4
-rw-r--r--backends/platform/psp/trace.h4
-rw-r--r--backends/platform/samsungtv/main.cpp4
-rw-r--r--backends/platform/samsungtv/samsungtv.cpp4
-rw-r--r--backends/platform/samsungtv/samsungtv.h4
-rw-r--r--backends/platform/sdl/amigaos/amigaos-main.cpp4
-rw-r--r--backends/platform/sdl/amigaos/amigaos.cpp4
-rw-r--r--backends/platform/sdl/amigaos/amigaos.h4
-rw-r--r--backends/platform/sdl/macosx/appmenu_osx.h4
-rw-r--r--backends/platform/sdl/macosx/appmenu_osx.mm4
-rw-r--r--backends/platform/sdl/macosx/macosx-main.cpp4
-rw-r--r--backends/platform/sdl/macosx/macosx.cpp19
-rw-r--r--backends/platform/sdl/macosx/macosx.h5
-rw-r--r--backends/platform/sdl/posix/posix-main.cpp4
-rw-r--r--backends/platform/sdl/posix/posix.cpp19
-rw-r--r--backends/platform/sdl/posix/posix.h4
-rw-r--r--backends/platform/sdl/ps3/ps3-main.cpp4
-rw-r--r--backends/platform/sdl/ps3/ps3.cpp4
-rw-r--r--backends/platform/sdl/ps3/ps3.h4
-rw-r--r--backends/platform/sdl/sdl-sys.h4
-rw-r--r--backends/platform/sdl/sdl.cpp320
-rw-r--r--backends/platform/sdl/sdl.h19
-rw-r--r--backends/platform/sdl/win32/win32-main.cpp4
-rw-r--r--backends/platform/sdl/win32/win32.cpp4
-rw-r--r--backends/platform/sdl/win32/win32.h4
-rw-r--r--backends/platform/symbian/AdaptAllMMPs.pl81
-rw-r--r--backends/platform/symbian/BuildPackageUpload_AllVersions.pl8
-rw-r--r--backends/platform/symbian/BuildPackageUpload_LocalSettings.pl119
-rw-r--r--backends/platform/symbian/README14
-rw-r--r--backends/platform/symbian/S60/ScummVM_S60.mmp.in2
-rw-r--r--backends/platform/symbian/S60/ScummVM_S60_App.mmp2
-rw-r--r--backends/platform/symbian/S60v3/BLD.INF.in1
-rw-r--r--backends/platform/symbian/S60v3/ScummVM_A0000658_S60v3.mmp.in8
-rw-r--r--backends/platform/symbian/S60v3/ScummVM_S60v3.mmp.in11
-rw-r--r--backends/platform/symbian/S60v3/scummvm-CVS-SymbianS60v3.pkg16
-rw-r--r--backends/platform/symbian/S60v3/scummvm-CVS-SymbianS60v3_split.pkg18
-rw-r--r--backends/platform/symbian/S80/ScummVM_S80.mmp.in2
-rw-r--r--backends/platform/symbian/S80/ScummVM_S80_App.mmp2
-rw-r--r--backends/platform/symbian/S90/Scummvm_S90.mmp.in2
-rw-r--r--backends/platform/symbian/S90/Scummvm_S90_App.mmp2
-rw-r--r--backends/platform/symbian/UIQ2/ScummVM.rss2
-rw-r--r--backends/platform/symbian/UIQ2/ScummVM_UIQ2.mmp.in2
-rw-r--r--backends/platform/symbian/UIQ3/ScummVM.rss2
-rw-r--r--backends/platform/symbian/UIQ3/ScummVM_A0000658.rss2
-rw-r--r--backends/platform/symbian/UIQ3/ScummVM_A0000658_UIQ3.mmp.in5
-rw-r--r--backends/platform/symbian/UIQ3/ScummVM_UIQ3.mmp.in5
-rw-r--r--backends/platform/symbian/UIQ3/scummvm-CVS-SymbianUIQ3.pkg2
-rw-r--r--backends/platform/symbian/UIQ3/scummvm-CVS-SymbianUIQ3_split.pkg2
-rw-r--r--backends/platform/symbian/UIQ3/scummvm_A0000658_loc.rss2
-rw-r--r--backends/platform/symbian/help/Custom.xml18
-rw-r--r--backends/platform/symbian/help/ScummVM.rtf341
-rw-r--r--backends/platform/symbian/help/ScummVM.xml19
-rw-r--r--backends/platform/symbian/help/build_help.mk29
-rw-r--r--backends/platform/symbian/mmp/scummvm_agi.mmp.in12
-rw-r--r--backends/platform/symbian/mmp/scummvm_agos.mmp.in12
-rw-r--r--backends/platform/symbian/mmp/scummvm_avalanche.mmp.in72
-rw-r--r--backends/platform/symbian/mmp/scummvm_base.mmp.in27
-rw-r--r--backends/platform/symbian/mmp/scummvm_bbvs.mmp.in72
-rw-r--r--backends/platform/symbian/mmp/scummvm_cge.mmp.in12
-rw-r--r--backends/platform/symbian/mmp/scummvm_cine.mmp.in13
-rw-r--r--backends/platform/symbian/mmp/scummvm_composer.mmp.in12
-rw-r--r--backends/platform/symbian/mmp/scummvm_cruise.mmp.in13
-rw-r--r--backends/platform/symbian/mmp/scummvm_draci.mmp.in12
-rw-r--r--backends/platform/symbian/mmp/scummvm_drascula.mmp.in13
-rw-r--r--backends/platform/symbian/mmp/scummvm_dreamweb.mmp.in72
-rw-r--r--backends/platform/symbian/mmp/scummvm_fullpipe.mmp.in72
-rw-r--r--backends/platform/symbian/mmp/scummvm_gob.mmp.in13
-rw-r--r--backends/platform/symbian/mmp/scummvm_groovie.mmp.in13
-rw-r--r--backends/platform/symbian/mmp/scummvm_hopkins.mmp.in12
-rw-r--r--backends/platform/symbian/mmp/scummvm_hugo.mmp.in12
-rw-r--r--backends/platform/symbian/mmp/scummvm_kyra.mmp.in20
-rw-r--r--backends/platform/symbian/mmp/scummvm_lastexpress.mmp.in12
-rw-r--r--backends/platform/symbian/mmp/scummvm_lure.mmp.in13
-rw-r--r--backends/platform/symbian/mmp/scummvm_m4.mmp.in12
-rw-r--r--backends/platform/symbian/mmp/scummvm_made.mmp.in13
-rw-r--r--backends/platform/symbian/mmp/scummvm_mads.mmp.in72
-rw-r--r--backends/platform/symbian/mmp/scummvm_mohawk.mmp.in31
-rw-r--r--backends/platform/symbian/mmp/scummvm_mortevielle.mmp.in72
-rw-r--r--backends/platform/symbian/mmp/scummvm_neverhood.mmp.in71
-rw-r--r--backends/platform/symbian/mmp/scummvm_parallaction.mmp.in12
-rw-r--r--backends/platform/symbian/mmp/scummvm_pegasus.mmp.in12
-rw-r--r--backends/platform/symbian/mmp/scummvm_queen.mmp.in13
-rw-r--r--backends/platform/symbian/mmp/scummvm_saga.mmp.in13
-rw-r--r--backends/platform/symbian/mmp/scummvm_sci.mmp.in20
-rw-r--r--backends/platform/symbian/mmp/scummvm_scumm.mmp.in7
-rw-r--r--backends/platform/symbian/mmp/scummvm_sky.mmp.in13
-rw-r--r--backends/platform/symbian/mmp/scummvm_sword1.mmp.in13
-rw-r--r--backends/platform/symbian/mmp/scummvm_sword2.mmp.in13
-rw-r--r--backends/platform/symbian/mmp/scummvm_sword25.mmp.in73
-rw-r--r--backends/platform/symbian/mmp/scummvm_teenagent.mmp.in12
-rw-r--r--backends/platform/symbian/mmp/scummvm_testbed.mmp.in72
-rw-r--r--backends/platform/symbian/mmp/scummvm_tinsel.mmp.in13
-rw-r--r--backends/platform/symbian/mmp/scummvm_toltecs.mmp.in12
-rw-r--r--backends/platform/symbian/mmp/scummvm_tony.mmp.in12
-rw-r--r--backends/platform/symbian/mmp/scummvm_toon.mmp.in12
-rw-r--r--backends/platform/symbian/mmp/scummvm_touche.mmp.in12
-rw-r--r--backends/platform/symbian/mmp/scummvm_tsage.mmp.in15
-rw-r--r--backends/platform/symbian/mmp/scummvm_tucker.mmp.in12
-rw-r--r--backends/platform/symbian/mmp/scummvm_voyeur.mmp.in71
-rw-r--r--backends/platform/symbian/mmp/scummvm_wintermute.mmp.in15
-rw-r--r--backends/platform/symbian/mmp/scummvm_zvision.mmp.in71
-rw-r--r--backends/platform/symbian/res/ScummVmAif.rss2
-rw-r--r--backends/platform/symbian/res/scummvm.rss2
-rw-r--r--backends/platform/symbian/res/scummvm_A0000658.rss2
-rw-r--r--backends/platform/symbian/src/ScummApp.cpp1
-rw-r--r--backends/platform/symbian/src/ScummApp.h1
-rw-r--r--backends/platform/symbian/src/ScummVm.hrh2
-rw-r--r--backends/platform/symbian/src/SymbianActions.cpp4
-rw-r--r--backends/platform/symbian/src/SymbianActions.h4
-rw-r--r--backends/platform/symbian/src/SymbianMain.cpp4
-rw-r--r--backends/platform/symbian/src/SymbianOS.cpp6
-rw-r--r--backends/platform/symbian/src/SymbianOS.h1
-rw-r--r--backends/platform/symbian/src/portdefs.h3
-rw-r--r--backends/platform/tizen/application.cpp2
-rw-r--r--backends/platform/tizen/application.h2
-rw-r--r--backends/platform/tizen/audio.cpp2
-rw-r--r--backends/platform/tizen/audio.h2
-rw-r--r--backends/platform/tizen/form.cpp2
-rw-r--r--backends/platform/tizen/form.h2
-rw-r--r--backends/platform/tizen/fs.cpp3
-rw-r--r--backends/platform/tizen/fs.h3
-rw-r--r--backends/platform/tizen/graphics.cpp109
-rw-r--r--backends/platform/tizen/graphics.h23
-rw-r--r--backends/platform/tizen/main.cpp2
-rw-r--r--backends/platform/tizen/missing.cpp2
-rw-r--r--backends/platform/tizen/portdefs.h2
-rw-r--r--backends/platform/tizen/sscanf.cpp2
-rw-r--r--backends/platform/tizen/system.cpp6
-rw-r--r--backends/platform/tizen/system.h4
-rw-r--r--backends/platform/webos/main.cpp4
-rw-r--r--backends/platform/webos/webos.cpp4
-rw-r--r--backends/platform/webos/webos.h4
-rw-r--r--backends/platform/wii/main.cpp8
-rw-r--r--backends/platform/wii/options.cpp2
-rw-r--r--backends/platform/wii/options.h2
-rw-r--r--backends/platform/wii/osystem.cpp5
-rw-r--r--backends/platform/wii/osystem.h5
-rw-r--r--backends/platform/wii/osystem_events.cpp7
-rw-r--r--backends/platform/wii/osystem_gfx.cpp9
-rw-r--r--backends/platform/wii/osystem_sfx.cpp5
-rw-r--r--backends/platform/wii/wii.mk4
-rw-r--r--backends/platform/wince/CEActionsPocket.cpp6
-rw-r--r--backends/platform/wince/CEActionsPocket.h4
-rw-r--r--backends/platform/wince/CEActionsSmartphone.cpp6
-rw-r--r--backends/platform/wince/CEActionsSmartphone.h4
-rw-r--r--backends/platform/wince/CEDevice.cpp4
-rw-r--r--backends/platform/wince/CEDevice.h4
-rw-r--r--backends/platform/wince/CEException.cpp4
-rw-r--r--backends/platform/wince/CEException.h4
-rw-r--r--backends/platform/wince/CELauncherDialog.cpp8
-rw-r--r--backends/platform/wince/CELauncherDialog.h4
-rw-r--r--backends/platform/wince/CEScaler.cpp4
-rw-r--r--backends/platform/wince/CEScaler.h4
-rw-r--r--backends/platform/wince/CEgui/CEGUI.h4
-rw-r--r--backends/platform/wince/CEgui/GUIElement.cpp4
-rw-r--r--backends/platform/wince/CEgui/GUIElement.h4
-rw-r--r--backends/platform/wince/CEgui/ItemAction.cpp4
-rw-r--r--backends/platform/wince/CEgui/ItemAction.h4
-rw-r--r--backends/platform/wince/CEgui/ItemSwitch.cpp4
-rw-r--r--backends/platform/wince/CEgui/ItemSwitch.h4
-rw-r--r--backends/platform/wince/CEgui/Panel.cpp4
-rw-r--r--backends/platform/wince/CEgui/Panel.h4
-rw-r--r--backends/platform/wince/CEgui/PanelItem.cpp4
-rw-r--r--backends/platform/wince/CEgui/PanelItem.h4
-rw-r--r--backends/platform/wince/CEgui/PanelKeyboard.cpp4
-rw-r--r--backends/platform/wince/CEgui/PanelKeyboard.h4
-rw-r--r--backends/platform/wince/CEgui/SDL_ImageResource.cpp4
-rw-r--r--backends/platform/wince/CEgui/SDL_ImageResource.h4
-rw-r--r--backends/platform/wince/CEgui/Toolbar.cpp4
-rw-r--r--backends/platform/wince/CEgui/Toolbar.h4
-rw-r--r--backends/platform/wince/CEgui/ToolbarHandler.cpp4
-rw-r--r--backends/platform/wince/CEgui/ToolbarHandler.h4
-rw-r--r--backends/platform/wince/CEkeys/CEKeys.h4
-rw-r--r--backends/platform/wince/CEkeys/EventsBuffer.cpp4
-rw-r--r--backends/platform/wince/CEkeys/EventsBuffer.h4
-rw-r--r--backends/platform/wince/missing/missing.cpp4
-rw-r--r--backends/platform/wince/portdefs.h4
-rw-r--r--backends/platform/wince/stub.cpp4
-rw-r--r--backends/platform/wince/wince-sdl.cpp18
-rw-r--r--backends/platform/wince/wince-sdl.h4
-rw-r--r--backends/plugins/ds/ds-provider.cpp4
-rw-r--r--backends/plugins/ds/ds-provider.h4
-rw-r--r--backends/plugins/dynamic-plugin.h4
-rw-r--r--backends/plugins/elf/arm-loader.cpp4
-rw-r--r--backends/plugins/elf/arm-loader.h4
-rw-r--r--backends/plugins/elf/elf-loader.cpp4
-rw-r--r--backends/plugins/elf/elf-loader.h4
-rw-r--r--backends/plugins/elf/elf-provider.cpp4
-rw-r--r--backends/plugins/elf/elf-provider.h4
-rw-r--r--backends/plugins/elf/elf32.h4
-rw-r--r--backends/plugins/elf/memory-manager.cpp4
-rw-r--r--backends/plugins/elf/memory-manager.h4
-rw-r--r--backends/plugins/elf/mips-loader.cpp4
-rw-r--r--backends/plugins/elf/mips-loader.h4
-rw-r--r--backends/plugins/elf/ppc-loader.cpp4
-rw-r--r--backends/plugins/elf/ppc-loader.h4
-rw-r--r--backends/plugins/elf/shorts-segment-manager.cpp4
-rw-r--r--backends/plugins/elf/shorts-segment-manager.h4
-rw-r--r--backends/plugins/elf/version.cpp12
-rw-r--r--backends/plugins/elf/version.h1
-rw-r--r--backends/plugins/posix/posix-provider.cpp4
-rw-r--r--backends/plugins/posix/posix-provider.h4
-rw-r--r--backends/plugins/ps2/ps2-provider.cpp4
-rw-r--r--backends/plugins/ps2/ps2-provider.h4
-rw-r--r--backends/plugins/psp/psp-provider.cpp4
-rw-r--r--backends/plugins/psp/psp-provider.h4
-rw-r--r--backends/plugins/sdl/sdl-provider.cpp4
-rw-r--r--backends/plugins/sdl/sdl-provider.h4
-rw-r--r--backends/plugins/wii/wii-provider.cpp4
-rw-r--r--backends/plugins/wii/wii-provider.h4
-rw-r--r--backends/plugins/win32/win32-provider.cpp4
-rw-r--r--backends/plugins/win32/win32-provider.h4
-rw-r--r--backends/saves/default/default-saves.cpp4
-rw-r--r--backends/saves/default/default-saves.h4
-rw-r--r--backends/saves/posix/posix-saves.cpp4
-rw-r--r--backends/saves/posix/posix-saves.h4
-rw-r--r--backends/saves/psp/psp-saves.cpp4
-rw-r--r--backends/saves/psp/psp-saves.h4
-rw-r--r--backends/saves/recorder/recorder-saves.cpp4
-rw-r--r--backends/saves/recorder/recorder-saves.h4
-rw-r--r--backends/saves/savefile.cpp4
-rw-r--r--backends/saves/windows/windows-saves.cpp4
-rw-r--r--backends/saves/windows/windows-saves.h4
-rw-r--r--backends/taskbar/macosx/macosx-taskbar.h57
-rw-r--r--backends/taskbar/macosx/macosx-taskbar.mm238
-rw-r--r--backends/taskbar/unity/unity-taskbar.cpp2
-rw-r--r--backends/taskbar/unity/unity-taskbar.h2
-rw-r--r--backends/timer/default/default-timer.cpp1
-rw-r--r--backends/timer/default/default-timer.h1
-rw-r--r--backends/timer/psp/timer.cpp4
-rw-r--r--backends/timer/psp/timer.h4
-rw-r--r--backends/timer/sdl/sdl-timer.cpp4
-rw-r--r--backends/timer/sdl/sdl-timer.h4
-rw-r--r--backends/timer/tizen/timer.cpp2
-rw-r--r--backends/timer/tizen/timer.h2
-rw-r--r--backends/updates/macosx/macosx-updates.h4
-rw-r--r--backends/updates/macosx/macosx-updates.mm4
-rw-r--r--backends/vkeybd/virtual-keyboard-gui.cpp40
-rw-r--r--backends/vkeybd/virtual-keyboard-gui.h40
-rw-r--r--backends/vkeybd/virtual-keyboard-parser.cpp4
580 files changed, 7631 insertions, 4471 deletions
diff --git a/backends/audiocd/audiocd.h b/backends/audiocd/audiocd.h
index 76c3998862..db9a15505a 100644
--- a/backends/audiocd/audiocd.h
+++ b/backends/audiocd/audiocd.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/audiocd/default/default-audiocd.cpp b/backends/audiocd/default/default-audiocd.cpp
index 819b9c4522..abf80ac4cd 100644
--- a/backends/audiocd/default/default-audiocd.cpp
+++ b/backends/audiocd/default/default-audiocd.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/audiocd/default/default-audiocd.h b/backends/audiocd/default/default-audiocd.h
index 1971ed8f6e..9e4ba6b33e 100644
--- a/backends/audiocd/default/default-audiocd.h
+++ b/backends/audiocd/default/default-audiocd.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/audiocd/sdl/sdl-audiocd.cpp b/backends/audiocd/sdl/sdl-audiocd.cpp
index b5f97571f3..5093c03a1c 100644
--- a/backends/audiocd/sdl/sdl-audiocd.cpp
+++ b/backends/audiocd/sdl/sdl-audiocd.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/audiocd/sdl/sdl-audiocd.h b/backends/audiocd/sdl/sdl-audiocd.h
index 85bde353df..ff98fcdd77 100644
--- a/backends/audiocd/sdl/sdl-audiocd.h
+++ b/backends/audiocd/sdl/sdl-audiocd.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/base-backend.h b/backends/base-backend.h
index c797e831a8..598f682b32 100644
--- a/backends/base-backend.h
+++ b/backends/base-backend.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/events/default/default-events.cpp b/backends/events/default/default-events.cpp
index 30f3b3790c..c7c39da069 100644
--- a/backends/events/default/default-events.cpp
+++ b/backends/events/default/default-events.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/events/default/default-events.h b/backends/events/default/default-events.h
index 4d89b78861..f378fb9ff0 100644
--- a/backends/events/default/default-events.h
+++ b/backends/events/default/default-events.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/events/dinguxsdl/dinguxsdl-events.cpp b/backends/events/dinguxsdl/dinguxsdl-events.cpp
index 64d8fbeb62..46089a4fcd 100644
--- a/backends/events/dinguxsdl/dinguxsdl-events.cpp
+++ b/backends/events/dinguxsdl/dinguxsdl-events.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/events/dinguxsdl/dinguxsdl-events.h b/backends/events/dinguxsdl/dinguxsdl-events.h
index b348bafa78..0ed0a9923e 100644
--- a/backends/events/dinguxsdl/dinguxsdl-events.h
+++ b/backends/events/dinguxsdl/dinguxsdl-events.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/events/gph/gph-events.cpp b/backends/events/gph/gph-events.cpp
index 91118d36c1..90b6a2a29d 100644
--- a/backends/events/gph/gph-events.cpp
+++ b/backends/events/gph/gph-events.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/events/gph/gph-events.h b/backends/events/gph/gph-events.h
index 3b1e6f090a..507aa94828 100644
--- a/backends/events/gph/gph-events.h
+++ b/backends/events/gph/gph-events.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/events/linuxmotosdl/linuxmotosdl-events.cpp b/backends/events/linuxmotosdl/linuxmotosdl-events.cpp
index 5d9f032e19..ce34662612 100644
--- a/backends/events/linuxmotosdl/linuxmotosdl-events.cpp
+++ b/backends/events/linuxmotosdl/linuxmotosdl-events.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/events/linuxmotosdl/linuxmotosdl-events.h b/backends/events/linuxmotosdl/linuxmotosdl-events.h
index 7b0c8fcc73..87eab3ffaa 100644
--- a/backends/events/linuxmotosdl/linuxmotosdl-events.h
+++ b/backends/events/linuxmotosdl/linuxmotosdl-events.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/events/maemosdl/maemosdl-events.cpp b/backends/events/maemosdl/maemosdl-events.cpp
index dcdf0384e3..5045363286 100644
--- a/backends/events/maemosdl/maemosdl-events.cpp
+++ b/backends/events/maemosdl/maemosdl-events.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -188,7 +188,7 @@ bool MaemoSdlEventSource::handleMouseButtonUp(SDL_Event &ev, Common::Event &even
bool MaemoSdlEventSource::toggleClickMode() {
_clickEnabled = !_clickEnabled;
- ((SurfaceSdlGraphicsManager *) _graphicsManager)->displayMessageOnOSD(
+ _graphicsManager->displayMessageOnOSD(
_clickEnabled ? _("Clicking Enabled") : _("Clicking Disabled"));
return _clickEnabled;
diff --git a/backends/events/maemosdl/maemosdl-events.h b/backends/events/maemosdl/maemosdl-events.h
index f3f05feeca..6024031249 100644
--- a/backends/events/maemosdl/maemosdl-events.h
+++ b/backends/events/maemosdl/maemosdl-events.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/events/openpandora/op-events.cpp b/backends/events/openpandora/op-events.cpp
index fc63cdf74f..b9d5fa8c7b 100644
--- a/backends/events/openpandora/op-events.cpp
+++ b/backends/events/openpandora/op-events.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/events/openpandora/op-events.h b/backends/events/openpandora/op-events.h
index 25f79e68d7..e45ac80e2a 100644
--- a/backends/events/openpandora/op-events.h
+++ b/backends/events/openpandora/op-events.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/events/ps3sdl/ps3sdl-events.cpp b/backends/events/ps3sdl/ps3sdl-events.cpp
index 723942af11..1a854436f1 100644
--- a/backends/events/ps3sdl/ps3sdl-events.cpp
+++ b/backends/events/ps3sdl/ps3sdl-events.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/events/ps3sdl/ps3sdl-events.h b/backends/events/ps3sdl/ps3sdl-events.h
index 8cf2f43426..d28ce7fcf8 100644
--- a/backends/events/ps3sdl/ps3sdl-events.h
+++ b/backends/events/ps3sdl/ps3sdl-events.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/events/samsungtvsdl/samsungtvsdl-events.cpp b/backends/events/samsungtvsdl/samsungtvsdl-events.cpp
index 5e3659839a..f5b919a060 100644
--- a/backends/events/samsungtvsdl/samsungtvsdl-events.cpp
+++ b/backends/events/samsungtvsdl/samsungtvsdl-events.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/events/samsungtvsdl/samsungtvsdl-events.h b/backends/events/samsungtvsdl/samsungtvsdl-events.h
index 4b9ccc9bf8..be3dfef8fd 100644
--- a/backends/events/samsungtvsdl/samsungtvsdl-events.h
+++ b/backends/events/samsungtvsdl/samsungtvsdl-events.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/events/sdl/sdl-events.cpp b/backends/events/sdl/sdl-events.cpp
index e2ef7f6bf6..2480e7c370 100644
--- a/backends/events/sdl/sdl-events.cpp
+++ b/backends/events/sdl/sdl-events.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -391,8 +391,17 @@ bool SdlEventSource::dispatchSDLEvent(SDL_Event &ev, Common::Event &event) {
return false;
case SDL_VIDEORESIZE:
- if (_graphicsManager)
+ if (_graphicsManager) {
_graphicsManager->notifyResize(ev.resize.w, ev.resize.h);
+
+ // If the screen changed, send an Common::EVENT_SCREEN_CHANGED
+ int screenID = ((OSystem_SDL *)g_system)->getGraphicsManager()->getScreenChangeID();
+ if (screenID != _lastScreenID) {
+ _lastScreenID = screenID;
+ event.type = Common::EVENT_SCREEN_CHANGED;
+ return true;
+ }
+ }
return false;
case SDL_QUIT:
diff --git a/backends/events/sdl/sdl-events.h b/backends/events/sdl/sdl-events.h
index ca4835126f..a1b6d5ec3c 100644
--- a/backends/events/sdl/sdl-events.h
+++ b/backends/events/sdl/sdl-events.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/events/symbiansdl/symbiansdl-events.cpp b/backends/events/symbiansdl/symbiansdl-events.cpp
index 308621e697..36018f1024 100644
--- a/backends/events/symbiansdl/symbiansdl-events.cpp
+++ b/backends/events/symbiansdl/symbiansdl-events.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/events/symbiansdl/symbiansdl-events.h b/backends/events/symbiansdl/symbiansdl-events.h
index 66c0b451eb..2664bc267d 100644
--- a/backends/events/symbiansdl/symbiansdl-events.h
+++ b/backends/events/symbiansdl/symbiansdl-events.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/events/webossdl/webossdl-events.cpp b/backends/events/webossdl/webossdl-events.cpp
index 286289f7a6..72106789a5 100644
--- a/backends/events/webossdl/webossdl-events.cpp
+++ b/backends/events/webossdl/webossdl-events.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/events/webossdl/webossdl-events.h b/backends/events/webossdl/webossdl-events.h
index 1ba5c6fcbf..043acfdf6f 100644
--- a/backends/events/webossdl/webossdl-events.h
+++ b/backends/events/webossdl/webossdl-events.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/events/wincesdl/wincesdl-events.cpp b/backends/events/wincesdl/wincesdl-events.cpp
index e73a4e66dd..d3141ee50c 100644
--- a/backends/events/wincesdl/wincesdl-events.cpp
+++ b/backends/events/wincesdl/wincesdl-events.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/events/wincesdl/wincesdl-events.h b/backends/events/wincesdl/wincesdl-events.h
index 5eff630c2a..38327681a5 100644
--- a/backends/events/wincesdl/wincesdl-events.h
+++ b/backends/events/wincesdl/wincesdl-events.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/fs/abstract-fs.cpp b/backends/fs/abstract-fs.cpp
index 372c7423dd..c3991ee8f4 100644
--- a/backends/fs/abstract-fs.cpp
+++ b/backends/fs/abstract-fs.cpp
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#include "backends/fs/abstract-fs.h"
diff --git a/backends/fs/abstract-fs.h b/backends/fs/abstract-fs.h
index 2b66a6e6e1..34a8120caa 100644
--- a/backends/fs/abstract-fs.h
+++ b/backends/fs/abstract-fs.h
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#ifndef BACKENDS_ABSTRACT_FS_H
diff --git a/backends/fs/amigaos4/amigaos4-fs-factory.cpp b/backends/fs/amigaos4/amigaos4-fs-factory.cpp
index a62b581f39..4ca65e53a5 100644
--- a/backends/fs/amigaos4/amigaos4-fs-factory.cpp
+++ b/backends/fs/amigaos4/amigaos4-fs-factory.cpp
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#if defined(__amigaos4__)
diff --git a/backends/fs/amigaos4/amigaos4-fs-factory.h b/backends/fs/amigaos4/amigaos4-fs-factory.h
index 0390e85072..432caf6fcf 100644
--- a/backends/fs/amigaos4/amigaos4-fs-factory.h
+++ b/backends/fs/amigaos4/amigaos4-fs-factory.h
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#ifndef AMIGAOS_FILESYSTEM_FACTORY_H
diff --git a/backends/fs/amigaos4/amigaos4-fs.cpp b/backends/fs/amigaos4/amigaos4-fs.cpp
index fe388c2a6e..5a66cdaa2f 100644
--- a/backends/fs/amigaos4/amigaos4-fs.cpp
+++ b/backends/fs/amigaos4/amigaos4-fs.cpp
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#if defined(__amigaos4__)
@@ -81,6 +82,7 @@ AmigaOSFilesystemNode::AmigaOSFilesystemNode(const Common::String &p) {
_sDisplayName = ::lastPathComponent(_sPath);
_pFileLock = 0;
_bIsDirectory = false;
+ _bIsValid = false;
// Check whether the node exists and if it is a directory
struct ExamineData * pExd = IDOS->ExamineObjectTags(EX_StringNameInput,_sPath.c_str(),TAG_END);
@@ -305,12 +307,6 @@ bool AmigaOSFilesystemNode::getChildren(AbstractFSList &myList, ListMode mode, b
AbstractFSNode *AmigaOSFilesystemNode::getParent() const {
ENTER();
- if (!_bIsDirectory) {
- debug(6, "Not a directory");
- LEAVE();
- return 0;
- }
-
if (_pFileLock == 0) {
debug(6, "Root node");
LEAVE();
@@ -332,19 +328,25 @@ AbstractFSNode *AmigaOSFilesystemNode::getParent() const {
}
bool AmigaOSFilesystemNode::isReadable() const {
+ if (!_bIsValid)
+ return false;
+
// Regular RWED protection flags are low-active or inverted, thus the negation.
// moreover pseudo root filesystem (null _pFileLock) is readable whatever the
// protection says
- bool readable = !(_nProt & EXDF_READ) || _pFileLock == 0;
+ bool readable = !(_nProt & EXDF_OTR_READ) || _pFileLock == 0;
return readable;
}
bool AmigaOSFilesystemNode::isWritable() const {
+ if (!_bIsValid)
+ return false;
+
// Regular RWED protection flags are low-active or inverted, thus the negation.
// moreover pseudo root filesystem (null _pFileLock) is never writable whatever
// the protection says (because of the pseudo nature)
- bool writable = !(_nProt & EXDF_WRITE) && _pFileLock !=0;
+ bool writable = !(_nProt & EXDF_OTR_WRITE) && _pFileLock !=0;
return writable;
}
@@ -367,8 +369,14 @@ AbstractFSList AmigaOSFilesystemNode::listVolumes() const {
dosList = IDOS->NextDosEntry(dosList, LDF_VOLUMES);
while (dosList) {
if (dosList->dol_Type == DLT_VOLUME &&
- dosList->dol_Name &&
- dosList->dol_Task) {
+ dosList->dol_Name) {
+
+ // Original was
+ // dosList->dol_Name &&
+ // dosList->dol_Task) {
+ // which errored using SDK 53.24 with a 'struct dosList' has no member called 'dol_Task'
+ // I removed dol_Task because it's not used anywhere else
+ // and it neither brought up further errors nor crashes or regressions.
// Copy name to buffer
IDOS->CopyStringBSTRToC(dosList->dol_Name, buffer, MAXPATHLEN);
diff --git a/backends/fs/amigaos4/amigaos4-fs.h b/backends/fs/amigaos4/amigaos4-fs.h
index c5ca61476f..bbe88b2716 100644
--- a/backends/fs/amigaos4/amigaos4-fs.h
+++ b/backends/fs/amigaos4/amigaos4-fs.h
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#ifndef AMIGAOS_FILESYSTEM_H
@@ -43,7 +44,13 @@
*/
class AmigaOSFilesystemNode : public AbstractFSNode {
protected:
+ /**
+ * The main file lock.
+ * If this is NULL but _bIsValid is true, then this Node references
+ * the virtual filesystem root.
+ */
BPTR _pFileLock;
+
Common::String _sDisplayName;
Common::String _sPath;
bool _bIsDirectory;
diff --git a/backends/fs/ds/ds-fs-factory.cpp b/backends/fs/ds/ds-fs-factory.cpp
index 4e09c3446b..98c522f1d6 100644
--- a/backends/fs/ds/ds-fs-factory.cpp
+++ b/backends/fs/ds/ds-fs-factory.cpp
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
// Disable symbol overrides for FILE as that is used in FLAC headers
diff --git a/backends/fs/ds/ds-fs-factory.h b/backends/fs/ds/ds-fs-factory.h
index ed5804b94a..7c42145518 100644
--- a/backends/fs/ds/ds-fs-factory.h
+++ b/backends/fs/ds/ds-fs-factory.h
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#ifndef DS_FILESYSTEM_FACTORY_H
diff --git a/backends/fs/ds/ds-fs.cpp b/backends/fs/ds/ds-fs.cpp
index e3f282df05..3782caf432 100644
--- a/backends/fs/ds/ds-fs.cpp
+++ b/backends/fs/ds/ds-fs.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/fs/ds/ds-fs.h b/backends/fs/ds/ds-fs.h
index 862f4c39d2..b9ccfcbe9c 100644
--- a/backends/fs/ds/ds-fs.h
+++ b/backends/fs/ds/ds-fs.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/fs/fs-factory.h b/backends/fs/fs-factory.h
index 6d378955ec..fce82a9847 100644
--- a/backends/fs/fs-factory.h
+++ b/backends/fs/fs-factory.h
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#ifndef FILESYSTEM_FACTORY_H
diff --git a/backends/fs/n64/n64-fs-factory.cpp b/backends/fs/n64/n64-fs-factory.cpp
index 5c588c5eb5..e662d6fd9b 100644
--- a/backends/fs/n64/n64-fs-factory.cpp
+++ b/backends/fs/n64/n64-fs-factory.cpp
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#ifdef __N64__
diff --git a/backends/fs/n64/n64-fs-factory.h b/backends/fs/n64/n64-fs-factory.h
index 5dec7c7eab..0a6ac8f41e 100644
--- a/backends/fs/n64/n64-fs-factory.h
+++ b/backends/fs/n64/n64-fs-factory.h
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#ifndef N64_FILESYSTEM_FACTORY_H
diff --git a/backends/fs/n64/n64-fs.h b/backends/fs/n64/n64-fs.h
index d177cae9b4..d503a6601e 100644
--- a/backends/fs/n64/n64-fs.h
+++ b/backends/fs/n64/n64-fs.h
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#ifndef N64_FILESYSTEM_H
diff --git a/backends/fs/n64/romfsstream.cpp b/backends/fs/n64/romfsstream.cpp
index 570f25932d..8661f8e9ab 100644
--- a/backends/fs/n64/romfsstream.cpp
+++ b/backends/fs/n64/romfsstream.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/fs/n64/romfsstream.h b/backends/fs/n64/romfsstream.h
index b0f27db13e..7c64bce3f3 100644
--- a/backends/fs/n64/romfsstream.h
+++ b/backends/fs/n64/romfsstream.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/fs/posix/posix-fs-factory.cpp b/backends/fs/posix/posix-fs-factory.cpp
index 776ea86155..d6266c78c9 100644
--- a/backends/fs/posix/posix-fs-factory.cpp
+++ b/backends/fs/posix/posix-fs-factory.cpp
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#if defined(POSIX) || defined(PLAYSTATION3)
diff --git a/backends/fs/posix/posix-fs-factory.h b/backends/fs/posix/posix-fs-factory.h
index c7cec6fab5..7aedde5b01 100644
--- a/backends/fs/posix/posix-fs-factory.h
+++ b/backends/fs/posix/posix-fs-factory.h
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#ifndef POSIX_FILESYSTEM_FACTORY_H
diff --git a/backends/fs/posix/posix-fs.cpp b/backends/fs/posix/posix-fs.cpp
index 320c5a6f39..4baf9f14fe 100644
--- a/backends/fs/posix/posix-fs.cpp
+++ b/backends/fs/posix/posix-fs.cpp
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#if defined(POSIX) || defined(PLAYSTATION3)
diff --git a/backends/fs/posix/posix-fs.h b/backends/fs/posix/posix-fs.h
index e124829c02..bd07749010 100644
--- a/backends/fs/posix/posix-fs.h
+++ b/backends/fs/posix/posix-fs.h
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#ifndef POSIX_FILESYSTEM_H
diff --git a/backends/fs/ps2/ps2-fs-factory.cpp b/backends/fs/ps2/ps2-fs-factory.cpp
index ef7b2013a3..9c12d27a6e 100644
--- a/backends/fs/ps2/ps2-fs-factory.cpp
+++ b/backends/fs/ps2/ps2-fs-factory.cpp
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#if defined(__PLAYSTATION2__)
diff --git a/backends/fs/ps2/ps2-fs-factory.h b/backends/fs/ps2/ps2-fs-factory.h
index 9c6709cccf..d6745a64d3 100644
--- a/backends/fs/ps2/ps2-fs-factory.h
+++ b/backends/fs/ps2/ps2-fs-factory.h
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#ifndef PS2_FILESYSTEM_FACTORY_H
diff --git a/backends/fs/ps2/ps2-fs.cpp b/backends/fs/ps2/ps2-fs.cpp
index 3a86cb3d9c..9b6e1270f1 100644
--- a/backends/fs/ps2/ps2-fs.cpp
+++ b/backends/fs/ps2/ps2-fs.cpp
@@ -17,13 +17,14 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#if defined(__PLAYSTATION2__)
-// Disable symbol overrides so that we can use system headers.
-#define FORBIDDEN_SYMBOL_ALLOW_ALL
-
+// Disable symbol overrides so that we can use "FILE"
+#define FORBIDDEN_SYMBOL_EXCEPTION_FILE
+#define FORBIDDEN_SYMBOL_EXCEPTION_printf
#include "backends/fs/ps2/ps2-fs.h"
@@ -57,13 +58,13 @@ const char *_lastPathComponent(const Common::String &str) {
cur++;
- // printf("lastPathComponent path=%s token=%s\n", start, cur);
+ // dbg_printf("lastPathComponent path=%s token=%s\n", start, cur);
return cur;
}
Ps2FilesystemNode::Ps2FilesystemNode() {
- printf("NEW FSNODE()\n");
+ dbg_printf("NEW FSNODE()\n");
_isHere = true;
_isDirectory = true;
@@ -74,7 +75,7 @@ Ps2FilesystemNode::Ps2FilesystemNode() {
}
Ps2FilesystemNode::Ps2FilesystemNode(const Common::String &path) {
- printf("NEW FSNODE(%s)\n", path.c_str());
+ dbg_printf("NEW FSNODE(%s)\n", path.c_str());
_path = path;
@@ -106,7 +107,7 @@ Ps2FilesystemNode::Ps2FilesystemNode(const Common::String &path) {
}
Ps2FilesystemNode::Ps2FilesystemNode(const Common::String &path, bool verify) {
- printf("NEW FSNODE(%s, %d)\n", path.c_str(), verify);
+ dbg_printf("NEW FSNODE(%s, %d)\n", path.c_str(), verify);
_path = path;
@@ -163,24 +164,24 @@ void Ps2FilesystemNode::doverify(void) {
_verified = true;
- printf(" verify: %s -> ", _path.c_str());
+ dbg_printf(" verify: %s -> ", _path.c_str());
#if 0
if (_path.empty()) {
- printf("PlayStation 2 Root !\n");
+ dbg_printf("PlayStation 2 Root !\n");
_verified = true;
return;
}
if (_path.lastChar() == ':') {
- printf("Dev: %s\n", _path.c_str());
+ dbg_printf("Dev: %s\n", _path.c_str());
_verified = true;
return;
}
#endif
if (_path[3] != ':' && _path[4] != ':') {
- printf("relative path !\n");
+ dbg_printf("relative path !\n");
_isHere = false;
_isDirectory = false;
return;
@@ -203,7 +204,7 @@ void Ps2FilesystemNode::doverify(void) {
fileXioWaitAsync(FXIO_WAIT, &fd);
if (!fd) {
- printf(" yes [stat]\n");
+ dbg_printf(" yes [stat]\n");
return true;
}
break;
@@ -217,11 +218,11 @@ void Ps2FilesystemNode::doverify(void) {
#if 1
fd = fio.open(_path.c_str(), O_RDONLY);
- printf("_path = %s -- fio.open -> %d\n", _path.c_str(), fd);
+ dbg_printf("_path = %s -- fio.open -> %d\n", _path.c_str(), fd);
if (fd >=0) {
fio.close(fd);
- printf(" yes [open]\n");
+ dbg_printf(" yes [open]\n");
_isHere = true;
if (medium==MC_DEV && _path.lastChar()=='/')
_isDirectory = true;
@@ -233,7 +234,7 @@ void Ps2FilesystemNode::doverify(void) {
fd = fio.dopen(_path.c_str());
if (fd >=0) {
fio.dclose(fd);
- printf(" yes [dopen]\n");
+ dbg_printf(" yes [dopen]\n");
_isHere = true;
_isDirectory = true;
return;
@@ -266,13 +267,13 @@ void Ps2FilesystemNode::doverify(void) {
_isHere = false;
_isDirectory = false;
- printf(" no\n");
+ dbg_printf(" no\n");
return;
}
AbstractFSNode *Ps2FilesystemNode::getChild(const Common::String &n) const {
- printf("getChild : %s\n", n.c_str());
+ dbg_printf("getChild : %s\n", n.c_str());
if (!_isDirectory)
return NULL;
@@ -327,13 +328,14 @@ AbstractFSNode *Ps2FilesystemNode::getChild(const Common::String &n) const {
bool Ps2FilesystemNode::getChildren(AbstractFSList &list, ListMode mode, bool hidden) const {
//TODO: honor the hidden flag
- // printf("getChildren\n");
+ // dbg_printf("getChildren\n");
if (!_isDirectory)
return false;
if (_isRoot) {
- list.push_back(new Ps2FilesystemNode("cdfs:"));
+ if (g_systemPs2->cdPresent())
+ list.push_back(new Ps2FilesystemNode("cdfs:"));
if (g_systemPs2->hddPresent())
list.push_back(new Ps2FilesystemNode("pfs0:"));
@@ -341,7 +343,7 @@ bool Ps2FilesystemNode::getChildren(AbstractFSList &list, ListMode mode, bool hi
if (g_systemPs2->usbMassPresent())
list.push_back(new Ps2FilesystemNode("mass:"));
- if (g_systemPs2->getBootDevice()==HOST_DEV || g_systemPs2->netPresent())
+ if (g_systemPs2->netPresent())
list.push_back(new Ps2FilesystemNode("host:"));
if (g_systemPs2->mcPresent())
@@ -356,7 +358,7 @@ bool Ps2FilesystemNode::getChildren(AbstractFSList &list, ListMode mode, bool hi
else
fd = fio.dopen(_path.c_str());
- // printf("dopen = %d\n", fd);
+ // dbg_printf("dopen = %d\n", fd);
if (fd >= 0) {
iox_dirent_t dirent;
@@ -398,7 +400,7 @@ bool Ps2FilesystemNode::getChildren(AbstractFSList &list, ListMode mode, bool hi
}
AbstractFSNode *Ps2FilesystemNode::getParent() const {
- // printf("Ps2FilesystemNode::getParent : path = %s\n", _path.c_str());
+ // dbg_printf("Ps2FilesystemNode::getParent : path = %s\n", _path.c_str());
if (_isRoot)
return new Ps2FilesystemNode(this); // FIXME : 0 ???
@@ -410,7 +412,7 @@ AbstractFSNode *Ps2FilesystemNode::getParent() const {
const char *end = _lastPathComponent(_path);
Common::String str(start, end - start);
- // printf(" parent = %s\n", str.c_str());
+ // dbg_printf(" parent = %s\n", str.c_str());
return new Ps2FilesystemNode(str, true);
}
diff --git a/backends/fs/ps2/ps2-fs.h b/backends/fs/ps2/ps2-fs.h
index df78f9f68a..63b866ba5b 100644
--- a/backends/fs/ps2/ps2-fs.h
+++ b/backends/fs/ps2/ps2-fs.h
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#ifndef PS2_FILESYSTEM_H
@@ -69,12 +70,12 @@ public:
virtual Common::String getPath() const { return _path; }
virtual bool exists() const {
- // printf("%s : is %d\n", _path.c_str(), _isHere);
+ // dbg_printf("%s : is %d\n", _path.c_str(), _isHere);
return _isHere;
}
virtual bool isDirectory() const {
- // printf("%s : dir %d\n", _path.c_str(), _isDirectory);
+ // dbg_printf("%s : dir %d\n", _path.c_str(), _isDirectory);
return _isDirectory;
}
diff --git a/backends/fs/ps3/ps3-fs-factory.cpp b/backends/fs/ps3/ps3-fs-factory.cpp
index 3257246c50..565452596f 100644
--- a/backends/fs/ps3/ps3-fs-factory.cpp
+++ b/backends/fs/ps3/ps3-fs-factory.cpp
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#include "backends/fs/ps3/ps3-fs-factory.h"
diff --git a/backends/fs/ps3/ps3-fs-factory.h b/backends/fs/ps3/ps3-fs-factory.h
index 6c1988b1c9..f7d54a90fd 100644
--- a/backends/fs/ps3/ps3-fs-factory.h
+++ b/backends/fs/ps3/ps3-fs-factory.h
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#ifndef PS3_FILESYSTEM_FACTORY_H
diff --git a/backends/fs/psp/psp-fs-factory.cpp b/backends/fs/psp/psp-fs-factory.cpp
index bb3aca8ee6..303ea242c5 100644
--- a/backends/fs/psp/psp-fs-factory.cpp
+++ b/backends/fs/psp/psp-fs-factory.cpp
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#if defined(__PSP__)
diff --git a/backends/fs/psp/psp-fs-factory.h b/backends/fs/psp/psp-fs-factory.h
index d57c8fb655..26888487c2 100644
--- a/backends/fs/psp/psp-fs-factory.h
+++ b/backends/fs/psp/psp-fs-factory.h
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#ifndef PSP_FILESYSTEM_FACTORY_H
diff --git a/backends/fs/psp/psp-fs.cpp b/backends/fs/psp/psp-fs.cpp
index 67f4cd59a7..e8aad9fa98 100644
--- a/backends/fs/psp/psp-fs.cpp
+++ b/backends/fs/psp/psp-fs.cpp
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#if defined(__PSP__)
diff --git a/backends/fs/psp/psp-fs.h b/backends/fs/psp/psp-fs.h
index 146debb5f1..1bb4543d19 100644
--- a/backends/fs/psp/psp-fs.h
+++ b/backends/fs/psp/psp-fs.h
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#ifndef PSP_FILESYSTEM_H
diff --git a/backends/fs/psp/psp-stream.cpp b/backends/fs/psp/psp-stream.cpp
index da5a46eedb..c9b2fc7d8c 100644
--- a/backends/fs/psp/psp-stream.cpp
+++ b/backends/fs/psp/psp-stream.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/fs/psp/psp-stream.h b/backends/fs/psp/psp-stream.h
index 395b27392d..734cb66184 100644
--- a/backends/fs/psp/psp-stream.h
+++ b/backends/fs/psp/psp-stream.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/fs/stdiostream.cpp b/backends/fs/stdiostream.cpp
index 3ea0f9898b..8206bd180f 100644
--- a/backends/fs/stdiostream.cpp
+++ b/backends/fs/stdiostream.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/fs/stdiostream.h b/backends/fs/stdiostream.h
index 1d45600d9c..f2495feac8 100644
--- a/backends/fs/stdiostream.h
+++ b/backends/fs/stdiostream.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/fs/symbian/symbian-fs-factory.cpp b/backends/fs/symbian/symbian-fs-factory.cpp
index 7a60109742..311a0bfd82 100644
--- a/backends/fs/symbian/symbian-fs-factory.cpp
+++ b/backends/fs/symbian/symbian-fs-factory.cpp
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#if defined(__SYMBIAN32__)
diff --git a/backends/fs/symbian/symbian-fs-factory.h b/backends/fs/symbian/symbian-fs-factory.h
index b99d3fb0ec..940b58e22f 100644
--- a/backends/fs/symbian/symbian-fs-factory.h
+++ b/backends/fs/symbian/symbian-fs-factory.h
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#ifndef SYMBIAN_FILESYSTEM_FACTORY_H
diff --git a/backends/fs/symbian/symbian-fs.cpp b/backends/fs/symbian/symbian-fs.cpp
index 7a652fa43c..8fbc3a402a 100644
--- a/backends/fs/symbian/symbian-fs.cpp
+++ b/backends/fs/symbian/symbian-fs.cpp
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#if defined(__SYMBIAN32__)
diff --git a/backends/fs/symbian/symbian-fs.h b/backends/fs/symbian/symbian-fs.h
index 0db9a88940..339e998a28 100644
--- a/backends/fs/symbian/symbian-fs.h
+++ b/backends/fs/symbian/symbian-fs.h
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#ifndef SYMBIAN_FILESYSTEM_H
diff --git a/backends/fs/symbian/symbianstream.cpp b/backends/fs/symbian/symbianstream.cpp
index fa7842d3b1..549bc54452 100644
--- a/backends/fs/symbian/symbianstream.cpp
+++ b/backends/fs/symbian/symbianstream.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/fs/symbian/symbianstream.h b/backends/fs/symbian/symbianstream.h
index 3ca612e39b..f0ec095fea 100644
--- a/backends/fs/symbian/symbianstream.h
+++ b/backends/fs/symbian/symbianstream.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/fs/wii/wii-fs-factory.cpp b/backends/fs/wii/wii-fs-factory.cpp
index 760e5316e7..f234c1e300 100644
--- a/backends/fs/wii/wii-fs-factory.cpp
+++ b/backends/fs/wii/wii-fs-factory.cpp
@@ -33,6 +33,9 @@
#ifdef USE_WII_DI
#include <di/di.h>
#include <iso9660.h>
+#ifdef GAMECUBE
+#include <ogc/dvd.h>
+#endif
#endif
#ifdef USE_WII_SMB
@@ -125,6 +128,14 @@ bool WiiFilesystemFactory::failedToMount(FileSystemType type) {
return false;
}
+#ifdef USE_WII_DI
+#ifndef GAMECUBE
+ const DISC_INTERFACE* dvd = &__io_wiidvd;
+#else
+ const DISC_INTERFACE* dvd = &__io_gcdvd;
+#endif
+#endif
+
void WiiFilesystemFactory::mount(FileSystemType type) {
switch (type) {
case kDVD:
@@ -133,7 +144,7 @@ void WiiFilesystemFactory::mount(FileSystemType type) {
break;
printf("mount dvd\n");
- if (ISO9660_Mount()) {
+ if (ISO9660_Mount("dvd", dvd)) {
_dvdMounted = true;
_dvdError = false;
printf("ISO9660 mounted\n");
@@ -179,7 +190,7 @@ void WiiFilesystemFactory::umount(FileSystemType type) {
printf("umount dvd\n");
- ISO9660_Unmount();
+ ISO9660_Unmount("dvd:");
_dvdMounted = false;
_dvdError = false;
diff --git a/backends/fs/wii/wii-fs.cpp b/backends/fs/wii/wii-fs.cpp
index 4a19e18240..43f4f592b7 100644
--- a/backends/fs/wii/wii-fs.cpp
+++ b/backends/fs/wii/wii-fs.cpp
@@ -80,9 +80,9 @@ void WiiFilesystemNode::clearFlags() {
void WiiFilesystemNode::setFlags(const struct stat *st) {
_exists = true;
- _isDirectory = S_ISDIR(st->st_mode);
- _isReadable = (st->st_mode & S_IRUSR) > 0;
- _isWritable = (st->st_mode & S_IWUSR) > 0;
+ _isDirectory = ( (st->st_mode & S_IFDIR) != 0 );
+ _isReadable = ( (st->st_mode & S_IRUSR) != 0 );
+ _isWritable = ( (st->st_mode & S_IWUSR) != 0 );
}
WiiFilesystemNode::WiiFilesystemNode() {
@@ -106,7 +106,7 @@ WiiFilesystemNode::WiiFilesystemNode(const Common::String &p) {
_displayName = lastPathComponent(_path, '/');
struct stat st;
- if (!stat(_path.c_str(), &st))
+ if(stat(_path.c_str(), &st) != -1)
setFlags(&st);
else
clearFlags();
@@ -152,33 +152,45 @@ bool WiiFilesystemNode::getChildren(AbstractFSList &list, ListMode mode, bool hi
if (_path.empty())
return getDevopChildren(list, mode, hidden);
- DIR_ITER* dp = diropen (_path.c_str());
+ DIR* dp = opendir (_path.c_str());
+ DIR* tmpdir;
if (dp == NULL)
return false;
- char filename[MAXPATHLEN];
- struct stat st;
+ struct dirent *pent;
- while (dirnext(dp, filename, &st) == 0) {
- if (strcmp(filename, ".") == 0 || strcmp(filename, "..") == 0)
+ while ((pent = readdir(dp)) != NULL) {
+ if (strcmp(pent->d_name, ".") == 0 || strcmp(pent->d_name, "..") == 0)
continue;
Common::String newPath(_path);
if (newPath.lastChar() != '/')
- newPath += '/';
- newPath += filename;
-
- bool isDir = S_ISDIR(st.st_mode);
-
+ newPath += '/';
+ newPath += pent->d_name;
+
+ bool isDir = false;
+ tmpdir = opendir(newPath.c_str());
+ if(tmpdir)
+ {
+ isDir = true;
+ closedir(tmpdir);
+ }
+
if ((mode == Common::FSNode::kListFilesOnly && isDir) ||
(mode == Common::FSNode::kListDirectoriesOnly && !isDir))
continue;
-
+
+ struct stat st;
+ st.st_mode = 0;
+ st.st_mode |= ( isDir ? S_IFDIR : 0 );
+ st.st_mode |= S_IRUSR;
+ st.st_mode |= S_IWUSR;
+
list.push_back(new WiiFilesystemNode(newPath, &st));
}
- dirclose(dp);
+ closedir(dp);
return true;
}
diff --git a/backends/fs/wii/wii-fs.h b/backends/fs/wii/wii-fs.h
index 11679d0c36..c77c543dae 100644
--- a/backends/fs/wii/wii-fs.h
+++ b/backends/fs/wii/wii-fs.h
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#ifndef WII_FILESYSTEM_H
@@ -51,7 +52,7 @@ public:
*
* @param path Common::String with the path the new node should point to.
*/
- WiiFilesystemNode(const Common::String &path);
+ WiiFilesystemNode(const Common::String &p);
WiiFilesystemNode(const Common::String &p, const struct stat *st);
virtual bool exists() const;
diff --git a/backends/fs/windows/windows-fs-factory.cpp b/backends/fs/windows/windows-fs-factory.cpp
index 46df253748..9d1b13a0c9 100644
--- a/backends/fs/windows/windows-fs-factory.cpp
+++ b/backends/fs/windows/windows-fs-factory.cpp
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#if defined(WIN32)
diff --git a/backends/fs/windows/windows-fs-factory.h b/backends/fs/windows/windows-fs-factory.h
index e7c70f1b55..b5df5406a8 100644
--- a/backends/fs/windows/windows-fs-factory.h
+++ b/backends/fs/windows/windows-fs-factory.h
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#ifndef WINDOWS_FILESYSTEM_FACTORY_H
diff --git a/backends/fs/windows/windows-fs.cpp b/backends/fs/windows/windows-fs.cpp
index 030f394f81..49549b83cb 100644
--- a/backends/fs/windows/windows-fs.cpp
+++ b/backends/fs/windows/windows-fs.cpp
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#if defined(WIN32)
diff --git a/backends/fs/windows/windows-fs.h b/backends/fs/windows/windows-fs.h
index 351307bef0..d06044603a 100644
--- a/backends/fs/windows/windows-fs.h
+++ b/backends/fs/windows/windows-fs.h
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#ifndef WINDOWS_FILESYSTEM_H
diff --git a/backends/graphics/default-palette.h b/backends/graphics/default-palette.h
index 8f3fcb2db1..a66e1862b7 100644
--- a/backends/graphics/default-palette.h
+++ b/backends/graphics/default-palette.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp b/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp
index bd87c9fafd..343efa4da6 100644
--- a/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp
+++ b/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/graphics/dinguxsdl/dinguxsdl-graphics.h b/backends/graphics/dinguxsdl/dinguxsdl-graphics.h
index ecdd01d166..fc70e721cf 100644
--- a/backends/graphics/dinguxsdl/dinguxsdl-graphics.h
+++ b/backends/graphics/dinguxsdl/dinguxsdl-graphics.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/graphics/gph/gph-graphics.cpp b/backends/graphics/gph/gph-graphics.cpp
index 92553564bf..247e5ed490 100644
--- a/backends/graphics/gph/gph-graphics.cpp
+++ b/backends/graphics/gph/gph-graphics.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/graphics/gph/gph-graphics.h b/backends/graphics/gph/gph-graphics.h
index f1f3d18b41..4a68ea6eed 100644
--- a/backends/graphics/gph/gph-graphics.h
+++ b/backends/graphics/gph/gph-graphics.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/graphics/graphics.h b/backends/graphics/graphics.h
index 24397228e6..3671b9f0b9 100644
--- a/backends/graphics/graphics.h
+++ b/backends/graphics/graphics.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp b/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp
index a005d74919..22b271ae1a 100644
--- a/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp
+++ b/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.h b/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.h
index ee2a566d71..8760c5004d 100644
--- a/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.h
+++ b/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/graphics/maemosdl/maemosdl-graphics.cpp b/backends/graphics/maemosdl/maemosdl-graphics.cpp
index 527ef82b9d..07d6d32d3a 100644
--- a/backends/graphics/maemosdl/maemosdl-graphics.cpp
+++ b/backends/graphics/maemosdl/maemosdl-graphics.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/graphics/maemosdl/maemosdl-graphics.h b/backends/graphics/maemosdl/maemosdl-graphics.h
index 81064d2d5f..c255e94653 100644
--- a/backends/graphics/maemosdl/maemosdl-graphics.h
+++ b/backends/graphics/maemosdl/maemosdl-graphics.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/graphics/null/null-graphics.h b/backends/graphics/null/null-graphics.h
index 276be7d3fa..67306c29f3 100644
--- a/backends/graphics/null/null-graphics.h
+++ b/backends/graphics/null/null-graphics.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/graphics/opengl/debug.cpp b/backends/graphics/opengl/debug.cpp
new file mode 100644
index 0000000000..d5d73fb5ec
--- /dev/null
+++ b/backends/graphics/opengl/debug.cpp
@@ -0,0 +1,65 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * 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
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "backends/graphics/opengl/debug.h"
+#include "backends/graphics/opengl/opengl-sys.h"
+
+#include "common/str.h"
+#include "common/textconsole.h"
+
+#ifdef OPENGL_DEBUG
+
+namespace OpenGL {
+
+namespace {
+Common::String getGLErrStr(GLenum error) {
+ switch (error) {
+ case GL_INVALID_ENUM:
+ return "GL_INVALID_ENUM";
+ case GL_INVALID_VALUE:
+ return "GL_INVALID_VALUE";
+ case GL_INVALID_OPERATION:
+ return "GL_INVALID_OPERATION";
+ case GL_STACK_OVERFLOW:
+ return "GL_STACK_OVERFLOW";
+ case GL_STACK_UNDERFLOW:
+ return "GL_STACK_UNDERFLOW";
+ case GL_OUT_OF_MEMORY:
+ return "GL_OUT_OF_MEMORY";
+ }
+
+ return Common::String::format("(Unknown GL error code 0x%X)", error);
+}
+} // End of anonymous namespace
+
+void checkGLError(const char *expr, const char *file, int line) {
+ GLenum error;
+
+ while ((error = glGetError()) != GL_NO_ERROR) {
+ // We cannot use error here because we do not know whether we have a
+ // working screen or not.
+ warning("GL ERROR: %s on %s (%s:%d)", getGLErrStr(error).c_str(), expr, file, line);
+ }
+}
+} // End of namespace OpenGL
+
+#endif
diff --git a/backends/graphics/opengl/debug.h b/backends/graphics/opengl/debug.h
new file mode 100644
index 0000000000..ff6b678870
--- /dev/null
+++ b/backends/graphics/opengl/debug.h
@@ -0,0 +1,39 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * 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
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef BACKENDS_GRAPHICS_OPENGL_DEBUG_H
+#define BACKENDS_GRAPHICS_OPENGL_DEBUG_H
+
+#define OPENGL_DEBUG
+
+#ifdef OPENGL_DEBUG
+
+namespace OpenGL {
+void checkGLError(const char *expr, const char *file, int line);
+} // End of namespace OpenGL
+
+#define GLCALL(x) do { (x); OpenGL::checkGLError(#x, __FILE__, __LINE__); } while (false)
+#else
+#define GLCALL(x) do { (x); } while (false)
+#endif
+
+#endif
diff --git a/backends/graphics/opengl/extensions.cpp b/backends/graphics/opengl/extensions.cpp
new file mode 100644
index 0000000000..4482ef82b5
--- /dev/null
+++ b/backends/graphics/opengl/extensions.cpp
@@ -0,0 +1,48 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * 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
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "backends/graphics/opengl/extensions.h"
+#include "backends/graphics/opengl/opengl-sys.h"
+
+#include "common/tokenizer.h"
+
+namespace OpenGL {
+
+bool g_extNPOTSupported = false;
+
+void initializeGLExtensions() {
+ const char *extString = (const char *)glGetString(GL_EXTENSIONS);
+
+ // Initialize default state.
+ g_extNPOTSupported = false;
+
+ Common::StringTokenizer tokenizer(extString, " ");
+ while (!tokenizer.empty()) {
+ Common::String token = tokenizer.nextToken();
+
+ if (token == "GL_ARB_texture_non_power_of_two") {
+ g_extNPOTSupported = true;
+ }
+ }
+}
+
+} // End of namespace OpenGL
diff --git a/backends/graphics/opengl/glerrorcheck.h b/backends/graphics/opengl/extensions.h
index 2d5491bdfd..87452429e2 100644
--- a/backends/graphics/opengl/glerrorcheck.h
+++ b/backends/graphics/opengl/extensions.h
@@ -8,28 +8,34 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
-#if !defined(DEBUG)
+#ifndef BACKENDS_GRAPHICS_OPENGL_EXTENSIONS_H
+#define BACKENDS_GRAPHICS_OPENGL_EXTENSIONS_H
-// If not in debug, do nothing
-#define CHECK_GL_ERROR() do {} while (false)
+namespace OpenGL {
-#else
+/**
+ * Checks for availability of extensions we want to use and initializes them
+ * when available.
+ */
+void initializeGLExtensions();
-// If in debug, check for an error after a GL call
-#define CHECK_GL_ERROR() checkGlError(__FILE__, __LINE__)
+/**
+ * Whether non power of two textures are supported
+ */
+extern bool g_extNPOTSupported;
-void checkGlError(const char *file, int line);
+} // End of namespace OpenGL
#endif
diff --git a/backends/graphics/opengl/gltexture.cpp b/backends/graphics/opengl/gltexture.cpp
deleted file mode 100644
index ca674563df..0000000000
--- a/backends/graphics/opengl/gltexture.cpp
+++ /dev/null
@@ -1,225 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * 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
- * of the License, or (at your option) any later version.
-
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
-
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "common/scummsys.h"
-
-#if defined(USE_OPENGL)
-
-#include "backends/graphics/opengl/gltexture.h"
-#include "backends/graphics/opengl/glerrorcheck.h"
-
-#include "common/rect.h"
-#include "common/array.h"
-#include "common/util.h"
-#include "common/tokenizer.h"
-
-// Supported GL extensions
-static bool npot_supported = false;
-static bool glext_inited = false;
-
-/*static inline GLint xdiv(int numerator, int denominator) {
- assert(numerator < (1 << 16));
- return (numerator << 16) / denominator;
-}*/
-
-static GLuint nextHigher2(GLuint v) {
- if (v == 0)
- return 1;
- v--;
- v |= v >> 1;
- v |= v >> 2;
- v |= v >> 4;
- v |= v >> 8;
- v |= v >> 16;
- return ++v;
-}
-
-void GLTexture::initGLExtensions() {
-
- // Return if extensions were already checked
- if (glext_inited)
- return;
-
- // Get a string with all extensions
- const char *ext_string = (const char *)glGetString(GL_EXTENSIONS);
- CHECK_GL_ERROR();
- Common::StringTokenizer tokenizer(ext_string, " ");
- // Iterate all string tokens
- while (!tokenizer.empty()) {
- Common::String token = tokenizer.nextToken();
- if (token == "GL_ARB_texture_non_power_of_two")
- npot_supported = true;
- }
-
- glext_inited = true;
-}
-
-GLTexture::GLTexture(byte bpp, GLenum internalFormat, GLenum format, GLenum type)
- :
- _bytesPerPixel(bpp),
- _internalFormat(internalFormat),
- _glFormat(format),
- _glType(type),
- _textureWidth(0),
- _textureHeight(0),
- _realWidth(0),
- _realHeight(0),
- _refresh(false),
- _filter(GL_NEAREST) {
-
- // Generate the texture ID
- glGenTextures(1, &_textureName); CHECK_GL_ERROR();
-}
-
-GLTexture::~GLTexture() {
- // Delete the texture
- glDeleteTextures(1, &_textureName); CHECK_GL_ERROR();
-}
-
-void GLTexture::refresh() {
- // Delete previous texture
- glDeleteTextures(1, &_textureName); CHECK_GL_ERROR();
-
- // Generate the texture ID
- glGenTextures(1, &_textureName); CHECK_GL_ERROR();
- _refresh = true;
-}
-
-void GLTexture::allocBuffer(GLuint w, GLuint h) {
- _realWidth = w;
- _realHeight = h;
-
- if (!_refresh) {
- if (npot_supported && _filter == GL_LINEAR) {
- // Check if we already allocated a correctly-sized buffer
- // This is so we don't need to duplicate the last row/column
- if (w == _textureWidth && h == _textureHeight)
- return;
- } else {
- // Check if we already have a large enough buffer
- if (w <= _textureWidth && h <= _textureHeight)
- return;
- }
- }
-
- if (npot_supported) {
- _textureWidth = w;
- _textureHeight = h;
- } else {
- _textureWidth = nextHigher2(w);
- _textureHeight = nextHigher2(h);
- }
-
- // Select this OpenGL texture
- glBindTexture(GL_TEXTURE_2D, _textureName); CHECK_GL_ERROR();
-
- // Set the texture parameters
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, _filter); CHECK_GL_ERROR();
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, _filter); CHECK_GL_ERROR();
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); CHECK_GL_ERROR();
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); CHECK_GL_ERROR();
-
- // Allocate room for the texture
- glTexImage2D(GL_TEXTURE_2D, 0, _internalFormat,
- _textureWidth, _textureHeight, 0, _glFormat, _glType, NULL); CHECK_GL_ERROR();
-
- _refresh = false;
-}
-
-void GLTexture::updateBuffer(const void *buf, int pitch, GLuint x, GLuint y, GLuint w, GLuint h) {
- // Skip empty updates.
- if (w * h == 0)
- return;
-
- // Select this OpenGL texture
- glBindTexture(GL_TEXTURE_2D, _textureName); CHECK_GL_ERROR();
-
- // Check if the buffer has its data contiguously
- if ((int)w * _bytesPerPixel == pitch) {
- glTexSubImage2D(GL_TEXTURE_2D, 0, x, y, w, h,
- _glFormat, _glType, buf); CHECK_GL_ERROR();
- } else {
- // Update the texture row by row
- const byte *src = (const byte *)buf;
- GLuint curY = y;
- GLuint height = h;
- do {
- glTexSubImage2D(GL_TEXTURE_2D, 0, x, curY,
- w, 1, _glFormat, _glType, src); CHECK_GL_ERROR();
- curY++;
- src += pitch;
- } while (--height);
- }
-
- // If we're in linear filter mode, repeat the last row/column if the real dimensions
- // doesn't match the texture dimensions.
- if (_filter == GL_LINEAR) {
- if (_realWidth != _textureWidth && x + w == _realWidth) {
- const byte *src = (const byte *)buf + (w - 1) * _bytesPerPixel;
- GLuint curY = y;
- GLuint height = h;
-
- do {
- glTexSubImage2D(GL_TEXTURE_2D, 0, x + w,
- curY, 1, 1, _glFormat, _glType, src); CHECK_GL_ERROR();
-
- curY++;
- src += pitch;
- } while (--height);
- }
-
- if (_realHeight != _textureHeight && y + h == _realHeight) {
- glTexSubImage2D(GL_TEXTURE_2D, 0, x, y + h,
- w, 1, _glFormat, _glType, (const byte *)buf + pitch * (h - 1)); CHECK_GL_ERROR();
- }
- }
-}
-
-void GLTexture::drawTexture(GLshort x, GLshort y, GLshort w, GLshort h) {
- // Select this OpenGL texture
- glBindTexture(GL_TEXTURE_2D, _textureName); CHECK_GL_ERROR();
-
- // Calculate the texture rect that will be drawn
- const GLfloat texWidth = (GLfloat)_realWidth / _textureWidth;//xdiv(_surface.w, _textureWidth);
- const GLfloat texHeight = (GLfloat)_realHeight / _textureHeight;//xdiv(_surface.h, _textureHeight);
- const GLfloat texcoords[] = {
- 0, 0,
- texWidth, 0,
- 0, texHeight,
- texWidth, texHeight,
- };
- glTexCoordPointer(2, GL_FLOAT, 0, texcoords); CHECK_GL_ERROR();
-
- // Calculate the screen rect where the texture will be drawn
- const GLshort vertices[] = {
- x, y,
- (GLshort)(x + w), y,
- x, (GLshort)(y + h),
- (GLshort)(x + w), (GLshort)(y + h),
- };
- glVertexPointer(2, GL_SHORT, 0, vertices); CHECK_GL_ERROR();
-
- // Draw the texture to the screen buffer
- glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); CHECK_GL_ERROR();
-}
-
-#endif
diff --git a/backends/graphics/opengl/gltexture.h b/backends/graphics/opengl/gltexture.h
deleted file mode 100644
index 6ef80923ae..0000000000
--- a/backends/graphics/opengl/gltexture.h
+++ /dev/null
@@ -1,131 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * 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
- * of the License, or (at your option) any later version.
-
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
-
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef BACKENDS_GRAPHICS_OPENGL_GLTEXTURE_H
-#define BACKENDS_GRAPHICS_OPENGL_GLTEXTURE_H
-
-#include "common/scummsys.h"
-
-#ifdef WIN32
-#if defined(ARRAYSIZE) && !defined(_WINDOWS_)
-#undef ARRAYSIZE
-#endif
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#undef ARRAYSIZE
-#endif
-
-// HACK: At this point in Windows platforms, common/util.h has been included
-// via common/rect.h (from backends/graphics/sdl/sdl-graphics.h), via
-// backends/graphics/openglsdl/openglsdl-graphics.h. Thus, we end up with
-// COMMON_UTIL_H defined, and ARRAYSIZE undefined (bad!). Therefore,
-// ARRAYSIZE is undefined in openglsdl-graphics.cpp. This is a temporary
-// hackish solution fo fix compilation under Windows.
-#if !defined(ARRAYSIZE) && defined(COMMON_UTIL_H)
-#define ARRAYSIZE(x) ((int)(sizeof(x) / sizeof(x[0])))
-#endif
-
-#if defined(TIZEN)
-#include <FGraphicsOpengl.h>
-using namespace Tizen::Graphics::Opengl;
-#elif defined(USE_GLES)
-#include <GLES/gl.h>
-#elif defined(SDL_BACKEND)
-#include <SDL_opengl.h>
-#else
-#include <GL/gl.h>
-#endif
-
-#include "graphics/surface.h"
-
-/**
- * OpenGL texture manager class
- */
-class GLTexture {
-public:
- /**
- * Initialize OpenGL Extensions
- */
- static void initGLExtensions();
-
- GLTexture(byte bpp, GLenum internalFormat, GLenum format, GLenum type);
- ~GLTexture();
-
- /**
- * Refresh the texture after a context change. The
- * process will be completed on next allocBuffer call.
- */
- void refresh();
-
- /**
- * Allocates memory needed for the given size.
- */
- void allocBuffer(GLuint width, GLuint height);
-
- /**
- * Updates the texture pixels.
- */
- void updateBuffer(const void *buf, int pitch, GLuint x, GLuint y,
- GLuint w, GLuint h);
-
- /**
- * Draws the texture to the screen buffer.
- */
- void drawTexture(GLshort x, GLshort y, GLshort w, GLshort h);
-
- /**
- * Get the texture width.
- */
- GLuint getWidth() const { return _realWidth; }
-
- /**
- * Get the texture height.
- */
- GLuint getHeight() const { return _realHeight; }
-
- /**
- * Get the bytes per pixel.
- */
- uint getBytesPerPixel() const { return _bytesPerPixel; }
-
- /**
- * Set the texture filter.
- * @filter the filter type, GL_NEAREST or GL_LINEAR
- */
- void setFilter(GLint filter) { _filter = filter; }
-
-private:
- const byte _bytesPerPixel;
- const GLenum _internalFormat;
- const GLenum _glFormat;
- const GLenum _glType;
-
- GLuint _realWidth;
- GLuint _realHeight;
- GLuint _textureName;
- GLuint _textureWidth;
- GLuint _textureHeight;
- GLint _filter;
- bool _refresh;
-};
-
-#endif
diff --git a/backends/graphics/opengl/opengl-graphics.cpp b/backends/graphics/opengl/opengl-graphics.cpp
index 84be83d524..cbd06e9161 100644
--- a/backends/graphics/opengl/opengl-graphics.cpp
+++ b/backends/graphics/opengl/opengl-graphics.cpp
@@ -8,102 +8,90 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
-#include "common/scummsys.h"
-
-#if defined(USE_OPENGL)
#include "backends/graphics/opengl/opengl-graphics.h"
-#include "backends/graphics/opengl/glerrorcheck.h"
-#include "common/config-manager.h"
-#include "common/file.h"
-#include "common/mutex.h"
+#include "backends/graphics/opengl/texture.h"
+#include "backends/graphics/opengl/debug.h"
+#include "backends/graphics/opengl/extensions.h"
+
#include "common/textconsole.h"
#include "common/translation.h"
+#include "common/algorithm.h"
+#include "common/file.h"
#ifdef USE_OSD
#include "common/tokenizer.h"
+#include "common/rect.h"
#endif
-#include "graphics/font.h"
+
+#include "graphics/conversion.h"
+#ifdef USE_OSD
#include "graphics/fontman.h"
+#include "graphics/font.h"
+#endif
+
+namespace OpenGL {
OpenGLGraphicsManager::OpenGLGraphicsManager()
- :
+ : _currentState(), _oldState(), _transactionMode(kTransactionNone), _screenChangeID(1 << (sizeof(int) * 8 - 2)),
+ _outputScreenWidth(0), _outputScreenHeight(0), _displayX(0), _displayY(0),
+ _displayWidth(0), _displayHeight(0), _defaultFormat(), _defaultFormatAlpha(),
+ _gameScreen(nullptr), _gameScreenShakeOffset(0), _overlay(nullptr),
+ _overlayVisible(false), _cursor(nullptr),
+ _cursorX(0), _cursorY(0), _cursorHotspotX(0), _cursorHotspotY(0), _cursorHotspotXScaled(0),
+ _cursorHotspotYScaled(0), _cursorWidthScaled(0), _cursorHeightScaled(0), _cursorKeyColor(0),
+ _cursorVisible(false), _cursorDontScale(false), _cursorPaletteEnabled(false)
#ifdef USE_OSD
- _osdTexture(0), _osdAlpha(0), _osdFadeStartTime(0), _requireOSDUpdate(false),
+ , _osdAlpha(0), _osdFadeStartTime(0), _osd(nullptr)
#endif
- _gameTexture(0), _overlayTexture(0), _cursorTexture(0),
- _screenChangeCount(1 << (sizeof(int) * 8 - 2)), _screenNeedsRedraw(false),
- _shakePos(0),
- _overlayVisible(false), _overlayNeedsRedraw(false),
- _transactionMode(kTransactionNone),
- _cursorNeedsRedraw(false), _cursorPaletteDisabled(true),
- _cursorVisible(false), _cursorKeyColor(0),
- _cursorDontScale(false),
- _formatBGR(false),
- _displayX(0), _displayY(0), _displayWidth(0), _displayHeight(0) {
-
- memset(&_oldVideoMode, 0, sizeof(_oldVideoMode));
- memset(&_videoMode, 0, sizeof(_videoMode));
- memset(&_transactionDetails, 0, sizeof(_transactionDetails));
-
- _videoMode.mode = OpenGL::GFX_NORMAL;
- _videoMode.scaleFactor = 2;
- _videoMode.fullscreen = ConfMan.getBool("fullscreen");
- _videoMode.antialiasing = false;
-
- _gamePalette = (byte *)calloc(sizeof(byte) * 3, 256);
- _cursorPalette = (byte *)calloc(sizeof(byte) * 3, 256);
+ {
+ memset(_gamePalette, 0, sizeof(_gamePalette));
}
OpenGLGraphicsManager::~OpenGLGraphicsManager() {
- free(_gamePalette);
- free(_cursorPalette);
-
- _screenData.free();
- _overlayData.free();
- _cursorData.free();
- _osdSurface.free();
-
- delete _gameTexture;
- delete _overlayTexture;
- delete _cursorTexture;
+ delete _gameScreen;
+ delete _overlay;
+ delete _cursor;
+#ifdef USE_OSD
+ delete _osd;
+#endif
}
-//
-// Feature
-//
-
bool OpenGLGraphicsManager::hasFeature(OSystem::Feature f) {
- return
- (f == OSystem::kFeatureAspectRatioCorrection) ||
- (f == OSystem::kFeatureCursorPalette);
+ switch (f) {
+ case OSystem::kFeatureAspectRatioCorrection:
+ case OSystem::kFeatureCursorPalette:
+ return true;
+
+ case OSystem::kFeatureOverlaySupportsAlpha:
+ return _defaultFormatAlpha.aBits() > 3;
+
+ default:
+ return false;
+ }
}
void OpenGLGraphicsManager::setFeatureState(OSystem::Feature f, bool enable) {
switch (f) {
- case OSystem::kFeatureFullscreenMode:
- setFullscreenMode(enable);
- break;
-
case OSystem::kFeatureAspectRatioCorrection:
- _videoMode.aspectRatioCorrection = enable;
- _transactionDetails.needRefresh = true;
+ assert(_transactionMode != kTransactionNone);
+ _currentState.aspectRatioCorrection = enable;
break;
case OSystem::kFeatureCursorPalette:
- _cursorPaletteDisabled = !enable;
- _cursorNeedsRedraw = true;
+ _cursorPaletteEnabled = enable;
+ updateCursorPalette();
break;
default:
@@ -113,1189 +101,1038 @@ void OpenGLGraphicsManager::setFeatureState(OSystem::Feature f, bool enable) {
bool OpenGLGraphicsManager::getFeatureState(OSystem::Feature f) {
switch (f) {
- case OSystem::kFeatureFullscreenMode:
- return _videoMode.fullscreen;
-
case OSystem::kFeatureAspectRatioCorrection:
- return _videoMode.aspectRatioCorrection;
+ return _currentState.aspectRatioCorrection;
case OSystem::kFeatureCursorPalette:
- return !_cursorPaletteDisabled;
+ return _cursorPaletteEnabled;
default:
return false;
}
}
-//
-// Screen format and modes
-//
+namespace {
-static const OSystem::GraphicsMode s_supportedGraphicsModes[] = {
- {"gl1", _s("OpenGL Normal"), OpenGL::GFX_NORMAL},
- {"gl2", _s("OpenGL Conserve"), OpenGL::GFX_CONSERVE},
- {"gl4", _s("OpenGL Original"), OpenGL::GFX_ORIGINAL},
- {0, 0, 0}
+const OSystem::GraphicsMode glGraphicsModes[] = {
+ { "opengl_linear", _s("OpenGL"), GFX_LINEAR },
+ { "opengl_nearest", _s("OpenGL (No filtering)"), GFX_NEAREST },
+ { nullptr, nullptr, 0 }
};
-const OSystem::GraphicsMode *OpenGLGraphicsManager::supportedGraphicsModes() {
- return s_supportedGraphicsModes;
-}
+} // End of anonymous namespace
const OSystem::GraphicsMode *OpenGLGraphicsManager::getSupportedGraphicsModes() const {
- return s_supportedGraphicsModes;
+ return glGraphicsModes;
}
int OpenGLGraphicsManager::getDefaultGraphicsMode() const {
- return OpenGL::GFX_NORMAL;
+ return GFX_LINEAR;
}
bool OpenGLGraphicsManager::setGraphicsMode(int mode) {
- assert(_transactionMode == kTransactionActive);
+ assert(_transactionMode != kTransactionNone);
- setScale(2);
+ switch (mode) {
+ case GFX_LINEAR:
+ case GFX_NEAREST:
+ _currentState.graphicsMode = mode;
+
+ if (_gameScreen) {
+ _gameScreen->enableLinearFiltering(mode == GFX_LINEAR);
+ }
+
+ if (_cursor) {
+ _cursor->enableLinearFiltering(mode == GFX_LINEAR);
+ }
- if (_oldVideoMode.setup && _oldVideoMode.mode == mode)
return true;
- switch (mode) {
- case OpenGL::GFX_NORMAL:
- case OpenGL::GFX_CONSERVE:
- case OpenGL::GFX_ORIGINAL:
- break;
default:
- warning("Unknown gfx mode %d", mode);
+ warning("OpenGLGraphicsManager::setGraphicsMode(%d): Unknown graphics mode", mode);
return false;
}
-
- _videoMode.mode = mode;
- _transactionDetails.needRefresh = true;
-
- return true;
}
int OpenGLGraphicsManager::getGraphicsMode() const {
- assert(_transactionMode == kTransactionNone);
- return _videoMode.mode;
-}
-
-void OpenGLGraphicsManager::resetGraphicsScale() {
- setScale(1);
+ return _currentState.graphicsMode;
}
#ifdef USE_RGB_COLOR
Graphics::PixelFormat OpenGLGraphicsManager::getScreenFormat() const {
- return _screenFormat;
+ return _currentState.gameFormat;
}
#endif
-void OpenGLGraphicsManager::initSize(uint width, uint height, const Graphics::PixelFormat *format) {
- assert(_transactionMode == kTransactionActive);
-
-#ifdef USE_RGB_COLOR
- Graphics::PixelFormat newFormat;
- if (!format)
- newFormat = Graphics::PixelFormat::createFormatCLUT8();
- else
- newFormat = *format;
-
- assert(newFormat.bytesPerPixel > 0);
-
- // Avoid redundant format changes
- if (newFormat != _videoMode.format) {
- _videoMode.format = newFormat;
- _transactionDetails.formatChanged = true;
- _screenFormat = newFormat;
- }
-#endif
-
- // Avoid redundant res changes
- if ((int)width == _videoMode.screenWidth && (int)height == _videoMode.screenHeight)
- return;
-
- _videoMode.screenWidth = width;
- _videoMode.screenHeight = height;
+void OpenGLGraphicsManager::beginGFXTransaction() {
+ assert(_transactionMode == kTransactionNone);
- _transactionDetails.sizeChanged = true;
+ // Start a transaction.
+ _oldState = _currentState;
+ _transactionMode = kTransactionActive;
}
-int OpenGLGraphicsManager::getScreenChangeID() const {
- return _screenChangeCount;
-}
+OSystem::TransactionError OpenGLGraphicsManager::endGFXTransaction() {
+ assert(_transactionMode == kTransactionActive);
-//
-// GFX
-//
+ uint transactionError = OSystem::kTransactionSuccess;
-void OpenGLGraphicsManager::beginGFXTransaction() {
- assert(_transactionMode == kTransactionNone);
+ bool setupNewGameScreen = false;
+ if ( _oldState.gameWidth != _currentState.gameWidth
+ || _oldState.gameHeight != _currentState.gameHeight) {
+ setupNewGameScreen = true;
+ }
- _transactionMode = kTransactionActive;
- _transactionDetails.sizeChanged = false;
- _transactionDetails.needRefresh = false;
- _transactionDetails.needUpdatescreen = false;
- _transactionDetails.filterChanged = false;
#ifdef USE_RGB_COLOR
- _transactionDetails.formatChanged = false;
+ if (_oldState.gameFormat != _currentState.gameFormat) {
+ setupNewGameScreen = true;
+ }
+
+ // Check whether the requested format can actually be used.
+ Common::List<Graphics::PixelFormat> supportedFormats = getSupportedFormats();
+ // In case the requested format is not usable we will fall back to CLUT8.
+ if (Common::find(supportedFormats.begin(), supportedFormats.end(), _currentState.gameFormat) == supportedFormats.end()) {
+ _currentState.gameFormat = Graphics::PixelFormat::createFormatCLUT8();
+ transactionError |= OSystem::kTransactionFormatNotSupported;
+ }
#endif
- _oldVideoMode = _videoMode;
-}
+ do {
+ uint requestedWidth = _currentState.gameWidth;
+ uint requestedHeight = _currentState.gameHeight;
+ const uint desiredAspect = getDesiredGameScreenAspect();
+ requestedHeight = intToFrac(requestedWidth) / desiredAspect;
-OSystem::TransactionError OpenGLGraphicsManager::endGFXTransaction() {
- int errors = OSystem::kTransactionSuccess;
+ if (!loadVideoMode(requestedWidth, requestedHeight,
+#ifdef USE_RGB_COLOR
+ _currentState.gameFormat
+#else
+ Graphics::PixelFormat::createFormatCLUT8()
+#endif
+ )
+ // HACK: This is really nasty but we don't have any guarantees of
+ // a context existing before, which means we don't know the maximum
+ // supported texture size before this. Thus, we check whether the
+ // requested game resolution is supported over here.
+ || ( _currentState.gameWidth > (uint)Texture::getMaximumTextureSize()
+ || _currentState.gameHeight > (uint)Texture::getMaximumTextureSize())) {
+ if (_transactionMode == kTransactionActive) {
+ // Try to setup the old state in case its valid and is
+ // actually different from the new one.
+ if (_oldState.valid && _oldState != _currentState) {
+ // Give some hints on what failed to set up.
+ if ( _oldState.gameWidth != _currentState.gameWidth
+ || _oldState.gameHeight != _currentState.gameHeight) {
+ transactionError |= OSystem::kTransactionSizeChangeFailed;
+ }
- assert(_transactionMode != kTransactionNone);
+#ifdef USE_RGB_COLOR
+ if (_oldState.gameFormat != _currentState.gameFormat) {
+ transactionError |= OSystem::kTransactionFormatNotSupported;
+ }
+#endif
- if (_transactionMode == kTransactionRollback) {
- if (_videoMode.fullscreen != _oldVideoMode.fullscreen) {
- errors |= OSystem::kTransactionFullscreenFailed;
+ if (_oldState.aspectRatioCorrection != _currentState.aspectRatioCorrection) {
+ transactionError |= OSystem::kTransactionAspectRatioFailed;
+ }
- _videoMode.fullscreen = _oldVideoMode.fullscreen;
- } else if (_videoMode.mode != _oldVideoMode.mode) {
- errors |= OSystem::kTransactionModeSwitchFailed;
+ if (_oldState.graphicsMode != _currentState.graphicsMode) {
+ transactionError |= OSystem::kTransactionModeSwitchFailed;
+ }
- _videoMode.mode = _oldVideoMode.mode;
- _videoMode.scaleFactor = _oldVideoMode.scaleFactor;
-#ifdef USE_RGB_COLOR
- } else if (_videoMode.format != _oldVideoMode.format) {
- errors |= OSystem::kTransactionFormatNotSupported;
+ // Roll back to the old state.
+ _currentState = _oldState;
+ _transactionMode = kTransactionRollback;
- _videoMode.format = _oldVideoMode.format;
- _screenFormat = _videoMode.format;
-#endif
- } else if (_videoMode.screenWidth != _oldVideoMode.screenWidth || _videoMode.screenHeight != _oldVideoMode.screenHeight) {
- errors |= OSystem::kTransactionSizeChangeFailed;
+ // Try to set up the old state.
+ continue;
+ }
+ }
- _videoMode.screenWidth = _oldVideoMode.screenWidth;
- _videoMode.screenHeight = _oldVideoMode.screenHeight;
- _videoMode.overlayWidth = _oldVideoMode.overlayWidth;
- _videoMode.overlayHeight = _oldVideoMode.overlayHeight;
+ // DON'T use error(), as this tries to bring up the debug
+ // console, which WON'T WORK now that we might no have a
+ // proper screen.
+ warning("OpenGLGraphicsManager::endGFXTransaction: Could not load any graphics mode!");
+ g_system->quit();
}
- if (_videoMode.fullscreen == _oldVideoMode.fullscreen &&
- _videoMode.mode == _oldVideoMode.mode &&
- _videoMode.screenWidth == _oldVideoMode.screenWidth &&
- _videoMode.screenHeight == _oldVideoMode.screenHeight) {
+ // In case we reach this we have a valid state, yay.
+ _transactionMode = kTransactionNone;
+ _currentState.valid = true;
+ } while (_transactionMode == kTransactionRollback);
+
+ if (setupNewGameScreen) {
+ delete _gameScreen;
+ _gameScreen = nullptr;
- _oldVideoMode.setup = false;
+#ifdef USE_RGB_COLOR
+ _gameScreen = createTexture(_currentState.gameFormat);
+#else
+ _gameScreen = createTexture(Graphics::PixelFormat::createFormatCLUT8());
+#endif
+ assert(_gameScreen);
+ if (_gameScreen->hasPalette()) {
+ _gameScreen->setPalette(0, 256, _gamePalette);
}
- }
- if (_transactionDetails.sizeChanged || _transactionDetails.needRefresh) {
- unloadGFXMode();
- if (!loadGFXMode()) {
- if (_oldVideoMode.setup) {
- _transactionMode = kTransactionRollback;
- errors |= endGFXTransaction();
- }
+ _gameScreen->allocate(_currentState.gameWidth, _currentState.gameHeight);
+ _gameScreen->enableLinearFiltering(_currentState.graphicsMode == GFX_LINEAR);
+ // We fill the screen to all black or index 0 for CLUT8.
+#ifdef USE_RGB_COLOR
+ if (_currentState.gameFormat.bytesPerPixel == 1) {
+ _gameScreen->fill(0);
} else {
- clearOverlay();
-
- _videoMode.setup = true;
- _screenChangeCount++;
+ _gameScreen->fill(_gameScreen->getSurface()->format.RGBToColor(0, 0, 0));
}
-#ifdef USE_RGB_COLOR
- } else if (_transactionDetails.filterChanged || _transactionDetails.formatChanged) {
#else
- } else if (_transactionDetails.filterChanged) {
+ _gameScreen->fill(0);
#endif
- loadTextures();
- internUpdateScreen();
- } else if (_transactionDetails.needUpdatescreen) {
- internUpdateScreen();
}
- _transactionMode = kTransactionNone;
- return (OSystem::TransactionError)errors;
-}
+ // Update our display area and cursor scaling. This makes sure we pick up
+ // aspect ratio correction and game screen changes correctly.
+ recalculateDisplayArea();
+ recalculateCursorScaling();
-//
-// Screen
-//
+ // Something changed, so update the screen change ID.
+ ++_screenChangeID;
-int16 OpenGLGraphicsManager::getHeight() {
- return _videoMode.screenHeight;
+ // Since transactionError is a ORd list of TransactionErrors this is
+ // clearly wrong. But our API is simply broken.
+ return (OSystem::TransactionError)transactionError;
}
-int16 OpenGLGraphicsManager::getWidth() {
- return _videoMode.screenWidth;
+int OpenGLGraphicsManager::getScreenChangeID() const {
+ return _screenChangeID;
}
-void OpenGLGraphicsManager::setPalette(const byte *colors, uint start, uint num) {
- assert(colors);
-
+void OpenGLGraphicsManager::initSize(uint width, uint height, const Graphics::PixelFormat *format) {
+ Graphics::PixelFormat requestedFormat;
#ifdef USE_RGB_COLOR
- assert(_screenFormat.bytesPerPixel == 1);
+ if (!format) {
+ requestedFormat = Graphics::PixelFormat::createFormatCLUT8();
+ } else {
+ requestedFormat = *format;
+ }
+ _currentState.gameFormat = requestedFormat;
#endif
- // Save the screen palette
- memcpy(_gamePalette + start * 3, colors, num * 3);
+ _currentState.gameWidth = width;
+ _currentState.gameHeight = height;
+}
- _screenNeedsRedraw = true;
+int16 OpenGLGraphicsManager::getWidth() {
+ return _currentState.gameWidth;
+}
- if (_cursorPaletteDisabled)
- _cursorNeedsRedraw = true;
+int16 OpenGLGraphicsManager::getHeight() {
+ return _currentState.gameHeight;
}
-void OpenGLGraphicsManager::grabPalette(byte *colors, uint start, uint num) {
- assert(colors);
+void OpenGLGraphicsManager::copyRectToScreen(const void *buf, int pitch, int x, int y, int w, int h) {
+ _gameScreen->copyRectToTexture(x, y, w, h, buf, pitch);
+}
-#ifdef USE_RGB_COLOR
- assert(_screenFormat.bytesPerPixel == 1);
-#endif
+void OpenGLGraphicsManager::fillScreen(uint32 col) {
+ // FIXME: This does not conform to the OSystem specs because fillScreen
+ // is always taking CLUT8 color values and use color indexed mode. This is,
+ // however, plain odd and probably was a forgotten when we introduced
+ // RGB support. Thus, we simply do the "sane" thing here and hope OSystem
+ // gets fixed one day.
+ _gameScreen->fill(col);
+}
- // Copies current palette to buffer
- memcpy(colors, _gamePalette + start * 3, num * 3);
+void OpenGLGraphicsManager::setShakePos(int shakeOffset) {
+ _gameScreenShakeOffset = shakeOffset;
}
-void OpenGLGraphicsManager::copyRectToScreen(const void *buf, int pitch, int x, int y, int w, int h) {
- assert(x >= 0 && x < _screenData.w);
- assert(y >= 0 && y < _screenData.h);
- assert(h > 0 && y + h <= _screenData.h);
- assert(w > 0 && x + w <= _screenData.w);
-
- // Copy buffer data to game screen internal buffer
- const byte *src = (const byte *)buf;
- byte *dst = (byte *)_screenData.getBasePtr(x, y);
- for (int i = 0; i < h; i++) {
- memcpy(dst, src, w * _screenData.format.bytesPerPixel);
- src += pitch;
- dst += _screenData.pitch;
+void OpenGLGraphicsManager::updateScreen() {
+ if (!_gameScreen) {
+ return;
}
- // Extend dirty area if not full screen redraw is flagged
- if (!_screenNeedsRedraw) {
- const Common::Rect dirtyRect(x, y, x + w, y + h);
- _screenDirtyRect.extend(dirtyRect);
+ // Clear the screen buffer
+ GLCALL(glClear(GL_COLOR_BUFFER_BIT));
+
+ const GLfloat shakeOffset = _gameScreenShakeOffset * (GLfloat)_displayHeight / _gameScreen->getHeight();
+
+ // First step: Draw the (virtual) game screen.
+ _gameScreen->draw(_displayX, _displayY + shakeOffset, _displayWidth, _displayHeight);
+
+ // Second step: Draw the overlay if visible.
+ if (_overlayVisible) {
+ _overlay->draw(0, 0, _outputScreenWidth, _outputScreenHeight);
}
-}
-Graphics::Surface *OpenGLGraphicsManager::lockScreen() {
- return &_screenData;
-}
+ // Third step: Draw the cursor if visible.
+ if (_cursorVisible && _cursor) {
+ // Adjust game screen shake position, but only when the overlay is not
+ // visible.
+ const GLfloat cursorOffset = _overlayVisible ? 0 : shakeOffset;
-void OpenGLGraphicsManager::unlockScreen() {
- _screenNeedsRedraw = true;
-}
+ _cursor->draw(_cursorX - _cursorHotspotXScaled, _cursorY - _cursorHotspotYScaled + cursorOffset,
+ _cursorWidthScaled, _cursorHeightScaled);
+ }
-void OpenGLGraphicsManager::fillScreen(uint32 col) {
- if (_gameTexture == NULL)
- return;
+#ifdef USE_OSD
+ // Fourth step: Draw the OSD.
+ if (_osdAlpha > 0) {
+ Common::StackLock lock(_osdMutex);
-#ifdef USE_RGB_COLOR
- if (_screenFormat.bytesPerPixel == 1) {
- memset(_screenData.getPixels(), col, _screenData.h * _screenData.pitch);
- } else if (_screenFormat.bytesPerPixel == 2) {
- uint16 *pixels = (uint16 *)_screenData.getPixels();
- uint16 col16 = (uint16)col;
- for (int i = 0; i < _screenData.w * _screenData.h; i++) {
- pixels[i] = col16;
- }
- } else if (_screenFormat.bytesPerPixel == 3) {
- uint8 *pixels = (uint8 *)_screenData.getPixels();
- byte r = (col >> 16) & 0xFF;
- byte g = (col >> 8) & 0xFF;
- byte b = col & 0xFF;
- for (int i = 0; i < _screenData.w * _screenData.h; i++) {
- pixels[0] = r;
- pixels[1] = g;
- pixels[2] = b;
- pixels += 3;
- }
- } else if (_screenFormat.bytesPerPixel == 4) {
- uint32 *pixels = (uint32 *)_screenData.getPixels();
- for (int i = 0; i < _screenData.w * _screenData.h; i++) {
- pixels[i] = col;
+ // Update alpha value.
+ const int diff = g_system->getMillis(false) - _osdFadeStartTime;
+ if (diff > 0) {
+ if (diff >= kOSDFadeOutDuration) {
+ // Back to full transparency.
+ _osdAlpha = 0;
+ } else {
+ // Do a fade out.
+ _osdAlpha = kOSDInitialAlpha - diff * kOSDInitialAlpha / kOSDFadeOutDuration;
+ }
}
+
+ // Set the OSD transparency.
+ GLCALL(glColor4f(1.0f, 1.0f, 1.0f, _osdAlpha / 100.0f));
+
+ // Draw the OSD texture.
+ _osd->draw(0, 0, _outputScreenWidth, _outputScreenHeight);
+
+ // Reset color.
+ GLCALL(glColor4f(1.0f, 1.0f, 1.0f, 1.0f));
}
-#else
- memset(_screenData.getPixels(), col, _screenData.h * _screenData.pitch);
#endif
- _screenNeedsRedraw = true;
}
-void OpenGLGraphicsManager::updateScreen() {
- assert(_transactionMode == kTransactionNone);
- internUpdateScreen();
+Graphics::Surface *OpenGLGraphicsManager::lockScreen() {
+ return _gameScreen->getSurface();
}
-void OpenGLGraphicsManager::setShakePos(int shakeOffset) {
- assert(_transactionMode == kTransactionNone);
- _shakePos = shakeOffset;
+void OpenGLGraphicsManager::unlockScreen() {
+ _gameScreen->flagDirty();
}
-void OpenGLGraphicsManager::setFocusRectangle(const Common::Rect &rect) {
+void OpenGLGraphicsManager::setFocusRectangle(const Common::Rect& rect) {
}
void OpenGLGraphicsManager::clearFocusRectangle() {
}
-//
-// Overlay
-//
-
-void OpenGLGraphicsManager::showOverlay() {
- assert(_transactionMode == kTransactionNone);
+int16 OpenGLGraphicsManager::getOverlayWidth() {
+ if (_overlay) {
+ return _overlay->getWidth();
+ } else {
+ return 0;
+ }
+}
- if (_overlayVisible)
- return;
+int16 OpenGLGraphicsManager::getOverlayHeight() {
+ if (_overlay) {
+ return _overlay->getHeight();
+ } else {
+ return 0;
+ }
+}
+void OpenGLGraphicsManager::showOverlay() {
_overlayVisible = true;
-
- clearOverlay();
}
void OpenGLGraphicsManager::hideOverlay() {
- assert(_transactionMode == kTransactionNone);
-
- if (!_overlayVisible)
- return;
-
_overlayVisible = false;
-
- clearOverlay();
}
Graphics::PixelFormat OpenGLGraphicsManager::getOverlayFormat() const {
- return _overlayFormat;
+ return _overlay->getFormat();
}
-void OpenGLGraphicsManager::clearOverlay() {
- // Set all pixels to 0
- memset(_overlayData.getPixels(), 0, _overlayData.h * _overlayData.pitch);
- _overlayNeedsRedraw = true;
+void OpenGLGraphicsManager::copyRectToOverlay(const void *buf, int pitch, int x, int y, int w, int h) {
+ _overlay->copyRectToTexture(x, y, w, h, buf, pitch);
}
-void OpenGLGraphicsManager::grabOverlay(void *buf, int pitch) {
- const byte *src = (byte *)_overlayData.getPixels();
- byte *dst = (byte *)buf;
- for (int i = 0; i < _overlayData.h; i++) {
- // Copy overlay data to buffer
- memcpy(dst, src, _overlayData.pitch);
- dst += pitch;
- src += _overlayData.pitch;
- }
+void OpenGLGraphicsManager::clearOverlay() {
+ _overlay->fill(0);
}
-void OpenGLGraphicsManager::copyRectToOverlay(const void *buf, int pitch, int x, int y, int w, int h) {
- assert(_transactionMode == kTransactionNone);
-
- if (_overlayTexture == NULL)
- return;
-
- const byte *src = (const byte *)buf;
-
- // Clip the coordinates
- if (x < 0) {
- w += x;
- src -= x * 2;
- x = 0;
- }
-
- if (y < 0) {
- h += y;
- src -= y * pitch;
- y = 0;
- }
-
- if (w > _overlayData.w - x)
- w = _overlayData.w - x;
-
- if (h > _overlayData.h - y)
- h = _overlayData.h - y;
-
- if (w <= 0 || h <= 0)
- return;
+void OpenGLGraphicsManager::grabOverlay(void *buf, int pitch) {
+ const Graphics::Surface *overlayData = _overlay->getSurface();
- // Copy buffer data to internal overlay surface
- byte *dst = (byte *)_overlayData.getBasePtr(0, y);
- for (int i = 0; i < h; i++) {
- memcpy(dst + x * _overlayData.format.bytesPerPixel, src, w * _overlayData.format.bytesPerPixel);
- src += pitch;
- dst += _overlayData.pitch;
- }
+ const byte *src = (const byte *)overlayData->getPixels();
+ byte *dst = (byte *)buf;
- // Extend dirty area if not full screen redraw is flagged
- if (!_overlayNeedsRedraw) {
- const Common::Rect dirtyRect(x, y, x + w, y + h);
- _overlayDirtyRect.extend(dirtyRect);
+ for (uint h = overlayData->h; h > 0; --h) {
+ memcpy(dst, src, overlayData->w * overlayData->format.bytesPerPixel);
+ dst += pitch;
+ src += overlayData->pitch;
}
}
-int16 OpenGLGraphicsManager::getOverlayHeight() {
- return _videoMode.overlayHeight;
-}
-
-int16 OpenGLGraphicsManager::getOverlayWidth() {
- return _videoMode.overlayWidth;
-}
-
-//
-// Cursor
-//
-
bool OpenGLGraphicsManager::showMouse(bool visible) {
- if (_cursorVisible == visible)
- return visible;
-
bool last = _cursorVisible;
_cursorVisible = visible;
-
return last;
}
void OpenGLGraphicsManager::warpMouse(int x, int y) {
- int scaledX = x;
- int scaledY = y;
-
- int16 currentX = _cursorState.x;
- int16 currentY = _cursorState.y;
-
+ int16 currentX = _cursorX;
+ int16 currentY = _cursorY;
adjustMousePosition(currentX, currentY);
- // Do not adjust the real screen position, when the current game / overlay
- // coordinates match the requested coordinates. This avoids a slight
- // movement which might occur otherwise when the mouse is at a subpixel
- // position.
- if (x == currentX && y == currentY)
+ // Check whether the (virtual) coordinate actually changed. If not, then
+ // simply do nothing. This avoids ugly "jittering" due to the actual
+ // output screen having a bigger resolution than the virtual coordinates.
+ if (currentX == x && currentY == y) {
return;
+ }
- if (_videoMode.mode == OpenGL::GFX_NORMAL) {
- if (_videoMode.hardwareWidth != _videoMode.overlayWidth)
- scaledX = scaledX * _videoMode.hardwareWidth / _videoMode.overlayWidth;
- if (_videoMode.hardwareHeight != _videoMode.overlayHeight)
- scaledY = scaledY * _videoMode.hardwareHeight / _videoMode.overlayHeight;
-
- if (!_overlayVisible) {
- scaledX *= _videoMode.scaleFactor;
- scaledY *= _videoMode.scaleFactor;
+ // Scale the virtual coordinates into actual physical coordinates.
+ if (_overlayVisible) {
+ if (!_overlay) {
+ return;
}
+
+ // It might be confusing that we actually have to handle something
+ // here when the overlay is visible. This is because for very small
+ // resolutions we have a minimal overlay size and have to adjust
+ // for that.
+ x = (x * _outputScreenWidth) / _overlay->getWidth();
+ y = (y * _outputScreenHeight) / _overlay->getHeight();
} else {
- if (_overlayVisible) {
- if (_displayWidth != _videoMode.overlayWidth)
- scaledX = scaledX * _displayWidth / _videoMode.overlayWidth;
- if (_displayHeight != _videoMode.overlayHeight)
- scaledY = scaledY * _displayHeight / _videoMode.overlayHeight;
- } else {
- if (_displayWidth != _videoMode.screenWidth)
- scaledX = scaledX * _displayWidth / _videoMode.screenWidth;
- if (_displayHeight != _videoMode.screenHeight)
- scaledY = scaledY * _displayHeight / _videoMode.screenHeight;
+ if (!_gameScreen) {
+ return;
}
- scaledX += _displayX;
- scaledY += _displayY;
+ x = (x * _displayWidth) / _gameScreen->getWidth();
+ y = (y * _displayHeight) / _gameScreen->getHeight();
+
+ x += _displayX;
+ y += _displayY;
}
- setMousePosition(scaledX, scaledY);
- setInternalMousePosition(scaledX, scaledY);
+ setMousePosition(x, y);
+ setInternalMousePosition(x, y);
+}
+
+namespace {
+template<typename DstPixel, typename SrcPixel>
+void applyColorKey(DstPixel *dst, const SrcPixel *src, uint w, uint h, uint dstPitch, uint srcPitch, SrcPixel keyColor, DstPixel alphaMask) {
+ const uint srcAdd = srcPitch - w * sizeof(SrcPixel);
+ const uint dstAdd = dstPitch - w * sizeof(DstPixel);
+
+ while (h-- > 0) {
+ for (uint x = w; x > 0; --x, ++dst, ++src) {
+ if (*src == keyColor) {
+ *dst &= ~alphaMask;
+ }
+ }
+
+ dst = (DstPixel *)((byte *)dst + dstAdd);
+ src = (const SrcPixel *)((const byte *)src + srcAdd);
+ }
}
+} // End of anonymous namespace
void OpenGLGraphicsManager::setMouseCursor(const void *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, bool dontScale, const Graphics::PixelFormat *format) {
+ Graphics::PixelFormat inputFormat;
#ifdef USE_RGB_COLOR
- if (format)
- _cursorFormat = *format;
- else
- _cursorFormat = Graphics::PixelFormat::createFormatCLUT8();
+ if (format) {
+ inputFormat = *format;
+ } else {
+ inputFormat = Graphics::PixelFormat::createFormatCLUT8();
+ }
#else
- assert(keycolor <= 255);
- _cursorFormat = Graphics::PixelFormat::createFormatCLUT8();
+ inputFormat = Graphics::PixelFormat::createFormatCLUT8();
#endif
- // Allocate space for cursor data
- if (_cursorData.w != w || _cursorData.h != h ||
- _cursorData.format.bytesPerPixel != _cursorFormat.bytesPerPixel)
- _cursorData.create(w, h, _cursorFormat);
-
- // Save cursor data
- memcpy(_cursorData.getPixels(), buf, h * _cursorData.pitch);
+ // In case the color format has changed we will need to create the texture.
+ if (!_cursor || _cursor->getFormat() != inputFormat) {
+ delete _cursor;
+ _cursor = nullptr;
+
+ GLenum glIntFormat, glFormat, glType;
+
+ Graphics::PixelFormat textureFormat;
+ if (inputFormat.bytesPerPixel == 1 || (inputFormat.aBits() && getGLPixelFormat(inputFormat, glIntFormat, glFormat, glType))) {
+ // There is two cases when we can use the cursor format directly.
+ // The first is when it's CLUT8, here color key handling can
+ // always be applied because we use the alpha channel of
+ // _defaultFormatAlpha for that.
+ // The other is when the input format has alpha bits and
+ // furthermore is directly supported.
+ textureFormat = inputFormat;
+ } else {
+ textureFormat = _defaultFormatAlpha;
+ }
+ _cursor = createTexture(textureFormat, true);
+ assert(_cursor);
+ _cursor->enableLinearFiltering(_currentState.graphicsMode == GFX_LINEAR);
+ }
- // Set cursor info
- _cursorState.w = w;
- _cursorState.h = h;
- _cursorState.hotX = hotspotX;
- _cursorState.hotY = hotspotY;
_cursorKeyColor = keycolor;
+ _cursorHotspotX = hotspotX;
+ _cursorHotspotY = hotspotY;
_cursorDontScale = dontScale;
- _cursorNeedsRedraw = true;
- refreshCursorScale();
+ _cursor->allocate(w, h);
+ if (inputFormat.bytesPerPixel == 1) {
+ // For CLUT8 cursors we can simply copy the input data into the
+ // texture.
+ _cursor->copyRectToTexture(0, 0, w, h, buf, w * inputFormat.bytesPerPixel);
+ } else {
+ // Otherwise it is a bit more ugly because we have to handle a key
+ // color properly.
+
+ Graphics::Surface *dst = _cursor->getSurface();
+ const uint srcPitch = w * inputFormat.bytesPerPixel;
+
+ // Copy the cursor data to the actual texture surface. This will make
+ // sure that the data is also converted to the expected format.
+ Graphics::crossBlit((byte *)dst->getPixels(), (const byte *)buf, dst->pitch, srcPitch,
+ w, h, dst->format, inputFormat);
+
+ // We apply the color key by setting the alpha bits of the pixels to
+ // fully transparent.
+ const uint32 aMask = (0xFF >> dst->format.aLoss) << dst->format.aShift;
+ if (dst->format.bytesPerPixel == 2) {
+ if (inputFormat.bytesPerPixel == 2) {
+ applyColorKey<uint16, uint16>((uint16 *)dst->getPixels(), (const uint16 *)buf, w, h,
+ dst->pitch, srcPitch, keycolor, aMask);
+ } else if (inputFormat.bytesPerPixel == 4) {
+ applyColorKey<uint16, uint32>((uint16 *)dst->getPixels(), (const uint32 *)buf, w, h,
+ dst->pitch, srcPitch, keycolor, aMask);
+ }
+ } else {
+ if (inputFormat.bytesPerPixel == 2) {
+ applyColorKey<uint32, uint16>((uint32 *)dst->getPixels(), (const uint16 *)buf, w, h,
+ dst->pitch, srcPitch, keycolor, aMask);
+ } else if (inputFormat.bytesPerPixel == 4) {
+ applyColorKey<uint32, uint32>((uint32 *)dst->getPixels(), (const uint32 *)buf, w, h,
+ dst->pitch, srcPitch, keycolor, aMask);
+ }
+ }
+
+ // Flag the texture as dirty.
+ _cursor->flagDirty();
+ }
+
+ // In case we actually use a palette set that up properly.
+ if (inputFormat.bytesPerPixel == 1) {
+ updateCursorPalette();
+ }
+
+ // Update the scaling.
+ recalculateCursorScaling();
}
void OpenGLGraphicsManager::setCursorPalette(const byte *colors, uint start, uint num) {
- assert(colors);
+ // FIXME: For some reason client code assumes that usage of this function
+ // automatically enables the cursor palette.
+ _cursorPaletteEnabled = true;
- // Save the cursor palette
memcpy(_cursorPalette + start * 3, colors, num * 3);
-
- _cursorPaletteDisabled = false;
- _cursorNeedsRedraw = true;
+ updateCursorPalette();
}
-//
-// Misc
-//
-
void OpenGLGraphicsManager::displayMessageOnOSD(const char *msg) {
- assert(_transactionMode == kTransactionNone);
- assert(msg);
-
#ifdef USE_OSD
- // Split the message into separate lines.
- _osdLines.clear();
+ // HACK: Actually no client code should use graphics functions from
+ // another thread. But the MT-32 emulator still does, thus we need to
+ // make sure this doesn't happen while a updateScreen call is done.
+ Common::StackLock lock(_osdMutex);
+ // Slip up the lines.
+ Common::Array<Common::String> osdLines;
Common::StringTokenizer tokenizer(msg, "\n");
- while (!tokenizer.empty())
- _osdLines.push_back(tokenizer.nextToken());
+ while (!tokenizer.empty()) {
+ osdLines.push_back(tokenizer.nextToken());
+ }
- // Request update of the texture
- _requireOSDUpdate = true;
+ // Do the actual drawing like the SDL backend.
+ const Graphics::Font *font = getFontOSD();
+ Graphics::Surface *dst = _osd->getSurface();
+ _osd->fill(0);
+ _osd->flagDirty();
+
+ // Determine a rect which would contain the message string (clipped to the
+ // screen dimensions).
+ const int vOffset = 6;
+ const int lineSpacing = 1;
+ const int lineHeight = font->getFontHeight() + 2 * lineSpacing;
+ int width = 0;
+ int height = lineHeight * osdLines.size() + 2 * vOffset;
+ for (uint i = 0; i < osdLines.size(); i++) {
+ width = MAX(width, font->getStringWidth(osdLines[i]) + 14);
+ }
+
+ // Clip the rect
+ width = MIN<int>(width, dst->w);
+ height = MIN<int>(height, dst->h);
+
+ int dstX = (dst->w - width) / 2;
+ int dstY = (dst->h - height) / 2;
+
+ // Draw a dark gray rect.
+ const uint32 color = dst->format.RGBToColor(40, 40, 40);
+ dst->fillRect(Common::Rect(dstX, dstY, dstX + width, dstY + height), color);
+
+ // Render the message, centered, and in white
+ const uint32 white = dst->format.RGBToColor(255, 255, 255);
+ for (uint i = 0; i < osdLines.size(); ++i) {
+ font->drawString(dst, osdLines[i],
+ dstX, dstY + i * lineHeight + vOffset + lineSpacing, width,
+ white, Graphics::kTextAlignCenter);
+ }
- // Init the OSD display parameters, and the fade out
+ // Init the OSD display parameters.
_osdAlpha = kOSDInitialAlpha;
_osdFadeStartTime = g_system->getMillis() + kOSDFadeOutDelay;
#endif
}
-//
-// Intern
-//
+void OpenGLGraphicsManager::setPalette(const byte *colors, uint start, uint num) {
+ assert(_gameScreen->hasPalette());
-void OpenGLGraphicsManager::setFullscreenMode(bool enable) {
- assert(_transactionMode == kTransactionActive);
+ memcpy(_gamePalette + start * 3, colors, num * 3);
+ _gameScreen->setPalette(start, num, colors);
- if (_oldVideoMode.setup && _oldVideoMode.fullscreen == enable)
- return;
+ // We might need to update the cursor palette here.
+ updateCursorPalette();
+}
- if (_transactionMode == kTransactionActive) {
- _videoMode.fullscreen = enable;
- _transactionDetails.needRefresh = true;
- }
+void OpenGLGraphicsManager::grabPalette(byte *colors, uint start, uint num) {
+ assert(_gameScreen->hasPalette());
+
+ memcpy(colors, _gamePalette + start * 3, num * 3);
}
-void OpenGLGraphicsManager::refreshGameScreen() {
- if (_screenNeedsRedraw)
- _screenDirtyRect = Common::Rect(0, 0, _screenData.w, _screenData.h);
-
- int x = _screenDirtyRect.left;
- int y = _screenDirtyRect.top;
- int w = _screenDirtyRect.width();
- int h = _screenDirtyRect.height();
-
- if (_screenData.format.bytesPerPixel == 1) {
- // Create a temporary RGB888 surface
- byte *surface = new byte[w * h * 3];
-
- // Convert the paletted buffer to RGB888
- const byte *src = (byte *)_screenData.getBasePtr(0, y);
- src += x * _screenData.format.bytesPerPixel;
- byte *dst = surface;
- for (int i = 0; i < h; i++) {
- for (int j = 0; j < w; j++) {
- dst[0] = _gamePalette[src[j] * 3];
- dst[1] = _gamePalette[src[j] * 3 + 1];
- dst[2] = _gamePalette[src[j] * 3 + 2];
- dst += 3;
- }
- src += _screenData.pitch;
+void OpenGLGraphicsManager::setActualScreenSize(uint width, uint height) {
+ _outputScreenWidth = width;
+ _outputScreenHeight = height;
+
+ // Setup coordinates system.
+ GLCALL(glViewport(0, 0, _outputScreenWidth, _outputScreenHeight));
+
+ GLCALL(glMatrixMode(GL_PROJECTION));
+ GLCALL(glLoadIdentity());
+#ifdef USE_GLES
+ GLCALL(glOrthof(0, _outputScreenWidth, _outputScreenHeight, 0, -1, 1));
+#else
+ GLCALL(glOrtho(0, _outputScreenWidth, _outputScreenHeight, 0, -1, 1));
+#endif
+ GLCALL(glMatrixMode(GL_MODELVIEW));
+ GLCALL(glLoadIdentity());
+
+ uint overlayWidth = width;
+ uint overlayHeight = height;
+
+ // WORKAROUND: We can only support surfaces up to the maximum supported
+ // texture size. Thus, in case we encounter a physical size bigger than
+ // this maximum texture size we will simply use an overlay as big as
+ // possible and then scale it to the physical display size. This sounds
+ // bad but actually all recent chips should support full HD resolution
+ // anyway. Thus, it should not be a real issue for modern hardware.
+ if ( overlayWidth > (uint)Texture::getMaximumTextureSize()
+ || overlayHeight > (uint)Texture::getMaximumTextureSize()) {
+ const frac_t outputAspect = intToFrac(_outputScreenWidth) / _outputScreenHeight;
+
+ if (outputAspect > (frac_t)FRAC_ONE) {
+ overlayWidth = Texture::getMaximumTextureSize();
+ overlayHeight = intToFrac(overlayWidth) / outputAspect;
+ } else {
+ overlayHeight = Texture::getMaximumTextureSize();
+ overlayWidth = fracToInt(overlayHeight * outputAspect);
}
+ }
- // Update the texture
- _gameTexture->updateBuffer(surface, w * 3, x, y, w, h);
+ // HACK: We limit the minimal overlay size to 256x200, which is the
+ // minimum of the dimensions of the two resolutions 256x240 (NES) and
+ // 320x200 (many DOS games use this). This hopefully assure that our
+ // GUI has working layouts.
+ overlayWidth = MAX<uint>(overlayWidth, 256);
+ overlayHeight = MAX<uint>(overlayHeight, 200);
+
+ if (!_overlay || _overlay->getFormat() != _defaultFormatAlpha) {
+ delete _overlay;
+ _overlay = nullptr;
+
+ _overlay = createTexture(_defaultFormatAlpha);
+ assert(_overlay);
+ // We always filter the overlay with GL_LINEAR. This assures it's
+ // readable in case it needs to be scaled and does not affect it
+ // otherwise.
+ _overlay->enableLinearFiltering(true);
+ }
+ _overlay->allocate(overlayWidth, overlayHeight);
+ _overlay->fill(0);
- // Free the temp surface
- delete[] surface;
- } else {
- // Update the texture
- _gameTexture->updateBuffer((byte *)_screenData.getBasePtr(x, y), _screenData.pitch, x, y, w, h);
+#ifdef USE_OSD
+ if (!_osd || _osd->getFormat() != _defaultFormatAlpha) {
+ delete _osd;
+ _osd = nullptr;
+
+ _osd = createTexture(_defaultFormatAlpha);
+ assert(_osd);
+ // We always filter the osd with GL_LINEAR. This assures it's
+ // readable in case it needs to be scaled and does not affect it
+ // otherwise.
+ _osd->enableLinearFiltering(true);
}
+ _osd->allocate(_overlay->getWidth(), _overlay->getHeight());
+ _osd->fill(0);
+#endif
- _screenNeedsRedraw = false;
- _screenDirtyRect = Common::Rect();
+ // Re-setup the scaling for the screen and cursor
+ recalculateDisplayArea();
+ recalculateCursorScaling();
+
+ // Something changed, so update the screen change ID.
+ ++_screenChangeID;
}
-void OpenGLGraphicsManager::refreshOverlay() {
- if (_overlayNeedsRedraw)
- _overlayDirtyRect = Common::Rect(0, 0, _overlayData.w, _overlayData.h);
-
- int x = _overlayDirtyRect.left;
- int y = _overlayDirtyRect.top;
- int w = _overlayDirtyRect.width();
- int h = _overlayDirtyRect.height();
-
- if (_overlayData.format.bytesPerPixel == 1) {
- // Create a temporary RGB888 surface
- byte *surface = new byte[w * h * 3];
-
- // Convert the paletted buffer to RGB888
- const byte *src = (byte *)_overlayData.getBasePtr(0, y);
- src += x * _overlayData.format.bytesPerPixel;
- byte *dst = surface;
- for (int i = 0; i < h; i++) {
- for (int j = 0; j < w; j++) {
- dst[0] = _gamePalette[src[j] * 3];
- dst[1] = _gamePalette[src[j] * 3 + 1];
- dst[2] = _gamePalette[src[j] * 3 + 2];
- dst += 3;
- }
- src += _screenData.pitch;
- }
+void OpenGLGraphicsManager::notifyContextCreate(const Graphics::PixelFormat &defaultFormat, const Graphics::PixelFormat &defaultFormatAlpha) {
+ // Initialize all extensions.
+ initializeGLExtensions();
- // Update the texture
- _overlayTexture->updateBuffer(surface, w * 3, x, y, w, h);
+ // Disable 3D properties.
+ GLCALL(glDisable(GL_CULL_FACE));
+ GLCALL(glDisable(GL_DEPTH_TEST));
+ GLCALL(glDisable(GL_LIGHTING));
+ GLCALL(glDisable(GL_FOG));
+ GLCALL(glDisable(GL_DITHER));
+ GLCALL(glShadeModel(GL_FLAT));
+ GLCALL(glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST));
- // Free the temp surface
- delete[] surface;
- } else {
- // Update the texture
- _overlayTexture->updateBuffer((byte *)_overlayData.getBasePtr(x, y), _overlayData.pitch, x, y, w, h);
+ // Default to black as clear color.
+ GLCALL(glClearColor(0.0f, 0.0f, 0.0f, 0.0f));
+ GLCALL(glColor4f(1.0f, 1.0f, 1.0f, 1.0f));
+
+ // Setup alpha blend (for overlay and cursor).
+ GLCALL(glEnable(GL_BLEND));
+ GLCALL(glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA));
+
+ // Enable rendering with vertex and coord arrays.
+ GLCALL(glEnableClientState(GL_VERTEX_ARRAY));
+ GLCALL(glEnableClientState(GL_TEXTURE_COORD_ARRAY));
+
+ GLCALL(glEnable(GL_TEXTURE_2D));
+
+ // We use a "pack" alignment (when reading from textures) to 4 here,
+ // since the only place where we really use it is the BMP screenshot
+ // code and that requires the same alignment too.
+ GLCALL(glPixelStorei(GL_PACK_ALIGNMENT, 4));
+
+ // Query information needed by textures.
+ Texture::queryTextureInformation();
+
+ // Refresh the output screen dimensions if some are set up.
+ if (_outputScreenWidth != 0 && _outputScreenHeight != 0) {
+ setActualScreenSize(_outputScreenWidth, _outputScreenHeight);
}
- _overlayNeedsRedraw = false;
- _overlayDirtyRect = Common::Rect();
-}
+ // TODO: Should we try to convert textures into one of those formats if
+ // possible? For example, when _gameScreen is CLUT8 we might want to use
+ // defaultFormat now.
+ _defaultFormat = defaultFormat;
+ _defaultFormatAlpha = defaultFormatAlpha;
-void OpenGLGraphicsManager::refreshCursor() {
- _cursorNeedsRedraw = false;
-
- // Allocate a texture big enough for cursor
- _cursorTexture->allocBuffer(_cursorState.w, _cursorState.h);
-
- // Create a temporary RGBA8888 surface
- byte *surface = new byte[_cursorState.w * _cursorState.h * 4];
- memset(surface, 0, _cursorState.w * _cursorState.h * 4);
-
- byte *dst = surface;
-
- // Convert the paletted cursor to RGBA8888
- if (_cursorFormat.bytesPerPixel == 1) {
- // Select palette
- byte *palette;
- if (_cursorPaletteDisabled)
- palette = _gamePalette;
- else
- palette = _cursorPalette;
-
- // Convert the paletted cursor to RGBA8888
- const byte *src = (byte *)_cursorData.getPixels();
- for (int i = 0; i < _cursorState.w * _cursorState.h; i++) {
- // Check for keycolor
- if (src[i] != _cursorKeyColor) {
- dst[0] = palette[src[i] * 3];
- dst[1] = palette[src[i] * 3 + 1];
- dst[2] = palette[src[i] * 3 + 2];
- dst[3] = 255;
- }
- dst += 4;
- }
- } else {
- const bool gotNoAlpha = (_cursorFormat.aLoss == 8);
-
- // Convert the RGB cursor to RGBA8888
- if (_cursorFormat.bytesPerPixel == 2) {
- const uint16 *src = (uint16 *)_cursorData.getPixels();
- for (int i = 0; i < _cursorState.w * _cursorState.h; i++) {
- // Check for keycolor
- if (src[i] != _cursorKeyColor) {
- _cursorFormat.colorToARGB(src[i], dst[3], dst[0], dst[1], dst[2]);
-
- if (gotNoAlpha)
- dst[3] = 255;
- }
- dst += 4;
- }
- } else if (_cursorFormat.bytesPerPixel == 4) {
- const uint32 *src = (uint32 *)_cursorData.getPixels();
- for (int i = 0; i < _cursorState.w * _cursorState.h; i++) {
- // Check for keycolor
- if (src[i] != _cursorKeyColor) {
- _cursorFormat.colorToARGB(src[i], dst[3], dst[0], dst[1], dst[2]);
-
- if (gotNoAlpha)
- dst[3] = 255;
- }
- dst += 4;
- }
- }
+ if (_gameScreen) {
+ _gameScreen->recreateInternalTexture();
}
- // Update the texture with new cursor
- _cursorTexture->updateBuffer(surface, _cursorState.w * 4, 0, 0, _cursorState.w, _cursorState.h);
+ if (_overlay) {
+ _overlay->recreateInternalTexture();
+ }
+
+ if (_cursor) {
+ _cursor->recreateInternalTexture();
+ }
- // Free the temp surface
- delete[] surface;
+#ifdef USE_OSD
+ if (_osd) {
+ _osd->recreateInternalTexture();
+ }
+#endif
}
-void OpenGLGraphicsManager::refreshCursorScale() {
- // Calculate the scale factors of the screen.
- // We also totally ignore the aspect of the overlay cursor, since aspect
- // ratio correction only applies to the game screen.
- // TODO: It might make sense to always ignore scaling of the mouse cursor
- // when the overlay is visible.
- uint screenScaleFactorX = _videoMode.hardwareWidth * 10000 / _videoMode.screenWidth;
- uint screenScaleFactorY = _videoMode.hardwareHeight * 10000 / _videoMode.screenHeight;
-
- // Ignore scaling when the cursor should not be scaled.
- if (_cursorDontScale) {
- screenScaleFactorX = 10000;
- screenScaleFactorY = 10000;
+void OpenGLGraphicsManager::notifyContextDestroy() {
+ if (_gameScreen) {
+ _gameScreen->releaseInternalTexture();
}
- // Apply them (without any possible) aspect ratio correction to the
- // overlay.
- _cursorState.rW = (int16)(_cursorState.w * screenScaleFactorX / 10000);
- _cursorState.rH = (int16)(_cursorState.h * screenScaleFactorY / 10000);
- _cursorState.rHotX = (int16)(_cursorState.hotX * screenScaleFactorX / 10000);
- _cursorState.rHotY = (int16)(_cursorState.hotY * screenScaleFactorY / 10000);
-
- // Only apply scaling when it's desired.
- if (_cursorDontScale) {
- screenScaleFactorX = 10000;
- screenScaleFactorY = 10000;
- } else {
- // Make sure we properly scale the cursor according to the desired aspect.
- int width, height;
- calculateDisplaySize(width, height);
- screenScaleFactorX = (width * 10000 / _videoMode.screenWidth);
- screenScaleFactorY = (height * 10000 / _videoMode.screenHeight);
+ if (_overlay) {
+ _overlay->releaseInternalTexture();
}
- // Apply the scale cursor scaling for the game screen.
- _cursorState.vW = (int16)(_cursorState.w * screenScaleFactorX / 10000);
- _cursorState.vH = (int16)(_cursorState.h * screenScaleFactorY / 10000);
- _cursorState.vHotX = (int16)(_cursorState.hotX * screenScaleFactorX / 10000);
- _cursorState.vHotY = (int16)(_cursorState.hotY * screenScaleFactorY / 10000);
+ if (_cursor) {
+ _cursor->releaseInternalTexture();
+ }
+
+#ifdef USE_OSD
+ if (_osd) {
+ _osd->releaseInternalTexture();
+ }
+#endif
}
-void OpenGLGraphicsManager::calculateDisplaySize(int &width, int &height) {
- if (_videoMode.mode == OpenGL::GFX_ORIGINAL) {
- width = _videoMode.screenWidth;
- height = _videoMode.screenHeight;
- } else {
- width = _videoMode.hardwareWidth;
- height = _videoMode.hardwareHeight;
+void OpenGLGraphicsManager::adjustMousePosition(int16 &x, int16 &y) {
+ if (_overlayVisible) {
+ // It might be confusing that we actually have to handle something
+ // here when the overlay is visible. This is because for very small
+ // resolutions we have a minimal overlay size and have to adjust
+ // for that.
+ // This can also happen when the overlay is smaller than the actual
+ // display size because of texture size limitations.
+ if (_overlay) {
+ x = (x * _overlay->getWidth()) / _outputScreenWidth;
+ y = (y * _overlay->getHeight()) / _outputScreenHeight;
+ }
+ } else if (_gameScreen) {
+ x -= _displayX;
+ y -= _displayY;
+
+ const int16 width = _gameScreen->getWidth();
+ const int16 height = _gameScreen->getHeight();
- uint aspectRatio = (_videoMode.hardwareWidth * 10000 + 5000) / _videoMode.hardwareHeight;
- uint desiredAspectRatio = getAspectRatio();
+ x = (x * width) / _displayWidth;
+ y = (y * height) / _displayHeight;
- // Adjust one screen dimension for mantaining the aspect ratio
- if (aspectRatio < desiredAspectRatio)
- height = (width * 10000 + 5000) / desiredAspectRatio;
- else if (aspectRatio > desiredAspectRatio)
- width = (height * desiredAspectRatio + 5000) / 10000;
+ // Make sure we only supply valid coordinates.
+ x = CLIP<int16>(x, 0, width - 1);
+ y = CLIP<int16>(y, 0, height - 1);
}
}
-void OpenGLGraphicsManager::refreshDisplaySize() {
- calculateDisplaySize(_displayWidth, _displayHeight);
-
- // Adjust x and y for centering the screen
- _displayX = (_videoMode.hardwareWidth - _displayWidth) / 2;
- _displayY = (_videoMode.hardwareHeight - _displayHeight) / 2;
+Texture *OpenGLGraphicsManager::createTexture(const Graphics::PixelFormat &format, bool wantAlpha) {
+ GLenum glIntFormat, glFormat, glType;
+ if (format.bytesPerPixel == 1) {
+ const Graphics::PixelFormat &virtFormat = wantAlpha ? _defaultFormatAlpha : _defaultFormat;
+ const bool supported = getGLPixelFormat(virtFormat, glIntFormat, glFormat, glType);
+ if (!supported) {
+ return nullptr;
+ } else {
+ return new TextureCLUT8(glIntFormat, glFormat, glType, virtFormat);
+ }
+ } else {
+ const bool supported = getGLPixelFormat(format, glIntFormat, glFormat, glType);
+ if (!supported) {
+ return nullptr;
+ } else {
+ return new Texture(glIntFormat, glFormat, glType, format);
+ }
+ }
}
-void OpenGLGraphicsManager::getGLPixelFormat(Graphics::PixelFormat pixelFormat, byte &bpp, GLenum &intFormat, GLenum &glFormat, GLenum &gltype) {
+bool OpenGLGraphicsManager::getGLPixelFormat(const Graphics::PixelFormat &pixelFormat, GLenum &glIntFormat, GLenum &glFormat, GLenum &glType) const {
+#ifdef SCUMM_LITTLE_ENDIAN
+ if (pixelFormat == Graphics::PixelFormat(4, 8, 8, 8, 8, 0, 8, 16, 24)) { // ABGR8888
+#else
if (pixelFormat == Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0)) { // RGBA8888
- bpp = 4;
- intFormat = GL_RGBA;
+#endif
+ glIntFormat = GL_RGBA;
glFormat = GL_RGBA;
- gltype = GL_UNSIGNED_INT_8_8_8_8;
- } else if (pixelFormat == Graphics::PixelFormat(3, 8, 8, 8, 0, 16, 8, 0, 0)) { // RGB888
- bpp = 3;
- intFormat = GL_RGB;
- glFormat = GL_RGB;
- gltype = GL_UNSIGNED_BYTE;
+ glType = GL_UNSIGNED_BYTE;
+ return true;
} else if (pixelFormat == Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0)) { // RGB565
- bpp = 2;
- intFormat = GL_RGB;
+ glIntFormat = GL_RGB;
glFormat = GL_RGB;
- gltype = GL_UNSIGNED_SHORT_5_6_5;
- } else if (pixelFormat == Graphics::PixelFormat(2, 5, 5, 5, 1, 11, 6, 1, 0)) { // RGB5551
- bpp = 2;
- intFormat = GL_RGBA;
+ glType = GL_UNSIGNED_SHORT_5_6_5;
+ return true;
+ } else if (pixelFormat == Graphics::PixelFormat(2, 5, 5, 5, 1, 11, 6, 1, 0)) { // RGBA5551
+ glIntFormat = GL_RGBA;
glFormat = GL_RGBA;
- gltype = GL_UNSIGNED_SHORT_5_5_5_1;
+ glType = GL_UNSIGNED_SHORT_5_5_5_1;
+ return true;
} else if (pixelFormat == Graphics::PixelFormat(2, 4, 4, 4, 4, 12, 8, 4, 0)) { // RGBA4444
- bpp = 2;
- intFormat = GL_RGBA;
+ glIntFormat = GL_RGBA;
glFormat = GL_RGBA;
- gltype = GL_UNSIGNED_SHORT_4_4_4_4;
- } else if (pixelFormat.bytesPerPixel == 1) { // CLUT8
- // If uses a palette, create texture as RGB888. The pixel data will be converted
- // later.
- bpp = 3;
- intFormat = GL_RGB;
- glFormat = GL_RGB;
- gltype = GL_UNSIGNED_BYTE;
+ glType = GL_UNSIGNED_SHORT_4_4_4_4;
+ return true;
#ifndef USE_GLES
+#ifdef SCUMM_LITTLE_ENDIAN
+ } else if (pixelFormat == Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0)) { // RGBA8888
+ glIntFormat = GL_RGBA;
+ glFormat = GL_RGBA;
+ glType = GL_UNSIGNED_INT_8_8_8_8;
+ return true;
+#endif
} else if (pixelFormat == Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0)) { // RGB555
// GL_BGRA does not exist in every GLES implementation so should not be configured if
// USE_GLES is set.
- bpp = 2;
- intFormat = GL_RGB;
+ glIntFormat = GL_RGB;
glFormat = GL_BGRA;
- gltype = GL_UNSIGNED_SHORT_1_5_5_5_REV;
+ glType = GL_UNSIGNED_SHORT_1_5_5_5_REV;
+ return true;
} else if (pixelFormat == Graphics::PixelFormat(4, 8, 8, 8, 8, 16, 8, 0, 24)) { // ARGB8888
- bpp = 4;
- intFormat = GL_RGBA;
+ glIntFormat = GL_RGBA;
glFormat = GL_BGRA;
- gltype = GL_UNSIGNED_INT_8_8_8_8_REV;
+ glType = GL_UNSIGNED_INT_8_8_8_8_REV;
+ return true;
} else if (pixelFormat == Graphics::PixelFormat(2, 4, 4, 4, 4, 8, 4, 0, 12)) { // ARGB4444
- bpp = 2;
- intFormat = GL_RGBA;
+ glIntFormat = GL_RGBA;
glFormat = GL_BGRA;
- gltype = GL_UNSIGNED_SHORT_4_4_4_4_REV;
+ glType = GL_UNSIGNED_SHORT_4_4_4_4_REV;
+ return true;
+#ifdef SCUMM_BIG_ENDIAN
} else if (pixelFormat == Graphics::PixelFormat(4, 8, 8, 8, 8, 0, 8, 16, 24)) { // ABGR8888
- bpp = 4;
- intFormat = GL_RGBA;
+ glIntFormat = GL_RGBA;
glFormat = GL_RGBA;
- gltype = GL_UNSIGNED_INT_8_8_8_8_REV;
+ glType = GL_UNSIGNED_INT_8_8_8_8_REV;
+ return true;
+#endif
} else if (pixelFormat == Graphics::PixelFormat(4, 8, 8, 8, 8, 8, 16, 24, 0)) { // BGRA8888
- bpp = 4;
- intFormat = GL_RGBA;
+ glIntFormat = GL_RGBA;
glFormat = GL_BGRA;
- gltype = GL_UNSIGNED_BYTE;
- } else if (pixelFormat == Graphics::PixelFormat(3, 8, 8, 8, 0, 0, 8, 16, 0)) { // BGR888
- bpp = 3;
- intFormat = GL_RGB;
- glFormat = GL_BGR;
- gltype = GL_UNSIGNED_BYTE;
+ glType = GL_UNSIGNED_INT_8_8_8_8;
+ return true;
} else if (pixelFormat == Graphics::PixelFormat(2, 5, 6, 5, 0, 0, 5, 11, 0)) { // BGR565
- bpp = 2;
- intFormat = GL_RGB;
+ glIntFormat = GL_RGB;
glFormat = GL_BGR;
- gltype = GL_UNSIGNED_SHORT_5_6_5;
+ glType = GL_UNSIGNED_SHORT_5_6_5;
+ return true;
} else if (pixelFormat == Graphics::PixelFormat(2, 5, 5, 5, 1, 1, 6, 11, 0)) { // BGRA5551
- bpp = 2;
- intFormat = GL_RGBA;
+ glIntFormat = GL_RGBA;
glFormat = GL_BGRA;
- gltype = GL_UNSIGNED_SHORT_5_5_5_1;
+ glType = GL_UNSIGNED_SHORT_5_5_5_1;
+ return true;
} else if (pixelFormat == Graphics::PixelFormat(2, 4, 4, 4, 4, 0, 4, 8, 12)) { // ABGR4444
- bpp = 2;
- intFormat = GL_RGBA;
+ glIntFormat = GL_RGBA;
glFormat = GL_RGBA;
- gltype = GL_UNSIGNED_SHORT_4_4_4_4_REV;
+ glType = GL_UNSIGNED_SHORT_4_4_4_4_REV;
+ return true;
} else if (pixelFormat == Graphics::PixelFormat(2, 4, 4, 4, 4, 4, 8, 12, 0)) { // BGRA4444
- bpp = 2;
- intFormat = GL_RGBA;
+ glIntFormat = GL_RGBA;
glFormat = GL_BGRA;
- gltype = GL_UNSIGNED_SHORT_4_4_4_4;
+ glType = GL_UNSIGNED_SHORT_4_4_4_4;
+ return true;
#endif
} else {
- error("OpenGLGraphicsManager: Pixel format not supported");
+ return false;
}
}
-void OpenGLGraphicsManager::internUpdateScreen() {
- // Clear the screen buffer
- glClear(GL_COLOR_BUFFER_BIT); CHECK_GL_ERROR();
-
- if (_screenNeedsRedraw || !_screenDirtyRect.isEmpty())
- // Refresh texture if dirty
- refreshGameScreen();
-
- int scaleFactor = _videoMode.hardwareHeight / _videoMode.screenHeight;
-
- glPushMatrix();
-
- // Adjust game screen shake position
- glTranslatef(0, _shakePos * scaleFactor, 0); CHECK_GL_ERROR();
-
- // Draw the game screen
- _gameTexture->drawTexture(_displayX, _displayY, _displayWidth, _displayHeight);
-
- glPopMatrix();
-
- if (_overlayVisible) {
- if (_overlayNeedsRedraw || !_overlayDirtyRect.isEmpty())
- // Refresh texture if dirty
- refreshOverlay();
-
- // Draw the overlay
- _overlayTexture->drawTexture(0, 0, _videoMode.overlayWidth, _videoMode.overlayHeight);
- }
-
- if (_cursorVisible) {
- if (_cursorNeedsRedraw)
- // Refresh texture if dirty
- refreshCursor();
+frac_t OpenGLGraphicsManager::getDesiredGameScreenAspect() const {
+ const uint width = _currentState.gameWidth;
+ const uint height = _currentState.gameHeight;
- glPushMatrix();
-
- // Adjust mouse shake position, unless the overlay is visible
- glTranslatef(0, _overlayVisible ? 0 : _shakePos * scaleFactor, 0); CHECK_GL_ERROR();
-
- // Draw the cursor
- if (_overlayVisible)
- _cursorTexture->drawTexture(_cursorState.x - _cursorState.rHotX,
- _cursorState.y - _cursorState.rHotY, _cursorState.rW, _cursorState.rH);
- else
- _cursorTexture->drawTexture(_cursorState.x - _cursorState.vHotX,
- _cursorState.y - _cursorState.vHotY, _cursorState.vW, _cursorState.vH);
-
- glPopMatrix();
- }
-
-#ifdef USE_OSD
- if (_osdAlpha > 0) {
- if (_requireOSDUpdate) {
- updateOSD();
- _requireOSDUpdate = false;
- }
-
- // Update alpha value
- const int diff = g_system->getMillis() - _osdFadeStartTime;
- if (diff > 0) {
- if (diff >= kOSDFadeOutDuration) {
- // Back to full transparency
- _osdAlpha = 0;
- } else {
- // Do a fade out
- _osdAlpha = kOSDInitialAlpha - diff * kOSDInitialAlpha / kOSDFadeOutDuration;
- }
+ if (_currentState.aspectRatioCorrection) {
+ // In case we enable aspect ratio correction we force a 4/3 ratio.
+ // But just for 320x200 and 640x400 games, since other games do not need
+ // this.
+ if ((width == 320 && height == 200) || (width == 640 && height == 400)) {
+ return intToFrac(4) / 3;
}
- // Set the osd transparency
- glColor4f(1.0f, 1.0f, 1.0f, _osdAlpha / 100.0f); CHECK_GL_ERROR();
-
- // Draw the osd texture
- _osdTexture->drawTexture(0, 0, _videoMode.hardwareWidth, _videoMode.hardwareHeight);
-
- // Reset color
- glColor4f(1.0f, 1.0f, 1.0f, 1.0f); CHECK_GL_ERROR();
}
-#endif
-}
-
-void OpenGLGraphicsManager::initGL() {
- // Check available GL Extensions
- GLTexture::initGLExtensions();
-
- // Disable 3D properties
- glDisable(GL_CULL_FACE); CHECK_GL_ERROR();
- glDisable(GL_DEPTH_TEST); CHECK_GL_ERROR();
- glDisable(GL_LIGHTING); CHECK_GL_ERROR();
- glDisable(GL_FOG); CHECK_GL_ERROR();
- glDisable(GL_DITHER); CHECK_GL_ERROR();
- glShadeModel(GL_FLAT); CHECK_GL_ERROR();
- glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST); CHECK_GL_ERROR();
-
- // Setup alpha blend (For overlay and cursor)
- glEnable(GL_BLEND); CHECK_GL_ERROR();
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); CHECK_GL_ERROR();
-
- // Enable rendering with vertex and coord arrays
- glEnableClientState(GL_VERTEX_ARRAY); CHECK_GL_ERROR();
- glEnableClientState(GL_TEXTURE_COORD_ARRAY); CHECK_GL_ERROR();
- glEnable(GL_TEXTURE_2D); CHECK_GL_ERROR();
-
- // Setup the GL viewport
- glViewport(0, 0, _videoMode.hardwareWidth, _videoMode.hardwareHeight); CHECK_GL_ERROR();
-
- // Setup coordinates system
- glMatrixMode(GL_PROJECTION); CHECK_GL_ERROR();
- glLoadIdentity(); CHECK_GL_ERROR();
-#ifdef USE_GLES
- glOrthof(0, _videoMode.hardwareWidth, _videoMode.hardwareHeight, 0, -1, 1); CHECK_GL_ERROR();
-#else
- glOrtho(0, _videoMode.hardwareWidth, _videoMode.hardwareHeight, 0, -1, 1); CHECK_GL_ERROR();
-#endif
- glMatrixMode(GL_MODELVIEW); CHECK_GL_ERROR();
- glLoadIdentity(); CHECK_GL_ERROR();
+ return intToFrac(width) / height;
}
-void OpenGLGraphicsManager::loadTextures() {
-#ifdef USE_RGB_COLOR
- if (_transactionDetails.formatChanged && _gameTexture) {
- delete _gameTexture;
- _gameTexture = 0;
+void OpenGLGraphicsManager::recalculateDisplayArea() {
+ if (!_gameScreen || _outputScreenHeight == 0) {
+ return;
}
-#endif
- if (!_gameTexture) {
- byte bpp;
- GLenum intformat;
- GLenum format;
- GLenum type;
-#ifdef USE_RGB_COLOR
- getGLPixelFormat(_screenFormat, bpp, intformat, format, type);
-#else
- getGLPixelFormat(Graphics::PixelFormat::createFormatCLUT8(), bpp, intformat, format, type);
-#endif
- _gameTexture = new GLTexture(bpp, intformat, format, type);
- } else
- _gameTexture->refresh();
-
- _overlayFormat = Graphics::PixelFormat(2, 5, 5, 5, 1, 11, 6, 1, 0);
-
- if (!_overlayTexture) {
- byte bpp;
- GLenum intformat;
- GLenum format;
- GLenum type;
- getGLPixelFormat(_overlayFormat, bpp, intformat, format, type);
- _overlayTexture = new GLTexture(bpp, intformat, format, type);
- } else
- _overlayTexture->refresh();
-
- if (!_cursorTexture)
- _cursorTexture = new GLTexture(4, GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE);
- else
- _cursorTexture->refresh();
-
- GLint filter = _videoMode.antialiasing ? GL_LINEAR : GL_NEAREST;
- _gameTexture->setFilter(filter);
- _overlayTexture->setFilter(filter);
- _cursorTexture->setFilter(filter);
-
- // Allocate texture memory and finish refreshing
- _gameTexture->allocBuffer(_videoMode.screenWidth, _videoMode.screenHeight);
- _overlayTexture->allocBuffer(_videoMode.overlayWidth, _videoMode.overlayHeight);
- _cursorTexture->allocBuffer(_cursorState.w, _cursorState.h);
-
- if (
-#ifdef USE_RGB_COLOR
- _transactionDetails.formatChanged ||
-#endif
- _oldVideoMode.screenWidth != _videoMode.screenWidth ||
- _oldVideoMode.screenHeight != _videoMode.screenHeight)
- _screenData.create(_videoMode.screenWidth, _videoMode.screenHeight,
-#ifdef USE_RGB_COLOR
- _screenFormat
-#else
- Graphics::PixelFormat::createFormatCLUT8()
-#endif
- );
-
-
- if (_oldVideoMode.overlayWidth != _videoMode.overlayWidth ||
- _oldVideoMode.overlayHeight != _videoMode.overlayHeight)
- _overlayData.create(_videoMode.overlayWidth, _videoMode.overlayHeight,
- _overlayFormat);
+ const frac_t outputAspect = intToFrac(_outputScreenWidth) / _outputScreenHeight;
+ const frac_t desiredAspect = getDesiredGameScreenAspect();
- _screenNeedsRedraw = true;
- _overlayNeedsRedraw = true;
- _cursorNeedsRedraw = true;
+ _displayWidth = _outputScreenWidth;
+ _displayHeight = _outputScreenHeight;
- // We need to setup a proper unpack alignment value here, else we will
- // get problems with the texture updates, in case the surface data is
- // not properly aligned.
- // It is noteworthy this assumes the OSD uses the same BPP as the overlay
- // and that the cursor works with any alignment setting.
- int newAlignment = Common::gcd(_gameTexture->getBytesPerPixel(), _overlayTexture->getBytesPerPixel());
- assert(newAlignment == 1 || newAlignment == 2 || newAlignment == 4);
- glPixelStorei(GL_UNPACK_ALIGNMENT, newAlignment);
-
- // We use a "pack" alignment (when reading from textures) to 4 here,
- // since the only place where we really use it is the BMP screenshot
- // code and that requires the same alignment too.
- glPixelStorei(GL_PACK_ALIGNMENT, 4);
-
-#ifdef USE_OSD
- if (!_osdTexture)
- _osdTexture = new GLTexture(2, GL_RGBA, GL_RGBA, GL_UNSIGNED_SHORT_5_5_5_1);
- else
- _osdTexture->refresh();
-
- _osdTexture->allocBuffer(_videoMode.overlayWidth, _videoMode.overlayHeight);
+ // Adjust one dimension for mantaining the aspect ratio.
+ if (outputAspect < desiredAspect) {
+ _displayHeight = intToFrac(_displayWidth) / desiredAspect;
+ } else if (outputAspect > desiredAspect) {
+ _displayWidth = fracToInt(_displayHeight * desiredAspect);
+ }
- // Update the OSD in case it is used right now
- _requireOSDUpdate = true;
-#endif
+ // We center the screen in the middle for now.
+ _displayX = (_outputScreenWidth - _displayWidth ) / 2;
+ _displayY = (_outputScreenHeight - _displayHeight) / 2;
}
-bool OpenGLGraphicsManager::loadGFXMode() {
- // Initialize OpenGL settings
- initGL();
-
- loadTextures();
-
- refreshCursorScale();
-
- refreshDisplaySize();
-
- internUpdateScreen();
-
- return true;
-}
+void OpenGLGraphicsManager::updateCursorPalette() {
+ if (!_cursor || !_cursor->hasPalette()) {
+ return;
+ }
-void OpenGLGraphicsManager::unloadGFXMode() {
+ if (_cursorPaletteEnabled) {
+ _cursor->setPalette(0, 256, _cursorPalette);
+ } else {
+ _cursor->setPalette(0, 256, _gamePalette);
+ }
+ // We remove all alpha bits from the palette entry of the color key.
+ // This makes sure its properly handled as color key.
+ const Graphics::PixelFormat &hardwareFormat = _cursor->getHardwareFormat();
+ const uint32 aMask = (0xFF >> hardwareFormat.aLoss) << hardwareFormat.aShift;
+
+ if (hardwareFormat.bytesPerPixel == 2) {
+ uint16 *palette = (uint16 *)_cursor->getPalette() + _cursorKeyColor;
+ *palette &= ~aMask;
+ } else if (hardwareFormat.bytesPerPixel == 4) {
+ uint32 *palette = (uint32 *)_cursor->getPalette() + _cursorKeyColor;
+ *palette &= ~aMask;
+ } else {
+ warning("OpenGLGraphicsManager::updateCursorPalette: Unsupported pixel depth %d", hardwareFormat.bytesPerPixel);
+ }
}
-void OpenGLGraphicsManager::setScale(int newScale) {
- assert(_transactionMode == kTransactionActive);
-
- if (newScale == _videoMode.scaleFactor)
+void OpenGLGraphicsManager::recalculateCursorScaling() {
+ if (!_cursor || !_gameScreen) {
return;
+ }
- _videoMode.scaleFactor = newScale;
- _transactionDetails.sizeChanged = true;
-}
+ // By default we use the unscaled versions.
+ _cursorHotspotXScaled = _cursorHotspotX;
+ _cursorHotspotYScaled = _cursorHotspotY;
+ _cursorWidthScaled = _cursor->getWidth();
+ _cursorHeightScaled = _cursor->getHeight();
-void OpenGLGraphicsManager::toggleAntialiasing() {
- assert(_transactionMode == kTransactionActive);
+ // In case scaling is actually enabled we will scale the cursor according
+ // to the game screen.
+ if (!_cursorDontScale) {
+ const frac_t screenScaleFactorX = intToFrac(_displayWidth) / _gameScreen->getWidth();
+ const frac_t screenScaleFactorY = intToFrac(_displayHeight) / _gameScreen->getHeight();
- _videoMode.antialiasing = !_videoMode.antialiasing;
- _transactionDetails.filterChanged = true;
-}
+ _cursorHotspotXScaled = fracToInt(_cursorHotspotXScaled * screenScaleFactorX);
+ _cursorWidthScaled = fracToInt(_cursorWidthScaled * screenScaleFactorX);
-uint OpenGLGraphicsManager::getAspectRatio() const {
- // In case we enable aspect ratio correction we force a 4/3 ratio.
- // But just for 320x200 and 640x400 games, since other games do not need
- // this.
- // TODO: This makes OpenGL Normal behave like OpenGL Conserve, when aspect
- // ratio correction is enabled, but it's better than the previous 4/3 mode
- // mess at least...
- if (_videoMode.aspectRatioCorrection
- && ((_videoMode.screenWidth == 320 && _videoMode.screenHeight == 200)
- || (_videoMode.screenWidth == 640 && _videoMode.screenHeight == 400)))
- return 13333;
- else if (_videoMode.mode == OpenGL::GFX_NORMAL)
- return _videoMode.hardwareWidth * 10000 / _videoMode.hardwareHeight;
- else
- return _videoMode.screenWidth * 10000 / _videoMode.screenHeight;
+ _cursorHotspotYScaled = fracToInt(_cursorHotspotYScaled * screenScaleFactorY);
+ _cursorHeightScaled = fracToInt(_cursorHeightScaled * screenScaleFactorY);
+ }
}
-void OpenGLGraphicsManager::adjustMousePosition(int16 &x, int16 &y) {
- if (_overlayVisible)
- return;
-
- x -= _displayX;
- y -= _displayY;
-
- if (_displayWidth != _videoMode.screenWidth)
- x = x * _videoMode.screenWidth / _displayWidth;
- if (_displayHeight != _videoMode.screenHeight)
- y = y * _videoMode.screenHeight / _displayHeight;
+#ifdef USE_OSD
+const Graphics::Font *OpenGLGraphicsManager::getFontOSD() {
+ return FontMan.getFontByUsage(Graphics::FontManager::kLocalizedFont);
}
+#endif
-bool OpenGLGraphicsManager::saveScreenshot(const char *filename) {
- int width = _videoMode.hardwareWidth;
- int height = _videoMode.hardwareHeight;
+void OpenGLGraphicsManager::saveScreenshot(const Common::String &filename) const {
+ const uint width = _outputScreenWidth;
+ const uint height = _outputScreenHeight;
// A line of a BMP image must have a size divisible by 4.
// We calculate the padding bytes needed here.
// Since we use a 3 byte per pixel mode, we can use width % 4 here, since
// it is equal to 4 - (width * 3) % 4. (4 - (width * Bpp) % 4, is the
// usual way of computing the padding bytes required).
- const int linePaddingSize = width % 4;
- const int lineSize = width * 3 + linePaddingSize;
+ const uint linePaddingSize = width % 4;
+ const uint lineSize = width * 3 + linePaddingSize;
// Allocate memory for screenshot
uint8 *pixels = new uint8[lineSize * height];
// Get pixel data from OpenGL buffer
-#ifdef USE_GLES
- glReadPixels(0, 0, width, height, GL_RGB, GL_UNSIGNED_BYTE, pixels); CHECK_GL_ERROR();
-#else
- if (_formatBGR) {
- glReadPixels(0, 0, width, height, GL_BGR, GL_UNSIGNED_BYTE, pixels); CHECK_GL_ERROR();
- } else {
- glReadPixels(0, 0, width, height, GL_RGB, GL_UNSIGNED_BYTE, pixels); CHECK_GL_ERROR();
+ GLCALL(glReadPixels(0, 0, width, height, GL_RGB, GL_UNSIGNED_BYTE, pixels));
+
+ // BMP stores as BGR. Since we can't assume that GL_BGR is supported we
+ // will swap the components from the RGB we read to BGR on our own.
+ for (uint y = height; y-- > 0;) {
+ uint8 *line = pixels + y * lineSize;
+
+ for (uint x = width; x > 0; --x, line += 3) {
+ SWAP(line[0], line[2]);
+ }
}
-#endif
// Open file
Common::DumpFile out;
@@ -1324,73 +1161,6 @@ bool OpenGLGraphicsManager::saveScreenshot(const char *filename) {
// Free allocated memory
delete[] pixels;
-
- return true;
}
-const char *OpenGLGraphicsManager::getCurrentModeName() {
- const char *modeName = 0;
- const OSystem::GraphicsMode *g = getSupportedGraphicsModes();
- while (g->name) {
- if (g->id == _videoMode.mode) {
- modeName = g->description;
- break;
- }
- g++;
- }
- return modeName;
-}
-
-#ifdef USE_OSD
-const Graphics::Font *OpenGLGraphicsManager::getFontOSD() {
- return FontMan.getFontByUsage(Graphics::FontManager::kLocalizedFont);
-}
-
-void OpenGLGraphicsManager::updateOSD() {
- // The font we are going to use:
- const Graphics::Font *font = getFontOSD();
-
- if (_osdSurface.w != _osdTexture->getWidth() || _osdSurface.h != _osdTexture->getHeight())
- _osdSurface.create(_osdTexture->getWidth(), _osdTexture->getHeight(), _overlayFormat);
- else
- // Clear everything
- memset(_osdSurface.getPixels(), 0, _osdSurface.h * _osdSurface.pitch);
-
- // Determine a rect which would contain the message string (clipped to the
- // screen dimensions).
- const int vOffset = 6;
- const int lineSpacing = 1;
- const int lineHeight = font->getFontHeight() + 2 * lineSpacing;
- int width = 0;
- int height = lineHeight * _osdLines.size() + 2 * vOffset;
- for (uint i = 0; i < _osdLines.size(); i++) {
- width = MAX(width, font->getStringWidth(_osdLines[i]) + 14);
- }
-
- // Clip the rect
- if (width > _osdSurface.w)
- width = _osdSurface.w;
- if (height > _osdSurface.h)
- height = _osdSurface.h;
-
- int dstX = (_osdSurface.w - width) / 2;
- int dstY = (_osdSurface.h - height) / 2;
-
- // Draw a dark gray rect (R = 40, G = 40, B = 40)
- const uint16 color = 0x294B;
- _osdSurface.fillRect(Common::Rect(dstX, dstY, dstX + width, dstY + height), color);
-
- // Render the message, centered, and in white
- for (uint i = 0; i < _osdLines.size(); i++) {
- font->drawString(&_osdSurface, _osdLines[i],
- dstX, dstY + i * lineHeight + vOffset + lineSpacing, width,
- 0xFFFF, Graphics::kTextAlignCenter);
- }
-
- // Update the texture
- _osdTexture->updateBuffer(_osdSurface.getPixels(), _osdSurface.pitch, 0, 0,
- _osdSurface.w, _osdSurface.h);
-}
-#endif
-
-#endif
+} // End of namespace OpenGL
diff --git a/backends/graphics/opengl/opengl-graphics.h b/backends/graphics/opengl/opengl-graphics.h
index 9d8d418d11..d16f92d148 100644
--- a/backends/graphics/opengl/opengl-graphics.h
+++ b/backends/graphics/opengl/opengl-graphics.h
@@ -8,338 +8,483 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
-#ifndef BACKENDS_GRAPHICS_OPENGL_H
-#define BACKENDS_GRAPHICS_OPENGL_H
+#ifndef BACKENDS_GRAPHICS_OPENGL_OPENGL_GRAPHICS_H
+#define BACKENDS_GRAPHICS_OPENGL_OPENGL_GRAPHICS_H
-#include "backends/graphics/opengl/gltexture.h"
+#include "backends/graphics/opengl/opengl-sys.h"
#include "backends/graphics/graphics.h"
-#include "common/array.h"
-#include "common/rect.h"
-#include "graphics/font.h"
-#include "graphics/pixelformat.h"
-// Uncomment this to enable the 'on screen display' code.
-#define USE_OSD 1
+#include "common/frac.h"
+#include "common/mutex.h"
+
+namespace Graphics {
+class Font;
+} // End of namespace Graphics
namespace OpenGL {
-// The OpenGL GFX modes. They have to be inside the OpenGL namespace so they
-// do not clash with the SDL GFX modes.
+
+// HACK: We use glColor in the OSD code. This might not be working on GL ES but
+// we still enable it because Tizen already shipped with it. Also, the
+// SurfaceSDL backend enables it and disabling it can cause issues in sdl.cpp.
+#define USE_OSD 1
+
+class Texture;
+
enum {
- GFX_NORMAL = 0,
- GFX_CONSERVE = 1,
- GFX_ORIGINAL = 2
+ GFX_LINEAR = 0,
+ GFX_NEAREST = 1
};
-}
-
-/**
- * OpenGL graphics manager. This is an abstract class, it does not do the
- * window and OpenGL context initialization.
- * Derived classes should at least override internUpdateScreen for doing
- * the buffers swap, and implement loadGFXMode for handling the window/context if
- * needed. If USE_RGB_COLOR is enabled, getSupportedFormats must be implemented.
- */
-class OpenGLGraphicsManager : public GraphicsManager {
+class OpenGLGraphicsManager : virtual public GraphicsManager {
public:
OpenGLGraphicsManager();
virtual ~OpenGLGraphicsManager();
+ // GraphicsManager API
virtual bool hasFeature(OSystem::Feature f);
virtual void setFeatureState(OSystem::Feature f, bool enable);
virtual bool getFeatureState(OSystem::Feature f);
- static const OSystem::GraphicsMode *supportedGraphicsModes();
virtual const OSystem::GraphicsMode *getSupportedGraphicsModes() const;
virtual int getDefaultGraphicsMode() const;
virtual bool setGraphicsMode(int mode);
virtual int getGraphicsMode() const;
- virtual void resetGraphicsScale();
+
+ virtual void resetGraphicsScale() {}
+
#ifdef USE_RGB_COLOR
virtual Graphics::PixelFormat getScreenFormat() const;
virtual Common::List<Graphics::PixelFormat> getSupportedFormats() const = 0;
#endif
- virtual void initSize(uint width, uint height, const Graphics::PixelFormat *format = NULL);
- virtual int getScreenChangeID() const;
virtual void beginGFXTransaction();
virtual OSystem::TransactionError endGFXTransaction();
- virtual int16 getHeight();
+ virtual int getScreenChangeID() const;
+
+ virtual void initSize(uint width, uint height, const Graphics::PixelFormat *format);
+
virtual int16 getWidth();
-protected:
- // PaletteManager API
- virtual void setPalette(const byte *colors, uint start, uint num);
- virtual void grabPalette(byte *colors, uint start, uint num);
+ virtual int16 getHeight();
-public:
virtual void copyRectToScreen(const void *buf, int pitch, int x, int y, int w, int h);
- virtual Graphics::Surface *lockScreen();
- virtual void unlockScreen();
virtual void fillScreen(uint32 col);
- virtual void updateScreen();
+
virtual void setShakePos(int shakeOffset);
- virtual void setFocusRectangle(const Common::Rect &rect);
+
+ virtual void updateScreen();
+
+ virtual Graphics::Surface *lockScreen();
+ virtual void unlockScreen();
+
+ virtual void setFocusRectangle(const Common::Rect& rect);
virtual void clearFocusRectangle();
+ virtual int16 getOverlayWidth();
+ virtual int16 getOverlayHeight();
+
virtual void showOverlay();
virtual void hideOverlay();
+
virtual Graphics::PixelFormat getOverlayFormat() const;
+
+ virtual void copyRectToOverlay(const void *buf, int pitch, int x, int y, int w, int h);
virtual void clearOverlay();
virtual void grabOverlay(void *buf, int pitch);
- virtual void copyRectToOverlay(const void *buf, int pitch, int x, int y, int w, int h);
- virtual int16 getOverlayHeight();
- virtual int16 getOverlayWidth();
virtual bool showMouse(bool visible);
virtual void warpMouse(int x, int y);
- virtual void setMouseCursor(const void *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, bool dontScale = false, const Graphics::PixelFormat *format = NULL);
+ virtual void setMouseCursor(const void *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, bool dontScale, const Graphics::PixelFormat *format);
virtual void setCursorPalette(const byte *colors, uint start, uint num);
virtual void displayMessageOnOSD(const char *msg);
+
+ // PaletteManager interface
+ virtual void setPalette(const byte *colors, uint start, uint num);
+ virtual void grabPalette(byte *colors, uint start, uint num);
+
protected:
/**
- * Setup OpenGL settings
+ * Set up the actual screen size available for the OpenGL code to do any
+ * drawing.
+ *
+ * @param width The width of the screen.
+ * @param height The height of the screen.
+ */
+ void setActualScreenSize(uint width, uint height);
+
+ /**
+ * Notify the manager of a OpenGL context change. This should be the first
+ * thing to call after you created an OpenGL (ES) context!
+ *
+ * @param defaultFormat The new default format for the game screen
+ * (this is used for the CLUT8 game screens).
+ * @param defaultFromatAlpha The new default format with an alpha channel
+ * (this is used for the overlay and cursor).
+ */
+ void notifyContextCreate(const Graphics::PixelFormat &defaultFormat, const Graphics::PixelFormat &defaultFormatAlpha);
+
+ /**
+ * Notify the manager that the OpenGL context is about to be destroyed.
+ * This will free up/reset internal OpenGL related state and *must* be
+ * called whenever a context might be created again after destroying a
+ * context.
*/
- virtual void initGL();
+ void notifyContextDestroy();
/**
- * Creates and refreshs OpenGL textures.
+ * Adjust the physical mouse coordinates according to the currently visible screen.
*/
- virtual void loadTextures();
+ void adjustMousePosition(int16 &x, int16 &y);
+
+ /**
+ * Set up the mouse position for graphics output.
+ *
+ * @param x X coordinate in physical coordinates.
+ * @param y Y coordinate in physical coordinates.
+ */
+ void setMousePosition(int x, int y) { _cursorX = x; _cursorY = y; }
+
+ /**
+ * Query the mouse position in physical coordinates.
+ */
+ void getMousePosition(int16 &x, int16 &y) const { x = _cursorX; y = _cursorY; }
+
+ /**
+ * Set up the mouse position for the (event) system.
+ *
+ * @param x X coordinate in physical coordinates.
+ * @param y Y coordinate in physical coordinates.
+ */
+ virtual void setInternalMousePosition(int x, int y) = 0;
+
+private:
+ /**
+ * Create a texture with the specified pixel format.
+ *
+ * @param format The pixel format the Texture object should accept as
+ * input.
+ * @param wantAlpha For CLUT8 textures this marks whether an alpha
+ * channel should be used.
+ * @return A pointer to the texture or nullptr on failure.
+ */
+ Texture *createTexture(const Graphics::PixelFormat &format, bool wantAlpha = false);
//
- // GFX and video
+ // Transaction support
//
- enum {
- kTransactionNone = 0,
- kTransactionActive = 1,
- kTransactionRollback = 2
- };
-
- struct TransactionDetails {
- bool sizeChanged;
- bool needRefresh;
- bool needUpdatescreen;
- bool filterChanged;
+ struct VideoState {
+ VideoState() : valid(false), gameWidth(0), gameHeight(0),
#ifdef USE_RGB_COLOR
- bool formatChanged;
+ gameFormat(),
#endif
- };
- TransactionDetails _transactionDetails;
- int _transactionMode;
-
- struct VideoState {
- bool setup;
+ aspectRatioCorrection(false), graphicsMode(GFX_LINEAR) {
+ }
- bool fullscreen;
+ bool valid;
- int mode;
- int scaleFactor;
- bool antialiasing;
+ uint gameWidth, gameHeight;
+#ifdef USE_RGB_COLOR
+ Graphics::PixelFormat gameFormat;
+#endif
bool aspectRatioCorrection;
+ int graphicsMode;
- int screenWidth, screenHeight;
- int overlayWidth, overlayHeight;
- int hardwareWidth, hardwareHeight;
+ bool operator==(const VideoState &right) {
+ return gameWidth == right.gameWidth && gameHeight == right.gameHeight
#ifdef USE_RGB_COLOR
- Graphics::PixelFormat format;
+ && gameFormat == right.gameFormat
#endif
+ && aspectRatioCorrection == right.aspectRatioCorrection
+ && graphicsMode == right.graphicsMode;
+ }
+
+ bool operator!=(const VideoState &right) {
+ return !(*this == right);
+ }
};
- VideoState _videoMode, _oldVideoMode;
/**
- * Sets the OpenGL texture format for the given pixel format. If format is not support will raise an error.
+ * The currently setup video state.
+ */
+ VideoState _currentState;
+
+ /**
+ * The old video state used when doing a transaction rollback.
*/
- virtual void getGLPixelFormat(Graphics::PixelFormat pixelFormat, byte &bpp, GLenum &intFormat, GLenum &glFormat, GLenum &type);
+ VideoState _oldState;
+
+protected:
+ enum TransactionMode {
+ kTransactionNone = 0,
+ kTransactionActive = 1,
+ kTransactionRollback = 2
+ };
- virtual void internUpdateScreen();
- virtual bool loadGFXMode();
- virtual void unloadGFXMode();
+ TransactionMode getTransactionMode() const { return _transactionMode; }
+private:
/**
- * Setup the fullscreen mode state.
+ * The current transaction mode.
*/
- void setFullscreenMode(bool enable);
+ TransactionMode _transactionMode;
/**
- * Query the fullscreen state.
+ * The current screen change ID.
*/
- inline bool getFullscreenMode() const { return _videoMode.fullscreen; }
+ int _screenChangeID;
+protected:
/**
- * Set the scale factor.
+ * Set up the requested video mode. This takes parameters which describe
+ * what resolution the game screen requests (this is possibly aspect ratio
+ * corrected!).
*
- * This can only be used in a GFX transaction.
+ * A sub-class should take these parameters as hints. It might very well
+ * set up a mode which it thinks suites the situation best.
*
- * @param newScale New scale factor.
+ * @parma requestedWidth This is the requested actual game screen width.
+ * @param requestedHeight This is the requested actual game screen height.
+ * @param format This is the requested pixel format of the virtual game screen.
+ * @return true on success, false otherwise
*/
- void setScale(int newScale);
+ virtual bool loadVideoMode(uint requestedWidth, uint requestedHeight, const Graphics::PixelFormat &format) = 0;
/**
- * Query the scale factor.
+ * Save a screenshot of the full display as BMP to the given file. This
+ * uses Common::DumpFile for writing the screenshot.
+ *
+ * @param filename The output filename.
*/
- inline int getScale() const { return _videoMode.scaleFactor; }
+ void saveScreenshot(const Common::String &filename) const;
+
+private:
+ //
+ // OpenGL utilities
+ //
/**
- * Toggle the antialiasing state of the current video mode.
+ * Try to determine the internal parameters for a given pixel format.
*
- * This can only be used in a GFX transaction.
+ * @return true when the format can be used, false otherwise.
*/
- void toggleAntialiasing();
+ bool getGLPixelFormat(const Graphics::PixelFormat &pixelFormat, GLenum &glIntFormat, GLenum &glFormat, GLenum &glType) const;
+
+ //
+ // Actual hardware screen
+ //
/**
- * Query the antialiasing state.
+ * The width of the physical output.
*/
- inline bool getAntialiasingState() const { return _videoMode.antialiasing; }
+ uint _outputScreenWidth;
- // Drawing coordinates for the current display mode and scale
- int _displayX;
- int _displayY;
- int _displayWidth;
- int _displayHeight;
+ /**
+ * The height of the physical output.
+ */
+ uint _outputScreenHeight;
- virtual const char *getCurrentModeName();
+ /**
+ * @return The desired aspect of the game screen.
+ */
+ frac_t getDesiredGameScreenAspect() const;
- virtual void calculateDisplaySize(int &width, int &height);
- virtual void refreshDisplaySize();
+ /**
+ * Recalculates the area used to display the game screen.
+ */
+ void recalculateDisplayArea();
- uint getAspectRatio() const;
+ /**
+ * The X coordinate of the game screen.
+ */
+ uint _displayX;
- void setFormatIsBGR(bool isBGR) { _formatBGR = isBGR; }
- bool _formatBGR;
+ /**
+ * The Y coordinate of the game screen.
+ */
+ uint _displayY;
+
+ /**
+ * The width of the game screen in physical coordinates.
+ */
+ uint _displayWidth;
+
+ /**
+ * The height of the game screen in physical coordinates.
+ */
+ uint _displayHeight;
+
+ /**
+ * The default pixel format of the backend.
+ */
+ Graphics::PixelFormat _defaultFormat;
+
+ /**
+ * The default pixel format with an alpha channel.
+ */
+ Graphics::PixelFormat _defaultFormatAlpha;
//
// Game screen
//
- GLTexture *_gameTexture;
- Graphics::Surface _screenData;
- int _screenChangeCount;
- bool _screenNeedsRedraw;
- Common::Rect _screenDirtyRect;
-#ifdef USE_RGB_COLOR
- Graphics::PixelFormat _screenFormat;
-#endif
- byte *_gamePalette;
+ /**
+ * The virtual game screen.
+ */
+ Texture *_gameScreen;
- virtual void refreshGameScreen();
+ /**
+ * The game palette if in CLUT8 mode.
+ */
+ byte _gamePalette[3 * 256];
- // Shake mode
- int _shakePos;
+ /**
+ * The offset by which the screen is moved vertically.
+ */
+ int _gameScreenShakeOffset;
//
// Overlay
//
- GLTexture *_overlayTexture;
- Graphics::Surface _overlayData;
- Graphics::PixelFormat _overlayFormat;
- bool _overlayVisible;
- bool _overlayNeedsRedraw;
- Common::Rect _overlayDirtyRect;
- virtual void refreshOverlay();
+ /**
+ * The overlay screen.
+ */
+ Texture *_overlay;
+
+ /**
+ * Whether the overlay is visible or not.
+ */
+ bool _overlayVisible;
//
- // Mouse
+ // Cursor
//
- struct MousePos {
- // The mouse position in hardware screen coordinates.
- int16 x, y;
- // The size and hotspot of the original cursor image.
- int16 w, h;
- int16 hotX, hotY;
+ /**
+ * Set up the correct cursor palette.
+ */
+ void updateCursorPalette();
- // The size and hotspot of the scaled cursor, in real coordinates.
- int16 rW, rH;
- int16 rHotX, rHotY;
+ /**
+ * The cursor image.
+ */
+ Texture *_cursor;
- // The size and hotspot of the scaled cursor, in game coordinates.
- int16 vW, vH;
- int16 vHotX, vHotY;
+ /**
+ * X coordinate of the cursor in phyiscal coordinates.
+ */
+ int _cursorX;
- MousePos() : x(0), y(0), w(0), h(0), hotX(0), hotY(0),
- rW(0), rH(0), rHotX(0), rHotY(0), vW(0), vH(0),
- vHotX(0), vHotY(0) {}
- };
+ /**
+ * Y coordinate of the cursor in physical coordinates.
+ */
+ int _cursorY;
- GLTexture *_cursorTexture;
- Graphics::Surface _cursorData;
- Graphics::PixelFormat _cursorFormat;
- byte *_cursorPalette;
- bool _cursorPaletteDisabled;
- MousePos _cursorState;
- bool _cursorVisible;
+ /**
+ * The X offset for the cursor hotspot in unscaled coordinates.
+ */
+ int _cursorHotspotX;
+
+ /**
+ * The Y offset for the cursor hotspot in unscaled coordinates.
+ */
+ int _cursorHotspotY;
+
+ /**
+ * Recalculate the cursor scaling. Scaling is always done according to
+ * the game screen.
+ */
+ void recalculateCursorScaling();
+
+ /**
+ * The X offset for the cursor hotspot in scaled coordinates.
+ */
+ int _cursorHotspotXScaled;
+
+ /**
+ * The Y offset for the cursor hotspot in scaled coordinates.
+ */
+ int _cursorHotspotYScaled;
+
+ /**
+ * The width of the cursor scaled coordinates.
+ */
+ uint _cursorWidthScaled;
+
+ /**
+ * The height of the cursor scaled coordinates.
+ */
+ uint _cursorHeightScaled;
+
+ /**
+ * The key color.
+ */
uint32 _cursorKeyColor;
- bool _cursorDontScale;
- bool _cursorNeedsRedraw;
/**
- * Set up the mouse position for graphics output.
- *
- * @param x X coordinate in native coordinates.
- * @param y Y coordinate in native coordinates.
+ * Whether the cursor is actually visible.
*/
- void setMousePosition(int x, int y) { _cursorState.x = x; _cursorState.y = y; }
+ bool _cursorVisible;
- virtual void refreshCursor();
- virtual void refreshCursorScale();
+ /**
+ * Whether no cursor scaling should be applied.
+ */
+ bool _cursorDontScale;
/**
- * Set up the mouse position for the (event) system.
- *
- * @param x X coordinate in native coordinates.
- * @param y Y coordinate in native coordinates.
+ * Whether the special cursor palette is enabled.
*/
- virtual void setInternalMousePosition(int x, int y) = 0;
+ bool _cursorPaletteEnabled;
/**
- * Adjusts hardware screen coordinates to either overlay or game screen
- * coordinates depending on whether the overlay is visible or not.
- *
- * @param x X coordinate of the mouse position.
- * @param y Y coordinate of the mouse position.
+ * The special cursor palette in case enabled.
*/
- virtual void adjustMousePosition(int16 &x, int16 &y);
+ byte _cursorPalette[3 * 256];
+#ifdef USE_OSD
//
- // Misc
+ // OSD
//
- virtual bool saveScreenshot(const char *filename);
-
-#ifdef USE_OSD
+protected:
/**
* Returns the font used for on screen display
*/
virtual const Graphics::Font *getFontOSD();
+private:
/**
- * Update the OSD texture / surface.
+ * The OSD's contents.
*/
- void updateOSD();
+ Texture *_osd;
/**
- * The OSD contents.
+ * Current opacity level of the OSD.
*/
- Common::Array<Common::String> _osdLines;
-
- GLTexture *_osdTexture;
- Graphics::Surface _osdSurface;
uint8 _osdAlpha;
+
+ /**
+ * When fading the OSD has started.
+ */
uint32 _osdFadeStartTime;
- bool _requireOSDUpdate;
+
+ /**
+ * Mutex to allow displayMessageOnOSD to be used from the audio thread.
+ */
+ Common::Mutex _osdMutex;
+
enum {
kOSDFadeOutDelay = 2 * 1000,
kOSDFadeOutDuration = 500,
@@ -348,4 +493,6 @@ protected:
#endif
};
+} // End of namespace OpenGL
+
#endif
diff --git a/backends/graphics/opengl/glerrorcheck.cpp b/backends/graphics/opengl/opengl-sys.h
index 439593577d..a3524b28d2 100644
--- a/backends/graphics/opengl/glerrorcheck.cpp
+++ b/backends/graphics/opengl/opengl-sys.h
@@ -8,25 +8,25 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
-#include "common/scummsys.h"
+#ifndef BACKENDS_GRAPHICS_OPENGL_OPENGL_H
+#define BACKENDS_GRAPHICS_OPENGL_OPENGL_H
-#if defined(DEBUG) && defined(USE_OPENGL)
+// The purpose of this header is to include the OpenGL headers in an uniform
+// fashion. A notable example for a non standard port is the Tizen port.
-#include "backends/graphics/opengl/glerrorcheck.h"
-#include "common/textconsole.h"
-#include "common/str.h"
+#include "common/scummsys.h"
#ifdef WIN32
#if defined(ARRAYSIZE) && !defined(_WINDOWS_)
@@ -37,31 +37,21 @@
#undef ARRAYSIZE
#endif
-#if defined(USE_GLES)
+// HACK: In case common/util.h has been included already we need to make sure
+// to define ARRAYSIZE again in case of Windows.
+#if !defined(ARRAYSIZE) && defined(COMMON_UTIL_H)
+#define ARRAYSIZE(x) ((int)(sizeof(x) / sizeof(x[0])))
+#endif
+
+#if defined(TIZEN)
+#include <FGraphicsOpengl.h>
+using namespace Tizen::Graphics::Opengl;
+#elif defined(USE_GLES)
#include <GLES/gl.h>
-#elif defined(MACOSX)
-#include <OpenGL/gl.h>
+#elif defined(SDL_BACKEND)
+#include <SDL_opengl.h>
#else
#include <GL/gl.h>
#endif
-static Common::String getGlErrStr(GLenum error) {
- switch (error) {
- case GL_NO_ERROR: return "GL_NO_ERROR";
- case GL_INVALID_ENUM: return "GL_INVALID_ENUM";
- case GL_INVALID_OPERATION: return "GL_INVALID_OPERATION";
- case GL_STACK_OVERFLOW: return "GL_STACK_OVERFLOW";
- case GL_STACK_UNDERFLOW: return "GL_STACK_UNDERFLOW";
- case GL_OUT_OF_MEMORY: return "GL_OUT_OF_MEMORY";
- }
-
- return Common::String::format("(Unknown GL error code 0x%x)", error);
-}
-
-void checkGlError(const char *file, int line) {
- GLenum error = glGetError();
- if (error != GL_NO_ERROR)
- warning("%s:%d: GL error: %s", file, line, getGlErrStr(error).c_str());
-}
-
#endif
diff --git a/backends/graphics/opengl/texture.cpp b/backends/graphics/opengl/texture.cpp
new file mode 100644
index 0000000000..7b0b22d630
--- /dev/null
+++ b/backends/graphics/opengl/texture.cpp
@@ -0,0 +1,374 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * 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
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "backends/graphics/opengl/texture.h"
+#include "backends/graphics/opengl/extensions.h"
+#include "backends/graphics/opengl/debug.h"
+
+#include "common/rect.h"
+#include "common/textconsole.h"
+
+namespace OpenGL {
+
+static GLuint nextHigher2(GLuint v) {
+ if (v == 0)
+ return 1;
+ v--;
+ v |= v >> 1;
+ v |= v >> 2;
+ v |= v >> 4;
+ v |= v >> 8;
+ v |= v >> 16;
+ return ++v;
+}
+
+GLint Texture::_maxTextureSize = 0;
+
+void Texture::queryTextureInformation() {
+ glGetIntegerv(GL_MAX_TEXTURE_SIZE, &_maxTextureSize);
+ debug(5, "OpenGL maximum texture size: %d", _maxTextureSize);
+}
+
+Texture::Texture(GLenum glIntFormat, GLenum glFormat, GLenum glType, const Graphics::PixelFormat &format)
+ : _glIntFormat(glIntFormat), _glFormat(glFormat), _glType(glType), _format(format), _glFilter(GL_NEAREST),
+ _glTexture(0), _textureData(), _userPixelData(), _allDirty(false) {
+ recreateInternalTexture();
+}
+
+Texture::~Texture() {
+ releaseInternalTexture();
+ _textureData.free();
+}
+
+void Texture::releaseInternalTexture() {
+ GLCALL(glDeleteTextures(1, &_glTexture));
+ _glTexture = 0;
+}
+
+void Texture::recreateInternalTexture() {
+ // Release old texture name in case it exists.
+ releaseInternalTexture();
+
+ // Get a new texture name.
+ GLCALL(glGenTextures(1, &_glTexture));
+
+ // Set up all texture parameters.
+ GLCALL(glBindTexture(GL_TEXTURE_2D, _glTexture));
+ GLCALL(glPixelStorei(GL_UNPACK_ALIGNMENT, 1));
+ GLCALL(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, _glFilter));
+ GLCALL(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, _glFilter));
+ GLCALL(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE));
+ GLCALL(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE));
+
+ // In case there is an actual texture setup we reinitialize it.
+ if (_textureData.getPixels()) {
+ // Allocate storage for OpenGL texture.
+ GLCALL(glTexImage2D(GL_TEXTURE_2D, 0, _glIntFormat, _textureData.w,
+ _textureData.h, 0, _glFormat, _glType, NULL));
+
+ // Mark dirts such that it will be completely refreshed the next time.
+ flagDirty();
+ }
+}
+
+void Texture::enableLinearFiltering(bool enable) {
+ if (enable) {
+ _glFilter = GL_LINEAR;
+ } else {
+ _glFilter = GL_NEAREST;
+ }
+
+ GLCALL(glBindTexture(GL_TEXTURE_2D, _glTexture));
+
+ GLCALL(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, _glFilter));
+ GLCALL(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, _glFilter));
+}
+
+void Texture::allocate(uint width, uint height) {
+ uint texWidth = width, texHeight = height;
+ if (!g_extNPOTSupported) {
+ texWidth = nextHigher2(texWidth);
+ texHeight = nextHigher2(texHeight);
+ }
+
+ // In case the needed texture dimension changed we will reinitialize the
+ // texture.
+ if (texWidth != _textureData.w || texHeight != _textureData.h) {
+ // Create a buffer for the texture data.
+ _textureData.create(texWidth, texHeight, _format);
+
+ // Set the texture.
+ GLCALL(glBindTexture(GL_TEXTURE_2D, _glTexture));
+
+ // Allocate storage for OpenGL texture.
+ GLCALL(glTexImage2D(GL_TEXTURE_2D, 0, _glIntFormat, _textureData.w,
+ _textureData.h, 0, _glFormat, _glType, NULL));
+ }
+
+ // Create a sub-buffer for raw access.
+ _userPixelData = _textureData.getSubArea(Common::Rect(width, height));
+}
+
+void Texture::copyRectToTexture(uint x, uint y, uint w, uint h, const void *srcPtr, uint srcPitch) {
+ Graphics::Surface *dstSurf = getSurface();
+ assert(x + w <= dstSurf->w);
+ assert(y + h <= dstSurf->h);
+
+ // *sigh* Common::Rect::extend behaves unexpected whenever one of the two
+ // parameters is an empty rect. Thus, we check whether the current dirty
+ // area is valid. In case it is not we simply use the parameters as new
+ // dirty area. Otherwise, we simply call extend.
+ if (_dirtyArea.isEmpty()) {
+ _dirtyArea = Common::Rect(x, y, x + w, y + h);
+ } else {
+ _dirtyArea.extend(Common::Rect(x, y, x + w, y + h));
+ }
+
+ const byte *src = (const byte *)srcPtr;
+ byte *dst = (byte *)dstSurf->getBasePtr(x, y);
+ const uint pitch = dstSurf->pitch;
+ const uint bytesPerPixel = dstSurf->format.bytesPerPixel;
+
+ if (srcPitch == pitch && x == 0 && w == dstSurf->w) {
+ memcpy(dst, src, h * pitch);
+ } else {
+ while (h-- > 0) {
+ memcpy(dst, src, w * bytesPerPixel);
+ dst += pitch;
+ src += srcPitch;
+ }
+ }
+}
+
+void Texture::fill(uint32 color) {
+ Graphics::Surface *dst = getSurface();
+ dst->fillRect(Common::Rect(dst->w, dst->h), color);
+
+ flagDirty();
+}
+
+void Texture::draw(GLfloat x, GLfloat y, GLfloat w, GLfloat h) {
+ // Only do any processing when the Texture is initialized.
+ if (!_textureData.getPixels()) {
+ return;
+ }
+
+ // First update any potentional changes.
+ updateTexture();
+
+ // Set the texture.
+ GLCALL(glBindTexture(GL_TEXTURE_2D, _glTexture));
+
+ // Calculate the texture rect that will be drawn.
+ const GLfloat texWidth = (GLfloat)_userPixelData.w / _textureData.w;
+ const GLfloat texHeight = (GLfloat)_userPixelData.h / _textureData.h;
+ const GLfloat texcoords[4*2] = {
+ 0, 0,
+ texWidth, 0,
+ 0, texHeight,
+ texWidth, texHeight
+ };
+ GLCALL(glTexCoordPointer(2, GL_FLOAT, 0, texcoords));
+
+ // Calculate the screen rect where the texture will be drawn.
+ const GLfloat vertices[4*2] = {
+ x, y,
+ x + w, y,
+ x, y + h,
+ x + w, y + h
+ };
+ GLCALL(glVertexPointer(2, GL_FLOAT, 0, vertices));
+
+ // Draw the texture to the screen buffer.
+ GLCALL(glDrawArrays(GL_TRIANGLE_STRIP, 0, 4));
+}
+
+void Texture::updateTexture() {
+ if (!isDirty()) {
+ return;
+ }
+
+ Common::Rect dirtyArea = getDirtyArea();
+
+ // In case we use linear filtering we might need to duplicate the last
+ // pixel row/column to avoid glitches with filtering.
+ if (_glFilter == GL_LINEAR) {
+ if (dirtyArea.right == _userPixelData.w && _userPixelData.w != _textureData.w) {
+ uint height = dirtyArea.height();
+
+ const byte *src = (const byte *)_textureData.getBasePtr(_userPixelData.w - 1, dirtyArea.top);
+ byte *dst = (byte *)_textureData.getBasePtr(_userPixelData.w, dirtyArea.top);
+
+ while (height-- > 0) {
+ memcpy(dst, src, _textureData.format.bytesPerPixel);
+ dst += _textureData.pitch;
+ src += _textureData.pitch;
+ }
+
+ // Extend the dirty area.
+ ++dirtyArea.right;
+ }
+
+ if (dirtyArea.bottom == _userPixelData.h && _userPixelData.h != _textureData.h) {
+ const byte *src = (const byte *)_textureData.getBasePtr(dirtyArea.left, _userPixelData.h - 1);
+ byte *dst = (byte *)_textureData.getBasePtr(dirtyArea.left, _userPixelData.h);
+ memcpy(dst, src, dirtyArea.width() * _textureData.format.bytesPerPixel);
+
+ // Extend the dirty area.
+ ++dirtyArea.bottom;
+ }
+ }
+
+ // Set the texture.
+ GLCALL(glBindTexture(GL_TEXTURE_2D, _glTexture));
+
+ // Update the actual texture.
+ // Although we keep track of the dirty part of the texture buffer we
+ // cannot take advantage of the left/right boundries here because it is
+ // not possible to specify a pitch to glTexSubImage2D. To be precise, with
+ // plain OpenGL we could set GL_UNPACK_ROW_LENGTH to achieve this. However,
+ // OpenGL ES 1.0 does not support GL_UNPACK_ROW_LENGTH. Thus, we are left
+ // with the following options:
+ //
+ // 1) (As we do right now) Simply always update the whole texture lines of
+ // rect changed. This is simplest to implement. In case performance is
+ // really an issue we can think of switching to another method.
+ //
+ // 2) Copy the dirty rect to a temporary buffer and upload that by using
+ // glTexSubImage2D. This is what the Android backend does. It is more
+ // complicated though.
+ //
+ // 3) Use glTexSubImage2D per line changed. This is what the old OpenGL
+ // graphics manager did but it is much slower! Thus, we do not use it.
+ GLCALL(glTexSubImage2D(GL_TEXTURE_2D, 0, 0, dirtyArea.top, _textureData.w, dirtyArea.height(),
+ _glFormat, _glType, _textureData.getBasePtr(0, dirtyArea.top)));
+
+ // We should have handled everything, thus not dirty anymore.
+ clearDirty();
+}
+
+Common::Rect Texture::getDirtyArea() const {
+ if (_allDirty) {
+ return Common::Rect(_userPixelData.w, _userPixelData.h);
+ } else {
+ return _dirtyArea;
+ }
+}
+
+TextureCLUT8::TextureCLUT8(GLenum glIntFormat, GLenum glFormat, GLenum glType, const Graphics::PixelFormat &format)
+ : Texture(glIntFormat, glFormat, glType, format), _clut8Data(), _palette(new byte[256 * format.bytesPerPixel]) {
+ memset(_palette, 0, sizeof(byte) * format.bytesPerPixel);
+}
+
+TextureCLUT8::~TextureCLUT8() {
+ delete[] _palette;
+ _palette = nullptr;
+ _clut8Data.free();
+}
+
+void TextureCLUT8::allocate(uint width, uint height) {
+ Texture::allocate(width, height);
+
+ // We only need to reinitialize our CLUT8 surface when the output size
+ // changed.
+ if (width == _clut8Data.w && height == _clut8Data.h) {
+ return;
+ }
+
+ _clut8Data.create(width, height, Graphics::PixelFormat::createFormatCLUT8());
+}
+
+Graphics::PixelFormat TextureCLUT8::getFormat() const {
+ return Graphics::PixelFormat::createFormatCLUT8();
+}
+
+namespace {
+template<typename ColorType>
+inline void convertPalette(ColorType *dst, const byte *src, uint colors, const Graphics::PixelFormat &format) {
+ while (colors-- > 0) {
+ *dst++ = format.RGBToColor(src[0], src[1], src[2]);
+ src += 3;
+ }
+}
+} // End of anonymous namespace
+
+void TextureCLUT8::setPalette(uint start, uint colors, const byte *palData) {
+ const Graphics::PixelFormat &hardwareFormat = getHardwareFormat();
+
+ if (hardwareFormat.bytesPerPixel == 2) {
+ convertPalette<uint16>((uint16 *)_palette + start, palData, colors, hardwareFormat);
+ } else if (hardwareFormat.bytesPerPixel == 4) {
+ convertPalette<uint32>((uint32 *)_palette + start, palData, colors, hardwareFormat);
+ } else {
+ warning("TextureCLUT8::setPalette: Unsupported pixel depth: %d", hardwareFormat.bytesPerPixel);
+ }
+
+ // A palette changes means we need to refresh the whole surface.
+ flagDirty();
+}
+
+namespace {
+template<typename PixelType>
+inline void doPaletteLookUp(PixelType *dst, const byte *src, uint width, uint height, uint dstPitch, uint srcPitch, const PixelType *palette) {
+ uint srcAdd = srcPitch - width;
+ uint dstAdd = dstPitch - width * sizeof(PixelType);
+
+ while (height-- > 0) {
+ for (uint x = width; x > 0; --x) {
+ *dst++ = palette[*src++];
+ }
+
+ dst = (PixelType *)((byte *)dst + dstAdd);
+ src += srcAdd;
+ }
+}
+} // End of anonymous namespace
+
+void TextureCLUT8::updateTexture() {
+ if (!isDirty()) {
+ return;
+ }
+
+ // Do the palette look up
+ Graphics::Surface *outSurf = Texture::getSurface();
+
+ Common::Rect dirtyArea = getDirtyArea();
+
+ if (outSurf->format.bytesPerPixel == 2) {
+ doPaletteLookUp<uint16>((uint16 *)outSurf->getBasePtr(dirtyArea.left, dirtyArea.top),
+ (const byte *)_clut8Data.getBasePtr(dirtyArea.left, dirtyArea.top),
+ dirtyArea.width(), dirtyArea.height(),
+ outSurf->pitch, _clut8Data.pitch, (const uint16 *)_palette);
+ } else if (outSurf->format.bytesPerPixel == 4) {
+ doPaletteLookUp<uint32>((uint32 *)outSurf->getBasePtr(dirtyArea.left, dirtyArea.top),
+ (const byte *)_clut8Data.getBasePtr(dirtyArea.left, dirtyArea.top),
+ dirtyArea.width(), dirtyArea.height(),
+ outSurf->pitch, _clut8Data.pitch, (const uint32 *)_palette);
+ } else {
+ warning("TextureCLUT8::updateTexture: Unsupported pixel depth: %d", outSurf->format.bytesPerPixel);
+ }
+
+ // Do generic handling of updating the texture.
+ Texture::updateTexture();
+}
+
+} // End of namespace OpenGL
diff --git a/backends/graphics/opengl/texture.h b/backends/graphics/opengl/texture.h
new file mode 100644
index 0000000000..ad70833544
--- /dev/null
+++ b/backends/graphics/opengl/texture.h
@@ -0,0 +1,175 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * 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
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef BACKENDS_GRAPHICS_OPENGL_TEXTURE_H
+#define BACKENDS_GRAPHICS_OPENGL_TEXTURE_H
+
+#include "backends/graphics/opengl/opengl-sys.h"
+
+#include "graphics/pixelformat.h"
+#include "graphics/surface.h"
+
+#include "common/rect.h"
+
+namespace OpenGL {
+
+/**
+ * An OpenGL texture wrapper. It automatically takes care of all OpenGL
+ * texture handling issues and also provides access to the texture data.
+ */
+class Texture {
+public:
+ /**
+ * Create a new texture with the specific internal format.
+ *
+ * @param glIntFormat The internal format to use.
+ * @param glFormat The input format.
+ * @param glType The input type.
+ * @param format The format used for the texture input.
+ */
+ Texture(GLenum glIntFormat, GLenum glFormat, GLenum glType, const Graphics::PixelFormat &format);
+ virtual ~Texture();
+
+ /**
+ * Destroy the OpenGL texture name.
+ */
+ void releaseInternalTexture();
+
+ /**
+ * Create the OpenGL texture name and flag the whole texture as dirty.
+ */
+ void recreateInternalTexture();
+
+ /**
+ * Enable or disable linear texture filtering.
+ *
+ * @param enable true to enable and false to disable.
+ */
+ void enableLinearFiltering(bool enable);
+
+ /**
+ * Allocate texture space for the desired dimensions. This wraps any
+ * handling of requirements for POT textures.
+ *
+ * @param width The desired logical width.
+ * @param height The desired logical height.
+ */
+ virtual void allocate(uint width, uint height);
+
+ void copyRectToTexture(uint x, uint y, uint w, uint h, const void *src, uint srcPitch);
+
+ void fill(uint32 color);
+
+ void draw(GLfloat x, GLfloat y, GLfloat w, GLfloat h);
+
+ void flagDirty() { _allDirty = true; }
+ bool isDirty() const { return _allDirty || !_dirtyArea.isEmpty(); }
+
+ uint getWidth() const { return _userPixelData.w; }
+ uint getHeight() const { return _userPixelData.h; }
+
+ /**
+ * @return The hardware format of the texture data.
+ */
+ const Graphics::PixelFormat &getHardwareFormat() const { return _format; }
+
+ /**
+ * @return The logical format of the texture data.
+ */
+ virtual Graphics::PixelFormat getFormat() const { return _format; }
+
+ virtual Graphics::Surface *getSurface() { return &_userPixelData; }
+ virtual const Graphics::Surface *getSurface() const { return &_userPixelData; }
+
+ /**
+ * @return Whether the texture data is using a palette.
+ */
+ virtual bool hasPalette() const { return false; }
+
+ virtual void setPalette(uint start, uint colors, const byte *palData) {}
+
+ virtual void *getPalette() { return 0; }
+ virtual const void *getPalette() const { return 0; }
+
+ /**
+ * Query texture related OpenGL information from the context. This only
+ * queries the maximum texture size for now.
+ */
+ static void queryTextureInformation();
+
+ /**
+ * @return Return the maximum texture dimensions supported.
+ */
+ static GLint getMaximumTextureSize() { return _maxTextureSize; }
+protected:
+ virtual void updateTexture();
+
+ Common::Rect getDirtyArea() const;
+private:
+ const GLenum _glIntFormat;
+ const GLenum _glFormat;
+ const GLenum _glType;
+ const Graphics::PixelFormat _format;
+
+ GLint _glFilter;
+ GLuint _glTexture;
+
+ Graphics::Surface _textureData;
+ Graphics::Surface _userPixelData;
+
+ bool _allDirty;
+ Common::Rect _dirtyArea;
+ void clearDirty() { _allDirty = false; _dirtyArea = Common::Rect(); }
+
+ static GLint _maxTextureSize;
+};
+
+class TextureCLUT8 : public Texture {
+public:
+ TextureCLUT8(GLenum glIntFormat, GLenum glFormat, GLenum glType, const Graphics::PixelFormat &format);
+ virtual ~TextureCLUT8();
+
+ virtual void allocate(uint width, uint height);
+
+ virtual Graphics::PixelFormat getFormat() const;
+
+ virtual bool hasPalette() const { return true; }
+
+ virtual void setPalette(uint start, uint colors, const byte *palData);
+
+ virtual void *getPalette() { return _palette; }
+ virtual const void *getPalette() const { return _palette; }
+
+ virtual Graphics::Surface *getSurface() { return &_clut8Data; }
+ virtual const Graphics::Surface *getSurface() const { return &_clut8Data; }
+
+protected:
+ virtual void updateTexture();
+
+private:
+ Graphics::Surface _clut8Data;
+ byte *_palette;
+};
+
+} // End of namespace OpenGL
+
+#endif
diff --git a/backends/graphics/openglsdl/openglsdl-graphics.cpp b/backends/graphics/openglsdl/openglsdl-graphics.cpp
index c5605cae87..3f42d62a3a 100644
--- a/backends/graphics/openglsdl/openglsdl-graphics.cpp
+++ b/backends/graphics/openglsdl/openglsdl-graphics.cpp
@@ -8,496 +8,386 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
-#include "common/scummsys.h"
-
-#if defined(SDL_BACKEND) && defined(USE_OPENGL)
-
#include "backends/graphics/openglsdl/openglsdl-graphics.h"
-#include "backends/platform/sdl/sdl.h"
-#include "common/config-manager.h"
+
#include "common/textconsole.h"
+#include "common/config-manager.h"
+#ifdef USE_OSD
#include "common/translation.h"
+#endif
+
+OpenGLSdlGraphicsManager::OpenGLSdlGraphicsManager(uint desktopWidth, uint desktopHeight, SdlEventSource *eventSource)
+ : SdlGraphicsManager(eventSource), _lastVideoModeLoad(0), _hwScreen(nullptr), _lastRequestedWidth(0), _lastRequestedHeight(0),
+ _graphicsScale(2), _ignoreLoadVideoMode(false), _gotResize(false), _wantsFullScreen(false), _ignoreResizeEvents(0),
+ _desiredFullscreenWidth(0), _desiredFullscreenHeight(0) {
+ // Setup OpenGL attributes for SDL
+ SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8);
+ SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 8);
+ SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8);
+ SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16);
+ SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
+
+ // Retrieve a list of working fullscreen modes
+ const SDL_Rect *const *availableModes = SDL_ListModes(NULL, SDL_OPENGL | SDL_FULLSCREEN);
+ if (availableModes != (void *)-1) {
+ for (;*availableModes; ++availableModes) {
+ const SDL_Rect *mode = *availableModes;
+
+ _fullscreenVideoModes.push_back(VideoMode(mode->w, mode->h));
+ }
-OpenGLSdlGraphicsManager::OpenGLSdlGraphicsManager(SdlEventSource *eventSource)
- :
- SdlGraphicsManager(eventSource),
- _hwscreen(0),
- _screenResized(false),
- _activeFullscreenMode(-2),
- _lastFullscreenModeWidth(0),
- _lastFullscreenModeHeight(0),
- _desktopWidth(0),
- _desktopHeight(0),
- _ignoreResizeFrames(0) {
-
- // Initialize SDL video subsystem
- if (SDL_InitSubSystem(SDL_INIT_VIDEO) == -1) {
- error("Could not initialize SDL: %s", SDL_GetError());
+ // Sort the modes in ascending order.
+ Common::sort(_fullscreenVideoModes.begin(), _fullscreenVideoModes.end());
}
- // This is also called in initSDL(), but initializing graphics
- // may reset it.
- SDL_EnableUNICODE(1);
-
- // Disable OS cursor
- SDL_ShowCursor(SDL_DISABLE);
-
- // Get desktop resolution
- // TODO: In case the OpenGL manager is created *after* a plain SDL manager
- // has been used, this will return the last setup graphics mode rather
- // than the desktop resolution. We should really look into a way to
- // properly retrieve the desktop resolution.
- const SDL_VideoInfo *videoInfo = SDL_GetVideoInfo();
- if (videoInfo->current_w > 0 && videoInfo->current_h > 0) {
- _desktopWidth = videoInfo->current_w;
- _desktopHeight = videoInfo->current_h;
+ // In case SDL is fine with every mode we will force the desktop mode.
+ // TODO? We could also try to add some default resolutions here.
+ if (_fullscreenVideoModes.empty() && desktopWidth && desktopHeight) {
+ _fullscreenVideoModes.push_back(VideoMode(desktopWidth, desktopHeight));
}
- if (ConfMan.hasKey("last_fullscreen_mode_width") && ConfMan.hasKey("last_fullscreen_mode_height")) {
- _lastFullscreenModeWidth = ConfMan.getInt("last_fullscreen_mode_width");
- _lastFullscreenModeHeight = ConfMan.getInt("last_fullscreen_mode_height");
+ // Get information about display sizes from the previous runs.
+ if (ConfMan.hasKey("last_fullscreen_mode_width", Common::ConfigManager::kApplicationDomain) && ConfMan.hasKey("last_fullscreen_mode_height", Common::ConfigManager::kApplicationDomain)) {
+ _desiredFullscreenWidth = ConfMan.getInt("last_fullscreen_mode_width", Common::ConfigManager::kApplicationDomain);
+ _desiredFullscreenHeight = ConfMan.getInt("last_fullscreen_mode_height", Common::ConfigManager::kApplicationDomain);
+ } else {
+ // Use the desktop resolutions when no previous default has been setup.
+ _desiredFullscreenWidth = desktopWidth;
+ _desiredFullscreenHeight = desktopHeight;
}
}
OpenGLSdlGraphicsManager::~OpenGLSdlGraphicsManager() {
- // Unregister the event observer
- if (g_system->getEventManager()->getEventDispatcher() != NULL)
- g_system->getEventManager()->getEventDispatcher()->unregisterObserver(this);
}
-void OpenGLSdlGraphicsManager::initEventObserver() {
+void OpenGLSdlGraphicsManager::activateManager() {
+ SdlGraphicsManager::activateManager();
+
// Register the graphics manager as a event observer
g_system->getEventManager()->getEventDispatcher()->registerObserver(this, 10, false);
}
+void OpenGLSdlGraphicsManager::deactivateManager() {
+ // Unregister the event observer
+ if (g_system->getEventManager()->getEventDispatcher()) {
+ g_system->getEventManager()->getEventDispatcher()->unregisterObserver(this);
+ }
+
+ SdlGraphicsManager::deactivateManager();
+}
+
bool OpenGLSdlGraphicsManager::hasFeature(OSystem::Feature f) {
- return
- (f == OSystem::kFeatureFullscreenMode) ||
- (f == OSystem::kFeatureIconifyWindow) ||
- OpenGLGraphicsManager::hasFeature(f);
+ switch (f) {
+ case OSystem::kFeatureFullscreenMode:
+ case OSystem::kFeatureIconifyWindow:
+ return true;
+
+ default:
+ return OpenGLGraphicsManager::hasFeature(f);
+ }
}
void OpenGLSdlGraphicsManager::setFeatureState(OSystem::Feature f, bool enable) {
switch (f) {
+ case OSystem::kFeatureFullscreenMode:
+ assert(getTransactionMode() != kTransactionNone);
+ _wantsFullScreen = enable;
+ break;
+
case OSystem::kFeatureIconifyWindow:
- if (enable)
+ if (enable) {
SDL_WM_IconifyWindow();
+ }
break;
+
default:
OpenGLGraphicsManager::setFeatureState(f, enable);
}
}
-#ifdef USE_RGB_COLOR
+bool OpenGLSdlGraphicsManager::getFeatureState(OSystem::Feature f) {
+ switch (f) {
+ case OSystem::kFeatureFullscreenMode:
+ if (_hwScreen) {
+ return (_hwScreen->flags & SDL_FULLSCREEN) != 0;
+ } else {
+ return _wantsFullScreen;
+ }
-Common::List<Graphics::PixelFormat> OpenGLSdlGraphicsManager::getSupportedFormats() const {
- assert(!_supportedFormats.empty());
- return _supportedFormats;
+ default:
+ return OpenGLGraphicsManager::getFeatureState(f);
+ }
}
-void OpenGLSdlGraphicsManager::detectSupportedFormats() {
-
- // Clear old list
- _supportedFormats.clear();
-
- // Some tables with standard formats that we always list
- // as "supported". If frontend code tries to use one of
- // these, we will perform the necessary format
- // conversion in the background. Of course this incurs a
- // performance hit, but on desktop ports this should not
- // matter. We still push the currently active format to
- // the front, so if frontend code just uses the first
- // available format, it will get one that is "cheap" to
- // use.
- const Graphics::PixelFormat RGBList[] = {
-#if defined(ENABLE_32BIT)
- Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0), // RGBA8888
-#ifndef USE_GLES
- Graphics::PixelFormat(4, 8, 8, 8, 8, 16, 8, 0, 24), // ARGB8888
-#endif
- Graphics::PixelFormat(3, 8, 8, 8, 0, 16, 8, 0, 0), // RGB888
-#endif
- Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0), // RGB565
- Graphics::PixelFormat(2, 5, 5, 5, 1, 11, 6, 1, 0), // RGB5551
- Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0), // RGB555
- Graphics::PixelFormat(2, 4, 4, 4, 4, 12, 8, 4, 0), // RGBA4444
-#ifndef USE_GLES
- Graphics::PixelFormat(2, 4, 4, 4, 4, 8, 4, 0, 12) // ARGB4444
-#endif
- };
-#ifndef USE_GLES
- const Graphics::PixelFormat BGRList[] = {
-#ifdef ENABLE_32BIT
- Graphics::PixelFormat(4, 8, 8, 8, 8, 0, 8, 16, 24), // ABGR8888
- Graphics::PixelFormat(4, 8, 8, 8, 8, 8, 16, 24, 0), // BGRA8888
- Graphics::PixelFormat(3, 8, 8, 8, 0, 0, 8, 16, 0), // BGR888
-#endif
- Graphics::PixelFormat(2, 5, 6, 5, 0, 0, 5, 11, 0), // BGR565
- Graphics::PixelFormat(2, 5, 5, 5, 1, 1, 6, 11, 0), // BGRA5551
- Graphics::PixelFormat(2, 4, 4, 4, 4, 0, 4, 8, 12), // ABGR4444
- Graphics::PixelFormat(2, 4, 4, 4, 4, 4, 8, 12, 0) // BGRA4444
- };
-#endif
+bool OpenGLSdlGraphicsManager::setGraphicsMode(int mode) {
+ // HACK: This is stupid but the SurfaceSDL backend defaults to 2x. This
+ // assures that the launcher (which requests 320x200) has a reasonable
+ // size. It also makes small games have a reasonable size (i.e. at least
+ // 640x400). We follow the same logic here until we have a better way to
+ // give hints to our backend for that.
+ _graphicsScale = 2;
- Graphics::PixelFormat format = Graphics::PixelFormat::createFormatCLUT8();
- if (_hwscreen) {
- // Get our currently set hardware format
- format = Graphics::PixelFormat(_hwscreen->format->BytesPerPixel,
- 8 - _hwscreen->format->Rloss, 8 - _hwscreen->format->Gloss,
- 8 - _hwscreen->format->Bloss, 8 - _hwscreen->format->Aloss,
- _hwscreen->format->Rshift, _hwscreen->format->Gshift,
- _hwscreen->format->Bshift, _hwscreen->format->Ashift);
-
- // Workaround to SDL not providing an accurate Aloss value on Mac OS X.
- if (_hwscreen->format->Amask == 0)
- format.aLoss = 8;
-
- // Push it first, as the prefered format if available
- for (int i = 0; i < ARRAYSIZE(RGBList); i++) {
- if (RGBList[i] == format) {
- _supportedFormats.push_back(format);
- break;
- }
- }
-#ifndef USE_GLES
- for (int i = 0; i < ARRAYSIZE(BGRList); i++) {
- if (BGRList[i] == format) {
- _supportedFormats.push_back(format);
- break;
- }
- }
+ return OpenGLGraphicsManager::setGraphicsMode(mode);
+}
+
+void OpenGLSdlGraphicsManager::resetGraphicsScale() {
+ OpenGLGraphicsManager::resetGraphicsScale();
+
+ // HACK: See OpenGLSdlGraphicsManager::setGraphicsMode.
+ _graphicsScale = 1;
+}
+
+#ifdef USE_RGB_COLOR
+Common::List<Graphics::PixelFormat> OpenGLSdlGraphicsManager::getSupportedFormats() const {
+ Common::List<Graphics::PixelFormat> formats;
+
+ // Our default mode is (memory layout wise) RGBA8888 which is a different
+ // logical layout depending on the endianness. We chose this mode because
+ // it is the only 32bit color mode we can safely assume to be present in
+ // OpenGL and OpenGL ES implementations. Thus, we need to supply different
+ // logical formats based on endianness.
+#ifdef SCUMM_LITTLE_ENDIAN
+ // ABGR8888
+ formats.push_back(Graphics::PixelFormat(4, 8, 8, 8, 8, 0, 8, 16, 24));
+#else
+ // RGBA8888
+ formats.push_back(Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0));
#endif
- }
+ // RGB565
+ formats.push_back(Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0));
+ // RGBA5551
+ formats.push_back(Graphics::PixelFormat(2, 5, 5, 5, 1, 11, 6, 1, 0));
+ // RGBA4444
+ formats.push_back(Graphics::PixelFormat(2, 4, 4, 4, 4, 12, 8, 4, 0));
- // Push some RGB formats
- for (int i = 0; i < ARRAYSIZE(RGBList); i++) {
- if (_hwscreen && (RGBList[i].bytesPerPixel > format.bytesPerPixel))
- continue;
- if (RGBList[i] != format)
- _supportedFormats.push_back(RGBList[i]);
- }
#ifndef USE_GLES
- // Push some BGR formats
- for (int i = 0; i < ARRAYSIZE(BGRList); i++) {
- if (_hwscreen && (BGRList[i].bytesPerPixel > format.bytesPerPixel))
- continue;
- if (BGRList[i] != format)
- _supportedFormats.push_back(BGRList[i]);
- }
+#ifdef SCUMM_LITTLE_ENDIAN
+ // RGBA8888
+ formats.push_back(Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0));
+#else
+ // ABGR8888
+ formats.push_back(Graphics::PixelFormat(4, 8, 8, 8, 8, 0, 8, 16, 24));
#endif
- _supportedFormats.push_back(Graphics::PixelFormat::createFormatCLUT8());
-}
+ // ARGB8888, this should not be here, but Sword25 requires it. :-/
+ formats.push_back(Graphics::PixelFormat(4, 8, 8, 8, 8, 16, 8, 0, 24));
+ // RGB555, this is used by SCUMM HE 16 bit games.
+ formats.push_back(Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0));
#endif
-void OpenGLSdlGraphicsManager::setInternalMousePosition(int x, int y) {
- SDL_WarpMouse(x, y);
+ formats.push_back(Graphics::PixelFormat::createFormatCLUT8());
+
+ return formats;
}
+#endif
void OpenGLSdlGraphicsManager::updateScreen() {
- if (_ignoreResizeFrames)
- _ignoreResizeFrames -= 1;
+ if (_ignoreResizeEvents) {
+ --_ignoreResizeEvents;
+ }
OpenGLGraphicsManager::updateScreen();
-}
-//
-// Intern
-//
+ // Swap OpenGL buffers
+ SDL_GL_SwapBuffers();
+}
-bool OpenGLSdlGraphicsManager::setupFullscreenMode() {
- SDL_Rect const* const*availableModes = SDL_ListModes(NULL, SDL_FULLSCREEN | SDL_OPENGL);
+void OpenGLSdlGraphicsManager::notifyVideoExpose() {
+}
- // SDL_ListModes() returns -1 in case any dimension is okay. In that
- // case we'll reuse the current desktop resolution for fullscreen.
- if (availableModes == (void *)-1) {
- _videoMode.hardwareWidth = _desktopWidth;
- _videoMode.hardwareHeight = _desktopHeight;
- _activeFullscreenMode = -2;
- return true;
+void OpenGLSdlGraphicsManager::notifyResize(const uint width, const uint height) {
+ if (!_ignoreResizeEvents && _hwScreen && !(_hwScreen->flags & SDL_FULLSCREEN)) {
+ // We save that we handled a resize event here. We need to know this
+ // so we do not overwrite the users requested window size whenever we
+ // switch aspect ratio or similar.
+ _gotResize = true;
+ if (!setupMode(width, height)) {
+ warning("OpenGLSdlGraphicsManager::notifyResize: Resize failed ('%s')", SDL_GetError());
+ g_system->quit();
+ }
}
+}
- // If -2, autodetect the fullscreen mode
- // The last used fullscreen mode will be prioritized, if there is no last fullscreen
- // mode, the desktop resolution will be used, and in case the desktop resolution
- // is not available as a fullscreen mode, the one with smallest metric will be selected.
- if (_activeFullscreenMode == -2) {
- // Desktop resolution
- int desktopModeIndex = -1;
-
- // Best metric mode
- const SDL_Rect *bestMode = availableModes[0];
- int bestModeIndex = 0;
- uint bestMetric = (uint)-1;
-
- // Iterate over all available fullscreen modes
- for (int i = 0; const SDL_Rect *mode = availableModes[i]; i++) {
- // Try to setup the last used fullscreen mode
- if (mode->w == _lastFullscreenModeWidth && mode->h == _lastFullscreenModeHeight) {
- _videoMode.hardwareWidth = _lastFullscreenModeWidth;
- _videoMode.hardwareHeight = _lastFullscreenModeHeight;
- _activeFullscreenMode = i;
- return true;
- }
-
- if (mode->w == _desktopWidth && mode->h == _desktopHeight)
- desktopModeIndex = i;
-
- if (mode->w < _videoMode.overlayWidth)
- continue;
- if (mode->h < _videoMode.overlayHeight)
- continue;
+void OpenGLSdlGraphicsManager::transformMouseCoordinates(Common::Point &point) {
+ adjustMousePosition(point.x, point.y);
+}
- uint metric = mode->w * mode->h - _videoMode.overlayWidth * _videoMode.overlayHeight;
- if (metric < bestMetric) {
- bestMode = mode;
- bestMetric = metric;
- bestModeIndex = i;
- }
- }
+void OpenGLSdlGraphicsManager::notifyMousePos(Common::Point mouse) {
+ setMousePosition(mouse.x, mouse.y);
+}
- if (desktopModeIndex >= 0) {
- _videoMode.hardwareWidth = _desktopWidth;
- _videoMode.hardwareHeight = _desktopHeight;
+void OpenGLSdlGraphicsManager::setInternalMousePosition(int x, int y) {
+ SDL_WarpMouse(x, y);
+}
- _activeFullscreenMode = desktopModeIndex;
- return true;
- } else if (bestMode) {
- _videoMode.hardwareWidth = bestMode->w;
- _videoMode.hardwareHeight = bestMode->h;
+bool OpenGLSdlGraphicsManager::loadVideoMode(uint requestedWidth, uint requestedHeight, const Graphics::PixelFormat &format) {
+ // In some cases we might not want to load the requested video mode. This
+ // will assure that the window size is not altered.
+ if (_ignoreLoadVideoMode) {
+ _ignoreLoadVideoMode = false;
+ return true;
+ }
- _activeFullscreenMode = bestModeIndex;
- return true;
- }
- } else {
- // Use last fullscreen mode if looping backwards from the first mode
- if (_activeFullscreenMode == -1) {
- do {
- _activeFullscreenMode++;
- } while(availableModes[_activeFullscreenMode]);
- _activeFullscreenMode--;
- }
+ // This function should never be called from notifyResize thus we know
+ // that the requested size came from somewhere else.
+ _gotResize = false;
- // Use first fullscreen mode if looping from last mode
- if (!availableModes[_activeFullscreenMode])
- _activeFullscreenMode = 0;
+ // Save the requested dimensions.
+ _lastRequestedWidth = requestedWidth;
+ _lastRequestedHeight = requestedHeight;
- // Check if the fullscreen mode is valid
- if (availableModes[_activeFullscreenMode]) {
- _videoMode.hardwareWidth = availableModes[_activeFullscreenMode]->w;
- _videoMode.hardwareHeight = availableModes[_activeFullscreenMode]->h;
- return true;
- }
- }
+ // Apply the currently saved scale setting.
+ requestedWidth *= _graphicsScale;
+ requestedHeight *= _graphicsScale;
- // Could not find any suiting fullscreen mode, return false.
- return false;
+ // Set up the mode.
+ return setupMode(requestedWidth, requestedHeight);
}
-bool OpenGLSdlGraphicsManager::loadGFXMode() {
- // If the screen was resized, do not change its size
- if (!_screenResized) {
- const int scaleFactor = getScale();
- _videoMode.overlayWidth = _videoMode.hardwareWidth = _videoMode.screenWidth * scaleFactor;
- _videoMode.overlayHeight = _videoMode.hardwareHeight = _videoMode.screenHeight * scaleFactor;
-
- // The only modes where we need to adapt the aspect ratio are 320x200
- // and 640x400. That is since our aspect ratio correction in fact is
- // only used to ensure that the original pixel size aspect for these
- // modes is used.
- // (Non-square pixels on old monitors vs square pixel on new ones).
- if (_videoMode.aspectRatioCorrection) {
- if (_videoMode.screenWidth == 320 && _videoMode.screenHeight == 200)
- _videoMode.overlayHeight = _videoMode.hardwareHeight = 240 * scaleFactor;
- else if (_videoMode.screenWidth == 640 && _videoMode.screenHeight == 400)
- _videoMode.overlayHeight = _videoMode.hardwareHeight = 480 * scaleFactor;
+bool OpenGLSdlGraphicsManager::setupMode(uint width, uint height) {
+ // In case we request a fullscreen mode we will use the mode the user
+ // has chosen last time or the biggest mode available.
+ if (_wantsFullScreen) {
+ if (_desiredFullscreenWidth && _desiredFullscreenHeight) {
+ // In case only a distinct set of modes is available we check
+ // whether the requested mode is actually available.
+ if (!_fullscreenVideoModes.empty()) {
+ VideoModeArray::const_iterator i = Common::find(_fullscreenVideoModes.begin(),
+ _fullscreenVideoModes.end(),
+ VideoMode(_desiredFullscreenWidth, _desiredFullscreenHeight));
+ // It's not available fall back to default.
+ if (i == _fullscreenVideoModes.end()) {
+ _desiredFullscreenWidth = 0;
+ _desiredFullscreenHeight = 0;
+ }
+ }
}
- }
- _screenResized = false;
-
- // Setup OpenGL attributes for SDL
- SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8);
- SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 8);
- SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8);
- SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16);
- SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
+ // In case no desired mode has been set we default to the biggest mode
+ // available or the requested mode in case we don't know any
+ // any fullscreen modes.
+ if (!_desiredFullscreenWidth || !_desiredFullscreenHeight) {
+ if (!_fullscreenVideoModes.empty()) {
+ VideoModeArray::const_iterator i = _fullscreenVideoModes.end();
+ --i;
+
+ _desiredFullscreenWidth = i->width;
+ _desiredFullscreenHeight = i->height;
+ } else {
+ _desiredFullscreenWidth = width;
+ _desiredFullscreenHeight = height;
+ }
+ }
- const bool isFullscreen = getFullscreenMode();
+ // Remember our choice.
+ ConfMan.setInt("last_fullscreen_mode_width", _desiredFullscreenWidth, Common::ConfigManager::kApplicationDomain);
+ ConfMan.setInt("last_fullscreen_mode_height", _desiredFullscreenHeight, Common::ConfigManager::kApplicationDomain);
- // In case we have an fullscreen mode and we are not in a rollback, detect
- // a proper mode to use. In case we are in a rollback, we already detected
- // a proper mode when setting up that mode, thus there is no need to run
- // the detection again.
- if (isFullscreen && _transactionMode != kTransactionRollback) {
- if (!setupFullscreenMode())
- // Failed setuping a fullscreen mode
- return false;
+ // Use our choice.
+ width = _desiredFullscreenWidth;
+ height = _desiredFullscreenHeight;
}
- _videoMode.overlayWidth = _videoMode.hardwareWidth;
- _videoMode.overlayHeight = _videoMode.hardwareHeight;
+ // WORKAROUND: Working around infamous SDL bugs when switching
+ // resolutions too fast. This might cause the event system to supply
+ // incorrect mouse position events otherwise.
+ // Reference: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=665779
+ const uint32 curTime = SDL_GetTicks();
+ if (_hwScreen && (curTime < _lastVideoModeLoad || curTime - _lastVideoModeLoad < 100)) {
+ for (int i = 10; i > 0; --i) {
+ SDL_PumpEvents();
+ SDL_Delay(10);
+ }
+ }
+ _lastVideoModeLoad = curTime;
uint32 flags = SDL_OPENGL;
-
- if (isFullscreen)
+ if (_wantsFullScreen) {
flags |= SDL_FULLSCREEN;
- else
+ } else {
flags |= SDL_RESIZABLE;
-
- // Create our window
- _hwscreen = SDL_SetVideoMode(_videoMode.hardwareWidth, _videoMode.hardwareHeight, 32, flags);
-#ifdef USE_RGB_COLOR
- detectSupportedFormats();
-#endif
-
- if (_hwscreen == NULL) {
- // DON'T use error(), as this tries to bring up the debug
- // console, which WON'T WORK now that _hwscreen is hosed.
-
- if (!_oldVideoMode.setup) {
- warning("SDL_SetVideoMode says we can't switch to that mode (%s)", SDL_GetError());
- g_system->quit();
- } else
- // Cancel GFX load, and go back to last mode
- return false;
}
- // Check if the screen is BGR format
- setFormatIsBGR(_hwscreen->format->Rshift != 0);
-
- if (isFullscreen) {
- _lastFullscreenModeWidth = _videoMode.hardwareWidth;
- _lastFullscreenModeHeight = _videoMode.hardwareHeight;
- ConfMan.setInt("last_fullscreen_mode_width", _lastFullscreenModeWidth);
- ConfMan.setInt("last_fullscreen_mode_height", _lastFullscreenModeHeight);
+ if (_hwScreen) {
+ // When a video mode has been setup already we notify the manager that
+ // the context is about to be destroyed.
+ // We do this because on Windows SDL_SetVideoMode can destroy and
+ // recreate the OpenGL context.
+ notifyContextDestroy();
}
- // Call and return parent implementation of this method
- return OpenGLGraphicsManager::loadGFXMode();
-}
+ _hwScreen = SDL_SetVideoMode(width, height, 32, flags);
-void OpenGLSdlGraphicsManager::unloadGFXMode() {
- if (_hwscreen) {
- SDL_FreeSurface(_hwscreen);
- _hwscreen = NULL;
+ if (!_hwScreen) {
+ // We treat fullscreen requests as a "hint" for now. This means in
+ // case it is not available we simply ignore it.
+ if (_wantsFullScreen) {
+ _hwScreen = SDL_SetVideoMode(width, height, 32, SDL_OPENGL | SDL_RESIZABLE);
+ }
}
-}
-
-void OpenGLSdlGraphicsManager::internUpdateScreen() {
- // Call to parent implementation of this method
- OpenGLGraphicsManager::internUpdateScreen();
-
- // Swap OpenGL buffers
- SDL_GL_SwapBuffers();
-}
-#ifdef USE_OSD
-void OpenGLSdlGraphicsManager::displayModeChangedMsg() {
- const char *newModeName = getCurrentModeName();
- if (newModeName) {
- const int scaleFactor = getScale();
-
- Common::String osdMessage = Common::String::format(
- "%s: %s\n%d x %d -> %d x %d",
- _("Current display mode"),
- newModeName,
- _videoMode.screenWidth * scaleFactor,
- _videoMode.screenHeight * scaleFactor,
- _hwscreen->w, _hwscreen->h
- );
- displayMessageOnOSD(osdMessage.c_str());
- }
-}
-void OpenGLSdlGraphicsManager::displayScaleChangedMsg() {
- const int scaleFactor = getScale();
- Common::String osdMessage = Common::String::format(
- "%s: x%d\n%d x %d -> %d x %d",
- _("Current scale"),
- scaleFactor,
- _videoMode.screenWidth, _videoMode.screenHeight,
- _videoMode.overlayWidth, _videoMode.overlayHeight
- );
- displayMessageOnOSD(osdMessage.c_str());
-}
+ if (_hwScreen) {
+ // This is pretty confusing since RGBA8888 talks about the memory
+ // layout here. This is a different logical layout depending on
+ // whether we run on little endian or big endian. However, we can
+ // only safely assume that RGBA8888 in memory layout is supported.
+ // Thus, we chose this one.
+ const Graphics::PixelFormat rgba8888 =
+#ifdef SCUMM_LITTLE_ENDIAN
+ Graphics::PixelFormat(4, 8, 8, 8, 8, 0, 8, 16, 24);
+#else
+ Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0);
#endif
-
-bool OpenGLSdlGraphicsManager::isHotkey(const Common::Event &event) {
- if ((event.kbd.flags & (Common::KBD_CTRL|Common::KBD_ALT)) == (Common::KBD_CTRL|Common::KBD_ALT)) {
- if (event.kbd.keycode == Common::KEYCODE_PLUS || event.kbd.keycode == Common::KEYCODE_MINUS ||
- event.kbd.keycode == Common::KEYCODE_KP_PLUS || event.kbd.keycode == Common::KEYCODE_KP_MINUS ||
- event.kbd.keycode == 'a' || event.kbd.keycode == 'f')
- return true;
- } else if ((event.kbd.flags & (Common::KBD_CTRL|Common::KBD_SHIFT)) == (Common::KBD_CTRL|Common::KBD_SHIFT)) {
- if (event.kbd.keycode == 'a' || event.kbd.keycode == 'f')
- return true;
- } else if ((event.kbd.flags & (Common::KBD_ALT)) == (Common::KBD_ALT) && event.kbd.keycode == 's') {
- return true;
+ notifyContextCreate(rgba8888, rgba8888);
+ setActualScreenSize(_hwScreen->w, _hwScreen->h);
}
- return false;
-}
-
-void OpenGLSdlGraphicsManager::toggleFullScreen(int loop) {
- beginGFXTransaction();
- const bool isFullscreen = getFullscreenMode();
-
- if (isFullscreen && loop) {
- _activeFullscreenMode += loop;
- setFullscreenMode(true);
- } else {
- _activeFullscreenMode = -2;
- setFullscreenMode(!isFullscreen);
- }
-
- // HACK: We need to force a refresh here, since we change the
- // fullscreen mode.
- _transactionDetails.needRefresh = true;
- endGFXTransaction();
- // Ignore resize events for the next 10 frames
- _ignoreResizeFrames = 10;
+ // Ignore resize events (from SDL) for a few frames. This avoids
+ // bad resizes to a (former) resolution for which we haven't
+ // processed an event yet.
+ _ignoreResizeEvents = 10;
-#ifdef USE_OSD
- Common::String osdMessage;
- if (getFullscreenMode())
- osdMessage = Common::String::format("%s\n%d x %d",
- _("Fullscreen mode"),
- _hwscreen->w, _hwscreen->h
- );
- else
- osdMessage = Common::String::format("%s\n%d x %d",
- _("Windowed mode"),
- _hwscreen->w, _hwscreen->h
- );
- displayMessageOnOSD(osdMessage.c_str());
-#endif
+ return _hwScreen != nullptr;
}
bool OpenGLSdlGraphicsManager::notifyEvent(const Common::Event &event) {
switch (event.type) {
+ case Common::EVENT_KEYUP:
+ return isHotkey(event);
+
case Common::EVENT_KEYDOWN:
if (event.kbd.hasFlags(Common::KBD_ALT)) {
- // Alt-Return and Alt-Enter toggle full screen mode
- if (event.kbd.keycode == Common::KEYCODE_RETURN ||
- event.kbd.keycode == (Common::KeyCode)SDLK_KP_ENTER) {
- toggleFullScreen(0);
+ if ( event.kbd.keycode == Common::KEYCODE_RETURN
+ || event.kbd.keycode == (Common::KeyCode)SDLK_KP_ENTER) {
+ // Alt-Return and Alt-Enter toggle full screen mode
+ beginGFXTransaction();
+ setFeatureState(OSystem::kFeatureFullscreenMode, !getFeatureState(OSystem::kFeatureFullscreenMode));
+ endGFXTransaction();
+
+#ifdef USE_OSD
+ if (getFeatureState(OSystem::kFeatureFullscreenMode)) {
+ displayMessageOnOSD("Fullscreen mode");
+ } else {
+ displayMessageOnOSD("Windowed mode");
+ }
+#endif
return true;
}
- // Alt-S create a screenshot
- if (event.kbd.keycode == 's') {
+ if (event.kbd.keycode == Common::KEYCODE_s) {
+ // Alt-s creates a screenshot
Common::String filename;
for (int n = 0;; n++) {
@@ -509,169 +399,167 @@ bool OpenGLSdlGraphicsManager::notifyEvent(const Common::Event &event) {
break;
SDL_RWclose(file);
}
- if (saveScreenshot(filename.c_str()))
- debug("Saved screenshot '%s'", filename.c_str());
- else
- warning("Could not save screenshot");
- return true;
- }
- }
- if (event.kbd.hasFlags(Common::KBD_CTRL|Common::KBD_ALT)) {
- // Ctrl-Alt-Return and Ctrl-Alt-Enter switch between full screen modes
- if (event.kbd.keycode == Common::KEYCODE_RETURN ||
- event.kbd.keycode == (Common::KeyCode)SDLK_KP_ENTER) {
- toggleFullScreen(1);
+ saveScreenshot(filename.c_str());
+ debug("Saved screenshot '%s'", filename.c_str());
+
return true;
}
+ } else if (event.kbd.hasFlags(Common::KBD_CTRL | Common::KBD_ALT)) {
+ if ( event.kbd.keycode == Common::KEYCODE_PLUS || event.kbd.keycode == Common::KEYCODE_MINUS
+ || event.kbd.keycode == Common::KEYCODE_KP_PLUS || event.kbd.keycode == Common::KEYCODE_KP_MINUS) {
+ // Ctrl+Alt+Plus/Minus Increase/decrease the size
+ const int direction = (event.kbd.keycode == Common::KEYCODE_PLUS || event.kbd.keycode == Common::KEYCODE_KP_PLUS) ? +1 : -1;
+
+ if (getFeatureState(OSystem::kFeatureFullscreenMode)) {
+ // In case we are in fullscreen we will choose the previous
+ // or next mode.
+
+ // In case no modes are available we do nothing.
+ if (_fullscreenVideoModes.empty()) {
+ return true;
+ }
+
+ // Look for the current mode.
+ VideoModeArray::const_iterator i = Common::find(_fullscreenVideoModes.begin(),
+ _fullscreenVideoModes.end(),
+ VideoMode(_desiredFullscreenWidth, _desiredFullscreenHeight));
+ if (i == _fullscreenVideoModes.end()) {
+ return true;
+ }
+
+ // Cycle through the modes in the specified direction.
+ if (direction > 0) {
+ ++i;
+ if (i == _fullscreenVideoModes.end()) {
+ i = _fullscreenVideoModes.begin();
+ }
+ } else {
+ if (i == _fullscreenVideoModes.begin()) {
+ i = _fullscreenVideoModes.end();
+ }
+ --i;
+ }
+
+ _desiredFullscreenWidth = i->width;
+ _desiredFullscreenHeight = i->height;
+
+ // Try to setup the mode.
+ if (!setupMode(_lastRequestedWidth, _lastRequestedHeight)) {
+ warning("OpenGLSdlGraphicsManager::notifyEvent: Fullscreen resize failed ('%s')", SDL_GetError());
+ g_system->quit();
+ }
+ } else {
+ // Calculate the next scaling setting. We approximate the
+ // current scale setting in case the user resized the
+ // window. Then we apply the direction change.
+ _graphicsScale = MAX<int>(_hwScreen->w / _lastRequestedWidth, _hwScreen->h / _lastRequestedHeight);
+ _graphicsScale = MAX<int>(_graphicsScale + direction, 1);
+
+ // Since we overwrite a user resize here we reset its
+ // flag here. This makes enabling AR smoother because it
+ // will change the window size like in surface SDL.
+ _gotResize = false;
+
+ // Try to setup the mode.
+ if (!setupMode(_lastRequestedWidth * _graphicsScale, _lastRequestedHeight * _graphicsScale)) {
+ warning("OpenGLSdlGraphicsManager::notifyEvent: Window resize failed ('%s')", SDL_GetError());
+ g_system->quit();
+ }
+ }
- // Ctrl-Alt-a switch between display modes
- if (event.kbd.keycode == 'a') {
- beginGFXTransaction();
- setFeatureState(OSystem::kFeatureAspectRatioCorrection, !getFeatureState(OSystem::kFeatureAspectRatioCorrection));
- endGFXTransaction();
#ifdef USE_OSD
- Common::String osdMessage;
- if (getFeatureState(OSystem::kFeatureAspectRatioCorrection))
- osdMessage = Common::String::format("%s\n%d x %d -> %d x %d",
- _("Enabled aspect ratio correction"),
- _videoMode.screenWidth, _videoMode.screenHeight,
- _hwscreen->w, _hwscreen->h);
- else
- osdMessage = Common::String::format("%s\n%d x %d -> %d x %d",
- _("Disabled aspect ratio correction"),
- _videoMode.screenWidth, _videoMode.screenHeight,
- _hwscreen->w, _hwscreen->h);
- displayMessageOnOSD(osdMessage.c_str());
+ const Common::String osdMsg = Common::String::format("Resolution: %dx%d", _hwScreen->w, _hwScreen->h);
+ displayMessageOnOSD(osdMsg.c_str());
#endif
- internUpdateScreen();
+
return true;
- }
+ } else if (event.kbd.keycode == Common::KEYCODE_a) {
+ // In case the user changed the window size manually we will
+ // not change the window size again here.
+ _ignoreLoadVideoMode = _gotResize;
- // Ctrl-Alt-f toggles antialiasing
- if (event.kbd.keycode == 'f') {
+ // Ctrl+Alt+a toggles the aspect ratio correction state.
beginGFXTransaction();
- toggleAntialiasing();
+ setFeatureState(OSystem::kFeatureAspectRatioCorrection, !getFeatureState(OSystem::kFeatureAspectRatioCorrection));
endGFXTransaction();
+ // Make sure we do not ignore the next resize. This
+ // effectively checks whether loadVideoMode has been called.
+ assert(!_ignoreLoadVideoMode);
+
#ifdef USE_OSD
- // TODO: This makes guesses about what internal antialiasing
- // modes we use, we might want to consider a better way of
- // displaying information to the user.
- if (getAntialiasingState())
- displayMessageOnOSD(_("Active filter mode: Linear"));
- else
- displayMessageOnOSD(_("Active filter mode: Nearest"));
+ Common::String osdMsg = "Aspect ratio correction: ";
+ osdMsg += getFeatureState(OSystem::kFeatureAspectRatioCorrection) ? "enabled" : "disabled";
+ displayMessageOnOSD(osdMsg.c_str());
#endif
+
return true;
- }
+ } else if (event.kbd.keycode == Common::KEYCODE_f) {
+ // Ctrl+Alt+f toggles the graphics modes.
+
+ // We are crazy we will allow the OpenGL base class to
+ // introduce new graphics modes like shaders for special
+ // filtering. If some other OpenGL subclass needs this,
+ // we can think of refactoring this.
+ int mode = getGraphicsMode();
+ const OSystem::GraphicsMode *supportedModes = getSupportedGraphicsModes();
+ const OSystem::GraphicsMode *modeDesc = nullptr;
+
+ // Search the current mode.
+ for (; supportedModes->name; ++supportedModes) {
+ if (supportedModes->id == mode) {
+ modeDesc = supportedModes;
+ break;
+ }
+ }
+ assert(modeDesc);
- SDLKey sdlKey = (SDLKey)event.kbd.keycode;
-
- // Ctrl+Alt+Plus/Minus Increase/decrease the scale factor
- if ((sdlKey == SDLK_EQUALS || sdlKey == SDLK_PLUS || sdlKey == SDLK_MINUS ||
- sdlKey == SDLK_KP_PLUS || sdlKey == SDLK_KP_MINUS)) {
- int factor = getScale();
- factor += (sdlKey == SDLK_MINUS || sdlKey == SDLK_KP_MINUS) ? -1 : +1;
- if (0 < factor && factor < 4) {
- // Check if the desktop resolution has been detected
- if (_desktopWidth > 0 && _desktopHeight > 0)
- // If the new scale factor is too big, do not scale
- if (_videoMode.screenWidth * factor > _desktopWidth ||
- _videoMode.screenHeight * factor > _desktopHeight)
- return false;
-
- beginGFXTransaction();
- setScale(factor);
- endGFXTransaction();
-#ifdef USE_OSD
- displayScaleChangedMsg();
-#endif
- return true;
+ // Try to use the next mode in the list.
+ ++modeDesc;
+ if (!modeDesc->name) {
+ modeDesc = getSupportedGraphicsModes();
}
- }
- const bool isNormalNumber = (SDLK_1 <= sdlKey && sdlKey <= SDLK_3);
- const bool isKeypadNumber = (SDLK_KP1 <= sdlKey && sdlKey <= SDLK_KP3);
+ // Never ever try to resize the window when we simply want to
+ // switch the graphics mode. This assures that the window size
+ // does not change.
+ _ignoreLoadVideoMode = true;
+
+ beginGFXTransaction();
+ setGraphicsMode(modeDesc->id);
+ endGFXTransaction();
+
+ // Make sure we do not ignore the next resize. This
+ // effectively checks whether loadVideoMode has been called.
+ assert(!_ignoreLoadVideoMode);
- // Ctrl-Alt-<number key> will change the GFX mode
- if (isNormalNumber || isKeypadNumber) {
- if (sdlKey - (isNormalNumber ? SDLK_1 : SDLK_KP1) <= 3) {
-#ifdef USE_OSD
- int lastMode = _videoMode.mode;
-#endif
- // We need to query the scale and set it up, because
- // setGraphicsMode sets the default scale to 2
- int oldScale = getScale();
- beginGFXTransaction();
- setGraphicsMode(sdlKey - (isNormalNumber ? SDLK_1 : SDLK_KP1));
- setScale(oldScale);
- endGFXTransaction();
#ifdef USE_OSD
- if (lastMode != _videoMode.mode)
- displayModeChangedMsg();
+ const Common::String osdMsg = Common::String::format("Graphics mode: %s", _(modeDesc->description));
+ displayMessageOnOSD(osdMsg.c_str());
#endif
- internUpdateScreen();
- }
- }
- }
- if (event.kbd.hasFlags(Common::KBD_CTRL|Common::KBD_SHIFT)) {
- // Ctrl-Shift-Return and Ctrl-Shift-Enter switch backwards between full screen modes
- if (event.kbd.keycode == Common::KEYCODE_RETURN ||
- event.kbd.keycode == (Common::KeyCode)SDLK_KP_ENTER) {
- toggleFullScreen(-1);
return true;
}
}
- break;
-
- case Common::EVENT_KEYUP:
- return isHotkey(event);
+ // Fall through
default:
- break;
+ return false;
}
-
- return false;
-}
-
-void OpenGLSdlGraphicsManager::notifyVideoExpose() {
}
-void OpenGLSdlGraphicsManager::notifyResize(const uint width, const uint height) {
- // Do not resize if ignoring resize events.
- if (!_ignoreResizeFrames && !getFullscreenMode()) {
- bool scaleChanged = false;
- beginGFXTransaction();
- _videoMode.hardwareWidth = width;
- _videoMode.hardwareHeight = height;
-
- _screenResized = true;
-
- int scale = MIN(_videoMode.hardwareWidth / _videoMode.screenWidth,
- _videoMode.hardwareHeight / _videoMode.screenHeight);
-
- if (getScale() != scale) {
- scaleChanged = true;
- setScale(MAX(MIN(scale, 3), 1));
- }
-
- _transactionDetails.sizeChanged = true;
- endGFXTransaction();
-#ifdef USE_OSD
- if (scaleChanged)
- displayScaleChangedMsg();
-#endif
+bool OpenGLSdlGraphicsManager::isHotkey(const Common::Event &event) {
+ if (event.kbd.hasFlags(Common::KBD_ALT)) {
+ return event.kbd.keycode == Common::KEYCODE_RETURN
+ || event.kbd.keycode == (Common::KeyCode)SDLK_KP_ENTER
+ || event.kbd.keycode == Common::KEYCODE_s;
+ } else if (event.kbd.hasFlags(Common::KBD_CTRL | Common::KBD_ALT)) {
+ return event.kbd.keycode == Common::KEYCODE_PLUS || event.kbd.keycode == Common::KEYCODE_MINUS
+ || event.kbd.keycode == Common::KEYCODE_KP_PLUS || event.kbd.keycode == Common::KEYCODE_KP_MINUS
+ || event.kbd.keycode == Common::KEYCODE_a
+ || event.kbd.keycode == Common::KEYCODE_f;
}
-}
-
-void OpenGLSdlGraphicsManager::transformMouseCoordinates(Common::Point &point) {
- adjustMousePosition(point.x, point.y);
-}
-void OpenGLSdlGraphicsManager::notifyMousePos(Common::Point mouse) {
- setMousePosition(mouse.x, mouse.y);
+ return false;
}
-
-#endif
diff --git a/backends/graphics/openglsdl/openglsdl-graphics.h b/backends/graphics/openglsdl/openglsdl-graphics.h
index 1587183328..9934ca79e2 100644
--- a/backends/graphics/openglsdl/openglsdl-graphics.h
+++ b/backends/graphics/openglsdl/openglsdl-graphics.h
@@ -8,117 +8,109 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
-#ifndef BACKENDS_GRAPHICS_OPENGLSDL_H
-#define BACKENDS_GRAPHICS_OPENGLSDL_H
+#ifndef BACKENDS_GRAPHICS_OPENGLSDL_OPENGLSDL_GRAPHICS_H
+#define BACKENDS_GRAPHICS_OPENGLSDL_OPENGLSDL_GRAPHICS_H
-#include "backends/platform/sdl/sdl-sys.h"
-#if defined(ARRAYSIZE) && !defined(_WINDOWS_)
-#undef ARRAYSIZE
-#endif
-#include "backends/graphics/sdl/sdl-graphics.h"
#include "backends/graphics/opengl/opengl-graphics.h"
+#include "backends/graphics/sdl/sdl-graphics.h"
+#include "backends/platform/sdl/sdl-sys.h"
+#include "common/array.h"
#include "common/events.h"
-/**
- * SDL OpenGL graphics manager
- */
-class OpenGLSdlGraphicsManager : public OpenGLGraphicsManager, public SdlGraphicsManager, public Common::EventObserver {
+class OpenGLSdlGraphicsManager : public OpenGL::OpenGLGraphicsManager, public SdlGraphicsManager, public Common::EventObserver {
public:
- OpenGLSdlGraphicsManager(SdlEventSource *eventSource);
+ OpenGLSdlGraphicsManager(uint desktopWidth, uint desktopHeight, SdlEventSource *eventSource);
virtual ~OpenGLSdlGraphicsManager();
+ // GraphicsManager API
+ virtual void activateManager();
+ virtual void deactivateManager();
+
virtual bool hasFeature(OSystem::Feature f);
virtual void setFeatureState(OSystem::Feature f, bool enable);
+ virtual bool getFeatureState(OSystem::Feature f);
+
+ virtual bool setGraphicsMode(int mode);
+ virtual void resetGraphicsScale();
#ifdef USE_RGB_COLOR
virtual Common::List<Graphics::PixelFormat> getSupportedFormats() const;
#endif
- virtual void initEventObserver();
- virtual bool notifyEvent(const Common::Event &event);
-
virtual void updateScreen();
- // SdlGraphicsManager interface
+ // EventObserver API
+ virtual bool notifyEvent(const Common::Event &event);
+
+ // SdlGraphicsManager API
virtual void notifyVideoExpose();
virtual void notifyResize(const uint width, const uint height);
virtual void transformMouseCoordinates(Common::Point &point);
virtual void notifyMousePos(Common::Point mouse);
protected:
- virtual void internUpdateScreen();
+ virtual void setInternalMousePosition(int x, int y);
- virtual bool loadGFXMode();
- virtual void unloadGFXMode();
- virtual bool isHotkey(const Common::Event &event);
+ virtual bool loadVideoMode(uint requestedWidth, uint requestedHeight, const Graphics::PixelFormat &format);
+private:
+ bool setupMode(uint width, uint height);
-#ifdef USE_RGB_COLOR
- Common::List<Graphics::PixelFormat> _supportedFormats;
+ uint32 _lastVideoModeLoad;
+ SDL_Surface *_hwScreen;
- /**
- * Update the list of supported pixel formats.
- * This method is invoked by loadGFXMode().
- */
- void detectSupportedFormats();
-#endif
+ uint _lastRequestedWidth;
+ uint _lastRequestedHeight;
+ uint _graphicsScale;
+ bool _ignoreLoadVideoMode;
+ bool _gotResize;
- /**
- * Toggles fullscreen.
- * @loop loop direction for switching fullscreen mode, if 0 toggles it.
- */
- virtual void toggleFullScreen(int loop);
+ bool _wantsFullScreen;
+ uint _ignoreResizeEvents;
- int _activeFullscreenMode;
+ struct VideoMode {
+ VideoMode() : width(0), height(0) {}
+ VideoMode(uint w, uint h) : width(w), height(h) {}
- /**
- * Setup the fullscreen mode.
- * @return false if failed finding a mode, true otherwise.
- */
- virtual bool setupFullscreenMode();
+ bool operator<(const VideoMode &right) const {
+ if (width < right.width) {
+ return true;
+ } else if (width == right.width && height < right.height) {
+ return true;
+ } else {
+ return false;
+ }
+ }
- virtual void setInternalMousePosition(int x, int y);
+ bool operator==(const VideoMode &right) const {
+ return width == right.width && height == right.height;
+ }
- int _lastFullscreenModeWidth;
- int _lastFullscreenModeHeight;
- int _desktopWidth;
- int _desktopHeight;
-
- // Hardware screen
- SDL_Surface *_hwscreen;
-
- // If screen was resized by the user
- bool _screenResized;
-
- // Ignore resize events for the number of updateScreen() calls.
- // Normaly resize events are user generated when resizing the window
- // from its borders, but in some cases a resize event can be generated
- // after a fullscreen change.
- int _ignoreResizeFrames;
-
-#ifdef USE_OSD
- /**
- * Displays a mode change message in OSD
- */
- void displayModeChangedMsg();
-
- /**
- * Displays a scale change message in OSD
- */
- void displayScaleChangedMsg();
-#endif
+ bool operator!=(const VideoMode &right) const {
+ return !(*this == right);
+ }
+
+ uint width, height;
+ };
+ typedef Common::Array<VideoMode> VideoModeArray;
+ VideoModeArray _fullscreenVideoModes;
+
+ uint _desiredFullscreenWidth;
+ uint _desiredFullscreenHeight;
+
+ virtual bool isHotkey(const Common::Event &event);
};
#endif
diff --git a/backends/graphics/openpandora/op-graphics.cpp b/backends/graphics/openpandora/op-graphics.cpp
index f371081fde..1ded1614de 100644
--- a/backends/graphics/openpandora/op-graphics.cpp
+++ b/backends/graphics/openpandora/op-graphics.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/graphics/openpandora/op-graphics.h b/backends/graphics/openpandora/op-graphics.h
index 2e3d63e3ad..8b498d632b 100644
--- a/backends/graphics/openpandora/op-graphics.h
+++ b/backends/graphics/openpandora/op-graphics.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/graphics/samsungtvsdl/samsungtvsdl-graphics.cpp b/backends/graphics/samsungtvsdl/samsungtvsdl-graphics.cpp
index 95e0875f55..3603d8a861 100644
--- a/backends/graphics/samsungtvsdl/samsungtvsdl-graphics.cpp
+++ b/backends/graphics/samsungtvsdl/samsungtvsdl-graphics.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/graphics/samsungtvsdl/samsungtvsdl-graphics.h b/backends/graphics/samsungtvsdl/samsungtvsdl-graphics.h
index 2d0ff636f4..15ba3dca48 100644
--- a/backends/graphics/samsungtvsdl/samsungtvsdl-graphics.h
+++ b/backends/graphics/samsungtvsdl/samsungtvsdl-graphics.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/graphics/sdl/sdl-graphics.cpp b/backends/graphics/sdl/sdl-graphics.cpp
index 2eca4b8aab..b5e49fa397 100644
--- a/backends/graphics/sdl/sdl-graphics.cpp
+++ b/backends/graphics/sdl/sdl-graphics.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -26,10 +26,15 @@
SdlGraphicsManager::SdlGraphicsManager(SdlEventSource *source)
: _eventSource(source) {
- _eventSource->setGraphicsManager(this);
}
SdlGraphicsManager::~SdlGraphicsManager() {
- _eventSource->setGraphicsManager(0);
}
+void SdlGraphicsManager::activateManager() {
+ _eventSource->setGraphicsManager(this);
+}
+
+void SdlGraphicsManager::deactivateManager() {
+ _eventSource->setGraphicsManager(0);
+}
diff --git a/backends/graphics/sdl/sdl-graphics.h b/backends/graphics/sdl/sdl-graphics.h
index ea9149fccb..3ef540708a 100644
--- a/backends/graphics/sdl/sdl-graphics.h
+++ b/backends/graphics/sdl/sdl-graphics.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -23,6 +23,8 @@
#ifndef BACKENDS_GRAPHICS_SDL_SDLGRAPHICS_H
#define BACKENDS_GRAPHICS_SDL_SDLGRAPHICS_H
+#include "backends/graphics/graphics.h"
+
#include "common/rect.h"
class SdlEventSource;
@@ -31,16 +33,26 @@ class SdlEventSource;
* Base class for a SDL based graphics manager.
*
* It features a few extra a few extra features required by SdlEventSource.
- * FIXME/HACK:
- * Note it does not inherit from GraphicsManager to avoid a diamond inheritance
- * in the current OpenGLSdlGraphicsManager.
*/
-class SdlGraphicsManager {
+class SdlGraphicsManager : virtual public GraphicsManager {
public:
SdlGraphicsManager(SdlEventSource *source);
virtual ~SdlGraphicsManager();
/**
+ * Makes this graphics manager active. That means it should be ready to
+ * process inputs now. However, even without being active it should be
+ * able to query the supported modes and other bits.
+ */
+ virtual void activateManager();
+
+ /**
+ * Makes this graphics manager inactive. This should allow another
+ * graphics manager to become active again.
+ */
+ virtual void deactivateManager();
+
+ /**
* Notify the graphics manager that the graphics needs to be redrawn, since
* the application window was modified.
*
diff --git a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
index 871c6c49b2..7f3c99fcea 100644
--- a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
+++ b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -142,14 +142,6 @@ SurfaceSdlGraphicsManager::SurfaceSdlGraphicsManager(SdlEventSource *sdlEventSou
#endif
_transactionMode(kTransactionNone) {
- if (SDL_InitSubSystem(SDL_INIT_VIDEO) == -1) {
- error("Could not initialize SDL: %s", SDL_GetError());
- }
-
- // This is also called in initSDL(), but initializing graphics
- // may reset it.
- SDL_EnableUNICODE(1);
-
// allocate palette storage
_currentPalette = (SDL_Color *)calloc(sizeof(SDL_Color), 256);
_cursorPalette = (SDL_Color *)calloc(sizeof(SDL_Color), 256);
@@ -165,8 +157,6 @@ SurfaceSdlGraphicsManager::SurfaceSdlGraphicsManager(SdlEventSource *sdlEventSou
_enableFocusRectDebugCode = ConfMan.getBool("use_sdl_debug_focusrect");
#endif
- SDL_ShowCursor(SDL_DISABLE);
-
memset(&_oldVideoMode, 0, sizeof(_oldVideoMode));
memset(&_videoMode, 0, sizeof(_videoMode));
memset(&_transactionDetails, 0, sizeof(_transactionDetails));
@@ -193,10 +183,6 @@ SurfaceSdlGraphicsManager::SurfaceSdlGraphicsManager(SdlEventSource *sdlEventSou
}
SurfaceSdlGraphicsManager::~SurfaceSdlGraphicsManager() {
- // Unregister the event observer
- if (g_system->getEventManager()->getEventDispatcher() != NULL)
- g_system->getEventManager()->getEventDispatcher()->unregisterObserver(this);
-
unloadGFXMode();
if (_mouseSurface)
SDL_FreeSurface(_mouseSurface);
@@ -211,11 +197,22 @@ SurfaceSdlGraphicsManager::~SurfaceSdlGraphicsManager() {
free(_mouseData);
}
-void SurfaceSdlGraphicsManager::initEventObserver() {
+void SurfaceSdlGraphicsManager::activateManager() {
+ SdlGraphicsManager::activateManager();
+
// Register the graphics manager as a event observer
g_system->getEventManager()->getEventDispatcher()->registerObserver(this, 10, false);
}
+void SurfaceSdlGraphicsManager::deactivateManager() {
+ // Unregister the event observer
+ if (g_system->getEventManager()->getEventDispatcher()) {
+ g_system->getEventManager()->getEventDispatcher()->unregisterObserver(this);
+ }
+
+ SdlGraphicsManager::deactivateManager();
+}
+
bool SurfaceSdlGraphicsManager::hasFeature(OSystem::Feature f) {
return
(f == OSystem::kFeatureFullscreenMode) ||
@@ -263,16 +260,16 @@ bool SurfaceSdlGraphicsManager::getFeatureState(OSystem::Feature f) {
}
}
-const OSystem::GraphicsMode *SurfaceSdlGraphicsManager::supportedGraphicsModes() {
- return s_supportedGraphicsModes;
-}
-
const OSystem::GraphicsMode *SurfaceSdlGraphicsManager::getSupportedGraphicsModes() const {
return s_supportedGraphicsModes;
}
int SurfaceSdlGraphicsManager::getDefaultGraphicsMode() const {
+#ifdef USE_SCALERS
return GFX_DOUBLESIZE;
+#else
+ return GFX_NORMAL;
+#endif
}
void SurfaceSdlGraphicsManager::resetGraphicsScale() {
@@ -747,6 +744,8 @@ bool SurfaceSdlGraphicsManager::loadGFXMode() {
if (_screen == NULL)
error("allocating _screen failed");
+ // Avoid having SDL_SRCALPHA set even if we supplied an alpha-channel in the format.
+ SDL_SetAlpha(_screen, 0, 255);
#else
_screen = SDL_CreateRGBSurface(SDL_SWSURFACE, _videoMode.screenWidth, _videoMode.screenHeight, 8, 0, 0, 0, 0);
if (_screen == NULL)
@@ -1081,7 +1080,9 @@ void SurfaceSdlGraphicsManager::internUpdateScreen() {
for (r = _dirtyRectList; r != lastRect; ++r) {
register int dst_y = r->y + _currentShakePos;
register int dst_h = 0;
+#ifdef USE_SCALERS
register int orig_dst_y = 0;
+#endif
register int rx1 = r->x * scale1;
if (dst_y < height) {
@@ -1089,7 +1090,9 @@ void SurfaceSdlGraphicsManager::internUpdateScreen() {
if (dst_h > height - dst_y)
dst_h = height - dst_y;
+#ifdef USE_SCALERS
orig_dst_y = dst_y;
+#endif
dst_y = dst_y * scale1;
if (_videoMode.aspectRatioCorrection && !_overlayVisible)
diff --git a/backends/graphics/surfacesdl/surfacesdl-graphics.h b/backends/graphics/surfacesdl/surfacesdl-graphics.h
index 97de0f9c97..49bd66b3e5 100644
--- a/backends/graphics/surfacesdl/surfacesdl-graphics.h
+++ b/backends/graphics/surfacesdl/surfacesdl-graphics.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -75,18 +75,18 @@ public:
/**
* SDL graphics manager
*/
-class SurfaceSdlGraphicsManager : public GraphicsManager, public SdlGraphicsManager, public Common::EventObserver {
+class SurfaceSdlGraphicsManager : public SdlGraphicsManager, public Common::EventObserver {
public:
SurfaceSdlGraphicsManager(SdlEventSource *sdlEventSource);
virtual ~SurfaceSdlGraphicsManager();
- virtual void initEventObserver();
+ virtual void activateManager();
+ virtual void deactivateManager();
virtual bool hasFeature(OSystem::Feature f);
virtual void setFeatureState(OSystem::Feature f, bool enable);
virtual bool getFeatureState(OSystem::Feature f);
- static const OSystem::GraphicsMode *supportedGraphicsModes();
virtual const OSystem::GraphicsMode *getSupportedGraphicsModes() const;
virtual int getDefaultGraphicsMode() const;
virtual bool setGraphicsMode(int mode);
diff --git a/backends/graphics/symbiansdl/symbiansdl-graphics.cpp b/backends/graphics/symbiansdl/symbiansdl-graphics.cpp
index 5fe8b19887..e339fecd1c 100644
--- a/backends/graphics/symbiansdl/symbiansdl-graphics.cpp
+++ b/backends/graphics/symbiansdl/symbiansdl-graphics.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/graphics/symbiansdl/symbiansdl-graphics.h b/backends/graphics/symbiansdl/symbiansdl-graphics.h
index 73e810a629..f514db286c 100644
--- a/backends/graphics/symbiansdl/symbiansdl-graphics.h
+++ b/backends/graphics/symbiansdl/symbiansdl-graphics.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/graphics/wincesdl/wincesdl-graphics.cpp b/backends/graphics/wincesdl/wincesdl-graphics.cpp
index f075f8cf8a..8e4685dbd8 100644
--- a/backends/graphics/wincesdl/wincesdl-graphics.cpp
+++ b/backends/graphics/wincesdl/wincesdl-graphics.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/graphics/wincesdl/wincesdl-graphics.h b/backends/graphics/wincesdl/wincesdl-graphics.h
index 2897ca5f40..50b422c10d 100644
--- a/backends/graphics/wincesdl/wincesdl-graphics.h
+++ b/backends/graphics/wincesdl/wincesdl-graphics.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/keymapper/action.cpp b/backends/keymapper/action.cpp
index 33f5c423b0..5108590f0c 100644
--- a/backends/keymapper/action.cpp
+++ b/backends/keymapper/action.cpp
@@ -1,24 +1,24 @@
/* ScummVM - Graphic Adventure Engine
-*
-* 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
-* of the License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*
-*/
+ *
+ * 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
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
#include "backends/keymapper/action.h"
diff --git a/backends/keymapper/action.h b/backends/keymapper/action.h
index 5e69ed3918..ed4bb86ce6 100644
--- a/backends/keymapper/action.h
+++ b/backends/keymapper/action.h
@@ -1,24 +1,24 @@
/* ScummVM - Graphic Adventure Engine
-*
-* 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
-* of the License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*
-*/
+ *
+ * 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
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
#ifndef COMMON_ACTION_H
#define COMMON_ACTION_H
diff --git a/backends/keymapper/hardware-input.cpp b/backends/keymapper/hardware-input.cpp
index d1f8822ac0..d4b5ff5da0 100644
--- a/backends/keymapper/hardware-input.cpp
+++ b/backends/keymapper/hardware-input.cpp
@@ -1,24 +1,24 @@
/* ScummVM - Graphic Adventure Engine
-*
-* 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
-* of the License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*
-*/
+ *
+ * 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
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
#include "backends/keymapper/hardware-input.h"
diff --git a/backends/keymapper/hardware-input.h b/backends/keymapper/hardware-input.h
index 51d4accb5b..064d7e9da0 100644
--- a/backends/keymapper/hardware-input.h
+++ b/backends/keymapper/hardware-input.h
@@ -1,24 +1,24 @@
/* ScummVM - Graphic Adventure Engine
-*
-* 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
-* of the License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*
-*/
+ *
+ * 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
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
#ifndef COMMON_HARDWARE_KEY_H
#define COMMON_HARDWARE_KEY_H
diff --git a/backends/keymapper/keymap.cpp b/backends/keymapper/keymap.cpp
index e95dd6afb5..eaa774c972 100644
--- a/backends/keymapper/keymap.cpp
+++ b/backends/keymapper/keymap.cpp
@@ -1,24 +1,24 @@
/* ScummVM - Graphic Adventure Engine
-*
-* 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
-* of the License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*
-*/
+ *
+ * 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
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
#include "backends/keymapper/keymap.h"
diff --git a/backends/keymapper/keymap.h b/backends/keymapper/keymap.h
index 6eaec7dcaf..0694dc31e1 100644
--- a/backends/keymapper/keymap.h
+++ b/backends/keymapper/keymap.h
@@ -1,24 +1,24 @@
/* ScummVM - Graphic Adventure Engine
-*
-* 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
-* of the License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*
-*/
+ *
+ * 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
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
#ifndef COMMON_KEYMAP_H
#define COMMON_KEYMAP_H
diff --git a/backends/keymapper/keymapper-defaults.h b/backends/keymapper/keymapper-defaults.h
index bd4afd4e3a..aedde873dc 100644
--- a/backends/keymapper/keymapper-defaults.h
+++ b/backends/keymapper/keymapper-defaults.h
@@ -1,24 +1,24 @@
/* ScummVM - Graphic Adventure Engine
-*
-* 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
-* of the License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*
-*/
+ *
+ * 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
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
#ifdef ENABLE_KEYMAPPER
diff --git a/backends/keymapper/keymapper.cpp b/backends/keymapper/keymapper.cpp
index dcb021f2d8..aba00c500d 100644
--- a/backends/keymapper/keymapper.cpp
+++ b/backends/keymapper/keymapper.cpp
@@ -1,24 +1,24 @@
/* ScummVM - Graphic Adventure Engine
-*
-* 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
-* of the License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*
-*/
+ *
+ * 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
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
#include "backends/keymapper/keymapper.h"
diff --git a/backends/keymapper/keymapper.h b/backends/keymapper/keymapper.h
index a54a2acbdc..ea6fc14e35 100644
--- a/backends/keymapper/keymapper.h
+++ b/backends/keymapper/keymapper.h
@@ -1,24 +1,24 @@
/* ScummVM - Graphic Adventure Engine
-*
-* 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
-* of the License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*
-*/
+ *
+ * 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
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
#ifndef COMMON_KEYMAPPER_H
#define COMMON_KEYMAPPER_H
diff --git a/backends/keymapper/remap-dialog.cpp b/backends/keymapper/remap-dialog.cpp
index 009c2201a9..3aa3647048 100644
--- a/backends/keymapper/remap-dialog.cpp
+++ b/backends/keymapper/remap-dialog.cpp
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#include "backends/keymapper/remap-dialog.h"
@@ -257,6 +258,12 @@ void RemapDialog::startRemapping(uint i) {
if (_topAction + i >= _currentActions.size())
return;
+ if (_keymapper->isRemapping()) {
+ // Handle a second click on the button as a stop to remapping
+ stopRemapping(true);
+ return;
+ }
+
_remapTimeout = g_system->getMillis() + kRemapTimeoutDelay;
Action *activeRemapAction = _currentActions[_topAction + i].action;
_keymapWidgets[i].keyButton->setLabel("...");
diff --git a/backends/keymapper/remap-dialog.h b/backends/keymapper/remap-dialog.h
index 82c68405db..054a471064 100644
--- a/backends/keymapper/remap-dialog.h
+++ b/backends/keymapper/remap-dialog.h
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#ifndef REMAP_DIALOG_H
diff --git a/backends/midi/alsa.cpp b/backends/midi/alsa.cpp
index c006b6b6bf..14889b2942 100644
--- a/backends/midi/alsa.cpp
+++ b/backends/midi/alsa.cpp
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
// Disable symbol overrides so that we can use system headers.
diff --git a/backends/midi/camd.cpp b/backends/midi/camd.cpp
index 88973488ca..d91aef5533 100644
--- a/backends/midi/camd.cpp
+++ b/backends/midi/camd.cpp
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
// Disable symbol overrides so that we can use system headers.
@@ -30,11 +31,13 @@
#include "common/error.h"
#include "common/endian.h"
#include "common/util.h"
+#include "common/str.h"
#include "audio/musicplugin.h"
#include "audio/mpu401.h"
#include <proto/camd.h>
#include <proto/exec.h>
+#include <proto/dos.h>
/*
* CAMD sequencer driver
@@ -55,6 +58,7 @@ private:
struct Library *_CamdBase;
struct CamdIFace *_ICamd;
struct MidiLink *_midi_link;
+ char _outport[128];
char *getDevice();
void closeAll();
@@ -154,13 +158,18 @@ char *MidiDriver_CAMD::getDevice() {
if (strstr(dev, "out") != NULL) {
// This is an output device, return this
- retname = dev;
+ Common::strlcpy(_outport, dev, sizeof(_outport));
+ retname = _outport;
} else {
// Search the next one
cluster = _ICamd->NextCluster(cluster);
}
}
+ // If the user has a preference outport set, use this instead
+ if(IDOS->GetVar("DefMidiOut", _outport, 128, 0))
+ retname = _outport;
+
_ICamd->UnlockCAMD(key);
}
diff --git a/backends/midi/coreaudio.cpp b/backends/midi/coreaudio.cpp
index e42b8ca313..74c590c654 100644
--- a/backends/midi/coreaudio.cpp
+++ b/backends/midi/coreaudio.cpp
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
// Disable symbol overrides so that we can use system headers.
diff --git a/backends/midi/coremidi.cpp b/backends/midi/coremidi.cpp
index 1d61dceba2..e2ec8405e9 100644
--- a/backends/midi/coremidi.cpp
+++ b/backends/midi/coremidi.cpp
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
// Disable symbol overrides so that we can use system headers.
diff --git a/backends/midi/dmedia.cpp b/backends/midi/dmedia.cpp
index 68e957f9aa..eac2d34b58 100644
--- a/backends/midi/dmedia.cpp
+++ b/backends/midi/dmedia.cpp
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
/*
diff --git a/backends/midi/seq.cpp b/backends/midi/seq.cpp
index 37986520bf..2ce25b726c 100644
--- a/backends/midi/seq.cpp
+++ b/backends/midi/seq.cpp
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
/*
diff --git a/backends/midi/sndio.cpp b/backends/midi/sndio.cpp
index a065a658e1..5efec4b899 100644
--- a/backends/midi/sndio.cpp
+++ b/backends/midi/sndio.cpp
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
// Disable symbol overrides so that we can use system headers.
diff --git a/backends/midi/stmidi.cpp b/backends/midi/stmidi.cpp
index 5a6326877e..28350b3cc2 100644
--- a/backends/midi/stmidi.cpp
+++ b/backends/midi/stmidi.cpp
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
/*
diff --git a/backends/midi/timidity.cpp b/backends/midi/timidity.cpp
index d2c60bec9d..d10b808bdb 100644
--- a/backends/midi/timidity.cpp
+++ b/backends/midi/timidity.cpp
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
/*
diff --git a/backends/midi/windows.cpp b/backends/midi/windows.cpp
index f4c5431d6e..e2b327ffa7 100644
--- a/backends/midi/windows.cpp
+++ b/backends/midi/windows.cpp
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
// Disable symbol overrides so that we can use system headers.
diff --git a/backends/mixer/doublebuffersdl/doublebuffersdl-mixer.cpp b/backends/mixer/doublebuffersdl/doublebuffersdl-mixer.cpp
index 3e5b9940e0..d59b0ebdfc 100644
--- a/backends/mixer/doublebuffersdl/doublebuffersdl-mixer.cpp
+++ b/backends/mixer/doublebuffersdl/doublebuffersdl-mixer.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/mixer/doublebuffersdl/doublebuffersdl-mixer.h b/backends/mixer/doublebuffersdl/doublebuffersdl-mixer.h
index c95294e2c0..e3019fe11b 100644
--- a/backends/mixer/doublebuffersdl/doublebuffersdl-mixer.h
+++ b/backends/mixer/doublebuffersdl/doublebuffersdl-mixer.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/mixer/nullmixer/nullsdl-mixer.cpp b/backends/mixer/nullmixer/nullsdl-mixer.cpp
index 2fd652e19f..97b59bb2ed 100644
--- a/backends/mixer/nullmixer/nullsdl-mixer.cpp
+++ b/backends/mixer/nullmixer/nullsdl-mixer.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/mixer/nullmixer/nullsdl-mixer.h b/backends/mixer/nullmixer/nullsdl-mixer.h
index 94248ced66..2fc46efc39 100644
--- a/backends/mixer/nullmixer/nullsdl-mixer.h
+++ b/backends/mixer/nullmixer/nullsdl-mixer.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/mixer/sdl/sdl-mixer.cpp b/backends/mixer/sdl/sdl-mixer.cpp
index 3c79290b50..7c709e91a3 100644
--- a/backends/mixer/sdl/sdl-mixer.cpp
+++ b/backends/mixer/sdl/sdl-mixer.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -58,6 +58,12 @@ void SdlMixerManager::init() {
error("Could not initialize SDL: %s", SDL_GetError());
}
+ const int maxNameLen = 20;
+ char sdlDriverName[maxNameLen];
+ sdlDriverName[0] = '\0';
+ SDL_AudioDriverName(sdlDriverName, maxNameLen);
+ debug(1, "Using SDL Audio Driver \"%s\"", sdlDriverName);
+
// Get the desired audio specs
SDL_AudioSpec desired = getAudioSpec(SAMPLES_PER_SEC);
diff --git a/backends/mixer/sdl/sdl-mixer.h b/backends/mixer/sdl/sdl-mixer.h
index 6fee26bd1f..088ebe109e 100644
--- a/backends/mixer/sdl/sdl-mixer.h
+++ b/backends/mixer/sdl/sdl-mixer.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/mixer/sdl13/sdl13-mixer.cpp b/backends/mixer/sdl13/sdl13-mixer.cpp
index 24d3434fde..f9894a6f91 100644
--- a/backends/mixer/sdl13/sdl13-mixer.cpp
+++ b/backends/mixer/sdl13/sdl13-mixer.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/mixer/sdl13/sdl13-mixer.h b/backends/mixer/sdl13/sdl13-mixer.h
index 9e07ea8673..ff2bb43084 100644
--- a/backends/mixer/sdl13/sdl13-mixer.h
+++ b/backends/mixer/sdl13/sdl13-mixer.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/mixer/symbiansdl/symbiansdl-mixer.cpp b/backends/mixer/symbiansdl/symbiansdl-mixer.cpp
index e978e9207f..debbb74c4f 100644
--- a/backends/mixer/symbiansdl/symbiansdl-mixer.cpp
+++ b/backends/mixer/symbiansdl/symbiansdl-mixer.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/mixer/symbiansdl/symbiansdl-mixer.h b/backends/mixer/symbiansdl/symbiansdl-mixer.h
index d59c98753b..4203d59350 100644
--- a/backends/mixer/symbiansdl/symbiansdl-mixer.h
+++ b/backends/mixer/symbiansdl/symbiansdl-mixer.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/mixer/wincesdl/wincesdl-mixer.cpp b/backends/mixer/wincesdl/wincesdl-mixer.cpp
index db5ab59446..2c70ee76c7 100644
--- a/backends/mixer/wincesdl/wincesdl-mixer.cpp
+++ b/backends/mixer/wincesdl/wincesdl-mixer.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/mixer/wincesdl/wincesdl-mixer.h b/backends/mixer/wincesdl/wincesdl-mixer.h
index fb51f6ac64..56883fa080 100644
--- a/backends/mixer/wincesdl/wincesdl-mixer.h
+++ b/backends/mixer/wincesdl/wincesdl-mixer.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/modular-backend.cpp b/backends/modular-backend.cpp
index 6afe06aeca..d8be9ca7ed 100644
--- a/backends/modular-backend.cpp
+++ b/backends/modular-backend.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/modular-backend.h b/backends/modular-backend.h
index b43769c716..20e8b7357d 100644
--- a/backends/modular-backend.h
+++ b/backends/modular-backend.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/module.mk b/backends/module.mk
index 31ac444750..34e2928419 100644
--- a/backends/module.mk
+++ b/backends/module.mk
@@ -40,14 +40,6 @@ MODULE_OBJS += \
keymapper/remap-dialog.o
endif
-ifdef USE_OPENGL
-MODULE_OBJS += \
- graphics/opengl/glerrorcheck.o \
- graphics/opengl/gltexture.o \
- graphics/opengl/opengl-graphics.o \
- graphics/openglsdl/openglsdl-graphics.o
-endif
-
ifdef ENABLE_VKEYBD
MODULE_OBJS += \
vkeybd/image-map.o \
@@ -57,6 +49,15 @@ MODULE_OBJS += \
vkeybd/virtual-keyboard-parser.o
endif
+# OpenGL specific source files.
+ifdef USE_OPENGL
+MODULE_OBJS += \
+ graphics/opengl/debug.o \
+ graphics/opengl/extensions.o \
+ graphics/opengl/opengl-graphics.o \
+ graphics/opengl/texture.o
+endif
+
# SDL specific source files.
# We cannot just check $BACKEND = sdl, as various other backends
# derive from the SDL backend, and they all need the following files.
@@ -76,6 +77,11 @@ ifndef USE_SDL13
MODULE_OBJS += \
audiocd/sdl/sdl-audiocd.o
endif
+
+ifdef USE_OPENGL
+MODULE_OBJS += \
+ graphics/openglsdl/openglsdl-graphics.o
+endif
endif
ifdef POSIX
@@ -91,7 +97,8 @@ ifdef MACOSX
MODULE_OBJS += \
midi/coreaudio.o \
midi/coremidi.o \
- updates/macosx/macosx-updates.o
+ updates/macosx/macosx-updates.o \
+ taskbar/macosx/macosx-taskbar.o
endif
ifdef WIN32
diff --git a/backends/mutex/mutex.h b/backends/mutex/mutex.h
index 9cc16c7a2c..26a6d47e09 100644
--- a/backends/mutex/mutex.h
+++ b/backends/mutex/mutex.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/mutex/null/null-mutex.h b/backends/mutex/null/null-mutex.h
index 7ae10cedb8..218b1adf02 100644
--- a/backends/mutex/null/null-mutex.h
+++ b/backends/mutex/null/null-mutex.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/mutex/sdl/sdl-mutex.cpp b/backends/mutex/sdl/sdl-mutex.cpp
index a51e6f0e38..be10d30500 100644
--- a/backends/mutex/sdl/sdl-mutex.cpp
+++ b/backends/mutex/sdl/sdl-mutex.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/mutex/sdl/sdl-mutex.h b/backends/mutex/sdl/sdl-mutex.h
index 914c2a19db..6fcae05cee 100644
--- a/backends/mutex/sdl/sdl-mutex.h
+++ b/backends/mutex/sdl/sdl-mutex.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/android/android.cpp b/backends/platform/android/android.cpp
index 5e3d1d0db6..3ff1b939ef 100644
--- a/backends/platform/android/android.cpp
+++ b/backends/platform/android/android.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/android/android.h b/backends/platform/android/android.h
index 704ce12f60..28016f5e3e 100644
--- a/backends/platform/android/android.h
+++ b/backends/platform/android/android.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/android/android.mk b/backends/platform/android/android.mk
index 915bf8ac60..7c4fe01d54 100644
--- a/backends/platform/android/android.mk
+++ b/backends/platform/android/android.mk
@@ -7,6 +7,7 @@ ANDROID_PLUGIN_VERSIONCODE = 6
JAVA_FILES = \
ScummVM.java \
ScummVMEvents.java \
+ ScummVMEventsHoneycomb.java \
ScummVMApplication.java \
ScummVMActivity.java \
EditableSurfaceView.java \
diff --git a/backends/platform/android/asset-archive.cpp b/backends/platform/android/asset-archive.cpp
index da378fb082..52c2c084bd 100644
--- a/backends/platform/android/asset-archive.cpp
+++ b/backends/platform/android/asset-archive.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/android/asset-archive.h b/backends/platform/android/asset-archive.h
index c5e43555e0..6a0033d24e 100644
--- a/backends/platform/android/asset-archive.h
+++ b/backends/platform/android/asset-archive.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/android/events.cpp b/backends/platform/android/events.cpp
index 5c42db9347..c60626ec36 100644
--- a/backends/platform/android/events.cpp
+++ b/backends/platform/android/events.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/android/gfx.cpp b/backends/platform/android/gfx.cpp
index 882dcff9a4..d7713f99d8 100644
--- a/backends/platform/android/gfx.cpp
+++ b/backends/platform/android/gfx.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -94,6 +94,7 @@ Common::List<Graphics::PixelFormat> OSystem_Android::getSupportedFormats() const
Common::List<Graphics::PixelFormat> res;
res.push_back(GLES565Texture::pixelFormat());
res.push_back(GLES5551Texture::pixelFormat());
+ res.push_back(GLES8888Texture::pixelFormat());
res.push_back(GLES4444Texture::pixelFormat());
res.push_back(Graphics::PixelFormat::createFormatCLUT8());
@@ -147,6 +148,8 @@ void OSystem_Android::initTexture(GLESBaseTexture **texture,
*texture = new GLES565Texture();
else if (format_new == GLES5551Texture::pixelFormat())
*texture = new GLES5551Texture();
+ else if (format_new == GLES8888Texture::pixelFormat())
+ *texture = new GLES8888Texture();
else if (format_new == GLES4444Texture::pixelFormat())
*texture = new GLES4444Texture();
else {
@@ -233,7 +236,7 @@ void OSystem_Android::initViewport() {
GLCALL(glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST));
GLCALL(glEnable(GL_BLEND));
- GLCALL(glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA));
+ GLCALL(glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA));
GLCALL(glEnableClientState(GL_VERTEX_ARRAY));
GLCALL(glEnableClientState(GL_TEXTURE_COORD_ARRAY));
@@ -726,7 +729,7 @@ void OSystem_Android::setMouseCursor(const void *buf, uint w, uint h,
_mouse_keycolor = keycolor;
p = _mouse_texture_palette->palette() + _mouse_keycolor * 2;
- WRITE_UINT16(p, READ_UINT16(p) & ~1);
+ WRITE_UINT16(p, 0);
}
if (w == 0 || h == 0)
@@ -752,12 +755,12 @@ void OSystem_Android::setMouseCursor(const void *buf, uint w, uint h,
return;
}
- uint16 *s = (uint16 *)buf;
+ const uint16 *s = (const uint16 *)buf;
uint16 *d = (uint16 *)tmp;
for (uint16 y = 0; y < h; ++y, d += pitch / 2 - w)
for (uint16 x = 0; x < w; ++x, d++)
- if (*s++ != (keycolor & 0xffff))
- *d |= 1;
+ if (*s++ == (keycolor & 0xffff))
+ *d = 0;
_mouse_texture->updateBuffer(0, 0, w, h, tmp, pitch);
@@ -779,7 +782,7 @@ void OSystem_Android::setCursorPaletteInternal(const byte *colors,
WRITE_UINT16(p, pf.RGBToColor(colors[0], colors[1], colors[2]));
p = _mouse_texture_palette->palette() + _mouse_keycolor * 2;
- WRITE_UINT16(p, READ_UINT16(p) & ~1);
+ WRITE_UINT16(p, 0);
}
void OSystem_Android::setCursorPalette(const byte *colors,
@@ -821,7 +824,7 @@ void OSystem_Android::disableCursorPalette() {
}
byte *p = _mouse_texture_palette->palette() + _mouse_keycolor * 2;
- WRITE_UINT16(p, READ_UINT16(p) & ~1);
+ WRITE_UINT16(p, 0);
}
}
diff --git a/backends/platform/android/jni.cpp b/backends/platform/android/jni.cpp
index 2b738dd63f..764c84ce1c 100644
--- a/backends/platform/android/jni.cpp
+++ b/backends/platform/android/jni.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/android/jni.h b/backends/platform/android/jni.h
index 52698e0f35..326869b1ee 100644
--- a/backends/platform/android/jni.h
+++ b/backends/platform/android/jni.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/android/org/scummvm/scummvm/ScummVM.java b/backends/platform/android/org/scummvm/scummvm/ScummVM.java
index 3a25b54eeb..5047502e61 100644
--- a/backends/platform/android/org/scummvm/scummvm/ScummVM.java
+++ b/backends/platform/android/org/scummvm/scummvm/ScummVM.java
@@ -86,13 +86,15 @@ public abstract class ScummVM implements SurfaceHolder.Callback, Runnable {
Log.d(LOG_TAG, String.format("surfaceChanged: %dx%d (%d)",
width, height, format));
+ // store values for the native code
+ // make sure to do it before notifying the lock
+ // as it leads to a race condition otherwise
+ setSurface(width, height);
+
synchronized(_sem_surface) {
_surface_holder = holder;
_sem_surface.notifyAll();
}
-
- // store values for the native code
- setSurface(width, height);
}
// SurfaceHolder callback
diff --git a/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java b/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java
index 5d041dafd2..5964d5bfde 100644
--- a/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java
+++ b/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java
@@ -4,6 +4,7 @@ import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.media.AudioManager;
+import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.util.DisplayMetrics;
@@ -169,7 +170,14 @@ public class ScummVMActivity extends Activity {
_mouseHelper.attach(main_surface);
}
- _events = new ScummVMEvents(this, _scummvm, _mouseHelper);
+ if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB_MR1)
+ {
+ _events = new ScummVMEvents(this, _scummvm, _mouseHelper);
+ }
+ else
+ {
+ _events = new ScummVMEventsHoneycomb(this, _scummvm, _mouseHelper);
+ }
main_surface.setOnKeyListener(_events);
main_surface.setOnTouchListener(_events);
diff --git a/backends/platform/android/org/scummvm/scummvm/ScummVMEvents.java b/backends/platform/android/org/scummvm/scummvm/ScummVMEvents.java
index 702215341b..32c65d3395 100644
--- a/backends/platform/android/org/scummvm/scummvm/ScummVMEvents.java
+++ b/backends/platform/android/org/scummvm/scummvm/ScummVMEvents.java
@@ -68,15 +68,7 @@ public class ScummVMEvents implements
return true;
}
- public boolean onGenericMotionEvent(final MotionEvent e) {
- if((e.getSource() & InputDevice.SOURCE_CLASS_JOYSTICK) != 0) {
- _scummvm.pushEvent(JE_JOYSTICK, e.getAction(),
- (int)(e.getAxisValue(MotionEvent.AXIS_X)*100),
- (int)(e.getAxisValue(MotionEvent.AXIS_Y)*100),
- 0, 0);
- return true;
- }
-
+ public boolean onGenericMotionEvent(MotionEvent e) {
return false;
}
diff --git a/backends/platform/android/org/scummvm/scummvm/ScummVMEventsHoneycomb.java b/backends/platform/android/org/scummvm/scummvm/ScummVMEventsHoneycomb.java
new file mode 100644
index 0000000000..ab85429040
--- /dev/null
+++ b/backends/platform/android/org/scummvm/scummvm/ScummVMEventsHoneycomb.java
@@ -0,0 +1,25 @@
+package org.scummvm.scummvm;
+
+import android.content.Context;
+import android.view.MotionEvent;
+import android.view.InputDevice;
+
+public class ScummVMEventsHoneycomb extends ScummVMEvents {
+
+ public ScummVMEventsHoneycomb(Context context, ScummVM scummvm, MouseHelper mouseHelper) {
+ super(context, scummvm, mouseHelper);
+ }
+
+ @Override
+ public boolean onGenericMotionEvent(MotionEvent e) {
+ if((e.getSource() & InputDevice.SOURCE_CLASS_JOYSTICK) != 0) {
+ _scummvm.pushEvent(JE_JOYSTICK, e.getAction(),
+ (int)(e.getAxisValue(MotionEvent.AXIS_X)*100),
+ (int)(e.getAxisValue(MotionEvent.AXIS_Y)*100),
+ 0, 0);
+ return true;
+ }
+
+ return false;
+ }
+}
diff --git a/backends/platform/android/texture.cpp b/backends/platform/android/texture.cpp
index cc41c0d8a6..165396b82b 100644
--- a/backends/platform/android/texture.cpp
+++ b/backends/platform/android/texture.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -259,11 +259,15 @@ void GLESTexture::fillBuffer(uint32 color) {
assert(_surface.getPixels());
if (_pixelFormat.bytesPerPixel == 1 ||
- ((color & 0xff) == ((color >> 8) & 0xff)))
+ (_pixelFormat.bytesPerPixel == 2 &&
+ ((color & 0xff) == ((color >> 8) & 0xff))))
memset(_pixels, color & 0xff, _surface.pitch * _surface.h);
- else
- Common::fill(_pixels, _pixels + _surface.pitch * _surface.h,
+ else if (_pixelFormat.bytesPerPixel == 2)
+ Common::fill((uint16 *)_pixels, (uint16 *)(_pixels + _surface.pitch * _surface.h),
(uint16)color);
+ else
+ Common::fill((uint32 *)_pixels, (uint32 *)(_pixels + _surface.pitch * _surface.h),
+ color);
setDirty();
}
@@ -334,6 +338,13 @@ GLES565Texture::GLES565Texture() :
GLES565Texture::~GLES565Texture() {
}
+GLES8888Texture::GLES8888Texture() :
+ GLESTexture(GL_RGBA, GL_UNSIGNED_BYTE, pixelFormat()) {
+}
+
+GLES8888Texture::~GLES8888Texture() {
+}
+
GLESFakePaletteTexture::GLESFakePaletteTexture(GLenum glFormat, GLenum glType,
Graphics::PixelFormat pixelFormat) :
GLESBaseTexture(glFormat, glType, pixelFormat),
diff --git a/backends/platform/android/texture.h b/backends/platform/android/texture.h
index 4307b5a1bc..4b05dfd5d4 100644
--- a/backends/platform/android/texture.h
+++ b/backends/platform/android/texture.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -224,6 +224,18 @@ public:
}
};
+// RGBA8888 texture
+class GLES8888Texture : public GLESTexture {
+public:
+ GLES8888Texture();
+ virtual ~GLES8888Texture();
+
+ static inline Graphics::PixelFormat pixelFormat() {
+ // We assume LE since all Android platforms are LE.
+ return Graphics::PixelFormat(4, 8, 8, 8, 8, 0, 8, 16, 24);
+ }
+};
+
class GLESFakePaletteTexture : public GLESBaseTexture {
protected:
GLESFakePaletteTexture(GLenum glFormat, GLenum glType,
diff --git a/backends/platform/dc/DCLauncherDialog.h b/backends/platform/dc/DCLauncherDialog.h
index 519524222f..5131482cb6 100644
--- a/backends/platform/dc/DCLauncherDialog.h
+++ b/backends/platform/dc/DCLauncherDialog.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/dc/audio.cpp b/backends/platform/dc/audio.cpp
index 4f01531486..4759ddb799 100644
--- a/backends/platform/dc/audio.cpp
+++ b/backends/platform/dc/audio.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/dc/dc-fs.cpp b/backends/platform/dc/dc-fs.cpp
index 36f5a1465c..77fe4143dd 100644
--- a/backends/platform/dc/dc-fs.cpp
+++ b/backends/platform/dc/dc-fs.cpp
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#define FORBIDDEN_SYMBOL_ALLOW_ALL
@@ -27,7 +28,9 @@
#include <ronin/cdfs.h>
#include <stdio.h>
+#define usleep usleep_unistd
#include <unistd.h>
+#undef usleep
/**
* Implementation of the ScummVM file system API based on Ronin.
diff --git a/backends/platform/dc/dc.h b/backends/platform/dc/dc.h
index d62ced02e1..d8ab549c3a 100644
--- a/backends/platform/dc/dc.h
+++ b/backends/platform/dc/dc.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -43,7 +43,9 @@ class Interactive
public:
virtual int key(int k, byte &shiftFlags) = 0;
virtual void mouse(int x, int y) = 0;
+ virtual ~Interactive() = 0;
};
+inline Interactive::~Interactive() { }
#include "softkbd.h"
diff --git a/backends/platform/dc/dcloader.cpp b/backends/platform/dc/dcloader.cpp
index 56193c282a..bc5e3a733b 100644
--- a/backends/platform/dc/dcloader.cpp
+++ b/backends/platform/dc/dcloader.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/dc/dcloader.h b/backends/platform/dc/dcloader.h
index 1782467acd..074ae7aa29 100644
--- a/backends/platform/dc/dcloader.h
+++ b/backends/platform/dc/dcloader.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/dc/dcmain.cpp b/backends/platform/dc/dcmain.cpp
index bec1fdae3a..eede796991 100644
--- a/backends/platform/dc/dcmain.cpp
+++ b/backends/platform/dc/dcmain.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -79,13 +79,14 @@ static bool find_track(int track, int &first_sec, int &last_sec)
if (first < 1 || last > 99 || first > last)
return false;
for (i=first; i<=last; i++)
- if (!(TOC_CTRL(toc->entry[i-1])&4))
+ if (!(TOC_CTRL(toc->entry[i-1])&4)) {
if (track==1) {
first_sec = TOC_LBA(toc->entry[i-1]);
last_sec = TOC_LBA(toc->entry[i]);
return true;
} else
--track;
+ }
return false;
}
@@ -281,7 +282,7 @@ namespace DC_Flash {
if((r = syscall_read_flash(info[0] + (bmb++ << 6), bm, 64))<0)
return r;
}
- if(!(bm[(b>>3)&63] & (0x80>>(b&7))))
+ if(!(bm[(b>>3)&63] & (0x80>>(b&7)))) {
if((r = syscall_read_flash(info[0] + ((b+1) << 6), buf, 64))<0)
return r;
else if((s=*(unsigned short *)(buf+0)) == sec &&
@@ -289,6 +290,7 @@ namespace DC_Flash {
memcpy(dst+(s-sec)*60, buf+2, 60);
got=1;
}
+ }
}
return got;
}
diff --git a/backends/platform/dc/display.cpp b/backends/platform/dc/display.cpp
index 54ee6000ed..1785c3c416 100644
--- a/backends/platform/dc/display.cpp
+++ b/backends/platform/dc/display.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/dc/icon.cpp b/backends/platform/dc/icon.cpp
index cf7afc82e0..ba621883a9 100644
--- a/backends/platform/dc/icon.cpp
+++ b/backends/platform/dc/icon.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -47,8 +47,8 @@ void Icon::create_vmicon(void *buffer)
void Icon::create_texture()
{
- static char tt[16] = { 0, 1, 4, 5, 16, 17, 20, 21,
- 64, 65, 68, 69, 80, 81, 84, 85 };
+ static unsigned char tt[16] = { 0, 1, 4, 5, 16, 17, 20, 21,
+ 64, 65, 68, 69, 80, 81, 84, 85 };
unsigned short *tex = (unsigned short *)ta_txalloc(512);
unsigned short *linebase;
unsigned char *src = bitmap+sizeof(bitmap)-17;
diff --git a/backends/platform/dc/icon.h b/backends/platform/dc/icon.h
index e412e67a84..253455fe30 100644
--- a/backends/platform/dc/icon.h
+++ b/backends/platform/dc/icon.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/dc/input.cpp b/backends/platform/dc/input.cpp
index 7b21c76efa..a69bb3b78f 100644
--- a/backends/platform/dc/input.cpp
+++ b/backends/platform/dc/input.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -50,10 +50,10 @@ int handleInput(struct mapledev *pad, int &mouse_x, int &mouse_y,
else if (!(buttons & 512)) newkey = ' ';
else if (!(buttons & 1024)) newkey = numpadmap[(buttons>>4)&15];
- if (!(buttons & 128)) if (inter) newkey = 1001; else mouse_x++;
- if (!(buttons & 64)) if (inter) newkey = 1002; else mouse_x--;
- if (!(buttons & 32)) if (inter) newkey = 1003; else mouse_y++;
- if (!(buttons & 16)) if (inter) newkey = 1004; else mouse_y--;
+ if (!(buttons & 128)) { if (inter) newkey = 1001; else mouse_x++; }
+ if (!(buttons & 64)) { if (inter) newkey = 1002; else mouse_x--; }
+ if (!(buttons & 32)) { if (inter) newkey = 1003; else mouse_y++; }
+ if (!(buttons & 16)) { if (inter) newkey = 1004; else mouse_y--; }
mouse_x += ((int)pad->cond.controller.joyx-128)>>4;
mouse_y += ((int)pad->cond.controller.joyy-128)>>4;
@@ -157,7 +157,7 @@ int handleInput(struct mapledev *pad, int &mouse_x, int &mouse_y,
return -Common::EVENT_RBUTTONUP;
}
- if (mouse_wheel != lastwheel)
+ if (mouse_wheel != lastwheel) {
if (((int8)(mouse_wheel - lastwheel)) > 0) {
lastwheel++;
return -Common::EVENT_WHEELDOWN;
@@ -165,6 +165,7 @@ int handleInput(struct mapledev *pad, int &mouse_x, int &mouse_y,
--lastwheel;
return -Common::EVENT_WHEELUP;
}
+ }
if (newkey && inter && newkey != lastkey) {
int transkey = inter->key(newkey, shiftFlags);
diff --git a/backends/platform/dc/ip.txt.in b/backends/platform/dc/ip.txt.in
index 23424e0950..539d29dd1e 100644
--- a/backends/platform/dc/ip.txt.in
+++ b/backends/platform/dc/ip.txt.in
@@ -7,5 +7,5 @@ Product No : T0000
Version : @VERSION@
Release Date : @DATE@
Boot Filename : SCUMMVM.BIN
-SW Maker Name : The ScummVM team
+SW Maker Name : The ScummVM Team
Game Title : ScummVM
diff --git a/backends/platform/dc/label.cpp b/backends/platform/dc/label.cpp
index 5db031958f..46bff0db11 100644
--- a/backends/platform/dc/label.cpp
+++ b/backends/platform/dc/label.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/dc/label.h b/backends/platform/dc/label.h
index 6b96175d29..2a7e7b35ea 100644
--- a/backends/platform/dc/label.h
+++ b/backends/platform/dc/label.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/dc/plugins.cpp b/backends/platform/dc/plugins.cpp
index 2942a4f155..93689157f3 100644
--- a/backends/platform/dc/plugins.cpp
+++ b/backends/platform/dc/plugins.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/dc/portdefs.h b/backends/platform/dc/portdefs.h
index 1f5c8f566a..191bbea09c 100644
--- a/backends/platform/dc/portdefs.h
+++ b/backends/platform/dc/portdefs.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/dc/selector.cpp b/backends/platform/dc/selector.cpp
index 4026c7dde6..6717ca494b 100644
--- a/backends/platform/dc/selector.cpp
+++ b/backends/platform/dc/selector.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/dc/softkbd.cpp b/backends/platform/dc/softkbd.cpp
index 076f826d1c..19f7b409a1 100644
--- a/backends/platform/dc/softkbd.cpp
+++ b/backends/platform/dc/softkbd.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/dc/softkbd.h b/backends/platform/dc/softkbd.h
index 8f87d12baa..c7c4357a44 100644
--- a/backends/platform/dc/softkbd.h
+++ b/backends/platform/dc/softkbd.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -40,6 +40,7 @@ class SoftKeyboard : public Interactive
public:
SoftKeyboard(const OSystem_Dreamcast *os);
+ virtual ~SoftKeyboard() {}
void draw(float x, float y, int transp = 0);
int key(int k, byte &shiftFlags);
diff --git a/backends/platform/dc/time.cpp b/backends/platform/dc/time.cpp
index 1e5f44ec85..ada53bf755 100644
--- a/backends/platform/dc/time.cpp
+++ b/backends/platform/dc/time.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/dc/vmsave.cpp b/backends/platform/dc/vmsave.cpp
index ba3b787942..5f5cdff24f 100644
--- a/backends/platform/dc/vmsave.cpp
+++ b/backends/platform/dc/vmsave.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/dingux/dingux.cpp b/backends/platform/dingux/dingux.cpp
index 674c2ea780..2f11dd31ad 100644
--- a/backends/platform/dingux/dingux.cpp
+++ b/backends/platform/dingux/dingux.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/dingux/dingux.h b/backends/platform/dingux/dingux.h
index 2a07a8a46a..add74fa039 100644
--- a/backends/platform/dingux/dingux.h
+++ b/backends/platform/dingux/dingux.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/dingux/main.cpp b/backends/platform/dingux/main.cpp
index 4fc67d874f..98b5058c06 100644
--- a/backends/platform/dingux/main.cpp
+++ b/backends/platform/dingux/main.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/ds/arm7/source/main.cpp b/backends/platform/ds/arm7/source/main.cpp
index 6e714b22fa..c4a22b8f68 100644
--- a/backends/platform/ds/arm7/source/main.cpp
+++ b/backends/platform/ds/arm7/source/main.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/ds/arm9/source/blitters.cpp b/backends/platform/ds/arm9/source/blitters.cpp
index ef2dc9c3b8..44de0ed0f6 100644
--- a/backends/platform/ds/arm9/source/blitters.cpp
+++ b/backends/platform/ds/arm9/source/blitters.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/ds/arm9/source/blitters.h b/backends/platform/ds/arm9/source/blitters.h
index de6e218778..602cde4755 100644
--- a/backends/platform/ds/arm9/source/blitters.h
+++ b/backends/platform/ds/arm9/source/blitters.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/ds/arm9/source/cdaudio.cpp b/backends/platform/ds/arm9/source/cdaudio.cpp
index 277e1f4ae7..c963f4d8bd 100644
--- a/backends/platform/ds/arm9/source/cdaudio.cpp
+++ b/backends/platform/ds/arm9/source/cdaudio.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/ds/arm9/source/cdaudio.h b/backends/platform/ds/arm9/source/cdaudio.h
index 8a0e0c5174..77766bae8e 100644
--- a/backends/platform/ds/arm9/source/cdaudio.h
+++ b/backends/platform/ds/arm9/source/cdaudio.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/ds/arm9/source/dsmain.cpp b/backends/platform/ds/arm9/source/dsmain.cpp
index 9dc66e80d7..b7c9c108a6 100644
--- a/backends/platform/ds/arm9/source/dsmain.cpp
+++ b/backends/platform/ds/arm9/source/dsmain.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/ds/arm9/source/dsmain.h b/backends/platform/ds/arm9/source/dsmain.h
index 5e91fae13a..fec97d878e 100644
--- a/backends/platform/ds/arm9/source/dsmain.h
+++ b/backends/platform/ds/arm9/source/dsmain.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/ds/arm9/source/dsoptions.cpp b/backends/platform/ds/arm9/source/dsoptions.cpp
index ac552bd826..733592e958 100644
--- a/backends/platform/ds/arm9/source/dsoptions.cpp
+++ b/backends/platform/ds/arm9/source/dsoptions.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/ds/arm9/source/dsoptions.h b/backends/platform/ds/arm9/source/dsoptions.h
index 9949b8b7d2..35e30a87d5 100644
--- a/backends/platform/ds/arm9/source/dsoptions.h
+++ b/backends/platform/ds/arm9/source/dsoptions.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/ds/arm9/source/gbampsave.cpp b/backends/platform/ds/arm9/source/gbampsave.cpp
index 3192e2d277..ef6091e2a2 100644
--- a/backends/platform/ds/arm9/source/gbampsave.cpp
+++ b/backends/platform/ds/arm9/source/gbampsave.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/ds/arm9/source/gbampsave.h b/backends/platform/ds/arm9/source/gbampsave.h
index 0d9d9aca8c..d86db2ec70 100644
--- a/backends/platform/ds/arm9/source/gbampsave.h
+++ b/backends/platform/ds/arm9/source/gbampsave.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/ds/arm9/source/keys.h b/backends/platform/ds/arm9/source/keys.h
index 9d6b41c746..d118b37f28 100644
--- a/backends/platform/ds/arm9/source/keys.h
+++ b/backends/platform/ds/arm9/source/keys.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/ds/arm9/source/osystem_ds.cpp b/backends/platform/ds/arm9/source/osystem_ds.cpp
index f109983fbc..c53f57523d 100644
--- a/backends/platform/ds/arm9/source/osystem_ds.cpp
+++ b/backends/platform/ds/arm9/source/osystem_ds.cpp
@@ -16,7 +16,8 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
diff --git a/backends/platform/ds/arm9/source/osystem_ds.h b/backends/platform/ds/arm9/source/osystem_ds.h
index 4550e22b2c..f4dbac66f7 100644
--- a/backends/platform/ds/arm9/source/osystem_ds.h
+++ b/backends/platform/ds/arm9/source/osystem_ds.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/ds/arm9/source/portdefs.h b/backends/platform/ds/arm9/source/portdefs.h
index e40849a513..0a20c459ab 100644
--- a/backends/platform/ds/arm9/source/portdefs.h
+++ b/backends/platform/ds/arm9/source/portdefs.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/ds/arm9/source/scummhelp.cpp b/backends/platform/ds/arm9/source/scummhelp.cpp
index a3fdaacfaa..a0fb9bd0ab 100644
--- a/backends/platform/ds/arm9/source/scummhelp.cpp
+++ b/backends/platform/ds/arm9/source/scummhelp.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/ds/arm9/source/scummhelp.h b/backends/platform/ds/arm9/source/scummhelp.h
index 41fc8f9c91..4e8d709c4f 100644
--- a/backends/platform/ds/arm9/source/scummhelp.h
+++ b/backends/platform/ds/arm9/source/scummhelp.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/ds/arm9/source/touchkeyboard.cpp b/backends/platform/ds/arm9/source/touchkeyboard.cpp
index 77da9cc22a..30c46dbf06 100644
--- a/backends/platform/ds/arm9/source/touchkeyboard.cpp
+++ b/backends/platform/ds/arm9/source/touchkeyboard.cpp
@@ -16,9 +16,10 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
+
#include <nds.h>
#include "NDS/scummvm_ipc.h"
#include "touchkeyboard.h"
diff --git a/backends/platform/ds/arm9/source/touchkeyboard.h b/backends/platform/ds/arm9/source/touchkeyboard.h
index dc20601023..f64d531b82 100644
--- a/backends/platform/ds/arm9/source/touchkeyboard.h
+++ b/backends/platform/ds/arm9/source/touchkeyboard.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/ds/arm9/source/wordcompletion.cpp b/backends/platform/ds/arm9/source/wordcompletion.cpp
index 51f93df7ff..36fa31247c 100644
--- a/backends/platform/ds/arm9/source/wordcompletion.cpp
+++ b/backends/platform/ds/arm9/source/wordcompletion.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/ds/arm9/source/wordcompletion.h b/backends/platform/ds/arm9/source/wordcompletion.h
index c355d29293..d6e7224186 100644
--- a/backends/platform/ds/arm9/source/wordcompletion.h
+++ b/backends/platform/ds/arm9/source/wordcompletion.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/ds/arm9/source/zipreader.cpp b/backends/platform/ds/arm9/source/zipreader.cpp
index 49552a86b2..0de2b0c981 100644
--- a/backends/platform/ds/arm9/source/zipreader.cpp
+++ b/backends/platform/ds/arm9/source/zipreader.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/ds/arm9/source/zipreader.h b/backends/platform/ds/arm9/source/zipreader.h
index 70f000eb4b..0078919d5f 100644
--- a/backends/platform/ds/arm9/source/zipreader.h
+++ b/backends/platform/ds/arm9/source/zipreader.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/ds/commoninclude/NDS/scummvm_ipc.h b/backends/platform/ds/commoninclude/NDS/scummvm_ipc.h
index 360b7b03dc..540348ca0b 100644
--- a/backends/platform/ds/commoninclude/NDS/scummvm_ipc.h
+++ b/backends/platform/ds/commoninclude/NDS/scummvm_ipc.h
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#ifndef SCUMMVM_IPC_INCLUDE
diff --git a/backends/platform/gph/gph-backend.cpp b/backends/platform/gph/gph-backend.cpp
index 485780b472..d033191d54 100644
--- a/backends/platform/gph/gph-backend.cpp
+++ b/backends/platform/gph/gph-backend.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -172,7 +172,7 @@ void OSystem_GPH::initSDL() {
// Check if SDL has not been initialized
if (!_initedSDL) {
- uint32 sdlFlags = SDL_INIT_EVENTTHREAD;
+ uint32 sdlFlags = SDL_INIT_EVENTTHREAD | SDL_INIT_VIDEO;
if (ConfMan.hasKey("disable_sdl_parachute"))
sdlFlags |= SDL_INIT_NOPARACHUTE;
diff --git a/backends/platform/gph/gph-hw.cpp b/backends/platform/gph/gph-hw.cpp
index cde50dc6b4..7b004f1739 100644
--- a/backends/platform/gph/gph-hw.cpp
+++ b/backends/platform/gph/gph-hw.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/gph/gph-hw.h b/backends/platform/gph/gph-hw.h
index f9584ca37e..c6d0094cf1 100644
--- a/backends/platform/gph/gph-hw.h
+++ b/backends/platform/gph/gph-hw.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/gph/gph-main.cpp b/backends/platform/gph/gph-main.cpp
index 876de0f358..5fce37179e 100644
--- a/backends/platform/gph/gph-main.cpp
+++ b/backends/platform/gph/gph-main.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/gph/gph.h b/backends/platform/gph/gph.h
index 90a798154f..d7004f1582 100644
--- a/backends/platform/gph/gph.h
+++ b/backends/platform/gph/gph.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/iphone/iphone_common.h b/backends/platform/iphone/iphone_common.h
index 9c45a240cb..59dca84b85 100644
--- a/backends/platform/iphone/iphone_common.h
+++ b/backends/platform/iphone/iphone_common.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/iphone/iphone_keyboard.h b/backends/platform/iphone/iphone_keyboard.h
index 2d1238c92f..d54df9ac96 100644
--- a/backends/platform/iphone/iphone_keyboard.h
+++ b/backends/platform/iphone/iphone_keyboard.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/iphone/iphone_keyboard.mm b/backends/platform/iphone/iphone_keyboard.mm
index b00930ab31..39d68aff81 100644
--- a/backends/platform/iphone/iphone_keyboard.mm
+++ b/backends/platform/iphone/iphone_keyboard.mm
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -39,7 +39,7 @@
@implementation TextInputHandler
-- (id)initWithKeyboard:(SoftKeyboard *)keyboard; {
+- (id)initWithKeyboard:(SoftKeyboard *)keyboard {
self = [super initWithFrame:CGRectMake(0.0f, 0.0f, 0.0f, 0.0f)];
softKeyboard = keyboard;
diff --git a/backends/platform/iphone/iphone_main.mm b/backends/platform/iphone/iphone_main.mm
index e76ffe866e..3707f10a29 100644
--- a/backends/platform/iphone/iphone_main.mm
+++ b/backends/platform/iphone/iphone_main.mm
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/iphone/iphone_video.h b/backends/platform/iphone/iphone_video.h
index 6b8c25ebcf..7dbf3c57ab 100644
--- a/backends/platform/iphone/iphone_video.h
+++ b/backends/platform/iphone/iphone_video.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -70,6 +70,7 @@
GLfloat _mouseScaleX, _mouseScaleY;
int _scaledShakeOffsetY;
+ CGFloat _contentScaleFactor;
UITouch *_firstTouch;
UITouch *_secondTouch;
diff --git a/backends/platform/iphone/iphone_video.mm b/backends/platform/iphone/iphone_video.mm
index f2c1527658..5048b57328 100644
--- a/backends/platform/iphone/iphone_video.mm
+++ b/backends/platform/iphone/iphone_video.mm
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -161,9 +161,23 @@ const char *iPhone_getDocumentsDir() {
- (id)initWithFrame:(struct CGRect)frame {
self = [super initWithFrame: frame];
+ _contentScaleFactor = 1;
if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)]) {
if ([self respondsToSelector:@selector(setContentScaleFactor:)]) {
- [self setContentScaleFactor:[[UIScreen mainScreen] scale]];
+ // Horrible and crazy method to get the proper return value of
+ // scale when the SDK used for building does not know anything
+ // about the selector scale...
+ NSMethodSignature *scaleSignature = [UIScreen instanceMethodSignatureForSelector:@selector(scale)];
+ NSInvocation *scaleInvocation = [NSInvocation invocationWithMethodSignature:scaleSignature];
+ [scaleInvocation setTarget:[UIScreen mainScreen]];
+ [scaleInvocation setSelector:@selector(scale)];
+ [scaleInvocation invoke];
+
+ NSInteger returnLength = [[scaleInvocation methodSignature] methodReturnLength];
+ if (returnLength == sizeof(CGFloat)) {
+ [scaleInvocation getReturnValue:&_contentScaleFactor];
+ [self setContentScaleFactor:_contentScaleFactor];
+ }
}
}
@@ -613,6 +627,11 @@ const char *iPhone_getDocumentsDir() {
}
- (bool)getMouseCoords:(CGPoint)point eventX:(int *)x eventY:(int *)y {
+ // We scale the input according to our scale factor to get actual screen
+ // cooridnates.
+ point.x *= _contentScaleFactor;
+ point.y *= _contentScaleFactor;
+
if (![self convertToRotatedCoords:point result:&point])
return false;
diff --git a/backends/platform/iphone/osys_events.cpp b/backends/platform/iphone/osys_events.cpp
index 9cfca0836e..95ca25a2d2 100644
--- a/backends/platform/iphone/osys_events.cpp
+++ b/backends/platform/iphone/osys_events.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/iphone/osys_main.cpp b/backends/platform/iphone/osys_main.cpp
index a814495b80..0ce21b44c1 100644
--- a/backends/platform/iphone/osys_main.cpp
+++ b/backends/platform/iphone/osys_main.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/iphone/osys_main.h b/backends/platform/iphone/osys_main.h
index 811a8ddb2e..0159eee1be 100644
--- a/backends/platform/iphone/osys_main.h
+++ b/backends/platform/iphone/osys_main.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/iphone/osys_sound.cpp b/backends/platform/iphone/osys_sound.cpp
index 405543e380..bfee06c6f2 100644
--- a/backends/platform/iphone/osys_sound.cpp
+++ b/backends/platform/iphone/osys_sound.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/iphone/osys_video.mm b/backends/platform/iphone/osys_video.mm
index ce7f94f5bd..c76f432dda 100644
--- a/backends/platform/iphone/osys_video.mm
+++ b/backends/platform/iphone/osys_video.mm
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/linuxmoto/hardwarekeys.cpp b/backends/platform/linuxmoto/hardwarekeys.cpp
index e1a5757430..70e55c86c0 100644
--- a/backends/platform/linuxmoto/hardwarekeys.cpp
+++ b/backends/platform/linuxmoto/hardwarekeys.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/linuxmoto/linuxmoto-main.cpp b/backends/platform/linuxmoto/linuxmoto-main.cpp
index 835ccb03ef..507be9fa95 100644
--- a/backends/platform/linuxmoto/linuxmoto-main.cpp
+++ b/backends/platform/linuxmoto/linuxmoto-main.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/linuxmoto/linuxmoto-sdl.cpp b/backends/platform/linuxmoto/linuxmoto-sdl.cpp
index 844bd19a83..a0310079de 100644
--- a/backends/platform/linuxmoto/linuxmoto-sdl.cpp
+++ b/backends/platform/linuxmoto/linuxmoto-sdl.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/linuxmoto/linuxmoto-sdl.h b/backends/platform/linuxmoto/linuxmoto-sdl.h
index 27f4e744bc..b0bf7b4df7 100644
--- a/backends/platform/linuxmoto/linuxmoto-sdl.h
+++ b/backends/platform/linuxmoto/linuxmoto-sdl.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/maemo/maemo-common.h b/backends/platform/maemo/maemo-common.h
index 0442b9c0ae..6d3c64402a 100644
--- a/backends/platform/maemo/maemo-common.h
+++ b/backends/platform/maemo/maemo-common.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/maemo/maemo.cpp b/backends/platform/maemo/maemo.cpp
index 6bd229177b..e81a208f7b 100644
--- a/backends/platform/maemo/maemo.cpp
+++ b/backends/platform/maemo/maemo.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/maemo/maemo.h b/backends/platform/maemo/maemo.h
index 43bc262ade..532a2de08c 100644
--- a/backends/platform/maemo/maemo.h
+++ b/backends/platform/maemo/maemo.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/maemo/main.cpp b/backends/platform/maemo/main.cpp
index 7e8a316eb5..4735ae30ed 100644
--- a/backends/platform/maemo/main.cpp
+++ b/backends/platform/maemo/main.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/n64/framfs_save_manager.cpp b/backends/platform/n64/framfs_save_manager.cpp
index 78f5333f2e..de645223e9 100644
--- a/backends/platform/n64/framfs_save_manager.cpp
+++ b/backends/platform/n64/framfs_save_manager.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/n64/framfs_save_manager.h b/backends/platform/n64/framfs_save_manager.h
index 0a88c8666b..a066854aab 100644
--- a/backends/platform/n64/framfs_save_manager.h
+++ b/backends/platform/n64/framfs_save_manager.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/n64/nintendo64.cpp b/backends/platform/n64/nintendo64.cpp
index bc416157e6..a3e8c016f4 100644
--- a/backends/platform/n64/nintendo64.cpp
+++ b/backends/platform/n64/nintendo64.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/n64/osys_n64.h b/backends/platform/n64/osys_n64.h
index 10138b230a..ad49c2981f 100644
--- a/backends/platform/n64/osys_n64.h
+++ b/backends/platform/n64/osys_n64.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/n64/osys_n64_base.cpp b/backends/platform/n64/osys_n64_base.cpp
index 36e5085764..16eeae5b7e 100644
--- a/backends/platform/n64/osys_n64_base.cpp
+++ b/backends/platform/n64/osys_n64_base.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/n64/osys_n64_events.cpp b/backends/platform/n64/osys_n64_events.cpp
index c83eb194ac..2aa228cab0 100644
--- a/backends/platform/n64/osys_n64_events.cpp
+++ b/backends/platform/n64/osys_n64_events.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/n64/osys_n64_utilities.cpp b/backends/platform/n64/osys_n64_utilities.cpp
index f007a1bd25..b3b6d50667 100644
--- a/backends/platform/n64/osys_n64_utilities.cpp
+++ b/backends/platform/n64/osys_n64_utilities.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/n64/pakfs_save_manager.cpp b/backends/platform/n64/pakfs_save_manager.cpp
index bf2fe8b1bc..5a83dab9d8 100644
--- a/backends/platform/n64/pakfs_save_manager.cpp
+++ b/backends/platform/n64/pakfs_save_manager.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/n64/pakfs_save_manager.h b/backends/platform/n64/pakfs_save_manager.h
index 6e67fb0f5f..ec66c80b73 100644
--- a/backends/platform/n64/pakfs_save_manager.h
+++ b/backends/platform/n64/pakfs_save_manager.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/n64/portdefs.h b/backends/platform/n64/portdefs.h
index 10f5ed6488..63ec989a8d 100644
--- a/backends/platform/n64/portdefs.h
+++ b/backends/platform/n64/portdefs.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/null/null.cpp b/backends/platform/null/null.cpp
index 9e05539799..a5eea06f7a 100644
--- a/backends/platform/null/null.cpp
+++ b/backends/platform/null/null.cpp
@@ -8,24 +8,35 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
+// We use some stdio.h functionality here thus we need to allow some
+// symbols. Alternatively, we could simply allow everything by defining
+// FORBIDDEN_SYMBOL_ALLOW_ALL
+#define FORBIDDEN_SYMBOL_EXCEPTION_FILE
+#define FORBIDDEN_SYMBOL_EXCEPTION_stdout
+#define FORBIDDEN_SYMBOL_EXCEPTION_stderr
+#define FORBIDDEN_SYMBOL_EXCEPTION_fputs
+
#include "backends/modular-backend.h"
#include "base/main.h"
#if defined(USE_NULL_DRIVER)
#include "backends/saves/default/default-saves.h"
#include "backends/timer/default/default-timer.h"
+#include "backends/events/default/default-events.h"
+#include "backends/mutex/null/null-mutex.h"
+#include "backends/graphics/null/null-graphics.h"
#include "audio/mixer_intern.h"
#include "common/scummsys.h"
@@ -40,13 +51,14 @@
#include "backends/fs/windows/windows-fs-factory.h"
#endif
-class OSystem_NULL : public ModularBackend {
+class OSystem_NULL : public ModularBackend, Common::EventSource {
public:
OSystem_NULL();
virtual ~OSystem_NULL();
virtual void initBackend();
+ virtual Common::EventSource *getDefaultEventSource() { return this; }
virtual bool pollEvent(Common::Event &event);
virtual uint32 getMillis(bool skipRecord = false);
@@ -92,7 +104,7 @@ bool OSystem_NULL::pollEvent(Common::Event &event) {
return false;
}
-uint32 OSystem_NULL::getMillis() {
+uint32 OSystem_NULL::getMillis(bool skipRecord) {
return 0;
}
diff --git a/backends/platform/openpandora/op-backend.cpp b/backends/platform/openpandora/op-backend.cpp
index 354aa24b24..abe288f5d7 100644
--- a/backends/platform/openpandora/op-backend.cpp
+++ b/backends/platform/openpandora/op-backend.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -160,7 +160,7 @@ void OSystem_OP::initSDL() {
// Check if SDL has not been initialized
if (!_initedSDL) {
- uint32 sdlFlags = SDL_INIT_EVENTTHREAD;
+ uint32 sdlFlags = SDL_INIT_EVENTTHREAD | SDL_INIT_VIDEO;
if (ConfMan.hasKey("disable_sdl_parachute"))
sdlFlags |= SDL_INIT_NOPARACHUTE;
diff --git a/backends/platform/openpandora/op-main.cpp b/backends/platform/openpandora/op-main.cpp
index ebe018f570..99026b89f6 100644
--- a/backends/platform/openpandora/op-main.cpp
+++ b/backends/platform/openpandora/op-main.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/openpandora/op-options.cpp b/backends/platform/openpandora/op-options.cpp
index 005a76b76c..d2e7860962 100644
--- a/backends/platform/openpandora/op-options.cpp
+++ b/backends/platform/openpandora/op-options.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/openpandora/op-options.h b/backends/platform/openpandora/op-options.h
index 919d217f4b..8eae420af2 100644
--- a/backends/platform/openpandora/op-options.h
+++ b/backends/platform/openpandora/op-options.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/openpandora/op-sdl.h b/backends/platform/openpandora/op-sdl.h
index 1eddad5c4a..dd239e58f8 100644
--- a/backends/platform/openpandora/op-sdl.h
+++ b/backends/platform/openpandora/op-sdl.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/ps2/DmaPipe.cpp b/backends/platform/ps2/DmaPipe.cpp
index a346a67566..a4bcf6299e 100644
--- a/backends/platform/ps2/DmaPipe.cpp
+++ b/backends/platform/ps2/DmaPipe.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -50,7 +50,7 @@ DmaPipe::DmaPipe(uint32 size) {
size &= ~0x1F;
_buf = (uint64 *)memalign(64, size);
_curPipe = 0;
- _pipes[0] = new SinglePipe(_buf, size >> 4);
+ _pipes[0] = new SinglePipe(_buf, size >> 4);
_pipes[1] = new SinglePipe(_buf + (size >> 4), size >> 4);
// reset DMAC Channel 2
@@ -80,7 +80,7 @@ void DmaPipe::uploadTex(uint32 dest, uint16 bufWidth, uint16 destOfsX, uint16 de
*(_pipes[_curPipe]->_chainHead) |= (1 << 28);
_pipes[_curPipe]->setGifLoopTag(4);
_pipes[_curPipe]->setReg(GPR_BITBLTBUF, GS_SET_DEST_BLTBUF((dest/256) & 0x3fff, (bufWidth/64) & 0x3f, pixelFmt & 0x3f));
- _pipes[_curPipe]->setReg( GPR_TRXPOS, GS_SET_DEST_TRXPOS(destOfsX, destOfsY));
+ _pipes[_curPipe]->setReg( GPR_TRXPOS, GS_SET_DEST_TRXPOS(destOfsX, destOfsY));
_pipes[_curPipe]->setReg( GPR_TRXREG, GS_SET_TRXREG(width, height));
_pipes[_curPipe]->setReg( GPR_TRXDIR, 0);
@@ -194,7 +194,7 @@ void DmaPipe::setConfig(uint8 prModeCont, uint8 dither, uint8 colClamp) {
// set some defaults
// alpha blending formula: (A-B) * C + D
- // set: A = dest pixel, b = 0, C = source alpha, D = source pixel, fix = don't care
+ // set: A = dest pixel, b = 0, C = source alpha, D = source pixel, fix = don't care
_pipes[_curPipe]->setReg(GPR_ALPHA_1, GS_SET_ALPHA(DEST_COLOR, ZERO_COLOR, SOURCE_ALPHA, SOURCE_COLOR, 0));
_pipes[_curPipe]->setReg( GPR_PRIM, 0);
@@ -279,7 +279,7 @@ void SinglePipe::appendChain(uint64 dmaTag) {
void SinglePipe::setReg(uint64 reg, uint64 value) {
*_bufPos++ = value;
*_bufPos++ = reg;
- (*_chainSize)++;
+ (*_chainSize)++;
}
void SinglePipe::setListReg(uint64 value1, uint64 value2) {
diff --git a/backends/platform/ps2/DmaPipe.h b/backends/platform/ps2/DmaPipe.h
index c99da1c395..ad5993923e 100644
--- a/backends/platform/ps2/DmaPipe.h
+++ b/backends/platform/ps2/DmaPipe.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/ps2/Gs2dScreen.cpp b/backends/platform/ps2/Gs2dScreen.cpp
index 58667c0230..a4ec23329a 100644
--- a/backends/platform/ps2/Gs2dScreen.cpp
+++ b/backends/platform/ps2/Gs2dScreen.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -32,6 +32,7 @@
#include "DmaPipe.h"
#include "GsDefs.h"
#include "graphics/surface.h"
+#include "graphics/colormasks.h"
#include "backends/platform/ps2/ps2debug.h"
extern void *_gp;
@@ -43,12 +44,49 @@ enum Buffers {
PRINTF
};
+/*
+ Supported modes:
+
+ Mode #1 = SDTV progressive (NTSC: 224p / PAL: 256p)
+ Mode #2 = SDTV interlaced (NTSC: 448i / PAL: 512i) <- default
+ Mode #3 = EDTV progressive (NTSC: 480p / PAL: 576p)
+ Mode #4 = HDTV progressive (720p)
+ Mode #5 = HDTV interlaced (1080i)
+ Mode #6 = VESA (640x480@60)
+ Mode #7 = VESA (800x600@60)
+ Mode #8 = VESA (1024x768@60)
+*/
+
+static ps2_mode_t ps2_mode[] = {
+
+ // -> w, h, interlaced, pitch, mode, vck, magh, magv, dx, dy
+
+ /* #1 : SDTV - progressive */
+ { 640, 224, 0, 640, 0x02, 2560, 4, 0, 160 /*158*/, 25 /*22*/ }, /* NTSC */
+ { 640, 256, 0, 640, 0x03, 2560, 4, 0, 170 /*163*/, 35 /*36*/ }, /* PAL */
+
+ /* #2 : SDTV - interlaced */
+ { 640, 448, 1, 640, 0x02, 2560, 4, 0, 156 /*158*/, 50 /*45*/ }, /* NTSC */
+ { 640, 512, 1, 640, 0x03, 2560, 4, 0, 170 /*163*/, 70 /*72*/ }, /* PAL */
+
+ /* #3 : EDTV */
+ { 720, 480, 0, 768, 0x50, 1440, 2, 0, 58, 35 }, /* NTSC */
+ /* { 720, 576, 0, 768, 0x53, 1440, 2, 0, 62, 45 }, */ /* PAL : full */
+ /* { 656, 576, 0, 704, 0x53, 1312, 2, 0, 62, 45 }, */ /* PAL : redux @ (0,0) */
+ { 656, 576, 0, 704, 0x53, 1312, 2, 0, 78 /*314*/, 45 }, /* PAL : redux @ center'd */
+
+ /* #4/#5 : HDTV */
+ { 1280, 720, 0, 1280, 0x52, 1280, 1, 0, 76 /*302*/, 24 },
+ { 1920, 1080, 1, 1920, 0x51, 1920, 1, 0, 60 /*236*/ /*238*/, 40 },
+
+ /* #6/#7/#8 : VESA 4:3 @ 60Hz */
+ { 640, 480, 0, 640, 0x1A, 1280, 2, 0, 70 /*276*/, 34 },
+ { 800, 600, 0, 832, 0x2B, 1600, 2, 0, 105 /*420*/, 26 },
+ { 1024, 768, 0, 1024, 0x3B, 2048, 2, 0, 144 /*580*/, 34 }
+};
+
#define ANIM_STACK_SIZE (1024 * 32)
-#define DEFAULT_PAL_X 175
-#define DEFAULT_PAL_Y 72 // 60
-#define DEFAULT_NTSC_X 165
-#define DEFAULT_NTSC_Y 45
#define ORG_X 256
#define ORG_Y 256
#define ORIGIN_X (ORG_X << 4)
@@ -77,7 +115,7 @@ void runAnimThread(Gs2dScreen *param);
int vblankStartHandler(int cause) {
// start of VBlank period
- if (g_VblankCmd) { // is there a new image waiting?
+ if (g_VblankCmd) { // is there a new image waiting?
GS_DISPFB1 = g_VblankCmd; // show it.
g_VblankCmd = 0;
iSignalSema(g_VblankSema);
@@ -87,8 +125,8 @@ int vblankStartHandler(int cause) {
int dmacHandler(int channel) {
if (g_DmacCmd && (channel == 2)) { // GS DMA transfer finished,
- g_VblankCmd = g_DmacCmd; // we want to show the image
- g_DmacCmd = 0; // when the next vblank occurs
+ g_VblankCmd = g_DmacCmd; // we want to show the image
+ g_DmacCmd = 0; // when the next vblank occurs
iSignalSema(g_DmacSema);
}
return 0;
@@ -102,7 +140,8 @@ int vblankEndHandler(int cause) {
void createAnimThread(Gs2dScreen *screen);
-Gs2dScreen::Gs2dScreen(uint16 width, uint16 height, TVMode mode) {
+Gs2dScreen::Gs2dScreen(uint16 width, uint16 height) {
+
_systemQuit = false;
ee_sema_t newSema;
newSema.init_count = 1;
@@ -125,12 +164,15 @@ Gs2dScreen::Gs2dScreen(uint16 width, uint16 height, TVMode mode) {
EnableIntc(INT_VBLANK_END);
EnableDmac(2);
+ _tvMode = 0; // force detection
+ _gfxMode = 0;
+
_width = width;
_height = height;
_pitch = (width + 127) & ~127;
_screenBuf = (uint8 *)memalign(64, _width * _height);
- _overlayBuf = (uint16 *)memalign(64, _width * _height * 2);
+ _overlayBuf = (uint16 *)memalign(64, _pitch * _height * 2);
_clut = (uint32 *)memalign(64, 256 * 4);
memset(_screenBuf, 0, _width * _height);
@@ -138,32 +180,102 @@ Gs2dScreen::Gs2dScreen(uint16 width, uint16 height, TVMode mode) {
_clut[1] = GS_RGBA(0xC0, 0xC0, 0xC0, 0);
clearOverlay();
- if (mode == TV_DONT_CARE) {
-#if 1
char romver[8];
+ uint16 biosver;
int fd = fioOpen("rom0:ROMVER", O_RDONLY);
fioRead(fd, &romver, 8);
fioClose(fd);
+ biosver=atoi(romver);
+ printf("ROMVER = %s\n", romver);
+ printf("ver = %d\n", atoi(romver));
+
+ if (!_tvMode) { // determine TV standard first
+ if (ConfMan.hasKey("tv_mode", "PlayStation2")) {
+ const char *tvname = ConfMan.get("tv_mode", "PlayStation2").c_str();
+
+ if (strcmp("ntsc", tvname) == 0) {
+ _tvMode = 2;
+ }
+ else if (strcmp("pal", tvname) == 0) {
+ _tvMode = 1;
+ }
+ else
+ _tvMode = 0;
+ }
+
+ if (!_tvMode) {
+ if (romver[4] == 'E')
+ _tvMode = TV_PAL;
+ else
+ _tvMode = TV_NTSC;
+
+ printf("Auto-detect TV mode: PSX:%c PS2:%c\n", *(char *)(0x1FC7FF52), romver[4]);
+ }
+ }
- if (romver[4] == 'E')
- _tvMode = TV_PAL;
- else
- _tvMode = TV_NTSC;
-#else
- if (PAL_NTSC_FLAG == 'E')
- _tvMode = TV_PAL;
+ uint8 mode;
+ if (!_gfxMode) { // determine GFX mode next
+ if (ConfMan.hasKey("gfx_mode", "PlayStation2")) {
+ _gfxMode = ConfMan.getInt("gfx_mode", "PlayStation2");
+ // TODO: free more video mem to support these modes
+ if (_gfxMode == 4 || _gfxMode == 5) {
+ printf("Not enough video mem: using EDTV (3)\n");
+ _gfxMode = 3;
+ }
+ else
+ if (_gfxMode == 7 || _gfxMode == 8) {
+ printf("Not enough video mem: using VGA (6)\n");
+ _gfxMode = 6;
+ }
+
+ if (_gfxMode < 1 || _gfxMode > 8) _gfxMode = 2;
+ else
+ if (_gfxMode == 4 || _gfxMode == 5) _tvMode = TV_HDTV;
+ else
+ if (_gfxMode > 5) _tvMode = TV_VESA;
+ }
else
- _tvMode = TV_NTSC;
-#endif
- } else
- _tvMode = mode;
+ _gfxMode = 2;
+ }
+
+ // Remap Mode Index
+ mode = _gfxMode;
+ if (_tvMode == TV_NTSC) {
+ mode = (mode * 2) - 1;
+ }
+ else if (_tvMode == TV_PAL) {
+ mode = (mode * 2);
+ }
+ else if (_tvMode == TV_HDTV) {
+ mode += 3;
+ }
+ else /* VESA */ {
+ _tvMode = TV_VESA;
+ mode += 3;
+ }
+ mode--;
+
+ switch (_tvMode) {
+ case TV_NTSC:
+ printf("Setting up TV mode: NTSC\n");
+ break;
+ case TV_PAL:
+ printf("Setting up TV mode: PAL\n");
+ break;
+ case TV_HDTV:
+ printf("Setting up TV mode: HDTV\n");
+ break;
+ case TV_VESA:
+ printf("Setting up TV mode: VESA\n");
+ break;
+ }
+
+ _tvWidth = ps2_mode[mode].w;
+ _tvHeight = ps2_mode[mode].h;
+ _tvPitch = ps2_mode[mode].pitch;
- // _tvMode = TV_NTSC;
- printf("Setting up %s mode\n", (_tvMode == TV_PAL) ? "PAL" : "NTSC");
+ printf("Setting up GFX mode: %d x %d\n", _tvWidth, _tvHeight);
- // set screen size, 640x512 for pal, 640x448 for ntsc
- _tvWidth = 640;
- _tvHeight = ((_tvMode == TV_PAL) ? 512 /*544*/ : 448);
kFullScreen[0].z = kFullScreen[1].z = 0;
kFullScreen[0].x = ORIGIN_X;
kFullScreen[0].y = ORIGIN_Y;
@@ -176,7 +288,7 @@ Gs2dScreen::Gs2dScreen(uint16 width, uint16 height, TVMode mode) {
_texCoords[1].u = SCALE(_width);
_texCoords[1].v = SCALE(_height);
- uint32 tvFrameSize = _tvWidth * _tvHeight * 4; // 32 bits per pixel
+ uint32 tvFrameSize = _tvPitch * _tvHeight * 4; // 32 bits per pixel
// setup frame buffer pointers
_frameBufPtr[0] = 0;
@@ -186,7 +298,7 @@ Gs2dScreen::Gs2dScreen(uint16 width, uint16 height, TVMode mode) {
_clutPtrs[TEXT] = _clutPtrs[SCREEN] + 0x2000;
_texPtrs[SCREEN] = _clutPtrs[SCREEN] + 0x3000;
_texPtrs[TEXT] = 0; // these buffers are stored in the alpha gaps of the frame buffers
- _texPtrs[MOUSE] = 128 * 256 * 4;
+ _texPtrs[MOUSE] = 128 * 256 * 4;
_texPtrs[PRINTF] = _texPtrs[MOUSE] + M_SIZE * M_SIZE * 4;
_showOverlay = false;
@@ -202,12 +314,12 @@ Gs2dScreen::Gs2dScreen(uint16 width, uint16 height, TVMode mode) {
_overlayFormat.rLoss = 3;
_overlayFormat.gLoss = 3;
_overlayFormat.bLoss = 3;
- _overlayFormat.aLoss = 7;
+ _overlayFormat.aLoss = 8; // 7
_overlayFormat.rShift = 0;
_overlayFormat.gShift = 5;
_overlayFormat.bShift = 10;
- _overlayFormat.aShift = 15;
+ _overlayFormat.aShift = 0; // 15
// setup hardware now.
GS_CSR = CSR_RESET; // Reset GS
@@ -215,22 +327,39 @@ Gs2dScreen::Gs2dScreen(uint16 width, uint16 height, TVMode mode) {
GS_CSR = 0;
GsPutIMR(0x7F00);
- uint16 dispPosX, dispPosY;
- if (_tvMode == TV_PAL) {
- SetGsCrt(GS_INTERLACED, 3, 0);
- dispPosX = DEFAULT_PAL_X;
- dispPosY = DEFAULT_PAL_Y;
- } else {
- SetGsCrt(GS_INTERLACED, 2, 0);
- dispPosX = DEFAULT_NTSC_X;
- dispPosY = DEFAULT_NTSC_Y;
+ if (biosver < 220 && ps2_mode[mode].mode == 0x53) { // EDTV PAL : mode not in BIOS < 2.20
+ // no worries... we work in magic ;-)
+ /* 720x576p */
+ asm ("di");
+ asm ("sync.l; sync.p");
+ GS_PMODE = 0;
+ asm ("sync.l; sync.p");
+ GS_SMODE1 = 0x1742890504;
+ asm ("sync.l; sync.p");
+ GS_SMODE2 = 0;
+ GS_SYNCH1 = 0x402E02003C827;
+ asm ("sync.l; sync.p");
+ GS_SYNCH2 = 0x19CA67;
+ asm ("sync.l; sync.p");
+ GS_SYNCV = 0xA9000002700005;
+ asm ("sync.l; sync.p");
+ GS_SRFSH = 4;
+ asm ("sync.l; sync.p");
+ GS_SMODE1 = 0x1742880504;
+ asm ("sync.l; sync.p");
+ asm ("sync.l; sync.p");
+ GS_SMODE2 = 0;
+ asm("ei");
+ }
+ else { // BIOS
+ SetGsCrt(ps2_mode[mode].interlaced, ps2_mode[mode].mode, 0); // ps2_mode[mode].interlaced);
}
asm("di");
GS_PMODE = GS_SET_PMODE(1, 0, 1, 1, 0, 255);
GS_BGCOLOUR = GS_RGBA(0, 0, 0, 0);
- GS_DISPLAY1 = GS_SET_DISPLAY(_tvWidth, _tvHeight, dispPosX, dispPosY);
+ GS_DISPLAY1 = GS_SET_DISPLAY_MODE(ps2_mode[mode]);
asm("ei");
_curDrawBuf = 0;
@@ -238,7 +367,7 @@ Gs2dScreen::Gs2dScreen(uint16 width, uint16 height, TVMode mode) {
_dmaPipe->setOrigin(ORIGIN_X, ORIGIN_Y);
_dmaPipe->setConfig(1, 0, 1);
_dmaPipe->setScissorRect(0, 0, _tvWidth - 1, _tvHeight - 1);
- _dmaPipe->setDrawBuffer(_frameBufPtr[_curDrawBuf], _tvWidth, GS_PSMCT24, 0);
+ _dmaPipe->setDrawBuffer(_frameBufPtr[_curDrawBuf], _tvPitch, GS_PSMCT24, 0);
_dmaPipe->flush();
_clutChanged = _screenChanged = _overlayChanged = true;
@@ -249,24 +378,33 @@ Gs2dScreen::Gs2dScreen(uint16 width, uint16 height, TVMode mode) {
createAnimTextures();
// create animation thread
- ee_thread_t animationThread, thisThread;
+ #ifdef __NEW_PS2SDK__
+ ee_thread_t animThread;
+ ee_thread_status_t thisThread;
+ #else
+ ee_thread_t animThread, thisThread;
+ #endif
ReferThreadStatus(GetThreadId(), &thisThread);
- _animStack = malloc(ANIM_STACK_SIZE);
- animationThread.initial_priority = thisThread.current_priority - 3;
- animationThread.stack = _animStack;
- animationThread.stack_size = ANIM_STACK_SIZE;
- animationThread.func = (void *)runAnimThread;
- animationThread.gp_reg = &_gp;
+ _animStack = memalign(64, ANIM_STACK_SIZE);
+ animThread.initial_priority = thisThread.current_priority - 3;
+ animThread.stack = _animStack;
+ animThread.stack_size = ANIM_STACK_SIZE;
+ animThread.func = (void *)runAnimThread;
+ animThread.gp_reg = &_gp;
- _animTid = CreateThread(&animationThread);
+ _animTid = CreateThread(&animThread);
assert(_animTid >= 0);
StartThread(_animTid, this);
}
void Gs2dScreen::quit(void) {
_systemQuit = true;
+ #ifdef __NEW_PS2SDK__
+ ee_thread_status_t statAnim;
+ #else
ee_thread_t statAnim;
+ #endif
do { // wait until thread called ExitThread()
SignalSema(g_AnimSema);
ReferThreadStatus(_animTid, &statAnim);
@@ -296,15 +434,15 @@ void Gs2dScreen::createAnimTextures(void) {
for (int i = 0; i < 16; i++) {
uint32 *destPos = (uint32 *)buf;
for (int ch = 15; ch >= 0; ch--) {
- const uint32 *src = (const uint32*)(_binaryData + ((_binaryPattern[i] >> ch) & 1) * 4 * 14);
+ const uint32 *src = (const uint32 *)(_binaryData + ((_binaryPattern[i] >> ch) & 1) * 4 * 14);
for (int line = 0; line < 14; line++)
destPos[line << 4] = src[line];
destPos++;
}
if (!(i & 1))
- _dmaPipe->uploadTex( vramDest, 128, 0, 0, GS_PSMT4HH, buf, 128, 16);
+ _dmaPipe->uploadTex( vramDest, 128, 0, 0, GS_PSMT4HH, buf, 128, 16);
else {
- _dmaPipe->uploadTex( vramDest, 128, 0, 0, GS_PSMT4HL, buf, 128, 16);
+ _dmaPipe->uploadTex( vramDest, 128, 0, 0, GS_PSMT4HL, buf, 128, 16);
vramDest += 128 * 16 * 4;
}
_dmaPipe->flush();
@@ -506,10 +644,10 @@ void Gs2dScreen::updateScreen(void) {
WaitSema(g_DmacSema); // wait for dma transfer, if there's one running
WaitSema(g_VblankSema); // wait if there's already an image waiting for vblank
- g_DmacCmd = GS_SET_DISPFB(_frameBufPtr[_curDrawBuf], _tvWidth, GS_PSMCT24); // put it here for dmac/vblank handler
+ g_DmacCmd = GS_SET_DISPFB(_frameBufPtr[_curDrawBuf], _tvPitch, GS_PSMCT24); // put it here for dmac/vblank handler
_dmaPipe->flush();
_curDrawBuf ^= 1;
- _dmaPipe->setDrawBuffer(_frameBufPtr[_curDrawBuf], _tvWidth, GS_PSMCT24, 0);
+ _dmaPipe->setDrawBuffer(_frameBufPtr[_curDrawBuf], _tvPitch, GS_PSMCT24, 0);
} else
_dmaPipe->flush();
SignalSema(_screenSema);
@@ -527,6 +665,7 @@ void Gs2dScreen::hideOverlay(void) {
Graphics::PixelFormat Gs2dScreen::getOverlayFormat(void) {
return _overlayFormat;
+ // return Graphics::createPixelFormat<1555>();
}
int16 Gs2dScreen::getOverlayWidth(void) {
@@ -633,11 +772,11 @@ void Gs2dScreen::setMouseXy(int16 x, int16 y) {
_mouseX = x;
_mouseY = y;
}
-
+/*
uint8 Gs2dScreen::tvMode(void) {
return _tvMode;
}
-
+*/
uint16 Gs2dScreen::getWidth(void) {
return _width;
}
@@ -655,7 +794,7 @@ void Gs2dScreen::wantAnim(bool runIt) {
#define V 1000
#define Z_TRANSL 65
-void Gs2dScreen::animThread(void) {
+void Gs2dScreen::playAnim(void) {
// animate zeros and ones while game accesses memory card, etc.
g_RunAnim = false;
float yPos = 0.0;
@@ -750,10 +889,10 @@ void Gs2dScreen::animThread(void) {
drawY += LINE_SPACE;
}
- g_DmacCmd = GS_SET_DISPFB(_frameBufPtr[_curDrawBuf], _tvWidth, GS_PSMCT24); // put it here for dmac/vblank handler
+ g_DmacCmd = GS_SET_DISPFB(_frameBufPtr[_curDrawBuf], _tvPitch, GS_PSMCT24); // put it here for dmac/vblank handler
_dmaPipe->flush();
_curDrawBuf ^= 1;
- _dmaPipe->setDrawBuffer(_frameBufPtr[_curDrawBuf], _tvWidth, GS_PSMCT24, 0);
+ _dmaPipe->setDrawBuffer(_frameBufPtr[_curDrawBuf], _tvPitch, GS_PSMCT24, 0);
_dmaPipe->setAlphaBlend(DEST_COLOR, ZERO_COLOR, SOURCE_ALPHA, SOURCE_COLOR, 0);
SignalSema(_screenSema);
@@ -763,7 +902,7 @@ void Gs2dScreen::animThread(void) {
}
void runAnimThread(Gs2dScreen *param) {
- param->animThread();
+ param->playAnim();
}
// data for the animated zeros and ones...
diff --git a/backends/platform/ps2/Gs2dScreen.h b/backends/platform/ps2/Gs2dScreen.h
index 1a70dad170..ea2b1e5f78 100644
--- a/backends/platform/ps2/Gs2dScreen.h
+++ b/backends/platform/ps2/Gs2dScreen.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -25,6 +25,7 @@
#include "sysdefs.h"
#include "backends/base-backend.h"
+#include "common/config-manager.h"
#include "backends/platform/ps2/DmaPipe.h"
#include "graphics/surface.h"
@@ -32,7 +33,9 @@
enum TVMode {
TV_DONT_CARE = 0,
TV_PAL,
- TV_NTSC
+ TV_NTSC,
+ TV_HDTV, /* internal */
+ TV_VESA /* internal */
};
enum GsInterlace {
@@ -42,14 +45,14 @@ enum GsInterlace {
class Gs2dScreen {
public:
- Gs2dScreen(uint16 width, uint16 height, TVMode mode);
+ Gs2dScreen(uint16 width, uint16 height);
~Gs2dScreen(void);
void newScreenSize(uint16 width, uint16 height);
- uint8 tvMode(void);
+ // uint8 tvMode(void);
uint16 getWidth(void);
uint16 getHeight(void);
- void copyPrintfOverlay(const uint8* buf);
+ void copyPrintfOverlay(const uint8 *buf);
void clearPrintfOverlay(void);
Graphics::Surface *lockScreen();
@@ -75,7 +78,7 @@ public:
void setMouseXy(int16 x, int16 y);
void setShakePos(int shake);
- void animThread(void);
+ void playAnim(void);
void wantAnim(bool runIt);
void quit(void);
@@ -85,8 +88,10 @@ private:
void createAnimTextures(void);
DmaPipe *_dmaPipe;
+ uint8 _gfxMode;
uint8 _tvMode;
uint16 _tvWidth, _tvHeight;
+ uint16 _tvPitch;
GsVertex _blitCoords[2];
TexVertex _texCoords[2];
diff --git a/backends/platform/ps2/GsDefs.h b/backends/platform/ps2/GsDefs.h
index fab0c40b35..9adf6acfcc 100644
--- a/backends/platform/ps2/GsDefs.h
+++ b/backends/platform/ps2/GsDefs.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -27,16 +27,23 @@
// Gs2dScreen defines:
-#define PAL_NTSC_FLAG (*(volatile uint8*)0x1FC7FF52)
+#define PAL_NTSC_FLAG (*(volatile uint8 *)0x1FC7FF52)
-#define GS_PMODE *((volatile uint64*)0x12000000)
-#define GS_CSR *((volatile uint64*)0x12001000)
-#define GS_DISPFB1 *((volatile uint64*)0x12000070)
-#define GS_DISPLAY1 *((volatile uint64*)0x12000080)
-#define GS_BGCOLOUR *((volatile uint64*)0x120000E0)
+#define GS_PMODE *((volatile uint64 *)0x12000000)
+#define GS_CSR *((volatile uint64 *)0x12001000)
+#define GS_DISPFB1 *((volatile uint64 *)0x12000070)
+#define GS_DISPLAY1 *((volatile uint64 *)0x12000080)
+#define GS_BGCOLOUR *((volatile uint64 *)0x120000E0)
+
+#define GS_SMODE1 *((volatile uint64 *)0x12000010)
+#define GS_SMODE2 *((volatile uint64 *)0x12000020)
+#define GS_SYNCH1 *((volatile uint64 *)0x12000040)
+#define GS_SYNCH2 *((volatile uint64 *)0x12000050)
+#define GS_SYNCV *((volatile uint64 *)0x12000060)
+#define GS_SRFSH *((volatile uint64 *)0x12000030)
enum GS_CSR_FIELDS {
- CSR_SIGNAL = 1 << 0,
+ CSR_SIGNAL = 1 << 0,
CSR_FINISH = 1 << 1,
CSR_HSYNC = 1 << 2,
CSR_VSYNC = 1 << 3,
@@ -44,6 +51,19 @@ enum GS_CSR_FIELDS {
CSR_RESET = 1 << 9
};
+typedef struct {
+ u16 w;
+ u16 h;
+ u16 interlaced;
+ u16 pitch;
+ u16 mode;
+ u16 vclk;
+ u16 magh;
+ u16 magv;
+ u16 dx;
+ u16 dy;
+} ps2_mode_t;
+
#define GS_SET_PMODE(readC1, readC2, alphaSel, alphaOut, alphaBlend, alphaFixed) \
((readC1) | ((readC2) << 1) | ((alphaSel) << 5) | ((alphaOut) << 6) | ((alphaBlend) << 7) | ((alphaFixed) << 8))
@@ -52,6 +72,10 @@ enum GS_CSR_FIELDS {
((((2560 + (width - 1)) / width) - 1)<<23) | \
(ypos << 12) | (xpos * (2560 / width)))
+#define GS_SET_DISPLAY_MODE(mode) \
+ (((uint64)(mode.h - 1) << 44) | ((uint64)(mode.vclk - 1) << 32) | \
+ ((mode.magh - 1) << 23) | (mode.dy << 12) | (mode.dx << 2))
+
#define GS_SET_DISPFB(frameBufPtr, frameBufWidth, psm) \
(((frameBufPtr) / 8192) | (((frameBufWidth) / 64) << 9) | ((psm) << 15))
@@ -61,63 +85,63 @@ enum GS_CSR_FIELDS {
//DmaPipe defines:
enum GsRegs {
- GPR_PRIM = 0x00, // Select and configure current drawing primitive
- GPR_RGBAQ, // Setup current vertex color
- GPR_ST, // ...
- GPR_UV, // Specify Vertex Texture Coordinates
- GPR_XYZF2, // Set vertex coordinate
- GPR_XYZ2, // Set vertex coordinate and 'kick' drawing
- GPR_TEX0_1, // Texture Buffer Setup (Context 1)
- GPR_TEX0_2, // Texture Buffer Setup (Context 2)
- GPR_CLAMP_1, // ...
- GPR_CLAMP_2, // ...
- GPR_FOG, // ...
-
- GPR_XYZF3 = 0x0C, // ...
- GPR_XYZ3, // ...
-
- GPR_TEX1_1 = 0x14, // ...
- GPR_TEX1_2, // ...
- GPR_TEX2_1, // ...
- GPR_TEX2_2, // ...
- GPR_XYOFFSET_1, // Mapping from Primitive to Window coordinate system (Context 1)
- GPR_XYOFFSET_2, // Mapping from Primitive to Window coordinate system (Context 2)
- GPR_PRMODECONT, // ...
- GPR_PRMODE, // ...
- GPR_TEXCLUT, // ...
-
- GPR_SCANMSK = 0x22, // ...
-
- GPR_MIPTBP1_1 = 0x34, // ...
- GPR_MIPTBP1_2, // ...
- GPR_MIPTBP2_1, // ...
- GPR_MIPTBP2_2, // ...
-
- GPR_TEXA = 0x3b, // ...
-
- GPR_FOGCOL = 0x3d, // ...
-
- GPR_TEXFLUSH = 0x3f,// Write to this register before using newly loaded texture
- GPR_SCISSOR_1, // Setup clipping rectangle (Context 1)
- GPR_SCISSOR_2, // Setup clipping rectangle (Context 2)
- GPR_ALPHA_1, // Setup Alpha Blending Parameters (Context 1)
- GPR_ALPHA_2, // Setup Alpha Blending Parameters (Context 2)
- GPR_DIMX, // ...
- GPR_DTHE, // ...
- GPR_COLCLAMP, // ...
- GPR_TEST_1, // ...
- GPR_TEST_2, // ...
- GPR_PABE, // ...
- GPR_FBA_1, // ...
- GPR_FBA_2, // ...
- GPR_FRAME_1, // Frame buffer settings (Context 1)
- GPR_FRAME_2, // Frame buffer settings (Context 2)
- GPR_ZBUF_1, // ...
- GPR_ZBUF_2, // ...
- GPR_BITBLTBUF, // Setup Image Transfer Between EE and GS
- GPR_TRXPOS, // Setup Image Transfer Coordinates
- GPR_TRXREG, // Setup Image Transfer Size
- GPR_TRXDIR, // Set Image Transfer Directon + Start Transfer
+ GPR_PRIM = 0x00, // Select and configure current drawing primitive
+ GPR_RGBAQ, // Setup current vertex color
+ GPR_ST, // ...
+ GPR_UV, // Specify Vertex Texture Coordinates
+ GPR_XYZF2, // Set vertex coordinate
+ GPR_XYZ2, // Set vertex coordinate and 'kick' drawing
+ GPR_TEX0_1, // Texture Buffer Setup (Context 1)
+ GPR_TEX0_2, // Texture Buffer Setup (Context 2)
+ GPR_CLAMP_1, // ...
+ GPR_CLAMP_2, // ...
+ GPR_FOG, // ...
+
+ GPR_XYZF3 = 0x0C, // ...
+ GPR_XYZ3, // ...
+
+ GPR_TEX1_1 = 0x14, // ...
+ GPR_TEX1_2, // ...
+ GPR_TEX2_1, // ...
+ GPR_TEX2_2, // ...
+ GPR_XYOFFSET_1, // Mapping from Primitive to Window coordinate system (Context 1)
+ GPR_XYOFFSET_2, // Mapping from Primitive to Window coordinate system (Context 2)
+ GPR_PRMODECONT, // ...
+ GPR_PRMODE, // ...
+ GPR_TEXCLUT, // ...
+
+ GPR_SCANMSK = 0x22, // ...
+
+ GPR_MIPTBP1_1 = 0x34, // ...
+ GPR_MIPTBP1_2, // ...
+ GPR_MIPTBP2_1, // ...
+ GPR_MIPTBP2_2, // ...
+
+ GPR_TEXA = 0x3b, // ...
+
+ GPR_FOGCOL = 0x3d, // ...
+
+ GPR_TEXFLUSH = 0x3f, // Write to this register before using newly loaded texture
+ GPR_SCISSOR_1, // Setup clipping rectangle (Context 1)
+ GPR_SCISSOR_2, // Setup clipping rectangle (Context 2)
+ GPR_ALPHA_1, // Setup Alpha Blending Parameters (Context 1)
+ GPR_ALPHA_2, // Setup Alpha Blending Parameters (Context 2)
+ GPR_DIMX, // ...
+ GPR_DTHE, // ...
+ GPR_COLCLAMP, // ...
+ GPR_TEST_1, // ...
+ GPR_TEST_2, // ...
+ GPR_PABE, // ...
+ GPR_FBA_1, // ...
+ GPR_FBA_2, // ...
+ GPR_FRAME_1, // Frame buffer settings (Context 1)
+ GPR_FRAME_2, // Frame buffer settings (Context 2)
+ GPR_ZBUF_1, // ...
+ GPR_ZBUF_2, // ...
+ GPR_BITBLTBUF, // Setup Image Transfer Between EE and GS
+ GPR_TRXPOS, // Setup Image Transfer Coordinates
+ GPR_TRXREG, // Setup Image Transfer Size
+ GPR_TRXDIR, // Set Image Transfer Directon + Start Transfer
GPR_HWREG,
GPR_SIGNAL = 0x60,
@@ -135,15 +159,15 @@ enum PrimTypes {
PR_SPRITE
};
-#define GS_PSMCT32 0x00
-#define GS_PSMCT24 0x01
-#define GS_PSMCT16 0x02
-#define GS_PSMCT16S 0x0A
-#define GS_PSMT8 0x13
-#define GS_PSMT4 0x14
-#define GS_PSMT4HL 0x24
-#define GS_PSMT4HH 0x2C
-#define GS_PSMT8H 0x1B
+#define GS_PSMCT32 0x00
+#define GS_PSMCT24 0x01
+#define GS_PSMCT16 0x02
+#define GS_PSMCT16S 0x0A
+#define GS_PSMT8 0x13
+#define GS_PSMT4 0x14
+#define GS_PSMT4HL 0x24
+#define GS_PSMT4HH 0x2C
+#define GS_PSMT8H 0x1B
/*#define GS_SET_BITBLTBUF(sbp, sbw, spsm, dbp, dbw, dpsm) \
((uint64)(sbp) | ((uint64)(sbw) << 16) | \
@@ -210,7 +234,7 @@ enum AlphaBlendColor {
enum AlphaBlendAlpha {
SOURCE_ALPHA = 0,
DEST_ALPHA,
- FIXED_ALPHA
+ FIXED_ALPHA
};
#define GS_SET_ALPHA(a, b, c, d, fix) \
diff --git a/backends/platform/ps2/Makefile.gdb b/backends/platform/ps2/Makefile.gdb
deleted file mode 100644
index 8ca47cd9f1..0000000000
--- a/backends/platform/ps2/Makefile.gdb
+++ /dev/null
@@ -1,104 +0,0 @@
-# $Header: Exp $
- include $(PS2SDK)/Defs.make
-
-PS2_EXTRA = /works/devel/ps2/sdk-extra
-PS2_EXTRA_INCS = /zlib/include /libmad/ee/include /SjPcm/ee/src /tremor
-PS2_EXTRA_LIBS = /zlib/lib /libmad/ee/lib /SjPcm/ee/lib /tremor/tremor
-
-ENABLED=STATIC_PLUGIN
-
-ENABLE_SCUMM = $(ENABLED)
-ENABLE_SCUMM_7_8 = $(ENABLED)
-# ENABLE_HE = $(ENABLED)
-# ENABLE_AGI = $(ENABLED)
-# ENABLE_AGOS = $(ENABLED)
-# ENABLE_AGOS2 = $(ENABLED)
-# ENABLE_CINE = $(ENABLED)
-# ENABLE_CRUISE = $(ENABLED)
-# ENABLE_DRACI = $(ENABLED)
-# ENABLE_DRASCULA = $(ENABLED)
-# ENABLE_GOB = $(ENABLED)
-# ENABLE_GROOVIE = $(ENABLED)
-## ENABLE_GROOVIE2 = $(ENABLED)
-# ENABLE_HUGO = $(ENABLED)
-# ENABLE_IHNM = $(ENABLED)
-# ENABLE_KYRA = $(ENABLED)
-## ENABLE_LOL = $(ENABLED)
-# ENABLE_LURE = $(ENABLED)
-## ENABLE_M4 = $(ENABLED)
-# ENABLE_MADE = $(ENABLED)
-# ENABLE_MOHAWK = $(ENABLED)
-# ENABLE_PARALLACTION = $(ENABLED)
-# ENABLE_QUEEN = $(ENABLED)
-# ENABLE_SAGA = $(ENABLED)
-# ENABLE_SAGA2 = $(ENABLED)
-# ENABLE_SCI = $(ENABLED)
-## ENABLE_SCI32 = $(ENABLED)
-# ENABLE_SKY = $(ENABLED)
-# ENABLE_SWORD1 = $(ENABLED)
-# ENABLE_SWORD2 = $(ENABLED)
-# ENABLE_TEENAGENT = $(ENABLED)
-# ENABLE_TINSEL = $(ENABLED)
-# ENABLE_TOON = $(ENABLED)
-# ENABLE_TOUCHE = $(ENABLED)
-# ENABLE_TUCKER = $(ENABLED)
-
-
-HAVE_GCC3 = true
-
-CC = ee-gcc
-CXX = ee-g++
-AS = ee-gcc
-LD = ee-gcc
-AR = ee-ar cru
-RANLIB = ee-ranlib
-STRIP = ee-strip
-MKDIR = mkdir -p
-RM = rm -f
-
-srcdir = ../../..
-VPATH = $(srcdir)
-INCDIR = ../../../
-# DEPDIR = .deps
-
-DEFINES = -DUSE_VORBIS -DUSE_TREMOR -DUSE_MAD -DUSE_ZLIB -DFORCE_RTL -DDISABLE_SAVEGAME_SORTING -D_EE -D__PLAYSTATION2__ -D__PS2_DEBUG__ -g -Wall -Wno-multichar -fno-rtti -fno-exceptions # -DNO_ADAPTOR
-# for release builds:
-#DEFINES += -DRELEASE_BUILD
-
-INCLUDES = $(addprefix -I$(PS2_EXTRA),$(PS2_EXTRA_INCS))
-INCLUDES += -I $(PS2GDB)/ee -I $(PS2SDK)/ee/include -I $(PS2SDK)/common/include -I ./common -I . -I $(srcdir) -I $(srcdir)/engines
-
-CXX_UPDATE_DEP_FLAG = -Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).d",-MQ,"$@",-MP
-
-TARGET = elf/scummvm.elf
-
-OBJS := $(srcdir)/backends/platform/ps2/DmaPipe.o \
- $(srcdir)/backends/platform/ps2/Gs2dScreen.o \
- $(srcdir)/backends/platform/ps2/irxboot.o \
- $(srcdir)/backends/platform/ps2/ps2input.o \
- $(srcdir)/backends/platform/ps2/ps2pad.o \
- $(srcdir)/backends/platform/ps2/savefilemgr.o \
- $(srcdir)/backends/platform/ps2/fileio.o \
- $(srcdir)/backends/platform/ps2/asyncfio.o \
- $(srcdir)/backends/platform/ps2/icon.o \
- $(srcdir)/backends/platform/ps2/cd.o \
- $(srcdir)/backends/platform/ps2/eecodyvdfs.o \
- $(srcdir)/backends/platform/ps2/rpckbd.o \
- $(srcdir)/backends/platform/ps2/systemps2.o \
- $(srcdir)/backends/platform/ps2/ps2mutex.o \
- $(srcdir)/backends/platform/ps2/ps2time.o \
- $(srcdir)/backends/platform/ps2/ps2debug.o
-
-MODULE_DIRS += .
-
-include $(srcdir)/Makefile.common
-
-LDFLAGS += -mno-crt0 $(PS2SDK)/ee/startup/crt0.o -T $(PS2SDK)/ee/startup/linkfile
-LDFLAGS += -L $(PS2GDB)/lib -L $(PS2SDK)/ee/lib -L .
-LDFLAGS += $(addprefix -L$(PS2_EXTRA),$(PS2_EXTRA_LIBS))
-LDFLAGS += -lmc -lpad -lmouse -lhdd -lpoweroff -lsjpcm -lmad -ltremor -lz -lm -lc -lfileXio -lps2gdbStub -lps2ip -ldebug -lkernel -lstdc++
-
-all: $(TARGET)
-
-$(TARGET): $(OBJS)
- $(LD) $^ $(LDFLAGS) -o $@
diff --git a/backends/platform/ps2/Makefile.ps2 b/backends/platform/ps2/Makefile.ps2
index d6ce08ae84..3631c653f6 100644
--- a/backends/platform/ps2/Makefile.ps2
+++ b/backends/platform/ps2/Makefile.ps2
@@ -1,107 +1,217 @@
-# $Header: Exp $
- include $(PS2SDK)/Defs.make
+# SCUMMVM-PS2 MakeFile
-PS2_EXTRA = /works/devel/ps2/sdk-extra
-PS2_EXTRA_INCS = /zlib/include /libmad/ee/include /SjPcm/ee/src /tremor
-PS2_EXTRA_LIBS = /zlib/lib /libmad/ee/lib /SjPcm/ee/lib /tremor/tremor
-ENABLED=STATIC_PLUGIN
+# Use only this section to modify how the makefile behaves ------------
-ENABLE_SCUMM = $(ENABLED)
-ENABLE_SCUMM_7_8 = $(ENABLED)
-ENABLE_HE = $(ENABLED)
+# Scummvm engine config: choose which engines are enabled
ENABLE_AGI = $(ENABLED)
ENABLE_AGOS = $(ENABLED)
-ENABLE_AGOS2 = $(ENABLED)
+ENABLE_AGOS2 = 1
+# ENABLE_AVALANCHE = $(ENABLED)
+ENABLE_CGE = $(ENABLED)
ENABLE_CINE = $(ENABLED)
+ENABLE_COMPOSER = $(ENABLED)
ENABLE_CRUISE = $(ENABLED)
ENABLE_DRACI = $(ENABLED)
ENABLE_DRASCULA = $(ENABLED)
+ENABLE_DREAMWEB = $(ENABLED)
+# ENABLE_FULLPIPE = $(ENABLED)
ENABLE_GOB = $(ENABLED)
ENABLE_GROOVIE = $(ENABLED)
# ENABLE_GROOVIE2 = $(ENABLED)
+# ENABLE_HOPKINS = $(ENABLED)
ENABLE_HUGO = $(ENABLED)
-ENABLE_IHNM = $(ENABLED)
ENABLE_KYRA = $(ENABLED)
-# ENABLE_LOL = $(ENABLED)
+ENABLE_LOL = 1
+ENABLE_EOB = 1
+# ENABLE_LASTEXPRESS = $(ENABLED)
ENABLE_LURE = $(ENABLED)
-# ENABLE_M4 = $(ENABLED)
ENABLE_MADE = $(ENABLED)
ENABLE_MOHAWK = $(ENABLED)
+# ENABLE_CSTIME = $(ENABLED)
+# ENABLE_RIVEN = $(ENABLED)
+# ENABLE_MYST = $(ENABLED)
+ENABLE_MORTEVIELLE = $(ENABLED)
+ENABLE_NEVERHOOD = $(ENABLED)
ENABLE_PARALLACTION = $(ENABLED)
+# ENABLE_PEGASUS = $(ENABLED)
ENABLE_QUEEN = $(ENABLED)
ENABLE_SAGA = $(ENABLED)
+ENABLE_IHNM = 1
# ENABLE_SAGA2 = $(ENABLED)
ENABLE_SCI = $(ENABLED)
# ENABLE_SCI32 = $(ENABLED)
+ENABLE_SCUMM = $(ENABLED)
+ENABLE_SCUMM_7_8 = 1
+ENABLE_HE = 1
ENABLE_SKY = $(ENABLED)
ENABLE_SWORD1 = $(ENABLED)
ENABLE_SWORD2 = $(ENABLED)
+# ENABLE_SWORD25 = $(ENABLED)
ENABLE_TEENAGENT = $(ENABLED)
+# ENABLE_TESTBED = $(ENABLED)
ENABLE_TINSEL = $(ENABLED)
+ENABLE_TOLTECS = $(ENABLED)
+# ENABLE_TONY = $(ENABLED)
ENABLE_TOON = $(ENABLED)
ENABLE_TOUCHE = $(ENABLED)
+ENABLE_TSAGE = $(ENABLED)
ENABLE_TUCKER = $(ENABLED)
-
-
-HAVE_GCC3 = true
-
-CC = ee-gcc
-CXX = ee-g++
-AS = ee-gcc
-LD = ee-gcc
+# ENABLE_WINTERMUTE = $(ENABLED)
+# ENABLE_ZVISION = $(ENABLED)
+
+# Set to 1 to enable seeing the commands to gcc
+VERBOSE_BUILD = 0
+# Set to 1 to enable, 0 to disable dynamic modules
+DYNAMIC_MODULES = 1
+# Set to 1 to enable debugging
+ENABLE_DEBUG = 0
+# Set to 1 to enable profiling
+ENABLE_PROFILING = 0
+# Set to 1 to disable HDD+NET
+DISABLE_NETWORK = 0
+# Set to 1 to enable, 0 to disable libmad and libogg
+USE_LIBMAD = 1
+USE_LIBOGG = 1
+
+# ---------------------------------------------------------------------
+
+
+# General variables
+srcdir = ../../..
+VPATH = $(srcdir)
+TARGET = scummvm.elf
+# PS2 SDK location variables
+# PS2SDK = /works/tools/devel/ps2/sdk
+
+# Check PS2SDK presence
+ifeq ($(PS2SDK),)
+$(error $$(PS2SDK) needs to be set.)
+endif
+
+# Variables for common Scummvm makefile
+CC = ee-gcc
+CXX = ee-g++
+FLAGS = -pedantic -Wall -W
+FLAGS += -Wcast-qual -Wconversion -Wpointer-arith -Wshadow -Wwrite-strings
+FLAGS += -Wno-long-long -Wno-multichar -Wno-unknown-pragmas -Wno-unused-parameter
+CFLAGS = $(FLAGS) -std=c99
+CXXFLAGS = $(FLAGS) -Wnon-virtual-dtor -Wno-reorder -fno-exceptions -fno-rtti
+
+DEFINES = -D_EE -D__PLAYSTATION2__ -D__NEW_PS2SDK__ -DUSE_ZLIB -DFORCE_RTL -DDATA_PATH=\"host:data\"
+DEFINES += -DDISABLE_SAVEGAME_SORTING -DDISABLE_TEXT_CONSOLE -DDISABLE_COMMAND_LINE -DDISABLE_DOSBOX_OPL -DDISABLE_SID -DDISABLE_NES_APU
+# DEFINES += -DLOGORRHEIC
+
+INCDIR := $(PS2SDK)/ee/include $(PS2SDK)/common/include $(PS2SDK)/ports/include . $(srcdir) $(srcdir)/engines
+INCLUDES := $(addprefix -I, $(INCDIR))
+DEPDIR = .deps
+MODULE_DIRS += ./
+MKDIR = mkdir -p
+RM = rm -f
+RM_REC = rm -rf
AR = ee-ar cru
RANLIB = ee-ranlib
STRIP = ee-strip
-MKDIR = mkdir -p
-RM = rm -f
-
-srcdir = ../../..
-VPATH = $(srcdir)
-INCDIR = ../../../
-# DEPDIR = .deps
-
-DEFINES = -DUSE_VORBIS -DUSE_TREMOR -DUSE_MAD -DUSE_ZLIB -DFORCE_RTL -DDISABLE_SAVEGAME_SORTING -D_EE -D__PLAYSTATION2__ -G2 -O2 -Wall -Wno-multichar -fno-rtti -fno-exceptions # -DNO_ADAPTOR
-# for release builds:
-#DEFINES += -DRELEASE_BUILD
-
-INCLUDES = $(addprefix -I$(PS2_EXTRA),$(PS2_EXTRA_INCS))
-INCLUDES += -I $(PS2SDK)/ee/include -I $(PS2SDK)/common/include -I ./common -I . -I $(srcdir) -I $(srcdir)/engines
-
-CXX_UPDATE_DEP_FLAG = -Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).d",-MQ,"$@",-MP
-
-TARGET = elf/scummvm.elf
+AS = ee-gcc
+LD = ee-gcc
+HAVE_GCC3 = true
+CXX_UPDATE_DEP_FLAG = -MMD -MF "$(*D)/$(DEPDIR)/$(*F).d" -MQ "$@" -MP
+
+# Variables for dynamic plugin building
+PLUGIN_PREFIX =
+PLUGIN_SUFFIX = .plg
+PLUGIN_EXTRA_DEPS = $(TARGET)
+PLUGIN_LDFLAGS = -nostartfiles $(srcdir)/backends/plugins/elf/version.o -Wl,-q,--just-symbols,$(TARGET),--retain-symbols-file,$(srcdir)/backends/plugins/elf/plugin.syms
+PLUGIN_LDFLAGS += -mno-crt0 $(PS2SDK)/ee/startup/crt0.o -Wl,-T$(srcdir)/backends/plugins/ps2/plugin.ld -lstdc++ -lc
+
+# Test for adding different libs
+ifeq ($(USE_LIBMAD),1)
+DEFINES += -DUSE_MAD
+LIBS += -lmad
+endif
+ifeq ($(USE_LIBOGG), 1)
+DEFINES += -DUSE_VORBIS -DUSE_TREMOR
+LIBS += -ltremor
+endif
+
+# Test for dynamic plugins
+ifeq ($(DYNAMIC_MODULES),1)
+ENABLED = DYNAMIC_PLUGIN
+DEFINES += -DDYNAMIC_MODULES -DUSE_ELF_LOADER -DMIPS_TARGET -DUNCACHED_PLUGINS -DPLUGIN_DIRECTORY=\"host:plugins\"
+PRE_OBJS_FLAGS = -Wl,--whole-archive
+POST_OBJS_FLAGS = -Wl,--no-whole-archive
+else
+ENABLED = STATIC_PLUGIN
+endif
+
+# Test for debug
+ifeq ($(ENABLE_DEBUG),1)
+DEFINES += -D__PS2_DEBUG__
+FLAGS += -G2 -g
+LIBS += -lps2gdbStub -lps2ip -ldebug
+else
+DEFINES += -DRELEASE_BUILD
+FLAGS += -G2 -O2 -s -Wuninitialized
+# LDFLAGS += -s
+endif
+
+# Test for profiling
+ifeq ($(ENABLE_PROFILING),1)
+DEFINES += -DENABLE_PROFILING
+FLAGS += -G2 -pg -g
+LDFLAGS += -pg
+endif
+
+# Test for net support
+ifeq ($(DISABLE_NETWORK),1)
+DEFINES += -DNO_ADAPTOR
+endif
+
+# PS2 LIBS
+PS2LIBS = -lmc -lpad -lmouse -lhdd -lpoweroff -lsjpcm -lz -lm -lc -lfileXio -lkernel -lstdc++
+
+# Add in PS2SDK includes and libraries.
+LIBS += $(PS2LIBS)
OBJS := $(srcdir)/backends/platform/ps2/DmaPipe.o \
- $(srcdir)/backends/platform/ps2/Gs2dScreen.o \
- $(srcdir)/backends/platform/ps2/irxboot.o \
- $(srcdir)/backends/platform/ps2/ps2input.o \
- $(srcdir)/backends/platform/ps2/ps2pad.o \
- $(srcdir)/backends/platform/ps2/savefilemgr.o \
- $(srcdir)/backends/platform/ps2/fileio.o \
- $(srcdir)/backends/platform/ps2/asyncfio.o \
- $(srcdir)/backends/platform/ps2/icon.o \
- $(srcdir)/backends/platform/ps2/cd.o \
- $(srcdir)/backends/platform/ps2/eecodyvdfs.o \
- $(srcdir)/backends/platform/ps2/rpckbd.o \
- $(srcdir)/backends/platform/ps2/systemps2.o \
- $(srcdir)/backends/platform/ps2/ps2mutex.o \
- $(srcdir)/backends/platform/ps2/ps2time.o \
- $(srcdir)/backends/platform/ps2/ps2debug.o
-
-MODULE_DIRS += .
+ $(srcdir)/backends/platform/ps2/Gs2dScreen.o \
+ $(srcdir)/backends/platform/ps2/irxboot.o \
+ $(srcdir)/backends/platform/ps2/ps2input.o \
+ $(srcdir)/backends/platform/ps2/ps2pad.o \
+ $(srcdir)/backends/platform/ps2/savefilemgr.o \
+ $(srcdir)/backends/platform/ps2/fileio.o \
+ $(srcdir)/backends/platform/ps2/asyncfio.o \
+ $(srcdir)/backends/platform/ps2/icon.o \
+ $(srcdir)/backends/platform/ps2/cd.o \
+ $(srcdir)/backends/platform/ps2/eecodyvdfs.o \
+ $(srcdir)/backends/platform/ps2/rpckbd.o \
+ $(srcdir)/backends/platform/ps2/systemps2.o \
+ $(srcdir)/backends/platform/ps2/ps2mutex.o \
+ $(srcdir)/backends/platform/ps2/ps2time.o \
+ $(srcdir)/backends/platform/ps2/ps2debug.o
+
+ifeq ($(DYNAMIC_MODULES),1)
+OBJS += $(srcdir)/backends/plugins/elf/elf-loader.o \
+ $(srcdir)/backends/plugins/elf/elf-provider.o \
+ $(srcdir)/backends/plugins/elf/shorts-segment-manager.o \
+ $(srcdir)/backends/plugins/elf/memory-manager.o \
+ $(srcdir)/backends/plugins/elf/mips-loader.o \
+ $(srcdir)/backends/plugins/elf/version.o
+endif
BACKEND := ps2
+# Include common Scummvm makefile
include $(srcdir)/Makefile.common
+LDFLAGS += -L$(PS2SDK)/ee/lib -L$(PS2SDK)/ports/lib
+ifeq ($(DYNAMIC_MODULES),1)
+LDFLAGS += -mno-crt0 $(PS2SDK)/ee/startup/crt0.o -Wl,-T$(srcdir)/backends/plugins/ps2/main_prog.ld
+else
LDFLAGS += -mno-crt0 $(PS2SDK)/ee/startup/crt0.o -T $(PS2SDK)/ee/startup/linkfile
-LDFLAGS += -L $(PS2SDK)/ee/lib -L .
-LDFLAGS += $(addprefix -L$(PS2_EXTRA),$(PS2_EXTRA_LIBS))
-LDFLAGS += -lmc -lpad -lmouse -lhdd -lpoweroff -lsjpcm -lmad -ltremor -lz -lm -lc -lfileXio -lkernel -lstdc++
-LDFLAGS += -s
+endif
all: $(TARGET)
$(TARGET): $(OBJS)
- $(LD) $^ $(LDFLAGS) -o $@
+ $(LD) $(PRE_OBJS_FLAGS) $(OBJS) $(POST_OBJS_FLAGS) $(LDFLAGS) $(LIBS) -o $@
diff --git a/backends/platform/ps2/Makefile.ps2.dev b/backends/platform/ps2/Makefile.ps2.dev
new file mode 100644
index 0000000000..cd9432e2df
--- /dev/null
+++ b/backends/platform/ps2/Makefile.ps2.dev
@@ -0,0 +1,170 @@
+# SCUMMVM-PS2 MakeFile
+
+
+# Use only this section to modify how the makefile behaves ------------
+
+# Scummvm engine config: choose which engines are enabled
+ENABLE_SCUMM = $(ENABLED)
+ENABLE_SCUMM_7_8 = 1
+# ENABLE_HE = 1
+ENABLE_SCI = $(ENABLED)
+# ENABLE_SCI32 = $(ENABLED)
+# ENABLE_SKY = $(ENABLED)
+# ENABLE_SWORD1 = $(ENABLED)
+# ENABLE_SWORD2 = $(ENABLED)
+
+# Set to 1 to enable seeing the commands to gcc
+VERBOSE_BUILD = 1
+# Set to 1 to enable, 0 to disable dynamic modules
+DYNAMIC_MODULES = 0
+# Set to 1 to enable debugging
+ENABLE_DEBUG = 0
+# Set to 1 to enable profiling
+ENABLE_PROFILING = 1
+# Set to 1 to disable HDD+NET
+DISABLE_NETWORK = 0
+# Set to 1 to enable, 0 to disable libmad and libogg
+USE_LIBMAD = 1
+USE_LIBOGG = 1
+
+# ---------------------------------------------------------------------
+
+
+# General variables
+srcdir = ../../..
+VPATH = $(srcdir)
+TARGET = scummvm.elf
+# PS2 SDK location variables
+# PS2SDK = /works/tools/devel/ps2/sdk
+
+# Check PS2SDK presence
+ifeq ($(PS2SDK),)
+$(error $$(PS2SDK) needs to be set.)
+endif
+
+# Variables for common Scummvm makefile
+CC = ee-gcc
+CXX = ee-g++
+FLAGS = -pedantic -Wall -W
+FLAGS += -Wcast-qual -Wconversion -Wpointer-arith -Wshadow -Wwrite-strings
+FLAGS += -Wno-long-long -Wno-multichar -Wno-unknown-pragmas -Wno-unused-parameter
+CFLAGS = $(FLAGS) -std=c99
+CXXFLAGS = $(FLAGS) -Wnon-virtual-dtor -Wno-reorder -fno-exceptions -fno-rtti
+
+DEFINES = -D_EE -D__PLAYSTATION2__ -D__NEW_PS2SDK__ -DUSE_ZLIB -DFORCE_RTL -DDATA_PATH=\"host:data\"
+DEFINES += -DDISABLE_SAVEGAME_SORTING -DDISABLE_TEXT_CONSOLE -DDISABLE_COMMAND_LINE -DDISABLE_DOSBOX_OPL -DDISABLE_SID -DDISABLE_NES_APU
+# DEFINES += -DLOGORRHEIC
+
+INCDIR := $(PS2SDK)/ee/include $(PS2SDK)/common/include $(PS2SDK)/ports/include . $(srcdir) $(srcdir)/engines
+INCLUDES := $(addprefix -I, $(INCDIR))
+DEPDIR = .deps
+MODULE_DIRS += ./
+MKDIR = mkdir -p
+RM = rm -f
+RM_REC = rm -rf
+AR = ee-ar cru
+RANLIB = ee-ranlib
+STRIP = ee-strip
+AS = ee-gcc
+LD = ee-gcc
+HAVE_GCC3 = true
+CXX_UPDATE_DEP_FLAG = -MMD -MF "$(*D)/$(DEPDIR)/$(*F).d" -MQ "$@" -MP
+
+# Variables for dynamic plugin building
+PLUGIN_PREFIX =
+PLUGIN_SUFFIX = .plg
+PLUGIN_EXTRA_DEPS = $(TARGET)
+PLUGIN_LDFLAGS = -nostartfiles $(srcdir)/backends/plugins/elf/version.o -Wl,-q,--just-symbols,$(TARGET),--retain-symbols-file,$(srcdir)/backends/plugins/elf/plugin.syms
+PLUGIN_LDFLAGS += -mno-crt0 $(PS2SDK)/ee/startup/crt0.o -Wl,-T$(srcdir)/backends/plugins/ps2/plugin.ld -lstdc++ -lc
+
+# Test for adding different libs
+ifeq ($(USE_LIBMAD),1)
+DEFINES += -DUSE_MAD
+LIBS += -lmad
+endif
+ifeq ($(USE_LIBOGG), 1)
+DEFINES += -DUSE_VORBIS -DUSE_TREMOR
+LIBS += -ltremor
+endif
+
+# Test for dynamic plugins
+ifeq ($(DYNAMIC_MODULES),1)
+ENABLED = DYNAMIC_PLUGIN
+DEFINES += -DDYNAMIC_MODULES -DUSE_ELF_LOADER -DMIPS_TARGET -DUNCACHED_PLUGINS -DPLUGIN_DIRECTORY=\"host:plugins\"
+PRE_OBJS_FLAGS = -Wl,--whole-archive
+POST_OBJS_FLAGS = -Wl,--no-whole-archive
+else
+ENABLED = STATIC_PLUGIN
+endif
+
+# Test for debug
+ifeq ($(ENABLE_DEBUG),1)
+DEFINES += -D__PS2_DEBUG__
+FLAGS += -G2 -g
+LIBS += -lps2gdbStub -lps2ip -ldebug
+else
+DEFINES += -DRELEASE_BUILD
+FLAGS += -G2 -O2 -s -Wuninitialized
+# LDFLAGS += -s
+endif
+
+# Test for profiling
+ifeq ($(ENABLE_PROFILING),1)
+DEFINES += -DENABLE_PROFILING
+FLAGS += -G2 -pg -g
+LDFLAGS += -pg
+endif
+
+# Test for net support
+ifeq ($(DISABLE_NETWORK),1)
+DEFINES += -DNO_ADAPTOR
+endif
+
+# PS2 LIBS
+PS2LIBS = -lmc -lpad -lmouse -lhdd -lpoweroff -lsjpcm -lz -lm -lc -lfileXio -lkernel -lstdc++
+
+# Add in PS2SDK includes and libraries.
+LIBS += $(PS2LIBS)
+
+OBJS := $(srcdir)/backends/platform/ps2/DmaPipe.o \
+ $(srcdir)/backends/platform/ps2/Gs2dScreen.o \
+ $(srcdir)/backends/platform/ps2/irxboot.o \
+ $(srcdir)/backends/platform/ps2/ps2input.o \
+ $(srcdir)/backends/platform/ps2/ps2pad.o \
+ $(srcdir)/backends/platform/ps2/savefilemgr.o \
+ $(srcdir)/backends/platform/ps2/fileio.o \
+ $(srcdir)/backends/platform/ps2/asyncfio.o \
+ $(srcdir)/backends/platform/ps2/icon.o \
+ $(srcdir)/backends/platform/ps2/cd.o \
+ $(srcdir)/backends/platform/ps2/eecodyvdfs.o \
+ $(srcdir)/backends/platform/ps2/rpckbd.o \
+ $(srcdir)/backends/platform/ps2/systemps2.o \
+ $(srcdir)/backends/platform/ps2/ps2mutex.o \
+ $(srcdir)/backends/platform/ps2/ps2time.o \
+ $(srcdir)/backends/platform/ps2/ps2debug.o
+
+ifeq ($(DYNAMIC_MODULES),1)
+OBJS += $(srcdir)/backends/plugins/elf/elf-loader.o \
+ $(srcdir)/backends/plugins/elf/elf-provider.o \
+ $(srcdir)/backends/plugins/elf/shorts-segment-manager.o \
+ $(srcdir)/backends/plugins/elf/memory-manager.o \
+ $(srcdir)/backends/plugins/elf/mips-loader.o \
+ $(srcdir)/backends/plugins/elf/version.o
+endif
+
+BACKEND := ps2
+
+# Include common Scummvm makefile
+include $(srcdir)/Makefile.common
+
+LDFLAGS += -L$(PS2SDK)/ee/lib -L$(PS2SDK)/ports/lib
+ifeq ($(DYNAMIC_MODULES),1)
+LDFLAGS += -mno-crt0 $(PS2SDK)/ee/startup/crt0.o -Wl,-T$(srcdir)/backends/plugins/ps2/main_prog.ld
+else
+LDFLAGS += -mno-crt0 $(PS2SDK)/ee/startup/crt0.o -T $(PS2SDK)/ee/startup/linkfile
+endif
+
+all: $(TARGET)
+
+$(TARGET): $(OBJS)
+ $(LD) $(PRE_OBJS_FLAGS) $(OBJS) $(POST_OBJS_FLAGS) $(LDFLAGS) $(LIBS) -o $@
diff --git a/backends/platform/ps2/README.PS2 b/backends/platform/ps2/README.PS2
new file mode 100644
index 0000000000..141a79eaca
--- /dev/null
+++ b/backends/platform/ps2/README.PS2
@@ -0,0 +1,189 @@
+Dear PS2 ScummVM enthusiast user,
+
+here you will find the latest and the greatest PS2 backend ever!
+
+
+ *** Release Notes ***
+
+Released 2 builds: SCUMMVM.ELF and SCUMMVM-S.ELF. The latter has engine
+modules statically linked into (that's what the "-S" is for), the former
+uses dynamic modules (uncached). The dynamic one is much faster to start
+and has more resources available for the games. The catch is that games
+detection, when you are adding a new one, is painstakingly slow...
+(as it needs to load, test, unload the plugins one by one).
+
+Until we have an optimization for that in place I would suggest you add
+new games with "SCUMMVM-S.ELF", and when you are done adding you then
+play them with "SCUMMVM.ELF", as this will give you the best of both.
+
+We no longer have a separate ELF build with hdd & net adapter disabled,
+as we now do it in the smart way, allowing users to disable it in their
+ScummVM.ini. See under in "Configuration" for details.
+
+We also have an improved Makefile.ps2 in ps2 folder which will allow
+you to create: static, dynamic, profile and debug build version.
+
+You can now also cleanly compile using "configure" and specifying:
+
+./configure --backend=ps2 --host=ps2 ...
+
+
+ *** Installation ***
+
+Some media drivers require all capitalized letter, so to be on the
+safe side store the files (SCUMMVM.ELF and *.IRX) in upper case.
+
+Here comes a full list of the required *.IRX (don't worry they are all
+provided pre-compiled in the binary release ;-)
+
+ IOMANX.IRX
+ FILEXIO.IRX
+ CODYVDFS.IRX
+ SJPCM.IRX
+ USBD.IRX
+ USB_MASS.IRX
+ PS2MOUSE.IRX
+ RPCKBD.IRX
+ POWEROFF.IRX
+ PS2DEV9.IRX
+ PS2ATAD.IRX
+ PS2HDD.IRX
+ PS2FS.IRX
+ PS2IP.IRX
+ PS2SMAP.IRX
+ PS2HOST.IRX
+
+Make sure they are all stored in the folder that contains your SCUMMVM.ELF!
+
+If you are starting ScummVM from CD/DVD then it will look for ScummVM.ini
+a ScummVM.ini on the media folder from where you started SCUMMVM.ELF.
+
+Notes:
+
+ - depending on the media you install Scummvm/PS2 onto, it might be
+ picky about files cases, so I'd leave those *.IRX uppercase and
+ scummmodern.zip lower ;0)
+
+ - make sure you selected a save path before you start playing!
+
+ - we added PS2IPS.IRX in case you wanted to test a debug build
+ (use Makefile.gdb)
+
+
+ *** Configuration ***
+
+There is now a [PlayStation2] section in ScummVM.ini which can be used
+to make your wildest dreams come true ;-)
+
+It accepts these entries:
+
+tv_mode = [pal] [ntsc]
+gfx_mode = [mode number] [*]
+hdd_part = [partition name] [disable]
+net_addr = [PS2 IP addr] [**]
+usb_mass = [0] [disable]
+
+[*] Currently supported gfx modes are:
+
+ # 1 -> SDTV progressive (NTSC: 224p / PAL: 256p)
+ # 2 -> SDTV interlaced (NTSC: 448i / PAL: 512i) <- default
+ # 3 -> EDTV progressive (NTSC: 480p / PAL: 576p)
+ # 6 -> VESA (640x480@60)
+
+If no tv_mode is specified it will be autodected based on PS2 model.
+
+The non-interlaced (progressive) modes look much better and sharper.
+You can check the difference starting COMI and choosing About from
+the GMM (press "start" then choose "about"). You can easily see the
+difference between progressive and interlaced in scrolling text.
+
+You can use mode 6 (VGA 640x480) if you are connecting your PS2 to
+a RGB monitor. Some TVs also supports this signal.
+
+We also do some bad-ass things, like detecting the BIOS version and
+setting the GS registers by hand, for console models where a mode
+is not supported ;-)
+
+If SCUMMVM.ELF hangs at start for you try disabling the adapter by
+setting in ScummVM.ini
+
+hdd_part = 0
+net_addr = 0
+
+You can now also choose the hdd partition used for ScummVM games
+(default "+ScummVM") passing it as an argument to hdd_part:
+
+hdd_part = MyPartition (witout the "+")
+
+If you have an adapter with hdd & net, but you don't use them you
+can just set both to 0 to disable, and have a leaner and meaner
+ScummVM booting much faster!
+
+[**] TODO
+
+ *** Remote ***
+
+You will need "PS2IP.IRX", "PS2SMAP.IRX" and "PS2HOST.IRX" drivers too
+in the folder where you are starting SCUMMVM.ELF if you want to use
+the remote capability.
+
+The IP 192.168.1.20 (ps2link default) is hardcoded in the source as
+"netArg" in irxboot.cpp, feel free to modify it to match your network
+configuration.
+
+In a future release you will be able to set in ScummVM.ini using
+
+net_addr = xxx.yyy.zzz.www
+
+If you are starting SCUMMVM.ELF over the net using ps2client then you
+are already set. If you are starting it in any other way, then you
+will have to "export" the folder where you are storing ScummVM games
+and data by starting ps2client from inside that folder. Eg. from a
+terminal:
+
+> ./ps2client -h [your ps2 ip] listen
+
+Do this -after- ScummVM is up and running otherwise it will fail to
+establish a connection.
+
+
+ *** Gamepad ***
+
+The mapping is:
+
+Start Button - GMM
+R1 - 'y'
+L1 - 'n'
+R2 - '.'
+L2 - Numpad 0
+Triangle - Escape
+Square - Enter
+Cross - Left mouse button
+Circle - Right mouse button
+
+
+ *** Bugs ***
+
+Though we made our best to make this release as bug free as possible
+there are still a few bugs left:
+
+ - file handling speed : (not really a bug, but a nuisance) : there
+ is probably space for some more optimization in the current file
+ management. The only case when it really bogs me it's when you
+ try to select a saved game and there is some lag.
+
+ Some game will start faster too when this is optimized.
+
+ - feel free to add your bug, suggestion, secret wish to this list!
+
+ - SCI games have smooth audio and intro, but moving the pointer
+ and in-game animation speed might be a challenge.
+
+ - it has been reported USB media greater than 8 GB might not work
+
+Now enough reading, rush to your PlayStation2 and start playing!
+
+Are you still reading?
+
+Have a lot of fun,
+ -Max Lingua
diff --git a/backends/platform/ps2/asyncfio.cpp b/backends/platform/ps2/asyncfio.cpp
index 3f20349107..6f15dcc628 100644
--- a/backends/platform/ps2/asyncfio.cpp
+++ b/backends/platform/ps2/asyncfio.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -33,7 +33,7 @@
AsyncFio::AsyncFio(void) {
_runningOp = NULL;
- memset((int *)_ioSlots, 0, MAX_HANDLES * sizeof(int));
+ memset(const_cast<int *>(_ioSlots), 0, MAX_HANDLES * sizeof(int));
ee_sema_t newSema;
newSema.init_count = 1;
newSema.max_count = 1;
@@ -63,7 +63,7 @@ int AsyncFio::open(const char *name, int ioMode, int mode) {
fileXioWaitAsync(FXIO_WAIT, &res);
SignalSema(_ioSema);
// dbg_printf("FIO: open ext(%s, %d, %d) => %d", name, ioMode, mode, res);
- return res;
+ return res;
}
void AsyncFio::close(int handle) {
@@ -80,7 +80,7 @@ void AsyncFio::close(int handle) {
void AsyncFio::checkSync(void) {
if (_runningOp) {
- fileXioWaitAsync(FXIO_WAIT, (int *)_runningOp);
+ fileXioWaitAsync(FXIO_WAIT, const_cast<int *>(_runningOp));
_runningOp = NULL;
}
}
@@ -90,7 +90,7 @@ void AsyncFio::read(int fd, void *dest, unsigned int len) {
checkSync();
assert(fd < MAX_HANDLES);
_runningOp = _ioSlots + fd;
- fileXioRead(fd, (unsigned char*)dest, len);
+ fileXioRead(fd, (unsigned char *)dest, len);
SignalSema(_ioSema);
}
@@ -99,7 +99,7 @@ void AsyncFio::write(int fd, const void *src, unsigned int len) {
checkSync();
assert(fd < MAX_HANDLES);
_runningOp = _ioSlots + fd;
- fileXioWrite(fd, (unsigned char*)src, len);
+ fileXioWrite(fd, (unsigned char *)const_cast<void *>(src), len);
SignalSema(_ioSema);
}
@@ -210,7 +210,7 @@ bool AsyncFio::poll(int fd) {
bool retVal = false;
if (PollSema(_ioSema) >= 0) {
if (_runningOp == _ioSlots + fd) {
- if (fileXioWaitAsync(FXIO_NOWAIT, (int *)_runningOp) == FXIO_COMPLETE) {
+ if (fileXioWaitAsync(FXIO_NOWAIT, const_cast<int *>(_runningOp)) == FXIO_COMPLETE) {
_runningOp = NULL;
retVal = true;
} else
@@ -226,7 +226,7 @@ bool AsyncFio::fioAvail(void) {
bool retVal = false;
if (PollSema(_ioSema) > 0) {
if (_runningOp) {
- if (fileXioWaitAsync(FXIO_NOWAIT, (int *)_runningOp) == FXIO_COMPLETE) {
+ if (fileXioWaitAsync(FXIO_NOWAIT, const_cast<int *>(_runningOp)) == FXIO_COMPLETE) {
_runningOp = NULL;
retVal = true;
} else
diff --git a/backends/platform/ps2/asyncfio.h b/backends/platform/ps2/asyncfio.h
index 31684d4349..6f84742da0 100644
--- a/backends/platform/ps2/asyncfio.h
+++ b/backends/platform/ps2/asyncfio.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -23,6 +23,9 @@
#define MAX_HANDLES 32
#include <sys/stat.h>
+#undef chdir // we define our own
+#undef mkdir
+
class AsyncFio {
public:
AsyncFio(void);
diff --git a/backends/platform/ps2/cd.c b/backends/platform/ps2/cd.c
index cd44b3d034..e08437d34f 100644
--- a/backends/platform/ps2/cd.c
+++ b/backends/platform/ps2/cd.c
@@ -19,35 +19,35 @@ int cdvdInitialised = 0;
void cdvdExit(void)
{
- cdvdInitialised = 0;
+ cdvdInitialised = 0;
}
int cdvdInit(int mode)
{
int i=0,len=0,ret=0;
- u8 *pkt;
-
- cdvdCd.server = NULL;
-
- do {
- if ((ret = SifBindRpc(&cdvdCd, CDVD_INIT_BIND_RPC, 0)) < 0) {
- return -1;
- }
- if (!cdvdCd.server) {
- nopdelay();
- }
- }
+ u8 *pkt;
+
+ cdvdCd.server = NULL;
+
+ do {
+ if ((ret = SifBindRpc(&cdvdCd, (signed)CDVD_INIT_BIND_RPC, 0)) < 0) {
+ return -1;
+ }
+ if (!cdvdCd.server) {
+ nopdelay();
+ }
+ }
while(!cdvdCd.server);
- pkt = sendBuffer;
- PUSHDATA( int, pkt, mode, i);
- pkt += i; len += i;
+ pkt = (unsigned char *)sendBuffer;
+ PUSHDATA(int, pkt, mode, i);
+ pkt += i; len += i;
if ((ret = SifCallRpc(&cdvdCd, 0, 0, sendBuffer, len, NULL, 0, 0, 0)) < 0)
- return -1;
+ return -1;
- cdvdInitialised = 1;
+ cdvdInitialised = 1;
- return 0;
+ return 0;
}
diff --git a/backends/platform/ps2/eecodyvdfs.h b/backends/platform/ps2/eecodyvdfs.h
index 1d43fb662f..f439c42125 100644
--- a/backends/platform/ps2/eecodyvdfs.h
+++ b/backends/platform/ps2/eecodyvdfs.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -40,7 +40,7 @@ struct CdClock {
#ifdef __cplusplus
extern "C" {
#endif
- int initCdvdFs(void);
+ int initCdvdFs(void);
void readRTC(struct CdClock *dest);
int driveStop(void);
int driveStandby(void);
diff --git a/backends/platform/ps2/fileio.cpp b/backends/platform/ps2/fileio.cpp
index 1ec16a3817..205a688438 100644
--- a/backends/platform/ps2/fileio.cpp
+++ b/backends/platform/ps2/fileio.cpp
@@ -8,20 +8,21 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
-// Disable symbol overrides so that we can use system headers.
-#define FORBIDDEN_SYMBOL_ALLOW_ALL
+// Disable symbol overrides so that we can use "FILE"
+#define FORBIDDEN_SYMBOL_EXCEPTION_FILE
+#define FORBIDDEN_SYMBOL_EXCEPTION_printf
#include "backends/platform/ps2/fileio.h"
@@ -78,12 +79,12 @@ Ps2File::~Ps2File() {
fio.seek(_fd, 0, SEEK_SET);
fio.write(_fd, _cacheBuf, _filePos);
w = fio.sync(_fd);
- printf("flushed wbuf: %x of %x\n", w, _filePos);
+ dbg_printf("flushed wbuf: %x of %x\n", w, _filePos);
}
fio.close(_fd);
uint32 r = fio.sync(_fd);
- printf("close [%d] - sync'd = %d\n", _fd, r);
+ dbg_printf("close [%d] - sync'd = %d\n", _fd, r);
}
free(_cacheBuf);
@@ -97,7 +98,7 @@ bool Ps2File::open(const char *name, int mode) {
#if 1
_fd = fio.open(name, mode);
- printf("open %s [%d]\n", name, _fd);
+ dbg_printf("open %s [%d]\n", name, _fd);
if (_fd >= 0) {
_mode = mode;
@@ -110,9 +111,9 @@ bool Ps2File::open(const char *name, int mode) {
else
_fileSize = 0;
- printf(" _mode = %x\n", _mode);
- printf(" _fileSize = %d\n", _fileSize);
- // printf(" _filePos = %d\n", _filePos);
+ dbg_printf(" _mode = %x\n", _mode);
+ dbg_printf(" _fileSize = %d\n", _fileSize);
+ // dbg_printf(" _filePos = %d\n", _filePos);
return true;
}
@@ -130,7 +131,7 @@ bool Ps2File::open(const char *name, int mode) {
if (_fileSize && mode != O_RDONLY) {
fio.read(_fd, _cacheBuf, _fileSize);
r = fio.sync(_fd);
- printf(" sz=%d, read=%d\n", _fileSize, r);
+ dbg_printf(" sz=%d, read=%d\n", _fileSize, r);
assert(r == _fileSize);
}
@@ -141,7 +142,7 @@ bool Ps2File::open(const char *name, int mode) {
_fd = fio.open(name, mode);
- printf("open %s [%d]\n", name, _fd);
+ dbg_printf("open %s [%d]\n", name, _fd);
if (_fd >= 0) {
_mode = mode;
@@ -160,16 +161,16 @@ bool Ps2File::open(const char *name, int mode) {
if (mode != O_RDONLY) {
fio.read(_fd, _cacheBuf, _fileSize);
r = fio.sync(_fd);
- printf(" sz=%d, read=%d\n", _fileSize, r);
+ dbg_printf(" sz=%d, read=%d\n", _fileSize, r);
assert(r == _fileSize);
// _fileSize = fio.seek(_fd, 0, SEEK_END);
}
#endif
}
- printf(" _mode = %x\n", _mode);
- printf(" _fileSize = %d\n", _fileSize);
- printf(" _filePos = %d\n", _filePos);
+ dbg_printf(" _mode = %x\n", _mode);
+ dbg_printf(" _fileSize = %d\n", _fileSize);
+ dbg_printf(" _filePos = %d\n", _filePos);
return true;
} else
@@ -208,7 +209,7 @@ bool Ps2File::eof() {
#ifdef __PS2_FILE_SEMA__
SignalSema(_sema);
- // printf(" EOF [%d] : %d of %d -> %d\n", _fd, _filePos, _fileSize, res);
+ // dbg_printf(" EOF [%d] : %d of %d -> %d\n", _fd, _filePos, _fileSize, res);
#endif
return res;
}
@@ -255,8 +256,8 @@ int Ps2File::seek(int32 offset, int origin) {
_eof = true;
}
- // printf("seek [%d] %d %d\n", _fd, offset, origin);
- // printf(" res = %d\n", res);
+ // dbg_printf("seek [%d] %d %d\n", _fd, offset, origin);
+ // dbg_printf(" res = %d\n", res);
#ifdef __PS2_FILE_SEMA__
SignalSema(_sema);
@@ -338,8 +339,8 @@ uint32 Ps2File::read(void *dest, uint32 len) {
#endif
#ifdef __PS2_FILE_DEBUG__
- printf("read (1) : _filePos = %d\n", _filePos);
- printf("read (1) : _cachePos = %d\n", _cachePos);
+ dbg_printf("read (1) : _filePos = %d\n", _filePos);
+ dbg_printf("read (1) : _cachePos = %d\n", _cachePos);
#endif
if (len == 0) {
@@ -409,7 +410,10 @@ uint32 Ps2File::read(void *dest, uint32 len) {
break; // EOF
}
}
+#ifndef ENABLE_PROFILING
+ // doesn't play nice with -pg
cacheReadAhead();
+#endif
#ifdef __PS2_FILE_SEMA__
SignalSema(_sema);
#endif
@@ -473,7 +477,7 @@ uint32 PS2FileStream::write(const void *ptr, uint32 len) {
}
bool PS2FileStream::flush() {
- // printf("flush not implemented\n");
+ // dbg_printf("flush not implemented\n");
return true;
}
@@ -481,7 +485,7 @@ bool PS2FileStream::err() const {
bool errVal = _handle->getErr();
if (errVal) {
- printf("ferror -> %d\n", errVal);
+ dbg_printf("ferror -> %d\n", errVal);
}
return errVal;
@@ -501,7 +505,7 @@ FILE *ps2_fopen(const char *fname, const char *mode) {
Ps2File *file = new Ps2File();
int _mode = O_RDONLY;
- printf("fopen(%s, %s)\n", fname, mode);
+ dbg_printf("fopen(%s, %s)\n", fname, mode);
if (mode[0] == 'r' && mode [1] == 'w')
_mode = O_RDWR;
diff --git a/backends/platform/ps2/fileio.h b/backends/platform/ps2/fileio.h
index afa2ca1f24..16eb7f212a 100644
--- a/backends/platform/ps2/fileio.h
+++ b/backends/platform/ps2/fileio.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -30,13 +30,13 @@
#include "common/stream.h"
enum {
- CACHE_SIZE = 2048 * 32,
- MAX_READ_STEP = 2048 * 16,
- MAX_CACHED_FILES = 6,
- CACHE_READ_THRESHOLD = 16 * 2048,
- CACHE_FILL_MIN = 2048 * 24,
- READ_ALIGN = 64, // align all reads to the size of an EE cache line
- READ_ALIGN_MASK = READ_ALIGN - 1
+ CACHE_SIZE = 2048 * 32,
+ MAX_READ_STEP = 2048 * 16,
+ MAX_CACHED_FILES = 6,
+ CACHE_READ_THRESHOLD = 16 * 2048,
+ CACHE_FILL_MIN = 2048 * 24,
+ READ_ALIGN = 64, // align all reads to the size of an EE cache line
+ READ_ALIGN_MASK = READ_ALIGN - 1
};
// TODO: Make this a subclass of SeekableReadStream & WriteStream
diff --git a/backends/platform/ps2/icon.cpp b/backends/platform/ps2/icon.cpp
index bda4843647..9319d9f4d9 100644
--- a/backends/platform/ps2/icon.cpp
+++ b/backends/platform/ps2/icon.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -937,7 +937,7 @@ uint16 PS2Icon::decompressData(uint16 **data) {
uint16 inPos = 1;
const uint16 *rleData = (const uint16 *)_rleIcoData;
uint16 resSize = rleData[0];
- uint16 *resData = (uint16 *)malloc(resSize * sizeof(uint16));
+ uint16 *resData = (uint16 *)memalign(64, resSize * sizeof(uint16));
uint16 outPos = 0;
while (outPos < resSize) {
diff --git a/backends/platform/ps2/icon.h b/backends/platform/ps2/icon.h
index 3ad19910d3..9413b8466c 100644
--- a/backends/platform/ps2/icon.h
+++ b/backends/platform/ps2/icon.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/ps2/iop/CoDyVDfs/common/codyvdirx.h b/backends/platform/ps2/iop/CoDyVDfs/common/codyvdirx.h
index e94e7dc8d6..6ac5a0bb65 100644
--- a/backends/platform/ps2/iop/CoDyVDfs/common/codyvdirx.h
+++ b/backends/platform/ps2/iop/CoDyVDfs/common/codyvdirx.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -26,13 +26,13 @@
#define CDVDFS_IRX_ID 0xD004352
// commands:
-#define READ_RTC 0
-#define SET_READ_SPEED 1
-#define DRIVE_STOP 2
-#define DRIVE_STANDBY 3
+#define READ_RTC 0
+#define SET_READ_SPEED 1
+#define DRIVE_STOP 2
+#define DRIVE_STANDBY 3
-#define CdTrayOpen 0
-#define CdTrayClose 1
-#define CdTrayCheck 2
+#define CdTrayOpen 0
+#define CdTrayClose 1
+#define CdTrayCheck 2
#endif // CDVDFS_COMMON_H
diff --git a/backends/platform/ps2/iop/CoDyVDfs/iop/cdtypes.h b/backends/platform/ps2/iop/CoDyVDfs/iop/cdtypes.h
index ad86631cfd..d9bd5287c6 100644
--- a/backends/platform/ps2/iop/CoDyVDfs/iop/cdtypes.h
+++ b/backends/platform/ps2/iop/CoDyVDfs/iop/cdtypes.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -39,24 +39,24 @@ typedef struct {
} ISOPathTableRecord __attribute__ ((packed));
typedef struct {
- uint8 year; // Number of years since 1900
- uint8 month; // Month of the year from 1 to 12
- uint8 day; // Day of the Month from 1 to 31
- uint8 hour; // Hour of the day from 0 to 23
- uint8 min; // Minute of the hour from 0 to 59
- uint8 sec; // second of the minute from 0 to 59
- uint8 gmtOff; // Offset from Greenwich Mean Time in number of 15 minute intervals from -48(West) to +52(East)
+ uint8 year; // Number of years since 1900
+ uint8 month; // Month of the year from 1 to 12
+ uint8 day; // Day of the Month from 1 to 31
+ uint8 hour; // Hour of the day from 0 to 23
+ uint8 min; // Minute of the hour from 0 to 59
+ uint8 sec; // second of the minute from 0 to 59
+ uint8 gmtOff; // Offset from Greenwich Mean Time in number of 15 minute intervals from -48(West) to +52(East)
uint8 padding[10];
} ISOTime __attribute__ ((packed));
typedef struct {
- uint8 year; // Number of years since 1900
- uint8 month; // Month of the year from 1 to 12
- uint8 day; // Day of the Month from 1 to 31
- uint8 hour; // Hour of the day from 0 to 23
- uint8 min; // Minute of the hour from 0 to 59
- uint8 sec; // second of the minute from 0 to 59
- uint8 gmtOff; // Offset from Greenwich Mean Time in number of 15 minute intervals from -48(West) to +52(East)
+ uint8 year; // Number of years since 1900
+ uint8 month; // Month of the year from 1 to 12
+ uint8 day; // Day of the Month from 1 to 31
+ uint8 hour; // Hour of the day from 0 to 23
+ uint8 min; // Minute of the hour from 0 to 59
+ uint8 sec; // second of the minute from 0 to 59
+ uint8 gmtOff; // Offset from Greenwich Mean Time in number of 15 minute intervals from -48(West) to +52(East)
//uint8 padding[10];
} ISOFileTime __attribute__ ((packed));
@@ -96,38 +96,38 @@ typedef struct {
uint8 reserved[6];
uint8 reserved2;
uint8 reserved3;
-} ISORoot __attribute__((packed)); // 0x22
+} ISORoot __attribute__((packed)); // 0x22
typedef struct {
- uint8 type; // 0x00
- char identifier[5]; // 0x01
- uint8 version; // 0x06
- uint8 reserved1; // 0x07
- char systemIdentifier[32]; // 0x08
+ uint8 type; // 0x00
+ char identifier[5]; // 0x01
+ uint8 version; // 0x06
+ uint8 reserved1; // 0x07
+ char systemIdentifier[32]; // 0x08
char volumeIdentifier[32]; // 0x28
- uint8 reserved2[8]; // 0x48
- uint32 volumeSpaceSize; // 0x50
- uint32 volumeSpaceSizeBE; // 0x54
- char reserved3[32]; // 0x58
- uint32 volumeSetSize; // 0x78
- uint32 volumeSequenceNumber; // 0x7C
- uint32 logicalBlockSize; // 0x80
- uint32 pathTableSize; // 0x84
- uint32 pathTableSizeBE; // 0x88
- uint32 pathTablePos; // 0x8C
- uint32 pathTable2Pos; // 0x90
- uint32 pathTablePosBE; // 0x94
- uint32 pathTable2PosBE; // 0x98
- ISORoot rootDir; // 0x9C
- ISOIds ids; // 0xBE
- ISOTime creation; // 0x32D
- ISOTime modification; // 0x33E
- ISOTime expiration; // 0x34F
- ISOTime effective; // 0x360
- uint8 fileStructureVersion; // 0x371
- uint8 reserved4; // 0x372
- uint8 applicationUse[512]; // 0x373
- uint8 reserved5[653]; // 0x573
-} ISOPvd __attribute__ ((packed)); // 0x800
+ uint8 reserved2[8]; // 0x48
+ uint32 volumeSpaceSize; // 0x50
+ uint32 volumeSpaceSizeBE; // 0x54
+ char reserved3[32]; // 0x58
+ uint32 volumeSetSize; // 0x78
+ uint32 volumeSequenceNumber; // 0x7C
+ uint32 logicalBlockSize; // 0x80
+ uint32 pathTableSize; // 0x84
+ uint32 pathTableSizeBE; // 0x88
+ uint32 pathTablePos; // 0x8C
+ uint32 pathTable2Pos; // 0x90
+ uint32 pathTablePosBE; // 0x94
+ uint32 pathTable2PosBE; // 0x98
+ ISORoot rootDir; // 0x9C
+ ISOIds ids; // 0xBE
+ ISOTime creation; // 0x32D
+ ISOTime modification; // 0x33E
+ ISOTime expiration; // 0x34F
+ ISOTime effective; // 0x360
+ uint8 fileStructureVersion; // 0x371
+ uint8 reserved4; // 0x372
+ uint8 applicationUse[512]; // 0x373
+ uint8 reserved5[653]; // 0x573
+} ISOPvd __attribute__ ((packed)); // 0x800
#endif // __CDTYPES_H__
diff --git a/backends/platform/ps2/iop/CoDyVDfs/iop/codyvdfs.c b/backends/platform/ps2/iop/CoDyVDfs/iop/codyvdfs.c
index e55e62853b..2a94560843 100644
--- a/backends/platform/ps2/iop/CoDyVDfs/iop/codyvdfs.c
+++ b/backends/platform/ps2/iop/CoDyVDfs/iop/codyvdfs.c
@@ -59,7 +59,7 @@ int verifyDriveReady(void) {
return -1; // drive still not ready
}
}
- if (mediaType == DISC_NONE)
+ if (mediaType == DISC_NONE)
return -1;
return 0;
}
@@ -72,14 +72,14 @@ int cacheEnterDir(ISODirectoryRecord *dir) {
cachedDirOfs = 0;
cacheName = cachedDir + strlen(cachedDir);
memcpy(cacheName, dir->name, dir->len_fi);
- cacheName[dir->len_fi] = '/';
+ cacheName[dir->len_fi] = '/';
cacheName[dir->len_fi + 1] = '\0';
return cdReadSectors(cachedDirLba, 1, cacheBuf, &rmode);
}
int initRootCache(void) {
CdRMode rmode = { 16, 0, CdSect2048, 0 };
- ISODirectoryRecord *root = (ISODirectoryRecord*)cacheBuf;
+ ISODirectoryRecord *root = (ISODirectoryRecord *)cacheBuf;
if (cdReadSectors(fsRootLba, 1, cacheBuf, &rmode) == 0) {
cachedDir[0] = '\0';
@@ -104,10 +104,10 @@ ISODirectoryRecord *findEntryInCache(const char *name, int nameLen) {
if (i != cachedDirOfs) {
if (cdReadSectors(cachedDirLba + i, 1, cacheBuf, &rmode) < 0)
return NULL;
- cachedDirOfs = i;
+ cachedDirOfs = i;
}
- while (entry->len_dr && ((uint8*)entry < cacheBuf + SECTOR_SIZE)) {
+ while (entry->len_dr && ((uint8 *)entry < cacheBuf + SECTOR_SIZE)) {
if ((entry->len_fi > 2) && (entry->name[entry->len_fi - 2] == ';') && (entry->name[entry->len_fi - 1] == '1')) {
if ((nameLen == entry->len_fi - 2) && (strnicmp(name, entry->name, entry->len_fi - 2) == 0))
return entry;
@@ -115,10 +115,10 @@ ISODirectoryRecord *findEntryInCache(const char *name, int nameLen) {
if ((nameLen == entry->len_fi) && (strnicmp(name, entry->name, entry->len_fi) == 0))
return entry;
}
- entry = (ISODirectoryRecord *)( (uint8*)entry + entry->len_dr );
+ entry = (ISODirectoryRecord *)( (uint8 *)entry + entry->len_dr );
}
}
- return NULL;
+ return NULL;
}
ISODirectoryRecord *findPath(const char *path) {
@@ -225,12 +225,12 @@ int initDisc(void) {
case 1:
discType = DISC_MODE1;
printf("Disc: Mode1\n");
- pvd = (ISOPvd*)(cacheBuf + 4);
+ pvd = (ISOPvd *)(cacheBuf + 4);
break;
case 2:
discType = DISC_MODE2;
printf("Disc: Mode2\n");
- pvd = (ISOPvd*)(cacheBuf + 12);
+ pvd = (ISOPvd *)(cacheBuf + 12);
break;
default:
DBG_PRINTF("Unknown Sector Type %02X\n", cacheBuf[3]);
@@ -257,7 +257,7 @@ int initDisc(void) {
mediaType = discType;
DBG_PRINTF("Root directory in sector %d\n", fsRootLba);
- return initRootCache();
+ return initRootCache();
}
}
}
@@ -290,46 +290,46 @@ int cd_init(iop_device_t *dev) {
}
iop_device_ops_t FS_ops = {
- (void *) cd_init,
- (void *) cd_dummy,
- (void *) cd_dummy,
- (void *) cd_open,
- (void *) cd_close,
- (void *) cd_read,
- (void *) cd_dummy,
- (void *) cd_lseek,
- (void *) cd_dummy,
- (void *) cd_dummy,
- (void *) cd_dummy,
- (void *) cd_dummy,
- (void *) cd_dopen,
- (void *) cd_dclose,
- (void *) cd_dread,
- (void *) cd_dummy,
- (void *) cd_dummy,
+ (void *) cd_init,
+ (void *) cd_dummy,
+ (void *) cd_dummy,
+ (void *) cd_open,
+ (void *) cd_close,
+ (void *) cd_read,
+ (void *) cd_dummy,
+ (void *) cd_lseek,
+ (void *) cd_dummy,
+ (void *) cd_dummy,
+ (void *) cd_dummy,
+ (void *) cd_dummy,
+ (void *) cd_dopen,
+ (void *) cd_dclose,
+ (void *) cd_dread,
+ (void *) cd_dummy,
+ (void *) cd_dummy,
};
#define FS_NAME "cdfs"
#define FS_DESC "CD-ROM"
iop_device_t fsdriver = {
- FS_NAME,
- IOP_DT_FS | IOP_DT_FSEXT,
- 1,
- FS_DESC,
- &FS_ops
+ FS_NAME,
+ IOP_DT_FS | IOP_DT_FSEXT,
+ 1,
+ FS_DESC,
+ &FS_ops
};
int _start(void) {
- printf("CoDyVDfs v0.01\n");
+ printf("CoDyVDfs v0.01\n");
CdInit(1);
- DelDrv(FS_NAME);
- AddDrv(&fsdriver);
+ DelDrv(FS_NAME);
+ AddDrv(&fsdriver);
initRpc();
initFio();
- return(0);
+ return(0);
}
int strnicmp(const char *s1, const char *s2, int n) {
diff --git a/backends/platform/ps2/iop/CoDyVDfs/iop/codyvdfs.h b/backends/platform/ps2/iop/CoDyVDfs/iop/codyvdfs.h
index b9f1edc194..cc903ea841 100644
--- a/backends/platform/ps2/iop/CoDyVDfs/iop/codyvdfs.h
+++ b/backends/platform/ps2/iop/CoDyVDfs/iop/codyvdfs.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -51,20 +51,20 @@ enum ReadModes {
};
enum {
- CdDiskNone = 0x00,
- CdDiskDetect, // 0x01
- CdDiskDetectCD, // 0x02
- CdDiskDetectDVD, // 0x03
- CdDiskDetectUnk = 0x05,
- CdDiskCDPS1 = 0x10,
- CdDiskCDDAPS1 = 0x11,
- CdDiskCDPS2 = 0x12,
- CdDiskCDDAPS2 = 0x13,
- CdDiskDVDPS2 = 0x14,
- CdDiskDVDV2 = 0xFC,
- CdDiskCDDA = 0xFD,
- CdDiskDVDV = 0xFE,
- CdDiskIllegal = 0xFF
+ CdDiskNone = 0x00,
+ CdDiskDetect, // 0x01
+ CdDiskDetectCD, // 0x02
+ CdDiskDetectDVD, // 0x03
+ CdDiskDetectUnk = 0x05,
+ CdDiskCDPS1 = 0x10,
+ CdDiskCDDAPS1 = 0x11,
+ CdDiskCDPS2 = 0x12,
+ CdDiskCDDAPS2 = 0x13,
+ CdDiskDVDPS2 = 0x14,
+ CdDiskDVDV2 = 0xFC,
+ CdDiskCDDA = 0xFD,
+ CdDiskDVDV = 0xFE,
+ CdDiskIllegal = 0xFF
};
#define DISC_NOT_READY(type) ((type > CdDiskNone) && (type < CdDiskCDPS1) && (type != CdDiskDetectUnk))
diff --git a/backends/platform/ps2/iop/CoDyVDfs/iop/fiofs.c b/backends/platform/ps2/iop/CoDyVDfs/iop/fiofs.c
index f0a06f927b..611211a715 100644
--- a/backends/platform/ps2/iop/CoDyVDfs/iop/fiofs.c
+++ b/backends/platform/ps2/iop/CoDyVDfs/iop/fiofs.c
@@ -104,7 +104,7 @@ int cd_open(iop_file_t *handle, const char *name, int mode) {
fd->pos = 0;
fd->cachedLba = 0;
- handle->privdata = (void*)fdSlot;
+ handle->privdata = (void *)fdSlot;
return 0;
}
@@ -135,7 +135,7 @@ int cd_read(iop_file_t *handle, void *dest, int length) {
FioHandle *fd = fioHandles + (int)handle->privdata;
CdRMode rmode = { 16, 0, CdSect2048, 0 };
int readLba, readPos, bytesLeft;
- uint8 *destPos = (uint8*)dest;
+ uint8 *destPos = (uint8 *)dest;
int doCopy;
int numLba;
readLba = fd->lba + (fd->pos >> 11);
@@ -171,13 +171,13 @@ int cd_read(iop_file_t *handle, void *dest, int length) {
numLba = bytesLeft >> 11;
if (cdReadSectors(readLba, numLba, destPos, &rmode) != 0)
break;
- readLba += numLba;
+ readLba += numLba;
fd->pos += numLba << 11;
destPos += numLba << 11;
bytesLeft &= 0x7FF;
}
}
- return destPos - (uint8*)dest;
+ return destPos - (uint8 *)dest;
}
int cd_close(iop_file_t *handle) {
@@ -219,7 +219,7 @@ int cd_dopen(iop_file_t *handle, const char *path) {
}
dioHandles[fdSlot].curOfs = 0;
dioHandles[fdSlot].lbaOfs = 0;
- handle->privdata = (void*)fdSlot;
+ handle->privdata = (void *)fdSlot;
return fdSlot;
}
@@ -252,7 +252,7 @@ int cd_dread(iop_file_t *handle, iox_dirent_t *buf) {
}
}
}
- return 0;
+ return 0;
}
int cd_dclose(iop_file_t *handle) {
diff --git a/backends/platform/ps2/iop/CoDyVDfs/iop/fiofs.h b/backends/platform/ps2/iop/CoDyVDfs/iop/fiofs.h
index db942b0b7e..058594a126 100644
--- a/backends/platform/ps2/iop/CoDyVDfs/iop/fiofs.h
+++ b/backends/platform/ps2/iop/CoDyVDfs/iop/fiofs.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/ps2/iop/CoDyVDfs/iop/irx_imports.h b/backends/platform/ps2/iop/CoDyVDfs/iop/irx_imports.h
index 69bbc012f8..393a7ee9a5 100644
--- a/backends/platform/ps2/iop/CoDyVDfs/iop/irx_imports.h
+++ b/backends/platform/ps2/iop/CoDyVDfs/iop/irx_imports.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/ps2/iop/CoDyVDfs/iop/rpcfs.c b/backends/platform/ps2/iop/CoDyVDfs/iop/rpcfs.c
index 5b760faa06..983ae38716 100644
--- a/backends/platform/ps2/iop/CoDyVDfs/iop/rpcfs.c
+++ b/backends/platform/ps2/iop/CoDyVDfs/iop/rpcfs.c
@@ -69,11 +69,11 @@ void *rpcReadClock(void *data) {
void *driveStop(void *data) {
if (CdStop() == 1) {
if (CdSync(0) == 0) {
- *(int*)data = CdGetError();
+ *(int *)data = CdGetError();
} else
- *(int*)data = -0x100;
+ *(int *)data = -0x100;
} else
- *(int*)data = -0x101;
+ *(int *)data = -0x101;
return data;
}
@@ -81,11 +81,11 @@ void *driveStandby(void *data) {
int type;
if (CdStandby() == 1) {
if (CdSync(0) == 0) {
- *(int*)data = CdGetError();
+ *(int *)data = CdGetError();
} else
- *(int*)data = -0x100;
+ *(int *)data = -0x100;
} else
- *(int*)data = -0x101;
+ *(int *)data = -0x101;
do { // wait until drive detected disc type
type = CdGetDiskType();
diff --git a/backends/platform/ps2/iop/rpckbd/include/ps2kbd.h b/backends/platform/ps2/iop/rpckbd/include/ps2kbd.h
index 07d9c3d7f9..6bef7caefa 100644
--- a/backends/platform/ps2/iop/rpckbd/include/ps2kbd.h
+++ b/backends/platform/ps2/iop/rpckbd/include/ps2kbd.h
@@ -87,8 +87,8 @@ typedef struct _kbd_keymap
#define KBD_RPC_SETSPECIALMAP 7 /* Sets the special key mapping */
#define KBD_RPC_FLUSHBUFFER 9 /* Flush the internal buffer, probably best after a keymap change */
#define KBD_RPC_RESETKEYMAP 10 /* Reset keymaps to default states */
-#define KBD_RPC_READKEY 11
-#define KBD_RPC_READRAW 12
+#define KBD_RPC_READKEY 11
+#define KBD_RPC_READRAW 12
/* Note on keymaps. In normal keymap a 0 would indicate no key */
/* Key maps are represented by 3 256*8bit tables. First table maps USB key to a char when not shifted */
diff --git a/backends/platform/ps2/iop/rpckbd/src/irx_imports.h b/backends/platform/ps2/iop/rpckbd/src/irx_imports.h
index f7d0656bda..193db4f02a 100644
--- a/backends/platform/ps2/iop/rpckbd/src/irx_imports.h
+++ b/backends/platform/ps2/iop/rpckbd/src/irx_imports.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/ps2/iop/rpckbd/src/ps2kbd.c b/backends/platform/ps2/iop/rpckbd/src/ps2kbd.c
index 7266afdce5..838ce9fe85 100644
--- a/backends/platform/ps2/iop/rpckbd/src/ps2kbd.c
+++ b/backends/platform/ps2/iop/rpckbd/src/ps2kbd.c
@@ -1089,7 +1089,7 @@ void *ps2kbd_rpc_server(int fno, void *data, int size) {
ps2kbd_rpc_flushbuffer();
break;
case KBD_RPC_SETLEDS:
- ps2kbd_rpc_setleds(*(u8*) data);
+ ps2kbd_rpc_setleds(*(u8 *) data);
break;
case KBD_RPC_RESETKEYMAP:
ps2kbd_rpc_resetkeymap();
@@ -1129,7 +1129,7 @@ int ps2kbd_init_rpc(void) {
int th;
param.attr = 0x02000000;
- param.thread = (void*)ps2kbd_start_rpc;
+ param.thread = (void *)ps2kbd_start_rpc;
param.priority = 40;
param.stacksize = 0x800;
param.option = 0;
diff --git a/backends/platform/ps2/irxboot.cpp b/backends/platform/ps2/irxboot.cpp
index aa904d4f5b..0e05047c6e 100644
--- a/backends/platform/ps2/irxboot.cpp
+++ b/backends/platform/ps2/irxboot.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -34,37 +34,65 @@
static const char hddArg[] = "-o" "\0" "8" "\0" "-n" "\0" "20";
static const char pfsArg[] = "-m" "\0" "2" "\0" "-o" "\0" "32" "\0" "-n" "\0" "72"; // "\0" "-debug";
-static const char netArg[] = "192.168.0.10" "\0" "255.255.255.0" "\0" "192.168.0.1";
-
-IrxFile irxFiles[] = {
- { "SIO2MAN", BIOS, NOTHING, NULL, 0 },
- { "MCMAN", BIOS, NOTHING, NULL, 0 },
- { "MCSERV", BIOS, NOTHING, NULL, 0 },
- { "PADMAN", BIOS, NOTHING, NULL, 0 },
- { "LIBSD", BIOS, NOTHING, NULL, 0 },
-
- { "IOMANX.IRX", SYSTEM, NOTHING, NULL, 0 },
- { "FILEXIO.IRX", SYSTEM, NOTHING, NULL, 0 },
- { "CODYVDFS.IRX", SYSTEM, NOTHING, NULL, 0 },
+static const char netArg[] = "192.168.1.20" "\0" "255.255.255.0" "\0" "192.168.1.1"; // TODO: set in ScummVM.ini
+
+IrxFile irxCore[] = { // core modules
+ // Memory Card
+ { "SIO2MAN", BIOS, NOTHING, NULL, 0 },
+ { "MCMAN", BIOS, NOTHING, NULL, 0 },
+ { "MCSERV", BIOS, NOTHING, NULL, 0 },
+ // Joypad
+ { "PADMAN", BIOS, NOTHING, NULL, 0 },
+ // Sound
+ { "LIBSD", BIOS, NOTHING, NULL, 0 },
{ "SJPCM.IRX", SYSTEM, NOTHING, NULL, 0 },
+ // Files I/O
+ { "IOMANX.IRX", SYSTEM, NOTHING, NULL, 0 },
+ { "FILEXIO.IRX", SYSTEM, NOTHING, NULL, 0 }
+};
+
+IrxFile irxCdrom[] = { // cdrom modules
+ // CD-Rom FS
+ { "CODYVDFS.IRX", SYSTEM, CD_DRIVER, NULL, 0 }
+};
+IrxFile irxUSB[] = { // USB mass
+ // USB drv & key
{ "USBD.IRX", USB | OPTIONAL | DEPENDANCY, USB_DRIVER, NULL, 0 },
- { "USB_MASS.IRX", USB | OPTIONAL, MASS_DRIVER, NULL, 0 },
+ { "USB_MASS.IRX", USB | OPTIONAL, MASS_DRIVER, NULL, 0 }
+};
+
+IrxFile irxInput[] = { // USB input
+ // USB mouse & kbd
{ "PS2MOUSE.IRX", USB | OPTIONAL, MOUSE_DRIVER, NULL, 0 },
- { "RPCKBD.IRX", USB | OPTIONAL, KBD_DRIVER, NULL, 0 },
-#ifndef NO_ADAPTOR
+ { "RPCKBD.IRX", USB | OPTIONAL, KBD_DRIVER, NULL, 0 }
+};
+
+IrxFile irxHDD[] = { // modules to support HDD
+ // hdd modules
{ "POWEROFF.IRX", HDD | OPTIONAL | NOT_HOST | DEPENDANCY, HDD_DRIVER, NULL, 0 },
{ "PS2DEV9.IRX", HDD | OPTIONAL | NOT_HOST | DEPENDANCY, HDD_DRIVER, NULL, 0 },
{ "PS2ATAD.IRX", HDD | OPTIONAL | DEPENDANCY, HDD_DRIVER, NULL, 0 },
{ "PS2HDD.IRX", HDD | OPTIONAL | DEPENDANCY, HDD_DRIVER, hddArg, sizeof(hddArg) },
- { "PS2FS.IRX", HDD | OPTIONAL | DEPENDANCY, HDD_DRIVER, pfsArg, sizeof(pfsArg) },
+ { "PS2FS.IRX", HDD | OPTIONAL | DEPENDANCY, HDD_DRIVER, pfsArg, sizeof(pfsArg) }
+};
+
+IrxFile irxNet[] = { // modules to support NET
+ // net modules
{ "PS2IP.IRX", NET | OPTIONAL | NOT_HOST | DEPENDANCY, NET_DRIVER, NULL, 0 },
{ "PS2SMAP.IRX", NET | OPTIONAL | NOT_HOST | DEPENDANCY, NET_DRIVER, netArg, sizeof(netArg) },
{ "PS2HOST.IRX", NET | OPTIONAL | NOT_HOST | DEPENDANCY, NET_DRIVER, NULL, 0 }
-#endif
};
-static const int numIrxFiles = sizeof(irxFiles) / sizeof(irxFiles[0]);
+IrxFile *irxType[IRX_MAX] = { irxCore, irxCdrom, irxUSB, irxInput, irxHDD, irxNet };
+
+static const int numIrx[IRX_MAX] = { sizeof(irxCore) / sizeof(IrxFile),
+ sizeof(irxCdrom) / sizeof(IrxFile),
+ sizeof(irxUSB) / sizeof(IrxFile),
+ sizeof(irxInput) / sizeof(IrxFile),
+ sizeof(irxHDD) / sizeof(IrxFile),
+ sizeof(irxNet) / sizeof(IrxFile)
+};
PS2Device detectBootPath(const char *elfPath, char *bootPath) {
@@ -113,19 +141,26 @@ PS2Device detectBootPath(const char *elfPath, char *bootPath) {
return device;
}
-int loadIrxModules(int device, const char *irxPath, IrxReference **modules) {
+int loadIrxModules(int device, const char *irxPath, IrxReference **modules, IrxType type) {
+
+ IrxReference *resModules;
+ IrxReference *curModule;
+ IrxFile *irxFiles;
+ int numFiles;
- IrxReference *resModules = (IrxReference *)malloc(numIrxFiles * sizeof(IrxReference));
- IrxReference *curModule = resModules;
+ irxFiles = irxType[type];
+ numFiles = numIrx[type];
+ resModules = (IrxReference *)memalign(64, numFiles * sizeof(IrxReference));
+ curModule = resModules;
- for (int i = 0; i < numIrxFiles; i++) {
+ for (int i = 0; i < numFiles; i++) {
curModule->fileRef = irxFiles + i;
if ((device == HOST_DEV) && (irxFiles[i].flags & NOT_HOST))
continue;
if ((irxFiles[i].flags & TYPEMASK) == BIOS) {
curModule->loc = IRX_FILE;
- curModule->path = (char *)malloc(32);
+ curModule->path = (char *)memalign(64, 32);
sprintf(curModule->path, "rom0:%s", irxFiles[i].name);
curModule->buffer = NULL;
curModule->size = 0;
@@ -134,7 +169,7 @@ int loadIrxModules(int device, const char *irxPath, IrxReference **modules) {
curModule->errorCode = 0;
} else {
curModule->loc = IRX_BUFFER;
- curModule->path = (char *)malloc(256);
+ curModule->path = (char *)memalign(64, 256);
sprintf(curModule->path, "%s%s%s", irxPath, irxFiles[i].name, (device == CD_DEV) ? ";1" : "");
int fd = fioOpen(curModule->path, O_RDONLY);
@@ -191,7 +226,7 @@ int loadIrxModules(int device, const char *irxPath, IrxReference **modules) {
pos++;
}
// and skip any remaining modules that depend on the missing one, too.
- while ((i < numIrxFiles - 1) && ((irxFiles[i + 1].flags & TYPEMASK) == (curModule->fileRef->flags & TYPEMASK)))
+ while ((i < numFiles - 1) && ((irxFiles[i + 1].flags & TYPEMASK) == (curModule->fileRef->flags & TYPEMASK)))
i++;
// the module that actually failed (curModule) is kept in the array for displaying an error message
}
diff --git a/backends/platform/ps2/irxboot.h b/backends/platform/ps2/irxboot.h
index 81b47a37c6..487d335553 100644
--- a/backends/platform/ps2/irxboot.h
+++ b/backends/platform/ps2/irxboot.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -25,6 +25,16 @@
#include "common/scummsys.h"
+enum IrxType {
+ IRX_CORE = 0,
+ IRX_CDROM,
+ IRX_USB,
+ IRX_INPUT,
+ IRX_HDD,
+ IRX_NET,
+ IRX_MAX
+};
+
enum IrxFlags {
BIOS = 0,
SYSTEM = 1,
@@ -40,6 +50,7 @@ enum IrxFlags {
enum IrxPurpose {
NOTHING,
+ CD_DRIVER,
HDD_DRIVER,
USB_DRIVER,
MOUSE_DRIVER,
@@ -81,6 +92,6 @@ struct IrxReference {
int errorCode;
};
-int loadIrxModules(int device, const char *irxPath, IrxReference **modules);
+int loadIrxModules(int device, const char *irxPath, IrxReference **modules, IrxType type);
#endif // __IRXBOOT_H__
diff --git a/backends/platform/ps2/module.mk b/backends/platform/ps2/module.mk
index bf95a5501d..7bcc60e58d 100644
--- a/backends/platform/ps2/module.mk
+++ b/backends/platform/ps2/module.mk
@@ -2,20 +2,20 @@ MODULE := backends/platform/ps2
MODULE_OBJS := \
DmaPipe.o \
- Gs2dScreen.o \
- irxboot.o \
+ Gs2dScreen.o \
+ irxboot.o \
ps2input.o \
ps2pad.o \
savefilemgr.o \
- fileio.o \
- asyncfio.o \
+ fileio.o \
+ asyncfio.o \
icon.o \
- cd.o \
- eecodyvdfs.o \
- rpckbd.o \
- systemps2.o \
- ps2mutex.o \
- ps2time.o \
+ cd.o \
+ eecodyvdfs.o \
+ rpckbd.o \
+ systemps2.o \
+ ps2mutex.o \
+ ps2time.o \
ps2debug.o
# We don't use rules.mk but rather manually update OBJS and MODULE_DIRS.
diff --git a/backends/platform/ps2/ps2debug.cpp b/backends/platform/ps2/ps2debug.cpp
index 300e18316f..84c3649faf 100644
--- a/backends/platform/ps2/ps2debug.cpp
+++ b/backends/platform/ps2/ps2debug.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -22,10 +22,10 @@
#include "ps2debug.h"
#include <stdio.h>
-#include <stdlib.h>
#include <sio.h>
void sioprintf(const char *zFormat, ...) {
+ #if 0 // doesn't seem to work with ps2link...
va_list ap;
char resStr[2048];
@@ -43,4 +43,5 @@ void sioprintf(const char *zFormat, ...) {
sio_putc(*pos);
pos++;
}
+ #endif
}
diff --git a/backends/platform/ps2/ps2debug.h b/backends/platform/ps2/ps2debug.h
index 02831e0623..45db850ebf 100644
--- a/backends/platform/ps2/ps2debug.h
+++ b/backends/platform/ps2/ps2debug.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -23,7 +23,13 @@
#ifndef __PS2DEBUG_H__
#define __PS2DEBUG_H__
-#define dbg_printf printf
+#ifdef LOGORRHEIC
+ #define FORBIDDEN_SYMBOL_EXCEPTION_printf
+ // #define dbg_printf sio_printf
+ #define dbg_printf printf
+#else
+ #define dbg_printf(...) /* ... */
+#endif
void sioprintf(const char *zFormat, ...);
diff --git a/backends/platform/ps2/ps2input.cpp b/backends/platform/ps2/ps2input.cpp
index 6f36c5ff90..636176e06c 100644
--- a/backends/platform/ps2/ps2input.cpp
+++ b/backends/platform/ps2/ps2input.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -170,7 +170,7 @@ bool Ps2Input::pollEvent(Common::Event *event) {
}
if (checkPadMouse || checkPadKbd) {
// no usb mouse, simulate it using the pad
- uint16 buttons;
+ uint16 buttons;
int16 joyh, joyv;
_pad->readPad(&buttons, &joyh, &joyv);
uint16 btnChange = buttons ^ _padLastButtons;
@@ -474,11 +474,11 @@ const Common::KeyCode Ps2Input::_usbToSdlk[0x100] = {
/* DD */ Common::KEYCODE_INVALID,
/* DE */ Common::KEYCODE_INVALID,
/* DF */ Common::KEYCODE_INVALID,
- /* E0 */ Common::KEYCODE_LCTRL,
+ /* E0 */ Common::KEYCODE_LCTRL,
/* E1 */ Common::KEYCODE_LSHIFT,
/* E2 */ Common::KEYCODE_LALT,
/* E3 */ Common::KEYCODE_INVALID,
- /* E4 */ Common::KEYCODE_RCTRL,
+ /* E4 */ Common::KEYCODE_RCTRL,
/* E5 */ Common::KEYCODE_RSHIFT,
/* E6 */ Common::KEYCODE_RALT,
/* E7 */ Common::KEYCODE_INVALID,
@@ -509,39 +509,39 @@ const Common::KeyCode Ps2Input::_usbToSdlk[0x100] = {
};
const Common::KeyCode Ps2Input::_padCodes[16] = {
- Common::KEYCODE_1, // Select
- Common::KEYCODE_INVALID, // L3
- Common::KEYCODE_INVALID, // R3
- Common::KEYCODE_F5, // Start
- Common::KEYCODE_INVALID, // Up
- Common::KEYCODE_INVALID, // Right
- Common::KEYCODE_INVALID, // Down
- Common::KEYCODE_INVALID, // Left
- Common::KEYCODE_KP0, // L2
- Common::KEYCODE_PERIOD, // R2
- Common::KEYCODE_n, // L1
- Common::KEYCODE_y, // R1
- Common::KEYCODE_ESCAPE, // Triangle
- Common::KEYCODE_INVALID, // Circle => Right mouse button
- Common::KEYCODE_INVALID, // Cross => Left mouse button
- Common::KEYCODE_RETURN // Square
+ Common::KEYCODE_1, // Select
+ Common::KEYCODE_INVALID, // L3
+ Common::KEYCODE_INVALID, // R3
+ Common::KEYCODE_F5, // Start
+ Common::KEYCODE_INVALID, // Up
+ Common::KEYCODE_INVALID, // Right
+ Common::KEYCODE_INVALID, // Down
+ Common::KEYCODE_INVALID, // Left
+ Common::KEYCODE_KP0, // L2
+ Common::KEYCODE_PERIOD, // R2
+ Common::KEYCODE_n, // L1
+ Common::KEYCODE_y, // R1
+ Common::KEYCODE_ESCAPE, // Triangle
+ Common::KEYCODE_INVALID, // Circle => Right mouse button
+ Common::KEYCODE_INVALID, // Cross => Left mouse button
+ Common::KEYCODE_RETURN // Square
};
const Common::KeyCode Ps2Input::_padFlags[16] = {
- Common::KEYCODE_INVALID, // Select
- Common::KEYCODE_INVALID, // L3
- Common::KEYCODE_INVALID, // R3
- Common::KEYCODE_INVALID, // Start
- Common::KEYCODE_INVALID, // Up
- Common::KEYCODE_INVALID, // Right
- Common::KEYCODE_INVALID, // Down
- Common::KEYCODE_INVALID, // Left
- Common::KEYCODE_INVALID, // L2
- Common::KEYCODE_INVALID, // R2
- Common::KEYCODE_INVALID, // L1
- Common::KEYCODE_INVALID, // R1
- Common::KEYCODE_INVALID, // Triangle
- Common::KEYCODE_INVALID, // Circle
- Common::KEYCODE_INVALID, // Cross
- Common::KEYCODE_INVALID // Square
+ Common::KEYCODE_INVALID, // Select
+ Common::KEYCODE_INVALID, // L3
+ Common::KEYCODE_INVALID, // R3
+ Common::KEYCODE_INVALID, // Start
+ Common::KEYCODE_INVALID, // Up
+ Common::KEYCODE_INVALID, // Right
+ Common::KEYCODE_INVALID, // Down
+ Common::KEYCODE_INVALID, // Left
+ Common::KEYCODE_INVALID, // L2
+ Common::KEYCODE_INVALID, // R2
+ Common::KEYCODE_INVALID, // L1
+ Common::KEYCODE_INVALID, // R1
+ Common::KEYCODE_INVALID, // Triangle
+ Common::KEYCODE_INVALID, // Circle
+ Common::KEYCODE_INVALID, // Cross
+ Common::KEYCODE_INVALID // Square
};
diff --git a/backends/platform/ps2/ps2input.h b/backends/platform/ps2/ps2input.h
index b97daac042..af413d262c 100644
--- a/backends/platform/ps2/ps2input.h
+++ b/backends/platform/ps2/ps2input.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -44,7 +44,7 @@ private:
int mapKey(int key, int mod);
bool getKeyEvent(Common::Event *event, uint16 buttonCode, bool down);
OSystem_PS2 *_system;
- Ps2Pad *_pad;
+ Ps2Pad *_pad;
uint16 _minx, _maxx, _miny, _maxy;
diff --git a/backends/platform/ps2/ps2mutex.cpp b/backends/platform/ps2/ps2mutex.cpp
index ae63fe5724..440a7e2cce 100644
--- a/backends/platform/ps2/ps2mutex.cpp
+++ b/backends/platform/ps2/ps2mutex.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/ps2/ps2pad.cpp b/backends/platform/ps2/ps2pad.cpp
index 607b614691..d990690331 100644
--- a/backends/platform/ps2/ps2pad.cpp
+++ b/backends/platform/ps2/ps2pad.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -34,7 +34,7 @@ Ps2Pad::Ps2Pad(OSystem_PS2 *system) {
_padStatus = STAT_NONE;
padInit(0); // initialize library
- _port = _slot = 0; // first controller, no multitap
+ _port = _slot = 0; // first controller, no multitap
initPad();
}
@@ -51,9 +51,6 @@ void Ps2Pad::initPad(void) {
} else {
if (checkPadReady(_port, _slot)) {
switch (_padStatus) {
- case STAT_NONE:
- printf("Pad Status is None. Shouldn't happen\n");
- break;
case STAT_OPEN:
_padStatus = STAT_DETECT;
break;
@@ -104,7 +101,8 @@ void Ps2Pad::initPad(void) {
_padStatus = STAT_OKAY;
break;
case STAT_OKAY:
- // pad is already initialized
+ case STAT_NONE:
+ // pad is already initialized (or not there)
break;
}
} else {
diff --git a/backends/platform/ps2/ps2pad.h b/backends/platform/ps2/ps2pad.h
index aebb3c6339..0457cd46bb 100644
--- a/backends/platform/ps2/ps2pad.h
+++ b/backends/platform/ps2/ps2pad.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/ps2/ps2temp.h b/backends/platform/ps2/ps2temp.h
index afffc6de2b..acfd3c7800 100644
--- a/backends/platform/ps2/ps2temp.h
+++ b/backends/platform/ps2/ps2temp.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/ps2/ps2time.cpp b/backends/platform/ps2/ps2time.cpp
index 1cddd230a0..e072ce9483 100644
--- a/backends/platform/ps2/ps2time.cpp
+++ b/backends/platform/ps2/ps2time.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -30,9 +30,9 @@
#define FROM_BCD(a) ((a >> 4) * 10 + (a & 0xF))
-static int g_timeSecs;
-static int g_day, g_month, g_year;
-static int g_lastTimeCheck;
+static int g_timeSecs;
+static int g_day, g_month, g_year;
+static int g_lastTimeCheck;
extern volatile uint32 msecCount;
void buildNewDate(int dayDiff) {
diff --git a/backends/platform/ps2/rpckbd.c b/backends/platform/ps2/rpckbd.c
index 0bb45208f5..e7975ab484 100644
--- a/backends/platform/ps2/rpckbd.c
+++ b/backends/platform/ps2/rpckbd.c
@@ -17,7 +17,7 @@
#include <string.h>
#include "backends/platform/ps2/rpckbd.h"
-static int curr_readmode = PS2KBD_READMODE_NORMAL;
+static unsigned int curr_readmode = PS2KBD_READMODE_NORMAL;
static int kbdRpcSema = -1;
static int kbdInitialized = 0;
diff --git a/backends/platform/ps2/rpckbd.h b/backends/platform/ps2/rpckbd.h
index bffd8e5be5..22cbbb4d21 100644
--- a/backends/platform/ps2/rpckbd.h
+++ b/backends/platform/ps2/rpckbd.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/ps2/savefilemgr.cpp b/backends/platform/ps2/savefilemgr.cpp
index 46af42e193..4fd2b1c72b 100644
--- a/backends/platform/ps2/savefilemgr.cpp
+++ b/backends/platform/ps2/savefilemgr.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -21,8 +21,6 @@
*/
#define FORBIDDEN_SYMBOL_EXCEPTION_printf
-#define FORBIDDEN_SYMBOL_EXCEPTION_mkdir
-#define FORBIDDEN_SYMBOL_EXCEPTION_unistd_h
#include "common/config-manager.h"
#include "common/zlib.h"
@@ -37,6 +35,7 @@
#include "savefilemgr.h"
#include "Gs2dScreen.h"
#include "ps2temp.h"
+#include "ps2debug.h"
extern AsyncFio fio;
@@ -57,20 +56,20 @@ bool Ps2SaveFileManager::mcCheck(const char *path) {
// int res;
- printf("mcCheck\n");
+ dbg_printf("mcCheck\n");
if (!dir.exists()) {
- printf("! exist -> create : ");
+ dbg_printf("! exist -> create : ");
#ifdef __USE_LIBMC__
- printf("%s\n", path+4);
+ dbg_printf("%s\n", path+4);
// WaitSema(_sema);
mcSync(0, NULL, NULL);
mcMkDir(0 /*port*/, 0 /*slot*/, path+4);
mcSync(0, NULL, &res);
- printf("sync : %d\n", res);
+ dbg_printf("sync : %d\n", res);
// SignalSema(_sema);
#else
- printf("%s\n", path);
+ dbg_printf("%s\n", path);
fio.mkdir(path);
#endif
}
@@ -108,7 +107,7 @@ Common::InSaveFile *Ps2SaveFileManager::openForLoading(const Common::String &fil
}
else {
char temp[32];
- printf("MC : filename = %s\n", filename.c_str());
+ dbg_printf("MC : filename = %s\n", filename.c_str());
strcpy(temp, filename.c_str());
// mcSplit(temp, game, ext);
@@ -149,7 +148,7 @@ Common::OutSaveFile *Ps2SaveFileManager::openForSaving(const Common::String &fil
Common::FSNode savePath(ConfMan.get("savepath")); // TODO: is this fast?
Common::WriteStream *sf;
- printf("openForSaving : %s\n", filename.c_str());
+ dbg_printf("openForSaving : %s\n", filename.c_str());
if (!savePath.exists() || !savePath.isDirectory())
return NULL;
@@ -166,10 +165,10 @@ Common::OutSaveFile *Ps2SaveFileManager::openForSaving(const Common::String &fil
sprintf(path, "mc0:ScummVM/indy4/iq-points");
}
// FIXME : hack for bs1 saved games
- else if (filename == "SAVEGAME.INF") {
- mcCheck("mc0:ScummVM/sword1");
- sprintf(path, "mc0:ScummVM/sword1/SAVEGAME.INF");
- }
+ else if (filename == "SAVEGAME.INF") {
+ mcCheck("mc0:ScummVM/sword1");
+ sprintf(path, "mc0:ScummVM/sword1/SAVEGAME.INF");
+ }
else {
char temp[32];
strcpy(temp, filename.c_str());
@@ -240,7 +239,7 @@ Common::StringArray Ps2SaveFileManager::listSavefiles(const Common::String &patt
if (!savePath.exists() || !savePath.isDirectory())
return Common::StringArray();
- printf("listSavefiles = %s\n", pattern.c_str());
+ dbg_printf("listSavefiles = %s\n", pattern.c_str());
if (_mc) {
strcpy(temp, pattern.c_str());
@@ -263,7 +262,7 @@ Common::StringArray Ps2SaveFileManager::listSavefiles(const Common::String &patt
Common::ArchiveMemberList savefiles;
Common::StringArray results;
- printf("dir = %s --- reg = %s\n", _dir.c_str(), search.c_str());
+ dbg_printf("dir = %s --- reg = %s\n", _dir.c_str(), search.c_str());
if (dir.listMatchingMembers(savefiles, search) > 0) {
for (Common::ArchiveMemberList::const_iterator file = savefiles.begin(); file != savefiles.end(); ++file) {
@@ -272,11 +271,11 @@ Common::StringArray Ps2SaveFileManager::listSavefiles(const Common::String &patt
temp[3] = '\0';
sprintf(path, "%s.%s", game, temp);
results.push_back(path);
- printf(" --> found = %s -> %s\n", (*file)->getName().c_str(), path);
+ dbg_printf(" --> found = %s -> %s\n", (*file)->getName().c_str(), path);
}
else {
results.push_back((*file)->getName());
- printf(" --> found = %s\n", (*file)->getName().c_str());
+ dbg_printf(" --> found = %s\n", (*file)->getName().c_str());
}
}
}
diff --git a/backends/platform/ps2/savefilemgr.h b/backends/platform/ps2/savefilemgr.h
index 163706eace..547f16fa77 100644
--- a/backends/platform/ps2/savefilemgr.h
+++ b/backends/platform/ps2/savefilemgr.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/ps2/sysdefs.h b/backends/platform/ps2/sysdefs.h
index 0114402233..c886d70eef 100644
--- a/backends/platform/ps2/sysdefs.h
+++ b/backends/platform/ps2/sysdefs.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -40,30 +40,30 @@ enum Interrupts {
};
// dma 2 registers
-#define D2_CHCR (*(volatile uint32*)0x1000A000)
-#define D2_QWC (*(volatile uint32*)0x1000A020)
-#define D2_TADR (*(volatile uint32*)0x1000A030)
-#define D2_MADR (*(volatile uint32*)0x1000A010)
-#define D2_ASR1 (*(volatile uint32*)0x1000A050)
-#define D2_ASR0 (*(volatile uint32*)0x1000A040)
+#define D2_CHCR (*(volatile uint32 *)0x1000A000)
+#define D2_QWC (*(volatile uint32 *)0x1000A020)
+#define D2_TADR (*(volatile uint32 *)0x1000A030)
+#define D2_MADR (*(volatile uint32 *)0x1000A010)
+#define D2_ASR1 (*(volatile uint32 *)0x1000A050)
+#define D2_ASR0 (*(volatile uint32 *)0x1000A040)
-#define D_CTRL (*(volatile uint32*)0x1000E000)
-#define D_STAT (*(volatile uint32*)0x1000E010)
-#define D_PCR (*(volatile uint32*)0x1000E020)
-#define D_SQWC (*(volatile uint32*)0x1000E030)
-#define D_RBSR (*(volatile uint32*)0x1000E040)
-#define D_RBOR (*(volatile uint32*)0x1000E050)
-#define D_STADR (*(volatile uint32*)0x1000E060)
+#define D_CTRL (*(volatile uint32 *)0x1000E000)
+#define D_STAT (*(volatile uint32 *)0x1000E010)
+#define D_PCR (*(volatile uint32 *)0x1000E020)
+#define D_SQWC (*(volatile uint32 *)0x1000E030)
+#define D_RBSR (*(volatile uint32 *)0x1000E040)
+#define D_RBOR (*(volatile uint32 *)0x1000E050)
+#define D_STADR (*(volatile uint32 *)0x1000E060)
#define CIM2 (1 << 18)
#define CIS2 (1 << 2)
// timer 0 registers
-#define T0_COUNT (*(volatile uint32*)0x10000000)
-#define T0_MODE (*(volatile uint32*)0x10000010)
-#define T0_COMP (*(volatile uint32*)0x10000020)
-#define T0_HOLD (*(volatile uint32*)0x10000030)
+#define T0_COUNT (*(volatile uint32 *)0x10000000)
+#define T0_MODE (*(volatile uint32 *)0x10000010)
+#define T0_COMP (*(volatile uint32 *)0x10000020)
+#define T0_HOLD (*(volatile uint32 *)0x10000030)
#define TIMER_MODE(clks, gate, gates, gatem, zeroret, cue, cmpe, ovfe, equf, ovff) \
((clks) | ((gate) << 2) | ((gates) << 3) | ((gatem) << 4) | ((zeroret) << 6) | \
diff --git a/backends/platform/ps2/systemps2.cpp b/backends/platform/ps2/systemps2.cpp
index a7d782b07c..1aa74b7d9b 100644
--- a/backends/platform/ps2/systemps2.cpp
+++ b/backends/platform/ps2/systemps2.cpp
@@ -8,20 +8,21 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
-// Disable symbol overrides so that we can use system headers.
-#define FORBIDDEN_SYMBOL_ALLOW_ALL
+// Disable symbol overrides so that we can use "FILE"
+#define FORBIDDEN_SYMBOL_EXCEPTION_FILE
+#define FORBIDDEN_SYMBOL_EXCEPTION_printf
#include <kernel.h>
#include <stdio.h>
@@ -50,7 +51,6 @@
#include "backends/platform/ps2/cd.h"
#include "backends/platform/ps2/fileio.h"
#include "backends/platform/ps2/Gs2dScreen.h"
-#include "backends/platform/ps2/irxboot.h"
#include "backends/platform/ps2/ps2debug.h"
#include "backends/platform/ps2/ps2input.h"
#include "backends/platform/ps2/savefilemgr.h"
@@ -112,7 +112,11 @@ extern "C" int scummvm_main(int argc, char *argv[]);
extern "C" int main(int argc, char *argv[]) {
SifInitRpc(0);
+ #ifdef __NEW_PS2SDK__
+ ee_thread_status_t thisThread;
+ #else
ee_thread_t thisThread;
+ #endif
int tid = GetThreadId();
ReferThreadStatus(tid, &thisThread);
@@ -147,6 +151,10 @@ extern "C" int main(int argc, char *argv[]) {
g_systemPs2->quit();
+#ifdef ENABLE_PROFILING
+ // make sure we can flush "gmon.out"
+ fileXioSetBlockMode(FXIO_WAIT);
+#endif
// control never gets here
return res;
}
@@ -184,13 +192,11 @@ void systemSoundThread(OSystem_PS2 *system) {
}
void gluePowerOffCallback(void *system) {
- ((OSystem_PS2*)system)->powerOffCallback();
+ ((OSystem_PS2 *)system)->powerOffCallback();
}
void OSystem_PS2::startIrxModules(int numModules, IrxReference *modules) {
- _usbMassLoaded = _useMouse = _useKbd = _useHdd = _useNet = false;
-
int res = 0, rv = 0;
for (int i = 0; i < numModules; i++) {
if (modules[i].loc == IRX_FILE) {
@@ -216,6 +222,9 @@ void OSystem_PS2::startIrxModules(int numModules, IrxReference *modules) {
case KBD_DRIVER:
_useKbd = true;
break;
+ case CD_DRIVER:
+ _useCd = true;
+ break;
case HDD_DRIVER:
_useHdd = true;
break;
@@ -241,20 +250,79 @@ void OSystem_PS2::startIrxModules(int numModules, IrxReference *modules) {
}
if (modules[i].buffer)
- free(modules[i].buffer);
+ ; // free(modules[i].buffer);
} else {
sioprintf("module %d of %d damaged, loc %d, path %s\n", i, numModules, modules[i].loc, modules[i].path);
}
- free(modules[i].path);
+ // free(modules[i].path);
}
- free(modules);
+ // free(modules);
sioprintf("done\n");
sioprintf("UsbMass: %sloaded\n", _usbMassLoaded ? "" : "not ");
sioprintf("Mouse: %sloaded\n", _useMouse ? "" : "not ");
sioprintf("Kbd: %sloaded\n", _useKbd ? "" : "not ");
+ sioprintf("Cd: %sloaded\n", _useCd ? "" : "not ");
sioprintf("Hdd: %sloaded\n", _useHdd ? "" : "not ");
}
+bool OSystem_PS2::loadDrivers(IrxType type)
+{
+ IrxReference *modules;
+ int numModules;
+ int res;
+
+ numModules = loadIrxModules(_bootDevice, _bootPath, &modules, type);
+ // TODO: for IRX_NET allows override IP addr
+ startIrxModules(numModules, modules);
+
+ switch (type) {
+ case IRX_CORE:
+ /* Init I/O */
+ if ((res = fileXioInit()) < 0) {
+ msgPrintf(FOREVER, "FXIO init failed: %d", res);
+ quit();
+ }
+ /* Init sound */
+ if ((res = SjPCM_Init(0)) < 0) {
+ msgPrintf(FOREVER, "SjPCM bind failed: %d\n", res);
+ quit();
+ }
+ break;
+
+ case IRX_CDROM:
+ /* Init CDROM & RTC Clock */
+ if ((res = initCdvdFs()) < 0) {
+ msgPrintf(FOREVER, "CoDyVDfs bind failed: %d", res);
+ quit();
+ }
+ sioprintf("Reading RTC\n");
+ readRtcTime(); /* depends on CDROM driver! */
+ break;
+
+ case IRX_HDD:
+ /* Check HD is available and formatted */
+ if ((hddCheckPresent() < 0) || (hddCheckFormatted() < 0)) {
+ _useHdd = false;
+ }
+ else {
+ poweroffInit();
+ poweroffSetCallback(gluePowerOffCallback, this);
+ }
+ break;
+
+ case IRX_NET:
+ if (_bootDevice == HOST_DEV) // net is pre-loaded on host
+ _useNet = true; // so we need to set by hand
+ break;
+
+ default:
+ /* zzz */
+ break;
+ }
+
+ return true;
+}
+
OSystem_PS2::OSystem_PS2(const char *elfPath) {
_soundStack = _timerStack = NULL;
_printY = 0;
@@ -262,20 +330,19 @@ OSystem_PS2::OSystem_PS2(const char *elfPath) {
_systemQuit = false;
_modeChanged = false;
_screenChangeCount = 0;
+ _mouseVisible = false;
- _screen = new Gs2dScreen(320, 200, TV_DONT_CARE);
+ // _screen = new Gs2dScreen(320, 200, TV_DONT_CARE); // moved to ::initSize
sioprintf("Initializing system...\n");
- _screen->wantAnim(true);
+ // _screen->wantAnim(true);
- _bootPath = (char *)malloc(128);
+ _bootPath = (char *)memalign(64, 128);
_bootDevice = detectBootPath(elfPath, _bootPath);
- IrxReference *modules;
- int numModules = loadIrxModules(_bootDevice, _bootPath, &modules);
-
if (_bootDevice != HOST_DEV) {
+ // TODO: reset funx
sioprintf("Resetting IOP.\n");
cdvdInit(CDVD_EXIT);
cdvdExit();
@@ -298,50 +365,12 @@ OSystem_PS2::OSystem_PS2(const char *elfPath) {
// TODO: ps2link 1.46 will stall on "poweroff" init / cb
}
- startIrxModules(numModules, modules);
-
- int res;
- if ((res = fileXioInit()) < 0) {
- msgPrintf(FOREVER, "FXIO Init failed: %d", res);
- quit();
- }
-
- if ((res = initCdvdFs()) < 0) {
- msgPrintf(FOREVER, "CoDyVDfs bind failed: %d", res);
- quit();
- }
-
- if ((res = SjPCM_Init(0)) < 0) {
- msgPrintf(FOREVER, "SjPCM Bind failed: %d\n", res);
- quit();
- }
-
- if (_useHdd) {
- if ((hddCheckPresent() < 0) || (hddCheckFormatted() < 0))
- _useHdd = false;
-
- //hddPreparePoweroff();
- poweroffInit();
+ _usbMassLoaded = _useMouse = _useKbd = _useCd = _useHdd = _useNet = false;
- //hddSetUserPoweroffCallback(gluePowerOffCallback, this);
- poweroffSetCallback(gluePowerOffCallback, this);
- }
+ loadDrivers(IRX_CORE);
+ loadDrivers(IRX_CDROM); // consider CDROM as "core", as RTC depends on it
fileXioSetBlockMode(FXIO_NOWAIT);
-
- _mouseVisible = false;
-
- sioprintf("reading RTC\n");
- readRtcTime();
-
- if (_useHdd) {
- // TODO : make partition path configurable
- if (fio.mount("pfs0:", "hdd0:+ScummVM", 0) >= 0)
- printf("Successfully mounted!\n");
- else
- _useHdd = false;
- }
-
initMutexes();
}
@@ -356,14 +385,67 @@ void OSystem_PS2::init(void) {
sioprintf("Starting SavefileManager\n");
_savefileManager = new Ps2SaveFileManager(this, _screen);
- sioprintf("Initializing ps2Input\n");
- _input = new Ps2Input(this, _useMouse, _useKbd);
-
prepMC();
makeConfigPath();
- _screen->wantAnim(false);
- fillScreen(0);
+ // _screen->wantAnim(false);
+ // fillScreen(0);
+}
+
+void OSystem_PS2::config(void) {
+ #ifndef NO_ADAPTOR
+ if (ConfMan.hasKey("hdd_part", "PlayStation2")) { // "hdd" ?
+ const char *hdd = ConfMan.get("hdd_part", "PlayStation2").c_str();
+
+ if ( !strcmp(hdd, "0") || !strcmp(hdd, "no") || !strcmp(hdd, "disable") ) {
+ _useHdd = false;
+ }
+ else {
+ loadDrivers(IRX_HDD);
+ hddMount(hdd);
+ }
+ }
+ else { // check for HDD and assume partition is +ScummVM
+ loadDrivers(IRX_HDD);
+ hddMount("ScummVM");
+ }
+
+ if (ConfMan.hasKey("net_addr", "PlayStation2")) { // "net" ?
+ const char *net = ConfMan.get("net_addr", "PlayStation2").c_str();
+
+ if ( !strcmp(net, "0") || !strcmp(net, "no") || !strcmp(net, "disable") ) {
+ _useNet = false;
+ }
+ else {
+ loadDrivers(IRX_NET);
+ // TODO: netInit("xxx.xxx.xxx.xxx");
+ }
+ }
+ else { // setup net - IP hardcoded 192.168.1.20
+ loadDrivers(IRX_NET);
+ }
+ #endif
+
+ // why USB drivers only load correctly post HDD ?
+ if (ConfMan.hasKey("usb_mass", "PlayStation2")) { // "usb" ?
+ const char *usb = ConfMan.get("usb_mass", "PlayStation2").c_str();
+
+ if ( !strcmp(usb, "0") || !strcmp(usb, "no") || !strcmp(usb, "disable") ) {
+ _usbMassLoaded = false;
+ }
+ else {
+ loadDrivers(IRX_USB);
+ loadDrivers(IRX_INPUT);
+ sioprintf("Initializing ps2Input\n");
+ _input = new Ps2Input(this, _useMouse, _useKbd);
+ }
+ }
+ else { // load USB drivers (mass & input(
+ loadDrivers(IRX_USB);
+ loadDrivers(IRX_INPUT);
+ sioprintf("Initializing ps2Input\n");
+ _input = new Ps2Input(this, _useMouse, _useKbd);
+ }
}
OSystem_PS2::~OSystem_PS2(void) {
@@ -380,26 +462,40 @@ void OSystem_PS2::initTimer(void) {
g_TimerThreadSema = CreateSema(&threadSema);
g_SoundThreadSema = CreateSema(&threadSema);
assert((g_TimerThreadSema >= 0) && (g_SoundThreadSema >= 0));
-
+ #ifdef __NEW_PS2SDK__
+ ee_thread_t timerThread, soundThread;
+ ee_thread_status_t thisThread;
+ #else
ee_thread_t timerThread, soundThread, thisThread;
+ #endif
ReferThreadStatus(GetThreadId(), &thisThread);
- _timerStack = (uint8 *)malloc(TIMER_STACK_SIZE);
- _soundStack = (uint8 *)malloc(SOUND_STACK_SIZE);
+ _timerStack = (uint8 *)memalign(64, TIMER_STACK_SIZE);
+ _soundStack = (uint8 *)memalign(64, SOUND_STACK_SIZE);
+ // gprof doesn't cope with higher thread priority too well
+ #ifdef ENABLE_PROFILING
+ timerThread.initial_priority = thisThread.current_priority;
+ #else
// give timer thread a higher priority than main thread
timerThread.initial_priority = thisThread.current_priority - 1;
+ #endif
timerThread.stack = _timerStack;
timerThread.stack_size = TIMER_STACK_SIZE;
timerThread.func = (void *)systemTimerThread;
- timerThread.gp_reg = &_gp;
+ timerThread.gp_reg = &_gp;
+ // gprof doesn't cope with higher thread priority too well
+ #ifdef ENABLE_PROFILING
+ soundThread.initial_priority = thisThread.current_priority;
+ #else
// soundthread's priority is higher than main- and timerthread
soundThread.initial_priority = thisThread.current_priority - 2;
+ #endif
soundThread.stack = _soundStack;
soundThread.stack_size = SOUND_STACK_SIZE;
soundThread.func = (void *)systemSoundThread;
- soundThread.gp_reg = &_gp;
+ soundThread.gp_reg = &_gp;
_timerTid = CreateThread(&timerThread);
_soundTid = CreateThread(&soundThread);
@@ -459,39 +555,39 @@ void OSystem_PS2::soundThreadCallback(void) {
// demux data into 2 buffers, L and R
__asm__ (
- "move $t2, %1\n\t" // dest buffer right
- "move $t3, %0\n\t" // dest buffer left
- "lui $t8, 0x7000\n\t" // muxed buffer, fixed at 0x70000000
- "addiu $t9, $0, 100\n\t" // number of loops
- "mtsab $0, 2\n\t" // set qword shift = 2 byte
+ "move $t2, %1\n\t" // dest buffer right
+ "move $t3, %0\n\t" // dest buffer left
+ "lui $t8, 0x7000\n\t" // muxed buffer, fixed at 0x70000000
+ "addiu $t9, $0, 100\n\t" // number of loops
+ "mtsab $0, 2\n\t" // set qword shift = 2 byte
"loop:\n\t"
- " lq $t4, 0($t8)\n\t" // load 8 muxed samples
- " lq $t5, 16($t8)\n\t" // load 8 more muxed samples
+ " lq $t4, 0($t8)\n\t" // load 8 muxed samples
+ " lq $t5, 16($t8)\n\t" // load 8 more muxed samples
- " qfsrv $t6, $0, $t4\n\t" // shift right for second
- " qfsrv $t7, $0, $t5\n\t" // packing step (right channel)
+ " qfsrv $t6, $0, $t4\n\t" // shift right for second
+ " qfsrv $t7, $0, $t5\n\t" // packing step (right channel)
- " ppach $t4, $t5, $t4\n\t" // combine left channel data
- " ppach $t6, $t7, $t6\n\t" // right channel data
+ " ppach $t4, $t5, $t4\n\t" // combine left channel data
+ " ppach $t6, $t7, $t6\n\t" // right channel data
- " sq $t4, 0($t3)\n\t" // write back
- " sq $t6, 0($t2)\n\t" //
+ " sq $t4, 0($t3)\n\t" // write back
+ " sq $t6, 0($t2)\n\t" //
- " addiu $t9, -1\n\t" // decrement loop counter
- " addiu $t2, 16\n\t" // increment pointers
+ " addiu $t9, -1\n\t" // decrement loop counter
+ " addiu $t2, 16\n\t" // increment pointers
" addiu $t3, 16\n\t"
" addiu $t8, 32\n\t"
- " bnez $t9, loop\n\t" // loop
+ " bnez $t9, loop\n\t" // loop
: // outputs
: "r"(soundBufL), "r"(soundBufR) // inputs
- // : "$t2", "$t3", "$t4", "$t5", "$t6", "$t7", "$t8", "$t9" // destroyed
+ // : "$t2", "$t3", "$t4", "$t5", "$t6", "$t7", "$t8", "$t9" // destroyed
: "$10", "$11", "$12", "$13", "$14", "$15", "$24", "$25" // destroyed
);
// and feed it into the SPU
// non-blocking call, the function will return before the buffer's content
// was transferred.
- SjPCM_Enqueue((short int*)soundBufL, (short int*)soundBufR, SMP_PER_BLOCK, 0);
+ SjPCM_Enqueue((short int *)soundBufL, (short int *)soundBufR, SMP_PER_BLOCK, 0);
bufferedSamples += SMP_PER_BLOCK;
}
}
@@ -510,6 +606,10 @@ bool OSystem_PS2::mcPresent(void) {
return false;
}
+bool OSystem_PS2::cdPresent(void) {
+ return _useCd;
+}
+
bool OSystem_PS2::hddPresent(void) {
return _useHdd;
}
@@ -528,11 +628,39 @@ bool OSystem_PS2::usbMassPresent(void) {
}
bool OSystem_PS2::netPresent(void) {
- return _useNet;
+ if (_useNet)
+ return true;
+
+ return false;
+}
+
+bool OSystem_PS2::hddMount(const char *partition) {
+ char name[64] = "hdd0:+ScummVM";
+
+ if (partition)
+ strcpy(name+6, partition);
+
+ if (fio.mount("pfs0:", name, 0) >= 0) {
+ dbg_printf("Successfully mounted (%s)!\n", name);
+ return true;
+ }
+ else {
+ dbg_printf("Failed to mount (%s).\n", name);
+ _useHdd = false;
+ return false;
+ }
}
void OSystem_PS2::initSize(uint width, uint height, const Graphics::PixelFormat *format) {
- printf("initializing new size: (%d/%d)...", width, height);
+ dbg_printf("initializing new size: (%d/%d)...", width, height);
+
+ /* ugly hack: we know we can parse ScummVM.ini now */
+ if (!_screenChangeCount) { // first round
+ config();
+ _screen = new Gs2dScreen(width, height);
+ fillScreen(0);
+ }
+
_screen->newScreenSize(width, height);
_screen->setMouseXy(width / 2, height / 2);
_input->newRange(0, 0, width - 1, height - 1);
@@ -543,7 +671,7 @@ void OSystem_PS2::initSize(uint width, uint height, const Graphics::PixelFormat
_modeChanged = true;
_screenChangeCount++;
- printf("done\n");
+ dbg_printf("done\n");
}
void OSystem_PS2::setPalette(const byte *colors, uint start, uint num) {
@@ -555,7 +683,7 @@ void OSystem_PS2::grabPalette(byte *colors, uint start, uint num) {
}
void OSystem_PS2::copyRectToScreen(const void *buf, int pitch, int x, int y, int w, int h) {
- _screen->copyScreenRect((const uint8*)buf, pitch, x, y, w, h);
+ _screen->copyScreenRect((const uint8 *)buf, pitch, x, y, w, h);
}
void OSystem_PS2::updateScreen(void) {
@@ -568,7 +696,7 @@ void OSystem_PS2::updateScreen(void) {
void OSystem_PS2::displayMessageOnOSD(const char *msg) {
/* TODO : check */
- printf("displayMessageOnOSD: %s\n", msg);
+ dbg_printf("displayMessageOnOSD: %s\n", msg);
}
uint32 OSystem_PS2::getMillis(bool skipRecord) {
@@ -666,7 +794,7 @@ void OSystem_PS2::unlockScreen(void) {
const OSystem::GraphicsMode OSystem_PS2::_graphicsMode = { NULL, NULL, 0 };
const OSystem::GraphicsMode *OSystem_PS2::getSupportedGraphicsModes(void) const {
- return &_graphicsMode;
+ return &_graphicsMode;
}
bool OSystem_PS2::setGraphicsMode(int mode) {
@@ -735,7 +863,7 @@ void OSystem_PS2::msgPrintf(int millis, const char *format, ...) {
Graphics::g_sysfont.drawString(&surf, str, posX, posY, 300 - posX, 1);
posY += 14;
- lnSta = lnEnd + 1;
+ lnSta = lnEnd + 1;
}
uint8 *scrBuf = (uint8 *)memalign(64, 320 * 200);
@@ -768,12 +896,14 @@ void OSystem_PS2::powerOffCallback(void) {
}
void OSystem_PS2::quit(void) {
- printf("OSystem_PS2::quit called\n");
+ dbg_printf("OSystem_PS2::quit called\n");
if (_bootDevice == HOST_DEV) {
- printf("OSystem_PS2::quit (HOST)\n");
+ dbg_printf("OSystem_PS2::quit (HOST)\n");
+ #ifndef ENABLE_PROFILING
SleepThread();
+ #endif
} else {
- printf("OSystem_PS2::quit (bootdev=%d)\n", _bootDevice);
+ dbg_printf("OSystem_PS2::quit (bootdev=%d)\n", _bootDevice);
if (_useHdd) {
driveStandby();
fio.umount("pfs0:");
@@ -781,18 +911,22 @@ void OSystem_PS2::quit(void) {
//setTimerCallback(NULL, 0);
_screen->wantAnim(false);
_systemQuit = true;
+ #ifdef __NEW_PS2SDK__
+ ee_thread_status_t statSound, statTimer;
+ #else
ee_thread_t statSound, statTimer;
- printf("Waiting for timer and sound thread to end\n");
+ #endif
+ dbg_printf("Waiting for timer and sound thread to end\n");
do { // wait until both threads called ExitThread()
ReferThreadStatus(_timerTid, &statTimer);
ReferThreadStatus(_soundTid, &statSound);
} while ((statSound.status != 0x10) || (statTimer.status != 0x10));
- printf("Done\n");
+ dbg_printf("Done\n");
DeleteThread(_timerTid);
DeleteThread(_soundTid);
free(_timerStack);
free(_soundStack);
- printf("Stopping timer\n");
+ dbg_printf("Stopping timer\n");
DisableIntc(INT_TIMER0);
RemoveIntcHandler(INT_TIMER0, _intrId);
@@ -801,7 +935,7 @@ void OSystem_PS2::quit(void) {
padEnd(); // stop pad library
cdvdInit(CDVD_EXIT);
- printf("resetting iop\n");
+ dbg_printf("resetting iop\n");
SifIopReset(NULL, 0);
SifExitRpc();
while (!SifIopSync());
@@ -829,7 +963,7 @@ void OSystem_PS2::quit(void) {
" li $3, 0x04;"
" syscall;"
" nop;"
- );
+ );
*/
/*
@@ -839,7 +973,7 @@ void OSystem_PS2::quit(void) {
*/
#else
// reset + load ELF from CD
- printf("Restarting ScummVM\n");
+ dbg_printf("Restarting ScummVM\n");
LoadExecPS2("cdrom0:\\SCUMMVM.ELF", 0, NULL);
#endif
}
@@ -856,12 +990,12 @@ bool OSystem_PS2::prepMC() {
if (!mcPresent())
return prep;
- printf("prepMC 0\n");
+ dbg_printf("prepMC 0\n");
// Common::String str("mc0:ScummVM/")
// Common::FSNode scumDir(str);
Common::FSNode scumDir("mc0:ScummVM/");
- printf("prepMC 00\n");
+ dbg_printf("prepMC 00\n");
if (!scumDir.exists()) {
uint16 *data, size;
@@ -869,11 +1003,11 @@ bool OSystem_PS2::prepMC() {
PS2Icon _ico;
mcIcon icon;
- printf("prepMC I\n");
+ dbg_printf("prepMC I\n");
size = _ico.decompressData(&data);
- printf("prepMC II\n");
+ dbg_printf("prepMC II\n");
_ico.setup(&icon);
@@ -888,21 +1022,21 @@ bool OSystem_PS2::prepMC() {
fio.mkdir("mc0:ScummVM");
f = ps2_fopen("mc0:ScummVM/scummvm.icn", "w");
- printf("f = %p\n", (const void *)f);
+ dbg_printf("f = %p\n", (const void *)f);
ps2_fwrite(data, size, 2, f);
ps2_fclose(f);
f = ps2_fopen("mc0:ScummVM/icon.sys", "w");
- printf("f = %p\n", (const void *)f);
+ dbg_printf("f = %p\n", (const void *)f);
ps2_fwrite(&icon, sizeof(icon), 1, f);
ps2_fclose(f);
#endif
free(data);
- printf("prepMC II\n");
+ dbg_printf("prepMC II\n");
prep = true;
}
@@ -911,7 +1045,7 @@ bool OSystem_PS2::prepMC() {
}
void OSystem_PS2::makeConfigPath() {
- FILE *src, *dst;
+ FILE *src, *dst;
char path[128], *buf;
int32 size;
@@ -926,7 +1060,7 @@ void OSystem_PS2::makeConfigPath() {
src = ps2_fopen("cdfs:ScummVM.ini", "r");
if (src) {
size = ((Ps2File *)src)->size();
- buf = (char *)malloc(size);
+ buf = (char *)memalign(64, size);
ps2_fread(buf, size, 1, src);
ps2_fclose(src);
@@ -970,6 +1104,5 @@ Common::String OSystem_PS2::getDefaultConfigFileName() {
}
void OSystem_PS2::logMessage(LogMessageType::Type type, const char *message) {
- printf("%s", message);
- sioprintf("%s", message);
+ dbg_printf("%s", message);
}
diff --git a/backends/platform/ps2/systemps2.h b/backends/platform/ps2/systemps2.h
index 3ba40a70f9..45b7dfae36 100644
--- a/backends/platform/ps2/systemps2.h
+++ b/backends/platform/ps2/systemps2.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -25,6 +25,7 @@
#include "common/system.h"
#include "backends/base-backend.h"
+#include "backends/platform/ps2/irxboot.h"
#include "graphics/palette.h"
class Gs2dScreen;
@@ -51,6 +52,7 @@ public:
virtual void initSize(uint width, uint height, const Graphics::PixelFormat *format);
void init(void);
+ void config(void);
virtual int16 getHeight(void);
virtual int16 getWidth(void);
@@ -119,14 +121,17 @@ public:
void powerOffCallback(void);
bool mcPresent(void);
+ bool cdPresent(void);
bool hddPresent(void);
bool usbMassPresent(void);
bool netPresent(void);
+ bool hddMount(const char *partition);
bool runningFromHost(void);
int getBootDevice() { return _bootDevice; }
private:
+ bool loadDrivers(IrxType type);
void startIrxModules(int numModules, IrxReference *modules);
void initMutexes(void);
@@ -136,28 +141,28 @@ private:
Audio::MixerImpl *_scummMixer;
bool _mouseVisible;
- bool _useMouse, _useKbd, _useHdd, _usbMassLoaded, _useNet;
+ bool _useMouse, _useKbd, _useCd, _useHdd, _usbMassLoaded, _useNet;
- Gs2dScreen *_screen;
- Ps2Input *_input;
- uint16 _oldMouseX, _oldMouseY;
- uint32 _msgClearTime;
- uint16 _printY;
+ Gs2dScreen *_screen;
+ Ps2Input *_input;
+ uint16 _oldMouseX, _oldMouseY;
+ uint32 _msgClearTime;
+ uint16 _printY;
bool _modeChanged;
int _screenChangeCount;
- int _mutexSema;
- Ps2Mutex _mutex[MAX_MUTEXES];
+ int _mutexSema;
+ Ps2Mutex _mutex[MAX_MUTEXES];
- uint8 *_timerStack, *_soundStack;
- int _timerTid, _soundTid;
- int _intrId;
+ uint8 *_timerStack, *_soundStack;
+ int _timerTid, _soundTid;
+ int _intrId;
volatile bool _systemQuit;
static const GraphicsMode _graphicsMode;
- int _bootDevice;
- char *_bootPath;
- char *_configFile;
+ int _bootDevice;
+ char *_bootPath;
+ char *_configFile;
};
#endif // SYSTEMPS2_H
diff --git a/backends/platform/psp/audio.cpp b/backends/platform/psp/audio.cpp
index dcbf0b2239..53423b6bbb 100644
--- a/backends/platform/psp/audio.cpp
+++ b/backends/platform/psp/audio.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/psp/audio.h b/backends/platform/psp/audio.h
index 34ded5c638..04f8954840 100644
--- a/backends/platform/psp/audio.h
+++ b/backends/platform/psp/audio.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/psp/cursor.cpp b/backends/platform/psp/cursor.cpp
index b295507de1..0760bd1354 100644
--- a/backends/platform/psp/cursor.cpp
+++ b/backends/platform/psp/cursor.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/psp/cursor.h b/backends/platform/psp/cursor.h
index f79968243b..85a6cbcc34 100644
--- a/backends/platform/psp/cursor.h
+++ b/backends/platform/psp/cursor.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/psp/default_display_client.cpp b/backends/platform/psp/default_display_client.cpp
index 6d6eb641f7..f2d8a7c03c 100644
--- a/backends/platform/psp/default_display_client.cpp
+++ b/backends/platform/psp/default_display_client.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/psp/default_display_client.h b/backends/platform/psp/default_display_client.h
index 95c52e2352..d46b7f1a8a 100644
--- a/backends/platform/psp/default_display_client.h
+++ b/backends/platform/psp/default_display_client.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/psp/display_client.cpp b/backends/platform/psp/display_client.cpp
index bc29166895..b238631e62 100644
--- a/backends/platform/psp/display_client.cpp
+++ b/backends/platform/psp/display_client.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/psp/display_client.h b/backends/platform/psp/display_client.h
index e384bfb82b..5e81947e20 100644
--- a/backends/platform/psp/display_client.h
+++ b/backends/platform/psp/display_client.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/psp/display_manager.cpp b/backends/platform/psp/display_manager.cpp
index c2ff84c7f5..2e995c809e 100644
--- a/backends/platform/psp/display_manager.cpp
+++ b/backends/platform/psp/display_manager.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/psp/display_manager.h b/backends/platform/psp/display_manager.h
index 38c43d60a3..b1b748a68c 100644
--- a/backends/platform/psp/display_manager.h
+++ b/backends/platform/psp/display_manager.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/psp/dummy.cpp b/backends/platform/psp/dummy.cpp
index 998ecf1488..240a1e25b5 100644
--- a/backends/platform/psp/dummy.cpp
+++ b/backends/platform/psp/dummy.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/psp/image_viewer.cpp b/backends/platform/psp/image_viewer.cpp
index 98205ddee9..8a1a256469 100644
--- a/backends/platform/psp/image_viewer.cpp
+++ b/backends/platform/psp/image_viewer.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/psp/image_viewer.h b/backends/platform/psp/image_viewer.h
index 91a70b85cc..66b640b6f3 100644
--- a/backends/platform/psp/image_viewer.h
+++ b/backends/platform/psp/image_viewer.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/psp/input.cpp b/backends/platform/psp/input.cpp
index 5e20fb1e43..4d7577eb94 100644
--- a/backends/platform/psp/input.cpp
+++ b/backends/platform/psp/input.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/psp/input.h b/backends/platform/psp/input.h
index ef2e1b84a4..05b575e0b0 100644
--- a/backends/platform/psp/input.h
+++ b/backends/platform/psp/input.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/psp/memory.cpp b/backends/platform/psp/memory.cpp
index 5419d60eb3..72a526c0ff 100644
--- a/backends/platform/psp/memory.cpp
+++ b/backends/platform/psp/memory.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/psp/memory.h b/backends/platform/psp/memory.h
index 5b728460fc..d7c5420d64 100644
--- a/backends/platform/psp/memory.h
+++ b/backends/platform/psp/memory.h
@@ -9,12 +9,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/psp/mp3.cpp b/backends/platform/psp/mp3.cpp
index 3dbf31112a..6db2a73a4b 100644
--- a/backends/platform/psp/mp3.cpp
+++ b/backends/platform/psp/mp3.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/psp/mp3.h b/backends/platform/psp/mp3.h
index f7bfdda254..86dfc4c37d 100644
--- a/backends/platform/psp/mp3.h
+++ b/backends/platform/psp/mp3.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/psp/osys_psp.cpp b/backends/platform/psp/osys_psp.cpp
index 8559066e53..67cb72d9d4 100644
--- a/backends/platform/psp/osys_psp.cpp
+++ b/backends/platform/psp/osys_psp.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/psp/osys_psp.h b/backends/platform/psp/osys_psp.h
index f4591e476d..6f9238b84e 100644
--- a/backends/platform/psp/osys_psp.h
+++ b/backends/platform/psp/osys_psp.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/psp/png_loader.cpp b/backends/platform/psp/png_loader.cpp
index 4de13d1e73..e54541b75d 100644
--- a/backends/platform/psp/png_loader.cpp
+++ b/backends/platform/psp/png_loader.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/psp/png_loader.h b/backends/platform/psp/png_loader.h
index 48a3220d78..b84bef4efe 100644
--- a/backends/platform/psp/png_loader.h
+++ b/backends/platform/psp/png_loader.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/psp/portdefs.h b/backends/platform/psp/portdefs.h
index 620a27a601..3e7b559666 100644
--- a/backends/platform/psp/portdefs.h
+++ b/backends/platform/psp/portdefs.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/psp/powerman.cpp b/backends/platform/psp/powerman.cpp
index b72d05809d..3cd663e3c7 100644
--- a/backends/platform/psp/powerman.cpp
+++ b/backends/platform/psp/powerman.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/psp/powerman.h b/backends/platform/psp/powerman.h
index e62b1ada8e..77cfb26720 100644
--- a/backends/platform/psp/powerman.h
+++ b/backends/platform/psp/powerman.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/psp/psp_main.cpp b/backends/platform/psp/psp_main.cpp
index a83a5bae71..8901f4ecd3 100644
--- a/backends/platform/psp/psp_main.cpp
+++ b/backends/platform/psp/psp_main.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/psp/pspkeyboard.cpp b/backends/platform/psp/pspkeyboard.cpp
index 66efe9145d..7b5637e52f 100644
--- a/backends/platform/psp/pspkeyboard.cpp
+++ b/backends/platform/psp/pspkeyboard.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/psp/pspkeyboard.h b/backends/platform/psp/pspkeyboard.h
index bd270da26f..ece769e0ce 100644
--- a/backends/platform/psp/pspkeyboard.h
+++ b/backends/platform/psp/pspkeyboard.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/psp/psppixelformat.cpp b/backends/platform/psp/psppixelformat.cpp
index e1649791a1..2d7d524b45 100644
--- a/backends/platform/psp/psppixelformat.cpp
+++ b/backends/platform/psp/psppixelformat.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/psp/psppixelformat.h b/backends/platform/psp/psppixelformat.h
index ca85e76211..ede5a97d6f 100644
--- a/backends/platform/psp/psppixelformat.h
+++ b/backends/platform/psp/psppixelformat.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/psp/rtc.cpp b/backends/platform/psp/rtc.cpp
index 4f15e45535..d01bd8f83a 100644
--- a/backends/platform/psp/rtc.cpp
+++ b/backends/platform/psp/rtc.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/psp/rtc.h b/backends/platform/psp/rtc.h
index d2689681dd..58d70f4ab2 100644
--- a/backends/platform/psp/rtc.h
+++ b/backends/platform/psp/rtc.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/psp/tests.cpp b/backends/platform/psp/tests.cpp
index 5c5ebb7a80..92a18e58d0 100644
--- a/backends/platform/psp/tests.cpp
+++ b/backends/platform/psp/tests.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/psp/tests.h b/backends/platform/psp/tests.h
index 3779cb6bb2..718287b9dd 100644
--- a/backends/platform/psp/tests.h
+++ b/backends/platform/psp/tests.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/psp/thread.cpp b/backends/platform/psp/thread.cpp
index 57370f7685..669a682c21 100644
--- a/backends/platform/psp/thread.cpp
+++ b/backends/platform/psp/thread.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/psp/thread.h b/backends/platform/psp/thread.h
index ca94b8c82c..a0d53e8638 100644
--- a/backends/platform/psp/thread.h
+++ b/backends/platform/psp/thread.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/psp/trace.cpp b/backends/platform/psp/trace.cpp
index 008b508b7e..50459dcea5 100644
--- a/backends/platform/psp/trace.cpp
+++ b/backends/platform/psp/trace.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/psp/trace.h b/backends/platform/psp/trace.h
index e27d06d8d3..43ccaea52a 100644
--- a/backends/platform/psp/trace.h
+++ b/backends/platform/psp/trace.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/samsungtv/main.cpp b/backends/platform/samsungtv/main.cpp
index 8274bb00a2..a390bd0f0b 100644
--- a/backends/platform/samsungtv/main.cpp
+++ b/backends/platform/samsungtv/main.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/samsungtv/samsungtv.cpp b/backends/platform/samsungtv/samsungtv.cpp
index 9718eed1fe..a1d15930f2 100644
--- a/backends/platform/samsungtv/samsungtv.cpp
+++ b/backends/platform/samsungtv/samsungtv.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/samsungtv/samsungtv.h b/backends/platform/samsungtv/samsungtv.h
index b7a78a96cd..fdd1015c8a 100644
--- a/backends/platform/samsungtv/samsungtv.h
+++ b/backends/platform/samsungtv/samsungtv.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/sdl/amigaos/amigaos-main.cpp b/backends/platform/sdl/amigaos/amigaos-main.cpp
index da83756a40..0743b3f9a0 100644
--- a/backends/platform/sdl/amigaos/amigaos-main.cpp
+++ b/backends/platform/sdl/amigaos/amigaos-main.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/sdl/amigaos/amigaos.cpp b/backends/platform/sdl/amigaos/amigaos.cpp
index 94daacfd14..fdd26cd256 100644
--- a/backends/platform/sdl/amigaos/amigaos.cpp
+++ b/backends/platform/sdl/amigaos/amigaos.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/sdl/amigaos/amigaos.h b/backends/platform/sdl/amigaos/amigaos.h
index 391a0bfa9a..76cc656364 100644
--- a/backends/platform/sdl/amigaos/amigaos.h
+++ b/backends/platform/sdl/amigaos/amigaos.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/sdl/macosx/appmenu_osx.h b/backends/platform/sdl/macosx/appmenu_osx.h
index 005414b789..22088184fb 100644
--- a/backends/platform/sdl/macosx/appmenu_osx.h
+++ b/backends/platform/sdl/macosx/appmenu_osx.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/sdl/macosx/appmenu_osx.mm b/backends/platform/sdl/macosx/appmenu_osx.mm
index 0d2a2ab7f2..d083fb8483 100644
--- a/backends/platform/sdl/macosx/appmenu_osx.mm
+++ b/backends/platform/sdl/macosx/appmenu_osx.mm
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/sdl/macosx/macosx-main.cpp b/backends/platform/sdl/macosx/macosx-main.cpp
index b89264f9e9..1b9fc1b82c 100644
--- a/backends/platform/sdl/macosx/macosx-main.cpp
+++ b/backends/platform/sdl/macosx/macosx-main.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/sdl/macosx/macosx.cpp b/backends/platform/sdl/macosx/macosx.cpp
index 85342d62fd..c48076c42f 100644
--- a/backends/platform/sdl/macosx/macosx.cpp
+++ b/backends/platform/sdl/macosx/macosx.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -31,6 +31,7 @@
#include "backends/mixer/doublebuffersdl/doublebuffersdl-mixer.h"
#include "backends/platform/sdl/macosx/appmenu_osx.h"
#include "backends/updates/macosx/macosx-updates.h"
+#include "backends/taskbar/macosx/macosx-taskbar.h"
#include "common/archive.h"
#include "common/config-manager.h"
@@ -45,6 +46,16 @@ OSystem_MacOSX::OSystem_MacOSX()
OSystem_POSIX("Library/Preferences/ScummVM Preferences") {
}
+void OSystem_MacOSX::init() {
+#if defined(USE_TASKBAR)
+ // Initialize taskbar manager
+ _taskbarManager = new MacOSXTaskbarManager();
+#endif
+
+ // Invoke parent implementation of this method
+ OSystem_POSIX::init();
+}
+
void OSystem_MacOSX::initBackend() {
// Create the mixer manager
if (_mixer == 0) {
@@ -134,7 +145,7 @@ Common::String OSystem_MacOSX::getSystemLanguage() const {
for (CFIndex i = 0 ; i < localizationsSize ; ++i) {
CFStringRef language = (CFStringRef)CFArrayGetValueAtIndex(preferredLocalizations, i);
char buffer[10];
- CFStringGetCString(language, buffer, 50, kCFStringEncodingASCII);
+ CFStringGetCString(language, buffer, sizeof(buffer), kCFStringEncodingASCII);
int32 languageId = TransMan.findMatchingLanguage(buffer);
if (languageId != -1) {
CFRelease(preferredLocalizations);
@@ -145,7 +156,7 @@ Common::String OSystem_MacOSX::getSystemLanguage() const {
if (localizationsSize > 0) {
CFStringRef language = (CFStringRef)CFArrayGetValueAtIndex(preferredLocalizations, 0);
char buffer[10];
- CFStringGetCString(language, buffer, 50, kCFStringEncodingASCII);
+ CFStringGetCString(language, buffer, sizeof(buffer), kCFStringEncodingASCII);
CFRelease(preferredLocalizations);
return buffer;
}
diff --git a/backends/platform/sdl/macosx/macosx.h b/backends/platform/sdl/macosx/macosx.h
index d9cb28b973..50cef60353 100644
--- a/backends/platform/sdl/macosx/macosx.h
+++ b/backends/platform/sdl/macosx/macosx.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -35,6 +35,7 @@ public:
virtual Common::String getSystemLanguage() const;
+ virtual void init();
virtual void initBackend();
virtual void addSysArchivesToSearchSet(Common::SearchSet &s, int priority = 0);
virtual void setupIcon();
diff --git a/backends/platform/sdl/posix/posix-main.cpp b/backends/platform/sdl/posix/posix-main.cpp
index 5f0914e04f..d07db11b0c 100644
--- a/backends/platform/sdl/posix/posix-main.cpp
+++ b/backends/platform/sdl/posix/posix-main.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/sdl/posix/posix.cpp b/backends/platform/sdl/posix/posix.cpp
index 7a8b1e7b70..a711c3a96b 100644
--- a/backends/platform/sdl/posix/posix.cpp
+++ b/backends/platform/sdl/posix/posix.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -50,7 +50,7 @@ void OSystem_POSIX::init() {
// Initialze File System Factory
_fsFactory = new POSIXFilesystemFactory();
-#if defined(USE_TASKBAR) && defined(USE_TASKBAR_UNITY)
+#if defined(USE_TASKBAR) && defined(USE_UNITY)
// Initialize taskbar manager
_taskbarManager = new UnityTaskbarManager();
#endif
@@ -67,7 +67,7 @@ void OSystem_POSIX::initBackend() {
// Invoke parent implementation of this method
OSystem_SDL::initBackend();
-#if defined(USE_TASKBAR) && defined(USE_TASKBAR_UNITY)
+#if defined(USE_TASKBAR) && defined(USE_UNITY)
// Register the taskbar manager as an event source (this is necessary for the glib event loop to be run)
_eventManager->getEventDispatcher()->registerSource((UnityTaskbarManager *)_taskbarManager, false);
#endif
@@ -80,15 +80,16 @@ bool OSystem_POSIX::hasFeature(Feature f) {
}
Common::String OSystem_POSIX::getDefaultConfigFileName() {
- char configFile[MAXPATHLEN];
+ Common::String configFile;
// On POSIX type systems, by default we store the config file inside
// to the HOME directory of the user.
const char *home = getenv("HOME");
- if (home != NULL && strlen(home) < MAXPATHLEN)
- snprintf(configFile, MAXPATHLEN, "%s/%s", home, _baseConfigName.c_str());
- else
- strcpy(configFile, _baseConfigName.c_str());
+ if (home != NULL && (strlen(home) + 1 + _baseConfigName.size()) < MAXPATHLEN) {
+ configFile = Common::String::format("%s/%s", home, _baseConfigName.c_str());
+ } else {
+ configFile = _baseConfigName;
+ }
return configFile;
}
diff --git a/backends/platform/sdl/posix/posix.h b/backends/platform/sdl/posix/posix.h
index 59909a958f..01a01528cd 100644
--- a/backends/platform/sdl/posix/posix.h
+++ b/backends/platform/sdl/posix/posix.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/sdl/ps3/ps3-main.cpp b/backends/platform/sdl/ps3/ps3-main.cpp
index ba548a3749..92c4a02865 100644
--- a/backends/platform/sdl/ps3/ps3-main.cpp
+++ b/backends/platform/sdl/ps3/ps3-main.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/sdl/ps3/ps3.cpp b/backends/platform/sdl/ps3/ps3.cpp
index 33586ce693..f111379794 100644
--- a/backends/platform/sdl/ps3/ps3.cpp
+++ b/backends/platform/sdl/ps3/ps3.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/sdl/ps3/ps3.h b/backends/platform/sdl/ps3/ps3.h
index daed7599a9..d812a13548 100644
--- a/backends/platform/sdl/ps3/ps3.h
+++ b/backends/platform/sdl/ps3/ps3.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/sdl/sdl-sys.h b/backends/platform/sdl/sdl-sys.h
index eccf73815d..eec3741ed6 100644
--- a/backends/platform/sdl/sdl-sys.h
+++ b/backends/platform/sdl/sdl-sys.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp
index 7ab367d4a4..41610dc0c7 100644
--- a/backends/platform/sdl/sdl.cpp
+++ b/backends/platform/sdl/sdl.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -65,10 +65,13 @@
OSystem_SDL::OSystem_SDL()
:
#ifdef USE_OPENGL
- _graphicsModes(0),
+ _desktopWidth(0),
+ _desktopHeight(0),
+ _graphicsModes(),
_graphicsMode(0),
- _sdlModesCount(0),
- _glModesCount(0),
+ _firstGLMode(0),
+ _defaultSDLMode(0),
+ _defaultGLMode(0),
#endif
_inited(false),
_initedSDL(false),
@@ -87,6 +90,9 @@ OSystem_SDL::~OSystem_SDL() {
// Hence, we perform the destruction on our own.
delete _savefileManager;
_savefileManager = 0;
+ if (_graphicsManager) {
+ dynamic_cast<SdlGraphicsManager *>(_graphicsManager)->deactivateManager();
+ }
delete _graphicsManager;
_graphicsManager = 0;
delete _eventManager;
@@ -110,10 +116,6 @@ OSystem_SDL::~OSystem_SDL() {
delete _mutexManager;
_mutexManager = 0;
-#ifdef USE_OPENGL
- delete[] _graphicsModes;
-#endif
-
delete _logger;
_logger = 0;
@@ -124,6 +126,12 @@ void OSystem_SDL::init() {
// Initialize SDL
initSDL();
+ // Enable unicode support if possible
+ SDL_EnableUNICODE(1);
+
+ // Disable OS cursor
+ SDL_ShowCursor(SDL_DISABLE);
+
if (!_logger)
_logger = new Backends::Log::Log(this);
@@ -144,50 +152,60 @@ void OSystem_SDL::init() {
_taskbarManager = new Common::TaskbarManager();
#endif
-#ifdef USE_OPENGL
- // Setup a list with both SDL and OpenGL graphics modes
- setupGraphicsModes();
-#endif
}
void OSystem_SDL::initBackend() {
// Check if backend has not been initialized
assert(!_inited);
+ const int maxNameLen = 20;
+ char sdlDriverName[maxNameLen];
+ sdlDriverName[0] = '\0';
+ SDL_VideoDriverName(sdlDriverName, maxNameLen);
+ // Using printf rather than debug() here as debug()/logging
+ // is not active by this point.
+ debug(1, "Using SDL Video Driver \"%s\"", sdlDriverName);
+
// Create the default event source, in case a custom backend
// manager didn't provide one yet.
if (_eventSource == 0)
_eventSource = new SdlEventSource();
- int graphicsManagerType = 0;
+#ifdef USE_OPENGL
+ // Query the desktop resolution. We simply hope nothing tried to change
+ // the resolution so far.
+ const SDL_VideoInfo *videoInfo = SDL_GetVideoInfo();
+ if (videoInfo && videoInfo->current_w > 0 && videoInfo->current_h > 0) {
+ _desktopWidth = videoInfo->current_w;
+ _desktopHeight = videoInfo->current_h;
+ }
+#endif
if (_graphicsManager == 0) {
#ifdef USE_OPENGL
+ // Setup a list with both SDL and OpenGL graphics modes. We only do
+ // this whenever the subclass did not already set up an graphics
+ // manager yet. This is because we don't know the type of the graphics
+ // manager of the subclass, thus we cannot easily switch between the
+ // OpenGL one and the set up one. It also is to be expected that the
+ // subclass does not want any switching of graphics managers anyway.
+ setupGraphicsModes();
+
if (ConfMan.hasKey("gfx_mode")) {
+ // If the gfx_mode is from OpenGL, create the OpenGL graphics manager
Common::String gfxMode(ConfMan.get("gfx_mode"));
- bool use_opengl = false;
- const OSystem::GraphicsMode *mode = OpenGLSdlGraphicsManager::supportedGraphicsModes();
- int i = 0;
- while (mode->name) {
- if (scumm_stricmp(mode->name, gfxMode.c_str()) == 0) {
- _graphicsMode = i + _sdlModesCount;
- use_opengl = true;
+ for (uint i = _firstGLMode; i < _graphicsModeIds.size(); ++i) {
+ if (!scumm_stricmp(_graphicsModes[i].name, gfxMode.c_str())) {
+ _graphicsManager = new OpenGLSdlGraphicsManager(_desktopWidth, _desktopHeight, _eventSource);
+ _graphicsMode = i;
+ break;
}
-
- mode++;
- ++i;
- }
-
- // If the gfx_mode is from OpenGL, create the OpenGL graphics manager
- if (use_opengl) {
- _graphicsManager = new OpenGLSdlGraphicsManager(_eventSource);
- graphicsManagerType = 1;
}
}
#endif
+
if (_graphicsManager == 0) {
_graphicsManager = new SurfaceSdlGraphicsManager(_eventSource);
- graphicsManagerType = 0;
}
}
@@ -230,13 +248,7 @@ void OSystem_SDL::initBackend() {
// so the virtual keyboard can be initialized, but we have to add the
// graphics manager as an event observer after initializing the event
// manager.
- if (graphicsManagerType == 0)
- ((SurfaceSdlGraphicsManager *)_graphicsManager)->initEventObserver();
-#ifdef USE_OPENGL
- else if (graphicsManagerType == 1)
- ((OpenGLSdlGraphicsManager *)_graphicsManager)->initEventObserver();
-#endif
-
+ dynamic_cast<SdlGraphicsManager *>(_graphicsManager)->activateManager();
}
#if defined(USE_TASKBAR)
@@ -257,22 +269,19 @@ void OSystem_SDL::engineDone() {
void OSystem_SDL::initSDL() {
// Check if SDL has not been initialized
if (!_initedSDL) {
- uint32 sdlFlags = 0;
+ // We always initialize the video subsystem because we will need it to
+ // be initialized before the graphics managers to retrieve the desktop
+ // resolution, for example. WebOS also requires this initialization
+ // or otherwise the application won't start.
+ uint32 sdlFlags = SDL_INIT_VIDEO;
+
if (ConfMan.hasKey("disable_sdl_parachute"))
sdlFlags |= SDL_INIT_NOPARACHUTE;
-#ifdef WEBOS
- // WebOS needs this flag or otherwise the application won't start
- sdlFlags |= SDL_INIT_VIDEO;
-#endif
-
// Initialize SDL (SDL Subsystems are initiliazed in the corresponding sdl managers)
if (SDL_Init(sdlFlags) == -1)
error("Could not initialize SDL: %s", SDL_GetError());
- // Enable unicode support if possible
- SDL_EnableUNICODE(1);
-
_initedSDL = true;
}
}
@@ -368,17 +377,6 @@ Common::String OSystem_SDL::getSystemLanguage() const {
const LCID languageIdentifier = GetThreadLocale();
- // GetLocalInfo is only supported starting from Windows 2000, according to this:
- // http://msdn.microsoft.com/en-us/library/dd318101%28VS.85%29.aspx
- // On the other hand the locale constants used, seem to exist on Windows 98 too,
- // check this for that: http://msdn.microsoft.com/en-us/library/dd464799%28v=VS.85%29.aspx
- //
- // I am not exactly sure what is the truth now, it might be very well that this breaks
- // support for systems older than Windows 2000....
- //
- // TODO: Check whether this (or ScummVM at all ;-) works on a system with Windows 98 for
- // example and if it does not and we still want Windows 9x support, we should definitly
- // think of another solution.
if (GetLocaleInfo(languageIdentifier, LOCALE_SISO639LANGNAME, langName, sizeof(langName)) != 0 &&
GetLocaleInfo(languageIdentifier, LOCALE_SISO3166CTRYNAME, ctryName, sizeof(ctryName)) != 0) {
Common::String localeName = langName;
@@ -391,10 +389,15 @@ Common::String OSystem_SDL::getSystemLanguage() const {
}
#else // WIN32
// Activating current locale settings
- const char *locale = setlocale(LC_ALL, "");
+ const Common::String locale = setlocale(LC_ALL, "");
+
+ // Restore default C locale to prevent issues with
+ // portability of sscanf(), atof(), etc.
+ // See bug #3615148
+ setlocale(LC_ALL, "C");
// Detect the language from the locale
- if (!locale) {
+ if (locale.empty()) {
return ModularBackend::getSystemLanguage();
} else {
int length = 0;
@@ -403,14 +406,14 @@ Common::String OSystem_SDL::getSystemLanguage() const {
// ".UTF-8" or the like. We do this, since
// our translation languages are usually
// specified without any charset information.
- for (int i = 0; locale[i]; ++i, ++length) {
+ for (int size = locale.size(); length < size; ++length) {
// TODO: Check whether "@" should really be checked
// here.
- if (locale[i] == '.' || locale[i] == ' ' || locale[i] == '@')
+ if (locale[length] == '.' || locale[length] == ' ' || locale[length] == '@')
break;
}
- return Common::String(locale, length);
+ return Common::String(locale.c_str(), length);
}
#endif // WIN32
#else // USE_DETECTLANG
@@ -535,28 +538,33 @@ Common::TimerManager *OSystem_SDL::getTimerManager() {
#ifdef USE_OPENGL
const OSystem::GraphicsMode *OSystem_SDL::getSupportedGraphicsModes() const {
- return _graphicsModes;
+ if (_graphicsModes.empty()) {
+ return _graphicsManager->getSupportedGraphicsModes();
+ } else {
+ return _graphicsModes.begin();
+ }
}
int OSystem_SDL::getDefaultGraphicsMode() const {
- // Return the default graphics mode from the current graphics manager
- if (_graphicsMode < _sdlModesCount)
+ if (_graphicsModes.empty()) {
return _graphicsManager->getDefaultGraphicsMode();
- else
- return _graphicsManager->getDefaultGraphicsMode() + _sdlModesCount;
+ } else {
+ // Return the default graphics mode from the current graphics manager
+ if (_graphicsMode < _firstGLMode)
+ return _defaultSDLMode;
+ else
+ return _defaultGLMode;
+ }
}
bool OSystem_SDL::setGraphicsMode(int mode) {
- const OSystem::GraphicsMode *srcMode;
- int i;
+ if (_graphicsModes.empty()) {
+ return _graphicsManager->setGraphicsMode(mode);
+ }
- // Check if mode is from SDL or OpenGL
- if (mode < _sdlModesCount) {
- srcMode = SurfaceSdlGraphicsManager::supportedGraphicsModes();
- i = 0;
- } else {
- srcMode = OpenGLSdlGraphicsManager::supportedGraphicsModes();
- i = _sdlModesCount;
+ // Check whether a invalid mode is requested.
+ if (mode < 0 || (uint)mode >= _graphicsModeIds.size()) {
+ return false;
}
// Very hacky way to set up the old graphics manager state, in case we
@@ -575,113 +583,121 @@ bool OSystem_SDL::setGraphicsMode(int mode) {
bool switchedManager = false;
- // Loop through modes
- while (srcMode->name) {
- if (i == mode) {
- // If the new mode and the current mode are not from the same graphics
- // manager, delete and create the new mode graphics manager
- if (_graphicsMode >= _sdlModesCount && mode < _sdlModesCount) {
- debug(1, "switching to plain SDL graphics");
- delete _graphicsManager;
- _graphicsManager = new SurfaceSdlGraphicsManager(_eventSource);
- ((SurfaceSdlGraphicsManager *)_graphicsManager)->initEventObserver();
- _graphicsManager->beginGFXTransaction();
-
- switchedManager = true;
- } else if (_graphicsMode < _sdlModesCount && mode >= _sdlModesCount) {
- debug(1, "switching to OpenGL graphics");
- delete _graphicsManager;
- _graphicsManager = new OpenGLSdlGraphicsManager(_eventSource);
- ((OpenGLSdlGraphicsManager *)_graphicsManager)->initEventObserver();
- _graphicsManager->beginGFXTransaction();
-
- switchedManager = true;
- }
+ // If the new mode and the current mode are not from the same graphics
+ // manager, delete and create the new mode graphics manager
+ if (_graphicsMode >= _firstGLMode && mode < _firstGLMode) {
+ debug(1, "switching to plain SDL graphics");
+ dynamic_cast<SdlGraphicsManager *>(_graphicsManager)->deactivateManager();
+ delete _graphicsManager;
+ _graphicsManager = new SurfaceSdlGraphicsManager(_eventSource);
+
+ switchedManager = true;
+ } else if (_graphicsMode < _firstGLMode && mode >= _firstGLMode) {
+ debug(1, "switching to OpenGL graphics");
+ dynamic_cast<SdlGraphicsManager *>(_graphicsManager)->deactivateManager();
+ delete _graphicsManager;
+ _graphicsManager = new OpenGLSdlGraphicsManager(_desktopWidth, _desktopHeight, _eventSource);
+
+ switchedManager = true;
+ }
- _graphicsMode = mode;
+ _graphicsMode = mode;
- if (switchedManager) {
+ if (switchedManager) {
+ dynamic_cast<SdlGraphicsManager *>(_graphicsManager)->activateManager();
+
+ _graphicsManager->beginGFXTransaction();
#ifdef USE_RGB_COLOR
- _graphicsManager->initSize(screenWidth, screenHeight, &pixelFormat);
+ _graphicsManager->initSize(screenWidth, screenHeight, &pixelFormat);
#else
- _graphicsManager->initSize(screenWidth, screenHeight, 0);
+ _graphicsManager->initSize(screenWidth, screenHeight, 0);
#endif
- _graphicsManager->setFeatureState(kFeatureAspectRatioCorrection, arState);
- _graphicsManager->setFeatureState(kFeatureFullscreenMode, fullscreen);
- _graphicsManager->setFeatureState(kFeatureCursorPalette, cursorPalette);
+ _graphicsManager->setFeatureState(kFeatureAspectRatioCorrection, arState);
+ _graphicsManager->setFeatureState(kFeatureFullscreenMode, fullscreen);
+ _graphicsManager->setFeatureState(kFeatureCursorPalette, cursorPalette);
- // Worst part about this right now, tell the cursor manager to
- // resetup the cursor + cursor palette if necessarily
+ // Worst part about this right now, tell the cursor manager to
+ // resetup the cursor + cursor palette if necessarily
- // First we need to try to setup the old state on the new manager...
- if (_graphicsManager->endGFXTransaction() != kTransactionSuccess) {
- // Oh my god if this failed the client code might just explode.
- return false;
- }
+ // First we need to try to setup the old state on the new manager...
+ if (_graphicsManager->endGFXTransaction() != kTransactionSuccess) {
+ // Oh my god if this failed the client code might just explode.
+ return false;
+ }
- // Next setup the cursor again
- CursorMan.pushCursor(0, 0, 0, 0, 0, 0);
- CursorMan.popCursor();
+ // Next setup the cursor again
+ CursorMan.pushCursor(0, 0, 0, 0, 0, 0);
+ CursorMan.popCursor();
- // Next setup cursor palette if needed
- if (cursorPalette) {
- CursorMan.pushCursorPalette(0, 0, 0);
- CursorMan.popCursorPalette();
- }
-
- _graphicsManager->beginGFXTransaction();
- // Oh my god if this failed the client code might just explode.
- return _graphicsManager->setGraphicsMode(srcMode->id);
- } else {
- return _graphicsManager->setGraphicsMode(srcMode->id);
- }
+ // Next setup cursor palette if needed
+ if (cursorPalette) {
+ CursorMan.pushCursorPalette(0, 0, 0);
+ CursorMan.popCursorPalette();
}
- i++;
- srcMode++;
+ _graphicsManager->beginGFXTransaction();
+ // Oh my god if this failed the client code might just explode.
+ return _graphicsManager->setGraphicsMode(_graphicsModeIds[mode]);
+ } else {
+ return _graphicsManager->setGraphicsMode(_graphicsModeIds[mode]);
}
-
- return false;
}
int OSystem_SDL::getGraphicsMode() const {
- return _graphicsMode;
+ if (_graphicsModes.empty()) {
+ return _graphicsManager->getGraphicsMode();
+ } else {
+ return _graphicsMode;
+ }
}
void OSystem_SDL::setupGraphicsModes() {
- const OSystem::GraphicsMode *sdlGraphicsModes = SurfaceSdlGraphicsManager::supportedGraphicsModes();
- const OSystem::GraphicsMode *openglGraphicsModes = OpenGLSdlGraphicsManager::supportedGraphicsModes();
- _sdlModesCount = 0;
- _glModesCount = 0;
+ _graphicsModes.clear();
+ _graphicsModeIds.clear();
+ _defaultSDLMode = _defaultGLMode = -1;
// Count the number of graphics modes
- const OSystem::GraphicsMode *srcMode = sdlGraphicsModes;
+ const OSystem::GraphicsMode *srcMode;
+ int defaultMode;
+
+ GraphicsManager *manager = new SurfaceSdlGraphicsManager(_eventSource);
+ srcMode = manager->getSupportedGraphicsModes();
+ defaultMode = manager->getDefaultGraphicsMode();
while (srcMode->name) {
- _sdlModesCount++;
+ if (defaultMode == srcMode->id) {
+ _defaultSDLMode = _graphicsModes.size();
+ }
+ _graphicsModes.push_back(*srcMode);
srcMode++;
}
- srcMode = openglGraphicsModes;
+ delete manager;
+ assert(_defaultSDLMode != -1);
+
+ _firstGLMode = _graphicsModes.size();
+ manager = new OpenGLSdlGraphicsManager(_desktopWidth, _desktopHeight, _eventSource);
+ srcMode = manager->getSupportedGraphicsModes();
+ defaultMode = manager->getDefaultGraphicsMode();
while (srcMode->name) {
- _glModesCount++;
+ if (defaultMode == srcMode->id) {
+ _defaultGLMode = _graphicsModes.size();
+ }
+ _graphicsModes.push_back(*srcMode);
srcMode++;
}
-
- // Allocate enough space for merged array of modes
- _graphicsModes = new OSystem::GraphicsMode[_glModesCount + _sdlModesCount + 1];
-
- // Copy SDL graphics modes
- memcpy((void *)_graphicsModes, sdlGraphicsModes, _sdlModesCount * sizeof(OSystem::GraphicsMode));
-
- // Copy OpenGL graphics modes
- memcpy((void *)(_graphicsModes + _sdlModesCount), openglGraphicsModes, _glModesCount * sizeof(OSystem::GraphicsMode));
+ delete manager;
+ manager = nullptr;
+ assert(_defaultGLMode != -1);
// Set a null mode at the end
- memset((void *)(_graphicsModes + _sdlModesCount + _glModesCount), 0, sizeof(OSystem::GraphicsMode));
+ GraphicsMode nullMode;
+ memset(&nullMode, 0, sizeof(nullMode));
+ _graphicsModes.push_back(nullMode);
// Set new internal ids for all modes
int i = 0;
- OSystem::GraphicsMode *mode = _graphicsModes;
+ OSystem::GraphicsMode *mode = _graphicsModes.begin();
while (mode->name) {
+ _graphicsModeIds.push_back(mode->id);
mode->id = i++;
mode++;
}
diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h
index 840e73ff09..5dcc269e55 100644
--- a/backends/platform/sdl/sdl.h
+++ b/backends/platform/sdl/sdl.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -30,6 +30,8 @@
#include "backends/events/sdl/sdl-events.h"
#include "backends/log/log.h"
+#include "common/array.h"
+
/**
* Base OSystem class for all SDL ports.
*/
@@ -106,15 +108,20 @@ protected:
Backends::Log::Log *_logger;
#ifdef USE_OPENGL
- OSystem::GraphicsMode *_graphicsModes;
+ int _desktopWidth, _desktopHeight;
+
+ typedef Common::Array<GraphicsMode> GraphicsModeArray;
+ GraphicsModeArray _graphicsModes;
+ Common::Array<int> _graphicsModeIds;
int _graphicsMode;
- int _sdlModesCount;
- int _glModesCount;
+ int _firstGLMode;
+ int _defaultSDLMode;
+ int _defaultGLMode;
/**
* Creates the merged graphics modes list
*/
- virtual void setupGraphicsModes();
+ void setupGraphicsModes();
virtual const OSystem::GraphicsMode *getSupportedGraphicsModes() const;
virtual int getDefaultGraphicsMode() const;
diff --git a/backends/platform/sdl/win32/win32-main.cpp b/backends/platform/sdl/win32/win32-main.cpp
index 2b3e18e9f0..e5b26c3ff0 100644
--- a/backends/platform/sdl/win32/win32-main.cpp
+++ b/backends/platform/sdl/win32/win32-main.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/sdl/win32/win32.cpp b/backends/platform/sdl/win32/win32.cpp
index 453d566c7b..5f860ad32d 100644
--- a/backends/platform/sdl/win32/win32.cpp
+++ b/backends/platform/sdl/win32/win32.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/sdl/win32/win32.h b/backends/platform/sdl/win32/win32.h
index b56997a63b..d72d80bc26 100644
--- a/backends/platform/sdl/win32/win32.h
+++ b/backends/platform/sdl/win32/win32.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/symbian/AdaptAllMMPs.pl b/backends/platform/symbian/AdaptAllMMPs.pl
index ffc4e88aff..18a464b580 100644
--- a/backends/platform/symbian/AdaptAllMMPs.pl
+++ b/backends/platform/symbian/AdaptAllMMPs.pl
@@ -14,36 +14,48 @@ chdir("../../../");
"mmp/scummvm_cine.mmp",
"mmp/scummvm_composer.mmp",
"mmp/scummvm_cruise.mmp",
+ "mmp/scummvm_draci.mmp",
"mmp/scummvm_drascula.mmp",
"mmp/scummvm_gob.mmp",
"mmp/scummvm_groovie.mmp",
+ "mmp/scummvm_hopkins.mmp",
+ "mmp/scummvm_hugo.mmp",
"mmp/scummvm_kyra.mmp",
"mmp/scummvm_lure.mmp",
"mmp/scummvm_m4.mmp",
"mmp/scummvm_made.mmp",
+ "mmp/scummvm_mohawk.mmp",
+ "mmp/scummvm_neverhood.mmp",
"mmp/scummvm_parallaction.mmp",
+ "mmp/scummvm_pegasus.mmp",
"mmp/scummvm_queen.mmp",
"mmp/scummvm_saga.mmp",
+ "mmp/scummvm_sci.mmp",
"mmp/scummvm_scumm.mmp",
"mmp/scummvm_sky.mmp",
"mmp/scummvm_sword1.mmp",
"mmp/scummvm_sword2.mmp",
- "mmp/scummvm_touche.mmp",
- "mmp/scummvm_tinsel.mmp",
- "mmp/scummvm_tucker.mmp",
- "mmp/scummvm_sci.mmp",
- "mmp/scummvm_draci.mmp",
"mmp/scummvm_teenagent.mmp",
- "mmp/scummvm_mohawk.mmp",
- "mmp/scummvm_hugo.mmp",
+ "mmp/scummvm_tinsel.mmp",
+ "mmp/scummvm_toltecs.mmp",
+ "mmp/scummvm_tony.mmp",
"mmp/scummvm_toon.mmp",
- "mmp/scummvm_lastexpress.mmp",
+ "mmp/scummvm_touche.mmp",
"mmp/scummvm_tsage.mmp",
- "mmp/scummvm_tony.mmp",
- "mmp/scummvm_hopkins.mmp",
- "mmp/scummvm_toltecs.mmp",
- "mmp/scummvm_pegasus.mmp",
+ "mmp/scummvm_tucker.mmp",
"mmp/scummvm_wintermute.mmp",
+ # New engines
+ "mmp/scummvm_avalanche.mmp",
+ "mmp/scummvm_bbvs.mmp",
+ "mmp/scummvm_dreamweb.mmp",
+ "mmp/scummvm_fullpipe.mmp",
+ "mmp/scummvm_lastexpress.mmp",
+ "mmp/scummvm_mads.mmp",
+ "mmp/scummvm_mortevielle.mmp",
+ "mmp/scummvm_sword25.mmp",
+ "mmp/scummvm_testbed.mmp",
+ "mmp/scummvm_zvision.mmp",
+ "mmp/scummvm_voyeur.mmp",
# Target Platform Project Files
"S60/ScummVM_S60.mmp",
"S60v3/ScummVM_S60v3.mmp",
@@ -79,10 +91,14 @@ Preparing to update all the Symbian MMP project files with objects from module.m
# some modules.mk files have #ifndef ENABLE_XXXX blocks:
my @section_empty = (""); # section standard: no #ifdef's in module.mk files
-my @sections_scumm = ("", "ENABLE_SCUMM_7_8", "ENABLE_HE"); # special sections for engine SCUMM
-my @sections_saga = ("", "ENABLE_IHNM", "ENABLE_SAGA2"); # special sections for engine SAGA
-my @sections_kyra = ("", "ENABLE_LOL","ENABLE_EOB"); # special sections for engine KYRA
my @sections_agos = ("", "ENABLE_AGOS2"); # special sections for engine AGOS
+my @section_video = ("", "USE_BINK"); # special sections for engine VIDEO ###, "USE_THEORADEC"
+my @sections_groovie = ("", "ENABLE_GROOVIE2"); # special sections for engine GROOVIE
+my @sections_kyra = ("", "ENABLE_LOL","ENABLE_EOB"); # special sections for engine KYRA
+my @sections_mohawk = ("", "ENABLE_CSTIME", "ENABLE_MYST", "ENABLE_RIVEN"); # special sections for engine MOHAWK
+my @sections_saga = ("", "ENABLE_IHNM", "ENABLE_SAGA2"); # special sections for engine SAGA
+my @sections_sci = ("", "ENABLE_SCI32"); # special sections for engine SCI
+my @sections_scumm = ("", "ENABLE_SCUMM_7_8", "ENABLE_HE"); # special sections for engine SCUMM
# files excluded from build, case insensitive, will be matched in filename string only
my @excludes_snd = (
@@ -126,20 +142,21 @@ my @excludes_scumm = (
);
-#arseModule(mmpStr, dirStr, ifdefArray, [exclusionsArray])
+#ParseModule(mmpStr, dirStr, ifdefArray, [exclusionsArray])
ParseModule("_base", "base", \@section_empty); # now in ./TRG/ScummVM_TRG.mmp, these never change anyways...
ParseModule("_base", "common", \@section_empty);
ParseModule("_base", "gui", \@section_empty, \@excludes_gui);
ParseModule("_base", "graphics", \@section_empty, \@excludes_graphics);
+ParseModule("_base", "image", \@section_empty);
ParseModule("_base", "audio", \@section_empty, \@excludes_snd);
-ParseModule("_base", "video", \@section_empty);
+ParseModule("_base", "video", \@section_video); #
chdir("engines/");
ParseModule("_scumm", "scumm", \@sections_scumm, \@excludes_scumm );
ParseModule("_queen", "queen", \@section_empty);
ParseModule("_agos", "agos", \@sections_agos);
-ParseModule("_sky", "sky", \@section_empty);
-ParseModule("_gob", "gob", \@section_empty);
+ParseModule("_sky", "sky", \@section_empty);
+ParseModule("_gob", "gob", \@section_empty);
ParseModule("_saga", "saga", \@sections_saga);
ParseModule("_kyra", "kyra", \@sections_kyra);
ParseModule("_sword1", "sword1", \@section_empty);
@@ -148,29 +165,41 @@ ParseModule("_lure", "lure", \@section_empty);
ParseModule("_cine", "cine", \@section_empty);
ParseModule("_cge", "cge", \@section_empty);
ParseModule("_composer","composer", \@section_empty);
-ParseModule("_agi", "agi", \@section_empty);
+ParseModule("_agi", "agi", \@section_empty);
ParseModule("_touche", "touche", \@section_empty);
ParseModule("_parallaction","parallaction",\@section_empty);
ParseModule("_cruise", "cruise", \@section_empty);
ParseModule("_drascula","drascula", \@section_empty);
ParseModule("_made", "made", \@section_empty);
-ParseModule("_m4", "m4", \@section_empty);
+ParseModule("_m4", "m4", \@section_empty);
ParseModule("_tinsel", "tinsel", \@section_empty);
-ParseModule("_groovie", "groovie", \@section_empty);
+ParseModule("_groovie", "groovie", \@sections_groovie);
ParseModule("_tucker", "tucker", \@section_empty);
-ParseModule("_sci", "sci", \@section_empty);
+ParseModule("_sci", "sci", \@sections_sci);
ParseModule("_draci", "draci", \@section_empty);
ParseModule("_teenagent","teenagent", \@section_empty);
-ParseModule("_mohawk" ,"mohawk", \@section_empty);
+ParseModule("_mohawk" ,"mohawk", \@sections_mohawk);
ParseModule("_hugo" ,"hugo", \@section_empty);
ParseModule("_toon" ,"toon", \@section_empty);
ParseModule("_lastexpress","lastexpress", \@section_empty);
-ParseModule("_tsage","tsage", \@section_empty);
-ParseModule("_tony","tony", \@section_empty);
+ParseModule("_tsage", "tsage", \@section_empty);
+ParseModule("_tony", "tony", \@section_empty);
ParseModule("_toltecs","toltecs", \@section_empty);
ParseModule("_hopkins","hopkins", \@section_empty);
ParseModule("_pegasus","pegasus", \@section_empty);
ParseModule("_wintermute","wintermute", \@section_empty);
+##### new engines
+ParseModule("_avalanche" ,"avalanche", \@section_empty);
+ParseModule("_dreamweb" ,"dreamweb", \@section_empty);
+ParseModule("_fullpipe" ,"fullpipe", \@section_empty);
+ParseModule("_mads" ,"mads", \@section_empty);
+ParseModule("_mortevielle" ,"mortevielle", \@section_empty);
+ParseModule("_neverhood" ,"neverhood", \@section_empty);
+ParseModule("_sword25" ,"sword25", \@section_empty);
+ParseModule("_testbed" ,"testbed", \@section_empty);
+ParseModule("_zvision" ,"zvision", \@section_empty);
+ParseModule("_voyeur" ,"voyeur", \@section_empty);
+ParseModule("_bbvs" ,"bbvs", \@section_empty);
print "
=======================================================================================
Done. Enjoy :P
diff --git a/backends/platform/symbian/BuildPackageUpload_AllVersions.pl b/backends/platform/symbian/BuildPackageUpload_AllVersions.pl
index 3062068852..a038bd90f8 100644
--- a/backends/platform/symbian/BuildPackageUpload_AllVersions.pl
+++ b/backends/platform/symbian/BuildPackageUpload_AllVersions.pl
@@ -1,6 +1,7 @@
use Cwd;
use Switch;
+#use feature "switch";
system("cls");
require "BuildPackageUpload_LocalSettings.pl";
@@ -59,9 +60,14 @@ $ftp_url = "FTP://$FTP_User\@$FTP_Host/$FTP_Dir/";
# these macros are always defined:
$ExtraMacros = "MACRO NONSTANDARD_PORT\n";
-$ExtraMacros .= "MACRO ENABLE_VKEYBD\n";
+$ExtraMacros .= "MACRO ENABLE_VKEYBD\n";
$ExtraMacros .= "MACRO DISABLE_FANCY_THEMES\n";
$ExtraMacros .= "MACRO USE_TRANSLATION\n";
+$ExtraMacros .= "MACRO USE_BINK\n";
+#$ExtraMacros .= "MACRO USE_THEORADEC\n";
+#$ExtraMacros .= "MACRO USE_MPEG2\n";
+# $ExtraMacros .= "MACRO \n";
+# candidates are : , USE_TIMIDITY,
# prep nice list of SDKs
#while( ($SDK, $RootDir) = each(%SDK_RootDirs) )
diff --git a/backends/platform/symbian/BuildPackageUpload_LocalSettings.pl b/backends/platform/symbian/BuildPackageUpload_LocalSettings.pl
index ded4ef198f..12fc2668e3 100644
--- a/backends/platform/symbian/BuildPackageUpload_LocalSettings.pl
+++ b/backends/platform/symbian/BuildPackageUpload_LocalSettings.pl
@@ -2,24 +2,33 @@
##################################################################################################################
@WorkingEngines = qw(
- scumm agos sky queen gob groovie saga drascula
- kyra lure agi touche parallaction cine
- cruise made tinsel tucker sword1 sword2 draci sci teenagent mohawk hugo toon lastexpress tsage cge
- composer toltecs tony wintermute pegasus
+ agos agi bbvs cine cge composer cruise draci
+ drascula hugo gob groovie kyra lastexpress
+ lure made mohawk parallaction pegasus queen
+ saga sci scumm sky sword1 sword2 teenagent tinsel
+ toltecs tony toon touche tsage tucker wintermute
+ dreamweb fullpipe hopkins mortevielle mads
+ neverhood testbed avalanche zvision voyeur
);
+#### New engines
+#### sword25
@WorkingEngines_1st = qw(
- scumm queen groovie saga drascula
- touche parallaction cine
-? cruise made tucker lastexpress composer wintermute
+ cine composer cruise drascula groovie
+ lastexpress made parallaction queen
+ saga scumm touche tucker wintermute
+ avalanche zvision voyeur
);
@WorkingEngines_2nd = qw(
- agos sky gob kyra lure
- agi tinsel sword1 sword2
- draci sci teenagent hugo toon
- tsage cge toltecs tony pegasus
+ agi agos bbvs cge draci gob hopkins
+ hugo kyra lure mohawk pegasus sci
+ sky sword1 sword2 teenagent mads
+ tinsel tsage toltecs tony toon
+ dreamweb fullpipe mortevielle
+ neverhood testbed
);
+#### sword25
@TestingEngines = qw(
@@ -34,20 +43,34 @@
lol
agos2
eob
+ cstime
+ myst
+ riven
+ saga2
+ sci32
+ groovie2
);
#disabled subengines lol saga2 personal nightmare
+ # see configure.engines
%UseableFeatures = (
- 'zlib' => 'zlib.lib',
+ 'freetype2' => 'freetype.lib',
+ 'faad' => 'libFAAD2.lib',
+ 'flac' => 'libflacdec.lib',
+ 'jpeg' => 'libjpeg.lib',
'mad' => 'libmad.lib',
+ 'mpeg2' => 'libmpeg2.lib',
+ 'png' => 'libpng.lib',
'tremor' => 'libtremor.lib',
- 'flac' => 'libflac.lib'
+ 'theoradec' => 'theora.lib',
+ 'zlib' => 'zlib.lib'
);
# these are normally enabled for each variation
#$DefaultFeatures = qw(zlib,mad);
- $DefaultFeatures = qw(zlib,mad,tremor,flac);
+ #$DefaultFeatures = qw(zlib,mad,tremor,);
+ $DefaultFeatures = qw(faad,flac,freetype2,jpeg,mad,mpeg2,png,theoradec,tremor,zlib,);
##################################################################################################################
##
@@ -64,7 +87,8 @@
$HaltOnError = 0;
$SkipExistingPackages = 0;
$ReallyQuiet = 0;
- $DevBase = "C:\\S";
+ $DevBase = "D:\\Symbian";
+ $Compiler = "D:\\Program/ Files\\CodeSourcery\\Sourcery/ G++ Lite";
# specify an optional FTP server to upload to after each Build+Package (can leave empty)
#$FTP_Host = "host.com";
@@ -77,14 +101,14 @@
# Note1: the \epoc32 directory needs to be in these rootdirs
# Note2: these paths do NOT end in a backslash!
# $SDK_RootDirs{'UIQ2'} = "$DevBase\\UIQ_21";
- $SDK_RootDirs{'UIQ3'} = "$DevBase\\UIQ3";
+ # $SDK_RootDirs{'UIQ3'} = "$DevBase\\UIQ3";
# $SDK_RootDirs{'S60v1'} = "$DevBase\\S60v1";
# $SDK_RootDirs{'S60v2'} = "$DevBase\\S60v2";
- $SDK_RootDirs{'S60v3'} = "$DevBase\\S60v3";
+ $SDK_RootDirs{'S60v3'} = "$DevBase\\S60v5";
# $SDK_RootDirs{'S80'} = "$DevBase\\S80";
# $SDK_RootDirs{'S90'} = "$DevBase\\S90";
- $SDK_ToolchainDirs{'S60v3'} = "$DevBase\\arm-symbianelf\\bin";
+ $SDK_ToolchainDirs{'S60v3'} = "$Compiler\\arm-symbianelf\\bin";
$SDK_ToolchainDirs{'UIQ2'} = "$DevBase\\ECompXL\\bin"; # only needed for UIQ2/UIQ3
$SDK_ToolchainDirs{'UIQ3'} = "$DevBase\\ECompXL\\bin"; # only needed for UIQ2/UIQ3
@@ -94,14 +118,14 @@
{
## Standard libraries
$SDK_LibraryDirs{'ALL'}{'zlib.lib'} = "$DevBase\\zlib-1.2.2\\epoc";
- #$SDK_LibraryDirs{'ALL'}{'libmad.lib'} = "$DevBase\\libmad-0.15.1b\\group";
+ $SDK_LibraryDirs{'ALL'}{'libmad.lib'} = "$DevBase\\libmad-0.15.1b\\group";
$SDK_LibraryDirs{'ALL'}{'libtremor.lib'}= "$DevBase\\tremor\\epoc";
## SDL 1.2.12 / AnotherGuest / Symbian version
my $SdlBase = "$DevBase\\SDL-1.2.12-ag\\Symbian";
#$SDK_LibraryDirs{'S60v1'}{'esdl.lib'} = "$SdlBase\\S60"; // unsupported?
#$SDK_LibraryDirs{'S60v2'}{'esdl.lib'} = "$SdlBase\\S60v2";
- $SDK_LibraryDirs{'S60v3'}{'esdl.lib'} = "$SdlBase\\S60v3";
+ $SDK_LibraryDirs{'S60v3'}{'esdl.lib'} = "$SdlBase\\S60v5";
#$SDK_LibraryDirs{'S80'}{'esdl.lib'} = "$SdlBase\\S80";
#$SDK_LibraryDirs{'S90'}{'esdl.lib'} = "$SdlBase\\S90";
#$SDK_LibraryDirs{'UIQ2'}{'esdl.lib'} = "$SdlBase\\UIQ2"
@@ -186,7 +210,7 @@
# now you can add $VariationSets only built on this PC below this line :)
}
- elsif ($ENV{'COMPUTERNAME'} eq "EMBEDDEV-LAPE") #################################################################
+ elsif ($ENV{'COMPUTERNAME'} eq "EMBEDDEV-VAIO2") #################################################################
{
$Producer = "AnotherGuest";
$RedirectSTDERR = 1;
@@ -206,7 +230,7 @@
$SDK_RootDirs{'S60v3'}= "G:\\S60v3";
#$SDK_RootDirs{'S80'}= "D:\\S80";
#$SDK_RootDirs{'S90'}= "D:\\S90";
- $ECompXL_BinDir= "D:\\ECompXL\\";
+ #$ECompXL_BinDir= "D:\\ECompXL\\";
if (0) # so we can turn them on/off easily
{
# $SDK_LibraryDirs{'ALL'}{'zlib.lib'} = "C:\\S\\zlib-1.2.2\\epoc";
@@ -223,38 +247,42 @@
# now you can add $VariationSets only built on this PC below this line :)
}
- elsif ($ENV{'COMPUTERNAME'} eq "EMBEDDEV_VAIO1") #################################################################
+ elsif ($ENV{'COMPUTERNAME'} eq "FEDOR4EVER") #################################################################
{
- $Producer = "AnotherGuest";
+ $Producer = "Fedor";
$RedirectSTDERR = 1;
$HaltOnError = 0;
- $SkipExistingPackages = 1;
- $ReallyQuiet = 1;
+ $SkipExistingPackages = 0;
+ $ReallyQuiet = 0;
+ $Compiler = "D:\\Program/ Files\\CodeSourcery\\Sourcery/ G++/ Lite";
#$FTP_Host = "host.com";
#$FTP_User = "ag@host.com";
#$FTP_Pass = "password";
#$FTP_Dir = "cvsbuilds";
- #$SDK_RootDirs{'UIQ2'}= "D:\\UIQ2";
- $SDK_RootDirs{'UIQ3'}= "G:\\UIQ3";
- #$SDK_RootDirs{'S60v1'}= "D:\\S60v1";
- #$SDK_RootDirs{'S60v2'}= "D:\\S60v2";
- $SDK_RootDirs{'S60v3'}= "G:\\S60v3";
- #$SDK_RootDirs{'S80'}= "D:\\S80";
- #$SDK_RootDirs{'S90'}= "D:\\S90";
- #$ECompXL_BinDir= "D:\\ECompXL\\";
+ #$SDK_RootDirs{'UIQ2'}= "C:\\UIQ2";
+ #$SDK_RootDirs{'UIQ3'}= "C:\\UIQ3";
+ #$SDK_RootDirs{'S60v1'}= "C:\\S60v1";
+ #$SDK_RootDirs{'S60v2'}= "C:\\S60v2";
+ #$SDK_RootDirs{'S80'}= "C:\\S80";
+ #$SDK_RootDirs{'S90'}= "C:\\S90";
+ #$ECompXL_BinDir= "C:\\ECompXL\\";
+
+ $SDK_RootDirs{'S60v3'}= "D:\\Symbian\\S60_5th_Edition_SDK_v1.0";
+ $SDK_ToolchainDirs{'S60v3'} = "$Compiler\\arm-symbianelf\\bin";
+
+ # these supporting libraries get built first, then all the Variations
+ # Note: the string {'xxx.lib'} is used in checking in build success: so needs to be accurate!
if (0) # so we can turn them on/off easily
{
# $SDK_LibraryDirs{'ALL'}{'zlib.lib'} = "C:\\S\\zlib-1.2.2\\epoc";
-# $SDK_LibraryDirs{'ALL'}{'libmad.lib'} = "C:\\S\\libmad-0.15.1b\\group";
-# $SDK_LibraryDirs{'ALL'}{'libtremor.lib'}= "C:\\tremor\\epoc";
- $SDK_LibraryDirs{'UIQ2'}{'esdl.lib'} = "E:\\WICKED\\ESDL\\epoc\\UIQ";
- $SDK_LibraryDirs{'S60v1'}{'esdl.lib'} = $SDK_LibraryDirs{'S60v2'}{'esdl.lib'} = "E:\\WICKED\\ESDL\\epoc\\S60";
- $SDK_LibraryDirs{'S80'}{'esdl.lib'} = "E:\\WICKED\\ESDL\\epoc\\S80";
- $SDK_LibraryDirs{'S90'}{'esdl.lib'} = "E:\\WICKED\\ESDL\\epoc\\S90";
- $SDK_LibraryDirs{'S60v3'}{'esdl.lib'} = "E:\\WICKED\\ESDL\\epoc\\S60\\S60V3";
- $SDK_LibraryDirs{'UIQ3'}{'esdl.lib'} = "E:\\WICKED\\ESDL\\epoc\\UIQ\\UIQ3";
+ $SDK_LibraryDirs{'ALL'}{'libmad.lib'} = "D:\\Symbian\\Projects\\SDL\\libs\\libmad-0.15.1b\\epoc";
+# $SDK_LibraryDirs{'ALL'}{'libtremor.lib'}= "D:\\Symbian\\Projects\\SDL\\libs\\Tremor\\epoc";
+# $SDK_LibraryDirs{'UIQ2'}{'esdl.lib'} = $SDK_LibraryDirs{'UIQ3'}{'esdl.lib'} = "C:\\S\\ESDL\\epoc\\UIQ";
+# $SDK_LibraryDirs{'S60v1'}{'esdl.lib'} = $SDK_LibraryDirs{'S60v2'}{'esdl.lib'} = $SDK_LibraryDirs{'S60v3'}{'esdl.lib'} = "C:\\S\\ESDL\\epoc\\S60";
+# $SDK_LibraryDirs{'S80'}{'esdl.lib'} = "C:\\S\\ESDL\\epoc\\S80";
+# $SDK_LibraryDirs{'S90'}{'esdl.lib'} = "C:\\S\\ESDL\\epoc\\S90";
}
# now you can add $VariationSets only built on this PC below this line :)
@@ -297,9 +325,10 @@
{
# the first one includes all SDKs & release-ready engines
- $VariationSets{'ALL'}{'all'} = "$DefaultFeatures @WorkingEngines @EnablableSubEngines";
-# $VariationSets{'ALL'}{'1St'} = "$DefaultFeatures @WorkingEngines_1st @EnablableSubEngines";
-# $VariationSets{'ALL'}{'2nd'} = "$DefaultFeatures @WorkingEngines_2nd @EnablableSubEngines";
+ # $VariationSets{'ALL'}{'all'} = "$DefaultFeatures @WorkingEngines @EnablableSubEngines";
+ $VariationSets{'ALL'}{'split'} = "$DefaultFeatures @WorkingEngines @EnablableSubEngines";
+ # $VariationSets{'ALL'}{'1St'} = "$DefaultFeatures @WorkingEngines_1st @EnablableSubEngines";
+ # $VariationSets{'ALL'}{'2nd'} = "$DefaultFeatures @WorkingEngines_2nd @EnablableSubEngines";
# now one for each ready-for-release engine
if (0)
{
diff --git a/backends/platform/symbian/README b/backends/platform/symbian/README
index 58cbc7814a..8a44e9399d 100644
--- a/backends/platform/symbian/README
+++ b/backends/platform/symbian/README
@@ -1,8 +1,9 @@
ScummVM - ScummVM ported to EPOC/SymbianOS
- Copyright (C) 2008-2013 ScummVM Team
- Copyright (C) 2003-2008 Lars 'AnotherGuest' Persson
+ Copyright (C) 2008-2014 ScummVM Team
+ Copyright (C) 2013-2013 Fedor Strizhniou aka zanac
+ Copyright (C) 2003-2013 Lars 'AnotherGuest' Persson
Copyright (C) 2002-2008 Jurgen 'SumthinWicked' Braam
Copyright (C) 2003-2005 Andreas 'Sprawl' Karlsson
@@ -24,6 +25,15 @@ About ScummVM
Jurgen and Lars have successfully transfered all needed changes into CVS/SVN, with additional helpful tools for Symbian OS
Release History:
+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)
+
Release version: 1.4.0
* Nothing significant in the Symbian port, except SDL improvements (new SDL version used)
* See main readme for general ScummVM improvements, major update
diff --git a/backends/platform/symbian/S60/ScummVM_S60.mmp.in b/backends/platform/symbian/S60/ScummVM_S60.mmp.in
index 28bd11dec6..ca2ec7f930 100644
--- a/backends/platform/symbian/S60/ScummVM_S60.mmp.in
+++ b/backends/platform/symbian/S60/ScummVM_S60.mmp.in
@@ -2,7 +2,7 @@
* Copyright (C) 2003-2005 Andreas 'Sprawl' Karlsson - Original EPOC port, ESDL
* Copyright (C) 2003-2005 Lars 'AnotherGuest' Persson - Original EPOC port, Audio System
* Copyright (C) 2005 Jurgen 'SumthinWicked' Braam - EPOC/CVS maintainer
- * Copyright (C) 2005-2013 The ScummVM project
+ * Copyright (C) 2005-2014 The ScummVM Team
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
diff --git a/backends/platform/symbian/S60/ScummVM_S60_App.mmp b/backends/platform/symbian/S60/ScummVM_S60_App.mmp
index 38d6f19590..2fc39c6838 100644
--- a/backends/platform/symbian/S60/ScummVM_S60_App.mmp
+++ b/backends/platform/symbian/S60/ScummVM_S60_App.mmp
@@ -2,7 +2,7 @@
* Copyright (C) 2003-2005 Andreas 'Sprawl' Karlsson - Original EPOC port, ESDL
* Copyright (C) 2003-2005 Lars 'AnotherGuest' Persson - Original EPOC port, Audio System
* Copyright (C) 2005 Jurgen 'SumthinWicked' Braam - EPOC/CVS maintainer
- * Copyright (C) 2005-2013 The ScummVM project
+ * Copyright (C) 2005-2014 The ScummVM Team
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
diff --git a/backends/platform/symbian/S60v3/BLD.INF.in b/backends/platform/symbian/S60v3/BLD.INF.in
index 78d130cb08..e21bcc7d01 100644
--- a/backends/platform/symbian/S60v3/BLD.INF.in
+++ b/backends/platform/symbian/S60v3/BLD.INF.in
@@ -8,5 +8,6 @@ PRJ_MMPFILES
//STOP_AUTO_PROJECTS//
gnumakefile icons.mk
+gnumakefile ..\help\build_help.mk
.\ScummVM_A0000658_S60v3.mmp
.\ScummVM_S60v3.mmp
diff --git a/backends/platform/symbian/S60v3/ScummVM_A0000658_S60v3.mmp.in b/backends/platform/symbian/S60v3/ScummVM_A0000658_S60v3.mmp.in
index 99b89efba8..cbb9679340 100644
--- a/backends/platform/symbian/S60v3/ScummVM_A0000658_S60v3.mmp.in
+++ b/backends/platform/symbian/S60v3/ScummVM_A0000658_S60v3.mmp.in
@@ -34,6 +34,8 @@ TARGET ScummVM_A0000658.exe
TARGETPATH sys\bin
TARGETTYPE exe
OPTION GCCE -Wno-multichar -Wno-reorder -Wno-unused -Wno-format -fsigned-char
+// fixes error "section .data loaded at [...] overlaps section .text loaded at [...]"
+LINKEROPTION GCCE -Tdata 0xAA00000
UID 0x100039ce 0xA0000658
@@ -90,9 +92,15 @@ STATICLIBRARY esdl.lib
USERINCLUDE ..\..\..\.. ..\..\..\..\gui ..\..\..\..\engines
USERINCLUDE ..\..\..\..\backends\fs ..\src ..\..\..\..\backends\platform\sdl ..\..\..\..\audio
+SYSTEMINCLUDE \epoc32\include\freetype
+SYSTEMINCLUDE \epoc32\include\mpeg2dec
+SYSTEMINCLUDE \epoc32\include\jpeg
+SYSTEMINCLUDE \epoc32\include\png
SYSTEMINCLUDE \epoc32\include\ESDL
SYSTEMINCLUDE \epoc32\include\ZLIB // before \epoc32\include because symbian already has older version
SYSTEMINCLUDE \epoc32\include\libc
+SYSTEMINCLUDE \epoc32\include\theora
+SYSTEMINCLUDE \epoc32\include\tremor
SYSTEMINCLUDE \epoc32\include
SYSTEMINCLUDE \epoc32\include\mw
SYSTEMINCLUDE \epoc32\include\platform
diff --git a/backends/platform/symbian/S60v3/ScummVM_S60v3.mmp.in b/backends/platform/symbian/S60v3/ScummVM_S60v3.mmp.in
index 1e0f282bc4..899d10dbe3 100644
--- a/backends/platform/symbian/S60v3/ScummVM_S60v3.mmp.in
+++ b/backends/platform/symbian/S60v3/ScummVM_S60v3.mmp.in
@@ -35,6 +35,9 @@ TARGETPATH sys\bin
TARGETTYPE exe
OPTION GCCE -Wno-multichar -Wno-reorder -Wno-unused -Wno-format -fsigned-char
+// fixes error "section .data loaded at [...] overlaps section .text loaded at [...]"
+LINKEROPTION GCCE -Tdata 0xAA00000
+
UID 0x100039ce 0xA0000657
START RESOURCE ScummVM_reg.rss
@@ -90,9 +93,15 @@ STATICLIBRARY esdl.lib
USERINCLUDE ..\..\..\.. ..\..\..\..\gui ..\..\..\..\engines
USERINCLUDE ..\..\..\..\backends\fs ..\src ..\..\..\..\backends\platform\sdl ..\..\..\..\audio
+SYSTEMINCLUDE \epoc32\include\freetype
+SYSTEMINCLUDE \epoc32\include\mpeg2dec
+SYSTEMINCLUDE \epoc32\include\jpeg
+SYSTEMINCLUDE \epoc32\include\png
SYSTEMINCLUDE \epoc32\include\ESDL
SYSTEMINCLUDE \epoc32\include\ZLIB // before \epoc32\include because symbian already has older version
SYSTEMINCLUDE \epoc32\include\libc
+SYSTEMINCLUDE \epoc32\include\theora
+SYSTEMINCLUDE \epoc32\include\tremor
SYSTEMINCLUDE \epoc32\include
SYSTEMINCLUDE \epoc32\include\mw
SYSTEMINCLUDE \epoc32\include\platform
@@ -140,7 +149,7 @@ source engines\obsolete.cpp
LIBRARY cone.lib eikcore.lib
LIBRARY euser.lib apparc.lib fbscli.lib
LIBRARY estlib.lib apgrfx.lib
-LIBRARY gdi.lib hal.lib bitgdi.lib
+LIBRARY gdi.lib hal.lib bitgdi.lib esock.lib
LIBRARY mediaclientaudiostream.lib efsrv.lib ws32.lib
library avkon.lib bafl.lib remconcoreapi.lib remconinterfacebase.lib
diff --git a/backends/platform/symbian/S60v3/scummvm-CVS-SymbianS60v3.pkg b/backends/platform/symbian/S60v3/scummvm-CVS-SymbianS60v3.pkg
index 4c6b1b05f8..5f74bee1c7 100644
--- a/backends/platform/symbian/S60v3/scummvm-CVS-SymbianS60v3.pkg
+++ b/backends/platform/symbian/S60v3/scummvm-CVS-SymbianS60v3.pkg
@@ -33,7 +33,7 @@
:"ScummVM"
; UID is the app's UID
-#{"ScummVM S60v3"},(0xA0000657),1,60,0
+#{"ScummVM S60v3"},(0xA0000657),1,70,0
;Supports Series 60 v 3.0
[0x101F7961], 0, 0, 0, {"Series60ProductID"}
@@ -57,16 +57,22 @@
"..\..\..\..\README"-"!:\resource\apps\scummvm\README"
"..\..\..\..\NEWS"-"!:\resource\apps\scummvm\NEWS"
+; Scummvm help
+"..\help\ScummVM.hlp"-"!:\resource\help\ScummVM.hlp"
+
; Common datafiles needed for some games
-"..\..\..\..\dists\engine-data\kyra.dat"-"c:\data\scummvm\kyra.dat"
-"..\..\..\..\dists\engine-data\sky.cpt"-"c:\data\scummvm\sky.cpt"
+"..\..\..\..\dists\engine-data\drascula.dat"-"c:\data\scummvm\drascula.dat"
"..\..\..\..\dists\engine-data\hugo.dat"-"c:\data\scummvm\hugo.dat"
+"..\..\..\..\dists\engine-data\kyra.dat"-"c:\data\scummvm\kyra.dat"
"..\..\..\..\dists\engine-data\lure.dat"-"c:\data\scummvm\lure.dat"
-"..\..\..\..\dists\engine-data\drascula.dat"-"c:\data\scummvm\drascula.dat"
+"..\..\..\..\dists\engine-data\mort.dat"-"c:\data\scummvm\mort.dat"
+"..\..\..\..\dists\engine-data\neverhood.dat"-"c:\data\scummvm\neverhood.dat"
+"..\..\..\..\dists\engine-data\queen.tbl"-"c:\data\scummvm\queen.tbl"
+"..\..\..\..\dists\engine-data\sky.cpt"-"c:\data\scummvm\sky.cpt"
"..\..\..\..\dists\engine-data\teenagent.dat"-"c:\data\scummvm\teenagent.dat"
+"..\..\..\..\dists\engine-data\tony.dat"-"c:\data\scummvm\tony.dat"
"..\..\..\..\dists\engine-data\toon.dat"-"c:\data\scummvm\toon.dat"
"..\..\..\..\dists\engine-data\wintermute.zip"-"c:\data\scummvm\wintermute.zip"
-"..\..\..\..\dists\engine-data\tony.dat"-"c:\data\scummvm\tony.dat"
"..\..\..\vkeybd\packs\vkeybd_default.zip"-"c:\data\scummvm\vkeybd_default.zip"
"..\..\..\..\gui\themes\translations.dat"-"c:\data\scummvm\translations.dat"
"..\..\..\..\gui\themes\scummmodern.zip"-"c:\data\scummvm\scummmodern.zip"
diff --git a/backends/platform/symbian/S60v3/scummvm-CVS-SymbianS60v3_split.pkg b/backends/platform/symbian/S60v3/scummvm-CVS-SymbianS60v3_split.pkg
index d3fd0450fa..4ef085d600 100644
--- a/backends/platform/symbian/S60v3/scummvm-CVS-SymbianS60v3_split.pkg
+++ b/backends/platform/symbian/S60v3/scummvm-CVS-SymbianS60v3_split.pkg
@@ -36,7 +36,7 @@
:"ScummVM"
; UID is the app's UID
-#{"ScummVM S60v3"},(0xA0000657),1,60,0
+#{"ScummVM S60v3"},(0xA0000657),1,70,6
;Supports Series 60 v 3.0
[0x101F7961], 0, 0, 0, {"Series60ProductID"}
@@ -65,16 +65,22 @@
"..\..\..\..\README"-"!:\resource\apps\scummvm\README"
"..\..\..\..\NEWS"-"!:\resource\apps\scummvm\NEWS"
+; Scummvm help
+"..\help\ScummVM.hlp"-"!:\resource\help\ScummVM.hlp"
+
; Common datafiles needed for some games
-"..\..\..\..\dists\engine-data\kyra.dat"-"c:\data\scummvm\kyra.dat"
-"..\..\..\..\dists\engine-data\sky.cpt"-"c:\data\scummvm\sky.cpt"
+"..\..\..\..\dists\engine-data\drascula.dat"-"c:\data\scummvm\drascula.dat"
"..\..\..\..\dists\engine-data\hugo.dat"-"c:\data\scummvm\hugo.dat"
+"..\..\..\..\dists\engine-data\kyra.dat"-"c:\data\scummvm\kyra.dat"
"..\..\..\..\dists\engine-data\lure.dat"-"c:\data\scummvm\lure.dat"
-"..\..\..\..\dists\engine-data\drascula.dat"-"c:\data\scummvm\drascula.dat"
+"..\..\..\..\dists\engine-data\mort.dat"-"c:\data\scummvm\mort.dat"
+"..\..\..\..\dists\engine-data\neverhood.dat"-"c:\data\scummvm\neverhood.dat"
+"..\..\..\..\dists\engine-data\queen.tbl"-"c:\data\scummvm\queen.tbl"
+"..\..\..\..\dists\engine-data\sky.cpt"-"c:\data\scummvm\sky.cpt"
"..\..\..\..\dists\engine-data\teenagent.dat"-"c:\data\scummvm\teenagent.dat"
+"..\..\..\..\dists\engine-data\tony.dat"-"c:\data\scummvm\tony.dat"
"..\..\..\..\dists\engine-data\toon.dat"-"c:\data\scummvm\toon.dat"
-"..\..\..\..\dists\engine-data\wintermute.zip-"c:\data\scummvm\wintermute.zip"
-"..\..\..\..\dists\engine-data\tony.dat-"c:\data\scummvm\tony.dat"
+"..\..\..\..\dists\engine-data\wintermute.zip"-"c:\data\scummvm\wintermute.zip"
"..\..\..\vkeybd\packs\vkeybd_default.zip"-"c:\data\scummvm\vkeybd_default.zip"
"..\..\..\..\gui\themes\translations.dat"-"c:\data\scummvm\translations.dat"
"..\..\..\..\gui\themes\scummmodern.zip"-"c:\data\scummvm\scummmodern.zip"
diff --git a/backends/platform/symbian/S80/ScummVM_S80.mmp.in b/backends/platform/symbian/S80/ScummVM_S80.mmp.in
index d9b9a5c948..34d1979fe5 100644
--- a/backends/platform/symbian/S80/ScummVM_S80.mmp.in
+++ b/backends/platform/symbian/S80/ScummVM_S80.mmp.in
@@ -2,7 +2,7 @@
* Copyright (C) 2003-2005 Andreas 'Sprawl' Karlsson - Original EPOC port, ESDL
* Copyright (C) 2003-2005 Lars 'AnotherGuest' Persson - Original EPOC port, Audio System
* Copyright (C) 2005 Jurgen 'SumthinWicked' Braam - EPOC/CVS maintainer
- * Copyright (C) 2005-2013 The ScummVM project
+ * Copyright (C) 2005-2014 The ScummVM Team
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
diff --git a/backends/platform/symbian/S80/ScummVM_S80_App.mmp b/backends/platform/symbian/S80/ScummVM_S80_App.mmp
index 30b1c3f58b..de96963d80 100644
--- a/backends/platform/symbian/S80/ScummVM_S80_App.mmp
+++ b/backends/platform/symbian/S80/ScummVM_S80_App.mmp
@@ -2,7 +2,7 @@
* Copyright (C) 2003-2005 Andreas 'Sprawl' Karlsson - Original EPOC port, ESDL
* Copyright (C) 2003-2005 Lars 'AnotherGuest' Persson - Original EPOC port, Audio System
* Copyright (C) 2005 Jurgen 'SumthinWicked' Braam - EPOC/CVS maintainer
- * Copyright (C) 2005-2013 The ScummVM project
+ * Copyright (C) 2005-2014 The ScummVM Team
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
diff --git a/backends/platform/symbian/S90/Scummvm_S90.mmp.in b/backends/platform/symbian/S90/Scummvm_S90.mmp.in
index 790dca14f0..e65397b145 100644
--- a/backends/platform/symbian/S90/Scummvm_S90.mmp.in
+++ b/backends/platform/symbian/S90/Scummvm_S90.mmp.in
@@ -2,7 +2,7 @@
* Copyright (C) 2003-2005 Andreas 'Sprawl' Karlsson - Original EPOC port, ESDL
* Copyright (C) 2003-2005 Lars 'AnotherGuest' Persson - Original EPOC port, Audio System
* Copyright (C) 2005 Jurgen 'SumthinWicked' Braam - EPOC/CVS maintainer
- * Copyright (C) 2005-2013 The ScummVM project
+ * Copyright (C) 2005-2014 The ScummVM Team
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
diff --git a/backends/platform/symbian/S90/Scummvm_S90_App.mmp b/backends/platform/symbian/S90/Scummvm_S90_App.mmp
index cf17f103ef..88a3e4d221 100644
--- a/backends/platform/symbian/S90/Scummvm_S90_App.mmp
+++ b/backends/platform/symbian/S90/Scummvm_S90_App.mmp
@@ -2,7 +2,7 @@
* Copyright (C) 2003-2005 Andreas 'Sprawl' Karlsson - Original EPOC port, ESDL
* Copyright (C) 2003-2005 Lars 'AnotherGuest' Persson - Original EPOC port, Audio System
* Copyright (C) 2005 Jurgen 'SumthinWicked' Braam - EPOC/CVS maintainer
- * Copyright (C) 2005-2013 The ScummVM project
+ * Copyright (C) 2005-2014 The ScummVM Team
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
diff --git a/backends/platform/symbian/UIQ2/ScummVM.rss b/backends/platform/symbian/UIQ2/ScummVM.rss
index bfdd07e898..2e02f1da1d 100644
--- a/backends/platform/symbian/UIQ2/ScummVM.rss
+++ b/backends/platform/symbian/UIQ2/ScummVM.rss
@@ -2,7 +2,7 @@
* Copyright (C) 2003-2005 Andreas 'Sprawl' Karlsson - Original EPOC port, ESDL
* Copyright (C) 2003-2005 Lars 'AnotherGuest' Persson - Original EPOC port, Audio System
* Copyright (C) 2005 Jurgen 'SumthinWicked' Braam - EPOC/CVS maintainer
- * Copyright (C) 2005-2013 The ScummVM project
+ * Copyright (C) 2005-2014 The ScummVM Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
diff --git a/backends/platform/symbian/UIQ2/ScummVM_UIQ2.mmp.in b/backends/platform/symbian/UIQ2/ScummVM_UIQ2.mmp.in
index 80ba37d694..68f5bd0cab 100644
--- a/backends/platform/symbian/UIQ2/ScummVM_UIQ2.mmp.in
+++ b/backends/platform/symbian/UIQ2/ScummVM_UIQ2.mmp.in
@@ -2,7 +2,7 @@
* Copyright (C) 2003-2005 Andreas 'Sprawl' Karlsson - Original EPOC port, ESDL
* Copyright (C) 2003-2005 Lars 'AnotherGuest' Persson - Original EPOC port, Audio System
* Copyright (C) 2005 Jurgen 'SumthinWicked' Braam - EPOC/CVS maintainer
- * Copyright (C) 2005-2006 The ScummVM project
+ * Copyright (C) 2005-2006 The ScummVM Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
diff --git a/backends/platform/symbian/UIQ3/ScummVM.rss b/backends/platform/symbian/UIQ3/ScummVM.rss
index b7f0a17113..11cc767671 100644
--- a/backends/platform/symbian/UIQ3/ScummVM.rss
+++ b/backends/platform/symbian/UIQ3/ScummVM.rss
@@ -2,7 +2,7 @@
* Copyright (C) 2003-2005 Andreas 'Sprawl' Karlsson - Original EPOC port, ESDL
* Copyright (C) 2003-2005 Lars 'AnotherGuest' Persson - Original EPOC port, Audio System
* Copyright (C) 2005 Jurgen 'SumthinWicked' Braam - EPOC/CVS maintainer
- * Copyright (C) 2005-2013 The ScummVM project
+ * Copyright (C) 2005-2014 The ScummVM Team
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
diff --git a/backends/platform/symbian/UIQ3/ScummVM_A0000658.rss b/backends/platform/symbian/UIQ3/ScummVM_A0000658.rss
index b7f0a17113..11cc767671 100644
--- a/backends/platform/symbian/UIQ3/ScummVM_A0000658.rss
+++ b/backends/platform/symbian/UIQ3/ScummVM_A0000658.rss
@@ -2,7 +2,7 @@
* Copyright (C) 2003-2005 Andreas 'Sprawl' Karlsson - Original EPOC port, ESDL
* Copyright (C) 2003-2005 Lars 'AnotherGuest' Persson - Original EPOC port, Audio System
* Copyright (C) 2005 Jurgen 'SumthinWicked' Braam - EPOC/CVS maintainer
- * Copyright (C) 2005-2013 The ScummVM project
+ * Copyright (C) 2005-2014 The ScummVM Team
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
diff --git a/backends/platform/symbian/UIQ3/ScummVM_A0000658_UIQ3.mmp.in b/backends/platform/symbian/UIQ3/ScummVM_A0000658_UIQ3.mmp.in
index fac178ad15..7c9e9032d4 100644
--- a/backends/platform/symbian/UIQ3/ScummVM_A0000658_UIQ3.mmp.in
+++ b/backends/platform/symbian/UIQ3/ScummVM_A0000658_UIQ3.mmp.in
@@ -2,7 +2,7 @@
* Copyright (C) 2003-2005 Andreas 'Sprawl' Karlsson - Original EPOC port, ESDL
* Copyright (C) 2003-2009 Lars 'AnotherGuest' Persson - Original EPOC port, Audio System
* Copyright (C) 2009 Jurgen 'SumthinWicked' Braam - EPOC/CVS maintainer
- * Copyright (C) 2005-2013 The ScummVM project
+ * Copyright (C) 2005-2014 The ScummVM Team
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
@@ -35,6 +35,9 @@ TARGETPATH sys\bin
TARGETTYPE exe
OPTION GCCE -Wno-multichar -Wno-reorder -Wno-unused -Wno-format -fsigned-char
+// fixes error "section .data loaded at [...] overlaps section .text loaded at [...]"
+// in future simple add 'a'
+LINKEROPTION GCCE -Tdata 0xAA00000
UID 0x100039ce 0xA0000658
diff --git a/backends/platform/symbian/UIQ3/ScummVM_UIQ3.mmp.in b/backends/platform/symbian/UIQ3/ScummVM_UIQ3.mmp.in
index 0f1ec7f60f..ab2956af55 100644
--- a/backends/platform/symbian/UIQ3/ScummVM_UIQ3.mmp.in
+++ b/backends/platform/symbian/UIQ3/ScummVM_UIQ3.mmp.in
@@ -2,7 +2,7 @@
* Copyright (C) 2003-2005 Andreas 'Sprawl' Karlsson - Original EPOC port, ESDL
* Copyright (C) 2003-2005 Lars 'AnotherGuest' Persson - Original EPOC port, Audio System
* Copyright (C) 2005 Jurgen 'SumthinWicked' Braam - EPOC/CVS maintainer
- * Copyright (C) 2005-2013 The ScummVM project
+ * Copyright (C) 2005-2014 The ScummVM Team
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
@@ -35,6 +35,9 @@ TARGETPATH sys\bin
TARGETTYPE exe
OPTION GCCE -Wno-multichar -Wno-reorder -Wno-unused -Wno-format -fsigned-char
+// fixes error "section .data loaded at [...] overlaps section .text loaded at [...]"
+// in future simple add 'a'
+LINKEROPTION GCCE -Tdata 0xAA00000
UID 0x100039ce 0xA0000657
diff --git a/backends/platform/symbian/UIQ3/scummvm-CVS-SymbianUIQ3.pkg b/backends/platform/symbian/UIQ3/scummvm-CVS-SymbianUIQ3.pkg
index c62d25dafa..b4f1cfdd5c 100644
--- a/backends/platform/symbian/UIQ3/scummvm-CVS-SymbianUIQ3.pkg
+++ b/backends/platform/symbian/UIQ3/scummvm-CVS-SymbianUIQ3.pkg
@@ -32,7 +32,7 @@
:"ScummVM"
; UID is the app's UID
-#{"ScummVM UIQ3"},(0xA0000657),1,60,0
+#{"ScummVM UIQ3"},(0xA0000657),1,70,0
; ProductID for UIQ 3.0
; Product/platform version UID, Major, Minor, Build, Product ID
diff --git a/backends/platform/symbian/UIQ3/scummvm-CVS-SymbianUIQ3_split.pkg b/backends/platform/symbian/UIQ3/scummvm-CVS-SymbianUIQ3_split.pkg
index a37e0b0533..722e23a1b8 100644
--- a/backends/platform/symbian/UIQ3/scummvm-CVS-SymbianUIQ3_split.pkg
+++ b/backends/platform/symbian/UIQ3/scummvm-CVS-SymbianUIQ3_split.pkg
@@ -35,7 +35,7 @@
:"ScummVM"
; UID is the app's UID
-#{"ScummVM UIQ3"},(0xA0000657),1,60,0
+#{"ScummVM UIQ3"},(0xA0000657),1,70,0
; ProductID for UIQ 3.0
; Product/platform version UID, Major, Minor, Build, Product ID
diff --git a/backends/platform/symbian/UIQ3/scummvm_A0000658_loc.rss b/backends/platform/symbian/UIQ3/scummvm_A0000658_loc.rss
index 47e7c44642..f54bcc24d3 100644
--- a/backends/platform/symbian/UIQ3/scummvm_A0000658_loc.rss
+++ b/backends/platform/symbian/UIQ3/scummvm_A0000658_loc.rss
@@ -2,7 +2,7 @@
* Copyright (C) 2003-2005 Andreas 'Sprawl' Karlsson - Original EPOC port, ESDL
* Copyright (C) 2003-2005 Lars 'AnotherGuest' Persson - Original EPOC port, Audio System
* Copyright (C) 2005 Jurgen 'SumthinWicked' Braam - EPOC/CVS maintainer
- * Copyright (C) 2005-2013 The ScummVM project
+ * Copyright (C) 2005-2014 The ScummVM Team
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
diff --git a/backends/platform/symbian/help/Custom.xml b/backends/platform/symbian/help/Custom.xml
new file mode 100644
index 0000000000..8bc518e036
--- /dev/null
+++ b/backends/platform/symbian/help/Custom.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0"?>
+<!DOCTYPE cshcust SYSTEM "/cshlpcmp/dtd/CSHcust.dtd">
+<?xml:stylesheet href="/cshlpcmp/xsl/cshcust.xsl" title="CS-Help customization" type="text/xsl"?>
+<cshcust>
+<parastyle name="body" font="sansserif" size="10"/>
+<parastyle name="tip" font="sansserif" size="10" left="20"></parastyle>
+<parastyle name="note" font="sansserif" size="10" left="20"></parastyle>
+<parastyle name="important" font="sansserif" size="10" left="20"></parastyle>
+<body style="body"/>
+<titlestyle fontstyle="sansserif" size="10"/>
+<listbullet1style bulletchar="8226"/>
+<listbullet2style bulletchar="8226"/>
+<lists leftindent="20"/>
+</cshcust>
+
+
+
+
diff --git a/backends/platform/symbian/help/ScummVM.rtf b/backends/platform/symbian/help/ScummVM.rtf
new file mode 100644
index 0000000000..352e2e8776
--- /dev/null
+++ b/backends/platform/symbian/help/ScummVM.rtf
@@ -0,0 +1,341 @@
+{\rtf1\ansi\ansicpg1251\uc1 \deff1\deflang1049\deflangfe1049{\fonttbl{\f0\froman\fcharset204\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f1\fswiss\fcharset204\fprq2{\*\panose 020b0604020202020204}Arial;}
+{\f2\fmodern\fcharset204\fprq1{\*\panose 02070309020205020404}Courier New;}{\f3\froman\fcharset2\fprq2{\*\panose 05050102010706020507}Symbol;}{\f8\froman\fcharset0\fprq2{\*\panose 00000000000000000000}Tms Rmn;}
+{\f14\fnil\fcharset2\fprq2{\*\panose 05000000000000000000}Wingdings;}{\f28\fswiss\fcharset204\fprq2{\*\panose 020b0604020202020204}Arial CYR;}{\f29\fmodern\fcharset204\fprq1{\*\panose 02070309020205020404}Courier New CYR;}
+{\f30\froman\fcharset2\fprq2{\*\panose 05030102010509060703}Webdings;}{\f31\fswiss\fcharset204\fprq2{\*\panose 020b0506020202030204}Arial Narrow;}{\f44\froman\fcharset0\fprq2 Times New Roman;}{\f42\froman\fcharset238\fprq2 Times New Roman CE;}
+{\f45\froman\fcharset161\fprq2 Times New Roman Greek;}{\f46\froman\fcharset162\fprq2 Times New Roman Tur;}{\f47\froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\f48\froman\fcharset178\fprq2 Times New Roman (Arabic);}
+{\f49\froman\fcharset186\fprq2 Times New Roman Baltic;}{\f52\fswiss\fcharset0\fprq2 Arial;}{\f50\fswiss\fcharset238\fprq2 Arial CE;}{\f53\fswiss\fcharset161\fprq2 Arial Greek;}{\f54\fswiss\fcharset162\fprq2 Arial Tur;}
+{\f55\fswiss\fcharset177\fprq2 Arial (Hebrew);}{\f56\fswiss\fcharset178\fprq2 Arial (Arabic);}{\f57\fswiss\fcharset186\fprq2 Arial Baltic;}{\f60\fmodern\fcharset0\fprq1 Courier New;}{\f58\fmodern\fcharset238\fprq1 Courier New CE;}
+{\f61\fmodern\fcharset161\fprq1 Courier New Greek;}{\f62\fmodern\fcharset162\fprq1 Courier New Tur;}{\f63\fmodern\fcharset177\fprq1 Courier New (Hebrew);}{\f64\fmodern\fcharset178\fprq1 Courier New (Arabic);}
+{\f65\fmodern\fcharset186\fprq1 Courier New Baltic;}{\f268\fswiss\fcharset0\fprq2 Arial CYR;}{\f266\fswiss\fcharset238\fprq2 Arial CYR CE;}{\f269\fswiss\fcharset161\fprq2 Arial CYR Greek;}{\f270\fswiss\fcharset162\fprq2 Arial CYR Tur;}
+{\f271\fswiss\fcharset177\fprq2 Arial CYR (Hebrew);}{\f272\fswiss\fcharset178\fprq2 Arial CYR (Arabic);}{\f273\fswiss\fcharset186\fprq2 Arial CYR Baltic;}{\f276\fmodern\fcharset0\fprq1 Courier New CYR;}{\f274\fmodern\fcharset238\fprq1 Courier New CYR CE;}
+{\f277\fmodern\fcharset161\fprq1 Courier New CYR Greek;}{\f278\fmodern\fcharset162\fprq1 Courier New CYR Tur;}{\f279\fmodern\fcharset177\fprq1 Courier New CYR (Hebrew);}{\f280\fmodern\fcharset178\fprq1 Courier New CYR (Arabic);}
+{\f281\fmodern\fcharset186\fprq1 Courier New CYR Baltic;}{\f292\fswiss\fcharset0\fprq2 Arial Narrow;}{\f290\fswiss\fcharset238\fprq2 Arial Narrow CE;}{\f293\fswiss\fcharset161\fprq2 Arial Narrow Greek;}{\f294\fswiss\fcharset162\fprq2 Arial Narrow Tur;}
+{\f297\fswiss\fcharset186\fprq2 Arial Narrow Baltic;}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;
+\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}{\stylesheet{
+\ql \li0\ri0\sa120\widctlpar\nooverflow\faroman\rin0\lin0\itap0 \f1\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 \snext0 Normal;}{\s1\ql \li0\ri0\sb360\sa240\keepn\widctlpar\nooverflow\faroman\rin0\lin0\itap0
+\b\f1\fs32\lang2057\langfe1033\kerning28\cgrid\langnp2057\langfenp1033 \sbasedon0 \snext0 heading 1;}{\s2\ql \li0\ri0\sb120\sa120\keepn\widctlpar\brdrt\brdrs\brdrw30\brsp20 \brdrb\brdrs\brdrw30\brsp20 \tqr\tx9072\nooverflow\faroman\rin0\lin0\itap0
+\b\f1\fs24\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 \sbasedon0 \snext0 heading 2;}{\s3\ql \li0\ri0\sb120\sa120\keepn\widctlpar\brdrt\brdrs\brdrw30\brsp20 \tqr\tx9072\nooverflow\faroman\rin0\lin0\itap0
+\b\f1\fs28\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 \sbasedon0 \snext0 heading 3;}{\s4\ql \li0\ri0\sb120\sa120\keepn\widctlpar\brdrt\brdrs\brdrw15\brsp20 \tqr\tx9072\nooverflow\faroman\rin0\lin0\itap0
+\b\f1\fs24\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 \sbasedon0 \snext0 heading 4;}{\s5\ql \li0\ri0\sa120\keepn\widctlpar\nooverflow\faroman\rin0\lin0\itap0 \b\f1\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 \sbasedon0 \snext0
+heading 5;}{\s6\ql \li0\ri0\sb240\sa60\widctlpar\nooverflow\faroman\rin0\lin0\itap0 \i\f1\fs22\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 \sbasedon0 \snext0 heading 6;}{\s7\ql \li0\ri0\sb240\sa60\widctlpar\nooverflow\faroman\rin0\lin0\itap0
+\f1\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 \sbasedon0 \snext0 heading 7;}{\s8\ql \li0\ri0\sb240\sa60\widctlpar\nooverflow\faroman\rin0\lin0\itap0 \i\f1\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 \sbasedon0 \snext0 heading 8;}{
+\s9\ql \li0\ri0\sb240\sa60\widctlpar\nooverflow\faroman\rin0\lin0\itap0 \i\f1\fs18\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 \sbasedon0 \snext0 heading 9;}{\*\cs10 \additive Default Paragraph Font;}{\*\cs15 \additive \b\f1\fs20 \sbasedon10
+App Text;}{\s16\ql \li0\ri0\sb360\sa240\keepn\widctlpar\nooverflow\faroman\rin0\lin0\itap0 \b\f1\fs32\cf9\lang2057\langfe1033\kerning28\cgrid\langnp2057\langfenp1033 \sbasedon0 \snext16 Category UID;}{
+\s17\ql \li0\ri0\sa120\widctlpar\nooverflow\faroman\rin0\lin0\itap0 \i\f1\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 \sbasedon0 \snext17 Comment;}{\s18\ql \fi-283\li283\ri0\sa120\widctlpar\brdrb\brdrs\brdrw15\brsp20 {\*\pn
+\pnlvlblt\ilvl10\ls2047\pnrnot0\pnf30\pnstart1\pnindent283\pnhang{\pntxtb \'a2}}\nooverflow\faroman\ls2047\ilvl10\rin0\lin283\itap0 \f1\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 \sbasedon0 \snext18 Context;}{\*\cs19 \additive
+\i\f1\fs20\ulnone\cf0\nosupersub \sbasedon10 Context Comment;}{\s20\ql \li0\ri0\sa120\widctlpar\nooverflow\faroman\rin0\lin0\itap0 \f1\fs20\cf11\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 \sbasedon0 \snext20 Definition Term;}{
+\s21\ql \li0\ri0\sa120\widctlpar\nooverflow\faroman\rin0\lin0\itap0 \f1\fs20\cf11\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 \sbasedon20 \snext21 Definition Definition;}{\*\cs22 \additive \scaps\f31\fs20\cf13 \sbasedon10 Graphic Link;}{
+\s23\ql \fi-283\li283\ri0\sa120\widctlpar{\*\pn \pnlvlblt\ilvl10\ls2047\pnrnot0\pnf14\pnstart1\pnindent283\pnhang{\pntxtb F}}\nooverflow\faroman\ls2047\ilvl10\rin0\lin283\itap0 \f1\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033
+\sbasedon0 \snext23 Tip;}{\s24\ql \fi-283\li283\ri0\sa120\widctlpar{\*\pn \pnlvlblt\ilvl10\ls2047\pnrnot0\pnf14\pnstart1\pnindent283\pnhang{\pntxtb ?}}\nooverflow\faroman\ls2047\ilvl10\rin0\lin283\itap0
+\f1\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 \sbasedon23 \snext24 Note;}{\s25\ql \fi-283\li283\ri0\sa120\widctlpar{\*\pn \pnlvlblt\ilvl10\ls2047\pnrnot0\pnf30\pnstart1\pnindent283\pnhang{\pntxtb ~}}
+\nooverflow\faroman\ls2047\ilvl10\rin0\lin283\itap0 \f1\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 \sbasedon24 \snext25 Important;}{\s26\ql \fi-283\li283\ri0\sa120\widctlpar\brdrb\brdrs\brdrw15\brsp20 {\*\pn \pnlvlblt\ilvl10\ls2047\pnrnot0
+\pnf30\pnstart1\pnindent283\pnhang{\pntxtb i}}\nooverflow\faroman\ls2047\ilvl10\rin0\lin283\itap0 \f1\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 \sbasedon0 \snext26 Index;}{\*\cs27 \additive \b\f2\fs20 \sbasedon10 Key Name;}{
+\s28\ql \fi-284\li284\ri0\sa120\widctlpar{\*\pn \pnlvlbody\ilvl11\ls2047\pnrnot0\pndec\pnstart1\pnindent283\pnhang{\pntxta .}}\nooverflow\faroman\ls2047\ilvl11\rin0\lin284\itap0 \f1\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033
+\sbasedon0 \snext28 List Number;}{\s29\ql \fi-284\li284\ri0\sa120\widctlpar\tx284{\*\pn \pnlvlbody\ilvl0\ls2047\pnrnot0\pndec\pnf8 }\nooverflow\faroman\ls2047\rin0\lin284\itap0 \f1\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033
+\sbasedon28 \snext29 List Manual;}{\s30\ql \fi-284\li568\ri0\sa120\widctlpar{\*\pn \pnlvlbody\ilvl11\ls2047\pnrnot0\pndec\pnstart1\pnindent283\pnhang{\pntxta .}}\nooverflow\faroman\ls2047\ilvl11\rin0\lin568\itap0
+\f1\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 \sbasedon0 \snext30 List Number 2;}{\s31\ql \fi-284\li568\ri0\sa120\widctlpar\tx284{\*\pn \pnlvlbody\ilvl0\ls2047\pnrnot0\pndec\pnf8 }\nooverflow\faroman\ls2047\rin0\lin568\itap0
+\f1\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 \sbasedon30 \snext31 List Manual 2;}{\s32\ql \li0\ri0\sa120\widctlpar\nooverflow\faroman\rin0\lin0\itap0 \f1\fs20\cf13\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 \sbasedon0 \snext32
+Synonyms;}{\*\cs33 \additive \super \sbasedon10 endnote reference;}{\s34\ql \fi-284\li284\ri0\sa120\widctlpar\tx284{\*\pn \pnlvlblt\ilvl10\ls2047\pnrnot0\pnf3\pnstart1\pnindent283\pnhang{\pntxtb \'b7}}\nooverflow\faroman\ls2047\ilvl10\rin0\lin284\itap0
+\f1\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 \sbasedon0 \snext34 \sautoupd List Bullet;}{\s35\ql \fi-284\li568\ri0\sa120\widctlpar{\*\pn \pnlvlblt\ilvl10\ls2047\pnrnot0\pnf3\pnstart1\pnindent283\pnhang{\pntxtb \'b7}}
+\nooverflow\faroman\ls2047\ilvl10\rin0\lin568\itap0 \f1\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 \sbasedon0 \snext35 \sautoupd List Bullet 2;}{\s36\ql \li0\ri0\sa120\widctlpar\tqc\tx4153\tqr\tx8306\nooverflow\faroman\rin0\lin0\itap0
+\f1\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 \sbasedon0 \snext36 footer;}{\s37\ql \li284\ri0\sa120\widctlpar\nooverflow\faroman\rin0\lin284\itap0 \f1\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 \sbasedon0 \snext37 List Continue;}{
+\s38\ql \li566\ri0\sa120\widctlpar\nooverflow\faroman\rin0\lin566\itap0 \f1\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 \sbasedon0 \snext38 List Continue 2;}}{\*\listtable{\list\listtemplateid-737142542\listsimple{\listlevel\levelnfc0
+\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'00.;}{\levelnumbers\'01;}\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1 \fi-360\li643\jclisttab\tx643 }{\listname ;}\listid-129}
+{\list\listtemplateid1907811784\listsimple{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0
+\fi-360\li643\jclisttab\tx643 }{\listname ;}\listid-125}{\list\listtemplateid1912741052\listsimple{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'00.;}{\levelnumbers\'01;}\chbrdr
+\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1 \fi-360\li360\jclisttab\tx360 }{\listname ;}\listid-120}{\list\listtemplateid-51363132\listsimple{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0
+{\leveltext\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li360\jclisttab\tx360 }{\listname ;}\listid-119}{\list\listtemplateid947971744\listsimple{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0
+\levelfollow0\levelstartat0\levelspace0\levelindent0{\leveltext\'01*;}{\levelnumbers;}\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1 }{\listname ;}\listid-2}}{\*\listoverridetable{\listoverride\listid-120\listoverridecount0\ls1}
+{\listoverride\listid-129\listoverridecount0\ls2}{\listoverride\listid-119\listoverridecount0\ls3}{\listoverride\listid-125\listoverridecount0\ls4}{\listoverride\listid-120\listoverridecount0\ls5}{\listoverride\listid-129\listoverridecount0\ls6}
+{\listoverride\listid-119\listoverridecount0\ls7}{\listoverride\listid-125\listoverridecount0\ls8}{\listoverride\listid-120\listoverridecount0\ls9}{\listoverride\listid-129\listoverridecount0\ls10}{\listoverride\listid-119\listoverridecount0\ls11}
+{\listoverride\listid-125\listoverridecount0\ls12}{\listoverride\listid-120\listoverridecount0\ls13}{\listoverride\listid-129\listoverridecount0\ls14}{\listoverride\listid-119\listoverridecount0\ls15}{\listoverride\listid-125\listoverridecount0\ls16}
+{\listoverride\listid-120\listoverridecount0\ls17}{\listoverride\listid-129\listoverridecount0\ls18}{\listoverride\listid-119\listoverridecount0\ls19}{\listoverride\listid-125\listoverridecount0\ls20}{\listoverride\listid-2\listoverridecount1{\lfolevel
+\listoverrideformat{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelold\levelspace0\levelindent283{\leveltext\'01\u-3991 ?;}{\levelnumbers;}\f30\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-283\li283
+}}\ls21}{\listoverride\listid-2\listoverridecount1{\lfolevel\listoverrideformat{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelold\levelspace0\levelindent283{\leveltext\'01\u-3991 ?;}{\levelnumbers;}\f30\chbrdr
+\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-283\li283 }}\ls22}}{\info{\author Fedor}{\operator Fedor}{\creatim\yr2013\mo11\dy30\hr23\min4}{\revtim\yr2014\mo5\dy28\hr12\min17}{\version97}{\edmins91}{\nofpages8}{\nofwords1514}{\nofchars8634}
+{\*\company DEV}{\nofcharsws0}{\vern8249}}\margl1701\margr850\margt1134\margb1134 \deftab708\widowctrl\ftnbj\aenddoc\noxlattoyen\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\hyphcaps0\horzdoc\dghspace120\dgvspace120\dghorigin1701\dgvorigin1984\dghshow0
+\dgvshow3\jcompress\viewkind4\viewscale100\nolnhtadjtbl \fet0{\*\template E:\\Documents and Settings\\Administrator\\Application Data\\Microsoft\\\'d8\'e0\'e1\'eb\'ee\'ed\'fb\\cshelp2000.dot}\sectd \linex0\sectdefaultcl {\*\pnseclvl1
+\pnucrm\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang{\pntxta )}}{\*\pnseclvl5
+\pndec\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang
+{\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}\pard\plain \s17\ql \li0\ri0\sa120\widctlpar\nooverflow\faroman\rin0\lin0\itap0 \i\f1\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {
+\lang1033\langfe1033\langnp1033 Author: Fedor Strizhniou.}{\f28
+\par }{\lang1033\langfe1033\langnp1033 Date: November 2013}{\f28
+\par }{\lang1033\langfe1033\langnp1033 Version: 1.7.0
+\par }\pard\plain \s1\ql \li0\ri0\sb360\sa240\keepn\widctlpar\nooverflow\faroman\outlinelevel0\rin0\lin0\itap0 \b\f1\fs32\lang2057\langfe1033\kerning28\cgrid\langnp2057\langfenp1033 {ScummVM Help
+\par }\pard\plain \s16\ql \li0\ri0\sb360\sa240\keepn\widctlpar\nooverflow\faroman\rin0\lin0\itap0 \b\f1\fs32\cf9\lang2057\langfe1033\kerning28\cgrid\langnp2057\langfenp1033 {\lang1033\langfe1033\langnp1033 0x100039ce}{\lang1059\langfe1033\langnp1059
+\par }\pard\plain \ql \li0\ri0\sa120\widctlpar\nooverflow\faroman\rin0\lin0\itap0 \f1\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\f28
+\par }\pard\plain \s2\ql \li0\ri0\sb120\sa120\keepn\widctlpar\brdrt\brdrs\brdrw30\brsp20 \brdrb\brdrs\brdrw30\brsp20 \tqr\tx9072\nooverflow\faroman\outlinelevel1\rin0\lin0\itap0 \b\f1\fs24\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\b0\f28
+About ScummVM Help
+\par {\pntext\pard\plain\s26 \f30\fs20\lang2057\langfe1033\langnp2057\langfenp1033 \loch\af30\dbch\af0\hich\f30 \'69\tab}}\pard\plain \s26\ql \fi-283\li283\ri0\sa120\widctlpar\brdrb\brdrs\brdrw15\brsp20 {\*\pn \pnlvlblt\ilvl0\ls21\pnrnot0
+\pnf30\pnstart1\pnindent283\pnhang{\pntxtb i}}\nooverflow\faroman\ls21\rin0\lin283\itap0 \f1\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {About ScummVM Help
+\par }\pard\plain \ql \li0\ri0\sa120\widctlpar{\*\pn \pnlvlcont\ilvl0\ls0\pnrnot0\pndec }\nooverflow\faroman\rin0\lin0\itap0 \f1\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\f28
+\par }{
+This help file based on ScummVM forum thread with some elaborations(in Anotherguest section) and text correction. If you wish add some text or translate you may download and modify source document from https://sourceforge.net/projects/scummvms60git/ and t
+hen send me to fedor_qd@mail.ru
+\par Feel free to replace, merge or write you own instead 1st, 2nd and 3rd guides. Other sections require strict translations. And don\rquote t forget add your name :-)
+\par First guide contain help by Anotherguest, second - VincentJ, third - murgo. This doc created by Fedor Strizhniou.
+\par Enjoys, cheers! Always yours =)}{\lang1059\langfe1033\langnp1059
+\par }{\f29
+\par }\pard\plain \s2\ql \li0\ri0\sb120\sa120\keepn\widctlpar\brdrt\brdrs\brdrw30\brsp20 \brdrb\brdrs\brdrw30\brsp20 \tqr\tx9072{\*\pn \pnlvlcont\ilvl0\ls0\pnrnot0\pndec }\nooverflow\faroman\outlinelevel1\rin0\lin0\itap0
+\b\f1\fs24\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\b0\f28 1st guide
+\par {\pntext\pard\plain\s26 \f30\fs20\lang2057\langfe1033\langnp2057\langfenp1033 \loch\af30\dbch\af0\hich\f30 \'69\tab}}\pard\plain \s26\ql \fi-283\li283\ri0\sa120\widctlpar\brdrb\brdrs\brdrw15\brsp20 {\*\pn \pnlvlblt\ilvl0\ls21\pnrnot0
+\pnf30\pnstart1\pnindent283\pnhang{\pntxtb i}}\nooverflow\faroman\ls21\rin0\lin283\itap0 \f1\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {Controls, Virtual keyboard, Shortcuts, ScummVM, Tips, S60, UIQ, UIQ3, S80, s80, S90, s90
+\par }\pard\plain \ql \li0\ri0\sa120\widctlpar{\*\pn \pnlvlcont\ilvl0\ls0\pnrnot0\pndec }\nooverflow\faroman\rin0\lin0\itap0 \f1\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\f28
+\par }{UIQ3 devices: To the top right (holding the phone portrait) you four icons, from the top they are
+\par
+\par * Toggle control mode, in control mode you can change text input , screen orientation and screen scaling
+\par * Mouse button, toggles between left, right and no button when tapping the screen. If no button is selected, 7 & Space works as left mouse button and 9 & Enter works as the right mouse button.
+\par * Esc, tap this to simulate ESC key being pressed. Same functionally on devices with 'C' key.
+\par * Virtual keyboard toggle, toggles the virtual keyboard, if not enabled when selecting '1'/'7' in control mode.
+\par * When Virtual keyboard is enabled you have more onscreen keys available
+\par * Enter key
+\par * Backspace
+\par * Arrow Up/Down to scroll the keys available
+\par * Virtual keyboard, tap letters to simulate key presses.
+\par
+\par S60 and UIQ3 devices: (Control Key = Green Phone key, to activate/deactivate control mode in SDL)
+\par }{\f29
+\par }{* 1 = change Input Mode: Joystick | Keyboard | Cursor
+\par * 2,'p' = change Video Mode: Landscape | Portrait
+\par * 3,'f' = change Orientation Mode for Landscape: 90\'b0 Left | 90\'b0 Right
+\par * 4,'s' = Toggle between stretched and non-stretched modes
+\par * 5 = Toggle between interpolating stretch or not
+\par * 7,'t' = Text/Multitap input
+\par * 8,'c' = Cursor input
+\par * 9,'j' = Joystick input
+\par * 0,'m' = Mouse input
+\par * Up/Down = Alter global volume when not in 1-1 VGA mode. Pan around in VGA 1-1 Mode
+\par * # = On/Off screen keyboard transparency in some games
+\par
+\par S80 devices:
+\par
+\par * Side key 1 = Fire Joystick 1 button (JoyMode)
+\par * Side key 2 = Fire Joystick 2 button (JoyMode) or change Video Mode: Upscaled | Normal (CursorMode)
+\par * Side key 3 = change Input Mode: Joystick | Cursor
+\par
+\par S90 devices: (Control Key = OK, pressed simultaneously with other keys to activate the mode changes in SDL)
+\par
+\par * OK+1 = change Input Mode: Joystick | Cursor
+\par * OK+2 = change Video Mode: Upscaled | Normal
+\par
+\par What are these Joystick, Keyboard and Cursor modes anyway?
+\par }{\f28
+\par }{Joystick mode sends SDL joystick events to ScummVM which acts as a mouse control in ScummVM. Cursor mode sends keyboard arrows instead, so for example it can be used to navigate
+through directorylist (one hand use perhaps!?) or save games etc. Keyboard mode is only available for S60 and enables multi-tap to enter text characters in save dialogs. These modes are implemented at the underlying SDL level, so this determines the types
+ of events that ScummVM receives from SDL.
+\par What are these Shrinked, Zoomed and Upscaled modes anyway?
+\par
+\par Shrink displays the game on your screen but in a shrinked way, either in Portrait or Landscape mode, so not all the pixels can be seen. Zoom mode uses the maximum resolution of your phone displaying a smaller part of the game zoomed at 1:1 pixels. For scr
+olling in S60 Zoom mode: 0+Cursor keys to scroll around, 0+Ok button to center view. Upscale tries to fill the larger screens on S80/S90 devices in a better way for low resolution games. Currently it uses a pixel interpolation upscaling routine.
+\par
+\par You can also use a bluetooth mouse with S60v3 devices to control your game. You need the bluetooth hid library from Hinkka http://koti.mbnet.fi/hinkka/Download.html to get it to work properly.
+\par }{\f29
+\par
+\par }\pard\plain \s2\ql \li0\ri0\sb120\sa120\keepn\widctlpar\brdrt\brdrs\brdrw30\brsp20 \brdrb\brdrs\brdrw30\brsp20 \tqr\tx9072{\*\pn \pnlvlcont\ilvl0\ls0\pnrnot0\pndec }\nooverflow\faroman\outlinelevel1\rin0\lin0\itap0
+\b\f1\fs24\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\b0\f28 2nd guide
+\par {\pntext\pard\plain\s26 \f30\fs20\lang2057\langfe1033\langnp2057\langfenp1033 \loch\af30\dbch\af0\hich\f30 \'69\tab}}\pard\plain \s26\ql \fi-283\li283\ri0\sa120\widctlpar\brdrb\brdrs\brdrw15\brsp20 {\*\pn \pnlvlblt\ilvl0\ls21\pnrnot0
+\pnf30\pnstart1\pnindent283\pnhang{\pntxtb i}}\nooverflow\faroman\ls21\rin0\lin283\itap0 \f1\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {Controls, Virtual keyboard, Shortcuts, ScummVM, Tips, S60, s60
+\par }\pard\plain \ql \li0\ri0\sa120\widctlpar{\*\pn \pnlvlcont\ilvl0\ls0\pnrnot0\pndec }\nooverflow\faroman\rin0\lin0\itap0 \f1\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\f28
+\par
+\par }{More user-friendly guide for Nokia phones (based on N96 but should apply to most phones)
+\par
+\par Left Soft Key - Left Click
+\par }{\f28
+\par }{Right Soft Key - Right Click
+\par }{\f28
+\par }{Navigation buttons - Move pointer on screen
+\par }{\f28
+\par }{"C" or "Delete Key" - Space Bar (i.e. skip dialogue/cutscene)
+\par }{\f28
+\par }{* - Bring up Menu (to Save, Load and change the game's options e.g. enable subtitles, speech etc. Varies from game to game)
+\par
+\par The <> is a toggling left right mode. I.e. first click is left, next is right, next is left etc.
+\par
+\par Call Button - Enter/Exit Configuration Mode
+\par }{\f28
+\par }{Configuration Mode, when activated, shows the word "CTRL" in green in the upper right corner of the screen. It allows to quickly switch between various functions of ScummVM. The following buttons on your keypad are activated when "CTRL" is displayed :
+
+\par }{\f29
+\par }{1 - Change Input.
+\par This is the option you'll probably use the most. There are three settings; A,C and J.
+\par
+\par A - This is the "Text Input" mode. It allows you to type directl
+y into ScummVM as if you were using a keyboard. Type the same way you would when sending a text message off of your phone. Please note that the pointer is disabled when in this mode. Don't forget to exit Configuration Mode before typing!
+\par
+\par C - This is the "Cursor" mode. This emulates the arrow keys of the keyboard. Some games require using this instead of the mouse (e.g. the destruction derby section towards the end of Full Throttle).
+\par
+\par J - This is the "Joystick/Mouse" mode. Simply put, it allows you to use the navigation buttons to move the pointer around the screen. The left and right mouse buttons are used by the left and right Soft keys.
+\par
+\par The "C" button emulates the space bar, i.e. skip line of dialogue, skip cutscene or pause game (depending on the game, some games simply use the left mouse button to skip dialogue in which case it will pause the game instead)
+\par }{\f29
+\par }{2 - Toggle Landscape and Portrait
+\par Switches the screen output between having the phone held normally (Portrait) or on its side (Landscape). You'll probably never take it off Landscape mode as it offers the better display area.
+\par
+\par 3 - Change Landscape Orientation
+\par Only applies to Landscape mode, simply swaps the screen output between having the phone tilted on its left side or on its right side.
+\par
+\par 4 - Toggle Zoom On and Off
+\par Zooms in on a portion of the screen. Handy for when you are looking through a screen for items or having trouble reading subtitles. Use the navigation buttons for panning around the play area. Don't forget you'll have to exit out of Confi
+guration Mode before you can move the pointer again. Exiting Configuration Mode does not reset the zoom level.
+\par }{\f29
+\par }{5 & 6 - Unused
+\par
+\par 7 - "Text Input" mode. Shortcut for entering "Text Input" mode directly instead of cycling through the other input types using the "1" key.
+\par
+\par 8 - "Cursor" mode. Shortcut for entering "Cursor" mode directly instead of cycling through the other input types using the "1" key.
+\par
+\par 9 - "Joystick/Mouse" mode. Shortcut for entering "Joystick/Mouse" mode directly instead of cycling through the other input types using the
+\par
+\par "1" key.
+\par
+\par 0 & * - Unused (The "*" Menu is disabled in Configuration Mode")
+\par
+\par Up Navigation Button - Increase ScummVM sound volume. Note that the game itself may have its own independent sound settings (usually found under the * menu)
+\par
+\par Down Navigation Button - Decrease ScummVM sound volume. Note that the game itself may have its own independent sound settings (usually found under the * menu)
+\par }{\f29
+\par
+\par }\pard\plain \s2\ql \li0\ri0\sb120\sa120\keepn\widctlpar\brdrt\brdrs\brdrw30\brsp20 \brdrb\brdrs\brdrw30\brsp20 \tqr\tx9072{\*\pn \pnlvlcont\ilvl0\ls0\pnrnot0\pndec }\nooverflow\faroman\outlinelevel1\rin0\lin0\itap0
+\b\f1\fs24\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\b0\f28 3rd guide
+\par {\pntext\pard\plain\s26 \f30\fs20\lang2057\langfe1033\langnp2057\langfenp1033 \loch\af30\dbch\af0\hich\f30 \'69\tab}}\pard\plain \s26\ql \fi-283\li283\ri0\sa120\widctlpar\brdrb\brdrs\brdrw15\brsp20 {\*\pn \pnlvlblt\ilvl0\ls21\pnrnot0
+\pnf30\pnstart1\pnindent283\pnhang{\pntxtb i}}\nooverflow\faroman\ls21\rin0\lin283\itap0 \f1\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {Controls, Virtual keyboard, Shortcuts, ScummVM, Tips, S60, s60
+\par }\pard\plain \ql \li0\ri0\sa120\widctlpar{\*\pn \pnlvlcont\ilvl0\ls0\pnrnot0\pndec }\nooverflow\faroman\rin0\lin0\itap0 \f1\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\f28
+\par
+\par }{ScummVM keys on Nokia e71 (most likely on any other qwerty-device, too), tested on version 0.14.0svn (Feb. 18 2009
+ 05:56:07). Number keys are inserted by first pressing fn-key (leftmost key at bottom row on E71) and then pressing correct key (e.g. 5 is fn+g). You don't have to press both keys simultaneously.
+\par
+\par Basic keys:
+\par
+\par Joystick -- Move cursor (in joystick mode) / arrow keys (in keyboard / cursor mode)
+\par Joystick button -- Skip text
+\par Left soft key -- Left mouse button
+\par Right soft key -- Right mouse button (context sensitive actions in Lucas Arts' games, something else in others)
+\par Backspace -- Esc / Skips demos / Removes selected action
+\par * (fn+u) -- Menu
+\par Space -- Pause
+\par Enter -- Enter (usually same as left soft key)
+\par
+\par In main menu:
+\par Shift -- Shift (can be used to mass-add games)
+\par You can press the first letter of the game name to jump there in the games list.
+\par
+\par CTRL-keys:
+\par To use these, first click on green answer key once, so that text CTRL shows up in the northwest corner of the screen, then click the key.
+\par
+\par p / 2 -- Screen orientation
+\par s / 5 -- Screen size
+\par k / 7 -- Input mode: keyboard
+\par c / 8 -- Input mode: cursor
+\par j / 9 -- Input mode: joystick
+\par joystick up -- Volume up
+\par joystick down -- Volume down
+\par 1 -- Toggle input mode
+\par
+\par Game specific:
+\par Most games have some specific keys (the same as in desktop model of ScummVM?). For instance in Day of the Tentacle:
+\par
+\par w -- Walk to
+\par l -- Look at
+\par p -- Pick up
+\par c -- Close
+\par o -- Open
+\par g -- Give
+\par t -- Talk to
+\par s -- Push
+\par y -- Pull
+\par }{\f29
+\par }{and in Full Throttle (from the top of my head):
+\par
+\par k -- kick (foot)
+\par t -- talk (mouth)
+\par l -- look (eyes)
+\par p -- punch (hand)
+\par
+\par AGI games (King's Quest, Police Quest etc.):
+\par The games work beautifully on the E71, but there's some stupid bugs (in input). I recall finding some debug keys and "last sentence" / "inventory" -keys in earlier version, but I can't find them any more. Also you can't turn on sirens in Police Quest, whi
+ch kinda makes it unplayable.
+\par
+\par There's good side and bad side to each input mode:
+\par Keyboard (I use this primarily)
+\par }{\f29
+\par }{* goes to menu
+\par + you can erase text
+\par + moving is relatively easy
+\par - you can't type in UPPER CASE
+\par - you can't type numbers
+\par - worthless 'current key' -display on left top corner
+\par
+\par Joystick / Cursor:
+\par }{\f29
+\par }{+ you can access menus
+\par + you can type numbers (just make sure f-letter in left top corner is red before clicking "numbers". It works kinda funnily, but you'll get hang of it.)
+\par - you move mouse cursor which makes walking harder (joystick mode)
+\par - you can't erase text
+\par }{\f28
+\par }\pard\plain \s2\ql \li0\ri0\sb120\sa120\keepn\widctlpar\brdrt\brdrs\brdrw30\brsp20 \brdrb\brdrs\brdrw30\brsp20 \tqr\tx9072{\*\pn \pnlvlcont\ilvl0\ls0\pnrnot0\pndec }\nooverflow\faroman\outlinelevel1\rin0\lin0\itap0
+\b\f1\fs24\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {ScummVM1 engines list
+\par {\pntext\pard\plain\s26 \f30\fs20\lang2057\langfe1033\langnp2057\langfenp1033 \loch\af30\dbch\af0\hich\f30 \'69\tab}}\pard\plain \s26\ql \fi-283\li283\ri0\sa120\widctlpar\brdrb\brdrs\brdrw15\brsp20 {\*\pn \pnlvlblt\ilvl0\ls22\pnrnot0
+\pnf30\pnstart1\pnindent283\pnhang{\pntxtb i}}\nooverflow\faroman\ls22\rin0\lin283\itap0 \f1\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {Supported engines
+\par }\pard\plain \ql \li0\ri0\sa120\widctlpar{\*\pn \pnlvlcont\ilvl0\ls0\pnrnot0\pndec }\nooverflow\faroman\rin0\lin0\itap0 \f1\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {agi
+\par agos
+\par \tab AGOS2
+\par cine
+\par composer
+\par cruise
+\par drascula
+\par gob
+\par groovie
+\par \tab GROOVIE2
+\par kyra
+\par \tab EOB
+\par \tab LOL
+\par lastexpress
+\par made
+\par neverhood
+\par parallaction
+\par queen
+\par saga
+\par \tab IHNM
+\par \tab SAGA2
+\par scumm
+\par \tab HE
+\par \tab SCUMM_7_8
+\par touche
+\par tucker
+\par wintermute
+\par
+\par }\pard\plain \s2\ql \li0\ri0\sb120\sa120\keepn\widctlpar\brdrt\brdrs\brdrw30\brsp20 \brdrb\brdrs\brdrw30\brsp20 \tqr\tx9072{\*\pn \pnlvlcont\ilvl0\ls0\pnrnot0\pndec }\nooverflow\faroman\outlinelevel1\rin0\lin0\itap0
+\b\f1\fs24\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {ScummVM2 engines list
+\par {\pntext\pard\plain\s26 \f30\fs20\lang2057\langfe1033\langnp2057\langfenp1033 \loch\af30\dbch\af0\hich\f30 \'69\tab}}\pard\plain \s26\ql \fi-283\li283\ri0\sa120\widctlpar\brdrb\brdrs\brdrw15\brsp20 {\*\pn \pnlvlblt\ilvl0\ls22\pnrnot0
+\pnf30\pnstart1\pnindent283\pnhang{\pntxtb i}}\nooverflow\faroman\ls22\rin0\lin283\itap0 \f1\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {Supported engines
+\par }\pard\plain \ql \li0\ri0\sa120\widctlpar\nooverflow\faroman\rin0\lin0\itap0 \f1\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {avalanche
+\par cge
+\par composer
+\par draci
+\par dreamweb
+\par fullpipe
+\par hopkins
+\par hugo
+\par lure
+\par mads
+\par mohawk
+\par \tab CSTIME
+\par \tab MYST
+\par \tab RIVEN
+\par mortevielle
+\par pegasus
+\par sci
+\par \tab SCI32
+\par sky
+\par sword1
+\par sword2
+\par sword25(Not supported)
+\par teenagent
+\par testbed
+\par tinsel
+\par toltecs
+\par tony
+\par toon
+\par tsage
+\par zvision
+\par }} \ No newline at end of file
diff --git a/backends/platform/symbian/help/ScummVM.xml b/backends/platform/symbian/help/ScummVM.xml
new file mode 100644
index 0000000000..a1a787012a
--- /dev/null
+++ b/backends/platform/symbian/help/ScummVM.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?xml:stylesheet href="\epoc32\tools\cshlpcmp\xsl\CSHproj.xsl" title="CS Help project" type="text/xsl"?>
+<!DOCTYPE cshproj SYSTEM "\epoc32\tools\cshlpcmp\dtd\CSHproj.dtd">
+
+<cshproj>
+ <helpfileUID>0x100039ce</helpfileUID> <!-- From help file -->
+ <directories>
+ <input></input>
+ <output></output>
+ <working></working>
+ </directories>
+ <files>
+ <source>
+ <file>ScummVM.rtf</file>
+ </source>
+ <destination>ScummVM.hlp</destination>
+ <customization>custom.xml</customization>
+ </files>
+</cshproj>
diff --git a/backends/platform/symbian/help/build_help.mk b/backends/platform/symbian/help/build_help.mk
new file mode 100644
index 0000000000..7a18ad8252
--- /dev/null
+++ b/backends/platform/symbian/help/build_help.mk
@@ -0,0 +1,29 @@
+# ============================================================================
+# Name : help.mk
+# Part of : ScummVM
+#
+# Description: This is file for creating .hlp file
+#
+# ============================================================================
+
+
+makmake :
+ cshlpcmp ScummVM.xml
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+ copy ScummVM.hlp $(EPOCROOT)epoc32\$(PLATFORM)\c\resource\help
+endif
+
+clean :
+ del ScummVM.hlp
+ del ScummVM.hlp.hrh
+
+bld :
+ cshlpcmp ScummVM.xml
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+ copy ScummVM.hlp $(EPOCROOT)epoc32\$(PLATFORM)\c\resource\help
+endif
+
+freeze lib cleanlib final resource savespace releasables :
+
diff --git a/backends/platform/symbian/mmp/scummvm_agi.mmp.in b/backends/platform/symbian/mmp/scummvm_agi.mmp.in
index 892ed57732..d6f9e54b7d 100644
--- a/backends/platform/symbian/mmp/scummvm_agi.mmp.in
+++ b/backends/platform/symbian/mmp/scummvm_agi.mmp.in
@@ -57,5 +57,15 @@ SOURCEPATH ..\..\..\..\engines\agi
USERINCLUDE ..\..\..\..\engines
USERINCLUDE ..\..\..\.. ..\..\..\..\gui ..\..\..\..\audio ..\src
+
+SYSTEMINCLUDE \epoc32\include\freetype
+SYSTEMINCLUDE \epoc32\include\mpeg2dec
+SYSTEMINCLUDE \epoc32\include\jpeg
+SYSTEMINCLUDE \epoc32\include\png
+SYSTEMINCLUDE \epoc32\include\ESDL
SYSTEMINCLUDE \epoc32\include\ZLIB // before \epoc32\include because symbian already has older version
-SYSTEMINCLUDE \epoc32\include \epoc32\include\libc ..\src
+SYSTEMINCLUDE \epoc32\include\libc
+SYSTEMINCLUDE \epoc32\include\theora
+SYSTEMINCLUDE \epoc32\include\tremor
+SYSTEMINCLUDE \epoc32\include
+SYSTEMINCLUDE ..\src // for portdefs.h
diff --git a/backends/platform/symbian/mmp/scummvm_agos.mmp.in b/backends/platform/symbian/mmp/scummvm_agos.mmp.in
index d3bc84ed51..d2b1329a24 100644
--- a/backends/platform/symbian/mmp/scummvm_agos.mmp.in
+++ b/backends/platform/symbian/mmp/scummvm_agos.mmp.in
@@ -63,5 +63,15 @@ SOURCEPATH ..\..\..\..\engines\agos
USERINCLUDE ..\..\..\..\engines
USERINCLUDE ..\..\..\.. ..\..\..\..\gui ..\..\..\..\audio ..\src
+
+SYSTEMINCLUDE \epoc32\include\freetype
+SYSTEMINCLUDE \epoc32\include\mpeg2dec
+SYSTEMINCLUDE \epoc32\include\jpeg
+SYSTEMINCLUDE \epoc32\include\png
+SYSTEMINCLUDE \epoc32\include\ESDL
SYSTEMINCLUDE \epoc32\include\ZLIB // before \epoc32\include because symbian already has older version
-SYSTEMINCLUDE \epoc32\include \epoc32\include\libc ..\src
+SYSTEMINCLUDE \epoc32\include\libc
+SYSTEMINCLUDE \epoc32\include\theora
+SYSTEMINCLUDE \epoc32\include\tremor
+SYSTEMINCLUDE \epoc32\include
+SYSTEMINCLUDE ..\src // for portdefs.h
diff --git a/backends/platform/symbian/mmp/scummvm_avalanche.mmp.in b/backends/platform/symbian/mmp/scummvm_avalanche.mmp.in
new file mode 100644
index 0000000000..5260edc79d
--- /dev/null
+++ b/backends/platform/symbian/mmp/scummvm_avalanche.mmp.in
@@ -0,0 +1,72 @@
+/* ScummVM - Graphic Adventure Engine
+ * Copyright (C) 2003-2005 Andreas 'Sprawl' Karlsson - Original EPOC port, ESDL
+ * Copyright (C) 2003-2005 Lars 'AnotherGuest' Persson - Original EPOC port, Audio System
+ * Copyright (C) 2005 Jurgen 'SumthinWicked' Braam - EPOC/CVS maintainer
+ * Copyright (C) 2005-2013 The ScummVM project
+ * Copyright (C) 2013 Strizniou Fedor
+ *
+ * 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
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+//
+// EPOC MMP makefile project for ScummVM
+//
+
+// *** Definitions
+
+TARGET scummvm_avalanche.lib
+TARGETTYPE lib
+OPTION MSVC /QIfist /Ob1 /Oy /GF // /QIfist disables use of __ftol2 to avoid linker probs with MS libc: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/vcrefQIfistSuppress_ftol.asp
+OPTION GCC -Wno-multichar -Wno-reorder // don't optimize for ARM, platform way too sensitive for that :( just turn off some common warnings
+OPTION GCCE -Wno-multichar -Wno-reorder -Wno-unused -Wno-format -fsigned-char
+ALWAYS_BUILD_AS_ARM
+
+//START_AUTO_MACROS_SLAVE//
+
+ // empty base file, will be updated by Perl build scripts
+
+//STOP_AUTO_MACROS_SLAVE//
+
+// *** SOURCE files
+
+SOURCEPATH ..\..\..\..\engines\avalanche
+
+//START_AUTO_OBJECTS_AVALANCHE_//
+
+ // empty base file, will be updated by Perl build scripts
+
+//STOP_AUTO_OBJECTS_AVALANCHE_//
+
+// *** Include paths
+
+USERINCLUDE ..\..\..\..\engines
+USERINCLUDE ..\..\..\.. ..\..\..\..\gui ..\..\..\..\audio ..\src
+
+SYSTEMINCLUDE \epoc32\include\freetype
+SYSTEMINCLUDE \epoc32\include\mpeg2dec
+SYSTEMINCLUDE \epoc32\include\jpeg
+SYSTEMINCLUDE \epoc32\include\png
+SYSTEMINCLUDE \epoc32\include\ESDL
+SYSTEMINCLUDE \epoc32\include\ZLIB // before \epoc32\include because symbian already has older version
+SYSTEMINCLUDE \epoc32\include\libc
+SYSTEMINCLUDE \epoc32\include\theora
+SYSTEMINCLUDE \epoc32\include\tremor
+SYSTEMINCLUDE \epoc32\include
+SYSTEMINCLUDE ..\src // for portdefs.h
diff --git a/backends/platform/symbian/mmp/scummvm_base.mmp.in b/backends/platform/symbian/mmp/scummvm_base.mmp.in
index d6dfafd014..37c68bf237 100644
--- a/backends/platform/symbian/mmp/scummvm_base.mmp.in
+++ b/backends/platform/symbian/mmp/scummvm_base.mmp.in
@@ -34,7 +34,9 @@ TARGET scummvm_base.lib
TARGETTYPE lib
OPTION MSVC /QIfist /Ob1 /Oy /GF // /QIfist disables use of __ftol2 to avoid linker probs with MS libc: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/vcrefQIfistSuppress_ftol.asp
OPTION GCC -Wno-multichar -Wno-reorder // don't optimize for ARM, platform way too sensitive for that :( just turn off some common warnings
-OPTION GCCE -Wno-multichar -Wno-reorder -Wno-unused -Wno-format -fsigned-char
+// using option -Wno-psabi to supress warning "note: the mangling of 'va_list' has changed in GCC 4.4"
+// compiler must use png.h from libpng.lib instead ScummVM's
+OPTION GCCE -Wno-multichar -Wno-reorder -Wno-unused -Wno-format -fsigned-char -Wno-psabi -I'/Symbian/S60_5th_Edition_SDK_v1.0/epoc32/include/png'
ALWAYS_BUILD_AS_ARM
// Note: the LIB:*.lib statements are used by AdaptAllMMPs.pl, so don't remove them!
@@ -50,15 +52,18 @@ ALWAYS_BUILD_AS_ARM
USERINCLUDE ..\..\..\.. ..\..\..\..\gui ..\..\..\..\audio
USERINCLUDE ..\..\..\..\backends\fs ..\src ..\..\..\..\backends\platform\sdl
+USERINCLUDE \epoc32\include\mpeg2dec //\epoc32\include\theora
+SYSTEMINCLUDE \epoc32\include\freetype
+SYSTEMINCLUDE \epoc32\include\mpeg2dec
+SYSTEMINCLUDE \epoc32\include\jpeg
+SYSTEMINCLUDE \epoc32\include\png
SYSTEMINCLUDE \epoc32\include\ESDL
SYSTEMINCLUDE \epoc32\include\ZLIB // before \epoc32\include because symbian already has older version
SYSTEMINCLUDE \epoc32\include\libc
+SYSTEMINCLUDE \epoc32\include\theora
SYSTEMINCLUDE \epoc32\include\tremor
SYSTEMINCLUDE \epoc32\include
-SYSTEMINCLUDE \epoc32\include\mw
-SYSTEMINCLUDE \epoc32\include\platform
-SYSTEMINCLUDE \epoc32\include\platform\mw
SYSTEMINCLUDE ..\src // for portdefs.h
// *** SOURCE files
@@ -80,6 +85,14 @@ SOURCEPATH ..\..\..\..\graphics
//STOP_AUTO_OBJECTS_GRAPHICS_//
+SOURCEPATH ..\..\..\..\image
+//START_AUTO_OBJECTS_IMAGE_//
+
+ // empty base file, will be updated by Perl build scripts
+
+//STOP_AUTO_OBJECTS_IMAGE_//
+
+
SOURCEPATH ..\..\..\..\gui
//START_AUTO_OBJECTS_GUI_//
@@ -115,6 +128,11 @@ SOURCEPATH ..\..\..\..\video
//STOP_AUTO_OBJECTS_VIDEO_//
// add a few files manually, since they are not parsed from modules.mk files
+SOURCE theora_decoder.cpp
+SOURCE bink_decoder.cpp
+// add a few files manually, since they are not parsed from modules.mk files
+SOURCE codecs\mpeg.cpp
+
SOURCEPATH ..\..\..\..
SOURCE backends\events\default\default-events.cpp
SOURCE backends\timer\default\default-timer.cpp
@@ -156,4 +174,5 @@ SOURCE backends\vkeybd\virtual-keyboard.cpp
// Downscaler
SOURCE graphics\scaler\downscaler.cpp
+SOURCE graphics\scaler\downscalerARM.s
MACRO SDL_BACKEND
diff --git a/backends/platform/symbian/mmp/scummvm_bbvs.mmp.in b/backends/platform/symbian/mmp/scummvm_bbvs.mmp.in
new file mode 100644
index 0000000000..b4981e6eec
--- /dev/null
+++ b/backends/platform/symbian/mmp/scummvm_bbvs.mmp.in
@@ -0,0 +1,72 @@
+/* ScummVM - Graphic Adventure Engine
+ * Copyright (C) 2003-2005 Andreas 'Sprawl' Karlsson - Original EPOC port, ESDL
+ * Copyright (C) 2003-2005 Lars 'AnotherGuest' Persson - Original EPOC port, Audio System
+ * Copyright (C) 2005 Jurgen 'SumthinWicked' Braam - EPOC/CVS maintainer
+ * Copyright (C) 2005-2014 The ScummVM Team
+ * Copyright (C) 2014 Fedor Strizhniou - Epoc project file
+ *
+ * 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
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+//
+// EPOC MMP makefile project for ScummVM
+//
+
+// *** Definitions
+
+TARGET scummvm_bbvs.lib
+TARGETTYPE lib
+OPTION MSVC /QIfist /Ob1 /Oy /GF // /QIfist disables use of __ftol2 to avoid linker probs with MS libc: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/vcrefQIfistSuppress_ftol.asp
+OPTION GCC -Wno-multichar -Wno-reorder // don't optimize for ARM, platform way too sensitive for that :( just turn off some common warnings
+OPTION GCCE -Wno-multichar -Wno-reorder -Wno-unused -Wno-format -fsigned-char
+ALWAYS_BUILD_AS_ARM
+
+//START_AUTO_MACROS_SLAVE//
+
+ // empty base file, will be updated by Perl build scripts
+
+//STOP_AUTO_MACROS_SLAVE//
+
+// *** SOURCE files
+
+SOURCEPATH ..\..\..\..\engines\bbvs
+
+//START_AUTO_OBJECTS_BBVS_//
+
+ // empty base file, will be updated by Perl build scripts
+
+//STOP_AUTO_OBJECTS_BBVS_//
+
+// *** Include paths
+
+USERINCLUDE ..\..\..\..\engines
+USERINCLUDE ..\..\..\.. ..\..\..\..\gui ..\..\..\..\audio ..\src
+
+SYSTEMINCLUDE \epoc32\include\freetype
+SYSTEMINCLUDE \epoc32\include\mpeg2dec
+SYSTEMINCLUDE \epoc32\include\jpeg
+SYSTEMINCLUDE \epoc32\include\png
+SYSTEMINCLUDE \epoc32\include\ESDL
+SYSTEMINCLUDE \epoc32\include\ZLIB // before \epoc32\include because symbian already has older version
+SYSTEMINCLUDE \epoc32\include\libc
+SYSTEMINCLUDE \epoc32\include\theora
+SYSTEMINCLUDE \epoc32\include\tremor
+SYSTEMINCLUDE \epoc32\include
+SYSTEMINCLUDE ..\src // for portdefs.h
diff --git a/backends/platform/symbian/mmp/scummvm_cge.mmp.in b/backends/platform/symbian/mmp/scummvm_cge.mmp.in
index 66a689efd8..35cb0f2f98 100644
--- a/backends/platform/symbian/mmp/scummvm_cge.mmp.in
+++ b/backends/platform/symbian/mmp/scummvm_cge.mmp.in
@@ -57,5 +57,15 @@ SOURCEPATH ..\..\..\..\engines\cge
USERINCLUDE ..\..\..\..\engines
USERINCLUDE ..\..\..\.. ..\..\..\..\gui ..\..\..\..\audio ..\src
+
+SYSTEMINCLUDE \epoc32\include\freetype
+SYSTEMINCLUDE \epoc32\include\mpeg2dec
+SYSTEMINCLUDE \epoc32\include\jpeg
+SYSTEMINCLUDE \epoc32\include\png
+SYSTEMINCLUDE \epoc32\include\ESDL
SYSTEMINCLUDE \epoc32\include\ZLIB // before \epoc32\include because symbian already has older version
-SYSTEMINCLUDE \epoc32\include \epoc32\include\libc ..\src
+SYSTEMINCLUDE \epoc32\include\libc
+SYSTEMINCLUDE \epoc32\include\theora
+SYSTEMINCLUDE \epoc32\include\tremor
+SYSTEMINCLUDE \epoc32\include
+SYSTEMINCLUDE ..\src // for portdefs.h
diff --git a/backends/platform/symbian/mmp/scummvm_cine.mmp.in b/backends/platform/symbian/mmp/scummvm_cine.mmp.in
index cb7143b837..99b45cddb8 100644
--- a/backends/platform/symbian/mmp/scummvm_cine.mmp.in
+++ b/backends/platform/symbian/mmp/scummvm_cine.mmp.in
@@ -57,4 +57,15 @@ SOURCEPATH ..\..\..\..\engines\cine
USERINCLUDE ..\..\..\..\engines
USERINCLUDE ..\..\..\.. ..\..\..\..\gui ..\..\..\..\audio ..\src
-SYSTEMINCLUDE \epoc32\include \epoc32\include\libc ..\src
+
+SYSTEMINCLUDE \epoc32\include\freetype
+SYSTEMINCLUDE \epoc32\include\mpeg2dec
+SYSTEMINCLUDE \epoc32\include\jpeg
+SYSTEMINCLUDE \epoc32\include\png
+SYSTEMINCLUDE \epoc32\include\ESDL
+SYSTEMINCLUDE \epoc32\include\ZLIB // before \epoc32\include because symbian already has older version
+SYSTEMINCLUDE \epoc32\include\libc
+SYSTEMINCLUDE \epoc32\include\theora
+SYSTEMINCLUDE \epoc32\include\tremor
+SYSTEMINCLUDE \epoc32\include
+SYSTEMINCLUDE ..\src // for portdefs.h
diff --git a/backends/platform/symbian/mmp/scummvm_composer.mmp.in b/backends/platform/symbian/mmp/scummvm_composer.mmp.in
index 19215f65a6..5a215f2d8d 100644
--- a/backends/platform/symbian/mmp/scummvm_composer.mmp.in
+++ b/backends/platform/symbian/mmp/scummvm_composer.mmp.in
@@ -57,5 +57,15 @@ SOURCEPATH ..\..\..\..\engines\COMPOSER
USERINCLUDE ..\..\..\..\engines
USERINCLUDE ..\..\..\.. ..\..\..\..\gui ..\..\..\..\audio ..\src
+
+SYSTEMINCLUDE \epoc32\include\freetype
+SYSTEMINCLUDE \epoc32\include\mpeg2dec
+SYSTEMINCLUDE \epoc32\include\jpeg
+SYSTEMINCLUDE \epoc32\include\png
+SYSTEMINCLUDE \epoc32\include\ESDL
SYSTEMINCLUDE \epoc32\include\ZLIB // before \epoc32\include because symbian already has older version
-SYSTEMINCLUDE \epoc32\include \epoc32\include\libc ..\src
+SYSTEMINCLUDE \epoc32\include\libc
+SYSTEMINCLUDE \epoc32\include\theora
+SYSTEMINCLUDE \epoc32\include\tremor
+SYSTEMINCLUDE \epoc32\include
+SYSTEMINCLUDE ..\src // for portdefs.h
diff --git a/backends/platform/symbian/mmp/scummvm_cruise.mmp.in b/backends/platform/symbian/mmp/scummvm_cruise.mmp.in
index c26e93dedc..21a674dc1f 100644
--- a/backends/platform/symbian/mmp/scummvm_cruise.mmp.in
+++ b/backends/platform/symbian/mmp/scummvm_cruise.mmp.in
@@ -57,4 +57,15 @@ SOURCEPATH ..\..\..\..\engines\cruise
USERINCLUDE ..\..\..\..\engines
USERINCLUDE ..\..\..\.. ..\..\..\..\gui ..\..\..\..\audio ..\src
-SYSTEMINCLUDE \epoc32\include \epoc32\include\libc ..\src
+
+SYSTEMINCLUDE \epoc32\include\freetype
+SYSTEMINCLUDE \epoc32\include\mpeg2dec
+SYSTEMINCLUDE \epoc32\include\jpeg
+SYSTEMINCLUDE \epoc32\include\png
+SYSTEMINCLUDE \epoc32\include\ESDL
+SYSTEMINCLUDE \epoc32\include\ZLIB // before \epoc32\include because symbian already has older version
+SYSTEMINCLUDE \epoc32\include\libc
+SYSTEMINCLUDE \epoc32\include\theora
+SYSTEMINCLUDE \epoc32\include\tremor
+SYSTEMINCLUDE \epoc32\include
+SYSTEMINCLUDE ..\src // for portdefs.h
diff --git a/backends/platform/symbian/mmp/scummvm_draci.mmp.in b/backends/platform/symbian/mmp/scummvm_draci.mmp.in
index 52f862bc6f..fe899a91ff 100644
--- a/backends/platform/symbian/mmp/scummvm_draci.mmp.in
+++ b/backends/platform/symbian/mmp/scummvm_draci.mmp.in
@@ -57,5 +57,15 @@ SOURCEPATH ..\..\..\..\engines\draci
USERINCLUDE ..\..\..\..\engines
USERINCLUDE ..\..\..\.. ..\..\..\..\gui ..\..\..\..\audio ..\src
+
+SYSTEMINCLUDE \epoc32\include\freetype
+SYSTEMINCLUDE \epoc32\include\mpeg2dec
+SYSTEMINCLUDE \epoc32\include\jpeg
+SYSTEMINCLUDE \epoc32\include\png
+SYSTEMINCLUDE \epoc32\include\ESDL
SYSTEMINCLUDE \epoc32\include\ZLIB // before \epoc32\include because symbian already has older version
-SYSTEMINCLUDE \epoc32\include \epoc32\include\libc ..\src
+SYSTEMINCLUDE \epoc32\include\libc
+SYSTEMINCLUDE \epoc32\include\theora
+SYSTEMINCLUDE \epoc32\include\tremor
+SYSTEMINCLUDE \epoc32\include
+SYSTEMINCLUDE ..\src // for portdefs.h
diff --git a/backends/platform/symbian/mmp/scummvm_drascula.mmp.in b/backends/platform/symbian/mmp/scummvm_drascula.mmp.in
index 9ea02fefe8..8f532d4498 100644
--- a/backends/platform/symbian/mmp/scummvm_drascula.mmp.in
+++ b/backends/platform/symbian/mmp/scummvm_drascula.mmp.in
@@ -57,4 +57,15 @@ SOURCEPATH ..\..\..\..\engines\drascula
USERINCLUDE ..\..\..\..\engines
USERINCLUDE ..\..\..\.. ..\..\..\..\gui ..\..\..\..\audio ..\src
-SYSTEMINCLUDE \epoc32\include \epoc32\include\libc ..\src
+
+SYSTEMINCLUDE \epoc32\include\freetype
+SYSTEMINCLUDE \epoc32\include\mpeg2dec
+SYSTEMINCLUDE \epoc32\include\jpeg
+SYSTEMINCLUDE \epoc32\include\png
+SYSTEMINCLUDE \epoc32\include\ESDL
+SYSTEMINCLUDE \epoc32\include\ZLIB // before \epoc32\include because symbian already has older version
+SYSTEMINCLUDE \epoc32\include\libc
+SYSTEMINCLUDE \epoc32\include\theora
+SYSTEMINCLUDE \epoc32\include\tremor
+SYSTEMINCLUDE \epoc32\include
+SYSTEMINCLUDE ..\src // for portdefs.h
diff --git a/backends/platform/symbian/mmp/scummvm_dreamweb.mmp.in b/backends/platform/symbian/mmp/scummvm_dreamweb.mmp.in
new file mode 100644
index 0000000000..89ffd23ebd
--- /dev/null
+++ b/backends/platform/symbian/mmp/scummvm_dreamweb.mmp.in
@@ -0,0 +1,72 @@
+/* ScummVM - Graphic Adventure Engine
+ * Copyright (C) 2003-2005 Andreas 'Sprawl' Karlsson - Original EPOC port, ESDL
+ * Copyright (C) 2003-2005 Lars 'AnotherGuest' Persson - Original EPOC port, Audio System
+ * Copyright (C) 2005 Jurgen 'SumthinWicked' Braam - EPOC/CVS maintainer
+ * Copyright (C) 2005-2013 The ScummVM project
+ * Copyright (C) 2013 Strizniou Fedor
+ *
+ * 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
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+//
+// EPOC MMP makefile project for ScummVM
+//
+
+// *** Definitions
+
+TARGET scummvm_dreamweb.lib
+TARGETTYPE lib
+OPTION MSVC /QIfist /Ob1 /Oy /GF // /QIfist disables use of __ftol2 to avoid linker probs with MS libc: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/vcrefQIfistSuppress_ftol.asp
+OPTION GCC -Wno-multichar -Wno-reorder // don't optimize for ARM, platform way too sensitive for that :( just turn off some common warnings
+OPTION GCCE -Wno-multichar -Wno-reorder -Wno-unused -Wno-format -fsigned-char
+ALWAYS_BUILD_AS_ARM
+
+//START_AUTO_MACROS_SLAVE//
+
+ // empty base file, will be updated by Perl build scripts
+
+//STOP_AUTO_MACROS_SLAVE//
+
+// *** SOURCE files
+
+SOURCEPATH ..\..\..\..\engines\dreamweb
+
+//START_AUTO_OBJECTS_DREAMWEB_//
+
+ // empty base file, will be updated by Perl build scripts
+
+//STOP_AUTO_OBJECTS_DREAMWEB_//
+
+// *** Include paths
+
+USERINCLUDE ..\..\..\..\engines
+USERINCLUDE ..\..\..\.. ..\..\..\..\gui ..\..\..\..\audio ..\src
+
+SYSTEMINCLUDE \epoc32\include\freetype
+SYSTEMINCLUDE \epoc32\include\mpeg2dec
+SYSTEMINCLUDE \epoc32\include\jpeg
+SYSTEMINCLUDE \epoc32\include\png
+SYSTEMINCLUDE \epoc32\include\ESDL
+SYSTEMINCLUDE \epoc32\include\ZLIB // before \epoc32\include because symbian already has older version
+SYSTEMINCLUDE \epoc32\include\libc
+SYSTEMINCLUDE \epoc32\include\theora
+SYSTEMINCLUDE \epoc32\include\tremor
+SYSTEMINCLUDE \epoc32\include
+SYSTEMINCLUDE ..\src // for portdefs.h
diff --git a/backends/platform/symbian/mmp/scummvm_fullpipe.mmp.in b/backends/platform/symbian/mmp/scummvm_fullpipe.mmp.in
new file mode 100644
index 0000000000..7612ad2bae
--- /dev/null
+++ b/backends/platform/symbian/mmp/scummvm_fullpipe.mmp.in
@@ -0,0 +1,72 @@
+/* ScummVM - Graphic Adventure Engine
+ * Copyright (C) 2003-2005 Andreas 'Sprawl' Karlsson - Original EPOC port, ESDL
+ * Copyright (C) 2003-2005 Lars 'AnotherGuest' Persson - Original EPOC port, Audio System
+ * Copyright (C) 2005 Jurgen 'SumthinWicked' Braam - EPOC/CVS maintainer
+ * Copyright (C) 2005-2013 The ScummVM project
+ * Copyright (C) 2013 Strizniou Fedor
+ *
+ * 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
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+//
+// EPOC MMP makefile project for ScummVM
+//
+
+// *** Definitions
+
+TARGET scummvm_fullpipe.lib
+TARGETTYPE lib
+OPTION MSVC /QIfist /Ob1 /Oy /GF // /QIfist disables use of __ftol2 to avoid linker probs with MS libc: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/vcrefQIfistSuppress_ftol.asp
+OPTION GCC -Wno-multichar -Wno-reorder // don't optimize for ARM, platform way too sensitive for that :( just turn off some common warnings
+OPTION GCCE -Wno-multichar -Wno-reorder -Wno-unused -Wno-format -fsigned-char
+ALWAYS_BUILD_AS_ARM
+
+//START_AUTO_MACROS_SLAVE//
+
+ // empty base file, will be updated by Perl build scripts
+
+//STOP_AUTO_MACROS_SLAVE//
+
+// *** SOURCE files
+
+SOURCEPATH ..\..\..\..\engines\fullpipe
+
+//START_AUTO_OBJECTS_FULLPIPE_//
+
+ // empty base file, will be updated by Perl build scripts
+
+//STOP_AUTO_OBJECTS_FULLPIPE_//
+
+// *** Include paths
+
+USERINCLUDE ..\..\..\..\engines
+USERINCLUDE ..\..\..\.. ..\..\..\..\gui ..\..\..\..\audio ..\src
+
+SYSTEMINCLUDE \epoc32\include\freetype
+SYSTEMINCLUDE \epoc32\include\mpeg2dec
+SYSTEMINCLUDE \epoc32\include\jpeg
+SYSTEMINCLUDE \epoc32\include\png
+SYSTEMINCLUDE \epoc32\include\ESDL
+SYSTEMINCLUDE \epoc32\include\ZLIB // before \epoc32\include because symbian already has older version
+SYSTEMINCLUDE \epoc32\include\libc
+SYSTEMINCLUDE \epoc32\include\theora
+SYSTEMINCLUDE \epoc32\include\tremor
+SYSTEMINCLUDE \epoc32\include
+SYSTEMINCLUDE ..\src // for portdefs.h
diff --git a/backends/platform/symbian/mmp/scummvm_gob.mmp.in b/backends/platform/symbian/mmp/scummvm_gob.mmp.in
index 906d54b487..884b06c61a 100644
--- a/backends/platform/symbian/mmp/scummvm_gob.mmp.in
+++ b/backends/platform/symbian/mmp/scummvm_gob.mmp.in
@@ -57,4 +57,15 @@ SOURCEPATH ..\..\..\..\engines\gob
USERINCLUDE ..\..\..\..\engines
USERINCLUDE ..\..\..\.. ..\..\..\..\gui ..\..\..\..\audio ..\src
-SYSTEMINCLUDE \epoc32\include \epoc32\include\libc ..\src
+
+SYSTEMINCLUDE \epoc32\include\freetype
+SYSTEMINCLUDE \epoc32\include\mpeg2dec
+SYSTEMINCLUDE \epoc32\include\jpeg
+SYSTEMINCLUDE \epoc32\include\png
+SYSTEMINCLUDE \epoc32\include\ESDL
+SYSTEMINCLUDE \epoc32\include\ZLIB // before \epoc32\include because symbian already has older version
+SYSTEMINCLUDE \epoc32\include\libc
+SYSTEMINCLUDE \epoc32\include\theora
+SYSTEMINCLUDE \epoc32\include\tremor
+SYSTEMINCLUDE \epoc32\include
+SYSTEMINCLUDE ..\src // for portdefs.h
diff --git a/backends/platform/symbian/mmp/scummvm_groovie.mmp.in b/backends/platform/symbian/mmp/scummvm_groovie.mmp.in
index e7f70bc110..53fb33fef0 100644
--- a/backends/platform/symbian/mmp/scummvm_groovie.mmp.in
+++ b/backends/platform/symbian/mmp/scummvm_groovie.mmp.in
@@ -52,10 +52,21 @@ SOURCEPATH ..\..\..\..\engines\groovie
// empty base file, will be updated by Perl build scripts
//STOP_AUTO_OBJECTS_GROOVIE_//
+SOURCE roq.cpp
// *** Include paths
USERINCLUDE ..\..\..\..\engines
USERINCLUDE ..\..\..\.. ..\..\..\..\gui ..\..\..\..\audio ..\src
+
+SYSTEMINCLUDE \epoc32\include\freetype
+SYSTEMINCLUDE \epoc32\include\mpeg2dec
+SYSTEMINCLUDE \epoc32\include\jpeg
+SYSTEMINCLUDE \epoc32\include\png
+SYSTEMINCLUDE \epoc32\include\ESDL
SYSTEMINCLUDE \epoc32\include\ZLIB // before \epoc32\include because symbian already has older version
-SYSTEMINCLUDE \epoc32\include \epoc32\include\libc ..\src
+SYSTEMINCLUDE \epoc32\include\libc
+SYSTEMINCLUDE \epoc32\include\theora
+SYSTEMINCLUDE \epoc32\include\tremor
+SYSTEMINCLUDE \epoc32\include
+SYSTEMINCLUDE ..\src // for portdefs.h
diff --git a/backends/platform/symbian/mmp/scummvm_hopkins.mmp.in b/backends/platform/symbian/mmp/scummvm_hopkins.mmp.in
index 4509026b6c..bafc11e65f 100644
--- a/backends/platform/symbian/mmp/scummvm_hopkins.mmp.in
+++ b/backends/platform/symbian/mmp/scummvm_hopkins.mmp.in
@@ -57,5 +57,15 @@ SOURCEPATH ..\..\..\..\engines\HOPKINS
USERINCLUDE ..\..\..\..\engines
USERINCLUDE ..\..\..\.. ..\..\..\..\gui ..\..\..\..\audio ..\src
+
+SYSTEMINCLUDE \epoc32\include\freetype
+SYSTEMINCLUDE \epoc32\include\mpeg2dec
+SYSTEMINCLUDE \epoc32\include\jpeg
+SYSTEMINCLUDE \epoc32\include\png
+SYSTEMINCLUDE \epoc32\include\ESDL
SYSTEMINCLUDE \epoc32\include\ZLIB // before \epoc32\include because symbian already has older version
-SYSTEMINCLUDE \epoc32\include \epoc32\include\libc ..\src
+SYSTEMINCLUDE \epoc32\include\libc
+SYSTEMINCLUDE \epoc32\include\theora
+SYSTEMINCLUDE \epoc32\include\tremor
+SYSTEMINCLUDE \epoc32\include
+SYSTEMINCLUDE ..\src // for portdefs.h \ No newline at end of file
diff --git a/backends/platform/symbian/mmp/scummvm_hugo.mmp.in b/backends/platform/symbian/mmp/scummvm_hugo.mmp.in
index 13dd7efa1e..58622a83fd 100644
--- a/backends/platform/symbian/mmp/scummvm_hugo.mmp.in
+++ b/backends/platform/symbian/mmp/scummvm_hugo.mmp.in
@@ -57,5 +57,15 @@ SOURCEPATH ..\..\..\..\engines\hugo
USERINCLUDE ..\..\..\..\engines
USERINCLUDE ..\..\..\.. ..\..\..\..\gui ..\..\..\..\audio ..\src
+
+SYSTEMINCLUDE \epoc32\include\freetype
+SYSTEMINCLUDE \epoc32\include\mpeg2dec
+SYSTEMINCLUDE \epoc32\include\jpeg
+SYSTEMINCLUDE \epoc32\include\png
+SYSTEMINCLUDE \epoc32\include\ESDL
SYSTEMINCLUDE \epoc32\include\ZLIB // before \epoc32\include because symbian already has older version
-SYSTEMINCLUDE \epoc32\include \epoc32\include\libc ..\src
+SYSTEMINCLUDE \epoc32\include\libc
+SYSTEMINCLUDE \epoc32\include\theora
+SYSTEMINCLUDE \epoc32\include\tremor
+SYSTEMINCLUDE \epoc32\include
+SYSTEMINCLUDE ..\src // for portdefs.h \ No newline at end of file
diff --git a/backends/platform/symbian/mmp/scummvm_kyra.mmp.in b/backends/platform/symbian/mmp/scummvm_kyra.mmp.in
index 5772bfaad0..3fa05e856d 100644
--- a/backends/platform/symbian/mmp/scummvm_kyra.mmp.in
+++ b/backends/platform/symbian/mmp/scummvm_kyra.mmp.in
@@ -59,8 +59,26 @@ SOURCEPATH ..\..\..\..\engines\kyra
//STOP_AUTO_OBJECTS_KYRA_ENABLE_LOL//
+
+//START_AUTO_OBJECTS_KYRA_ENABLE_EOB//
+
+ // empty base file, will be updated by Perl build scripts
+
+//STOP_AUTO_OBJECTS_KYRA_ENABLE_EOB//
+
// *** Include paths
USERINCLUDE ..\..\..\..\engines
USERINCLUDE ..\..\..\.. ..\..\..\..\gui ..\..\..\..\audio ..\src
-SYSTEMINCLUDE \epoc32\include \epoc32\include\libc ..\src
+
+SYSTEMINCLUDE \epoc32\include\freetype
+SYSTEMINCLUDE \epoc32\include\mpeg2dec
+SYSTEMINCLUDE \epoc32\include\jpeg
+SYSTEMINCLUDE \epoc32\include\png
+SYSTEMINCLUDE \epoc32\include\ESDL
+SYSTEMINCLUDE \epoc32\include\ZLIB // before \epoc32\include because symbian already has older version
+SYSTEMINCLUDE \epoc32\include\libc
+SYSTEMINCLUDE \epoc32\include\theora
+SYSTEMINCLUDE \epoc32\include\tremor
+SYSTEMINCLUDE \epoc32\include
+SYSTEMINCLUDE ..\src // for portdefs.h
diff --git a/backends/platform/symbian/mmp/scummvm_lastexpress.mmp.in b/backends/platform/symbian/mmp/scummvm_lastexpress.mmp.in
index b8db95ea0c..8e0b3026c7 100644
--- a/backends/platform/symbian/mmp/scummvm_lastexpress.mmp.in
+++ b/backends/platform/symbian/mmp/scummvm_lastexpress.mmp.in
@@ -57,5 +57,15 @@ SOURCEPATH ..\..\..\..\engines\lastexpress
USERINCLUDE ..\..\..\..\engines
USERINCLUDE ..\..\..\.. ..\..\..\..\gui ..\..\..\..\audio ..\src
+
+SYSTEMINCLUDE \epoc32\include\freetype
+SYSTEMINCLUDE \epoc32\include\mpeg2dec
+SYSTEMINCLUDE \epoc32\include\jpeg
+SYSTEMINCLUDE \epoc32\include\png
+SYSTEMINCLUDE \epoc32\include\ESDL
SYSTEMINCLUDE \epoc32\include\ZLIB // before \epoc32\include because symbian already has older version
-SYSTEMINCLUDE \epoc32\include \epoc32\include\libc ..\src
+SYSTEMINCLUDE \epoc32\include\libc
+SYSTEMINCLUDE \epoc32\include\theora
+SYSTEMINCLUDE \epoc32\include\tremor
+SYSTEMINCLUDE \epoc32\include
+SYSTEMINCLUDE ..\src // for portdefs.h
diff --git a/backends/platform/symbian/mmp/scummvm_lure.mmp.in b/backends/platform/symbian/mmp/scummvm_lure.mmp.in
index 84c3eecd5e..89c93d058d 100644
--- a/backends/platform/symbian/mmp/scummvm_lure.mmp.in
+++ b/backends/platform/symbian/mmp/scummvm_lure.mmp.in
@@ -57,4 +57,15 @@ SOURCEPATH ..\..\..\..\engines\lure
USERINCLUDE ..\..\..\..\engines
USERINCLUDE ..\..\..\.. ..\..\..\..\gui ..\..\..\..\audio ..\src
-SYSTEMINCLUDE \epoc32\include \epoc32\include\libc ..\src
+
+SYSTEMINCLUDE \epoc32\include\freetype
+SYSTEMINCLUDE \epoc32\include\mpeg2dec
+SYSTEMINCLUDE \epoc32\include\jpeg
+SYSTEMINCLUDE \epoc32\include\png
+SYSTEMINCLUDE \epoc32\include\ESDL
+SYSTEMINCLUDE \epoc32\include\ZLIB // before \epoc32\include because symbian already has older version
+SYSTEMINCLUDE \epoc32\include\libc
+SYSTEMINCLUDE \epoc32\include\theora
+SYSTEMINCLUDE \epoc32\include\tremor
+SYSTEMINCLUDE \epoc32\include
+SYSTEMINCLUDE ..\src // for portdefs.h
diff --git a/backends/platform/symbian/mmp/scummvm_m4.mmp.in b/backends/platform/symbian/mmp/scummvm_m4.mmp.in
index e69b40ceb0..b3024c93c3 100644
--- a/backends/platform/symbian/mmp/scummvm_m4.mmp.in
+++ b/backends/platform/symbian/mmp/scummvm_m4.mmp.in
@@ -57,5 +57,15 @@ SOURCEPATH ..\..\..\..\engines\m4
USERINCLUDE ..\..\..\..\engines
USERINCLUDE ..\..\..\.. ..\..\..\..\gui ..\..\..\..\audio ..\src
+
+SYSTEMINCLUDE \epoc32\include\freetype
+SYSTEMINCLUDE \epoc32\include\mpeg2dec
+SYSTEMINCLUDE \epoc32\include\jpeg
+SYSTEMINCLUDE \epoc32\include\png
+SYSTEMINCLUDE \epoc32\include\ESDL
SYSTEMINCLUDE \epoc32\include\ZLIB // before \epoc32\include because symbian already has older version
-SYSTEMINCLUDE \epoc32\include \epoc32\include\libc ..\src
+SYSTEMINCLUDE \epoc32\include\libc
+SYSTEMINCLUDE \epoc32\include\theora
+SYSTEMINCLUDE \epoc32\include\tremor
+SYSTEMINCLUDE \epoc32\include
+SYSTEMINCLUDE ..\src // for portdefs.h
diff --git a/backends/platform/symbian/mmp/scummvm_made.mmp.in b/backends/platform/symbian/mmp/scummvm_made.mmp.in
index b52d9cc6cb..d4a63f8d87 100644
--- a/backends/platform/symbian/mmp/scummvm_made.mmp.in
+++ b/backends/platform/symbian/mmp/scummvm_made.mmp.in
@@ -57,5 +57,16 @@ SOURCEPATH ..\..\..\..\engines\made
USERINCLUDE ..\..\..\..\engines
USERINCLUDE ..\..\..\.. ..\..\..\..\gui ..\..\..\..\audio ..\src
+
+SYSTEMINCLUDE \epoc32\include\freetype
+SYSTEMINCLUDE \epoc32\include\mpeg2dec
+SYSTEMINCLUDE \epoc32\include\jpeg
+SYSTEMINCLUDE \epoc32\include\png
+SYSTEMINCLUDE \epoc32\include\ESDL
SYSTEMINCLUDE \epoc32\include\ZLIB // before \epoc32\include because symbian already has older version
-SYSTEMINCLUDE \epoc32\include \epoc32\include\libc ..\src
+SYSTEMINCLUDE \epoc32\include\libc
+SYSTEMINCLUDE \epoc32\include\theora
+SYSTEMINCLUDE \epoc32\include\tremor
+SYSTEMINCLUDE \epoc32\include
+SYSTEMINCLUDE ..\src // for portdefs.h
+
diff --git a/backends/platform/symbian/mmp/scummvm_mads.mmp.in b/backends/platform/symbian/mmp/scummvm_mads.mmp.in
new file mode 100644
index 0000000000..d0d6091f83
--- /dev/null
+++ b/backends/platform/symbian/mmp/scummvm_mads.mmp.in
@@ -0,0 +1,72 @@
+/* ScummVM - Graphic Adventure Engine
+ * Copyright (C) 2003-2005 Andreas 'Sprawl' Karlsson - Original EPOC port, ESDL
+ * Copyright (C) 2003-2005 Lars 'AnotherGuest' Persson - Original EPOC port, Audio System
+ * Copyright (C) 2005 Jurgen 'SumthinWicked' Braam - EPOC/CVS maintainer
+ * Copyright (C) 2005-2013 The ScummVM project
+ * Copyright (C) 2014 Fedor Strizhniou - Epoc project file
+ *
+ * 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
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+//
+// EPOC MMP makefile project for ScummVM
+//
+
+// *** Definitions
+
+TARGET scummvm_mads.lib
+TARGETTYPE lib
+OPTION MSVC /QIfist /Ob1 /Oy /GF // /QIfist disables use of __ftol2 to avoid linker probs with MS libc: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/vcrefQIfistSuppress_ftol.asp
+OPTION GCC -Wno-multichar -Wno-reorder // don't optimize for ARM, platform way too sensitive for that :( just turn off some common warnings
+OPTION GCCE -Wno-multichar -Wno-reorder -Wno-unused -Wno-format -fsigned-char
+ALWAYS_BUILD_AS_ARM
+
+//START_AUTO_MACROS_SLAVE//
+
+ // empty base file, will be updated by Perl build scripts
+
+//STOP_AUTO_MACROS_SLAVE//
+
+// *** SOURCE files
+
+SOURCEPATH ..\..\..\..\engines\mads
+
+//START_AUTO_OBJECTS_MADS_//
+
+ // empty base file, will be updated by Perl build scripts
+
+//STOP_AUTO_OBJECTS_MADS_//
+
+// *** Include paths
+
+USERINCLUDE ..\..\..\..\engines
+USERINCLUDE ..\..\..\.. ..\..\..\..\gui ..\..\..\..\audio ..\src
+
+SYSTEMINCLUDE \epoc32\include\freetype
+SYSTEMINCLUDE \epoc32\include\mpeg2dec
+SYSTEMINCLUDE \epoc32\include\jpeg
+SYSTEMINCLUDE \epoc32\include\png
+SYSTEMINCLUDE \epoc32\include\ESDL
+SYSTEMINCLUDE \epoc32\include\ZLIB // before \epoc32\include because symbian already has older version
+SYSTEMINCLUDE \epoc32\include\libc
+SYSTEMINCLUDE \epoc32\include\theora
+SYSTEMINCLUDE \epoc32\include\tremor
+SYSTEMINCLUDE \epoc32\include
+SYSTEMINCLUDE ..\src // for portdefs.h
diff --git a/backends/platform/symbian/mmp/scummvm_mohawk.mmp.in b/backends/platform/symbian/mmp/scummvm_mohawk.mmp.in
index 5f7bd4e144..e9175593ec 100644
--- a/backends/platform/symbian/mmp/scummvm_mohawk.mmp.in
+++ b/backends/platform/symbian/mmp/scummvm_mohawk.mmp.in
@@ -53,9 +53,38 @@ SOURCEPATH ..\..\..\..\engines\mohawk
//STOP_AUTO_OBJECTS_MOHAWK_//
+
+//START_AUTO_OBJECTS_MOHAWK_ENABLE_MYST//
+
+ // empty base file, will be updated by Perl build scripts
+
+//STOP_AUTO_OBJECTS_MOHAWK_ENABLE_MYST//
+
+//START_AUTO_OBJECTS_MOHAWK_ENABLE_RIVEN//
+
+ // empty base file, will be updated by Perl build scripts
+
+//STOP_AUTO_OBJECTS_MOHAWK_ENABLE_RIVEN//
+
+//START_AUTO_OBJECTS_MOHAWK_ENABLE_CSTIME//
+
+ // empty base file, will be updated by Perl build scripts
+
+//STOP_AUTO_OBJECTS_MOHAWK_ENABLE_CSTIME//
+
// *** Include paths
USERINCLUDE ..\..\..\..\engines
USERINCLUDE ..\..\..\.. ..\..\..\..\gui ..\..\..\..\audio ..\src
+
+SYSTEMINCLUDE \epoc32\include\freetype
+SYSTEMINCLUDE \epoc32\include\mpeg2dec
+SYSTEMINCLUDE \epoc32\include\jpeg
+SYSTEMINCLUDE \epoc32\include\png
+SYSTEMINCLUDE \epoc32\include\ESDL
SYSTEMINCLUDE \epoc32\include\ZLIB // before \epoc32\include because symbian already has older version
-SYSTEMINCLUDE \epoc32\include \epoc32\include\libc ..\src
+SYSTEMINCLUDE \epoc32\include\libc
+SYSTEMINCLUDE \epoc32\include\theora
+SYSTEMINCLUDE \epoc32\include\tremor
+SYSTEMINCLUDE \epoc32\include
+SYSTEMINCLUDE ..\src // for portdefs.h
diff --git a/backends/platform/symbian/mmp/scummvm_mortevielle.mmp.in b/backends/platform/symbian/mmp/scummvm_mortevielle.mmp.in
new file mode 100644
index 0000000000..f118ddbef0
--- /dev/null
+++ b/backends/platform/symbian/mmp/scummvm_mortevielle.mmp.in
@@ -0,0 +1,72 @@
+/* ScummVM - Graphic Adventure Engine
+ * Copyright (C) 2003-2005 Andreas 'Sprawl' Karlsson - Original EPOC port, ESDL
+ * Copyright (C) 2003-2005 Lars 'AnotherGuest' Persson - Original EPOC port, Audio System
+ * Copyright (C) 2005 Jurgen 'SumthinWicked' Braam - EPOC/CVS maintainer
+ * Copyright (C) 2005-2013 The ScummVM project
+ * Copyright (C) 2013 Strizniou Fedor
+ *
+ * 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
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+//
+// EPOC MMP makefile project for ScummVM
+//
+
+// *** Definitions
+
+TARGET scummvm_mortevielle.lib
+TARGETTYPE lib
+OPTION MSVC /QIfist /Ob1 /Oy /GF // /QIfist disables use of __ftol2 to avoid linker probs with MS libc: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/vcrefQIfistSuppress_ftol.asp
+OPTION GCC -Wno-multichar -Wno-reorder // don't optimize for ARM, platform way too sensitive for that :( just turn off some common warnings
+OPTION GCCE -Wno-multichar -Wno-reorder -Wno-unused -Wno-format -fsigned-char
+ALWAYS_BUILD_AS_ARM
+
+//START_AUTO_MACROS_SLAVE//
+
+ // empty base file, will be updated by Perl build scripts
+
+//STOP_AUTO_MACROS_SLAVE//
+
+// *** SOURCE files
+
+SOURCEPATH ..\..\..\..\engines\mortevielle
+
+//START_AUTO_OBJECTS_MORTEVIELLE_//
+
+ // empty base file, will be updated by Perl build scripts
+
+//STOP_AUTO_OBJECTS_MORTEVIELLE_//
+
+// *** Include paths
+
+USERINCLUDE ..\..\..\..\engines
+USERINCLUDE ..\..\..\.. ..\..\..\..\gui ..\..\..\..\audio ..\src
+
+SYSTEMINCLUDE \epoc32\include\freetype
+SYSTEMINCLUDE \epoc32\include\mpeg2dec
+SYSTEMINCLUDE \epoc32\include\jpeg
+SYSTEMINCLUDE \epoc32\include\png
+SYSTEMINCLUDE \epoc32\include\ESDL
+SYSTEMINCLUDE \epoc32\include\ZLIB // before \epoc32\include because symbian already has older version
+SYSTEMINCLUDE \epoc32\include\libc
+SYSTEMINCLUDE \epoc32\include\theora
+SYSTEMINCLUDE \epoc32\include\tremor
+SYSTEMINCLUDE \epoc32\include
+SYSTEMINCLUDE ..\src // for portdefs.h
diff --git a/backends/platform/symbian/mmp/scummvm_neverhood.mmp.in b/backends/platform/symbian/mmp/scummvm_neverhood.mmp.in
new file mode 100644
index 0000000000..a57161577f
--- /dev/null
+++ b/backends/platform/symbian/mmp/scummvm_neverhood.mmp.in
@@ -0,0 +1,71 @@
+/* ScummVM - Graphic Adventure Engine
+ * Copyright (C) 2003-2005 Andreas 'Sprawl' Karlsson - Original EPOC port, ESDL
+ * Copyright (C) 2003-2005 Lars 'AnotherGuest' Persson - Original EPOC port, Audio System
+ * Copyright (C) 2005 Jurgen 'SumthinWicked' Braam - EPOC/CVS maintainer
+ * Copyright (C) 2005-2013 The ScummVM project
+ *
+ * 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
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+//
+// EPOC MMP makefile project for ScummVM
+//
+
+// *** Definitions
+
+TARGET scummvm_neverhood.lib
+TARGETTYPE lib
+OPTION MSVC /QIfist /Ob1 /Oy /GF // /QIfist disables use of __ftol2 to avoid linker probs with MS libc: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/vcrefQIfistSuppress_ftol.asp
+OPTION GCC -Wno-multichar -Wno-reorder // don't optimize for ARM, platform way too sensitive for that :( just turn off some common warnings
+OPTION GCCE -Wno-multichar -Wno-reorder -Wno-unused -Wno-format -fsigned-char
+ALWAYS_BUILD_AS_ARM
+
+//START_AUTO_MACROS_SLAVE//
+
+ // empty base file, will be updated by Perl build scripts
+
+//STOP_AUTO_MACROS_SLAVE//
+
+// *** SOURCE files
+
+SOURCEPATH ..\..\..\..\engines\neverhood
+
+//START_AUTO_OBJECTS_NEVERHOOD_//
+
+ // empty base file, will be updated by Perl build scripts
+
+//STOP_AUTO_OBJECTS_NEVERHOOD_//
+
+// *** Include paths
+
+USERINCLUDE ..\..\..\..\engines
+USERINCLUDE ..\..\..\.. ..\..\..\..\gui ..\..\..\..\audio ..\src
+
+SYSTEMINCLUDE \epoc32\include\freetype
+SYSTEMINCLUDE \epoc32\include\mpeg2dec
+SYSTEMINCLUDE \epoc32\include\jpeg
+SYSTEMINCLUDE \epoc32\include\png
+SYSTEMINCLUDE \epoc32\include\ESDL
+SYSTEMINCLUDE \epoc32\include\ZLIB // before \epoc32\include because symbian already has older version
+SYSTEMINCLUDE \epoc32\include\libc
+SYSTEMINCLUDE \epoc32\include\theora
+SYSTEMINCLUDE \epoc32\include\tremor
+SYSTEMINCLUDE \epoc32\include
+SYSTEMINCLUDE ..\src // for portdefs.h
diff --git a/backends/platform/symbian/mmp/scummvm_parallaction.mmp.in b/backends/platform/symbian/mmp/scummvm_parallaction.mmp.in
index f8ee389577..cefdd1b282 100644
--- a/backends/platform/symbian/mmp/scummvm_parallaction.mmp.in
+++ b/backends/platform/symbian/mmp/scummvm_parallaction.mmp.in
@@ -57,5 +57,15 @@ SOURCEPATH ..\..\..\..\engines\parallaction
USERINCLUDE ..\..\..\..\engines
USERINCLUDE ..\..\..\.. ..\..\..\..\gui ..\..\..\..\audio ..\src
+
+SYSTEMINCLUDE \epoc32\include\freetype
+SYSTEMINCLUDE \epoc32\include\mpeg2dec
+SYSTEMINCLUDE \epoc32\include\jpeg
+SYSTEMINCLUDE \epoc32\include\png
+SYSTEMINCLUDE \epoc32\include\ESDL
SYSTEMINCLUDE \epoc32\include\ZLIB // before \epoc32\include because symbian already has older version
-SYSTEMINCLUDE \epoc32\include \epoc32\include\libc ..\src
+SYSTEMINCLUDE \epoc32\include\libc
+SYSTEMINCLUDE \epoc32\include\theora
+SYSTEMINCLUDE \epoc32\include\tremor
+SYSTEMINCLUDE \epoc32\include
+SYSTEMINCLUDE ..\src // for portdefs.h
diff --git a/backends/platform/symbian/mmp/scummvm_pegasus.mmp.in b/backends/platform/symbian/mmp/scummvm_pegasus.mmp.in
index fefc63e936..68b2c12774 100644
--- a/backends/platform/symbian/mmp/scummvm_pegasus.mmp.in
+++ b/backends/platform/symbian/mmp/scummvm_pegasus.mmp.in
@@ -57,5 +57,15 @@ SOURCEPATH ..\..\..\..\engines\PEGASUS
USERINCLUDE ..\..\..\..\engines
USERINCLUDE ..\..\..\.. ..\..\..\..\gui ..\..\..\..\audio ..\src
+
+SYSTEMINCLUDE \epoc32\include\freetype
+SYSTEMINCLUDE \epoc32\include\mpeg2dec
+SYSTEMINCLUDE \epoc32\include\jpeg
+SYSTEMINCLUDE \epoc32\include\png
+SYSTEMINCLUDE \epoc32\include\ESDL
SYSTEMINCLUDE \epoc32\include\ZLIB // before \epoc32\include because symbian already has older version
-SYSTEMINCLUDE \epoc32\include \epoc32\include\libc ..\src
+SYSTEMINCLUDE \epoc32\include\libc
+SYSTEMINCLUDE \epoc32\include\theora
+SYSTEMINCLUDE \epoc32\include\tremor
+SYSTEMINCLUDE \epoc32\include
+SYSTEMINCLUDE ..\src // for portdefs.h \ No newline at end of file
diff --git a/backends/platform/symbian/mmp/scummvm_queen.mmp.in b/backends/platform/symbian/mmp/scummvm_queen.mmp.in
index f507f482f9..94835aae90 100644
--- a/backends/platform/symbian/mmp/scummvm_queen.mmp.in
+++ b/backends/platform/symbian/mmp/scummvm_queen.mmp.in
@@ -57,4 +57,15 @@ SOURCEPATH ..\..\..\..\engines\queen
USERINCLUDE ..\..\..\..\engines
USERINCLUDE ..\..\..\.. ..\..\..\..\gui ..\..\..\..\audio ..\src
-SYSTEMINCLUDE \epoc32\include \epoc32\include\libc ..\src
+
+SYSTEMINCLUDE \epoc32\include\freetype
+SYSTEMINCLUDE \epoc32\include\mpeg2dec
+SYSTEMINCLUDE \epoc32\include\jpeg
+SYSTEMINCLUDE \epoc32\include\png
+SYSTEMINCLUDE \epoc32\include\ESDL
+SYSTEMINCLUDE \epoc32\include\ZLIB // before \epoc32\include because symbian already has older version
+SYSTEMINCLUDE \epoc32\include\libc
+SYSTEMINCLUDE \epoc32\include\theora
+SYSTEMINCLUDE \epoc32\include\tremor
+SYSTEMINCLUDE \epoc32\include
+SYSTEMINCLUDE ..\src // for portdefs.h
diff --git a/backends/platform/symbian/mmp/scummvm_saga.mmp.in b/backends/platform/symbian/mmp/scummvm_saga.mmp.in
index cd158556dc..77bf839efe 100644
--- a/backends/platform/symbian/mmp/scummvm_saga.mmp.in
+++ b/backends/platform/symbian/mmp/scummvm_saga.mmp.in
@@ -69,4 +69,15 @@ SOURCEPATH ..\..\..\..\engines\saga
USERINCLUDE ..\..\..\..\engines
USERINCLUDE ..\..\..\.. ..\..\..\..\gui ..\..\..\..\audio ..\src
-SYSTEMINCLUDE \epoc32\include \epoc32\include\libc ..\src
+
+SYSTEMINCLUDE \epoc32\include\freetype
+SYSTEMINCLUDE \epoc32\include\mpeg2dec
+SYSTEMINCLUDE \epoc32\include\jpeg
+SYSTEMINCLUDE \epoc32\include\png
+SYSTEMINCLUDE \epoc32\include\ESDL
+SYSTEMINCLUDE \epoc32\include\ZLIB // before \epoc32\include because symbian already has older version
+SYSTEMINCLUDE \epoc32\include\libc
+SYSTEMINCLUDE \epoc32\include\theora
+SYSTEMINCLUDE \epoc32\include\tremor
+SYSTEMINCLUDE \epoc32\include
+SYSTEMINCLUDE ..\src // for portdefs.h
diff --git a/backends/platform/symbian/mmp/scummvm_sci.mmp.in b/backends/platform/symbian/mmp/scummvm_sci.mmp.in
index 5749c66e10..d08501e471 100644
--- a/backends/platform/symbian/mmp/scummvm_sci.mmp.in
+++ b/backends/platform/symbian/mmp/scummvm_sci.mmp.in
@@ -53,9 +53,27 @@ SOURCEPATH ..\..\..\..\engines\sci
//STOP_AUTO_OBJECTS_SCI_//
+
+//START_AUTO_OBJECTS_SCI_ENABLE_SCI32//
+
+ // empty base file, will be updated by Perl build scripts
+
+//STOP_AUTO_OBJECTS_SCI_ENABLE_SCI32//
+
+
// *** Include paths
USERINCLUDE ..\..\..\..\engines
USERINCLUDE ..\..\..\.. ..\..\..\..\gui ..\..\..\..\audio ..\src
+
+SYSTEMINCLUDE \epoc32\include\freetype
+SYSTEMINCLUDE \epoc32\include\mpeg2dec
+SYSTEMINCLUDE \epoc32\include\jpeg
+SYSTEMINCLUDE \epoc32\include\png
+SYSTEMINCLUDE \epoc32\include\ESDL
SYSTEMINCLUDE \epoc32\include\ZLIB // before \epoc32\include because symbian already has older version
-SYSTEMINCLUDE \epoc32\include \epoc32\include\libc ..\src
+SYSTEMINCLUDE \epoc32\include\libc
+SYSTEMINCLUDE \epoc32\include\theora
+SYSTEMINCLUDE \epoc32\include\tremor
+SYSTEMINCLUDE \epoc32\include
+SYSTEMINCLUDE ..\src // for portdefs.h
diff --git a/backends/platform/symbian/mmp/scummvm_scumm.mmp.in b/backends/platform/symbian/mmp/scummvm_scumm.mmp.in
index c07725e002..a11dd071d3 100644
--- a/backends/platform/symbian/mmp/scummvm_scumm.mmp.in
+++ b/backends/platform/symbian/mmp/scummvm_scumm.mmp.in
@@ -81,7 +81,14 @@ SOURCE smush/codec47ARM.s // ARM version: add ASM routines
USERINCLUDE ..\..\..\..\engines ..\..\..\..\engines\scumm\smush ..\..\..\..\engines\scumm\insane
USERINCLUDE ..\..\..\.. ..\..\..\..\gui ..\..\..\..\audio ..\src
+SYSTEMINCLUDE \epoc32\include\freetype
+SYSTEMINCLUDE \epoc32\include\mpeg2dec
+SYSTEMINCLUDE \epoc32\include\jpeg
+SYSTEMINCLUDE \epoc32\include\png
+SYSTEMINCLUDE \epoc32\include\ESDL
SYSTEMINCLUDE \epoc32\include\ZLIB // before \epoc32\include because symbian already has older version
SYSTEMINCLUDE \epoc32\include\libc
+SYSTEMINCLUDE \epoc32\include\theora
+SYSTEMINCLUDE \epoc32\include\tremor
SYSTEMINCLUDE \epoc32\include
SYSTEMINCLUDE ..\src // for portdefs.h
diff --git a/backends/platform/symbian/mmp/scummvm_sky.mmp.in b/backends/platform/symbian/mmp/scummvm_sky.mmp.in
index b5048106dc..37fdc89f99 100644
--- a/backends/platform/symbian/mmp/scummvm_sky.mmp.in
+++ b/backends/platform/symbian/mmp/scummvm_sky.mmp.in
@@ -57,4 +57,15 @@ SOURCEPATH ..\..\..\..\engines\sky
USERINCLUDE ..\..\..\..\engines ..\..\..\..\engines\sky\music
USERINCLUDE ..\..\..\.. ..\..\..\..\gui ..\..\..\..\audio ..\src
-SYSTEMINCLUDE \epoc32\include \epoc32\include\libc ..\src
+
+SYSTEMINCLUDE \epoc32\include\freetype
+SYSTEMINCLUDE \epoc32\include\mpeg2dec
+SYSTEMINCLUDE \epoc32\include\jpeg
+SYSTEMINCLUDE \epoc32\include\png
+SYSTEMINCLUDE \epoc32\include\ESDL
+SYSTEMINCLUDE \epoc32\include\ZLIB // before \epoc32\include because symbian already has older version
+SYSTEMINCLUDE \epoc32\include\libc
+SYSTEMINCLUDE \epoc32\include\theora
+SYSTEMINCLUDE \epoc32\include\tremor
+SYSTEMINCLUDE \epoc32\include
+SYSTEMINCLUDE ..\src // for portdefs.h
diff --git a/backends/platform/symbian/mmp/scummvm_sword1.mmp.in b/backends/platform/symbian/mmp/scummvm_sword1.mmp.in
index 578839e8c4..352cbe59f0 100644
--- a/backends/platform/symbian/mmp/scummvm_sword1.mmp.in
+++ b/backends/platform/symbian/mmp/scummvm_sword1.mmp.in
@@ -57,4 +57,15 @@ SOURCEPATH ..\..\..\..\engines\sword1
USERINCLUDE ..\..\..\..\engines
USERINCLUDE ..\..\..\.. ..\..\..\..\gui ..\..\..\..\audio ..\src
-SYSTEMINCLUDE \epoc32\include \epoc32\include\libc ..\src
+
+SYSTEMINCLUDE \epoc32\include\freetype
+SYSTEMINCLUDE \epoc32\include\mpeg2dec
+SYSTEMINCLUDE \epoc32\include\jpeg
+SYSTEMINCLUDE \epoc32\include\png
+SYSTEMINCLUDE \epoc32\include\ESDL
+SYSTEMINCLUDE \epoc32\include\ZLIB // before \epoc32\include because symbian already has older version
+SYSTEMINCLUDE \epoc32\include\libc
+SYSTEMINCLUDE \epoc32\include\theora
+SYSTEMINCLUDE \epoc32\include\tremor
+SYSTEMINCLUDE \epoc32\include
+SYSTEMINCLUDE ..\src // for portdefs.h
diff --git a/backends/platform/symbian/mmp/scummvm_sword2.mmp.in b/backends/platform/symbian/mmp/scummvm_sword2.mmp.in
index 23a055c99c..7b79bf7f5c 100644
--- a/backends/platform/symbian/mmp/scummvm_sword2.mmp.in
+++ b/backends/platform/symbian/mmp/scummvm_sword2.mmp.in
@@ -57,4 +57,15 @@ SOURCEPATH ..\..\..\..\engines\sword2
USERINCLUDE ..\..\..\..\engines
USERINCLUDE ..\..\..\.. ..\..\..\..\gui ..\..\..\..\audio ..\src
-SYSTEMINCLUDE \epoc32\include \epoc32\include\libc ..\src
+
+SYSTEMINCLUDE \epoc32\include\freetype
+SYSTEMINCLUDE \epoc32\include\mpeg2dec
+SYSTEMINCLUDE \epoc32\include\jpeg
+SYSTEMINCLUDE \epoc32\include\png
+SYSTEMINCLUDE \epoc32\include\ESDL
+SYSTEMINCLUDE \epoc32\include\ZLIB // before \epoc32\include because symbian already has older version
+SYSTEMINCLUDE \epoc32\include\libc
+SYSTEMINCLUDE \epoc32\include\theora
+SYSTEMINCLUDE \epoc32\include\tremor
+SYSTEMINCLUDE \epoc32\include
+SYSTEMINCLUDE ..\src // for portdefs.h
diff --git a/backends/platform/symbian/mmp/scummvm_sword25.mmp.in b/backends/platform/symbian/mmp/scummvm_sword25.mmp.in
new file mode 100644
index 0000000000..4159350bce
--- /dev/null
+++ b/backends/platform/symbian/mmp/scummvm_sword25.mmp.in
@@ -0,0 +1,73 @@
+/* ScummVM - Graphic Adventure Engine
+ * Copyright (C) 2003-2005 Andreas 'Sprawl' Karlsson - Original EPOC port, ESDL
+ * Copyright (C) 2003-2005 Lars 'AnotherGuest' Persson - Original EPOC port, Audio System
+ * Copyright (C) 2005 Jurgen 'SumthinWicked' Braam - EPOC/CVS maintainer
+ * Copyright (C) 2005-2013 The ScummVM project
+ * Copyright (C) 2013 Strizniou Fedor
+ *
+ * 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
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+//
+// EPOC MMP makefile project for ScummVM
+//
+
+// *** Definitions
+
+TARGET scummvm_sword25.lib
+TARGETTYPE lib
+OPTION MSVC /QIfist /Ob1 /Oy /GF // /QIfist disables use of __ftol2 to avoid linker probs with MS libc: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/vcrefQIfistSuppress_ftol.asp
+OPTION GCC -Wno-multichar -Wno-reorder // don't optimize for ARM, platform way too sensitive for that :( just turn off some common warnings
+OPTION GCCE -Wno-multichar -Wno-reorder -Wno-unused -Wno-format -fsigned-char
+ALWAYS_BUILD_AS_ARM
+
+//START_AUTO_MACROS_SLAVE//
+
+ // empty base file, will be updated by Perl build scripts
+
+//STOP_AUTO_MACROS_SLAVE//
+
+// *** SOURCE files
+
+SOURCEPATH ..\..\..\..\engines\sword25
+
+//START_AUTO_OBJECTS_SWORD25_//
+
+ // empty base file, will be updated by Perl build scripts
+
+//STOP_AUTO_OBJECTS_SWORD25_//
+
+// *** Include paths
+
+USERINCLUDE ..\..\..\..\engines
+USERINCLUDE ..\..\..\.. ..\..\..\..\gui ..\..\..\..\audio ..\src
+USERINCLUDE ..\..\..\..\engines\sword25\util\lua ..\..\..\..\engines\sword25\util\pluto
+
+SYSTEMINCLUDE \epoc32\include\freetype
+SYSTEMINCLUDE \epoc32\include\mpeg2dec
+SYSTEMINCLUDE \epoc32\include\jpeg
+SYSTEMINCLUDE \epoc32\include\png
+SYSTEMINCLUDE \epoc32\include\ESDL
+SYSTEMINCLUDE \epoc32\include\ZLIB // before \epoc32\include because symbian already has older version
+SYSTEMINCLUDE \epoc32\include\libc
+SYSTEMINCLUDE \epoc32\include\theora
+SYSTEMINCLUDE \epoc32\include\tremor
+SYSTEMINCLUDE \epoc32\include
+SYSTEMINCLUDE ..\src // for portdefs.h
diff --git a/backends/platform/symbian/mmp/scummvm_teenagent.mmp.in b/backends/platform/symbian/mmp/scummvm_teenagent.mmp.in
index 58bfa4c337..332b9f20ac 100644
--- a/backends/platform/symbian/mmp/scummvm_teenagent.mmp.in
+++ b/backends/platform/symbian/mmp/scummvm_teenagent.mmp.in
@@ -57,5 +57,15 @@ SOURCEPATH ..\..\..\..\engines\teenagent
USERINCLUDE ..\..\..\..\engines
USERINCLUDE ..\..\..\.. ..\..\..\..\gui ..\..\..\..\audio ..\src
+
+SYSTEMINCLUDE \epoc32\include\freetype
+SYSTEMINCLUDE \epoc32\include\mpeg2dec
+SYSTEMINCLUDE \epoc32\include\jpeg
+SYSTEMINCLUDE \epoc32\include\png
+SYSTEMINCLUDE \epoc32\include\ESDL
SYSTEMINCLUDE \epoc32\include\ZLIB // before \epoc32\include because symbian already has older version
-SYSTEMINCLUDE \epoc32\include \epoc32\include\libc ..\src
+SYSTEMINCLUDE \epoc32\include\libc
+SYSTEMINCLUDE \epoc32\include\theora
+SYSTEMINCLUDE \epoc32\include\tremor
+SYSTEMINCLUDE \epoc32\include
+SYSTEMINCLUDE ..\src // for portdefs.h
diff --git a/backends/platform/symbian/mmp/scummvm_testbed.mmp.in b/backends/platform/symbian/mmp/scummvm_testbed.mmp.in
new file mode 100644
index 0000000000..20d3789a31
--- /dev/null
+++ b/backends/platform/symbian/mmp/scummvm_testbed.mmp.in
@@ -0,0 +1,72 @@
+/* ScummVM - Graphic Adventure Engine
+ * Copyright (C) 2003-2005 Andreas 'Sprawl' Karlsson - Original EPOC port, ESDL
+ * Copyright (C) 2003-2005 Lars 'AnotherGuest' Persson - Original EPOC port, Audio System
+ * Copyright (C) 2005 Jurgen 'SumthinWicked' Braam - EPOC/CVS maintainer
+ * Copyright (C) 2005-2013 The ScummVM project
+ * Copyright (C) 2013 Strizniou Fedor
+ *
+ * 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
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+//
+// EPOC MMP makefile project for ScummVM
+//
+
+// *** Definitions
+
+TARGET scummvm_testbed.lib
+TARGETTYPE lib
+OPTION MSVC /QIfist /Ob1 /Oy /GF // /QIfist disables use of __ftol2 to avoid linker probs with MS libc: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/vcrefQIfistSuppress_ftol.asp
+OPTION GCC -Wno-multichar -Wno-reorder // don't optimize for ARM, platform way too sensitive for that :( just turn off some common warnings
+OPTION GCCE -Wno-multichar -Wno-reorder -Wno-unused -Wno-format -fsigned-char
+ALWAYS_BUILD_AS_ARM
+
+//START_AUTO_MACROS_SLAVE//
+
+ // empty base file, will be updated by Perl build scripts
+
+//STOP_AUTO_MACROS_SLAVE//
+
+// *** SOURCE files
+
+SOURCEPATH ..\..\..\..\engines\testbed
+
+//START_AUTO_OBJECTS_TESTBED_//
+
+ // empty base file, will be updated by Perl build scripts
+
+//STOP_AUTO_OBJECTS_TESTBED_//
+
+// *** Include paths
+
+USERINCLUDE ..\..\..\..\engines
+USERINCLUDE ..\..\..\.. ..\..\..\..\gui ..\..\..\..\audio ..\src
+
+SYSTEMINCLUDE \epoc32\include\freetype
+SYSTEMINCLUDE \epoc32\include\mpeg2dec
+SYSTEMINCLUDE \epoc32\include\jpeg
+SYSTEMINCLUDE \epoc32\include\png
+SYSTEMINCLUDE \epoc32\include\ESDL
+SYSTEMINCLUDE \epoc32\include\ZLIB // before \epoc32\include because symbian already has older version
+SYSTEMINCLUDE \epoc32\include\libc
+SYSTEMINCLUDE \epoc32\include\theora
+SYSTEMINCLUDE \epoc32\include\tremor
+SYSTEMINCLUDE \epoc32\include
+SYSTEMINCLUDE ..\src // for portdefs.h
diff --git a/backends/platform/symbian/mmp/scummvm_tinsel.mmp.in b/backends/platform/symbian/mmp/scummvm_tinsel.mmp.in
index 4cdd0bd774..15c5850cee 100644
--- a/backends/platform/symbian/mmp/scummvm_tinsel.mmp.in
+++ b/backends/platform/symbian/mmp/scummvm_tinsel.mmp.in
@@ -57,4 +57,15 @@ SOURCEPATH ..\..\..\..\engines\tinsel
USERINCLUDE ..\..\..\..\engines
USERINCLUDE ..\..\..\.. ..\..\..\..\gui ..\..\..\..\audio ..\src
-SYSTEMINCLUDE \epoc32\include \epoc32\include\libc ..\src
+
+SYSTEMINCLUDE \epoc32\include\freetype
+SYSTEMINCLUDE \epoc32\include\mpeg2dec
+SYSTEMINCLUDE \epoc32\include\jpeg
+SYSTEMINCLUDE \epoc32\include\png
+SYSTEMINCLUDE \epoc32\include\ESDL
+SYSTEMINCLUDE \epoc32\include\ZLIB // before \epoc32\include because symbian already has older version
+SYSTEMINCLUDE \epoc32\include\libc
+SYSTEMINCLUDE \epoc32\include\theora
+SYSTEMINCLUDE \epoc32\include\tremor
+SYSTEMINCLUDE \epoc32\include
+SYSTEMINCLUDE ..\src // for portdefs.h \ No newline at end of file
diff --git a/backends/platform/symbian/mmp/scummvm_toltecs.mmp.in b/backends/platform/symbian/mmp/scummvm_toltecs.mmp.in
index 9f9d1c1dda..df75290d81 100644
--- a/backends/platform/symbian/mmp/scummvm_toltecs.mmp.in
+++ b/backends/platform/symbian/mmp/scummvm_toltecs.mmp.in
@@ -57,5 +57,15 @@ SOURCEPATH ..\..\..\..\engines\TOLTECS
USERINCLUDE ..\..\..\..\engines
USERINCLUDE ..\..\..\.. ..\..\..\..\gui ..\..\..\..\audio ..\src
+
+SYSTEMINCLUDE \epoc32\include\freetype
+SYSTEMINCLUDE \epoc32\include\mpeg2dec
+SYSTEMINCLUDE \epoc32\include\jpeg
+SYSTEMINCLUDE \epoc32\include\png
+SYSTEMINCLUDE \epoc32\include\ESDL
SYSTEMINCLUDE \epoc32\include\ZLIB // before \epoc32\include because symbian already has older version
-SYSTEMINCLUDE \epoc32\include \epoc32\include\libc ..\src
+SYSTEMINCLUDE \epoc32\include\libc
+SYSTEMINCLUDE \epoc32\include\theora
+SYSTEMINCLUDE \epoc32\include\tremor
+SYSTEMINCLUDE \epoc32\include
+SYSTEMINCLUDE ..\src // for portdefs.h
diff --git a/backends/platform/symbian/mmp/scummvm_tony.mmp.in b/backends/platform/symbian/mmp/scummvm_tony.mmp.in
index d80d82a9c5..bcdbc1c979 100644
--- a/backends/platform/symbian/mmp/scummvm_tony.mmp.in
+++ b/backends/platform/symbian/mmp/scummvm_tony.mmp.in
@@ -57,5 +57,15 @@ SOURCEPATH ..\..\..\..\engines\TONY
USERINCLUDE ..\..\..\..\engines
USERINCLUDE ..\..\..\.. ..\..\..\..\gui ..\..\..\..\audio ..\src
+
+SYSTEMINCLUDE \epoc32\include\freetype
+SYSTEMINCLUDE \epoc32\include\mpeg2dec
+SYSTEMINCLUDE \epoc32\include\jpeg
+SYSTEMINCLUDE \epoc32\include\png
+SYSTEMINCLUDE \epoc32\include\ESDL
SYSTEMINCLUDE \epoc32\include\ZLIB // before \epoc32\include because symbian already has older version
-SYSTEMINCLUDE \epoc32\include \epoc32\include\libc ..\src
+SYSTEMINCLUDE \epoc32\include\libc
+SYSTEMINCLUDE \epoc32\include\theora
+SYSTEMINCLUDE \epoc32\include\tremor
+SYSTEMINCLUDE \epoc32\include
+SYSTEMINCLUDE ..\src // for portdefs.h
diff --git a/backends/platform/symbian/mmp/scummvm_toon.mmp.in b/backends/platform/symbian/mmp/scummvm_toon.mmp.in
index 00f84d2bec..7bfec38dc5 100644
--- a/backends/platform/symbian/mmp/scummvm_toon.mmp.in
+++ b/backends/platform/symbian/mmp/scummvm_toon.mmp.in
@@ -57,5 +57,15 @@ SOURCEPATH ..\..\..\..\engines\toon
USERINCLUDE ..\..\..\..\engines
USERINCLUDE ..\..\..\.. ..\..\..\..\gui ..\..\..\..\audio ..\src
+
+SYSTEMINCLUDE \epoc32\include\freetype
+SYSTEMINCLUDE \epoc32\include\mpeg2dec
+SYSTEMINCLUDE \epoc32\include\jpeg
+SYSTEMINCLUDE \epoc32\include\png
+SYSTEMINCLUDE \epoc32\include\ESDL
SYSTEMINCLUDE \epoc32\include\ZLIB // before \epoc32\include because symbian already has older version
-SYSTEMINCLUDE \epoc32\include \epoc32\include\libc ..\src
+SYSTEMINCLUDE \epoc32\include\libc
+SYSTEMINCLUDE \epoc32\include\theora
+SYSTEMINCLUDE \epoc32\include\tremor
+SYSTEMINCLUDE \epoc32\include
+SYSTEMINCLUDE ..\src // for portdefs.h
diff --git a/backends/platform/symbian/mmp/scummvm_touche.mmp.in b/backends/platform/symbian/mmp/scummvm_touche.mmp.in
index e59dd0cd00..407e275ae3 100644
--- a/backends/platform/symbian/mmp/scummvm_touche.mmp.in
+++ b/backends/platform/symbian/mmp/scummvm_touche.mmp.in
@@ -57,5 +57,15 @@ SOURCEPATH ..\..\..\..\engines\touche
USERINCLUDE ..\..\..\..\engines
USERINCLUDE ..\..\..\.. ..\..\..\..\gui ..\..\..\..\audio ..\src
+
+SYSTEMINCLUDE \epoc32\include\freetype
+SYSTEMINCLUDE \epoc32\include\mpeg2dec
+SYSTEMINCLUDE \epoc32\include\jpeg
+SYSTEMINCLUDE \epoc32\include\png
+SYSTEMINCLUDE \epoc32\include\ESDL
SYSTEMINCLUDE \epoc32\include\ZLIB // before \epoc32\include because symbian already has older version
-SYSTEMINCLUDE \epoc32\include \epoc32\include\libc ..\src
+SYSTEMINCLUDE \epoc32\include\libc
+SYSTEMINCLUDE \epoc32\include\theora
+SYSTEMINCLUDE \epoc32\include\tremor
+SYSTEMINCLUDE \epoc32\include
+SYSTEMINCLUDE ..\src // for portdefs.h
diff --git a/backends/platform/symbian/mmp/scummvm_tsage.mmp.in b/backends/platform/symbian/mmp/scummvm_tsage.mmp.in
index cd4aa158dc..c0705d7aad 100644
--- a/backends/platform/symbian/mmp/scummvm_tsage.mmp.in
+++ b/backends/platform/symbian/mmp/scummvm_tsage.mmp.in
@@ -34,7 +34,8 @@ TARGET scummvm_tsage.lib
TARGETTYPE lib
OPTION MSVC /QIfist /Ob1 /Oy /GF // /QIfist disables use of __ftol2 to avoid linker probs with MS libc: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/vcrefQIfistSuppress_ftol.asp
OPTION GCC -Wno-multichar -Wno-reorder // don't optimize for ARM, platform way too sensitive for that :( just turn off some common warnings
-OPTION GCCE -Wno-multichar -Wno-reorder -Wno-unused -Wno-format -fsigned-char
+// -Wno-psabi turn off "note: the mangling of 'va_list' has changed in GCC 4.4"
+OPTION GCCE -Wno-multichar -Wno-reorder -Wno-unused -Wno-format -fsigned-char -Wno-psabi
ALWAYS_BUILD_AS_ARM
//START_AUTO_MACROS_SLAVE//
@@ -57,5 +58,15 @@ SOURCEPATH ..\..\..\..\engines\tsage
USERINCLUDE ..\..\..\..\engines
USERINCLUDE ..\..\..\.. ..\..\..\..\gui ..\..\..\..\audio ..\src
+
+SYSTEMINCLUDE \epoc32\include\freetype
+SYSTEMINCLUDE \epoc32\include\mpeg2dec
+SYSTEMINCLUDE \epoc32\include\jpeg
+SYSTEMINCLUDE \epoc32\include\png
+SYSTEMINCLUDE \epoc32\include\ESDL
SYSTEMINCLUDE \epoc32\include\ZLIB // before \epoc32\include because symbian already has older version
-SYSTEMINCLUDE \epoc32\include \epoc32\include\libc ..\src
+SYSTEMINCLUDE \epoc32\include\libc
+SYSTEMINCLUDE \epoc32\include\theora
+SYSTEMINCLUDE \epoc32\include\tremor
+SYSTEMINCLUDE \epoc32\include
+SYSTEMINCLUDE ..\src // for portdefs.h
diff --git a/backends/platform/symbian/mmp/scummvm_tucker.mmp.in b/backends/platform/symbian/mmp/scummvm_tucker.mmp.in
index 0ff8eb9920..c457dd4083 100644
--- a/backends/platform/symbian/mmp/scummvm_tucker.mmp.in
+++ b/backends/platform/symbian/mmp/scummvm_tucker.mmp.in
@@ -57,5 +57,15 @@ SOURCEPATH ..\..\..\..\engines\tucker
USERINCLUDE ..\..\..\..\engines
USERINCLUDE ..\..\..\.. ..\..\..\..\gui ..\..\..\..\audio ..\src
+
+SYSTEMINCLUDE \epoc32\include\freetype
+SYSTEMINCLUDE \epoc32\include\mpeg2dec
+SYSTEMINCLUDE \epoc32\include\jpeg
+SYSTEMINCLUDE \epoc32\include\png
+SYSTEMINCLUDE \epoc32\include\ESDL
SYSTEMINCLUDE \epoc32\include\ZLIB // before \epoc32\include because symbian already has older version
-SYSTEMINCLUDE \epoc32\include \epoc32\include\libc ..\src
+SYSTEMINCLUDE \epoc32\include\libc
+SYSTEMINCLUDE \epoc32\include\theora
+SYSTEMINCLUDE \epoc32\include\tremor
+SYSTEMINCLUDE \epoc32\include
+SYSTEMINCLUDE ..\src // for portdefs.h
diff --git a/backends/platform/symbian/mmp/scummvm_voyeur.mmp.in b/backends/platform/symbian/mmp/scummvm_voyeur.mmp.in
new file mode 100644
index 0000000000..86dc32b3f8
--- /dev/null
+++ b/backends/platform/symbian/mmp/scummvm_voyeur.mmp.in
@@ -0,0 +1,71 @@
+/* ScummVM - Graphic Adventure Engine
+ * Copyright (C) 2003-2005 Andreas 'Sprawl' Karlsson - Original EPOC port, ESDL
+ * Copyright (C) 2003-2005 Lars 'AnotherGuest' Persson - Original EPOC port, Audio System
+ * Copyright (C) 2005 Jurgen 'SumthinWicked' Braam - EPOC/CVS maintainer
+ * Copyright (C) 2005-2014 The ScummVM Team
+ *
+ * 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
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+//
+// EPOC MMP makefile project for ScummVM
+//
+
+// *** Definitions
+
+TARGET scummvm_voyeur.lib
+TARGETTYPE lib
+OPTION MSVC /QIfist /Ob1 /Oy /GF // /QIfist disables use of __ftol2 to avoid linker probs with MS libc: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/vcrefQIfistSuppress_ftol.asp
+OPTION GCC -Wno-multichar -Wno-reorder // don't optimize for ARM, platform way too sensitive for that :( just turn off some common warnings
+OPTION GCCE -Wno-multichar -Wno-reorder -Wno-unused -Wno-format -fsigned-char
+ALWAYS_BUILD_AS_ARM
+
+//START_AUTO_MACROS_SLAVE//
+
+// empty base file, will be updated by Perl build scripts
+
+//STOP_AUTO_MACROS_SLAVE//
+
+// *** SOURCE files
+
+SOURCEPATH ..\..\..\..\engines\voyeur
+
+//START_AUTO_OBJECTS_VOYEUR_//
+
+ // empty base file, will be updated by Perl build scripts
+
+//STOP_AUTO_OBJECTS_VOYEUR_//
+
+// *** Include paths
+
+USERINCLUDE ..\..\..\..\engines
+USERINCLUDE ..\..\..\.. ..\..\..\..\gui ..\..\..\..\audio ..\src
+
+SYSTEMINCLUDE \epoc32\include\freetype
+SYSTEMINCLUDE \epoc32\include\mpeg2dec
+SYSTEMINCLUDE \epoc32\include\jpeg
+SYSTEMINCLUDE \epoc32\include\png
+SYSTEMINCLUDE \epoc32\include\ESDL
+SYSTEMINCLUDE \epoc32\include\ZLIB // before \epoc32\include because symbian already has older version
+SYSTEMINCLUDE \epoc32\include\libc
+SYSTEMINCLUDE \epoc32\include\theora
+SYSTEMINCLUDE \epoc32\include\tremor
+SYSTEMINCLUDE \epoc32\include
+SYSTEMINCLUDE ..\src // for portdefs.h
diff --git a/backends/platform/symbian/mmp/scummvm_wintermute.mmp.in b/backends/platform/symbian/mmp/scummvm_wintermute.mmp.in
index ebe762fe36..63dd7d39d8 100644
--- a/backends/platform/symbian/mmp/scummvm_wintermute.mmp.in
+++ b/backends/platform/symbian/mmp/scummvm_wintermute.mmp.in
@@ -34,7 +34,8 @@ TARGET scummvm_wintermute.lib
TARGETTYPE lib
OPTION MSVC /QIfist /Ob1 /Oy /GF // /QIfist disables use of __ftol2 to avoid linker probs with MS libc: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/vcrefQIfistSuppress_ftol.asp
OPTION GCC -Wno-multichar -Wno-reorder // don't optimize for ARM, platform way too sensitive for that :( just turn off some common warnings
-OPTION GCCE -Wno-multichar -Wno-reorder -Wno-unused -Wno-format -fsigned-char
+// -Wno-psabi turn off "note: the mangling of 'va_list' has changed in GCC 4.4"
+OPTION GCCE -Wno-multichar -Wno-reorder -Wno-unused -Wno-format -fsigned-char -Wno-psabi
ALWAYS_BUILD_AS_ARM
//START_AUTO_MACROS_SLAVE//
@@ -57,5 +58,15 @@ SOURCEPATH ..\..\..\..\engines\wintermute
USERINCLUDE ..\..\..\..\engines
USERINCLUDE ..\..\..\.. ..\..\..\..\gui ..\..\..\..\audio ..\src
+
+SYSTEMINCLUDE \epoc32\include\freetype
+SYSTEMINCLUDE \epoc32\include\mpeg2dec
+SYSTEMINCLUDE \epoc32\include\jpeg
+SYSTEMINCLUDE \epoc32\include\png
+SYSTEMINCLUDE \epoc32\include\ESDL
SYSTEMINCLUDE \epoc32\include\ZLIB // before \epoc32\include because symbian already has older version
-SYSTEMINCLUDE \epoc32\include \epoc32\include\libc ..\src
+SYSTEMINCLUDE \epoc32\include\libc
+SYSTEMINCLUDE \epoc32\include\theora
+SYSTEMINCLUDE \epoc32\include\tremor
+SYSTEMINCLUDE \epoc32\include
+SYSTEMINCLUDE ..\src // for portdefs.h
diff --git a/backends/platform/symbian/mmp/scummvm_zvision.mmp.in b/backends/platform/symbian/mmp/scummvm_zvision.mmp.in
new file mode 100644
index 0000000000..642f659551
--- /dev/null
+++ b/backends/platform/symbian/mmp/scummvm_zvision.mmp.in
@@ -0,0 +1,71 @@
+/* ScummVM - Graphic Adventure Engine
+ * Copyright (C) 2003-2005 Andreas 'Sprawl' Karlsson - Original EPOC port, ESDL
+ * Copyright (C) 2003-2005 Lars 'AnotherGuest' Persson - Original EPOC port, Audio System
+ * Copyright (C) 2005 Jurgen 'SumthinWicked' Braam - EPOC/CVS maintainer
+ * Copyright (C) 2005-2013 The ScummVM project
+ * Copyright (C) 2013 Strizniou Fedor - Epoc project file
+ *
+ * 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
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+//
+// EPOC MMP makefile project for ScummVM
+//
+
+// *** Definitions
+
+TARGET scummvm_zvision.lib
+TARGETTYPE lib
+OPTION MSVC /QIfist /Ob1 /Oy /GF // /QIfist disables use of __ftol2 to avoid linker probs with MS libc: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/vcrefQIfistSuppress_ftol.asp
+OPTION GCC -Wno-multichar -Wno-reorder // don't optimize for ARM, platform way too sensitive for that :( just turn off some common warnings
+OPTION GCCE -Wno-multichar -Wno-reorder -Wno-unused -Wno-format -fsigned-char
+ALWAYS_BUILD_AS_ARM
+
+//START_AUTO_MACROS_SLAVE//
+
+ // empty base file, will be updated by Perl build scripts
+
+//STOP_AUTO_MACROS_SLAVE//
+
+// *** SOURCE files
+
+SOURCEPATH ..\..\..\..\engines\zvision
+
+//START_AUTO_OBJECTS_ZVISION_//
+
+ // empty base file, will be updated by Perl build scripts
+
+//STOP_AUTO_OBJECTS_ZVISION_//
+
+// *** Include paths
+
+USERINCLUDE ..\..\..\..\engines
+USERINCLUDE ..\..\..\.. ..\..\..\..\gui ..\..\..\..\audio ..\src
+SYSTEMINCLUDE \epoc32\include\freetype
+SYSTEMINCLUDE \epoc32\include\mpeg2dec
+SYSTEMINCLUDE \epoc32\include\jpeg
+SYSTEMINCLUDE \epoc32\include\png
+SYSTEMINCLUDE \epoc32\include\ESDL
+SYSTEMINCLUDE \epoc32\include\ZLIB // before \epoc32\include because symbian already has older version
+SYSTEMINCLUDE \epoc32\include\libc
+SYSTEMINCLUDE \epoc32\include\theora
+SYSTEMINCLUDE \epoc32\include\tremor
+SYSTEMINCLUDE \epoc32\include
+SYSTEMINCLUDE ..\src // for portdefs.h
diff --git a/backends/platform/symbian/res/ScummVmAif.rss b/backends/platform/symbian/res/ScummVmAif.rss
index fab2cadbb8..2dbf436a8f 100644
--- a/backends/platform/symbian/res/ScummVmAif.rss
+++ b/backends/platform/symbian/res/ScummVmAif.rss
@@ -2,7 +2,7 @@
* Copyright (C) 2003-2005 Andreas 'Sprawl' Karlsson - Original EPOC port, ESDL
* Copyright (C) 2003-2005 Lars 'AnotherGuest' Persson - Original EPOC port, Audio System
* Copyright (C) 2005 Jurgen 'SumthinWicked' Braam - EPOC/CVS maintainer
- * Copyright (C) 2005-2013 The ScummVM project
+ * Copyright (C) 2005-2014 The ScummVM Team
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
diff --git a/backends/platform/symbian/res/scummvm.rss b/backends/platform/symbian/res/scummvm.rss
index 7e667f1cf3..6a0ab24ff0 100644
--- a/backends/platform/symbian/res/scummvm.rss
+++ b/backends/platform/symbian/res/scummvm.rss
@@ -2,7 +2,7 @@
* Copyright (C) 2003-2005 Andreas 'Sprawl' Karlsson - Original EPOC port, ESDL
* Copyright (C) 2003-2005 Lars 'AnotherGuest' Persson - Original EPOC port, Audio System
* Copyright (C) 2005 Jurgen 'SumthinWicked' Braam - EPOC/CVS maintainer
- * Copyright (C) 2005-2013 The ScummVM project
+ * Copyright (C) 2005-2014 The ScummVM Team
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
diff --git a/backends/platform/symbian/res/scummvm_A0000658.rss b/backends/platform/symbian/res/scummvm_A0000658.rss
index 3325d72249..562fef54c6 100644
--- a/backends/platform/symbian/res/scummvm_A0000658.rss
+++ b/backends/platform/symbian/res/scummvm_A0000658.rss
@@ -2,7 +2,7 @@
* Copyright (C) 2003-2005 Andreas 'Sprawl' Karlsson - Original EPOC port, ESDL
* Copyright (C) 2003-2005 Lars 'AnotherGuest' Persson - Original EPOC port, Audio System
* Copyright (C) 2005 Jurgen 'SumthinWicked' Braam - EPOC/CVS maintainer
- * Copyright (C) 2005-2013 The ScummVM project
+ * Copyright (C) 2005-2014 The ScummVM Team
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
diff --git a/backends/platform/symbian/src/ScummApp.cpp b/backends/platform/symbian/src/ScummApp.cpp
index b952177f9a..5256c81dcc 100644
--- a/backends/platform/symbian/src/ScummApp.cpp
+++ b/backends/platform/symbian/src/ScummApp.cpp
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#include "backends/platform/symbian/src/ScummApp.h"
diff --git a/backends/platform/symbian/src/ScummApp.h b/backends/platform/symbian/src/ScummApp.h
index 00d03e6d7b..db643f61b6 100644
--- a/backends/platform/symbian/src/ScummApp.h
+++ b/backends/platform/symbian/src/ScummApp.h
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#ifndef SCUMMAPP_H
diff --git a/backends/platform/symbian/src/ScummVm.hrh b/backends/platform/symbian/src/ScummVm.hrh
index c43a9da118..316e4d08f6 100644
--- a/backends/platform/symbian/src/ScummVm.hrh
+++ b/backends/platform/symbian/src/ScummVm.hrh
@@ -2,7 +2,7 @@
* Copyright (C) 2003-2005 Andreas 'Sprawl' Karlsson - Original EPOC port, ESDL
* Copyright (C) 2003-2005 Lars 'AnotherGuest' Persson - Original EPOC port, Audio System
* Copyright (C) 2005 Jurgen 'SumthinWicked' Braam - EPOC/CVS maintainer
- * Copyright (C) 2005-2013 The ScummVM project
+ * Copyright (C) 2005-2014 The ScummVM Team
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
diff --git a/backends/platform/symbian/src/SymbianActions.cpp b/backends/platform/symbian/src/SymbianActions.cpp
index c47bd93772..0810b382d2 100644
--- a/backends/platform/symbian/src/SymbianActions.cpp
+++ b/backends/platform/symbian/src/SymbianActions.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/symbian/src/SymbianActions.h b/backends/platform/symbian/src/SymbianActions.h
index 2b65c6c950..fc68091c74 100644
--- a/backends/platform/symbian/src/SymbianActions.h
+++ b/backends/platform/symbian/src/SymbianActions.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/symbian/src/SymbianMain.cpp b/backends/platform/symbian/src/SymbianMain.cpp
index 8da2b239f4..d7ad26d769 100644
--- a/backends/platform/symbian/src/SymbianMain.cpp
+++ b/backends/platform/symbian/src/SymbianMain.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/symbian/src/SymbianOS.cpp b/backends/platform/symbian/src/SymbianOS.cpp
index b1bd976f9e..1fca7f5df5 100644
--- a/backends/platform/symbian/src/SymbianOS.cpp
+++ b/backends/platform/symbian/src/SymbianOS.cpp
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#include <sdlapp.h> // for CSDLApp::GetExecutablePathCStr() @ Symbian::GetExecutablePath()
@@ -197,3 +198,8 @@ void* scumm_bsearch(const void *key, const void *base, size_t nmemb, size_t size
return NULL;
}
+
+int remove(const char *path)
+{
+ return unlink(path);
+}
diff --git a/backends/platform/symbian/src/SymbianOS.h b/backends/platform/symbian/src/SymbianOS.h
index 74a102dc15..57a471f1a9 100644
--- a/backends/platform/symbian/src/SymbianOS.h
+++ b/backends/platform/symbian/src/SymbianOS.h
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#ifndef PLATFORM_SDL_SYMBIAN_H
diff --git a/backends/platform/symbian/src/portdefs.h b/backends/platform/symbian/src/portdefs.h
index 1f9128a54f..1fb941963b 100644
--- a/backends/platform/symbian/src/portdefs.h
+++ b/backends/platform/symbian/src/portdefs.h
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#ifndef SYMBIAN_PORTDEFS_H
@@ -60,6 +61,8 @@ typedef signed long int int32;
#define SMALL_SCREEN_DEVICE
#define DISABLE_COMMAND_LINE
+#define USE_RGB_COLOR
+int remove(const char *path);
#if defined(USE_TREMOR) && !defined(USE_VORBIS)
#define USE_VORBIS // make sure this one is defined together with USE_TREMOR!
diff --git a/backends/platform/tizen/application.cpp b/backends/platform/tizen/application.cpp
index a73efacf58..d7832ca1da 100644
--- a/backends/platform/tizen/application.cpp
+++ b/backends/platform/tizen/application.cpp
@@ -11,7 +11,7 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
diff --git a/backends/platform/tizen/application.h b/backends/platform/tizen/application.h
index f18ccb175b..c46684eafb 100644
--- a/backends/platform/tizen/application.h
+++ b/backends/platform/tizen/application.h
@@ -11,7 +11,7 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
diff --git a/backends/platform/tizen/audio.cpp b/backends/platform/tizen/audio.cpp
index f9ac80a583..b2e061baef 100644
--- a/backends/platform/tizen/audio.cpp
+++ b/backends/platform/tizen/audio.cpp
@@ -11,7 +11,7 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
diff --git a/backends/platform/tizen/audio.h b/backends/platform/tizen/audio.h
index a304231578..de4724eb3c 100644
--- a/backends/platform/tizen/audio.h
+++ b/backends/platform/tizen/audio.h
@@ -11,7 +11,7 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
diff --git a/backends/platform/tizen/form.cpp b/backends/platform/tizen/form.cpp
index 10d51cc610..3f7b918102 100644
--- a/backends/platform/tizen/form.cpp
+++ b/backends/platform/tizen/form.cpp
@@ -11,7 +11,7 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
diff --git a/backends/platform/tizen/form.h b/backends/platform/tizen/form.h
index e419c14d24..3e34b8989e 100644
--- a/backends/platform/tizen/form.h
+++ b/backends/platform/tizen/form.h
@@ -11,7 +11,7 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
diff --git a/backends/platform/tizen/fs.cpp b/backends/platform/tizen/fs.cpp
index 8145cd5638..c6cd8f0a71 100644
--- a/backends/platform/tizen/fs.cpp
+++ b/backends/platform/tizen/fs.cpp
@@ -11,12 +11,13 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#include "config.h"
diff --git a/backends/platform/tizen/fs.h b/backends/platform/tizen/fs.h
index 0356aaad33..8c1677fa7b 100644
--- a/backends/platform/tizen/fs.h
+++ b/backends/platform/tizen/fs.h
@@ -11,12 +11,13 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#ifndef TIZEN_FILESYSTEM_H
diff --git a/backends/platform/tizen/graphics.cpp b/backends/platform/tizen/graphics.cpp
index 2cafb9f781..9b23e3fe78 100644
--- a/backends/platform/tizen/graphics.cpp
+++ b/backends/platform/tizen/graphics.cpp
@@ -11,7 +11,7 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
@@ -37,13 +37,13 @@ TizenGraphicsManager::TizenGraphicsManager(TizenAppForm *appForm) :
_eglContext(EGL_NO_CONTEXT),
_initState(true) {
assert(appForm != NULL);
- _videoMode.fullscreen = true;
}
TizenGraphicsManager::~TizenGraphicsManager() {
logEntered();
if (_eglDisplay != EGL_NO_DISPLAY) {
+ notifyContextDestroy();
eglMakeCurrent(_eglDisplay, NULL, NULL, NULL);
if (_eglContext != EGL_NO_CONTEXT) {
eglDestroyContext(_eglDisplay, _eglContext);
@@ -51,17 +51,34 @@ TizenGraphicsManager::~TizenGraphicsManager() {
}
}
+result TizenGraphicsManager::Construct() {
+ // Initialize our OpenGL ES context.
+ loadEgl();
+
+ // Notify the OpenGL code about our context.
+
+ // We default to RGB565 and RGBA5551 which is closest to the actual output
+ // mode we setup.
+ notifyContextCreate(Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0), Graphics::PixelFormat(2, 5, 5, 5, 1, 11, 6, 1, 0));
+
+ // Tell our size.
+ int x, y, width, height;
+ _appForm->GetBounds(x, y, width, height);
+ AppLog("screen size: %dx%d", width, height);
+ setActualScreenSize(width, height);
+ return E_SUCCESS;
+}
+
const Graphics::Font *TizenGraphicsManager::getFontOSD() {
return FontMan.getFontByUsage(Graphics::FontManager::kBigGUIFont);
}
bool TizenGraphicsManager::moveMouse(int16 &x, int16 &y) {
- int16 currentX = _cursorState.x;
- int16 currentY = _cursorState.y;
+ int16 currentX, currentY;
+ getMousePosition(currentX, currentY);
// save the current hardware coordinates
- _cursorState.x = x;
- _cursorState.y = y;
+ setMousePosition(x, y);
// return x/y as game coordinates
adjustMousePosition(x, y);
@@ -85,15 +102,17 @@ Common::List<Graphics::PixelFormat> TizenGraphicsManager::getSupportedFormats()
}
bool TizenGraphicsManager::hasFeature(OSystem::Feature f) {
- bool result = (f == OSystem::kFeatureFullscreenMode ||
- f == OSystem::kFeatureVirtualKeyboard ||
+ bool result =
+ (f == OSystem::kFeatureVirtualKeyboard ||
OpenGLGraphicsManager::hasFeature(f));
return result;
}
void TizenGraphicsManager::setFeatureState(OSystem::Feature f, bool enable) {
- if (f == OSystem::kFeatureVirtualKeyboard && enable) {
- _appForm->showKeypad();
+ if (f == OSystem::kFeatureVirtualKeyboard) {
+ if (enable) {
+ _appForm->showKeypad();
+ }
} else {
OpenGLGraphicsManager::setFeatureState(f, enable);
}
@@ -106,8 +125,9 @@ void TizenGraphicsManager::setReady() {
}
void TizenGraphicsManager::updateScreen() {
- if (_transactionMode == kTransactionNone) {
- internUpdateScreen();
+ if (!_initState) {
+ OpenGLGraphicsManager::updateScreen();
+ eglSwapBuffers(_eglDisplay, _eglSurface);
}
}
@@ -133,10 +153,6 @@ bool TizenGraphicsManager::loadEgl() {
eglBindAPI(EGL_OPENGL_ES_API);
- if (_eglDisplay) {
- unloadGFXMode();
- }
-
_eglDisplay = eglGetDisplay((EGLNativeDisplayType) EGL_DEFAULT_DISPLAY);
if (EGL_NO_DISPLAY == _eglDisplay) {
systemError("eglGetDisplay() failed");
@@ -178,65 +194,12 @@ bool TizenGraphicsManager::loadEgl() {
systemError("eglMakeCurrent() failed");
return false;
}
- if (!_initState) {
- _appForm->GetVisualElement()->SetShowState(true);
- }
logLeaving();
return true;
}
-bool TizenGraphicsManager::loadGFXMode() {
- logEntered();
-
- if (!loadEgl()) {
- unloadGFXMode();
- return false;
- }
-
- int x, y, width, height;
- _appForm->GetBounds(x, y, width, height);
- _videoMode.overlayWidth = _videoMode.hardwareWidth = width;
- _videoMode.overlayHeight = _videoMode.hardwareHeight = height;
- _videoMode.scaleFactor = 4; // for proportional sized cursor in the launcher
-
- AppLog("screen size: %dx%d", _videoMode.hardwareWidth, _videoMode.hardwareHeight);
- return OpenGLGraphicsManager::loadGFXMode();
-}
-
-void TizenGraphicsManager::loadTextures() {
- logEntered();
- OpenGLGraphicsManager::loadTextures();
-}
-
-void TizenGraphicsManager::internUpdateScreen() {
- if (!_initState) {
- OpenGLGraphicsManager::internUpdateScreen();
- eglSwapBuffers(_eglDisplay, _eglSurface);
- }
-}
-
-void TizenGraphicsManager::unloadGFXMode() {
- logEntered();
- _appForm->GetVisualElement()->SetShowState(false);
-
- if (_eglDisplay != EGL_NO_DISPLAY) {
- eglMakeCurrent(_eglDisplay, NULL, NULL, NULL);
-
- if (_eglContext != EGL_NO_CONTEXT) {
- eglDestroyContext(_eglDisplay, _eglContext);
- _eglContext = EGL_NO_CONTEXT;
- }
-
- if (_eglSurface != EGL_NO_SURFACE) {
- eglDestroySurface(_eglDisplay, _eglSurface);
- _eglSurface = EGL_NO_SURFACE;
- }
-
- eglTerminate(_eglDisplay);
- _eglDisplay = EGL_NO_DISPLAY;
- }
-
- _eglConfig = NULL;
- OpenGLGraphicsManager::unloadGFXMode();
- logLeaving();
+bool TizenGraphicsManager::loadVideoMode(uint requestedWidth, uint requestedHeight, const Graphics::PixelFormat &format) {
+ // We get this whenever a new resolution is requested. Since Tizen is
+ // using a fixed output size we do nothing like that here.
+ return true;
}
diff --git a/backends/platform/tizen/graphics.h b/backends/platform/tizen/graphics.h
index 27e5a6aaeb..f1d4498650 100644
--- a/backends/platform/tizen/graphics.h
+++ b/backends/platform/tizen/graphics.h
@@ -11,7 +11,7 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
@@ -39,28 +39,31 @@ using namespace Tizen::Graphics;
using namespace Tizen::Graphics::Opengl;
using namespace Tizen::App;
-class TizenGraphicsManager : public OpenGLGraphicsManager {
+class TizenGraphicsManager : public OpenGL::OpenGLGraphicsManager {
public:
TizenGraphicsManager(TizenAppForm *appForm);
virtual ~TizenGraphicsManager();
+ result Construct();
+
Common::List<Graphics::PixelFormat> getSupportedFormats() const;
bool hasFeature(OSystem::Feature f);
- void updateScreen();
void setFeatureState(OSystem::Feature f, bool enable);
+ void updateScreen();
+
void setReady();
bool isReady() { return !_initState; }
- const Graphics::Font *getFontOSD();
+
bool moveMouse(int16 &x, int16 &y);
-private:
- void internUpdateScreen();
- bool loadGFXMode();
- void loadTextures();
- void unloadGFXMode();
+protected:
void setInternalMousePosition(int x, int y) {}
- void showSplash();
+ bool loadVideoMode(uint requestedWidth, uint requestedHeight, const Graphics::PixelFormat &format);
+
+ const Graphics::Font *getFontOSD();
+
+private:
bool loadEgl();
TizenAppForm *_appForm;
EGLDisplay _eglDisplay;
diff --git a/backends/platform/tizen/main.cpp b/backends/platform/tizen/main.cpp
index b12cc3adc9..50baa5b977 100644
--- a/backends/platform/tizen/main.cpp
+++ b/backends/platform/tizen/main.cpp
@@ -11,7 +11,7 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
diff --git a/backends/platform/tizen/missing.cpp b/backends/platform/tizen/missing.cpp
index 5ac55d0f6c..f24ba5655c 100644
--- a/backends/platform/tizen/missing.cpp
+++ b/backends/platform/tizen/missing.cpp
@@ -11,7 +11,7 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
diff --git a/backends/platform/tizen/portdefs.h b/backends/platform/tizen/portdefs.h
index 050ce7d1e0..f5efe85f92 100644
--- a/backends/platform/tizen/portdefs.h
+++ b/backends/platform/tizen/portdefs.h
@@ -11,7 +11,7 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
diff --git a/backends/platform/tizen/sscanf.cpp b/backends/platform/tizen/sscanf.cpp
index 75f009cc61..b52389c91c 100644
--- a/backends/platform/tizen/sscanf.cpp
+++ b/backends/platform/tizen/sscanf.cpp
@@ -11,7 +11,7 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
diff --git a/backends/platform/tizen/system.cpp b/backends/platform/tizen/system.cpp
index 3448dc1421..a235456670 100644
--- a/backends/platform/tizen/system.cpp
+++ b/backends/platform/tizen/system.cpp
@@ -11,7 +11,7 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
@@ -266,8 +266,8 @@ result TizenSystem::initModules() {
return E_OUT_OF_MEMORY;
}
- _graphicsManager = (GraphicsManager *)new TizenGraphicsManager(_appForm);
- if (!_graphicsManager) {
+ _graphicsManager = new TizenGraphicsManager(_appForm);
+ if (!_graphicsManager || getGraphics()->Construct() != E_SUCCESS) {
return E_OUT_OF_MEMORY;
}
diff --git a/backends/platform/tizen/system.h b/backends/platform/tizen/system.h
index b38940cc95..3f668baf34 100644
--- a/backends/platform/tizen/system.h
+++ b/backends/platform/tizen/system.h
@@ -11,7 +11,7 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
@@ -73,7 +73,7 @@ public:
bool isClosing() { return _appForm->isClosing(); }
TizenGraphicsManager *getGraphics() {
- return (TizenGraphicsManager *)_graphicsManager;
+ return dynamic_cast<TizenGraphicsManager *>(_graphicsManager);
}
private:
diff --git a/backends/platform/webos/main.cpp b/backends/platform/webos/main.cpp
index 43c7ba18af..70b3fe1674 100644
--- a/backends/platform/webos/main.cpp
+++ b/backends/platform/webos/main.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/webos/webos.cpp b/backends/platform/webos/webos.cpp
index fc18628235..da60b27713 100644
--- a/backends/platform/webos/webos.cpp
+++ b/backends/platform/webos/webos.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/webos/webos.h b/backends/platform/webos/webos.h
index dda56a70da..a2535ddc08 100644
--- a/backends/platform/webos/webos.h
+++ b/backends/platform/webos/webos.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/wii/main.cpp b/backends/platform/wii/main.cpp
index affe053b6a..35d800a527 100644
--- a/backends/platform/wii/main.cpp
+++ b/backends/platform/wii/main.cpp
@@ -8,15 +8,16 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#define FORBIDDEN_SYMBOL_EXCEPTION_chdir
@@ -225,7 +226,8 @@ int main(int argc, char *argv[]) {
printf("shutdown\n");
SYS_UnregisterResetFunc(&resetinfo);
- fatUnmountDefault();
+ fatUnmount("usb:/");
+ fatUnmount("sd:/");
if (res)
show_console(res);
diff --git a/backends/platform/wii/options.cpp b/backends/platform/wii/options.cpp
index ede81343ca..731e979ec0 100644
--- a/backends/platform/wii/options.cpp
+++ b/backends/platform/wii/options.cpp
@@ -16,7 +16,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
diff --git a/backends/platform/wii/options.h b/backends/platform/wii/options.h
index 9b500ef29f..1fa4acd50e 100644
--- a/backends/platform/wii/options.h
+++ b/backends/platform/wii/options.h
@@ -16,7 +16,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
diff --git a/backends/platform/wii/osystem.cpp b/backends/platform/wii/osystem.cpp
index 9d3a7473e3..ab2f2c6f0f 100644
--- a/backends/platform/wii/osystem.cpp
+++ b/backends/platform/wii/osystem.cpp
@@ -8,15 +8,16 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#define FORBIDDEN_SYMBOL_ALLOW_ALL
diff --git a/backends/platform/wii/osystem.h b/backends/platform/wii/osystem.h
index 287c70ad6b..f1591614bf 100644
--- a/backends/platform/wii/osystem.h
+++ b/backends/platform/wii/osystem.h
@@ -8,15 +8,16 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#ifndef _WII_OSYSTEM_H_
diff --git a/backends/platform/wii/osystem_events.cpp b/backends/platform/wii/osystem_events.cpp
index 3ba66aed89..2da1d80917 100644
--- a/backends/platform/wii/osystem_events.cpp
+++ b/backends/platform/wii/osystem_events.cpp
@@ -8,15 +8,16 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#define FORBIDDEN_SYMBOL_EXCEPTION_printf
@@ -188,7 +189,7 @@ void OSystem_Wii::initEvents() {
_padAcceleration = 9 - ConfMan.getInt("wii_pad_acceleration");
#ifdef USE_WII_KBD
- _kbd_active = KEYBOARD_Init() >= 0;
+ _kbd_active = KEYBOARD_Init(NULL) >= 0;
#endif
}
diff --git a/backends/platform/wii/osystem_gfx.cpp b/backends/platform/wii/osystem_gfx.cpp
index 92c890b0a9..bb91242f98 100644
--- a/backends/platform/wii/osystem_gfx.cpp
+++ b/backends/platform/wii/osystem_gfx.cpp
@@ -8,15 +8,16 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#define FORBIDDEN_SYMBOL_EXCEPTION_printf
@@ -716,8 +717,8 @@ void OSystem_Wii::setMouseCursor(const void *buf, uint w, uint h, int hotspotX,
u16 *d = (u16 *) tmp;
for (u16 y = 0; y < h; ++y) {
for (u16 x = 0; x < w; ++x) {
- if (*s++ != _mouseKeyColor)
- *d++ |= 7 << 12;
+ if (*s++ == _mouseKeyColor)
+ *d++ &= ~(7 << 12);
else
d++;
}
diff --git a/backends/platform/wii/osystem_sfx.cpp b/backends/platform/wii/osystem_sfx.cpp
index 2e658e47aa..70a440a600 100644
--- a/backends/platform/wii/osystem_sfx.cpp
+++ b/backends/platform/wii/osystem_sfx.cpp
@@ -8,15 +8,16 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#define FORBIDDEN_SYMBOL_EXCEPTION_printf
diff --git a/backends/platform/wii/wii.mk b/backends/platform/wii/wii.mk
index 7d2db68b4e..99ef46338c 100644
--- a/backends/platform/wii/wii.mk
+++ b/backends/platform/wii/wii.mk
@@ -17,10 +17,10 @@ geckoupload: $(WII_EXE_STRIPPED)
$(DEVKITPPC)/bin/geckoupload $<
wiigdb:
- $(DEVKITPPC)/bin/powerpc-gekko-gdb -n $(EXECUTABLE)
+ $(DEVKITPPC)/bin/powerpc-eabi-gdb -n $(EXECUTABLE)
wiidebug:
- $(DEVKITPPC)/bin/powerpc-gekko-gdb -n $(EXECUTABLE) -x $(srcdir)/backends/platform/wii/gdb.txt
+ $(DEVKITPPC)/bin/powerpc-eabi-gdb -n $(EXECUTABLE) -x $(srcdir)/backends/platform/wii/gdb.txt
# target to create a Wii snapshot
wiidist: all
diff --git a/backends/platform/wince/CEActionsPocket.cpp b/backends/platform/wince/CEActionsPocket.cpp
index 5980a41caa..09286f2e9f 100644
--- a/backends/platform/wince/CEActionsPocket.cpp
+++ b/backends/platform/wince/CEActionsPocket.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -236,7 +236,7 @@ CEActionsPocket::~CEActionsPocket() {
bool CEActionsPocket::perform(GUI::ActionType action, bool pushed) {
static bool keydialogrunning = false, quitdialog = false;
- _graphicsMan = ((WINCESdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager());
+ _graphicsMan = dynamic_cast<WINCESdlGraphicsManager *>(((OSystem_SDL *)g_system)->getGraphicsManager());
if (!pushed) {
switch (action) {
diff --git a/backends/platform/wince/CEActionsPocket.h b/backends/platform/wince/CEActionsPocket.h
index e1f52b6b88..f2952c059a 100644
--- a/backends/platform/wince/CEActionsPocket.h
+++ b/backends/platform/wince/CEActionsPocket.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/wince/CEActionsSmartphone.cpp b/backends/platform/wince/CEActionsSmartphone.cpp
index 2cce288323..95957707e3 100644
--- a/backends/platform/wince/CEActionsSmartphone.cpp
+++ b/backends/platform/wince/CEActionsSmartphone.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -202,7 +202,7 @@ CEActionsSmartphone::~CEActionsSmartphone() {
bool CEActionsSmartphone::perform(GUI::ActionType action, bool pushed) {
static bool keydialogrunning = false, quitdialog = false;
- _graphicsMan = ((WINCESdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager());
+ _graphicsMan = dynamic_cast<WINCESdlGraphicsManager *>(((OSystem_SDL *)g_system)->getGraphicsManager());
if (!pushed) {
switch (action) {
diff --git a/backends/platform/wince/CEActionsSmartphone.h b/backends/platform/wince/CEActionsSmartphone.h
index 3da46d3923..46529bbd99 100644
--- a/backends/platform/wince/CEActionsSmartphone.h
+++ b/backends/platform/wince/CEActionsSmartphone.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/wince/CEDevice.cpp b/backends/platform/wince/CEDevice.cpp
index 640b1e9169..ffadfeb993 100644
--- a/backends/platform/wince/CEDevice.cpp
+++ b/backends/platform/wince/CEDevice.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/wince/CEDevice.h b/backends/platform/wince/CEDevice.h
index b9f815ac71..2032b7fb27 100644
--- a/backends/platform/wince/CEDevice.h
+++ b/backends/platform/wince/CEDevice.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/wince/CEException.cpp b/backends/platform/wince/CEException.cpp
index 4a03354112..46bb618e39 100644
--- a/backends/platform/wince/CEException.cpp
+++ b/backends/platform/wince/CEException.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/wince/CEException.h b/backends/platform/wince/CEException.h
index 3d4616f282..8ce6bd7dc0 100644
--- a/backends/platform/wince/CEException.h
+++ b/backends/platform/wince/CEException.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/wince/CELauncherDialog.cpp b/backends/platform/wince/CELauncherDialog.cpp
index dd6076e0af..f7795dfdef 100644
--- a/backends/platform/wince/CELauncherDialog.cpp
+++ b/backends/platform/wince/CELauncherDialog.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -65,12 +65,12 @@ public:
};
CELauncherDialog::CELauncherDialog() : GUI::LauncherDialog() {
- ((WINCESdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager())->reset_panel();
+ dynamic_cast<WINCESdlGraphicsManager *>(((OSystem_SDL *)g_system)->getGraphicsManager())->reset_panel();
}
void CELauncherDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {
if ((cmd == 'STRT') || (cmd == kListItemActivatedCmd) || (cmd == kListItemDoubleClickedCmd)) {
- ((WINCESdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager())->init_panel();
+ dynamic_cast<WINCESdlGraphicsManager *>(((OSystem_SDL *)g_system)->getGraphicsManager())->init_panel();
}
LauncherDialog::handleCommand(sender, cmd, data);
if (cmd == 'ABOU') {
diff --git a/backends/platform/wince/CELauncherDialog.h b/backends/platform/wince/CELauncherDialog.h
index ac84cd3e21..9f69b8500f 100644
--- a/backends/platform/wince/CELauncherDialog.h
+++ b/backends/platform/wince/CELauncherDialog.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/wince/CEScaler.cpp b/backends/platform/wince/CEScaler.cpp
index 66f7809a3a..321bdd92a9 100644
--- a/backends/platform/wince/CEScaler.cpp
+++ b/backends/platform/wince/CEScaler.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/wince/CEScaler.h b/backends/platform/wince/CEScaler.h
index de001f7348..fc6540a33c 100644
--- a/backends/platform/wince/CEScaler.h
+++ b/backends/platform/wince/CEScaler.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/wince/CEgui/CEGUI.h b/backends/platform/wince/CEgui/CEGUI.h
index 8b2e3528e3..8b6db6b099 100644
--- a/backends/platform/wince/CEgui/CEGUI.h
+++ b/backends/platform/wince/CEgui/CEGUI.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/wince/CEgui/GUIElement.cpp b/backends/platform/wince/CEgui/GUIElement.cpp
index c8e68b87fd..e33e7f7f9d 100644
--- a/backends/platform/wince/CEgui/GUIElement.cpp
+++ b/backends/platform/wince/CEgui/GUIElement.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/wince/CEgui/GUIElement.h b/backends/platform/wince/CEgui/GUIElement.h
index 44c4b3f275..6695029877 100644
--- a/backends/platform/wince/CEgui/GUIElement.h
+++ b/backends/platform/wince/CEgui/GUIElement.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/wince/CEgui/ItemAction.cpp b/backends/platform/wince/CEgui/ItemAction.cpp
index 7d6316748b..89ca48efdc 100644
--- a/backends/platform/wince/CEgui/ItemAction.cpp
+++ b/backends/platform/wince/CEgui/ItemAction.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/wince/CEgui/ItemAction.h b/backends/platform/wince/CEgui/ItemAction.h
index 7b36eaf11a..8de0046d4c 100644
--- a/backends/platform/wince/CEgui/ItemAction.h
+++ b/backends/platform/wince/CEgui/ItemAction.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/wince/CEgui/ItemSwitch.cpp b/backends/platform/wince/CEgui/ItemSwitch.cpp
index 444826201c..7bb0a23a7b 100644
--- a/backends/platform/wince/CEgui/ItemSwitch.cpp
+++ b/backends/platform/wince/CEgui/ItemSwitch.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/wince/CEgui/ItemSwitch.h b/backends/platform/wince/CEgui/ItemSwitch.h
index 724d31363c..e54b4b1b99 100644
--- a/backends/platform/wince/CEgui/ItemSwitch.h
+++ b/backends/platform/wince/CEgui/ItemSwitch.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/wince/CEgui/Panel.cpp b/backends/platform/wince/CEgui/Panel.cpp
index 0853bae8f2..273d06a054 100644
--- a/backends/platform/wince/CEgui/Panel.cpp
+++ b/backends/platform/wince/CEgui/Panel.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/wince/CEgui/Panel.h b/backends/platform/wince/CEgui/Panel.h
index 514ee5b8af..db38751073 100644
--- a/backends/platform/wince/CEgui/Panel.h
+++ b/backends/platform/wince/CEgui/Panel.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/wince/CEgui/PanelItem.cpp b/backends/platform/wince/CEgui/PanelItem.cpp
index 2849e256fb..186b5161ef 100644
--- a/backends/platform/wince/CEgui/PanelItem.cpp
+++ b/backends/platform/wince/CEgui/PanelItem.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/wince/CEgui/PanelItem.h b/backends/platform/wince/CEgui/PanelItem.h
index 8305311ff2..a0a72c2525 100644
--- a/backends/platform/wince/CEgui/PanelItem.h
+++ b/backends/platform/wince/CEgui/PanelItem.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/wince/CEgui/PanelKeyboard.cpp b/backends/platform/wince/CEgui/PanelKeyboard.cpp
index cab02150c5..34ba8d6473 100644
--- a/backends/platform/wince/CEgui/PanelKeyboard.cpp
+++ b/backends/platform/wince/CEgui/PanelKeyboard.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/wince/CEgui/PanelKeyboard.h b/backends/platform/wince/CEgui/PanelKeyboard.h
index 69d6a89bd2..a0daca81e3 100644
--- a/backends/platform/wince/CEgui/PanelKeyboard.h
+++ b/backends/platform/wince/CEgui/PanelKeyboard.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/wince/CEgui/SDL_ImageResource.cpp b/backends/platform/wince/CEgui/SDL_ImageResource.cpp
index 507f9ad7fe..ec430fc848 100644
--- a/backends/platform/wince/CEgui/SDL_ImageResource.cpp
+++ b/backends/platform/wince/CEgui/SDL_ImageResource.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/wince/CEgui/SDL_ImageResource.h b/backends/platform/wince/CEgui/SDL_ImageResource.h
index 08807a5c1f..4fd7932743 100644
--- a/backends/platform/wince/CEgui/SDL_ImageResource.h
+++ b/backends/platform/wince/CEgui/SDL_ImageResource.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/wince/CEgui/Toolbar.cpp b/backends/platform/wince/CEgui/Toolbar.cpp
index 0e8e82f1f4..9e04a30210 100644
--- a/backends/platform/wince/CEgui/Toolbar.cpp
+++ b/backends/platform/wince/CEgui/Toolbar.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/wince/CEgui/Toolbar.h b/backends/platform/wince/CEgui/Toolbar.h
index c7e62bb3d9..d0ac2cdcb3 100644
--- a/backends/platform/wince/CEgui/Toolbar.h
+++ b/backends/platform/wince/CEgui/Toolbar.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/wince/CEgui/ToolbarHandler.cpp b/backends/platform/wince/CEgui/ToolbarHandler.cpp
index f3e42e11fa..534b338cdb 100644
--- a/backends/platform/wince/CEgui/ToolbarHandler.cpp
+++ b/backends/platform/wince/CEgui/ToolbarHandler.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/wince/CEgui/ToolbarHandler.h b/backends/platform/wince/CEgui/ToolbarHandler.h
index 5709cf3f1a..36f4022bd8 100644
--- a/backends/platform/wince/CEgui/ToolbarHandler.h
+++ b/backends/platform/wince/CEgui/ToolbarHandler.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/wince/CEkeys/CEKeys.h b/backends/platform/wince/CEkeys/CEKeys.h
index cf71b982f3..31f5ba839c 100644
--- a/backends/platform/wince/CEkeys/CEKeys.h
+++ b/backends/platform/wince/CEkeys/CEKeys.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/wince/CEkeys/EventsBuffer.cpp b/backends/platform/wince/CEkeys/EventsBuffer.cpp
index c993798dc8..b4fdc0010d 100644
--- a/backends/platform/wince/CEkeys/EventsBuffer.cpp
+++ b/backends/platform/wince/CEkeys/EventsBuffer.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/wince/CEkeys/EventsBuffer.h b/backends/platform/wince/CEkeys/EventsBuffer.h
index 235a3e7afd..6c1b12cc24 100644
--- a/backends/platform/wince/CEkeys/EventsBuffer.h
+++ b/backends/platform/wince/CEkeys/EventsBuffer.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/wince/missing/missing.cpp b/backends/platform/wince/missing/missing.cpp
index ba35f15bb7..0355f35a69 100644
--- a/backends/platform/wince/missing/missing.cpp
+++ b/backends/platform/wince/missing/missing.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/wince/portdefs.h b/backends/platform/wince/portdefs.h
index 289406c2a4..3304ee0893 100644
--- a/backends/platform/wince/portdefs.h
+++ b/backends/platform/wince/portdefs.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/wince/stub.cpp b/backends/platform/wince/stub.cpp
index 9f42dc76aa..aba3fb973e 100644
--- a/backends/platform/wince/stub.cpp
+++ b/backends/platform/wince/stub.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/wince/wince-sdl.cpp b/backends/platform/wince/wince-sdl.cpp
index 3897731db4..96c9313c5d 100644
--- a/backends/platform/wince/wince-sdl.cpp
+++ b/backends/platform/wince/wince-sdl.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -422,7 +422,7 @@ void OSystem_WINCE3::initBackend() {
if (_graphicsManager == 0)
_graphicsManager = new WINCESdlGraphicsManager(_eventSource);
- ((WINCESdlEventSource *)_eventSource)->init((WINCESdlGraphicsManager *)_graphicsManager);
+ ((WINCESdlEventSource *)_eventSource)->init(dynamic_cast<WINCESdlGraphicsManager *>(_graphicsManager));
// Call parent implementation of this method
OSystem_SDL::initBackend();
@@ -486,15 +486,16 @@ void OSystem_WINCE3::swap_sound_master() {
//WINCESdlGraphicsManager _graphicsManager
- if (((WINCESdlGraphicsManager *)_graphicsManager)->_toolbarHandler.activeName() == NAME_MAIN_PANEL)
- ((WINCESdlGraphicsManager *)_graphicsManager)->_toolbarHandler.forceRedraw(); // redraw sound icon
+ WINCESdlGraphicsManager *graphicsManager = dynamic_cast<WINCESdlGraphicsManager *>(_graphicsManager);
+ if (graphicsManager->_toolbarHandler.activeName() == NAME_MAIN_PANEL)
+ graphicsManager->_toolbarHandler.forceRedraw(); // redraw sound icon
}
void OSystem_WINCE3::engineInit() {
check_mappings(); // called here to initialize virtual keys handling
- ((WINCESdlGraphicsManager *)_graphicsManager)->update_game_settings();
+ dynamic_cast<WINCESdlGraphicsManager *>(_graphicsManager)->update_game_settings();
// finalize mixer init
_mixerManager->init();
}
@@ -563,7 +564,7 @@ void OSystem_WINCE3::setGraphicsModeIntern() {
void OSystem_WINCE3::initSDL() {
// Check if SDL has not been initialized
if (!_initedSDL) {
- uint32 sdlFlags = SDL_INIT_EVENTTHREAD;
+ uint32 sdlFlags = SDL_INIT_EVENTTHREAD | SDL_INIT_VIDEO;
if (ConfMan.hasKey("disable_sdl_parachute"))
sdlFlags |= SDL_INIT_NOPARACHUTE;
@@ -576,9 +577,6 @@ void OSystem_WINCE3::initSDL() {
if (SDL_Init(sdlFlags) == -1)
error("Could not initialize SDL: %s", SDL_GetError());
- // Enable unicode support if possible
- SDL_EnableUNICODE(1);
-
_initedSDL = true;
}
}
diff --git a/backends/platform/wince/wince-sdl.h b/backends/platform/wince/wince-sdl.h
index b4f323c9e2..2d5a02a23d 100644
--- a/backends/platform/wince/wince-sdl.h
+++ b/backends/platform/wince/wince-sdl.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/plugins/ds/ds-provider.cpp b/backends/plugins/ds/ds-provider.cpp
index 21ec157e5f..1c9744518e 100644
--- a/backends/plugins/ds/ds-provider.cpp
+++ b/backends/plugins/ds/ds-provider.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/plugins/ds/ds-provider.h b/backends/plugins/ds/ds-provider.h
index 1d806a03bd..4eae89383b 100644
--- a/backends/plugins/ds/ds-provider.h
+++ b/backends/plugins/ds/ds-provider.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/plugins/dynamic-plugin.h b/backends/plugins/dynamic-plugin.h
index d68321b2a9..5aca44b676 100644
--- a/backends/plugins/dynamic-plugin.h
+++ b/backends/plugins/dynamic-plugin.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/plugins/elf/arm-loader.cpp b/backends/plugins/elf/arm-loader.cpp
index f8deac9c88..3aabf44452 100644
--- a/backends/plugins/elf/arm-loader.cpp
+++ b/backends/plugins/elf/arm-loader.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/plugins/elf/arm-loader.h b/backends/plugins/elf/arm-loader.h
index 598517d2ef..6f7ae2601d 100644
--- a/backends/plugins/elf/arm-loader.h
+++ b/backends/plugins/elf/arm-loader.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/plugins/elf/elf-loader.cpp b/backends/plugins/elf/elf-loader.cpp
index d60ddce57e..5198fa8088 100644
--- a/backends/plugins/elf/elf-loader.cpp
+++ b/backends/plugins/elf/elf-loader.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/plugins/elf/elf-loader.h b/backends/plugins/elf/elf-loader.h
index 58cc7714cf..17ca35482a 100644
--- a/backends/plugins/elf/elf-loader.h
+++ b/backends/plugins/elf/elf-loader.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/plugins/elf/elf-provider.cpp b/backends/plugins/elf/elf-provider.cpp
index f637596d8d..28536eee94 100644
--- a/backends/plugins/elf/elf-provider.cpp
+++ b/backends/plugins/elf/elf-provider.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/plugins/elf/elf-provider.h b/backends/plugins/elf/elf-provider.h
index a966f371f6..1270949f42 100644
--- a/backends/plugins/elf/elf-provider.h
+++ b/backends/plugins/elf/elf-provider.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/plugins/elf/elf32.h b/backends/plugins/elf/elf32.h
index 1ecc68a8f0..9f6f92fe95 100644
--- a/backends/plugins/elf/elf32.h
+++ b/backends/plugins/elf/elf32.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/plugins/elf/memory-manager.cpp b/backends/plugins/elf/memory-manager.cpp
index 47b77a3ec2..5014718ae8 100644
--- a/backends/plugins/elf/memory-manager.cpp
+++ b/backends/plugins/elf/memory-manager.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/plugins/elf/memory-manager.h b/backends/plugins/elf/memory-manager.h
index 032ecb2be5..12373556df 100644
--- a/backends/plugins/elf/memory-manager.h
+++ b/backends/plugins/elf/memory-manager.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/plugins/elf/mips-loader.cpp b/backends/plugins/elf/mips-loader.cpp
index 6c0e688783..47ae00a8ea 100644
--- a/backends/plugins/elf/mips-loader.cpp
+++ b/backends/plugins/elf/mips-loader.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/plugins/elf/mips-loader.h b/backends/plugins/elf/mips-loader.h
index 1103e939ce..44b4468bb5 100644
--- a/backends/plugins/elf/mips-loader.h
+++ b/backends/plugins/elf/mips-loader.h
@@ -9,12 +9,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/plugins/elf/ppc-loader.cpp b/backends/plugins/elf/ppc-loader.cpp
index 4c9290ad5e..dffd95993b 100644
--- a/backends/plugins/elf/ppc-loader.cpp
+++ b/backends/plugins/elf/ppc-loader.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/plugins/elf/ppc-loader.h b/backends/plugins/elf/ppc-loader.h
index 8614476a92..e99c57117c 100644
--- a/backends/plugins/elf/ppc-loader.h
+++ b/backends/plugins/elf/ppc-loader.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/plugins/elf/shorts-segment-manager.cpp b/backends/plugins/elf/shorts-segment-manager.cpp
index 993a538f6c..4fa03cc79c 100644
--- a/backends/plugins/elf/shorts-segment-manager.cpp
+++ b/backends/plugins/elf/shorts-segment-manager.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/plugins/elf/shorts-segment-manager.h b/backends/plugins/elf/shorts-segment-manager.h
index 34e233a2f4..0e9268a769 100644
--- a/backends/plugins/elf/shorts-segment-manager.h
+++ b/backends/plugins/elf/shorts-segment-manager.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/plugins/elf/version.cpp b/backends/plugins/elf/version.cpp
index 9f64870500..ac999e1d7c 100644
--- a/backends/plugins/elf/version.cpp
+++ b/backends/plugins/elf/version.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -23,6 +23,10 @@
#include "backends/plugins/elf/version.h"
#ifdef USE_ELF_LOADER
-const char *gScummVMPluginBuildDate __attribute__((visibility("hidden"))) =
- __DATE__ " " __TIME__ ;
+ #ifdef __PLAYSTATION2__
+ const char *gScummVMPluginBuildDate = "Git Master"; /* ScummVM Git Master */
+ #else
+ const char *gScummVMPluginBuildDate __attribute__((visibility("hidden"))) =
+ __DATE__ " " __TIME__ ;
+ #endif
#endif
diff --git a/backends/plugins/elf/version.h b/backends/plugins/elf/version.h
index 1f6924028b..1e901bc162 100644
--- a/backends/plugins/elf/version.h
+++ b/backends/plugins/elf/version.h
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#ifndef BACKENDS_PLUGINS_ELF_VERSION_H
diff --git a/backends/plugins/posix/posix-provider.cpp b/backends/plugins/posix/posix-provider.cpp
index a68a792fa4..b484842ea5 100644
--- a/backends/plugins/posix/posix-provider.cpp
+++ b/backends/plugins/posix/posix-provider.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/plugins/posix/posix-provider.h b/backends/plugins/posix/posix-provider.h
index b1186ccf3f..f5fc96eac4 100644
--- a/backends/plugins/posix/posix-provider.h
+++ b/backends/plugins/posix/posix-provider.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/plugins/ps2/ps2-provider.cpp b/backends/plugins/ps2/ps2-provider.cpp
index 50cddb05e0..a4a9877c61 100644
--- a/backends/plugins/ps2/ps2-provider.cpp
+++ b/backends/plugins/ps2/ps2-provider.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/plugins/ps2/ps2-provider.h b/backends/plugins/ps2/ps2-provider.h
index f4498204b4..6c95cc395a 100644
--- a/backends/plugins/ps2/ps2-provider.h
+++ b/backends/plugins/ps2/ps2-provider.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/plugins/psp/psp-provider.cpp b/backends/plugins/psp/psp-provider.cpp
index 1d8cad6b50..217a58e48d 100644
--- a/backends/plugins/psp/psp-provider.cpp
+++ b/backends/plugins/psp/psp-provider.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/plugins/psp/psp-provider.h b/backends/plugins/psp/psp-provider.h
index 4ace3e7f4b..6211ac6f64 100644
--- a/backends/plugins/psp/psp-provider.h
+++ b/backends/plugins/psp/psp-provider.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/plugins/sdl/sdl-provider.cpp b/backends/plugins/sdl/sdl-provider.cpp
index 00520b48b0..5749a2afa2 100644
--- a/backends/plugins/sdl/sdl-provider.cpp
+++ b/backends/plugins/sdl/sdl-provider.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/plugins/sdl/sdl-provider.h b/backends/plugins/sdl/sdl-provider.h
index 881aa5cc19..8b5ae31c17 100644
--- a/backends/plugins/sdl/sdl-provider.h
+++ b/backends/plugins/sdl/sdl-provider.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/plugins/wii/wii-provider.cpp b/backends/plugins/wii/wii-provider.cpp
index f96254eabe..4d7391b44e 100644
--- a/backends/plugins/wii/wii-provider.cpp
+++ b/backends/plugins/wii/wii-provider.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/plugins/wii/wii-provider.h b/backends/plugins/wii/wii-provider.h
index fb847e1024..49eba82e8b 100644
--- a/backends/plugins/wii/wii-provider.h
+++ b/backends/plugins/wii/wii-provider.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/plugins/win32/win32-provider.cpp b/backends/plugins/win32/win32-provider.cpp
index 0a08e48e6f..5f4d405da4 100644
--- a/backends/plugins/win32/win32-provider.cpp
+++ b/backends/plugins/win32/win32-provider.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/plugins/win32/win32-provider.h b/backends/plugins/win32/win32-provider.h
index 42c04e6d59..71e6cf098c 100644
--- a/backends/plugins/win32/win32-provider.h
+++ b/backends/plugins/win32/win32-provider.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/saves/default/default-saves.cpp b/backends/saves/default/default-saves.cpp
index 64e7e778b6..1b955a5021 100644
--- a/backends/saves/default/default-saves.cpp
+++ b/backends/saves/default/default-saves.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/saves/default/default-saves.h b/backends/saves/default/default-saves.h
index c7fca279bc..81f45f96b8 100644
--- a/backends/saves/default/default-saves.h
+++ b/backends/saves/default/default-saves.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/saves/posix/posix-saves.cpp b/backends/saves/posix/posix-saves.cpp
index e04609be5b..96828320a6 100644
--- a/backends/saves/posix/posix-saves.cpp
+++ b/backends/saves/posix/posix-saves.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/saves/posix/posix-saves.h b/backends/saves/posix/posix-saves.h
index 160075d3db..2477bd60e7 100644
--- a/backends/saves/posix/posix-saves.h
+++ b/backends/saves/posix/posix-saves.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/saves/psp/psp-saves.cpp b/backends/saves/psp/psp-saves.cpp
index 65003e9fb9..9d9affbc1b 100644
--- a/backends/saves/psp/psp-saves.cpp
+++ b/backends/saves/psp/psp-saves.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/saves/psp/psp-saves.h b/backends/saves/psp/psp-saves.h
index de2d8a693e..a0e4c38ecf 100644
--- a/backends/saves/psp/psp-saves.h
+++ b/backends/saves/psp/psp-saves.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/saves/recorder/recorder-saves.cpp b/backends/saves/recorder/recorder-saves.cpp
index 49b4672913..e2cdc5c1c2 100644
--- a/backends/saves/recorder/recorder-saves.cpp
+++ b/backends/saves/recorder/recorder-saves.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/saves/recorder/recorder-saves.h b/backends/saves/recorder/recorder-saves.h
index 692aeca329..b5bf02fc83 100644
--- a/backends/saves/recorder/recorder-saves.h
+++ b/backends/saves/recorder/recorder-saves.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/saves/savefile.cpp b/backends/saves/savefile.cpp
index edfdd9bc20..b04c53d832 100644
--- a/backends/saves/savefile.cpp
+++ b/backends/saves/savefile.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/saves/windows/windows-saves.cpp b/backends/saves/windows/windows-saves.cpp
index d520632394..b84ab1312d 100644
--- a/backends/saves/windows/windows-saves.cpp
+++ b/backends/saves/windows/windows-saves.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/saves/windows/windows-saves.h b/backends/saves/windows/windows-saves.h
index a705aa2b7f..d22033273a 100644
--- a/backends/saves/windows/windows-saves.h
+++ b/backends/saves/windows/windows-saves.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/taskbar/macosx/macosx-taskbar.h b/backends/taskbar/macosx/macosx-taskbar.h
new file mode 100644
index 0000000000..5d5b9d02cd
--- /dev/null
+++ b/backends/taskbar/macosx/macosx-taskbar.h
@@ -0,0 +1,57 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * 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
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef BACKEND_MACOSX_TASKBAR_H
+#define BACKEND_MACOSX_TASKBAR_H
+
+#if defined(MACOSX) && defined(USE_TASKBAR)
+
+#include "common/str.h"
+#include "common/taskbar.h"
+
+class MacOSXTaskbarManager : public Common::TaskbarManager {
+public:
+ MacOSXTaskbarManager();
+ virtual ~MacOSXTaskbarManager();
+
+ virtual void setOverlayIcon(const Common::String &name, const Common::String &description);
+ virtual void setProgressValue(int completed, int total);
+ virtual void setProgressState(TaskbarProgressState state);
+ virtual void setCount(int count);
+ virtual void notifyError();
+ virtual void clearError();
+
+private:
+ Common::String getIconPath(const Common::String&);
+
+ void initApplicationIconView();
+ void clearApplicationIconView();
+
+ void initOverlayIconView();
+ void clearOverlayIconView();
+
+ double _progress;
+};
+
+#endif
+
+#endif // BACKEND_MACOSX_TASKBAR_H
diff --git a/backends/taskbar/macosx/macosx-taskbar.mm b/backends/taskbar/macosx/macosx-taskbar.mm
new file mode 100644
index 0000000000..ae087dfb85
--- /dev/null
+++ b/backends/taskbar/macosx/macosx-taskbar.mm
@@ -0,0 +1,238 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * 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
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+// Disable symbol overrides so that we can use system headers
+#define FORBIDDEN_SYMBOL_ALLOW_ALL
+#include "common/scummsys.h"
+
+#if defined(MACOSX) && defined(USE_TASKBAR)
+
+// NSDockTile was introduced with Mac OS X 10.5.
+// Try provide backward compatibility by avoiding NSDockTile symbols.
+
+// TODO: Implement recent list, maybe as a custom menu on dock tile when app is not running
+// See Dock Tile plug-in at https://developer.apple.com/library/mac/documentation/Carbon/Conceptual/customizing_docktile/CreatingaDockTilePlug-in/CreatingaDockTilePlug-in.html
+
+#include "backends/taskbar/macosx/macosx-taskbar.h"
+#include "common/config-manager.h"
+#include "common/file.h"
+
+#include <AppKit/NSApplication.h>
+#include <AppKit/NSImage.h>
+#include <Foundation/NSString.h>
+#include <AppKit/NSImageView.h>
+#include <AppKit/NSColor.h>
+#include <AppKit/NSBezierPath.h>
+#include <CoreFoundation/CFString.h>
+
+id _dockTile;
+NSImageView *_applicationIconView;
+NSImageView *_overlayIconView;
+
+// Using a NSProgressIndicator as a sub-view of the NSDockTile view does not work properly.
+// The progress indicator is grayed out and display no progress. So instead the bar is drawn
+// manually, which is a bit more work :(
+
+MacOSXTaskbarManager::MacOSXTaskbarManager() : _progress(-1.0) {
+ if ([NSApp respondsToSelector:@selector(dockTile)])
+ _dockTile = [NSApp dockTile];
+ _applicationIconView = nil;
+ _overlayIconView = nil;
+}
+
+MacOSXTaskbarManager::~MacOSXTaskbarManager() {
+ clearApplicationIconView();
+}
+
+void MacOSXTaskbarManager::initApplicationIconView() {
+ if (_dockTile == nil)
+ return;
+ if (_applicationIconView == nil) {
+ _applicationIconView = [[NSImageView alloc] init];
+ [_applicationIconView setImage:[NSApp applicationIconImage]];
+ [_dockTile performSelector:@selector(setContentView:) withObject:_applicationIconView];
+ }
+}
+
+void MacOSXTaskbarManager::clearApplicationIconView() {
+ if (_dockTile == nil)
+ return;
+ [_dockTile performSelector:@selector(setContentView:) withObject:nil];
+ [_applicationIconView release];
+ _applicationIconView = nil;
+}
+
+void MacOSXTaskbarManager::initOverlayIconView() {
+ if (_dockTile == nil)
+ return;
+ if (_overlayIconView == nil) {
+ const double overlaySize = 0.75;
+ initApplicationIconView();
+ NSSize size = [_applicationIconView frame].size;
+ _overlayIconView = [[NSImageView alloc] initWithFrame:NSMakeRect(size.width * (1.0-overlaySize), 0.0f, size.width * overlaySize, size.height * overlaySize)];
+ [_overlayIconView setImageAlignment:NSImageAlignBottomRight];
+ [_applicationIconView addSubview:_overlayIconView];
+ [_overlayIconView release];
+ }
+}
+
+void MacOSXTaskbarManager::clearOverlayIconView() {
+ if (_progress < 0.0)
+ clearApplicationIconView();
+ else
+ [_overlayIconView removeFromSuperview];
+ _overlayIconView = nil;
+}
+
+void MacOSXTaskbarManager::setOverlayIcon(const Common::String &name, const Common::String &description) {
+ if (_dockTile == nil)
+ return;
+
+ if (name.empty()) {
+ clearOverlayIconView();
+ [_dockTile performSelector:@selector(display)];
+ return;
+ }
+
+ Common::String path = getIconPath(name);
+ if (path.empty())
+ return;
+
+ initOverlayIconView();
+
+ CFStringRef imageFile = CFStringCreateWithCString(0, path.c_str(), kCFStringEncodingASCII);
+ NSImage* image = [[NSImage alloc] initWithContentsOfFile:(NSString *)imageFile];
+ [_overlayIconView setImage:image];
+ [image release];
+ CFRelease(imageFile);
+
+ [_dockTile performSelector:@selector(display)];
+}
+
+void MacOSXTaskbarManager::setProgressValue(int completed, int total) {
+ if (_dockTile == nil)
+ return;
+
+ if (total > 0)
+ _progress = (double)completed / (double)total;
+ else if (_progress < 0)
+ _progress = 0.0;
+
+ NSImage *mainIcon = [[NSApp applicationIconImage] copy];
+ double barSize = [mainIcon size].width;
+ double progressSize = barSize * _progress;
+ [mainIcon lockFocus];
+ [[NSColor colorWithDeviceRed:(40.0/255.0) green:(120.0/255.0) blue:(255.0/255.0) alpha:0.78] set];
+ [NSBezierPath fillRect:NSMakeRect(0, 0, progressSize, 11)];
+ [[NSColor colorWithDeviceRed:(241.0/255.0) green:(241.0/255.0) blue:(241.0/255.0) alpha:0.78] set];
+ [NSBezierPath fillRect:NSMakeRect(progressSize, 0, barSize-progressSize, 11)];
+ [mainIcon unlockFocus];
+
+ initApplicationIconView();
+ [_applicationIconView setImage:mainIcon];
+ [mainIcon release];
+
+ [_dockTile performSelector:@selector(display)];
+}
+
+void MacOSXTaskbarManager::setProgressState(TaskbarProgressState state) {
+ if (_dockTile == nil)
+ return;
+
+ // Only support two states: visible and not visible.
+ if (state == kTaskbarNoProgress) {
+ _progress = -1.0;
+ if (_overlayIconView == nil)
+ clearApplicationIconView();
+ else if (_applicationIconView != nil)
+ [_applicationIconView setImage:[NSApp applicationIconImage]];
+ return;
+ }
+
+ setProgressValue(-1, -1);
+}
+
+void MacOSXTaskbarManager::setCount(int count) {
+ if (_dockTile == nil)
+ return;
+
+ if (count > 0)
+ [_dockTile performSelector:@selector(setBadgeLabel:) withObject:[NSString stringWithFormat:@"%d", count]];
+ else
+ [_dockTile performSelector:@selector(setBadgeLabel:) withObject:nil];
+}
+
+void MacOSXTaskbarManager::notifyError() {
+ if (_dockTile == nil)
+ return;
+
+ // NSImageNameCaution was introduced in 10.6.
+ // For compatibility with older systems we should use something else (e.g. overlay label
+ // or our own icon).
+ //initOverlayIconView();
+ //[_overlayIconView setImage:[NSImage imageNamed:NSImageNameCaution]];
+ //[_dockTile performSelector:@selector(display)];
+}
+
+void MacOSXTaskbarManager::clearError() {
+ if (_dockTile == nil)
+ return;
+
+ clearOverlayIconView();
+ [_dockTile performSelector:@selector(display)];
+ return;
+}
+
+Common::String MacOSXTaskbarManager::getIconPath(const Common::String& target) {
+ // We first try to look for a iconspath configuration variable then
+ // fallback to the extra path
+ //
+ // Icons can be either in a subfolder named "icons" or directly in the path
+
+ Common::String iconsPath = ConfMan.get("iconspath");
+ Common::String extraPath = ConfMan.get("extrapath");
+
+#define TRY_ICON_PATH(path) { \
+Common::FSNode node((path)); \
+if (node.exists()) \
+return (path); \
+}
+
+ if (!iconsPath.empty()) {
+ TRY_ICON_PATH(iconsPath + "/" + target + ".png");
+ TRY_ICON_PATH(iconsPath + "/" + ConfMan.get("gameid") + ".png");
+ TRY_ICON_PATH(iconsPath + "/icons/" + target + ".png");
+ TRY_ICON_PATH(iconsPath + "/icons/" + ConfMan.get("gameid") + ".png");
+ }
+
+ if (!extraPath.empty()) {
+ TRY_ICON_PATH(extraPath + "/" + target + ".png");
+ TRY_ICON_PATH(extraPath + "/" + ConfMan.get("gameid") + ".png");
+ TRY_ICON_PATH(extraPath + "/icons/" + target + ".png");
+ TRY_ICON_PATH(extraPath + "/icons/" + ConfMan.get("gameid") + ".png");
+ }
+
+ return "";
+}
+
+
+#endif
diff --git a/backends/taskbar/unity/unity-taskbar.cpp b/backends/taskbar/unity/unity-taskbar.cpp
index f36e2bf628..1b82e58c8a 100644
--- a/backends/taskbar/unity/unity-taskbar.cpp
+++ b/backends/taskbar/unity/unity-taskbar.cpp
@@ -24,7 +24,7 @@
#define FORBIDDEN_SYMBOL_EXCEPTION_time_h
#include "common/scummsys.h"
-#if defined(POSIX) && defined(USE_TASKBAR) && defined(USE_TASKBAR_UNITY)
+#if defined(POSIX) && defined(USE_TASKBAR) && defined(USE_UNITY)
#include "backends/taskbar/unity/unity-taskbar.h"
diff --git a/backends/taskbar/unity/unity-taskbar.h b/backends/taskbar/unity/unity-taskbar.h
index d1d9430bcd..d818ed9ff1 100644
--- a/backends/taskbar/unity/unity-taskbar.h
+++ b/backends/taskbar/unity/unity-taskbar.h
@@ -23,7 +23,7 @@
#ifndef BACKEND_UNITY_TASKBAR_H
#define BACKEND_UNITY_TASKBAR_H
-#if defined(POSIX) && defined(USE_TASKBAR) && defined(USE_TASKBAR_UNITY)
+#if defined(POSIX) && defined(USE_TASKBAR) && defined(USE_UNITY)
#include "common/events.h"
#include "common/str.h"
diff --git a/backends/timer/default/default-timer.cpp b/backends/timer/default/default-timer.cpp
index ce93320f3d..8964d5a7c7 100644
--- a/backends/timer/default/default-timer.cpp
+++ b/backends/timer/default/default-timer.cpp
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#include "common/scummsys.h"
diff --git a/backends/timer/default/default-timer.h b/backends/timer/default/default-timer.h
index 5884979da0..8b23fb744f 100644
--- a/backends/timer/default/default-timer.h
+++ b/backends/timer/default/default-timer.h
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#ifndef BACKENDS_TIMER_DEFAULT_H
diff --git a/backends/timer/psp/timer.cpp b/backends/timer/psp/timer.cpp
index 6f8e4b6643..278f50581c 100644
--- a/backends/timer/psp/timer.cpp
+++ b/backends/timer/psp/timer.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/timer/psp/timer.h b/backends/timer/psp/timer.h
index 76eebfd6a4..45b32e0e14 100644
--- a/backends/timer/psp/timer.h
+++ b/backends/timer/psp/timer.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/timer/sdl/sdl-timer.cpp b/backends/timer/sdl/sdl-timer.cpp
index 33596f4bd8..22d4bb985f 100644
--- a/backends/timer/sdl/sdl-timer.cpp
+++ b/backends/timer/sdl/sdl-timer.cpp
@@ -9,12 +9,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/timer/sdl/sdl-timer.h b/backends/timer/sdl/sdl-timer.h
index 069a266e45..278df515cd 100644
--- a/backends/timer/sdl/sdl-timer.h
+++ b/backends/timer/sdl/sdl-timer.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/timer/tizen/timer.cpp b/backends/timer/tizen/timer.cpp
index fa226ce747..dfa558615a 100644
--- a/backends/timer/tizen/timer.cpp
+++ b/backends/timer/tizen/timer.cpp
@@ -11,7 +11,7 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
diff --git a/backends/timer/tizen/timer.h b/backends/timer/tizen/timer.h
index 4b2596401a..ff5ea1a35f 100644
--- a/backends/timer/tizen/timer.h
+++ b/backends/timer/tizen/timer.h
@@ -11,7 +11,7 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
diff --git a/backends/updates/macosx/macosx-updates.h b/backends/updates/macosx/macosx-updates.h
index 8c9ac1f743..fd2d1f46f5 100644
--- a/backends/updates/macosx/macosx-updates.h
+++ b/backends/updates/macosx/macosx-updates.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/updates/macosx/macosx-updates.mm b/backends/updates/macosx/macosx-updates.mm
index f3b221cabf..a94f1c21fd 100644
--- a/backends/updates/macosx/macosx-updates.mm
+++ b/backends/updates/macosx/macosx-updates.mm
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/vkeybd/virtual-keyboard-gui.cpp b/backends/vkeybd/virtual-keyboard-gui.cpp
index ec4cbf1de2..1d2b8285f5 100644
--- a/backends/vkeybd/virtual-keyboard-gui.cpp
+++ b/backends/vkeybd/virtual-keyboard-gui.cpp
@@ -1,24 +1,24 @@
/* ScummVM - Graphic Adventure Engine
-*
-* 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
-* of the License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*
-*/
+ *
+ * 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
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
#include "common/scummsys.h"
diff --git a/backends/vkeybd/virtual-keyboard-gui.h b/backends/vkeybd/virtual-keyboard-gui.h
index a2000adea0..c328d1e25d 100644
--- a/backends/vkeybd/virtual-keyboard-gui.h
+++ b/backends/vkeybd/virtual-keyboard-gui.h
@@ -1,24 +1,24 @@
/* ScummVM - Graphic Adventure Engine
-*
-* 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
-* of the License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*
-*/
+ *
+ * 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
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
#ifndef COMMON_VIRTUAL_KEYBOARD_GUI_H
#define COMMON_VIRTUAL_KEYBOARD_GUI_H
diff --git a/backends/vkeybd/virtual-keyboard-parser.cpp b/backends/vkeybd/virtual-keyboard-parser.cpp
index bb8286d1f5..25c0161ae6 100644
--- a/backends/vkeybd/virtual-keyboard-parser.cpp
+++ b/backends/vkeybd/virtual-keyboard-parser.cpp
@@ -34,7 +34,7 @@
#include "common/tokenizer.h"
#include "common/stream.h"
-#include "graphics/decoders/bmp.h"
+#include "image/bmp.h"
namespace Common {
@@ -267,7 +267,7 @@ bool VirtualKeyboardParser::parserCallback_layout(ParserNode *node) {
const Graphics::PixelFormat format = g_system->getOverlayFormat();
{
- Graphics::BitmapDecoder bmp;
+ Image::BitmapDecoder bmp;
if (!bmp.loadStream(*file))
return parserError("Error loading bitmap '" + _mode->bitmapName + "'");