Code formatting

This commit is contained in:
2024-10-06 14:36:43 +02:00
parent d767b95d59
commit 617e0e54f1
5 changed files with 15 additions and 14 deletions

View File

@@ -176,4 +176,4 @@ void GameEnts_Init() {
ent_Block->height = 64;
ent_Block->fric_static = 0.0f;
ent_Block->fric_dynamic = 0.2f;
}
}

View File

@@ -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);

View File

@@ -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;

View File

@@ -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

View File

@@ -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)*/