Compare commits
No commits in common. "5454729293d872540ef8a3e663212d3f9095d7d7" and "f0a2ec04b3044fb639f5273ee763a1fffc2fbde8" have entirely different histories.
5454729293
...
f0a2ec04b3
6 changed files with 17 additions and 16 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 $@
|
||||
|
||||
# Version finale avec optimisations (défaut)
|
||||
$(PROGNAME): CFLAGS += -O3
|
||||
# Par défaut
|
||||
$(PROGNAME): CFLAGS += -Wall -Wextra -Wshadow -pedantic -g -Wsign-conversion -fanalyzer
|
||||
$(PROGNAME): compilation
|
||||
|
||||
# Débug
|
||||
debug: CFLAGS += -Wall -Wextra -Wshadow -pedantic -g -Wsign-conversion -fanalyzer
|
||||
debug: compilation
|
||||
# Version finale avec optimisations
|
||||
release: CFLAGS += -O3
|
||||
release: compilation
|
||||
|
||||
compilation: $(OBJ)
|
||||
$(CC) $(OBJ) $(LDFLAGS) -o $(PROGNAME)
|
||||
|
|
BIN
images/kirby.jpg
BIN
images/kirby.jpg
Binary file not shown.
Before Width: | Height: | Size: 81 KiB After Width: | Height: | Size: 62 KiB |
|
@ -13,7 +13,7 @@ void callback(void *_, Uint8 *stream, int taille) {
|
|||
(void)_;
|
||||
|
||||
int i = 0;
|
||||
double moyenne_calcul = 0.;
|
||||
float moyenne_calcul = 0.f;
|
||||
for(signed short *stream16 = (signed short *)stream; i < taille / 2; ++i) {
|
||||
moyenne_calcul += stream16[i] / ((1 << 15) - 1.);
|
||||
}
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
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:
|
||||
|
@ -53,7 +52,6 @@ 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();
|
||||
|
@ -67,8 +65,8 @@ void kirbyRotation(int etat) {
|
|||
|
||||
glUseProgram(0);
|
||||
|
||||
a += 2;
|
||||
b += 0.012f;
|
||||
a += 6;
|
||||
printf("rot=%d\n", 135-a);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -78,6 +76,7 @@ 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:
|
||||
|
@ -135,6 +134,8 @@ 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 / 7.f;
|
||||
s -= s / 20.f;
|
||||
}
|
||||
if(s < musique[2]) {
|
||||
s += s / 7.f;
|
||||
s += s / 20.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 },
|
||||
{ 1700, kirbyRotation, NULL, NULL},
|
||||
{ 5000, kirby, NULL, NULL }, */
|
||||
{ 1000, kirbyRotation, NULL, NULL},
|
||||
{ 3000, kirbyCredits, NULL, NULL},
|
||||
{ 0, NULL, NULL, NULL }
|
||||
};
|
||||
|
|
Reference in a new issue