diff options
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | ball.c | 6 | ||||
-rw-r--r-- | ball.h | 4 | ||||
-rw-r--r-- | fps.c | 5 | ||||
-rw-r--r-- | fps.h | 6 | ||||
-rw-r--r-- | glpong.c | 4 | ||||
-rw-r--r-- | glpong.h | 1 | ||||
-rw-r--r-- | text.c | 4 | ||||
-rw-r--r-- | text.h | 4 |
9 files changed, 19 insertions, 17 deletions
@@ -1,6 +1,6 @@ CC=gcc STRIP=strip -WARN=-Wall -W -ansi -pedantic +WARN=-Wall -W -pedantic DEFINES=-DINLINE=__inline__ -DDEBUG=1 CFLAGS=-Os -pipe -std=c99 -g ${DEFINES} ${WARN} LDFLAGS=-Wl,-O1 @@ -3,8 +3,8 @@ #include "SDL.h" #include "SDL_opengl.h" -#include "glpong.h" #include "ball.h" +#include "glpong.h" static GLuint ball; static GLfloat ball_width; @@ -22,7 +22,7 @@ length(Ball_t * balls) { #endif void -GLPong_BallInit() { +GLPong_BallInit(void) { ball_width = 20.0f; ball_height = 20.0f; @@ -38,7 +38,7 @@ GLPong_BallInit() { } void -GLPong_BallDeinit() { +GLPong_BallDeinit(void) { glDeleteLists(ball, 1); } @@ -13,8 +13,8 @@ typedef struct Ball_t { GLubyte r, g, b, a; /* red, green, blue, alpha components; 1 byte ea. */ } Ball_t; -void GLPong_BallInit(); -void GLPong_BallDeinit(); +void GLPong_BallInit(void); +void GLPong_BallDeinit(void); void GLPong_BallAdd(Ball_t ** balls); void GLPong_BallDelete(Ball_t * from, Ball_t * ball); void GLPong_BallDeleteAll(Ball_t * list); @@ -3,19 +3,18 @@ #include "SDL.h" #include "SDL_opengl.h" -#include "text.h" #include "fps.h" static clock_t start; static GLfloat fps; void -GLPong_FPSInit() { +GLPong_FPSInit(void) { start = SDL_GetTicks(); } INLINE GLfloat -GLPong_FPSCount() { +GLPong_FPSCount(void) { /* 10.0f is the number of frames we let draw before calculating FPS */ fps = 10.0f / (SDL_GetTicks() - start) * 1000; /* 1 sec / 1 millisec == 1000 */ start = SDL_GetTicks(); @@ -1,8 +1,10 @@ #ifndef FPS_H #define FPS_H -void GLPong_FPSInit(); -INLINE GLfloat GLPong_FPSCount(); +#include "glpong.h" + +void GLPong_FPSInit(void); +INLINE GLfloat GLPong_FPSCount(void); #endif @@ -13,7 +13,7 @@ static int GLPong_Init(GLPong_t * GLPong); static void GLPong_Deinit(GLPong_t * GLPong); -static int GLPong_HandleEvents(); +static int GLPong_HandleEvents(void); static INLINE unsigned int NextPow2(unsigned int value); static GLuint SDL_GL_SurfaceToTexture(SDL_Surface * surface); static GLuint SDL_GL_NPOTSurfaceToTexture(SDL_Surface * surface, GLfloat * wratio, GLfloat * hratio); @@ -160,7 +160,7 @@ GLPong_Deinit(GLPong_t * GLPong) { } static int -GLPong_HandleEvents() { +GLPong_HandleEvents(void) { SDL_Event Event; if (SDL_PollEvent(&Event) != 0) { @@ -35,3 +35,4 @@ typedef struct { } GLPong_t; #endif + @@ -7,7 +7,7 @@ static GLuint font; int -GLPong_TextInit() { +GLPong_TextInit(void) { #ifdef DEBUG int count, i; #endif @@ -42,7 +42,7 @@ GLPong_TextInit() { } void -GLPong_TextDeinit() { +GLPong_TextDeinit(void) { glcDeleteFont(font); } @@ -1,8 +1,8 @@ #ifndef TEXT_H #define TEXT_H -int GLPong_TextInit(); -void GLPong_TextDeinit(); +int GLPong_TextInit(void); +void GLPong_TextDeinit(void); void GLPong_TextDrawFPS(GLfloat fps); #endif |