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

Commit

Permalink
make indent
Browse files Browse the repository at this point in the history
  • Loading branch information
pendletonrc committed Jul 24, 2007
1 parent 2ec5cfc commit 3255f00
Show file tree
Hide file tree
Showing 31 changed files with 815 additions and 736 deletions.
2 changes: 1 addition & 1 deletion Xcode/SDLTest/libsdlmain_prefix.h
Expand Up @@ -10,4 +10,4 @@
#include <Cocoa/Cocoa.h>
#include <Carbon/Carbon.h>
#include "SDL.h"
#include "SDLMain.h"
#include "SDLMain.h"
3 changes: 1 addition & 2 deletions Xcode/TemplatesForProjectBuilder/SDL Application/SDLMain.h
Expand Up @@ -7,5 +7,4 @@

#import <Cocoa/Cocoa.h>

@interface SDLMain : NSObject
@end
@ interface SDLMain:NSObject @ end
90 changes: 45 additions & 45 deletions Xcode/TemplatesForProjectBuilder/SDL Application/main.c
Expand Up @@ -4,62 +4,62 @@
Please see the SDL documentation for details on using the SDL API:
/Developer/Documentation/SDL/docs.html
*/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

#include "SDL.h"

int main(int argc, char *argv[])
int
main(int argc, char *argv[])
{
Uint32 initflags = SDL_INIT_VIDEO; /* See documentation for details */
SDL_Surface *screen;
Uint8 video_bpp = 0;
Uint32 videoflags = SDL_SWSURFACE;
int done;
SDL_Event event;
Uint32 initflags = SDL_INIT_VIDEO; /* See documentation for details */
SDL_Surface *screen;
Uint8 video_bpp = 0;
Uint32 videoflags = SDL_SWSURFACE;
int done;
SDL_Event event;

/* Initialize the SDL library */
if (SDL_Init(initflags) < 0) {
fprintf(stderr, "Couldn't initialize SDL: %s\n", SDL_GetError());
exit(1);
}

/* Initialize the SDL library */
if ( SDL_Init(initflags) < 0 ) {
fprintf(stderr, "Couldn't initialize SDL: %s\n",
SDL_GetError());
exit(1);
}
/* Set 640x480 video mode */
screen = SDL_SetVideoMode(640, 480, video_bpp, videoflags);
if (screen == NULL) {
fprintf(stderr, "Couldn't set 640x480x%d video mode: %s\n",
video_bpp, SDL_GetError());
SDL_Quit();
exit(2);
}

/* Set 640x480 video mode */
screen=SDL_SetVideoMode(640,480, video_bpp, videoflags);
if (screen == NULL) {
fprintf(stderr, "Couldn't set 640x480x%d video mode: %s\n",
video_bpp, SDL_GetError());
SDL_Quit();
exit(2);
}
done = 0;
while (!done) {

done = 0;
while ( !done ) {
/* Check for events */
while (SDL_PollEvent(&event)) {
switch (event.type) {

/* Check for events */
while ( SDL_PollEvent(&event) ) {
switch (event.type) {
case SDL_MOUSEMOTION:
break;
case SDL_MOUSEBUTTONDOWN:
break;
case SDL_KEYDOWN:
/* Any keypress quits the app... */
case SDL_QUIT:
done = 1;
break;
default:
break;
}
}
}

case SDL_MOUSEMOTION:
break;
case SDL_MOUSEBUTTONDOWN:
break;
case SDL_KEYDOWN:
/* Any keypress quits the app... */
case SDL_QUIT:
done = 1;
break;
default:
break;
}
}
}

/* Clean up the SDL library */
SDL_Quit();
return(0);
/* Clean up the SDL library */
SDL_Quit();
return (0);
}
13 changes: 6 additions & 7 deletions Xcode/TemplatesForProjectBuilder/SDL Cocoa Application/SDLMain.h
Expand Up @@ -7,11 +7,10 @@

#import <Cocoa/Cocoa.h>

@interface SDLMain : NSObject
- (IBAction)prefsMenu:(id)sender;
- (IBAction)newGame:(id)sender;
- (IBAction)openGame:(id)sender;
- (IBAction)saveGame:(id)sender;
- (IBAction)saveGameAs:(id)sender;
- (IBAction)help:(id)sender;
@ interface SDLMain: NSObject - (IBAction) prefsMenu:(id) sender;
-(IBAction) newGame:(id) sender;
-(IBAction) openGame:(id) sender;
-(IBAction) saveGame:(id) sender;
-(IBAction) saveGameAs:(id) sender;
-(IBAction) help:(id) sender;
@end
90 changes: 45 additions & 45 deletions Xcode/TemplatesForProjectBuilder/SDL Cocoa Application/main.c
Expand Up @@ -4,62 +4,62 @@
Please see the SDL documentation for details on using the SDL API:
/Developer/Documentation/SDL/docs.html
*/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

#include "SDL.h"

int main(int argc, char *argv[])
int
main(int argc, char *argv[])
{
Uint32 initflags = SDL_INIT_VIDEO; /* See documentation for details */
SDL_Surface *screen;
Uint8 video_bpp = 0;
Uint32 videoflags = SDL_SWSURFACE;
int done;
SDL_Event event;
Uint32 initflags = SDL_INIT_VIDEO; /* See documentation for details */
SDL_Surface *screen;
Uint8 video_bpp = 0;
Uint32 videoflags = SDL_SWSURFACE;
int done;
SDL_Event event;

/* Initialize the SDL library */
if (SDL_Init(initflags) < 0) {
fprintf(stderr, "Couldn't initialize SDL: %s\n", SDL_GetError());
exit(1);
}

/* Initialize the SDL library */
if ( SDL_Init(initflags) < 0 ) {
fprintf(stderr, "Couldn't initialize SDL: %s\n",
SDL_GetError());
exit(1);
}
/* Set 640x480 video mode */
screen = SDL_SetVideoMode(640, 480, video_bpp, videoflags);
if (screen == NULL) {
fprintf(stderr, "Couldn't set 640x480x%d video mode: %s\n",
video_bpp, SDL_GetError());
SDL_Quit();
exit(2);
}

/* Set 640x480 video mode */
screen=SDL_SetVideoMode(640,480, video_bpp, videoflags);
if (screen == NULL) {
fprintf(stderr, "Couldn't set 640x480x%d video mode: %s\n",
video_bpp, SDL_GetError());
SDL_Quit();
exit(2);
}
done = 0;
while (!done) {

done = 0;
while ( !done ) {
/* Check for events */
while (SDL_PollEvent(&event)) {
switch (event.type) {

/* Check for events */
while ( SDL_PollEvent(&event) ) {
switch (event.type) {
case SDL_MOUSEMOTION:
break;
case SDL_MOUSEBUTTONDOWN:
break;
case SDL_KEYDOWN:
/* Any keypress quits the app... */
case SDL_QUIT:
done = 1;
break;
default:
break;
}
}
}

case SDL_MOUSEMOTION:
break;
case SDL_MOUSEBUTTONDOWN:
break;
case SDL_KEYDOWN:
/* Any keypress quits the app... */
case SDL_QUIT:
done = 1;
break;
default:
break;
}
}
}

/* Clean up the SDL library */
SDL_Quit();
return(0);
/* Clean up the SDL library */
SDL_Quit();
return (0);
}
Expand Up @@ -9,38 +9,34 @@
#import <Cocoa/Cocoa.h>
#import "SDL.h"

extern id gController; // instance of this class from nib
extern id gController; // instance of this class from nib

// Declare SDL_QuartzWindowDelegate (defined in SDL.framework)
@interface SDL_QuartzWindowDelegate : NSObject
@end

@interface MyController : NSObject
{
@interface SDL_QuartzWindowDelegate: NSObject @ end @ interface MyController:NSObject {
// Interface Builder Outlets
IBOutlet id _framesPerSecond;
IBOutlet id _numSprites;
IBOutlet id _window;
IBOutlet id _view;
IBOutlet id _framesPerSecond;
IBOutlet id _numSprites;
IBOutlet id _window;
IBOutlet id _view;

// Private instance variables
int _nSprites;
int _max_speed;
int _doFlip;
Uint8* _mem;
SDL_Surface* _screen;
SDL_Surface* _sprite;
SDL_Rect* _sprite_rects;
SDL_Rect* _positions;
SDL_Rect* _velocities;
int _sprites_visible;
Uint16 _sprite_w, _sprite_h;
int _mouse_x, _mouse_y;
int _nSprites;
int _max_speed;
int _doFlip;
Uint8 *_mem;

SDL_Surface *_screen;
SDL_Surface *_sprite;
SDL_Rect *_sprite_rects;
SDL_Rect *_positions;
SDL_Rect *_velocities;
int _sprites_visible;
Uint16 _sprite_w, _sprite_h;

int _mouse_x, _mouse_y;
}

// Interface Builder Actions
- (IBAction)changeNumberOfSprites:(id)sender;
- (IBAction)selectUpdateMode:(id)sender;
-(IBAction) changeNumberOfSprites:(id) sender;
-(IBAction) selectUpdateMode:(id) sender;
@end

Expand Up @@ -9,8 +9,7 @@
#import <AppKit/AppKit.h>


@interface MyCustomView : NSQuickDrawView
{
@ interface MyCustomView:NSQuickDrawView {
}

@end
Expand Up @@ -11,17 +11,11 @@
// Be a subclass of SDL_QuartzWindow so SDL will
// handle the redraw problems when minimizing the window
// This class is defined in SDL.framework
@interface SDL_QuartzWindow : NSWindow
@end

@ interface SDL_QuartzWindow:NSWindow @ end
// Also assign SDL_QuartzWindowDelegate to the window
// to perform other tasks. You can subclass this delegate
// if you want to add your own delegation methods
// This class is defined in SDL.framework
@interface SDL_QuartzWindowDelegate : NSObject
@end

@ interface SDL_QuartzWindowDelegate:NSObject @ end
// Declare our custom class
@interface MyCustomWindow : SDL_QuartzWindow
@end

@ interface MyCustomWindow:SDL_QuartzWindow @ end
Expand Up @@ -7,8 +7,8 @@

#import <Cocoa/Cocoa.h>

@interface SDLMain : NSObject
{
@ interface SDLMain:NSObject {
IBOutlet id _controller;
}

@end
Expand Up @@ -9,4 +9,3 @@

#include <Foundation/Foundation.h>
#include <Cocoa/Cocoa.h>

Expand Up @@ -7,5 +7,4 @@

#import <Cocoa/Cocoa.h>

@interface SDLMain : NSObject
@end
@ interface SDLMain:NSObject @ end

0 comments on commit 3255f00

Please sign in to comment.