Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
File style cleanup for the SDL 2.0 release
  • Loading branch information
slouken committed May 18, 2013
1 parent d8d8542 commit e81108d
Show file tree
Hide file tree
Showing 376 changed files with 18,163 additions and 18,374 deletions.
12 changes: 6 additions & 6 deletions Xcode-iOS/Demos/src/accelerometer.c
@@ -1,7 +1,7 @@
/*
* accelerometer.c
* written by Holmes Futrell
* use however you want
* accelerometer.c
* written by Holmes Futrell
* use however you want
*/

#include "SDL.h"
Expand All @@ -13,7 +13,7 @@
#define FRICTION 0.0008f /* coefficient of acceleration that opposes direction of motion */
#define GRAVITY_CONSTANT 0.004f /* how sensitive the ship is to the accelerometer */

/* If we aren't on an iPhone, then this definition ought to yield reasonable behavior */
/* If we aren't on an iPhone, then this definition ought to yield reasonable behavior */
#ifndef SDL_IPHONE_MAX_GFORCE
#define SDL_IPHONE_MAX_GFORCE 5.0f
#endif
Expand Down Expand Up @@ -48,7 +48,7 @@ render(SDL_Renderer *renderer)
#define SINT16_MAX ((float)(0x7FFF))

/* update velocity from accelerometer
the factor SDL_IPHONE_MAX_G_FORCE / SINT16_MAX converts between
the factor SDL_IPHONE_MAX_G_FORCE / SINT16_MAX converts between
SDL's units reported from the joytick, and units of g-force, as reported by the accelerometer
*/
shipData.vx +=
Expand Down Expand Up @@ -159,7 +159,7 @@ main(int argc, char *argv[])
{

SDL_Window *window; /* main window */
SDL_Renderer *renderer;
SDL_Renderer *renderer;
Uint32 startFrame; /* time frame began to process */
Uint32 endFrame; /* time frame ended processing */
Uint32 delay; /* time to pause waiting to draw next frame */
Expand Down
14 changes: 7 additions & 7 deletions Xcode-iOS/Demos/src/common.c
@@ -1,16 +1,16 @@
/*
* common.c
* written by Holmes Futrell
* use however you want
* common.c
* written by Holmes Futrell
* use however you want
*/

#include "common.h"
#include "SDL.h"
#include <stdlib.h>

/*
Produces a random int x, min <= x <= max
following a uniform distribution
Produces a random int x, min <= x <= max
following a uniform distribution
*/
int
randomInt(int min, int max)
Expand All @@ -19,8 +19,8 @@ randomInt(int min, int max)
}

/*
Produces a random float x, min <= x <= max
following a uniform distribution
Produces a random float x, min <= x <= max
following a uniform distribution
*/
float
randomFloat(float min, float max)
Expand Down
6 changes: 3 additions & 3 deletions Xcode-iOS/Demos/src/common.h
@@ -1,7 +1,7 @@
/*
* common.h
* written by Holmes Futrell
* use however you want
* common.h
* written by Holmes Futrell
* use however you want
*/

#define SCREEN_WIDTH 320
Expand Down
40 changes: 20 additions & 20 deletions Xcode-iOS/Demos/src/fireworks.c
@@ -1,7 +1,7 @@
/*
* fireworks.c
* written by Holmes Futrell
* use however you want
* fireworks.c
* written by Holmes Futrell
* use however you want
*/

#include "SDL.h"
Expand All @@ -17,11 +17,11 @@

static GLuint particleTextureID; /* OpenGL particle texture id */
static SDL_bool pointSizeExtensionSupported; /* is GL_OES_point_size_array supported ? */
/*
used to describe what type of particle a given struct particle is.
emitter - this particle flies up, shooting off trail particles, then finally explodes into dust particles.
trail - shoots off, following emitter particle
dust - radiates outwards from emitter explosion
/*
used to describe what type of particle a given struct particle is.
emitter - this particle flies up, shooting off trail particles, then finally explodes into dust particles.
trail - shoots off, following emitter particle
dust - radiates outwards from emitter explosion
*/
enum particleType
{
Expand All @@ -30,7 +30,7 @@ enum particleType
dust
};
/*
struct particle is used to describe each particle displayed on screen
struct particle is used to describe each particle displayed on screen
*/
struct particle
{
Expand All @@ -57,8 +57,8 @@ int nextPowerOfTwo(int x);
void drawParticles();
void stepParticles(void);

/* helper function (used in texture loading)
returns next power of two greater than or equal to x
/* helper function (used in texture loading)
returns next power of two greater than or equal to x
*/
int
nextPowerOfTwo(int x)
Expand All @@ -70,8 +70,8 @@ nextPowerOfTwo(int x)
return val;
}

/*
steps each active particle by timestep MILLESECONDS_PER_FRAME
/*
steps each active particle by timestep MILLESECONDS_PER_FRAME
*/
void
stepParticles(void)
Expand Down Expand Up @@ -145,13 +145,13 @@ stepParticles(void)
curr++;
}
/* the number of active particles is computed as the difference between
old number of active particles, where slot points, and the
old number of active particles, where slot points, and the
new size of the array, where particles points */
num_active_particles = slot - particles;
}

/*
This draws all the particles shown on screen
This draws all the particles shown on screen
*/
void
drawParticles()
Expand All @@ -177,7 +177,7 @@ drawParticles()
}

/*
This causes an emitter to explode in a circular bloom of dust particles
This causes an emitter to explode in a circular bloom of dust particles
*/
void
explodeEmitter(struct particle *emitter)
Expand Down Expand Up @@ -219,7 +219,7 @@ explodeEmitter(struct particle *emitter)
}

/*
This spawns a trail particle from an emitter
This spawns a trail particle from an emitter
*/
void
spawnTrailFromEmitter(struct particle *emitter)
Expand Down Expand Up @@ -254,7 +254,7 @@ spawnTrailFromEmitter(struct particle *emitter)
}

/*
spawns a new emitter particle at the bottom of the screen
spawns a new emitter particle at the bottom of the screen
destined for the point (x,y).
*/
void
Expand Down Expand Up @@ -313,7 +313,7 @@ initializeParticles(void)
}

/*
loads the particle texture
loads the particle texture
*/
void
initializeTexture()
Expand Down Expand Up @@ -375,7 +375,7 @@ main(int argc, char *argv[])
}
/* seed the random number generator */
srand(time(NULL));
/*
/*
request some OpenGL parameters
that may speed drawing
*/
Expand Down
14 changes: 7 additions & 7 deletions Xcode-iOS/Demos/src/happy.c
@@ -1,7 +1,7 @@
/*
* happy.c
* written by Holmes Futrell
* use however you want
* happy.c
* written by Holmes Futrell
* use however you want
*/

#include "SDL.h"
Expand All @@ -20,8 +20,8 @@ static struct
} faces[NUM_HAPPY_FACES];

/*
Sets initial positions and velocities of happyfaces
units of velocity are pixels per millesecond
Sets initial positions and velocities of happyfaces
units of velocity are pixels per millesecond
*/
void
initializeHappyFaces()
Expand Down Expand Up @@ -94,7 +94,7 @@ render(SDL_Renderer *renderer)
}

/*
loads the happyface graphic into a texture
loads the happyface graphic into a texture
*/
void
initializeTexture(SDL_Renderer *renderer)
Expand Down Expand Up @@ -125,7 +125,7 @@ main(int argc, char *argv[])
{

SDL_Window *window;
SDL_Renderer *renderer;
SDL_Renderer *renderer;
Uint32 startFrame;
Uint32 endFrame;
Uint32 delay;
Expand Down
26 changes: 13 additions & 13 deletions Xcode-iOS/Demos/src/keyboard.c
@@ -1,7 +1,7 @@
/*
* keyboard.c
* written by Holmes Futrell
* use however you want
* keyboard.c
* written by Holmes Futrell
* use however you want
*/

#import "SDL.h"
Expand Down Expand Up @@ -97,14 +97,14 @@ fontMapping map[TABLE_SIZE] = {
};

/*
This function maps an SDL_KeySym to an index in the bitmap font.
It does so by scanning through the font mapping table one entry
at a time.
If a match is found (scancode and allowed modifiers), the proper
index is returned.
If there is no entry for the key, -1 is returned
This function maps an SDL_KeySym to an index in the bitmap font.
It does so by scanning through the font mapping table one entry
at a time.
If a match is found (scancode and allowed modifiers), the proper
index is returned.
If there is no entry for the key, -1 is returned
*/
int
keyToIndex(SDL_Keysym key)
Expand All @@ -125,8 +125,8 @@ keyToIndex(SDL_Keysym key)
return index;
}

/*
This function returns and x,y position for a given character number.
/*
This function returns and x,y position for a given character number.
It is used for positioning each character of text
*/
void
Expand Down
20 changes: 10 additions & 10 deletions Xcode-iOS/Demos/src/mixer.c
@@ -1,7 +1,7 @@
/*
* mixer.c
* written by Holmes Futrell
* use however you want
* mixer.c
* written by Holmes Futrell
* use however you want
*/

#import "SDL.h"
Expand Down Expand Up @@ -100,7 +100,7 @@ loadSound(const char *file, struct sound *s)
if (result == -1) {
fatalError("could not build audio CVT");
} else if (result != 0) {
/*
/*
this happens when the .wav format differs from the output format.
we convert the .wav buffer here
*/
Expand Down Expand Up @@ -179,8 +179,8 @@ render(SDL_Renderer *renderer)
}

/*
finds a sound channel in the mixer for a sound
and sets it up to start playing
finds a sound channel in the mixer for a sound
and sets it up to start playing
*/
int
playSound(struct sound *s)
Expand Down Expand Up @@ -225,9 +225,9 @@ playSound(struct sound *s)
return selected_channel;
}

/*
Called from SDL's audio system. Supplies sound input with data by mixing together all
currently playing sound effects.
/*
Called from SDL's audio system. Supplies sound input with data by mixing together all
currently playing sound effects.
*/
void
audioCallback(void *userdata, Uint8 * stream, int len)
Expand Down Expand Up @@ -273,7 +273,7 @@ main(int argc, char *argv[])

int done; /* has user tried to quit ? */
SDL_Window *window; /* main window */
SDL_Renderer *renderer;
SDL_Renderer *renderer;
SDL_Event event;
Uint32 startFrame; /* holds when frame started processing */
Uint32 endFrame; /* holds when frame ended processing */
Expand Down
10 changes: 5 additions & 5 deletions Xcode-iOS/Demos/src/rectangles.c
@@ -1,7 +1,7 @@
/*
* rectangles.c
* written by Holmes Futrell
* use however you want
* rectangles.c
* written by Holmes Futrell
* use however you want
*/

#include "SDL.h"
Expand Down Expand Up @@ -39,7 +39,7 @@ main(int argc, char *argv[])
{

SDL_Window *window;
SDL_Renderer *renderer;
SDL_Renderer *renderer;
int done;
SDL_Event event;

Expand All @@ -59,7 +59,7 @@ main(int argc, char *argv[])
fatalError("Could not initialize Window");
}
renderer = SDL_CreateRenderer(window, -1, 0);
if (!renderer) {
if (!renderer) {
fatalError("Could not create renderer");
}

Expand Down

0 comments on commit e81108d

Please sign in to comment.