Compare commits

..

6 commits

Author SHA1 Message Date
5454729293
trim space 2022-05-19 17:28:53 +02:00
6ef675d765
Make default the release one 2022-05-19 17:20:17 +02:00
f07503e647
fix type 2022-05-19 17:10:04 +02:00
d4823a7832
Add credits 2022-05-19 17:07:10 +02:00
783ac75683
fix kirby size 2022-05-19 17:07:05 +02:00
7ab8734993
fix animations timing 2022-05-19 17:06:51 +02:00
6 changed files with 16 additions and 17 deletions

View file

@ -54,13 +54,13 @@ LDFLAGS += -lGL4Dummies $(shell sdl2-config --libs) -lSDL2_mixer -lSDL2_image
%.o: %.c
$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@
# Par défaut
$(PROGNAME): CFLAGS += -Wall -Wextra -Wshadow -pedantic -g -Wsign-conversion -fanalyzer
# Version finale avec optimisations (défaut)
$(PROGNAME): CFLAGS += -O3
$(PROGNAME): compilation
# Version finale avec optimisations
release: CFLAGS += -O3
release: compilation
# Débug
debug: CFLAGS += -Wall -Wextra -Wshadow -pedantic -g -Wsign-conversion -fanalyzer
debug: compilation
compilation: $(OBJ)
$(CC) $(OBJ) $(LDFLAGS) -o $(PROGNAME)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 81 KiB

View file

@ -13,7 +13,7 @@ void callback(void *_, Uint8 *stream, int taille) {
(void)_;
int i = 0;
float moyenne_calcul = 0.f;
double moyenne_calcul = 0.;
for(signed short *stream16 = (signed short *)stream; i < taille / 2; ++i) {
moyenne_calcul += stream16[i] / ((1 << 15) - 1.);
}

View file

@ -7,6 +7,7 @@
void kirbyRotation(int etat) {
static GLuint boule = 0, proc_id = 0, tex_id = 0;
static int a = 0;
static GLfloat b = 0.f;
switch(etat) {
case GL4DH_INIT:
@ -52,6 +53,7 @@ void kirbyRotation(int etat) {
gl4duPushMatrix();
gl4duRotatef(135 - a, 0, 1, 0);
gl4duScalef(.23f + b, .23f + b, .23f + b);
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
gl4duSendMatrices();
@ -65,8 +67,8 @@ void kirbyRotation(int etat) {
glUseProgram(0);
a += 6;
printf("rot=%d\n", 135-a);
a += 2;
b += 0.012f;
break;
default:
@ -76,7 +78,6 @@ void kirbyRotation(int etat) {
void kirbyCredits(int etat) {
static GLuint boule = 0, proc_id = 0, tex_id = 0;
static int a = 0;
switch(etat) {
case GL4DH_INIT:
@ -134,8 +135,6 @@ void kirbyCredits(int etat) {
gl4duPopMatrix();
glUseProgram(0);
a += 7;
break;
default:

View file

@ -57,10 +57,10 @@ void kirby(int etat) {
if(musique[0] != 0 || musique[1] != 0) {
s = (s - musique[0]) / (musique[1] - musique[0]) + .2f;
if(s > musique[2]) {
s -= s / 20.f;
s -= s / 7.f;
}
if(s < musique[2]) {
s += s / 20.f;
s += s / 7.f;
}
}
musique[1] = musique[1] < s ? s : musique[1];

View file

@ -5,7 +5,7 @@
#include "includes/animations.h"
// Son de fond
static Mix_Music * ambiance = NULL;
static Mix_Music *ambiance = NULL;
// Comportement à la fermeture du programme
void fermeture(void) {
@ -25,11 +25,11 @@ int main(int argc, char *argv[]) {
// Animations
GL4DHanime animations[] = {
/* { 6800, cube, NULL, NULL },
{ 6800, cube, NULL, NULL },
{ 8500, voronoi, NULL, NULL },
{ 6000, polygone, NULL, NULL },
{ 5000, kirby, NULL, NULL }, */
{ 1000, kirbyRotation, NULL, NULL},
{ 5000, kirby, NULL, NULL },
{ 1700, kirbyRotation, NULL, NULL},
{ 3000, kirbyCredits, NULL, NULL},
{ 0, NULL, NULL, NULL }
};