4 * Riven-Wahrk - a reimplementation of the game Riven, by Cyan
5 * Copyright (C) 2009 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/>.
34 ignoreMouseUp
= false;
37 diskSets
.readFile ("disks");
38 Set::init (&diskSets
.lookup ("sets"));
41 loadStack (Stack::JSPIT
);
43 var
.loadGame ("sub.rvn");
45 card
= new Card (this, 527);
46 mouseCoor
.y
= mouseCoor
.x
= 0;
50 void Game::loadStack (Stack::Name name
) {
53 stack
= set
->loadStack (Stack::JSPIT
);
59 void Game::mouseMove (const Coor
&coorIn
) {
61 if (insideCard
) return;
63 card
->mouseMove (mouseCoor
);
67 void Game::mouseDown () {
68 if (insideCard
) return;
73 // we are at a new card, so ignore the next time we get a mouse
79 void Game::mouseUp () {
80 if (insideCard
) return;
82 ignoreMouseUp
= false;
92 void Game::findSet (Stack
*saveGame
) {
94 File
vers (saveGame
, Resource::VERS
, 1);
95 uint32_t version
= vers
.readULong (0);
97 Setting
& s
= diskSets
.lookup ("sets");
98 for (int i
=0; i
<s
.getLength(); i
++) {
99 if (version
== (uint32_t) (s
[i
]["save_ver"])) {
100 std::cout
<< "save game identified as "
101 << (const char*) s
[i
]["name"] << std::endl
;
109 void Game::loadStack (Stack::Name stack
) {
114 // have to identify which version to use.
115 // if a savegame is specified, use which ever
116 // version that requires. otherwise present a
117 // generic prompt asking to put in dvd or disk 1.
118 // do a checkAStack (if we are using cd's, copy a_spit
119 // to ~, otherwise just open the dvd's a_spit.) go to
120 // the card in save game, or go to main menu