Skip to content

Commit

Permalink
Merge remote-tracking branch 'sync/master' into prince-malik
Browse files Browse the repository at this point in the history
  • Loading branch information
Kamil Zbróg committed Jan 27, 2014
2 parents 444934a + 0f5eeae commit 8eac80c
Show file tree
Hide file tree
Showing 161 changed files with 5,325 additions and 1,755 deletions.
2 changes: 1 addition & 1 deletion AUTHORS
Expand Up @@ -62,7 +62,7 @@ ScummVM Team
Oliver Kiehl - (retired)
Ludvig Strigeus - (retired)

AVALANCHE:
Avalanche:
Peter Bozso
Arnaud Boutonne

Expand Down
5 changes: 3 additions & 2 deletions Makefile
Expand Up @@ -33,8 +33,9 @@ ifeq "$(HAVE_GCC)" "1"
#CXXFLAGS+= -Wmissing-format-attribute

ifneq "$(BACKEND)" "tizen"
# Disable RTTI and exceptions. These settings cause tizen apps to crash
CXXFLAGS+= -fno-rtti -fno-exceptions
# Disable exceptions. This setting causes tizen apps to crash
# TODO: Does this still apply after enabling RTTI again?
CXXFLAGS+= -fno-exceptions
endif

ifneq "$(HAVE_CLANG)" "1"
Expand Down
16 changes: 11 additions & 5 deletions NEWS
Expand Up @@ -5,6 +5,7 @@ For a more comprehensive changelog of the latest experimental code, see:
New Games:
- Added support for Return to Ringworld.
- Added support for The Neverhood.
- Added support for Mortville Manor.

General:
- Updated Munt MT-32 emulation code to version 1.3.0.
Expand All @@ -13,6 +14,12 @@ For a more comprehensive changelog of the latest experimental code, see:
(NOTE: The change to libpng was done in version 1.6.0, but it was not
added to the NEWS file).

Broken Sword 1:
- Added back support for MPEG-2 videos.

Broken Sword 2:
- Added back support for MPEG-2 videos.

Gob:
- Improved video quality in Urban Runner.

Expand All @@ -29,11 +36,10 @@ For a more comprehensive changelog of the latest experimental code, see:
- Improved the MIDI parser so that music event processing is done more
properly.

Broken Sword 1:
- Added back support for MPEG-2 videos.

Broken Sword 2:
- Added back support for MPEG-2 videos.
SCUMM:
- Changed the saved game naming scheme of HE games to always contain
the target name.
- Fixed having multiple coaches in Backyard Football.

Tinsel:
- Discworld 1 and 2 no longer crash on big-endian systems.
Expand Down
2 changes: 1 addition & 1 deletion audio/decoders/voc.cpp
Expand Up @@ -559,7 +559,7 @@ SeekableAudioStream *makeVOCStream(Common::SeekableReadStream *stream, byte flag

SeekableAudioStream *audioStream = new VocStream(stream, (flags & Audio::FLAG_UNSIGNED) != 0, disposeAfterUse);

if (audioStream && audioStream->endOfData()) {
if (audioStream->endOfData()) {
delete audioStream;
return 0;
} else {
Expand Down
22 changes: 13 additions & 9 deletions audio/midiparser.cpp
Expand Up @@ -214,13 +214,16 @@ void MidiParser::onTimer() {
activeNote(info.channel(), info.basic.param1, true);
}

processEvent(info);

if (_abortParse)
break;
// Player::metaEvent() in SCUMM will delete the parser object,
// so return immediately if that might have happened.
bool ret = processEvent(info);
if (!ret)
return;

_position._lastEventTime = eventTime;
parseNextEvent(_nextEvent);
if (!_abortParse) {
_position._lastEventTime = eventTime;
parseNextEvent(_nextEvent);
}
}

if (!_abortParse) {
Expand All @@ -229,7 +232,7 @@ void MidiParser::onTimer() {
}
}

void MidiParser::processEvent(const EventInfo &info, bool fireEvents) {
bool MidiParser::processEvent(const EventInfo &info, bool fireEvents) {
if (info.event == 0xF0) {
// SysEx event
// Check for trailing 0xF7 -- if present, remove it.
Expand All @@ -252,8 +255,7 @@ void MidiParser::processEvent(const EventInfo &info, bool fireEvents) {
if (fireEvents)
_driver->metaEvent(info.ext.type, info.ext.data, (uint16)info.length);
}
_abortParse = true;
return;
return false;
} else if (info.ext.type == 0x51) {
if (info.length >= 3) {
setTempo(info.ext.data[0] << 16 | info.ext.data[1] << 8 | info.ext.data[2]);
Expand All @@ -265,6 +267,8 @@ void MidiParser::processEvent(const EventInfo &info, bool fireEvents) {
if (fireEvents)
sendToDriver(info.event, info.basic.param1, info.basic.param2);
}

return true;
}


Expand Down
2 changes: 1 addition & 1 deletion audio/midiparser.h
Expand Up @@ -294,7 +294,7 @@ class MidiParser {
virtual void resetTracking();
virtual void allNotesOff();
virtual void parseNextEvent(EventInfo &info) = 0;
virtual void processEvent(const EventInfo &info, bool fireEvents = true);
virtual bool processEvent(const EventInfo &info, bool fireEvents = true);

void activeNote(byte channel, byte note, bool active);
void hangingNote(byte channel, byte note, uint32 ticksLeft, bool recycle = true);
Expand Down
2 changes: 1 addition & 1 deletion audio/softsynth/eas.cpp
Expand Up @@ -305,7 +305,7 @@ int MidiDriver_EAS::open() {
warning("error opening EAS dump file");
#endif

g_system->getMixer()->playStream(Audio::Mixer::kMusicSoundType,
g_system->getMixer()->playStream(Audio::Mixer::kPlainSoundType,
&_soundHandle, this, -1,
Audio::Mixer::kMaxChannelVolume, 0,
DisposeAfterUse::NO, true);
Expand Down
3 changes: 1 addition & 2 deletions audio/softsynth/fluidsynth.cpp
Expand Up @@ -184,8 +184,7 @@ int MidiDriver_FluidSynth::open() {

MidiDriver_Emulated::open();

// The MT-32 emulator uses kSFXSoundType here. I don't know why.
_mixer->playStream(Audio::Mixer::kMusicSoundType, &_mixerSoundHandle, this, -1, Audio::Mixer::kMaxChannelVolume, 0, DisposeAfterUse::NO, true);
_mixer->playStream(Audio::Mixer::kPlainSoundType, &_mixerSoundHandle, this, -1, Audio::Mixer::kMaxChannelVolume, 0, DisposeAfterUse::NO, true);
return 0;
}

Expand Down
11 changes: 1 addition & 10 deletions audio/softsynth/mt32.cpp
Expand Up @@ -80,15 +80,6 @@ friend class Synth;
void showLCDMessage(const char *message) {
g_system->displayMessageOnOSD(message);
}
void onDeviceReset() {}
void onDeviceReconfig() {}
void onNewReverbMode(Bit8u /* mode */) {}
void onNewReverbTime(Bit8u /* time */) {}
void onNewReverbLevel(Bit8u /* level */) {}
void onPartStateChanged(int /* partNum */, bool /* isActive */) {}
void onPolyStateChanged(int /* partNum */) {}
void onPartialStateChanged(int /* partialNum */, int /* oldPartialPhase */, int /* newPartialPhase */) {}
void onProgramChanged(int /* partNum */, char * /* patchName */) {}
};

} // end of namespace MT32Emu
Expand Down Expand Up @@ -230,7 +221,7 @@ int MidiDriver_MT32::open() {

g_system->updateScreen();

_mixer->playStream(Audio::Mixer::kSFXSoundType, &_mixerSoundHandle, this, -1, Audio::Mixer::kMaxChannelVolume, 0, DisposeAfterUse::NO, true);
_mixer->playStream(Audio::Mixer::kPlainSoundType, &_mixerSoundHandle, this, -1, Audio::Mixer::kMaxChannelVolume, 0, DisposeAfterUse::NO, true);

return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion backends/events/maemosdl/maemosdl-events.cpp
Expand Up @@ -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;
Expand Down
13 changes: 7 additions & 6 deletions backends/fs/amigaos4/amigaos4-fs.cpp
Expand Up @@ -81,6 +81,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);
Expand Down Expand Up @@ -305,12 +306,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();
Expand All @@ -332,6 +327,9 @@ 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
Expand All @@ -341,6 +339,9 @@ bool AmigaOSFilesystemNode::isReadable() const {
}

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)
Expand Down
6 changes: 6 additions & 0 deletions backends/fs/amigaos4/amigaos4-fs.h
Expand Up @@ -43,7 +43,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;
Expand Down
15 changes: 13 additions & 2 deletions backends/fs/wii/wii-fs-factory.cpp
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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");
Expand Down Expand Up @@ -179,7 +190,7 @@ void WiiFilesystemFactory::umount(FileSystemType type) {

printf("umount dvd\n");

ISO9660_Unmount();
ISO9660_Unmount("dvd:");

_dvdMounted = false;
_dvdError = false;
Expand Down
44 changes: 28 additions & 16 deletions backends/fs/wii/wii-fs.cpp
Expand Up @@ -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() {
Expand All @@ -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();
Expand Down Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion backends/fs/wii/wii-fs.h
Expand Up @@ -51,7 +51,7 @@ class WiiFilesystemNode : public AbstractFSNode {
*
* @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;
Expand Down
21 changes: 0 additions & 21 deletions backends/graphics/graphics.h
Expand Up @@ -37,27 +37,6 @@ class GraphicsManager : public PaletteManager {
public:
virtual ~GraphicsManager() {}

/**
* 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.
*
* HACK: Actually this is specific to SdlGraphicsManager subclasses.
* But sadly we cannot cast from GraphicsManager to SdlGraphicsManager
* because there is no relation between these two.
*/
virtual void activateManager() {}

/**
* Makes this graphics manager inactive. This should allow another
* graphics manager to become active again.
*
* HACK: Actually this is specific to SdlGraphicsManager subclasses.
* But sadly we cannot cast from GraphicsManager to SdlGraphicsManager
* because there is no relation between these two.
*/
virtual void deactivateManager() {}

virtual bool hasFeature(OSystem::Feature f) = 0;
virtual void setFeatureState(OSystem::Feature f, bool enable) = 0;
virtual bool getFeatureState(OSystem::Feature f) = 0;
Expand Down

0 comments on commit 8eac80c

Please sign in to comment.