Skip to content

Commit 7dfb98c

Browse files
committed
Release 2.1 prebake-rotation
1 parent f5e6061 commit 7dfb98c

File tree

12 files changed

+76
-47
lines changed

12 files changed

+76
-47
lines changed
+9-10
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,33 @@
11
{
22
"FolderOrderSettings": [
3-
{"name":"outline-shader-drawer","order":4,"path":"folders/outline-shader-drawer.yy",},
43
{"name":"_third_party_packages_","order":3,"path":"folders/_third_party_packages_.yy",},
5-
{"name":"Canvas","order":1,"path":"folders/_third_party_packages_/Canvas.yy",},
4+
{"name":"outline-shader-drawer","order":4,"path":"folders/outline-shader-drawer.yy",},
65
{"name":"System","order":1,"path":"folders/_third_party_packages_/Canvas/System.yy",},
76
],
87
"ResourceOrderSettings": [
9-
{"name":"__CanvasSurfFormat","order":4,"path":"scripts/__CanvasSurfFormat/__CanvasSurfFormat.yy",},
8+
{"name":"Canvas","order":2,"path":"scripts/Canvas/Canvas.yy",},
9+
{"name":"__CanvasError","order":2,"path":"scripts/__CanvasError/__CanvasError.yy",},
1010
{"name":"DemoMace","order":1,"path":"objects/DemoMace/DemoMace.yy",},
11-
{"name":"CanvasIsCanvas","order":4,"path":"scripts/CanvasIsCanvas/CanvasIsCanvas.yy",},
12-
{"name":"__CanvasTrace","order":6,"path":"scripts/__CanvasTrace/__CanvasTrace.yy",},
1311
{"name":"OutlineObject","order":2,"path":"objects/OutlineObject/OutlineObject.yy",},
1412
{"name":"seqRotatingLoop","order":2,"path":"sequences/seqRotatingLoop/seqRotatingLoop.yy",},
1513
{"name":"OutlineLogo","order":8,"path":"objects/OutlineLogo/OutlineLogo.yy",},
14+
{"name":"CanvasIsCanvas","order":4,"path":"scripts/CanvasIsCanvas/CanvasIsCanvas.yy",},
1615
{"name":"sprite_to_canvas","order":5,"path":"scripts/sprite_to_canvas/sprite_to_canvas.yy",},
17-
{"name":"Canvas","order":2,"path":"scripts/Canvas/Canvas.yy",},
18-
{"name":"__CanvasSystem","order":5,"path":"scripts/__CanvasSystem/__CanvasSystem.yy",},
19-
{"name":"__CanvasCleanupQueue","order":1,"path":"scripts/__CanvasCleanupQueue/__CanvasCleanupQueue.yy",},
2016
{"name":"DemoPotion","order":6,"path":"objects/DemoPotion/DemoPotion.yy",},
2117
{"name":"sprHellToHeaven","order":4,"path":"sprites/sprHellToHeaven/sprHellToHeaven.yy",},
22-
{"name":"__CanvasGC","order":3,"path":"scripts/__CanvasGC/__CanvasGC.yy",},
18+
{"name":"__CanvasCleanupQueue","order":1,"path":"scripts/__CanvasCleanupQueue/__CanvasCleanupQueue.yy",},
19+
{"name":"__CanvasTrace","order":6,"path":"scripts/__CanvasTrace/__CanvasTrace.yy",},
2320
{"name":"CanvasGetAppSurf","order":3,"path":"scripts/CanvasGetAppSurf/CanvasGetAppSurf.yy",},
2421
{"name":"RotatingCoin","order":1,"path":"objects/RotatingCoin/RotatingCoin.yy",},
2522
{"name":"DemoTextDrawer","order":3,"path":"objects/DemoTextDrawer/DemoTextDrawer.yy",},
23+
{"name":"__CanvasSurfFormat","order":4,"path":"scripts/__CanvasSurfFormat/__CanvasSurfFormat.yy",},
24+
{"name":"__CanvasGC","order":3,"path":"scripts/__CanvasGC/__CanvasGC.yy",},
2625
{"name":"sprMace","order":3,"path":"sprites/sprMace/sprMace.yy",},
2726
{"name":"sprRedPotion","order":4,"path":"sprites/sprRedPotion/sprRedPotion.yy",},
2827
{"name":"sprOutlineTitle","order":7,"path":"sprites/sprOutlineTitle/sprOutlineTitle.yy",},
29-
{"name":"__CanvasError","order":2,"path":"scripts/__CanvasError/__CanvasError.yy",},
3028
{"name":"shd_outline","order":4,"path":"shaders/shd_outline/shd_outline.yy",},
3129
{"name":"OutlineObjectBaked","order":3,"path":"objects/OutlineObjectBaked/OutlineObjectBaked.yy",},
30+
{"name":"__CanvasSystem","order":5,"path":"scripts/__CanvasSystem/__CanvasSystem.yy",},
3231
{"name":"outline_drawer","order":1,"path":"scripts/outline_drawer/outline_drawer.yy",},
3332
],
3433
}

gml-outline-shader-drawer.yyp

+11-11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

objects/DemoPotion/DemoPotion.yy

+3-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

objects/DemoTextDrawer/Create_0.gml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/// @description event
2+
//show_debug_overlay(true);

objects/DemoTextDrawer/DemoTextDrawer.yy

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

objects/DemoTextDrawer/Draw_0.gml

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ draw_text(10, 10,
66
"Outline Drawer Demo\nHover the mouse over any of the objects.\n" +
77
"Press 1-5 to set strength of outline\n" +
88
"Press A to toggle alpha fading of the outline (better visuals with strength 4+)\n" +
9-
"Mace+Potion: Press R to let the sprite rotate slowly so you can watch rotating outlines"
9+
"Mace+Potion: Press R to let the sprite rotate slowly so you can watch rotating outlines\n" +
10+
"The Mace uses OutlineObject and the Potion uses OutlineObjectBaked (prebaked shader)"
1011
);
1112

1213
draw_set_color(c_white);

objects/OutlineObjectBaked/Create_0.gml

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ __free = function() {
1010
/// @function bake()
1111
bake = function() {
1212
if (canvas != undefined) canvas.free();
13-
log("Pre-Baking sprite '{0}' with {1} frames", sprite_get_name(sprite_index), image_number);
13+
show_debug_message("Pre-Baking sprite '{0}' with {1} frames", sprite_get_name(sprite_index), image_number);
1414
var begintime = current_time;
1515
var shader = shd_outline;
1616
var u_texel = shader_get_uniform(shader, "u_vTexel");
@@ -38,14 +38,14 @@ bake = function() {
3838
canvas.canvas.Free();
3939
// ...and inject the pre-baked
4040
canvas.canvas = target;
41-
log("Pre-Baking took {0}ms", current_time - begintime);
41+
show_debug_message("Pre-Baking took {0}ms", current_time - begintime);
4242
}
4343

4444
__draw = function() {
4545
if (canvas == undefined) bake();
4646
image_index = canvas.get_image_index(delta_time, image_speed);
4747
if (outline_always || (outline_on_mouse_over && mouse_is_over))
48-
canvas.draw_frame(image_index, x - outline_strength - TEXTURE_PAGE_BORDER_SIZE, y - outline_strength - TEXTURE_PAGE_BORDER_SIZE);
48+
canvas.draw_frame_ext(image_index, x, y, depth, image_xscale, image_yscale, image_angle, image_blend, image_alpha);
4949
else
5050
draw_self();
5151
}

options/operagx/options_operagx.yy

+10-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/Canvas/Canvas.gml

+17-13
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ function Canvas(_width, _height, _forceInit = false, _format = surface_rgba8unor
8888
__CanvasError("Canvas " + string(_canvas) + " is not a valid Canvas instance!");
8989
}
9090

91-
__validateContents();
91+
__ValidateContents();
9292
CopySurface(_canvas.GetSurfaceID(), _x, _y, _forceResize, _updateCache);
9393
return self;
9494
}
@@ -107,7 +107,7 @@ function Canvas(_width, _height, _forceInit = false, _format = surface_rgba8unor
107107
__CanvasError("Canvas " + string(_canvas) + " is not a valid Canvas instance!");
108108
}
109109

110-
__validateContents();
110+
__ValidateContents();
111111
CopySurfacePart(_canvas.GetSurfaceID(), _x, _y, _xs, _ys, _ws, _hs, _forceResize, _updateCache);
112112
return self;
113113
}
@@ -225,6 +225,10 @@ function Canvas(_width, _height, _forceInit = false, _format = surface_rgba8unor
225225
__surface = -1;
226226
}
227227

228+
__refContents.buff = -1;
229+
__refContents.cbuff = -1;
230+
__refContents.surf = -1;
231+
228232
if (!__isAppSurf) __status = CanvasStatus.NO_DATA;
229233
}
230234

@@ -641,7 +645,7 @@ function Canvas(_width, _height, _forceInit = false, _format = surface_rgba8unor
641645
draw_clear_alpha(_color, _alpha);
642646
surface_reset_target();
643647

644-
buffer_fill(__buffer, 0, buffer_u8, 0, buffer_get_size(__buffer));
648+
__UpdateCache();
645649
return self;
646650
}
647651

@@ -653,7 +657,7 @@ function Canvas(_width, _height, _forceInit = false, _format = surface_rgba8unor
653657
/// @param {Real} x
654658
/// @param {Real} y
655659
static Draw = function(_x, _y) {
656-
__validateContents();
660+
__ValidateContents();
657661
CheckSurface();
658662
draw_surface(__surface, _x, _y);
659663
}
@@ -666,15 +670,15 @@ function Canvas(_width, _height, _forceInit = false, _format = surface_rgba8unor
666670
/// @param {Real} col
667671
/// @param {Real} alpha
668672
static DrawExt = function(_x, _y, _xscale, _yscale, _rot, _col, _alpha) {
669-
__validateContents();
673+
__ValidateContents();
670674
CheckSurface();
671675
draw_surface_ext(__surface, _x, _y, _xscale, _yscale, _rot, _col, _alpha);
672676
}
673677

674678
/// @param {Real} x
675679
/// @param {Real} y
676680
static DrawTiled = function(_x, _y) {
677-
__validateContents();
681+
__ValidateContents();
678682
CheckSurface();
679683
draw_surface_tiled(__surface, _x, _y);
680684
}
@@ -686,7 +690,7 @@ function Canvas(_width, _height, _forceInit = false, _format = surface_rgba8unor
686690
/// @param {Real} colour
687691
/// @param {Real} alpha
688692
static DrawTiledExt = function(_x, _y, _xscale, _yscale, _col, _alpha) {
689-
__validateContents();
693+
__ValidateContents();
690694
CheckSurface();
691695
draw_surface_tiled_ext(__surface, _x, _y, _xscale, _yscale, _col, _alpha);
692696
}
@@ -698,7 +702,7 @@ function Canvas(_width, _height, _forceInit = false, _format = surface_rgba8unor
698702
/// @param {Real} x
699703
/// @param {Real} y
700704
static DrawPart = function(_left, _top, _width, _height, _x, _y) {
701-
__validateContents();
705+
__ValidateContents();
702706
CheckSurface();
703707
draw_surface_part(__surface, _left, _top, _width, _height, _x, _y);
704708
}
@@ -714,7 +718,7 @@ function Canvas(_width, _height, _forceInit = false, _format = surface_rgba8unor
714718
/// @param {Real} colour
715719
/// @param {Real} alpha
716720
static DrawPartExt = function(_left, _top, _width, _height, _x, _y, _xscale, _yscale, _col, _alpha) {
717-
__validateContents();
721+
__ValidateContents();
718722
CheckSurface();
719723
draw_surface_part_ext(__surface, _left, _top, _width, _height, _x, _y, _xscale, _yscale, _col, _alpha);
720724
}
@@ -724,7 +728,7 @@ function Canvas(_width, _height, _forceInit = false, _format = surface_rgba8unor
724728
/// @param {Real} width
725729
/// @param {Real} height
726730
static DrawStretched = function(_x, _y, _width, _height) {
727-
__validateContents();
731+
__ValidateContents();
728732
CheckSurface();
729733
draw_surface_stretched(__surface, _x, _y, _width, _height);
730734
}
@@ -736,7 +740,7 @@ function Canvas(_width, _height, _forceInit = false, _format = surface_rgba8unor
736740
/// @param {Real} colour
737741
/// @param {Real} alpha
738742
static DrawStretchedExt = function(_x, _y, _width, _height, _col, _alpha) {
739-
__validateContents();
743+
__ValidateContents();
740744
CheckSurface();
741745
draw_surface_stretched_ext(__surface, _x, _y, _width, _height, _col, _alpha);
742746
}
@@ -756,7 +760,7 @@ function Canvas(_width, _height, _forceInit = false, _format = surface_rgba8unor
756760
/// @param {Real} colour4
757761
/// @param {Real} alpha
758762
static DrawGeneral = function(_left, _top, _width, _height, _x, _y, _xscale, _yscale, _rot, _col1, _col2, _col3, _col4, _alpha) {
759-
__validateContents();
763+
__ValidateContents();
760764
CheckSurface();
761765
draw_surface_general(__surface, _left, _top, _width, _height, _x, _y, _xscale, _yscale, _rot, _col1, _col2, _col3, _col4, _alpha);
762766
}
@@ -864,7 +868,7 @@ function Canvas(_width, _height, _forceInit = false, _format = surface_rgba8unor
864868
__status = CanvasStatus.HAS_DATA;
865869
}
866870

867-
static __validateContents = function() {
871+
static __ValidateContents = function() {
868872
if (!IsAvailable()) {
869873
__CanvasError("Canvas has no data or in use!");
870874
}

scripts/__CanvasSystem/__CanvasSystem.gml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function __CanvasSystem() {
1111
}
1212

1313
#macro __CANVAS_CREDITS "@TabularElf - https://tabelf.link/"
14-
#macro __CANVAS_VERSION "v2.0.0"
14+
#macro __CANVAS_VERSION "v2.0.1"
1515
#macro __CANVAS_ON_WEB (os_browser != browser_not_a_browser)
1616
__CanvasTrace(__CANVAS_VERSION + " initalized! Created by " + __CANVAS_CREDITS);
1717

scripts/_outline_shader_drawer_version_/_outline_shader_drawer_version_.gml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#macro OUTLINE_SHADER_VERSION "2.0"
1+
#macro OUTLINE_SHADER_VERSION "2.1"
22
#macro OUTLINE_SHADER_NAME "outline-shader-drawer "
33
#macro OUTLINE_SHADER_COPYRIGHT "(c)2022* coldrock.games, @Grisgram (github)"
44

0 commit comments

Comments
 (0)