ScummVM API documentation
image_translation.h
1
/* ScummVM - Graphic Adventure Engine
2
*
3
* ScummVM is the legal property of its developers, whose names
4
* are too numerous to list here. Please refer to the COPYRIGHT
5
* file distributed with this source distribution.
6
*
7
* This program is free software: you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation, either version 3 of the License, or
10
* (at your option) any later version.
11
*
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
16
*
17
* You should have received a copy of the GNU General Public License
18
* along with this program. If not, see <http://www.gnu.org/licenses/>.
19
*
20
*/
21
22
#ifndef HOLLYWOOD_IMAGE_TRANSLATION_H
23
#define HOLLYWOOD_IMAGE_TRANSLATION_H
24
25
#include "common/archive.h"
26
#include "common/hash-str.h"
27
#include "common/ptr.h"
28
29
#include "hollywood/resource.h"
30
31
namespace
Hollywood {
32
33
// Applies extracted image overlays while preserving the original files on disk.
34
class
ImageTranslationArchive
:
public
Common::MemcachingCaseInsensitiveArchive
{
35
public
:
36
ImageTranslationArchive
(
Common::Archive
*archive);
37
bool
load(
const
Common::Path
&originalTextArchive);
38
39
bool
hasFile
(
const
Common::Path
&path)
const override
;
40
int
listMembers
(
Common::ArchiveMemberList
&list)
const override
;
41
const
Common::ArchiveMemberPtr
getMember
(
const
Common::Path
&path)
const override
;
42
Common::SharedArchiveContents
readContentsForPath(
const
Common::Path
&path)
const override
;
43
44
private
:
45
enum
Layout {
46
kBlocks,
47
kPixels,
48
kPalette
49
};
50
51
struct
Overlay
{
52
Common::String
source;
53
Common::String
baseName;
54
byte
chunk;
55
Layout layout;
56
byte
paletteChunk;
57
uint16 x, y;
58
};
59
60
bool
readOriginalChunk(
Common::SeekableReadStream
&file,
const
ResourceChunkTable &table,
61
uint index,
Common::Array<byte>
&data)
const
;
62
void
remapPalette(
Common::Array<byte>
&pixels,
const
Common::Array<byte>
&originalPalette,
63
const
byte
*translatedPalette)
const
;
64
bool
applyImage(
const
Overlay
&overlay,
Common::SeekableReadStream
&file,
65
const
ResourceChunkTable &table,
Common::Array<byte>
&data)
const
;
66
67
Common::Archive
*_archive;
// Owned by TextTranslation.
68
Common::StringMap
_sources;
69
Common::Array<Overlay>
_overlays;
70
};
71
72
}
// End of namespace Hollywood
73
74
#endif
// HOLLYWOOD_IMAGE_TRANSLATION_H
Common::Archive
Definition:
archive.h:141
Common::Array< byte >
Common::HashMap< String, String, IgnoreCase_Hash, IgnoreCase_EqualTo >
Common::List
Definition:
list.h:44
Common::MemcachingCaseInsensitiveArchive
Definition:
archive.h:287
Common::Path
Definition:
path.h:52
Common::SeekableReadStream
Definition:
stream.h:745
Common::SharedArchiveContents
Definition:
archive.h:242
Common::SharedPtr< ArchiveMember >
Common::String
Definition:
str.h:59
Hollywood::ImageTranslationArchive
Definition:
image_translation.h:34
Hollywood::ImageTranslationArchive::listMembers
int listMembers(Common::ArchiveMemberList &list) const override
Hollywood::ImageTranslationArchive::getMember
const Common::ArchiveMemberPtr getMember(const Common::Path &path) const override
Hollywood::ImageTranslationArchive::hasFile
bool hasFile(const Common::Path &path) const override
Overlay
Definition:
default_display_client.h:68
engines
hollywood
image_translation.h
Generated on Sun Nov 22 2026 09:25:13 for ScummVM API documentation by
1.9.4