|
|
@ -81,7 +81,7 @@ void draw_player(SDL_Renderer * ren, int x, int y, bool red) { |
|
|
|
player_rect.w = 20; |
|
|
|
player_rect.w = 20; |
|
|
|
player_rect.h = 20; |
|
|
|
player_rect.h = 20; |
|
|
|
|
|
|
|
|
|
|
|
struct colour c = get_scene_at(viewport_pos, level).colours.bg; |
|
|
|
struct colour c = get_scene_watch()->colours.bg; |
|
|
|
|
|
|
|
|
|
|
|
SDL_SetRenderDrawColor(ren, c.r, c.g, c.b, 255); |
|
|
|
SDL_SetRenderDrawColor(ren, c.r, c.g, c.b, 255); |
|
|
|
|
|
|
|
|
|
|
@ -448,7 +448,7 @@ double interpolate_h(Vect left, Vect right, double x) { |
|
|
|
return x * m + c; |
|
|
|
return x * m + c; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void draw_environment(SDL_Renderer * ren, struct environment *scene) { |
|
|
|
void draw_environment(SDL_Renderer * ren, const struct environment *scene) { |
|
|
|
struct colour c1 = scene->colours.bg; |
|
|
|
struct colour c1 = scene->colours.bg; |
|
|
|
struct colour c2 = scene->colours.fg1; |
|
|
|
struct colour c2 = scene->colours.fg1; |
|
|
|
struct colour c3 = scene->colours.fg2; |
|
|
|
struct colour c3 = scene->colours.fg2; |
|
|
@ -577,19 +577,19 @@ void draw_level_chooser_tbox(SDL_Renderer *ren) { |
|
|
|
char string[250]; |
|
|
|
char string[250]; |
|
|
|
snprintf(string, 250,"GOTO LEVEL: %s", gameui.currently_bound_textbox->text_input); |
|
|
|
snprintf(string, 250,"GOTO LEVEL: %s", gameui.currently_bound_textbox->text_input); |
|
|
|
|
|
|
|
|
|
|
|
struct environment scene = get_scene_at(viewport_pos, level); |
|
|
|
const struct environment *scene = get_scene_watch(); |
|
|
|
|
|
|
|
|
|
|
|
Vect pos = {.x= width - (width / 4), .y = height - (height / 10)}; |
|
|
|
Vect pos = {.x= width - (width / 4), .y = height - (height / 10)}; |
|
|
|
draw_text(ren, pos, scene.colours.fg1, string); |
|
|
|
draw_text(ren, pos, scene->colours.fg1, string); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int draw_end_screen(SDL_Renderer *ren) { |
|
|
|
int draw_end_screen(SDL_Renderer *ren) { |
|
|
|
struct environment scene = get_scene_at(viewport_pos, level); |
|
|
|
const struct environment *scene = get_scene_watch(); |
|
|
|
|
|
|
|
|
|
|
|
struct colour bg = scene.colours.bg; |
|
|
|
struct colour bg = scene->colours.bg; |
|
|
|
struct colour colour = scene.colours.fg1; |
|
|
|
struct colour colour = scene->colours.fg1; |
|
|
|
struct colour_pallete pal = scene.colours; |
|
|
|
struct colour_pallete pal = scene->colours; |
|
|
|
|
|
|
|
|
|
|
|
SDL_SetRenderDrawColor(ren, bg.r, bg.g, bg.b,255); |
|
|
|
SDL_SetRenderDrawColor(ren, bg.r, bg.g, bg.b,255); |
|
|
|
|
|
|
|
|
|
|
@ -684,7 +684,7 @@ int draw_end_screen(SDL_Renderer *ren) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void draw_level_time(SDL_Renderer *ren, struct environment * e) { |
|
|
|
void draw_level_time(SDL_Renderer *ren, const struct environment * e) { |
|
|
|
|
|
|
|
|
|
|
|
int margin = height / 10; |
|
|
|
int margin = height / 10; |
|
|
|
|
|
|
|
|
|
|
@ -794,9 +794,9 @@ void redraw_buffer(SDL_Renderer * ren) { |
|
|
|
|
|
|
|
|
|
|
|
//SDL_GetMouseState(&newmousex, &newmousey);
|
|
|
|
//SDL_GetMouseState(&newmousex, &newmousey);
|
|
|
|
|
|
|
|
|
|
|
|
struct environment scene = get_scene_at(viewport_pos, level); |
|
|
|
const struct environment* scene = get_scene_watch(); |
|
|
|
draw_environment(ren, &scene); |
|
|
|
draw_environment(ren, scene); |
|
|
|
draw_level_time(ren, &scene); |
|
|
|
draw_level_time(ren, scene); |
|
|
|
SDL_UnlockMutex(player.physics->lock); |
|
|
|
SDL_UnlockMutex(player.physics->lock); |
|
|
|
|
|
|
|
|
|
|
|
for (int i=0; i < world.items.size; i++) { |
|
|
|
for (int i=0; i < world.items.size; i++) { |
|
|
@ -846,7 +846,7 @@ void redraw_buffer(SDL_Renderer * ren) { |
|
|
|
SDL_SetRenderDrawColor(ren, 0, 0, 0, 90); |
|
|
|
SDL_SetRenderDrawColor(ren, 0, 0, 0, 90); |
|
|
|
SDL_RenderFillRect(ren, &r); |
|
|
|
SDL_RenderFillRect(ren, &r); |
|
|
|
if (in_game) |
|
|
|
if (in_game) |
|
|
|
draw_pause_screen(ren, &scene); |
|
|
|
draw_pause_screen(ren, scene); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/*if (newmousex != mousex || newmousey != mousey) {*/ /*mousey = newmousey;*/ |
|
|
|
/*if (newmousex != mousex || newmousey != mousey) {*/ /*mousey = newmousey;*/ |
|
|
|