index 5cad990728fdeef920044afd92044e06680ab12e..786229a847ef6dd5777801191e59647400c89950 100644 (file)
unit g_textures;
-{$MODE Delphi}
+{$INCLUDE ../shared/a_modes.inc}
interface
-uses LCLIntf, LCLType, LMessages, e_graphics;
+uses LCLIntf, LCLType, LMessages, e_graphics, utils;
function g_SimpleCreateTextureWAD(var ID: DWORD; Resource: string): Boolean;
function g_SimpleCreateTextureWADSize(var ID: DWORD; Resource: string;
function g_CreateTextureWAD(TextureName: ShortString; Resource: string; flag: Byte = 0): Boolean;
function g_CreateTextureWADSize(TextureName: ShortString; Resource: string;
X, Y, Width, Height: Word; flag: Byte = 0): Boolean;
-function g_CreateTextureMemorySize(pData: Pointer; Name: ShortString; X, Y,
+function g_CreateTextureMemorySize(pData: Pointer; dataLen: Integer; Name: ShortString; X, Y,
Width, Height: Word; flag: Byte = 0): Boolean;
function g_GetTexture(TextureName: ShortString; var ID: DWORD): Boolean;
WAD := TWADEditor_1.Create;
WAD.ReadFile(FileName);
- if WAD.GetResource(SectionName, ResourceName, TextureData, ResourceLength) then
+ if WAD.GetResource(utf2win(SectionName), utf2win(ResourceName), TextureData, ResourceLength) then
begin
- if e_CreateTextureMem(TextureData, ID) then Result := True;
+ if e_CreateTextureMem(TextureData, ResourceLength, ID) then Result := True;
FreeMem(TextureData);
end
else
WAD.Destroy;
end;
-function g_CreateTextureMemorySize(pData: Pointer; Name: ShortString; X, Y,
+function g_CreateTextureMemorySize(pData: Pointer; dataLen: Integer; Name: ShortString; X, Y,
Width, Height: Word; flag: Byte = 0): Boolean;
var
find_id: DWORD;
find_id := FindTexture;
- if not e_CreateTextureMemEx(pData, TexturesArray[find_id].ID, X, Y, Width, Height) then
+ if not e_CreateTextureMemEx(pData, dataLen, TexturesArray[find_id].ID, X, Y, Width, Height) then
begin
FreeMem(pData);
Exit;
WAD := TWADEditor_1.Create;
WAD.ReadFile(FileName);
- if WAD.GetResource(SectionName, ResourceName, TextureData, ResourceLength) then
+ if WAD.GetResource(utf2win(SectionName), utf2win(ResourceName), TextureData, ResourceLength) then
begin
- Result := e_CreateTextureMem(TextureData, TexturesArray[find_id].ID);
+ Result := e_CreateTextureMem(TextureData, ResourceLength, TexturesArray[find_id].ID);
FreeMem(TextureData);
if Result then
begin
WAD := TWADEditor_1.Create;
WAD.ReadFile(FileName);
- if WAD.GetResource(SectionName, ResourceName, TextureData, ResourceLength) then
+ if WAD.GetResource(utf2win(SectionName), utf2win(ResourceName), TextureData, ResourceLength) then
begin
- if e_CreateTextureMemEx(TextureData, ID, X, Y, Width, Height) then Result := True;
+ if e_CreateTextureMemEx(TextureData, ResourceLength, ID, X, Y, Width, Height) then Result := True;
FreeMem(TextureData);
end
else
WAD := TWADEditor_1.Create;
WAD.ReadFile(FileName);
- if WAD.GetResource(SectionName, ResourceName, TextureData, ResourceLength) then
+ if WAD.GetResource(utf2win(SectionName), utf2win(ResourceName), TextureData, ResourceLength) then
begin
- Result := e_CreateTextureMemEx(TextureData, TexturesArray[find_id].ID, X, Y, Width, Height);
+ Result := e_CreateTextureMemEx(TextureData, ResourceLength, TexturesArray[find_id].ID, X, Y, Width, Height);
FreeMem(TextureData);
if Result then
begin