-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[0.22.10] - removed mark dirty system
- Loading branch information
1 parent
2ea08c2
commit bb11aae
Showing
14 changed files
with
24 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
/* By: freddy <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2024/05/28 08:45:22 by freddy #+# #+# */ | ||
/* Updated: 2024/06/27 22:37:27 by freddy ### ########.fr */ | ||
/* Updated: 2024/06/28 13:17:49 by freddy ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
|
@@ -22,7 +22,6 @@ | |
# define DEBUG false | ||
# define LOG_WALLS false | ||
# define TERMINAL_MAP true | ||
# define MARK_DIRTY_LOGGING false | ||
|
||
// --- Debug | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
/* ************************************************************************** */ | ||
/* */ | ||
/* ::: :::::::: */ | ||
/* PROJECTILE_NTTntity.c :+: :+: :+: */ | ||
/* projectile_entity.c :+: :+: :+: */ | ||
/* +:+ +:+ +:+ */ | ||
/* By: freddy <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2024/06/26 13:56:45 by fschuber #+# #+# */ | ||
/* Updated: 2024/06/27 22:34:52 by freddy ### ########.fr */ | ||
/* Updated: 2024/06/28 13:18:24 by freddy ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
|
@@ -35,13 +35,9 @@ void tick_projectile(t_entity *self) | |
if (!is_position_valid(new_pos.x, new_pos.y)) | ||
{ | ||
self->to_be_deleted = true; | ||
game()->dirty = true; | ||
return ; | ||
} | ||
self->transform.pos = new_pos; | ||
game()->dirty = true; | ||
if (MARK_DIRTY_LOGGING) | ||
logger(LOGGER_DIRTY, "Projectile moved, set dirty to true!\n"); | ||
} | ||
|
||
mlx_texture_t *get_texture_projectile(t_entity *self) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
/* By: freddy <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2024/05/28 10:23:28 by freddy #+# #+# */ | ||
/* Updated: 2024/06/27 18:54:57 by freddy ### ########.fr */ | ||
/* Updated: 2024/06/28 13:18:50 by freddy ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
|
@@ -33,18 +33,11 @@ void loop_hook(void *param) | |
// logger(LOGGER_WARNING, "skipped frame"); | ||
if ((int)curr_time != (int)prev_time || curr_frame != prev_frame) | ||
{ | ||
game()->dirty = false; | ||
handle_mouse_mv(); | ||
handle_player_move(); | ||
tick_entities(); | ||
collide_entities(); | ||
if (game()->dirty == true) | ||
{ | ||
if (MARK_DIRTY_LOGGING) | ||
logger(LOGGER_DIRTY, "State is dirty, rendering anew!"); | ||
render(); | ||
game()->dirty = false; | ||
} | ||
render(); | ||
game()->prev_time = curr_time; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,15 +6,15 @@ | |
/* By: freddy <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2024/05/21 08:49:10 by fschuber #+# #+# */ | ||
/* Updated: 2024/06/27 18:57:03 by freddy ### ########.fr */ | ||
/* Updated: 2024/06/28 13:19:15 by freddy ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
#include "../../include/cub3d.h" | ||
|
||
/* | ||
@brief prints a message to the console | ||
@param type - 'e' for error, 'w' for warning, 'i' for info, 's' for step, 'a' for action, 'd' for dirty | ||
@param type - 'e' for error, 'w' for warning, 'i' for info, 's' for step, 'a' for action | ||
@param message - the message to print | ||
*/ | ||
void logger(char type, char *message) | ||
|
@@ -31,8 +31,6 @@ void logger(char type, char *message) | |
printf("%sSTEP%s: \t%s\n", ANSI_BOLD_GREEN, ANSI_RESET, message); | ||
else if (type == 'a') | ||
printf("%sACTION%s: %s\n", ANSI_BOLD_MAGENTA, ANSI_RESET, message); | ||
else if (type == 'd') | ||
printf("%sDIRTY%s: \t%s\n", ANSI_BOLD_BLUE, ANSI_RESET, message); | ||
else | ||
printf("%s%s%s\n", ANSI_COLOR_WHITE, ANSI_RESET, message); | ||
} | ||
|