[Scummvm-git-logs] scummvm master -> 8f5fc51915f50588b728c56e3f29e03ab3821e7a
neuromancer
noreply at scummvm.org
Sat Jan 8 18:08:33 UTC 2022
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
8f5fc51915 HYPNO: added some code to handle changing color palettes in spider
Commit: 8f5fc51915f50588b728c56e3f29e03ab3821e7a
https://github.com/scummvm/scummvm/commit/8f5fc51915f50588b728c56e3f29e03ab3821e7a
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-01-08T19:07:55+01:00
Commit Message:
HYPNO: added some code to handle changing color palettes in spider
Changed paths:
engines/hypno/actions.cpp
engines/hypno/hypno.h
engines/hypno/scene.cpp
diff --git a/engines/hypno/actions.cpp b/engines/hypno/actions.cpp
index 8261d598347..adb79d44d7b 100644
--- a/engines/hypno/actions.cpp
+++ b/engines/hypno/actions.cpp
@@ -58,6 +58,9 @@ void HypnoEngine::runMenu(Hotspots hs) {
_intros[cutscene->path] = true;
}
break;
+ case PaletteAction:
+ runPalette((Palette *)action);
+ break;
default:
break;
@@ -110,6 +113,22 @@ void HypnoEngine::runMice(Mice *a) {
changeCursor(a->path, a->index);
}
+void HypnoEngine::runPalette(Palette *a) {
+ return; // remove when palette are working
+ Common::File *file = new Common::File();
+ Common::String path = convertPath(a->path);
+ if (!_prefixDir.empty())
+ path = _prefixDir + "/" + path;
+
+ if (!file->open(path))
+ error("unable to find video file %s", path.c_str());
+
+ debugC(1, kHypnoDebugScene, "Loading palette from %s", path.c_str());
+ byte *videoPalette = (byte*) malloc(file->size());
+ file->read(videoPalette, file->size());
+ g_system->getPaletteManager()->setPalette(videoPalette+8, 0, 256);
+}
+
void HypnoEngine::runEscape() {
_nextHotsToRemove = stack.back();
_nextSequentialVideoToPlay = _escapeSequentialVideoToPlay;
diff --git a/engines/hypno/hypno.h b/engines/hypno/hypno.h
index 29e9dd6790f..c26851312f2 100644
--- a/engines/hypno/hypno.h
+++ b/engines/hypno/hypno.h
@@ -32,6 +32,7 @@
#include "graphics/font.h"
#include "graphics/fontman.h"
#include "graphics/managed_surface.h"
+#include "graphics/palette.h"
#include "hypno/grammar.h"
#include "hypno/libfile.h"
@@ -159,6 +160,7 @@ public:
void runQuit(Quit *a);
void runCutscene(Cutscene *a);
void runPlay(Play *a);
+ void runPalette(Palette *a);
void runAmbient(Ambient *a);
void runWalN(WalN *a);
bool runGlobal(Global *a);
diff --git a/engines/hypno/scene.cpp b/engines/hypno/scene.cpp
index cbc8eafd74a..c7d96fe636c 100644
--- a/engines/hypno/scene.cpp
+++ b/engines/hypno/scene.cpp
@@ -186,7 +186,7 @@ void HypnoEngine::clickedHotspot(Common::Point mousePos) {
runAmbient((Ambient *)action);
break;
case PaletteAction:
- debugC(1, kHypnoDebugScene, "runPalette unimplemented");
+ runPalette((Palette *)action);
break;
default:
More information about the Scummvm-git-logs
mailing list