From d53c43d092ed505185ad30086ffb78f1b04332a3 Mon Sep 17 00:00:00 2001 From: Simei Yin Date: Sat, 15 Jul 2017 16:28:19 +0200 Subject: SLUDGE: Add a color into stack machine --- engines/sludge/backdrop.cpp | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'engines/sludge') diff --git a/engines/sludge/backdrop.cpp b/engines/sludge/backdrop.cpp index ac818893e0..c1830d884f 100644 --- a/engines/sludge/backdrop.cpp +++ b/engines/sludge/backdrop.cpp @@ -924,7 +924,6 @@ void saveParallaxRecursive(parallaxLayer *me, Common::WriteStream *stream) { } bool getRGBIntoStack(uint x, uint y, stackHandler *sH) { -#if 0 if (x >= sceneWidth || y >= sceneHeight) { return fatal("Co-ordinates are outside current scene!"); } @@ -933,25 +932,18 @@ bool getRGBIntoStack(uint x, uint y, stackHandler *sH) { newValue.varType = SVT_NULL; - saveTexture(backdropTextureName, backdropTexture); - - GLubyte *target; - if (!NPOT_textures) { - target = backdropTexture + 4 * getNextPOT(sceneWidth) * y + x * 4; - } else { - target = backdropTexture + 4 * sceneWidth * y + x * 4; - } + byte *target = (byte *)renderSurface.getBasePtr(x, y); - setVariable(newValue, SVT_INT, target[2]); + setVariable(newValue, SVT_INT, target[1]); if (!addVarToStackQuick(newValue, sH->first)) return false; sH->last = sH->first; - setVariable(newValue, SVT_INT, target[1]); + setVariable(newValue, SVT_INT, target[2]); if (!addVarToStackQuick(newValue, sH->first)) return false; - setVariable(newValue, SVT_INT, target[0]); + setVariable(newValue, SVT_INT, target[3]); if (!addVarToStackQuick(newValue, sH->first)) return false; -#endif + return true; } -- cgit v1.2.3