Repository navigation
Expand file tree
/
Copy pathmisc.cc
More file actions
87 lines (75 loc) · 1.98 KB
/
Copy pathmisc.cc
File metadata and controls
87 lines (75 loc) · 1.98 KB
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
/* -*- Mode: C++; c-basic-offset: 2; tab-width: 2; indent-tabs-mode: nil -*-
*
* Quadra, an action puzzle game
* Copyright (C) 1998-2000 Ludus Design
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "misc.h"
#include "input.h"
#include "random.h"
#include "sons.h"
#include "main.h"
#include "global.h"
Wait_time::Wait_time(int del, bool force) {
force_wait = force;
delay = del;
}
void Wait_time::step() {
if(!force_wait)
Wait_event::step();
delay--;
if(delay < 0 || quitting)
ret();
}
void Wait_event::step() {
if(ecran)
ecran->do_frame();
if(input->last_keysym.sym != SDLK_UNKNOWN || (ecran && ecran->clicked)) {
input->clear_last_keysym();
ret();
}
}
Fade_to::Fade_to(const Palette& dst, const Palette& src, int nframe) {
fad = new Fade(dst, src, nframe);
}
Fade_to::~Fade_to() {
delete fad;
}
void Fade_to::step() {
if(quitting) {
ret();
return;
}
time_control = TIME_FREEZE; // always fade the sync with the display
if(fad->step())
ret();
fad->set();
}
void Fade_in::init() {
Fade_to::init();
sons.fadein->play(-400, 0, 11000+ugs_random.rnd(511));
}
void Fade_out::init() {
Fade_to::init();
sons.fadeout->play(-400, 0, 22000+ugs_random.rnd(511));
}
Setpalette::Setpalette(const Palette& p): pal(p) {
}
void Setpalette::init() {
Module::init();
pal.set();
ret();
}