hedgewars/uStore.pas
changeset 2447 08d623a494e6
parent 2438 6df2e58b6ab2
child 2452 a6edc408a376
equal deleted inserted replaced
2446:cbb3af76bcc0 2447:08d623a494e6
   177 					if Hat <> 'NoHat' then
   177 					if Hat <> 'NoHat' then
   178 						begin
   178 						begin
   179 						texsurf:= LoadImage(Pathz[ptHats] + '/' + Hat, ifNone);
   179 						texsurf:= LoadImage(Pathz[ptHats] + '/' + Hat, ifNone);
   180 						if texsurf <> nil then
   180 						if texsurf <> nil then
   181 							begin
   181 							begin
   182 							HatTex:= Surface2Tex(texsurf, false);
   182 							HatTex:= Surface2Tex(texsurf, true);
   183 							SDL_FreeSurface(texsurf)
   183 							SDL_FreeSurface(texsurf)
   184 							end
   184 							end
   185 						end
   185 						end
   186 					end;
   186 					end;
   187 		end;
   187 		end;
   297 				begin
   297 				begin
   298 				if imageWidth = 0 then imageWidth := tmpsurf^.w;
   298 				if imageWidth = 0 then imageWidth := tmpsurf^.w;
   299 				if imageHeight = 0 then imageHeight := tmpsurf^.h;
   299 				if imageHeight = 0 then imageHeight := tmpsurf^.h;
   300 				if Width = 0 then Width:= tmpsurf^.w;
   300 				if Width = 0 then Width:= tmpsurf^.w;
   301 				if Height = 0 then Height:= tmpsurf^.h;
   301 				if Height = 0 then Height:= tmpsurf^.h;
   302 				if (ii = sprSky) then
   302 				if (ii in [sprSky, sprSkyL, sprSkyR, sprHorizont, sprHorizontL, sprHorizontR, sprFlake]) then
   303 					Texture:= Surface2Tex(tmpsurf, true)
   303 					Texture:= Surface2Tex(tmpsurf, true)
   304 				else
   304 				else
       
   305 					begin
   305 					Texture:= Surface2Tex(tmpsurf, false);
   306 					Texture:= Surface2Tex(tmpsurf, false);
       
   307 					if (ii = sprWater) and not cReducedQuality then // HACK: We should include some sprite attribute to define the texture wrap directions
       
   308 						glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
       
   309 					end;
   306 				if saveSurf then Surface:= tmpsurf else SDL_FreeSurface(tmpsurf)
   310 				if saveSurf then Surface:= tmpsurf else SDL_FreeSurface(tmpsurf)
   307 				end
   311 				end
   308 			else
   312 			else
   309 				Surface:= nil
   313 				Surface:= nil
   310 		end;
   314 		end;
   875         end;
   879         end;
   876     inc(pos);
   880     inc(pos);
   877     end;
   881     end;
   878 
   882 
   879 //TryDo(SDL_SetColorKey(Result, SDL_SRCCOLORKEY, 0) = 0, errmsgTransparentSet, true);
   883 //TryDo(SDL_SetColorKey(Result, SDL_SRCCOLORKEY, 0) = 0, errmsgTransparentSet, true);
   880 RenderSpeechBubbleTex:= Surface2Tex(Result, false);
   884 RenderSpeechBubbleTex:= Surface2Tex(Result, true);
   881 
   885 
   882 SDL_FreeSurface(rotatedEdge);
   886 SDL_FreeSurface(rotatedEdge);
   883 SDL_FreeSurface(Result)
   887 SDL_FreeSurface(Result)
   884 end;
   888 end;
   885 
   889