Commit a0ebe8c 1 parent e769860 commit a0ebe8c Copy full SHA for a0ebe8c
File tree 3 files changed +8
-6
lines changed
3 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 6
6
//#define WORLD_SIZE_X 12 //amount of chunks in x orientation
7
7
//#define WORLD_SIZE_Y 12 //amount of chunks in y orientation
8
8
9
- #define CHUNK_SIZE (FIXED_POINT_FACTOR * 10) //10 meter size per chunk
9
+ #define CHUNK_UNITS 10 //10 meter size per chunk (max is around 64)
10
+
11
+ #define CHUNK_SIZE (FIXED_POINT_FACTOR * CHUNK_UNITS) //Total fixed point representation of one chunk
10
12
//starting location of chunks in world coordinates
11
13
#define CHUNK_OFFSET_X (-(WORLD_SIZE_X * CHUNK_SIZE) / 2)
12
14
#define CHUNK_OFFSET_Y (-(WORLD_SIZE_Y * CHUNK_SIZE) / 2)
Original file line number Diff line number Diff line change 1
1
#include " render_globals.h"
2
+ #include " chunk_globals.h"
2
3
#include " render_math.h"
3
4
4
5
float camera_position[3 ] = {0.0 , 0.0 , 0.0 };
@@ -120,12 +121,12 @@ void render_view_projection() {
120
121
float old_position_z = camera_position[2 ];
121
122
122
123
// calculate and update needed global offsets
123
- global_offset_x = camera_position[0 ] / 10 ;
124
- global_offset_z = camera_position[2 ] / 10 ;
124
+ global_offset_x = camera_position[0 ] / CHUNK_UNITS ;
125
+ global_offset_z = camera_position[2 ] / CHUNK_UNITS ;
125
126
126
127
// we update the camera position to the new one and move the camera
127
- camera_position[0 ] -= global_offset_x * 10 ;
128
- camera_position[2 ] -= global_offset_z * 10 ;
128
+ camera_position[0 ] -= global_offset_x * CHUNK_UNITS ;
129
+ camera_position[2 ] -= global_offset_z * CHUNK_UNITS ;
129
130
130
131
update_camera ();
131
132
Original file line number Diff line number Diff line change @@ -69,7 +69,6 @@ void display_menu() {
69
69
#else
70
70
if (demo_progress < 2500 ) {
71
71
text (" Pico3D Engine" , 28 , 20 );
72
- text (" by: Bernhard Strobl" , 10 , 30 );
73
72
}
74
73
75
74
if ((demo_progress / 32 ) % 2 == 0 ) {
You can’t perform that action at this time.
0 commit comments