379080004e5c0a2f5f68711ee12eba48bc6b3546
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);
29 procedure r_Draw_MultiTextureRepeatRotate (img: TGLMultiTexture; const anim: TAnimState; x, y, w, h: Integer; flip: Boolean; rx, ry, a: Integer);
33 implementation
35 uses
36 {$IFDEF USE_GLES1}
37 GLES11,
38 {$ELSE}
40 {$ENDIF}
43 g_game // gScreenWidth, gScreenHeight
44 ;
47 begin
51 glLoadIdentity;
54 glLoadIdentity;
58 begin
69 begin
71 begin
77 end
78 else
79 begin
100 end
103 (*
104 procedure r_Draw_Texture (img: TGLTexture; x, y, w, h: Integer; flip: Boolean);
105 var i, j, offx, offy, nw, nh: Integer; n: TGLAtlasNode;
106 begin
107 ASSERT(w >= 0);
108 ASSERT(h >= 0);
109 if img = nil then
110 DrawTile(nil, x, y, w, h, flip)
111 else
112 begin
113 offx := 0;
114 offy := 0;
115 nw := w div img.cols;
116 nh := h div img.lines;
117 for j := 0 to img.lines - 1 do
118 begin
119 for i := 0 to img.cols - 1 do
120 begin
121 n := img.GetTile(i, j);
122 ASSERT(n <> nil);
123 DrawTile(n, x + offx, y + offy, nw, nh, flip);
124 offx := offx + nw;
125 end;
126 offx := 0;
127 offy := offy + nh;
128 end
129 end
130 end;
131 *)
135 begin
140 else
141 begin
142 glPushMatrix;
147 begin
149 begin
158 glPopMatrix;
159 end
164 begin
169 else
175 procedure r_Draw_MultiTextureRepeat (m: TGLMultiTexture; const a: TAnimState; x, y, w, h: Integer; flip: Boolean);
177 begin
181 else
182 begin
184 begin
188 end
189 else
193 end
196 procedure r_Draw_MultiTextureRepeatRotate (img: TGLMultiTexture; const anim: TAnimState; x, y, w, h: Integer; flip: Boolean; rx, ry, a: Integer);
198 begin
202 begin
203 glPushMatrix;
208 glPopMatrix;
209 end
210 else
215 begin
227 glEnd;