Skip to content

Commit

Permalink
IMAGE: Try and work around N64 compilation error
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed Sep 11, 2016
1 parent dd1a2b6 commit 21979d7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion image/codecs/indeo/indeo.cpp
Expand Up @@ -35,6 +35,7 @@
#include "graphics/yuv_to_rgb.h"
#include "common/system.h"
#include "common/algorithm.h"
#include "common/rect.h"
#include "common/textconsole.h"
#include "common/util.h"

Expand Down Expand Up @@ -468,13 +469,14 @@ IVI45DecContext::IVI45DecContext() : _gb(nullptr), _frameNum(0), _frameType(0),
IndeoDecoderBase::IndeoDecoderBase(uint16 width, uint16 height) : Codec() {
_pixelFormat = g_system->getScreenFormat();
assert(_pixelFormat.bytesPerPixel > 1);
_surface = new Graphics::ManagedSurface();
_surface = new Graphics::Surface();
_surface->create(width, height, _pixelFormat);
_surface->fillRect(Common::Rect(0, 0, width, height), 0);
_ctx._bRefBuf = 3; // buffer 2 is used for scalability mode
}

IndeoDecoderBase::~IndeoDecoderBase() {
_surface->free();
delete _surface;
IVIPlaneDesc::freeBuffers(_ctx._planes);
if (_ctx._mbVlc._custTab._table)
Expand Down
4 changes: 2 additions & 2 deletions image/codecs/indeo/indeo.h
Expand Up @@ -21,7 +21,7 @@
*/

#include "common/scummsys.h"
#include "graphics/managed_surface.h"
#include "graphics/surface.h"
#include "image/codecs/codec.h"

/* Common structures, macros, and base class shared by both Indeo4 and
Expand Down Expand Up @@ -518,7 +518,7 @@ class IndeoDecoderBase : public Codec {
protected:
IVI45DecContext _ctx;
Graphics::PixelFormat _pixelFormat;
Graphics::ManagedSurface *_surface;
Graphics::Surface *_surface;

/**
* Scan patterns shared between indeo4 and indeo5
Expand Down
2 changes: 1 addition & 1 deletion image/codecs/indeo4.cpp
Expand Up @@ -85,7 +85,7 @@ const Graphics::Surface *Indeo4Decoder::decodeFrame(Common::SeekableReadStream &
_ctx._frameData = nullptr;
_ctx._frameSize = 0;

return (err < 0) ? nullptr : &_surface->rawSurface();
return (err < 0) ? nullptr : _surface;
}

int Indeo4Decoder::decodePictureHeader() {
Expand Down
2 changes: 1 addition & 1 deletion image/codecs/indeo5.cpp
Expand Up @@ -96,7 +96,7 @@ const Graphics::Surface *Indeo5Decoder::decodeFrame(Common::SeekableReadStream &
_ctx._frameData = nullptr;
_ctx._frameSize = 0;

return (err < 0) ? nullptr : &_surface->rawSurface();
return (err < 0) ? nullptr : _surface;
}

int Indeo5Decoder::decodePictureHeader() {
Expand Down

0 comments on commit 21979d7

Please sign in to comment.