camel case

This commit is contained in:
Mylloon 2023-05-23 13:11:34 +02:00
parent fc1e5e40f9
commit d1c392d27d
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
7 changed files with 20 additions and 19 deletions

View file

@ -18,10 +18,10 @@ void tag(const int);
void credits(const int); void credits(const int);
// Initialisation des transitions // Initialisation des transitions
void transitions_init(void); void transitionsInit(void);
// Transition zoom // Transition zoom
void zoom_in(void (*)(int), void (*)(int), Uint32, Uint32, int); void zoomIn(void (*)(int), void (*)(int), Uint32, Uint32, const int);
// Personnage // Personnage
struct manifestant { struct manifestant {

View file

@ -28,12 +28,12 @@ void bindAndLoadf(const char *name);
void move(const GLfloat x, const GLfloat y, const GLfloat z); void move(const GLfloat x, const GLfloat y, const GLfloat z);
// Rotate a vector XYZ // Rotate a vector XYZ
void rotate_vec(GLfloat *, const GLfloat); void rotateVec(GLfloat *, const GLfloat);
// Load an image into a GL texture // 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 // Copy a texture
void copy_texture(const GLuint, const GLuint); void copyTexture(const GLuint, const GLuint);
#endif #endif

6
main.c
View file

@ -21,9 +21,9 @@ int main(const int argc, char *argv[]) {
// Animations // Animations
GL4DHanime animations[] = {{10000, manif, NULL, NULL}, // Manifestation GL4DHanime animations[] = {{10000, manif, NULL, NULL}, // Manifestation
{2000, manif, tag, zoom_in}, // Transition {2000, manif, tag, zoomIn}, // Transition
{10000, tag, NULL, NULL}, // Tag {10000, tag, NULL, NULL}, // Tag
{2000, tag, credits, zoom_in}, // Transition {2000, tag, credits, zoomIn}, // Transition
{9500, credits, NULL, NULL}, // Crédits {9500, credits, NULL, NULL}, // Crédits
{0, NULL, NULL, NULL}}; {0, NULL, NULL, NULL}};
@ -44,7 +44,7 @@ static void init(void) {
srand((Uint32)time(NULL)); srand((Uint32)time(NULL));
transitions_init(); transitionsInit();
printf("Bienvenue dans la démo API8 !\n"); printf("Bienvenue dans la démo API8 !\n");
} }

View file

@ -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) { if (!_quadId) {
_quadId = gl4dgGenQuadf(); _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) { switch (state) {
case GL4DH_INIT: case GL4DH_INIT:
zoomin_init(); zoomin_init();

View file

@ -86,7 +86,7 @@ static void draw(void) {
float offset = 2; // we make sure that lights never eats the ground float offset = 2; // we make sure that lights never eats the ground
GLfloat lumpos_i[] = {(_herosId[i].ox / 10) + (deplacement / 10), 1, GLfloat lumpos_i[] = {(_herosId[i].ox / 10) + (deplacement / 10), 1,
((_herosId[i].oz / 20) - 1) - offset}; ((_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)); memcpy(lumpos[i], lumpos_i, sizeof(lumpos_i));
// Color // Color

View file

@ -36,8 +36,8 @@ static void init(void) {
_pId = gl4duCreateProgram("<vs>shaders/tag.vs", "<fs>shaders/tag.fs", NULL); _pId = gl4duCreateProgram("<vs>shaders/tag.vs", "<fs>shaders/tag.fs", NULL);
glGenTextures(2, _texId); glGenTextures(2, _texId);
load_img("images/wall.png", _texId[0]); loadImg("images/wall.png", _texId[0]);
copy_texture(_texId[0], _texId[1]); copyTexture(_texId[0], _texId[1]);
TTF_Font *font = NULL; TTF_Font *font = NULL;
if (initFont(&font, "fonts/Instrument.ttf", 100)) { if (initFont(&font, "fonts/Instrument.ttf", 100)) {

View file

@ -18,7 +18,7 @@ void move(const GLfloat x, const GLfloat y, const GLfloat z) {
gl4duTranslatef(x, y, 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 y = vec[1];
GLfloat z = vec[2]; GLfloat z = vec[2];
@ -29,7 +29,7 @@ void rotate_vec(GLfloat *vec, const GLfloat angle) {
vec[2] = y * sinTheta + z * cosTheta; 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); glBindTexture(GL_TEXTURE_2D, texture);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); 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); 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)) { if (!(src || dst)) {
fprintf(stderr, fprintf(stderr,
"Erreur copie texture: Source/Destination pas initalisée\n"); "Erreur copie texture: Source/Destination pas initalisée\n");