aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/gfx/gfx_res_options.h
blob: a595c56606b53b67551eb7d5bb17a11e9753f1e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
/* 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 2
 * 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, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 *
 * $URL$
 * $Id$
 *
 */

#ifndef SCI_GFX_GFX_RES_OPTIONS_H
#define SCI_GFX_GFX_RES_OPTIONS_H

#ifdef CUSTOM_GRAPHICS_OPTIONS

#include "sci/sci.h"
#include "sci/gfx/gfx_resource.h"
#include "sci/gfx/gfx_resmgr.h"

namespace Sci {
/** @name Configuration options for per-resource customisations */
/** @{ */

struct gfx_res_pattern_t {
	int min, max;
};

/**
 * GFX resource assignments.
 */
struct gfx_res_assign_t {
	union {
		struct {
			int colors_nr;
			gfx_pixmap_color_t *colors;
		} palette;
	} assign;
};


/**
 * GFX resource modifications/
 */
struct gfx_res_conf_t {
	int type; /**< Resource type-- only one allowed */

	/* If any of the following is 0, it means that there is no restriction.
	** Otherwise, one of the patterns associated with them must match. */
	int patterns_nr; /**< Number of patterns (only 'view' patterns for views) */
	int loops_nr, cels_nr; /**< Number of loop/cel patterns, for views only.
			       ** For pics, loops_nr identifies the palette. */

	gfx_res_pattern_t *patterns;

	union {
		gfx_res_assign_t assign;
		byte factor[3]; /**< divide by 16 to retrieve factor */
	} conf; /**< The actual configuration */

	gfx_res_conf_t *next;
};


typedef gfx_res_conf_t *gfx_res_conf_p_t;

struct gfx_res_fullconf_t {
	gfx_res_conf_p_t assign[GFX_RESOURCE_TYPES_NR];
	gfx_res_conf_p_t mod[GFX_RESOURCE_TYPES_NR];
};


struct gfx_options_t;

/**
 * Configures a graphical pixmap according to config options.
 *
 * Modifies pxm as considered appropriate by configuration options. Does
 * not do anything in colour index mode.
 *
 * @param[in] options	The options according to which configuration
 * 						should be performed
 * @param[in] pxm		The pixmap to configure
 * @return				0 on success, non-zero otherwise
 */
int gfx_get_res_config(gfx_options_t *options, gfx_pixmap_t *pxm);

/** @} */
} // End of namespace Sci

#endif

#endif // SCI_GFX_GFX_RES_OPTIONS_H