Skip to content

Commit

Permalink
See desc
Browse files Browse the repository at this point in the history
* fully remove boolean types (see #48)
* add nightly builds link to README
* store smooth rotation of local player in players array, reset on spawn
  • Loading branch information
xtreme8000 committed May 7, 2018
1 parent 491919b commit ffbb928
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 19 deletions.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -18,6 +18,7 @@
### Quick usage guide

**As of right now, you can download the newest stable version from the [releases page](https://github.com/xtreme8000/BetterSpades/releases).**
**You can get [nightly builds here](http://bytebit.info.tm:8080/job/BetterSpades/).**

You can either:
* use the client temporarily by extracting the downloaded zip into a new directory.
Expand Down
7 changes: 3 additions & 4 deletions src/cameracontroller.c
Expand Up @@ -21,7 +21,6 @@

int cameracontroller_bodyview_player = 0;

float lx,ly,lz;
void cameracontroller_fps(float dt) {
players[local_player_id].connected = 1;
players[local_player_id].alive = 1;
Expand Down Expand Up @@ -90,9 +89,9 @@ void cameracontroller_fps(float dt) {
players[local_player_id].input.buttons.packed = 0;
}

lx = lx*pow(0.7F,dt*60.0F)+(sin(camera_rot_x)*sin(camera_rot_y))*pow(0.3F,dt*60.0F);
ly = ly*pow(0.7F,dt*60.0F)+(cos(camera_rot_y))*pow(0.3F,dt*60.0F);
lz = lz*pow(0.7F,dt*60.0F)+(cos(camera_rot_x)*sin(camera_rot_y))*pow(0.3F,dt*60.0F);
float lx = players[local_player_id].orientation_smooth.x*pow(0.7F,dt*60.0F)+(sin(camera_rot_x)*sin(camera_rot_y))*pow(0.3F,dt*60.0F);
float ly = players[local_player_id].orientation_smooth.y*pow(0.7F,dt*60.0F)+(cos(camera_rot_y))*pow(0.3F,dt*60.0F);
float lz = players[local_player_id].orientation_smooth.z*pow(0.7F,dt*60.0F)+(cos(camera_rot_x)*sin(camera_rot_y))*pow(0.3F,dt*60.0F);

float len = sqrt(lx*lx+ly*ly+lz*lz);
players[local_player_id].orientation.x = players[local_player_id].orientation_smooth.x = lx/len;
Expand Down
4 changes: 2 additions & 2 deletions src/chunk.c
Expand Up @@ -29,7 +29,7 @@ int chunk_geometry_changed_lenght = 0;
int chunk_lighting_changed[CHUNKS_PER_DIM*CHUNKS_PER_DIM*2];
int chunk_lighting_changed_lenght = 0;

boolean chunk_render_mode = 0;
int chunk_render_mode = 0;

struct chunk_d {
int x,y;
Expand Down Expand Up @@ -94,7 +94,7 @@ void chunk_draw_visible() {
chunk_render(chunks_draw[k].x/CHUNK_SIZE,chunks_draw[k].y/CHUNK_SIZE);
}

void chunk_set_render_mode(boolean r) {
void chunk_set_render_mode(int r) {
chunk_render_mode = r;
}

Expand Down
4 changes: 2 additions & 2 deletions src/chunk.h
Expand Up @@ -34,7 +34,7 @@ extern int chunk_geometry_changed_lenght;
extern int chunk_lighting_changed[CHUNKS_PER_DIM*CHUNKS_PER_DIM*2];
extern int chunk_lighting_changed_lenght;

extern boolean chunk_render_mode;
extern int chunk_render_mode;

#define CHUNK_WORKERS_MAX 3

Expand Down Expand Up @@ -67,7 +67,7 @@ void chunk_generate_greedy(struct chunk_worker* worker);
void chunk_generate_naive(struct chunk_worker* worker);
void chunk_render(int x, int y);
void chunk_rebuild_all(void);
void chunk_set_render_mode(boolean r);
void chunk_set_render_mode(int r);
void chunk_draw_visible(void);

void chunk_draw_shadow_volume(float* data, int max);
Expand Down
14 changes: 7 additions & 7 deletions src/config.h
Expand Up @@ -19,17 +19,17 @@

extern struct RENDER_OPTIONS {
char name[17];
boolean opengl14;
boolean color_correction;
boolean shadow_entities;
boolean ambient_occlusion;
int opengl14;
int color_correction;
int shadow_entities;
int ambient_occlusion;
float render_distance;
int window_width;
int window_height;
unsigned char multisamples;
boolean player_arms;
boolean fullscreen;
boolean greedy_meshing;
int player_arms;
int fullscreen;
int greedy_meshing;
int vsync;
float mouse_sensitivity;
} settings;
Expand Down
6 changes: 3 additions & 3 deletions src/network.c
Expand Up @@ -333,9 +333,9 @@ void read_PacketCreatePlayer(void* data, int len) {
players[p->player_id].pos.y = 63.0F-p->z;
players[p->player_id].pos.z = p->y;
strcpy(players[p->player_id].name,p->name);
players[p->player_id].orientation.x = (p->team==TEAM_1)?1.0F:-1.0F;
players[p->player_id].orientation.y = 0.0F;
players[p->player_id].orientation.z = 0.0F;
players[p->player_id].orientation.x = players[p->player_id].orientation_smooth.x = (p->team==TEAM_1)?1.0F:-1.0F;
players[p->player_id].orientation.y = players[p->player_id].orientation_smooth.y = 0.0F;
players[p->player_id].orientation.z = players[p->player_id].orientation_smooth.z = 0.0F;

players[p->player_id].block.red = 111;
players[p->player_id].block.green = 111;
Expand Down
2 changes: 1 addition & 1 deletion src/particle.h
Expand Up @@ -26,7 +26,7 @@ typedef struct {
float created;
float fade;
unsigned int color;
boolean alive;
int alive;
} Particle;

extern Particle* particles;
Expand Down

0 comments on commit ffbb928

Please sign in to comment.