2
// -*- Mode: C++; tab-width:2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
3
// vi:tw=80:et:ts=2:sts=2
5
// -----------------------------------------------------------------------
7
// This file is part of RLVM, a RealLive virtual machine clone.
9
// -----------------------------------------------------------------------
11
// Copyright (C) 2009 Elliot Glaysher
13
// This program is free software; you can redistribute it and/or modify
14
// it under the terms of the GNU General Public License as published by
15
// the Free Software Foundation; either version 3 of the License, or
16
// (at your option) any later version.
18
// This program is distributed in the hope that it will be useful,
19
// but WITHOUT ANY WARRANTY; without even the implied warranty of
20
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
// GNU General Public License for more details.
23
// You should have received a copy of the GNU General Public License
24
// along with this program; if not, write to the Free Software
25
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
26
// -----------------------------------------------------------------------
28
#ifndef SRC_SYSTEMS_BASE_HIKSCRIPT_HPP_
29
#define SRC_SYSTEMS_BASE_HIKSCRIPT_HPP_
34
#include <boost/filesystem.hpp>
35
#include <boost/shared_ptr.hpp>
37
#include "Systems/Base/Rect.hpp"
42
// Class that parses and executes HIK files.
45
HIKScript(System& system, const boost::filesystem::path& file);
48
// Loads our data from a HIK file.
49
void loadHikFile(System& system, const boost::filesystem::path& file);
51
// Make sure all graphics data is ready to be presented to the user.
52
void EnsureUploaded();
54
// The contents of the 40000 keys which define an individual frame.
58
boost::shared_ptr<const Surface> surface;
64
// The contents of the 30000 keys. I used to call this structure Unkowns;
65
// "Animation" is a tentative name as it contains individual Frames that are
66
// played in sequence.
68
int use_multiframe_animation;
70
// The number of frames as reported by the HIK file. Used for error
74
// All frames to display.
75
std::vector<Frame> frames;
77
// IDEA: This is the animation number in the layer to move to next when
78
// all frames in this animation are played out.
83
// The sum of all |frame_length_ms| in frames.
87
// The contents of the 20000 keys.
100
// Number of unknowns as reported by the HIK file on disk.
101
int number_of_animations;
103
std::vector<Animation> animations;
107
// Returns the HIK layer data.
108
const std::vector<Layer>& layers() const { return layers_; }
109
const Size& size() const { return size_of_hik_; }
112
// Returns the current structure being operated on, throwing on logic
113
// errors. Only to be used during parsing of the file.
114
Animation& currentAnimation();
115
Layer& currentLayer();
116
Frame& currentFrame();
118
// Each graphics component in the HIK script.
119
std::vector<Layer> layers_;
121
// The number of layers as reported by the HIK file. Used for error checking.
122
int number_of_layers_;
124
// Size of the hik graphic as reported by the hik.
128
#endif // SRC_SYSTEMS_BASE_HIKSCRIPT_HPP_