@@ -88,7 +88,7 @@ function Canvas(_width, _height, _forceInit = false, _format = surface_rgba8unor
88
88
__CanvasError (" Canvas " + string (_canvas) + " is not a valid Canvas instance!" );
89
89
}
90
90
91
- __validateContents ();
91
+ __ValidateContents ();
92
92
CopySurface (_canvas.GetSurfaceID (), _x, _y, _forceResize, _updateCache);
93
93
return self;
94
94
}
@@ -107,7 +107,7 @@ function Canvas(_width, _height, _forceInit = false, _format = surface_rgba8unor
107
107
__CanvasError (" Canvas " + string (_canvas) + " is not a valid Canvas instance!" );
108
108
}
109
109
110
- __validateContents ();
110
+ __ValidateContents ();
111
111
CopySurfacePart (_canvas.GetSurfaceID (), _x, _y, _xs, _ys, _ws, _hs, _forceResize, _updateCache);
112
112
return self;
113
113
}
@@ -225,6 +225,10 @@ function Canvas(_width, _height, _forceInit = false, _format = surface_rgba8unor
225
225
__surface = -1 ;
226
226
}
227
227
228
+ __refContents.buff = -1 ;
229
+ __refContents.cbuff = -1 ;
230
+ __refContents.surf = -1 ;
231
+
228
232
if (!__isAppSurf) __status = CanvasStatus.NO_DATA ;
229
233
}
230
234
@@ -641,7 +645,7 @@ function Canvas(_width, _height, _forceInit = false, _format = surface_rgba8unor
641
645
draw_clear_alpha (_color, _alpha);
642
646
surface_reset_target ();
643
647
644
- buffer_fill (__buffer, 0 , buffer_u8, 0 , buffer_get_size (__buffer) );
648
+ __UpdateCache ( );
645
649
return self;
646
650
}
647
651
@@ -653,7 +657,7 @@ function Canvas(_width, _height, _forceInit = false, _format = surface_rgba8unor
653
657
// / @param {Real} x
654
658
// / @param {Real} y
655
659
static Draw = function (_x, _y) {
656
- __validateContents ();
660
+ __ValidateContents ();
657
661
CheckSurface ();
658
662
draw_surface (__surface, _x, _y);
659
663
}
@@ -666,15 +670,15 @@ function Canvas(_width, _height, _forceInit = false, _format = surface_rgba8unor
666
670
// / @param {Real} col
667
671
// / @param {Real} alpha
668
672
static DrawExt = function (_x, _y, _xscale, _yscale, _rot, _col, _alpha) {
669
- __validateContents ();
673
+ __ValidateContents ();
670
674
CheckSurface ();
671
675
draw_surface_ext (__surface, _x, _y, _xscale, _yscale, _rot, _col, _alpha);
672
676
}
673
677
674
678
// / @param {Real} x
675
679
// / @param {Real} y
676
680
static DrawTiled = function (_x, _y) {
677
- __validateContents ();
681
+ __ValidateContents ();
678
682
CheckSurface ();
679
683
draw_surface_tiled (__surface, _x, _y);
680
684
}
@@ -686,7 +690,7 @@ function Canvas(_width, _height, _forceInit = false, _format = surface_rgba8unor
686
690
// / @param {Real} colour
687
691
// / @param {Real} alpha
688
692
static DrawTiledExt = function (_x, _y, _xscale, _yscale, _col, _alpha) {
689
- __validateContents ();
693
+ __ValidateContents ();
690
694
CheckSurface ();
691
695
draw_surface_tiled_ext (__surface, _x, _y, _xscale, _yscale, _col, _alpha);
692
696
}
@@ -698,7 +702,7 @@ function Canvas(_width, _height, _forceInit = false, _format = surface_rgba8unor
698
702
// / @param {Real} x
699
703
// / @param {Real} y
700
704
static DrawPart = function (_left, _top, _width, _height, _x, _y) {
701
- __validateContents ();
705
+ __ValidateContents ();
702
706
CheckSurface ();
703
707
draw_surface_part (__surface, _left, _top, _width, _height, _x, _y);
704
708
}
@@ -714,7 +718,7 @@ function Canvas(_width, _height, _forceInit = false, _format = surface_rgba8unor
714
718
// / @param {Real} colour
715
719
// / @param {Real} alpha
716
720
static DrawPartExt = function (_left, _top, _width, _height, _x, _y, _xscale, _yscale, _col, _alpha) {
717
- __validateContents ();
721
+ __ValidateContents ();
718
722
CheckSurface ();
719
723
draw_surface_part_ext (__surface, _left, _top, _width, _height, _x, _y, _xscale, _yscale, _col, _alpha);
720
724
}
@@ -724,7 +728,7 @@ function Canvas(_width, _height, _forceInit = false, _format = surface_rgba8unor
724
728
// / @param {Real} width
725
729
// / @param {Real} height
726
730
static DrawStretched = function (_x, _y, _width, _height) {
727
- __validateContents ();
731
+ __ValidateContents ();
728
732
CheckSurface ();
729
733
draw_surface_stretched (__surface, _x, _y, _width, _height);
730
734
}
@@ -736,7 +740,7 @@ function Canvas(_width, _height, _forceInit = false, _format = surface_rgba8unor
736
740
// / @param {Real} colour
737
741
// / @param {Real} alpha
738
742
static DrawStretchedExt = function (_x, _y, _width, _height, _col, _alpha) {
739
- __validateContents ();
743
+ __ValidateContents ();
740
744
CheckSurface ();
741
745
draw_surface_stretched_ext (__surface, _x, _y, _width, _height, _col, _alpha);
742
746
}
@@ -756,7 +760,7 @@ function Canvas(_width, _height, _forceInit = false, _format = surface_rgba8unor
756
760
// / @param {Real} colour4
757
761
// / @param {Real} alpha
758
762
static DrawGeneral = function (_left, _top, _width, _height, _x, _y, _xscale, _yscale, _rot, _col1, _col2, _col3, _col4, _alpha) {
759
- __validateContents ();
763
+ __ValidateContents ();
760
764
CheckSurface ();
761
765
draw_surface_general (__surface, _left, _top, _width, _height, _x, _y, _xscale, _yscale, _rot, _col1, _col2, _col3, _col4, _alpha);
762
766
}
@@ -864,7 +868,7 @@ function Canvas(_width, _height, _forceInit = false, _format = surface_rgba8unor
864
868
__status = CanvasStatus.HAS_DATA ;
865
869
}
866
870
867
- static __validateContents = function () {
871
+ static __ValidateContents = function () {
868
872
if (!IsAvailable ()) {
869
873
__CanvasError (" Canvas has no data or in use!" );
870
874
}
0 commit comments