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

Commit

Permalink
Don't run indent on the Xcode templates
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Aug 11, 2007
1 parent 7b34fe6 commit 4606648
Show file tree
Hide file tree
Showing 29 changed files with 733 additions and 744 deletions.
2 changes: 1 addition & 1 deletion Makefile.in
Expand Up @@ -177,7 +177,7 @@ indent:
-name '*.h' -o \
-name '*.c' -o \
-name '*.cc' \) \
-print | \
-print | fgrep -v ./Xcode | \
while read file; do \
indent "$$file" -o "$$file.indent"; \
if cmp "$$file" "$$file.indent" >/dev/null; then \
Expand Down
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: 2 additions & 1 deletion Xcode/TemplatesForProjectBuilder/SDL Application/SDLMain.h
Expand Up @@ -7,4 +7,5 @@

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

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

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

done = 0;
while (!done) {
/* 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);
}

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

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

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

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

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

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

done = 0;
while (!done) {
/* 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);
}

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

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

/* Clean up the SDL library */
SDL_Quit();
return (0);
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);
}
Expand Up @@ -9,35 +9,38 @@
#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,7 +9,8 @@
#import <AppKit/AppKit.h>


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

@end
Expand Up @@ -11,11 +11,17 @@
// 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,3 +9,4 @@

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

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

#import <Cocoa/Cocoa.h>

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

0 comments on commit 4606648

Please sign in to comment.