From d1c392d27d80bfb4a590abf27e9bb0a395e77f47 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Tue, 23 May 2023 13:11:34 +0200 Subject: [PATCH] camel case --- includes/animations.h | 4 ++-- includes/utils.h | 6 +++--- main.c | 12 ++++++------ src/animations.c | 5 +++-- src/manif.c | 2 +- src/tag.c | 4 ++-- src/utils.c | 6 +++--- 7 files changed, 20 insertions(+), 19 deletions(-) diff --git a/includes/animations.h b/includes/animations.h index 85418ca..267de78 100644 --- a/includes/animations.h +++ b/includes/animations.h @@ -18,10 +18,10 @@ void tag(const int); void credits(const int); // Initialisation des transitions -void transitions_init(void); +void transitionsInit(void); // Transition zoom -void zoom_in(void (*)(int), void (*)(int), Uint32, Uint32, int); +void zoomIn(void (*)(int), void (*)(int), Uint32, Uint32, const int); // Personnage struct manifestant { diff --git a/includes/utils.h b/includes/utils.h index 9885997..320fab0 100644 --- a/includes/utils.h +++ b/includes/utils.h @@ -28,12 +28,12 @@ void bindAndLoadf(const char *name); void move(const GLfloat x, const GLfloat y, const GLfloat z); // Rotate a vector XYZ -void rotate_vec(GLfloat *, const GLfloat); +void rotateVec(GLfloat *, const GLfloat); // Load an image into a GL texture -void load_img(const char *filename, const GLuint texture); +void loadImg(const char *filename, const GLuint texture); // Copy a texture -void copy_texture(const GLuint, const GLuint); +void copyTexture(const GLuint, const GLuint); #endif diff --git a/main.c b/main.c index 3fcec86..fbb8c41 100644 --- a/main.c +++ b/main.c @@ -20,11 +20,11 @@ int main(const int argc, char *argv[]) { } // Animations - GL4DHanime animations[] = {{10000, manif, NULL, NULL}, // Manifestation - {2000, manif, tag, zoom_in}, // Transition - {10000, tag, NULL, NULL}, // Tag - {2000, tag, credits, zoom_in}, // Transition - {9500, credits, NULL, NULL}, // Crédits + GL4DHanime animations[] = {{10000, manif, NULL, NULL}, // Manifestation + {2000, manif, tag, zoomIn}, // Transition + {10000, tag, NULL, NULL}, // Tag + {2000, tag, credits, zoomIn}, // Transition + {9500, credits, NULL, NULL}, // Crédits {0, NULL, NULL, NULL}}; gl4dhInit(animations, _dims[0], _dims[1], init); @@ -44,7 +44,7 @@ static void init(void) { srand((Uint32)time(NULL)); - transitions_init(); + transitionsInit(); printf("Bienvenue dans la démo API8 !\n"); } diff --git a/src/animations.c b/src/animations.c index d9b37f3..af04ed1 100644 --- a/src/animations.c +++ b/src/animations.c @@ -18,13 +18,14 @@ static void update_with_audio(void (*a0)(int), void (*a1)(int), int state) { } } -void transitions_init(void) { +void transitionsInit(void) { if (!_quadId) { _quadId = gl4dgGenQuadf(); } } -void zoom_in(void (*a0)(int), void (*a1)(int), Uint32 t, Uint32 et, int state) { +void zoomIn(void (*a0)(int), void (*a1)(int), Uint32 t, Uint32 et, + const int state) { switch (state) { case GL4DH_INIT: zoomin_init(); diff --git a/src/manif.c b/src/manif.c index 1bdd1f1..9653047 100644 --- a/src/manif.c +++ b/src/manif.c @@ -86,7 +86,7 @@ static void draw(void) { float offset = 2; // we make sure that lights never eats the ground GLfloat lumpos_i[] = {(_herosId[i].ox / 10) + (deplacement / 10), 1, ((_herosId[i].oz / 20) - 1) - offset}; - rotate_vec(lumpos_i, ((float)sin(deplacement) + 1)); + rotateVec(lumpos_i, ((float)sin(deplacement) + 1)); memcpy(lumpos[i], lumpos_i, sizeof(lumpos_i)); // Color diff --git a/src/tag.c b/src/tag.c index b1ec2d3..347284f 100644 --- a/src/tag.c +++ b/src/tag.c @@ -36,8 +36,8 @@ static void init(void) { _pId = gl4duCreateProgram("shaders/tag.vs", "shaders/tag.fs", NULL); glGenTextures(2, _texId); - load_img("images/wall.png", _texId[0]); - copy_texture(_texId[0], _texId[1]); + loadImg("images/wall.png", _texId[0]); + copyTexture(_texId[0], _texId[1]); TTF_Font *font = NULL; if (initFont(&font, "fonts/Instrument.ttf", 100)) { diff --git a/src/utils.c b/src/utils.c index 22fbf1c..58c3245 100644 --- a/src/utils.c +++ b/src/utils.c @@ -18,7 +18,7 @@ void move(const GLfloat x, const GLfloat y, const GLfloat z) { gl4duTranslatef(x, y, z); } -void rotate_vec(GLfloat *vec, const GLfloat angle) { +void rotateVec(GLfloat *vec, const GLfloat angle) { GLfloat y = vec[1]; GLfloat z = vec[2]; @@ -29,7 +29,7 @@ void rotate_vec(GLfloat *vec, const GLfloat angle) { vec[2] = y * sinTheta + z * cosTheta; } -void load_img(const char *filename, const GLuint texture) { +void loadImg(const char *filename, const GLuint texture) { glBindTexture(GL_TEXTURE_2D, texture); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); @@ -53,7 +53,7 @@ void load_img(const char *filename, const GLuint texture) { glBindTexture(GL_TEXTURE_2D, 0); } -void copy_texture(const GLuint src, const GLuint dst) { +void copyTexture(const GLuint src, const GLuint dst) { if (!(src || dst)) { fprintf(stderr, "Erreur copie texture: Source/Destination pas initalisée\n");