From 617e0e54f11a2908c3749e898b420fb8000f4033 Mon Sep 17 00:00:00 2001 From: "Valeriano A.R." Date: Sun, 6 Oct 2024 14:36:43 +0200 Subject: [PATCH] Code formatting --- Example.GameLib/src/GameEnts.c | 2 +- Example.GameLib/src/GameMap.c | 2 +- src/Audio.c | 20 ++++++++++---------- src/Draw.h | 3 ++- src/lodepng.c | 2 +- 5 files changed, 15 insertions(+), 14 deletions(-) diff --git a/Example.GameLib/src/GameEnts.c b/Example.GameLib/src/GameEnts.c index 7a9241d..ebce181 100644 --- a/Example.GameLib/src/GameEnts.c +++ b/Example.GameLib/src/GameEnts.c @@ -176,4 +176,4 @@ void GameEnts_Init() { ent_Block->height = 64; ent_Block->fric_static = 0.0f; ent_Block->fric_dynamic = 0.2f; -} +} \ No newline at end of file diff --git a/Example.GameLib/src/GameMap.c b/Example.GameLib/src/GameMap.c index 2d2c730..7dbad45 100644 --- a/Example.GameLib/src/GameMap.c +++ b/Example.GameLib/src/GameMap.c @@ -75,7 +75,7 @@ int GameMap_LoadLevel(char *filename, int res) { // Build the map map = malloc(sizeof(char) * width * height); memset(map, 0, width * height); -#define MAP(x, y) map[(x) + ((y)*width)] +#define MAP(x, y) map[(x) + ((y) * width)] j = 0; do { len = ReadLine(file, line, MaxLineLen); diff --git a/src/Audio.c b/src/Audio.c index 3d0b310..bff10c9 100644 --- a/src/Audio.c +++ b/src/Audio.c @@ -67,11 +67,11 @@ int Audio_Init() { } // Open the audio device using the desired parameters - as.freq = 44100; - as.format = AUDIO_S16SYS; - as.channels = 2; - as.samples = 2048; - as.callback = Audio_MixerCallback; + as.freq = 44100; + as.format = AUDIO_S16SYS; + as.channels = 2; + as.samples = 2048; + as.callback = Audio_MixerCallback; g_AudioDeviceID = SDL_OpenAudioDevice(NULL, 0, &as, &as2, 0); if (g_AudioDeviceID == 0) { Print("ERROR: Audio_Init: Failure opening audio. %s\n", SDL_GetError()); @@ -110,7 +110,7 @@ static void Audio_MixerCallback(void *ud, uint8_t *stream, int l) { // Mix all the channels previousChannel = NULL; - chan = g_Channels; + chan = g_Channels; while (chan) { if (!chan->wave) { // Remove finished channels @@ -189,7 +189,7 @@ static void Audio_MixerCallback(void *ud, uint8_t *stream, int l) { // Next channel previousChannel = chan; - chan = chan->next; + chan = chan->next; } } @@ -335,11 +335,11 @@ AudioChn Audio_PlaySound(AudioSnd snd, float leftVolume, float rightVolume, int } // Initialize the channel - chan->wave = wave; - chan->pos = 0; + chan->wave = wave; + chan->pos = 0; chan->rightVolume = (uint8_t)(rightVolume * 255.0f); chan->leftVolume = (uint8_t)(leftVolume * 255.0f); - chan->loop = loop; + chan->loop = loop; // Include in sounds list chan->next = g_Channels; diff --git a/src/Draw.h b/src/Draw.h index e8c48f8..6101545 100644 --- a/src/Draw.h +++ b/src/Draw.h @@ -107,7 +107,8 @@ void Draw_DrawImgPartHoriz(DrawImg img, int x, int y, int w, int i, const float // // void Draw_ImgParallax( - DrawImg img, int imgSize[2], const int imgOffset[2], const float parallaxFactor[2], const int gamePos[2], const int gameSize[2]); + DrawImg img, int imgSize[2], const int imgOffset[2], const float parallaxFactor[2], const int gamePos[2], + const int gameSize[2]); ///////////////////////////// // Draw_SetColor diff --git a/src/lodepng.c b/src/lodepng.c index 74615ab..d4cc153 100644 --- a/src/lodepng.c +++ b/src/lodepng.c @@ -299,7 +299,7 @@ static void lodepng_set32bitInt(unsigned char *buffer, unsigned value) { buffer[0] = (unsigned char)((value >> 24) & 0xff); buffer[1] = (unsigned char)((value >> 16) & 0xff); buffer[2] = (unsigned char)((value >> 8) & 0xff); - buffer[3] = (unsigned char)((value)&0xff); + buffer[3] = (unsigned char)((value) & 0xff); } #endif /*defined(LODEPNG_COMPILE_PNG) || defined(LODEPNG_COMPILE_ENCODER)*/