Skip to content

Commit

Permalink
1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
skejeton committed Dec 26, 2024
1 parent 198c8b1 commit e1432ea
Show file tree
Hide file tree
Showing 5 changed files with 125 additions and 11 deletions.
2 changes: 1 addition & 1 deletion box.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tophat",
"version": "v1.4.0",
"version": "v1.5.0",
"author": "Marek Maškarinec <[email protected]>",
"license": "BSD-3",
"description": "A 2d game framework",
Expand Down
32 changes: 28 additions & 4 deletions cmd/win-buildmodules.bat
Original file line number Diff line number Diff line change
@@ -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!
Expand Down
3 changes: 2 additions & 1 deletion src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
97 changes: 93 additions & 4 deletions src/staembed.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "tophat.h"
// Generated via cmd/win-buildmodules.bat
#include "tophat.h"
const char *th_em_modulesrc[] = {
"\n"
"import (\n"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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[] = {
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.4
v1.5

0 comments on commit e1432ea

Please sign in to comment.