hedgewars/uLandObjects.pas
changeset 2171 8208946331ba
parent 2152 a2811690da1b
child 2272 c59656d7b1de
equal deleted inserted replaced
2170:aa77f2a6b4f1 2171:8208946331ba
   187 until y > (LAND_HEIGHT-125);
   187 until y > (LAND_HEIGHT-125);
   188 
   188 
   189 if x1 > 0 then
   189 if x1 > 0 then
   190 	begin
   190 	begin
   191 	Result:= true;
   191 	Result:= true;
   192 	tmpsurf:= LoadImage(Pathz[ptCurrTheme] + '/Girder', false, false, true);
   192 	tmpsurf:= LoadImage(Pathz[ptCurrTheme] + '/Girder', ifTransparent or ifIgnoreCaps);
   193 	if tmpsurf = nil then tmpsurf:= LoadImage(Pathz[ptGraphics] + '/Girder', false, true, true);
   193 	if tmpsurf = nil then tmpsurf:= LoadImage(Pathz[ptGraphics] + '/Girder', ifCritical or ifTransparent or ifIgnoreCaps);
   194 	
   194 	
   195 	rr.x:= x1;
   195 	rr.x:= x1;
   196 	while rr.x < x2 do
   196 	while rr.x < x2 do
   197 		begin
   197 		begin
   198 		BlitImageAndGenerateCollisionInfo(rr.x, y, min(x2 - rr.x, tmpsurf^.w), tmpsurf);
   198 		BlitImageAndGenerateCollisionInfo(rr.x, y, min(x2 - rr.x, tmpsurf^.w), tmpsurf);
   369 
   369 
   370 // read sky and explosion border colors
   370 // read sky and explosion border colors
   371 Readln(f, c1.r, c1.g, c1. b);
   371 Readln(f, c1.r, c1.g, c1. b);
   372 Readln(f, c2.r, c2.g, c2. b);
   372 Readln(f, c2.r, c2.g, c2. b);
   373 // read water gradient colors
   373 // read water gradient colors
   374 Readln(f, WaterColorArray[0].r, WaterColorArray[0].g, WaterColorArray[0]. b);
   374 Readln(f, WaterColorArray[0].r, WaterColorArray[0].g, WaterColorArray[0].b);
   375 Readln(f, WaterColorArray[2].r, WaterColorArray[2].g, WaterColorArray[2]. b);
   375 Readln(f, WaterColorArray[2].r, WaterColorArray[2].g, WaterColorArray[2].b);
       
   376 WaterColorArray[0].a := 255;
       
   377 WaterColorArray[2].a := 255;
   376 WaterColorArray[1]:= WaterColorArray[0];
   378 WaterColorArray[1]:= WaterColorArray[0];
   377 WaterColorArray[3]:= WaterColorArray[2];
   379 WaterColorArray[3]:= WaterColorArray[2];
   378 
   380 
   379 glClearColor(c1.r / 255, c1.g / 255, c1.b / 255, 0.99); // sky color
   381 glClearColor(c1.r / 255, c1.g / 255, c1.b / 255, 0.99); // sky color
   380 cExplosionBorderColor:= c2.value or $FF000000;
   382 cExplosionBorderColor:= c2.value or $FF000000;
   391 for i:= 0 to Pred(ThemeObjects.Count) do
   393 for i:= 0 to Pred(ThemeObjects.Count) do
   392 	begin
   394 	begin
   393 	Readln(f, s); // filename
   395 	Readln(f, s); // filename
   394 	with ThemeObjects.objs[i] do
   396 	with ThemeObjects.objs[i] do
   395 			begin
   397 			begin
   396 			Surf:= LoadImage(Pathz[ptCurrTheme] + '/' + s, false, true, true);
   398 			Surf:= LoadImage(Pathz[ptCurrTheme] + '/' + s, ifCritical or ifTransparent or ifIgnoreCaps);
   397 			Width:= Surf^.w;
   399 			Width:= Surf^.w;
   398 			Height:= Surf^.h;
   400 			Height:= Surf^.h;
   399 			with inland do
   401 			with inland do
   400 				begin
   402 				begin
   401 				Read(f, x, y, w, h);
   403 				Read(f, x, y, w, h);
   418 for i:= 0 to Pred(SprayObjects.Count) do
   420 for i:= 0 to Pred(SprayObjects.Count) do
   419     begin
   421     begin
   420     Readln(f, s); // filename
   422     Readln(f, s); // filename
   421     with SprayObjects.objs[i] do
   423     with SprayObjects.objs[i] do
   422          begin
   424          begin
   423          Surf:= LoadImage(Pathz[ptCurrTheme] + '/' + s, false, true, true);
   425          Surf:= LoadImage(Pathz[ptCurrTheme] + '/' + s, ifCritical or ifTransparent or ifIgnoreCaps);
   424          Width:= Surf^.w;
   426          Width:= Surf^.w;
   425          Height:= Surf^.h;
   427          Height:= Surf^.h;
   426          ReadLn(f, Maxcnt)
   428          ReadLn(f, Maxcnt)
   427          end;
   429          end;
   428     end;
   430     end;