1 (* Copyright (C) Doom 2D: Forever Developers
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, version 3 of the License ONLY.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program. If not, see <http://www.gnu.org/licenses/>.
14 *)
15 {$INCLUDE ../../shared/a_modes.inc}
18 interface
20 function g_Texture_CreateWAD (var ID: LongWord; const Resource: AnsiString; filterHint: Boolean = False): Boolean;
22 function g_Texture_CreateWADEx (const textureName, Resource: AnsiString; filterHint: Boolean = False): Boolean;
25 function g_Texture_GetSize (const textureName: AnsiString; var w, h: Integer): Boolean; overload;
30 implementation
32 uses
35 e_log,
36 r_graphics,
37 g_language, g_game
38 ;
40 type
48 var
52 var
54 begin
56 begin
58 begin
60 exit;
67 begin
69 begin
79 function g_Texture_CreateWAD (var ID: LongWord; const Resource: AnsiString; filterHint: Boolean = False): Boolean;
80 var
85 begin
93 begin
97 end
98 else
99 begin
101 //e_WriteLog(Format('WAD Reader error: %s', [WAD.GetLastErrorStr]), MSG_WARNING);
108 begin
111 begin
117 function g_Texture_CreateWADEx (const textureName, Resource: AnsiString; filterHint: Boolean = False): Boolean;
118 var
124 begin
133 begin
134 result := e_CreateTextureMem(TextureData, ResourceLength, texturesArray[find_id].ID, filterHint);
136 begin
137 e_GetTextureSize(texturesArray[find_id].ID, @texturesArray[find_id].width, @texturesArray[find_id].height);
142 end
143 else
144 begin
146 //e_WriteLog(Format('WAD Reader error: %s', [WAD.GetLastErrorStr]), MSG_WARNING);
154 var
156 begin
160 begin
163 e_GetTextureSize(texturesArray[find_id].ID, @texturesArray[find_id].width, @texturesArray[find_id].height);
164 end
170 var
172 begin
176 begin
178 begin
181 break;
184 //if not Result then g_ConsoleAdd('Texture '+TextureName+' not found');
187 function g_Texture_GetSize (const textureName: AnsiString; var w, h: Integer): Boolean; overload;
188 var
190 begin
196 begin
198 begin
202 break;
209 var
211 begin
217 begin
219 begin
223 break;
230 var
232 begin
235 begin
237 begin
249 var
251 begin
253 begin