Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/scummvm/scummvm
Browse files Browse the repository at this point in the history
  • Loading branch information
athrxx committed Apr 21, 2011
2 parents b0008d2 + 44e79c7 commit 204644b
Show file tree
Hide file tree
Showing 38 changed files with 513 additions and 450 deletions.
2 changes: 1 addition & 1 deletion backends/mixer/doublebuffersdl/doublebuffersdl-mixer.cpp
Expand Up @@ -23,7 +23,7 @@
*
*/

#if defined(MACOSX) || defined(GP2X)
#if defined(MACOSX) || defined(GP2X) || defined(CAANOO) || defined(GP2XWIZ)

#include "backends/mixer/doublebuffersdl/doublebuffersdl-mixer.h"

Expand Down
5 changes: 0 additions & 5 deletions backends/module.mk
Expand Up @@ -75,11 +75,6 @@ MODULE_OBJS := \
vkeybd/virtual-keyboard-gui.o \
vkeybd/virtual-keyboard-parser.o

ifeq ($(BACKEND),dc)
MODULE_OBJS += \
plugins/dc/dc-provider.o
endif

ifeq ($(BACKEND),ds)
MODULE_OBJS += \
fs/ds/ds-fs-factory.o \
Expand Down
2 changes: 1 addition & 1 deletion backends/platform/dc/Makefile
Expand Up @@ -65,7 +65,7 @@ ENABLE_TOUCHE = $(ENABLED)
ENABLE_TUCKER = $(ENABLED)

OBJS := dcmain.o time.o display.o audio.o input.o selector.o icon.o \
label.o vmsave.o softkbd.o dcloader.o cache.o dc-fs.o
label.o vmsave.o softkbd.o dcloader.o cache.o dc-fs.o plugins.o

MODULE_DIRS += ./

Expand Down
17 changes: 16 additions & 1 deletion backends/platform/dc/dc.h
Expand Up @@ -31,6 +31,9 @@
#include "backends/audiocd/default/default-audiocd.h"
#include "backends/fs/fs-factory.h"
#include "audio/mixer_intern.h"
#ifdef DYNAMIC_MODULES
#include "backends/plugins/dynamic-plugin.h"
#endif

#define NUM_BUFFERS 4
#define SOUND_BUFFER_SHIFT 3
Expand Down Expand Up @@ -69,7 +72,11 @@ class DCCDManager : public DefaultAudioCDManager {
void updateCD();
};

class OSystem_Dreamcast : private DCHardware, public BaseBackend, public PaletteManager, public FilesystemFactory {
class OSystem_Dreamcast : private DCHardware, public BaseBackend, public PaletteManager, public FilesystemFactory
#ifdef DYNAMIC_MODULES
, public FilePluginProvider
#endif
{

public:
OSystem_Dreamcast();
Expand Down Expand Up @@ -250,6 +257,14 @@ class OSystem_Dreamcast : private DCHardware, public BaseBackend, public Palette

void logMessage(LogMessageType::Type type, const char *message);
Common::String getSystemLanguage() const;

#ifdef DYNAMIC_MODULES
class DCPlugin;

protected:
Plugin* createPlugin(const Common::FSNode &node) const;
bool isPluginFilename(const Common::FSNode &node) const;
#endif
};


Expand Down
3 changes: 1 addition & 2 deletions backends/platform/dc/dcmain.cpp
Expand Up @@ -33,7 +33,6 @@
#include <common/config-manager.h>
#include <common/memstream.h>

#include "backends/plugins/dc/dc-provider.h"
#include "audio/mixer_intern.h"


Expand Down Expand Up @@ -336,7 +335,7 @@ int main()
g_system = &osys_dc;

#ifdef DYNAMIC_MODULES
PluginManager::instance().addPluginProvider(new DCPluginProvider());
PluginManager::instance().addPluginProvider(&osys_dc);
#endif

scummvm_main(argc, argv);
Expand Down
2 changes: 1 addition & 1 deletion backends/platform/dc/module.mk
@@ -1,7 +1,7 @@
MODULE := backends/platform/dc

MODULE_OBJS := dcmain.o time.o display.o audio.o input.o selector.o icon.o \
label.o vmsave.o softkbd.o dcloader.o cache.o dc-fs.o
label.o vmsave.o softkbd.o dcloader.o cache.o dc-fs.o plugins.o

# We don't use rules.mk but rather manually update OBJS and MODULE_DIRS.
MODULE_OBJS := $(addprefix $(MODULE)/, $(MODULE_OBJS))
Expand Down
Expand Up @@ -25,16 +25,48 @@

#include "common/scummsys.h"

#if defined(DYNAMIC_MODULES) && defined(__DC__)
#if defined(DYNAMIC_MODULES)

#include "backends/plugins/dc/dc-provider.h"
#include "backends/plugins/dynamic-plugin.h"
#include "common/fs.h"

#include "dcloader.h"

extern void draw_solid_quad(float x1, float y1, float x2, float y2,
int c0, int c1, int c2, int c3);

static void drawPluginProgress(const Common::String &filename)
{
ta_sync();
void *mark = ta_txmark();
Label lab1, lab2, lab3;
char buf[32];
unsigned memleft = 0x8cf00000-((unsigned)sbrk(0));
float ffree = memleft*(1.0/(16<<20));
int fcol = (memleft < (1<<20)? 0xffff0000:
(memleft < (4<<20)? 0xffffff00: 0xff00ff00));
snprintf(buf, sizeof(buf), "%dK free memory", memleft>>10);
lab1.create_texture("Loading plugins, please wait...");
lab2.create_texture(filename.c_str());
lab3.create_texture(buf);
ta_begin_frame();
draw_solid_quad(80.0, 320.0, 560.0, 350.0,
0xff808080, 0xff808080, 0xff808080, 0xff808080);
draw_solid_quad(85.0, 325.0, 555.0, 345.0,
0xff202020, 0xff202020, 0xff202020, 0xff202020);
draw_solid_quad(85.0, 325.0, 85.0+470.0*ffree, 345.0,
fcol, fcol, fcol, fcol);
ta_commit_end();
lab1.draw(100.0, 200.0, 0xffffffff);
lab2.draw(100.0, 240.0, 0xffffffff);
lab3.draw(100.0, 280.0, 0xffffffff);
ta_commit_frame();
ta_sync();
ta_txrelease(mark);
}


class DCPlugin : public DynamicPlugin {
class OSystem_Dreamcast::DCPlugin : public DynamicPlugin {
protected:
void *_dlHandle;

Expand All @@ -59,6 +91,7 @@ class DCPlugin : public DynamicPlugin {

bool loadPlugin() {
assert(!_dlHandle);
drawPluginProgress(_filename);
_dlHandle = dlopen(_filename.c_str(), RTLD_LAZY);

if (!_dlHandle) {
Expand All @@ -85,11 +118,11 @@ class DCPlugin : public DynamicPlugin {
};


Plugin* DCPluginProvider::createPlugin(const Common::FSNode &node) const {
Plugin* OSystem_Dreamcast::createPlugin(const Common::FSNode &node) const {
return new DCPlugin(node.getPath());
}

bool DCPluginProvider::isPluginFilename(const Common::FSNode &node) const {
bool OSystem_Dreamcast::isPluginFilename(const Common::FSNode &node) const {
// Check the plugin suffix
Common::String filename = node.getName();
if (!filename.hasSuffix(".PLG"))
Expand All @@ -98,4 +131,4 @@ bool DCPluginProvider::isPluginFilename(const Common::FSNode &node) const {
return true;
}

#endif // defined(DYNAMIC_MODULES) && defined(__DC__)
#endif // defined(DYNAMIC_MODULES)
21 changes: 14 additions & 7 deletions backends/platform/gph/gph-backend.cpp
Expand Up @@ -26,23 +26,22 @@
#include "backends/platform/sdl/sdl-sys.h"

// #include "backends/platform/gph/gph-options.h"
#include "backends/platform/gph/gph-sdl.h"
#include "backends/mixer/doublebuffersdl/doublebuffersdl-mixer.h"
#include "backends/platform/gph/gph-hw.h"
#include "backends/platform/gph/gph-sdl.h"
#include "backends/plugins/posix/posix-provider.h"
#include "backends/saves/default/default-saves.h"
#include "backends/timer/default/default-timer.h"

#include "base/main.h"

#include "common/archive.h"
#include "common/config-manager.h"
#include "common/debug.h"
#include "common/events.h"
#include "common/util.h"

#include "common/file.h"
#include "base/main.h"

#include "backends/saves/default/default-saves.h"
#include "common/util.h"

#include "backends/timer/default/default-timer.h"
#include "audio/mixer_intern.h"

#include <stdio.h>
Expand All @@ -67,6 +66,14 @@ void OSystem_GPH::initBackend() {
_graphicsManager = new GPHGraphicsManager(_eventSource);
}

// Create the mixer manager
if (_mixer == 0) {
_mixerManager = new DoubleBufferSDLMixerManager();

// Setup and start mixer
_mixerManager->init();
}

/* Setup default save path to be workingdir/saves */

char savePath[PATH_MAX+1];
Expand Down
1 change: 0 additions & 1 deletion backends/platform/gph/gph-sdl.h
Expand Up @@ -32,7 +32,6 @@
#include "backends/events/gph/gph-events.h"

#define __GP2XWIZ__
#define MIXER_DOUBLE_BUFFERING 1

#ifndef PATH_MAX
#define PATH_MAX 255
Expand Down
17 changes: 11 additions & 6 deletions backends/platform/openpandora/op-backend.cpp
Expand Up @@ -26,20 +26,17 @@
#include "backends/platform/openpandora/op-sdl.h"
#include "base/main.h"

#include "backends/mixer/doublebuffersdl/doublebuffersdl-mixer.h"
#include "backends/saves/default/default-saves.h"
#include "backends/timer/default/default-timer.h"

#include "common/archive.h"
#include "common/config-manager.h"
#include "common/debug.h"
#include "common/events.h"
#include "common/util.h"

#include "common/file.h"
#include "base/main.h"

#include "backends/saves/default/default-saves.h"
#include "common/util.h"

#include "backends/timer/default/default-timer.h"
#include "audio/mixer_intern.h"

#include <stdio.h>
Expand Down Expand Up @@ -78,6 +75,14 @@ void OSystem_OP::initBackend() {
// }
//

// Create the mixer manager
if (_mixer == 0) {
_mixerManager = new DoubleBufferSDLMixerManager();

// Setup and start mixer
_mixerManager->init();
}

/* Setup default save path to be workingdir/saves */

char savePath[PATH_MAX+1];
Expand Down
1 change: 0 additions & 1 deletion backends/platform/openpandora/op-sdl.h
Expand Up @@ -32,7 +32,6 @@
#include "backends/graphics/openpandora/op-graphics.h"

#define __OPENPANDORA__
#define MIXER_DOUBLE_BUFFERING 1

#ifndef PATH_MAX
#define PATH_MAX 255
Expand Down
3 changes: 2 additions & 1 deletion backends/platform/symbian/AdaptAllMMPs.pl
Expand Up @@ -111,7 +111,8 @@
ParseModule("_base", "common", \@section_empty);
ParseModule("_base", "gui", \@section_empty, \@excludes_gui);
ParseModule("_base", "graphics", \@section_empty, \@excludes_graphics);
ParseModule("_base", "sound", \@section_empty, \@excludes_snd);
ParseModule("_base", "audio", \@section_empty, \@excludes_snd);
ParseModule("_base", "video", \@section_empty);

chdir("engines/");
ParseModule("_scumm", "scumm", \@sections_scumm, \@excludes_scumm );
Expand Down
4 changes: 2 additions & 2 deletions backends/platform/symbian/mmp/scummvm_base.mmp.in
Expand Up @@ -96,11 +96,11 @@ SOURCEPATH ..\..\..\..\gui
//SOURCE Actions.cpp

SOURCEPATH ..\..\..\..\audio
//START_AUTO_OBJECTS_SOUND_//
//START_AUTO_OBJECTS_AUDIO_//

// empty base file, will be updated by Perl build scripts

//STOP_AUTO_OBJECTS_SOUND_//
//STOP_AUTO_OBJECTS_AUDIO_//
SOURCE softsynth\fmtowns_pc98\towns_pc98_fmsynth.cpp // Included since its excluded by filter

#if defined (WINS)
Expand Down
5 changes: 5 additions & 0 deletions backends/platform/symbian/src/portdefs.h
Expand Up @@ -35,6 +35,11 @@
#include <e32std.h>
#include <math.h>

/* define pi */
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif /* M_PI */

#define DISABLE_COMMAND_LINE

#if defined(USE_TREMOR) && !defined(USE_VORBIS)
Expand Down
42 changes: 0 additions & 42 deletions backends/plugins/dc/dc-provider.h

This file was deleted.

1 change: 0 additions & 1 deletion common/stream.cpp
Expand Up @@ -205,7 +205,6 @@ uint32 SubReadStream::read(void *dataPtr, uint32 dataSize) {
}

dataSize = _parentStream->read(dataPtr, dataSize);
_eos |= _parentStream->eos();
_pos += dataSize;

return dataSize;
Expand Down
2 changes: 1 addition & 1 deletion common/substream.h
Expand Up @@ -59,7 +59,7 @@ class SubReadStream : virtual public ReadStream {
delete _parentStream;
}

virtual bool eos() const { return _eos; }
virtual bool eos() const { return _eos | _parentStream->eos(); }
virtual bool err() const { return _parentStream->err(); }
virtual void clearErr() { _eos = false; _parentStream->clearErr(); }
virtual uint32 read(void *dataPtr, uint32 dataSize);
Expand Down
2 changes: 1 addition & 1 deletion engines/gob/save/savefile.cpp
Expand Up @@ -336,7 +336,7 @@ bool SavePartSprite::read(Common::ReadStream &stream) {

// If it's in the current format, the true color flag has to be the same too
if (!_oldFormat)
if (stream.readByte() != _trueColor)
if ((stream.readByte() != 0) != _trueColor)
return false;

// Sprite data
Expand Down
1 change: 1 addition & 0 deletions engines/hugo/mouse.cpp
Expand Up @@ -363,6 +363,7 @@ void MouseHandler::readHotspot(Common::ReadStream &in, hotspot_t &hotspot) {
void MouseHandler::loadHotspots(Common::ReadStream &in) {
hotspot_t *wrkHotspots = 0;
hotspot_t tmp;
memset(&tmp, 0, sizeof(tmp));
for (int varnt = 0; varnt < _vm->_numVariant; varnt++) {
int numRows = in.readUint16BE();
if (varnt == _vm->_gameVariant)
Expand Down

0 comments on commit 204644b

Please sign in to comment.