Compare commits

..

No commits in common. "master" and "0.6.2_4" have entirely different histories.

15 changed files with 38 additions and 57 deletions

View file

@ -1,18 +1,3 @@
0.6.2_7 (2022-12-19)
====================
* Update Makefile.
0.6.2_6 (2020-12-30)
====================
* Update CFLAGS.
0.6.2_5 (2020-12-30)
====================
* Rename binary.
0.6.2_4 (2020-12-25) 0.6.2_4 (2020-12-25)
==================== ====================

View file

@ -1,10 +1,8 @@
# # Copyright (c) 2019-2020, yzrh <yzrh@noema.org>
# Copyright (c) 2019-2023, yzrh <yzrh@noema.org>
# #
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
#
src = snake-sdl.c collision.c game.c input.c renderer.c src = main.c collision.c game.c input.c renderer.c
inc = extern.h game.h input.h renderer.h screen.h version.h inc = extern.h game.h input.h renderer.h screen.h version.h
.ifdef GPIO .ifdef GPIO
@ -18,8 +16,8 @@ obj = ${src:.c=.o}
PREFIX = /usr/local PREFIX = /usr/local
CFLAGS = -O2 -pipe -flto -Wall -Wextra -Wno-unused-parameter CFLAGS = -O3 -march=native -pipe -flto=thin -Wall -Wno-unused-result
LDFLAGS = -Wl,-O2 -lpthread -lSDL2 -lSDL2_ttf LDFLAGS = -Wl,-O3 -lpthread -lSDL2 -lSDL2_ttf
.ifdef SOUND .ifdef SOUND
@ -33,20 +31,20 @@ CFLAGS += -I/usr/local/include
LDFLAGS += -L/usr/local/lib LDFLAGS += -L/usr/local/lib
all: ${obj} ${inc} all: ${obj} ${inc}
${CC} ${LDFLAGS} -o snake-sdl ${obj} ${CC} ${LDFLAGS} -o snake ${obj}
clean: clean:
rm -f snake-sdl ${obj} rm -f snake ${obj}
install: install:
install -d ${PREFIX}/bin install -d ${PREFIX}/bin
install -d ${PREFIX}/share/snake-sdl install -d ${PREFIX}/share/snake
install snake-sdl ${PREFIX}/bin install snake ${PREFIX}/bin
install -m644 ../contrib/font.ttf ${PREFIX}/share/snake-sdl install -m644 ../contrib/font.ttf ${PREFIX}/share/snake
install -m644 ../contrib/music.flac ${PREFIX}/share/snake-sdl install -m644 ../contrib/music.flac ${PREFIX}/share/snake
deinstall: deinstall:
rm -f ${PREFIX}/bin/snake-sdl rm -f ${PREFIX}/bin/snake
rm -rf ${PREFIX}/share/snake-sdl rm -rf ${PREFIX}/share/snake
.PHONY: all clean install deinstall .PHONY: all clean install deinstall

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021, yzrh <yzrh@noema.org> * Copyright (c) 2019-2020, yzrh <yzrh@noema.org>
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021, yzrh <yzrh@noema.org> * Copyright (c) 2019-2020, yzrh <yzrh@noema.org>
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021, yzrh <yzrh@noema.org> * Copyright (c) 2019-2020, yzrh <yzrh@noema.org>
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021, yzrh <yzrh@noema.org> * Copyright (c) 2019-2020, yzrh <yzrh@noema.org>
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021, yzrh <yzrh@noema.org> * Copyright (c) 2019-2020, yzrh <yzrh@noema.org>
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021, yzrh <yzrh@noema.org> * Copyright (c) 2019-2020, yzrh <yzrh@noema.org>
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021, yzrh <yzrh@noema.org> * Copyright (c) 2019-2020, yzrh <yzrh@noema.org>
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021, yzrh <yzrh@noema.org> * Copyright (c) 2019-2020, yzrh <yzrh@noema.org>
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2023, yzrh <yzrh@noema.org> * Copyright (c) 2019-2020, yzrh <yzrh@noema.org>
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
@ -108,22 +108,19 @@ static void*
handler_rendering(void *args) handler_rendering(void *args)
{ {
const SDL_Color fg = { const SDL_Color fg = {
.r = COLOUR_FOREGROUND_R, COLOUR_FOREGROUND_R,
.g = COLOUR_FOREGROUND_G, COLOUR_FOREGROUND_G,
.b = COLOUR_FOREGROUND_B, COLOUR_FOREGROUND_B
.a = 255
}; };
const SDL_Color bg = { const SDL_Color bg = {
.r = COLOUR_BACKGROUND_R, COLOUR_BACKGROUND_R,
.g = COLOUR_BACKGROUND_G, COLOUR_BACKGROUND_G,
.b = COLOUR_BACKGROUND_B, COLOUR_BACKGROUND_B
.a = 255
}; };
const SDL_Color bg_s = { const SDL_Color bg_s = {
.r = COLOUR_BACKGROUND_SHADE_R, COLOUR_BACKGROUND_SHADE_R,
.g = COLOUR_BACKGROUND_SHADE_G, COLOUR_BACKGROUND_SHADE_G,
.b = COLOUR_BACKGROUND_SHADE_B, COLOUR_BACKGROUND_SHADE_B
.a = 255
}; };
char result_str[23]; char result_str[23];
@ -944,7 +941,7 @@ int
main(void) main(void)
{ {
printf("Snake " VERSION "." RELEASE "." PATCH EXTRA "\n" printf("Snake " VERSION "." RELEASE "." PATCH EXTRA "\n"
"Copyright (c) 2019-2022, yzrh <yzrh@noema.org>\n"); "Copyright (c) 2019-2020, yzrh <yzrh@noema.org>\n");
if (SDL_Init(SDL_INIT_VIDEO | if (SDL_Init(SDL_INIT_VIDEO |
SDL_INIT_AUDIO | SDL_INIT_AUDIO |
@ -1418,7 +1415,8 @@ main(void)
text_score.cache = 0; text_score.cache = 0;
if (flappy) { if (flappy) {
delay.tv_nsec /= SCREEN_UNIT; delay.tv_nsec = TICK_TIME_INIT /
SCREEN_UNIT;
game_snake_init(&snake0, 0); game_snake_init(&snake0, 0);

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021, yzrh <yzrh@noema.org> * Copyright (c) 2019-2020, yzrh <yzrh@noema.org>
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021, yzrh <yzrh@noema.org> * Copyright (c) 2019-2020, yzrh <yzrh@noema.org>
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021, yzrh <yzrh@noema.org> * Copyright (c) 2019-2020, yzrh <yzrh@noema.org>
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2022, yzrh <yzrh@noema.org> * Copyright (c) 2019-2020, yzrh <yzrh@noema.org>
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
@ -7,4 +7,4 @@
#define VERSION "0" #define VERSION "0"
#define RELEASE "6" #define RELEASE "6"
#define PATCH "2" #define PATCH "2"
#define EXTRA "_7" #define EXTRA "_4"