Skip to content

Commit

Permalink
its alive
Browse files Browse the repository at this point in the history
  • Loading branch information
Iipal committed Jun 12, 2019
1 parent b6454bb commit eccdcf2
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 13 deletions.
4 changes: 2 additions & 2 deletions includes/wolf3d_sounds.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
/* */
/* ************************************************************************** */

Expand All @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions srcs/init/wolf_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
/* */
/* ************************************************************************** */

Expand Down Expand Up @@ -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);
Expand Down
5 changes: 2 additions & 3 deletions srcs/rendering/wolf_torch.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
/* */
/* ************************************************************************** */

Expand All @@ -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;

Expand All @@ -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)
Expand Down
12 changes: 6 additions & 6 deletions srcs/wolf_map_reader.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
/* */
/* ************************************************************************** */

Expand All @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit eccdcf2

Please sign in to comment.