[Scummvm-git-logs] scummvm master -> fc09a2da9eb0ababbaf8d8b367ae3d3bbb5f9f5d

bluegr noreply at scummvm.org
Fri Sep 4 10:06:18 UTC 2026


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .

Summary:
fc09a2da9e STARK: Save the palette when extracting textures


Commit: fc09a2da9eb0ababbaf8d8b367ae3d3bbb5f9f5d
    https://github.com/scummvm/scummvm/commit/fc09a2da9eb0ababbaf8d8b367ae3d3bbb5f9f5d
Author: Cameron Cawley (ccawley2011 at gmail.com)
Date: 2026-09-04T13:06:13+03:00

Commit Message:
STARK: Save the palette when extracting textures

Changed paths:
    engines/stark/formats/tm.cpp
    engines/stark/formats/tm.h
    engines/stark/resources/textureset.cpp


diff --git a/engines/stark/formats/tm.cpp b/engines/stark/formats/tm.cpp
index 7835715dd01..55ba4b5cd68 100644
--- a/engines/stark/formats/tm.cpp
+++ b/engines/stark/formats/tm.cpp
@@ -46,7 +46,7 @@ public:
 		delete[] _palette;
 	}
 
-	const byte *getPalette() {
+	const byte *getPalette() const {
 		return _palette;
 	}
 
@@ -117,10 +117,14 @@ Gfx::Texture *Texture::acquireTexturePointer() {
 	return texture;
 }
 
-Graphics::Surface *Texture::getSurface() const {
+const Graphics::Surface &Texture::getSurface() const {
+	return _surface;
+}
+
+const byte *Texture::getPalette() const {
 	TextureGroup *textureGroup = static_cast<TextureGroup *>(_parent);
 
-	return _surface.convertTo(Gfx::Driver::getRGBAPixelFormat(), textureGroup->getPalette());
+	return textureGroup->getPalette();
 }
 
 Gfx::TextureSet *TextureSetReader::read(ArchiveReadStream *stream) {
diff --git a/engines/stark/formats/tm.h b/engines/stark/formats/tm.h
index 05cc4a2e322..a015c1bf72c 100644
--- a/engines/stark/formats/tm.h
+++ b/engines/stark/formats/tm.h
@@ -88,8 +88,11 @@ public:
 	 */
 	Gfx::Texture *acquireTexturePointer();
 
-	/** Return a RGBA copy of the pixel data */
-	Graphics::Surface *getSurface() const;
+	/** Return a reference to the pixel data */
+	const Graphics::Surface &getSurface() const;
+
+	/** Return a pointer to the palette data */
+	const byte *getPalette() const;
 
 	// BiffObject API
 	void readData(ArchiveReadStream *stream, uint32 dataLength) override;
diff --git a/engines/stark/resources/textureset.cpp b/engines/stark/resources/textureset.cpp
index 79793573c0d..b0e35ecfeb9 100644
--- a/engines/stark/resources/textureset.cpp
+++ b/engines/stark/resources/textureset.cpp
@@ -102,14 +102,12 @@ void TextureSet::extractArchive() {
 			return;
 		}
 
-		Graphics::Surface *surface = textures[i]->getSurface();
+		const Graphics::Surface &surface = textures[i]->getSurface();
+		const byte *palette = textures[i]->getPalette();
 
-		Image::writePNG(out, *surface);
+		Image::writePNG(out, surface, palette);
 
 		out.close();
-
-		surface->free();
-		delete surface;
 	}
 
 	delete archive;




More information about the Scummvm-git-logs mailing list