# HG changeset patch
# User koda
# Date 1278463931 -7200
# Node ID 19f78afa0188ce9d74fde0c104b8f2727ea4086a
# Parent 9f1d79e01a60541cd1be0951b3218e37e1c3dd59
fix the multitouch shooting and moving
fix a crash (unknown) when reloading
leave the lobby open after returing from game
diff -r 9f1d79e01a60 -r 19f78afa0188 hedgewars/PascalExports.pas
--- a/hedgewars/PascalExports.pas Tue Jul 06 03:33:01 2010 +0200
+++ b/hedgewars/PascalExports.pas Wed Jul 07 02:52:11 2010 +0200
@@ -55,6 +55,21 @@
rightClick:= true;
end;
+procedure HW_walkingKeysUp; cdecl; export;
+begin
+ leftKey:= false;
+ rightKey:= false;
+ upKey:= false;
+ downKey:= false;
+end;
+
+procedure HW_otherKeysUp; cdecl; export;
+begin
+ spaceKey:= false;
+ enterKey:= false;
+ backspaceKey:= false;
+end;
+
procedure HW_allKeysUp; cdecl; export;
begin
// set all keys to released
diff -r 9f1d79e01a60 -r 19f78afa0188 hedgewars/uMisc.pas
--- a/hedgewars/uMisc.pas Tue Jul 06 03:33:01 2010 +0200
+++ b/hedgewars/uMisc.pas Wed Jul 07 02:52:11 2010 +0200
@@ -804,7 +804,7 @@
procedure freeModule;
begin
- //uRandom.DumpBuffer;
+ recordFileName:= '';
while TextureList <> nil do FreeTexture(TextureList);
{$IFDEF DEBUGFILE}
diff -r 9f1d79e01a60 -r 19f78afa0188 hedgewars/uStore.pas
--- a/hedgewars/uStore.pas Tue Jul 06 03:33:01 2010 +0200
+++ b/hedgewars/uStore.pas Wed Jul 07 02:52:11 2010 +0200
@@ -36,9 +36,7 @@
ProgrTex: PTexture;
MissionIcons: PSDL_Surface;
ropeIconTex: PTexture;
-{$IFDEF IPHONEOS}
rotationQt: GLfloat;
-{$ENDIF}
wScreen: LongInt;
hScreen: LongInt;
@@ -1232,9 +1230,7 @@
glMatrixMode(GL_MODELVIEW);
// prepare default translation/scaling
glLoadIdentity();
-{$IFDEF IPHONEOS}
glRotatef(rotationQt, 0, 0, 1);
-{$ENDIF}
glScalef(2.0 / cScreenWidth, -2.0 / cScreenHeight, 1.0);
glTranslatef(0, -cScreenHeight / 2, 0);
@@ -1260,9 +1256,7 @@
begin
glPushMatrix; // save default scaling
glLoadIdentity;
-{$IFDEF IPHONEOS}
glRotatef(rotationQt, 0, 0, 1);
-{$ENDIF}
glScalef(f / wScreen, -f / hScreen, 1.0);
glTranslatef(0, -cScreenHeight / 2, 0);
end;
@@ -1585,6 +1579,7 @@
{$IFDEF IPHONEOS}
rotationQt:= -90;
{$ELSE}
+ rotationQt:= 0;
cGPUVendor:= gvUnknown;
{$ENDIF}
// really initalized in storeLoad
diff -r 9f1d79e01a60 -r 19f78afa0188 project_files/HedgewarsMobile/Classes/GameConfigViewController.m
--- a/project_files/HedgewarsMobile/Classes/GameConfigViewController.m Tue Jul 06 03:33:01 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/GameConfigViewController.m Wed Jul 07 02:52:11 2010 +0200
@@ -48,9 +48,10 @@
break;
case 1:
theButton.enabled = NO;
- [self performSelector:@selector(startGame:)
- withObject:theButton
- afterDelay:0.25];
+ [self startGame:theButton];
+// [self performSelector:@selector(startGame:)
+// withObject:theButton
+// afterDelay:0.25];
break;
default:
break;
@@ -154,9 +155,9 @@
nil];
// finally launch game and remove this controller
- [[self parentViewController] dismissModalViewControllerAnimated:YES];
[[SDLUIKitDelegate sharedAppDelegate] startSDLgame:gameDictionary];
[gameDictionary release];
+ //[[self parentViewController] dismissModalViewControllerAnimated:YES];
}
-(void) viewDidLoad {
diff -r 9f1d79e01a60 -r 19f78afa0188 project_files/HedgewarsMobile/Classes/GameSetup.m
--- a/project_files/HedgewarsMobile/Classes/GameSetup.m Tue Jul 06 03:33:01 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/GameSetup.m Wed Jul 07 02:52:11 2010 +0200
@@ -277,7 +277,7 @@
switch (buffer[0]) {
case 'C':
- DLog(@"sending game config");
+ DLog(@"sending game config...\n%@",self.gameConfig);
// local game
[self sendToEngine:@"TL"];
diff -r 9f1d79e01a60 -r 19f78afa0188 project_files/HedgewarsMobile/Classes/OverlayViewController.m
--- a/project_files/HedgewarsMobile/Classes/OverlayViewController.m Tue Jul 06 03:33:01 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/OverlayViewController.m Wed Jul 07 02:52:11 2010 +0200
@@ -26,16 +26,6 @@
return rotationManager(interfaceOrientation);
}
-
--(void) didReceiveMemoryWarning {
- // Releases the view if it doesn't have a superview.
- [super didReceiveMemoryWarning];
- // Release any cached data, images, etc that aren't in use.
- if (popupMenu.view.superview == nil)
- popupMenu = nil;
- MSG_MEMCLEAN();
-}
-
-(void) didRotate:(NSNotification *)notification {
UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation];
CGRect rect = [[UIScreen mainScreen] bounds];
@@ -148,6 +138,7 @@
[self didRotate:[NSNotification notificationWithName:UIDeviceOrientationDidChangeNotification object:nil]];
}
+/* these are causing problems at reloading so let's remove 'em
-(void) viewDidUnload {
[popoverController dismissPopoverAnimated:NO];
[dimTimer invalidate];
@@ -159,6 +150,16 @@
MSG_DIDUNLOAD();
}
+-(void) didReceiveMemoryWarning {
+ // Releases the view if it doesn't have a superview.
+ [super didReceiveMemoryWarning];
+ // Release any cached data, images, etc that aren't in use.
+ if (popupMenu.view.superview == nil)
+ popupMenu = nil;
+ MSG_MEMCLEAN();
+}
+*/
+
-(void) dealloc {
[writeChatTextField release];
[popupMenu release];
@@ -170,12 +171,6 @@
#pragma mark -
#pragma mark Overlay actions and members
-// dim the overlay when there's no more input for a certain amount of time
--(IBAction) buttonReleased:(id) sender {
- HW_allKeysUp();
- [dimTimer setFireDate:HIDING_TIME_DEFAULT];
-}
-
// nice transition for dimming, should be called only by the timer himself
-(void) dimOverlay {
if (canDim) {
@@ -192,6 +187,30 @@
[dimTimer setFireDate:HIDING_TIME_NEVER];
}
+// dim the overlay when there's no more input for a certain amount of time
+-(IBAction) buttonReleased:(id) sender {
+ UIButton *theButton = (UIButton *)sender;
+
+ switch (theButton.tag) {
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ HW_walkingKeysUp();
+ break;
+ case 4:
+ case 5:
+ case 6:
+ HW_otherKeysUp();
+ break;
+ default:
+ NSLog(@"Nope");
+ break;
+ }
+
+ [dimTimer setFireDate:HIDING_TIME_DEFAULT];
+}
+
// issue certain action based on the tag of the button
-(IBAction) buttonPressed:(id) sender {
[self activateOverlay];
@@ -232,7 +251,7 @@
HW_ammoMenu();
break;
default:
- NSLog(@"Nope");
+ DLog(@"Nope");
break;
}
}
diff -r 9f1d79e01a60 -r 19f78afa0188 project_files/HedgewarsMobile/Classes/PascalImports.h
--- a/project_files/HedgewarsMobile/Classes/PascalImports.h Tue Jul 06 03:33:01 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/PascalImports.h Wed Jul 07 02:52:11 2010 +0200
@@ -30,6 +30,8 @@
void HW_zoomReset(void);
void HW_ammoMenu(void);
+ void HW_walkingKeysUp(void);
+ void HW_otherKeysUp(void);
void HW_allKeysUp(void);
void HW_walkLeft(void);
diff -r 9f1d79e01a60 -r 19f78afa0188 project_files/HedgewarsMobile/Classes/SDL_uikitappdelegate.m
--- a/project_files/HedgewarsMobile/Classes/SDL_uikitappdelegate.m Tue Jul 06 03:33:01 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/SDL_uikitappdelegate.m Wed Jul 07 02:52:11 2010 +0200
@@ -100,8 +100,6 @@
// bring the uiwindow below in front
UIWindow *aWin = [[[UIApplication sharedApplication] windows] objectAtIndex:0];
[aWin makeKeyAndVisible];
- aWin = [[[UIApplication sharedApplication] windows] lastObject];
- [aWin removeFromSuperview];
DLog(@"%@",[[UIApplication sharedApplication] windows]);
diff -r 9f1d79e01a60 -r 19f78afa0188 project_files/HedgewarsMobile/Resources/OverlayViewController.xib
--- a/project_files/HedgewarsMobile/Resources/OverlayViewController.xib Tue Jul 06 03:33:01 2010 +0200
+++ b/project_files/HedgewarsMobile/Resources/OverlayViewController.xib Wed Jul 07 02:52:11 2010 +0200
@@ -581,6 +581,15 @@
68
+
@@ -732,7 +741,7 @@
- 68
+ 69