hedgewars/uWorld.pas
changeset 2171 8208946331ba
parent 2162 2bce91404d49
child 2178 d8b3417b2704
equal deleted inserted replaced
2170:aa77f2a6b4f1 2171:8208946331ba
   200 	VertexBuffer[2].Y:= lh;
   200 	VertexBuffer[2].Y:= lh;
   201 	VertexBuffer[3].X:= -lw;
   201 	VertexBuffer[3].X:= -lw;
   202 	VertexBuffer[3].Y:= lh;
   202 	VertexBuffer[3].Y:= lh;
   203 
   203 
   204 	glEnableClientState (GL_COLOR_ARRAY);
   204 	glEnableClientState (GL_COLOR_ARRAY);
   205 	glColorPointer(3, GL_UNSIGNED_BYTE, 0, @WaterColorArray[0]);
   205 	glColorPointer(4, GL_UNSIGNED_BYTE, 0, @WaterColorArray[0]);
   206 
   206 
   207 	glEnableClientState(GL_VERTEX_ARRAY);
   207 	glEnableClientState(GL_VERTEX_ARRAY);
   208 	glVertexPointer(2, GL_FLOAT, 0, @VertexBuffer[0]);
   208 	glVertexPointer(2, GL_FLOAT, 0, @VertexBuffer[0]);
   209 	
   209 
   210 	glDrawArrays(GL_TRIANGLE_FAN, 0, Length(VertexBuffer));
   210 	glDrawArrays(GL_TRIANGLE_FAN, 0, Length(VertexBuffer));
   211 
   211 
   212 	glEnableClientState(GL_COLOR_ARRAY);
   212 	glEnableClientState(GL_COLOR_ARRAY);
   213 	glDisableClientState(GL_COLOR_ARRAY);
   213 	glDisableClientState(GL_COLOR_ARRAY);
   214 
   214 
   423       FPS:= Frames;
   423       FPS:= Frames;
   424       Frames:= 0;
   424       Frames:= 0;
   425       CountTicks:= 0;
   425       CountTicks:= 0;
   426       s:= inttostr(FPS) + ' fps';
   426       s:= inttostr(FPS) + ' fps';
   427       if fpsTexture <> nil then FreeTexture(fpsTexture);
   427       if fpsTexture <> nil then FreeTexture(fpsTexture);
   428 {$IFNDEF IPHONEOS}
       
   429       tmpSurface:= TTF_RenderUTF8_Blended(Fontz[fnt16].Handle, Str2PChar(s), $FFFFFF);
   428       tmpSurface:= TTF_RenderUTF8_Blended(Fontz[fnt16].Handle, Str2PChar(s), $FFFFFF);
   430 {$ENDIF}
       
   431       fpsTexture:= Surface2Tex(tmpSurface);
   429       fpsTexture:= Surface2Tex(tmpSurface);
   432       SDL_FreeSurface(tmpSurface)
   430       SDL_FreeSurface(tmpSurface)
   433       end;
   431       end;
   434    if fpsTexture <> nil then
   432    if fpsTexture <> nil then
   435       DrawTexture(cScreenWidth div 2 - 50, 10, fpsTexture);
   433       DrawTexture(cScreenWidth div 2 - 50, 10, fpsTexture);
   470 
   468 
   471 procedure MoveCamera;
   469 procedure MoveCamera;
   472 const PrevSentPointTime: LongWord = 0;
   470 const PrevSentPointTime: LongWord = 0;
   473 var EdgesDist, cw: LongInt;
   471 var EdgesDist, cw: LongInt;
   474 begin
   472 begin
       
   473 
   475 cw:= round(cScreenWidth / cScaleFactor);
   474 cw:= round(cScreenWidth / cScaleFactor);
   476 
   475 
   477 
   476 if (not (CurrentTeam^.ExtDriven and isCursorVisible)) and cHasFocus then
   478 if (not (CurrentTeam^.ExtDriven and isCursorVisible))
       
   479 	and cHasFocus then
       
   480 	begin
   477 	begin
       
   478 {$IFDEF SDL13}
       
   479 	SDL_GetMouseState(0, @CursorPoint.X, @CursorPoint.Y);
       
   480 {$ELSE}
   481 	SDL_GetMouseState(@CursorPoint.X, @CursorPoint.Y);
   481 	SDL_GetMouseState(@CursorPoint.X, @CursorPoint.Y);
       
   482 {$ENDIF}
   482 	CursorPoint.X:= CursorPoint.X - cScreenWidth div 2;
   483 	CursorPoint.X:= CursorPoint.X - cScreenWidth div 2;
   483 //	CursorPoint.X:= round((CursorPoint.X - cScreenWidth / 2) * 2 / cScaleFactor);
   484 //	CursorPoint.X:= round((CursorPoint.X - cScreenWidth / 2) * 2 / cScaleFactor);
   484 //	CursorPoint.Y:= round(CursorPoint.Y * 2 / cScaleFactor);
   485 //	CursorPoint.Y:= round(CursorPoint.Y * 2 / cScaleFactor);
   485 	end;
   486 	end;
   486 
   487