commit 9441aa63cb45853847d93dc3a131f8ea96ebb208 Author: veclav talica Date: Fri Nov 24 04:02:18 2023 +0500 simple composable grid context and grid controller, fiend sprite, godotxel addon diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..24a8e87 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.png filter=lfs diff=lfs merge=lfs -text diff --git a/.import/.gdignore b/.import/.gdignore new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/.import/.gdignore @@ -0,0 +1 @@ + diff --git a/.import/BrushCircle.png-dd250909fee7964ffc38f7e4fcfe9c07.md5 b/.import/BrushCircle.png-dd250909fee7964ffc38f7e4fcfe9c07.md5 new file mode 100644 index 0000000..2b626cc --- /dev/null +++ b/.import/BrushCircle.png-dd250909fee7964ffc38f7e4fcfe9c07.md5 @@ -0,0 +1,3 @@ +source_md5="02600b8740456771affee06983e57ba2" +dest_md5="da049aced7d51eead426dccecd83e17d" + diff --git a/.import/BrushCircle.png-dd250909fee7964ffc38f7e4fcfe9c07.stex b/.import/BrushCircle.png-dd250909fee7964ffc38f7e4fcfe9c07.stex new file mode 100644 index 0000000..53da307 Binary files /dev/null and b/.import/BrushCircle.png-dd250909fee7964ffc38f7e4fcfe9c07.stex differ diff --git a/.import/BrushCircle_Hovered.png-ae1a4d835af51e8a293b71d6a241b71c.md5 b/.import/BrushCircle_Hovered.png-ae1a4d835af51e8a293b71d6a241b71c.md5 new file mode 100644 index 0000000..637228e --- /dev/null +++ b/.import/BrushCircle_Hovered.png-ae1a4d835af51e8a293b71d6a241b71c.md5 @@ -0,0 +1,3 @@ +source_md5="fdff01762759c532cf06f6c399898003" +dest_md5="fe9b15be81847e11ef7929564db675ca" + diff --git a/.import/BrushCircle_Hovered.png-ae1a4d835af51e8a293b71d6a241b71c.stex b/.import/BrushCircle_Hovered.png-ae1a4d835af51e8a293b71d6a241b71c.stex new file mode 100644 index 0000000..4170c79 Binary files /dev/null and b/.import/BrushCircle_Hovered.png-ae1a4d835af51e8a293b71d6a241b71c.stex differ diff --git a/.import/BrushHLine.png-9182ec8ac804af16d356bf911782e299.md5 b/.import/BrushHLine.png-9182ec8ac804af16d356bf911782e299.md5 new file mode 100644 index 0000000..41dfbcd --- /dev/null +++ b/.import/BrushHLine.png-9182ec8ac804af16d356bf911782e299.md5 @@ -0,0 +1,3 @@ +source_md5="3364be2e9af88c9893e2a69af65b0547" +dest_md5="e754226789026560da0e12e720b31660" + diff --git a/.import/BrushHLine.png-9182ec8ac804af16d356bf911782e299.stex b/.import/BrushHLine.png-9182ec8ac804af16d356bf911782e299.stex new file mode 100644 index 0000000..ca68cf2 Binary files /dev/null and b/.import/BrushHLine.png-9182ec8ac804af16d356bf911782e299.stex differ diff --git a/.import/BrushHLine_Hovered.png-e51d5f3c1628c510a225057f3ed60d5a.md5 b/.import/BrushHLine_Hovered.png-e51d5f3c1628c510a225057f3ed60d5a.md5 new file mode 100644 index 0000000..507efa1 --- /dev/null +++ b/.import/BrushHLine_Hovered.png-e51d5f3c1628c510a225057f3ed60d5a.md5 @@ -0,0 +1,3 @@ +source_md5="c767c1f5f8db79fd5b9edf9508fc4d1b" +dest_md5="14567b18c33c4cd5dee7d4b11f07b7f2" + diff --git a/.import/BrushHLine_Hovered.png-e51d5f3c1628c510a225057f3ed60d5a.stex b/.import/BrushHLine_Hovered.png-e51d5f3c1628c510a225057f3ed60d5a.stex new file mode 100644 index 0000000..70747dd Binary files /dev/null and b/.import/BrushHLine_Hovered.png-e51d5f3c1628c510a225057f3ed60d5a.stex differ diff --git a/.import/BrushRect.png-2b2d0ae4889c1fbc5c7bee7ae5515663.md5 b/.import/BrushRect.png-2b2d0ae4889c1fbc5c7bee7ae5515663.md5 new file mode 100644 index 0000000..7dd2e45 --- /dev/null +++ b/.import/BrushRect.png-2b2d0ae4889c1fbc5c7bee7ae5515663.md5 @@ -0,0 +1,3 @@ +source_md5="0ec1c2f2a7018aa4122bf76285f87443" +dest_md5="955c166c2c50a7fc7bb522de89df91ce" + diff --git a/.import/BrushRect.png-2b2d0ae4889c1fbc5c7bee7ae5515663.stex b/.import/BrushRect.png-2b2d0ae4889c1fbc5c7bee7ae5515663.stex new file mode 100644 index 0000000..510f09a Binary files /dev/null and b/.import/BrushRect.png-2b2d0ae4889c1fbc5c7bee7ae5515663.stex differ diff --git a/.import/BrushRect_Hovered.png-b09066b673d6082ce887a03a19f17977.md5 b/.import/BrushRect_Hovered.png-b09066b673d6082ce887a03a19f17977.md5 new file mode 100644 index 0000000..d6b4e56 --- /dev/null +++ b/.import/BrushRect_Hovered.png-b09066b673d6082ce887a03a19f17977.md5 @@ -0,0 +1,3 @@ +source_md5="b2f8bc01566c3fa839501355155541c6" +dest_md5="d10f6c9b72dba11f0356fa63b0efbddd" + diff --git a/.import/BrushRect_Hovered.png-b09066b673d6082ce887a03a19f17977.stex b/.import/BrushRect_Hovered.png-b09066b673d6082ce887a03a19f17977.stex new file mode 100644 index 0000000..466cd12 Binary files /dev/null and b/.import/BrushRect_Hovered.png-b09066b673d6082ce887a03a19f17977.stex differ diff --git a/.import/BrushVLine.png-022220d888fe2fe2f8a081bcca62b4b2.md5 b/.import/BrushVLine.png-022220d888fe2fe2f8a081bcca62b4b2.md5 new file mode 100644 index 0000000..5d602f3 --- /dev/null +++ b/.import/BrushVLine.png-022220d888fe2fe2f8a081bcca62b4b2.md5 @@ -0,0 +1,3 @@ +source_md5="3e197fa301ef03f312365bd01429d08b" +dest_md5="0913df5f9c2a29dd74c7b88f6a7f37e3" + diff --git a/.import/BrushVLine.png-022220d888fe2fe2f8a081bcca62b4b2.stex b/.import/BrushVLine.png-022220d888fe2fe2f8a081bcca62b4b2.stex new file mode 100644 index 0000000..87527db Binary files /dev/null and b/.import/BrushVLine.png-022220d888fe2fe2f8a081bcca62b4b2.stex differ diff --git a/.import/BrushVLine_Hovered.png-104e29757699756f1b44bd32a622df2c.md5 b/.import/BrushVLine_Hovered.png-104e29757699756f1b44bd32a622df2c.md5 new file mode 100644 index 0000000..9080744 --- /dev/null +++ b/.import/BrushVLine_Hovered.png-104e29757699756f1b44bd32a622df2c.md5 @@ -0,0 +1,3 @@ +source_md5="9d4fb491eb4bf3869fca7d038c928759" +dest_md5="9ebfff15dc061a68c6bf82d1cb83e6af" + diff --git a/.import/BrushVLine_Hovered.png-104e29757699756f1b44bd32a622df2c.stex b/.import/BrushVLine_Hovered.png-104e29757699756f1b44bd32a622df2c.stex new file mode 100644 index 0000000..e222191 Binary files /dev/null and b/.import/BrushVLine_Hovered.png-104e29757699756f1b44bd32a622df2c.stex differ diff --git a/.import/Godoxel_Anim_Panel.png-56f84f9044d8bd8d0a4f3430dba126f6.md5 b/.import/Godoxel_Anim_Panel.png-56f84f9044d8bd8d0a4f3430dba126f6.md5 new file mode 100644 index 0000000..6d6f224 --- /dev/null +++ b/.import/Godoxel_Anim_Panel.png-56f84f9044d8bd8d0a4f3430dba126f6.md5 @@ -0,0 +1,3 @@ +source_md5="e1db1064c72265a01a992e8d77615cd0" +dest_md5="8de5f0178bb0f6b0773e245a52d2df9a" + diff --git a/.import/Godoxel_Anim_Panel.png-56f84f9044d8bd8d0a4f3430dba126f6.stex b/.import/Godoxel_Anim_Panel.png-56f84f9044d8bd8d0a4f3430dba126f6.stex new file mode 100644 index 0000000..a90632c Binary files /dev/null and b/.import/Godoxel_Anim_Panel.png-56f84f9044d8bd8d0a4f3430dba126f6.stex differ diff --git a/.import/Godoxel_Preview.png-e30103581d3fc0ed2a2c92cdf72b5c70.md5 b/.import/Godoxel_Preview.png-e30103581d3fc0ed2a2c92cdf72b5c70.md5 new file mode 100644 index 0000000..e0726f8 --- /dev/null +++ b/.import/Godoxel_Preview.png-e30103581d3fc0ed2a2c92cdf72b5c70.md5 @@ -0,0 +1,3 @@ +source_md5="5a6b6ab9dca02fb1f80c7468b43a982c" +dest_md5="e5448547844aef6e50771770909354c4" + diff --git a/.import/Godoxel_Preview.png-e30103581d3fc0ed2a2c92cdf72b5c70.stex b/.import/Godoxel_Preview.png-e30103581d3fc0ed2a2c92cdf72b5c70.stex new file mode 100644 index 0000000..06c29c9 Binary files /dev/null and b/.import/Godoxel_Preview.png-e30103581d3fc0ed2a2c92cdf72b5c70.stex differ diff --git a/.import/Godoxel_Shortcuts.png-bd1a4956e0778c5ddf36cdc3bb058831.md5 b/.import/Godoxel_Shortcuts.png-bd1a4956e0778c5ddf36cdc3bb058831.md5 new file mode 100644 index 0000000..ba23d3b --- /dev/null +++ b/.import/Godoxel_Shortcuts.png-bd1a4956e0778c5ddf36cdc3bb058831.md5 @@ -0,0 +1,3 @@ +source_md5="8a10fc33b613b33b4d51afda12ea1d74" +dest_md5="22b5b124b8176533aa5cd11928ff8e1a" + diff --git a/.import/Godoxel_Shortcuts.png-bd1a4956e0778c5ddf36cdc3bb058831.stex b/.import/Godoxel_Shortcuts.png-bd1a4956e0778c5ddf36cdc3bb058831.stex new file mode 100644 index 0000000..90e44ed Binary files /dev/null and b/.import/Godoxel_Shortcuts.png-bd1a4956e0778c5ddf36cdc3bb058831.stex differ diff --git a/.import/animation_arrow_down.png-9edbf9aa07338136f99ac434cbed09e5.md5 b/.import/animation_arrow_down.png-9edbf9aa07338136f99ac434cbed09e5.md5 new file mode 100644 index 0000000..474df21 --- /dev/null +++ b/.import/animation_arrow_down.png-9edbf9aa07338136f99ac434cbed09e5.md5 @@ -0,0 +1,3 @@ +source_md5="9e8801de4bef4983cca7e993585bb944" +dest_md5="75483eb7190f06ec5b7c17b158dff864" + diff --git a/.import/animation_arrow_down.png-9edbf9aa07338136f99ac434cbed09e5.stex b/.import/animation_arrow_down.png-9edbf9aa07338136f99ac434cbed09e5.stex new file mode 100644 index 0000000..fbb6f64 Binary files /dev/null and b/.import/animation_arrow_down.png-9edbf9aa07338136f99ac434cbed09e5.stex differ diff --git a/.import/animation_arrow_up.png-8957357689f69c848f5f33d20a50a416.md5 b/.import/animation_arrow_up.png-8957357689f69c848f5f33d20a50a416.md5 new file mode 100644 index 0000000..ac66192 --- /dev/null +++ b/.import/animation_arrow_up.png-8957357689f69c848f5f33d20a50a416.md5 @@ -0,0 +1,3 @@ +source_md5="f4c7f3ffcadcda366aedce818d6efbfe" +dest_md5="e02525cb50c283e4e58be85a22e82e3a" + diff --git a/.import/animation_arrow_up.png-8957357689f69c848f5f33d20a50a416.stex b/.import/animation_arrow_up.png-8957357689f69c848f5f33d20a50a416.stex new file mode 100644 index 0000000..bac322a Binary files /dev/null and b/.import/animation_arrow_up.png-8957357689f69c848f5f33d20a50a416.stex differ diff --git a/.import/arrow_down.png-d2bd93428c0bc172a28a43c55aac576e.md5 b/.import/arrow_down.png-d2bd93428c0bc172a28a43c55aac576e.md5 new file mode 100644 index 0000000..7c67a91 --- /dev/null +++ b/.import/arrow_down.png-d2bd93428c0bc172a28a43c55aac576e.md5 @@ -0,0 +1,3 @@ +source_md5="7ba250dc0369bd9ea174a98fa96fd159" +dest_md5="56c8662891cd27a8926447a80462218e" + diff --git a/.import/arrow_down.png-d2bd93428c0bc172a28a43c55aac576e.stex b/.import/arrow_down.png-d2bd93428c0bc172a28a43c55aac576e.stex new file mode 100644 index 0000000..3b30b28 Binary files /dev/null and b/.import/arrow_down.png-d2bd93428c0bc172a28a43c55aac576e.stex differ diff --git a/.import/arrow_up.png-2598e148d1b795a628ce80a4fd5cf401.md5 b/.import/arrow_up.png-2598e148d1b795a628ce80a4fd5cf401.md5 new file mode 100644 index 0000000..cae1f0a --- /dev/null +++ b/.import/arrow_up.png-2598e148d1b795a628ce80a4fd5cf401.md5 @@ -0,0 +1,3 @@ +source_md5="2117353e2e3a97b4461460d303806021" +dest_md5="1e89a6da5bb0a41a9f96eed98d099ecb" + diff --git a/.import/arrow_up.png-2598e148d1b795a628ce80a4fd5cf401.stex b/.import/arrow_up.png-2598e148d1b795a628ce80a4fd5cf401.stex new file mode 100644 index 0000000..1d7f780 Binary files /dev/null and b/.import/arrow_up.png-2598e148d1b795a628ce80a4fd5cf401.stex differ diff --git a/.import/fiend.png-46f0c65314f5bbca8d0599edf0d36a2b.md5 b/.import/fiend.png-46f0c65314f5bbca8d0599edf0d36a2b.md5 new file mode 100644 index 0000000..8c7ca14 --- /dev/null +++ b/.import/fiend.png-46f0c65314f5bbca8d0599edf0d36a2b.md5 @@ -0,0 +1,3 @@ +source_md5="7c1193f6500d1fc0411cdeb3000c36df" +dest_md5="81ad6cf73db3ebed1cf028a8ba220086" + diff --git a/.import/fiend.png-46f0c65314f5bbca8d0599edf0d36a2b.stex b/.import/fiend.png-46f0c65314f5bbca8d0599edf0d36a2b.stex new file mode 100644 index 0000000..808edd5 Binary files /dev/null and b/.import/fiend.png-46f0c65314f5bbca8d0599edf0d36a2b.stex differ diff --git a/.import/godoxel_screenshot.png-43fb83f678511237490ee7f96939d8cd.md5 b/.import/godoxel_screenshot.png-43fb83f678511237490ee7f96939d8cd.md5 new file mode 100644 index 0000000..0399980 --- /dev/null +++ b/.import/godoxel_screenshot.png-43fb83f678511237490ee7f96939d8cd.md5 @@ -0,0 +1,3 @@ +source_md5="854d565fe87c02a40a91d093e1942111" +dest_md5="ad1a81cfcbcbdb6d5a9f99dd98a9e5e0" + diff --git a/.import/godoxel_screenshot.png-43fb83f678511237490ee7f96939d8cd.stex b/.import/godoxel_screenshot.png-43fb83f678511237490ee7f96939d8cd.stex new file mode 100644 index 0000000..73a8356 Binary files /dev/null and b/.import/godoxel_screenshot.png-43fb83f678511237490ee7f96939d8cd.stex differ diff --git a/.import/grid.png-e3d637acacdb891e09f422df261dbd1e.md5 b/.import/grid.png-e3d637acacdb891e09f422df261dbd1e.md5 new file mode 100644 index 0000000..8ae2c38 --- /dev/null +++ b/.import/grid.png-e3d637acacdb891e09f422df261dbd1e.md5 @@ -0,0 +1,3 @@ +source_md5="5e9bc42ebbb41300af1c572f986960ac" +dest_md5="9761c0d50600309e43d1d28fd72b54f5" + diff --git a/.import/grid.png-e3d637acacdb891e09f422df261dbd1e.stex b/.import/grid.png-e3d637acacdb891e09f422df261dbd1e.stex new file mode 100644 index 0000000..968416a Binary files /dev/null and b/.import/grid.png-e3d637acacdb891e09f422df261dbd1e.stex differ diff --git a/.import/icon.png-487276ed1e3a0c39cad0279d744ee560.md5 b/.import/icon.png-487276ed1e3a0c39cad0279d744ee560.md5 new file mode 100644 index 0000000..5328bc7 --- /dev/null +++ b/.import/icon.png-487276ed1e3a0c39cad0279d744ee560.md5 @@ -0,0 +1,3 @@ +source_md5="47313fa4c47a9963fddd764e1ec6e4a8" +dest_md5="26ea799ea0a3da9e753b3ebe822e0570" + diff --git a/.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex b/.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex new file mode 100644 index 0000000..71f6913 Binary files /dev/null and b/.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex differ diff --git a/.import/lock_layer.png-076954b389746de9e13c853ed5d9ba59.md5 b/.import/lock_layer.png-076954b389746de9e13c853ed5d9ba59.md5 new file mode 100644 index 0000000..d52d5c5 --- /dev/null +++ b/.import/lock_layer.png-076954b389746de9e13c853ed5d9ba59.md5 @@ -0,0 +1,3 @@ +source_md5="1f208aa17bb746f72d0c708960e161b8" +dest_md5="9a39a80a2cbcca6412c335d0d192b71e" + diff --git a/.import/lock_layer.png-076954b389746de9e13c853ed5d9ba59.stex b/.import/lock_layer.png-076954b389746de9e13c853ed5d9ba59.stex new file mode 100644 index 0000000..03eaf90 Binary files /dev/null and b/.import/lock_layer.png-076954b389746de9e13c853ed5d9ba59.stex differ diff --git a/.import/lock_layer_1.png-4848d5f2cd0f48c68b880712b6b38776.md5 b/.import/lock_layer_1.png-4848d5f2cd0f48c68b880712b6b38776.md5 new file mode 100644 index 0000000..3130109 --- /dev/null +++ b/.import/lock_layer_1.png-4848d5f2cd0f48c68b880712b6b38776.md5 @@ -0,0 +1,3 @@ +source_md5="f5c365385f1229bba28c2118b09557f0" +dest_md5="215730718d238613f5ecfb60c77fd1c3" + diff --git a/.import/lock_layer_1.png-4848d5f2cd0f48c68b880712b6b38776.stex b/.import/lock_layer_1.png-4848d5f2cd0f48c68b880712b6b38776.stex new file mode 100644 index 0000000..49a5b7b Binary files /dev/null and b/.import/lock_layer_1.png-4848d5f2cd0f48c68b880712b6b38776.stex differ diff --git a/.import/minidotta.png-adac81df344972ef82e2499656aa288e.md5 b/.import/minidotta.png-adac81df344972ef82e2499656aa288e.md5 new file mode 100644 index 0000000..539a7df --- /dev/null +++ b/.import/minidotta.png-adac81df344972ef82e2499656aa288e.md5 @@ -0,0 +1,3 @@ +source_md5="e0848eef5591cbefcdd580e2266df32a" +dest_md5="7e23ebf9e94e4bc4758723749616c112" + diff --git a/.import/minidotta.png-adac81df344972ef82e2499656aa288e.stex b/.import/minidotta.png-adac81df344972ef82e2499656aa288e.stex new file mode 100644 index 0000000..90a2ea8 Binary files /dev/null and b/.import/minidotta.png-adac81df344972ef82e2499656aa288e.stex differ diff --git a/.import/minidotta_invis.png-5232a113bb226997ae55212b2aa90bd4.md5 b/.import/minidotta_invis.png-5232a113bb226997ae55212b2aa90bd4.md5 new file mode 100644 index 0000000..54cfbf4 --- /dev/null +++ b/.import/minidotta_invis.png-5232a113bb226997ae55212b2aa90bd4.md5 @@ -0,0 +1,3 @@ +source_md5="ed7ea9ed6750cf2fbe5141c6745f1a80" +dest_md5="365e095f05917944fca1b11c61acdd5b" + diff --git a/.import/minidotta_invis.png-5232a113bb226997ae55212b2aa90bd4.stex b/.import/minidotta_invis.png-5232a113bb226997ae55212b2aa90bd4.stex new file mode 100644 index 0000000..ea7bf55 Binary files /dev/null and b/.import/minidotta_invis.png-5232a113bb226997ae55212b2aa90bd4.stex differ diff --git a/.import/unlock_layer.png-ae7c97a04fb889522c7c466fdc9dd8f6.md5 b/.import/unlock_layer.png-ae7c97a04fb889522c7c466fdc9dd8f6.md5 new file mode 100644 index 0000000..5210da3 --- /dev/null +++ b/.import/unlock_layer.png-ae7c97a04fb889522c7c466fdc9dd8f6.md5 @@ -0,0 +1,3 @@ +source_md5="14b94da08f95d2ae578c2be11f83ccd8" +dest_md5="ece14a0ab6aa8577445cdcf27ed7ac33" + diff --git a/.import/unlock_layer.png-ae7c97a04fb889522c7c466fdc9dd8f6.stex b/.import/unlock_layer.png-ae7c97a04fb889522c7c466fdc9dd8f6.stex new file mode 100644 index 0000000..8f3ddbc Binary files /dev/null and b/.import/unlock_layer.png-ae7c97a04fb889522c7c466fdc9dd8f6.stex differ diff --git a/addons/Godoxel/Animation.gd b/addons/Godoxel/Animation.gd new file mode 100644 index 0000000..75a90b9 --- /dev/null +++ b/addons/Godoxel/Animation.gd @@ -0,0 +1,24 @@ +extends Node +class_name GEAnimation + + +var frames = [] +var anim_idx = -1 + + +func _ready(): + pass + + +func add_frame(frame): + frames.append(frame) + + +func get_anim_index(): + return anim_idx + + +func set_anim_index(index): + anim_idx = index + + diff --git a/addons/Godoxel/BrushPrefabs.gd b/addons/Godoxel/BrushPrefabs.gd new file mode 100644 index 0000000..fe809ae --- /dev/null +++ b/addons/Godoxel/BrushPrefabs.gd @@ -0,0 +1,106 @@ +class_name BrushPrefabs + + +const list = [ + [ Vector2(0, -1), + Vector2(-1, 0), Vector2(0, 0), Vector2(1, 0), + Vector2(0, 1) + ], + [Vector2(-1, -1), Vector2(0, -1), Vector2(1, -1), + Vector2(-1, 0), Vector2(0, 0), Vector2(1, 0), + Vector2(-1, 1), Vector2(0, 1), Vector2(1, 1), + ], + [ + Vector2(-1, 0), Vector2(0, 0), Vector2(1, 0), + ], + [ Vector2(0, -1), + Vector2(0, 0), + Vector2(0, 1) + ] +] + + +enum Type { + V_LINE, + H_LINE, + RECT, + CIRCLE, +} + +static func get_brush(type, size: int): + var pixels = [] + if size < 1: + size = 1 + + match type: + Type.CIRCLE: + size += 1 + var center = Vector2.ZERO + var last = center + var radius = size / 2.0 + for x in range(size): + for y in range(size): + if Vector2(x - radius, y - radius).length() < size / 3.0: + pixels.append(Vector2(x, y)) + + var avg = Vector2(size / 2, size / 2) + avg = Vector2(floor(avg.x), floor(avg.y)) + + for i in range(pixels.size()): + pixels[i] -= avg + + Type.RECT: + var center = Vector2.ZERO + var last = center + for x in range(size): + for y in range(size): + pixels.append(Vector2(x, y)) + + var avg = Vector2.ZERO + for cell in pixels: + avg += cell + + avg.x /= pixels.size() + avg.y /= pixels.size() + + avg = Vector2(floor(avg.x), floor(avg.y)) + + for i in range(pixels.size()): + pixels[i] -= avg + + Type.V_LINE: + var center = Vector2.ZERO + var last = center + pixels.append(Vector2.ZERO) + + for i in range(size - 1): + var sig = sign(last.y) + if sig == 0: + sig = 1 + + if last.y < 0: + center.y = abs(last.y) * -sig + else: + center.y = abs(last.y+1) * -sig + last = center + pixels.append(center) + Type.H_LINE: + var center = Vector2.ZERO + var last = center + pixels.append(Vector2.ZERO) + + for i in range(size - 1): + var sig = sign(last.x) + if sig == 0: + sig = 1 + + if last.x < 0: + center.x = abs(last.x) * -sig + else: + center.x = abs(last.x+1) * -sig + last = center + pixels.append(center) + + return pixels + + diff --git a/addons/Godoxel/Canvas.gd b/addons/Godoxel/Canvas.gd new file mode 100644 index 0000000..a0618ff --- /dev/null +++ b/addons/Godoxel/Canvas.gd @@ -0,0 +1,517 @@ +extends Control +class_name GECanvas +tool + +export var pixel_size: float = 16 setget set_pixel_size +export(int, 1, 2500) var canvas_width = 48 setget set_canvas_width # == pixels +export(int, 1, 2500) var canvas_height = 28 setget set_canvas_height # == pixels +export var grid_size = 16 setget set_grid_size +export var big_grid_size = 10 setget set_big_grid_size +export var can_draw = true + +var mouse_in_region +var mouse_on_top + +var frame: GEFrame + +#var layers : Array = [] # Key: layer_name, val: GELayer +var active_layer: GELayer +var preview_layer: GELayer +var tool_layer: GELayer +var canvas_layers: Control + +var canvas +var grid +var big_grid +var selected_pixels = [] + +var symmetry_x = false +var symmetry_y = false + + +func _ready(): + #------------------------------- + # Set nodes + #------------------------------- + canvas = find_node("Canvas") + grid = find_node("Grid") + big_grid = find_node("BigGrid") + canvas_layers = find_node("CanvasLayers") + + #------------------------------- + # setup layers and canvas + #------------------------------- + if not is_connected("mouse_entered", self, "_on_mouse_entered"): + connect("mouse_entered", self, "_on_mouse_entered") + if not is_connected("mouse_exited", self, "_on_mouse_exited"): + connect("mouse_exited", self, "_on_mouse_exited") + + #------------------------------- + # setup layers and canvas + #------------------------------- + #canvas_size = Vector2(int(rect_size.x / grid_size), int(rect_size.y / grid_size)) + #pixel_size = canvas_size + + create_preview_layer() + create_tool_layer() + + set_process(true) + + +func _process(delta): + if not is_visible_in_tree(): + return + var mouse_position = get_local_mouse_position() + var rect = Rect2(Vector2(0, 0), rect_size) + mouse_in_region = rect.has_point(mouse_position) + + +func _draw(): + if preview_layer: + preview_layer.update_texture() + if tool_layer: + tool_layer.update_texture() +# for layer in layers: +# layer.update_texture() + # TODO + #if frame: + #frame._draw() + + +func resize(width: int, height: int): + if width < 0: + width = 1 + if height < 0: + height = 1 + + # TODO move resize to editor.gd -> for all frames + + set_canvas_width(width) + set_canvas_height(height) + + preview_layer.resize(width, height) + tool_layer.resize(width, height) + + #frame.resize(width, height) + + + +func set_frame(new_frame): + frame = new_frame + if canvas_layers.get_child_count() > 0: + canvas_layers.remove_child(canvas_layers.get_child(0)) + canvas_layers.add_child(frame) + + frame.width = canvas_width + frame.height = canvas_height + + frame.anchor_right = 1 + frame.anchor_bottom = 1 + frame.margin_right = 0 + frame.margin_bottom = 0 + + if not frame.layers.empty(): + active_layer = frame.layers[owner.current_layer_idx] + + + +################################################################ +# Export +################################################################ + +func get_current_frame_image() -> Image: + var image = Image.new() + image.create(canvas_width, canvas_height, true, Image.FORMAT_RGBA8) + image.lock() + image.fill(Color.transparent) + image.unlock() + image.lock() + + for layer in frame.layers: + if not layer.visible: + continue + + for x in range(frame.width): + for y in range(frame.height): + var color = layer.get_pixel(x, y) + var image_color = image.get_pixel(x, y) + + if color.a != 0: + image.set_pixel(x, y, color) + else: + image.set_pixel(x, y, image_color.blend(color)) + image.unlock() + return image + + +func get_current_layer_image() -> Image: + var image = Image.new() + image.create(canvas_width, canvas_height, true, Image.FORMAT_RGBA8) + image.lock() + image.fill(Color.transparent) + image.unlock() + image.lock() + + for layer in frame.layers: + if layer != active_layer: + continue + + for x in range(frame.width): + for y in range(frame.height): + var color = layer.get_pixel(x, y) + var image_color = image.get_pixel(x, y) + + if color.a != 0: + image.set_pixel(x, y, color) + else: + image.set_pixel(x, y, image_color.blend(color)) + image.unlock() + return image + + + +################################################################ +# Pixel/Grid size +################################################################ + +func set_pixel_size(size: float): + pixel_size = size + set_grid_size(grid_size) + set_big_grid_size(big_grid_size) + set_canvas_width(canvas_width) + set_canvas_height(canvas_height) + + +func set_grid_size(size): + grid_size = size + if not find_node("Grid"): + return + find_node("Grid").size = size * pixel_size + + +func set_big_grid_size(size): + big_grid_size = size + if not find_node("BigGrid"): + return + find_node("BigGrid").size = size * pixel_size + + +func set_canvas_width(val: int): + canvas_width = val + rect_size.x = canvas_width * pixel_size + + +func set_canvas_height(val: int): + canvas_height = val + rect_size.y = canvas_height * pixel_size + + + +#------------------------------- +# Layer +#------------------------------- + +func toggle_alpha_locked(layer_name: String): + var layer = find_layer_by_name(layer_name) + layer.toggle_alpha_locked() + + +func is_alpha_locked() -> bool: + return active_layer.alpha_locked + + +func get_content_margin() -> Rect2: + return frame.get_content_margin() + + +func crop_to_content(): + frame.crop_to_content() + + +func get_active_layer() -> GELayer: + return active_layer + + +func get_preview_layer(): + return preview_layer + + +func clear_active_layer(): + active_layer.clear() + + +func clear_preview_layer(): + preview_layer.clear() + + +func clear_layer(layer_name: String): + for layer in frame.layers: + if layer.name == layer_name: + layer.clear() + break + + +func remove_layer(layer_name: String): + # change current layer if the active layer is removed + var del_layer = find_layer_by_name(layer_name) + del_layer.clear() + if del_layer == active_layer: + for layer in frame.layers: + if layer == preview_layer or layer == active_layer or layer == tool_layer: + continue + active_layer = layer + print("Select active layer: ", active_layer) + break + frame.layers.erase(del_layer) + return active_layer + + +func create_preview_layer(): + var layer = GELayer.new() + layer.create($PreviewLayer, canvas_width, canvas_height) + preview_layer = layer + return layer + + +func create_tool_layer(): + var layer = GELayer.new() + layer.create($ToolPreviewLayer, canvas_width, canvas_height) + tool_layer = layer + return layer + + +func duplicate_layer(layer: GELayer): + for existing_layer in frame.layers: + if layer.name == existing_layer.name: + return + + var new_layer: GELayer = GELayer.new() + new_layer.image.copy_from(layer.image) + return new_layer + + +func toggle_layer_visibility(layer_name: String): + var layer_idx = get_layer_index(layer_name) + assert(layer_idx != -1, "Layer name not found!") + var layer = frame.layers[layer_idx] + layer.visible = not layer.visible + return layer.visible + + +func get_layer_index(layer_name: String): + var idx = 0 + for layer in frame.layers: + if layer.name == layer_name: + return idx + idx += 1 + return -1 + + +func find_layer_by_name(layer_name: String): + for layer in frame.layers: + if layer.name == layer_name: + return layer + return null + + +func toggle_lock_layer(layer_name: String): + find_layer_by_name(layer_name).toggle_lock() + + +func is_active_layer_locked() -> bool: + return active_layer.locked + + +func get_active_layer_index() -> int: + return get_layer_index(active_layer.name) + + +func move_layer_forward(layer_name: String): + var layer = find_layer_by_name(layer_name).texture_rect_ref + var new_idx = max(layer.get_index() - 1, 0) + layer.get_parent().move_child(layer, new_idx) + + +func move_layer_back(layer_name: String): + var layer = find_layer_by_name(layer_name).texture_rect_ref + layer.get_parent().move_child(layer, layer.get_index() + 1) + + +func select_layer(layer: GELayer): + active_layer = layer + + +#------------------------------- +# Check +#------------------------------- + +func _on_mouse_entered(): + mouse_on_top = true + + +func _on_mouse_exited(): + mouse_on_top = false + + +func is_inside_canvas(x, y): + if x < 0 or y < 0: + return false + if x >= canvas_width or y >= canvas_height: + return false + return true + + + +#------------------------------- +# Basic pixel-layer options +#------------------------------- + + +#Note: Arrays are always passed by reference. To get a copy of an array which +# can be modified independently of the original array, use duplicate. +# (https://docs.godotengine.org/en/stable/classes/class_array.html) +func set_pixel_arr(pixels: Array, color: Color): + for pixel in pixels: + _set_pixel(active_layer, pixel.x, pixel.y, color) + + +func set_pixel_v(pos: Vector2, color: Color): + set_pixel(pos.x, pos.y, color) + + +func set_pixel(x: int, y: int, color: Color): + _set_pixel(active_layer, x, y, color) + + +func _set_pixel_v(layer: GELayer, v: Vector2, color: Color): + _set_pixel(layer, v.x, v.y, color) + + +func _set_pixel(layer: GELayer, x: int, y: int, color: Color): + if not is_inside_canvas(x, y): + return + layer.set_pixel(x, y, color) + + +func get_pixel_v(pos: Vector2): + return get_pixel(pos.x, pos.y) + + +func get_pixel(x: int, y: int): + if active_layer: + return active_layer.get_pixel(x, y) + return null + + +func set_preview_pixel_v(pos: Vector2, color: Color): + set_preview_pixel(pos.x, pos.y, color) + + +func set_preview_pixel(x:int, y: int, color: Color): + if not is_inside_canvas(x, y): + return + preview_layer.set_pixel(x, y, color) + + +func get_preview_pixel_v(pos: Vector2): + return get_preview_pixel(pos.x, pos.y) + + +func get_preview_pixel(x: int, y: int): + if not preview_layer: + return null + return preview_layer.get_pixel(x, y) + + + +#------------------------------- +# Grid +#------------------------------- + + +func toggle_grid(): + $Grid.visible = not $Grid.visible + + +func show_grid(): + $Grid.show() + + +func hide_grid(): + $Grid.hide() + + +#------------------------------- +# Handy tools +#------------------------------- + + +func select_color(x, y): + print("???") + var same_color_pixels = [] + var color = get_pixel(x, y) + for x in range(active_layer.layer_width): + for y in range(active_layer.layer_height): + var pixel_color = active_layer.get_pixel(x, y) + if pixel_color == color: + same_color_pixels.append(color) + return same_color_pixels + + +func select_same_color(x, y): + return get_neighbouring_pixels(x, y) + + +# returns array of Vector2 +# yoinked from +# https://www.geeksforgeeks.org/flood-fill-algorithm-implement-fill-paint/ +func get_neighbouring_pixels(pos_x: int, pos_y: int) -> Array: + var pixels = [] + + var to_check_queue = [] + var checked_queue = [] + + to_check_queue.append(GEUtils.to_1D(pos_x, pos_y, canvas_width)) + + var color = get_pixel(pos_x, pos_y) + + while not to_check_queue.empty(): + var idx = to_check_queue.pop_front() + var p = GEUtils.to_2D(idx, canvas_width) + + if idx in checked_queue: + continue + + checked_queue.append(idx) + + if get_pixel(p.x, p.y) != color: + continue + + # add to result + pixels.append(p) + + # check neighbours + var x = p.x - 1 + var y = p.y + if is_inside_canvas(x, y): + idx = GEUtils.to_1D(x, y, canvas_width) + to_check_queue.append(idx) + + x = p.x + 1 + if is_inside_canvas(x, y): + idx = GEUtils.to_1D(x, y, canvas_width) + to_check_queue.append(idx) + + x = p.x + y = p.y - 1 + if is_inside_canvas(x, y): + idx = GEUtils.to_1D(x, y, canvas_width) + to_check_queue.append(idx) + + y = p.y + 1 + if is_inside_canvas(x, y): + idx = GEUtils.to_1D(x, y, canvas_width) + to_check_queue.append(idx) + + return pixels + diff --git a/addons/Godoxel/CanvasOutline.gd b/addons/Godoxel/CanvasOutline.gd new file mode 100644 index 0000000..964be71 --- /dev/null +++ b/addons/Godoxel/CanvasOutline.gd @@ -0,0 +1,31 @@ +tool +extends Control + +export var color = Color() + + +func _ready(): + pass + + +func _draw(): + var size = get_parent().rect_size + var pos = Vector2.ZERO #get_parent().rect_global_position + draw_outline_box(pos, size, color, 1) + + +func draw_outline_box(pos, size, color, width): + #Top line + draw_line(pos+Vector2(-1, 0), pos + Vector2(size.x, 0), color, width) + #Left line + draw_line(pos, pos + Vector2(0, size.y), color, width) + #Bottom line + draw_line(pos + Vector2(0, size.y), pos + Vector2(size.x, size.y), color, width) + #Right line + draw_line(pos + Vector2(size.x, 0), pos + Vector2(size.x, size.y), color, width) + + +func _process(delta): + if not is_visible_in_tree(): + return + update() diff --git a/addons/Godoxel/Colors.gd b/addons/Godoxel/Colors.gd new file mode 100644 index 0000000..ccd2d56 --- /dev/null +++ b/addons/Godoxel/Colors.gd @@ -0,0 +1,34 @@ +tool +extends GridContainer + +signal color_change_request + +func _enter_tree(): + for child in get_children(): + child.set("custom_styles/normal", StyleBoxFlat.new()) + child.get("custom_styles/normal").set("bg_color", Color(randf(), randf(), randf())) + for child in get_children(): + if child.is_connected("pressed", self, "change_color_to"): + return + child.connect("pressed", self, "change_color_to", [child.get("custom_styles/normal").bg_color]) + + +func change_color_to(color): + emit_signal("color_change_request", color) + + +func add_color_prefab(color: Color): + var dup = get_child(0).duplicate() + add_child(dup) + move_child(dup, 0) + dup.set("custom_styles/normal", StyleBoxFlat.new()) + dup.get("custom_styles/normal").set("bg_color", color) + for child in get_children(): + if child.is_connected("pressed", self, "change_color_to"): + return + child.connect("pressed", self, "change_color_to", [child.get("custom_styles/normal").bg_color]) + + + + + diff --git a/addons/Godoxel/DebugTextDisplay.gd b/addons/Godoxel/DebugTextDisplay.gd new file mode 100644 index 0000000..bdb7616 --- /dev/null +++ b/addons/Godoxel/DebugTextDisplay.gd @@ -0,0 +1,9 @@ +extends RichTextLabel +tool + +func _ready(): + pass + + +func display_text(text): + self.text = text diff --git a/addons/Godoxel/Editor.gd b/addons/Godoxel/Editor.gd new file mode 100644 index 0000000..afd44c4 --- /dev/null +++ b/addons/Godoxel/Editor.gd @@ -0,0 +1,1577 @@ +tool +extends Control + +enum Tools { + PAINT, + BRUSH, + BUCKET, + RAINBOW, + LINE, + RECT, + DARKEN, + BRIGHTEN + COLORPICKER, + CUT, + PASTECUT, +} + +var shortcuts = { + KEY_CONTROL: { + KEY_Z: "undo_action", + KEY_Y: "redo_action", + }, + KEY_SHIFT: { + KEY_Q: Tools.PAINT, + KEY_W: Tools.BUCKET, + KEY_E: Tools.RAINBOW, + + KEY_A: Tools.LINE, + KEY_S: Tools.RECT, + KEY_D: Tools.COLORPICKER, + + KEY_Z: Tools.BRIGHTEN, + KEY_X: Tools.DARKEN, + KEY_C: Tools.CUT, + }, + KEY_Z: "undo_action", + KEY_Y: "redo_action", +} + +const LayerButton = preload("res://addons/Godoxel/LayerButton.tscn") + +onready var right_panel: Panel = find_node("RightPanel") +onready var left_panel: Panel = find_node("LeftPanel") +onready var layer_buttons: Control = find_node("LayerButtons") +onready var paint_canvas_container_node = find_node("PaintCanvasContainer") +onready var paint_canvas: GECanvas = find_node("Canvas") +onready var canvas_background: TextureRect = find_node("CanvasBackground") +onready var colors_grid = find_node("Colors") +onready var debug_text = find_node("DebugTextDisplay") +onready var preview_window: Control = find_node("PreviewWindow") +onready var preview_layer_textures = find_node("PreviewLayerTextures") +onready var shift_shortcut_window = find_node("ShortcutWindow") +onready var frame_selection_container = find_node("FrameSelectionContainer") +onready var anim_panel = find_node("AnimationPanel") +onready var color_picker_button = find_node("ColorPicker") + +var allow_drawing = true +var selected_color = Color(1, 1, 1, 1) setget set_selected_color +var util = preload("res://addons/Godoxel/Util.gd") + +var mouse_in_region = false +var mouse_on_top = false + +var _preview_drag_start_pos = null +var _preview_drag_pos = null + +var _middle_mouse_pressed_pos = null +var _middle_mouse_pressed_start_pos = null +var _previous_tool +var brush_mode + +var _layer_button_ref = {} + +var _total_added_layers = 0 + +var selected_brush_prefab = 0 +var _last_drawn_pixel = Vector2.ZERO +var _last_preview_draw_cell_pos = Vector2.ZERO + +var _selection_cells = [] +var _selection_colors = [] + +var _cut_pos = Vector2.ZERO +var _cut_size = Vector2.ZERO + +var _actions_history = [] # for undo +var _redo_history = [] +var _current_action + +var _last_mouse_pos_canvas_area = Vector2.ZERO + +var _picked_color = false + +var mouse_position = Vector2() +var canvas_position = Vector2() +var canvas_mouse_position = Vector2() +var cell_mouse_position = Vector2() +var cell_color = Color() + +var last_mouse_position = Vector2() +var last_canvas_position = Vector2() +var last_canvas_mouse_position = Vector2() +var last_cell_mouse_position = Vector2() +var last_cell_color = Color() + +const current_layer_highlight = Color(0.354706, 0.497302, 0.769531) +const other_layer_highlight = Color(0.180392, 0.176471, 0.176471) +const locked_layer_highlight = Color(0.098039, 0.094118, 0.094118) + +var big_grid_pixels = 4 # 1 grid-box is big_grid_pixels big + +var _preview_scale := 1.0 + +var animations = [] +var current_animation_idx = 0 +var current_animation: GEAnimation +var current_frame_idx = 0 +var current_frame: GEFrame +var current_layer_idx = 0 + +var animation_looped := true +var animation_playing := false +var animation_fps = 5.0 +var next_anim_time = 0.0 +var animation_frame_duration: float = 1 / animation_fps + +var preview_thread = Thread.new() + + +func _ready(): + #-------------------- + #Setup nodes + #-------------------- + selected_color = color_picker_button.color + _center_element(paint_canvas) + + #-------------------- + #connect nodes + #-------------------- + if not anim_panel.is_connected("on_add_animation", self, "_on_add_animation"): + anim_panel.connect("on_add_animation", self, "_on_add_animation") + anim_panel.connect("on_add_frame_pressed", self, "_on_add_frame_pressed") + anim_panel.connect("on_frame_pressed", self, "_on_frame_pressed") + anim_panel.connect("on_animation_pressed", self, "_on_animation_pressed") + anim_panel.connect("on_animation_move", self, "_on_animation_move") + anim_panel.connect("on_animation_duplicated", self, "_on_animation_duplicated") + anim_panel.connect("on_animation_selected", self, "_on_animation_selected") + anim_panel.connect("on_animation_deleted", self, "_on_animation_deleted") + + + if not colors_grid.is_connected("color_change_request", self, "change_color"): + colors_grid.connect("color_change_request", self, "change_color") + + if not is_connected("visibility_changed", self, "_on_Editor_visibility_changed"): + connect("visibility_changed", self, "_on_Editor_visibility_changed") + + canvas_background.material.set_shader_param( + "pixel_size", 8 * pow(0.5, big_grid_pixels)/paint_canvas.pixel_size) + + # ready + set_tool(Tools.PAINT) + + find_node("BrushSizeLabel").text = str(int(find_node("BrushSize").value)) + + paint_canvas.update() + + shift_shortcut_window.setup(shortcuts[KEY_SHIFT]) + + #-------------------- + # animation + #-------------------- + current_animation = add_new_animation() + current_frame = add_new_frame(current_animation) + paint_canvas.set_frame(current_frame) + add_new_layer() + +# var animation = GEAnimation.new() +# animations.append(animation) +# +# var frame = GEFrame.new() +# frame.resize(paint_canvas.canvas_width, paint_canvas.canvas_height) +# animation.add_frame(frame) +# var layer = frame.add_new_layer(layer_buttons.get_child(0).name) +# +# anim_panel.set_frame_preview(animations.size()-1, 0, frame) +# +# var anim = _on_add_animation(anim_panel.add_animation_stripe()) + + # data +# var frame = paint_canvas.frame +# var anim = GEAnimation.new() +# anim.add_frame(frame) +# animations.append(anim) +# +# # ui +# var anim_stripe = anim_panel.add_animation_stripe() +# anim_stripe.connect("on_frame_pressed", self, "_on_frame_pressed") +# +# # data -> ui +# anim_stripe.set_animation(anim) +# #anim_stripe.add_frame(frame) +# #anim_panel._on_add_frame_pressed(0, 0) #ugly + + #-------------------- + # animation + #-------------------- + preview_window.update_preview(current_frame) + anim_panel.set_frame_preview(current_animation_idx, current_frame_idx, current_frame) + + set_process(true) + + # start thread +# preview_thread.start(self, "_update_frame_preview") + + +#func _update_frame_preview(data): +# while true: +# print("update preview") +# current_frame._update_preview() +# yield(get_tree().create_timer(2.0), "timeout") + + +func _exit_tree(): + if preview_thread != null and preview_thread.is_active(): + preview_thread.wait_to_finish() + + +func _input(event: InputEvent) -> void: + if is_any_menu_open(): + return + if not is_visible_in_tree(): + return + if paint_canvas_container_node == null or paint_canvas == null: + return + + if event is InputEventMouseButton: + if event.pressed and not event.is_echo(): + if is_mouse_in_preview_window(): + _preview_drag_start_pos = preview_layer_textures.get_child(0).rect_position + _preview_drag_pos = get_global_mouse_position() + elif is_mouse_in_canvas(): + _middle_mouse_pressed_start_pos = paint_canvas.rect_position + _middle_mouse_pressed_pos = get_global_mouse_position() + + _handle_zoom(event) + + if paint_canvas.is_active_layer_locked(): + return + + _handle_paint(event) + + +func _unhandled_input(event:InputEvent): + if is_any_menu_open(): + return + if not is_visible_in_tree(): + return + if paint_canvas_container_node == null or paint_canvas == null: + return + + _handle_shortcuts(event) + + +func _handle_paint(event: InputEvent): + if brush_mode == Tools.CUT: + if event is InputEventMouseButton: + if event.button_index == BUTTON_LEFT: + if not event.pressed: + commit_action() + + if is_mouse_in_canvas(): + if event is InputEventMouseButton: + match brush_mode: + Tools.BUCKET: + if event.button_index == BUTTON_LEFT: + if event.pressed: + if _current_action == null: + _current_action = get_action() + do_action([cell_mouse_position, last_cell_mouse_position, selected_color]) + + Tools.COLORPICKER: + if event.button_index == BUTTON_LEFT: + if event.pressed: + if paint_canvas.get_pixel(cell_mouse_position.x, cell_mouse_position.y).a == 0: + return + selected_color = paint_canvas.get_pixel(cell_mouse_position.x, cell_mouse_position.y) + _picked_color = true + find_node("Colors").add_color_prefab(selected_color) + color_picker_button.color = selected_color + elif _picked_color: + set_tool(_previous_tool) + elif event.button_index == BUTTON_RIGHT: + if event.pressed: + set_tool(_previous_tool) + + Tools.PASTECUT: + if event.button_index == BUTTON_RIGHT: + if event.pressed: + commit_action() + set_tool(Tools.PAINT) + + +func _process(delta): + if not is_visible_in_tree(): + return + if paint_canvas_container_node == null or paint_canvas == null: + return + + _handle_scroll() + + if is_any_menu_open(): + return + + #Update commonly used variables + var grid_size = paint_canvas.pixel_size + mouse_position = get_global_mouse_position() #paint_canvas.get_local_mouse_position() + canvas_position = paint_canvas.rect_global_position + canvas_mouse_position = Vector2(mouse_position.x - canvas_position.x, mouse_position.y - canvas_position.y) + if is_mouse_in_canvas(): + cell_mouse_position = Vector2( + floor(canvas_mouse_position.x / grid_size), + floor(canvas_mouse_position.y / grid_size)) + cell_color = paint_canvas.get_pixel(cell_mouse_position.x, cell_mouse_position.y) + update_text_info() + + if animation_playing: + next_anim_time += delta + if next_anim_time >= animation_frame_duration: + next_anim_time = 0 + current_frame_idx += 1 + if current_frame_idx >= current_animation.frames.size(): + current_frame_idx = 0 + if not animation_looped: + animation_playing = false + anim_panel.set_play_pause_button(animation_playing) + _on_frame_pressed(current_animation_idx, current_frame_idx) + else: + if is_mouse_in_canvas(): + if not paint_canvas.is_active_layer_locked(): + if is_position_in_canvas(get_global_mouse_position()) or \ + is_position_in_canvas(_last_mouse_pos_canvas_area): + + brush_process() + else: + print(cell_mouse_position, " not in ", paint_canvas_container_node.rect_size) + print("not in canvas") + + _draw_tool_brush() + + #Update last variables with the current variables + last_mouse_position = mouse_position + last_canvas_position = canvas_position + last_canvas_mouse_position = canvas_mouse_position + last_cell_mouse_position = cell_mouse_position + last_cell_color = cell_color + _last_mouse_pos_canvas_area = get_global_mouse_position() + #paint_canvas_container_node.get_local_mouse_position() + + +var ctrl_pressed = false +var shift_pressed = false +func _handle_shortcuts(event: InputEvent): + if not event is InputEventKey: + return + + # check modifiers + if event.scancode == KEY_SHIFT: + shift_pressed = event.pressed + shift_shortcut_window.visible = shift_pressed + elif event.scancode == KEY_CONTROL: + ctrl_pressed = event.pressed + + if not event.pressed: + return + + # delegate shortcuts depending on modifiers + if shift_pressed: + if shortcuts[KEY_SHIFT].has(event.scancode): + if shift_shortcut_window.check_input_for_shorcut(event, event.shift): + if shortcuts[KEY_SHIFT].has(event.scancode): + _handle_shortcut(shortcuts[KEY_SHIFT][event.scancode]) + accept_event() + return + elif ctrl_pressed: + if shortcuts[KEY_CONTROL].has(event.scancode): + _handle_shortcut(shortcuts[KEY_CONTROL][event.scancode]) + accept_event() + return + elif shortcuts.has(event.scancode): + accept_event() + _handle_shortcut(shortcuts[event.scancode]) + return + + +func _handle_shortcut(shortcut): + if typeof(shortcut) == TYPE_STRING: + call(shortcut) + else: + set_tool(shortcut) + + +func _draw_tool_brush(): + paint_canvas.tool_layer.clear() + + match brush_mode: + Tools.PASTECUT: + for idx in range(_selection_cells.size()): + var pixel = _selection_cells[idx] +# if pixel.x < 0 or pixel.y < 0: +# print(pixel) + var color = _selection_colors[idx] + pixel -= _cut_pos + _cut_size / 2 + pixel += cell_mouse_position + paint_canvas._set_pixel_v(paint_canvas.tool_layer, pixel, color) + Tools.BRUSH: + var pixels = BrushPrefabs.get_brush(selected_brush_prefab, find_node("BrushSize").value) + for pixel in pixels: + + paint_canvas._set_pixel(paint_canvas.tool_layer, + cell_mouse_position.x + pixel.x, cell_mouse_position.y + pixel.y, selected_color) + + Tools.RAINBOW: + paint_canvas._set_pixel(paint_canvas.tool_layer, + cell_mouse_position.x, cell_mouse_position.y, Color(0.46875, 0.446777, 0.446777, 0.196078)) + + Tools.COLORPICKER: + paint_canvas._set_pixel(paint_canvas.tool_layer, + cell_mouse_position.x, cell_mouse_position.y, Color(0.866667, 0.847059, 0.847059, 0.196078)) + _: + paint_canvas._set_pixel(paint_canvas.tool_layer, + cell_mouse_position.x, cell_mouse_position.y, selected_color) + + paint_canvas.update() + #TODO add here brush prefab drawing + paint_canvas.tool_layer.update_texture() + + + +############################################ +# Animation Panel +############################################ + +var change_grid = true +func _on_AnimationPanel_on_play_pause_pressed(): + animation_playing = not animation_playing + + if animation_playing and not paint_canvas.grid.visible: + change_grid = false + + if change_grid: + if animation_playing: + paint_canvas.hide_grid() + elif not paint_canvas.grid.visible: + paint_canvas.show_grid() + + +func _on_AnimationPanel_on_animation_loop_toggled(): + animation_looped = not animation_looped + + +func _on_AnimationPanel_on_animation_frame_rate_changed(new_frame_rate): + animation_fps = new_frame_rate + animation_frame_duration = 1.0 / animation_fps + + + +############################################ +# Frames +############################################ + +func _create_new_frame(): + var frame = GEFrame.new() + frame.resize(paint_canvas.canvas_width, paint_canvas.canvas_height) + + for idx in range(get_layer_count()): + var layer = _create_layer(get_layer_name(idx), frame.width, frame.height) + frame.add_frame_layer(layer) + + return frame + + +func add_new_frame(animation): + var frame = _create_new_frame() + animation.add_frame(frame) + + anim_panel.set_frame_preview(current_animation_idx, current_frame_idx, frame) + _update_anim_and_frame_idx(current_animation_idx, current_frame_idx) + + return frame + + +func duplicate_frame(): + pass + + +func copy_current_frame_to_all_frames(): + pass + + +func _on_frame_pressed(anim_idx, frame_idx): + _update_anim_and_frame_idx(anim_idx, frame_idx) + paint_canvas.set_frame(current_frame) + preview_window.update_preview(current_frame) + + +func _on_add_frame_pressed(anim_idx, frame_idx): + current_animation_idx = anim_idx + current_frame_idx = frame_idx + add_new_frame(animations[anim_idx]) + + +func _update_anim_and_frame_idx(anim_idx, frame_idx): + current_animation_idx = anim_idx + current_animation = animations[current_animation_idx] + current_frame_idx = min(frame_idx, animations[current_animation_idx].frames.size() - 1) + current_frame = animations[current_animation_idx].frames[current_frame_idx] + + + +############################################ +# Animations +############################################ + +func _on_add_animation(): + var animation = add_new_animation() + add_new_frame_to_animation(animation) + return animation + + +func add_new_frame_to_animation(animation: GEAnimation): + var frame = _create_new_frame() + animation.add_frame(frame) + + anim_panel.set_frame_preview(animation.get_anim_index(), animation.frames.size()-1, frame) + + return frame + + +func add_new_animation(): + var animation = GEAnimation.new() + animation.set_anim_index(animations.size()) + animations.append(animation) + + anim_panel.add_animation_stripe() + return animation + + +func add_animation(): + var animation = GEAnimation.new() + animations.append(animation) + + var frame = GEFrame.new() + frame.resize(paint_canvas.canvas_width, paint_canvas.canvas_height) + animation.add_frame(frame) + + for idx in range(preview_layer_textures.get_child_count()): + frame.add_new_layer(layer_buttons.get_child(idx).name) + + anim_panel.set_frame_preview(animations.size()-1, 0, frame) + return animation + + +func _on_animation_pressed(anim_idx): + current_animation_idx = anim_idx + _update_anim_and_frame_idx(current_animation_idx, current_frame_idx) + paint_canvas.set_frame(current_frame) + preview_window.update_preview(current_frame) + + +func _on_animation_selected(anim_idx): + current_animation_idx = anim_idx + _update_anim_and_frame_idx(current_animation_idx, current_frame_idx) + paint_canvas.set_frame(current_frame) + preview_window.update_preview(current_frame) + + +func _on_animation_deleted(anim_idx): + if animations.size() <= 1: + return + animations.remove(anim_idx) + var anim_stripe = anim_panel.anim_button_container.get_child(anim_idx) + anim_panel.anim_button_container.remove_child(anim_stripe) + anim_stripe.queue_free() + + if current_animation_idx >= anim_idx: + current_animation_idx -= 1 + _update_anim_and_frame_idx(current_animation_idx, current_frame_idx) + + +func _on_animation_duplicated(anim_idx): + var anim = add_new_animation() + + for i in range(animations[anim_idx].frames.size()): + if i > 0: + anim_panel.get_last_animation_stripe().add_new_frame_button() + var frame = add_new_frame_to_animation(anim) + + frame.width = animations[anim_idx].frames[i].width + frame.height = animations[anim_idx].frames[i].height + + for frame_idx in range(anim.frames.size()): + for layer_idx in range(anim.frames[frame_idx].layers.size()): + var layer = animations[anim_idx].frames[frame_idx].layers[layer_idx] + var dup_layer = anim.frames[frame_idx].layers[layer_idx] + dup_layer.image.copy_from(layer.image) + dup_layer.update_texture() + + +func _on_animation_move(from, to): + var anim = animations[to] + animations[to] = animations[from] + animations[from] = anim + + if current_animation_idx == from: + current_animation_idx = to + _update_anim_and_frame_idx(current_animation_idx, current_frame_idx) + elif current_animation_idx == to: + current_animation_idx = from + _update_anim_and_frame_idx(current_animation_idx, current_frame_idx) + + + +############################################ +# Save/Load +############################################ + +func get_save_project_data(): + var data = {} + data["canvas"] = { + "width": paint_canvas.canvas_width, + "height": paint_canvas.canvas_height, + } + data["animations"] = {} + var anim_idx = 0 + for anim in animations: + data["animations"][anim_idx] = { + "name": anim_panel.get_animation_stripe(anim_idx).get_animation_name(), + "frames": {} + } + + var frame_idx = 0 + for frame in anim.frames: + data["animations"][anim_idx]["frames"][frame_idx] = { + "layers": {} + } + + var layer_idx = 0 + for layer in frame.layers: + data["animations"][anim_idx]["frames"][frame_idx]["layers"][layer_idx] = {} + data["animations"][anim_idx]["frames"][frame_idx]["layers"][layer_idx] = { + "name": str(anim_idx) + " - "+ str(frame_idx) + " - " + str(layer_idx), + "image_data": Array(layer.image.save_png_to_buffer()) + } + layer_idx += 1 + frame.layers + frame_idx += 1 + anim_idx += 1 + return data + + +func load_project(data): + resize(data.canvas.width, data.canvas.height) + + var layer_amount = 0 + var anim_amount = 0 + var frame_amounts = [] + for anim in data.animations: + var frame_amount = 0 + for frame in data.animations[anim].frames: + layer_amount = 0 + for layer in data.animations[anim].frames[frame].layers: + layer_amount += 1 + frame_amount += 1 + frame_amounts.append(frame_amount) + anim_amount += 1 + + print("Loading...") + print("Animations: ", anim_amount) + print("Frames: ", frame_amounts) + print("Layers: ", layer_amount) + + reset_project() + current_animation_idx = 0 + current_frame_idx = 0 + + for i in range(layer_amount): + add_new_layer() + + for anim_key in data.animations: + var frames_data = data.animations[anim_key].frames + var anim = add_new_animation() + var anim_stripe = anim_panel.get_last_animation_stripe() + if "name" in data.animations[anim_key]: + anim_stripe.set_animation_name(data.animations[anim_key].name) + for frame_key in frames_data: + if current_frame_idx > 0: + anim_stripe.add_new_frame_button() + var frame = add_new_frame_to_animation(anim) + var layer_data = frames_data[frame_key].layers + for layer_key in layer_data: + var new_img = layer_data[layer_key] + var img_data = Array(new_img.image_data) + frame.layers[int(layer_key)].image.load_png_from_buffer(img_data) + frame.layers[int(layer_key)].update_texture() + current_frame_idx += 1 + current_frame_idx = 0 + current_animation_idx += 1 + + for anim_idx in range(animations.size()): + if current_animation == null and not animations[anim_idx].frames.empty(): + current_animation = animations[anim_idx] + current_animation_idx = anim_idx + current_frame_idx = 0 + current_frame = animations[anim_idx].frames[current_frame_idx] + + if get_layer_count() <= 0: + add_new_layer() + + current_layer_idx = 0 + paint_canvas.set_frame(current_frame) + preview_window.update_preview(current_frame) + + +func reset_project(): + anim_panel.clear_all() + for layer_button in layer_buttons.get_children(): + layer_buttons.remove_child(layer_button) + layer_button.queue_free() + animations.clear() + _total_added_layers = 0 + for preview_texture in preview_layer_textures.get_children(): + preview_layer_textures.remove_child(preview_texture) + preview_texture.queue_free() + paint_canvas.frame = null + paint_canvas.update() + + current_animation = null + current_frame = null + current_layer_idx = -1 + current_frame_idx = -1 + current_animation_idx = -1 + + +func delete_current_animation(): + delete_animation(current_animation_idx) + + +func delete_animation(anim_idx): + animations.remove(anim_idx) + + +func delete_current_frame(): + delete_frame(current_animation_idx, current_frame_idx) + + +func delete_frame(anim_idx, frame_idx): + if animations[anim_idx].frames.size() <= 1: + return + animations[anim_idx].frames.remove(frame_idx) + anim_panel.get_last_animation_stripe().remove_frame(frame_idx) + + if current_frame_idx >= frame_idx: + current_frame_idx -= 1 + + _update_anim_and_frame_idx(current_animation_idx, current_frame_idx) + paint_canvas.set_frame(current_frame) + preview_window.update_preview(current_frame) + + +####################################################### +# Zoom & Scroll +####################################################### + +func _handle_scroll(): + if is_mouse_in_preview_window(): + _handle_preview_scroll() + elif control_has_point(anim_panel, get_global_mouse_position()): + pass + elif control_has_point(self, get_global_mouse_position()): + _handle_canvas_scroll() + + +func _handle_preview_scroll(): + if is_preview_dragging(): + if Input.is_mouse_button_pressed(BUTTON_MIDDLE): + if not is_preview_dragging(): + return + for child in preview_layer_textures.get_children(): + child.rect_position = _preview_drag_start_pos + child.rect_position += get_global_mouse_position() - _preview_drag_pos + elif is_preview_dragging(): + _preview_drag_start_pos = null + + +func _handle_canvas_scroll(): + if is_dragging(): + if Input.is_mouse_button_pressed(BUTTON_MIDDLE): + if not is_dragging(): + return + paint_canvas.rect_position = _middle_mouse_pressed_start_pos + paint_canvas.rect_position += get_global_mouse_position() - _middle_mouse_pressed_pos + if paint_canvas.rect_position.y < -paint_canvas.rect_size.y: + paint_canvas.rect_position.y = -paint_canvas.rect_size.y + if paint_canvas.rect_position.x < -paint_canvas.rect_size.x: + paint_canvas.rect_position.x = -paint_canvas.rect_size.x + + if paint_canvas.rect_position.x > rect_global_position.x + rect_size.x: + paint_canvas.rect_position.x = rect_global_position.x + rect_size.x + + if paint_canvas.rect_position.y > rect_global_position.y + rect_size.y: + paint_canvas.rect_position.y = rect_global_position.y + rect_size.y + + + elif is_dragging(): + _middle_mouse_pressed_start_pos = null + + +func is_dragging() -> bool: + return _middle_mouse_pressed_start_pos != null + + +func is_preview_dragging() -> bool: + return _preview_drag_start_pos != null + + +const max_zoom_out = 0.25 +const max_zoom_in = 50 + +func _handle_zoom(event): + if not event is InputEventMouseButton: + return + if is_mouse_in_preview_window(): + _handle_preview_zoom(event) + elif control_has_point(anim_panel, get_global_mouse_position()): + pass + elif is_mouse_in_canvas(): + _handle_canvas_zoom(event) + + +func _handle_preview_zoom(event: InputEvent): + if event.is_pressed(): + if event.button_index == BUTTON_WHEEL_UP: + set_preview_scale(_preview_scale * 2) + _update_preview_layers_size() + for child in preview_layer_textures.get_children(): + child.rect_position -= child.get_local_mouse_position() + child.rect_position.x = clamp(child.rect_position.x, + -child.rect_size.x * 0.8, + rect_size.x) + child.rect_position.y = clamp(child.rect_position.y, + -child.rect_size.y * 0.8, + rect_size.y) + elif event.button_index == BUTTON_WHEEL_DOWN: + set_preview_scale(_preview_scale / 2) + _update_preview_layers_size() + for child in preview_layer_textures.get_children(): + child.rect_position += child.get_local_mouse_position() + child.rect_position.x = clamp(child.rect_position.x, + -child.rect_size.x * 0.8, + rect_size.x) + child.rect_position.y = clamp(child.rect_position.y, + -child.rect_size.y * 0.8, + rect_size.y) + + +func _handle_canvas_zoom(event: InputEvent): + if event.is_pressed(): + if event.button_index == BUTTON_WHEEL_UP: + var px = min(paint_canvas.pixel_size * 2, max_zoom_in) + if px == paint_canvas.pixel_size: + return + paint_canvas.set_pixel_size(px) + find_node("CanvasBackground").material.set_shader_param( + "pixel_size", 8 * pow(0.5, big_grid_pixels)/paint_canvas.pixel_size) + paint_canvas.rect_position -= paint_canvas.get_local_mouse_position() + paint_canvas.rect_position.x = clamp(paint_canvas.rect_position.x, + -paint_canvas.rect_size.x * 0.8, + rect_size.x) + paint_canvas.rect_position.y = clamp(paint_canvas.rect_position.y, + -paint_canvas.rect_size.y * 0.8, + rect_size.y) + + elif event.button_index == BUTTON_WHEEL_DOWN: + var px = max(paint_canvas.pixel_size / 2.0, max_zoom_out) + if px == paint_canvas.pixel_size: + return + paint_canvas.set_pixel_size(px) + find_node("CanvasBackground").material.set_shader_param( + # 4 2 1 + "pixel_size", 8 * pow(0.5, big_grid_pixels)/paint_canvas.pixel_size) + paint_canvas.rect_position += paint_canvas.get_local_mouse_position() / 2 + paint_canvas.rect_position.x = clamp(paint_canvas.rect_position.x, + -paint_canvas.rect_size.x * 0.8, + rect_size.x) + paint_canvas.rect_position.y = clamp(paint_canvas.rect_position.y, + -paint_canvas.rect_size.y * 0.8, + rect_size.y) + + +func _handle_cut(): + if Input.is_mouse_button_pressed(BUTTON_RIGHT): + paint_canvas.clear_preview_layer() + set_tool(_previous_tool) + return + + if Input.is_mouse_button_pressed(BUTTON_LEFT): + for pixel_pos in GEUtils.get_pixels_in_line(cell_mouse_position, last_cell_mouse_position): + for idx in range(_selection_cells.size()): + var pixel = _selection_cells[idx] + var color = _selection_colors[idx] + pixel -= _cut_pos + _cut_size / 2 + pixel += pixel_pos + paint_canvas.set_pixel_v(pixel, color) + else: + if _last_preview_draw_cell_pos == cell_mouse_position: + return + paint_canvas.clear_preview_layer() + for idx in range(_selection_cells.size()): + var pixel = _selection_cells[idx] + var color = _selection_colors[idx] + pixel -= _cut_pos + _cut_size / 2 + pixel += cell_mouse_position + paint_canvas.set_preview_pixel_v(pixel, color) + _last_preview_draw_cell_pos = cell_mouse_position + + +func brush_process(): + if Input.is_mouse_button_pressed(BUTTON_LEFT): + if _current_action == null: + _current_action = get_action() + if brush_mode == Tools.COLORPICKER: + _current_action = null + #TODO only draw if cell != last cell pos AND! already drawn + # -> last_drawn_at .. +# if cell_mouse_position == last_cell_mouse_position: +# return + + + match brush_mode: + Tools.PAINT: + do_action([cell_mouse_position, last_cell_mouse_position, selected_color]) + Tools.BRUSH: + do_action([cell_mouse_position, last_cell_mouse_position, selected_color, + selected_brush_prefab, find_node("BrushSize").value]) + Tools.LINE: + do_action([cell_mouse_position, last_cell_mouse_position, selected_color]) + Tools.RECT: + do_action([cell_mouse_position, last_cell_mouse_position, selected_color]) + Tools.DARKEN: + do_action([cell_mouse_position, last_cell_mouse_position, selected_color]) + Tools.BRIGHTEN: + do_action([cell_mouse_position, last_cell_mouse_position, selected_color]) + Tools.COLORPICKER: + pass + Tools.CUT: + do_action([cell_mouse_position, last_cell_mouse_position, selected_color]) + Tools.PASTECUT: + do_action([cell_mouse_position, last_cell_mouse_position, + _selection_cells, _selection_colors, + _cut_pos, _cut_size]) + Tools.RAINBOW: + do_action([cell_mouse_position, last_cell_mouse_position]) + paint_canvas.update() + if current_frame: + current_frame.preview_dirty = true + + elif Input.is_mouse_button_pressed(BUTTON_RIGHT): + paint_canvas.update() + if _current_action == null: + _current_action = get_action() + + match brush_mode: + Tools.PAINT: + do_action([cell_mouse_position, last_cell_mouse_position, Color.transparent]) + Tools.BRUSH: + do_action([cell_mouse_position, last_cell_mouse_position, Color.transparent, + selected_brush_prefab, find_node("BrushSize").value]) + current_frame.preview_dirty = true + + else: + if _current_action and _current_action.can_commit(): + commit_action() + paint_canvas.update() + if current_frame: + current_frame.preview_dirty = true + paint_canvas.active_layer.update_texture() + + +func update_text_info(): + var text = "" + + var cell_color_text = cell_color + cell_color_text = Color(0, 0, 0, 0) + + text += \ + str("FPS %s\t" + \ + "Mouse Position %s\t" + \ + "Canvas Mouse Position %s \t" + \ + "Canvas Position %s\t\n" + \ + "Cell Position %s \t" + \ + "Cell Color %s\t" + \ + "inside canvas %s\t") % [ + str(Engine.get_frames_per_second()), + str(mouse_position), + str(canvas_mouse_position), + str(canvas_position), + str(cell_mouse_position), + str(cell_color_text), + str(is_mouse_in_canvas()) + ] + + + debug_text.display_text(text) + + +func _on_Save_pressed(): + get_node("SaveFileDialog").show() + + + +################################################## +# Actions +################################################## + +func do_action(data: Array): + if _current_action == null: + #print("clear redo") + _redo_history.clear() + _current_action.do_action(paint_canvas, data) + + +func commit_action(): + if not _current_action: + return + + var commit_data = _current_action.commit_action(paint_canvas) + var action = get_action() + action.action_data = _current_action.action_data.duplicate(true) + _actions_history.push_back(action) + _redo_history.clear() + + match brush_mode: + Tools.CUT: + _cut_pos = _current_action.mouse_start_pos + _cut_size = _current_action.mouse_end_pos - _current_action.mouse_start_pos + _selection_cells = _current_action.action_data.redo.cells.duplicate() + _selection_colors = _current_action.action_data.redo.colors.duplicate() + set_tool(Tools.PASTECUT) + _: + _current_action = null + + +func redo_action(): + if _redo_history.empty(): + print("Godoxel: Nothing to redo.") + return + var action = _redo_history.pop_back() + if not action: + return + _actions_history.append(action) + action.redo_action(paint_canvas) + paint_canvas.update() + print("Godoxel: redo.") + + +func undo_action(): + var action = _actions_history.pop_back() + if not action: + print("Godoxel: Nothing to undo.") + return + _redo_history.append(action) + action.undo_action(paint_canvas) + update() + paint_canvas.update() + print("Godoxel: undo.") + + +func get_action(): + match brush_mode: + Tools.PAINT: + return GEPencil.new() + Tools.BRUSH: + return GEBrush.new() + Tools.LINE: + return GELine.new() + Tools.RAINBOW: + return GERainbow.new() + Tools.BUCKET: + return GEBucket.new() + Tools.RECT: + return GERect.new() + Tools.DARKEN: + return GEDarken.new() + Tools.BRIGHTEN: + return GEBrighten.new() + Tools.CUT: + return GECut.new() + Tools.PASTECUT: + return GEPasteCut.new() + _: + #print("no tool!") + return null + + + +############################################ +# Brushes +############################################ + +func set_selected_color(color): + selected_color = color + + +func set_tool(new_mode): + if brush_mode == new_mode: + return + _previous_tool = brush_mode + brush_mode = new_mode + + _current_action = get_action() + + match _previous_tool: + Tools.CUT: + paint_canvas.clear_preview_layer() + Tools.PASTECUT: + _selection_cells.clear() + _selection_colors.clear() + Tools.BUCKET: + _current_action = null + #print("Selected: ", Tools.keys()[brush_mode]) + + +func change_color(new_color): + if new_color.a == 0: + return + selected_color = new_color + color_picker_button.color = selected_color + + +func _on_ColorPicker_color_changed(color): + selected_color = color + + +func _on_PaintTool_pressed(): + set_tool(Tools.PAINT) + + +func _on_BucketTool_pressed(): + set_tool(Tools.BUCKET) + + +func _on_RainbowTool_pressed(): + set_tool(Tools.RAINBOW) + + +func _on_BrushTool_pressed(): + set_tool(Tools.BRUSH) + + +func _on_LineTool_pressed(): + set_tool(Tools.LINE) + + +func _on_RectTool_pressed(): + set_tool(Tools.RECT) + + +func _on_DarkenTool_pressed(): + set_tool(Tools.DARKEN) + + +func _on_BrightenTool_pressed(): + set_tool(Tools.BRIGHTEN) + + +func _on_ColorPickerTool_pressed(): + set_tool(Tools.COLORPICKER) + + +func _on_CutTool_pressed(): + set_tool(Tools.CUT) + + +func _on_Editor_visibility_changed(): + pause_mode = not visible + + + +############################################ +# Preview +############################################ + +func _adjust_preview_layer_size(): + _preview_scale = max_preview_scale + _on_canvas_resized() + var width = paint_canvas.canvas_width + var height = paint_canvas.canvas_height + + while _preview_scale > min_preview_scale: + if width * _preview_scale < preview_layer_textures.rect_size.x: + break + set_preview_scale(_preview_scale / 2) + + while _preview_scale > min_preview_scale: + if height * _preview_scale < preview_layer_textures.rect_size.y: + break + set_preview_scale(_preview_scale / 2) + + _update_preview_layers_size() + + +const max_preview_scale = pow(2, 10) +const min_preview_scale = pow(0.5, 10) + +func set_preview_scale(new_scale: float): + _preview_scale = clamp(new_scale, min_preview_scale, max_preview_scale) + + +func _update_preview_layers_size(): + for child in preview_layer_textures.get_children(): + child.rect_scale.x = _preview_scale + child.rect_scale.y = _preview_scale + _center_element(child) + preview_window.set_title(str("Preview (x", _preview_scale, ")")) + + +func _add_preview_layer(): + var preview_texture = TextureRect.new() + preview_texture.expand = false + preview_texture.mouse_filter = Control.MOUSE_FILTER_IGNORE + + preview_layer_textures.add_child(preview_texture) + preview_texture.owner = owner + preview_texture.set_anchors_preset(Control.PRESET_CENTER) + + _adjust_preview_layer_size() + + +# only updates preview atm +func _on_canvas_resized(): + if not paint_canvas.frame: + return + for idx in range(preview_layer_textures.get_child_count()): + preview_layer_textures.get_child(idx).texture = paint_canvas.frame.layers[idx].texture + _center_element(preview_layer_textures.get_child(idx)) + + +func _center_element(element: Control): + var width = element.get_rect().size.x / 2 + var height = element.get_rect().size.y / 2 + element.margin_left = -width + element.margin_top = -height + element.margin_right = width + element.margin_bottom = height + + + +############################################ +# Layer +############################################ + + +func get_layer_count(): + return _total_added_layers + + +func get_layer_name(index: int): + return layer_buttons.get_child(index).name + + +func resize(width: int, height: int): + paint_canvas.resize(width, height) + + for anim in animations: + for frame in anim.frames: + frame.resize(width, height) + + _adjust_preview_layer_size() + + +func highlight_layer(layer_name: String): + if animations.empty() or animations[0].frames.empty(): + return + for button in layer_buttons.get_children(): + if paint_canvas.find_layer_by_name(button.name).locked: + button.get("custom_styles/panel").set("bg_color", locked_layer_highlight) + elif button.name == layer_name: + button.get("custom_styles/panel").set("bg_color", current_layer_highlight) + else: + button.get("custom_styles/panel").set("bg_color", other_layer_highlight) + + +func toggle_layer_visibility(button, layer_name: String): + var index = paint_canvas.get_layer_index(layer_name) + preview_layer_textures.get_child(index).visible = paint_canvas.toggle_layer_visibility(layer_name) + + for anim_stripe in anim_panel.anim_button_container.get_children(): + for frame_button in anim_stripe.frame_button_container.get_children(): + frame_button.set_layer_visibility(index, preview_layer_textures.get_child(index).visible) + frame_button.update_preview() + + _update_frame_button_previews() + + +func select_layer(layer_button): + current_layer_idx = layer_button.get_index() + var layer = paint_canvas.find_layer_by_name(layer_button.name) + paint_canvas.select_layer(layer) + highlight_layer(layer_button.name) + + +func lock_layer(button, layer_name: String): + paint_canvas.toggle_lock_layer(layer_name) + highlight_layer(paint_canvas.get_active_layer().name) + + +func _add_layer_button(): + var layer_button = LayerButton.instance() + layer_buttons.add_child(layer_button, true) + _total_added_layers += 1 + layer_button.find_node("Select").text = "Layer " + str(get_layer_count()) + _layer_button_ref[layer_button.name] = layer_button + _connect_layer_buttons() + return layer_button + + +func _create_layer(layer_name: String, width: int, height: int): + var layer: GELayer = GELayer.new() + layer.name = layer_name + var texture_rect = TextureRect.new() + texture_rect.expand = true + texture_rect.anchor_right = 1 + texture_rect.anchor_bottom = 1 + texture_rect.margin_right = 0 + texture_rect.margin_bottom = 0 + texture_rect.mouse_filter = Control.MOUSE_FILTER_IGNORE + layer.create(texture_rect, width, height) + return layer + + +func add_new_layer(): + var layer_button = _add_layer_button() + + for anim in animations: + for frame in anim.frames: + var layer: GELayer = _create_layer(layer_button.name, + paint_canvas.canvas_width, paint_canvas.canvas_height) + frame.add_frame_layer(layer) + + _add_preview_layer() + + if current_frame: + preview_window.update_preview(current_frame) + paint_canvas.set_frame(current_frame) + highlight_layer(paint_canvas.get_active_layer().name) + + _update_frame_button_previews() + + +func duplicate_active_layer(): + var layer_button = _add_layer_button() + for anim in animations: + for frame in anim.frames: + var new_layer: GELayer = _create_layer(layer_button.name, + paint_canvas.canvas_width, paint_canvas.canvas_height) + new_layer.copy_from(frame.layers[paint_canvas.get_active_layer_index()]) + frame.add_frame_layer(new_layer) + new_layer.update_texture() + + _add_preview_layer() + + if current_frame: + preview_window.update_preview(current_frame) + paint_canvas.set_frame(current_frame) + + # update highlight + highlight_layer(paint_canvas.get_active_layer().name) + _update_frame_button_previews() + + +func remove_active_layer(): + if layer_buttons.get_child_count() <= 1: + return + var layer_name = paint_canvas.active_layer.name + var index = paint_canvas.get_layer_index(paint_canvas.active_layer.name) + paint_canvas.remove_layer(layer_name) + layer_buttons.remove_child(_layer_button_ref[layer_name]) + _layer_button_ref[layer_name].queue_free() + _layer_button_ref.erase(layer_name) + + var preview_layer = preview_layer_textures.get_child(index) + preview_layer.remove_child(preview_layer) + preview_layer.queue_free() + + _update_frame_button_previews() + + highlight_layer(paint_canvas.get_active_layer().name) + + +func move_up(layer_btn): + var index = layer_btn.get_index() + var new_idx = min(index + 1, layer_buttons.get_child_count() - 1) + if index == new_idx: + return + + # layer buttons + layer_buttons.move_child(layer_btn, new_idx) + # canvas + paint_canvas.move_layer_forward(layer_btn.name) + # preview window + preview_layer_textures.move_child(preview_layer_textures.get_child(index), new_idx) + # Frame previews + for anim_idx in range(animations.size()): + var anim = animations[anim_idx] + for frame_idx in range(anim.frames.size()): + var frame = anim.frames[frame_idx] + var layer = frame.layers[index] + frame.layers.remove(index) + frame.layers.insert(new_idx, layer) + anim_panel.set_frame_preview(anim_idx, frame_idx, frame) + + _update_frame_button_previews() + + +func move_down(layer_btn): + var index = layer_btn.get_index() + var new_idx = max(index - 1, 0) + if index == new_idx: + return + + # layer buttons + layer_buttons.move_child(layer_btn, new_idx) + # canvas + paint_canvas.move_layer_forward(layer_btn.name) + # preview window + preview_layer_textures.move_child(preview_layer_textures.get_child(index), new_idx) + # Frame previews + for anim_idx in range(animations.size()): + var anim = animations[anim_idx] + for frame_idx in range(anim.frames.size()): + var frame = anim.frames[frame_idx] + var layer = frame.layers[index] + frame.layers.remove(index) + frame.layers.insert(new_idx, layer) + anim_panel.set_frame_preview(anim_idx, frame_idx, frame) + + _update_frame_button_previews() + + +func _connect_layer_buttons(): + for layer_btn in layer_buttons.get_children(): + if layer_btn.find_node("Select").is_connected("pressed", self, "select_layer"): + continue + layer_btn.find_node("Select").connect("pressed", self, "select_layer", [layer_btn]) + layer_btn.find_node("Visible").connect("pressed", self, "toggle_layer_visibility", + [layer_btn.find_node("Visible"), layer_btn.name]) + layer_btn.find_node("Up").connect("pressed", self, "move_down", [layer_btn]) + layer_btn.find_node("Down").connect("pressed", self, "move_up", [layer_btn]) + layer_btn.find_node("Lock").connect("pressed", self, "lock_layer", + [layer_btn, layer_btn.name]) + + +func _on_AddNewLayer_pressed(): + add_new_layer() + #_update_frame_button_previews() + + +func _update_frame_button_previews(): + for anim_stripe in anim_panel.anim_button_container.get_children(): + for frame_button in anim_stripe.frame_button_container.get_children(): + frame_button.update_preview() + + +func _on_PaintCanvasContainer_mouse_entered(): + if mouse_on_top: + return + mouse_on_top = true + paint_canvas.tool_layer.clear() + paint_canvas.update() + paint_canvas.tool_layer.update_texture() + + +func _on_PaintCanvasContainer_mouse_exited(): + if not mouse_on_top: + return + mouse_on_top = false + paint_canvas.tool_layer.clear() + paint_canvas.update() + paint_canvas.tool_layer.update_texture() + + +func _on_ColorPicker_popup_closed(): + find_node("Colors").add_color_prefab(color_picker_button.color) + + + +############################################ +# MISC +############################################ + +func is_position_in_canvas(pos): + if control_has_point(left_panel, pos): + return false + if control_has_point(right_panel, pos): + return false + if control_has_point(preview_window, pos): + return false + + return control_has_point(paint_canvas_container_node, pos) + + +func control_has_point(control, point) -> bool: + if not control.visible: + return false + return Rect2(control.rect_global_position, control.rect_size).has_point(point) + + +func is_mouse_in_canvas() -> bool: + return is_position_in_canvas(get_global_mouse_position()) + + +func is_mouse_in_preview_window() -> bool: + return control_has_point(preview_window, get_global_mouse_position()) + + +func is_any_menu_open() -> bool: + return $ChangeCanvasSize.visible or \ + $ChangeGridSizeDialog.visible or \ + $Settings.visible or \ + $LoadFileDialog.visible or \ + $SaveFileDialog.visible or \ + find_node("Navbar").is_any_menu_open() + + +func _on_LockAlpha_pressed(): + var checked = find_node("LockAlpha").pressed + paint_canvas.active_layer.toggle_alpha_locked() + for i in range(find_node("Layer").get_popup().get_item_count()): + if find_node("Layer").get_popup().get_item_text(i) == "Toggle Alpha Locked": + find_node("Layer").get_popup().set_item_checked(i, + not find_node("Layer").get_popup().is_item_checked(i)) + + +func _on_BrushRect_pressed(): + if brush_mode != Tools.BRUSH: + set_tool(Tools.BRUSH) + selected_brush_prefab = BrushPrefabs.Type.RECT + + +func _on_BrushCircle_pressed(): + if brush_mode != Tools.BRUSH: + set_tool(Tools.BRUSH) + selected_brush_prefab = BrushPrefabs.Type.CIRCLE + + +func _on_BrushVLine_pressed(): + if brush_mode != Tools.BRUSH: + set_tool(Tools.BRUSH) + selected_brush_prefab = BrushPrefabs.Type.V_LINE + + +func _on_BrushHLine_pressed(): + if brush_mode != Tools.BRUSH: + set_tool(Tools.BRUSH) + selected_brush_prefab = BrushPrefabs.Type.H_LINE + + +func _on_BrushSize_value_changed(value: float): + find_node("BrushSizeLabel").text = str(int(value)) + + +func _on_XSymmetry_pressed(): + paint_canvas.symmetry_x = not paint_canvas.symmetry_x + + +func _on_YSymmetry_pressed(): + paint_canvas.symmetry_y = not paint_canvas.symmetry_y diff --git a/addons/Godoxel/Editor.tscn b/addons/Godoxel/Editor.tscn new file mode 100644 index 0000000..7b654bf --- /dev/null +++ b/addons/Godoxel/Editor.tscn @@ -0,0 +1,1309 @@ +[gd_scene load_steps=60 format=2] + +[ext_resource path="res://addons/Godoxel/Editor.gd" type="Script" id=1] +[ext_resource path="res://addons/Godoxel/dialogs/LoadFileDialog.gd" type="Script" id=2] +[ext_resource path="res://addons/Godoxel/Canvas.gd" type="Script" id=3] +[ext_resource path="res://addons/Godoxel/VisualGrid.tscn" type="PackedScene" id=4] +[ext_resource path="res://addons/Godoxel/CanvasOutline.gd" type="Script" id=5] +[ext_resource path="res://addons/Godoxel/Navbar.gd" type="Script" id=6] +[ext_resource path="res://addons/Godoxel/MenuButtonExtended.gd" type="Script" id=7] +[ext_resource path="res://addons/Godoxel/Colors.gd" type="Script" id=8] +[ext_resource path="res://addons/Godoxel/SaveFileDialog.gd" type="Script" id=9] +[ext_resource path="res://addons/Godoxel/Settings.tscn" type="PackedScene" id=10] +[ext_resource path="res://addons/Godoxel/DebugTextDisplay.gd" type="Script" id=11] +[ext_resource path="res://addons/Godoxel/assets/grid.png" type="Texture" id=13] +[ext_resource path="res://addons/Godoxel/PreviewWindow.gd" type="Script" id=14] +[ext_resource path="res://addons/Godoxel/dialogs/ChangeGridSizeDialog.gd" type="Script" id=15] +[ext_resource path="res://addons/Godoxel/assets/BrushVLine.png" type="Texture" id=16] +[ext_resource path="res://addons/Godoxel/assets/BrushRect.png" type="Texture" id=17] +[ext_resource path="res://addons/Godoxel/assets/BrushCircle.png" type="Texture" id=18] +[ext_resource path="res://addons/Godoxel/assets/BrushHLine.png" type="Texture" id=19] +[ext_resource path="res://addons/Godoxel/assets/BrushRect_Hovered.png" type="Texture" id=20] +[ext_resource path="res://addons/Godoxel/assets/BrushCircle_Hovered.png" type="Texture" id=21] +[ext_resource path="res://addons/Godoxel/assets/BrushVLine_Hovered.png" type="Texture" id=22] +[ext_resource path="res://addons/Godoxel/assets/BrushHLine_Hovered.png" type="Texture" id=23] +[ext_resource path="res://addons/Godoxel/dialogs/DraggableWindow.tscn" type="PackedScene" id=24] +[ext_resource path="res://addons/Godoxel/dialogs/ChangeCanvasDialog.gd" type="Script" id=25] +[ext_resource path="res://addons/Godoxel/components/ShortcutWindow.tscn" type="PackedScene" id=26] +[ext_resource path="res://addons/Godoxel/components/AnimationPanel.tscn" type="PackedScene" id=27] + +[sub_resource type="StyleBoxFlat" id=1] +bg_color = Color( 0.14902, 0.172549, 0.231373, 1 ) + +[sub_resource type="Shader" id=2] +code = "shader_type canvas_item; + +uniform float pixel_size : hint_range(0.01, 1.0); + + +void fragment() { + vec4 color = texture(TEXTURE, UV); + + float light = 0.8; + float dark = 0.4; + + float val = dark; + + if ( int(UV.y * 8.0 * pixel_size) % 2 == 1 ) { + if ( int(UV.x * 8.0 * pixel_size) % 2 == 1 ) { + val = dark; + } + else { + val = light; + } + } + else { + if ( int(UV.x * 8.0 * pixel_size) % 2 == 1 ) { + val = light; + } + else { + val = dark; + } + } + + color.rgb = vec3(val, val, val); + + COLOR = color; +}" + +[sub_resource type="ShaderMaterial" id=3] +shader = SubResource( 2 ) +shader_param/pixel_size = 0.125 + +[sub_resource type="Image" id=62] +data = { +"data": PoolByteArray( 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0 ), +"format": "RGBA8", +"height": 64, +"mipmaps": false, +"width": 64 +} + +[sub_resource type="ImageTexture" id=35] +flags = 0 +flags = 0 +image = SubResource( 62 ) +size = Vector2( 64, 64 ) + +[sub_resource type="Image" id=63] +data = { +"data": PoolByteArray( 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0 ), +"format": "RGBA8", +"height": 64, +"mipmaps": false, +"width": 64 +} + +[sub_resource type="ImageTexture" id=37] +flags = 0 +flags = 0 +image = SubResource( 63 ) +size = Vector2( 64, 64 ) + +[sub_resource type="StyleBoxFlat" id=8] +bg_color = Color( 0.12549, 0.141176, 0.192157, 0.792157 ) + +[sub_resource type="StyleBoxFlat" id=38] +bg_color = Color( 0.832851, 0.34549, 0.232149, 1 ) + +[sub_resource type="StyleBoxFlat" id=39] +bg_color = Color( 0.270873, 0.550955, 0.493098, 1 ) + +[sub_resource type="StyleBoxFlat" id=40] +bg_color = Color( 0.836322, 0.920572, 0.395286, 1 ) + +[sub_resource type="StyleBoxFlat" id=41] +bg_color = Color( 0.306443, 0.405122, 0.767277, 1 ) + +[sub_resource type="StyleBoxFlat" id=42] +bg_color = Color( 0.890179, 0.0747555, 0.914933, 1 ) + +[sub_resource type="StyleBoxFlat" id=43] +bg_color = Color( 0.810691, 0.535597, 0.0676325, 1 ) + +[sub_resource type="StyleBoxFlat" id=44] +bg_color = Color( 0.199354, 0.367441, 0.643453, 1 ) + +[sub_resource type="StyleBoxFlat" id=45] +bg_color = Color( 0.954982, 0.106064, 0.902508, 1 ) + +[sub_resource type="StyleBoxFlat" id=46] +bg_color = Color( 0.732566, 0.707789, 0.17506, 1 ) + +[sub_resource type="StyleBoxFlat" id=47] +bg_color = Color( 0.270643, 0.479343, 0.77945, 1 ) + +[sub_resource type="StyleBoxFlat" id=48] +bg_color = Color( 0.568264, 0.643972, 0.774615, 1 ) + +[sub_resource type="StyleBoxFlat" id=49] +bg_color = Color( 0.00528907, 0.238746, 0.495341, 1 ) + +[sub_resource type="StyleBoxFlat" id=50] +bg_color = Color( 0.854929, 0.096905, 0.750924, 1 ) + +[sub_resource type="StyleBoxFlat" id=51] +bg_color = Color( 0.128049, 0.0938824, 0.463044, 1 ) + +[sub_resource type="StyleBoxFlat" id=52] +bg_color = Color( 0.777614, 0.713933, 0.113727, 1 ) + +[sub_resource type="StyleBoxFlat" id=53] +bg_color = Color( 0.145854, 0.296341, 0.370148, 1 ) + +[sub_resource type="StyleBoxFlat" id=54] +bg_color = Color( 0.255997, 0.877668, 0.774858, 1 ) + +[sub_resource type="StyleBoxFlat" id=55] +bg_color = Color( 0.406142, 0.348892, 0.208062, 1 ) + +[sub_resource type="StyleBoxFlat" id=56] +bg_color = Color( 0.757542, 0.337039, 0.256694, 1 ) + +[sub_resource type="StyleBoxFlat" id=57] +bg_color = Color( 0.838079, 0.501353, 0.0603895, 1 ) + +[sub_resource type="StyleBoxFlat" id=58] +bg_color = Color( 0.610624, 0.706239, 0.920417, 1 ) + +[sub_resource type="StyleBoxFlat" id=59] +bg_color = Color( 0.627376, 0.0700438, 0.522361, 1 ) + +[sub_resource type="StyleBoxFlat" id=60] +bg_color = Color( 0.055693, 0.90498, 0.768635, 1 ) + +[sub_resource type="StyleBoxFlat" id=61] +bg_color = Color( 0.940186, 0.101324, 0.499248, 1 ) + +[sub_resource type="StyleBoxFlat" id=33] +bg_color = Color( 0.180392, 0.2, 0.243137, 1 ) +border_width_left = 1 +border_width_top = 1 +border_width_right = 2 +border_width_bottom = 2 +border_color = Color( 0.12549, 0.141176, 0.192157, 1 ) + +[node name="Editor" type="Control"] +anchor_right = 1.0 +anchor_bottom = 1.0 +rect_clip_content = true +size_flags_horizontal = 3 +size_flags_vertical = 3 +script = ExtResource( 1 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Panel" type="Panel" parent="."] +anchor_right = 1.0 +anchor_bottom = 1.0 +custom_styles/panel = SubResource( 1 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="NoBCViewportsnotworking26181" type="Control" parent="Panel"] +anchor_right = 1.0 +anchor_bottom = 1.0 +__meta__ = { +"_edit_use_anchors_": false, +"_editor_description_": "https://github.com/godotengine/godot/issues/26181" +} + +[node name="Control" type="Control" parent="Panel/NoBCViewportsnotworking26181"] +anchor_top = 0.0833333 +anchor_right = 1.0 +anchor_bottom = 0.918 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="PaintCanvasContainer" type="Control" parent="Panel/NoBCViewportsnotworking26181/Control"] +anchor_right = 1.0 +anchor_bottom = 1.0 +rect_clip_content = true +focus_mode = 1 +mouse_filter = 1 +size_flags_horizontal = 3 +size_flags_vertical = 3 +size_flags_stretch_ratio = 6.0 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Canvas" type="Control" parent="Panel/NoBCViewportsnotworking26181/Control/PaintCanvasContainer"] +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +margin_left = -128.0 +margin_top = -128.0 +margin_right = 128.0 +margin_bottom = 128.0 +mouse_filter = 1 +size_flags_horizontal = 3 +size_flags_vertical = 3 +script = ExtResource( 3 ) +__meta__ = { +"_edit_group_": true, +"_edit_use_anchors_": false +} +pixel_size = 4.0 +canvas_width = 64 +canvas_height = 64 +grid_size = 1 +big_grid_size = 8 + +[node name="CanvasBackground" type="TextureRect" parent="Panel/NoBCViewportsnotworking26181/Control/PaintCanvasContainer/Canvas"] +show_behind_parent = true +material = SubResource( 3 ) +anchor_right = 1.0 +anchor_bottom = 1.0 +texture = ExtResource( 13 ) +expand = true +stretch_mode = 2 +__meta__ = { +"_edit_lock_": true +} + +[node name="CanvasLayers" type="Control" parent="Panel/NoBCViewportsnotworking26181/Control/PaintCanvasContainer/Canvas"] +anchor_right = 1.0 +anchor_bottom = 1.0 +mouse_filter = 2 +__meta__ = { +"_edit_lock_": true, +"_edit_use_anchors_": false +} + +[node name="PreviewLayer" type="TextureRect" parent="Panel/NoBCViewportsnotworking26181/Control/PaintCanvasContainer/Canvas"] +anchor_right = 1.0 +anchor_bottom = 1.0 +mouse_filter = 2 +texture = SubResource( 35 ) +expand = true +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="ToolPreviewLayer" type="TextureRect" parent="Panel/NoBCViewportsnotworking26181/Control/PaintCanvasContainer/Canvas"] +anchor_right = 1.0 +anchor_bottom = 1.0 +mouse_filter = 2 +texture = SubResource( 37 ) +expand = true +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Grid" parent="Panel/NoBCViewportsnotworking26181/Control/PaintCanvasContainer/Canvas" instance=ExtResource( 4 )] +mouse_filter = 2 +color = Color( 1, 1, 1, 0.415686 ) +size = 4 + +[node name="CanvasOutline" type="Control" parent="Panel/NoBCViewportsnotworking26181/Control/PaintCanvasContainer/Canvas"] +anchor_right = 1.0 +anchor_bottom = 1.0 +mouse_filter = 2 +script = ExtResource( 5 ) +__meta__ = { +"_edit_lock_": true, +"_edit_use_anchors_": false +} +color = Color( 0, 1, 0, 1 ) + +[node name="RightPanel" type="Panel" parent="Panel/NoBCViewportsnotworking26181/Control"] +anchor_left = 1.0 +anchor_right = 1.0 +anchor_bottom = 1.0 +margin_left = -140.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +custom_styles/panel = SubResource( 8 ) +__meta__ = { +"_edit_use_anchors_": true +} + +[node name="ScrollContainer" type="ScrollContainer" parent="Panel/NoBCViewportsnotworking26181/Control/RightPanel"] +anchor_right = 1.0 +anchor_bottom = 1.0 +margin_left = 4.0 +margin_top = 4.0 +margin_right = -4.0 +margin_bottom = -4.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="ToolMenu" type="VBoxContainer" parent="Panel/NoBCViewportsnotworking26181/Control/RightPanel/ScrollContainer"] +margin_right = 132.0 +margin_bottom = 592.96 +size_flags_horizontal = 3 +size_flags_vertical = 3 + +[node name="Tools" type="VBoxContainer" parent="Panel/NoBCViewportsnotworking26181/Control/RightPanel/ScrollContainer/ToolMenu"] +margin_right = 132.0 +margin_bottom = 294.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 + +[node name="PaintTool" type="Button" parent="Panel/NoBCViewportsnotworking26181/Control/RightPanel/ScrollContainer/ToolMenu/Tools"] +margin_right = 132.0 +margin_bottom = 25.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +text = "Pencil" + +[node name="BrushTool" type="Button" parent="Panel/NoBCViewportsnotworking26181/Control/RightPanel/ScrollContainer/ToolMenu/Tools"] +visible = false +margin_top = 24.0 +margin_right = 132.0 +margin_bottom = 44.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +text = "Brush" + +[node name="MultiTool" type="Button" parent="Panel/NoBCViewportsnotworking26181/Control/RightPanel/ScrollContainer/ToolMenu/Tools"] +visible = false +margin_top = 24.0 +margin_right = 132.0 +margin_bottom = 44.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +text = "Polygon" +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="BucketTool" type="Button" parent="Panel/NoBCViewportsnotworking26181/Control/RightPanel/ScrollContainer/ToolMenu/Tools"] +margin_top = 29.0 +margin_right = 132.0 +margin_bottom = 55.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +text = "Bucket Fill" +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="RainbowTool" type="Button" parent="Panel/NoBCViewportsnotworking26181/Control/RightPanel/ScrollContainer/ToolMenu/Tools"] +margin_top = 59.0 +margin_right = 132.0 +margin_bottom = 85.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +text = "Rainbow" +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="LineTool" type="Button" parent="Panel/NoBCViewportsnotworking26181/Control/RightPanel/ScrollContainer/ToolMenu/Tools"] +margin_top = 89.0 +margin_right = 132.0 +margin_bottom = 115.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +text = "Line" +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="RectTool" type="Button" parent="Panel/NoBCViewportsnotworking26181/Control/RightPanel/ScrollContainer/ToolMenu/Tools"] +margin_top = 119.0 +margin_right = 132.0 +margin_bottom = 144.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +text = "Rectangle" +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="DarkenTool" type="Button" parent="Panel/NoBCViewportsnotworking26181/Control/RightPanel/ScrollContainer/ToolMenu/Tools"] +margin_top = 148.0 +margin_right = 132.0 +margin_bottom = 174.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +text = "Darken" +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="BrightenTool" type="Button" parent="Panel/NoBCViewportsnotworking26181/Control/RightPanel/ScrollContainer/ToolMenu/Tools"] +margin_top = 178.0 +margin_right = 132.0 +margin_bottom = 204.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +text = "Brighten" +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="ColorPickerTool" type="Button" parent="Panel/NoBCViewportsnotworking26181/Control/RightPanel/ScrollContainer/ToolMenu/Tools"] +margin_top = 208.0 +margin_right = 132.0 +margin_bottom = 234.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +text = "Color Picker" +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="CutTool" type="Button" parent="Panel/NoBCViewportsnotworking26181/Control/RightPanel/ScrollContainer/ToolMenu/Tools"] +margin_top = 238.0 +margin_right = 132.0 +margin_bottom = 264.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +text = "Cut Section" +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="ColorPicker" type="ColorPickerButton" parent="Panel/NoBCViewportsnotworking26181/Control/RightPanel/ScrollContainer/ToolMenu/Tools"] +margin_top = 268.0 +margin_right = 132.0 +margin_bottom = 294.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Control" type="ScrollContainer" parent="Panel/NoBCViewportsnotworking26181/Control/RightPanel/ScrollContainer/ToolMenu"] +margin_top = 298.0 +margin_right = 132.0 +margin_bottom = 592.0 +size_flags_vertical = 3 + +[node name="VBoxContainer" type="VBoxContainer" parent="Panel/NoBCViewportsnotworking26181/Control/RightPanel/ScrollContainer/ToolMenu/Control"] +margin_right = 132.0 +margin_bottom = 294.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 + +[node name="LayerButtons" type="VBoxContainer" parent="Panel/NoBCViewportsnotworking26181/Control/RightPanel/ScrollContainer/ToolMenu/Control/VBoxContainer"] +margin_right = 132.0 +margin_bottom = 265.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="AddNewLayer" type="Button" parent="Panel/NoBCViewportsnotworking26181/Control/RightPanel/ScrollContainer/ToolMenu/Control/VBoxContainer"] +margin_top = 269.0 +margin_right = 132.0 +margin_bottom = 294.0 +rect_min_size = Vector2( 0, 25 ) +size_flags_horizontal = 3 +text = "+" +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="LeftPanel" type="Panel" parent="Panel/NoBCViewportsnotworking26181/Control"] +anchor_right = 0.0166016 +anchor_bottom = 0.824803 +margin_right = 140.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +custom_styles/panel = SubResource( 8 ) +__meta__ = { +"_edit_use_anchors_": true, +"_editor_description_": "" +} + +[node name="MarginContainer" type="MarginContainer" parent="Panel/NoBCViewportsnotworking26181/Control/LeftPanel"] +anchor_right = 1.0 +anchor_bottom = 1.0 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="VBoxContainer" type="VBoxContainer" parent="Panel/NoBCViewportsnotworking26181/Control/LeftPanel/MarginContainer"] +margin_right = 161.0 +margin_bottom = 495.0 +custom_constants/separation = 12 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="ScrollContainer" type="ScrollContainer" parent="Panel/NoBCViewportsnotworking26181/Control/LeftPanel/MarginContainer/VBoxContainer"] +margin_right = 161.0 +margin_bottom = 144.0 +rect_min_size = Vector2( 0, 144 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Colors" type="GridContainer" parent="Panel/NoBCViewportsnotworking26181/Control/LeftPanel/MarginContainer/VBoxContainer/ScrollContainer"] +margin_right = 149.0 +margin_bottom = 170.0 +rect_min_size = Vector2( 0, 144 ) +size_flags_horizontal = 3 +size_flags_vertical = 3 +columns = 4 +script = ExtResource( 8 ) + +[node name="Button1" type="Button" parent="Panel/NoBCViewportsnotworking26181/Control/LeftPanel/MarginContainer/VBoxContainer/ScrollContainer/Colors"] +margin_right = 34.0 +margin_bottom = 25.0 +rect_min_size = Vector2( 25, 25 ) +size_flags_horizontal = 3 +size_flags_vertical = 3 +custom_styles/normal = SubResource( 38 ) + +[node name="Button2" type="Button" parent="Panel/NoBCViewportsnotworking26181/Control/LeftPanel/MarginContainer/VBoxContainer/ScrollContainer/Colors"] +margin_left = 38.0 +margin_right = 72.0 +margin_bottom = 25.0 +rect_min_size = Vector2( 25, 25 ) +size_flags_horizontal = 3 +size_flags_vertical = 3 +custom_styles/normal = SubResource( 39 ) + +[node name="Button3" type="Button" parent="Panel/NoBCViewportsnotworking26181/Control/LeftPanel/MarginContainer/VBoxContainer/ScrollContainer/Colors"] +margin_left = 76.0 +margin_right = 110.0 +margin_bottom = 25.0 +rect_min_size = Vector2( 25, 25 ) +size_flags_horizontal = 3 +size_flags_vertical = 3 +custom_styles/normal = SubResource( 40 ) + +[node name="Button4" type="Button" parent="Panel/NoBCViewportsnotworking26181/Control/LeftPanel/MarginContainer/VBoxContainer/ScrollContainer/Colors"] +margin_left = 114.0 +margin_right = 148.0 +margin_bottom = 25.0 +rect_min_size = Vector2( 25, 25 ) +size_flags_horizontal = 3 +size_flags_vertical = 3 +custom_styles/normal = SubResource( 41 ) + +[node name="Button5" type="Button" parent="Panel/NoBCViewportsnotworking26181/Control/LeftPanel/MarginContainer/VBoxContainer/ScrollContainer/Colors"] +margin_top = 29.0 +margin_right = 34.0 +margin_bottom = 54.0 +rect_min_size = Vector2( 25, 25 ) +size_flags_horizontal = 3 +size_flags_vertical = 3 +custom_styles/normal = SubResource( 42 ) + +[node name="Button6" type="Button" parent="Panel/NoBCViewportsnotworking26181/Control/LeftPanel/MarginContainer/VBoxContainer/ScrollContainer/Colors"] +margin_left = 38.0 +margin_top = 29.0 +margin_right = 72.0 +margin_bottom = 54.0 +rect_min_size = Vector2( 25, 25 ) +size_flags_horizontal = 3 +size_flags_vertical = 3 +custom_styles/normal = SubResource( 43 ) + +[node name="Button7" type="Button" parent="Panel/NoBCViewportsnotworking26181/Control/LeftPanel/MarginContainer/VBoxContainer/ScrollContainer/Colors"] +margin_left = 76.0 +margin_top = 29.0 +margin_right = 110.0 +margin_bottom = 54.0 +rect_min_size = Vector2( 25, 25 ) +size_flags_horizontal = 3 +size_flags_vertical = 3 +custom_styles/normal = SubResource( 44 ) + +[node name="Button8" type="Button" parent="Panel/NoBCViewportsnotworking26181/Control/LeftPanel/MarginContainer/VBoxContainer/ScrollContainer/Colors"] +margin_left = 114.0 +margin_top = 29.0 +margin_right = 148.0 +margin_bottom = 54.0 +rect_min_size = Vector2( 25, 25 ) +size_flags_horizontal = 3 +size_flags_vertical = 3 +custom_styles/normal = SubResource( 45 ) + +[node name="Button9" type="Button" parent="Panel/NoBCViewportsnotworking26181/Control/LeftPanel/MarginContainer/VBoxContainer/ScrollContainer/Colors"] +margin_top = 58.0 +margin_right = 34.0 +margin_bottom = 83.0 +rect_min_size = Vector2( 25, 25 ) +size_flags_horizontal = 3 +size_flags_vertical = 3 +custom_styles/normal = SubResource( 46 ) + +[node name="Button10" type="Button" parent="Panel/NoBCViewportsnotworking26181/Control/LeftPanel/MarginContainer/VBoxContainer/ScrollContainer/Colors"] +margin_left = 38.0 +margin_top = 58.0 +margin_right = 72.0 +margin_bottom = 83.0 +rect_min_size = Vector2( 25, 25 ) +size_flags_horizontal = 3 +size_flags_vertical = 3 +custom_styles/normal = SubResource( 47 ) + +[node name="Button11" type="Button" parent="Panel/NoBCViewportsnotworking26181/Control/LeftPanel/MarginContainer/VBoxContainer/ScrollContainer/Colors"] +margin_left = 76.0 +margin_top = 58.0 +margin_right = 110.0 +margin_bottom = 83.0 +rect_min_size = Vector2( 25, 25 ) +size_flags_horizontal = 3 +size_flags_vertical = 3 +custom_styles/normal = SubResource( 48 ) + +[node name="Button12" type="Button" parent="Panel/NoBCViewportsnotworking26181/Control/LeftPanel/MarginContainer/VBoxContainer/ScrollContainer/Colors"] +margin_left = 114.0 +margin_top = 58.0 +margin_right = 148.0 +margin_bottom = 83.0 +rect_min_size = Vector2( 25, 25 ) +size_flags_horizontal = 3 +size_flags_vertical = 3 +custom_styles/normal = SubResource( 49 ) + +[node name="Button13" type="Button" parent="Panel/NoBCViewportsnotworking26181/Control/LeftPanel/MarginContainer/VBoxContainer/ScrollContainer/Colors"] +margin_top = 87.0 +margin_right = 34.0 +margin_bottom = 112.0 +rect_min_size = Vector2( 25, 25 ) +size_flags_horizontal = 3 +size_flags_vertical = 3 +custom_styles/normal = SubResource( 50 ) + +[node name="Button14" type="Button" parent="Panel/NoBCViewportsnotworking26181/Control/LeftPanel/MarginContainer/VBoxContainer/ScrollContainer/Colors"] +margin_left = 38.0 +margin_top = 87.0 +margin_right = 72.0 +margin_bottom = 112.0 +rect_min_size = Vector2( 25, 25 ) +size_flags_horizontal = 3 +size_flags_vertical = 3 +custom_styles/normal = SubResource( 51 ) + +[node name="Button15" type="Button" parent="Panel/NoBCViewportsnotworking26181/Control/LeftPanel/MarginContainer/VBoxContainer/ScrollContainer/Colors"] +margin_left = 76.0 +margin_top = 87.0 +margin_right = 110.0 +margin_bottom = 112.0 +rect_min_size = Vector2( 25, 25 ) +size_flags_horizontal = 3 +size_flags_vertical = 3 +custom_styles/normal = SubResource( 52 ) + +[node name="Button16" type="Button" parent="Panel/NoBCViewportsnotworking26181/Control/LeftPanel/MarginContainer/VBoxContainer/ScrollContainer/Colors"] +margin_left = 114.0 +margin_top = 87.0 +margin_right = 148.0 +margin_bottom = 112.0 +rect_min_size = Vector2( 25, 25 ) +size_flags_horizontal = 3 +size_flags_vertical = 3 +custom_styles/normal = SubResource( 53 ) + +[node name="Button17" type="Button" parent="Panel/NoBCViewportsnotworking26181/Control/LeftPanel/MarginContainer/VBoxContainer/ScrollContainer/Colors"] +margin_top = 116.0 +margin_right = 34.0 +margin_bottom = 141.0 +rect_min_size = Vector2( 25, 25 ) +size_flags_horizontal = 3 +size_flags_vertical = 3 +custom_styles/normal = SubResource( 54 ) + +[node name="Button18" type="Button" parent="Panel/NoBCViewportsnotworking26181/Control/LeftPanel/MarginContainer/VBoxContainer/ScrollContainer/Colors"] +margin_left = 38.0 +margin_top = 116.0 +margin_right = 72.0 +margin_bottom = 141.0 +rect_min_size = Vector2( 25, 25 ) +size_flags_horizontal = 3 +size_flags_vertical = 3 +custom_styles/normal = SubResource( 55 ) + +[node name="Button19" type="Button" parent="Panel/NoBCViewportsnotworking26181/Control/LeftPanel/MarginContainer/VBoxContainer/ScrollContainer/Colors"] +margin_left = 76.0 +margin_top = 116.0 +margin_right = 110.0 +margin_bottom = 141.0 +rect_min_size = Vector2( 25, 25 ) +size_flags_horizontal = 3 +size_flags_vertical = 3 +custom_styles/normal = SubResource( 56 ) + +[node name="Button20" type="Button" parent="Panel/NoBCViewportsnotworking26181/Control/LeftPanel/MarginContainer/VBoxContainer/ScrollContainer/Colors"] +margin_left = 114.0 +margin_top = 116.0 +margin_right = 148.0 +margin_bottom = 141.0 +rect_min_size = Vector2( 25, 25 ) +size_flags_horizontal = 3 +size_flags_vertical = 3 +custom_styles/normal = SubResource( 57 ) + +[node name="Button21" type="Button" parent="Panel/NoBCViewportsnotworking26181/Control/LeftPanel/MarginContainer/VBoxContainer/ScrollContainer/Colors"] +margin_top = 145.0 +margin_right = 34.0 +margin_bottom = 170.0 +rect_min_size = Vector2( 25, 25 ) +size_flags_horizontal = 3 +size_flags_vertical = 3 +custom_styles/normal = SubResource( 58 ) + +[node name="Button22" type="Button" parent="Panel/NoBCViewportsnotworking26181/Control/LeftPanel/MarginContainer/VBoxContainer/ScrollContainer/Colors"] +margin_left = 38.0 +margin_top = 145.0 +margin_right = 72.0 +margin_bottom = 170.0 +rect_min_size = Vector2( 25, 25 ) +size_flags_horizontal = 3 +size_flags_vertical = 3 +custom_styles/normal = SubResource( 59 ) + +[node name="Button23" type="Button" parent="Panel/NoBCViewportsnotworking26181/Control/LeftPanel/MarginContainer/VBoxContainer/ScrollContainer/Colors"] +margin_left = 76.0 +margin_top = 145.0 +margin_right = 110.0 +margin_bottom = 170.0 +rect_min_size = Vector2( 25, 25 ) +size_flags_horizontal = 3 +size_flags_vertical = 3 +custom_styles/normal = SubResource( 60 ) + +[node name="Button24" type="Button" parent="Panel/NoBCViewportsnotworking26181/Control/LeftPanel/MarginContainer/VBoxContainer/ScrollContainer/Colors"] +margin_left = 114.0 +margin_top = 145.0 +margin_right = 148.0 +margin_bottom = 170.0 +rect_min_size = Vector2( 25, 25 ) +size_flags_horizontal = 3 +size_flags_vertical = 3 +custom_styles/normal = SubResource( 61 ) + +[node name="VBoxContainer" type="VBoxContainer" parent="Panel/NoBCViewportsnotworking26181/Control/LeftPanel/MarginContainer/VBoxContainer"] +margin_top = 156.0 +margin_right = 161.0 +margin_bottom = 196.0 + +[node name="LockAlpha" type="CheckButton" parent="Panel/NoBCViewportsnotworking26181/Control/LeftPanel/MarginContainer/VBoxContainer/VBoxContainer"] +margin_right = 161.0 +margin_bottom = 40.0 +text = "Lock Alpha" +align = 2 + +[node name="BrushSelection" type="GridContainer" parent="Panel/NoBCViewportsnotworking26181/Control/LeftPanel/MarginContainer/VBoxContainer"] +margin_top = 208.0 +margin_right = 161.0 +margin_bottom = 233.0 +columns = 4 + +[node name="BrushRect" type="TextureButton" parent="Panel/NoBCViewportsnotworking26181/Control/LeftPanel/MarginContainer/VBoxContainer/BrushSelection"] +margin_right = 25.0 +margin_bottom = 25.0 +rect_min_size = Vector2( 25, 25 ) +texture_normal = ExtResource( 17 ) +texture_hover = ExtResource( 20 ) + +[node name="BrushCircle" type="TextureButton" parent="Panel/NoBCViewportsnotworking26181/Control/LeftPanel/MarginContainer/VBoxContainer/BrushSelection"] +margin_left = 29.0 +margin_right = 54.0 +margin_bottom = 25.0 +rect_min_size = Vector2( 25, 25 ) +texture_normal = ExtResource( 18 ) +texture_hover = ExtResource( 21 ) + +[node name="BrushVLine" type="TextureButton" parent="Panel/NoBCViewportsnotworking26181/Control/LeftPanel/MarginContainer/VBoxContainer/BrushSelection"] +margin_left = 58.0 +margin_right = 83.0 +margin_bottom = 25.0 +rect_min_size = Vector2( 25, 25 ) +texture_normal = ExtResource( 16 ) +texture_hover = ExtResource( 22 ) + +[node name="BrushHLine" type="TextureButton" parent="Panel/NoBCViewportsnotworking26181/Control/LeftPanel/MarginContainer/VBoxContainer/BrushSelection"] +margin_left = 87.0 +margin_right = 112.0 +margin_bottom = 25.0 +rect_min_size = Vector2( 25, 25 ) +texture_normal = ExtResource( 19 ) +texture_hover = ExtResource( 23 ) + +[node name="VSplitContainer" type="VBoxContainer" parent="Panel/NoBCViewportsnotworking26181/Control/LeftPanel/MarginContainer/VBoxContainer"] +margin_top = 245.0 +margin_right = 161.0 +margin_bottom = 279.0 +size_flags_horizontal = 3 + +[node name="BrushLabel" type="Label" parent="Panel/NoBCViewportsnotworking26181/Control/LeftPanel/MarginContainer/VBoxContainer/VSplitContainer"] +margin_right = 161.0 +margin_bottom = 14.0 +text = "Brush Size" + +[node name="HBoxContainer" type="HBoxContainer" parent="Panel/NoBCViewportsnotworking26181/Control/LeftPanel/MarginContainer/VBoxContainer/VSplitContainer"] +margin_top = 18.0 +margin_right = 161.0 +margin_bottom = 34.0 + +[node name="BrushSizeLabel" type="Label" parent="Panel/NoBCViewportsnotworking26181/Control/LeftPanel/MarginContainer/VBoxContainer/VSplitContainer/HBoxContainer"] +margin_top = 1.0 +margin_right = 30.0 +margin_bottom = 15.0 +rect_min_size = Vector2( 30, 0 ) +text = "1" + +[node name="BrushSize" type="HSlider" parent="Panel/NoBCViewportsnotworking26181/Control/LeftPanel/MarginContainer/VBoxContainer/VSplitContainer/HBoxContainer"] +margin_left = 34.0 +margin_right = 161.0 +margin_bottom = 16.0 +size_flags_horizontal = 3 +size_flags_vertical = 2 +min_value = 1.0 +value = 1.0 + +[node name="XSymmetry" type="CheckButton" parent="Panel/NoBCViewportsnotworking26181/Control/LeftPanel/MarginContainer/VBoxContainer"] +margin_top = 291.0 +margin_right = 161.0 +margin_bottom = 331.0 +text = "X Symmetry" + +[node name="YSymmetry" type="CheckButton" parent="Panel/NoBCViewportsnotworking26181/Control/LeftPanel/MarginContainer/VBoxContainer"] +margin_top = 343.0 +margin_right = 161.0 +margin_bottom = 383.0 +text = "Y Symmetry" + +[node name="PreviewWindow" parent="Panel/NoBCViewportsnotworking26181/Control" instance=ExtResource( 24 )] +visible = true +anchor_left = 1.0 +anchor_top = 0.762 +anchor_right = 1.0 +anchor_bottom = 0.762 +margin_left = -361.0 +margin_top = -0.0960083 +margin_right = -145.003 +margin_bottom = 159.904 +script = ExtResource( 14 ) +show_ok_cancel = false +show_close = false +title = "Preview (x2)" + +[node name="PreviewLayerTextures" type="Control" parent="Panel/NoBCViewportsnotworking26181/Control/PreviewWindow"] +anchor_right = 1.0 +anchor_bottom = 1.0 +margin_left = 5.0 +margin_top = 25.0 +margin_right = -5.0 +margin_bottom = -5.0 +rect_clip_content = true +mouse_filter = 2 +__meta__ = { +"_edit_use_anchors_": true +} + +[node name="ShortcutWindow" parent="Panel/NoBCViewportsnotworking26181/Control" instance=ExtResource( 26 )] +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +margin_left = -175.0 +margin_top = -154.0 +margin_right = 175.0 +margin_bottom = 154.0 + +[node name="Navbar" type="Control" parent="Panel/NoBCViewportsnotworking26181"] +anchor_right = 1.0 +anchor_bottom = 0.0833333 +size_flags_horizontal = 3 +size_flags_vertical = 3 +script = ExtResource( 6 ) +__meta__ = { +"_edit_use_anchors_": true +} + +[node name="Panel" type="Panel" parent="Panel/NoBCViewportsnotworking26181/Navbar"] +self_modulate = Color( 0.854902, 0.854902, 0.854902, 1 ) +anchor_right = 1.0 +anchor_bottom = 1.0 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Buttons" type="HBoxContainer" parent="Panel/NoBCViewportsnotworking26181/Navbar"] +anchor_left = 0.0078125 +anchor_top = 0.12 +anchor_right = 0.628906 +anchor_bottom = 0.62 +custom_constants/separation = 20 +__meta__ = { +"_edit_use_anchors_": true +} + +[node name="File" type="MenuButton" parent="Panel/NoBCViewportsnotworking26181/Navbar/Buttons"] +margin_right = 81.0 +margin_bottom = 29.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +text = "File" +flat = false +items = [ "New Project", null, 0, false, false, 0, 0, null, "", false, "Save Project", null, 0, false, false, 1, 0, null, "", false, "Load Project", null, 0, false, false, 2, 0, null, "", false, "Recent Sessions...", null, 0, false, true, 3, 0, null, "", false, "", null, 0, false, false, 4, 0, null, "", true, "Export (PNG)", null, 0, false, false, 5, 0, null, "", false, "Export Frame", null, 0, false, false, 6, 0, null, "", false, "Export Layer", null, 0, false, false, 7, 0, null, "", false, "Export Selection", null, 0, false, true, 8, 0, null, "", false, "", null, 0, false, false, 9, 0, null, "", true, "Import (PNG)", null, 0, false, false, 10, 0, null, "", false, "Recent Images...", null, 0, false, true, 11, 0, null, "", false ] +switch_on_hover = true +script = ExtResource( 7 ) + +[node name="Edit" type="MenuButton" parent="Panel/NoBCViewportsnotworking26181/Navbar/Buttons"] +margin_left = 101.0 +margin_right = 183.0 +margin_bottom = 29.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +disabled = true +text = "Edit" +flat = false +items = [ "Undo", null, 0, false, false, 0, 0, null, "", false, "Redo", null, 0, false, false, 1, 0, null, "", false, "Cut", null, 0, false, false, 2, 0, null, "", false, "Copy", null, 0, false, false, 3, 0, null, "", false, "Paste", null, 0, false, false, 4, 0, null, "", false ] +switch_on_hover = true +script = ExtResource( 7 ) + +[node name="Canvas" type="MenuButton" parent="Panel/NoBCViewportsnotworking26181/Navbar/Buttons"] +margin_left = 203.0 +margin_right = 285.0 +margin_bottom = 29.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +text = "Canvas" +flat = false +items = [ "Change Size", null, 0, false, false, 0, 0, null, "", false, "Crop To Content", null, 0, false, true, 1, 0, null, "", false ] +switch_on_hover = true +script = ExtResource( 7 ) + +[node name="Layer" type="MenuButton" parent="Panel/NoBCViewportsnotworking26181/Navbar/Buttons"] +margin_left = 305.0 +margin_right = 387.0 +margin_bottom = 29.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +text = "Layer" +flat = false +items = [ "Add Layer", null, 0, false, false, 0, 0, null, "", false, "Delete Layer", null, 0, false, false, 1, 0, null, "", false, "Duplicate Layer", null, 0, false, false, 2, 0, null, "", false, "Clear Layer", null, 0, false, false, 3, 0, null, "", false, "", null, 0, false, false, 4, 0, null, "", true, "Toggle Alpha Locked", null, 1, false, false, 5, 0, null, "", false ] +switch_on_hover = true +script = ExtResource( 7 ) + +[node name="Frame" type="MenuButton" parent="Panel/NoBCViewportsnotworking26181/Navbar/Buttons"] +margin_left = 407.0 +margin_right = 488.0 +margin_bottom = 29.0 +focus_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +text = "Frame" +flat = false +items = [ "Add Frame", null, 0, false, false, 0, 0, null, "", false, "Delete Frame", null, 0, false, false, 1, 0, null, "", false, "Duplicate Frame", null, 0, false, true, 2, 0, null, "", false, "Clear Frame Layers", null, 0, false, true, 3, 0, null, "", false ] +switch_on_hover = true +script = ExtResource( 7 ) +__meta__ = { +"_editor_description_": "" +} + +[node name="Grid" type="MenuButton" parent="Panel/NoBCViewportsnotworking26181/Navbar/Buttons"] +margin_left = 508.0 +margin_right = 590.0 +margin_bottom = 29.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +text = "Grid" +flat = false +items = [ "Toggle Grid", null, 0, false, false, 0, 0, null, "", false, "Change Grid Size", null, 0, false, false, 1, 0, null, "", false ] +switch_on_hover = true +script = ExtResource( 7 ) + +[node name="Magic" type="MenuButton" parent="Panel/NoBCViewportsnotworking26181/Navbar/Buttons"] +margin_left = 610.0 +margin_right = 692.0 +margin_bottom = 29.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +disabled = true +text = "Magic" +flat = false +items = [ "ChangeSingleColor", null, 0, false, false, 0, 0, null, "", false, "ChangeColorRange", null, 0, false, false, 1, 0, null, "", false, "HSV Noise", null, 0, false, false, 2, 0, null, "", false, "HSV Color Modulation", null, 0, false, false, 3, 0, null, "", false ] +switch_on_hover = true +script = ExtResource( 7 ) + +[node name="Editor" type="MenuButton" parent="Panel/NoBCViewportsnotworking26181/Navbar/Buttons"] +margin_left = 712.0 +margin_right = 794.0 +margin_bottom = 29.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +text = "Editor" +flat = false +items = [ "Settings", null, 0, false, false, 0, 0, null, "", false, "", null, 0, false, true, 1, 0, null, "", true, "Show Preview", null, 1, true, false, 2, 0, null, "", false, "Show Animation Panel", null, 1, true, false, 3, 0, null, "", false ] +switch_on_hover = true +script = ExtResource( 7 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Modes" type="HBoxContainer" parent="Panel/NoBCViewportsnotworking26181/Navbar"] +visible = false +anchor_left = 0.904297 +anchor_top = 11.16 +anchor_right = 0.943359 +anchor_bottom = 11.96 +__meta__ = { +"_edit_use_anchors_": true +} + +[node name="Draw" type="Button" parent="Panel/NoBCViewportsnotworking26181/Navbar/Modes"] +margin_right = 12.0 +margin_bottom = 48.0 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="FrameEdit" type="Button" parent="Panel/NoBCViewportsnotworking26181/Navbar/Modes"] +margin_left = 16.0 +margin_right = 28.0 +margin_bottom = 48.0 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Label" type="Label" parent="Panel/NoBCViewportsnotworking26181/Navbar"] +modulate = Color( 1, 1, 1, 0.184314 ) +anchor_left = 0.682 +anchor_right = 0.865 +anchor_bottom = 0.88 +margin_left = -0.368042 +margin_top = 6.0 +margin_right = 0.239929 +margin_bottom = 1.52588e-05 +text = "Shortcut Menu (Shift + )" +align = 1 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Label2" type="Label" parent="Panel/NoBCViewportsnotworking26181/Navbar"] +modulate = Color( 1, 1, 1, 0.184314 ) +anchor_left = 0.887 +anchor_right = 1.0 +anchor_bottom = 1.0 +margin_left = -0.288025 +margin_bottom = 1.90735e-05 +text = "Undo (Ctrl + Z) +Redo (Ctrl + Y)" +align = 1 +valign = 1 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="AnimationPanel" parent="Panel/NoBCViewportsnotworking26181" instance=ExtResource( 27 )] +anchor_left = 0.003125 +anchor_top = 0.786111 +anchor_right = 0.633594 +anchor_bottom = 0.994444 +margin_right = -0.000305176 +margin_bottom = 0.000305176 + +[node name="DebugPanel" type="Panel" parent="Panel/NoBCViewportsnotworking26181"] +visible = false +anchor_top = 0.913333 +anchor_right = 0.642578 +anchor_bottom = 0.998333 +rect_min_size = Vector2( 0, 40 ) +size_flags_horizontal = 3 +custom_styles/panel = SubResource( 33 ) +__meta__ = { +"_edit_group_": true, +"_edit_use_anchors_": true +} + +[node name="DebugTextDisplay" type="RichTextLabel" parent="Panel/NoBCViewportsnotworking26181/DebugPanel"] +anchor_right = 1.0 +anchor_bottom = 1.0 +text = "FPS 60 Mouse Position (1508.907471, -64.579575) Canvas Mouse Position (996.907471, -297.059509) Canvas Position (512, 232.47995) +Cell Position (142, 4) Cell Color 0,0,0,0 inside canvas False " +scroll_active = false +script = ExtResource( 11 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="SaveFileDialog" type="FileDialog" parent="."] +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +margin_left = -340.0 +margin_top = -165.0 +margin_right = 340.0 +margin_bottom = 165.0 +mouse_filter = 1 +filters = PoolStringArray( "*.png ; PNG Images" ) +script = ExtResource( 9 ) + +[node name="LoadFileDialog" type="FileDialog" parent="."] +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +margin_left = -340.0 +margin_top = -165.0 +margin_right = 340.0 +margin_bottom = 165.0 +mouse_filter = 1 +window_title = "Open a File" +mode = 0 +filters = PoolStringArray( "*.png ; PNG Images" ) +script = ExtResource( 2 ) + +[node name="Settings" parent="." instance=ExtResource( 10 )] +visible = false +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +margin_left = -150.0 +margin_top = -50.0 +margin_right = 150.0 +margin_bottom = 50.0 +mouse_filter = 1 + +[node name="ChangeCanvasSize" parent="." instance=ExtResource( 24 )] +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +margin_left = -125.5 +margin_top = -70.0 +margin_right = 125.5 +margin_bottom = 70.0 +script = ExtResource( 25 ) +title = "Change Canvas Size?" + +[node name="ChangeGridSizeDialog" type="AcceptDialog" parent="."] +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +margin_left = -127.0 +margin_top = -74.0 +margin_right = 128.0 +margin_bottom = 73.0 +window_title = "Change Grid Size" +resizable = true +script = ExtResource( 15 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="VBoxContainer" type="VBoxContainer" parent="ChangeGridSizeDialog"] +anchor_left = 0.0313726 +anchor_top = 0.0816327 +anchor_right = 0.968627 +anchor_bottom = 0.727891 +margin_left = -1.23978e-05 +margin_top = -4.00001 +margin_right = 0.00012207 +margin_bottom = 4.00002 +__meta__ = { +"_edit_use_anchors_": true +} + +[node name="Label" type="Label" parent="ChangeGridSizeDialog/VBoxContainer"] +margin_right = 239.0 +margin_bottom = 31.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +text = "Change Grid Size" +align = 1 + +[node name="HBoxContainer" type="HBoxContainer" parent="ChangeGridSizeDialog/VBoxContainer"] +margin_top = 35.0 +margin_right = 239.0 +margin_bottom = 67.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 + +[node name="Label" type="Label" parent="ChangeGridSizeDialog/VBoxContainer/HBoxContainer"] +margin_top = 9.0 +margin_right = 117.0 +margin_bottom = 23.0 +size_flags_horizontal = 3 +size_flags_vertical = 6 +text = "Grid 1" + +[node name="GridValue" type="SpinBox" parent="ChangeGridSizeDialog/VBoxContainer/HBoxContainer"] +margin_left = 121.0 +margin_top = 4.0 +margin_right = 239.0 +margin_bottom = 28.0 +size_flags_horizontal = 3 +size_flags_vertical = 6 +max_value = 2500.0 +value = 1.0 + +[node name="HBoxContainer2" type="HBoxContainer" parent="ChangeGridSizeDialog/VBoxContainer"] +margin_top = 71.0 +margin_right = 239.0 +margin_bottom = 103.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 + +[node name="Label" type="Label" parent="ChangeGridSizeDialog/VBoxContainer/HBoxContainer2"] +margin_top = 9.0 +margin_right = 117.0 +margin_bottom = 23.0 +size_flags_horizontal = 3 +size_flags_vertical = 6 +text = "Grid 2" + +[node name="BigGridValue" type="SpinBox" parent="ChangeGridSizeDialog/VBoxContainer/HBoxContainer2"] +margin_left = 121.0 +margin_top = 4.0 +margin_right = 239.0 +margin_bottom = 28.0 +size_flags_horizontal = 3 +size_flags_vertical = 6 +max_value = 2500.0 +value = 8.0 + +[connection signal="mouse_entered" from="Panel/NoBCViewportsnotworking26181/Control/PaintCanvasContainer" to="." method="_on_PaintCanvasContainer_mouse_entered"] +[connection signal="mouse_exited" from="Panel/NoBCViewportsnotworking26181/Control/PaintCanvasContainer" to="." method="_on_PaintCanvasContainer_mouse_exited"] +[connection signal="pressed" from="Panel/NoBCViewportsnotworking26181/Control/RightPanel/ScrollContainer/ToolMenu/Tools/PaintTool" to="." method="_on_PaintTool_pressed"] +[connection signal="pressed" from="Panel/NoBCViewportsnotworking26181/Control/RightPanel/ScrollContainer/ToolMenu/Tools/BrushTool" to="." method="_on_BrushTool_pressed"] +[connection signal="pressed" from="Panel/NoBCViewportsnotworking26181/Control/RightPanel/ScrollContainer/ToolMenu/Tools/MultiTool" to="." method="_on_MultiTool_pressed"] +[connection signal="pressed" from="Panel/NoBCViewportsnotworking26181/Control/RightPanel/ScrollContainer/ToolMenu/Tools/BucketTool" to="." method="_on_BucketTool_pressed"] +[connection signal="pressed" from="Panel/NoBCViewportsnotworking26181/Control/RightPanel/ScrollContainer/ToolMenu/Tools/RainbowTool" to="." method="_on_RainbowTool_pressed"] +[connection signal="pressed" from="Panel/NoBCViewportsnotworking26181/Control/RightPanel/ScrollContainer/ToolMenu/Tools/LineTool" to="." method="_on_LineTool_pressed"] +[connection signal="pressed" from="Panel/NoBCViewportsnotworking26181/Control/RightPanel/ScrollContainer/ToolMenu/Tools/RectTool" to="." method="_on_RectTool_pressed"] +[connection signal="pressed" from="Panel/NoBCViewportsnotworking26181/Control/RightPanel/ScrollContainer/ToolMenu/Tools/DarkenTool" to="." method="_on_DarkenTool_pressed"] +[connection signal="pressed" from="Panel/NoBCViewportsnotworking26181/Control/RightPanel/ScrollContainer/ToolMenu/Tools/BrightenTool" to="." method="_on_BrightenTool_pressed"] +[connection signal="pressed" from="Panel/NoBCViewportsnotworking26181/Control/RightPanel/ScrollContainer/ToolMenu/Tools/ColorPickerTool" to="." method="_on_ColorPickerTool_pressed"] +[connection signal="pressed" from="Panel/NoBCViewportsnotworking26181/Control/RightPanel/ScrollContainer/ToolMenu/Tools/CutTool" to="." method="_on_CutTool_pressed"] +[connection signal="color_changed" from="Panel/NoBCViewportsnotworking26181/Control/RightPanel/ScrollContainer/ToolMenu/Tools/ColorPicker" to="." method="_on_ColorPicker_color_changed"] +[connection signal="popup_closed" from="Panel/NoBCViewportsnotworking26181/Control/RightPanel/ScrollContainer/ToolMenu/Tools/ColorPicker" to="." method="_on_ColorPicker_popup_closed"] +[connection signal="pressed" from="Panel/NoBCViewportsnotworking26181/Control/RightPanel/ScrollContainer/ToolMenu/Control/VBoxContainer/AddNewLayer" to="." method="_on_AddNewLayer_pressed"] +[connection signal="pressed" from="Panel/NoBCViewportsnotworking26181/Control/LeftPanel/MarginContainer/VBoxContainer/VBoxContainer/LockAlpha" to="." method="_on_LockAlpha_pressed"] +[connection signal="pressed" from="Panel/NoBCViewportsnotworking26181/Control/LeftPanel/MarginContainer/VBoxContainer/BrushSelection/BrushRect" to="." method="_on_BrushRect_pressed"] +[connection signal="pressed" from="Panel/NoBCViewportsnotworking26181/Control/LeftPanel/MarginContainer/VBoxContainer/BrushSelection/BrushCircle" to="." method="_on_BrushCircle_pressed"] +[connection signal="pressed" from="Panel/NoBCViewportsnotworking26181/Control/LeftPanel/MarginContainer/VBoxContainer/BrushSelection/BrushVLine" to="." method="_on_BrushVLine_pressed"] +[connection signal="pressed" from="Panel/NoBCViewportsnotworking26181/Control/LeftPanel/MarginContainer/VBoxContainer/BrushSelection/BrushHLine" to="." method="_on_BrushHLine_pressed"] +[connection signal="value_changed" from="Panel/NoBCViewportsnotworking26181/Control/LeftPanel/MarginContainer/VBoxContainer/VSplitContainer/HBoxContainer/BrushSize" to="." method="_on_BrushSize_value_changed"] +[connection signal="pressed" from="Panel/NoBCViewportsnotworking26181/Control/LeftPanel/MarginContainer/VBoxContainer/XSymmetry" to="." method="_on_XSymmetry_pressed"] +[connection signal="pressed" from="Panel/NoBCViewportsnotworking26181/Control/LeftPanel/MarginContainer/VBoxContainer/YSymmetry" to="." method="_on_YSymmetry_pressed"] +[connection signal="on_animation_frame_rate_changed" from="Panel/NoBCViewportsnotworking26181/AnimationPanel" to="." method="_on_AnimationPanel_on_animation_frame_rate_changed"] +[connection signal="on_animation_loop_toggled" from="Panel/NoBCViewportsnotworking26181/AnimationPanel" to="." method="_on_AnimationPanel_on_animation_loop_toggled"] +[connection signal="on_play_pause_pressed" from="Panel/NoBCViewportsnotworking26181/AnimationPanel" to="." method="_on_AnimationPanel_on_play_pause_pressed"] +[connection signal="about_to_show" from="SaveFileDialog" to="SaveFileDialog" method="_on_SaveFileDialog_about_to_show"] +[connection signal="confirmed" from="SaveFileDialog" to="SaveFileDialog" method="_on_SaveFileDialog_confirmed"] +[connection signal="file_selected" from="SaveFileDialog" to="SaveFileDialog" method="_on_SaveFileDialog_file_selected"] +[connection signal="visibility_changed" from="SaveFileDialog" to="SaveFileDialog" method="_on_SaveFileDialog_visibility_changed"] +[connection signal="about_to_show" from="LoadFileDialog" to="LoadFileDialog" method="_on_LoadFileDialog_about_to_show"] +[connection signal="confirmed" from="LoadFileDialog" to="LoadFileDialog" method="_on_LoadFileDialog_confirmed"] +[connection signal="file_selected" from="LoadFileDialog" to="LoadFileDialog" method="_on_LoadFileDialog_file_selected"] +[connection signal="visibility_changed" from="LoadFileDialog" to="LoadFileDialog" method="_on_LoadFileDialog_visibility_changed"] +[connection signal="confirmed" from="ChangeGridSizeDialog" to="ChangeGridSizeDialog" method="_on_ChangeGridSizeDialog_confirmed"] +[connection signal="visibility_changed" from="ChangeGridSizeDialog" to="ChangeGridSizeDialog" method="_on_ChangeGridSizeDialog_visibility_changed"] +[connection signal="value_changed" from="ChangeGridSizeDialog/VBoxContainer/HBoxContainer/GridValue" to="ChangeGridSizeDialog" method="_on_GridValue_value_changed"] +[connection signal="value_changed" from="ChangeGridSizeDialog/VBoxContainer/HBoxContainer2/BigGridValue" to="ChangeGridSizeDialog" method="_on_BigGridValue_value_changed"] diff --git a/addons/Godoxel/Frame.gd b/addons/Godoxel/Frame.gd new file mode 100644 index 0000000..53e66d7 --- /dev/null +++ b/addons/Godoxel/Frame.gd @@ -0,0 +1,107 @@ +extends Control +class_name GEFrame +tool + + +var layers = [] + +var width: int +var height: int + +var preview_texture: ImageTexture = ImageTexture.new() +var preview_dirty = false +var preview_updated = true + + +func _ready(): + pass + + +func _draw(): +# return +# if not preview_dirty: +# return +# preview_dirty = false + for layer in layers: + layer.update_texture() + #_update_preview() + + +func _update_preview(): + var image = Image.new() + image.create(width, height, true, Image.FORMAT_RGBA8) + image.lock() + image.fill(Color.transparent) + image.unlock() + image.lock() + + for layer in layers: + if not layer.visible: + continue + + for x in range(width): + for y in range(height): + var color = layer.get_pixel(x, y) + var image_color = image.get_pixel(x, y) + + if color.a != 0: + image.set_pixel(x, y, color) + else: + image.set_pixel(x, y, image_color.blend(color)) + image.unlock() + preview_texture.create_from_image(image) + preview_updated = true + + +func get_preview_texture(): + return preview_texture + + +func set_layers(new_layers: Array): + for layer in new_layers: + add_frame_layer(layer) + + +func add_frame_layer(layer: GELayer): + layers.append(layer) + add_child(layer.texture_rect_ref, true) + return layer + + +func resize(width: int, height: int): + self.width = width + self.height = height + for layer in layers: + layer.resize(width, height) + + +func get_content_margin() -> Rect2: + var rect = Rect2(999999, 999999, -999999, -999999) + for layer in layers: + var r = layer.image.get_used_rect() + if r.position.x < rect.position.x: + rect.position.x = r.position.x + if r.position.y < rect.position.y: + rect.position.y = r.position.y + if r.size.x > rect.size.x: + rect.size.x = r.size.x + if r.size.y > rect.size.y: + rect.size.y = r.size.y + return rect + + +func crop_to_content(): + var rect = get_content_margin() + + #print(rect) + + for layer in layers: + layer.image + +# set_canvas_width(rect.size.x) +# set_canvas_height(rect.size.x) + +# preview_layer.resize(width, height) +# tool_layer.resize(width, height) +# for layer in layers: +# layer.resize(width, height) diff --git a/addons/Godoxel/LICENSE b/addons/Godoxel/LICENSE new file mode 100644 index 0000000..11b9025 --- /dev/null +++ b/addons/Godoxel/LICENSE @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2019 Flairieve +Copyright (c) 2020 cobrapitz + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/addons/Godoxel/Layer.gd b/addons/Godoxel/Layer.gd new file mode 100644 index 0000000..889b47c --- /dev/null +++ b/addons/Godoxel/Layer.gd @@ -0,0 +1,107 @@ +extends Reference +class_name GELayer +tool + + +var name +var layer_width +var layer_height +var visible = true setget set_visible +var locked = false +var alpha_locked = false + +var texture: ImageTexture +var image: Image +var texture_rect_ref + + +func _init(): + texture = ImageTexture.new() + + +func create(texture_rect_ref, width: int, height: int): + self.texture_rect_ref = texture_rect_ref + + assert(width > 0 and height > 0, "Texture size invalid!") + + layer_width = width + layer_height = height + + image = Image.new() + image.create(width, height, false, Image.FORMAT_RGBA8) + image.fill(Color.transparent) + update_texture() + + +func resize(width: int, height: int): + var pixel_colors = [] + var prev_width = layer_width + var prev_height = layer_height + + image.lock() + for y in range(prev_height): + for x in range(prev_width): + pixel_colors.append(image.get_pixel(x, y)) + image.unlock() + + layer_width = width + layer_height = height + + image.create(width, height, false, Image.FORMAT_RGBA8) + image.fill(Color.transparent) + + image.lock() + for x in range(prev_width): + for y in range(prev_height): + if x >= width or y >= height: + continue + image.set_pixel(x, y, pixel_colors[GEUtils.to_1D(x, y, prev_width)]) + image.unlock() + + update_texture() + + +func set_pixel(x, y, color): + image.lock() + image.set_pixel(x, y, color) + image.unlock() + + +func get_pixel(x: int, y: int): + if x < 0 or y < 0 or x >= image.get_width() or y >= image.get_height(): + return null + image.lock() + var pixel = image.get_pixel(x, y) + image.unlock() + return pixel + + +func clear(): + image.fill(Color.transparent) + update_texture() + + +func update_texture(): + texture.create_from_image(image, 0) + texture_rect_ref.texture = texture + texture_rect_ref.margin_right = 0 + texture_rect_ref.margin_bottom = 0 + + +func set_visible(vis: bool): + # TODO upate frame preview when hide/show + visible = vis + texture_rect_ref.visible = visible + + +func toggle_lock(): + locked = not locked + + +func toggle_alpha_locked(): + alpha_locked = not alpha_locked + + +func copy_from(other: GELayer): + image.copy_from(other.image) + diff --git a/addons/Godoxel/LayerButton.tscn b/addons/Godoxel/LayerButton.tscn new file mode 100644 index 0000000..841cdd6 --- /dev/null +++ b/addons/Godoxel/LayerButton.tscn @@ -0,0 +1,108 @@ +[gd_scene load_steps=11 format=2] + +[ext_resource path="res://addons/Godoxel/assets/minidotta_invis.png" type="Texture" id=1] +[ext_resource path="res://addons/Godoxel/assets/minidotta.png" type="Texture" id=2] +[ext_resource path="res://addons/Godoxel/assets/arrow_down.png" type="Texture" id=3] +[ext_resource path="res://addons/Godoxel/assets/arrow_up.png" type="Texture" id=4] +[ext_resource path="res://addons/Godoxel/assets/lock_layer_1.png" type="Texture" id=5] +[ext_resource path="res://addons/Godoxel/assets/unlock_layer.png" type="Texture" id=6] + +[sub_resource type="StyleBoxFlat" id=4] +resource_local_to_scene = true +bg_color = Color( 0.354706, 0.497302, 0.769531, 1 ) + +[sub_resource type="StyleBoxFlat" id=1] +bg_color = Color( 0.25098, 0.25098, 0.25098, 0 ) + +[sub_resource type="StyleBoxFlat" id=2] +bg_color = Color( 0.6, 0.6, 0.6, 0 ) + +[sub_resource type="StyleBoxFlat" id=3] +bg_color = Color( 0.6, 0.6, 0.6, 0 ) + +[node name="Layer1" type="Panel"] +show_behind_parent = true +anchor_right = 0.113281 +anchor_bottom = 0.0416667 +margin_bottom = -1.90735e-06 +rect_min_size = Vector2( 0, 32 ) +mouse_filter = 2 +custom_styles/panel = SubResource( 4 ) +__meta__ = { +"_edit_use_anchors_": true +} + +[node name="Select" type="Button" parent="." groups=["layer_button"]] +anchor_right = 0.827586 +anchor_bottom = 1.0 +custom_styles/hover = SubResource( 1 ) +custom_styles/pressed = SubResource( 1 ) +custom_styles/focus = SubResource( 1 ) +custom_styles/disabled = SubResource( 1 ) +custom_styles/normal = SubResource( 1 ) +text = "Layer 1" +align = 2 +__meta__ = { +"_edit_use_anchors_": true +} + +[node name="Visible" type="CheckButton" parent="."] +anchor_top = 0.5 +anchor_bottom = 0.5 +margin_left = 3.0 +margin_top = -8.5 +margin_right = 19.0 +margin_bottom = 7.5 +custom_icons/off = ExtResource( 1 ) +custom_icons/on = ExtResource( 2 ) +custom_styles/normal = SubResource( 2 ) +pressed = true +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Lock" type="CheckButton" parent="."] +anchor_top = 0.5 +anchor_bottom = 0.5 +margin_left = 22.0 +margin_top = -11.0 +margin_right = 46.0 +margin_bottom = 11.0 +custom_icons/off = ExtResource( 6 ) +custom_icons/on = ExtResource( 5 ) +custom_styles/normal = SubResource( 3 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="VBoxContainer" type="VBoxContainer" parent="."] +anchor_left = 1.0 +anchor_right = 1.0 +anchor_bottom = 1.0 +margin_left = -20.0 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Up" type="TextureButton" parent="VBoxContainer"] +margin_right = 20.0 +margin_bottom = 14.0 +rect_min_size = Vector2( 20, 0 ) +size_flags_horizontal = 3 +size_flags_vertical = 3 +texture_normal = ExtResource( 4 ) +texture_pressed = ExtResource( 2 ) +expand = true +stretch_mode = 3 + +[node name="Down" type="TextureButton" parent="VBoxContainer"] +margin_top = 18.0 +margin_right = 20.0 +margin_bottom = 32.0 +rect_min_size = Vector2( 20, 0 ) +size_flags_horizontal = 3 +size_flags_vertical = 3 +texture_normal = ExtResource( 3 ) +texture_pressed = ExtResource( 2 ) +expand = true +stretch_mode = 3 diff --git a/addons/Godoxel/MenuButtonExtended.gd b/addons/Godoxel/MenuButtonExtended.gd new file mode 100644 index 0000000..dd442f6 --- /dev/null +++ b/addons/Godoxel/MenuButtonExtended.gd @@ -0,0 +1,13 @@ +tool +extends MenuButton + +var popup = get_popup() +signal item_pressed + +func _ready(): + popup.connect("id_pressed", self, "id_pressed") + +func id_pressed(id): + emit_signal("item_pressed", name, popup.get_item_text(id), id) + + diff --git a/addons/Godoxel/Navbar.gd b/addons/Godoxel/Navbar.gd new file mode 100644 index 0000000..9e75237 --- /dev/null +++ b/addons/Godoxel/Navbar.gd @@ -0,0 +1,139 @@ +tool +extends Control + +var editor +var paint_canvas + +func _ready(): + editor = owner + paint_canvas = editor.find_node("PaintCanvas") + + for i in get_node("Buttons").get_children(): + i.connect("item_pressed", self, "button_pressed") + + +func button_pressed(button_name, button_item, id): +# print("pressed: ", button_name) +# print("pressed item is: '%s'" % button_item) + + match button_name: + "File": + handle_file_menu(button_item, id) + "Edit": + handle_edit_menu(button_item, id) + "Canvas": + handle_canvas_menu(button_item, id) + "Layer": + handle_layer_menu(button_item, id) + "Frame": + handle_frame_menu(button_item, id) + "Grid": + handle_grid_menu(button_item, id) + "Magic": + handle_magic_menu(button_item, id) + "Editor": + handle_editor_menu(button_item, id) + + +func handle_file_menu(pressed_item: String, id): + match pressed_item: + "Save Project": + owner.get_node("SaveFileDialog").open_save_project() + "Load Project": + owner.get_node("LoadFileDialog").open_load_project() + "New Project": + owner.get_node("ConfirmationDialog").show() + "Export (PNG)": + owner.get_node("SaveFileDialog").open_save_current_frame() + "Export Frame": + owner.get_node("SaveFileDialog").open_save_current_frame() + "Export Layer": + owner.get_node("SaveFileDialog").open_save_current_layer() + "Export Selection": + print("Not implemented!") + "Import (PNG)": + owner.get_node("LoadFileDialog").open_import_image() + + +func handle_edit_menu(pressed_item: String, id): + match pressed_item: + "Add Layer": + editor.add_new_layer() + + +func handle_canvas_menu(pressed_item: String, id): + match pressed_item: + "Change Size": + owner.get_node("ChangeCanvasSize").show() + "Crop To Content": + owner.paint_canvas.crop_to_content() + + +func handle_layer_menu(pressed_item: String, id): + match pressed_item: + "Add Layer": + editor.add_new_layer() + "Delete Layer": + editor.remove_active_layer() + "Duplicate Layer": + editor.duplicate_active_layer() + "Clear Layer": + owner.paint_canvas.clear_active_layer() + "Toggle Alpha Locked": + owner.paint_canvas.active_layer.toggle_alpha_locked() + $Buttons/Layer.get_popup().set_item_checked(id, not $Buttons/Layer.get_popup().is_item_checked(id)) + owner.find_node("LockAlpha").pressed = $Buttons/Layer.get_popup().is_item_checked(id) + + +func handle_frame_menu(pressed_item: String, id): + match pressed_item: + "Add Frame": + var frame_button = editor.anim_panel.get_animation_stripe(editor.current_animation_idx).add_new_frame_button() + editor._on_add_frame_pressed(editor.current_animation_idx, frame_button.get_index()) + "Delete Frame": + editor.delete_current_frame() + "Duplicate Frame": + pass + "Clear Frame Layers": + pass + _: + printerr("Pressed: ", pressed_item, " not found!") + + +func handle_grid_menu(pressed_item: String, id): + match pressed_item: + "Change Grid Size": + owner.get_node("ChangeGridSizeDialog").show() + "Toggle Grid": + owner.paint_canvas.toggle_grid() + + +func handle_magic_menu(pressed_item: String, id): + match pressed_item: + "Add Layer": + editor.add_new_layer() + + +func handle_editor_menu(pressed_item: String, id): + match pressed_item: + "Settings": + owner.get_node("Settings").show() + "Show Preview": + owner.preview_window.visible = not owner.preview_window.visible + $Buttons/Editor.get_popup().set_item_checked(id, owner.preview_window.visible) + "Toggle Grid": + var grids_node = owner.find_node("Grids") + grids_node.visible = !grids_node.visible + "Reset Canvas Position": + owner.paint_canvas_node.rect_position = Vector2(0, 0) + "Show Animation Panel": + owner.anim_panel.visible = not owner.anim_panel.visible + $Buttons/Editor.get_popup().set_item_checked(id, owner.anim_panel.visible) + + +func is_any_menu_open() -> bool: + for child in $Buttons.get_children(): + if child.get_popup().visible: + return true + return false + diff --git a/addons/Godoxel/PaintCanvas.gd b/addons/Godoxel/PaintCanvas.gd new file mode 100644 index 0000000..39fa0ba --- /dev/null +++ b/addons/Godoxel/PaintCanvas.gd @@ -0,0 +1,500 @@ +tool +extends Control + +var image = Image.new() +var last_pixel = [] +onready var canvas_image_node = get_node("CanvasImage") +export var grid_size = 16 +export var canvas_size = Vector2(48, 28) +export var region_size = 10 +export var can_draw = true + +var mouse_in_region +var mouse_on_top + +#terms +#global cell - a cell that has a global grid position on the canvas +#local cell - a cell that has a local grid position in a chunk region on the canvas +#chunk region - a set of cells contained in an even number + +#TODO: Maybe each chunk region can hold an image resource +# so that way the engine wouldn't lag at all when updating the canvas + +var layers = {} +var active_layer + +var preview_layer = "preview" +var preview_enabled = false + + +func _enter_tree(): + #---------------------- + # init Layer + #---------------------- + layers[preview_layer] = { + "layer": null, + "data": [], + "chunks": null, + } + + canvas_size = Vector2(int(rect_size.x / grid_size), int(rect_size.y / grid_size)) + #print("canvas_size: ", canvas_size) + + +func _ready(): + active_layer = add_existing_layer(get_tree().get_nodes_in_group("layer")[0]) + #print("active Layer: ", active_layer) + + +func get_layer_data(layer_name): + return layers[layer_name] + + +func get_active_layer(): + return layers[active_layer] + + +func get_preview_layer(): + return layers[preview_layer] + + +func clear_active_layer(): + for pixel in layers[active_layer].data: + set_global_cell_in_chunk(pixel[0], pixel[1], Color(0,0,0,0)) + + +func clear_layer(layer_name: String): + for pixel in layers[layer_name].data: + set_global_cell_in_chunk(pixel[0], pixel[1], Color(0,0,0,0)) + + +func clear_preview_layer(): + for pixel in layers["preview"].data: + set_global_cell_in_chunk(pixel[0], pixel[1], Color(0,0,0,0)) + + +func remove_layer(layer_name): + get_node("ChunkNodes").remove_child(layers[layer_name].chunks) + layers[layer_name].chunks.queue_free() + + layers.erase(layer_name) + + if active_layer == layer_name: + for layer in layers: + if layer == preview_layer: + continue + active_layer = layer + break + + return active_layer + + + +# only needed for init +func add_existing_layer(layer): + layers[layer.name] = { + "layer": layer, + "data": [], + "chunks": null, + } + generate_chunks() + return layer.name + + +func add_new_layer(layer_name): + layers[layer_name] = { + "layer": null, + "data": [], + "chunks": null, + } + + generate_chunks() + + return layer_name + + +func duplicate_layer(layer: String, neu_layer_name: String): + var _preview = preview_enabled + preview_enabled = false + var _temp = active_layer + active_layer = neu_layer_name + + layers[neu_layer_name] = { + "layer": null, + "data": layers[layer].data.duplicate(true), + "chunks": null, + } + + generate_chunks() +# get_node("ChunkNodes").remove_child(layers[neu_layer_name].chunks) +# get_node("ChunkNodes").add_child_below_node(layers[layer].chunks, layers[neu_layer_name].chunks, true) + + for pixel in layers[neu_layer_name].data: + set_pixel_cell(pixel[0], pixel[1], pixel[2]) + active_layer = _temp + + preview_enabled = _preview + return neu_layer_name + + +func toggle_layer_visibility(layer_name): + layers[layer_name].chunks.visible = not layers[layer_name].chunks.visible + #print("Layer: ", layer_name, " is now: ", layers[layer_name].chunks.visible) + + +var util = preload("res://addons/Godoxel/Util.gd") + + +func _on_mouse_entered(): + mouse_on_top = true + + +func _on_mouse_exited(): + mouse_on_top = false + + +func _process(delta: float) -> void: + var mouse_position = get_local_mouse_position() + var rect = Rect2(Vector2(0, 0), rect_size) + mouse_in_region = rect.has_point(mouse_position) + + update() + #if not Engine.editor_hint: + # print(mouse_on_canvas, " | ", has_focus()) + #draw_canvas_out just updates the image constantly + #if can_draw: + # draw_canvas_out() + + +func generate_chunks(): + var maxium_chunk_size = get_maxium_filled_chunks() + #TODO: We probably don't need to check for x and y anymore + for key in layers: + if layers[key].chunks != null: + continue + + var chunk_node = Control.new() + get_node("ChunkNodes").add_child(chunk_node) + chunk_node.owner = self + + layers[key].chunks = chunk_node + + for x in maxium_chunk_size.x: + for y in maxium_chunk_size.y: + var paint_canvas_chunk = load("res://addons/Godoxel/PaintCanvasChunk.tscn").instance() + paint_canvas_chunk.setup(region_size) + paint_canvas_chunk.name = "C-%s-%s" % [x, y] + paint_canvas_chunk.rect_position = \ + Vector2(x * (grid_size * region_size), y * (grid_size * region_size)) + layers[key].chunks.add_child(paint_canvas_chunk) + + +func get_maxium_filled_chunks(): + return Vector2(canvas_size.x / region_size, canvas_size.y / region_size).ceil() + + +##TODO: Remake these functions with godot's setget features +#func resize_grid(grid): +# #print(grid) +# if grid <= 0: +# return +# grid_size = grid +# canvas_image_node.rect_scale = Vector2(grid, grid) +# +# +#func resize_canvas(x, y): +# image.unlock() +# image.create(x, y, true, Image.FORMAT_RGBA8) +# canvas_size = Vector2(x, y) +# #setup_all_chunks() +# image.lock() + +#func draw_canvas_out(a = ""): +# if canvas_image_node == null: +# return +# var image_texture = ImageTexture.new() +# image_texture.create_from_image(image) +# image_texture.set_flags(0) +# canvas_image_node.texture = image_texture + + +func get_wrapped_region_cell(x, y): + return Vector2(wrapi(x, 0, region_size), wrapi(y, 0, region_size)) + + +func get_region_from_cell(x, y): + return Vector2(floor(x / region_size), floor(y / region_size)) + + +func set_local_cell_in_chunk(chunk_x, chunk_y, local_cell_x, local_cell_y, color): + var chunk_node + + if preview_enabled: + chunk_node = layers.preview.chunks.get_node_or_null("C-%s-%s" % [chunk_x, chunk_y]) + else: + chunk_node = layers[active_layer].chunks.get_node_or_null("C-%s-%s" % [chunk_x, chunk_y]) + + if chunk_node == null: + #print("Can't find chunk node!") + return + chunk_node.set_cell(local_cell_x, local_cell_y, color) + + +func set_global_cell_in_chunk(cell_x, cell_y, color): + var chunk = get_region_from_cell(cell_x, cell_y) + var wrapped_cell = get_wrapped_region_cell(cell_x, cell_y) + set_local_cell_in_chunk(chunk.x, chunk.y, wrapped_cell.x, wrapped_cell.y, color) + +#func update_chunk_region_from_cell(x, y): +# var region_to_update = get_region_from_cell(x, y) +# update_chunk_region(region_to_update.x, region_to_update.y) + +func get_pixel_cell_color(x, y): + if not cell_in_canvas_region(x, y): + return null + var pixel_cell = get_pixel_cell(x, y) + if pixel_cell == null: + #We already checked that the cell can't be out of the canvas + #region so we can assume the pixel cell is completely transparent if it's null + return Color(0, 0, 0, 0) + else: + return util.color_from_array(pixel_cell[2]) + +func get_pixel_cell_color_v(vec2): + return get_pixel_cell_color(vec2.x, vec2.y) + +func get_pixel_cell(x, y): + if active_layer == null: + return + if not cell_in_canvas_region(x, y): + return null + + for pixel in get_active_layer().data: + if pixel[0] == x and pixel[1] == y: + return pixel + + return null + +func get_pixel_cell_v(vec2): + return get_pixel_cell(vec2.x, vec2.y) + +#func remove_pixel_cell(x, y): +# if can_draw == false: +# return false +# if not cell_in_canvas_region(x, y): +# return false +# var layer_data = get_layer_data("Layer 1") +# for pixel in range(0, layer_data.size()): +# if layer_data[pixel][0] == x and layer_data[pixel][1] == y: +# layer_data.remove(pixel) +# #update_chunk_region_from_cell(x, y) +# #TOOD: If pixel exists in temp_pool_pixels then remove it +# image.set_pixel(x, y, Color(0, 0, 0, 0)) +# return true +# return false + +#func remove_pixel_cell_v(vec2): +# return remove_pixel_cell(vec2.x, vec2.y) + +func set_pixel_cell(x, y, color): + if can_draw == false: + return false + + if not cell_in_canvas_region(x, y): + return false + + var layer + if preview_enabled: + layer = get_preview_layer() + else: + layer = get_active_layer() + + var index = 0 + for pixel in layer.data: + #TODO: Make a better way of accessing the array because the more pixels we have, + #the longer it takes to + #set the pixel + if pixel[0] == x and pixel[1] == y: + #No reason to set the pixel again if the colors are the same + + #If the color we are setting is 0, 0, 0, 0 then there is + #no reason to keep the information about the pixel + #so we remove it from the layer data + if color == Color(0, 0, 0, 0): + layer.data.remove(index) + else: + pixel[2] = color + #TODO: The new system is going to allow chunks to each have their own TextureRect and Image + #nodes so what we are doing in here is + #that we are setting the local cell in the region of that image + set_global_cell_in_chunk(x, y, color) + last_pixel = [x, y, color] + return true + index += 1 + #don't append any data if the color is 0, 0, 0, 0 + if color != Color(0, 0, 0, 0): + #if the pixel data doesn't exist then we add it in + layer.data.append([x, y, color]) + set_global_cell_in_chunk(x, y, color) + last_pixel = [x, y, color] + return true + +func set_pixel_cell_v(vec2, color): + return set_pixel_cell(vec2.x, vec2.y, color) + +func set_pixels_from_line(vec2_1, vec2_2, color): + var points = get_pixels_from_line(vec2_1, vec2_2) + for i in points: + set_pixel_cell_v(i, color) + +func set_random_pixels_from_line(vec2_1, vec2_2): + var points = get_pixels_from_line(vec2_1, vec2_2) + for i in points: + set_pixel_cell_v(i, util.random_color_alt()) + +func get_pixels_from_line(vec2_1, vec2_2): + var points = PoolVector2Array() + + var dx = abs(vec2_2.x - vec2_1.x) + var dy = abs(vec2_2.y - vec2_1.y) + + var x = vec2_1.x + var y = vec2_1.y + + var sx = 0 + if vec2_1.x > vec2_2.x: + sx = -1 + else: + sx = 1 + + var sy = 0 + if vec2_1.y > vec2_2.y: + sy = -1 + else: + sy = 1 + + if dx > dy: + var err = dx / 2 + while(true): + if x == vec2_2.x: + break + points.push_back(Vector2(x, y)) + + err -= dy + if err < 0: + y += sy + err += dx + x += sx + else: + var err = dy / 2 + while (true): + if y == vec2_2.y: + break + points.push_back(Vector2(x, y)) + + err -= dx + if err < 0: + x += sx + err += dy + y += sy + points.push_back(Vector2(x, y)) + return points + + +#even though the function checks for it, we can't afford adding more functions to the call stack +#because godot has a limit until it crashes +var flood_fill_queue = 0 +func flood_fill(x, y, target_color, replacement_color): + #yield(get_tree().create_timer(1), "timeout") + flood_fill_queue += 1 + if not cell_in_canvas_region(x, y): + flood_fill_queue -= 1 + return + if target_color == replacement_color: + flood_fill_queue -= 1 + return + elif not get_pixel_cell_color(x, y) == target_color: + flood_fill_queue -= 1 + return + else: + set_pixel_cell(x, y, replacement_color) + if flood_fill_queue >= 500: + #print(flood_fill_queue) + yield(get_tree().create_timer(0.01), "timeout") + #up + if get_pixel_cell_color(x, y - 1) == target_color: + flood_fill(x, y - 1, target_color, replacement_color) + #down + if get_pixel_cell_color(x, y + 1) == target_color: + flood_fill(x, y + 1, target_color, replacement_color) + #left + if get_pixel_cell_color(x - 1, y) == target_color: + flood_fill(x - 1, y, target_color, replacement_color) + #right + if get_pixel_cell_color(x + 1, y) == target_color: + flood_fill(x + 1, y, target_color, replacement_color) + flood_fill_queue -= 1 + return + +#func flood_fill_erase(x, y, target_color): +# yield(get_tree().create_timer(0.001), "timeout") +# if not cell_in_canvas_region(x, y): +# print("cell not in canvas") +# return +# #if target_color == replacement_color: +# # return +# elif not get_pixel_cell_color(x, y) == target_color: +# print("cell doesn't match pixel color") +# return +# elif not get_pixel_cell(x, y): +# print("cell already erased") +# return +# else: +# print("removed pixel") +# remove_pixel_cell(x, y) +# print("x: ", x, " y: ", y, " color: ", target_color) +# #up +# flood_fill_erase(x, y - 1, target_color) +# #down +# flood_fill_erase(x, y + 1, target_color) +# #left +# flood_fill_erase(x - 1, y, target_color) +# #right +# flood_fill_erase(x + 1, y, target_color) +# return + +func cell_in_canvas_region(x, y): + if x > canvas_size.x - 1 or x < 0 or y > canvas_size.y - 1 or y < 0: + #out of bounds, return false + return false + else: + return true + +#Both of these functions right now just return the starting +#position of the canvas and the last position of the canvas +func get_all_used_regions_in_canvas(): + var first_used_region = get_first_used_region_in_canvas() + var last_used_region = get_last_used_region_in_canvas() + var chunk_pool = PoolVector2Array() + for chunk_x in range(first_used_region.x, last_used_region.x): + for chunk_y in range(first_used_region.y, last_used_region.y): + chunk_pool.append(Vector2(chunk_x, chunk_y)) + return chunk_pool + +func get_first_used_region_in_canvas(): + return get_region_from_cell(0, 0) + +func get_last_used_region_in_canvas(): + return get_region_from_cell(canvas_size.x - 1, canvas_size.y - 1) + +func get_cells_in_region(x, y): + var start_cell = Vector2(x * region_size, y * region_size) + var end_cell = Vector2((x * region_size) + region_size, (y * region_size) + region_size) + var cell_array = [] + for cx in range(start_cell.x, end_cell.x): + for cy in range(start_cell.y, end_cell.y): + var pixel_cell = get_pixel_cell(cx, cy) + if pixel_cell == null: + pixel_cell = [cx, cy, Color(0, 0, 0, 0)] + cell_array.append(pixel_cell) + return cell_array diff --git a/addons/Godoxel/PaintCanvas.tscn b/addons/Godoxel/PaintCanvas.tscn new file mode 100644 index 0000000..b2d66d1 --- /dev/null +++ b/addons/Godoxel/PaintCanvas.tscn @@ -0,0 +1,29 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://addons/Godoxel/PaintCanvas.gd" type="Script" id=1] + +[node name="PaintCanvas" type="Control"] +anchor_right = 1.0 +anchor_bottom = 1.0 +mouse_filter = 2 +script = ExtResource( 1 ) +__meta__ = { +"_edit_use_anchors_": false +} +canvas_size = Vector2( 0, 0 ) + +[node name="ChunkNodes" type="Control" parent="."] +anchor_right = 1.0 +anchor_bottom = 1.0 +mouse_filter = 2 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="CanvasImage" type="TextureRect" parent="."] +visible = false +anchor_right = 1.0 +anchor_bottom = 1.0 +mouse_filter = 2 +expand = true +stretch_mode = 3 diff --git a/addons/Godoxel/PaintCanvasChunk.gd b/addons/Godoxel/PaintCanvasChunk.gd new file mode 100644 index 0000000..3a49c02 --- /dev/null +++ b/addons/Godoxel/PaintCanvasChunk.gd @@ -0,0 +1,27 @@ +tool +extends Control + +var image = Image.new() +var image_texture = ImageTexture.new() + +func _ready(): + mouse_filter = Control.MOUSE_FILTER_IGNORE + +func setup(region_size): + image.create(region_size, region_size, true, Image.FORMAT_RGBA8) + image.lock() + +func update_chunk(): + image_texture.create_from_image(image) + image_texture.set_flags(0) + self.texture = image_texture + +func set_cell(x, y, color): + image.set_pixel(x, y, color) + update_chunk() + +func _on_VisibilityNotifier2D_screen_entered(): + visible = true + +func _on_VisibilityNotifier2D_screen_exited(): + visible = false diff --git a/addons/Godoxel/PaintCanvasChunk.tscn b/addons/Godoxel/PaintCanvasChunk.tscn new file mode 100644 index 0000000..1f2f2b0 --- /dev/null +++ b/addons/Godoxel/PaintCanvasChunk.tscn @@ -0,0 +1,13 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://addons/Godoxel/PaintCanvasChunk.gd" type="Script" id=1] + + +[node name="PaintCanvasChunk" type="TextureRect"] +margin_right = 10.0 +margin_bottom = 10.0 +rect_scale = Vector2( 16, 16 ) +mouse_filter = 2 +expand = true +stretch_mode = 1 +script = ExtResource( 1 ) diff --git a/addons/Godoxel/PaintCanvasContainer.gd b/addons/Godoxel/PaintCanvasContainer.gd new file mode 100644 index 0000000..34ca400 --- /dev/null +++ b/addons/Godoxel/PaintCanvasContainer.gd @@ -0,0 +1,2 @@ +tool +extends Control diff --git a/addons/Godoxel/PreviewWindow.gd b/addons/Godoxel/PreviewWindow.gd new file mode 100644 index 0000000..8150c7e --- /dev/null +++ b/addons/Godoxel/PreviewWindow.gd @@ -0,0 +1,14 @@ +extends GEDraggableWindow +tool + +onready var preview_layers = $PreviewLayerTextures + + +func _ready() -> void: + show() + + +func update_preview(frame: GEFrame): + for idx in range(preview_layers.get_child_count()): + preview_layers.get_child(idx).texture = frame.layers[idx].texture + diff --git a/addons/Godoxel/SaveFileDialog.gd b/addons/Godoxel/SaveFileDialog.gd new file mode 100644 index 0000000..b310820 --- /dev/null +++ b/addons/Godoxel/SaveFileDialog.gd @@ -0,0 +1,129 @@ +tool +extends FileDialog + +enum SaveMode { + CURRENT_FRAME, + PROJECT, + CURRENT_LAYER, +} + +var save_mode = SaveMode.CURRENT_FRAME +onready var canvas = get_parent().find_node("Canvas") +var file_path = "" + + +func _ready(): + # warning-ignore:return_value_discarded + get_line_edit().connect("text_entered", self, "_on_LineEdit_text_entered") + invalidate() + clear_filters() + add_filter("*.png ; PNG Images") + + + +####################################################### +# dialogs +####################################################### + +func open_save_current_frame(): + show() + invalidate() + clear_filters() + add_filter("*.png ; PNG Images") + save_mode = SaveMode.CURRENT_FRAME + + +func open_save_project(): + show() + invalidate() + clear_filters() + add_filter("*.godoxel ; Godot - Godoxel") + save_mode = SaveMode.PROJECT + + +func open_save_current_layer(): + show() + invalidate() + clear_filters() + add_filter("*.png ; PNG Images") + save_mode = SaveMode.CURRENT_LAYER + + + +####################################################### +# dialogs +####################################################### + +func _on_SaveFileDialog_file_selected(path: String): + file_path = path + match save_mode: + SaveMode.CURRENT_FRAME: + save_current_frame() + SaveMode.CURRENT_LAYER: + save_current_layer() + SaveMode.PROJECT: + save_project() + + +func save_current_layer(): + var image = canvas.get_current_layer_image() + + # overwrite image if exists + var dir = Directory.new() + if dir.file_exists(file_path): + dir.remove(file_path) + + image.save_png(file_path) + + # update file doc if using inside the editor + if Engine.is_editor_hint(): + EditorPlugin.new().get_editor_interface().get_resource_filesystem().scan() + + +func save_project(): + var save_data = owner.get_save_project_data() + + # overwrite image if exists + var dir = Directory.new() + if dir.file_exists(file_path): + dir.remove(file_path) + + var file = File.new() + file.open(file_path, File.WRITE) + file.store_string(JSON.print(save_data)) + file.close() + + # update file doc if using inside the editor + if Engine.is_editor_hint(): + EditorPlugin.new().get_editor_interface().get_resource_filesystem().scan() + + +func save_current_frame(): + var image = canvas.get_current_frame_image() + + # overwrite image if exists + var dir = Directory.new() + if dir.file_exists(file_path): + dir.remove(file_path) + + image.save_png(file_path) + + # update file doc if using inside the editor + if Engine.is_editor_hint(): + EditorPlugin.new().get_editor_interface().get_resource_filesystem().scan() + + +func _on_SaveFileDialog_about_to_show(): + invalidate() + + +func _on_SaveFileDialog_visibility_changed(): + invalidate() + + +#func _on_LineEdit_text_entered(text): +# return + + +func _on_SaveFileDialog_confirmed(): + return diff --git a/addons/Godoxel/SelectionBox.gd b/addons/Godoxel/SelectionBox.gd new file mode 100644 index 0000000..7ddfd2a --- /dev/null +++ b/addons/Godoxel/SelectionBox.gd @@ -0,0 +1,24 @@ +tool +extends Control + +export var outline_size = 3 + +func _ready(): + pass + +func _process(delta): + update() + +func _draw(): + if not rect_size == Vector2(): + draw_outline_box(rect_size, Color.gray, outline_size) + +func draw_outline_box(size, color, width): + #Top line + draw_line(Vector2(0 + 1, 0), Vector2(size.x, 0), color, width) + #Left line + draw_line(Vector2(0 + 1, 0), Vector2(0, size.y), color, width) + #Bottom line + draw_line(Vector2(0 + 1, size.y), Vector2(size.x, size.y), color, width) + #Right line + draw_line(Vector2(size.x, 0), Vector2(size.x, size.y), color, width) diff --git a/addons/Godoxel/Settings.gd b/addons/Godoxel/Settings.gd new file mode 100644 index 0000000..8657585 --- /dev/null +++ b/addons/Godoxel/Settings.gd @@ -0,0 +1,24 @@ +tool +extends Control + +var editor +var canvas_outline +var start_time +var end_time + + +func _enter_tree(): + canvas_outline = get_parent().find_node("CanvasOutline") + editor = get_parent() + + +func _on_ColorPickerButton_color_changed(color): + canvas_outline.color = color + + +func _on_CheckButton_toggled(button_pressed): + canvas_outline.visible = button_pressed + + +func _on_Ok_pressed(): + hide() diff --git a/addons/Godoxel/Settings.tscn b/addons/Godoxel/Settings.tscn new file mode 100644 index 0000000..f2d9c24 --- /dev/null +++ b/addons/Godoxel/Settings.tscn @@ -0,0 +1,64 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://addons/Godoxel/Settings.gd" type="Script" id=1] + + +[node name="Settings" type="WindowDialog"] +visible = true +margin_top = 20.0 +margin_right = 300.0 +margin_bottom = 120.0 +window_title = "Settings" +script = ExtResource( 1 ) + +[node name="Ok" type="Button" parent="."] +margin_left = 210.0 +margin_top = 70.0 +margin_right = 290.0 +margin_bottom = 90.0 +text = "Ok" + +[node name="CanvasOutlineToggle" type="Control" parent="."] +margin_left = 10.0 +margin_top = 10.0 +margin_right = 290.0 +margin_bottom = 30.0 +__meta__ = { +"_edit_group_": true +} + +[node name="Label" type="Label" parent="CanvasOutlineToggle"] +margin_right = 130.0 +margin_bottom = 20.0 +text = "Canvas Outline:" +valign = 1 + +[node name="CheckButton" type="CheckButton" parent="CanvasOutlineToggle"] +margin_left = 210.0 +margin_top = -10.0 +margin_right = 286.0 +margin_bottom = 30.0 +pressed = true + +[node name="CanvasOutlineColor" type="Control" parent="."] +margin_left = 10.0 +margin_top = 40.0 +margin_right = 290.0 +margin_bottom = 60.0 +__meta__ = { +"_edit_group_": true +} + +[node name="Label" type="Label" parent="CanvasOutlineColor"] +margin_right = 130.0 +margin_bottom = 20.0 +text = "Canvas Outline Color:" +valign = 1 + +[node name="ColorPickerButton" type="ColorPickerButton" parent="CanvasOutlineColor"] +margin_left = 170.0 +margin_right = 280.0 +margin_bottom = 20.0 +[connection signal="pressed" from="Ok" to="." method="_on_Ok_pressed"] +[connection signal="toggled" from="CanvasOutlineToggle/CheckButton" to="." method="_on_CheckButton_toggled"] +[connection signal="color_changed" from="CanvasOutlineColor/ColorPickerButton" to="." method="_on_ColorPickerButton_color_changed"] diff --git a/addons/Godoxel/TextInfo.gd b/addons/Godoxel/TextInfo.gd new file mode 100644 index 0000000..e9368e1 --- /dev/null +++ b/addons/Godoxel/TextInfo.gd @@ -0,0 +1,39 @@ +tool +extends Control + +var size = 240 + +#TODO: To make reading the text easier, the text info with the longest text should have it's length applied to all the +#the other text infos + +func add_text_info(text_name, custom_node = null): + var last_text_info_child = null + var child_count = get_child_count() + if not child_count <= 0: + last_text_info_child = get_children()[get_children().size() - 1] + var label = Label.new() + label.name = text_name + label.rect_size = Vector2(size, 14) + if not last_text_info_child == null: + var x = last_text_info_child.rect_position.x + var y = last_text_info_child.rect_position.y + var temp_size = size + if child_count == 4: + x = 0 + y = 20 + temp_size = 0 + label.rect_position = Vector2(x + temp_size, y) + if not custom_node == null: + label.add_child(custom_node) + add_child(label) + +func update_text_info(text_name, text_value = null, node = null, node_target_value = null, node_value = null): + var text_label = self.get_node(text_name) + if text_label == null: + return + if not node == null: + get_node(text_name).get_node(node).set(node_target_value, node_value) + if text_value == null: + text_label.text = "%s: %s" % [text_name, null] + else: + text_label.text = "%s: %s" % [text_name, String(text_value)] diff --git a/addons/Godoxel/Util.gd b/addons/Godoxel/Util.gd new file mode 100644 index 0000000..d2246a5 --- /dev/null +++ b/addons/Godoxel/Util.gd @@ -0,0 +1,94 @@ +tool +extends Node +class_name GEUtils + + +static func get_pixels_in_line(from: Vector2, to: Vector2): + var dx = to[0] - from[0] + var dy = to[1] - from[1] + var nx = abs(dx) + var ny = abs(dy) + var signX = sign(dx) + var signY = sign(dy) + var p = from + var points : Array = [p] + + var ix = 0 + var iy = 0 + + while ix < nx || iy < ny: + if (1 + (ix << 1)) * ny < (1 + (iy << 1)) * nx: + p[0] += signX + ix +=1 + else: + p[1] += signY + iy += 1 + points.append(p) + return points + + +static func to_1D_v(p, w) -> int: + return p.x + p.y * w + + +static func to_1D(x, y, w) -> int: + return x + y * w + + +static func to_2D(idx, w) -> Vector2: + var p = Vector2() + p.x = int(idx) % int(w) + p.y = int(idx / w) + return p + + + +static func color_from_array(color_array): + var r = color_array[0] + var g = color_array[1] + var b = color_array[2] + var a = color_array[3] + return Color(r, g, b, a) + +static func random_color(): + return Color(randf(), randf(), randf()) + +static func random_color_alt(): + var rand = randi() % 6 + + match rand: + #red + 0: + return Color.red + #blue + 1: + return Color.blue + #green + 2: + return Color.green + #orange + 3: + return Color.orange + #yellow + 4: + return Color.yellow + #purple + 5: + return Color.purple + +static func get_line_string(file, number): + return file.get_as_text().split("\n")[number - 1].strip_edges() + +static func printv(variable): + var stack = get_stack()[get_stack().size() - 1] + var line = stack.line + var source = stack.source + var file = File.new() + file.open(source, File.READ) + var line_string = get_line_string(file, line) + file.close() + var left_p = line_string.find("(") + var left_p_string = line_string.right(left_p + 1) + var right_p = left_p_string.find(")") + var variable_name = left_p_string.left(right_p) + print("%s: %s" % [variable_name, variable]) diff --git a/addons/Godoxel/ViewportContainer.gd b/addons/Godoxel/ViewportContainer.gd new file mode 100644 index 0000000..5ff1df6 --- /dev/null +++ b/addons/Godoxel/ViewportContainer.gd @@ -0,0 +1,6 @@ +extends ViewportContainer +tool + +func _ready(): + get_child(0).size = rect_size + diff --git a/addons/Godoxel/VisualGrid.gd b/addons/Godoxel/VisualGrid.gd new file mode 100644 index 0000000..a935a15 --- /dev/null +++ b/addons/Godoxel/VisualGrid.gd @@ -0,0 +1,41 @@ +tool +extends Control + +export var color = Color() +export var size:int = 16 +export var zoom = 0 +export var offset = Vector2(0, 0) + + +func _enter_tree(): + set_process(true) + + +func _draw(): + if size == 0: + size = 1 + + var temp_size = size + zoom + + var wrap_offset = Vector2(wrapf(offset.x, 0, temp_size), wrapf(offset.y, 0, temp_size)) + + var ceil_x = ceil(rect_size.x / temp_size) + var ceil_y = ceil(rect_size.y / temp_size) + + for i in ceil_y: + var start_x = Vector2(0, (i * temp_size) + wrap_offset.y) + var end_x = Vector2(rect_size.x, (i * temp_size) + wrap_offset.y) +# var end_x = Vector2(int(rect_size.x) + size - int(rect_size.x) % size, (i * temp_size) + wrap_offset.y) + draw_line(start_x, end_x, color, 1) + + for i in ceil_x: + var start_y = Vector2((i * temp_size) + wrap_offset.x, 0) + var end_y = Vector2((i * temp_size) + (wrap_offset.x), rect_size.y) +# var end_y = Vector2((i * temp_size) + (wrap_offset.x), int(rect_size.y) + size - int(rect_size.y) % size) + draw_line(start_y, end_y, color, 1) + + +func _process(delta): + if not is_visible_in_tree(): + return + update() diff --git a/addons/Godoxel/VisualGrid.tscn b/addons/Godoxel/VisualGrid.tscn new file mode 100644 index 0000000..ac8345a --- /dev/null +++ b/addons/Godoxel/VisualGrid.tscn @@ -0,0 +1,9 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://addons/Godoxel/VisualGrid.gd" type="Script" id=1] + + +[node name="VisualGrid" type="Control"] +anchor_right = 1.0 +anchor_bottom = 1.0 +script = ExtResource( 1 ) diff --git a/addons/Godoxel/actions/Action.gd b/addons/Godoxel/actions/Action.gd new file mode 100644 index 0000000..97292c2 --- /dev/null +++ b/addons/Godoxel/actions/Action.gd @@ -0,0 +1,123 @@ +extends Node +class_name GEAction + + +var action_data = {} + + +func _init(): + action_data["redo"] = {} + action_data["undo"] = {} + action_data["preview"] = {} + + +func do_action(canvas, data: Array): + if not "cells" in action_data.redo: + action_data.redo["cells"] = [] + action_data.redo["colors"] = [] + + if not "cells" in action_data.undo: + action_data.undo["cells"] = [] + action_data.undo["colors"] = [] + + if not "cells" in action_data.preview: + action_data.preview["cells"] = [] + action_data.preview["colors"] = [] + + if not "layer" in action_data: + action_data["layer"] = canvas.active_layer + + +func commit_action(canvas): + print("NO IMPL commit_action ") + return [] + + +func undo_action(canvas): + print("NO IMPL undo_action ") + + +func redo_action(canvas): + print("NO IMPL redo_action ") + + +func can_commit() -> bool: + return not action_data.redo.empty() + + +func get_x_sym_points(canvas_width, pixel): + var p = int(canvas_width - pixel.x) + var all_points = [pixel, Vector2(p-1, pixel.y)] + + var points :Array = [] + for point in all_points: + if point in points: + continue + points.append(point) + return points + + +func get_y_sym_points(canvas_height, pixel): + var p = int(canvas_height - pixel.y) + var all_points = [pixel, Vector2(pixel.x, p-1)] + + var points :Array = [] + for point in all_points: + if point in points: + continue + points.append(point) + return points + + +func get_xy_sym_points(canvas_width, canvas_height, pixel): + var all_points = [] + var xpoints = get_x_sym_points(canvas_width, pixel) + + all_points += get_y_sym_points(canvas_height, xpoints[0]) + all_points += get_y_sym_points(canvas_height, xpoints[1]) + + var points :Array = [] + for point in all_points: + if point in points: + continue + points.append(point) + + return points + + +func get_points(canvas, pixel): + var points = [] + if canvas.symmetry_x and canvas.symmetry_y: + var sym_points = get_xy_sym_points(canvas.canvas_width, canvas.canvas_height, pixel) + for point in sym_points: + if point in action_data.undo.cells or canvas.get_pixel_v(point) == null: + continue + if canvas.is_alpha_locked() and canvas.get_pixel_v(pixel) == Color.transparent: + continue + points.append(point) + elif canvas.symmetry_y: + var sym_points = get_y_sym_points(canvas.canvas_height, pixel) + for point in sym_points: + if point in action_data.undo.cells or canvas.get_pixel_v(point) == null: + continue + if canvas.is_alpha_locked() and canvas.get_pixel_v(pixel) == Color.transparent: + continue + points.append(point) + elif canvas.symmetry_x: + var sym_points = get_x_sym_points(canvas.canvas_width, pixel) + for point in sym_points: + if point in action_data.undo.cells or canvas.get_pixel_v(point) == null: + continue + if canvas.is_alpha_locked() and canvas.get_pixel_v(pixel) == Color.transparent: + continue + points.append(point) + else: + if pixel in action_data.undo.cells or canvas.get_pixel_v(pixel) == null: + return [] + if canvas.is_alpha_locked() and canvas.get_pixel_v(pixel) == Color.transparent: + return [] + points.append(pixel) + + return points + + diff --git a/addons/Godoxel/actions/Brighten.gd b/addons/Godoxel/actions/Brighten.gd new file mode 100644 index 0000000..faf7f81 --- /dev/null +++ b/addons/Godoxel/actions/Brighten.gd @@ -0,0 +1,53 @@ +extends GEAction +class_name GEBrighten + + +const brighten_color = 0.1 + + +func do_action(canvas, data: Array): + .do_action(canvas, data) + + var pixels = GEUtils.get_pixels_in_line(data[0], data[1]) + for pixel in pixels: + if canvas.get_pixel_v(pixel) == null: + continue + + if canvas.is_alpha_locked() and canvas.get_pixel_v(pixel) == Color.transparent: + continue + + if pixel in action_data.undo.cells: + var brightened_color = canvas.get_pixel_v(pixel).lightened(0.1) + canvas.set_pixel_v(pixel, brightened_color) + + action_data.redo.cells.append(pixel) + action_data.redo.colors.append(brightened_color) + continue + + action_data.undo.colors.append(canvas.get_pixel_v(pixel)) + action_data.undo.cells.append(pixel) + var brightened_color = canvas.get_pixel_v(pixel).lightened(0.1) + canvas.set_pixel_v(pixel, brightened_color) + + action_data.redo.cells.append(pixel) + action_data.redo.colors.append(brightened_color) + + +func commit_action(canvas): + var cells = action_data.redo.cells + var colors = action_data.redo.colors + return [] + + +func undo_action(canvas): + var cells = action_data.undo.cells + var colors = action_data.undo.colors + for idx in range(cells.size()): + canvas._set_pixel_v(action_data.layer, cells[idx], colors[idx]) + + +func redo_action(canvas): + var cells = action_data.redo.cells + var colors = action_data.redo.colors + for idx in range(cells.size()): + canvas._set_pixel_v(action_data.layer, cells[idx], colors[idx]) diff --git a/addons/Godoxel/actions/Brush.gd b/addons/Godoxel/actions/Brush.gd new file mode 100644 index 0000000..edeccaf --- /dev/null +++ b/addons/Godoxel/actions/Brush.gd @@ -0,0 +1,47 @@ +extends GEAction +class_name GEBrush + + +func do_action(canvas: GECanvas, data: Array): + .do_action(canvas, data) + + for pixel in GEUtils.get_pixels_in_line(data[0], data[1]): + for off in BrushPrefabs.get_brush(data[3], data[4]): + var p = pixel + off + + if p in action_data.undo.cells or canvas.get_pixel_v(p) == null: + continue + + if canvas.is_alpha_locked() and canvas.get_pixel_v(p) == Color.transparent: + continue + + action_data.undo.colors.append(canvas.get_pixel_v(p)) + action_data.undo.cells.append(p) + + canvas.set_pixel_v(p, data[2]) + + action_data.redo.cells.append(p) + action_data.redo.colors.append(data[2]) + + +func commit_action(canvas): + var cells = action_data.redo.cells + var colors = action_data.redo.colors + return [] + + +func undo_action(canvas): + var cells = action_data.undo.cells + var colors = action_data.undo.colors + for idx in range(cells.size()): + canvas._set_pixel_v(action_data.layer, cells[idx], colors[idx]) + + +func redo_action(canvas): + var cells = action_data.redo.cells + var colors = action_data.redo.colors + for idx in range(cells.size()): + canvas._set_pixel_v(action_data.layer, cells[idx], colors[idx]) + + + diff --git a/addons/Godoxel/actions/Bucket.gd b/addons/Godoxel/actions/Bucket.gd new file mode 100644 index 0000000..8ff2f90 --- /dev/null +++ b/addons/Godoxel/actions/Bucket.gd @@ -0,0 +1,49 @@ +extends GEAction +class_name GEBucket + + + +func do_action(canvas, data: Array): + .do_action(canvas, data) + + if canvas.get_pixel_v(data[0]) == data[2]: + return + var pixels = canvas.select_same_color(data[0].x, data[0].y) + + for pixel in pixels: + if pixel in action_data.undo.cells: + continue + + if canvas.is_alpha_locked() and canvas.get_pixel_v(pixel) == Color.transparent: + continue + + action_data.undo.colors.append(canvas.get_pixel_v(pixel)) + action_data.undo.cells.append(pixel) + + canvas.set_pixel_v(pixel, data[2]) + + action_data.redo.cells.append(pixel) + action_data.redo.colors.append(data[2]) + + +func commit_action(canvas): + var cells = action_data.preview.cells + var colors = action_data.preview.colors + return [] + + +func undo_action(canvas): + var cells = action_data.undo.cells + var colors = action_data.undo.colors + for idx in range(cells.size()): + canvas._set_pixel_v(action_data.layer, cells[idx], colors[idx]) + + +func redo_action(canvas): + var cells = action_data.redo.cells + var colors = action_data.redo.colors + for idx in range(cells.size()): + canvas._set_pixel_v(action_data.layer, cells[idx], colors[idx]) + + + diff --git a/addons/Godoxel/actions/Cut.gd b/addons/Godoxel/actions/Cut.gd new file mode 100644 index 0000000..4f60815 --- /dev/null +++ b/addons/Godoxel/actions/Cut.gd @@ -0,0 +1,82 @@ +extends GEAction +class_name GECut + +const selection_color = Color(0.8, 0.8, 0.8, 0.5) +var mouse_start_pos = null +var mouse_end_pos = null + + +func can_commit() -> bool: + return false #ugly way of handling a cut + + +func do_action(canvas, data: Array): + .do_action(canvas, data) + + if mouse_start_pos == null: + mouse_start_pos = data[0] + mouse_end_pos = data[0] + + action_data.preview.cells.clear() + action_data.preview.colors.clear() + canvas.clear_preview_layer() + + var p = mouse_start_pos + var s = mouse_end_pos - mouse_start_pos + + var pixels = GEUtils.get_pixels_in_line(p, p + Vector2(s.x, 0)) + pixels += GEUtils.get_pixels_in_line(p, p + Vector2(0, s.y)) + pixels += GEUtils.get_pixels_in_line(p + s, p + s + Vector2(0, -s.y)) + pixels += GEUtils.get_pixels_in_line(p + s, p + s + Vector2(-s.x, 0)) + + for pixel in pixels: + canvas.set_preview_pixel_v(pixel, selection_color) + action_data.preview.cells.append(pixel) + action_data.preview.colors.append(selection_color) + + +func commit_action(canvas): + canvas.clear_preview_layer() + var p = mouse_start_pos + var s = mouse_end_pos - mouse_start_pos + + for x in range(abs(s.x)+1): + for y in range(abs(s.y)+1): + var px = x + var py = y + if s.x < 0: + px *= -1 + if s.y < 0: + py *= -1 + + var pos = p + Vector2(px, py) + var color = canvas.get_pixel(pos.x, pos.y) + + if color == null or color.a == 0.0: + continue + + action_data.redo.cells.append(pos) + action_data.redo.colors.append(canvas.get_pixel_v(pos)) + + canvas.set_pixel_v(pos, Color.transparent) + + action_data.undo.cells.append(pos) + action_data.undo.colors.append(Color.transparent) + return [] + + +func undo_action(canvas): + var cells = action_data.undo.cells + var colors = action_data.undo.colors + for idx in range(cells.size()): + canvas._set_pixel_v(action_data.layer, cells[idx], colors[idx]) + + +func redo_action(canvas): + var cells = action_data.redo.cells + var colors = action_data.redo.colors + for idx in range(cells.size()): + canvas._set_pixel_v(action_data.layer, cells[idx], colors[idx]) + + + diff --git a/addons/Godoxel/actions/Darken.gd b/addons/Godoxel/actions/Darken.gd new file mode 100644 index 0000000..3832a17 --- /dev/null +++ b/addons/Godoxel/actions/Darken.gd @@ -0,0 +1,55 @@ +extends GEAction +class_name GEDarken + +const dark_factor = 0.1 + + +func do_action(canvas, data: Array): + .do_action(canvas, data) + + var pixels = GEUtils.get_pixels_in_line(data[0], data[1]) + for pixel in pixels: + if canvas.get_pixel_v(pixel) == null: + continue + + if canvas.is_alpha_locked() and canvas.get_pixel_v(pixel) == Color.transparent: + continue + + if pixel in action_data.undo.cells: + var darkened_color = canvas.get_pixel_v(pixel).darkened(dark_factor) + canvas.set_pixel_v(pixel, darkened_color) + + action_data.redo.cells.append(pixel) + action_data.redo.colors.append(darkened_color) + continue + + action_data.undo.colors.append(canvas.get_pixel_v(pixel)) + action_data.undo.cells.append(pixel) + var darkened_color = canvas.get_pixel_v(pixel).darkened(dark_factor) + canvas.set_pixel_v(pixel, darkened_color) + + action_data.redo.cells.append(pixel) + action_data.redo.colors.append(darkened_color) + + +func commit_action(canvas): + var cells = action_data.redo.cells + var colors = action_data.redo.colors + return [] + + +func undo_action(canvas): + var cells = action_data.undo.cells + var colors = action_data.undo.colors + for idx in range(cells.size()): + canvas._set_pixel_v(action_data.layer, cells[idx], colors[idx]) + + +func redo_action(canvas): + var cells = action_data.redo.cells + var colors = action_data.redo.colors + for idx in range(cells.size()): + canvas._set_pixel_v(action_data.layer, cells[idx], colors[idx]) + + + diff --git a/addons/Godoxel/actions/Line.gd b/addons/Godoxel/actions/Line.gd new file mode 100644 index 0000000..6f17316 --- /dev/null +++ b/addons/Godoxel/actions/Line.gd @@ -0,0 +1,59 @@ +extends GEAction +class_name GELine + + +var mouse_start_pos = null + +func do_action(canvas, data: Array): + .do_action(canvas, data) + + if mouse_start_pos == null: + mouse_start_pos = data[0] + + action_data.preview.cells.clear() + action_data.preview.colors.clear() + canvas.clear_preview_layer() + + var pixels = GEUtils.get_pixels_in_line(data[0], mouse_start_pos) + for pixel in pixels: + if canvas.is_alpha_locked() and canvas.get_pixel_v(pixel) == Color.transparent: + continue + + canvas.set_preview_pixel_v(pixel, data[2]) + action_data.preview.cells.append(pixel) + action_data.preview.colors.append(data[2]) + + +func commit_action(canvas): + canvas.clear_preview_layer() + var cells = action_data.preview.cells + var colors = action_data.preview.colors + for idx in range(cells.size()): + if canvas.get_pixel_v(cells[idx]) == null: + continue + action_data.undo.cells.append(cells[idx]) + action_data.undo.colors.append(canvas.get_pixel_v(cells[idx])) + + canvas.set_pixel_v(cells[idx], colors[idx]) + + action_data.redo.cells.append(cells[idx]) + action_data.redo.colors.append(colors[idx]) + mouse_start_pos = null + return [] + + +func undo_action(canvas): + var cells = action_data.undo.cells + var colors = action_data.undo.colors + for idx in range(cells.size()): + canvas._set_pixel_v(action_data.layer, cells[idx], colors[idx]) + + +func redo_action(canvas): + var cells = action_data.redo.cells + var colors = action_data.redo.colors + for idx in range(cells.size()): + canvas._set_pixel_v(action_data.layer, cells[idx], colors[idx]) + + + diff --git a/addons/Godoxel/actions/MultiLine.gd b/addons/Godoxel/actions/MultiLine.gd new file mode 100644 index 0000000..b3850ff --- /dev/null +++ b/addons/Godoxel/actions/MultiLine.gd @@ -0,0 +1,44 @@ +extends GEAction +class_name GEMultiLine + + +func can_commit() -> bool: + return false + + +func update_action(canvas, data: Array): + .update_action(canvas, data) + + var pixels = GEUtils.get_pixels_in_line(data[0], data[1]) + for pixel in pixels: + if pixel in action_data.undo.cells or canvas.get_pixel_v(pixel) == null or canvas.is_alpha_locked(): + continue + action_data.undo.colors.append(canvas.get_pixel_v(pixel)) + action_data.undo.cells.append(pixel) + canvas.set_pixel_v(pixel, data[2]) + + action_data.redo.cells.append(pixel) + action_data.redo.colors.append(data[2]) + + +func commit_action(canvas): + var cells = action_data.redo.cells + var colors = action_data.redo.colors + return [] + + +func undo_action(canvas): + var cells = action_data.undo.cells + var colors = action_data.undo.colors + for idx in range(cells.size()): + canvas._set_pixel_v(action_data.layer, cells[idx], colors[idx]) + + +func redo_action(canvas): + var cells = action_data.redo.cells + var colors = action_data.redo.colors + for idx in range(cells.size()): + canvas._set_pixel_v(action_data.layer, cells[idx], colors[idx]) + + + diff --git a/addons/Godoxel/actions/PasteCut.gd b/addons/Godoxel/actions/PasteCut.gd new file mode 100644 index 0000000..5ffaa8e --- /dev/null +++ b/addons/Godoxel/actions/PasteCut.gd @@ -0,0 +1,59 @@ +extends GEAction +class_name GEPasteCut + + +#data[2] = selection_pos +#data[3] = selection_color +#data[4] = cut pos +#data[5] = cut size +func do_action(canvas, data: Array): + .do_action(canvas, data) + + for pixel_pos in GEUtils.get_pixels_in_line(data[0], data[1]): + for idx in range(data[2].size()): + var pixel = data[2][idx] + var color = data[3][idx] + pixel -= data[4] + data[5] / 2 + pixel += pixel_pos + + if canvas.get_pixel_v(pixel) == null: + continue + + if canvas.is_alpha_locked() and canvas.get_pixel_v(pixel) == Color.transparent: + continue + + var found = action_data.redo.cells.find(pixel) + if found == -1: + action_data.redo.cells.append(pixel) + action_data.redo.colors.append(color) + else: + action_data.redo.colors[found] = color + + found = action_data.undo.cells.find(pixel) + if found == -1: + action_data.undo.colors.append(canvas.get_pixel_v(pixel)) + action_data.undo.cells.append(pixel) + + canvas.set_pixel_v(pixel, color) + + +func commit_action(canvas): + canvas.clear_preview_layer() + return [] + + +func undo_action(canvas): + var cells = action_data.undo.cells + var colors = action_data.undo.colors + for idx in range(cells.size()): + canvas._set_pixel_v(action_data.layer, cells[idx], colors[idx]) + + +func redo_action(canvas): + var cells = action_data.redo.cells + var colors = action_data.redo.colors + for idx in range(cells.size()): + canvas._set_pixel_v(action_data.layer, cells[idx], colors[idx]) + + + diff --git a/addons/Godoxel/actions/Pencil.gd b/addons/Godoxel/actions/Pencil.gd new file mode 100644 index 0000000..906236f --- /dev/null +++ b/addons/Godoxel/actions/Pencil.gd @@ -0,0 +1,43 @@ +extends GEAction +class_name GEPencil + + +func do_action(canvas, data: Array): + .do_action(canvas, data) + + var pixels = GEUtils.get_pixels_in_line(data[0], data[1]) + for pixel in pixels: + for p in get_points(canvas, pixel): + _set_pixel(canvas, p, data[2]) + + +func _set_pixel(canvas, pixel, color): + action_data.undo.colors.append(canvas.get_pixel_v(pixel)) + action_data.undo.cells.append(pixel) + canvas.set_pixel_v(pixel, color) + + action_data.redo.cells.append(pixel) + action_data.redo.colors.append(color) + + +func commit_action(canvas): + var cells = action_data.redo.cells + var colors = action_data.redo.colors + return [] + + +func undo_action(canvas): + var cells = action_data.undo.cells + var colors = action_data.undo.colors + for idx in range(cells.size()): + canvas._set_pixel_v(action_data.layer, cells[idx], colors[idx]) + + +func redo_action(canvas): + var cells = action_data.redo.cells + var colors = action_data.redo.colors + for idx in range(cells.size()): + canvas._set_pixel_v(action_data.layer, cells[idx], colors[idx]) + + + diff --git a/addons/Godoxel/actions/Rainbow.gd b/addons/Godoxel/actions/Rainbow.gd new file mode 100644 index 0000000..618bdd1 --- /dev/null +++ b/addons/Godoxel/actions/Rainbow.gd @@ -0,0 +1,58 @@ +extends GEAction +class_name GERainbow + + +func do_action(canvas, data: Array): + .do_action(canvas, data) + + var pixels = GEUtils.get_pixels_in_line(data[0], data[1]) + for pixel in pixels: + if canvas.get_pixel_v(pixel) == null: + continue + + if canvas.is_alpha_locked() and canvas.get_pixel_v(pixel) == Color.transparent: + continue + + if pixel in action_data.undo.cells: + var color = GEUtils.random_color() + canvas.set_pixel_v(pixel, color) + + var idx = action_data.redo.cells.find(pixel) + action_data.redo.cells.remove(idx) + action_data.redo.colors.remove(idx) + + action_data.redo.cells.append(pixel) + action_data.redo.colors.append(color) + continue + + action_data.undo.colors.append(canvas.get_pixel_v(pixel)) + action_data.undo.cells.append(pixel) + + var color = GEUtils.random_color() + canvas.set_pixel_v(pixel, color) + + action_data.redo.cells.append(pixel) + action_data.redo.colors.append(color) + + +func commit_action(canvas): + var cells = action_data.redo.cells + var colors = action_data.redo.colors + return [] + + +func undo_action(canvas): + var cells = action_data.undo.cells + var colors = action_data.undo.colors + for idx in range(cells.size()): + canvas._set_pixel_v(action_data.layer, cells[idx], colors[idx]) + + +func redo_action(canvas): + var cells = action_data.redo.cells + var colors = action_data.redo.colors + for idx in range(cells.size()): + canvas._set_pixel_v(action_data.layer, cells[idx], colors[idx]) + + + diff --git a/addons/Godoxel/actions/Rect.gd b/addons/Godoxel/actions/Rect.gd new file mode 100644 index 0000000..770e28b --- /dev/null +++ b/addons/Godoxel/actions/Rect.gd @@ -0,0 +1,69 @@ +extends GEAction +class_name GERect + + +var mouse_start_pos = null + +func do_action(canvas, data: Array): + .do_action(canvas, data) + + if mouse_start_pos == null: + mouse_start_pos = data[0] + #print("init:", mouse_start_pos) + + + action_data.undo.cells.clear() + action_data.undo.colors.clear() + action_data.preview.cells.clear() + action_data.preview.colors.clear() + canvas.clear_preview_layer() + + var p = mouse_start_pos + var s = data[0] - mouse_start_pos + var pixels = GEUtils.get_pixels_in_line(p, p + Vector2(s.x, 0)) + pixels += GEUtils.get_pixels_in_line(p, p + Vector2(0, s.y)) + pixels += GEUtils.get_pixels_in_line(p + s, p + s + Vector2(0, -s.y)) + pixels += GEUtils.get_pixels_in_line(p + s, p + s + Vector2(-s.x, 0)) + + for pixel in pixels: + if canvas.get_pixel_v(pixel) == null: + continue + + if canvas.is_alpha_locked() and canvas.get_pixel_v(pixel) == Color.transparent: + continue + + canvas.set_preview_pixel_v(pixel, data[2]) + action_data.undo.cells.append(pixel) + action_data.undo.colors.append(canvas.get_pixel_v(pixel)) + action_data.preview.cells.append(pixel) + action_data.preview.colors.append(data[2]) + + +func commit_action(canvas): + canvas.clear_preview_layer() + var cells = action_data.preview.cells + var colors = action_data.preview.colors + for idx in range(cells.size()): + canvas.set_pixel_v(cells[idx], colors[idx]) + + action_data.redo.cells.append(cells[idx]) + action_data.redo.colors.append(colors[idx]) + mouse_start_pos = null + return [] + + +func undo_action(canvas): + var cells = action_data.undo.cells + var colors = action_data.undo.colors + for idx in range(cells.size()): + canvas._set_pixel_v(action_data.layer, cells[idx], colors[idx]) + + +func redo_action(canvas): + var cells = action_data.redo.cells + var colors = action_data.redo.colors + for idx in range(cells.size()): + canvas._set_pixel_v(action_data.layer, cells[idx], colors[idx]) + + + diff --git a/addons/Godoxel/assets/BrushCircle.png b/addons/Godoxel/assets/BrushCircle.png new file mode 100644 index 0000000..994f4ac --- /dev/null +++ b/addons/Godoxel/assets/BrushCircle.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:34cae0d90dd86270b0b2d5cb5e9d461d91a2c39c060d397094059f9a28d2f57f +size 195 diff --git a/addons/Godoxel/assets/BrushCircle.png.import b/addons/Godoxel/assets/BrushCircle.png.import new file mode 100644 index 0000000..6c0c697 --- /dev/null +++ b/addons/Godoxel/assets/BrushCircle.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/BrushCircle.png-dd250909fee7964ffc38f7e4fcfe9c07.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/Godoxel/assets/BrushCircle.png" +dest_files=[ "res://.import/BrushCircle.png-dd250909fee7964ffc38f7e4fcfe9c07.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/addons/Godoxel/assets/BrushCircle_Hovered.png b/addons/Godoxel/assets/BrushCircle_Hovered.png new file mode 100644 index 0000000..b1d1dc4 --- /dev/null +++ b/addons/Godoxel/assets/BrushCircle_Hovered.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:36d8248278e07c92ffec9d673e42a6fbde4357ca913f992ebed6a27f147fac5b +size 3413 diff --git a/addons/Godoxel/assets/BrushCircle_Hovered.png.import b/addons/Godoxel/assets/BrushCircle_Hovered.png.import new file mode 100644 index 0000000..262712b --- /dev/null +++ b/addons/Godoxel/assets/BrushCircle_Hovered.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/BrushCircle_Hovered.png-ae1a4d835af51e8a293b71d6a241b71c.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/Godoxel/assets/BrushCircle_Hovered.png" +dest_files=[ "res://.import/BrushCircle_Hovered.png-ae1a4d835af51e8a293b71d6a241b71c.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/addons/Godoxel/assets/BrushHLine.png b/addons/Godoxel/assets/BrushHLine.png new file mode 100644 index 0000000..5b148cb --- /dev/null +++ b/addons/Godoxel/assets/BrushHLine.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8af5a36a1a9ad1db6593cfe6d5d755b408ad7ffd82ca4a4a31b0c1b9c208d05b +size 127 diff --git a/addons/Godoxel/assets/BrushHLine.png.import b/addons/Godoxel/assets/BrushHLine.png.import new file mode 100644 index 0000000..dc4eaf1 --- /dev/null +++ b/addons/Godoxel/assets/BrushHLine.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/BrushHLine.png-9182ec8ac804af16d356bf911782e299.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/Godoxel/assets/BrushHLine.png" +dest_files=[ "res://.import/BrushHLine.png-9182ec8ac804af16d356bf911782e299.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/addons/Godoxel/assets/BrushHLine_Hovered.png b/addons/Godoxel/assets/BrushHLine_Hovered.png new file mode 100644 index 0000000..41961de --- /dev/null +++ b/addons/Godoxel/assets/BrushHLine_Hovered.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5205a28621d8bd821f9ac55dd3646fd1b2ea68cb18c4777205fe4861b8447f70 +size 1930 diff --git a/addons/Godoxel/assets/BrushHLine_Hovered.png.import b/addons/Godoxel/assets/BrushHLine_Hovered.png.import new file mode 100644 index 0000000..a5a460b --- /dev/null +++ b/addons/Godoxel/assets/BrushHLine_Hovered.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/BrushHLine_Hovered.png-e51d5f3c1628c510a225057f3ed60d5a.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/Godoxel/assets/BrushHLine_Hovered.png" +dest_files=[ "res://.import/BrushHLine_Hovered.png-e51d5f3c1628c510a225057f3ed60d5a.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/addons/Godoxel/assets/BrushRect.png b/addons/Godoxel/assets/BrushRect.png new file mode 100644 index 0000000..6c8bf46 --- /dev/null +++ b/addons/Godoxel/assets/BrushRect.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dae20c1d91fb189b8661b0cd16672f4db394f0aa5c9d2676cf4204d3af1e487f +size 128 diff --git a/addons/Godoxel/assets/BrushRect.png.import b/addons/Godoxel/assets/BrushRect.png.import new file mode 100644 index 0000000..73e3317 --- /dev/null +++ b/addons/Godoxel/assets/BrushRect.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/BrushRect.png-2b2d0ae4889c1fbc5c7bee7ae5515663.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/Godoxel/assets/BrushRect.png" +dest_files=[ "res://.import/BrushRect.png-2b2d0ae4889c1fbc5c7bee7ae5515663.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/addons/Godoxel/assets/BrushRect_Hovered.png b/addons/Godoxel/assets/BrushRect_Hovered.png new file mode 100644 index 0000000..f5cbe08 --- /dev/null +++ b/addons/Godoxel/assets/BrushRect_Hovered.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4518db3eafa9fb90ac3b32aa0cbb287dcb825569d8685b511fa7b7539f9f27df +size 1819 diff --git a/addons/Godoxel/assets/BrushRect_Hovered.png.import b/addons/Godoxel/assets/BrushRect_Hovered.png.import new file mode 100644 index 0000000..df4596c --- /dev/null +++ b/addons/Godoxel/assets/BrushRect_Hovered.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/BrushRect_Hovered.png-b09066b673d6082ce887a03a19f17977.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/Godoxel/assets/BrushRect_Hovered.png" +dest_files=[ "res://.import/BrushRect_Hovered.png-b09066b673d6082ce887a03a19f17977.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/addons/Godoxel/assets/BrushVLine.png b/addons/Godoxel/assets/BrushVLine.png new file mode 100644 index 0000000..12d7c38 --- /dev/null +++ b/addons/Godoxel/assets/BrushVLine.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2e731a70c278759c163036f3ecc97fc1edb63752340c571267a6eaa512c291ca +size 129 diff --git a/addons/Godoxel/assets/BrushVLine.png.import b/addons/Godoxel/assets/BrushVLine.png.import new file mode 100644 index 0000000..6eaf85a --- /dev/null +++ b/addons/Godoxel/assets/BrushVLine.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/BrushVLine.png-022220d888fe2fe2f8a081bcca62b4b2.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/Godoxel/assets/BrushVLine.png" +dest_files=[ "res://.import/BrushVLine.png-022220d888fe2fe2f8a081bcca62b4b2.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/addons/Godoxel/assets/BrushVLine_Hovered.png b/addons/Godoxel/assets/BrushVLine_Hovered.png new file mode 100644 index 0000000..b771e31 --- /dev/null +++ b/addons/Godoxel/assets/BrushVLine_Hovered.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c1e9fbf07b966d638c774300516a03f06874e870eba9af1280479cf774e57bb8 +size 1998 diff --git a/addons/Godoxel/assets/BrushVLine_Hovered.png.import b/addons/Godoxel/assets/BrushVLine_Hovered.png.import new file mode 100644 index 0000000..d1ec261 --- /dev/null +++ b/addons/Godoxel/assets/BrushVLine_Hovered.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/BrushVLine_Hovered.png-104e29757699756f1b44bd32a622df2c.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/Godoxel/assets/BrushVLine_Hovered.png" +dest_files=[ "res://.import/BrushVLine_Hovered.png-104e29757699756f1b44bd32a622df2c.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/addons/Godoxel/assets/Godoxel_Anim_Panel.png b/addons/Godoxel/assets/Godoxel_Anim_Panel.png new file mode 100644 index 0000000..367ca6d --- /dev/null +++ b/addons/Godoxel/assets/Godoxel_Anim_Panel.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ef8ca7bd83b0646da103d0c9d4d3df1cda916e4f4c6511d2079b3eb02532cdcc +size 52771 diff --git a/addons/Godoxel/assets/Godoxel_Anim_Panel.png.import b/addons/Godoxel/assets/Godoxel_Anim_Panel.png.import new file mode 100644 index 0000000..474429a --- /dev/null +++ b/addons/Godoxel/assets/Godoxel_Anim_Panel.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/Godoxel_Anim_Panel.png-56f84f9044d8bd8d0a4f3430dba126f6.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/Godoxel/assets/Godoxel_Anim_Panel.png" +dest_files=[ "res://.import/Godoxel_Anim_Panel.png-56f84f9044d8bd8d0a4f3430dba126f6.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/addons/Godoxel/assets/Godoxel_Preview.png b/addons/Godoxel/assets/Godoxel_Preview.png new file mode 100644 index 0000000..c5a2c4c --- /dev/null +++ b/addons/Godoxel/assets/Godoxel_Preview.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:65857240a730ea849c9a2d6ded456e070fef98f2d4f659cd30272148990903dc +size 67122 diff --git a/addons/Godoxel/assets/Godoxel_Preview.png.import b/addons/Godoxel/assets/Godoxel_Preview.png.import new file mode 100644 index 0000000..53fe208 --- /dev/null +++ b/addons/Godoxel/assets/Godoxel_Preview.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/Godoxel_Preview.png-e30103581d3fc0ed2a2c92cdf72b5c70.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/Godoxel/assets/Godoxel_Preview.png" +dest_files=[ "res://.import/Godoxel_Preview.png-e30103581d3fc0ed2a2c92cdf72b5c70.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/addons/Godoxel/assets/Godoxel_Shortcuts.png b/addons/Godoxel/assets/Godoxel_Shortcuts.png new file mode 100644 index 0000000..911bd1b --- /dev/null +++ b/addons/Godoxel/assets/Godoxel_Shortcuts.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c7ac2ef01841ba01ecf381ae54eeff3d19ef2d5edd4de7a2cb18cbbc72993033 +size 26603 diff --git a/addons/Godoxel/assets/Godoxel_Shortcuts.png.import b/addons/Godoxel/assets/Godoxel_Shortcuts.png.import new file mode 100644 index 0000000..06ba76a --- /dev/null +++ b/addons/Godoxel/assets/Godoxel_Shortcuts.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/Godoxel_Shortcuts.png-bd1a4956e0778c5ddf36cdc3bb058831.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/Godoxel/assets/Godoxel_Shortcuts.png" +dest_files=[ "res://.import/Godoxel_Shortcuts.png-bd1a4956e0778c5ddf36cdc3bb058831.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/addons/Godoxel/assets/animation_arrow_down.png b/addons/Godoxel/assets/animation_arrow_down.png new file mode 100644 index 0000000..fc0356e --- /dev/null +++ b/addons/Godoxel/assets/animation_arrow_down.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c01e05f8d8ca6bbddc79091afcbbe70e1224d9cb423f1e586946e6ab44b9b2ad +size 118 diff --git a/addons/Godoxel/assets/animation_arrow_down.png.import b/addons/Godoxel/assets/animation_arrow_down.png.import new file mode 100644 index 0000000..3ba74ad --- /dev/null +++ b/addons/Godoxel/assets/animation_arrow_down.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/animation_arrow_down.png-9edbf9aa07338136f99ac434cbed09e5.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/Godoxel/assets/animation_arrow_down.png" +dest_files=[ "res://.import/animation_arrow_down.png-9edbf9aa07338136f99ac434cbed09e5.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/addons/Godoxel/assets/animation_arrow_up.png b/addons/Godoxel/assets/animation_arrow_up.png new file mode 100644 index 0000000..e188ac2 --- /dev/null +++ b/addons/Godoxel/assets/animation_arrow_up.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:093ac2c890ec1aee110dc9fe37f9dc4f5cd51fb9bddfa0d67df16e2065555a5c +size 112 diff --git a/addons/Godoxel/assets/animation_arrow_up.png.import b/addons/Godoxel/assets/animation_arrow_up.png.import new file mode 100644 index 0000000..ad89377 --- /dev/null +++ b/addons/Godoxel/assets/animation_arrow_up.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/animation_arrow_up.png-8957357689f69c848f5f33d20a50a416.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/Godoxel/assets/animation_arrow_up.png" +dest_files=[ "res://.import/animation_arrow_up.png-8957357689f69c848f5f33d20a50a416.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/addons/Godoxel/assets/arrow_down.png b/addons/Godoxel/assets/arrow_down.png new file mode 100644 index 0000000..00795e9 --- /dev/null +++ b/addons/Godoxel/assets/arrow_down.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c2d3dc2463161956db5a22304fc259637e019412634e94a9a81b3c2354416b33 +size 562 diff --git a/addons/Godoxel/assets/arrow_down.png.import b/addons/Godoxel/assets/arrow_down.png.import new file mode 100644 index 0000000..b9e87b6 --- /dev/null +++ b/addons/Godoxel/assets/arrow_down.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/arrow_down.png-d2bd93428c0bc172a28a43c55aac576e.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/Godoxel/assets/arrow_down.png" +dest_files=[ "res://.import/arrow_down.png-d2bd93428c0bc172a28a43c55aac576e.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/addons/Godoxel/assets/arrow_up.png b/addons/Godoxel/assets/arrow_up.png new file mode 100644 index 0000000..d447bc2 --- /dev/null +++ b/addons/Godoxel/assets/arrow_up.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d500266f596487515794fb573ac5fea3683551b0a45d6539ab5354fdbf0d5f4c +size 565 diff --git a/addons/Godoxel/assets/arrow_up.png.import b/addons/Godoxel/assets/arrow_up.png.import new file mode 100644 index 0000000..4ea01b4 --- /dev/null +++ b/addons/Godoxel/assets/arrow_up.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/arrow_up.png-2598e148d1b795a628ce80a4fd5cf401.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/Godoxel/assets/arrow_up.png" +dest_files=[ "res://.import/arrow_up.png-2598e148d1b795a628ce80a4fd5cf401.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/addons/Godoxel/assets/bitstream_vera_sans_font_6016/COPYRIGHT.TXT b/addons/Godoxel/assets/bitstream_vera_sans_font_6016/COPYRIGHT.TXT new file mode 100644 index 0000000..40e3562 --- /dev/null +++ b/addons/Godoxel/assets/bitstream_vera_sans_font_6016/COPYRIGHT.TXT @@ -0,0 +1,124 @@ +Bitstream Vera Fonts Copyright + +The fonts have a generous copyright, allowing derivative works (as +long as "Bitstream" or "Vera" are not in the names), and full +redistribution (so long as they are not *sold* by themselves). They +can be be bundled, redistributed and sold with any software. + +The fonts are distributed under the following copyright: + +Copyright +========= + +Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream +Vera is a trademark of Bitstream, Inc. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of the fonts accompanying this license ("Fonts") and associated +documentation files (the "Font Software"), to reproduce and distribute +the Font Software, including without limitation the rights to use, +copy, merge, publish, distribute, and/or sell copies of the Font +Software, and to permit persons to whom the Font Software is furnished +to do so, subject to the following conditions: + +The above copyright and trademark notices and this permission notice +shall be included in all copies of one or more of the Font Software +typefaces. + +The Font Software may be modified, altered, or added to, and in +particular the designs of glyphs or characters in the Fonts may be +modified and additional glyphs or characters may be added to the +Fonts, only if the fonts are renamed to names not containing either +the words "Bitstream" or the word "Vera". + +This License becomes null and void to the extent applicable to Fonts +or Font Software that has been modified and is distributed under the +"Bitstream Vera" names. + +The Font Software may be sold as part of a larger software package but +no copy of one or more of the Font Software typefaces may be sold by +itself. + +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL +BITSTREAM OR THE GNOME FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, +OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT +SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. + +Except as contained in this notice, the names of Gnome, the Gnome +Foundation, and Bitstream Inc., shall not be used in advertising or +otherwise to promote the sale, use or other dealings in this Font +Software without prior written authorization from the Gnome Foundation +or Bitstream Inc., respectively. For further information, contact: +fonts at gnome dot org. + +Copyright FAQ +============= + + 1. I don't understand the resale restriction... What gives? + + Bitstream is giving away these fonts, but wishes to ensure its + competitors can't just drop the fonts as is into a font sale system + and sell them as is. It seems fair that if Bitstream can't make money + from the Bitstream Vera fonts, their competitors should not be able to + do so either. You can sell the fonts as part of any software package, + however. + + 2. I want to package these fonts separately for distribution and + sale as part of a larger software package or system. Can I do so? + + Yes. A RPM or Debian package is a "larger software package" to begin + with, and you aren't selling them independently by themselves. + See 1. above. + + 3. Are derivative works allowed? + Yes! + + 4. Can I change or add to the font(s)? + Yes, but you must change the name(s) of the font(s). + + 5. Under what terms are derivative works allowed? + + You must change the name(s) of the fonts. This is to ensure the + quality of the fonts, both to protect Bitstream and Gnome. We want to + ensure that if an application has opened a font specifically of these + names, it gets what it expects (though of course, using fontconfig, + substitutions could still could have occurred during font + opening). You must include the Bitstream copyright. Additional + copyrights can be added, as per copyright law. Happy Font Hacking! + + 6. If I have improvements for Bitstream Vera, is it possible they might get + adopted in future versions? + + Yes. The contract between the Gnome Foundation and Bitstream has + provisions for working with Bitstream to ensure quality additions to + the Bitstream Vera font family. Please contact us if you have such + additions. Note, that in general, we will want such additions for the + entire family, not just a single font, and that you'll have to keep + both Gnome and Jim Lyles, Vera's designer, happy! To make sense to add + glyphs to the font, they must be stylistically in keeping with Vera's + design. Vera cannot become a "ransom note" font. Jim Lyles will be + providing a document describing the design elements used in Vera, as a + guide and aid for people interested in contributing to Vera. + + 7. I want to sell a software package that uses these fonts: Can I do so? + + Sure. Bundle the fonts with your software and sell your software + with the fonts. That is the intent of the copyright. + + 8. If applications have built the names "Bitstream Vera" into them, + can I override this somehow to use fonts of my choosing? + + This depends on exact details of the software. Most open source + systems and software (e.g., Gnome, KDE, etc.) are now converting to + use fontconfig (see www.fontconfig.org) to handle font configuration, + selection and substitution; it has provisions for overriding font + names and subsituting alternatives. An example is provided by the + supplied local.conf file, which chooses the family Bitstream Vera for + "sans", "serif" and "monospace". Other software (e.g., the XFree86 + core server) has other mechanisms for font substitution. + diff --git a/addons/Godoxel/assets/bitstream_vera_sans_font_6016/README.TXT b/addons/Godoxel/assets/bitstream_vera_sans_font_6016/README.TXT new file mode 100644 index 0000000..0f71795 --- /dev/null +++ b/addons/Godoxel/assets/bitstream_vera_sans_font_6016/README.TXT @@ -0,0 +1,11 @@ +Contained herin is the Bitstream Vera font family. + +The Copyright information is found in the COPYRIGHT.TXT file (along +with being incoporated into the fonts themselves). + +The releases notes are found in the file "RELEASENOTES.TXT". + +We hope you enjoy Vera! + + Bitstream, Inc. + The Gnome Project diff --git a/addons/Godoxel/assets/bitstream_vera_sans_font_6016/RELEASENOTES.TXT b/addons/Godoxel/assets/bitstream_vera_sans_font_6016/RELEASENOTES.TXT new file mode 100644 index 0000000..270bc0d --- /dev/null +++ b/addons/Godoxel/assets/bitstream_vera_sans_font_6016/RELEASENOTES.TXT @@ -0,0 +1,162 @@ +Bitstream Vera Fonts - April 16, 2003 +===================================== + +The version number of these fonts is 1.10 to distinguish them from the +beta test fonts. + +Note that the Vera copyright is incorporated in the fonts themselves. +The License field in the fonts contains the copyright license as it +appears below. The TrueType copyright field is not large enough to +contain the full license, so the license is incorporated (as you might +think if you thought about it) into the license field, which +unfortunately can be obscure to find. (In pfaedit, see: Element->Font +Info->TTFNames->License). + +Our apologies for it taking longer to complete the fonts than planned. +Beta testers requested a tighter line spacing (less leading) and Jim +Lyles redesigned Vera's accents to bring its line spacing to more +typical of other fonts. This took additional time and effort. Our +thanks to Jim for this effort above and beyond the call of duty. + +There are four monospace and sans faces (normal, oblique, bold, bold +oblique) and two serif faces (normal and bold). Fontconfig/Xft2 (see +www.fontconfig.org) can artificially oblique the serif faces for you: +this loses hinting and distorts the faces slightly, but is visibly +different than normal and bold, and reasonably pleasing. + +On systems with fontconfig 2.0 or 2.1 installed, making your sans, +serif and monospace fonts default to these fonts is very easy. Just +drop the file local.conf into your /etc/fonts directory. This will +make the Bitstream fonts your default fonts for all applications using +fontconfig (if sans, serif, or monospace names are used, as they often +are as default values in many desktops). The XML in local.conf may +need modification to enable subpixel decimation, if appropriate, +however, the commented out phrase does so for XFree86 4.3, in the case +that the server does not have sufficient information to identify the +use of a flat panel. Fontconfig 2.2 adds Vera to the list of font +families and will, by default use it as the default sans, serif and +monospace fonts. + +During the testing of the final Vera fonts, we learned that screen +fonts in general are only typically hinted to work correctly at +integer pixel sizes. Vera is coded internally for integer sizes only. +We need to investigate further to see if there are commonly used fonts +that are hinted to be rounded but are not rounded to integer sizes due +to oversights in their coding. + +Most fonts work best at 8 pixels and below if anti-aliased only, as +the amount of work required to hint well at smaller and smaller sizes +becomes astronomical. GASP tables are typically used to control +whether hinting is used or not, but Freetype/Xft does not currently +support GASP tables (which are present in Vera). + +To mitigate this problem, both for Vera and other fonts, there will be +(very shortly) a new fontconfig 2.2 release that will, by default not +apply hints if the size is below 8 pixels. if you should have a font +that in fact has been hinted more agressively, you can use fontconfig +to note this exception. We believe this should improve many hinted +fonts in addition to Vera, though implemeting GASP support is likely +the right long term solution. + +Font rendering in Gnome or KDE is the combination of algorithms in +Xft2 and Freetype, along with hinting in the fonts themselves. It is +vital to have sufficient information to disentangle problems that you +may observe. + +Note that having your font rendering system set up correctly is vital +to proper judgement of problems of the fonts: + + * Freetype may or may not be configured to in ways that may + implement execution of possibly patented (in some parts of the world) + TrueType hinting algorithms, particularly at small sizes. Best + results are obtained while using these algorithms. + + * The freetype autohinter (used when the possibly patented + algorithms are not used) continues to improve with each release. If + you are using the autohinter, please ensure you are using an up to + date version of freetype before reporting problems. + + * Please identify what version of freetype you are using in any + bug reports, and how your freetype is configured. + + * Make sure you are not using the freetype version included in + XFree86 4.3, as it has bugs that significantly degrade most fonts, + including Vera. if you build XFree86 4.3 from source yourself, you may + have installed this broken version without intending it (as I + did). Vera was verified with the recently released Freetype 2.1.4. On + many systems, 'ldd" can be used to see which freetype shared library + is actually being used. + + * Xft/X Render does not (yet) implement gamma correction. This + causes significant problems rendering white text on a black background + (causing partial pixels to be insufficiently shaded) if the gamma of + your monitor has not been compensated for, and minor problems with + black text on a while background. The program "xgamma" can be used to + set a gamma correction value in the X server's color pallette. Most + monitors have a gamma near 2. + + * Note that the Vera family uses minimal delta hinting. Your + results on other systems when not used anti-aliased may not be + entirely satisfying. We are primarily interested in reports of + problems on open source systems implementing Xft2/fontconfig/freetype + (which implements antialiasing and hinting adjustements, and + sophisticated subpixel decimation on flatpanels). Also, the + algorithms used by Xft2 adjust the hints to integer widths and the + results are crisper on open source systems than on Windows or + MacIntosh. + + * Your fontconfig may (probably does) predate the release of + fontconfig 2.2, and you may see artifacts not present when the font is + used at very small sizes with hinting enabled. "vc-list -V" can be + used to see what version you have installed. + +We believe and hope that these fonts will resolve the problems +reported during beta test. The largest change is the reduction of +leading (interline spacing), which had annoyed a number of people, and +reduced Vera's utility for some applcations. The Vera monospace font +should also now make '0' and 'O' and '1' and 'l' more clearly +distinguishable. + +The version of these fonts is version 1.10. Fontconfig should be +choosing the new version of the fonts if both the released fonts and +beta test fonts are installed (though please discard them: they have +names of form tt20[1-12]gn.ttf). Note that older versions of +fontconfig sometimes did not rebuild their cache correctly when new +fonts are installed: please upgrade to fontconfig 2.2. "fc-cache -f" +can be used to force rebuilding fontconfig's cache files. + +If you note problems, please send them to fonts at gnome dot org, with +exactly which face and size and unicode point you observe the problem +at. The xfd utility from XFree86 CVS may be useful for this (e.g. "xfd +-fa sans"). A possibly more useful program to examine fonts at a +variety of sizes is the "waterfall" program found in Keith Packard's +CVS. + + $ cvs -d :pserver:anoncvs@keithp.com:/local/src/CVS login + Logging in to :pserver:anoncvs@keithp.com:2401/local/src/CVS + CVS password: + $ cvs -d :pserver:anoncvs@keithp.com:/local/src/CVS co waterfall + $ cd waterfall + $ xmkmf -a + $ make + # make install + # make install.man + +Again, please make sure you are running an up-to-date freetype, and +that you are only examining integer sizes. + +Reporting Problems +================== + +Please send problem reports to fonts at gnome org, with the following +information: + + 1. Version of Freetype, Xft2 and fontconfig + 2. Whether TT hinting is being used, or the autohinter + 3. Application being used + 4. Character/Unicode code point that has problems (if applicable) + 5. Version of which operating system + 6. Please include a screenshot, when possible. + +Please check the fonts list archives before reporting problems to cut +down on duplication. diff --git a/addons/Godoxel/assets/bitstream_vera_sans_font_6016/Vera.ttf b/addons/Godoxel/assets/bitstream_vera_sans_font_6016/Vera.ttf new file mode 100644 index 0000000..58cd6b5 Binary files /dev/null and b/addons/Godoxel/assets/bitstream_vera_sans_font_6016/Vera.ttf differ diff --git a/addons/Godoxel/assets/bitstream_vera_sans_font_6016/VeraBI.ttf b/addons/Godoxel/assets/bitstream_vera_sans_font_6016/VeraBI.ttf new file mode 100644 index 0000000..b55eee3 Binary files /dev/null and b/addons/Godoxel/assets/bitstream_vera_sans_font_6016/VeraBI.ttf differ diff --git a/addons/Godoxel/assets/bitstream_vera_sans_font_6016/VeraBd.ttf b/addons/Godoxel/assets/bitstream_vera_sans_font_6016/VeraBd.ttf new file mode 100644 index 0000000..51d6111 Binary files /dev/null and b/addons/Godoxel/assets/bitstream_vera_sans_font_6016/VeraBd.ttf differ diff --git a/addons/Godoxel/assets/bitstream_vera_sans_font_6016/VeraIt.ttf b/addons/Godoxel/assets/bitstream_vera_sans_font_6016/VeraIt.ttf new file mode 100644 index 0000000..cc23c9e Binary files /dev/null and b/addons/Godoxel/assets/bitstream_vera_sans_font_6016/VeraIt.ttf differ diff --git a/addons/Godoxel/assets/bitstream_vera_sans_font_6016/all-free-download.com.url b/addons/Godoxel/assets/bitstream_vera_sans_font_6016/all-free-download.com.url new file mode 100644 index 0000000..be505ef --- /dev/null +++ b/addons/Godoxel/assets/bitstream_vera_sans_font_6016/all-free-download.com.url @@ -0,0 +1,8 @@ +[InternetShortcut] +URL=http://www.all-free-download.com/ +IDList= +HotKey=0 +IconFile=C:\WINDOWS\system32\SHELL32.dll +IconIndex=23 +[{000214A0-0000-0000-C000-000000000046}] +Prop3=19,2 diff --git a/addons/Godoxel/assets/godoxel_screenshot.png b/addons/Godoxel/assets/godoxel_screenshot.png new file mode 100644 index 0000000..bb88818 --- /dev/null +++ b/addons/Godoxel/assets/godoxel_screenshot.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f65e5dfbed1c0bffa1d2f4096b94845cd8cf0d6c910a684cb910a1112fb97b37 +size 76642 diff --git a/addons/Godoxel/assets/godoxel_screenshot.png.import b/addons/Godoxel/assets/godoxel_screenshot.png.import new file mode 100644 index 0000000..0130f1e --- /dev/null +++ b/addons/Godoxel/assets/godoxel_screenshot.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/godoxel_screenshot.png-43fb83f678511237490ee7f96939d8cd.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/Godoxel/assets/godoxel_screenshot.png" +dest_files=[ "res://.import/godoxel_screenshot.png-43fb83f678511237490ee7f96939d8cd.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/addons/Godoxel/assets/grid.png b/addons/Godoxel/assets/grid.png new file mode 100644 index 0000000..c68dc5b --- /dev/null +++ b/addons/Godoxel/assets/grid.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6e906d39f57bc454a2e042443b2562b9df24a092856018cfe6cbbd6a360c303b +size 148 diff --git a/addons/Godoxel/assets/grid.png.import b/addons/Godoxel/assets/grid.png.import new file mode 100644 index 0000000..eac50ac --- /dev/null +++ b/addons/Godoxel/assets/grid.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/grid.png-e3d637acacdb891e09f422df261dbd1e.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/Godoxel/assets/grid.png" +dest_files=[ "res://.import/grid.png-e3d637acacdb891e09f422df261dbd1e.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/addons/Godoxel/assets/lock_layer.png b/addons/Godoxel/assets/lock_layer.png new file mode 100644 index 0000000..45edce1 --- /dev/null +++ b/addons/Godoxel/assets/lock_layer.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f8101850a2043d8f25ea4869c17a4886fadb748bf1d119f6d9acd58882eafa33 +size 251 diff --git a/addons/Godoxel/assets/lock_layer.png.import b/addons/Godoxel/assets/lock_layer.png.import new file mode 100644 index 0000000..5fd8060 --- /dev/null +++ b/addons/Godoxel/assets/lock_layer.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/lock_layer.png-076954b389746de9e13c853ed5d9ba59.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/Godoxel/assets/lock_layer.png" +dest_files=[ "res://.import/lock_layer.png-076954b389746de9e13c853ed5d9ba59.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/addons/Godoxel/assets/lock_layer_1.png b/addons/Godoxel/assets/lock_layer_1.png new file mode 100644 index 0000000..e8175b5 --- /dev/null +++ b/addons/Godoxel/assets/lock_layer_1.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1820fa3576f462d10682211d0d7e0661993ca0cae9bd80c252be75faf79d7b33 +size 242 diff --git a/addons/Godoxel/assets/lock_layer_1.png.import b/addons/Godoxel/assets/lock_layer_1.png.import new file mode 100644 index 0000000..e3cb23a --- /dev/null +++ b/addons/Godoxel/assets/lock_layer_1.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/lock_layer_1.png-4848d5f2cd0f48c68b880712b6b38776.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/Godoxel/assets/lock_layer_1.png" +dest_files=[ "res://.import/lock_layer_1.png-4848d5f2cd0f48c68b880712b6b38776.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/addons/Godoxel/assets/minidotta.png b/addons/Godoxel/assets/minidotta.png new file mode 100644 index 0000000..f2765b2 --- /dev/null +++ b/addons/Godoxel/assets/minidotta.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:00fcc85d7665ce7878e2e59130ac3832c656fbee0ac9538807a988018f06f7b6 +size 2330 diff --git a/addons/Godoxel/assets/minidotta.png.import b/addons/Godoxel/assets/minidotta.png.import new file mode 100644 index 0000000..462757f --- /dev/null +++ b/addons/Godoxel/assets/minidotta.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/minidotta.png-adac81df344972ef82e2499656aa288e.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/Godoxel/assets/minidotta.png" +dest_files=[ "res://.import/minidotta.png-adac81df344972ef82e2499656aa288e.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/addons/Godoxel/assets/minidotta_invis.png b/addons/Godoxel/assets/minidotta_invis.png new file mode 100644 index 0000000..536e3dd --- /dev/null +++ b/addons/Godoxel/assets/minidotta_invis.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:23abd300d8f912d918aa6e6e0b6b6f2040f666c03ebed9650b0728219e790203 +size 1746 diff --git a/addons/Godoxel/assets/minidotta_invis.png.import b/addons/Godoxel/assets/minidotta_invis.png.import new file mode 100644 index 0000000..607a755 --- /dev/null +++ b/addons/Godoxel/assets/minidotta_invis.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/minidotta_invis.png-5232a113bb226997ae55212b2aa90bd4.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/Godoxel/assets/minidotta_invis.png" +dest_files=[ "res://.import/minidotta_invis.png-5232a113bb226997ae55212b2aa90bd4.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/addons/Godoxel/assets/unlock_layer.png b/addons/Godoxel/assets/unlock_layer.png new file mode 100644 index 0000000..ef34c1f --- /dev/null +++ b/addons/Godoxel/assets/unlock_layer.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:682e33fee04aba3e33c8a3e197d66a25c1d1f872f90d13046e03b65d44c8793c +size 240 diff --git a/addons/Godoxel/assets/unlock_layer.png.import b/addons/Godoxel/assets/unlock_layer.png.import new file mode 100644 index 0000000..17d2172 --- /dev/null +++ b/addons/Godoxel/assets/unlock_layer.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/unlock_layer.png-ae7c97a04fb889522c7c466fdc9dd8f6.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/Godoxel/assets/unlock_layer.png" +dest_files=[ "res://.import/unlock_layer.png-ae7c97a04fb889522c7c466fdc9dd8f6.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/addons/Godoxel/components/AnimationButton.gd b/addons/Godoxel/components/AnimationButton.gd new file mode 100644 index 0000000..d009c17 --- /dev/null +++ b/addons/Godoxel/components/AnimationButton.gd @@ -0,0 +1,73 @@ +extends Button +tool + +signal on_animation_button_pressed() + +onready var line_edit = $LineEdit +onready var label = $Label + +var press_pos +var release_pos +var moved = false + + +func _ready(): + line_edit.hide() + set_process_input(false) + + +func _input(event: InputEvent): + if event is InputEventKey: + if event.pressed and event.scancode == KEY_ESCAPE: + line_edit.hide() + line_edit.text = label.text + elif event is InputEventMouseButton: + if line_edit.visible and event.pressed and event.button_index == BUTTON_LEFT: + line_edit.hide() + line_edit.text = label.text + + +func _on_TextButton_gui_input(event: InputEvent): + if event is InputEventMouseButton: + if event.button_index == BUTTON_LEFT: + if not event.pressed: + if !moved: + if not line_edit.visible: + line_edit.show() + line_edit.grab_focus() + line_edit.grab_click_focus() + line_edit.caret_position = line_edit.text.length() - 1 + else: + line_edit.hide() + elif line_edit.visible: + line_edit.hide() + else: + moved = false + elif event is InputEventMouseMotion: + moved = true + + +func _on_LineEdit_focus_exited(): + label.text = line_edit.text + if not Rect2(rect_global_position, rect_size).has_point(get_global_mouse_position()): + line_edit.hide() + + +func _on_LineEdit_text_entered(new_text: String): + label.text = new_text + line_edit.hide() + + +func _on_AnimationButton_pressed(): + line_edit.hide() + emit_signal("on_animation_button_pressed") +# if line_edit.visible: +# line_edit.hide() +# else: +# line_edit.show() +# line_edit.grab_focus() +# line_edit.grab_click_focus() + + +func _on_LineEdit_visibility_changed(): + set_process_input(line_edit.visible) diff --git a/addons/Godoxel/components/AnimationButton.tscn b/addons/Godoxel/components/AnimationButton.tscn new file mode 100644 index 0000000..38ebca1 --- /dev/null +++ b/addons/Godoxel/components/AnimationButton.tscn @@ -0,0 +1,64 @@ +[gd_scene load_steps=3 format=2] + +[ext_resource path="res://addons/Godoxel/components/AnimationButton.gd" type="Script" id=1] + +[sub_resource type="StyleBoxFlat" id=1] +bg_color = Color( 0.6, 0.6, 0.6, 0.12549 ) + +[node name="AnimationButton" type="Button"] +margin_right = 250.0 +margin_bottom = 42.0 +script = ExtResource( 1 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="TextButton" type="Button" parent="."] +anchor_left = 0.14 +anchor_top = 0.261905 +anchor_right = 0.86 +anchor_bottom = 0.738095 +margin_top = -9.53674e-07 +custom_styles/hover = SubResource( 1 ) +custom_styles/pressed = SubResource( 1 ) +custom_styles/focus = SubResource( 1 ) +custom_styles/disabled = SubResource( 1 ) +custom_styles/normal = SubResource( 1 ) +__meta__ = { +"_edit_use_anchors_": true +} + +[node name="Label" type="Label" parent="."] +anchor_right = 1.0 +anchor_bottom = 1.0 +text = "Animation" +align = 1 +valign = 1 +clip_text = true +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="LineEdit" type="LineEdit" parent="."] +visible = false +anchor_left = 0.108 +anchor_top = 0.5 +anchor_right = 0.892 +anchor_bottom = 0.5 +margin_left = -0.0559998 +margin_top = -12.0 +margin_right = 0.0559998 +margin_bottom = 12.0 +mouse_filter = 2 +text = "Animation" +caret_blink = true +caret_blink_speed = 0.5 +__meta__ = { +"_edit_use_anchors_": false +} + +[connection signal="pressed" from="." to="." method="_on_AnimationButton_pressed"] +[connection signal="gui_input" from="TextButton" to="." method="_on_TextButton_gui_input"] +[connection signal="focus_exited" from="LineEdit" to="." method="_on_LineEdit_focus_exited"] +[connection signal="text_entered" from="LineEdit" to="." method="_on_LineEdit_text_entered"] +[connection signal="visibility_changed" from="LineEdit" to="." method="_on_LineEdit_visibility_changed"] diff --git a/addons/Godoxel/components/AnimationPanel.gd b/addons/Godoxel/components/AnimationPanel.gd new file mode 100644 index 0000000..39c0fa9 --- /dev/null +++ b/addons/Godoxel/components/AnimationPanel.gd @@ -0,0 +1,157 @@ +extends Panel +tool + +signal on_add_animation() +signal on_frame_pressed(anim, frame_button) +signal on_add_frame_pressed(anim, frame_button) +signal on_animation_pressed(anim) + +signal on_play_pause_pressed() +signal on_animation_frame_rate_changed(new_frame_rate) +signal on_animation_loop_toggled() + +signal on_animation_move(from, to) +signal on_animation_duplicated(anim) + +signal on_animation_selected(anim) +signal on_animation_deleted(anim) + + +const AnimationStripe = preload("res://addons/Godoxel/components/AnimationStripe.tscn") + +onready var anim_button_container = find_node("AnimationButtons") +onready var play_pause_button = find_node("PlayPause") +onready var add_animation_button = find_node("AddAnimation") # for dragging + + +func _ready(): + pass + + +func _on_moved(from, to): + if from > to: + _move_animation_up(from, to) + elif from != to: + _move_animation_up(from, to) + anim_button_container.queue_sort() + + +func _move_animation_up(anim_idx, pos): + anim_button_container.move_child(anim_button_container.get_child(anim_idx), pos) + emit_signal("on_animation_move", anim_idx, pos) + + +func move_animation_up(anim_idx): + var pos = max(anim_idx - 1, 0) + anim_button_container.move_child(anim_button_container.get_child(anim_idx), pos) + emit_signal("on_animation_move", anim_idx, pos) + + +func move_animation_down(anim_idx): + var pos = min(anim_idx + 1, anim_button_container.get_child_count() - 1) + anim_button_container.move_child(anim_button_container.get_child(anim_idx), pos) + emit_signal("on_animation_move", anim_idx, pos) + + +func clear_all(): + for anim_button in anim_button_container.get_children(): + anim_button_container.remove_child(anim_button) + anim_button.queue_free() + + +func update_all_frame_button_previews(): + for anim_stripe in anim_button_container.get_children(): + for frame_button in anim_stripe.frame_button_container.get_children(): + for layer in frame_button.frame.layers: + layer.update_texture() + frame_button.update_preview() + + +func set_frame_preview(anim_idx, frame_idx, frame): + if anim_button_container.get_child(anim_idx).get_frame_button(frame_idx): + anim_button_container.get_child(anim_idx).get_frame_button(frame_idx).set_frame(frame) + + +func get_frame_button(anim_idx, frame_idx): + return anim_button_container.get_child(anim_idx).get_frame_button(frame_idx) + + +func get_animation_stripe(anim_idx): + return anim_button_container.get_child(anim_idx) + + +func get_last_animation_stripe(): + return get_animation_stripe(anim_button_container.get_child_count()-1) + + +func _on_AddAnimation_pressed(): + emit_signal("on_add_animation") + + +func add_animation_stripe(): + var anim_stripe = AnimationStripe.instance() + anim_button_container.add_child(anim_stripe) + anim_stripe.connect("on_frame_pressed", self, "_on_frame_pressed") + anim_stripe.connect("on_add_frame_pressed", self, "_on_add_frame_pressed") + anim_stripe.connect("on_animation_pressed", self, "_on_animation_pressed") + anim_stripe.connect("on_move_down_pressed", self, "move_animation_down") + anim_stripe.connect("on_move_up_pressed", self, "move_animation_up") + anim_stripe.connect("on_moved", self, "_on_moved") + anim_stripe.connect("on_animation_duplicated", self, "_on_animation_duplicated") + anim_stripe.connect("on_animation_selected", self, "_on_animation_selected") + anim_stripe.connect("on_deleted", self, "_on_deleted") + + anim_stripe.add_new_frame_button() + + return anim_stripe + + +func _on_animation_pressed(anim_idx): + emit_signal("on_animation_pressed", anim_idx) + + +func _on_add_frame_pressed(anim, frame_button): + emit_signal("on_add_frame_pressed", anim, frame_button) + + +func _on_frame_pressed(anim, frame_button): + emit_signal("on_frame_pressed", anim, frame_button) + + +func get_animation_container(): + return anim_button_container + + +func set_play_pause_button(playing: bool): + if playing: + play_pause_button.text = "Pause" + else: + play_pause_button.text = "Play" + + +func _on_PlayPause_pressed(): + if play_pause_button.text == "Play": + play_pause_button.text = "Pause" + else: + play_pause_button.text = "Play" + emit_signal("on_play_pause_pressed") + + +func _on_FrameRate_value_changed(value): + emit_signal("on_animation_frame_rate_changed", value) + + +func _on_ToggleAnimationLoop_pressed(): + emit_signal("on_animation_loop_toggled") + + +func _on_animation_duplicated(anim): + emit_signal("on_animation_duplicated", anim) + + +func _on_animation_selected(anim): + emit_signal("on_animation_selected", anim) + + +func _on_deleted(anim): + emit_signal("on_animation_deleted", anim) diff --git a/addons/Godoxel/components/AnimationPanel.tscn b/addons/Godoxel/components/AnimationPanel.tscn new file mode 100644 index 0000000..a652961 --- /dev/null +++ b/addons/Godoxel/components/AnimationPanel.tscn @@ -0,0 +1,109 @@ +[gd_scene load_steps=4 format=2] + +[ext_resource path="res://addons/Godoxel/components/AnimationPanel.gd" type="Script" id=1] + +[sub_resource type="StyleBoxFlat" id=1] +bg_color = Color( 0.2, 0.227451, 0.309804, 1 ) + +[sub_resource type="StyleBoxFlat" id=2] +bg_color = Color( 0.12549, 0.141176, 0.192157, 1 ) + +[node name="AnimationPanel" type="Panel"] +margin_right = 653.0 +margin_bottom = 120.0 +custom_styles/panel = SubResource( 1 ) +script = ExtResource( 1 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="VBoxContainer" type="VBoxContainer" parent="."] +anchor_right = 1.0 +anchor_bottom = 1.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Panel" type="Panel" parent="VBoxContainer"] +margin_right = 653.0 +margin_bottom = 40.0 +rect_min_size = Vector2( 0, 40 ) +custom_styles/panel = SubResource( 2 ) + +[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/Panel"] +anchor_right = 1.0 +anchor_bottom = 1.0 +custom_constants/separation = 20 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="PlayPause" type="Button" parent="VBoxContainer/Panel/HBoxContainer"] +margin_top = 5.0 +margin_right = 60.0 +margin_bottom = 35.0 +rect_min_size = Vector2( 60, 30 ) +size_flags_vertical = 4 +text = "Play" + +[node name="FrameRate" type="SpinBox" parent="VBoxContainer/Panel/HBoxContainer"] +margin_left = 80.0 +margin_top = 4.0 +margin_right = 154.0 +margin_bottom = 36.0 +rect_min_size = Vector2( 0, 32 ) +size_flags_vertical = 4 +min_value = 0.001 +max_value = 200.0 +step = 0.1 +value = 5.0 +align = 1 +suffix = "fps" + +[node name="ToggleAnimationLoop" type="CheckButton" parent="VBoxContainer/Panel/HBoxContainer"] +margin_left = 174.0 +margin_right = 285.0 +margin_bottom = 40.0 +pressed = true +text = "Loop" + +[node name="ScrollContainer" type="ScrollContainer" parent="VBoxContainer"] +margin_top = 44.0 +margin_right = 653.0 +margin_bottom = 120.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="HBoxContainer2" type="VBoxContainer" parent="VBoxContainer/ScrollContainer"] +margin_right = 653.0 +margin_bottom = 76.0 +rect_min_size = Vector2( 450, 0 ) +size_flags_horizontal = 3 +size_flags_vertical = 3 + +[node name="AnimationButtons" type="VBoxContainer" parent="VBoxContainer/ScrollContainer/HBoxContainer2"] +margin_right = 653.0 +size_flags_horizontal = 3 +custom_constants/separation = 5 + +[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/ScrollContainer/HBoxContainer2"] +margin_top = 4.0 +margin_right = 120.0 +margin_bottom = 34.0 +size_flags_horizontal = 0 + +[node name="AddAnimation" type="Button" parent="VBoxContainer/ScrollContainer/HBoxContainer2/VBoxContainer"] +margin_right = 120.0 +margin_bottom = 30.0 +rect_min_size = Vector2( 120, 30 ) +text = "+" + +[connection signal="pressed" from="VBoxContainer/Panel/HBoxContainer/PlayPause" to="." method="_on_PlayPause_pressed"] +[connection signal="value_changed" from="VBoxContainer/Panel/HBoxContainer/FrameRate" to="." method="_on_FrameRate_value_changed"] +[connection signal="pressed" from="VBoxContainer/Panel/HBoxContainer/ToggleAnimationLoop" to="." method="_on_ToggleAnimationLoop_pressed"] +[connection signal="pressed" from="VBoxContainer/ScrollContainer/HBoxContainer2/VBoxContainer/AddAnimation" to="." method="_on_AddAnimation_pressed"] diff --git a/addons/Godoxel/components/AnimationStripe.gd b/addons/Godoxel/components/AnimationStripe.gd new file mode 100644 index 0000000..7cbfbe2 --- /dev/null +++ b/addons/Godoxel/components/AnimationStripe.gd @@ -0,0 +1,141 @@ +extends Panel +tool + +signal on_frame_pressed(anim, btn) +signal on_add_frame_pressed(anim, btn) +signal on_animation_pressed(anim) + +signal on_move_up_pressed(index) +signal on_move_down_pressed(index) +signal on_moved(form, to) + +signal on_animation_duplicated(anim) +signal on_animation_selected(anim) + +signal on_deleted(anim) + +const FrameButton = preload("res://addons/Godoxel/components/FrameButton.tscn") + +const StyleNormal = preload("res://addons/Godoxel/themes/AnimationStripe_Panel_normal.tres") +const StyleDragging = preload("res://addons/Godoxel/themes/AnimationStripe_Panel_dragging.tres") +const StyleDraggable = preload("res://addons/Godoxel/themes/AnimationStripe_Panel_draggable.tres") + +onready var frame_button_container = find_node("FrameContainer") +onready var anim_button = find_node("AnimationButton") +var frames = [] +var animation: GEAnimation + + +func _ready(): + set("custom_styles/panel", StyleNormal) + + +var previous_index = -1 +var current_index = -1 +var dragging = false +var mouse_offset = Vector2.ZERO +func _input(event): + if not dragging: + if event is InputEventMouseButton: + if event.button_index == BUTTON_LEFT and event.pressed: + if not dragging and get_global_rect().has_point(get_global_mouse_position()): + dragging = true + set("custom_styles/panel", StyleDragging) + var mp = get_global_mouse_position() + mouse_offset = mp - rect_global_position + emit_signal("on_animation_selected", get_index()) + if event is InputEventMouseMotion: + if get_global_rect().has_point(get_global_mouse_position()): + set("custom_styles/panel", StyleDraggable) + else: + set("custom_styles/panel", StyleNormal) + return + + if dragging and event is InputEventMouseButton: + if not event.pressed and event.button_index == BUTTON_LEFT: + dragging = false + current_index = -1 + current_index = -1 + mouse_offset = Vector2.ZERO + get_parent().update() + return + + previous_index = current_index + + var mp = get_global_mouse_position().y - get_parent().rect_global_position.y + var y_index = mp / (rect_size.y + get_parent().get("custom_constants/separation")) + y_index = clamp(int(y_index), 0, get_parent().get_child_count()-1) + current_index = y_index + + if previous_index != current_index and previous_index != -1: + emit_signal("on_moved", previous_index, current_index) + + +func set_animation(animation): + self.animation = animation + + +func get_animation_name() -> String: + return anim_button.label.text + + +func set_animation_name(anim_name: String): + anim_button.label.text = anim_name + anim_button.line_edit.text = anim_name + + +func get_frame_button(idx): + return frame_button_container.get_child(idx) + + +func add_new_frame_button(): + var frame_button = FrameButton.instance() + frame_button_container.add_child(frame_button) + frame_button.connect("on_frame_pressed", self, "_on_frame_pressed") + return frame_button + + +func add_frame(frame): + var frame_button = add_new_frame_button() + frame_button.set_frame(frame) + return frame_button + + +func remove_frame(idx): + var child = frame_button_container.get_child(idx) + frame_button_container.remove_child(child) + child.queue_free() + + +func _on_frame_pressed(frame_btn_index): + emit_signal("on_frame_pressed", get_index(), frame_btn_index) + + +func _on_AddFrame_pressed(): + var frame_button = add_new_frame_button() + emit_signal("on_add_frame_pressed", get_index(), frame_button.get_index()) + + +func _on_AnimationButton_on_animation_button_pressed(): + emit_signal("on_animation_pressed", get_index()) + + +func _on_AnimationButton_pressed(): + pass # Replace with function body. + + +func _on_Up_pressed(): + emit_signal("on_move_up_pressed", get_index()) + + +func _on_Down_pressed(): + emit_signal("on_move_down_pressed", get_index()) + + +func _on_Duplicate_pressed(): + emit_signal("on_animation_duplicated", get_index()) + + +func _on_Delete_pressed(): + emit_signal("on_deleted", get_index()) + diff --git a/addons/Godoxel/components/AnimationStripe.tscn b/addons/Godoxel/components/AnimationStripe.tscn new file mode 100644 index 0000000..53d681c --- /dev/null +++ b/addons/Godoxel/components/AnimationStripe.tscn @@ -0,0 +1,132 @@ +[gd_scene load_steps=8 format=2] + +[ext_resource path="res://addons/Godoxel/components/AnimationButton.tscn" type="PackedScene" id=1] +[ext_resource path="res://addons/Godoxel/components/AnimationStripe.gd" type="Script" id=2] +[ext_resource path="res://addons/Godoxel/themes/AnimationStripe_Panel_normal.tres" type="StyleBox" id=3] +[ext_resource path="res://addons/Godoxel/assets/bitstream_vera_sans_font_6016/Vera.ttf" type="DynamicFontData" id=4] +[ext_resource path="res://addons/Godoxel/assets/animation_arrow_up.png" type="Texture" id=5] +[ext_resource path="res://addons/Godoxel/assets/animation_arrow_down.png" type="Texture" id=6] + +[sub_resource type="DynamicFont" id=1] +size = 12 +use_filter = true +font_data = ExtResource( 4 ) + +[node name="AnimationStripe" type="Panel"] +anchor_right = 1.0 +anchor_bottom = 1.0 +margin_right = -813.0 +margin_bottom = -666.0 +rect_min_size = Vector2( 0, 54 ) +size_flags_horizontal = 3 +custom_styles/panel = ExtResource( 3 ) +script = ExtResource( 2 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="HBoxContainer" type="HBoxContainer" parent="."] +anchor_right = 1.0 +anchor_bottom = 1.0 +margin_left = 4.0 +margin_right = -4.0 +rect_pivot_offset = Vector2( -149, -134 ) +size_flags_horizontal = 3 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="AnimationButton" parent="HBoxContainer" instance=ExtResource( 1 )] +margin_top = 7.0 +margin_right = 120.0 +margin_bottom = 47.0 +rect_min_size = Vector2( 120, 40 ) +size_flags_vertical = 4 +custom_fonts/font = SubResource( 1 ) + +[node name="VBoxContainer" type="VBoxContainer" parent="HBoxContainer"] +margin_left = 124.0 +margin_right = 152.0 +margin_bottom = 54.0 +rect_min_size = Vector2( 20, 0 ) +custom_constants/separation = 5 +alignment = 1 + +[node name="Up" type="TextureButton" parent="HBoxContainer/VBoxContainer"] +margin_top = 6.0 +margin_right = 28.0 +margin_bottom = 18.0 +rect_min_size = Vector2( 28, 12 ) +size_flags_vertical = 6 +texture_normal = ExtResource( 5 ) +expand = true +stretch_mode = 5 + +[node name="Down" type="TextureButton" parent="HBoxContainer/VBoxContainer"] +margin_top = 35.0 +margin_right = 28.0 +margin_bottom = 47.0 +rect_min_size = Vector2( 28, 12 ) +size_flags_vertical = 6 +texture_normal = ExtResource( 6 ) +expand = true +stretch_mode = 5 + +[node name="ScrollContainer" type="ScrollContainer" parent="HBoxContainer"] +margin_left = 156.0 +margin_right = 333.0 +margin_bottom = 54.0 +rect_min_size = Vector2( 80, 0 ) +mouse_filter = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +scroll_vertical_enabled = false + +[node name="HBoxContainer" type="HBoxContainer" parent="HBoxContainer/ScrollContainer"] +margin_right = 54.0 +margin_bottom = 54.0 +size_flags_vertical = 3 + +[node name="FrameContainer" type="HBoxContainer" parent="HBoxContainer/ScrollContainer/HBoxContainer"] +margin_bottom = 54.0 +rect_min_size = Vector2( 0, 38 ) + +[node name="HBoxContainer" type="HBoxContainer" parent="HBoxContainer/ScrollContainer/HBoxContainer"] +margin_left = 4.0 +margin_right = 54.0 +margin_bottom = 54.0 +size_flags_vertical = 5 + +[node name="AddFrame" type="Button" parent="HBoxContainer/ScrollContainer/HBoxContainer/HBoxContainer"] +margin_right = 50.0 +margin_bottom = 54.0 +rect_min_size = Vector2( 50, 0 ) +text = "+" + +[node name="Duplicate" type="Button" parent="HBoxContainer"] +margin_left = 337.0 +margin_top = 9.0 +margin_right = 406.0 +margin_bottom = 44.0 +rect_min_size = Vector2( 0, 35 ) +size_flags_vertical = 4 +custom_fonts/font = SubResource( 1 ) +text = "Duplicate" + +[node name="Delete" type="Button" parent="HBoxContainer"] +margin_left = 410.0 +margin_top = 9.0 +margin_right = 459.0 +margin_bottom = 44.0 +rect_min_size = Vector2( 0, 35 ) +size_flags_vertical = 4 +custom_fonts/font = SubResource( 1 ) +text = "delete" + +[connection signal="on_animation_button_pressed" from="HBoxContainer/AnimationButton" to="." method="_on_AnimationButton_on_animation_button_pressed"] +[connection signal="pressed" from="HBoxContainer/AnimationButton" to="." method="_on_AnimationButton_pressed"] +[connection signal="pressed" from="HBoxContainer/VBoxContainer/Up" to="." method="_on_Up_pressed"] +[connection signal="pressed" from="HBoxContainer/VBoxContainer/Down" to="." method="_on_Down_pressed"] +[connection signal="pressed" from="HBoxContainer/ScrollContainer/HBoxContainer/HBoxContainer/AddFrame" to="." method="_on_AddFrame_pressed"] +[connection signal="pressed" from="HBoxContainer/Duplicate" to="." method="_on_Duplicate_pressed"] +[connection signal="pressed" from="HBoxContainer/Delete" to="." method="_on_Delete_pressed"] diff --git a/addons/Godoxel/components/FrameButton.gd b/addons/Godoxel/components/FrameButton.gd new file mode 100644 index 0000000..a756018 --- /dev/null +++ b/addons/Godoxel/components/FrameButton.gd @@ -0,0 +1,55 @@ +extends Button +tool + +signal on_frame_pressed(btn) + +onready var frame_preview := find_node("TextureRect") + +var frame: GEFrame + + +func _ready(): + pass + + +func set_frame(frame: GEFrame): + self.frame = frame + update_preview() + + +func set_layer_visibility(layer_idx: int, visibility: bool): + frame.layers[layer_idx].visible = visibility + + +func update_preview(): + for child in get_children(): + remove_child(child) + child.queue_free() + + for layer in frame.layers: + if not layer.visible: + continue + var texture_rect = TextureRect.new() + add_child(texture_rect) + texture_rect.expand = true + texture_rect.stretch_mode = TextureRect.STRETCH_KEEP_ASPECT_CENTERED + texture_rect.anchor_bottom = 1 + texture_rect.anchor_right = 1 + texture_rect.margin_left = 3 + texture_rect.margin_top = 3 + texture_rect.margin_right = -3 + texture_rect.margin_bottom = -3 + + texture_rect.texture = layer.texture + + +func move_layer_forward(): + pass + + +func move_layer_back(): + pass + + +func _on_FrameButton_pressed(): + emit_signal("on_frame_pressed", get_index()) diff --git a/addons/Godoxel/components/FrameButton.tscn b/addons/Godoxel/components/FrameButton.tscn new file mode 100644 index 0000000..51395e4 --- /dev/null +++ b/addons/Godoxel/components/FrameButton.tscn @@ -0,0 +1,50 @@ +[gd_scene load_steps=5 format=2] + +[ext_resource path="res://addons/Godoxel/components/FrameButton.gd" type="Script" id=1] + +[sub_resource type="StyleBoxFlat" id=3] +bg_color = Color( 0.933333, 0.933333, 0.933333, 1 ) +border_color = Color( 0.266667, 0.266667, 0.266667, 1 ) + +[sub_resource type="StyleBoxFlat" id=2] +bg_color = Color( 0.933333, 0.933333, 0.933333, 1 ) +border_width_left = 3 +border_width_top = 3 +border_width_right = 3 +border_width_bottom = 3 +border_color = Color( 0.662745, 0.662745, 0.662745, 1 ) + +[sub_resource type="StyleBoxFlat" id=1] +bg_color = Color( 0.721569, 0.721569, 0.721569, 1 ) +border_width_left = 3 +border_width_top = 3 +border_width_right = 3 +border_width_bottom = 3 +border_color = Color( 0.45098, 0.45098, 0.45098, 1 ) + +[node name="FrameButton" type="Button"] +margin_right = 50.0 +margin_bottom = 20.0 +rect_min_size = Vector2( 50, 50 ) +custom_styles/hover = SubResource( 3 ) +custom_styles/focus = SubResource( 2 ) +custom_styles/normal = SubResource( 1 ) +script = ExtResource( 1 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="TextureRect" type="TextureRect" parent="."] +anchor_right = 1.0 +anchor_bottom = 1.0 +margin_left = 3.0 +margin_top = 3.0 +margin_right = -3.0 +margin_bottom = -3.0 +expand = true +stretch_mode = 6 +__meta__ = { +"_edit_use_anchors_": false +} + +[connection signal="pressed" from="." to="." method="_on_FrameButton_pressed"] diff --git a/addons/Godoxel/components/ShortcutPanel.gd b/addons/Godoxel/components/ShortcutPanel.gd new file mode 100644 index 0000000..507f69e --- /dev/null +++ b/addons/Godoxel/components/ShortcutPanel.gd @@ -0,0 +1,29 @@ +extends Panel +tool + +onready var name_label = find_node("Name") +onready var shortcut_label = find_node("Shortcut") + +const select_theme = preload("res://addons/Godoxel/themes/ShortcutPanel_selected.tres") +const deselect_theme = preload("res://addons/Godoxel/themes/ShortcutPanel_deselected.tres") + + +func _ready(): + set("custom_styles/panel", deselect_theme) + + +func set_tool(tool_name, tool_shortcut): + name_label.text = tool_name + shortcut_label.text = tool_shortcut + + +func select(): + set("custom_styles/panel", select_theme) + + +func deselect(): + set("custom_styles/panel", deselect_theme) + + +func get_shortcut(): + return shortcut_label.text diff --git a/addons/Godoxel/components/ShortcutPanel.tscn b/addons/Godoxel/components/ShortcutPanel.tscn new file mode 100644 index 0000000..263da77 --- /dev/null +++ b/addons/Godoxel/components/ShortcutPanel.tscn @@ -0,0 +1,39 @@ +[gd_scene load_steps=3 format=2] + +[ext_resource path="res://addons/Godoxel/components/ShortcutPanel.gd" type="Script" id=1] +[ext_resource path="res://addons/Godoxel/themes/ShortcutPanel_deselected.tres" type="StyleBox" id=2] + +[node name="ShortcutPanel" type="Panel"] +margin_right = 85.0 +margin_bottom = 75.0 +rect_min_size = Vector2( 85, 75 ) +size_flags_horizontal = 0 +size_flags_vertical = 0 +custom_styles/panel = ExtResource( 2 ) +script = ExtResource( 1 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="VBoxContainer" type="VBoxContainer" parent="."] +anchor_right = 1.0 +anchor_bottom = 1.0 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Name" type="Label" parent="VBoxContainer"] +margin_right = 85.0 +margin_bottom = 35.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +align = 1 +valign = 2 + +[node name="Shortcut" type="Label" parent="VBoxContainer"] +margin_top = 39.0 +margin_right = 85.0 +margin_bottom = 75.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +align = 1 diff --git a/addons/Godoxel/components/ShortcutWindow.gd b/addons/Godoxel/components/ShortcutWindow.gd new file mode 100644 index 0000000..17181b7 --- /dev/null +++ b/addons/Godoxel/components/ShortcutWindow.gd @@ -0,0 +1,59 @@ +extends Panel +tool + +onready var shortcut_container = find_node("ShortcutContainer") + +var shortcuts = {} +var shift_pressed = false +var panels = [] + + +func _ready(): + hide() + panels.clear() + for child in get_child(0).get_children(): + for panel in child.get_children(): + if panel is Panel: + panels.append(panel) + + +func setup(shortcuts: Dictionary): + self.shortcuts = shortcuts + var idx = 0 + for panel in panels: + var tool_name = "" + if typeof(shortcuts.values()[idx]) == TYPE_STRING: + tool_name = str(shortcuts.values()[idx]) + else: + tool_name = str(owner.Tools.keys()[shortcuts.values()[idx]]) + tool_name = tool_name.to_lower().capitalize() + + var shortcut = OS.get_scancode_string(shortcuts.keys()[idx]) + panel.set_tool(tool_name, shortcut) + idx += 1 + + +func check_input_for_shorcut(event: InputEvent, shift_pressed: bool): + if not event is InputEventKey: + return + + if event.pressed: + if event.scancode in shortcuts.keys(): + for panel in panels: + panel.deselect() + get_panel(event.as_text()).select() + return true + else: + for panel in panels: + panel.deselect() + return false + + +func get_panel(scancode: String): + var character = scancode.substr(scancode.length() - 1, 1) + for panel in panels: + if panel.get_shortcut() == character: + return panel + return null + + diff --git a/addons/Godoxel/components/ShortcutWindow.tscn b/addons/Godoxel/components/ShortcutWindow.tscn new file mode 100644 index 0000000..aae430e --- /dev/null +++ b/addons/Godoxel/components/ShortcutWindow.tscn @@ -0,0 +1,114 @@ +[gd_scene load_steps=4 format=2] + +[ext_resource path="res://addons/Godoxel/components/ShortcutWindow.gd" type="Script" id=1] +[ext_resource path="res://addons/Godoxel/components/ShortcutPanel.tscn" type="PackedScene" id=2] + +[sub_resource type="StyleBoxFlat" id=1] +bg_color = Color( 0.247059, 0.239216, 0.239216, 0.819608 ) +border_color = Color( 1, 1, 1, 1 ) +border_blend = true +corner_radius_top_left = 20 +corner_radius_top_right = 80 +corner_radius_bottom_right = 20 +corner_radius_bottom_left = 80 + +[node name="ShortcutWindow" type="Panel"] +visible = false +margin_right = 390.0 +margin_bottom = 328.0 +rect_pivot_offset = Vector2( -497, -187 ) +custom_styles/panel = SubResource( 1 ) +script = ExtResource( 1 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="ShortcutContainer" type="VBoxContainer" parent="."] +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +margin_left = -189.0 +margin_top = -124.0 +margin_right = 158.0 +margin_bottom = 158.0 +custom_constants/separation = 15 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="HBoxContainer" type="HBoxContainer" parent="ShortcutContainer"] +margin_right = 355.0 +margin_bottom = 75.0 +size_flags_vertical = 0 +custom_constants/separation = 15 +alignment = 1 + +[node name="PAINT" parent="ShortcutContainer/HBoxContainer" instance=ExtResource( 2 )] +margin_left = 35.0 +margin_right = 120.0 + +[node name="BUCKET" parent="ShortcutContainer/HBoxContainer" instance=ExtResource( 2 )] +margin_left = 135.0 +margin_right = 220.0 + +[node name="RAINBOW" parent="ShortcutContainer/HBoxContainer" instance=ExtResource( 2 )] +margin_left = 235.0 +margin_right = 320.0 + +[node name="HBoxContainer2" type="HBoxContainer" parent="ShortcutContainer"] +margin_top = 90.0 +margin_right = 355.0 +margin_bottom = 165.0 +size_flags_vertical = 0 +custom_constants/separation = 15 +alignment = 1 + +[node name="Control" type="Control" parent="ShortcutContainer/HBoxContainer2"] +margin_left = 17.0 +margin_right = 37.0 +margin_bottom = 75.0 +rect_min_size = Vector2( 20, 0 ) + +[node name="LINE" parent="ShortcutContainer/HBoxContainer2" instance=ExtResource( 2 )] +margin_left = 52.0 +margin_right = 137.0 + +[node name="RECT" parent="ShortcutContainer/HBoxContainer2" instance=ExtResource( 2 )] +margin_left = 152.0 +margin_right = 237.0 + +[node name="COLORPICKER" parent="ShortcutContainer/HBoxContainer2" instance=ExtResource( 2 )] +margin_left = 252.0 +margin_right = 337.0 + +[node name="HBoxContainer3" type="HBoxContainer" parent="ShortcutContainer"] +margin_top = 180.0 +margin_right = 355.0 +margin_bottom = 255.0 +size_flags_vertical = 0 +custom_constants/separation = 15 +alignment = 1 + +[node name="Control" type="Control" parent="ShortcutContainer/HBoxContainer3"] +margin_right = 20.0 +margin_bottom = 75.0 +rect_min_size = Vector2( 20, 0 ) + +[node name="Control2" type="Control" parent="ShortcutContainer/HBoxContainer3"] +margin_left = 35.0 +margin_right = 55.0 +margin_bottom = 75.0 +rect_min_size = Vector2( 20, 0 ) + +[node name="BRIGHTEN" parent="ShortcutContainer/HBoxContainer3" instance=ExtResource( 2 )] +margin_left = 70.0 +margin_right = 155.0 + +[node name="DARKEN" parent="ShortcutContainer/HBoxContainer3" instance=ExtResource( 2 )] +margin_left = 170.0 +margin_right = 255.0 + +[node name="CUT" parent="ShortcutContainer/HBoxContainer3" instance=ExtResource( 2 )] +margin_left = 270.0 +margin_right = 355.0 diff --git a/addons/Godoxel/dialogs/ChangeCanvasDialog.gd b/addons/Godoxel/dialogs/ChangeCanvasDialog.gd new file mode 100644 index 0000000..0d0a511 --- /dev/null +++ b/addons/Godoxel/dialogs/ChangeCanvasDialog.gd @@ -0,0 +1,29 @@ +extends GEDraggableWindow +tool + + +var width_comp: SpinBox +var height_comp: SpinBox + + +func _ready() -> void: + connect("on_ok", self, "_on_ConfirmationDialog_confirmed") + connect("visibility_changed", self, "_on_ChangeCanvasSize_visibility_changed") + + yield(owner, "ready") + + width_comp = add_component_float("Width (px)", owner.paint_canvas.canvas_width, 1, 5000) + height_comp = add_component_float("Height (px)", owner.paint_canvas.canvas_height, 1, 5000) + + +func _on_ConfirmationDialog_confirmed(): + var width = width_comp.value + var height = height_comp.value + print("change canvas size: ", width, " ", height) + owner.resize(width, height) + + +func _on_ChangeCanvasSize_visibility_changed(): + if visible: + width_comp.value = owner.paint_canvas.canvas_width + height_comp.value = owner.paint_canvas.canvas_height diff --git a/addons/Godoxel/dialogs/ChangeGridSizeDialog.gd b/addons/Godoxel/dialogs/ChangeGridSizeDialog.gd new file mode 100644 index 0000000..2aea630 --- /dev/null +++ b/addons/Godoxel/dialogs/ChangeGridSizeDialog.gd @@ -0,0 +1,28 @@ +extends AcceptDialog +tool + +func _ready(): + yield(owner, "ready") + find_node("GridValue").value = owner.paint_canvas.grid_size + find_node("BigGridValue").value = owner.paint_canvas.big_grid_size + + +func _on_ChangeGridSizeDialog_confirmed(): + var grid_size = find_node("GridValue").value + var big_grid_size = find_node("BigGridValue").value + owner.paint_canvas.grid_size = grid_size + owner.paint_canvas.big_grid_size = big_grid_size + + +func _on_GridValue_value_changed(value): + var grid_size = value + owner.paint_canvas.grid_size = grid_size + + +func _on_BigGridValue_value_changed(value): + var big_grid_size = value + owner.paint_canvas.big_grid_size = big_grid_size + + +func _on_ChangeGridSizeDialog_visibility_changed(): + pass # Replace with function body. diff --git a/addons/Godoxel/dialogs/ConfirmationDialog.gd b/addons/Godoxel/dialogs/ConfirmationDialog.gd new file mode 100644 index 0000000..07b15a0 --- /dev/null +++ b/addons/Godoxel/dialogs/ConfirmationDialog.gd @@ -0,0 +1,20 @@ +extends ConfirmationDialog +tool + +func _ready(): + yield(owner, "ready") + find_node("Width").value = owner.paint_canvas.canvas_width + find_node("Height").value = owner.paint_canvas.canvas_height + + +func _on_ConfirmationDialog_confirmed(): + var width = find_node("Width").value + var height = find_node("Height").value + print("change canvas size: ", width, " ", height) + owner.paint_canvas.resize(width, height) + + +func _on_ChangeCanvasSize_visibility_changed(): + if visible: + find_node("Width").value = owner.paint_canvas.canvas_width + find_node("Height").value = owner.paint_canvas.canvas_height diff --git a/addons/Godoxel/dialogs/DraggableWindow.gd b/addons/Godoxel/dialogs/DraggableWindow.gd new file mode 100644 index 0000000..fb56c59 --- /dev/null +++ b/addons/Godoxel/dialogs/DraggableWindow.gd @@ -0,0 +1,128 @@ +extends Control +class_name GEDraggableWindow +tool + +signal on_cancel() +signal on_ok() + +export(bool) var show_ok_cancel = true setget set_ok_cancel_visible +export(bool) var show_close = true setget set_close_visible +export(String) var title = "" setget set_title + +onready var title_bar = find_node("TitleBar") +onready var close_button = find_node("CloseButton") +onready var title_label = find_node("Title") +onready var main = find_node("Main") +var _main_child = null + +var dragging = false +var mouse_offset = Vector2.ZERO +var children = [] + + +func _ready() -> void: + _main_child = main.get_child(0) + + set_title(title) + set_ok_cancel_visible(show_ok_cancel) + set_close_visible(show_close) + + hide() + + +func set_title(new_title: String): + title = new_title + + if title_label: + title_label.text = title + + +func set_ok_cancel_visible(new_visible: bool): + show_ok_cancel = new_visible + if _main_child: + _main_child.visible = show_ok_cancel + + +func set_close_visible(new_visible: bool): + show_close = new_visible + if close_button: + close_button.visible = show_close + + +func _add_child(child, legible_unique_name=false): + main.add_child(child, legible_unique_name) + _main_child.raise() + + +func _input(event: InputEvent) -> void: + if not dragging or not visible: + return + rect_global_position = get_global_mouse_position() - mouse_offset + if event is InputEventMouseButton: + if event.button_index == BUTTON_LEFT and not event.pressed: + dragging = false + + +func _on_ColorRect2_gui_input(event: InputEvent) -> void: + if not visible: + return + + if event is InputEventMouseButton: + if not Rect2(title_bar.rect_global_position, title_bar.rect_size).has_point( + get_global_mouse_position()): + return + if event.button_index == BUTTON_LEFT and event.pressed: + dragging = true + mouse_offset = get_global_mouse_position() - rect_global_position + + + +################################################## +# Components +################################################## + +func add_component_float(comp_name: String, + default: float, from: float = -1, to: float = -1) -> SpinBox: + var label = Label.new() + label.text = comp_name + + var spinbox = SpinBox.new() + spinbox.value = default + + if not is_equal_approx(from, to): + spinbox.min_value = from + spinbox.max_value = to + + var hbox = HBoxContainer.new() + hbox.add_child(label) + hbox.add_child(spinbox) + label.size_flags_horizontal = Label.SIZE_EXPAND_FILL + label.size_flags_vertical = Label.SIZE_EXPAND_FILL + spinbox.size_flags_horizontal = Label.SIZE_EXPAND_FILL + spinbox.size_flags_vertical = Label.SIZE_EXPAND_FILL + + _add_child(hbox) + + return spinbox + + + +################################################## +# Signals +################################################## + +func _on_Button_pressed() -> void: + hide() + emit_signal("on_cancel") + + +func _on_Ok_pressed() -> void: + emit_signal("on_ok") + hide() + + +func _on_Cancel_pressed() -> void: + hide() + emit_signal("on_cancel") + + diff --git a/addons/Godoxel/dialogs/DraggableWindow.tscn b/addons/Godoxel/dialogs/DraggableWindow.tscn new file mode 100644 index 0000000..ef000a1 --- /dev/null +++ b/addons/Godoxel/dialogs/DraggableWindow.tscn @@ -0,0 +1,172 @@ +[gd_scene load_steps=4 format=2] + +[ext_resource path="res://addons/Godoxel/dialogs/DraggableWindow.gd" type="Script" id=1] + +[sub_resource type="StyleBoxFlat" id=62] +bg_color = Color( 0.88, 0.3696, 0.3696, 1 ) + +[sub_resource type="StyleBoxFlat" id=63] +content_margin_left = 5.0 +content_margin_right = 5.0 +content_margin_top = 5.0 +content_margin_bottom = 5.0 + +[node name="Window" type="Control"] +visible = false +margin_right = 236.0 +margin_bottom = 136.0 +script = ExtResource( 1 ) +__meta__ = { +"_edit_use_anchors_": true +} + +[node name="ColorRect" type="ColorRect" parent="."] +anchor_right = 1.0 +rect_min_size = Vector2( 0, 24 ) +size_flags_horizontal = 3 +color = Color( 0.12549, 0.141176, 0.192157, 1 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="VBoxContainer" type="HBoxContainer" parent="ColorRect"] +anchor_right = 1.0 +anchor_bottom = 1.0 +custom_constants/separation = 0 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="TitleBar" type="Control" parent="ColorRect/VBoxContainer"] +margin_right = 212.0 +margin_bottom = 24.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 + +[node name="Title" type="Label" parent="ColorRect/VBoxContainer/TitleBar"] +anchor_right = 1.0 +anchor_bottom = 1.0 +align = 1 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="CloseButton" type="Button" parent="ColorRect/VBoxContainer"] +margin_left = 212.0 +margin_right = 236.0 +margin_bottom = 24.0 +rect_min_size = Vector2( 24, 24 ) +custom_styles/normal = SubResource( 62 ) + +[node name="ColorRect" type="ColorRect" parent="ColorRect/VBoxContainer/CloseButton"] +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +margin_left = -5.0 +margin_top = -6.0 +margin_right = 11.0 +margin_bottom = -5.0 +rect_rotation = 45.0 +mouse_filter = 2 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="ColorRect2" type="ColorRect" parent="ColorRect/VBoxContainer/CloseButton"] +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +margin_left = -6.0 +margin_top = 5.0 +margin_right = 10.0 +margin_bottom = 6.0 +rect_rotation = -45.0 +mouse_filter = 2 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="ColorRect2" type="ColorRect" parent="."] +show_behind_parent = true +anchor_right = 1.0 +anchor_bottom = 1.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +color = Color( 0.2, 0.227451, 0.309804, 1 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="ColorRect" type="ColorRect" parent="ColorRect2"] +anchor_right = 1.0 +anchor_bottom = 1.0 +margin_left = 5.0 +margin_top = 5.0 +margin_right = -5.0 +margin_bottom = -5.0 +mouse_filter = 2 +color = Color( 0.234, 0.2655, 0.36, 1 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Main" type="VBoxContainer" parent="ColorRect2"] +anchor_right = 1.0 +anchor_bottom = 1.0 +margin_left = 5.0 +margin_top = 5.0 +margin_right = -5.0 +margin_bottom = -5.0 +mouse_filter = 2 +alignment = 2 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="VBoxContainer" type="VBoxContainer" parent="ColorRect2/Main"] +margin_top = 98.0 +margin_right = 226.0 +margin_bottom = 126.0 +mouse_filter = 2 + +[node name="HBoxContainer" type="HBoxContainer" parent="ColorRect2/Main/VBoxContainer"] +margin_right = 226.0 +margin_bottom = 24.0 +mouse_filter = 2 +alignment = 1 + +[node name="Ok" type="Button" parent="ColorRect2/Main/VBoxContainer/HBoxContainer"] +margin_left = 58.0 +margin_right = 88.0 +margin_bottom = 24.0 +rect_min_size = Vector2( 30, 19 ) +custom_styles/normal = SubResource( 63 ) +text = "Ok" + +[node name="Control" type="Control" parent="ColorRect2/Main/VBoxContainer/HBoxContainer"] +margin_left = 92.0 +margin_right = 112.0 +margin_bottom = 24.0 +rect_min_size = Vector2( 20, 0 ) +mouse_filter = 2 + +[node name="Cancel" type="Button" parent="ColorRect2/Main/VBoxContainer/HBoxContainer"] +margin_left = 116.0 +margin_right = 168.0 +margin_bottom = 24.0 +rect_min_size = Vector2( 30, 19 ) +custom_styles/normal = SubResource( 63 ) +text = "Cancel" + +[node name="Control" type="Control" parent="ColorRect2/Main/VBoxContainer"] +margin_top = 28.0 +margin_right = 226.0 +margin_bottom = 28.0 +mouse_filter = 2 + +[connection signal="pressed" from="ColorRect/VBoxContainer/CloseButton" to="." method="_on_Button_pressed"] +[connection signal="gui_input" from="ColorRect2" to="." method="_on_ColorRect2_gui_input"] +[connection signal="pressed" from="ColorRect2/Main/VBoxContainer/HBoxContainer/Ok" to="." method="_on_Ok_pressed"] +[connection signal="pressed" from="ColorRect2/Main/VBoxContainer/HBoxContainer/Cancel" to="." method="_on_Cancel_pressed"] diff --git a/addons/Godoxel/dialogs/LoadFileDialog.gd b/addons/Godoxel/dialogs/LoadFileDialog.gd new file mode 100644 index 0000000..50a75fc --- /dev/null +++ b/addons/Godoxel/dialogs/LoadFileDialog.gd @@ -0,0 +1,112 @@ +tool +extends FileDialog + + +enum LoadMode { + IMPORT_IMAGE, + LOAD_PROJECT, +} + +var canvas: GECanvas +var file_path = "" +var load_mode = LoadMode.IMPORT_IMAGE + + +func _ready(): + get_line_edit().connect("text_entered", self, "_on_LineEdit_text_entered") + invalidate() + clear_filters() + add_filter("*.png ; PNG Images") + + +func _on_LineEdit_text_entered(_text): + return +# print(_text) + #load_img() +# print("hsadfasd") + + + +####################################################### +# dialogs +####################################################### + +func open_load_project(): + invalidate() + clear_filters() + add_filter("*.godoxel ; Godot - Godoxel") + load_mode = LoadMode.LOAD_PROJECT + show() + + +func open_import_image(): + invalidate() + clear_filters() + add_filter("*.png ; PNG Images") + load_mode = LoadMode.IMPORT_IMAGE + show() + + + +####################################################### +# dialogs +####################################################### + +func _on_LoadFileDialog_file_selected(path): + file_path = path + + match load_mode: + LoadMode.IMPORT_IMAGE: + import_image() + LoadMode.LOAD_PROJECT: + load_project() + + +func load_project(): + var file = File.new() + file.open(file_path, File.READ) + var data = JSON.parse(file.get_as_text()).result + file.close() + + owner.load_project(data) + + +func import_image(): + var image = Image.new() + if image.load(file_path) != OK: + print("couldn't load image!") + return + + var image_data = image.get_data() + var layer: GELayer = owner.add_new_layer() + + var width = image.get_width() + var height = image.get_height() + + if owner.paint_canvas.canvas_width < width: + owner.resize(width, owner.paint_canvas.canvas_height) + + if owner.paint_canvas.canvas_height < height: + owner.resize(owner.paint_canvas.canvas_width, height) + + for i in range(image_data.size() / 4): + var color = Color(image_data[i*4] / 255.0, image_data[i*4+1] / 255.0, image_data[i*4+2] / 255.0, image_data[i*4+3] / 255.0) + var pos = GEUtils.to_2D(i, image.get_width()) + if pos.x > layer.layer_width: + continue + + layer.set_pixel(pos.x, pos.y, color) + layer.update_texture() + owner._update_frame_button_previews() + + +func _on_LoadFileDialog_confirmed(): + return + + +func _on_LoadFileDialog_about_to_show(): + invalidate() + + +func _on_LoadFileDialog_visibility_changed(): + invalidate() diff --git a/addons/Godoxel/dialogs/LoadFileDialog.tscn b/addons/Godoxel/dialogs/LoadFileDialog.tscn new file mode 100644 index 0000000..0d083c0 --- /dev/null +++ b/addons/Godoxel/dialogs/LoadFileDialog.tscn @@ -0,0 +1,22 @@ +[gd_scene load_steps=2 format=2] + +[sub_resource type="GDScript" id=1] +script/source = "extends ConfirmationDialog + +func _ready(): + get_ok().connect(\"pressed\", self, \"hide\") + get_cancel().connect(\"pressed\", self, \"hide\") + + + +" + +[node name="LoadFileDialog" type="FileDialog"] +margin_right = 604.0 +margin_bottom = 367.0 +window_title = "Open a File" +mode = 0 +access = 2 +current_dir = "/Projects/BitBucket/GraphicsEditor" +current_path = "/Projects/BitBucket/GraphicsEditor/" +script = SubResource( 1 ) diff --git a/addons/Godoxel/plugin.cfg b/addons/Godoxel/plugin.cfg new file mode 100644 index 0000000..526cfb3 --- /dev/null +++ b/addons/Godoxel/plugin.cfg @@ -0,0 +1,7 @@ +[plugin] + +name="Godoxel - Pixel Image Editor" +description="" +author="" +version="" +script="plugin.gd" diff --git a/addons/Godoxel/plugin.gd b/addons/Godoxel/plugin.gd new file mode 100644 index 0000000..c288aaf --- /dev/null +++ b/addons/Godoxel/plugin.gd @@ -0,0 +1,37 @@ +tool +extends EditorPlugin + +var editor_scene = load("res://addons/Godoxel/Editor.tscn").instance() + +func _enter_tree(): + editor_scene.name = "Editor" + if get_editor_interface().get_editor_viewport().has_node("Editor"): + var n = get_editor_interface().get_editor_viewport().get_node("Editor") + n.name = "EditorDel" + n.queue_free() + get_editor_interface().get_editor_viewport().add_child(editor_scene, true) + editor_scene.owner = get_editor_interface().get_editor_viewport() + make_visible(false) + + +func _exit_tree(): + if editor_scene: + editor_scene.queue_free() + + +func has_main_screen(): + return true + + +func make_visible(visible): + if editor_scene: + editor_scene.visible = visible + + +func get_plugin_name(): + return "Godoxel" + + +func get_plugin_icon(): + # Must return some kind of Texture for the icon. + return get_editor_interface().get_base_control().get_icon("CanvasModulate", "EditorIcons") diff --git a/addons/Godoxel/themes/AnimationStripe_Panel_draggable.tres b/addons/Godoxel/themes/AnimationStripe_Panel_draggable.tres new file mode 100644 index 0000000..0200614 --- /dev/null +++ b/addons/Godoxel/themes/AnimationStripe_Panel_draggable.tres @@ -0,0 +1,4 @@ +[gd_resource type="StyleBoxFlat" format=2] + +[resource] +bg_color = Color( 0.442, 0.5015, 0.68, 1 ) diff --git a/addons/Godoxel/themes/AnimationStripe_Panel_dragging.tres b/addons/Godoxel/themes/AnimationStripe_Panel_dragging.tres new file mode 100644 index 0000000..c25d34d --- /dev/null +++ b/addons/Godoxel/themes/AnimationStripe_Panel_dragging.tres @@ -0,0 +1,4 @@ +[gd_resource type="StyleBoxFlat" format=2] + +[resource] +bg_color = Color( 0.7426, 0.77221, 0.94, 1 ) diff --git a/addons/Godoxel/themes/AnimationStripe_Panel_normal.tres b/addons/Godoxel/themes/AnimationStripe_Panel_normal.tres new file mode 100644 index 0000000..699cc0b --- /dev/null +++ b/addons/Godoxel/themes/AnimationStripe_Panel_normal.tres @@ -0,0 +1,4 @@ +[gd_resource type="StyleBoxFlat" format=2] + +[resource] +bg_color = Color( 0.27451, 0.309804, 0.419608, 1 ) diff --git a/addons/Godoxel/themes/ShortcutPanel_deselected.tres b/addons/Godoxel/themes/ShortcutPanel_deselected.tres new file mode 100644 index 0000000..d724934 --- /dev/null +++ b/addons/Godoxel/themes/ShortcutPanel_deselected.tres @@ -0,0 +1,13 @@ +[gd_resource type="StyleBoxFlat" format=2] + +[resource] +bg_color = Color( 0.141176, 0.141176, 0.141176, 0.607843 ) +border_width_left = 1 +border_width_top = 1 +border_width_right = 1 +border_width_bottom = 1 +border_blend = true +corner_radius_top_left = 7 +corner_radius_top_right = 25 +corner_radius_bottom_right = 7 +corner_radius_bottom_left = 25 diff --git a/addons/Godoxel/themes/ShortcutPanel_selected.tres b/addons/Godoxel/themes/ShortcutPanel_selected.tres new file mode 100644 index 0000000..5b89768 --- /dev/null +++ b/addons/Godoxel/themes/ShortcutPanel_selected.tres @@ -0,0 +1,9 @@ +[gd_resource type="StyleBoxFlat" format=2] + +[resource] +bg_color = Color( 0.411765, 0.411765, 0.411765, 0.607843 ) +border_blend = true +corner_radius_top_left = 7 +corner_radius_top_right = 25 +corner_radius_bottom_right = 7 +corner_radius_bottom_left = 25 diff --git a/art/entities/fiend.png b/art/entities/fiend.png new file mode 100644 index 0000000..897d6c5 --- /dev/null +++ b/art/entities/fiend.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:42e68360f3f01617f9e5b8ecb68b159793531dfda6b64ca37a270fc28d86f83a +size 180 diff --git a/art/entities/fiend.png.import b/art/entities/fiend.png.import new file mode 100644 index 0000000..c89daf5 --- /dev/null +++ b/art/entities/fiend.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/fiend.png-46f0c65314f5bbca8d0599edf0d36a2b.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://art/entities/fiend.png" +dest_files=[ "res://.import/fiend.png-46f0c65314f5bbca8d0599edf0d36a2b.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/nodes/FittingSprite.gd b/nodes/FittingSprite.gd new file mode 100644 index 0000000..1cf264b --- /dev/null +++ b/nodes/FittingSprite.gd @@ -0,0 +1,14 @@ +tool +extends Sprite +class_name TK_FittingSprite + +## A Sprite that is resized to absolute pixel size, no matter the texture. + +export var target_size: Vector2 setget _set_target_size + +func _set_target_size(p_size: Vector2) -> void: + target_size = p_size + _update_scale() + +func _update_scale() -> void: + scale = target_size / texture.get_size() diff --git a/nodes/GridContext.gd b/nodes/GridContext.gd new file mode 100644 index 0000000..5f21175 --- /dev/null +++ b/nodes/GridContext.gd @@ -0,0 +1,13 @@ +extends Node2D +class_name TK_GridContext + +## todo: Cell visualization. +## todo: Integration of TileMap. + +export var cell_size: Vector2 = Vector2(64, 64) + +func position_to_cell_position(p_position: Vector2) -> Vector2: + return Arithmetic.vector2_mod(global_position - p_position, cell_size) + +func is_cell_traversible(p_cell_position: Vector2) -> bool: + return true diff --git a/nodes/GridContext.tscn b/nodes/GridContext.tscn new file mode 100644 index 0000000..3522db6 --- /dev/null +++ b/nodes/GridContext.tscn @@ -0,0 +1,6 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://nodes/GridContext.gd" type="Script" id=1] + +[node name="GridContext" type="Node2D"] +script = ExtResource( 1 ) diff --git a/nodes/GridController.gd b/nodes/GridController.gd new file mode 100644 index 0000000..eb5dd72 --- /dev/null +++ b/nodes/GridController.gd @@ -0,0 +1,26 @@ +extends Node +class_name TK_GridController + +## Composable 4-way grid controller. +## Depends on placement below some Node2D below some GridContext. + +signal moved(p_new_cell_position) + +func _input(p_event: InputEvent): + var direction := InputUtils.input_event_to_4way_direction(p_event) + if direction == Vector2.ZERO: + return + + var context := _get_grid_context() + var cell = context.position_to_cell_position(get_parent().global_position) + var new_cell = cell + direction + if context.is_cell_traversible(new_cell): + # todo: Should we move the outmost node2d? + get_parent().position += context.cell_size * direction + emit_signal("moved", new_cell) + +func _get_grid_context() -> Node: + var current := self.get_parent().get_parent() + while current.name != "GridContext": + current = current.get_parent() + return current diff --git a/nodes/GridController.tscn b/nodes/GridController.tscn new file mode 100644 index 0000000..59c9e3f --- /dev/null +++ b/nodes/GridController.tscn @@ -0,0 +1,6 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://nodes/GridController.gd" type="Script" id=1] + +[node name="GridController" type="Node"] +script = ExtResource( 1 ) diff --git a/nodes/singletons/Arithmetic.gd b/nodes/singletons/Arithmetic.gd new file mode 100644 index 0000000..5be6587 --- /dev/null +++ b/nodes/singletons/Arithmetic.gd @@ -0,0 +1,8 @@ +extends Node +class_name TK_Arithmetic + +static func float_mod(p_a: float, p_b: float) -> float: + return p_a - (p_b * floor(p_a / p_b)) + +static func vector2_mod(p_a: Vector2, p_b: Vector2) -> Vector2: + return p_a - (p_b * (p_a / p_b).floor()) diff --git a/nodes/singletons/InputUtils.gd b/nodes/singletons/InputUtils.gd new file mode 100644 index 0000000..06a5e1e --- /dev/null +++ b/nodes/singletons/InputUtils.gd @@ -0,0 +1,13 @@ +extends Node + +func input_event_to_4way_direction(p_event: InputEvent) -> Vector2: + var result := Vector2.ZERO + if p_event.is_action_pressed("move_down"): + result.y += 1 + if p_event.is_action_pressed("move_right"): + result.x += 1 + if p_event.is_action_pressed("move_up"): + result.y -= 1 + if p_event.is_action_pressed("move_left"): + result.x -= 1 + return result diff --git a/project.godot b/project.godot new file mode 100644 index 0000000..7062b5a --- /dev/null +++ b/project.godot @@ -0,0 +1,210 @@ +; Engine configuration file. +; It's best edited using the editor UI and not directly, +; since the parameters that go here are not all obvious. +; +; Format: +; [section] ; section goes between [] +; param=value ; assign values to parameters + +config_version=4 + +_global_script_classes=[ { +"base": "Reference", +"class": "BrushPrefabs", +"language": "GDScript", +"path": "res://addons/Godoxel/BrushPrefabs.gd" +}, { +"base": "Node", +"class": "GEAction", +"language": "GDScript", +"path": "res://addons/Godoxel/actions/Action.gd" +}, { +"base": "Node", +"class": "GEAnimation", +"language": "GDScript", +"path": "res://addons/Godoxel/Animation.gd" +}, { +"base": "GEAction", +"class": "GEBrighten", +"language": "GDScript", +"path": "res://addons/Godoxel/actions/Brighten.gd" +}, { +"base": "GEAction", +"class": "GEBrush", +"language": "GDScript", +"path": "res://addons/Godoxel/actions/Brush.gd" +}, { +"base": "GEAction", +"class": "GEBucket", +"language": "GDScript", +"path": "res://addons/Godoxel/actions/Bucket.gd" +}, { +"base": "Control", +"class": "GECanvas", +"language": "GDScript", +"path": "res://addons/Godoxel/Canvas.gd" +}, { +"base": "GEAction", +"class": "GECut", +"language": "GDScript", +"path": "res://addons/Godoxel/actions/Cut.gd" +}, { +"base": "GEAction", +"class": "GEDarken", +"language": "GDScript", +"path": "res://addons/Godoxel/actions/Darken.gd" +}, { +"base": "Control", +"class": "GEDraggableWindow", +"language": "GDScript", +"path": "res://addons/Godoxel/dialogs/DraggableWindow.gd" +}, { +"base": "Control", +"class": "GEFrame", +"language": "GDScript", +"path": "res://addons/Godoxel/Frame.gd" +}, { +"base": "Reference", +"class": "GELayer", +"language": "GDScript", +"path": "res://addons/Godoxel/Layer.gd" +}, { +"base": "GEAction", +"class": "GELine", +"language": "GDScript", +"path": "res://addons/Godoxel/actions/Line.gd" +}, { +"base": "GEAction", +"class": "GEMultiLine", +"language": "GDScript", +"path": "res://addons/Godoxel/actions/MultiLine.gd" +}, { +"base": "GEAction", +"class": "GEPasteCut", +"language": "GDScript", +"path": "res://addons/Godoxel/actions/PasteCut.gd" +}, { +"base": "GEAction", +"class": "GEPencil", +"language": "GDScript", +"path": "res://addons/Godoxel/actions/Pencil.gd" +}, { +"base": "GEAction", +"class": "GERainbow", +"language": "GDScript", +"path": "res://addons/Godoxel/actions/Rainbow.gd" +}, { +"base": "GEAction", +"class": "GERect", +"language": "GDScript", +"path": "res://addons/Godoxel/actions/Rect.gd" +}, { +"base": "Node", +"class": "GEUtils", +"language": "GDScript", +"path": "res://addons/Godoxel/Util.gd" +}, { +"base": "Node", +"class": "TK_Arithmetic", +"language": "GDScript", +"path": "res://nodes/singletons/Arithmetic.gd" +}, { +"base": "Sprite", +"class": "TK_FittingSprite", +"language": "GDScript", +"path": "res://nodes/FittingSprite.gd" +}, { +"base": "Node2D", +"class": "TK_GridContext", +"language": "GDScript", +"path": "res://nodes/GridContext.gd" +}, { +"base": "Node", +"class": "TK_GridController", +"language": "GDScript", +"path": "res://nodes/GridController.gd" +} ] +_global_script_class_icons={ +"BrushPrefabs": "", +"GEAction": "", +"GEAnimation": "", +"GEBrighten": "", +"GEBrush": "", +"GEBucket": "", +"GECanvas": "", +"GECut": "", +"GEDarken": "", +"GEDraggableWindow": "", +"GEFrame": "", +"GELayer": "", +"GELine": "", +"GEMultiLine": "", +"GEPasteCut": "", +"GEPencil": "", +"GERainbow": "", +"GERect": "", +"GEUtils": "", +"TK_Arithmetic": "", +"TK_FittingSprite": "", +"TK_GridContext": "", +"TK_GridController": "" +} + +[application] + +config/name="TochieKit" +run/main_scene="res://scenes/Game.tscn" +config/icon="res://icon.png" + +[autoload] + +Arithmetic="*res://nodes/singletons/Arithmetic.gd" +InputUtils="*res://nodes/singletons/InputUtils.gd" + +[editor_plugins] + +enabled=PoolStringArray( "res://addons/Godoxel/plugin.cfg" ) + +[gui] + +common/drop_mouse_on_gui_input_disabled=true + +[input] + +move_up={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":0,"physical_scancode":87,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777232,"physical_scancode":0,"unicode":0,"echo":false,"script":null) + ] +} +move_right={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":0,"physical_scancode":68,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777233,"physical_scancode":0,"unicode":0,"echo":false,"script":null) + ] +} +move_down={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":0,"physical_scancode":83,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777234,"physical_scancode":0,"unicode":0,"echo":false,"script":null) + ] +} +move_left={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":0,"physical_scancode":65,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777231,"physical_scancode":0,"unicode":0,"echo":false,"script":null) + ] +} + +[physics] + +common/enable_pause_aware_picking=true + +[rendering] + +quality/driver/driver_name="GLES2" +2d/snapping/use_gpu_pixel_snap=true +vram_compression/import_etc=true +vram_compression/import_etc2=false +environment/default_clear_color=Color( 0.00784314, 0, 0.117647, 1 ) +environment/default_environment="res://default_env.tres" diff --git a/scenes/Game.tscn b/scenes/Game.tscn new file mode 100644 index 0000000..a2fd1a4 --- /dev/null +++ b/scenes/Game.tscn @@ -0,0 +1,21 @@ +[gd_scene load_steps=5 format=2] + +[ext_resource path="res://nodes/FittingSprite.gd" type="Script" id=1] +[ext_resource path="res://art/entities/fiend.png" type="Texture" id=2] +[ext_resource path="res://nodes/GridController.gd" type="Script" id=3] +[ext_resource path="res://nodes/GridContext.tscn" type="PackedScene" id=4] + +[node name="Game" type="Node"] + +[node name="GridContext" parent="." instance=ExtResource( 4 )] + +[node name="Fiend" type="Sprite" parent="GridContext"] +position = Vector2( 128, 128 ) +scale = Vector2( 4, 4 ) +texture = ExtResource( 2 ) +centered = false +script = ExtResource( 1 ) +target_size = Vector2( 64, 64 ) + +[node name="GridController" type="Node" parent="GridContext/Fiend"] +script = ExtResource( 3 )