blob: 969b979847d0edb44068f54ac8fb54ad057ecfac (
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
|
/*
This file is part of Minitrem.
Minitrem 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.
Minitrem 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 Minitrem. If not, see <http://www.gnu.org/licenses/>.
*/
#include "game.hpp"
namespace game {
pseudostate_t::pseudostate_t(sf::RenderWindow *window_)
{
pimpl = new state_t();
pimpl->interface.window = window_;
pimpl->interface.game = pimpl;
}
pseudostate_t::~pseudostate_t(void)
{
delete pimpl;
}
void pseudostate_t::start(void)
{
pimpl->start();
}
void pseudostate_t::stop(void)
{
pimpl->stop();
}
void pseudostate_t::tick(ntime_t time, double dt)
{
pimpl->tick(time);
pimpl->interface.tick(dt);
}
world::world_t *pseudostate_t::get_world(void)
{
return &pimpl->world;
}
double pseudostate_t::get_render_time(void)
{
return pimpl->now;
}
void pseudostate_t::render_interface_to(render::state_t *render)
{
pimpl->interface.render_to(render);
pimpl->compute_ambience();
audio::update(pimpl->interface.camera_3d, pimpl->paused);
}
}
|