[Scummvm-git-logs] scummvm master -> 641d03fc0df5ca079872ffe4305b9ce13e7c99d1

OMGPizzaGuy noreply at scummvm.org
Sat Dec 10 15:58:12 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:
641d03fc0d ULTIMA8: Add mouse shape to the shape viewer


Commit: 641d03fc0df5ca079872ffe4305b9ce13e7c99d1
    https://github.com/scummvm/scummvm/commit/641d03fc0df5ca079872ffe4305b9ce13e7c99d1
Author: Matthew Jimenez (matthew.jimenez at outlook.com)
Date: 2022-12-10T09:57:54-06:00

Commit Message:
ULTIMA8: Add mouse shape to the shape viewer

Changed paths:
  A engines/ultima/ultima8/graphics/mouse_shape_archive.h
    engines/ultima/ultima8/games/game_data.h
    engines/ultima/ultima8/gumps/shape_viewer_gump.cpp


diff --git a/engines/ultima/ultima8/games/game_data.h b/engines/ultima/ultima8/games/game_data.h
index 8616e4da9cd..9dbb56deeb5 100644
--- a/engines/ultima/ultima8/games/game_data.h
+++ b/engines/ultima/ultima8/games/game_data.h
@@ -76,7 +76,7 @@ public:
 	GumpShapeArchive *getGumps() const {
 		return _gumps;
 	}
-	const Shape *getMouse() const {
+	Shape *getMouse() const {
 		return _mouse;
 	}
 	MusicFlex *getMusic() const {
diff --git a/engines/ultima/ultima8/graphics/mouse_shape_archive.h b/engines/ultima/ultima8/graphics/mouse_shape_archive.h
new file mode 100644
index 00000000000..bb7f2a8eafc
--- /dev/null
+++ b/engines/ultima/ultima8/graphics/mouse_shape_archive.h
@@ -0,0 +1,56 @@
+/* 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 ULTIMA8_GRAPHICS_MOUSESHAPEARCHIVE_H
+#define ULTIMA8_GRAPHICS_MOUSESHAPEARCHIVE_H
+
+#include "ultima/ultima8/graphics/shape_archive.h"
+
+namespace Ultima {
+namespace Ultima8 {
+
+// Fake archive class for mouse shape in the shape viewer
+// TODO - consider using this in GameData and owning the shape
+class MouseShapeArchive : public ShapeArchive {
+public:
+	MouseShapeArchive(uint16 id, Palette *pal = 0,
+					 const ConvertShapeFormat *format = 0)
+		: ShapeArchive(id, pal, format) {}
+	MouseShapeArchive(Shape *shape, uint16 id, Palette *pal = 0,
+					  const ConvertShapeFormat *format = 0)
+		: ShapeArchive(id, pal, format) {
+		_shapes.push_back(shape);
+		_count = 1;
+	}
+	~MouseShapeArchive() override {
+		_shapes.clear();
+	}
+
+	void cache(uint32 shapenum) override {}
+	void uncache(uint32 shapenum) override {}
+	bool isCached(uint32 shapenum) const override { return true; }
+};
+
+
+} // End of namespace Ultima8
+} // End of namespace Ultima
+
+#endif
diff --git a/engines/ultima/ultima8/gumps/shape_viewer_gump.cpp b/engines/ultima/ultima8/gumps/shape_viewer_gump.cpp
index e475a686a33..c4b8e8636c4 100644
--- a/engines/ultima/ultima8/gumps/shape_viewer_gump.cpp
+++ b/engines/ultima/ultima8/gumps/shape_viewer_gump.cpp
@@ -36,6 +36,7 @@
 #include "ultima/ultima8/graphics/fonts/font_shape_archive.h"
 #include "ultima/ultima8/graphics/main_shape_archive.h"
 #include "ultima/ultima8/graphics/gump_shape_archive.h"
+#include "ultima/ultima8/graphics/mouse_shape_archive.h"
 
 #include "ultima/ultima8/filesys/file_system.h"
 #include "ultima/ultima8/convert/u8/convert_shape_u8.h"
@@ -296,6 +297,9 @@ void ShapeViewerGump::U8ShapeViewer() {
 	archives.push_back(ShapeArchiveEntry("gumps", gamedata->getGumps()));
 	archives.push_back(ShapeArchiveEntry("fonts", gamedata->getFonts()));
 
+	ShapeArchive *mouseShapes = new MouseShapeArchive(gamedata->getMouse(), GameData::OTHER);
+	archives.push_back(ShapeArchiveEntry("mouse", mouseShapes, DisposeAfterUse::YES));
+
 	FileSystem *filesys = FileSystem::get_instance();
 	Common::SeekableReadStream *eintro = filesys->ReadFile("static/eintro.skf");
 	if (eintro) {




More information about the Scummvm-git-logs mailing list