-
Notifications
You must be signed in to change notification settings - Fork 0
/
Scenar1.class.cpp
74 lines (62 loc) · 1.85 KB
/
Scenar1.class.cpp
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
// ************************************************************************** //
// //
// ::: :::::::: //
// Scenar1.class.cpp :+: :+: :+: //
// +:+ +:+ +:+ //
// By: jmoiroux <jmoiroux@student.42.fr> +#+ +:+ +#+ //
// +#+#+#+#+#+ +#+ //
// Created: 2015/01/25 18:34:56 by jmoiroux #+# #+# //
// Updated: 2015/01/25 18:34:58 by jmoiroux ### ########.fr //
// //
// ************************************************************************** //
#include "Scenar1.class.hpp"
void Scenar1::go( void ) {
int y = 0;
int x;
glBegin(GL_POINTS);
while ( y < TAB_SIZE ) {
x = 0;
while ( x < TAB_SIZE ) {
ft42::hillColor_toShow( d, y, x );
x++;
}
y++;
}
glEnd();
ft42::oceanBorder();
usleep(100000);
}
void Scenar1::rUpWater(t_data * d, int z, int y, int x) {
if ( d->map2d[y][x].type == WATER ) // if already WATER up one more Z
d->map2d[y][x].z = z;
if ( z >= d->map2d[y][x].z ) {
d->map2d[y][x].type = WATER;
d->map2d[y][x].z = z;
}
}
void Scenar1::upWater( int z ) {
int y = 0;
int x = 0;
while ( y < TAB_SIZE ) {
x = 0;
while ( x < TAB_SIZE ) {
rUpWater(this->d, z, y, x);
x++;
}
y++;
}
}
Scenar1::Scenar1() {
this->d = getData();
this->d->toShow = this->d->map2d;
}
Scenar1::Scenar1( Scenar1 const & rSource ) {
*this = rSource;
}
Scenar1 & Scenar1::operator=( Scenar1 const & rSource ) {
if ( this != &rSource ) {
this->d = rSource.d;
}
return *this;
}
Scenar1::~Scenar1() {}