added moon + mouse X control and no more Y mouse control
This commit is contained in:
parent
33d32936b2
commit
82b0f7df59
90
window.c
90
window.c
@ -35,6 +35,7 @@ static surface_t * _sun = NULL;
|
|||||||
static surface_t * _planet[9] = {NULL, NULL, NULL,
|
static surface_t * _planet[9] = {NULL, NULL, NULL,
|
||||||
NULL, NULL, NULL,
|
NULL, NULL, NULL,
|
||||||
NULL, NULL, NULL};
|
NULL, NULL, NULL};
|
||||||
|
static surface_t * _moon = NULL;
|
||||||
|
|
||||||
/* des variable d'états pour activer/désactiver des options de rendu */
|
/* des variable d'états pour activer/désactiver des options de rendu */
|
||||||
static int _use_tex = 1, _use_color = 0, _use_lighting = 1;
|
static int _use_tex = 1, _use_color = 0, _use_lighting = 1;
|
||||||
@ -50,7 +51,7 @@ static cam_t _cam = {0, 1.0f, 10, 0};
|
|||||||
|
|
||||||
static float _v = 0.1f;
|
static float _v = 0.1f;
|
||||||
|
|
||||||
static int _wW = 1200, _wH = 1000;
|
static int _wW = 1200, _wH = 900;
|
||||||
static int _xm = 400, _ym = 300;
|
static int _xm = 400, _ym = 300;
|
||||||
|
|
||||||
static int _pause = 0;
|
static int _pause = 0;
|
||||||
@ -89,10 +90,11 @@ int main(int argc, char ** argv) {
|
|||||||
/*!\brief init de nos données, spécialement les trois surfaces
|
/*!\brief init de nos données, spécialement les trois surfaces
|
||||||
* utilisées dans ce code */
|
* utilisées dans ce code */
|
||||||
void init(void) {
|
void init(void) {
|
||||||
uint id[9], sun_id, i;
|
uint id[9], sun_id, i, moon_id;
|
||||||
/*vec4 g = {0, 1, 0, 1};*/
|
/*vec4 g = {0, 1, 0, 1};*/
|
||||||
/* on créé nos trois type de surfaces */
|
/* on créé nos trois type de surfaces */
|
||||||
_sun = mkSphere(12, 12); /*ça fait 12x12x2 trianles !*/
|
_sun = mkSphere(12, 12); /*ça fait 12x12x2 trianles !*/
|
||||||
|
_moon = mkSphere(12, 12);
|
||||||
/* on change les couleurs de surfaces */
|
/* on change les couleurs de surfaces */
|
||||||
/*_sun->dcolor = g; */
|
/*_sun->dcolor = g; */
|
||||||
for(i = 0; i < 9; ++i) {
|
for(i = 0; i < 9; ++i) {
|
||||||
@ -108,23 +110,28 @@ void init(void) {
|
|||||||
id[6] = getTexFromBMP("images/2k-uranus.bmp");
|
id[6] = getTexFromBMP("images/2k-uranus.bmp");
|
||||||
id[7] = getTexFromBMP("images/2k-neptune.bmp");
|
id[7] = getTexFromBMP("images/2k-neptune.bmp");
|
||||||
id[8] = getTexFromBMP("images/pluto.bmp");
|
id[8] = getTexFromBMP("images/pluto.bmp");
|
||||||
|
moon_id = getTexFromBMP("images/2k-moon.bmp");
|
||||||
setTexId(_sun, sun_id);
|
setTexId(_sun, sun_id);
|
||||||
|
setTexId(_moon, moon_id);
|
||||||
for(i = 0; i < 9; ++i)
|
for(i = 0; i < 9; ++i)
|
||||||
setTexId(_planet[i], id[i]);
|
setTexId(_planet[i], id[i]);
|
||||||
/* si _use_tex != 0, on active l'utilisation de la texture pour les
|
/* si _use_tex != 0, on active l'utilisation de la texture pour les
|
||||||
* trois */
|
* trois */
|
||||||
if(_use_tex) {
|
if(_use_tex) {
|
||||||
enableSurfaceOption(_sun, SO_USE_TEXTURE);
|
enableSurfaceOption(_sun, SO_USE_TEXTURE);
|
||||||
|
enableSurfaceOption(_moon, SO_USE_TEXTURE);
|
||||||
for(i = 0; i < 9; ++i)
|
for(i = 0; i < 9; ++i)
|
||||||
enableSurfaceOption(_planet[i], SO_USE_TEXTURE);
|
enableSurfaceOption(_planet[i], SO_USE_TEXTURE);
|
||||||
}
|
}
|
||||||
/* si _use_lighting != 0, on active l'ombrage */
|
/* si _use_lighting != 0, on active l'ombrage */
|
||||||
if(_use_lighting) {
|
if(_use_lighting) {
|
||||||
enableSurfaceOption(_sun, SO_USE_LIGHTING);
|
enableSurfaceOption(_sun, SO_USE_LIGHTING);
|
||||||
|
enableSurfaceOption(_moon, SO_USE_LIGHTING);
|
||||||
for(i = 0; i < 9; ++i)
|
for(i = 0; i < 9; ++i)
|
||||||
enableSurfaceOption(_planet[i], SO_USE_LIGHTING);
|
enableSurfaceOption(_planet[i], SO_USE_LIGHTING);
|
||||||
}
|
}
|
||||||
disableSurfaceOption(_sun, SO_USE_COLOR);
|
disableSurfaceOption(_sun, SO_USE_COLOR);
|
||||||
|
disableSurfaceOption(_moon, SO_USE_COLOR);
|
||||||
for(i = 0; i < 9; ++i)
|
for(i = 0; i < 9; ++i)
|
||||||
disableSurfaceOption(_planet[i], SO_USE_COLOR);
|
disableSurfaceOption(_planet[i], SO_USE_COLOR);
|
||||||
atexit(sortie);
|
atexit(sortie);
|
||||||
@ -153,12 +160,13 @@ void draw(void) {
|
|||||||
/*lookAt(mvMat, _cam.x, 0.0, _cam.z, _cam.x - sin(_cam.theta), 1.0f - _ym / 200.0f, _cam.z - cos(_cam.theta), 0.0, 1.0, 0.0);*/
|
/*lookAt(mvMat, _cam.x, 0.0, _cam.z, _cam.x - sin(_cam.theta), 1.0f - _ym / 200.0f, _cam.z - cos(_cam.theta), 0.0, 1.0, 0.0);*/
|
||||||
/*_cam.x = (_xm - (_wW >> 1)) / (float)_wW;*/
|
/*_cam.x = (_xm - (_wW >> 1)) / (float)_wW;*/
|
||||||
|
|
||||||
|
// Y ----> 1.0 - (_ym - (_wH >> 1)) / (float)_wH * 5
|
||||||
/*_cam.y = 1.0 - (_ym - (_wH >> 1)) / 300.0f;*/
|
/*_cam.y = 1.0 - (_ym - (_wH >> 1)) / 300.0f;*/
|
||||||
lookAt(mvMat, _cam.x, _cam.y, _cam.z, _cam.x - sin(_cam.theta), 1.0 - (_ym - (_wH >> 1)) / 300.0f, _cam.z - cos(_cam.theta), 0.0, 1.0, 0.0);
|
lookAt(mvMat, _cam.x, _cam.y, _cam.z, _cam.x - sin(_cam.theta), 1.0, _cam.z - cos(_cam.theta), 0.0, 1.0, 0.0);
|
||||||
|
|
||||||
// scales https://www.jpl.nasa.gov/infographics/infographic.view.php?id=10749
|
// scales https://www.jpl.nasa.gov/infographics/infographic.view.php?id=10749
|
||||||
|
// https://www.exploratorium.edu/ronh/solar_system/scale.pdf
|
||||||
|
|
||||||
/* la sphère est laissée au centre et tourne autour de son axe y */
|
|
||||||
// SUN
|
// SUN
|
||||||
memcpy(nmv, mvMat, sizeof nmv); /* copie mvMat dans nmv */
|
memcpy(nmv, mvMat, sizeof nmv); /* copie mvMat dans nmv */
|
||||||
rotate(nmv, (a / 24.5f), 0.0f, 1.0f, 0.0f);
|
rotate(nmv, (a / 24.5f), 0.0f, 1.0f, 0.0f);
|
||||||
@ -179,7 +187,7 @@ void draw(void) {
|
|||||||
rotate(nmv, (a / 224.7f), 0.0f, 1.0f, 0.0f); // orbit mouvement
|
rotate(nmv, (a / 224.7f), 0.0f, 1.0f, 0.0f); // orbit mouvement
|
||||||
translate(nmv, 7.9f, 1.0f, 0.0f);
|
translate(nmv, 7.9f, 1.0f, 0.0f);
|
||||||
scale(nmv, (1/113.0f) * 12.0f, (1/113.0f) * 12.0f, (1/113.0f) * 12.0f);
|
scale(nmv, (1/113.0f) * 12.0f, (1/113.0f) * 12.0f, (1/113.0f) * 12.0f);
|
||||||
rotate(nmv, (a / 243.75f), 0.1773f, -1.0f, 0.0f); // rotation anti-clockwise
|
rotate(nmv, (a / 243.75f), -0.1773f, -1.0f, 0.0f); // rotation anti-clockwise
|
||||||
transform_n_raster(_planet[1], nmv, projMat);
|
transform_n_raster(_planet[1], nmv, projMat);
|
||||||
|
|
||||||
// EARTH
|
// EARTH
|
||||||
@ -187,15 +195,23 @@ void draw(void) {
|
|||||||
rotate(nmv, (a / 365.2425f), 0.0f, 1.0f, 0.0f);
|
rotate(nmv, (a / 365.2425f), 0.0f, 1.0f, 0.0f);
|
||||||
translate(nmv, 10.0f, 1.0f, 0.0f);
|
translate(nmv, 10.0f, 1.0f, 0.0f);
|
||||||
scale(nmv, (1/108.0f) * 12.0f, (1/108.0f) * 12.0f, (1/108.0f) * 12.0f);
|
scale(nmv, (1/108.0f) * 12.0f, (1/108.0f) * 12.0f, (1/108.0f) * 12.0f);
|
||||||
rotate(nmv, a, 0.234f, 1.0f, 0.0f);
|
rotate(nmv, a, -0.234f, 1.0f, 0.0f);
|
||||||
transform_n_raster(_planet[2], nmv, projMat);
|
transform_n_raster(_planet[2], nmv, projMat);
|
||||||
|
|
||||||
|
// MOON
|
||||||
|
memcpy(nmv, mvMat, sizeof nmv); /* copie mvMat dans nmv */
|
||||||
|
rotate(nmv, (a / 365.2425f), 0.0f, 1.0f, 0.0f);
|
||||||
|
translate(nmv, 11.0f, 1.0f, 0.0f);
|
||||||
|
rotate(nmv, a, 0.0f, 1.0f, 0.0f);
|
||||||
|
/*scale(nmv, (1/108.0f) * 12.0f / 30, (1/108.0f) * 12.0f / 30, (1/108.0f) * 12.0f / 30);*/
|
||||||
|
transform_n_raster(_moon, nmv, projMat);
|
||||||
|
|
||||||
// MARS
|
// MARS
|
||||||
memcpy(nmv, mvMat, sizeof nmv); /* copie mvMat dans nmv */
|
memcpy(nmv, mvMat, sizeof nmv); /* copie mvMat dans nmv */
|
||||||
rotate(nmv, (a / 686.98f), 0.0f, 1.0f, 0.0f);
|
rotate(nmv, (a / 686.98f), 0.0f, 1.0f, 0.0f);
|
||||||
translate(nmv, 15.2f, 1.0f, 0.0f);
|
translate(nmv, 15.2f, 1.0f, 0.0f);
|
||||||
scale(nmv, (1/208.0f) * 12.0f, (1/208.0f) * 12.0f, (1/208.0f) * 12.0f);
|
scale(nmv, (1/208.0f) * 12.0f, (1/208.0f) * 12.0f, (1/208.0f) * 12.0f);
|
||||||
rotate(nmv, a / 1.0416f, 0.252f, 1.0f, 0.0f);
|
rotate(nmv, a / 1.0416f, -0.252f, 1.0f, 0.0f);
|
||||||
transform_n_raster(_planet[3], nmv, projMat);
|
transform_n_raster(_planet[3], nmv, projMat);
|
||||||
|
|
||||||
// JUPITER
|
// JUPITER
|
||||||
@ -203,7 +219,7 @@ void draw(void) {
|
|||||||
rotate(nmv, a / (12 * 365.2425f), 0.0f, 1.0f, 0.0f);
|
rotate(nmv, a / (12 * 365.2425f), 0.0f, 1.0f, 0.0f);
|
||||||
translate(nmv, 52.0f, 1.0f, 0.0f);
|
translate(nmv, 52.0f, 1.0f, 0.0f);
|
||||||
scale(nmv, (1/9.7f) * 12.0f, (1/9.7f) * 12.0f, (1/9.7f) * 12.0f);
|
scale(nmv, (1/9.7f) * 12.0f, (1/9.7f) * 12.0f, (1/9.7f) * 12.0f);
|
||||||
rotate(nmv, a / 0.416f, 0.031f, 1.0f, 0.0f);
|
rotate(nmv, a / 0.416f, -0.031f, 1.0f, 0.0f);
|
||||||
transform_n_raster(_planet[4], nmv, projMat);
|
transform_n_raster(_planet[4], nmv, projMat);
|
||||||
|
|
||||||
// SATURN
|
// SATURN
|
||||||
@ -211,7 +227,7 @@ void draw(void) {
|
|||||||
rotate(nmv, a / (30 * 365.2425f), 0.0f, 1.0f, 0.0f);
|
rotate(nmv, a / (30 * 365.2425f), 0.0f, 1.0f, 0.0f);
|
||||||
translate(nmv, 95.4f, 1.0f, 0.0f);
|
translate(nmv, 95.4f, 1.0f, 0.0f);
|
||||||
scale(nmv, (1/11.4f) * 12.0f, (1/11.4f) * 12.0f, (1/11.4f) * 12.0f);
|
scale(nmv, (1/11.4f) * 12.0f, (1/11.4f) * 12.0f, (1/11.4f) * 12.0f);
|
||||||
rotate(nmv, a / 0.4583f, 0.267f, 1.0f, 0.0f);
|
rotate(nmv, a / 0.4583f, -0.267f, 1.0f, 0.0f);
|
||||||
transform_n_raster(_planet[5], nmv, projMat);
|
transform_n_raster(_planet[5], nmv, projMat);
|
||||||
|
|
||||||
// URANUS
|
// URANUS
|
||||||
@ -227,7 +243,7 @@ void draw(void) {
|
|||||||
rotate(nmv, a / (165 * 365.2425f), 0.0f, 1.0f, 0.0f);
|
rotate(nmv, a / (165 * 365.2425f), 0.0f, 1.0f, 0.0f);
|
||||||
translate(nmv, 301.0f, 1.0f, 0.0f);
|
translate(nmv, 301.0f, 1.0f, 0.0f);
|
||||||
scale(nmv, (1/27.7f) * 12.0f, (1/27.7f) * 12.0f, (1/27.7f) * 12.0f);
|
scale(nmv, (1/27.7f) * 12.0f, (1/27.7f) * 12.0f, (1/27.7f) * 12.0f);
|
||||||
rotate(nmv, a / 0.6f, 0.283f, 1.0f, 0.0f);
|
rotate(nmv, a / 0.6f, -0.283f, 1.0f, 0.0f);
|
||||||
transform_n_raster(_planet[7], nmv, projMat);
|
transform_n_raster(_planet[7], nmv, projMat);
|
||||||
|
|
||||||
// PLUTO
|
// PLUTO
|
||||||
@ -235,7 +251,7 @@ void draw(void) {
|
|||||||
rotate(nmv, a / (248 * 365.2425f), 0.0f, 1.0f, 0.0f);
|
rotate(nmv, a / (248 * 365.2425f), 0.0f, 1.0f, 0.0f);
|
||||||
translate(nmv, 394.0f, 1.0f, 0.0f);
|
translate(nmv, 394.0f, 1.0f, 0.0f);
|
||||||
scale(nmv, (1/500.0f) * 12.0f, (1/500.0f) * 12.0f, (1/500.0f) * 12.0f);
|
scale(nmv, (1/500.0f) * 12.0f, (1/500.0f) * 12.0f, (1/500.0f) * 12.0f);
|
||||||
rotate(nmv, a / 6.4, 0.119f, 1.0f, 0.0f);
|
rotate(nmv, a / 6.4, -0.119f, 1.0f, 0.0f);
|
||||||
transform_n_raster(_planet[8], nmv, projMat);
|
transform_n_raster(_planet[8], nmv, projMat);
|
||||||
|
|
||||||
/* déclarer qu'on a changé (en bas niveau) des pixels du screen */
|
/* déclarer qu'on a changé (en bas niveau) des pixels du screen */
|
||||||
@ -249,6 +265,7 @@ void draw(void) {
|
|||||||
/*!\brief intercepte l'événement clavier pour modifier les options. */
|
/*!\brief intercepte l'événement clavier pour modifier les options. */
|
||||||
void key(int keycode) {
|
void key(int keycode) {
|
||||||
double dtheta = M_PI, step = 5.0;
|
double dtheta = M_PI, step = 5.0;
|
||||||
|
int i;
|
||||||
switch(keycode) {
|
switch(keycode) {
|
||||||
case GL4DK_UP:
|
case GL4DK_UP:
|
||||||
_cam.y += 5 * dtheta;
|
_cam.y += 5 * dtheta;
|
||||||
@ -271,10 +288,10 @@ void key(int keycode) {
|
|||||||
_cam.z += _v * step * cos(_cam.theta);
|
_cam.z += _v * step * cos(_cam.theta);
|
||||||
break;
|
break;
|
||||||
case GL4DK_a:
|
case GL4DK_a:
|
||||||
_cam.theta -= -_v * dtheta;
|
_cam.theta += _v * step;
|
||||||
break;
|
break;
|
||||||
case GL4DK_d:
|
case GL4DK_d:
|
||||||
_cam.theta += -_v * dtheta;
|
_cam.theta -= _v * step;
|
||||||
break;
|
break;
|
||||||
case GL4DK_p:
|
case GL4DK_p:
|
||||||
if (_pause == 0)
|
if (_pause == 0)
|
||||||
@ -283,13 +300,13 @@ void key(int keycode) {
|
|||||||
_pause = 0;
|
_pause = 0;
|
||||||
break;
|
break;
|
||||||
case GL4DK_MINUS:
|
case GL4DK_MINUS:
|
||||||
_v -= 0.001f;
|
_v -= 0.01f;
|
||||||
if (_v < 0.001f){
|
if (_v < 0.01f){
|
||||||
_v = 0.001f;
|
_v = 0.01f;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case GL4DK_EQUALS:
|
case GL4DK_EQUALS:
|
||||||
_v += 0.001f;
|
_v += 0.01f;
|
||||||
if (_v > 0.5f){
|
if (_v > 0.5f){
|
||||||
_v = 0.5f;
|
_v = 0.5f;
|
||||||
}
|
}
|
||||||
@ -302,42 +319,36 @@ void key(int keycode) {
|
|||||||
_use_tex = !_use_tex;
|
_use_tex = !_use_tex;
|
||||||
if(_use_tex) {
|
if(_use_tex) {
|
||||||
enableSurfaceOption(_sun, SO_USE_TEXTURE);
|
enableSurfaceOption(_sun, SO_USE_TEXTURE);
|
||||||
enableSurfaceOption(_planet[0], SO_USE_TEXTURE);
|
for(i = 0; i < 9; ++i)
|
||||||
enableSurfaceOption(_planet[1], SO_USE_TEXTURE);
|
enableSurfaceOption(_planet[i], SO_USE_TEXTURE);
|
||||||
enableSurfaceOption(_planet[2], SO_USE_TEXTURE);
|
|
||||||
} else {
|
} else {
|
||||||
disableSurfaceOption(_sun, SO_USE_TEXTURE);
|
disableSurfaceOption(_sun, SO_USE_TEXTURE);
|
||||||
disableSurfaceOption(_planet[0], SO_USE_TEXTURE);
|
for(i = 0; i < 9; ++i)
|
||||||
disableSurfaceOption(_planet[1], SO_USE_TEXTURE);
|
disableSurfaceOption(_planet[i], SO_USE_TEXTURE);
|
||||||
disableSurfaceOption(_planet[2], SO_USE_TEXTURE);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case GL4DK_c: /* 'c' utiliser la couleur */
|
case GL4DK_c: /* 'c' utiliser la couleur */
|
||||||
_use_color = !_use_color;
|
_use_color = !_use_color;
|
||||||
if(_use_color) {
|
if(_use_color) {
|
||||||
enableSurfaceOption(_sun, SO_USE_COLOR);
|
enableSurfaceOption(_sun, SO_USE_COLOR);
|
||||||
enableSurfaceOption(_planet[0], SO_USE_COLOR);
|
for(i = 0; i < 9; ++i)
|
||||||
enableSurfaceOption(_planet[1], SO_USE_COLOR);
|
enableSurfaceOption(_planet[i], SO_USE_COLOR);
|
||||||
enableSurfaceOption(_planet[2], SO_USE_COLOR);
|
|
||||||
} else {
|
} else {
|
||||||
disableSurfaceOption(_sun, SO_USE_COLOR);
|
disableSurfaceOption(_sun, SO_USE_COLOR);
|
||||||
disableSurfaceOption(_planet[0], SO_USE_COLOR);
|
for(i = 0; i < 9; ++i)
|
||||||
disableSurfaceOption(_planet[1], SO_USE_COLOR);
|
disableSurfaceOption(_planet[i], SO_USE_COLOR);
|
||||||
disableSurfaceOption(_planet[2], SO_USE_COLOR);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case GL4DK_l: /* 'l' utiliser l'ombrage par la méthode Gouraud */
|
case GL4DK_l: /* 'l' utiliser l'ombrage par la méthode Gouraud */
|
||||||
_use_lighting = !_use_lighting;
|
_use_lighting = !_use_lighting;
|
||||||
if(_use_lighting) {
|
if(_use_lighting) {
|
||||||
enableSurfaceOption(_sun, SO_USE_LIGHTING);
|
enableSurfaceOption(_sun, SO_USE_LIGHTING);
|
||||||
enableSurfaceOption(_planet[0], SO_USE_LIGHTING);
|
for(i = 0; i < 9; ++i)
|
||||||
enableSurfaceOption(_planet[1], SO_USE_LIGHTING);
|
enableSurfaceOption(_planet[i], SO_USE_LIGHTING);
|
||||||
enableSurfaceOption(_planet[2], SO_USE_LIGHTING);
|
|
||||||
} else {
|
} else {
|
||||||
disableSurfaceOption(_sun, SO_USE_LIGHTING);
|
disableSurfaceOption(_sun, SO_USE_LIGHTING);
|
||||||
disableSurfaceOption(_planet[0], SO_USE_LIGHTING);
|
for(i = 0; i < 9; ++i)
|
||||||
disableSurfaceOption(_planet[1], SO_USE_LIGHTING);
|
disableSurfaceOption(_planet[i], SO_USE_LIGHTING);
|
||||||
disableSurfaceOption(_planet[2], SO_USE_LIGHTING);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default: break;
|
default: break;
|
||||||
@ -347,14 +358,15 @@ void key(int keycode) {
|
|||||||
static void pmotion(int x, int y) {
|
static void pmotion(int x, int y) {
|
||||||
_xm = x;
|
_xm = x;
|
||||||
_ym = y;
|
_ym = y;
|
||||||
|
_cam.theta = -(_xm - (_wW >> 1)) / (float)_wW*10;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mouse(int button, int state, int x, int y) {
|
static void mouse(int button, int state, int x, int y) {
|
||||||
double dtheta = M_PI;
|
double dtheta = M_PI;
|
||||||
if (button == GL4D_BUTTON_LEFT)
|
if (button == GL4D_BUTTON_LEFT)
|
||||||
_cam.y += (_v/2) * dtheta;
|
_cam.y += 10 * dtheta;
|
||||||
if (button == GL4D_BUTTON_RIGHT)
|
if (button == GL4D_BUTTON_RIGHT)
|
||||||
_cam.y -= (_v/2) * dtheta;
|
_cam.y -= 10 * dtheta;
|
||||||
if (button == GL4D_BUTTON_MIDDLE)
|
if (button == GL4D_BUTTON_MIDDLE)
|
||||||
_cam.y = 1.0f;
|
_cam.y = 1.0f;
|
||||||
}
|
}
|
||||||
@ -366,6 +378,10 @@ void sortie(void) {
|
|||||||
freeSurface(_sun);
|
freeSurface(_sun);
|
||||||
_sun = NULL;
|
_sun = NULL;
|
||||||
}
|
}
|
||||||
|
if(_moon) {
|
||||||
|
freeSurface(_moon);
|
||||||
|
_moon = NULL;
|
||||||
|
}
|
||||||
for(i = 0; i < 9; ++i) {
|
for(i = 0; i < 9; ++i) {
|
||||||
if(_planet[i]){
|
if(_planet[i]){
|
||||||
freeSurface(_planet[i]);
|
freeSurface(_planet[i]);
|
||||||
|
Loading…
Reference in New Issue
Block a user