hedgewars/uStore.pas
changeset 2292 87af4ad0ec98
parent 2290 bf87ca44782e
child 2332 351abbbb12f3
equal deleted inserted replaced
2291:353fb9621da0 2292:87af4ad0ec98
   289 				end;
   289 				end;
   290 			if imageWidth = 0 then imageWidth := tmpsurf^.w;
   290 			if imageWidth = 0 then imageWidth := tmpsurf^.w;
   291 			if imageHeight = 0 then imageHeight := tmpsurf^.h;
   291 			if imageHeight = 0 then imageHeight := tmpsurf^.h;
   292 			if Width = 0 then Width:= tmpsurf^.w;
   292 			if Width = 0 then Width:= tmpsurf^.w;
   293 			if Height = 0 then Height:= tmpsurf^.h;
   293 			if Height = 0 then Height:= tmpsurf^.h;
   294             if (ii = sprSky) or (ii = sprWater) then
   294             if (ii = sprSky) then
   295 			    Texture:= Surface2Tex(tmpsurf, true)
   295 			    Texture:= Surface2Tex(tmpsurf, true)
   296             else
   296             else
   297 			    Texture:= Surface2Tex(tmpsurf, false);
   297 			    Texture:= Surface2Tex(tmpsurf, false);
   298 			if saveSurf then Surface:= tmpsurf else SDL_FreeSurface(tmpsurf)
   298 			if saveSurf then Surface:= tmpsurf else SDL_FreeSurface(tmpsurf)
   299 		end;
   299 		end;
   974 end;
   974 end;
   975 
   975 
   976 procedure SetScale(f: GLfloat);
   976 procedure SetScale(f: GLfloat);
   977 begin
   977 begin
   978 cScaleFactor:= f;
   978 cScaleFactor:= f;
   979 if SpritesData[sprWater].Width <> 0 then
       
   980     cWaterSprCount:= 1 + round(cScreenWidth * 2 / cScaleFactor / SpritesData[sprWater].Width);
       
   981 
   979 
   982 glLoadIdentity;
   980 glLoadIdentity;
   983 glViewport(0, 0, cScreenWidth, cScreenHeight);
   981 glViewport(0, 0, cScreenWidth, cScreenHeight);
   984 glScalef(f / cScreenWidth, -f / cScreenHeight, 1.0);
   982 glScalef(f / cScreenWidth, -f / cScreenHeight, 1.0);
   985 //glTranslatef(-cScreenWidth / 2, -cScreenHeight / 2, 0);
   983 //glTranslatef(-cScreenWidth / 2, -cScreenHeight / 2, 0);