# HG changeset patch # User koda # Date 1285191998 -7200 # Node ID e7c202c08ac1690bbf4c6698144c2a22c8ad110a # Parent 568bfd0834658b49de3736fbb2ef7af5207b830f compilation bugfix and scaling down textures when bigger than screen diff -r 568bfd083465 -r e7c202c08ac1 hedgewars/uStore.pas --- a/hedgewars/uStore.pas Wed Sep 22 02:22:15 2010 +0200 +++ b/hedgewars/uStore.pas Wed Sep 22 23:46:38 2010 +0200 @@ -732,8 +732,13 @@ end; procedure DrawCentered(X, Top: LongInt; Source: PTexture); +var scale: GLfloat; begin -DrawTexture(X - Source^.w shr 1, Top, Source) + if (Source^.w + 20) > cScreenWidth then + scale:= cScreenWidth / (Source^.w + 20) + else + scale:= 1.0; + DrawTexture(X - round((Source^.w * scale) div 2, Top, Source, scale) end; procedure DrawHedgehog(X, Y: LongInt; Dir: LongInt; Pos, Step: LongWord; Angle: real); diff -r 568bfd083465 -r e7c202c08ac1 project_files/HedgewarsMobile/Classes/GameSetup.m --- a/project_files/HedgewarsMobile/Classes/GameSetup.m Wed Sep 22 02:22:15 2010 +0200 +++ b/project_files/HedgewarsMobile/Classes/GameSetup.m Wed Sep 22 23:46:38 2010 +0200 @@ -26,7 +26,7 @@ #import "CommodityFunctions.h" #import "NSStringExtra.h" -#define BUFFER_SIZE 128 +#define BUFFER_SIZE 64 @implementation GameSetup @synthesize systemSettings, gameConfig, savePath; diff -r 568bfd083465 -r e7c202c08ac1 project_files/HedgewarsMobile/Classes/SDL_uikitappdelegate.m --- a/project_files/HedgewarsMobile/Classes/SDL_uikitappdelegate.m Wed Sep 22 02:22:15 2010 +0200 +++ b/project_files/HedgewarsMobile/Classes/SDL_uikitappdelegate.m Wed Sep 22 23:46:38 2010 +0200 @@ -79,10 +79,12 @@ // main routine for calling the actual game engine -(void) startSDLgame:(NSDictionary *)gameDictionary { - UIView *blackView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.height, self.view.frame.size.width)]; + UIWindow *aWin = [[[UIApplication sharedApplication] windows] objectAtIndex:0]; + + UIView *blackView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, aWin.frame.size.height, aWin.frame.size.width)]; blackView.opaque = YES; blackView.backgroundColor = [UIColor blackColor]; - [self.view addSubview:blackView]; + [aWin addSubview:blackView]; // pull out useful configuration info from various files GameSetup *setup = [[GameSetup alloc] initWithDictionary:gameDictionary]; @@ -102,7 +104,7 @@ isInGame = NO; free(gameArgs); - UIWindow *aWin = [[[UIApplication sharedApplication] windows] objectAtIndex:0]; [aWin makeKeyAndVisible]; + [aWin makeKeyAndVisible]; [UIView beginAnimations:@"fading in from ingame" context:NULL]; [UIView setAnimationDuration:1]; blackView.alpha = 0; diff -r 568bfd083465 -r e7c202c08ac1 project_files/HedgewarsMobile/Classes/SavedGamesViewController.h --- a/project_files/HedgewarsMobile/Classes/SavedGamesViewController.h Wed Sep 22 02:22:15 2010 +0200 +++ b/project_files/HedgewarsMobile/Classes/SavedGamesViewController.h Wed Sep 22 23:46:38 2010 +0200 @@ -22,7 +22,7 @@ #import -@interface SavedGamesViewController : UIViewController { +@interface SavedGamesViewController : UITableViewController { }