diff --git a/box.json b/box.json index 17e9f8c..75f8e6d 100644 --- a/box.json +++ b/box.json @@ -1,6 +1,6 @@ { "name": "tophat", - "version": "v1.4.0", + "version": "v1.5.0", "author": "Marek Maškarinec ", "license": "BSD-3", "description": "A 2d game framework", diff --git a/cmd/win-buildmodules.bat b/cmd/win-buildmodules.bat index 9c10904..bda5516 100644 --- a/cmd/win-buildmodules.bat +++ b/cmd/win-buildmodules.bat @@ -1,16 +1,40 @@ @echo off setlocal enableDelayedExpansion -set modules=umka/anim.um umka/audio.um umka/csv.um umka/ent.um umka/image.um umka/input.um umka/misc.um umka/canvas.um umka/rect.um umka/tilemap.um umka/window.um umka/particles.um umka/lerp.um umka/font.um umka/th.um umka/signal.um umka/atlas.um umka/shader.um umka/color.um umka/coll.um umka/placeholders.um umka/nav.um umka/ui.um +set modules=^ + umka/anim.um^ + umka/atlas.um^ + umka/audio.um^ + umka/canvas.um^ + umka/coll.um^ + umka/color.um^ + umka/csv.um^ + umka/ent.um^ + umka/font.um^ + umka/image.um^ + umka/input.um^ + umka/lerp.um^ + umka/misc.um^ + umka/nav.um^ + umka/particles.um^ + umka/placeholders.um^ + umka/rect.um^ + umka/rt.um^ + umka/shader.um^ + umka/signal.um^ + umka/th.um^ + umka/tilemap.um^ + umka/ui.um^ + umka/window.um set module_names=%modules:umka/=% +set docs=%modules:.um=.md% set umka=lib\umka\umka_windows_msvc\umka.exe set em_target=src\staembed.c set run=%umka% cmd\buildhelper.um set images=etc/test.ff etc/icon.ff etc/button.ff -set docs=umka/anim.md umka/audio.md umka/csv.md umka/ent.md umka/image.md umka/input.md umka/misc.md umka/canvas.md umka/rect.md umka/tilemap.md umka/window.md umka/particles.md umka/lerp.md umka/font.md umka/th.md umka/signal.md umka/atlas.md umka/shader.md umka/color.md umka/coll.md umka/placeholders.md umka/nav.md umka/ui.md -echo. > %em_target% -echo #include "tophat.h" > %em_target% +echo // Generated via cmd/win-buildmodules.bat > %em_target% +echo #include "tophat.h" >> %em_target% for %%f in (%modules%) do ( set pat=%%f set pat=!pat:.um=.md! diff --git a/src/Makefile b/src/Makefile index 17824f3..cb47386 100644 --- a/src/Makefile +++ b/src/Makefile @@ -44,7 +44,8 @@ IMAGES = etc/test.ff etc/icon.ff etc/button.ff $(EM_TARGET): $(UMKA_MODULES) $(UMKA_DOCS) $(IMAGES_MOD) LICENSE version $(HELPER_SCRIPT) $(UMKA_BIN) $(IMAGES) @echo EM $@ - @echo '#include "tophat.h"' > $(EM_TARGET) + @echo '// Generated via src/Makefile' > $(EM_TARGET) + @echo '#include "tophat.h"' >> $(EM_TARGET) @$(UMKA_BIN) $(HELPER_SCRIPT) em th_em_modulesrc $(UMKA_MODULES) >> $(EM_TARGET) @$(UMKA_BIN) $(HELPER_SCRIPT) argarr th_em_modulenames $(UMKA_MODULES:umka/%=%) >> $(EM_TARGET) @$(UMKA_BIN) $(HELPER_SCRIPT) em th_em_misc LICENSE version >> $(EM_TARGET) diff --git a/src/staembed.c b/src/staembed.c index 9666ea4..0bceca9 100644 --- a/src/staembed.c +++ b/src/staembed.c @@ -1,4 +1,5 @@ -#include "tophat.h" +// Generated via cmd/win-buildmodules.bat +#include "tophat.h" const char *th_em_modulesrc[] = { "\n" "import (\n" @@ -2718,7 +2719,7 @@ const char *th_em_modulesrc[] = { "\n" "fn umth_conv_path(path: str): str\n" "//~~fn convPath\n" -"// Expands the path to a platform specific path.\n" +"// Evaluate path prefixes and return as a platform native path.\n" "fn convPath*(path: str): str {\n" "//~~\n" "\treturn umth_conv_path(path)\n" @@ -4108,7 +4109,7 @@ const char *th_em_misc[] = { "OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n" "OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n" "", -"v1.4\n" +"v1.5\n" "", }; const char *th_em_moduledocs[] = { @@ -4422,6 +4423,94 @@ const char *th_em_moduledocs[] = { "---------\n" "\n" "", +"\n" +"\n" +"\n" +"Canvas library allowing for drawing basic shapes. Coordinates are based on\n" +"the screen.\n" +"\n" +"---------\n" +"\n" +"fn drawText\n" +"\n" +"fn drawText*(text: str, pos: th::Vf2, color: uint32, size: th::fu) {\n" +"\n" +"Draws a basic pixel text. Only ascii is supported.\n" +"\n" +"---------\n" +"\n" +"fn textSize\n" +"\n" +"fn textSize*(text: str, scale: th::fu): th::Vf2 {\n" +"\n" +"Returns the size of text taken by an equivalent drawText call.\n" +"\n" +"---------\n" +"\n" +"Pixel Font\n" +"\n" +"var pixelFont*: PixelFont\n" +"\n" +"The `pixelFont` variable exposes the canvas pixel font as a generic font.\n" +"\n" +"---------\n" +"\n" +"fn drawRect\n" +"\n" +"fn drawRect*(color: uint32, r: rect::Rect) {\n" +"\n" +"Draws a Rectangle.\n" +"\n" +"---------\n" +"\n" +"fn drawLine\n" +"\n" +"fn drawLine*(color: uint32, b, e: th::Vf2, thickness: th::fu) {\n" +"\n" +"Draws a line.\n" +"\n" +"---------\n" +"\n" +"fn drawRectLines\n" +"\n" +"fn drawRectLines*(color: uint32, r: rect::Rect, thickness: real32 = 1.0) {\n" +"\n" +"Draws rect border.\n" +"\n" +"---------\n" +"\n" +"fn drawQuad\n" +"\n" +"fn drawQuad*(color: uint32, q: th::Quad) {\n" +"\n" +"Draws a convex quad.\n" +"\n" +"---------\n" +"\n" +"fn drawTrig\n" +"\n" +"fn drawTrig*(color: uint32, a, b, c: th::Vf2) {\n" +"\n" +"Draws a triangle.\n" +"\n" +"---------\n" +"\n" +"fn beginScissorRect\n" +"\n" +"fn beginScissorRect*(r: rect::Rect, debug: bool = false) {\n" +"\n" +"Disable rendering outside of rect `r`\n" +"\n" +"---------\n" +"\n" +"fn endScissor\n" +"\n" +"fn endScissor*() {\n" +"\n" +"Stops cropping\n" +"\n" +"---------\n" +"\n" "", "\n" "\n" @@ -6137,7 +6226,7 @@ const char *th_em_moduledocs[] = { "\n" "fn convPath*(path: str): str {\n" "\n" -"Expands the path to a platform specific path.\n" +"Evaluate path prefixes and return as a platform native path.\n" "\n" "---------\n" "\n" diff --git a/version b/version index b1f7421..1ce69a7 100644 --- a/version +++ b/version @@ -1 +1 @@ -v1.4 +v1.5