GameApi
28
Library used by GameApi Builder tool
Loading...
Searching...
No Matches
GameApiTest.hh
Go to the documentation of this file.
1
2
void
GameApiTest
();
3
4
#include "
Effect.hh
"
5
#include "
Graph.hh
"
6
7
class
BitmapMod
8
{
9
public
:
10
virtual
void
Origo
()=0;
11
virtual
void
SetPos
(
int
x,
int
y)=0;
12
virtual
void
Move
(
int
dx,
int
dy
)=0;
13
virtual
void
Change
(
int
value)=0;
14
virtual
int
Value
()
const
=0;
15
virtual
void
SavePos
(
int
id
)=0;
16
virtual
void
LoadPos
(
int
id
)=0;
17
virtual
Pos
CurrentPos
()
const
=0;
18
};
19
20
class
DepMod
21
{
22
public
:
23
virtual
void
Value
(
int
i)=0;
24
virtual
void
Func
(
int
i1,
int
i2)=0;
25
};
26
/*
27
void FloodFill(BitmapMod &m, int old_tile, int new_tile)
28
{
29
std::vector<Pos> p;
30
Pos curr = m.CurrentPos();
31
p.push_back(curr);
32
while(!p.empty()) {
33
Pos pos = p.back();
34
p.pop_back();
35
m.SetPos(pos.x, pos.y);
36
if (m.Value() == old_tile)
37
{
38
m.Change(new_tile);
39
Pos px1 = { pos.x-1, pos.y };
40
Pos px2 = { pos.x+1, pos.y };
41
Pos py1 = { pos.x, pos.y-1 };
42
Pos py2 = { pos.x, pos.y+1 };
43
p.push_back(px1);
44
p.push_back(px2);
45
p.push_back(py1);
46
p.push_back(py2);
47
}
48
}
49
}
50
*/
51
52
void
Square
(
BitmapMod
&m,
53
int
corner_tl,
int
middle_t,
int
corner_tr,
54
int
middle_l,
int
middle_r,
55
int
corner_bl,
int
middle_b,
int
corner_br,
56
int
width,
int
height
)
57
{
58
m.
Change
(corner_tl);
59
m.
SavePos
(0);
60
for
(
int
i=1;i<width-1;i++)
61
{
62
m.
Move
(1,0);
63
m.
Change
(middle_t);
64
}
65
m.
Move
(1,0);
66
m.
Change
(corner_tr);
67
m.
LoadPos
(0);
68
for
(
int
i=1;i<
height
-1;i++)
69
{
70
m.
Move
(0,1);
71
m.
Change
(middle_l);
72
m.
Move
(width,0);
73
m.
Change
(middle_r);
74
m.
Move
(-width,0);
75
}
76
m.
Move
(0,1);
77
m.
Change
(corner_bl);
78
for
(
int
i=1;i<width-1;i++)
79
{
80
m.
Move
(1,0);
81
m.
Change
(middle_t);
82
}
83
m.
Move
(1,0);
84
m.
Change
(corner_br);
85
}
86
87
void
Square
(
DepMod
&m,
int
v)
88
{
89
m.
Value
(v+0);
90
m.
Value
(v+1);
91
m.
Value
(v+2);
92
m.
Value
(v+3);
93
m.
Func
(v+0,v+1);
94
m.
Func
(v+1,v+2);
95
m.
Func
(v+0,v+3);
96
m.
Func
(v+3,v+2);
97
}
Effect.hh
Square
void Square(BitmapMod &m, int corner_tl, int middle_t, int corner_tr, int middle_l, int middle_r, int corner_bl, int middle_b, int corner_br, int width, int height)
Definition
GameApiTest.hh:52
GameApiTest
void GameApiTest()
Definition
GameApiTest.cc:48
dy
size dy
Definition
GameApi_gui.cc:1727
Graph.hh
BitmapMod
Definition
GameApiTest.hh:8
BitmapMod::SavePos
virtual void SavePos(int id)=0
BitmapMod::SetPos
virtual void SetPos(int x, int y)=0
BitmapMod::Origo
virtual void Origo()=0
BitmapMod::Change
virtual void Change(int value)=0
BitmapMod::Move
virtual void Move(int dx, int dy)=0
BitmapMod::LoadPos
virtual void LoadPos(int id)=0
BitmapMod::CurrentPos
virtual Pos CurrentPos() const =0
BitmapMod::Value
virtual int Value() const =0
DepMod
Definition
GameApiTest.hh:21
DepMod::Func
virtual void Func(int i1, int i2)=0
DepMod::Value
virtual void Value(int i)=0
height
line height
Definition
meshpage.php:3536
Pos
Definition
test.cpp:10
GameApiTest.hh
Generated by
1.15.0