2
Copyright (C) 2006 Parallel Realities
4
This program is free software; you can redistribute it and/or
5
modify it under the terms of the GNU General Public License
6
as published by the Free Software Foundation; either version 2
7
of the License, or (at your option) any later version.
9
This program is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13
See the GNU General Public License for more details.
15
You should have received a copy of the GNU General Public License
16
along with this program; if not, write to the Free Software
17
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21
#include "../headers.h"
26
alternativeBlend = false;
32
x1 = y1 = x2 = y2 = 0;
44
void Decal::rotate(Vector normal)
46
rotation.x = toDegrees(asin(normal.x));
47
rotation.y = toDegrees(-asin(normal.y));
48
rotation.z = toDegrees(asin(normal.z));
51
void Decal::load(Properties *props)
53
alternativeBlend = props->getInt("alternativeBlend", alternativeBlend);
54
type = props->getInt("type", type);
55
health = props->getFloat("health", health);
56
color = props->getColor("color");
57
position = props->getVector("position", position);
58
rotation = props->getVector("rotation", rotation);
59
cluster = props->getInt("cluster", cluster);
60
x1 = props->getFloat("x1", x1);
61
y1 = props->getFloat("y1", y1);
62
x2 = props->getFloat("x2", x2);
63
y2 = props->getFloat("y2", y2);
64
uv1 = props->getFloat("uv1", uv1);
65
uv2 = props->getFloat("uv2", uv2);
66
uv3 = props->getFloat("uv3", uv3);
67
uv4 = props->getFloat("uv4", uv4);
70
void Decal::save(FILE *fp)
74
props.setName("Decal");
76
props.setProperty("type", type);
77
props.setProperty("alternativeBlend", alternativeBlend);
78
props.setProperty("health", health);
79
props.setProperty("color", color);
80
props.setProperty("position", position);
81
props.setProperty("rotation", rotation);
82
props.setProperty("cluster", cluster);
83
props.setProperty("x1", x1);
84
props.setProperty("y1", y1);
85
props.setProperty("x2", x2);
86
props.setProperty("y2", y2);
87
props.setProperty("uv1", uv1);
88
props.setProperty("uv2", uv2);
89
props.setProperty("uv3", uv3);
90
props.setProperty("uv4", uv4);