Compare commits
6 commits
f0a2ec04b3
...
5454729293
Author | SHA1 | Date | |
---|---|---|---|
5454729293 | |||
6ef675d765 | |||
f07503e647 | |||
d4823a7832 | |||
783ac75683 | |||
7ab8734993 |
6 changed files with 16 additions and 17 deletions
10
Makefile
10
Makefile
|
@ -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)
|
||||
|
|
BIN
images/kirby.jpg
BIN
images/kirby.jpg
Binary file not shown.
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 81 KiB |
|
@ -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.);
|
||||
}
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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];
|
||||
|
|
8
window.c
8
window.c
|
@ -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 }
|
||||
};
|
||||
|
|
Reference in a new issue