norm work
This commit is contained in:
parent
09b9237927
commit
22e67c1ff4
4
Makefile
4
Makefile
@ -6,7 +6,7 @@
|
||||
# By: qmennen <qmennen@student.codam.nl> +#+ +:+ +#+ #
|
||||
# +#+#+#+#+#+ +#+ #
|
||||
# Created: 2024/10/15 11:48:46 by whaffman #+# #+# #
|
||||
# Updated: 2025/06/04 20:10:47 by qmennen ### ########.fr #
|
||||
# Updated: 2025/06/05 17:28:32 by qmennen ### ########.fr #
|
||||
# #
|
||||
# **************************************************************************** #
|
||||
|
||||
@ -47,7 +47,7 @@ SOURCES = $(shell basename -a $(shell find $(SRC_PATH) -type f -name "*.c"))
|
||||
# Build configurations
|
||||
BUILD_CONFIGS = release debug asan tsan
|
||||
|
||||
release_CFLAGS = -Wall -Werror -Werror -flto -Ofast -march=native -mtune=native -ffast-math -DFULLSCREEN=1
|
||||
release_CFLAGS = -Wall -Werror -Werror -flto -Ofast -march=native -mtune=native -ffast-math -DFULLSCREEN=0
|
||||
unity_CFLAGS = -Wall -Werror -Werror -Ofast -march=native -mtune=native -ffast-math
|
||||
debug_CFLAGS = -Wall -Werror -Werror -g3 -DDEBUG -DDBG='fprintf(stderr, RED "DEBUG: " RESET "%s:%d (%s)\n", __FILE__, __LINE__, __PRETTY_FUNCTION__);'
|
||||
asan_CFLAGS = -Wall -Werror -Werror -flto -fsanitize=address,leak,undefined -g3 -DFULLSCREEN=0
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
/* By: qmennen <qmennen@student.codam.nl> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/22 14:40:47 by qmennen #+# #+# */
|
||||
/* Updated: 2025/06/03 21:24:43 by qmennen ### ########.fr */
|
||||
/* Updated: 2025/06/05 18:49:10 by qmennen ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -18,6 +18,5 @@
|
||||
int collision_horizontal(t_map *map, t_player *player, double xa);
|
||||
int collision_vertical(t_map *map, t_player *player, double ya);
|
||||
int collision_sprite(t_game *game, double xa, double ya);
|
||||
void collect(t_player *player);
|
||||
|
||||
#endif
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
/* By: qmennen <qmennen@student.codam.nl> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/05/27 15:07:48 by qmennen #+# #+# */
|
||||
/* Updated: 2025/06/03 19:15:44 by qmennen ### ########.fr */
|
||||
/* Updated: 2025/06/05 18:48:10 by qmennen ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -19,6 +19,7 @@ void menu_display(t_menu *menu, t_screen *screen);
|
||||
void draw_end_screen(t_game_manager *manager, t_menu *menu);
|
||||
t_menu *create_end_screen(t_game_manager *manager);
|
||||
mlx_image_t *menu_load_background(mlx_t *mlx, char *background_path);
|
||||
void menu_set_background(t_menu *menu, mlx_t *mlx, char *b_path);
|
||||
t_menu *create_main_menu(t_game_manager *manager);
|
||||
t_menu *menu_create(t_game_manager *manager, char *b_path,
|
||||
const t_menu_item *options[]);
|
||||
|
||||
@ -6,17 +6,30 @@
|
||||
/* By: qmennen <qmennen@student.codam.nl> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/22 14:40:59 by qmennen #+# #+# */
|
||||
/* Updated: 2025/06/04 18:35:34 by qmennen ### ########.fr */
|
||||
/* Updated: 2025/06/05 18:41:12 by qmennen ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "collision.h"
|
||||
|
||||
void collect(t_player *player)
|
||||
static void collect(t_game *game, t_sprite *sprite)
|
||||
{
|
||||
t_player *player;
|
||||
|
||||
player = game->player;
|
||||
player->battery += 0.5f;
|
||||
if (player->battery > 1.f)
|
||||
player->battery = 1.f;
|
||||
sprite->type = SPRITE_TYPE_COLLECTED;
|
||||
game->scoreboard->collectibles++;
|
||||
}
|
||||
|
||||
static void damage_player(t_player *player, float amount)
|
||||
{
|
||||
player->battery -= amount;
|
||||
if (player->battery < 0.f)
|
||||
player->battery = 0.f;
|
||||
player->hit_timer = 0.65f;
|
||||
}
|
||||
|
||||
int collision_sprite(t_game *game, double xa, double ya)
|
||||
@ -38,16 +51,9 @@ int collision_sprite(t_game *game, double xa, double ya)
|
||||
&& fabs(player->pos.y + ya - sprites[i].pos.y) < 0.5))
|
||||
{
|
||||
if (sprites[i].type == SPRITE_TYPE_ENEMY)
|
||||
{
|
||||
player->battery -= 0.001;
|
||||
player->hit_timer = .65f;
|
||||
}
|
||||
damage_player(player, 0.05f);
|
||||
else
|
||||
{
|
||||
sprites[i].type = SPRITE_TYPE_COLLECTED;
|
||||
collect(player);
|
||||
game->scoreboard->collectibles++;
|
||||
}
|
||||
collect(game, &sprites[i]);
|
||||
return (1);
|
||||
}
|
||||
i++;
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
/* By: qmennen <qmennen@student.codam.nl> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/06/03 15:53:32 by qmennen #+# #+# */
|
||||
/* Updated: 2025/06/04 18:42:45 by qmennen ### ########.fr */
|
||||
/* Updated: 2025/06/05 18:41:33 by qmennen ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -22,5 +22,4 @@ void handle_flash(t_sprite *sprite, t_game *game)
|
||||
sprite->type = SPRITE_TYPE_DISABLED;
|
||||
game->scoreboard->enemies++;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
/* By: qmennen <qmennen@student.codam.nl> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/15 15:46:08 by qmennen #+# #+# */
|
||||
/* Updated: 2025/06/05 17:09:48 by qmennen ### ########.fr */
|
||||
/* Updated: 2025/06/05 18:43:54 by qmennen ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -24,7 +24,7 @@ int game_create(t_game **game)
|
||||
{
|
||||
return (free(*game), FAILURE);
|
||||
}
|
||||
return (SUCCESS);
|
||||
return (SUCCESS);
|
||||
}
|
||||
|
||||
void game_over(t_game_manager *manager)
|
||||
@ -62,7 +62,19 @@ void game_run(t_game *game)
|
||||
collision_sprite(game, 0, 0);
|
||||
if (game->player->battery <= 0 || count_tiles(game->map, TILE_EMPTY) == 0)
|
||||
game_over(game->manager);
|
||||
}
|
||||
|
||||
static void scoreboard_free(mlx_t *mlx, t_scoreboard *scoreboard)
|
||||
{
|
||||
if (scoreboard->tiles_text)
|
||||
mlx_delete_image(mlx, scoreboard->tiles_text);
|
||||
if (scoreboard->collectibles_text)
|
||||
mlx_delete_image(mlx, scoreboard->collectibles_text);
|
||||
if (scoreboard->battery_text)
|
||||
mlx_delete_image(mlx, scoreboard->battery_text);
|
||||
if (scoreboard->enemies_text)
|
||||
mlx_delete_image(mlx, scoreboard->enemies_text);
|
||||
free(scoreboard);
|
||||
}
|
||||
|
||||
void game_free(t_game *game)
|
||||
@ -83,22 +95,6 @@ void game_free(t_game *game)
|
||||
if (game->keyboard)
|
||||
free(game->keyboard);
|
||||
if (game->scoreboard)
|
||||
{
|
||||
if (game->scoreboard->tiles_text)
|
||||
mlx_delete_image(game->screen->mlx, game->scoreboard->tiles_text);
|
||||
if (game->scoreboard->collectibles_text)
|
||||
mlx_delete_image(game->screen->mlx, game->scoreboard->collectibles_text);
|
||||
if (game->scoreboard->battery_text)
|
||||
mlx_delete_image(game->screen->mlx, game->scoreboard->battery_text);
|
||||
if (game->scoreboard->enemies_text)
|
||||
mlx_delete_image(game->screen->mlx, game->scoreboard->enemies_text);
|
||||
free(game->scoreboard);
|
||||
}
|
||||
}
|
||||
|
||||
void game_terminate(t_game *game)
|
||||
{
|
||||
print_scores(game);
|
||||
game_free(game);
|
||||
exit(EXIT_SUCCESS);
|
||||
scoreboard_free(game->screen->mlx, game->scoreboard);
|
||||
game->scoreboard = NULL;
|
||||
}
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
/* By: qmennen <qmennen@student.codam.nl> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/05/28 14:26:29 by qmennen #+# #+# */
|
||||
/* Updated: 2025/06/03 19:22:47 by qmennen ### ########.fr */
|
||||
/* Updated: 2025/06/05 18:41:43 by qmennen ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -58,7 +58,6 @@ void handle_battery(t_game *game)
|
||||
{
|
||||
game->player->battery = 0;
|
||||
game->manager->state = GAME_STATE_MENU;
|
||||
// game_terminate(game);
|
||||
}
|
||||
draw_battery(game->screen->minimap, game->player->battery);
|
||||
}
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
/* By: qmennen <qmennen@student.codam.nl> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/15 18:53:19 by qmennen #+# #+# */
|
||||
/* Updated: 2025/06/04 18:49:17 by qmennen ### ########.fr */
|
||||
/* Updated: 2025/06/05 18:44:18 by qmennen ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -32,11 +32,11 @@ int player_create(t_game **game)
|
||||
void interact_door(t_game *game)
|
||||
{
|
||||
t_vec2_int pos;
|
||||
|
||||
|
||||
pos = vec2_to_int(add(game->player->pos, game->player->dir));
|
||||
if (game->map->grid[pos.y][pos.x] == TILE_DOOR)
|
||||
{
|
||||
game->map->grid[pos.y][pos.x] = TILE_EMPTY;
|
||||
game->scoreboard->tiles_visited++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* game_manager_utils.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: qmennen <qmennen@student.codam.nl> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2025/05/27 15:22:15 by qmennen #+# #+# */
|
||||
/* Updated: 2025/06/04 17:51:00 by whaffman ######## odam.nl */
|
||||
/* ::: :::::::: */
|
||||
/* game_manager_utils.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: qmennen <qmennen@student.codam.nl> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/05/27 15:22:15 by qmennen #+# #+# */
|
||||
/* Updated: 2025/06/05 18:44:32 by qmennen ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -39,6 +39,7 @@ void game_manager_handle_input(t_game_manager *manager)
|
||||
{
|
||||
(*manager->active_menu)->selected_option--;
|
||||
if ((*manager->active_menu)->selected_option < 0)
|
||||
(*manager->active_menu)->selected_option = (*manager->active_menu)->num_options - 1;
|
||||
(*manager->active_menu)->selected_option = (
|
||||
*manager->active_menu)->num_options - 1;
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
/* By: qmennen <qmennen@student.codam.nl> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/05/28 14:14:11 by qmennen #+# #+# */
|
||||
/* Updated: 2025/06/05 17:09:25 by qmennen ### ########.fr */
|
||||
/* Updated: 2025/06/05 18:44:51 by qmennen ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -43,7 +43,8 @@ t_menu *create_main_menu(t_game_manager *manager)
|
||||
};
|
||||
t_menu *menu;
|
||||
|
||||
menu = menu_create(manager, "./assets/menu/surveillor_background.png", menu_items);
|
||||
menu = menu_create(manager, "./assets/menu/surveillor_background.png",
|
||||
menu_items);
|
||||
if (!menu)
|
||||
return (NULL);
|
||||
return (menu);
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
/* By: qmennen <qmennen@student.codam.nl> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/05/27 14:31:53 by qmennen #+# #+# */
|
||||
/* Updated: 2025/06/03 20:16:52 by qmennen ### ########.fr */
|
||||
/* Updated: 2025/06/05 18:49:23 by qmennen ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -22,17 +22,7 @@ t_menu *menu_create(t_game_manager *manager, char *b_path,
|
||||
if (!menu)
|
||||
return (NULL);
|
||||
ft_memset(menu, 0, sizeof(t_menu));
|
||||
if (b_path)
|
||||
menu->background = menu_load_background(
|
||||
manager->game->screen->mlx, b_path);
|
||||
if (b_path && mlx_image_to_window(
|
||||
manager->game->screen->mlx, menu->background, 0, 0) < 0)
|
||||
{
|
||||
mlx_delete_image(manager->game->screen->mlx, menu->background);
|
||||
return (free(menu), NULL);
|
||||
}
|
||||
if (menu->background)
|
||||
menu->background->instances[0].enabled = false;
|
||||
menu_set_background(menu, manager->game->screen->mlx, b_path);
|
||||
menu->hidden = 1;
|
||||
i = -1;
|
||||
while (options[++i])
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
/* By: qmennen <qmennen@student.codam.nl> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/05/28 13:50:14 by qmennen #+# #+# */
|
||||
/* Updated: 2025/06/03 16:23:36 by qmennen ### ########.fr */
|
||||
/* Updated: 2025/06/05 18:50:10 by qmennen ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -24,7 +24,6 @@ t_menu_item *menu_item_create(t_screen *screen, const char *text,
|
||||
item->text = (char *)text;
|
||||
item->act = act;
|
||||
item->image = mlx_put_string(screen->mlx, text, 0, 0);
|
||||
// mlx_resize_image(item->image, 200, 50);
|
||||
item->image->instances[0].enabled = false;
|
||||
return (item);
|
||||
}
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
/* By: qmennen <qmennen@student.codam.nl> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/05/28 14:45:59 by qmennen #+# #+# */
|
||||
/* Updated: 2025/05/28 14:46:31 by qmennen ### ########.fr */
|
||||
/* Updated: 2025/06/05 18:47:58 by qmennen ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -28,3 +28,16 @@ mlx_image_t *menu_load_background(mlx_t *mlx, char *background_path)
|
||||
background_image = mlx_texture_to_image(mlx, background_texture);
|
||||
return (mlx_delete_texture(background_texture), background_image);
|
||||
}
|
||||
|
||||
void menu_set_background(t_menu *menu, mlx_t *mlx, char *b_path)
|
||||
{
|
||||
if (!menu || !b_path)
|
||||
return ;
|
||||
menu->background = menu_load_background(mlx, b_path);
|
||||
if (mlx_image_to_window(mlx, menu->background, 0, 0) < 0)
|
||||
{
|
||||
mlx_delete_image(mlx, menu->background);
|
||||
return ;
|
||||
}
|
||||
menu->background->instances[0].enabled = false;
|
||||
}
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
/* By: qmennen <qmennen@student.codam.nl> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/22 13:10:06 by whaffman #+# #+# */
|
||||
/* Updated: 2025/06/04 17:57:29 by qmennen ### ########.fr */
|
||||
/* Updated: 2025/06/05 17:15:42 by qmennen ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -16,7 +16,6 @@ mlx_texture_t *load_texture(const char *path)
|
||||
{
|
||||
mlx_texture_t *texture;
|
||||
|
||||
// printf("Loading texture: |%s|\n", path);
|
||||
texture = mlx_load_png(path);
|
||||
if (texture == NULL)
|
||||
{
|
||||
@ -29,7 +28,8 @@ mlx_texture_t *load_texture(const char *path)
|
||||
t_token_handler handle_config_token(const char *token, t_map *map)
|
||||
{
|
||||
const char *config_tokens[] = {
|
||||
"NO", "SO", "WE", "EA", "D", "F", "C", "FT", "CT", "-c", "-s", "-e", NULL
|
||||
"NO", "SO", "WE", "EA", "D", "F", "C", "FT", "CT", "-c", "-s", "-e",
|
||||
NULL
|
||||
};
|
||||
const t_token_handler handlers[] = {
|
||||
handle_wall, handle_wall, handle_wall, handle_wall, handle_wall,
|
||||
@ -39,7 +39,6 @@ t_token_handler handle_config_token(const char *token, t_map *map)
|
||||
int i;
|
||||
|
||||
i = 0;
|
||||
// printf("Token: %s\n", token);
|
||||
while (config_tokens[i] != NULL)
|
||||
{
|
||||
if (ft_strcmp(token, config_tokens[i]) == 0)
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
/* By: qmennen <qmennen@student.codam.nl> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/05/14 13:06:39 by whaffman #+# #+# */
|
||||
/* Updated: 2025/06/04 20:07:21 by qmennen ### ########.fr */
|
||||
/* Updated: 2025/06/05 17:01:36 by qmennen ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
||||
17
src/screen.c
17
src/screen.c
@ -6,7 +6,7 @@
|
||||
/* By: qmennen <qmennen@student.codam.nl> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/15 15:30:27 by qmennen #+# #+# */
|
||||
/* Updated: 2025/06/03 20:20:36 by qmennen ### ########.fr */
|
||||
/* Updated: 2025/06/05 17:15:05 by qmennen ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -77,14 +77,17 @@ int center_window(t_screen *screen)
|
||||
int screen_display(t_screen *screen)
|
||||
{
|
||||
int display_error;
|
||||
|
||||
fill_background(screen->background, 0x000000FF);
|
||||
|
||||
display_error = 0;
|
||||
display_error |= mlx_image_to_window(screen->mlx, screen->background, 0, 0) < 0;
|
||||
display_error |= mlx_image_to_window(screen->mlx, screen->img, 0, 0) < 0;
|
||||
display_error |= mlx_image_to_window(screen->mlx, screen->minimap, 175, 575) < 0;
|
||||
display_error |= mlx_image_to_window(screen->mlx, screen->hud, 0, 0) < 0;
|
||||
|
||||
display_error |= mlx_image_to_window(screen->mlx,
|
||||
screen->background, 0, 0) < 0;
|
||||
display_error |= mlx_image_to_window(screen->mlx,
|
||||
screen->img, 0, 0) < 0;
|
||||
display_error |= mlx_image_to_window(screen->mlx,
|
||||
screen->minimap, 175, 575) < 0;
|
||||
display_error |= mlx_image_to_window(screen->mlx,
|
||||
screen->hud, 0, 0) < 0;
|
||||
if (display_error || !center_window(screen))
|
||||
{
|
||||
printf(RED "Display failed to initialize\n" RESET);
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
/* By: qmennen <qmennen@student.codam.nl> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/05/08 18:27:59 by qmennen #+# #+# */
|
||||
/* Updated: 2025/06/03 19:34:08 by qmennen ### ########.fr */
|
||||
/* Updated: 2025/06/05 17:26:44 by qmennen ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -33,16 +33,21 @@ int load_uniforms(t_game **game)
|
||||
mlx_ctx_t *ctx;
|
||||
|
||||
ctx = (mlx_ctx_t *)(*game)->screen->mlx->context;
|
||||
(*game)->screen->u_time_location = glGetUniformLocation(ctx->shaderprogram, "u_time");
|
||||
(*game)->screen->u_battery_location = glGetUniformLocation(ctx->shaderprogram, "u_battery");
|
||||
(*game)->screen->u_hit_timer_location = glGetUniformLocation(ctx->shaderprogram, "u_hit_timer");
|
||||
(*game)->screen->u_enabled_location = glGetUniformLocation(ctx->shaderprogram, "u_enabled");
|
||||
(*game)->screen->u_resolution_location = glGetUniformLocation(ctx->shaderprogram, "u_resolution");
|
||||
if ((*game)->screen->u_time_location < 0 ||
|
||||
(*game)->screen->u_battery_location < 0 ||
|
||||
(*game)->screen->u_hit_timer_location < 0 ||
|
||||
(*game)->screen->u_enabled_location < 0 ||
|
||||
(*game)->screen->u_resolution_location < 0)
|
||||
(*game)->screen->u_time_location = glGetUniformLocation(
|
||||
ctx->shaderprogram, "u_time");
|
||||
(*game)->screen->u_battery_location = glGetUniformLocation(
|
||||
ctx->shaderprogram, "u_battery");
|
||||
(*game)->screen->u_hit_timer_location = glGetUniformLocation(
|
||||
ctx->shaderprogram, "u_hit_timer");
|
||||
(*game)->screen->u_enabled_location = glGetUniformLocation(
|
||||
ctx->shaderprogram, "u_enabled");
|
||||
(*game)->screen->u_resolution_location = glGetUniformLocation(
|
||||
ctx->shaderprogram, "u_resolution");
|
||||
if ((*game)->screen->u_time_location < 0
|
||||
|| (*game)->screen->u_battery_location < 0
|
||||
|| (*game)->screen->u_hit_timer_location < 0
|
||||
|| (*game)->screen->u_enabled_location < 0
|
||||
|| (*game)->screen->u_resolution_location < 0)
|
||||
return (FAILURE);
|
||||
return (SUCCESS);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user