diff options
author | Eugene Sandulenko | 2013-05-17 00:18:09 +0300 |
---|---|---|
committer | Eugene Sandulenko | 2013-05-17 00:18:09 +0300 |
commit | f59512c47ea21c851535eeabf822aabdfde9167f (patch) | |
tree | 19c58c54c897dde0188e28951f0827a20ef3c4a0 /engines | |
parent | 4a62d6c25a4994a72c59ca3b8f2913ead565a173 (diff) | |
download | scummvm-rg350-f59512c47ea21c851535eeabf822aabdfde9167f.tar.gz scummvm-rg350-f59512c47ea21c851535eeabf822aabdfde9167f.tar.bz2 scummvm-rg350-f59512c47ea21c851535eeabf822aabdfde9167f.zip |
RECORDER: Implement Events Recorder
Diffstat (limited to 'engines')
-rw-r--r-- | engines/advancedDetector.cpp | 9 | ||||
-rw-r--r-- | engines/advancedDetector.h | 3 | ||||
-rw-r--r-- | engines/cge/cge.cpp | 1 | ||||
-rw-r--r-- | engines/dreamweb/dreamweb.cpp | 1 | ||||
-rw-r--r-- | engines/sword25/gfx/image/renderedimage.cpp | 57 | ||||
-rw-r--r-- | engines/sword25/gfx/image/renderedimage.h | 3 | ||||
-rw-r--r-- | engines/wintermute/wintermute.cpp | 1 |
7 files changed, 12 insertions, 63 deletions
diff --git a/engines/advancedDetector.cpp b/engines/advancedDetector.cpp index b1d1008b60..9023548c83 100644 --- a/engines/advancedDetector.cpp +++ b/engines/advancedDetector.cpp @@ -29,7 +29,7 @@ #include "common/system.h" #include "common/textconsole.h" #include "common/translation.h" - +#include "gui/EventRecorder.h" #include "engines/advancedDetector.h" #include "engines/obsolete.h" @@ -301,6 +301,7 @@ Common::Error AdvancedMetaEngine::createInstance(OSystem *syst, Engine **engine) return Common::kUserCanceled; debug(2, "Running %s", gameDescriptor.description().c_str()); + initSubSystems(agdDesc); if (!createInstance(syst, engine, agdDesc)) return Common::kNoGameDataFoundError; else @@ -606,3 +607,9 @@ AdvancedMetaEngine::AdvancedMetaEngine(const void *descs, uint descItemSize, con _maxScanDepth = 1; _directoryGlobs = NULL; } + +void AdvancedMetaEngine::initSubSystems(const ADGameDescription *gameDesc) const { + if (gameDesc) { + g_eventRec.processGameDescription(gameDesc); + } +} diff --git a/engines/advancedDetector.h b/engines/advancedDetector.h index 3eec33abe5..71d2c4a446 100644 --- a/engines/advancedDetector.h +++ b/engines/advancedDetector.h @@ -280,6 +280,9 @@ protected: return 0; } +private: + void initSubSystems(const ADGameDescription *gameDesc) const; + protected: /** * Detect games in specified directory. diff --git a/engines/cge/cge.cpp b/engines/cge/cge.cpp index 6cc0c45963..af7e91f7eb 100644 --- a/engines/cge/cge.cpp +++ b/engines/cge/cge.cpp @@ -25,7 +25,6 @@ #include "common/debug.h" #include "common/debug-channels.h" #include "common/error.h" -#include "common/EventRecorder.h" #include "common/file.h" #include "common/fs.h" #include "engines/advancedDetector.h" diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index c3ede46df2..08838a784a 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -23,7 +23,6 @@ #include "common/config-manager.h" #include "common/debug-channels.h" #include "common/events.h" -#include "common/EventRecorder.h" #include "common/file.h" #include "common/func.h" #include "common/system.h" diff --git a/engines/sword25/gfx/image/renderedimage.cpp b/engines/sword25/gfx/image/renderedimage.cpp index c8a6666046..81a29c727f 100644 --- a/engines/sword25/gfx/image/renderedimage.cpp +++ b/engines/sword25/gfx/image/renderedimage.cpp @@ -41,6 +41,7 @@ #include "sword25/gfx/renderobjectmanager.h" #include "common/system.h" +#include "graphics/thumbnail.h" namespace Sword25 { @@ -509,60 +510,4 @@ void RenderedImage::checkForTransparency() { } } -/** - * Scales a passed surface, creating a new surface with the result - * @param srcImage Source image to scale - * @param scaleFactor Scale amount. Must be between 0 and 1.0 (but not zero) - * @remarks Caller is responsible for freeing the returned surface - */ -Graphics::Surface *RenderedImage::scale(const Graphics::Surface &srcImage, int xSize, int ySize) { - Graphics::Surface *s = new Graphics::Surface(); - s->create(xSize, ySize, srcImage.format); - - int *horizUsage = scaleLine(xSize, srcImage.w); - int *vertUsage = scaleLine(ySize, srcImage.h); - - // Loop to create scaled version - for (int yp = 0; yp < ySize; ++yp) { - const byte *srcP = (const byte *)srcImage.getBasePtr(0, vertUsage[yp]); - byte *destP = (byte *)s->getBasePtr(0, yp); - - for (int xp = 0; xp < xSize; ++xp) { - const byte *tempSrcP = srcP + (horizUsage[xp] * srcImage.format.bytesPerPixel); - for (int byteCtr = 0; byteCtr < srcImage.format.bytesPerPixel; ++byteCtr) { - *destP++ = *tempSrcP++; - } - } - } - - // Delete arrays and return surface - delete[] horizUsage; - delete[] vertUsage; - return s; -} - -/** - * Returns an array indicating which pixels of a source image horizontally or vertically get - * included in a scaled image - */ -int *RenderedImage::scaleLine(int size, int srcSize) { - int scale = 100 * size / srcSize; - assert(scale > 0); - int *v = new int[size]; - Common::fill(v, &v[size], 0); - - int distCtr = 0; - int *destP = v; - for (int distIndex = 0; distIndex < srcSize; ++distIndex) { - distCtr += scale; - while (distCtr >= 100) { - assert(destP < &v[size]); - *destP++ = distIndex; - distCtr -= 100; - } - } - - return v; -} - } // End of namespace Sword25 diff --git a/engines/sword25/gfx/image/renderedimage.h b/engines/sword25/gfx/image/renderedimage.h index a25b258592..116f97de26 100644 --- a/engines/sword25/gfx/image/renderedimage.h +++ b/engines/sword25/gfx/image/renderedimage.h @@ -104,8 +104,6 @@ public: return true; } - static Graphics::Surface *scale(const Graphics::Surface &srcImage, int xSize, int ySize); - void setIsTransparent(bool isTransparent) { _isTransparent = isTransparent; } virtual bool isSolid() const { return !_isTransparent; } @@ -119,7 +117,6 @@ private: Graphics::Surface *_backSurface; void checkForTransparency(); - static int *scaleLine(int size, int srcSize); }; } // End of namespace Sword25 diff --git a/engines/wintermute/wintermute.cpp b/engines/wintermute/wintermute.cpp index 89a6f1b3e0..19848b002e 100644 --- a/engines/wintermute/wintermute.cpp +++ b/engines/wintermute/wintermute.cpp @@ -26,7 +26,6 @@ #include "common/debug.h" #include "common/debug-channels.h" #include "common/error.h" -#include "common/EventRecorder.h" #include "common/file.h" #include "common/fs.h" #include "common/tokenizer.h" |