d76f493e3ed590f9ec3122b60b90731271ba5a14
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 uses
21 g_textures,
22 r_textures
23 ;
28 procedure r_Draw_MultiTextureRepeat (m: TGLMultiTexture; const a: TAnimState; x, y, w, h: Integer; flip: Boolean);
32 implementation
34 uses
35 {$IFDEF USE_GLES1}
36 GLES11,
37 {$ELSE}
39 {$ENDIF}
42 g_game // gScreenWidth, gScreenHeight
43 ;
46 begin
50 glLoadIdentity;
53 glLoadIdentity;
57 begin
68 begin
70 begin
76 end
77 else
78 begin
99 end
102 (*
103 procedure r_Draw_Texture (img: TGLTexture; x, y, w, h: Integer; flip: Boolean);
104 var i, j, offx, offy, nw, nh: Integer; n: TGLAtlasNode;
105 begin
106 ASSERT(w >= 0);
107 ASSERT(h >= 0);
108 if img = nil then
109 DrawTile(nil, x, y, w, h, flip)
110 else
111 begin
112 offx := 0;
113 offy := 0;
114 nw := w div img.cols;
115 nh := h div img.lines;
116 for j := 0 to img.lines - 1 do
117 begin
118 for i := 0 to img.cols - 1 do
119 begin
120 n := img.GetTile(i, j);
121 ASSERT(n <> nil);
122 DrawTile(n, x + offx, y + offy, nw, nh, flip);
123 offx := offx + nw;
124 end;
125 offx := 0;
126 offy := offy + nh;
127 end
128 end
129 end;
130 *)
134 begin
139 else
140 begin
141 glPushMatrix;
146 begin
148 begin
157 glPopMatrix;
158 end
163 begin
168 else
174 procedure r_Draw_MultiTextureRepeat (m: TGLMultiTexture; const a: TAnimState; x, y, w, h: Integer; flip: Boolean);
176 begin
180 else
181 begin
183 begin
187 end
188 else
192 end
196 begin
208 glEnd;