3 * Riven-Wahrk - a reimplementation of the game Riven, by Cyan
4 * Copyright (C) 2010 Tyler Genter <tylergenter@gmail.com>
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
35 // true if this file needs to be copied to the hard drive
36 unsigned char install
;
37 // the path to the file, from the root of the disk
51 #define make_set(stacks) { \
52 (set_t::stack_t[]) { \
56 (set_t::stack_t::file_t*) NULL, \
57 (set_t::stack_t::file_t*) NULL \
62 #define make_stack(which, files, waves) { \
64 (set_t::stack_t::file_t[]) { \
66 {0, 0, (char*) NULL }}, \
67 (set_t::stack_t::file_t[]) { \
69 {0, 0, (char*) NULL }} \
72 #define make_file(disk,install,path) { disk, install, path },
74 static set_t
*sets
= (set_t
[]) {
79 make_stack( stack_t::ASPIT
,
80 make_file(1, 0, "Data/a_Data.MHK"),
81 make_file(1, 0, "ASSETS1/a_Sounds.MHK"))
82 make_stack( stack_t::BSPIT
,
83 make_file(1, 0, "Data/b_Data.MHK"),
84 make_file(1, 0, "ASSETS1/b_Sounds.MHK"))
85 make_stack (stack_t::GSPIT
,
86 make_file(1, 0, "Data/g_Data.MHK"),
87 make_file(1, 0, "ASSETS1/g_Sounds.MHK"))
88 make_stack( stack_t::JSPIT
,
89 make_file(1, 0, "Data/j_Data1.MHK")
90 make_file(1, 0, "Data/j_Data2.MHK"),
91 make_file(1, 0, "ASSETS1/j_Sounds.MHK"))
92 make_stack( stack_t::OSPIT
,
93 make_file(1, 0, "Data/o_Data.MHK"),
94 make_file(1, 0, "ASSETS1/o_Sounds.MHK"))
95 make_stack( stack_t::PSPIT
,
96 make_file(1, 0, "Data/p_Data.MHK"),
97 make_file(1, 0, "ASSETS1/p_Sounds.MHK"))
98 make_stack( stack_t::RSPIT
,
99 make_file(1, 0, "Data/r_Data.MHK"),
100 make_file(1, 0, "ASSETS1/r_Sounds.MHK"))
101 make_stack( stack_t::TSPIT
,
102 make_file(1, 0, "Data/t_Data1.MHK")
103 make_file(1, 0, "Data/t_Data2.MHK"),
104 make_file(1, 0, "Data/t_Sounds.MHK"))
110 (set_t::stack_t
*) NULL
114 static set_t
*current_set
;
119 current_set
= &sets
[0];
124 void set::get_stack_files (
125 unsigned which_stack
,
126 std::vector
<std::string
> &files
) {
128 // find the set_t::stack_t
129 set_t::stack_t
*stack
= current_set
->stacks
;
132 if (stack
->which
== which_stack
)
136 } while (stack
->files
);
138 std::vector
<std::string
> disks
;
142 for (int i
=0; i
<disks
.size(); i
++) {
145 for (set_t::stack_t::file_t
*file
= stack
->files
; file
->path
; file
++) {
147 std::string path
= find_file (disks
[i
], std::string (file
->path
));
148 if (path
.length() == 0)
151 files
.push_back (path
);
155 if (files
.size() != 0)
163 void set::get_stack_sound_files (unsigned stack
, std::vector
<std::string
> &files
) {