- procedure TTexture.AddRef;
- begin
- inc(refcount);
- end;
- procedure TTexture.Release;
- begin
- dec(refcount);
- if refcount<=0 then
- begin
- texturelist.delete(texturelist.indexof(name));
- Free;
- end;
- end;
- class function TTexture.LoadTexture(const name:string):TTexture;
- var
- i:Integer;
- begin
- i:=texturelist.indexof(name);
- if i=-1 then result:=TTexture.create(name) else result:=TTexture(texturelist.objects[i]);
- result.AddRef;
- end;