fix kirby size

This commit is contained in:
Mylloon 2022-05-19 17:07:05 +02:00
parent 7ab8734993
commit 783ac75683
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
2 changed files with 6 additions and 7 deletions

View file

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

View file

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