Skip to content

Commit cbea39a

Browse files
committed
LN_GLCORE Fix bug introduced in 9b3d9e3 when using multiple colors
Problem stems from conversion of apply to case-based approach which didn't consider that colors in glCore:TextureDrawUnClipped is now a list of lists. Also patched glCore:TextureDrawClipped
1 parent 7561c9a commit cbea39a

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

modules/ln_glcore/glcore.scm

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -298,15 +298,15 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
298298
(glCoreVertex2f w2 h2 @x2 @y2)
299299
(glCoreVertex2f (fl- w2) (fl- h2) @x1 @y1)
300300
(glCoreVertex2f w2 (fl- h2) @x2 @y1)
301-
)(begin
302-
(glCoreColor (car colors))
303-
(glCoreVertex2f (fl- w2) h2 @x1 @y2)
304-
(glCoreColor (cadr colors))
305-
(glCoreVertex2f w2 h2 @x2 @y2)
306-
(glCoreColor (caddr colors))
307-
(glCoreVertex2f (fl- w2) (fl- h2) @x1 @y1)
308-
(glCoreColor (cadddr colors))
309-
(glCoreVertex2f w2 (fl- h2) @x2 @y1)
301+
)(let ((colors (list->vector (car colors))))
302+
(glCoreColor (vector-ref colors 0))
303+
(glCoreVertex2f (fl- w2) h2 @x1 @y2)
304+
(glCoreColor (vector-ref colors 1))
305+
(glCoreVertex2f w2 h2 @x2 @y2)
306+
(glCoreColor (vector-ref colors 2))
307+
(glCoreVertex2f (fl- w2) (fl- h2) @x1 @y1)
308+
(glCoreColor (vector-ref colors 3))
309+
(glCoreVertex2f w2 (fl- h2) @x2 @y1)
310310
))
311311
(glCoreEnd)
312312
(glPopMatrix)
@@ -341,7 +341,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
341341
(glCoreVertex2f (fl- cw2) (fl- ch2) c@x1 c@y1)
342342
(glCoreVertex2f cw2 (fl- ch2) c@x2 c@y1)
343343
)
344-
(let ((colors (list->vector colors)))
344+
(let ((colors (list->vector (car colors))))
345345
;; TODO: color interpolation here!
346346
(glCoreColor (vector-ref colors 0))
347347
(glCoreVertex2f (fl- cw2) ch2 c@x1 c@y2)

0 commit comments

Comments
 (0)