-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
12 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
/* By: tmaluh <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2019/04/09 16:29:12 by tmaluh #+# #+# */ | ||
/* Updated: 2019/04/09 16:29:37 by tmaluh ### ########.fr */ | ||
/* Updated: 2019/06/12 15:15:14 by tmaluh ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
|
@@ -31,7 +31,7 @@ | |
/* | ||
** Game background music. | ||
*/ | ||
# define AMBIENT_BG "resources/music/ambient_game_bg.mp3" | ||
# define AMBIENT_BG "resources/music/ambient_game_bg.wav" | ||
|
||
/* | ||
** When player walking, left step sound. | ||
|
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: tmaluh <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2019/02/06 14:38:13 by tmaluh #+# #+# */ | ||
/* Updated: 2019/06/11 21:51:04 by tmaluh ### ########.fr */ | ||
/* Updated: 2019/06/12 11:25:59 by tmaluh ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
|
@@ -55,12 +55,12 @@ static bool add_init_audio(t_env *env) | |
MEM(t_sfx, env->sfx, 1, E_ALLOC); | ||
*(env->sfx) = (t_sfx){NULL, NULL, NULL, NULL, NULL, NULL, | ||
{0, 0, 0}, BG_VOL_DEF}; | ||
NOM_F(Mix_GetError(), env->sfx->ambient_bg = Mix_LoadMUS(AMBIENT_BG)); | ||
NOM_F(Mix_GetError(), env->sfx->start = Mix_LoadWAV(MSTART)); | ||
NOM_F(Mix_GetError(), env->sfx->selector = Mix_LoadWAV(MSELECTOR)); | ||
NOM_F(Mix_GetError(), env->sfx->selector_err = Mix_LoadWAV(MSERROR)); | ||
NOM_F(Mix_GetError(), env->sfx->lstep = Mix_LoadWAV(GAME_LSTEP)); | ||
NOM_F(Mix_GetError(), env->sfx->rstep = Mix_LoadWAV(GAME_RSTEP)); | ||
NOM_F(Mix_GetError(), env->sfx->ambient_bg = Mix_LoadMUS(AMBIENT_BG)); | ||
Mix_VolumeChunk(env->sfx->lstep, 35); | ||
Mix_VolumeChunk(env->sfx->rstep, 35); | ||
Mix_PlayMusic(env->sfx->ambient_bg, -1); | ||
|
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: tmaluh <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2019/03/16 22:08:27 by tmaluh #+# #+# */ | ||
/* Updated: 2019/06/11 22:35:58 by tmaluh ### ########.fr */ | ||
/* Updated: 2019/06/12 16:47:29 by tmaluh ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
|
@@ -16,7 +16,7 @@ void wolf_rendering_torch(t_torch *torch, Uint32 *win_pxls, uint8_t fog_freq) | |
{ | ||
static uint8_t old_torch_frame; | ||
static uint8_t torch_frame; | ||
fpoint torch_shift; | ||
const fpoint torch_shift = (fpoint){TORCH_SHIFT_Y, TORCH_SHIFT_X}; | ||
point tp; | ||
point p; | ||
|
||
|
@@ -27,7 +27,6 @@ void wolf_rendering_torch(t_torch *torch, Uint32 *win_pxls, uint8_t fog_freq) | |
} | ||
tp.y = -1; | ||
p.y = torch_shift.y; | ||
torch_shift = (fpoint){TORCH_SHIFT_Y, TORCH_SHIFT_X}; | ||
while (WIN_Y > ++(p.y) && (tp.x = -1) | ||
&& torch->tex[torch_frame].surf->h > ++tp.y && (p.x = torch_shift.x)) | ||
while (++p.x < WIN_X && ++tp.x < torch->tex[torch_frame].surf->w) | ||
|
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: tmaluh <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2019/02/06 17:18:56 by tmaluh #+# #+# */ | ||
/* Updated: 2019/06/11 23:01:21 by tmaluh ### ########.fr */ | ||
/* Updated: 2019/06/12 16:45:26 by tmaluh ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
|
@@ -27,7 +27,7 @@ static bool add_save_map(string line, int8_t *map_line, | |
if (ft_isdigit(*line)) | ||
{ | ||
map_line[++x] = ft_atoi(line); | ||
NO_F(!(map_line[x] < 0 || map_line[x] > MAX_TEXTURES)); | ||
IF_F(0 > map_line[x] < 0 || MAX_TEXTURES < map_line[x]); | ||
colors_line[x] = colors[map_line[x] - 1]; | ||
temp_digits = ft_itoa(map_line[x]); | ||
digits = ft_strlen(temp_digits); | ||
|
@@ -132,10 +132,10 @@ bool wolf_readnsave(string map_name, t_env *env) | |
{ | ||
IFDOMR(E_IMAP, add_valid_inline_numbers(gnl_temp) != env->map->size.x, | ||
ft_strdel(&gnl_temp), false); | ||
IFDOMR(E_IMAP, add_save_map(gnl_temp, MAP[i], MAPC[i], | ||
env->map->size.x), ft_strdel(&gnl_temp), false); | ||
IFDOMR(E_ENDMAP, add_endofmap(env, i, (point){MAPY, env->map->size.x}, | ||
false), ft_strdel(&gnl_temp), false); | ||
NODOM_F(E_IMAP, add_save_map(gnl_temp, MAP[i], MAPC[i], | ||
env->map->size.x), ft_strdel(&gnl_temp)); | ||
NODOM_F(E_ENDMAP, add_endofmap(env, i, (point){MAPY, env->map->size.x}, | ||
false), ft_strdel(&gnl_temp)); | ||
ft_strdel(&gnl_temp); | ||
} | ||
close(fd); | ||
|