hedgewars/uTextures.pas
changeset 6380 1ff5ad1d771b
parent 6305 5f7480c2a08d
child 6390 3807d4cad077
equal deleted inserted replaced
6379:ef4288298e57 6380:1ff5ad1d771b
   205 // deletes texture and frees the memory allocated for it.
   205 // deletes texture and frees the memory allocated for it.
   206 // if nil is passed nothing is done
   206 // if nil is passed nothing is done
   207 procedure FreeTexture(tex: PTexture);
   207 procedure FreeTexture(tex: PTexture);
   208 begin
   208 begin
   209     if tex <> nil then
   209     if tex <> nil then
   210     begin
   210         begin
   211         if tex^.NextTexture <> nil then
   211         if tex^.NextTexture <> nil then
   212             tex^.NextTexture^.PrevTexture:= tex^.PrevTexture;
   212             tex^.NextTexture^.PrevTexture:= tex^.PrevTexture;
   213         if tex^.PrevTexture <> nil then
   213         if tex^.PrevTexture <> nil then
   214             tex^.PrevTexture^.NextTexture:= tex^.NextTexture
   214             tex^.PrevTexture^.NextTexture:= tex^.NextTexture
   215         else
   215         else
   216             TextureList:= tex^.NextTexture;
   216             TextureList:= tex^.NextTexture;
   217         glDeleteTextures(1, @tex^.id);
   217         glDeleteTextures(1, @tex^.id);
   218         Dispose(tex);
   218         Dispose(tex);
   219     end
   219         end
   220 end;
   220 end;
   221 
   221 
   222 procedure initModule;
   222 procedure initModule;
   223 begin
   223 begin
   224 TextureList:= nil;
   224 TextureList:= nil;