a couple of fixes i missed previously
authorkoda
Sat, 03 Jul 2010 05:51:24 +0200
changeset 3617 1df21e06b8ba
parent 3616 85d69ddb41b6
child 3618 337a27d62016
a couple of fixes i missed previously
hedgewars/hwengine.pas
hedgewars/uAI.pas
hedgewars/uConsole.pas
hedgewars/uLand.pas
project_files/HedgewarsMobile/Classes/GameSetup.m
project_files/HedgewarsMobile/Classes/OverlayViewController.m
--- a/hedgewars/hwengine.pas	Sat Jul 03 04:42:29 2010 +0200
+++ b/hedgewars/hwengine.pas	Sat Jul 03 05:51:24 2010 +0200
@@ -125,6 +125,7 @@
 procedure OnDestroy;
 begin
     WriteLnToConsole('Freeing resources...');
+    FreeActionsList();
     StoreRelease();
     ControllerClose();
     SendKB();
@@ -379,7 +380,7 @@
         uAIMisc.freeModule;         //stub
         //uAIAmmoTests does not need to be freed
         //uAIActions does not need to be freed
-        uAI.freeModule;
+        uAI.freeModule;             //stub
     end;
     
     uIO.freeModule;             //stub
--- a/hedgewars/uAI.pas	Sat Jul 03 04:42:29 2010 +0200
+++ b/hedgewars/uAI.pas	Sat Jul 03 05:51:24 2010 +0200
@@ -358,7 +358,7 @@
 
 procedure freeModule;
 begin
-    FreeActionsList();
+
 end;
 
 end.
--- a/hedgewars/uConsole.pas	Sat Jul 03 04:42:29 2010 +0200
+++ b/hedgewars/uConsole.pas	Sat Jul 03 05:51:24 2010 +0200
@@ -85,19 +85,6 @@
 RegisterVariable:= value;
 end;
 
-procedure FreeVariablesList;
-var t, tt: PVariable;
-begin
-tt:= Variables;
-Variables:= nil;
-while tt <> nil do
-      begin
-      t:= tt;
-      tt:= tt^.Next;
-      Dispose(t)
-      end;
-end;
-
 procedure WriteToConsole(s: shortstring);
 var Len: LongInt;
     done: boolean;
@@ -316,8 +303,16 @@
 end;
 
 procedure freeModule;
+var t, tt: PVariable;
 begin
-    FreeVariablesList();
+    tt:= Variables;
+    Variables:= nil;
+    while tt <> nil do
+    begin
+        t:= tt;
+        tt:= tt^.Next;
+        Dispose(t)
+    end;
 end;
 
 end.
--- a/hedgewars/uLand.pas	Sat Jul 03 04:42:29 2010 +0200
+++ b/hedgewars/uLand.pas	Sat Jul 03 05:51:24 2010 +0200
@@ -1300,7 +1300,7 @@
 end;
 
 function GenPreview: TPreview;
-var x, y, xx, yy, t, bit: LongInt;
+var x, y, xx, yy, t, bit, cbit, lh, lw: LongInt;
     Preview: TPreview;
 begin
     WriteLnToConsole('Generating preview...');
@@ -1309,6 +1309,8 @@
         1: GenMaze;
     end;
 
+    lh:= LAND_HEIGHT div 128;
+    lw:= LAND_WIDTH div 32;
     for y:= 0 to 127 do
         for x:= 0 to 31 do
         begin
@@ -1316,8 +1318,9 @@
             for bit:= 0 to 7 do
             begin
                 t:= 0;
-                for yy:= y * (LAND_HEIGHT div 128) to y * (LAND_HEIGHT div 128) + 7 do
-                    for xx:= x * (LAND_WIDTH div 32) + bit * 8 to x * (LAND_WIDTH div 32) + bit * 8 + 7 do
+                cbit:= bit * 8;
+                for yy:= y * lh to y * lh + 7 do
+                    for xx:= x * lw + cbit to x * lw + cbit + 7 do
                         if Land[yy, xx] <> 0 then inc(t);
                 if t > 8 then
                     Preview[y, x]:= Preview[y, x] or ($80 shr bit);
--- a/project_files/HedgewarsMobile/Classes/GameSetup.m	Sat Jul 03 04:42:29 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/GameSetup.m	Sat Jul 03 05:51:24 2010 +0200
@@ -271,7 +271,7 @@
         
         switch (buffer[0]) {
             case 'C':
-                DLog(@"sending game config\n%@",self.gameConfig);
+                DLog(@"sending game config");
                 
                 // local game
                 [self sendToEngine:@"TL"];
--- a/project_files/HedgewarsMobile/Classes/OverlayViewController.m	Sat Jul 03 04:42:29 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/OverlayViewController.m	Sat Jul 03 05:51:24 2010 +0200
@@ -33,6 +33,7 @@
     // Release any cached data, images, etc that aren't in use.
     if (popupMenu.view.superview == nil) 
         popupMenu = nil;
+    MSG_MEMCLEAN();
 }
 
 -(void) didRotate:(NSNotification *)notification {  
@@ -84,6 +85,7 @@
 }
 
 -(void) chatAppear {
+    /*
     if (writeChatTextField == nil) {
         writeChatTextField = [[UITextField alloc] initWithFrame:CGRectMake(0, 100, 768, [UIFont systemFontSize]+8)];
         writeChatTextField.textColor = [UIColor whiteColor];
@@ -100,12 +102,15 @@
     writeChatTextField.alpha = 1;
     [self activateOverlay];
     [dimTimer setFireDate:HIDING_TIME_NEVER];
+    */
 }
 
 -(void) chatDisappear {
+    /*
     writeChatTextField.alpha = 0;
     [writeChatTextField resignFirstResponder];
     [dimTimer setFireDate:HIDING_TIME_DEFAULT];
+    */
 }
 
 #pragma mark -
@@ -141,14 +146,12 @@
 
     // set initial orientation
     [self didRotate:[NSNotification notificationWithName:UIDeviceOrientationDidChangeNotification object:nil]];
-
-    // to put the slider vertical...
-    //slider.transform = CGAffineTransformMakeRotation(M_PI * 0.5);
 }
 
 -(void) viewDidUnload {
+    [dimTimer invalidate];
+    [popoverController dismissPopoverAnimated:NO];
     self.writeChatTextField = nil;
-    [popoverController dismissPopoverAnimated:NO];
     self.popoverController = nil;
     self.popupMenu = nil;
     self.spinningWheel = nil;
@@ -157,7 +160,6 @@
 }
 
 -(void) dealloc {
-    [dimTimer invalidate];
     [writeChatTextField release];
     [popupMenu release];
     [popoverController release];