redid set handling, again. did other stuff
[riven-wahrk.git] / src / stack.cpp
blobb67f5273d83560a01d521202206ed6a2d64b1fd1
2 /*
4 * Riven-Wahrk - a reimplementation of the game Riven, by Cyan
5 * Copyright (C) 2009-2010 Tyler Genter <tylergenter@gmail.com>
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.
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.
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/>.
22 #include "mohawk.h"
23 #include "set.h"
24 #include "stack.h"
26 using namespace riven;
29 stack_t *riven::game_stack = NULL;
31 void mhk_group_t::load (std::vector<std::string> &files) {
33 std::vector<std::string>::iterator iter;
35 mohawks.reserve (files.size ());
37 for (iter = files.begin(); iter != files.end(); ++iter)
38 mohawks.push_back (new mohawk_t (*iter));
42 mhk_group_t::mhk_group_t (const std::string &path) {
44 mohawks.push_back (new mohawk_t (path));
49 void stack_t::choose_set () {
51 game_stack = new stack_t;
53 set::init ();
58 void stack_t::load_stack (unsigned which) {
60 std::vector<std::string> files;
61 set::get_stack_files (which, files);
63 for (int i=0; i<files.size(); i++)
64 printf ("%s\n", files[i].c_str());
66 game_stack->which = which;
67 game_stack->load (files);