You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -688,14 +691,12 @@ ADE_FUNC(drawCurve, l_Graphics, "number X, number Y, number Radius", "Draws a cu
688
691
if(!ade_get_args(L, "iii|i", &x,&y,&ra, &dir))
689
692
returnADE_RETURN_NIL;
690
693
691
-
gr_lua_screen.active = true;
694
+
LuaScreenContext context;
692
695
693
696
//WMC - direction should be settable at a certain point via enumerations.
694
697
//Not gonna deal with it now.
695
698
gr_curve(x, y, ra, dir, lua_ResizeMode);
696
699
697
-
gr_lua_screen.active = false;
698
-
699
700
returnADE_RETURN_NIL;
700
701
}
701
702
@@ -709,12 +710,10 @@ ADE_FUNC(drawGradientLine, l_Graphics, "number X1, number Y1, number X2, number
709
710
if(!ade_get_args(L, "iiii", &x1, &y1, &x2, &y2))
710
711
returnADE_RETURN_NIL;
711
712
712
-
gr_lua_screen.active = true;
713
+
LuaScreenContext context;
713
714
714
715
gr_gradient(x1,y1,x2,y2,lua_ResizeMode);
715
716
716
-
gr_lua_screen.active = false;
717
-
718
717
returnADE_RETURN_NIL;
719
718
}
720
719
@@ -728,12 +727,10 @@ ADE_FUNC(drawLine, l_Graphics, "number X1, number Y1, number X2, number Y2", "Dr
728
727
if(!ade_get_args(L, "iiii", &x1, &y1, &x2, &y2))
729
728
returnADE_RETURN_NIL;
730
729
731
-
gr_lua_screen.active = true;
730
+
LuaScreenContext context;
732
731
733
732
gr_line(x1,y1,x2,y2,lua_ResizeMode);
734
733
735
-
gr_lua_screen.active = false;
736
-
737
734
returnADE_RETURN_NIL;
738
735
}
739
736
@@ -747,12 +744,10 @@ ADE_FUNC(drawPixel, l_Graphics, "number X, number Y", "Draws a pixel using activ
747
744
if(!ade_get_args(L, "ii", &x, &y))
748
745
returnADE_RETURN_NIL;
749
746
750
-
gr_lua_screen.active = true;
747
+
LuaScreenContext context;
751
748
752
749
gr_pixel(x,y,lua_ResizeMode);
753
750
754
-
gr_lua_screen.active = false;
755
-
756
751
returnADE_RETURN_NIL;
757
752
}
758
753
@@ -775,7 +770,7 @@ ADE_FUNC(drawPolygon,
775
770
if (!tdx->isValid())
776
771
returnADE_RETURN_FALSE;
777
772
778
-
gr_lua_screen.active = true;
773
+
LuaScreenContext context;
779
774
780
775
matrix *orip = &vmd_identity_matrix;
781
776
if(mh != NULL)
@@ -796,14 +791,12 @@ ADE_FUNC(drawPolygon,
796
791
if(!in_frame)
797
792
g3_end_frame();
798
793
799
-
gr_lua_screen.active = false;
800
-
801
794
returnADE_RETURN_TRUE;
802
795
}
803
796
804
797
voiddrawRectInternal(int x1, int x2, int y1, int y2, bool f = true, float a = 0.f)
805
798
{
806
-
gr_lua_screen.active = true;
799
+
LuaScreenContext context;
807
800
808
801
if(f)
809
802
{
@@ -845,8 +838,6 @@ void drawRectInternal(int x1, int x2, int y1, int y2, bool f = true, float a = 0
845
838
}
846
839
}
847
840
848
-
gr_lua_screen.active = false;
849
-
850
841
}
851
842
852
843
ADE_FUNC(drawRectangle, l_Graphics, "number X1, number Y1, number X2, number Y2, [boolean Filled=true, number angle=0.0]", "Draws a rectangle using active context values (like color or width). May be rotated by passing the angle parameter in radians.", nullptr, nullptr)
0 commit comments