hedgewars/hwengine.dpr
changeset 2243 b4764993f833
parent 2191 20c62f787a4d
child 2244 853a1db1cff6
equal deleted inserted replaced
2242:2e8251933b71 2243:b4764993f833
    70 
    70 
    71 procedure OnDestroy; forward;
    71 procedure OnDestroy; forward;
    72 
    72 
    73 ////////////////////////////////
    73 ////////////////////////////////
    74 procedure DoTimer(Lag: LongInt);
    74 procedure DoTimer(Lag: LongInt);
       
    75 {$IFNDEF IPHONEOS}
    75 var s: string;
    76 var s: string;
       
    77 {$ENDIF}
    76 begin
    78 begin
    77 inc(RealTicks, Lag);
    79 inc(RealTicks, Lag);
    78 
    80 
    79 case GameState of
    81 case GameState of
    80 	gsLandGen: begin
    82 	gsLandGen: begin
   139 StoreRelease;
   141 StoreRelease;
   140 FreeLand;
   142 FreeLand;
   141 SendKB;
   143 SendKB;
   142 CloseIPC;
   144 CloseIPC;
   143 TTF_Quit;
   145 TTF_Quit;
   144 {$IFNDEF IPHONEOS}
   146 {$IFNDEF IPHONEOS or DEBUGFILE}
   145 //i know it is not clean but it is better than a crash
   147 //i know it is not clean but it is better than a crash
   146 SDL_Quit;
   148 SDL_Quit;
   147 {$ENDIF}
   149 {$ENDIF}
   148 halt
   150 halt
   149 end;
   151 end;
   167 begin
   169 begin
   168 PrevTime:= SDL_GetTicks;
   170 PrevTime:= SDL_GetTicks;
   169 repeat
   171 repeat
   170 while SDL_PollEvent(@event) <> 0 do
   172 while SDL_PollEvent(@event) <> 0 do
   171 	case event.type_ of
   173 	case event.type_ of
   172 		{thinker here for adding touch events}
   174 	{$IFDEF IPHONEOS}
       
   175 		SDL_MOUSEMOTION: WriteLnToConsole('mouse number ' + inttostr(SDL_SelectMouse(event.motion.which)) + ' over ' + inttostr(SDL_GetNumMice()));
       
   176 	{$ELSE}
   173 		SDL_KEYDOWN: if GameState = gsChat then KeyPressChat(event.key.keysym.unicode);
   177 		SDL_KEYDOWN: if GameState = gsChat then KeyPressChat(event.key.keysym.unicode);
       
   178 	{$ENDIF}
   174 		SDL_ACTIVEEVENT: if (event.active.state and SDL_APPINPUTFOCUS) <> 0 then
   179 		SDL_ACTIVEEVENT: if (event.active.state and SDL_APPINPUTFOCUS) <> 0 then
   175 				cHasFocus:= event.active.gain = 1;
   180 				cHasFocus:= event.active.gain = 1;
   176 		//SDL_VIDEORESIZE: Resize(max(event.resize.w, 600), max(event.resize.h, 450));
   181 		//SDL_VIDEORESIZE: Resize(max(event.resize.w, 600), max(event.resize.h, 450));
   177 		SDL_QUITEV: isTerminated:= true
   182 		SDL_QUITEV: isTerminated:= true
   178 		end;
   183 		end;