Skip to content

Commit

Permalink
Merge branch 'master' into sherlock2
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed May 23, 2015
2 parents 40f7fff + 2db07a9 commit b4b6bf6
Show file tree
Hide file tree
Showing 171 changed files with 3,828 additions and 2,573 deletions.
16 changes: 14 additions & 2 deletions NEWS
Expand Up @@ -11,6 +11,15 @@ For a more comprehensive changelog of the latest experimental code, see:
General:
- Updated Munt MT-32 emulation code to version 1.5.0.

AGI:
- It is now possible to disable mouse support (except for Amiga versions
and fanmade games, that require a mouse).
- Fix incorrect volume attenuation in PCjr sound code (bug #6858).

AGOS:
- Fixed arpeggio effect used in music of Amiga version of Elvira 1.
- Fixed loading and saving progress in the PC version of Waxworks.

Broken Sword 1:
- Fix speech endianness detection on big endian systems for the mac
version (bug #6720).
Expand All @@ -20,8 +29,11 @@ For a more comprehensive changelog of the latest experimental code, see:

SCI:
- Handling of music priority has been greatly improved.
- A lot of fixes for original game script bugs, which are too numerous to
mention here.
- A lot of fixes for original game script bugs that also occurred when
using the original interpreter.
KQ6 (Dual Mode), LSL5, QfG1 (EGA), QfG1 (VGA), QfG2, QfG3, SQ1, SQ4 (CD)
- Restoring from the ScummVM in-game menu should now work all the time.
- Improve support for Japanese PC-9801 games.

SCUMM:
- It is now possible to play Maniac Mansion from within Day of the
Expand Down
16 changes: 15 additions & 1 deletion README
Expand Up @@ -1013,7 +1013,11 @@ site, please see the section on reporting bugs.
Inherit the Earth: Quest for the Orb
- Amiga versions aren't supported

Simon the Sorcerer 1:
Lure of the Temptress
- No Roland MT-32 support
- Sound support is incomplete and doesn't sound like original

Simon the Sorcerer 1:
- Subtitles aren't available in the English and German CD versions
as they are missing the majority of subtitles.

Expand Down Expand Up @@ -2264,6 +2268,10 @@ Sierra games using the AGI engine add the following non-standard keywords:

originalsaveload bool If true, the original save/load screens are
used instead of the enhanced ScummVM ones
altamigapalette bool Use an alternative palette, common for all
Amiga games. This was the old behavior
mousesupport bool Enables mouse support. Allows to use mouse
for movement and in game menus

Sierra games using the SCI engine add the following non-standard keywords:

Expand All @@ -2275,6 +2283,12 @@ Sierra games using the SCI engine add the following non-standard keywords:
native_fb01 bool If true, the music driver for an IBM Music
Feature card or a Yamaha FB-01 FM synth module
is used for MIDI output
use_cdaudio bool Use CD audio instead of in-game audio,
when available
windows_cursors bool Use the Windows cursors (smaller and monochrome)
instead of the DOS ones (King's Quest 6)
silver_cursors bool Use the alternate set of silver cursors,
instead of the normal golden ones (Space Quest 4)

Broken Sword II adds the following non-standard keywords:

Expand Down
9 changes: 4 additions & 5 deletions audio/mods/protracker.cpp
Expand Up @@ -219,11 +219,10 @@ void ProtrackerStream::updateRow() {
case 0x0:
if (exy) {
_track[track].arpeggio = true;
if (note.period) {
_track[track].arpeggioNotes[0] = note.note;
_track[track].arpeggioNotes[1] = note.note + ex;
_track[track].arpeggioNotes[2] = note.note + ey;
}
byte trackNote = _module.periodToNote(_track[track].period);
_track[track].arpeggioNotes[0] = trackNote;
_track[track].arpeggioNotes[1] = trackNote + ex;
_track[track].arpeggioNotes[2] = trackNote + ey;
}
break;
case 0x1:
Expand Down
5 changes: 4 additions & 1 deletion backends/graphics/openglsdl/openglsdl-graphics.cpp
Expand Up @@ -57,7 +57,10 @@ OpenGLSdlGraphicsManager::OpenGLSdlGraphicsManager(uint desktopWidth, uint deskt
}
#else
const SDL_Rect *const *availableModes = SDL_ListModes(NULL, SDL_OPENGL | SDL_FULLSCREEN);
if (availableModes != (void *)-1) {
// TODO: NULL means that there are no fullscreen modes supported. We
// should probably use this information and disable any fullscreen support
// in this case.
if (availableModes != NULL && availableModes != (void *)-1) {
for (;*availableModes; ++availableModes) {
const SDL_Rect *mode = *availableModes;

Expand Down
19 changes: 18 additions & 1 deletion backends/graphics/surfacesdl/surfacesdl-graphics.cpp
Expand Up @@ -125,6 +125,8 @@ SurfaceSdlGraphicsManager::SurfaceSdlGraphicsManager(SdlEventSource *sdlEventSou
_hwscreen(0),
#if SDL_VERSION_ATLEAST(2, 0, 0)
_renderer(nullptr), _screenTexture(nullptr),
#else
_originalBitsPerPixel(0),
#endif
_screen(0), _tmpscreen(0),
#ifdef USE_RGB_COLOR
Expand Down Expand Up @@ -796,7 +798,15 @@ bool SurfaceSdlGraphicsManager::loadGFXMode() {
_hwscreen = g_eventRec.getSurface(_videoMode.hardwareWidth, _videoMode.hardwareHeight);
} else
#endif
{
{
// Save the original bpp to be able to restore the video mode on unload
#if !SDL_VERSION_ATLEAST(2, 0, 0)
if (_originalBitsPerPixel == 0) {
const SDL_VideoInfo *videoInfo = SDL_GetVideoInfo();
_originalBitsPerPixel = videoInfo->vfmt->BitsPerPixel;
}
#endif

_hwscreen = SDL_SetVideoMode(_videoMode.hardwareWidth, _videoMode.hardwareHeight, 16,
_videoMode.fullscreen ? (SDL_FULLSCREEN|SDL_SWSURFACE) : SDL_SWSURFACE
);
Expand Down Expand Up @@ -929,6 +939,13 @@ void SurfaceSdlGraphicsManager::unloadGFXMode() {
}
#endif
DestroyScalers();

#if !SDL_VERSION_ATLEAST(2, 0, 0)
// Reset video mode to original
// This will ensure that any new graphic manager will use the initial BPP when listing available modes
if (_originalBitsPerPixel != 0)
SDL_SetVideoMode(_videoMode.screenWidth, _videoMode.screenHeight, _originalBitsPerPixel, _videoMode.fullscreen ? (SDL_FULLSCREEN | SDL_SWSURFACE) : SDL_SWSURFACE);
#endif
}

bool SurfaceSdlGraphicsManager::hotswapGFXMode() {
Expand Down
3 changes: 3 additions & 0 deletions backends/graphics/surfacesdl/surfacesdl-graphics.h
Expand Up @@ -236,6 +236,9 @@ class SurfaceSdlGraphicsManager : public SdlGraphicsManager, public Common::Even
};
VideoState _videoMode, _oldVideoMode;

// Original BPP to restore the video mode on unload
uint8 _originalBitsPerPixel;

/** Force full redraw on next updateScreen */
bool _forceFull;

Expand Down
5 changes: 3 additions & 2 deletions devtools/scumm-md5.txt
Expand Up @@ -314,7 +314,7 @@ tentacle Day of the Tentacle
4fbbe9f64b8bc547503a379a301183ce -1 it All? - CD - Andrea Petrucci
883af4b0af4f77a92f1dcf1d0a283140 -1 es All? - CD - Andrea Petrucci
cc04a076779379524ed4d9c5ee3c6fb1 282467632 en Mac - CD Mac bundle Fingolfin, Joachim Eberhard
ede149fda3edfc1dbd7347e0737cb583 -1 fr Mac - CD Mac bundle ThierryFR
ede149fda3edfc1dbd7347e0737cb583 282830409 fr Mac - CD Mac bundle ThierryFR, Thierry Crozat
f73883f13b5a302749a5bad31d909780 -1 de Mac - CD Mac bundle morrissey

c83079157ec765a28de445aec9768d60 7477 en All - Demo - Fingolfin
Expand All @@ -337,7 +337,7 @@ samnmax Sam & Max Hit the Road
4ba7fb331296c283e73d8f5b2096e551 -1 es All? - CD - Andrea Petrucci
d43352a805d78b5f4936c6d7779bf575 -1 ru DOS - CD -
166553538ff320c69edafeee29525419 199195304 en Mac - CD Mac bundle Joachim Eberhard
3a5d13675e9a23aedac0bac7730f0ac1 -1 fr Mac - CD Mac bundle ThierryFR
3a5d13675e9a23aedac0bac7730f0ac1 228446581 fr Mac - CD Mac bundle ThierryFR, Thierry Crozat

c3196c5349e53e387aaff1533d95e53a -1 en DOS Floppy Demo -
0e4c5d54a0ad4b26132e78b5ea76642a 6485 en DOS Floppy Demo WIP Fingolfin
Expand All @@ -358,6 +358,7 @@ ft Full Throttle
e72bb4c2b613db2cf50f89ff6350e70a -1 es All? - - -
fe381e45117878b1e942cb876b050fd6 513243679 en Mac - - Mac bundle Fingolfin
04401d747f1a2c1c4b388daff71ed378 535405461 de Mac - - Mac bundle Fingolfin
403d2ec4d60d3cdae925e6cbf67716d6 489436643 fr Mac - - Mac bundle Thierry Crozat

32a433dea56b86a55b59e4ff7d755711 -1 en DOS Demo Demo -
9d7b67be003fea60be4dcbd193611936 11164 en Mac Demo Demo - Fingolfin
Expand Down
94 changes: 62 additions & 32 deletions engines/agi/agi.cpp
Expand Up @@ -97,50 +97,62 @@ void AgiEngine::processEvents() {
}
break;
case Common::EVENT_LBUTTONDOWN:
key = BUTTON_LEFT;
_mouse.button = kAgiMouseButtonLeft;
keyEnqueue(key);
_mouse.x = event.mouse.x;
_mouse.y = event.mouse.y;
if (_game.mouseEnabled) {
key = BUTTON_LEFT;
_mouse.button = kAgiMouseButtonLeft;
keyEnqueue(key);
_mouse.x = event.mouse.x;
_mouse.y = event.mouse.y;
}
break;
case Common::EVENT_RBUTTONDOWN:
key = BUTTON_RIGHT;
_mouse.button = kAgiMouseButtonRight;
keyEnqueue(key);
_mouse.x = event.mouse.x;
_mouse.y = event.mouse.y;
if (_game.mouseEnabled) {
key = BUTTON_RIGHT;
_mouse.button = kAgiMouseButtonRight;
keyEnqueue(key);
_mouse.x = event.mouse.x;
_mouse.y = event.mouse.y;
}
break;
case Common::EVENT_WHEELUP:
key = WHEEL_UP;
keyEnqueue(key);
if (_game.mouseEnabled) {
key = WHEEL_UP;
keyEnqueue(key);
}
break;
case Common::EVENT_WHEELDOWN:
key = WHEEL_DOWN;
keyEnqueue(key);
if (_game.mouseEnabled) {
key = WHEEL_DOWN;
keyEnqueue(key);
}
break;
case Common::EVENT_MOUSEMOVE:
_mouse.x = event.mouse.x;
_mouse.y = event.mouse.y;

if (!_game.mouseFence.isEmpty()) {
if (_mouse.x < _game.mouseFence.left)
_mouse.x = _game.mouseFence.left;
if (_mouse.x > _game.mouseFence.right)
_mouse.x = _game.mouseFence.right;
if (_mouse.y < _game.mouseFence.top)
_mouse.y = _game.mouseFence.top;
if (_mouse.y > _game.mouseFence.bottom)
_mouse.y = _game.mouseFence.bottom;

g_system->warpMouse(_mouse.x, _mouse.y);
if (_game.mouseEnabled) {
_mouse.x = event.mouse.x;
_mouse.y = event.mouse.y;

if (!_game.mouseFence.isEmpty()) {
if (_mouse.x < _game.mouseFence.left)
_mouse.x = _game.mouseFence.left;
if (_mouse.x > _game.mouseFence.right)
_mouse.x = _game.mouseFence.right;
if (_mouse.y < _game.mouseFence.top)
_mouse.y = _game.mouseFence.top;
if (_mouse.y > _game.mouseFence.bottom)
_mouse.y = _game.mouseFence.bottom;

g_system->warpMouse(_mouse.x, _mouse.y);
}
}

break;
case Common::EVENT_LBUTTONUP:
case Common::EVENT_RBUTTONUP:
_mouse.button = kAgiMouseButtonUp;
_mouse.x = event.mouse.x;
_mouse.y = event.mouse.y;
if (_game.mouseEnabled) {
_mouse.button = kAgiMouseButtonUp;
_mouse.x = event.mouse.x;
_mouse.y = event.mouse.y;
}
break;
case Common::EVENT_KEYDOWN:
if (event.kbd.hasFlags(Common::KBD_CTRL) && event.kbd.keycode == Common::KEYCODE_d) {
Expand Down Expand Up @@ -496,12 +508,15 @@ AgiBase::AgiBase(OSystem *syst, const AGIGameDescription *gameDesc) : Engine(sys
// Assign default values to the config manager, in case settings are missing
ConfMan.registerDefault("originalsaveload", "false");
ConfMan.registerDefault("altamigapalette", "false");
ConfMan.registerDefault("mousesupport", "true");

_noSaveLoadAllowed = false;

_rnd = new Common::RandomSource("agi");
_sound = 0;

_fontData = NULL;

initFeatures();
initVersion();
}
Expand Down Expand Up @@ -550,6 +565,19 @@ AgiEngine::AgiEngine(OSystem *syst, const AGIGameDescription *gameDesc) : AgiBas
memset(&_debug, 0, sizeof(struct AgiDebug));
memset(&_mouse, 0, sizeof(struct Mouse));

_game.mouseEnabled = true;
if (!ConfMan.getBool("mousesupport")) {
// we effectively disable the mouse for games, that explicitly do not want mouse support to be enabled
_game.mouseEnabled = false;
}

// We are currently using the custom font for all fanmade games
if (!(getFeatures() & (GF_FANMADE | GF_AGDS))) {
_fontData = fontData_Sierra; // original Sierra font
} else {
_fontData = fontData_FanGames; // our (own?) custom font, that supports umlauts etc.
}

_game._vm = this;

_game.clockEnabled = false;
Expand Down Expand Up @@ -708,7 +736,9 @@ Common::Error AgiBase::init() {
}

Common::Error AgiEngine::go() {
CursorMan.showMouse(true);
if (_game.mouseEnabled) {
CursorMan.showMouse(true);
}
setTotalPlayTime(0);

if (_game.state < STATE_LOADED) {
Expand Down
5 changes: 5 additions & 0 deletions engines/agi/agi.h
Expand Up @@ -643,6 +643,7 @@ struct AgiGame {
int simpleSave; /**< select simple savegames */

Common::Rect mouseFence; /**< rectangle set by fence.mouse command */
bool mouseEnabled; /**< if mouse is supposed to be active */

// IF condition handling
int testResult;
Expand Down Expand Up @@ -780,6 +781,8 @@ class AgiBase : public ::Engine {

void initRenderMode();

const uint8 *_fontData;

public:
GfxMgr *_gfx;

Expand Down Expand Up @@ -839,6 +842,8 @@ class AgiBase : public ::Engine {

bool canLoadGameStateCurrently();
bool canSaveGameStateCurrently();

const uint8 *getFontData() { return _fontData; };
};

typedef void (*AgiCommand)(AgiGame *state, uint8 *p);
Expand Down

0 comments on commit b4b6bf6

Please sign in to comment.