2011-12-10 13:25:22 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
#include "IL/il.h"
|
|
|
|
#include "IL/ilu.h"
|
|
|
|
|
|
|
|
#include "shared/types.h"
|
|
|
|
#include "shared/constants.h"
|
|
|
|
#include "shared/globals.h"
|
2012-01-22 18:39:42 +00:00
|
|
|
|
2012-01-24 13:16:20 +00:00
|
|
|
#include "auto.h"
|
|
|
|
#include "system.h"
|
|
|
|
#include "camera.h"
|
|
|
|
#include "scenery.h"
|
|
|
|
#include "render.h"
|
2011-12-10 13:25:22 +00:00
|
|
|
|
2011-12-23 22:39:13 +00:00
|
|
|
void paysagesInit()
|
2011-12-10 13:25:22 +00:00
|
|
|
{
|
2012-01-24 13:16:20 +00:00
|
|
|
CameraDefinition camera;
|
|
|
|
|
2012-01-07 16:53:23 +00:00
|
|
|
systemInit();
|
2011-12-10 13:25:22 +00:00
|
|
|
ilInit();
|
|
|
|
iluInit();
|
|
|
|
|
2012-01-24 13:16:20 +00:00
|
|
|
sceneryInit();
|
2012-01-22 18:39:42 +00:00
|
|
|
renderInit();
|
2011-12-18 21:59:33 +00:00
|
|
|
|
2012-01-24 13:16:20 +00:00
|
|
|
camera = cameraCreateDefinition();
|
|
|
|
cameraSetLocation(&camera, -12.0, 5.0, 2.0);
|
|
|
|
cameraSetTarget(&camera, 0.0, 5.0, 0.0);
|
|
|
|
scenerySetCamera(&camera);
|
|
|
|
cameraDeleteDefinition(&camera);
|
2012-01-23 23:45:33 +00:00
|
|
|
|
2011-12-10 13:25:22 +00:00
|
|
|
autoGenRealisticLandscape(0);
|
|
|
|
autoSetDaytime(8, 30);
|
2012-01-22 18:39:42 +00:00
|
|
|
|
2012-01-03 15:40:50 +00:00
|
|
|
// DEBUG
|
2012-01-05 11:32:14 +00:00
|
|
|
/*double last_height, height, x;
|
2012-01-03 15:40:50 +00:00
|
|
|
last_height = height = 0.0;
|
|
|
|
x = 0.0;
|
|
|
|
while (height <= 1.0 || height >= last_height || last_height < 0.1)
|
|
|
|
{
|
|
|
|
last_height = height;
|
|
|
|
height = terrainGetHeight(x, 0.0);
|
|
|
|
x += 0.1;
|
|
|
|
}
|
|
|
|
cameraSetLocation(x - 2.0, height, 0.0);
|
2012-01-05 11:32:14 +00:00
|
|
|
cameraSetTarget(x - 1.0, height, 0.0);*/
|
2011-12-10 13:25:22 +00:00
|
|
|
}
|
2012-01-22 18:39:42 +00:00
|
|
|
|
|
|
|
void paysagesSave(char* filepath)
|
|
|
|
{
|
2012-01-23 23:45:33 +00:00
|
|
|
scenerySaveToFile(filepath);
|
2012-01-22 18:39:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void paysagesLoad(char* filepath)
|
|
|
|
{
|
2012-01-23 23:45:33 +00:00
|
|
|
sceneryLoadFromFile(filepath);
|
2012-01-22 18:39:42 +00:00
|
|
|
}
|