Skip to content

Commit

Permalink
GROOVIE: Remove groovie2 8bpp mode
Browse files Browse the repository at this point in the history
It didn't work properly, it's not what the original did, and spooky mode needs to be implemented completely differently
  • Loading branch information
Matthew Hoops committed Jun 2, 2014
1 parent 72e7d55 commit 5d4fd2e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 30 deletions.
2 changes: 1 addition & 1 deletion engines/groovie/configure.engine
@@ -1,4 +1,4 @@
# This file is included from the main "configure" script
# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps]
add_engine groovie "Groovie" yes "groovie2" "7th Guest"
add_engine groovie2 "Groovie 2 games" no "" "" "jpeg"
add_engine groovie2 "Groovie 2 games" no "" "" "jpeg 16bit"
11 changes: 8 additions & 3 deletions engines/groovie/groovie.cpp
Expand Up @@ -50,7 +50,8 @@ namespace Groovie {
GroovieEngine::GroovieEngine(OSystem *syst, const GroovieGameDescription *gd) :
Engine(syst), _gameDescription(gd), _debugger(NULL), _script(NULL),
_resMan(NULL), _grvCursorMan(NULL), _videoPlayer(NULL), _musicPlayer(NULL),
_graphicsMan(NULL), _macResFork(NULL), _waitingForInput(false), _font(NULL) {
_graphicsMan(NULL), _macResFork(NULL), _waitingForInput(false), _font(NULL),
_spookyMode(false) {

// Adding the default directories
const Common::FSNode gameDataDir(ConfMan.get("path"));
Expand Down Expand Up @@ -107,9 +108,13 @@ Common::Error GroovieEngine::run() {
// Request the mode with the highest precision available
initGraphics(640, 480, true, NULL);

// Save the enabled mode as it can be both an RGB mode or CLUT8
// Save the enabled mode
_pixelFormat = _system->getScreenFormat();
_mode8bit = (_pixelFormat == Graphics::PixelFormat::createFormatCLUT8());

// TODO: Eventually drop 16bpp mode
if (_pixelFormat.bytesPerPixel == 1)
return Common::kUnsupportedColorMode;

break;
case kGroovieT7G:
initGraphics(640, 480, true);
Expand Down
2 changes: 1 addition & 1 deletion engines/groovie/groovie.h
Expand Up @@ -110,7 +110,7 @@ class GroovieEngine : public Engine {
void waitForInput();

Graphics::PixelFormat _pixelFormat;
bool _mode8bit;
bool _spookyMode;
Script *_script;
ResMan *_resMan;
GrvCursorMan *_grvCursorMan;
Expand Down
30 changes: 5 additions & 25 deletions engines/groovie/roq.cpp
Expand Up @@ -50,19 +50,6 @@ ROQPlayer::ROQPlayer(GroovieEngine *vm) :
// Create the work surfaces
_currBuf = new Graphics::Surface();
_prevBuf = new Graphics::Surface();

if (_vm->_mode8bit) {
byte pal[256 * 3];

// Set a grayscale palette
for (int i = 0; i < 256; i++) {
pal[(i * 3) + 0] = i;
pal[(i * 3) + 1] = i;
pal[(i * 3) + 2] = i;
}

_syst->getPaletteManager()->setPalette(pal, 0, 256);
}
}

ROQPlayer::~ROQPlayer() {
Expand Down Expand Up @@ -118,18 +105,11 @@ void ROQPlayer::buildShowBuf() {
byte *out = (byte *)_bg->getBasePtr(0, line);
byte *in = (byte *)_currBuf->getBasePtr(0, line / _scaleY);
for (int x = 0; x < _bg->w; x++) {
if (_vm->_mode8bit) {
// Just use the luminancy component
*out = *in;
#ifdef USE_RGB_COLOR
} else {
// Do the format conversion (YUV -> RGB -> Screen format)
byte r, g, b;
Graphics::YUV2RGB(*in, *(in + 1), *(in + 2), r, g, b);
// FIXME: this is fixed to 16bit
*(uint16 *)out = (uint16)_vm->_pixelFormat.RGBToColor(r, g, b);
#endif // USE_RGB_COLOR
}
// Do the format conversion (YUV -> RGB -> Screen format)
byte r, g, b;
Graphics::YUV2RGB(*in, *(in + 1), *(in + 2), r, g, b);
// FIXME: this is fixed to 16bit
*(uint16 *)out = _vm->_pixelFormat.RGBToColor(r, g, b);

// Skip to the next pixel
out += _vm->_pixelFormat.bytesPerPixel;
Expand Down

0 comments on commit 5d4fd2e

Please sign in to comment.