sync with scummvm
This commit is contained in:
parent
9771492e6c
commit
b15eee129d
38 changed files with 454 additions and 278 deletions
2
Makefile
2
Makefile
|
@ -32,7 +32,7 @@ ifeq "$(HAVE_GCC)" "1"
|
||||||
# being helpful.
|
# being helpful.
|
||||||
#CXXFLAGS+= -Wmissing-format-attribute
|
#CXXFLAGS+= -Wmissing-format-attribute
|
||||||
|
|
||||||
# Disable exceptions (ResidualVM use RTTI)
|
# Disable exceptions, ResidualVM use RTTI:
|
||||||
CXXFLAGS+= -fno-exceptions
|
CXXFLAGS+= -fno-exceptions
|
||||||
|
|
||||||
ifneq "$(HAVE_CLANG)" "1"
|
ifneq "$(HAVE_CLANG)" "1"
|
||||||
|
|
|
@ -12,6 +12,7 @@ all: $(EXECUTABLE) plugins
|
||||||
######################################################################
|
######################################################################
|
||||||
# Module settings
|
# Module settings
|
||||||
######################################################################
|
######################################################################
|
||||||
|
#ResidualVM: do not include 'test' but add 'math':
|
||||||
|
|
||||||
PLUGINS :=
|
PLUGINS :=
|
||||||
MODULES := devtools base $(MODULES)
|
MODULES := devtools base $(MODULES)
|
||||||
|
@ -241,7 +242,10 @@ endif
|
||||||
DIST_FILES_THEMES:=$(addprefix $(srcdir)/gui/themes/,$(DIST_FILES_THEMES))
|
DIST_FILES_THEMES:=$(addprefix $(srcdir)/gui/themes/,$(DIST_FILES_THEMES))
|
||||||
|
|
||||||
# Engine data files
|
# Engine data files
|
||||||
DIST_FILES_ENGINEDATA=residualvm-grim-patch.lab
|
DIST_FILES_ENGINEDATA=
|
||||||
|
ifdef ENABLE_GRIM
|
||||||
|
DIST_FILES_ENGINEDATA+=residualvm-grim-patch.lab
|
||||||
|
endif
|
||||||
DIST_FILES_ENGINEDATA:=$(addprefix $(srcdir)/dists/engine-data/,$(DIST_FILES_ENGINEDATA))
|
DIST_FILES_ENGINEDATA:=$(addprefix $(srcdir)/dists/engine-data/,$(DIST_FILES_ENGINEDATA))
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
* Abstract class for graphics manager. Subclasses
|
* Abstract class for graphics manager. Subclasses
|
||||||
* implement the real functionality.
|
* implement the real functionality.
|
||||||
*/
|
*/
|
||||||
|
// ResidualVM specific method
|
||||||
class GraphicsManager : Common::NonCopyable {
|
class GraphicsManager : Common::NonCopyable {
|
||||||
public:
|
public:
|
||||||
virtual ~GraphicsManager() {}
|
virtual ~GraphicsManager() {}
|
||||||
|
@ -41,7 +42,9 @@ public:
|
||||||
virtual void setFeatureState(OSystem::Feature f, bool enable) = 0;
|
virtual void setFeatureState(OSystem::Feature f, bool enable) = 0;
|
||||||
virtual bool getFeatureState(OSystem::Feature f) = 0;
|
virtual bool getFeatureState(OSystem::Feature f) = 0;
|
||||||
|
|
||||||
|
// ResidualVM specific method
|
||||||
virtual void launcherInitSize(uint w, uint h) = 0;
|
virtual void launcherInitSize(uint w, uint h) = 0;
|
||||||
|
// ResidualVM specific method
|
||||||
virtual Graphics::PixelBuffer setupScreen(int screenW, int screenH, bool fullscreen, bool accel3d) = 0;
|
virtual Graphics::PixelBuffer setupScreen(int screenW, int screenH, bool fullscreen, bool accel3d) = 0;
|
||||||
virtual int getScreenChangeID() const = 0;
|
virtual int getScreenChangeID() const = 0;
|
||||||
virtual int16 getHeight() = 0;
|
virtual int16 getHeight() = 0;
|
||||||
|
|
|
@ -143,7 +143,7 @@ Keymap *Keymapper::getKeymap(const String& name, bool *globalReturn) {
|
||||||
return keymap;
|
return keymap;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Keymapper::pushKeymap(const String& name, bool inherit) {
|
bool Keymapper::pushKeymap(const String& name, bool transparent) {
|
||||||
bool global;
|
bool global;
|
||||||
Keymap *newMap = getKeymap(name, &global);
|
Keymap *newMap = getKeymap(name, &global);
|
||||||
|
|
||||||
|
@ -152,20 +152,30 @@ bool Keymapper::pushKeymap(const String& name, bool inherit) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
pushKeymap(newMap, inherit, global);
|
pushKeymap(newMap, transparent, global);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Keymapper::pushKeymap(Keymap *newMap, bool inherit, bool global) {
|
void Keymapper::pushKeymap(Keymap *newMap, bool transparent, bool global) {
|
||||||
MapRecord mr = {newMap, inherit, global};
|
MapRecord mr = {newMap, transparent, global};
|
||||||
|
|
||||||
_activeMaps.push(mr);
|
_activeMaps.push(mr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Keymapper::popKeymap() {
|
void Keymapper::popKeymap(const char *name) {
|
||||||
if (!_activeMaps.empty())
|
if (!_activeMaps.empty()) {
|
||||||
_activeMaps.pop();
|
if (name) {
|
||||||
|
String topKeymapName = _activeMaps.top().keymap->getName();
|
||||||
|
if (topKeymapName.equals(name))
|
||||||
|
_activeMaps.pop();
|
||||||
|
else
|
||||||
|
warning("An attempt to pop wrong keymap was blocked (expected %s but was %s)", name, topKeymapName.c_str());
|
||||||
|
} else {
|
||||||
|
_activeMaps.pop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Keymapper::notifyEvent(const Common::Event &ev) {
|
bool Keymapper::notifyEvent(const Common::Event &ev) {
|
||||||
|
@ -198,7 +208,7 @@ bool Keymapper::mapKey(const KeyState& key, bool keyDown) {
|
||||||
debug(5, "Keymapper::mapKey keymap: %s", mr.keymap->getName().c_str());
|
debug(5, "Keymapper::mapKey keymap: %s", mr.keymap->getName().c_str());
|
||||||
action = mr.keymap->getMappedAction(key);
|
action = mr.keymap->getMappedAction(key);
|
||||||
|
|
||||||
if (action || !mr.inherit)
|
if (action || !mr.transparent)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,13 +37,14 @@
|
||||||
namespace Common {
|
namespace Common {
|
||||||
|
|
||||||
const char *const kGuiKeymapName = "gui";
|
const char *const kGuiKeymapName = "gui";
|
||||||
|
const char *const kGlobalKeymapName = "global";
|
||||||
|
|
||||||
class Keymapper : public Common::EventMapper, private Common::ArtificialEventSource {
|
class Keymapper : public Common::EventMapper, private Common::ArtificialEventSource {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
struct MapRecord {
|
struct MapRecord {
|
||||||
Keymap* keymap;
|
Keymap* keymap;
|
||||||
bool inherit;
|
bool transparent;
|
||||||
bool global;
|
bool global;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -121,17 +122,20 @@ public:
|
||||||
/**
|
/**
|
||||||
* Push a new keymap to the top of the active stack, activating
|
* Push a new keymap to the top of the active stack, activating
|
||||||
* it for use.
|
* it for use.
|
||||||
* @param name name of the keymap to push
|
* @param name name of the keymap to push
|
||||||
* @param inherit if true keymapper will iterate down the
|
* @param transparent if true keymapper will iterate down the
|
||||||
* stack if it cannot find a key in the new map
|
* stack if it cannot find a key in the new map
|
||||||
* @return true if succesful
|
* @return true if succesful
|
||||||
*/
|
*/
|
||||||
bool pushKeymap(const String& name, bool inherit = false);
|
bool pushKeymap(const String& name, bool transparent = false);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pop the top keymap off the active stack.
|
* Pop the top keymap off the active stack.
|
||||||
|
* @param name (optional) name of keymap expected to be popped
|
||||||
|
* if provided, will not pop unless name is the same
|
||||||
|
* as the top keymap
|
||||||
*/
|
*/
|
||||||
void popKeymap();
|
void popKeymap(const char *name = 0);
|
||||||
|
|
||||||
// Implementation of the EventMapper interface
|
// Implementation of the EventMapper interface
|
||||||
bool notifyEvent(const Common::Event &ev);
|
bool notifyEvent(const Common::Event &ev);
|
||||||
|
@ -182,7 +186,7 @@ private:
|
||||||
|
|
||||||
HardwareKeySet *_hardwareKeys;
|
HardwareKeySet *_hardwareKeys;
|
||||||
|
|
||||||
void pushKeymap(Keymap *newMap, bool inherit, bool global);
|
void pushKeymap(Keymap *newMap, bool transparent, bool global);
|
||||||
|
|
||||||
Action *getAction(const KeyState& key);
|
Action *getAction(const KeyState& key);
|
||||||
void executeAction(const Action *act, bool keyDown);
|
void executeAction(const Action *act, bool keyDown);
|
||||||
|
|
|
@ -327,7 +327,7 @@ void RemapDialog::loadKeymap() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// loop through remaining finding mappings for unmapped keys
|
// loop through remaining finding mappings for unmapped keys
|
||||||
if (top.inherit && topIndex >= 0) {
|
if (top.transparent && topIndex >= 0) {
|
||||||
for (int i = topIndex - 1; i >= 0; --i) {
|
for (int i = topIndex - 1; i >= 0; --i) {
|
||||||
Keymapper::MapRecord mr = activeKeymaps[i];
|
Keymapper::MapRecord mr = activeKeymaps[i];
|
||||||
debug(3, "RemapDialog::loadKeymap keymap: %s", mr.keymap->getName().c_str());
|
debug(3, "RemapDialog::loadKeymap keymap: %s", mr.keymap->getName().c_str());
|
||||||
|
@ -345,7 +345,7 @@ void RemapDialog::loadKeymap() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mr.inherit == false || freeKeys.empty())
|
if (mr.transparent == false || freeKeys.empty())
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
|
|
||||||
#include "audio/mixer.h"
|
#include "audio/mixer.h"
|
||||||
#include "graphics/pixelformat.h"
|
#include "graphics/pixelformat.h"
|
||||||
|
// ResidualVM specific:
|
||||||
#include "graphics/pixelbuffer.h"
|
#include "graphics/pixelbuffer.h"
|
||||||
|
|
||||||
ModularBackend::ModularBackend()
|
ModularBackend::ModularBackend()
|
||||||
|
@ -65,10 +66,12 @@ GraphicsManager *ModularBackend::getGraphicsManager() {
|
||||||
return (GraphicsManager *)_graphicsManager;
|
return (GraphicsManager *)_graphicsManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ResidualVM specific method
|
||||||
void ModularBackend::launcherInitSize(uint w, uint h) {
|
void ModularBackend::launcherInitSize(uint w, uint h) {
|
||||||
_graphicsManager->launcherInitSize(w, h);
|
_graphicsManager->launcherInitSize(w, h);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ResidualVM specific method
|
||||||
Graphics::PixelBuffer ModularBackend::setupScreen(int screenW, int screenH, bool fullscreen, bool accel3d) {
|
Graphics::PixelBuffer ModularBackend::setupScreen(int screenW, int screenH, bool fullscreen, bool accel3d) {
|
||||||
return _graphicsManager->setupScreen(screenW, screenH, fullscreen, accel3d);
|
return _graphicsManager->setupScreen(screenW, screenH, fullscreen, accel3d);
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,7 +62,9 @@ public:
|
||||||
//@{
|
//@{
|
||||||
|
|
||||||
virtual GraphicsManager *getGraphicsManager();
|
virtual GraphicsManager *getGraphicsManager();
|
||||||
|
// ResidualVM specific method
|
||||||
virtual void launcherInitSize(uint w, uint h);
|
virtual void launcherInitSize(uint w, uint h);
|
||||||
|
// ResidualVM specific method
|
||||||
virtual Graphics::PixelBuffer setupScreen(int screenW, int screenH, bool fullscreen, bool accel3d);
|
virtual Graphics::PixelBuffer setupScreen(int screenW, int screenH, bool fullscreen, bool accel3d);
|
||||||
virtual int getScreenChangeID() const;
|
virtual int getScreenChangeID() const;
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,11 @@
|
||||||
- (void)setAppleMenu:(NSMenu *)menu;
|
- (void)setAppleMenu:(NSMenu *)menu;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
NSString *constructNSStringFromCString(const char* rawCString, NSStringEncoding stringEncoding) {
|
||||||
|
NSData *nsData = [NSData dataWithBytes:rawCString length:strlen(rawCString)];
|
||||||
|
return [[NSString alloc] initWithData:nsData encoding:stringEncoding];
|
||||||
|
}
|
||||||
|
|
||||||
void replaceApplicationMenuItems() {
|
void replaceApplicationMenuItems() {
|
||||||
|
|
||||||
// Code mainly copied and adapted from SDLmain.m
|
// Code mainly copied and adapted from SDLmain.m
|
||||||
|
@ -50,34 +55,47 @@ void replaceApplicationMenuItems() {
|
||||||
// Create new application menu
|
// Create new application menu
|
||||||
appleMenu = [[NSMenu alloc] initWithTitle:@""];
|
appleMenu = [[NSMenu alloc] initWithTitle:@""];
|
||||||
|
|
||||||
|
NSString *nsString = NULL;
|
||||||
|
|
||||||
// Get current encoding
|
// Get current encoding
|
||||||
#ifdef USE_TRANSLATION
|
#ifdef USE_TRANSLATION
|
||||||
NSStringEncoding stringEncoding = CFStringConvertEncodingToNSStringEncoding(CFStringConvertIANACharSetNameToEncoding((CFStringRef)[NSString stringWithCString:(TransMan.getCurrentCharset()).c_str() encoding:NSASCIIStringEncoding]));
|
nsString = constructNSStringFromCString((TransMan.getCurrentCharset()).c_str(), NSASCIIStringEncoding);
|
||||||
|
NSStringEncoding stringEncoding = CFStringConvertEncodingToNSStringEncoding(CFStringConvertIANACharSetNameToEncoding((CFStringRef)nsString));
|
||||||
|
[nsString release];
|
||||||
#else
|
#else
|
||||||
NSStringEncoding stringEncoding = NSASCIIStringEncoding;
|
NSStringEncoding stringEncoding = NSASCIIStringEncoding;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Add "About ScummVM" menu item
|
// Add "About ScummVM" menu item
|
||||||
[appleMenu addItemWithTitle:[NSString stringWithCString:_("About ResidualVM") encoding:stringEncoding] action:@selector(orderFrontStandardAboutPanel:) keyEquivalent:@""];
|
nsString = constructNSStringFromCString(_("About ResidualVM"), stringEncoding);
|
||||||
|
[appleMenu addItemWithTitle:nsString action:@selector(orderFrontStandardAboutPanel:) keyEquivalent:@""];
|
||||||
|
[nsString release];
|
||||||
|
|
||||||
// Add separator
|
// Add separator
|
||||||
[appleMenu addItem:[NSMenuItem separatorItem]];
|
[appleMenu addItem:[NSMenuItem separatorItem]];
|
||||||
|
|
||||||
// Add "Hide ScummVM" menu item
|
// Add "Hide ScummVM" menu item
|
||||||
[appleMenu addItemWithTitle:[NSString stringWithCString:_("Hide ResidualVM") encoding:stringEncoding] action:@selector(hide:) keyEquivalent:@"h"];
|
nsString = constructNSStringFromCString(_("Hide ResidualVM"), stringEncoding);
|
||||||
|
[appleMenu addItemWithTitle:nsString action:@selector(hide:) keyEquivalent:@"h"];
|
||||||
|
[nsString release];
|
||||||
|
|
||||||
// Add "Hide Others" menu item
|
// Add "Hide Others" menu item
|
||||||
menuItem = (NSMenuItem *)[appleMenu addItemWithTitle:[NSString stringWithCString:_("Hide Others") encoding:stringEncoding] action:@selector(hideOtherApplications:) keyEquivalent:@"h"];
|
nsString = constructNSStringFromCString(_("Hide Others"), stringEncoding);
|
||||||
|
menuItem = (NSMenuItem *)[appleMenu addItemWithTitle:nsString action:@selector(hideOtherApplications:) keyEquivalent:@"h"];
|
||||||
[menuItem setKeyEquivalentModifierMask:(NSAlternateKeyMask|NSCommandKeyMask)];
|
[menuItem setKeyEquivalentModifierMask:(NSAlternateKeyMask|NSCommandKeyMask)];
|
||||||
|
|
||||||
// Add "Show All" menu item
|
// Add "Show All" menu item
|
||||||
[appleMenu addItemWithTitle:[NSString stringWithCString:_("Show All") encoding:stringEncoding] action:@selector(unhideAllApplications:) keyEquivalent:@""];
|
nsString = constructNSStringFromCString(_("Show All"), stringEncoding);
|
||||||
|
[appleMenu addItemWithTitle:nsString action:@selector(unhideAllApplications:) keyEquivalent:@""];
|
||||||
|
[nsString release];
|
||||||
|
|
||||||
// Add separator
|
// Add separator
|
||||||
[appleMenu addItem:[NSMenuItem separatorItem]];
|
[appleMenu addItem:[NSMenuItem separatorItem]];
|
||||||
|
|
||||||
// Add "Quit ScummVM" menu item
|
// Add "Quit ScummVM" menu item
|
||||||
[appleMenu addItemWithTitle:[NSString stringWithCString:_("Quit ResidualVM") encoding:stringEncoding] action:@selector(terminate:) keyEquivalent:@"q"];
|
nsString = constructNSStringFromCString(_("Quit ResidualVM"), stringEncoding);
|
||||||
|
[appleMenu addItemWithTitle:nsString action:@selector(terminate:) keyEquivalent:@"q"];
|
||||||
|
[nsString release];
|
||||||
|
|
||||||
// Put application menu into the menubar
|
// Put application menu into the menubar
|
||||||
menuItem = [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""];
|
menuItem = [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""];
|
||||||
|
@ -89,16 +107,22 @@ void replaceApplicationMenuItems() {
|
||||||
|
|
||||||
|
|
||||||
// Create new "Window" menu
|
// Create new "Window" menu
|
||||||
windowMenu = [[NSMenu alloc] initWithTitle:[NSString stringWithCString:_("Window") encoding:stringEncoding]];
|
nsString = constructNSStringFromCString(_("Window"), stringEncoding);
|
||||||
|
windowMenu = [[NSMenu alloc] initWithTitle:nsString];
|
||||||
|
[nsString release];
|
||||||
|
|
||||||
// Add "Minimize" menu item
|
// Add "Minimize" menu item
|
||||||
menuItem = [[NSMenuItem alloc] initWithTitle:[NSString stringWithCString:_("Minimize") encoding:stringEncoding] action:@selector(performMiniaturize:) keyEquivalent:@"m"];
|
nsString = constructNSStringFromCString(_("Minimize"), stringEncoding);
|
||||||
|
menuItem = [[NSMenuItem alloc] initWithTitle:nsString action:@selector(performMiniaturize:) keyEquivalent:@"m"];
|
||||||
[windowMenu addItem:menuItem];
|
[windowMenu addItem:menuItem];
|
||||||
|
[nsString release];
|
||||||
|
|
||||||
// Put menu into the menubar
|
// Put menu into the menubar
|
||||||
menuItem = [[NSMenuItem alloc] initWithTitle:[NSString stringWithCString:_("Window") encoding:stringEncoding] action:nil keyEquivalent:@""];
|
nsString = constructNSStringFromCString(_("Window"), stringEncoding);
|
||||||
|
menuItem = [[NSMenuItem alloc] initWithTitle:nsString action:nil keyEquivalent:@""];
|
||||||
[menuItem setSubmenu:windowMenu];
|
[menuItem setSubmenu:windowMenu];
|
||||||
[[NSApp mainMenu] addItem:menuItem];
|
[[NSApp mainMenu] addItem:menuItem];
|
||||||
|
[nsString release];
|
||||||
|
|
||||||
// Tell the application object that this is now the window menu.
|
// Tell the application object that this is now the window menu.
|
||||||
[NSApp setWindowsMenu:windowMenu];
|
[NSApp setWindowsMenu:windowMenu];
|
||||||
|
|
|
@ -38,6 +38,7 @@
|
||||||
#include <SDL_syswm.h> // For setting the icon
|
#include <SDL_syswm.h> // For setting the icon
|
||||||
|
|
||||||
#include "backends/platform/sdl/win32/win32.h"
|
#include "backends/platform/sdl/win32/win32.h"
|
||||||
|
#include "backends/saves/windows/windows-saves.h"
|
||||||
#include "backends/fs/windows/windows-fs-factory.h"
|
#include "backends/fs/windows/windows-fs-factory.h"
|
||||||
#include "backends/taskbar/win32/win32-taskbar.h"
|
#include "backends/taskbar/win32/win32-taskbar.h"
|
||||||
|
|
||||||
|
@ -74,6 +75,10 @@ void OSystem_Win32::initBackend() {
|
||||||
FreeConsole();
|
FreeConsole();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Create the savefile manager
|
||||||
|
if (_savefileManager == 0)
|
||||||
|
_savefileManager = new WindowsSaveFileManager();
|
||||||
|
|
||||||
// Invoke parent implementation of this method
|
// Invoke parent implementation of this method
|
||||||
OSystem_SDL::initBackend();
|
OSystem_SDL::initBackend();
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,12 +29,8 @@
|
||||||
#if defined(WIN32) && defined(USE_TASKBAR)
|
#if defined(WIN32) && defined(USE_TASKBAR)
|
||||||
|
|
||||||
// Needed for taskbar functions
|
// Needed for taskbar functions
|
||||||
#if defined(__GNUC__)
|
#if defined(__GNUC__) && defined(__MINGW32__) && !defined(__MINGW64__)
|
||||||
#ifdef __MINGW32__
|
|
||||||
#include "backends/taskbar/win32/mingw-compat.h"
|
#include "backends/taskbar/win32/mingw-compat.h"
|
||||||
#else
|
|
||||||
#error Only compilation with MingW is supported
|
|
||||||
#endif
|
|
||||||
#else
|
#else
|
||||||
// We need certain functions that are excluded by default
|
// We need certain functions that are excluded by default
|
||||||
#undef NONLS
|
#undef NONLS
|
||||||
|
@ -44,9 +40,12 @@
|
||||||
#undef ARRAYSIZE
|
#undef ARRAYSIZE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Default MSVC headers for ITaskbarList3 and IShellLink
|
#if defined(_MSC_VER)
|
||||||
#include <SDKDDKVer.h>
|
// Default MSVC headers for ITaskbarList3 and IShellLink
|
||||||
|
#include <SDKDDKVer.h>
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <shlobj.h>
|
#include <shlobj.h>
|
||||||
|
|
||||||
// For HWND
|
// For HWND
|
||||||
|
|
|
@ -161,7 +161,7 @@ void SearchSet::addSubDirectoriesMatching(const FSNode &directory, String origPa
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nextPattern.empty())
|
if (nextPattern.empty())
|
||||||
addDirectory(i->getPath(), *i, priority);
|
addDirectory(name, *i, priority);
|
||||||
else
|
else
|
||||||
addSubDirectoriesMatching(*i, nextPattern, ignoreCase, priority);
|
addSubDirectoriesMatching(*i, nextPattern, ignoreCase, priority);
|
||||||
}
|
}
|
||||||
|
|
|
@ -102,7 +102,7 @@ struct Event {
|
||||||
/**
|
/**
|
||||||
* Mouse movement since the last mouse movement event.
|
* Mouse movement since the last mouse movement event.
|
||||||
*
|
*
|
||||||
* This field is Residual specific
|
* This field is ResidualVM specific
|
||||||
*/
|
*/
|
||||||
Common::Point relMouse;
|
Common::Point relMouse;
|
||||||
|
|
||||||
|
|
|
@ -182,7 +182,8 @@
|
||||||
#define putchar(a) FORBIDDEN_SYMBOL_REPLACEMENT
|
#define putchar(a) FORBIDDEN_SYMBOL_REPLACEMENT
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// mingw-w64 uses [set|long]jmp in system headers
|
||||||
|
#ifndef __MINGW64__
|
||||||
#ifndef FORBIDDEN_SYMBOL_EXCEPTION_setjmp
|
#ifndef FORBIDDEN_SYMBOL_EXCEPTION_setjmp
|
||||||
#undef setjmp
|
#undef setjmp
|
||||||
#define setjmp(a) FORBIDDEN_SYMBOL_REPLACEMENT
|
#define setjmp(a) FORBIDDEN_SYMBOL_REPLACEMENT
|
||||||
|
@ -192,6 +193,7 @@
|
||||||
#undef longjmp
|
#undef longjmp
|
||||||
#define longjmp(a,b) FORBIDDEN_SYMBOL_REPLACEMENT
|
#define longjmp(a,b) FORBIDDEN_SYMBOL_REPLACEMENT
|
||||||
#endif
|
#endif
|
||||||
|
#endif // __MINGW64__
|
||||||
|
|
||||||
#ifndef FORBIDDEN_SYMBOL_EXCEPTION_system
|
#ifndef FORBIDDEN_SYMBOL_EXCEPTION_system
|
||||||
#undef system
|
#undef system
|
||||||
|
|
|
@ -78,6 +78,7 @@ template<typename T> inline void SWAP(T &a, T &b) { T tmp = a; a = b; b = tmp; }
|
||||||
# define SCUMMVM_CURRENT_FUNCTION "<unknown>"
|
# define SCUMMVM_CURRENT_FUNCTION "<unknown>"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
//ResidualVM specific
|
||||||
#ifndef round
|
#ifndef round
|
||||||
#define round(x) ((x > 0.0) ? floor((x) + 0.5) : ceil((x) - 0.5))
|
#define round(x) ((x > 0.0) ? floor((x) + 0.5) : ceil((x) - 0.5))
|
||||||
#endif
|
#endif
|
||||||
|
|
173
configure
vendored
173
configure
vendored
|
@ -80,10 +80,12 @@ add_engine() {
|
||||||
add_engine grim "Grim" yes
|
add_engine grim "Grim" yes
|
||||||
add_engine myst3 "Myst 3" yes
|
add_engine myst3 "Myst 3" yes
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Default settings
|
# Default settings
|
||||||
#
|
#
|
||||||
|
#ResidualVM defaults: mpeg2=no, faad=no, opengles=no
|
||||||
|
#mt32emu=no, translation=no
|
||||||
|
#
|
||||||
# Default lib behaviour yes/no/auto
|
# Default lib behaviour yes/no/auto
|
||||||
_vorbis=auto
|
_vorbis=auto
|
||||||
_tremor=auto
|
_tremor=auto
|
||||||
|
@ -95,7 +97,9 @@ _seq_midi=auto
|
||||||
_timidity=auto
|
_timidity=auto
|
||||||
_zlib=auto
|
_zlib=auto
|
||||||
_sparkle=auto
|
_sparkle=auto
|
||||||
|
_png=no
|
||||||
_mpeg2=no
|
_mpeg2=no
|
||||||
|
_faad=no
|
||||||
_fluidsynth=auto
|
_fluidsynth=auto
|
||||||
_opengl=auto
|
_opengl=auto
|
||||||
_opengles=no
|
_opengles=no
|
||||||
|
@ -646,7 +650,7 @@ get_saga_build_string() {
|
||||||
#
|
#
|
||||||
# Greet user
|
# Greet user
|
||||||
#
|
#
|
||||||
echo "Running Residual configure..."
|
echo "Running ResidualVM configure..."
|
||||||
echo "Configure run on" `date` > $TMPLOG
|
echo "Configure run on" `date` > $TMPLOG
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -756,6 +760,15 @@ Optional Libraries:
|
||||||
|
|
||||||
--disable-opengl disable OpenGL (ES) support [autodetect]
|
--disable-opengl disable OpenGL (ES) support [autodetect]
|
||||||
|
|
||||||
|
--with-png-prefix=DIR Prefix where libpng is installed (optional)
|
||||||
|
--disable-png disable PNG decoder [autodetect]
|
||||||
|
|
||||||
|
--with-theoradec-prefix=DIR Prefix where libtheoradec is installed (optional)
|
||||||
|
--disable-theoradec disable Theora decoder [autodetect]
|
||||||
|
|
||||||
|
--with-faad-prefix=DIR Prefix where libfaad is installed (optional)
|
||||||
|
--disable-faad disable AAC decoder [autodetect]
|
||||||
|
|
||||||
--with-fluidsynth-prefix=DIR Prefix where libfluidsynth is
|
--with-fluidsynth-prefix=DIR Prefix where libfluidsynth is
|
||||||
installed (optional)
|
installed (optional)
|
||||||
--disable-fluidsynth disable fluidsynth MIDI driver [autodetect]
|
--disable-fluidsynth disable fluidsynth MIDI driver [autodetect]
|
||||||
|
@ -814,6 +827,12 @@ for ac_option in $@; do
|
||||||
--enable-nasm) _nasm=yes ;;
|
--enable-nasm) _nasm=yes ;;
|
||||||
--disable-nasm) _nasm=no ;;
|
--disable-nasm) _nasm=no ;;
|
||||||
--enable-mpeg2) _mpeg2=yes ;;
|
--enable-mpeg2) _mpeg2=yes ;;
|
||||||
|
--disable-png) _png=no ;;
|
||||||
|
--enable-png) _png=yes ;;
|
||||||
|
--disable-theoradec) _theoradec=no ;;
|
||||||
|
--enable-theoradec) _theoradec=yes ;;
|
||||||
|
--disable-faad) _faad=no ;;
|
||||||
|
--enable-faad) _faad=yes ;;
|
||||||
--disable-fluidsynth) _fluidsynth=no ;;
|
--disable-fluidsynth) _fluidsynth=no ;;
|
||||||
--enable-readline) _readline=yes ;;
|
--enable-readline) _readline=yes ;;
|
||||||
--disable-readline) _readline=no ;;
|
--disable-readline) _readline=no ;;
|
||||||
|
@ -880,6 +899,21 @@ for ac_option in $@; do
|
||||||
MAD_CFLAGS="-I$arg/include"
|
MAD_CFLAGS="-I$arg/include"
|
||||||
MAD_LIBS="-L$arg/lib"
|
MAD_LIBS="-L$arg/lib"
|
||||||
;;
|
;;
|
||||||
|
--with-png-prefix=*)
|
||||||
|
arg=`echo $ac_option | cut -d '=' -f 2`
|
||||||
|
PNG_CFLAGS="-I$arg/include"
|
||||||
|
PNG_LIBS="-L$arg/lib"
|
||||||
|
;;
|
||||||
|
--with-theoradec-prefix=*)
|
||||||
|
arg=`echo $ac_option | cut -d '=' -f 2`
|
||||||
|
THEORADEC_CFLAGS="-I$arg/include"
|
||||||
|
THEORADEC_LIBS="-L$arg/lib"
|
||||||
|
;;
|
||||||
|
--with-faad-prefix=*)
|
||||||
|
arg=`echo $ac_option | cut -d '=' -f 2`
|
||||||
|
FAAD_CFLAGS="-I$arg/include"
|
||||||
|
FAAD_LIBS="-L$arg/lib"
|
||||||
|
;;
|
||||||
--with-zlib-prefix=*)
|
--with-zlib-prefix=*)
|
||||||
arg=`echo $ac_option | cut -d '=' -f 2`
|
arg=`echo $ac_option | cut -d '=' -f 2`
|
||||||
ZLIB_CFLAGS="-I$arg/include"
|
ZLIB_CFLAGS="-I$arg/include"
|
||||||
|
@ -1516,7 +1550,7 @@ fi;
|
||||||
# However, some platforms use GNU extensions in system header files, so
|
# However, some platforms use GNU extensions in system header files, so
|
||||||
# for these we must not use -pedantic.
|
# for these we must not use -pedantic.
|
||||||
case $_host_os in
|
case $_host_os in
|
||||||
android | gamecube | psp | wii)
|
android | gamecube | psp | wii | webos)
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
# ICC does not support pedantic, while GCC and clang do.
|
# ICC does not support pedantic, while GCC and clang do.
|
||||||
|
@ -1579,7 +1613,7 @@ esac
|
||||||
# Determine a data type with the given length
|
# Determine a data type with the given length
|
||||||
#
|
#
|
||||||
find_type_with_size() {
|
find_type_with_size() {
|
||||||
for datatype in int short char long unknown; do
|
for datatype in int short char long "long long" unknown; do
|
||||||
cat > tmp_find_type_with_size.cpp << EOF
|
cat > tmp_find_type_with_size.cpp << EOF
|
||||||
typedef $datatype ac__type_sizeof_;
|
typedef $datatype ac__type_sizeof_;
|
||||||
int main() {
|
int main() {
|
||||||
|
@ -1603,22 +1637,34 @@ EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
# Determine a size of pointer type
|
# Check whether the system is 32-bit
|
||||||
#
|
#
|
||||||
find_pointer_size() {
|
pointer_is_32bit() {
|
||||||
cat > tmp_find_pointer_size.cpp << EOF
|
cat > tmp_pointer_is_32bit.cpp << EOF
|
||||||
int main() {
|
int main() {
|
||||||
void *p;
|
static int test_array[1 - 2 * !(sizeof(void *) == 4)];
|
||||||
int v = (int)p;
|
test_array[0] = 0;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
$CXX $CXXFLAGS -c -o $TMPO.o tmp_find_pointer_size.cpp 2>/dev/null
|
$CXX $CXXFLAGS -c -o $TMPO.o tmp_pointer_is_32bit.cpp 2>/dev/null
|
||||||
status=$?
|
status=$?
|
||||||
cc_check_clean tmp_find_pointer_size.cpp
|
cc_check_clean tmp_pointer_is_32bit.cpp
|
||||||
return $status
|
return $status
|
||||||
}
|
}
|
||||||
|
|
||||||
|
echo_n "Checking 64-bitness... "
|
||||||
|
pointer_is_32bit
|
||||||
|
if test $? -eq 0; then
|
||||||
|
type_ptr=int32
|
||||||
|
echo "no"
|
||||||
|
add_line_to_config_h "/* #define SCUMM_64BITS */"
|
||||||
|
else
|
||||||
|
type_ptr=int64
|
||||||
|
echo "yes"
|
||||||
|
add_line_to_config_h "#define SCUMM_64BITS"
|
||||||
|
fi
|
||||||
|
|
||||||
#
|
#
|
||||||
# Determine data type sizes
|
# Determine data type sizes
|
||||||
#
|
#
|
||||||
|
@ -1651,18 +1697,6 @@ fi
|
||||||
# force cleanup after check for 8 bytes type
|
# force cleanup after check for 8 bytes type
|
||||||
cc_check_clean tmp_find_type_with_size.cpp
|
cc_check_clean tmp_find_type_with_size.cpp
|
||||||
|
|
||||||
echo_n "Target 64 bits... "
|
|
||||||
find_pointer_size
|
|
||||||
if test $? -eq 0; then
|
|
||||||
type_ptr=int32
|
|
||||||
echo "no"
|
|
||||||
add_line_to_config_h "/* #define TARGET_64BITS */"
|
|
||||||
else
|
|
||||||
type_ptr=int64
|
|
||||||
echo "yes"
|
|
||||||
add_line_to_config_h "#define TARGET_64BITS"
|
|
||||||
fi
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Check whether memory alignment is required
|
# Check whether memory alignment is required
|
||||||
#
|
#
|
||||||
|
@ -1829,7 +1863,7 @@ case $_host_os in
|
||||||
# Now we may have MacPorts or Fink installed
|
# Now we may have MacPorts or Fink installed
|
||||||
# Which put libraries and headers in non-standard places
|
# Which put libraries and headers in non-standard places
|
||||||
# Checking them here
|
# Checking them here
|
||||||
|
|
||||||
# MacPorts
|
# MacPorts
|
||||||
# There is no way to get the prefix, so implementing a hack here
|
# There is no way to get the prefix, so implementing a hack here
|
||||||
macport_version=`port version 2>/dev/null`
|
macport_version=`port version 2>/dev/null`
|
||||||
|
@ -1985,6 +2019,7 @@ case $_host_os in
|
||||||
LIBS="$LIBS -lnsl -lsocket"
|
LIBS="$LIBS -lnsl -lsocket"
|
||||||
;;
|
;;
|
||||||
webos)
|
webos)
|
||||||
|
CXXFLAGS="$CXXFLAGS --sysroot=$WEBOS_PDK/arm-gcc/sysroot"
|
||||||
CXXFLAGS="$CXXFLAGS -I$WEBOS_PDK/include"
|
CXXFLAGS="$CXXFLAGS -I$WEBOS_PDK/include"
|
||||||
CXXFLAGS="$CXXFLAGS -I$WEBOS_PDK/include/SDL"
|
CXXFLAGS="$CXXFLAGS -I$WEBOS_PDK/include/SDL"
|
||||||
CXXFLAGS="$CXXFLAGS -I$WEBOS_PDK/device/usr/include"
|
CXXFLAGS="$CXXFLAGS -I$WEBOS_PDK/device/usr/include"
|
||||||
|
@ -3062,6 +3097,76 @@ fi
|
||||||
define_in_config_h_if_yes "$_alsa" 'USE_ALSA'
|
define_in_config_h_if_yes "$_alsa" 'USE_ALSA'
|
||||||
echo "$_alsa"
|
echo "$_alsa"
|
||||||
|
|
||||||
|
#
|
||||||
|
# Check for PNG
|
||||||
|
#
|
||||||
|
echocheck "PNG >= 1.2.8"
|
||||||
|
if test "$_png" = auto ; then
|
||||||
|
_png=no
|
||||||
|
cat > $TMPC << EOF
|
||||||
|
#include <png.h>
|
||||||
|
int main(void) {
|
||||||
|
#if PNG_LIBPNG_VER >= 10208
|
||||||
|
#else
|
||||||
|
syntax error
|
||||||
|
#endif
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
cc_check $PNG_CFLAGS $PNG_LIBS -lpng && _png=yes
|
||||||
|
fi
|
||||||
|
if test "$_png" = yes ; then
|
||||||
|
LIBS="$LIBS $PNG_LIBS -lpng"
|
||||||
|
INCLUDES="$INCLUDES $PNG_CFLAGS"
|
||||||
|
fi
|
||||||
|
define_in_config_if_yes "$_png" 'USE_PNG'
|
||||||
|
echo "$_png"
|
||||||
|
|
||||||
|
#
|
||||||
|
# Check for Theora Decoder
|
||||||
|
#
|
||||||
|
echocheck "libtheoradec >= 1.0"
|
||||||
|
if test "$_vorbis" = no ; then
|
||||||
|
echo "skipping. no vorbis"
|
||||||
|
_theoradec=notsupported
|
||||||
|
fi
|
||||||
|
if test "$_theoradec" = auto ; then
|
||||||
|
_theoradec=no
|
||||||
|
cat > $TMPC << EOF
|
||||||
|
#include <theora/theoradec.h>
|
||||||
|
#include <vorbis/codec.h>
|
||||||
|
int main(void) { th_ycbcr_buffer yuv; th_decode_ycbcr_out(NULL, yuv); }
|
||||||
|
EOF
|
||||||
|
cc_check $THEORADEC_CFLAGS $THEORADEC_LIBS -ltheoradec && _theoradec=yes
|
||||||
|
fi
|
||||||
|
if test "$_theoradec" = yes ; then
|
||||||
|
LIBS="$LIBS $THEORADEC_LIBS -ltheoradec"
|
||||||
|
INCLUDES="$INCLUDES $THEORADEC_CFLAGS"
|
||||||
|
fi
|
||||||
|
define_in_config_if_yes "$_theoradec" 'USE_THEORADEC'
|
||||||
|
if test ! "$_theoradec" = notsupported ; then
|
||||||
|
echo "$_theoradec"
|
||||||
|
fi
|
||||||
|
|
||||||
|
#
|
||||||
|
# Check for the AAC decoder
|
||||||
|
#
|
||||||
|
echocheck "libfaad"
|
||||||
|
if test "$_faad" = auto ; then
|
||||||
|
_faad=no
|
||||||
|
cat > $TMPC << EOF
|
||||||
|
#include <neaacdec.h>
|
||||||
|
int main(void) { NeAACDecGetCapabilities(); return 0; }
|
||||||
|
EOF
|
||||||
|
cc_check $FAAD_CFLAGS $FAAD_LIBS -lfaad && _faad=yes
|
||||||
|
fi
|
||||||
|
if test "$_faad" = yes ; then
|
||||||
|
LIBS="$LIBS $FAAD_LIBS -lfaad"
|
||||||
|
INCLUDES="$INCLUDES $FAAD_CFLAGS"
|
||||||
|
fi
|
||||||
|
define_in_config_if_yes "$_faad" 'USE_FAAD'
|
||||||
|
echo "$_faad"
|
||||||
|
|
||||||
#
|
#
|
||||||
# Check for SEQ MIDI
|
# Check for SEQ MIDI
|
||||||
#
|
#
|
||||||
|
@ -3355,6 +3460,14 @@ EOF
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
case $_host_os in
|
||||||
|
bada)
|
||||||
|
# components live in non-standard locations so just assume sane SDK
|
||||||
|
_opengl=yes
|
||||||
|
_opengles=yes
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
if test "$_opengles" = "yes" ; then
|
if test "$_opengles" = "yes" ; then
|
||||||
echo "yes (OpenGL ES)"
|
echo "yes (OpenGL ES)"
|
||||||
else
|
else
|
||||||
|
@ -3754,8 +3867,12 @@ typedef unsigned $type_4_byte uint32;
|
||||||
typedef signed $type_1_byte int8;
|
typedef signed $type_1_byte int8;
|
||||||
typedef signed $type_2_byte int16;
|
typedef signed $type_2_byte int16;
|
||||||
typedef signed $type_4_byte int32;
|
typedef signed $type_4_byte int32;
|
||||||
|
EOF
|
||||||
|
|
||||||
// Residual 64bit stuff
|
if test -n "$_def_64bit_type_unsigned" ; then
|
||||||
|
cat >> config.h << EOF
|
||||||
|
|
||||||
|
/* 64-bit stuff */
|
||||||
$_def_64bit_type_signed
|
$_def_64bit_type_signed
|
||||||
#if defined(__APPLE__) && !defined(__ppc__)
|
#if defined(__APPLE__) && !defined(__ppc__)
|
||||||
#ifndef _UINT64
|
#ifndef _UINT64
|
||||||
|
@ -3765,7 +3882,10 @@ $_def_64bit_type_unsigned
|
||||||
#else
|
#else
|
||||||
$_def_64bit_type_unsigned
|
$_def_64bit_type_unsigned
|
||||||
#endif
|
#endif
|
||||||
typedef $type_ptr residualvmptr;
|
EOF
|
||||||
|
fi
|
||||||
|
|
||||||
|
cat >> config.h << EOF
|
||||||
|
|
||||||
#endif /* CONFIG_H */
|
#endif /* CONFIG_H */
|
||||||
EOF
|
EOF
|
||||||
|
@ -3789,6 +3909,7 @@ STAGINGPATH=$_stagingpath
|
||||||
WIN32PATH=$_win32path
|
WIN32PATH=$_win32path
|
||||||
AOS4PATH=$_aos4path
|
AOS4PATH=$_aos4path
|
||||||
STATICLIBPATH=$_staticlibpath
|
STATICLIBPATH=$_staticlibpath
|
||||||
|
#ResidualVM specific:
|
||||||
SDLCONFIG=$_sdlconfig
|
SDLCONFIG=$_sdlconfig
|
||||||
|
|
||||||
BACKEND := $_backend
|
BACKEND := $_backend
|
||||||
|
|
|
@ -534,7 +534,7 @@ int main(int argc, char *argv[]) {
|
||||||
projectWarnings["agos"].push_back("4511");
|
projectWarnings["agos"].push_back("4511");
|
||||||
|
|
||||||
projectWarnings["dreamweb"].push_back("4355");
|
projectWarnings["dreamweb"].push_back("4355");
|
||||||
|
|
||||||
projectWarnings["lure"].push_back("4189");
|
projectWarnings["lure"].push_back("4189");
|
||||||
projectWarnings["lure"].push_back("4355");
|
projectWarnings["lure"].push_back("4355");
|
||||||
|
|
||||||
|
@ -575,6 +575,8 @@ int main(int argc, char *argv[]) {
|
||||||
globalWarnings.push_back("-Wwrite-strings");
|
globalWarnings.push_back("-Wwrite-strings");
|
||||||
// The following are not warnings at all... We should consider adding them to
|
// The following are not warnings at all... We should consider adding them to
|
||||||
// a different list of parameters.
|
// a different list of parameters.
|
||||||
|
//ResidualVM: disabled:
|
||||||
|
globalWarnings.push_back("-fno-rtti");
|
||||||
globalWarnings.push_back("-fno-exceptions");
|
globalWarnings.push_back("-fno-exceptions");
|
||||||
globalWarnings.push_back("-fcheck-new");
|
globalWarnings.push_back("-fcheck-new");
|
||||||
|
|
||||||
|
@ -1212,6 +1214,7 @@ void ProjectProvider::createProject(const BuildSetup &setup) {
|
||||||
createModuleList(setup.srcDir + "/gui", setup.defines, in, ex);
|
createModuleList(setup.srcDir + "/gui", setup.defines, in, ex);
|
||||||
createModuleList(setup.srcDir + "/audio", setup.defines, in, ex);
|
createModuleList(setup.srcDir + "/audio", setup.defines, in, ex);
|
||||||
createModuleList(setup.srcDir + "/audio/softsynth/mt32", setup.defines, in, ex);
|
createModuleList(setup.srcDir + "/audio/softsynth/mt32", setup.defines, in, ex);
|
||||||
|
//ResidualVM specific
|
||||||
createModuleList(setup.srcDir + "/math", setup.defines, in, ex);
|
createModuleList(setup.srcDir + "/math", setup.defines, in, ex);
|
||||||
#if HAS_VIDEO_FOLDER
|
#if HAS_VIDEO_FOLDER
|
||||||
createModuleList(setup.srcDir + "/video", setup.defines, in, ex);
|
createModuleList(setup.srcDir + "/video", setup.defines, in, ex);
|
||||||
|
|
|
@ -493,7 +493,6 @@ protected:
|
||||||
uint32 _dynamicData; /**< Dynamic data from the GUI Theme that modifies the drawing of the current shape */
|
uint32 _dynamicData; /**< Dynamic data from the GUI Theme that modifies the drawing of the current shape */
|
||||||
|
|
||||||
int _gradientFactor; /**< Multiplication factor of the active gradient */
|
int _gradientFactor; /**< Multiplication factor of the active gradient */
|
||||||
int _gradientBytes[3]; /**< Color bytes of the active gradient, used to speed up calculation */
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // End of namespace Graphics
|
} // End of namespace Graphics
|
||||||
|
|
|
@ -18,19 +18,17 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*
|
*
|
||||||
* $URL: https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/trunk/graphics/conversion.h $
|
|
||||||
* $Id: conversion.h 43626 2009-08-22 00:27:13Z dhewg $
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef GRAPHICS_CONVERSION_H
|
#ifndef GRAPHICS_CONVERSION_H
|
||||||
#define GRAPHICS_CONVERSION_H
|
#define GRAPHICS_CONVERSION_H
|
||||||
|
|
||||||
#include "common/util.h"
|
#include "common/util.h"
|
||||||
#include "graphics/pixelformat.h"
|
|
||||||
|
|
||||||
namespace Graphics {
|
namespace Graphics {
|
||||||
|
|
||||||
|
struct PixelFormat;
|
||||||
|
|
||||||
/** Converting a color from YUV to RGB colorspace. */
|
/** Converting a color from YUV to RGB colorspace. */
|
||||||
inline static void YUV2RGB(byte y, byte u, byte v, byte &r, byte &g, byte &b) {
|
inline static void YUV2RGB(byte y, byte u, byte v, byte &r, byte &g, byte &b) {
|
||||||
r = CLIP<int>(y + ((1357 * (v - 128)) >> 10), 0, 255);
|
r = CLIP<int>(y + ((1357 * (v - 128)) >> 10), 0, 255);
|
||||||
|
@ -45,6 +43,32 @@ inline static void RGB2YUV(byte r, byte g, byte b, byte &y, byte &u, byte &v) {
|
||||||
v = CLIP<int>( ((r * 512) >> 10) - ((g * 429) >> 10) - ((b * 83) >> 10) + 128, 0, 255);
|
v = CLIP<int>( ((r * 512) >> 10) - ((g * 429) >> 10) - ((b * 83) >> 10) + 128, 0, 255);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // end of namespace Graphics
|
// TODO: generic YUV to RGB blit
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Blits a rectangle from one graphical format to another.
|
||||||
|
*
|
||||||
|
* @param dstbuf the buffer which will recieve the converted graphics data
|
||||||
|
* @param srcbuf the buffer containing the original graphics data
|
||||||
|
* @param dstpitch width in bytes of one full line of the dest buffer
|
||||||
|
* @param srcpitch width in bytes of one full line of the source buffer
|
||||||
|
* @param w the width of the graphics data
|
||||||
|
* @param h the height of the graphics data
|
||||||
|
* @param dstFmt the desired pixel format
|
||||||
|
* @param srcFmt the original pixel format
|
||||||
|
* @return true if conversion completes successfully,
|
||||||
|
* false if there is an error.
|
||||||
|
*
|
||||||
|
* @note This implementation currently arbitrarily requires that the
|
||||||
|
* destination's format have at least as high a bytedepth as
|
||||||
|
* the source's.
|
||||||
|
* @note This can convert a rectangle in place, if the source and
|
||||||
|
* destination format have the same bytedepth.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
bool crossBlit(byte *dst, const byte *src, int dstpitch, int srcpitch,
|
||||||
|
int w, int h, const Graphics::PixelFormat &dstFmt, const Graphics::PixelFormat &srcFmt);
|
||||||
|
|
||||||
|
} // End of namespace Graphics
|
||||||
|
|
||||||
#endif // GRAPHICS_CONVERSION_H
|
#endif // GRAPHICS_CONVERSION_H
|
||||||
|
|
|
@ -136,23 +136,23 @@ void CursorManager::replaceCursor(const byte *buf, uint w, uint h, int hotspotX,
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CursorManager::supportsCursorPalettes() {
|
bool CursorManager::supportsCursorPalettes() {
|
||||||
return false;
|
return false; //ResidualVM: not supported
|
||||||
}
|
}
|
||||||
|
|
||||||
void CursorManager::disableCursorPalette(bool disable) {
|
void CursorManager::disableCursorPalette(bool disable) {
|
||||||
return;
|
return; //ResidualVM: not supported
|
||||||
}
|
}
|
||||||
|
|
||||||
void CursorManager::pushCursorPalette(const byte *colors, uint start, uint num) {
|
void CursorManager::pushCursorPalette(const byte *colors, uint start, uint num) {
|
||||||
return;
|
return; //ResidualVM: not supported
|
||||||
}
|
}
|
||||||
|
|
||||||
void CursorManager::popCursorPalette() {
|
void CursorManager::popCursorPalette() {
|
||||||
return;
|
return; //ResidualVM: not supported
|
||||||
}
|
}
|
||||||
|
|
||||||
void CursorManager::replaceCursorPalette(const byte *colors, uint start, uint num) {
|
void CursorManager::replaceCursorPalette(const byte *colors, uint start, uint num) {
|
||||||
return;
|
return; //ResidualVM: not supported
|
||||||
}
|
}
|
||||||
|
|
||||||
CursorManager::Cursor::Cursor(const byte *data, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int targetScale, const Graphics::PixelFormat *format) {
|
CursorManager::Cursor::Cursor(const byte *data, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int targetScale, const Graphics::PixelFormat *format) {
|
||||||
|
|
|
@ -72,6 +72,20 @@ const struct {
|
||||||
{ 0, FontManager::kConsoleFont }
|
{ 0, FontManager::kConsoleFont }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
bool FontManager::setLocalizedFont(const Common::String &name) {
|
||||||
|
Common::String lowercaseName = name;
|
||||||
|
lowercaseName.toLowercase();
|
||||||
|
|
||||||
|
// We only update the localized font in case the name is properly assigned
|
||||||
|
// to a font.
|
||||||
|
if (_fontMap.contains(lowercaseName) && _fontMap.getVal(lowercaseName) != 0) {
|
||||||
|
_localizedFontName = lowercaseName;
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool FontManager::assignFontToName(const Common::String &name, const Font *font) {
|
bool FontManager::assignFontToName(const Common::String &name, const Font *font) {
|
||||||
Common::String lowercaseName = name;
|
Common::String lowercaseName = name;
|
||||||
lowercaseName.toLowercase();
|
lowercaseName.toLowercase();
|
||||||
|
@ -79,19 +93,19 @@ bool FontManager::assignFontToName(const Common::String &name, const Font *font)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FontManager::setFont(FontUsage usage, const Font *font) {
|
bool FontManager::setFont(FontUsage usage, const BdfFont *font) {
|
||||||
switch (usage) {
|
switch (usage) {
|
||||||
case kConsoleFont:
|
case kConsoleFont:
|
||||||
delete g_consolefont;
|
delete g_consolefont;
|
||||||
g_consolefont = (const BdfFont *)font;
|
g_consolefont = font;
|
||||||
break;
|
break;
|
||||||
case kGUIFont:
|
case kGUIFont:
|
||||||
delete g_sysfont;
|
delete g_sysfont;
|
||||||
g_sysfont = (const BdfFont *)font;
|
g_sysfont = font;
|
||||||
break;
|
break;
|
||||||
case kBigGUIFont:
|
case kBigGUIFont:
|
||||||
delete g_sysfont_big;
|
delete g_sysfont_big;
|
||||||
g_sysfont_big = (const BdfFont *)font;
|
g_sysfont_big = font;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
|
@ -103,6 +117,11 @@ void FontManager::removeFontName(const Common::String &name) {
|
||||||
Common::String lowercaseName = name;
|
Common::String lowercaseName = name;
|
||||||
lowercaseName.toLowercase();
|
lowercaseName.toLowercase();
|
||||||
_fontMap.erase(lowercaseName);
|
_fontMap.erase(lowercaseName);
|
||||||
|
|
||||||
|
// In case the current localized font is removed, we fall back to the
|
||||||
|
// default font again.
|
||||||
|
if (_localizedFontName == lowercaseName)
|
||||||
|
_localizedFontName.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
const Font *FontManager::getFontByName(const Common::String &name) const {
|
const Font *FontManager::getFontByName(const Common::String &name) const {
|
||||||
|
@ -126,51 +145,16 @@ const Font *FontManager::getFontByUsage(FontUsage usage) const {
|
||||||
case kBigGUIFont:
|
case kBigGUIFont:
|
||||||
return g_sysfont_big;
|
return g_sysfont_big;
|
||||||
case kLocalizedFont:
|
case kLocalizedFont:
|
||||||
{
|
// By default use the big font as localized font
|
||||||
// First try to find a kBigGUIFont
|
if (_localizedFontName.empty())
|
||||||
Common::String fontName = getLocalizedFontNameByUsage(kBigGUIFont);
|
return g_sysfont_big;
|
||||||
if (!fontName.empty()) {
|
else
|
||||||
const Font *font = getFontByName(fontName);
|
return _fontMap[_localizedFontName];
|
||||||
if (font)
|
|
||||||
return font;
|
|
||||||
}
|
|
||||||
// Try kGUIFont
|
|
||||||
fontName = getLocalizedFontNameByUsage(kGUIFont);
|
|
||||||
if (!fontName.empty()) {
|
|
||||||
const Font *font = getFontByName(fontName);
|
|
||||||
if (font)
|
|
||||||
return font;
|
|
||||||
}
|
|
||||||
#ifdef USE_TRANSLATION
|
|
||||||
// Accept any other font that has the charset in its name
|
|
||||||
for (Common::HashMap<Common::String, const Font *>::const_iterator it = _fontMap.begin() ; it != _fontMap.end() ; ++it) {
|
|
||||||
if (it->_key.contains(TransMan.getCurrentCharset()))
|
|
||||||
return it->_value;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
// Fallback: return a non localized kGUIFont.
|
|
||||||
// Maybe we should return a null pointer instead?
|
|
||||||
return g_sysfont;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
Common::String FontManager::getLocalizedFontNameByUsage(FontUsage usage) const {
|
|
||||||
// We look for a name that matches the usage and that ends in .bdf.
|
|
||||||
// It should also not contain "-ascii" or "-iso-" in its name.
|
|
||||||
// We take the first name that matches.
|
|
||||||
for (int i = 0; builtinFontNames[i].name; i++) {
|
|
||||||
if (builtinFontNames[i].id == usage) {
|
|
||||||
Common::String fontName(builtinFontNames[i].name);
|
|
||||||
if (!fontName.contains("-ascii") && !fontName.contains("-iso-") && fontName.contains(".bdf"))
|
|
||||||
return genLocalizedFontFilename(fontName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return Common::String();
|
|
||||||
}
|
|
||||||
|
|
||||||
Common::String FontManager::genLocalizedFontFilename(const Common::String &filename) const {
|
Common::String FontManager::genLocalizedFontFilename(const Common::String &filename) const {
|
||||||
#ifndef USE_TRANSLATION
|
#ifndef USE_TRANSLATION
|
||||||
return filename;
|
return filename;
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
namespace Graphics {
|
namespace Graphics {
|
||||||
|
|
||||||
class Font;
|
class Font;
|
||||||
|
class BdfFont;
|
||||||
|
|
||||||
class FontManager : public Common::Singleton<FontManager> {
|
class FontManager : public Common::Singleton<FontManager> {
|
||||||
public:
|
public:
|
||||||
|
@ -42,6 +43,14 @@ public:
|
||||||
kBigGUIFont = 3
|
kBigGUIFont = 3
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the localized font name.
|
||||||
|
*
|
||||||
|
* @param name the name of the localized font.
|
||||||
|
* @return true when the font was present, false otherwise.
|
||||||
|
*/
|
||||||
|
bool setLocalizedFont(const Common::String &name);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve a font object based on its 'name'.
|
* Retrieve a font object based on its 'name'.
|
||||||
*
|
*
|
||||||
|
@ -67,7 +76,7 @@ public:
|
||||||
* @param font the font object
|
* @param font the font object
|
||||||
* @return true on success, false on failure
|
* @return true on success, false on failure
|
||||||
*/
|
*/
|
||||||
bool setFont(FontUsage usage, const Font *font);
|
bool setFont(FontUsage usage, const BdfFont *font);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Removes binding from name to font
|
* Removes binding from name to font
|
||||||
|
@ -96,22 +105,13 @@ public:
|
||||||
|
|
||||||
//const Font *getFontBySize(int size???) const;
|
//const Font *getFontBySize(int size???) const;
|
||||||
|
|
||||||
protected:
|
|
||||||
/**
|
|
||||||
* Get the name of the localized font for the given usage. There is no garanty that
|
|
||||||
* the font exists. If the usage is kLocalizedFont it returns an empty string.
|
|
||||||
*
|
|
||||||
* @param usage a FontUsage enum value indicating what the font will be used for.
|
|
||||||
* @return the name of a localized font or an empty string if no suitable font was found.
|
|
||||||
*/
|
|
||||||
Common::String getLocalizedFontNameByUsage(FontUsage usage) const;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class Common::Singleton<SingletonBaseType>;
|
friend class Common::Singleton<SingletonBaseType>;
|
||||||
FontManager();
|
FontManager();
|
||||||
~FontManager();
|
~FontManager();
|
||||||
|
|
||||||
Common::HashMap<Common::String, const Font *> _fontMap;
|
Common::HashMap<Common::String, const Font *> _fontMap;
|
||||||
|
Common::String _localizedFontName;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -67,7 +67,7 @@ int BdfFont::getCharWidth(byte chr) const {
|
||||||
|
|
||||||
template<typename PixelType>
|
template<typename PixelType>
|
||||||
void drawCharIntern(byte *ptr, uint pitch, const byte *src, int h, int width, int minX, int maxX, const PixelType color) {
|
void drawCharIntern(byte *ptr, uint pitch, const byte *src, int h, int width, int minX, int maxX, const PixelType color) {
|
||||||
byte data;
|
byte data = 0;
|
||||||
while (h--) {
|
while (h--) {
|
||||||
PixelType *dst = (PixelType *)ptr;
|
PixelType *dst = (PixelType *)ptr;
|
||||||
|
|
||||||
|
|
|
@ -117,7 +117,7 @@ Surface *BMPDecoder::decodeImage(Common::SeekableReadStream &stream, const Pixel
|
||||||
assert(newSurf);
|
assert(newSurf);
|
||||||
newSurf->create(info.width, info.height, format);
|
newSurf->create(info.width, info.height, format);
|
||||||
assert(newSurf->pixels);
|
assert(newSurf->pixels);
|
||||||
byte *curPixel = (byte*)newSurf->pixels + (newSurf->h-1) * newSurf->pitch;
|
byte *curPixel = (byte *)newSurf->pixels + (newSurf->h - 1) * newSurf->pitch;
|
||||||
int pitchAdd = info.width % 4;
|
int pitchAdd = info.width % 4;
|
||||||
for (int i = 0; i < newSurf->h; ++i) {
|
for (int i = 0; i < newSurf->h; ++i) {
|
||||||
for (int i2 = 0; i2 < newSurf->w; ++i2) {
|
for (int i2 = 0; i2 < newSurf->w; ++i2) {
|
||||||
|
|
|
@ -18,9 +18,6 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*
|
*
|
||||||
* $URL$
|
|
||||||
* $Id$
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "graphics/conversion.h"
|
#include "graphics/conversion.h"
|
||||||
|
@ -227,7 +224,7 @@ bool JPEG::read(Common::SeekableReadStream *stream) {
|
||||||
bool JPEG::readJFIF() {
|
bool JPEG::readJFIF() {
|
||||||
uint16 length = _stream->readUint16BE();
|
uint16 length = _stream->readUint16BE();
|
||||||
uint32 tag = _stream->readUint32BE();
|
uint32 tag = _stream->readUint32BE();
|
||||||
if (tag != MKTAG('J','F','I','F')) {
|
if (tag != MKTAG('J', 'F', 'I', 'F')) {
|
||||||
warning("JPEG::readJFIF() tag mismatch");
|
warning("JPEG::readJFIF() tag mismatch");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -237,7 +234,7 @@ bool JPEG::readJFIF() {
|
||||||
}
|
}
|
||||||
byte majorVersion = _stream->readByte();
|
byte majorVersion = _stream->readByte();
|
||||||
byte minorVersion = _stream->readByte();
|
byte minorVersion = _stream->readByte();
|
||||||
if(majorVersion != 1 || minorVersion != 1)
|
if (majorVersion != 1 || minorVersion != 1)
|
||||||
warning("JPEG::readJFIF() Non-v1.1 JPEGs may not be handled correctly");
|
warning("JPEG::readJFIF() Non-v1.1 JPEGs may not be handled correctly");
|
||||||
/* byte densityUnits = */ _stream->readByte();
|
/* byte densityUnits = */ _stream->readByte();
|
||||||
/* uint16 xDensity = */ _stream->readUint16BE();
|
/* uint16 xDensity = */ _stream->readUint16BE();
|
||||||
|
@ -307,7 +304,7 @@ bool JPEG::readDHT() {
|
||||||
// Free the Huffman table
|
// Free the Huffman table
|
||||||
delete[] _huff[tableNum].values; _huff[tableNum].values = NULL;
|
delete[] _huff[tableNum].values; _huff[tableNum].values = NULL;
|
||||||
delete[] _huff[tableNum].sizes; _huff[tableNum].sizes = NULL;
|
delete[] _huff[tableNum].sizes; _huff[tableNum].sizes = NULL;
|
||||||
delete[] _huff[tableNum].codes; _huff[tableNum].codes = NULL;
|
delete[] _huff[tableNum].codes; _huff[tableNum].codes = NULL;
|
||||||
|
|
||||||
// Read the number of values for each length
|
// Read the number of values for each length
|
||||||
uint8 numValues[16];
|
uint8 numValues[16];
|
||||||
|
@ -514,13 +511,13 @@ void JPEG::idct8x8(float result[64], const int16 dct[64]) {
|
||||||
for (int y = 0; y < 8; y++) {
|
for (int y = 0; y < 8; y++) {
|
||||||
for (int x = 0; x < 8; x++) {
|
for (int x = 0; x < 8; x++) {
|
||||||
tmp[y + x * 8] = dct[0] * _idct8x8[x][0]
|
tmp[y + x * 8] = dct[0] * _idct8x8[x][0]
|
||||||
+ dct[1] * _idct8x8[x][1]
|
+ dct[1] * _idct8x8[x][1]
|
||||||
+ dct[2] * _idct8x8[x][2]
|
+ dct[2] * _idct8x8[x][2]
|
||||||
+ dct[3] * _idct8x8[x][3]
|
+ dct[3] * _idct8x8[x][3]
|
||||||
+ dct[4] * _idct8x8[x][4]
|
+ dct[4] * _idct8x8[x][4]
|
||||||
+ dct[5] * _idct8x8[x][5]
|
+ dct[5] * _idct8x8[x][5]
|
||||||
+ dct[6] * _idct8x8[x][6]
|
+ dct[6] * _idct8x8[x][6]
|
||||||
+ dct[7] * _idct8x8[x][7];
|
+ dct[7] * _idct8x8[x][7];
|
||||||
}
|
}
|
||||||
|
|
||||||
dct += 8;
|
dct += 8;
|
||||||
|
@ -531,13 +528,13 @@ void JPEG::idct8x8(float result[64], const int16 dct[64]) {
|
||||||
const float *u = tmp + x * 8;
|
const float *u = tmp + x * 8;
|
||||||
for (int y = 0; y < 8; y++) {
|
for (int y = 0; y < 8; y++) {
|
||||||
result[y * 8 + x] = u[0] * _idct8x8[y][0]
|
result[y * 8 + x] = u[0] * _idct8x8[y][0]
|
||||||
+ u[1] * _idct8x8[y][1]
|
+ u[1] * _idct8x8[y][1]
|
||||||
+ u[2] * _idct8x8[y][2]
|
+ u[2] * _idct8x8[y][2]
|
||||||
+ u[3] * _idct8x8[y][3]
|
+ u[3] * _idct8x8[y][3]
|
||||||
+ u[4] * _idct8x8[y][4]
|
+ u[4] * _idct8x8[y][4]
|
||||||
+ u[5] * _idct8x8[y][5]
|
+ u[5] * _idct8x8[y][5]
|
||||||
+ u[6] * _idct8x8[y][6]
|
+ u[6] * _idct8x8[y][6]
|
||||||
+ u[7] * _idct8x8[y][7];
|
+ u[7] * _idct8x8[y][7];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -657,8 +654,7 @@ int16 JPEG::readSignedBits(uint8 numBits) {
|
||||||
ret = (ret << 1) + readBit();
|
ret = (ret << 1) + readBit();
|
||||||
|
|
||||||
// Extend sign bits (PAG109)
|
// Extend sign bits (PAG109)
|
||||||
if (!(ret >> (numBits - 1)))
|
if (!(ret >> (numBits - 1))) {
|
||||||
{
|
|
||||||
uint16 tmp = ((uint16)-1 << numBits) + 1;
|
uint16 tmp = ((uint16)-1 << numBits) + 1;
|
||||||
ret = ret + tmp;
|
ret = ret + tmp;
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,9 +18,6 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*
|
*
|
||||||
* $URL$
|
|
||||||
* $Id$
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef GRAPHICS_JPEG_H
|
#ifndef GRAPHICS_JPEG_H
|
||||||
|
@ -75,7 +72,7 @@ private:
|
||||||
// Result image for this component
|
// Result image for this component
|
||||||
Surface surface;
|
Surface surface;
|
||||||
};
|
};
|
||||||
|
|
||||||
Component *_components;
|
Component *_components;
|
||||||
|
|
||||||
// Scan components
|
// Scan components
|
||||||
|
|
|
@ -9,6 +9,7 @@ MODULE_OBJS := \
|
||||||
fonts/newfont_big.o \
|
fonts/newfont_big.o \
|
||||||
fonts/newfont.o \
|
fonts/newfont.o \
|
||||||
imagedec.o \
|
imagedec.o \
|
||||||
|
jpeg.o \
|
||||||
primitives.o \
|
primitives.o \
|
||||||
surface.o \
|
surface.o \
|
||||||
thumbnail.o \
|
thumbnail.o \
|
||||||
|
@ -16,7 +17,6 @@ MODULE_OBJS := \
|
||||||
VectorRendererSpec.o \
|
VectorRendererSpec.o \
|
||||||
yuv_to_rgb.o \
|
yuv_to_rgb.o \
|
||||||
yuva_to_rgba.o \
|
yuva_to_rgba.o \
|
||||||
jpeg.o \
|
|
||||||
pixelbuffer.o \
|
pixelbuffer.o \
|
||||||
tinygl/api.o \
|
tinygl/api.o \
|
||||||
tinygl/arrays.o \
|
tinygl/arrays.o \
|
||||||
|
|
|
@ -25,6 +25,41 @@
|
||||||
#include "common/scummsys.h"
|
#include "common/scummsys.h"
|
||||||
#include "graphics/surface.h"
|
#include "graphics/surface.h"
|
||||||
|
|
||||||
|
extern void InitScalers(uint32 BitFormat);
|
||||||
|
extern void DestroyScalers();
|
||||||
|
|
||||||
|
typedef void ScalerProc(const uint8 *srcPtr, uint32 srcPitch,
|
||||||
|
uint8 *dstPtr, uint32 dstPitch, int width, int height);
|
||||||
|
|
||||||
|
#define DECLARE_SCALER(x) \
|
||||||
|
extern void x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, \
|
||||||
|
uint32 dstPitch, int width, int height)
|
||||||
|
|
||||||
|
|
||||||
|
DECLARE_SCALER(Normal1x);
|
||||||
|
|
||||||
|
#ifdef USE_SCALERS
|
||||||
|
|
||||||
|
DECLARE_SCALER(Normal2x);
|
||||||
|
DECLARE_SCALER(Normal3x);
|
||||||
|
DECLARE_SCALER(Normal1o5x);
|
||||||
|
|
||||||
|
DECLARE_SCALER(_2xSaI);
|
||||||
|
DECLARE_SCALER(Super2xSaI);
|
||||||
|
DECLARE_SCALER(SuperEagle);
|
||||||
|
|
||||||
|
DECLARE_SCALER(AdvMame2x);
|
||||||
|
DECLARE_SCALER(AdvMame3x);
|
||||||
|
|
||||||
|
DECLARE_SCALER(TV2x);
|
||||||
|
DECLARE_SCALER(DotMatrix);
|
||||||
|
|
||||||
|
#ifdef USE_HQ_SCALERS
|
||||||
|
DECLARE_SCALER(HQ2x);
|
||||||
|
DECLARE_SCALER(HQ3x);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // #ifdef USE_SCALERS
|
||||||
|
|
||||||
// creates a 160x100 thumbnail for 320x200 games
|
// creates a 160x100 thumbnail for 320x200 games
|
||||||
// and 160x120 thumbnail for 320x240 and 640x480 games
|
// and 160x120 thumbnail for 320x240 and 640x480 games
|
||||||
|
@ -41,6 +76,7 @@ enum {
|
||||||
* @param surf a surface (will always have 16 bpp after this for now)
|
* @param surf a surface (will always have 16 bpp after this for now)
|
||||||
* @return false if a error occurred
|
* @return false if a error occurred
|
||||||
*/
|
*/
|
||||||
|
//ResidualVM: not supported
|
||||||
//extern bool createThumbnailFromScreen(Graphics::Surface *surf);
|
//extern bool createThumbnailFromScreen(Graphics::Surface *surf);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -52,6 +88,7 @@ enum {
|
||||||
* @param h height
|
* @param h height
|
||||||
* @param palette palette in RGB format
|
* @param palette palette in RGB format
|
||||||
*/
|
*/
|
||||||
|
//ResidualVM: not supported
|
||||||
//extern bool createThumbnail(Graphics::Surface *surf, const uint8 *pixels, int w, int h, const uint8 *palette);
|
//extern bool createThumbnail(Graphics::Surface *surf, const uint8 *pixels, int w, int h, const uint8 *palette);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -126,6 +126,7 @@ Graphics::Surface *loadThumbnail(Common::SeekableReadStream &in) {
|
||||||
bool saveThumbnail(Common::WriteStream &out) {
|
bool saveThumbnail(Common::WriteStream &out) {
|
||||||
Graphics::Surface thumb;
|
Graphics::Surface thumb;
|
||||||
|
|
||||||
|
//ResidualVM: not supported
|
||||||
// if (!createThumbnailFromScreen(&thumb)) {
|
// if (!createThumbnailFromScreen(&thumb)) {
|
||||||
// warning("Couldn't create thumbnail from screen, aborting thumbnail save");
|
// warning("Couldn't create thumbnail from screen, aborting thumbnail save");
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -261,7 +261,8 @@ void ThemeItemBitmap::drawSelf(bool draw, bool restore) {
|
||||||
ThemeEngine::ThemeEngine(Common::String id, GraphicsMode mode) :
|
ThemeEngine::ThemeEngine(Common::String id, GraphicsMode mode) :
|
||||||
_system(0), _vectorRenderer(0),
|
_system(0), _vectorRenderer(0),
|
||||||
_buffering(false), _bytesPerPixel(0), _graphicsMode(kGfxDisabled),
|
_buffering(false), _bytesPerPixel(0), _graphicsMode(kGfxDisabled),
|
||||||
_font(0), _initOk(false), _themeOk(false), _enabled(false), _cursor(0) {
|
_font(0), _initOk(false), _themeOk(false), _enabled(false), _themeFiles(),
|
||||||
|
_cursor(0) {
|
||||||
|
|
||||||
_system = g_system;
|
_system = g_system;
|
||||||
_parser = new ThemeParser(this);
|
_parser = new ThemeParser(this);
|
||||||
|
@ -294,6 +295,9 @@ ThemeEngine::ThemeEngine(Common::String id, GraphicsMode mode) :
|
||||||
_graphicsMode = mode;
|
_graphicsMode = mode;
|
||||||
_themeArchive = 0;
|
_themeArchive = 0;
|
||||||
_initOk = false;
|
_initOk = false;
|
||||||
|
|
||||||
|
// We prefer files in archive bundles over the common search paths.
|
||||||
|
_themeFiles.add("default", &SearchMan, 0, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
ThemeEngine::~ThemeEngine() {
|
ThemeEngine::~ThemeEngine() {
|
||||||
|
@ -317,7 +321,6 @@ ThemeEngine::~ThemeEngine() {
|
||||||
delete _parser;
|
delete _parser;
|
||||||
delete _themeEval;
|
delete _themeEval;
|
||||||
delete[] _cursor;
|
delete[] _cursor;
|
||||||
delete _themeArchive;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -406,6 +409,9 @@ bool ThemeEngine::init() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_themeArchive)
|
||||||
|
_themeFiles.add("theme_archive", _themeArchive, 1, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load the theme
|
// Load the theme
|
||||||
|
@ -564,35 +570,20 @@ bool ThemeEngine::addFont(TextData textId, const Common::String &file) {
|
||||||
_texts[textId]->_fontPtr = _font;
|
_texts[textId]->_fontPtr = _font;
|
||||||
} else {
|
} else {
|
||||||
Common::String localized = FontMan.genLocalizedFontFilename(file);
|
Common::String localized = FontMan.genLocalizedFontFilename(file);
|
||||||
// Try built-in fonts
|
// Try localized fonts
|
||||||
_texts[textId]->_fontPtr = FontMan.getFontByName(localized);
|
_texts[textId]->_fontPtr = loadFont(localized, textId == kTextDataDefault);
|
||||||
|
|
||||||
if (!_texts[textId]->_fontPtr) {
|
if (!_texts[textId]->_fontPtr) {
|
||||||
// First try to load localized font
|
// Try standard fonts
|
||||||
_texts[textId]->_fontPtr = loadFont(localized);
|
_texts[textId]->_fontPtr = loadFont(file, textId == kTextDataDefault);
|
||||||
|
|
||||||
if (_texts[textId]->_fontPtr)
|
if (!_texts[textId]->_fontPtr)
|
||||||
FontMan.assignFontToName(localized, _texts[textId]->_fontPtr);
|
error("Couldn't load font '%s'", file.c_str());
|
||||||
|
|
||||||
// Fallback to non-localized font and default translation
|
|
||||||
else {
|
|
||||||
// Try built-in fonts
|
|
||||||
_texts[textId]->_fontPtr = FontMan.getFontByName(file);
|
|
||||||
|
|
||||||
// Try to load it
|
|
||||||
if (!_texts[textId]->_fontPtr) {
|
|
||||||
_texts[textId]->_fontPtr = loadFont(file);
|
|
||||||
|
|
||||||
if (!_texts[textId]->_fontPtr)
|
|
||||||
error("Couldn't load font '%s'", file.c_str());
|
|
||||||
|
|
||||||
FontMan.assignFontToName(file, _texts[textId]->_fontPtr);
|
|
||||||
}
|
|
||||||
#ifdef USE_TRANSLATION
|
#ifdef USE_TRANSLATION
|
||||||
TransMan.setLanguage("C");
|
TransMan.setLanguage("C");
|
||||||
#endif
|
#endif
|
||||||
warning("Failed to load localized font '%s'. Using non-localized font and default GUI language instead", localized.c_str());
|
warning("Failed to load localized font '%s'. Using non-localized font and default GUI language instead", localized.c_str());
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -623,12 +614,16 @@ bool ThemeEngine::addBitmap(const Common::String &filename) {
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// If not, try to load the bitmap via the ImageDecoder class.
|
// If not, try to load the bitmap via the ImageDecoder class.
|
||||||
surf = Graphics::ImageDecoder::loadFile(filename, _overlayFormat);
|
Common::ArchiveMemberList members;
|
||||||
if (!surf && _themeArchive) {
|
_themeFiles.listMatchingMembers(members, filename);
|
||||||
Common::SeekableReadStream *stream = _themeArchive->createReadStreamForMember(filename);
|
for (Common::ArchiveMemberList::const_iterator i = members.begin(), end = members.end(); i != end; ++i) {
|
||||||
|
Common::SeekableReadStream *stream = (*i)->createReadStream();
|
||||||
if (stream) {
|
if (stream) {
|
||||||
surf = Graphics::ImageDecoder::loadFile(*stream, _overlayFormat);
|
surf = Graphics::ImageDecoder::loadFile(*stream, _overlayFormat);
|
||||||
delete stream;
|
delete stream;
|
||||||
|
|
||||||
|
if (surf)
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1390,68 +1385,45 @@ DrawData ThemeEngine::parseDrawDataId(const Common::String &name) const {
|
||||||
* External data loading
|
* External data loading
|
||||||
*********************************************************/
|
*********************************************************/
|
||||||
|
|
||||||
const Graphics::Font *ThemeEngine::loadFontFromArchive(const Common::String &filename) {
|
const Graphics::Font *ThemeEngine::loadFont(const Common::String &filename, const bool makeLocalizedFont) {
|
||||||
Common::SeekableReadStream *stream = 0;
|
// Try already loaded fonts.
|
||||||
const Graphics::Font *font = 0;
|
const Graphics::Font *font = FontMan.getFontByName(filename);
|
||||||
|
if (font)
|
||||||
|
return font;
|
||||||
|
|
||||||
if (_themeArchive)
|
|
||||||
stream = _themeArchive->createReadStreamForMember(filename);
|
|
||||||
if (stream) {
|
|
||||||
font = Graphics::BdfFont::loadFont(*stream);
|
|
||||||
delete stream;
|
|
||||||
}
|
|
||||||
|
|
||||||
return font;
|
|
||||||
}
|
|
||||||
|
|
||||||
const Graphics::Font *ThemeEngine::loadCachedFontFromArchive(const Common::String &filename) {
|
|
||||||
Common::SeekableReadStream *stream = 0;
|
|
||||||
const Graphics::Font *font = 0;
|
|
||||||
|
|
||||||
if (_themeArchive)
|
|
||||||
stream = _themeArchive->createReadStreamForMember(filename);
|
|
||||||
if (stream) {
|
|
||||||
font = Graphics::BdfFont::loadFromCache(*stream);
|
|
||||||
delete stream;
|
|
||||||
}
|
|
||||||
|
|
||||||
return font;
|
|
||||||
}
|
|
||||||
|
|
||||||
const Graphics::Font *ThemeEngine::loadFont(const Common::String &filename) {
|
|
||||||
const Graphics::Font *font = 0;
|
|
||||||
Common::String cacheFilename = genCacheFilename(filename);
|
Common::String cacheFilename = genCacheFilename(filename);
|
||||||
Common::File fontFile;
|
|
||||||
|
|
||||||
if (!cacheFilename.empty()) {
|
Common::ArchiveMemberList members;
|
||||||
if (fontFile.open(cacheFilename)) {
|
_themeFiles.listMatchingMembers(members, cacheFilename);
|
||||||
font = Graphics::BdfFont::loadFromCache(fontFile);
|
_themeFiles.listMatchingMembers(members, filename);
|
||||||
|
|
||||||
|
for (Common::ArchiveMemberList::const_iterator i = members.begin(), end = members.end(); i != end; ++i) {
|
||||||
|
Common::SeekableReadStream *stream = (*i)->createReadStream();
|
||||||
|
if (stream) {
|
||||||
|
if ((*i)->getName().equalsIgnoreCase(cacheFilename)) {
|
||||||
|
font = Graphics::BdfFont::loadFromCache(*stream);
|
||||||
|
} else {
|
||||||
|
font = Graphics::BdfFont::loadFont(*stream);
|
||||||
|
if (font && !cacheFilename.empty()) {
|
||||||
|
if (!Graphics::BdfFont::cacheFontData(*(const Graphics::BdfFont *)font, cacheFilename))
|
||||||
|
warning("Couldn't create cache file for font '%s'", filename.c_str());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
delete stream;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (font)
|
if (font)
|
||||||
return font;
|
break;
|
||||||
|
|
||||||
if ((font = loadCachedFontFromArchive(cacheFilename)))
|
|
||||||
return font;
|
|
||||||
}
|
|
||||||
|
|
||||||
// normal open
|
|
||||||
if (fontFile.open(filename)) {
|
|
||||||
font = Graphics::BdfFont::loadFont(fontFile);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!font) {
|
|
||||||
font = loadFontFromArchive(filename);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If the font is successfully loaded store it in the font manager.
|
||||||
if (font) {
|
if (font) {
|
||||||
if (!cacheFilename.empty()) {
|
FontMan.assignFontToName(filename, font);
|
||||||
if (!Graphics::BdfFont::cacheFontData(*(const Graphics::BdfFont *)font, cacheFilename)) {
|
// If this font should be the new default localized font, we set it up
|
||||||
warning("Couldn't create cache file for font '%s'", filename.c_str());
|
// for that.
|
||||||
}
|
if (makeLocalizedFont)
|
||||||
}
|
FontMan.setLocalizedFont(filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
return font;
|
return font;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -536,9 +536,7 @@ protected:
|
||||||
*/
|
*/
|
||||||
void unloadTheme();
|
void unloadTheme();
|
||||||
|
|
||||||
const Graphics::Font *loadFont(const Common::String &filename);
|
const Graphics::Font *loadFont(const Common::String &filename, const bool makeLocalizedFont);
|
||||||
const Graphics::Font *loadFontFromArchive(const Common::String &filename);
|
|
||||||
const Graphics::Font *loadCachedFontFromArchive(const Common::String &filename);
|
|
||||||
Common::String genCacheFilename(const Common::String &filename) const;
|
Common::String genCacheFilename(const Common::String &filename) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -658,6 +656,7 @@ protected:
|
||||||
Common::String _themeId;
|
Common::String _themeId;
|
||||||
Common::String _themeFile;
|
Common::String _themeFile;
|
||||||
Common::Archive *_themeArchive;
|
Common::Archive *_themeArchive;
|
||||||
|
Common::SearchSet _themeFiles;
|
||||||
|
|
||||||
bool _useCursor;
|
bool _useCursor;
|
||||||
int _cursorHotspotX, _cursorHotspotY;
|
int _cursorHotspotX, _cursorHotspotY;
|
||||||
|
|
|
@ -54,11 +54,7 @@ int BrowserDialog::runModal() {
|
||||||
NSOpenPanel * panel = [NSOpenPanel openPanel];
|
NSOpenPanel * panel = [NSOpenPanel openPanel];
|
||||||
[panel setCanChooseDirectories:YES];
|
[panel setCanChooseDirectories:YES];
|
||||||
if ([panel runModalForTypes:nil] == NSOKButton) {
|
if ([panel runModalForTypes:nil] == NSOKButton) {
|
||||||
#ifdef __POWERPC__
|
const char *filename = [[panel filename] UTF8String];
|
||||||
const char *filename = [[panel filename] cString];
|
|
||||||
#else
|
|
||||||
const char *filename = [[panel filename] cStringUsingEncoding:NSUTF8StringEncoding];
|
|
||||||
#endif
|
|
||||||
_choice = Common::FSNode(filename);
|
_choice = Common::FSNode(filename);
|
||||||
choiceMade = true;
|
choiceMade = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -132,15 +132,7 @@ void GuiManager::pushKeymap() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void GuiManager::popKeymap() {
|
void GuiManager::popKeymap() {
|
||||||
Common::Keymapper *keymapper = _system->getEventManager()->getKeymapper();
|
_system->getEventManager()->getKeymapper()->popKeymap(Common::kGuiKeymapName);
|
||||||
if (!keymapper->getActiveStack().empty()) {
|
|
||||||
Common::Keymapper::MapRecord topKeymap = keymapper->getActiveStack().top();
|
|
||||||
// TODO: Don't use the keymap name as a way to discriminate GUI maps
|
|
||||||
if(topKeymap.keymap->getName().equals(Common::kGuiKeymapName))
|
|
||||||
keymapper->popKeymap();
|
|
||||||
else
|
|
||||||
warning("An attempt to pop non-gui keymap %s was blocked", topKeymap.keymap->getName().c_str());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -285,15 +277,6 @@ void GuiManager::runLoop() {
|
||||||
uint32 lastRedraw = 0;
|
uint32 lastRedraw = 0;
|
||||||
const uint32 waitTime = 1000 / 45;
|
const uint32 waitTime = 1000 / 45;
|
||||||
|
|
||||||
#ifdef ENABLE_KEYMAPPER
|
|
||||||
// Due to circular reference with event manager and GUI
|
|
||||||
// we cannot init keymap on the GUI creation. Thus, let's
|
|
||||||
// try to do it on every launch, checking whether the
|
|
||||||
// map is already existing
|
|
||||||
initKeymap();
|
|
||||||
pushKeymap();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
bool tooltipCheck = false;
|
bool tooltipCheck = false;
|
||||||
|
|
||||||
while (!_dialogStack.empty() && activeDialog == getTopDialog()) {
|
while (!_dialogStack.empty() && activeDialog == getTopDialog()) {
|
||||||
|
@ -405,10 +388,6 @@ void GuiManager::runLoop() {
|
||||||
_system->delayMillis(10);
|
_system->delayMillis(10);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ENABLE_KEYMAPPER
|
|
||||||
popKeymap();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (didSaveState) {
|
if (didSaveState) {
|
||||||
_theme->disable();
|
_theme->disable();
|
||||||
restoreState();
|
restoreState();
|
||||||
|
@ -419,6 +398,10 @@ void GuiManager::runLoop() {
|
||||||
#pragma mark -
|
#pragma mark -
|
||||||
|
|
||||||
void GuiManager::saveState() {
|
void GuiManager::saveState() {
|
||||||
|
#ifdef ENABLE_KEYMAPPER
|
||||||
|
initKeymap();
|
||||||
|
pushKeymap();
|
||||||
|
#endif
|
||||||
// Backup old cursor
|
// Backup old cursor
|
||||||
_lastClick.x = _lastClick.y = 0;
|
_lastClick.x = _lastClick.y = 0;
|
||||||
_lastClick.time = 0;
|
_lastClick.time = 0;
|
||||||
|
@ -428,6 +411,9 @@ void GuiManager::saveState() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void GuiManager::restoreState() {
|
void GuiManager::restoreState() {
|
||||||
|
#ifdef ENABLE_KEYMAPPER
|
||||||
|
popKeymap();
|
||||||
|
#endif
|
||||||
if (_useStdCursor) {
|
if (_useStdCursor) {
|
||||||
CursorMan.popCursor();
|
CursorMan.popCursor();
|
||||||
CursorMan.popCursorPalette();
|
CursorMan.popCursorPalette();
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 890 B After Width: | Height: | Size: 824 B |
9
ports.mk
9
ports.mk
|
@ -16,8 +16,7 @@ install:
|
||||||
$(INSTALL) -d "$(DESTDIR)$(docdir)"
|
$(INSTALL) -d "$(DESTDIR)$(docdir)"
|
||||||
$(INSTALL) -c -m 644 $(DIST_FILES_DOCS) "$(DESTDIR)$(docdir)"
|
$(INSTALL) -c -m 644 $(DIST_FILES_DOCS) "$(DESTDIR)$(docdir)"
|
||||||
$(INSTALL) -d "$(DESTDIR)$(datadir)"
|
$(INSTALL) -d "$(DESTDIR)$(datadir)"
|
||||||
$(INSTALL) -c -m 644 $(DIST_FILES_THEMES) "$(DESTDIR)$(datadir)/"
|
$(INSTALL) -c -m 644 $(DIST_FILES_THEMES) $(DIST_FILES_ENGINEDATA) "$(DESTDIR)$(datadir)/"
|
||||||
$(INSTALL) -c -m 644 $(DIST_FILES_ENGINEDATA) "$(DESTDIR)$(datadir)/"
|
|
||||||
ifdef DYNAMIC_MODULES
|
ifdef DYNAMIC_MODULES
|
||||||
$(INSTALL) -d "$(DESTDIR)$(libdir)/residualvm/"
|
$(INSTALL) -d "$(DESTDIR)$(libdir)/residualvm/"
|
||||||
$(INSTALL) -c -s -m 644 $(PLUGINS) "$(DESTDIR)$(libdir)/residualvm/"
|
$(INSTALL) -c -s -m 644 $(PLUGINS) "$(DESTDIR)$(libdir)/residualvm/"
|
||||||
|
@ -82,6 +81,7 @@ endif
|
||||||
# Location of static libs for the iPhone
|
# Location of static libs for the iPhone
|
||||||
ifneq ($(BACKEND), iphone)
|
ifneq ($(BACKEND), iphone)
|
||||||
# Static libaries, used for the residualvm-static and iphone targets
|
# Static libaries, used for the residualvm-static and iphone targets
|
||||||
|
#ResidualVM path for SDL
|
||||||
OSX_STATIC_LIBS := `$(SDLCONFIG) --static-libs`
|
OSX_STATIC_LIBS := `$(SDLCONFIG) --static-libs`
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -122,7 +122,7 @@ OSX_STATIC_LIBS += $(STATICLIBPATH)/lib/libfaad.a
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef USE_ZLIB
|
ifdef USE_ZLIB
|
||||||
OSX_ZLIB ?= -lz
|
OSX_ZLIB ?= $(STATICLIBPATH)/lib/libz.a
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef USE_SPARKLE
|
ifdef USE_SPARKLE
|
||||||
|
@ -163,6 +163,7 @@ osxsnap: bundle
|
||||||
cp $(srcdir)/COPYRIGHT ./ResidualVM-snapshot/Copyright\ Holders
|
cp $(srcdir)/COPYRIGHT ./ResidualVM-snapshot/Copyright\ Holders
|
||||||
cp $(srcdir)/NEWS ./ResidualVM-snapshot/News
|
cp $(srcdir)/NEWS ./ResidualVM-snapshot/News
|
||||||
cp $(srcdir)/README ./ResidualVM-snapshot/Residual\ ReadMe
|
cp $(srcdir)/README ./ResidualVM-snapshot/Residual\ ReadMe
|
||||||
|
mkdir ScummVM-snapshot/doc
|
||||||
/Developer/Tools/SetFile -t ttro -c ttxt ./ResidualVM-snapshot/*
|
/Developer/Tools/SetFile -t ttro -c ttxt ./ResidualVM-snapshot/*
|
||||||
/Developer/Tools/CpMac -r $(bundle_name) ./ResidualVM-snapshot/
|
/Developer/Tools/CpMac -r $(bundle_name) ./ResidualVM-snapshot/
|
||||||
#cp $(srcdir)/dists/macosx/DS_Store ./ResidualVM-snapshot/.DS_Store
|
#cp $(srcdir)/dists/macosx/DS_Store ./ResidualVM-snapshot/.DS_Store
|
||||||
|
@ -186,6 +187,7 @@ residualvmwinres.o: $(srcdir)/icons/residualvm.ico $(DIST_FILES_THEMES) $(DIST_F
|
||||||
win32dist: $(EXECUTABLE)
|
win32dist: $(EXECUTABLE)
|
||||||
mkdir -p $(WIN32PATH)
|
mkdir -p $(WIN32PATH)
|
||||||
mkdir -p $(WIN32PATH)/graphics
|
mkdir -p $(WIN32PATH)/graphics
|
||||||
|
mkdir -p $(WIN32PATH)/doc
|
||||||
$(STRIP) $(EXECUTABLE) -o $(WIN32PATH)/$(EXECUTABLE)
|
$(STRIP) $(EXECUTABLE) -o $(WIN32PATH)/$(EXECUTABLE)
|
||||||
cp $(DIST_FILES_THEMES) $(WIN32PATH)
|
cp $(DIST_FILES_THEMES) $(WIN32PATH)
|
||||||
ifdef DIST_FILES_ENGINEDATA
|
ifdef DIST_FILES_ENGINEDATA
|
||||||
|
@ -202,6 +204,7 @@ endif
|
||||||
cp $(srcdir)/icons/residualvm.ico $(WIN32PATH)
|
cp $(srcdir)/icons/residualvm.ico $(WIN32PATH)
|
||||||
cp $(srcdir)/dists/win32/residualvm.iss $(WIN32PATH)
|
cp $(srcdir)/dists/win32/residualvm.iss $(WIN32PATH)
|
||||||
unix2dos $(WIN32PATH)/*.txt
|
unix2dos $(WIN32PATH)/*.txt
|
||||||
|
unix2dos $(WIN32PATH)/doc/*.txt
|
||||||
# Special target to create a win32 NSIS installer
|
# Special target to create a win32 NSIS installer
|
||||||
win32setup: $(EXECUTABLE)
|
win32setup: $(EXECUTABLE)
|
||||||
mkdir -p $(srcdir)/$(STAGINGPATH)
|
mkdir -p $(srcdir)/$(STAGINGPATH)
|
||||||
|
|
|
@ -515,7 +515,7 @@ void BinkDecoder::mergeHuffmanSymbols(VideoFrame &video, byte *dst, const byte *
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BinkDecoder::loadStream(Common::SeekableReadStream *stream) {
|
bool BinkDecoder::loadStream(Common::SeekableReadStream *stream) {
|
||||||
Graphics::PixelFormat format = g_system->getOverlayFormat(); // residual FIXME: getScreenFormat();
|
Graphics::PixelFormat format = g_system->getOverlayFormat(); // ResidualVM specific: getScreenFormat();
|
||||||
return loadStream(stream, format);
|
return loadStream(stream, format);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,6 @@ public:
|
||||||
|
|
||||||
// VideoDecoder API
|
// VideoDecoder API
|
||||||
bool loadStream(Common::SeekableReadStream *stream);
|
bool loadStream(Common::SeekableReadStream *stream);
|
||||||
bool loadStream(Common::SeekableReadStream *stream, const Graphics::PixelFormat &format);
|
|
||||||
void close();
|
void close();
|
||||||
bool isVideoLoaded() const { return _bink != 0; }
|
bool isVideoLoaded() const { return _bink != 0; }
|
||||||
uint16 getWidth() const { return _surface.w; }
|
uint16 getWidth() const { return _surface.w; }
|
||||||
|
@ -79,6 +78,8 @@ public:
|
||||||
// FixedRateVideoDecoder
|
// FixedRateVideoDecoder
|
||||||
Common::Rational getFrameRate() const { return _frameRate; }
|
Common::Rational getFrameRate() const { return _frameRate; }
|
||||||
|
|
||||||
|
// Bink specific
|
||||||
|
bool loadStream(Common::SeekableReadStream *stream, const Graphics::PixelFormat &format);
|
||||||
protected:
|
protected:
|
||||||
static const int kAudioChannelsMax = 2;
|
static const int kAudioChannelsMax = 2;
|
||||||
static const int kAudioBlockSizeMax = (kAudioChannelsMax << 11);
|
static const int kAudioBlockSizeMax = (kAudioChannelsMax << 11);
|
||||||
|
@ -263,7 +264,7 @@ protected:
|
||||||
/**
|
/**
|
||||||
* Decode a video packet.
|
* Decode a video packet.
|
||||||
*
|
*
|
||||||
* This method is virtual because it is overriden in Residual
|
* This method is virtual because it is overriden in ResidualVM
|
||||||
* to export the alpha channel of the video
|
* to export the alpha channel of the video
|
||||||
*/
|
*/
|
||||||
virtual void videoPacket(VideoFrame &video);
|
virtual void videoPacket(VideoFrame &video);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue