ScummVM API documentation
asset_helper.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//=============================================================================
23//
24// Functions related to finding and opening game assets.
25//
26//=============================================================================
27
28#ifndef AGS_ENGINE_AC_ASSET_HELPER_H
29#define AGS_ENGINE_AC_ASSET_HELPER_H
30
31#include "common/std/memory.h"
32#include "common/std/utility.h"
33#include "ags/shared/util/string.h"
34#include "ags/shared/core/asset_manager.h"
35
36namespace AGS3 {
37
38struct PACKFILE;
39
40namespace AGS {
41namespace Shared {
42class Stream;
43} // namespace Shared
44} // namespace AGS
45
46using AGS::Shared::AssetPath;
47using AGS::Shared::Stream;
48using AGS::Shared::String;
49
50// Looks for valid asset library everywhere and returns path, or empty string if failed
51String find_assetlib(const String &filename);
52
53// Returns the path to the audio asset, considering the given bundling type
54AssetPath get_audio_clip_assetpath(int bundling_type, const String &filename);
55// Returns the path to the voice-over asset
56AssetPath get_voice_over_assetpath(const String &filename);
57
58// Custom AGS PACKFILE user object
59// TODO: it is preferrable to let our Stream define custom readable window instead,
60// keeping this as simple as possible for now (we may require a stream classes overhaul).
63 size_t asset_size = 0u;
64 size_t remains = 0u;
65};
66// Creates PACKFILE stream from AGS asset.
67// This function is supposed to be used only when you have to create Allegro
68// object, passing PACKFILE stream to constructor.
69PACKFILE *PackfileFromAsset(const AssetPath &path);
70
71} // namespace AGS3
72
73#endif
Definition: ptr.h:572
Definition: asset_manager.h:70
Definition: asset_helper.h:61
Definition: file.h:62