Skip to content

Commit e1432ea

Browse files
committed
1.5
1 parent 198c8b1 commit e1432ea

File tree

5 files changed

+125
-11
lines changed

5 files changed

+125
-11
lines changed

box.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "tophat",
3-
"version": "v1.4.0",
3+
"version": "v1.5.0",
44
"author": "Marek Maškarinec <marek@mrms.cz>",
55
"license": "BSD-3",
66
"description": "A 2d game framework",

cmd/win-buildmodules.bat

+28-4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,40 @@
11
@echo off
22
setlocal enableDelayedExpansion
33

4-
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
4+
set modules=^
5+
umka/anim.um^
6+
umka/atlas.um^
7+
umka/audio.um^
8+
umka/canvas.um^
9+
umka/coll.um^
10+
umka/color.um^
11+
umka/csv.um^
12+
umka/ent.um^
13+
umka/font.um^
14+
umka/image.um^
15+
umka/input.um^
16+
umka/lerp.um^
17+
umka/misc.um^
18+
umka/nav.um^
19+
umka/particles.um^
20+
umka/placeholders.um^
21+
umka/rect.um^
22+
umka/rt.um^
23+
umka/shader.um^
24+
umka/signal.um^
25+
umka/th.um^
26+
umka/tilemap.um^
27+
umka/ui.um^
28+
umka/window.um
529
set module_names=%modules:umka/=%
30+
set docs=%modules:.um=.md%
631
set umka=lib\umka\umka_windows_msvc\umka.exe
732
set em_target=src\staembed.c
833
set run=%umka% cmd\buildhelper.um
934
set images=etc/test.ff etc/icon.ff etc/button.ff
10-
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
1135

12-
echo. > %em_target%
13-
echo #include "tophat.h" > %em_target%
36+
echo // Generated via cmd/win-buildmodules.bat > %em_target%
37+
echo #include "tophat.h" >> %em_target%
1438
for %%f in (%modules%) do (
1539
set pat=%%f
1640
set pat=!pat:.um=.md!

src/Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ IMAGES = etc/test.ff etc/icon.ff etc/button.ff
4444

4545
$(EM_TARGET): $(UMKA_MODULES) $(UMKA_DOCS) $(IMAGES_MOD) LICENSE version $(HELPER_SCRIPT) $(UMKA_BIN) $(IMAGES)
4646
@echo EM $@
47-
@echo '#include "tophat.h"' > $(EM_TARGET)
47+
@echo '// Generated via src/Makefile' > $(EM_TARGET)
48+
@echo '#include "tophat.h"' >> $(EM_TARGET)
4849
@$(UMKA_BIN) $(HELPER_SCRIPT) em th_em_modulesrc $(UMKA_MODULES) >> $(EM_TARGET)
4950
@$(UMKA_BIN) $(HELPER_SCRIPT) argarr th_em_modulenames $(UMKA_MODULES:umka/%=%) >> $(EM_TARGET)
5051
@$(UMKA_BIN) $(HELPER_SCRIPT) em th_em_misc LICENSE version >> $(EM_TARGET)

src/staembed.c

+93-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#include "tophat.h"
1+
// Generated via cmd/win-buildmodules.bat
2+
#include "tophat.h"
23
const char *th_em_modulesrc[] = {
34
"\n"
45
"import (\n"
@@ -2718,7 +2719,7 @@ const char *th_em_modulesrc[] = {
27182719
"\n"
27192720
"fn umth_conv_path(path: str): str\n"
27202721
"//~~fn convPath\n"
2721-
"// Expands the path to a platform specific path.\n"
2722+
"// Evaluate path prefixes and return as a platform native path.\n"
27222723
"fn convPath*(path: str): str {\n"
27232724
"//~~\n"
27242725
"\treturn umth_conv_path(path)\n"
@@ -4108,7 +4109,7 @@ const char *th_em_misc[] = {
41084109
"OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n"
41094110
"OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
41104111
"",
4111-
"v1.4\n"
4112+
"v1.5\n"
41124113
"",
41134114
};
41144115
const char *th_em_moduledocs[] = {
@@ -4422,6 +4423,94 @@ const char *th_em_moduledocs[] = {
44224423
"---------\n"
44234424
"\n"
44244425
"",
4426+
"\n"
4427+
"\n"
4428+
"\n"
4429+
"Canvas library allowing for drawing basic shapes. Coordinates are based on\n"
4430+
"the screen.\n"
4431+
"\n"
4432+
"---------\n"
4433+
"\n"
4434+
"fn drawText\n"
4435+
"\n"
4436+
"fn drawText*(text: str, pos: th::Vf2, color: uint32, size: th::fu) {\n"
4437+
"\n"
4438+
"Draws a basic pixel text. Only ascii is supported.\n"
4439+
"\n"
4440+
"---------\n"
4441+
"\n"
4442+
"fn textSize\n"
4443+
"\n"
4444+
"fn textSize*(text: str, scale: th::fu): th::Vf2 {\n"
4445+
"\n"
4446+
"Returns the size of text taken by an equivalent drawText call.\n"
4447+
"\n"
4448+
"---------\n"
4449+
"\n"
4450+
"Pixel Font\n"
4451+
"\n"
4452+
"var pixelFont*: PixelFont\n"
4453+
"\n"
4454+
"The `pixelFont` variable exposes the canvas pixel font as a generic font.\n"
4455+
"\n"
4456+
"---------\n"
4457+
"\n"
4458+
"fn drawRect\n"
4459+
"\n"
4460+
"fn drawRect*(color: uint32, r: rect::Rect) {\n"
4461+
"\n"
4462+
"Draws a Rectangle.\n"
4463+
"\n"
4464+
"---------\n"
4465+
"\n"
4466+
"fn drawLine\n"
4467+
"\n"
4468+
"fn drawLine*(color: uint32, b, e: th::Vf2, thickness: th::fu) {\n"
4469+
"\n"
4470+
"Draws a line.\n"
4471+
"\n"
4472+
"---------\n"
4473+
"\n"
4474+
"fn drawRectLines\n"
4475+
"\n"
4476+
"fn drawRectLines*(color: uint32, r: rect::Rect, thickness: real32 = 1.0) {\n"
4477+
"\n"
4478+
"Draws rect border.\n"
4479+
"\n"
4480+
"---------\n"
4481+
"\n"
4482+
"fn drawQuad\n"
4483+
"\n"
4484+
"fn drawQuad*(color: uint32, q: th::Quad) {\n"
4485+
"\n"
4486+
"Draws a convex quad.\n"
4487+
"\n"
4488+
"---------\n"
4489+
"\n"
4490+
"fn drawTrig\n"
4491+
"\n"
4492+
"fn drawTrig*(color: uint32, a, b, c: th::Vf2) {\n"
4493+
"\n"
4494+
"Draws a triangle.\n"
4495+
"\n"
4496+
"---------\n"
4497+
"\n"
4498+
"fn beginScissorRect\n"
4499+
"\n"
4500+
"fn beginScissorRect*(r: rect::Rect, debug: bool = false) {\n"
4501+
"\n"
4502+
"Disable rendering outside of rect `r`\n"
4503+
"\n"
4504+
"---------\n"
4505+
"\n"
4506+
"fn endScissor\n"
4507+
"\n"
4508+
"fn endScissor*() {\n"
4509+
"\n"
4510+
"Stops cropping\n"
4511+
"\n"
4512+
"---------\n"
4513+
"\n"
44254514
"",
44264515
"\n"
44274516
"\n"
@@ -6137,7 +6226,7 @@ const char *th_em_moduledocs[] = {
61376226
"\n"
61386227
"fn convPath*(path: str): str {\n"
61396228
"\n"
6140-
"Expands the path to a platform specific path.\n"
6229+
"Evaluate path prefixes and return as a platform native path.\n"
61416230
"\n"
61426231
"---------\n"
61436232
"\n"

version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v1.4
1+
v1.5

0 commit comments

Comments
 (0)