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

Commit

Permalink
Cleanup out trailing whitespace in src/video/uikit
Browse files Browse the repository at this point in the history
  • Loading branch information
keestux committed Sep 27, 2011
1 parent 4a98254 commit 7edbd34
Show file tree
Hide file tree
Showing 12 changed files with 121 additions and 121 deletions.
24 changes: 12 additions & 12 deletions src/video/uikit/SDL_uikitappdelegate.m
Expand Up @@ -41,7 +41,7 @@ int main(int argc, char **argv) {

int i;
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];

/* store arguments */
forward_argc = argc;
forward_argv = (char **)malloc((argc+1) * sizeof(char *));
Expand All @@ -53,14 +53,14 @@ int main(int argc, char **argv) {

/* Give over control to run loop, SDLUIKitDelegate will handle most things from here */
UIApplicationMain(argc, argv, NULL, [SDLUIKitDelegate getAppDelegateClassName]);

[pool release];
return 0;
}

static void SDL_IdleTimerDisabledChanged(const char *name, const char *oldValue, const char *newValue) {
SDL_assert(SDL_strcmp(name, SDL_HINT_IDLE_TIMER_DISABLED) == 0);

BOOL disable = (*newValue != '0');
[UIApplication sharedApplication].idleTimerDisabled = disable;
}
Expand All @@ -85,37 +85,37 @@ - (id)init {
}

- (void)postFinishLaunch {

/* register a callback for the idletimer hint */
SDL_SetHint(SDL_HINT_IDLE_TIMER_DISABLED, "0");
SDL_RegisterHintChangedCb(SDL_HINT_IDLE_TIMER_DISABLED, &SDL_IdleTimerDisabledChanged);

/* run the user's application, passing argc and argv */
int exit_status = SDL_main(forward_argc, forward_argv);

/* free the memory we used to hold copies of argc and argv */
int i;
for (i=0; i<forward_argc; i++) {
free(forward_argv[i]);
}
free(forward_argv);
free(forward_argv);

/* exit, passing the return status from the user's application */
exit(exit_status);
}

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

/* Set working directory to resource path */
[[NSFileManager defaultManager] changeCurrentDirectoryPath: [[NSBundle mainBundle] resourcePath]];

[self performSelector:@selector(postFinishLaunch) withObject:nil afterDelay:0.0];

return YES;
}

- (void)applicationWillTerminate:(UIApplication *)application {

SDL_SendQuit();
/* hack to prevent automatic termination. See SDL_uikitevents.m for details */
longjmp(*(jump_env()), 1);
Expand All @@ -130,7 +130,7 @@ - (void) applicationWillResignActive:(UIApplication*)application
if (!_this) {
return;
}

SDL_Window *window;
for (window = _this->windows; window != nil; window = window->next) {
SDL_SendWindowEvent(window, SDL_WINDOWEVENT_MINIMIZED, 0, 0);
Expand All @@ -146,7 +146,7 @@ - (void) applicationDidBecomeActive:(UIApplication*)application
if (!_this) {
return;
}

SDL_Window *window;
for (window = _this->windows; window != nil; window = window->next) {
SDL_SendWindowEvent(window, SDL_WINDOWEVENT_RESTORED, 0, 0);
Expand Down
8 changes: 4 additions & 4 deletions src/video/uikit/SDL_uikitevents.m
Expand Up @@ -31,17 +31,17 @@
void
UIKit_PumpEvents(_THIS)
{
/*
/*
When the user presses the 'home' button on the iPod
the application exits -- immediatly.
Unlike in Mac OS X, it appears there is no way to cancel the termination.
This doesn't give the SDL user's application time to respond to an SDL_Quit event.
So what we do is that in the UIApplicationDelegate class (SDLUIApplicationDelegate),
when the delegate receives the ApplicationWillTerminate message, we execute
a longjmp statement to get back here, preventing an immediate exit.
*/
*/
if (setjmp(*jump_env()) == 0) {
/* if we're setting the jump, rather than jumping back */
SInt32 result;
Expand Down
16 changes: 8 additions & 8 deletions src/video/uikit/SDL_uikitopengles.m
Expand Up @@ -34,7 +34,7 @@

void *
UIKit_GL_GetProcAddress(_THIS, const char *proc)
{
{
/* Look through all SO's for the proc symbol. Here's why:
-Looking for the path to the OpenGL Library seems not to work in the iPhone Simulator.
-We don't know that the path won't change in the future.
Expand All @@ -47,23 +47,23 @@
*/
int UIKit_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context)
{

if (context) {
SDL_WindowData *data = (SDL_WindowData *)window->driverdata;
[data->view setCurrentContext];
}
else {
[EAGLContext setCurrentContext: nil];
}

return 0;
}

int
UIKit_GL_LoadLibrary(_THIS, const char *path)
{
/*
shouldn't be passing a path into this function
/*
shouldn't be passing a path into this function
why? Because we've already loaded the library
and because the SDK forbids loading an external SO
*/
Expand All @@ -84,7 +84,7 @@ void UIKit_GL_SwapWindow(_THIS, SDL_Window * window)
#endif

SDL_WindowData *data = (SDL_WindowData *)window->driverdata;

if (nil == data->view) {
return;
}
Expand All @@ -95,7 +95,7 @@ void UIKit_GL_SwapWindow(_THIS, SDL_Window * window)

/* we need to let the event cycle run, or the OS won't update the OpenGL view! */
SDL_PumpEvents();

}

SDL_GLContext UIKit_GL_CreateContext(_THIS, SDL_Window * window)
Expand All @@ -114,7 +114,7 @@ SDL_GLContext UIKit_GL_CreateContext(_THIS, SDL_Window * window)
aBits: _this->gl_config.alpha_size \
depthBits: _this->gl_config.depth_size \
majorVersion: _this->gl_config.major_version];

data->view = view;
view->viewcontroller = data->viewcontroller;
if (view->viewcontroller != nil) {
Expand Down
8 changes: 4 additions & 4 deletions src/video/uikit/SDL_uikitopenglview.h
Expand Up @@ -31,17 +31,17 @@
*/
/* *INDENT-OFF* */
@interface SDL_uikitopenglview : SDL_uikitview {

@private
/* The pixel dimensions of the backbuffer */
GLint backingWidth;
GLint backingHeight;

EAGLContext *context;

/* OpenGL names for the renderbuffer and framebuffers used to render to this view */
GLuint viewRenderbuffer, viewFramebuffer;

/* OpenGL name for the depth buffer that is attached to viewFramebuffer, if it exists (0 if it does not exist) */
GLuint depthRenderbuffer;

Expand Down
28 changes: 14 additions & 14 deletions src/video/uikit/SDL_uikitopenglview.m
Expand Up @@ -50,7 +50,7 @@ - (id)initWithFrame:(CGRect)frame \
{
NSString *colorFormat=nil;
BOOL useDepthBuffer;

if (rBits == 8 && gBits == 8 && bBits == 8) {
/* if user specifically requests rbg888 or some color format higher than 16bpp */
colorFormat = kEAGLColorFormatRGBA8;
Expand All @@ -59,7 +59,7 @@ - (id)initWithFrame:(CGRect)frame \
/* default case (faster) */
colorFormat = kEAGLColorFormatRGB565;
}

depthBufferFormat = 0;

if (depthBits == 24) {
Expand All @@ -71,22 +71,22 @@ - (id)initWithFrame:(CGRect)frame \
}
else {
/* default case when depth buffer is not disabled */
/*
/*
strange, even when we use this, we seem to get a 24 bit depth buffer on iPhone.
perhaps that's the only depth format iPhone actually supports
*/
useDepthBuffer = YES;
depthBufferFormat = GL_DEPTH_COMPONENT16_OES;
}

if ((self = [super initWithFrame:frame])) {
// Get the layer
CAEAGLLayer *eaglLayer = (CAEAGLLayer *)self.layer;

eaglLayer.opaque = YES;
eaglLayer.drawableProperties = [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithBool: retained], kEAGLDrawablePropertyRetainedBacking, colorFormat, kEAGLDrawablePropertyColorFormat, nil];

if (majorVersion > 1) {
context = [[EAGLContext alloc] initWithAPI: kEAGLRenderingAPIOpenGLES2];
} else {
Expand All @@ -96,16 +96,16 @@ - (id)initWithFrame:(CGRect)frame \
[self release];
return nil;
}

/* create the buffers */
glGenFramebuffersOES(1, &viewFramebuffer);
glGenRenderbuffersOES(1, &viewRenderbuffer);

glBindFramebufferOES(GL_FRAMEBUFFER_OES, viewFramebuffer);
glBindRenderbufferOES(GL_RENDERBUFFER_OES, viewRenderbuffer);
[context renderbufferStorage:GL_RENDERBUFFER_OES fromDrawable:(CAEAGLLayer*)self.layer];
glFramebufferRenderbufferOES(GL_FRAMEBUFFER_OES, GL_COLOR_ATTACHMENT0_OES, GL_RENDERBUFFER_OES, viewRenderbuffer);

glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES, GL_RENDERBUFFER_WIDTH_OES, &backingWidth);
glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES, GL_RENDERBUFFER_HEIGHT_OES, &backingHeight);

Expand All @@ -115,7 +115,7 @@ - (id)initWithFrame:(CGRect)frame \
glRenderbufferStorageOES(GL_RENDERBUFFER_OES, depthBufferFormat, backingWidth, backingHeight);
glFramebufferRenderbufferOES(GL_FRAMEBUFFER_OES, GL_DEPTH_ATTACHMENT_OES, GL_RENDERBUFFER_OES, depthRenderbuffer);
}

if(glCheckFramebufferStatusOES(GL_FRAMEBUFFER_OES) != GL_FRAMEBUFFER_COMPLETE_OES) {
return NO;
}
Expand All @@ -140,7 +140,7 @@ - (void)updateFrame {
glGenRenderbuffersOES(1, &viewRenderbuffer);
glBindRenderbufferOES(GL_RENDERBUFFER_OES, viewRenderbuffer);
[context renderbufferStorage:GL_RENDERBUFFER_OES fromDrawable:(CAEAGLLayer*)self.layer];
glFramebufferRenderbufferOES(GL_FRAMEBUFFER_OES, GL_COLOR_ATTACHMENT0_OES, GL_RENDERBUFFER_OES, viewRenderbuffer);
glFramebufferRenderbufferOES(GL_FRAMEBUFFER_OES, GL_COLOR_ATTACHMENT0_OES, GL_RENDERBUFFER_OES, viewRenderbuffer);

glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES, GL_RENDERBUFFER_WIDTH_OES, &backingWidth);
glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES, GL_RENDERBUFFER_HEIGHT_OES, &backingHeight);
Expand All @@ -149,7 +149,7 @@ - (void)updateFrame {
glBindRenderbufferOES(GL_RENDERBUFFER_OES, depthRenderbuffer);
glRenderbufferStorageOES(GL_RENDERBUFFER_OES, depthBufferFormat, backingWidth, backingHeight);
}

// !!! FIXME: use the screen this is on!
/* Use the main screen scale (for retina display support) */
if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)])
Expand All @@ -176,7 +176,7 @@ - (void)destroyFramebuffer {
viewFramebuffer = 0;
glDeleteRenderbuffersOES(1, &viewRenderbuffer);
viewRenderbuffer = 0;

if (depthRenderbuffer) {
glDeleteRenderbuffersOES(1, &depthRenderbuffer);
depthRenderbuffer = 0;
Expand All @@ -189,7 +189,7 @@ - (void)dealloc {
if ([EAGLContext currentContext] == context) {
[EAGLContext setCurrentContext:nil];
}
[context release];
[context release];
[super dealloc];
}

Expand Down
6 changes: 3 additions & 3 deletions src/video/uikit/SDL_uikitvideo.m
Expand Up @@ -84,8 +84,8 @@ static void UIKit_DeleteDevice(SDL_VideoDevice * device)
device->CreateWindow = UIKit_CreateWindow;
device->DestroyWindow = UIKit_DestroyWindow;
device->GetWindowWMInfo = UIKit_GetWindowWMInfo;


/* OpenGL (ES) functions */
device->GL_MakeCurrent = UIKit_GL_MakeCurrent;
device->GL_SwapWindow = UIKit_GL_SwapWindow;
Expand Down Expand Up @@ -211,7 +211,7 @@ static void UIKit_DeleteDevice(SDL_VideoDevice * device)
mode.w = w;
mode.h = h;
mode.refresh_rate = 0;

[uimode retain];
mode.driverdata = uimode;

Expand Down
4 changes: 2 additions & 2 deletions src/video/uikit/SDL_uikitview.h
Expand Up @@ -48,7 +48,7 @@
#if SDL_IPHONE_KEYBOARD
UITextField *textField;
BOOL keyboardVisible;
#endif
#endif

@public
SDL_uikitviewcontroller *viewcontroller;
Expand All @@ -62,7 +62,7 @@
- (void)hideKeyboard;
- (void)initializeKeyboard;
@property (readonly) BOOL keyboardVisible;
#endif
#endif

@end
/* *INDENT-ON* */
Expand Down

0 comments on commit 7edbd34

Please sign in to comment.