[Scummvm-git-logs] scummvm master -> ce7af32c5e96969e78eb8e73bacaf213bfb26530
sev-
noreply at scummvm.org
Fri Jan 27 22:24:52 UTC 2023
This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
b8b0490f53 DIRECTOR: Added Porta XCMD stub used in the7colors
55e75be7a8 DIRECTOR: Renamed constants in accordance with our naming conventions
ce7af32c5e DIRECTOR: Speed up palette transitions on fewframesonly
Commit: b8b0490f53a0792a5bf84dd5587ef9a7ff1855dc
https://github.com/scummvm/scummvm/commit/b8b0490f53a0792a5bf84dd5587ef9a7ff1855dc
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2023-01-27T22:53:15+01:00
Commit Message:
DIRECTOR: Added Porta XCMD stub used in the7colors
Changed paths:
A engines/director/lingo/xlibs/porta.cpp
A engines/director/lingo/xlibs/porta.h
engines/director/lingo/lingo-object.cpp
engines/director/module.mk
diff --git a/engines/director/lingo/lingo-object.cpp b/engines/director/lingo/lingo-object.cpp
index ede5d79d3be..1f7711b8aa8 100644
--- a/engines/director/lingo/lingo-object.cpp
+++ b/engines/director/lingo/lingo-object.cpp
@@ -63,6 +63,7 @@
#include "director/lingo/xlibs/orthoplayxobj.h"
#include "director/lingo/xlibs/palxobj.h"
#include "director/lingo/xlibs/popupmenuxobj.h"
+#include "director/lingo/xlibs/porta.h"
#include "director/lingo/xlibs/qtmovie.h"
#include "director/lingo/xlibs/registercomponent.h"
#include "director/lingo/xlibs/serialportxobj.h"
@@ -150,6 +151,7 @@ static struct XLibProto {
{ BarakeObj::fileNames, BarakeObj::open, BarakeObj::close, kXObj, 400 }, // D4
{ CDROMXObj::fileNames, CDROMXObj::open, CDROMXObj::close, kXObj, 200 }, // D2
{ DarkenScreen::fileNames, DarkenScreen::open, DarkenScreen::close, kXObj, 300 }, // D3
+ { DeveloperStack::fileNames, DeveloperStack::open, DeveloperStack::close, kXObj, 300 }, // D3
{ Ednox::fileNames, Ednox::open, Ednox::close, kXObj, 300 }, // D3
{ FileExists::fileNames, FileExists::open, FileExists::close, kXObj, 300 }, // D3
{ FileIO::fileNames, FileIO::open, FileIO::close, kXObj | kXtraObj, 200 }, // D2
@@ -170,11 +172,11 @@ static struct XLibProto {
{ OrthoPlayXObj::fileNames, OrthoPlayXObj::open, OrthoPlayXObj::close, kXObj, 400 }, // D4
{ PalXObj::fileNames, PalXObj::open, PalXObj::close, kXObj, 400 }, // D4
{ PopUpMenuXObj::fileNames, PopUpMenuXObj::open, PopUpMenuXObj::close, kXObj, 200 }, // D2
+ { Porta::fileNames, Porta::open, Porta::close, kXObj, 300 }, // D3
{ QTMovie::fileNames, QTMovie::open, QTMovie::close, kXObj, 400 }, // D4
{ RearWindowXObj::fileNames, RearWindowXObj::open, RearWindowXObj::close, kXObj, 400 }, // D4
{ RegisterComponent::fileNames, RegisterComponent::open, RegisterComponent::close, kXObj, 400 }, // D4
{ SerialPortXObj::fileNames, SerialPortXObj::open, SerialPortXObj::close, kXObj, 200 }, // D2
- { DeveloperStack::fileNames, DeveloperStack::open, DeveloperStack::close, kXObj, 300 }, // D3
{ SoundJam::fileNames, SoundJam::open, SoundJam::close, kXObj, 400 }, // D4
{ SpaceMgr::fileNames, SpaceMgr::open, SpaceMgr::close, kXObj, 400 }, // D4
{ VolumeList::fileNames, VolumeList::open, VolumeList::close, kXObj, 300 }, // D3
diff --git a/engines/director/lingo/xlibs/porta.cpp b/engines/director/lingo/xlibs/porta.cpp
new file mode 100644
index 00000000000..86ccfc0e036
--- /dev/null
+++ b/engines/director/lingo/xlibs/porta.cpp
@@ -0,0 +1,64 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "director/director.h"
+#include "director/lingo/xlibs/porta.h"
+
+/*************************************
+ *
+ * XCMD: Porta
+ *
+ * USED IN:
+ * the7colors: The Seven Colors: Legend of PSYã»S City
+ *
+ * Used in Piano mini-game
+ *
+ *************************************/
+
+namespace Director {
+
+const char *Porta::xlibName = "Porta";
+const char *Porta::fileNames[] = {
+ "Porta",
+ "PortaXCMD.rsrc",
+ nullptr
+};
+
+static BuiltinProto builtins[] = {
+ { "Porta", Porta::b_porta, 1, 1, 300, HBLTIN },
+ { nullptr, nullptr, 0, 0, 0, VOIDSYM }
+};
+
+void Porta::open(int type) {
+ g_lingo->initBuiltIns(builtins);
+}
+
+void Porta::close(int type) {
+ g_lingo->cleanupBuiltIns(builtins);
+}
+
+void Porta::b_porta(int nargs) {
+ int mode = g_lingo->pop().asInt();
+
+ debug(5, "LB::b_porta: mode: %d", mode);
+}
+
+} // End of namespace Director
diff --git a/engines/director/lingo/xlibs/porta.h b/engines/director/lingo/xlibs/porta.h
new file mode 100644
index 00000000000..97b42c1bf19
--- /dev/null
+++ b/engines/director/lingo/xlibs/porta.h
@@ -0,0 +1,41 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef DIRECTOR_LINGO_XLIBS_PORTA_H
+#define DIRECTOR_LINGO_XLIBS_PORTA_H
+
+namespace Director {
+
+namespace Porta {
+
+extern const char *xlibName;
+extern const char *fileNames[];
+
+void open(int type);
+void close(int type);
+
+void b_porta(int nargs);
+
+} // End of namespace Porta
+
+} // End of namespace Director
+
+#endif
diff --git a/engines/director/module.mk b/engines/director/module.mk
index eae3e9a66a1..6578bfc5663 100644
--- a/engines/director/module.mk
+++ b/engines/director/module.mk
@@ -66,6 +66,7 @@ MODULE_OBJS = \
lingo/xlibs/orthoplayxobj.o \
lingo/xlibs/palxobj.o \
lingo/xlibs/popupmenuxobj.o \
+ lingo/xlibs/porta.o \
lingo/xlibs/qtmovie.o \
lingo/xlibs/registercomponent.o \
lingo/xlibs/serialportxobj.o \
Commit: 55e75be7a83dea0062382aab5a73f7d972e176c1
https://github.com/scummvm/scummvm/commit/55e75be7a83dea0062382aab5a73f7d972e176c1
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2023-01-27T23:21:18+01:00
Commit Message:
DIRECTOR: Renamed constants in accordance with our naming conventions
Changed paths:
engines/director/palette-fade.h
engines/director/score.cpp
diff --git a/engines/director/palette-fade.h b/engines/director/palette-fade.h
index 3260468ef30..c6ab6ed41e3 100644
--- a/engines/director/palette-fade.h
+++ b/engines/director/palette-fade.h
@@ -19,7 +19,7 @@
*
*/
-static byte whitePalette[768] = {
+static byte kWhitePalette[768] = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, // 0 (0x00)
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, // 4 (0x04)
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, // 8 (0x08)
@@ -86,7 +86,7 @@ static byte whitePalette[768] = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00 // 252 (0xfc)
};
-static byte blackPalette[768] = {
+static byte kBlackPalette[768] = {
0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 0 (0x00)
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 4 (0x04)
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 8 (0x08)
@@ -157,7 +157,7 @@ static byte blackPalette[768] = {
// accuracy could be improved.
// Regression formula used:
// [round(31.78738613 + -1.934614248*i + 0.03033348561*i*i) for i in range(1, 31)]
-static int fadeColorFrames[30] = {
+static int kFadeColorFrames[30] = {
30, 28, 26, 25, 23, 21, 20, 18, 17, 15, 14,
13, 12, 11, 10, 9, 8, 7, 6, 5,
5, 4, 3, 3, 2, 2, 2, 1, 1, 1
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index 42a193e3ca4..9667ba2478f 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -645,7 +645,7 @@ bool Score::renderPrePaletteCycle(uint16 frameId, RenderMode mode) {
int frameRate = CLIP<int>(_frames[frameId]->_palette.speed, 1, 30);
int frameDelay = 1000/60;
- int fadeFrames = fadeColorFrames[frameRate - 1];
+ int fadeFrames = kFadeColorFrames[frameRate - 1];
byte calcPal[768];
if (_frames[frameId]->_palette.normal) {
@@ -676,10 +676,10 @@ bool Score::renderPrePaletteCycle(uint16 frameId, RenderMode mode) {
byte *fadePal = nullptr;
if (_frames[frameId]->_palette.fadeToBlack) {
// Fade everything except color index 0 to black
- fadePal = blackPalette;
+ fadePal = kBlackPalette;
} else if (_frames[frameId]->_palette.fadeToWhite) {
// Fade everything except color index 255 to white
- fadePal = whitePalette;
+ fadePal = kWhitePalette;
} else {
// Shouldn't reach here
return false;
@@ -831,10 +831,10 @@ void Score::renderPaletteCycle(uint16 frameId, RenderMode mode) {
byte *fadePal = nullptr;
if (_frames[frameId]->_palette.fadeToBlack) {
// Fade everything except color index 0 to black
- fadePal = blackPalette;
+ fadePal = kBlackPalette;
} else if (_frames[frameId]->_palette.fadeToWhite) {
// Fade everything except color index 255 to white
- fadePal = whitePalette;
+ fadePal = kWhitePalette;
} else {
// Shouldn't reach here
return;
@@ -874,17 +874,17 @@ void Score::renderPaletteCycle(uint16 frameId, RenderMode mode) {
byte *fadePal = nullptr;
if (_frames[frameId]->_palette.fadeToBlack) {
// Fade everything except color index 0 to black
- fadePal = blackPalette;
+ fadePal = kBlackPalette;
} else if (_frames[frameId]->_palette.fadeToWhite) {
// Fade everything except color index 255 to white
- fadePal = whitePalette;
+ fadePal = kWhitePalette;
} else {
// Shouldn't reach here
return;
}
int frameRate = CLIP<int>(_frames[frameId]->_palette.speed, 1, 30);
int frameDelay = 1000/60;
- int fadeFrames = fadeColorFrames[frameRate - 1];
+ int fadeFrames = kFadeColorFrames[frameRate - 1];
// Wait for a fixed time
g_director->setPalette(fadePal, 256);
Commit: ce7af32c5e96969e78eb8e73bacaf213bfb26530
https://github.com/scummvm/scummvm/commit/ce7af32c5e96969e78eb8e73bacaf213bfb26530
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2023-01-27T23:24:22+01:00
Commit Message:
DIRECTOR: Speed up palette transitions on fewframesonly
Changed paths:
engines/director/score.cpp
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index 9667ba2478f..ac337a6e470 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -644,6 +644,10 @@ bool Score::renderPrePaletteCycle(uint16 frameId, RenderMode mode) {
PaletteV4 *destPal = g_director->getPalette(resolvePaletteId(currentPalette));
int frameRate = CLIP<int>(_frames[frameId]->_palette.speed, 1, 30);
+
+ if (debugChannelSet(-1, kDebugFewFramesOnly))
+ frameRate = 30;
+
int frameDelay = 1000/60;
int fadeFrames = kFadeColorFrames[frameRate - 1];
byte calcPal[768];
@@ -755,6 +759,10 @@ void Score::renderPaletteCycle(uint16 frameId, RenderMode mode) {
int speed = _frames[frameId]->_palette.speed;
if (speed == 0)
return;
+
+ if (debugChannelSet(-1, kDebugFewFramesOnly))
+ speed = 30;
+
// 30 (the maximum) is actually unbounded
int delay = speed == 30 ? 10 : 1000 / speed;
if (_frames[frameId]->_palette.colorCycling) {
@@ -883,6 +891,10 @@ void Score::renderPaletteCycle(uint16 frameId, RenderMode mode) {
return;
}
int frameRate = CLIP<int>(_frames[frameId]->_palette.speed, 1, 30);
+
+ if (debugChannelSet(-1, kDebugFewFramesOnly))
+ frameRate = 30;
+
int frameDelay = 1000/60;
int fadeFrames = kFadeColorFrames[frameRate - 1];
More information about the Scummvm-git-logs
mailing list