Code formatting
This commit is contained in:
@@ -176,4 +176,4 @@ void GameEnts_Init() {
|
|||||||
ent_Block->height = 64;
|
ent_Block->height = 64;
|
||||||
ent_Block->fric_static = 0.0f;
|
ent_Block->fric_static = 0.0f;
|
||||||
ent_Block->fric_dynamic = 0.2f;
|
ent_Block->fric_dynamic = 0.2f;
|
||||||
}
|
}
|
||||||
@@ -75,7 +75,7 @@ int GameMap_LoadLevel(char *filename, int res) {
|
|||||||
// Build the map
|
// Build the map
|
||||||
map = malloc(sizeof(char) * width * height);
|
map = malloc(sizeof(char) * width * height);
|
||||||
memset(map, 0, 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;
|
j = 0;
|
||||||
do {
|
do {
|
||||||
len = ReadLine(file, line, MaxLineLen);
|
len = ReadLine(file, line, MaxLineLen);
|
||||||
|
|||||||
20
src/Audio.c
20
src/Audio.c
@@ -67,11 +67,11 @@ int Audio_Init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Open the audio device using the desired parameters
|
// Open the audio device using the desired parameters
|
||||||
as.freq = 44100;
|
as.freq = 44100;
|
||||||
as.format = AUDIO_S16SYS;
|
as.format = AUDIO_S16SYS;
|
||||||
as.channels = 2;
|
as.channels = 2;
|
||||||
as.samples = 2048;
|
as.samples = 2048;
|
||||||
as.callback = Audio_MixerCallback;
|
as.callback = Audio_MixerCallback;
|
||||||
g_AudioDeviceID = SDL_OpenAudioDevice(NULL, 0, &as, &as2, 0);
|
g_AudioDeviceID = SDL_OpenAudioDevice(NULL, 0, &as, &as2, 0);
|
||||||
if (g_AudioDeviceID == 0) {
|
if (g_AudioDeviceID == 0) {
|
||||||
Print("ERROR: Audio_Init: Failure opening audio. %s\n", SDL_GetError());
|
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
|
// Mix all the channels
|
||||||
previousChannel = NULL;
|
previousChannel = NULL;
|
||||||
chan = g_Channels;
|
chan = g_Channels;
|
||||||
while (chan) {
|
while (chan) {
|
||||||
if (!chan->wave) {
|
if (!chan->wave) {
|
||||||
// Remove finished channels
|
// Remove finished channels
|
||||||
@@ -189,7 +189,7 @@ static void Audio_MixerCallback(void *ud, uint8_t *stream, int l) {
|
|||||||
|
|
||||||
// Next channel
|
// Next channel
|
||||||
previousChannel = chan;
|
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
|
// Initialize the channel
|
||||||
chan->wave = wave;
|
chan->wave = wave;
|
||||||
chan->pos = 0;
|
chan->pos = 0;
|
||||||
chan->rightVolume = (uint8_t)(rightVolume * 255.0f);
|
chan->rightVolume = (uint8_t)(rightVolume * 255.0f);
|
||||||
chan->leftVolume = (uint8_t)(leftVolume * 255.0f);
|
chan->leftVolume = (uint8_t)(leftVolume * 255.0f);
|
||||||
chan->loop = loop;
|
chan->loop = loop;
|
||||||
|
|
||||||
// Include in sounds list
|
// Include in sounds list
|
||||||
chan->next = g_Channels;
|
chan->next = g_Channels;
|
||||||
|
|||||||
@@ -107,7 +107,8 @@ void Draw_DrawImgPartHoriz(DrawImg img, int x, int y, int w, int i, const float
|
|||||||
//
|
//
|
||||||
//
|
//
|
||||||
void Draw_ImgParallax(
|
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
|
// Draw_SetColor
|
||||||
|
|||||||
@@ -299,7 +299,7 @@ static void lodepng_set32bitInt(unsigned char *buffer, unsigned value) {
|
|||||||
buffer[0] = (unsigned char)((value >> 24) & 0xff);
|
buffer[0] = (unsigned char)((value >> 24) & 0xff);
|
||||||
buffer[1] = (unsigned char)((value >> 16) & 0xff);
|
buffer[1] = (unsigned char)((value >> 16) & 0xff);
|
||||||
buffer[2] = (unsigned char)((value >> 8) & 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)*/
|
#endif /*defined(LODEPNG_COMPILE_PNG) || defined(LODEPNG_COMPILE_ENCODER)*/
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user