├── .changeset ├── README.md ├── config.json └── olive-oranges-grin.md ├── .github ├── dependabot.yml └── workflows │ └── build.yml ├── .gitignore ├── CHANGELOG.md ├── CMakeLists.txt ├── LICENSE ├── README.md ├── ci ├── build-external.ts ├── build-native-coverage.ts ├── build-native.ts ├── build.ts ├── clean.ts ├── external-recipes │ ├── box2d.ts │ ├── cairo.ts │ ├── freetype │ │ ├── freetype.ts │ │ └── recipe │ │ │ ├── ft2build.h │ │ │ ├── ftmodule.h │ │ │ └── ftoption.h │ ├── headers.ts │ ├── imgui.ts │ ├── miniz.ts │ ├── pugixml.ts │ ├── quickjs.ts │ └── sokol.ts └── shdc-test │ ├── simple2d.glsl │ └── test.ts ├── docs ├── assets-idea.md ├── project-structure.md ├── random-notes.md ├── references.md └── todo.md ├── examples ├── 1-app │ ├── CMakeLists.txt │ ├── ek.ts │ └── src │ │ ├── config │ │ └── build_info.h │ │ └── main.c ├── 2-drawing │ ├── CMakeLists.txt │ ├── ek.ts │ └── src │ │ ├── config │ │ └── build_info.h │ │ └── main.c └── rnd-test │ ├── CMakeLists.txt │ ├── ek.ts │ └── src │ ├── config │ ├── BuildInfo.h │ └── build_info.h │ └── main.cpp ├── external ├── CMakeLists.txt ├── box2d │ ├── CMakeLists.txt │ ├── README.md │ ├── ek.ts │ ├── include │ │ └── box2d │ │ │ ├── b2_api.h │ │ │ ├── b2_block_allocator.h │ │ │ ├── b2_body.h │ │ │ ├── b2_broad_phase.h │ │ │ ├── b2_chain_shape.h │ │ │ ├── b2_circle_shape.h │ │ │ ├── b2_collision.h │ │ │ ├── b2_common.h │ │ │ ├── b2_contact.h │ │ │ ├── b2_contact_manager.h │ │ │ ├── b2_distance.h │ │ │ ├── b2_distance_joint.h │ │ │ ├── b2_draw.h │ │ │ ├── b2_dynamic_tree.h │ │ │ ├── b2_edge_shape.h │ │ │ ├── b2_fixture.h │ │ │ ├── b2_friction_joint.h │ │ │ ├── b2_gear_joint.h │ │ │ ├── b2_growable_stack.h │ │ │ ├── b2_joint.h │ │ │ ├── b2_math.h │ │ │ ├── b2_motor_joint.h │ │ │ ├── b2_mouse_joint.h │ │ │ ├── b2_polygon_shape.h │ │ │ ├── b2_prismatic_joint.h │ │ │ ├── b2_pulley_joint.h │ │ │ ├── b2_revolute_joint.h │ │ │ ├── b2_rope.h │ │ │ ├── b2_settings.h │ │ │ ├── b2_shape.h │ │ │ ├── b2_stack_allocator.h │ │ │ ├── b2_time_of_impact.h │ │ │ ├── b2_time_step.h │ │ │ ├── b2_timer.h │ │ │ ├── b2_types.h │ │ │ ├── b2_weld_joint.h │ │ │ ├── b2_wheel_joint.h │ │ │ ├── b2_world.h │ │ │ ├── b2_world_callbacks.h │ │ │ └── box2d.h │ ├── src │ │ ├── collision │ │ │ ├── b2_broad_phase.cpp │ │ │ ├── b2_chain_shape.cpp │ │ │ ├── b2_circle_shape.cpp │ │ │ ├── b2_collide_circle.cpp │ │ │ ├── b2_collide_edge.cpp │ │ │ ├── b2_collide_polygon.cpp │ │ │ ├── b2_collision.cpp │ │ │ ├── b2_distance.cpp │ │ │ ├── b2_dynamic_tree.cpp │ │ │ ├── b2_edge_shape.cpp │ │ │ ├── b2_polygon_shape.cpp │ │ │ └── b2_time_of_impact.cpp │ │ ├── common │ │ │ ├── b2_block_allocator.cpp │ │ │ ├── b2_draw.cpp │ │ │ ├── b2_math.cpp │ │ │ ├── b2_settings.cpp │ │ │ ├── b2_stack_allocator.cpp │ │ │ └── b2_timer.cpp │ │ ├── dynamics │ │ │ ├── b2_body.cpp │ │ │ ├── b2_chain_circle_contact.cpp │ │ │ ├── b2_chain_circle_contact.h │ │ │ ├── b2_chain_polygon_contact.cpp │ │ │ ├── b2_chain_polygon_contact.h │ │ │ ├── b2_circle_contact.cpp │ │ │ ├── b2_circle_contact.h │ │ │ ├── b2_contact.cpp │ │ │ ├── b2_contact_manager.cpp │ │ │ ├── b2_contact_solver.cpp │ │ │ ├── b2_contact_solver.h │ │ │ ├── b2_distance_joint.cpp │ │ │ ├── b2_edge_circle_contact.cpp │ │ │ ├── b2_edge_circle_contact.h │ │ │ ├── b2_edge_polygon_contact.cpp │ │ │ ├── b2_edge_polygon_contact.h │ │ │ ├── b2_fixture.cpp │ │ │ ├── b2_friction_joint.cpp │ │ │ ├── b2_gear_joint.cpp │ │ │ ├── b2_island.cpp │ │ │ ├── b2_island.h │ │ │ ├── b2_joint.cpp │ │ │ ├── b2_motor_joint.cpp │ │ │ ├── b2_mouse_joint.cpp │ │ │ ├── b2_polygon_circle_contact.cpp │ │ │ ├── b2_polygon_circle_contact.h │ │ │ ├── b2_polygon_contact.cpp │ │ │ ├── b2_polygon_contact.h │ │ │ ├── b2_prismatic_joint.cpp │ │ │ ├── b2_pulley_joint.cpp │ │ │ ├── b2_revolute_joint.cpp │ │ │ ├── b2_weld_joint.cpp │ │ │ ├── b2_wheel_joint.cpp │ │ │ ├── b2_world.cpp │ │ │ └── b2_world_callbacks.cpp │ │ └── rope │ │ │ └── b2_rope.cpp │ └── test │ │ ├── CMakeLists.txt │ │ └── main.cpp ├── cairo │ ├── CMakeLists.txt │ ├── README.md │ ├── src │ │ ├── cairo-analysis-surface-private.h │ │ ├── cairo-analysis-surface.c │ │ ├── cairo-arc-private.h │ │ ├── cairo-arc.c │ │ ├── cairo-array-private.h │ │ ├── cairo-array.c │ │ ├── cairo-atomic-private.h │ │ ├── cairo-atomic.c │ │ ├── cairo-backend-private.h │ │ ├── cairo-base64-stream.c │ │ ├── cairo-base85-stream.c │ │ ├── cairo-bentley-ottmann-rectangular.c │ │ ├── cairo-bentley-ottmann-rectilinear.c │ │ ├── cairo-bentley-ottmann.c │ │ ├── cairo-botor-scan-converter.c │ │ ├── cairo-box-inline.h │ │ ├── cairo-boxes-intersect.c │ │ ├── cairo-boxes-private.h │ │ ├── cairo-boxes.c │ │ ├── cairo-cache-private.h │ │ ├── cairo-cache.c │ │ ├── cairo-cff-subset.c │ │ ├── cairo-clip-boxes.c │ │ ├── cairo-clip-inline.h │ │ ├── cairo-clip-polygon.c │ │ ├── cairo-clip-private.h │ │ ├── cairo-clip-region.c │ │ ├── cairo-clip-surface.c │ │ ├── cairo-clip-tor-scan-converter.c │ │ ├── cairo-clip.c │ │ ├── cairo-color.c │ │ ├── cairo-colr-glyph-render.c │ │ ├── cairo-combsort-inline.h │ │ ├── cairo-compiler-private.h │ │ ├── cairo-composite-rectangles-private.h │ │ ├── cairo-composite-rectangles.c │ │ ├── cairo-compositor-private.h │ │ ├── cairo-compositor.c │ │ ├── cairo-contour-inline.h │ │ ├── cairo-contour-private.h │ │ ├── cairo-contour.c │ │ ├── cairo-ctype-inline.h │ │ ├── cairo-damage-private.h │ │ ├── cairo-damage.c │ │ ├── cairo-debug.c │ │ ├── cairo-default-context-private.h │ │ ├── cairo-default-context.c │ │ ├── cairo-deflate-stream.c │ │ ├── cairo-deprecated.h │ │ ├── cairo-device-private.h │ │ ├── cairo-device.c │ │ ├── cairo-dwrite.h │ │ ├── cairo-error-inline.h │ │ ├── cairo-error-private.h │ │ ├── cairo-error.c │ │ ├── cairo-fallback-compositor.c │ │ ├── cairo-features.h │ │ ├── cairo-fixed-private.h │ │ ├── cairo-fixed-type-private.h │ │ ├── cairo-fixed.c │ │ ├── cairo-font-face-twin-data.c │ │ ├── cairo-font-face-twin.c │ │ ├── cairo-font-face.c │ │ ├── cairo-font-options.c │ │ ├── cairo-fontconfig-private.h │ │ ├── cairo-freed-pool-private.h │ │ ├── cairo-freed-pool.c │ │ ├── cairo-freelist-private.h │ │ ├── cairo-freelist-type-private.h │ │ ├── cairo-freelist.c │ │ ├── cairo-ft-font.c │ │ ├── cairo-ft-private.h │ │ ├── cairo-ft.h │ │ ├── cairo-gstate-private.h │ │ ├── cairo-gstate.c │ │ ├── cairo-hash-private.h │ │ ├── cairo-hash.c │ │ ├── cairo-hull.c │ │ ├── cairo-image-compositor.c │ │ ├── cairo-image-info-private.h │ │ ├── cairo-image-info.c │ │ ├── cairo-image-mask-compositor.c │ │ ├── cairo-image-source.c │ │ ├── cairo-image-surface-inline.h │ │ ├── cairo-image-surface-private.h │ │ ├── cairo-image-surface.c │ │ ├── cairo-line-inline.h │ │ ├── cairo-line-private.h │ │ ├── cairo-line.c │ │ ├── cairo-list-inline.h │ │ ├── cairo-list-private.h │ │ ├── cairo-lzw.c │ │ ├── cairo-malloc-private.h │ │ ├── cairo-mask-compositor.c │ │ ├── cairo-matrix.c │ │ ├── cairo-mempool-private.h │ │ ├── cairo-mempool.c │ │ ├── cairo-mesh-pattern-rasterizer.c │ │ ├── cairo-misc.c │ │ ├── cairo-mono-scan-converter.c │ │ ├── cairo-mutex-impl-private.h │ │ ├── cairo-mutex-list-private.h │ │ ├── cairo-mutex-private.h │ │ ├── cairo-mutex-type-private.h │ │ ├── cairo-mutex.c │ │ ├── cairo-no-compositor.c │ │ ├── cairo-observer.c │ │ ├── cairo-output-stream-private.h │ │ ├── cairo-output-stream.c │ │ ├── cairo-paginated-private.h │ │ ├── cairo-paginated-surface-private.h │ │ ├── cairo-paginated-surface.c │ │ ├── cairo-path-bounds.c │ │ ├── cairo-path-fill.c │ │ ├── cairo-path-fixed-private.h │ │ ├── cairo-path-fixed.c │ │ ├── cairo-path-in-fill.c │ │ ├── cairo-path-private.h │ │ ├── cairo-path-stroke-boxes.c │ │ ├── cairo-path-stroke-polygon.c │ │ ├── cairo-path-stroke-traps.c │ │ ├── cairo-path-stroke-tristrip.c │ │ ├── cairo-path-stroke.c │ │ ├── cairo-path.c │ │ ├── cairo-pattern-inline.h │ │ ├── cairo-pattern-private.h │ │ ├── cairo-pattern.c │ │ ├── cairo-pdf-interchange.c │ │ ├── cairo-pdf-operators-private.h │ │ ├── cairo-pdf-operators.c │ │ ├── cairo-pdf-shading-private.h │ │ ├── cairo-pdf-shading.c │ │ ├── cairo-pdf-surface-private.h │ │ ├── cairo-pdf-surface.c │ │ ├── cairo-pdf.h │ │ ├── cairo-pen.c │ │ ├── cairo-pixman-private.h │ │ ├── cairo-png.c │ │ ├── cairo-polygon-intersect.c │ │ ├── cairo-polygon-reduce.c │ │ ├── cairo-polygon.c │ │ ├── cairo-private.h │ │ ├── cairo-ps-surface-private.h │ │ ├── cairo-ps-surface.c │ │ ├── cairo-ps.h │ │ ├── cairo-quartz-font.c │ │ ├── cairo-quartz-image-surface.c │ │ ├── cairo-quartz-image.h │ │ ├── cairo-quartz-private.h │ │ ├── cairo-quartz-surface.c │ │ ├── cairo-quartz.h │ │ ├── cairo-raster-source-pattern.c │ │ ├── cairo-recording-surface-inline.h │ │ ├── cairo-recording-surface-private.h │ │ ├── cairo-recording-surface.c │ │ ├── cairo-rectangle.c │ │ ├── cairo-rectangular-scan-converter.c │ │ ├── cairo-reference-count-private.h │ │ ├── cairo-region-private.h │ │ ├── cairo-region.c │ │ ├── cairo-rtree-private.h │ │ ├── cairo-rtree.c │ │ ├── cairo-scaled-font-private.h │ │ ├── cairo-scaled-font-subsets-private.h │ │ ├── cairo-scaled-font-subsets.c │ │ ├── cairo-scaled-font.c │ │ ├── cairo-script-private.h │ │ ├── cairo-script-surface.c │ │ ├── cairo-script.h │ │ ├── cairo-shape-mask-compositor.c │ │ ├── cairo-slope-private.h │ │ ├── cairo-slope.c │ │ ├── cairo-spans-compositor-private.h │ │ ├── cairo-spans-compositor.c │ │ ├── cairo-spans-private.h │ │ ├── cairo-spans.c │ │ ├── cairo-spline.c │ │ ├── cairo-stroke-dash-private.h │ │ ├── cairo-stroke-dash.c │ │ ├── cairo-stroke-style.c │ │ ├── cairo-surface-backend-private.h │ │ ├── cairo-surface-clipper-private.h │ │ ├── cairo-surface-clipper.c │ │ ├── cairo-surface-fallback-private.h │ │ ├── cairo-surface-fallback.c │ │ ├── cairo-surface-inline.h │ │ ├── cairo-surface-observer-inline.h │ │ ├── cairo-surface-observer-private.h │ │ ├── cairo-surface-observer.c │ │ ├── cairo-surface-offset-private.h │ │ ├── cairo-surface-offset.c │ │ ├── cairo-surface-private.h │ │ ├── cairo-surface-snapshot-inline.h │ │ ├── cairo-surface-snapshot-private.h │ │ ├── cairo-surface-snapshot.c │ │ ├── cairo-surface-subsurface-inline.h │ │ ├── cairo-surface-subsurface-private.h │ │ ├── cairo-surface-subsurface.c │ │ ├── cairo-surface-wrapper-private.h │ │ ├── cairo-surface-wrapper.c │ │ ├── cairo-surface.c │ │ ├── cairo-svg-glyph-render.c │ │ ├── cairo-svg-surface-private.h │ │ ├── cairo-svg-surface.c │ │ ├── cairo-svg.h │ │ ├── cairo-tag-attributes-private.h │ │ ├── cairo-tag-attributes.c │ │ ├── cairo-tag-stack-private.h │ │ ├── cairo-tag-stack.c │ │ ├── cairo-tee-surface-private.h │ │ ├── cairo-tee-surface.c │ │ ├── cairo-tee.h │ │ ├── cairo-time-private.h │ │ ├── cairo-time.c │ │ ├── cairo-tor-scan-converter.c │ │ ├── cairo-tor22-scan-converter.c │ │ ├── cairo-toy-font-face.c │ │ ├── cairo-traps-compositor.c │ │ ├── cairo-traps-private.h │ │ ├── cairo-traps.c │ │ ├── cairo-tristrip-private.h │ │ ├── cairo-tristrip.c │ │ ├── cairo-truetype-subset-private.h │ │ ├── cairo-truetype-subset.c │ │ ├── cairo-type1-fallback.c │ │ ├── cairo-type1-glyph-names.c │ │ ├── cairo-type1-private.h │ │ ├── cairo-type1-subset.c │ │ ├── cairo-type3-glyph-surface-private.h │ │ ├── cairo-type3-glyph-surface.c │ │ ├── cairo-types-private.h │ │ ├── cairo-unicode.c │ │ ├── cairo-user-font-private.h │ │ ├── cairo-user-font.c │ │ ├── cairo-version.c │ │ ├── cairo-version.h │ │ ├── cairo-wideint-private.h │ │ ├── cairo-wideint-type-private.h │ │ ├── cairo-wideint.c │ │ ├── cairo-win32.h │ │ ├── cairo-xcb-connection-core.c │ │ ├── cairo-xcb-connection-render.c │ │ ├── cairo-xcb-connection-shm.c │ │ ├── cairo-xcb-connection.c │ │ ├── cairo-xcb-private.h │ │ ├── cairo-xcb-resources.c │ │ ├── cairo-xcb-screen.c │ │ ├── cairo-xcb-shm.c │ │ ├── cairo-xcb-surface-core.c │ │ ├── cairo-xcb-surface-render.c │ │ ├── cairo-xcb-surface.c │ │ ├── cairo-xcb.h │ │ ├── cairo-xlib-core-compositor.c │ │ ├── cairo-xlib-display.c │ │ ├── cairo-xlib-fallback-compositor.c │ │ ├── cairo-xlib-private.h │ │ ├── cairo-xlib-render-compositor.c │ │ ├── cairo-xlib-screen.c │ │ ├── cairo-xlib-source.c │ │ ├── cairo-xlib-surface-private.h │ │ ├── cairo-xlib-surface-shm.c │ │ ├── cairo-xlib-surface.c │ │ ├── cairo-xlib-visual.c │ │ ├── cairo-xlib-xcb-surface.c │ │ ├── cairo-xlib-xrender-private.h │ │ ├── cairo-xlib-xrender.h │ │ ├── cairo-xlib.h │ │ ├── cairo-xml-surface.c │ │ ├── cairo-xml.h │ │ ├── cairo.c │ │ ├── cairo.h │ │ ├── cairoint.h │ │ ├── config.h │ │ ├── loongson-mmintrin.h │ │ ├── pixman-access-accessors.c │ │ ├── pixman-access.c │ │ ├── pixman-accessor.h │ │ ├── pixman-arm-asm.h │ │ ├── pixman-arm-common.h │ │ ├── pixman-arm-neon-asm-bilinear.S │ │ ├── pixman-arm-neon-asm.S │ │ ├── pixman-arm-neon-asm.h │ │ ├── pixman-arm-neon.c │ │ ├── pixman-arm-simd-asm-scaled.S │ │ ├── pixman-arm-simd-asm.S │ │ ├── pixman-arm-simd-asm.h │ │ ├── pixman-arm-simd.c │ │ ├── pixman-arm.c │ │ ├── pixman-bits-image.c │ │ ├── pixman-combine-float.c │ │ ├── pixman-combine32.c │ │ ├── pixman-combine32.h │ │ ├── pixman-compiler.h │ │ ├── pixman-config.h │ │ ├── pixman-conical-gradient.c │ │ ├── pixman-edge-accessors.c │ │ ├── pixman-edge-imp.h │ │ ├── pixman-edge.c │ │ ├── pixman-fast-path.c │ │ ├── pixman-filter.c │ │ ├── pixman-general.c │ │ ├── pixman-glyph.c │ │ ├── pixman-gradient-walker.c │ │ ├── pixman-image.c │ │ ├── pixman-implementation.c │ │ ├── pixman-inlines.h │ │ ├── pixman-linear-gradient.c │ │ ├── pixman-matrix.c │ │ ├── pixman-mips-dspr2-asm.S │ │ ├── pixman-mips-dspr2-asm.h │ │ ├── pixman-mips-dspr2.c │ │ ├── pixman-mips-dspr2.h │ │ ├── pixman-mips-memcpy-asm.S │ │ ├── pixman-mips.c │ │ ├── pixman-mmx.c │ │ ├── pixman-noop.c │ │ ├── pixman-ppc.c │ │ ├── pixman-private.h │ │ ├── pixman-radial-gradient.c │ │ ├── pixman-region.c │ │ ├── pixman-region16.c │ │ ├── pixman-region32.c │ │ ├── pixman-solid-fill.c │ │ ├── pixman-sse2.c │ │ ├── pixman-ssse3.c │ │ ├── pixman-timer.c │ │ ├── pixman-trap.c │ │ ├── pixman-utils.c │ │ ├── pixman-version.h │ │ ├── pixman-vmx.c │ │ ├── pixman-x86.c │ │ ├── pixman.c │ │ ├── pixman.h │ │ └── win32 │ │ │ ├── cairo-dwrite-font.cpp │ │ │ ├── cairo-dwrite-private.hpp │ │ │ ├── cairo-win32-debug.c │ │ │ ├── cairo-win32-device.c │ │ │ ├── cairo-win32-display-surface.c │ │ │ ├── cairo-win32-font.c │ │ │ ├── cairo-win32-gdi-compositor.c │ │ │ ├── cairo-win32-printing-surface.c │ │ │ ├── cairo-win32-private.h │ │ │ ├── cairo-win32-refptr.hpp │ │ │ ├── cairo-win32-surface.c │ │ │ ├── cairo-win32-system.c │ │ │ ├── d2d1-extra.h │ │ │ └── dw-extra.h │ └── test │ │ ├── CMakeLists.txt │ │ └── main.c ├── freetype │ ├── CMakeLists.txt │ ├── README.md │ ├── ek.ts │ ├── include │ │ ├── dlg │ │ │ ├── dlg.h │ │ │ └── output.h │ │ ├── freetype │ │ │ ├── config │ │ │ │ ├── ftconfig.h │ │ │ │ ├── ftheader.h │ │ │ │ ├── ftmodule.h │ │ │ │ ├── ftoption.h │ │ │ │ ├── ftstdlib.h │ │ │ │ ├── integer-types.h │ │ │ │ ├── mac-support.h │ │ │ │ └── public-macros.h │ │ │ ├── freetype.h │ │ │ ├── ftadvanc.h │ │ │ ├── ftbbox.h │ │ │ ├── ftbdf.h │ │ │ ├── ftbitmap.h │ │ │ ├── ftbzip2.h │ │ │ ├── ftcache.h │ │ │ ├── ftchapters.h │ │ │ ├── ftcid.h │ │ │ ├── ftcolor.h │ │ │ ├── ftdriver.h │ │ │ ├── fterrdef.h │ │ │ ├── fterrors.h │ │ │ ├── ftfntfmt.h │ │ │ ├── ftgasp.h │ │ │ ├── ftglyph.h │ │ │ ├── ftgxval.h │ │ │ ├── ftgzip.h │ │ │ ├── ftimage.h │ │ │ ├── ftincrem.h │ │ │ ├── ftlcdfil.h │ │ │ ├── ftlist.h │ │ │ ├── ftlogging.h │ │ │ ├── ftlzw.h │ │ │ ├── ftmac.h │ │ │ ├── ftmm.h │ │ │ ├── ftmodapi.h │ │ │ ├── ftmoderr.h │ │ │ ├── ftotval.h │ │ │ ├── ftoutln.h │ │ │ ├── ftparams.h │ │ │ ├── ftpfr.h │ │ │ ├── ftrender.h │ │ │ ├── ftsizes.h │ │ │ ├── ftsnames.h │ │ │ ├── ftstroke.h │ │ │ ├── ftsynth.h │ │ │ ├── ftsystem.h │ │ │ ├── fttrigon.h │ │ │ ├── fttypes.h │ │ │ ├── ftwinfnt.h │ │ │ ├── internal │ │ │ │ ├── autohint.h │ │ │ │ ├── cffotypes.h │ │ │ │ ├── cfftypes.h │ │ │ │ ├── compiler-macros.h │ │ │ │ ├── ftcalc.h │ │ │ │ ├── ftdebug.h │ │ │ │ ├── ftdrv.h │ │ │ │ ├── ftgloadr.h │ │ │ │ ├── fthash.h │ │ │ │ ├── ftmemory.h │ │ │ │ ├── ftmmtypes.h │ │ │ │ ├── ftobjs.h │ │ │ │ ├── ftpsprop.h │ │ │ │ ├── ftrfork.h │ │ │ │ ├── ftserv.h │ │ │ │ ├── ftstream.h │ │ │ │ ├── fttrace.h │ │ │ │ ├── ftvalid.h │ │ │ │ ├── psaux.h │ │ │ │ ├── pshints.h │ │ │ │ ├── services │ │ │ │ │ ├── svbdf.h │ │ │ │ │ ├── svcfftl.h │ │ │ │ │ ├── svcid.h │ │ │ │ │ ├── svfntfmt.h │ │ │ │ │ ├── svgldict.h │ │ │ │ │ ├── svgxval.h │ │ │ │ │ ├── svkern.h │ │ │ │ │ ├── svmetric.h │ │ │ │ │ ├── svmm.h │ │ │ │ │ ├── svotval.h │ │ │ │ │ ├── svpfr.h │ │ │ │ │ ├── svpostnm.h │ │ │ │ │ ├── svprop.h │ │ │ │ │ ├── svpscmap.h │ │ │ │ │ ├── svpsinfo.h │ │ │ │ │ ├── svsfnt.h │ │ │ │ │ ├── svttcmap.h │ │ │ │ │ ├── svtteng.h │ │ │ │ │ ├── svttglyf.h │ │ │ │ │ └── svwinfnt.h │ │ │ │ ├── sfnt.h │ │ │ │ ├── svginterface.h │ │ │ │ ├── t1types.h │ │ │ │ ├── tttypes.h │ │ │ │ └── wofftypes.h │ │ │ ├── otsvg.h │ │ │ ├── t1tables.h │ │ │ ├── ttnameid.h │ │ │ ├── tttables.h │ │ │ └── tttags.h │ │ └── ft2build.h │ ├── src │ │ ├── autofit │ │ │ ├── afblue.c │ │ │ ├── afblue.cin │ │ │ ├── afblue.dat │ │ │ ├── afblue.h │ │ │ ├── afblue.hin │ │ │ ├── afcjk.c │ │ │ ├── afcjk.h │ │ │ ├── afcover.h │ │ │ ├── afdummy.c │ │ │ ├── afdummy.h │ │ │ ├── aferrors.h │ │ │ ├── afglobal.c │ │ │ ├── afglobal.h │ │ │ ├── afhints.c │ │ │ ├── afhints.h │ │ │ ├── afindic.c │ │ │ ├── afindic.h │ │ │ ├── aflatin.c │ │ │ ├── aflatin.h │ │ │ ├── afloader.c │ │ │ ├── afloader.h │ │ │ ├── afmodule.c │ │ │ ├── afmodule.h │ │ │ ├── afranges.c │ │ │ ├── afranges.h │ │ │ ├── afscript.h │ │ │ ├── afshaper.c │ │ │ ├── afshaper.h │ │ │ ├── afstyles.h │ │ │ ├── aftypes.h │ │ │ ├── afws-decl.h │ │ │ ├── afws-iter.h │ │ │ ├── autofit.c │ │ │ ├── ft-hb.c │ │ │ └── ft-hb.h │ │ ├── base │ │ │ ├── ftadvanc.c │ │ │ ├── ftbase.c │ │ │ ├── ftbase.h │ │ │ ├── ftbbox.c │ │ │ ├── ftbdf.c │ │ │ ├── ftbitmap.c │ │ │ ├── ftcalc.c │ │ │ ├── ftcid.c │ │ │ ├── ftcolor.c │ │ │ ├── ftdbgmem.c │ │ │ ├── ftdebug.c │ │ │ ├── fterrors.c │ │ │ ├── ftfntfmt.c │ │ │ ├── ftfstype.c │ │ │ ├── ftgasp.c │ │ │ ├── ftgloadr.c │ │ │ ├── ftglyph.c │ │ │ ├── ftgxval.c │ │ │ ├── fthash.c │ │ │ ├── ftinit.c │ │ │ ├── ftlcdfil.c │ │ │ ├── ftmac.c │ │ │ ├── ftmm.c │ │ │ ├── ftobjs.c │ │ │ ├── ftotval.c │ │ │ ├── ftoutln.c │ │ │ ├── ftpatent.c │ │ │ ├── ftpfr.c │ │ │ ├── ftpsprop.c │ │ │ ├── ftrfork.c │ │ │ ├── ftsnames.c │ │ │ ├── ftstream.c │ │ │ ├── ftstroke.c │ │ │ ├── ftsynth.c │ │ │ ├── ftsystem.c │ │ │ ├── fttrigon.c │ │ │ ├── fttype1.c │ │ │ ├── ftutil.c │ │ │ ├── ftwinfnt.c │ │ │ ├── md5.c │ │ │ └── md5.h │ │ ├── bdf │ │ │ ├── bdf.c │ │ │ ├── bdf.h │ │ │ ├── bdfdrivr.c │ │ │ ├── bdfdrivr.h │ │ │ ├── bdferror.h │ │ │ └── bdflib.c │ │ ├── bzip2 │ │ │ └── ftbzip2.c │ │ ├── cache │ │ │ ├── ftcache.c │ │ │ ├── ftcbasic.c │ │ │ ├── ftccache.c │ │ │ ├── ftccache.h │ │ │ ├── ftccback.h │ │ │ ├── ftccmap.c │ │ │ ├── ftcerror.h │ │ │ ├── ftcglyph.c │ │ │ ├── ftcglyph.h │ │ │ ├── ftcimage.c │ │ │ ├── ftcimage.h │ │ │ ├── ftcmanag.c │ │ │ ├── ftcmanag.h │ │ │ ├── ftcmru.c │ │ │ ├── ftcmru.h │ │ │ ├── ftcsbits.c │ │ │ └── ftcsbits.h │ │ ├── cff │ │ │ ├── cff.c │ │ │ ├── cffcmap.c │ │ │ ├── cffcmap.h │ │ │ ├── cffdrivr.c │ │ │ ├── cffdrivr.h │ │ │ ├── cfferrs.h │ │ │ ├── cffgload.c │ │ │ ├── cffgload.h │ │ │ ├── cffload.c │ │ │ ├── cffload.h │ │ │ ├── cffobjs.c │ │ │ ├── cffobjs.h │ │ │ ├── cffparse.c │ │ │ ├── cffparse.h │ │ │ └── cfftoken.h │ │ ├── cid │ │ │ ├── ciderrs.h │ │ │ ├── cidgload.c │ │ │ ├── cidgload.h │ │ │ ├── cidload.c │ │ │ ├── cidload.h │ │ │ ├── cidobjs.c │ │ │ ├── cidobjs.h │ │ │ ├── cidparse.c │ │ │ ├── cidparse.h │ │ │ ├── cidriver.c │ │ │ ├── cidriver.h │ │ │ ├── cidtoken.h │ │ │ └── type1cid.c │ │ ├── dlg │ │ │ ├── dlg.c │ │ │ └── dlgwrap.c │ │ ├── gxvalid │ │ │ ├── gxvalid.c │ │ │ ├── gxvalid.h │ │ │ ├── gxvbsln.c │ │ │ ├── gxvcommn.c │ │ │ ├── gxvcommn.h │ │ │ ├── gxverror.h │ │ │ ├── gxvfeat.c │ │ │ ├── gxvfeat.h │ │ │ ├── gxvfgen.c │ │ │ ├── gxvjust.c │ │ │ ├── gxvkern.c │ │ │ ├── gxvlcar.c │ │ │ ├── gxvmod.c │ │ │ ├── gxvmod.h │ │ │ ├── gxvmort.c │ │ │ ├── gxvmort.h │ │ │ ├── gxvmort0.c │ │ │ ├── gxvmort1.c │ │ │ ├── gxvmort2.c │ │ │ ├── gxvmort4.c │ │ │ ├── gxvmort5.c │ │ │ ├── gxvmorx.c │ │ │ ├── gxvmorx.h │ │ │ ├── gxvmorx0.c │ │ │ ├── gxvmorx1.c │ │ │ ├── gxvmorx2.c │ │ │ ├── gxvmorx4.c │ │ │ ├── gxvmorx5.c │ │ │ ├── gxvopbd.c │ │ │ ├── gxvprop.c │ │ │ └── gxvtrak.c │ │ ├── gzip │ │ │ ├── adler32.c │ │ │ ├── crc32.c │ │ │ ├── crc32.h │ │ │ ├── ftgzip.c │ │ │ ├── ftzconf.h │ │ │ ├── gzguts.h │ │ │ ├── infback.c │ │ │ ├── inffast.c │ │ │ ├── inffast.h │ │ │ ├── inffixed.h │ │ │ ├── inflate.c │ │ │ ├── inflate.h │ │ │ ├── inftrees.c │ │ │ ├── inftrees.h │ │ │ ├── zlib.h │ │ │ ├── zutil.c │ │ │ └── zutil.h │ │ ├── lzw │ │ │ ├── ftlzw.c │ │ │ ├── ftzopen.c │ │ │ └── ftzopen.h │ │ ├── otvalid │ │ │ ├── otvalid.c │ │ │ ├── otvalid.h │ │ │ ├── otvbase.c │ │ │ ├── otvcommn.c │ │ │ ├── otvcommn.h │ │ │ ├── otverror.h │ │ │ ├── otvgdef.c │ │ │ ├── otvgpos.c │ │ │ ├── otvgpos.h │ │ │ ├── otvgsub.c │ │ │ ├── otvjstf.c │ │ │ ├── otvmath.c │ │ │ ├── otvmod.c │ │ │ └── otvmod.h │ │ ├── pcf │ │ │ ├── pcf.c │ │ │ ├── pcf.h │ │ │ ├── pcfdrivr.c │ │ │ ├── pcfdrivr.h │ │ │ ├── pcferror.h │ │ │ ├── pcfread.c │ │ │ ├── pcfread.h │ │ │ ├── pcfutil.c │ │ │ └── pcfutil.h │ │ ├── pfr │ │ │ ├── pfr.c │ │ │ ├── pfrcmap.c │ │ │ ├── pfrcmap.h │ │ │ ├── pfrdrivr.c │ │ │ ├── pfrdrivr.h │ │ │ ├── pfrerror.h │ │ │ ├── pfrgload.c │ │ │ ├── pfrgload.h │ │ │ ├── pfrload.c │ │ │ ├── pfrload.h │ │ │ ├── pfrobjs.c │ │ │ ├── pfrobjs.h │ │ │ ├── pfrsbit.c │ │ │ ├── pfrsbit.h │ │ │ └── pfrtypes.h │ │ ├── psaux │ │ │ ├── afmparse.c │ │ │ ├── afmparse.h │ │ │ ├── cffdecode.c │ │ │ ├── cffdecode.h │ │ │ ├── psarrst.c │ │ │ ├── psarrst.h │ │ │ ├── psaux.c │ │ │ ├── psauxerr.h │ │ │ ├── psauxmod.c │ │ │ ├── psauxmod.h │ │ │ ├── psblues.c │ │ │ ├── psblues.h │ │ │ ├── psconv.c │ │ │ ├── psconv.h │ │ │ ├── pserror.c │ │ │ ├── pserror.h │ │ │ ├── psfixed.h │ │ │ ├── psfont.c │ │ │ ├── psfont.h │ │ │ ├── psft.c │ │ │ ├── psft.h │ │ │ ├── psglue.h │ │ │ ├── pshints.c │ │ │ ├── pshints.h │ │ │ ├── psintrp.c │ │ │ ├── psintrp.h │ │ │ ├── psobjs.c │ │ │ ├── psobjs.h │ │ │ ├── psread.c │ │ │ ├── psread.h │ │ │ ├── psstack.c │ │ │ ├── psstack.h │ │ │ ├── pstypes.h │ │ │ ├── t1cmap.c │ │ │ ├── t1cmap.h │ │ │ ├── t1decode.c │ │ │ └── t1decode.h │ │ ├── pshinter │ │ │ ├── pshalgo.c │ │ │ ├── pshalgo.h │ │ │ ├── pshglob.c │ │ │ ├── pshglob.h │ │ │ ├── pshinter.c │ │ │ ├── pshmod.c │ │ │ ├── pshmod.h │ │ │ ├── pshnterr.h │ │ │ ├── pshrec.c │ │ │ └── pshrec.h │ │ ├── psnames │ │ │ ├── psmodule.c │ │ │ ├── psmodule.h │ │ │ ├── psnamerr.h │ │ │ ├── psnames.c │ │ │ └── pstables.h │ │ ├── raster │ │ │ ├── ftmisc.h │ │ │ ├── ftraster.c │ │ │ ├── ftraster.h │ │ │ ├── ftrend1.c │ │ │ ├── ftrend1.h │ │ │ ├── raster.c │ │ │ └── rasterrs.h │ │ ├── sdf │ │ │ ├── ftbsdf.c │ │ │ ├── ftsdf.c │ │ │ ├── ftsdf.h │ │ │ ├── ftsdfcommon.c │ │ │ ├── ftsdfcommon.h │ │ │ ├── ftsdferrs.h │ │ │ ├── ftsdfrend.c │ │ │ ├── ftsdfrend.h │ │ │ └── sdf.c │ │ ├── sfnt │ │ │ ├── pngshim.c │ │ │ ├── pngshim.h │ │ │ ├── sfdriver.c │ │ │ ├── sfdriver.h │ │ │ ├── sferrors.h │ │ │ ├── sfnt.c │ │ │ ├── sfobjs.c │ │ │ ├── sfobjs.h │ │ │ ├── sfwoff.c │ │ │ ├── sfwoff.h │ │ │ ├── sfwoff2.c │ │ │ ├── sfwoff2.h │ │ │ ├── ttbdf.c │ │ │ ├── ttbdf.h │ │ │ ├── ttcmap.c │ │ │ ├── ttcmap.h │ │ │ ├── ttcmapc.h │ │ │ ├── ttcolr.c │ │ │ ├── ttcolr.h │ │ │ ├── ttcpal.c │ │ │ ├── ttcpal.h │ │ │ ├── ttkern.c │ │ │ ├── ttkern.h │ │ │ ├── ttload.c │ │ │ ├── ttload.h │ │ │ ├── ttmtx.c │ │ │ ├── ttmtx.h │ │ │ ├── ttpost.c │ │ │ ├── ttpost.h │ │ │ ├── ttsbit.c │ │ │ ├── ttsbit.h │ │ │ ├── ttsvg.c │ │ │ ├── ttsvg.h │ │ │ ├── woff2tags.c │ │ │ └── woff2tags.h │ │ ├── smooth │ │ │ ├── ftgrays.c │ │ │ ├── ftgrays.h │ │ │ ├── ftsmerrs.h │ │ │ ├── ftsmooth.c │ │ │ ├── ftsmooth.h │ │ │ └── smooth.c │ │ ├── svg │ │ │ ├── ftsvg.c │ │ │ ├── ftsvg.h │ │ │ ├── svg.c │ │ │ └── svgtypes.h │ │ ├── truetype │ │ │ ├── truetype.c │ │ │ ├── ttdriver.c │ │ │ ├── ttdriver.h │ │ │ ├── tterrors.h │ │ │ ├── ttgload.c │ │ │ ├── ttgload.h │ │ │ ├── ttgxvar.c │ │ │ ├── ttgxvar.h │ │ │ ├── ttinterp.c │ │ │ ├── ttinterp.h │ │ │ ├── ttobjs.c │ │ │ ├── ttobjs.h │ │ │ ├── ttpload.c │ │ │ ├── ttpload.h │ │ │ ├── ttsubpix.c │ │ │ └── ttsubpix.h │ │ ├── type1 │ │ │ ├── t1afm.c │ │ │ ├── t1afm.h │ │ │ ├── t1driver.c │ │ │ ├── t1driver.h │ │ │ ├── t1errors.h │ │ │ ├── t1gload.c │ │ │ ├── t1gload.h │ │ │ ├── t1load.c │ │ │ ├── t1load.h │ │ │ ├── t1objs.c │ │ │ ├── t1objs.h │ │ │ ├── t1parse.c │ │ │ ├── t1parse.h │ │ │ ├── t1tokens.h │ │ │ └── type1.c │ │ ├── type42 │ │ │ ├── t42drivr.c │ │ │ ├── t42drivr.h │ │ │ ├── t42error.h │ │ │ ├── t42objs.c │ │ │ ├── t42objs.h │ │ │ ├── t42parse.c │ │ │ ├── t42parse.h │ │ │ ├── t42types.h │ │ │ └── type42.c │ │ └── winfonts │ │ │ ├── fnterrs.h │ │ │ ├── winfnt.c │ │ │ └── winfnt.h │ └── test │ │ ├── CMakeLists.txt │ │ └── main.c ├── headers │ ├── CMakeLists.txt │ ├── README.md │ ├── ek.ts │ ├── include │ │ ├── dr │ │ │ ├── dr_flac.h │ │ │ ├── dr_mp3.h │ │ │ └── dr_wav.h │ │ ├── fast_obj │ │ │ └── fast_obj.h │ │ ├── pocketmod │ │ │ └── pocketmod.h │ │ └── stb │ │ │ ├── stb_c_lexer.h │ │ │ ├── stb_connected_components.h │ │ │ ├── stb_divide.h │ │ │ ├── stb_ds.h │ │ │ ├── stb_dxt.h │ │ │ ├── stb_easy_font.h │ │ │ ├── stb_herringbone_wang_tile.h │ │ │ ├── stb_hexwave.h │ │ │ ├── stb_image.h │ │ │ ├── stb_image_resize.h │ │ │ ├── stb_image_write.h │ │ │ ├── stb_include.h │ │ │ ├── stb_leakcheck.h │ │ │ ├── stb_rect_pack.h │ │ │ ├── stb_sprintf.h │ │ │ ├── stb_textedit.h │ │ │ ├── stb_tilemap_editor.h │ │ │ ├── stb_truetype.h │ │ │ ├── stb_vorbis.c │ │ │ └── stb_voxel_render.h │ └── test │ │ ├── CMakeLists.txt │ │ └── main.c ├── imgui │ ├── CMakeLists.txt │ ├── README.md │ ├── ek.ts │ ├── src │ │ ├── ImGuizmo │ │ │ ├── GraphEditor.cpp │ │ │ ├── GraphEditor.h │ │ │ ├── ImCurveEdit.cpp │ │ │ ├── ImCurveEdit.h │ │ │ ├── ImGradient.cpp │ │ │ ├── ImGradient.h │ │ │ ├── ImGuizmo.cpp │ │ │ ├── ImGuizmo.h │ │ │ ├── ImSequencer.cpp │ │ │ ├── ImSequencer.h │ │ │ └── ImZoomSlider.h │ │ ├── fonts │ │ │ ├── IconsFontAwesome5.h │ │ │ └── IconsMaterialDesign.h │ │ ├── imconfig.h │ │ ├── imgui.cpp │ │ ├── imgui.h │ │ ├── imgui_demo.cpp │ │ ├── imgui_draw.cpp │ │ ├── imgui_internal.h │ │ ├── imgui_memory_editor │ │ │ └── imgui_memory_editor.h │ │ ├── imgui_stdlib.cpp │ │ ├── imgui_stdlib.h │ │ ├── imgui_tables.cpp │ │ ├── imgui_widgets.cpp │ │ ├── implot.cpp │ │ ├── implot.h │ │ ├── implot_demo.cpp │ │ ├── implot_internal.h │ │ ├── implot_items.cpp │ │ ├── imstb_textedit.h │ │ └── misc │ │ │ └── freetype │ │ │ ├── imgui_freetype.cpp │ │ │ └── imgui_freetype.h │ ├── test │ │ ├── CMakeLists.txt │ │ └── main.cpp │ └── ttf │ │ ├── Cousine-Regular.ttf │ │ ├── MaterialIcons-Regular.ttf │ │ ├── fa-regular-400.ttf │ │ ├── fa-solid-900.ttf │ │ ├── sf-mono-text-regular.ttf │ │ └── sf-pro-text-regular.ttf ├── miniz │ ├── CMakeLists.txt │ ├── README.md │ ├── src │ │ ├── miniz.c │ │ ├── miniz.h │ │ ├── miniz_common.h │ │ ├── miniz_export.h │ │ ├── miniz_tdef.c │ │ ├── miniz_tdef.h │ │ ├── miniz_tinfl.c │ │ ├── miniz_tinfl.h │ │ ├── miniz_zip.c │ │ └── miniz_zip.h │ └── test │ │ ├── CMakeLists.txt │ │ └── main.c ├── msgpack │ ├── CMakeLists.txt │ ├── README.md │ ├── ek.ts │ └── include │ │ ├── msgpack.h │ │ └── msgpack │ │ ├── fbuffer.h │ │ ├── gcc_atomic.h │ │ ├── msgpack_all.c │ │ ├── object.h │ │ ├── objectc.c │ │ ├── pack.h │ │ ├── pack_define.h │ │ ├── pack_template.h │ │ ├── sbuffer.h │ │ ├── sysdep.h │ │ ├── timestamp.h │ │ ├── unpack.c │ │ ├── unpack.h │ │ ├── unpack_define.h │ │ ├── unpack_template.h │ │ ├── util.h │ │ ├── version.c │ │ ├── version.h │ │ ├── version_master.h │ │ ├── vrefbuffer.c │ │ ├── vrefbuffer.h │ │ ├── zbuffer.h │ │ ├── zone.c │ │ └── zone.h ├── pugixml │ ├── CMakeLists.txt │ ├── README.md │ ├── src │ │ ├── pugiconfig.hpp │ │ ├── pugixml.cpp │ │ └── pugixml.hpp │ └── test │ │ ├── CMakeLists.txt │ │ └── main.cpp ├── quickjs │ ├── CMakeLists.txt │ ├── ek.ts │ ├── src │ │ ├── cutils.c │ │ ├── cutils.h │ │ ├── libbf.c │ │ ├── libbf.h │ │ ├── libregexp-opcode.h │ │ ├── libregexp.c │ │ ├── libregexp.h │ │ ├── libunicode-table.h │ │ ├── libunicode.c │ │ ├── libunicode.h │ │ ├── list.h │ │ ├── quickjs-atom.h │ │ ├── quickjs-libc.c │ │ ├── quickjs-libc.h │ │ ├── quickjs-opcode.h │ │ ├── quickjs.c │ │ └── quickjs.h │ └── test │ │ ├── CMakeLists.txt │ │ └── main.c └── sokol │ ├── CMakeLists.txt │ ├── README.md │ ├── ek.ts │ ├── include │ ├── sokol_app.h │ ├── sokol_args.h │ ├── sokol_audio.h │ ├── sokol_fetch.h │ ├── sokol_gfx.h │ ├── sokol_glue.h │ ├── sokol_time.h │ └── util │ │ ├── sokol_debugtext.h │ │ ├── sokol_fontstash.h │ │ ├── sokol_gfx_imgui.h │ │ ├── sokol_gl.h │ │ ├── sokol_imgui.h │ │ ├── sokol_memtrack.h │ │ └── sokol_shape.h │ └── test │ ├── CMakeLists.txt │ └── main.c ├── logo.png ├── logow.png ├── modules ├── android-proj │ ├── README.md │ ├── _project │ │ ├── Gemfile │ │ ├── _gitignore │ │ ├── _idea │ │ │ └── gradle.xml │ │ ├── app │ │ │ ├── _gitignore │ │ │ ├── build.gradle │ │ │ ├── multidex-config.pro │ │ │ ├── proguard-rules.pro │ │ │ └── src │ │ │ │ └── main │ │ │ │ ├── AndroidManifest.xml │ │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── eliasku │ │ │ │ │ └── template_android │ │ │ │ │ └── MainActivity.java │ │ │ │ └── res │ │ │ │ ├── drawable │ │ │ │ ├── launch_splash.xml │ │ │ │ └── splash.png │ │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ └── values │ │ │ │ ├── colors.xml │ │ │ │ ├── strings.xml │ │ │ │ └── styles.xml │ │ ├── build.gradle │ │ ├── fastlane │ │ │ ├── Appfile │ │ │ └── Fastfile │ │ ├── gradle.properties │ │ ├── gradle │ │ │ └── wrapper │ │ │ │ ├── gradle-wrapper.jar │ │ │ │ └── gradle-wrapper.properties │ │ ├── gradlew │ │ ├── gradlew.bat │ │ └── settings.gradle │ ├── android.ts │ ├── androidManifest.ts │ ├── gradle.ts │ ├── index.ts │ └── res.ts ├── cli │ ├── README.md │ ├── _templates │ │ ├── android-icons │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ └── mipmap-xxxhdpi │ │ │ │ └── ic_launcher.png │ │ ├── android-splash │ │ │ ├── launch_splash.xml │ │ │ └── splash.png │ │ ├── default-icon.fla │ │ ├── template-ios │ │ │ ├── Gemfile │ │ │ ├── Podfile │ │ │ ├── app-ios.xcodeproj │ │ │ │ ├── project.pbxproj │ │ │ │ ├── project.xcworkspace │ │ │ │ │ ├── contents.xcworkspacedata │ │ │ │ │ ├── xcshareddata │ │ │ │ │ │ └── IDEWorkspaceChecks.plist │ │ │ │ │ └── xcuserdata │ │ │ │ │ │ └── ilyak.xcuserdatad │ │ │ │ │ │ └── UserInterfaceState.xcuserstate │ │ │ │ ├── xcshareddata │ │ │ │ │ └── xcschemes │ │ │ │ │ │ └── app-ios.xcscheme │ │ │ │ └── xcuserdata │ │ │ │ │ └── ilyak.xcuserdatad │ │ │ │ │ └── xcschemes │ │ │ │ │ └── xcschememanagement.plist │ │ │ ├── fastlane │ │ │ │ ├── Appfile │ │ │ │ └── Fastfile │ │ │ ├── src │ │ │ │ ├── Assets.xcassets │ │ │ │ │ ├── AppIcon.appiconset │ │ │ │ │ │ ├── Contents.json │ │ │ │ │ │ ├── ios-marketing_1024.png │ │ │ │ │ │ ├── ipad_152.png │ │ │ │ │ │ ├── ipad_167.png │ │ │ │ │ │ ├── ipad_20.png │ │ │ │ │ │ ├── ipad_29.png │ │ │ │ │ │ ├── ipad_40.png │ │ │ │ │ │ ├── ipad_58.png │ │ │ │ │ │ ├── ipad_76.png │ │ │ │ │ │ ├── ipad_80.png │ │ │ │ │ │ ├── iphone_120.png │ │ │ │ │ │ ├── iphone_180.png │ │ │ │ │ │ ├── iphone_40.png │ │ │ │ │ │ ├── iphone_58.png │ │ │ │ │ │ ├── iphone_60.png │ │ │ │ │ │ ├── iphone_80.png │ │ │ │ │ │ └── iphone_87.png │ │ │ │ │ ├── Contents.json │ │ │ │ │ └── LaunchLogo.imageset │ │ │ │ │ │ ├── Contents.json │ │ │ │ │ │ ├── iphone_120.png │ │ │ │ │ │ ├── iphone_40.png │ │ │ │ │ │ └── iphone_80.png │ │ │ │ ├── Base.lproj │ │ │ │ │ └── LaunchScreen.storyboard │ │ │ │ └── Info.plist │ │ │ ├── xcode-project-ios-post.py │ │ │ └── xcode-project-ios.py │ │ └── web │ │ │ ├── README.md │ │ │ ├── index.html.mustache │ │ │ ├── init.js │ │ │ ├── initModule.js │ │ │ ├── initPWA.js │ │ │ ├── manifest.json │ │ │ ├── pwacompat.min.js │ │ │ └── sw.js │ ├── android │ │ └── android.ts │ ├── appicon │ │ └── appicon.ts │ ├── assets.ts │ ├── assets │ │ ├── Asset.ts │ │ ├── AssetBuilder.ts │ │ ├── Atlas.ts │ │ ├── Audio.ts │ │ ├── BitmapFont.ts │ │ ├── DynamicAtlas.ts │ │ ├── Flash.ts │ │ ├── Model.ts │ │ ├── StaticFileImporter.ts │ │ ├── TTF.ts │ │ ├── Texture.ts │ │ ├── Translations.ts │ │ └── helpers │ │ │ ├── BytesWriter.ts │ │ │ ├── StringTable.ts │ │ │ ├── bmfont.ts │ │ │ ├── flashExport.ts │ │ │ ├── hash.ts │ │ │ ├── market.ts │ │ │ ├── msgfmt.ts │ │ │ ├── objExport.ts │ │ │ ├── parse.ts │ │ │ ├── spritePacker.ts │ │ │ └── webp.ts │ ├── collectSources.ts │ ├── dev │ │ └── index.ts │ ├── exporters.ts │ ├── firebase │ │ └── index.ts │ ├── ios │ │ └── ios.ts │ ├── logger.ts │ ├── main.ts │ ├── module.ts │ ├── project.ts │ ├── screenshots │ │ └── index.ts │ ├── utility │ │ ├── bin.ts │ │ ├── fix-mp3.ts │ │ ├── hash.ts │ │ └── resolveFrom.ts │ ├── utils.ts │ ├── version.ts │ └── web │ │ ├── buildWasm.ts │ │ ├── deployFirebaseHosting.ts │ │ ├── generateIndex.ts │ │ ├── serve.ts │ │ └── web.ts ├── cmake │ ├── generate.ts │ ├── init.ts │ ├── ios.cmake │ ├── linux.cmake │ ├── mingw-w64-x86_64.cmake │ ├── mod.ts │ └── npm.ts ├── repos-management │ ├── auto-changeset.ts │ ├── build-games.ts │ ├── fix-commits.ts │ ├── sync-versions.ts │ ├── update-lock.ts │ ├── upgrade.ts │ └── ws.ts ├── sokol-shdc.ts └── utils │ ├── dirs.ts │ ├── download.ts │ └── utils.ts ├── package-lock.json ├── package.json ├── packages ├── app │ ├── CMakeLists.txt │ ├── ek.ts │ ├── include │ │ └── ek │ │ │ ├── app.h │ │ │ └── app_native.h │ ├── java │ │ └── ek │ │ │ ├── AppUtils.java │ │ │ ├── EkActivity.java │ │ │ ├── EkDevice.java │ │ │ ├── EkPlatform.java │ │ │ ├── EkPlugin.java │ │ │ ├── EkPluginInterface.java │ │ │ ├── EkPluginManager.java │ │ │ ├── EkRenderer.java │ │ │ └── EkSurfaceView.java │ └── src │ │ ├── android │ │ └── android.c.h │ │ ├── app.c │ │ ├── apple │ │ ├── apple.m │ │ ├── apple_ios.m.h │ │ ├── apple_macos.m.h │ │ └── apple_macos_util.h │ │ ├── intern.h │ │ ├── null │ │ └── app-null.c.h │ │ └── web │ │ ├── app.js │ │ ├── app.js.h │ │ └── web.c.h ├── appbox │ ├── CMakeLists.txt │ ├── ek.ts │ └── src │ │ ├── CMakeLists.txt │ │ └── appbox │ │ ├── Ads.cpp │ │ ├── Ads.hpp │ │ ├── AppBox.cpp │ │ └── AppBox.hpp ├── audio │ ├── CMakeLists.txt │ ├── README.md │ ├── ek.ts │ └── src │ │ ├── ek │ │ └── audio.h │ │ ├── ek_audio.c │ │ └── ek_audio_auph.c ├── auph │ ├── CMakeLists.txt │ ├── NATIVE.md │ ├── README.md │ ├── REFERENCES.md │ ├── android │ │ ├── java │ │ │ └── ek │ │ │ │ └── Auph.java │ │ └── oboe │ │ │ ├── LICENSE │ │ │ ├── include │ │ │ └── oboe │ │ │ │ ├── AudioStream.h │ │ │ │ ├── AudioStreamBase.h │ │ │ │ ├── AudioStreamBuilder.h │ │ │ │ ├── AudioStreamCallback.h │ │ │ │ ├── Definitions.h │ │ │ │ ├── LatencyTuner.h │ │ │ │ ├── Oboe.h │ │ │ │ ├── ResultWithValue.h │ │ │ │ ├── StabilizedCallback.h │ │ │ │ ├── Utilities.h │ │ │ │ └── Version.h │ │ │ └── src │ │ │ ├── aaudio │ │ │ ├── AAudioExtensions.h │ │ │ ├── AAudioLoader.cpp │ │ │ ├── AAudioLoader.h │ │ │ ├── AudioStreamAAudio.cpp │ │ │ └── AudioStreamAAudio.h │ │ │ ├── common │ │ │ ├── AudioClock.h │ │ │ ├── AudioSourceCaller.cpp │ │ │ ├── AudioSourceCaller.h │ │ │ ├── AudioStream.cpp │ │ │ ├── AudioStreamBuilder.cpp │ │ │ ├── DataConversionFlowGraph.cpp │ │ │ ├── DataConversionFlowGraph.h │ │ │ ├── FilterAudioStream.cpp │ │ │ ├── FilterAudioStream.h │ │ │ ├── FixedBlockAdapter.cpp │ │ │ ├── FixedBlockAdapter.h │ │ │ ├── FixedBlockReader.cpp │ │ │ ├── FixedBlockReader.h │ │ │ ├── FixedBlockWriter.cpp │ │ │ ├── FixedBlockWriter.h │ │ │ ├── LatencyTuner.cpp │ │ │ ├── MonotonicCounter.h │ │ │ ├── OboeDebug.h │ │ │ ├── QuirksManager.cpp │ │ │ ├── QuirksManager.h │ │ │ ├── README.md │ │ │ ├── SourceFloatCaller.cpp │ │ │ ├── SourceFloatCaller.h │ │ │ ├── SourceI16Caller.cpp │ │ │ ├── SourceI16Caller.h │ │ │ ├── SourceI24Caller.cpp │ │ │ ├── SourceI24Caller.h │ │ │ ├── SourceI32Caller.cpp │ │ │ ├── SourceI32Caller.h │ │ │ ├── StabilizedCallback.cpp │ │ │ ├── Trace.cpp │ │ │ ├── Trace.h │ │ │ ├── Utilities.cpp │ │ │ └── Version.cpp │ │ │ ├── fifo │ │ │ ├── FifoBuffer.cpp │ │ │ ├── FifoBuffer.h │ │ │ ├── FifoController.cpp │ │ │ ├── FifoController.h │ │ │ ├── FifoControllerBase.cpp │ │ │ ├── FifoControllerBase.h │ │ │ ├── FifoControllerIndirect.cpp │ │ │ └── FifoControllerIndirect.h │ │ │ ├── flowgraph │ │ │ ├── ChannelCountConverter.cpp │ │ │ ├── ChannelCountConverter.h │ │ │ ├── ClipToRange.cpp │ │ │ ├── ClipToRange.h │ │ │ ├── FlowGraphNode.cpp │ │ │ ├── FlowGraphNode.h │ │ │ ├── FlowgraphUtilities.h │ │ │ ├── ManyToMultiConverter.cpp │ │ │ ├── ManyToMultiConverter.h │ │ │ ├── MonoToMultiConverter.cpp │ │ │ ├── MonoToMultiConverter.h │ │ │ ├── MultiToMonoConverter.cpp │ │ │ ├── MultiToMonoConverter.h │ │ │ ├── RampLinear.cpp │ │ │ ├── RampLinear.h │ │ │ ├── SampleRateConverter.cpp │ │ │ ├── SampleRateConverter.h │ │ │ ├── SinkFloat.cpp │ │ │ ├── SinkFloat.h │ │ │ ├── SinkI16.cpp │ │ │ ├── SinkI16.h │ │ │ ├── SinkI24.cpp │ │ │ ├── SinkI24.h │ │ │ ├── SinkI32.cpp │ │ │ ├── SinkI32.h │ │ │ ├── SourceFloat.cpp │ │ │ ├── SourceFloat.h │ │ │ ├── SourceI16.cpp │ │ │ ├── SourceI16.h │ │ │ ├── SourceI24.cpp │ │ │ ├── SourceI24.h │ │ │ ├── SourceI32.cpp │ │ │ ├── SourceI32.h │ │ │ └── resampler │ │ │ │ ├── HyperbolicCosineWindow.h │ │ │ │ ├── IntegerRatio.cpp │ │ │ │ ├── IntegerRatio.h │ │ │ │ ├── KaiserWindow.h │ │ │ │ ├── LinearResampler.cpp │ │ │ │ ├── LinearResampler.h │ │ │ │ ├── MultiChannelResampler.cpp │ │ │ │ ├── MultiChannelResampler.h │ │ │ │ ├── PolyphaseResampler.cpp │ │ │ │ ├── PolyphaseResampler.h │ │ │ │ ├── PolyphaseResamplerMono.cpp │ │ │ │ ├── PolyphaseResamplerMono.h │ │ │ │ ├── PolyphaseResamplerStereo.cpp │ │ │ │ ├── PolyphaseResamplerStereo.h │ │ │ │ ├── README.md │ │ │ │ ├── SincResampler.cpp │ │ │ │ ├── SincResampler.h │ │ │ │ ├── SincResamplerStereo.cpp │ │ │ │ └── SincResamplerStereo.h │ │ │ ├── oboe-all.cpp │ │ │ └── opensles │ │ │ ├── AudioInputStreamOpenSLES.cpp │ │ │ ├── AudioInputStreamOpenSLES.h │ │ │ ├── AudioOutputStreamOpenSLES.cpp │ │ │ ├── AudioOutputStreamOpenSLES.h │ │ │ ├── AudioStreamBuffered.cpp │ │ │ ├── AudioStreamBuffered.h │ │ │ ├── AudioStreamOpenSLES.cpp │ │ │ ├── AudioStreamOpenSLES.h │ │ │ ├── EngineOpenSLES.cpp │ │ │ ├── EngineOpenSLES.h │ │ │ ├── OpenSLESUtilities.cpp │ │ │ ├── OpenSLESUtilities.h │ │ │ ├── OutputMixerOpenSLES.cpp │ │ │ └── OutputMixerOpenSLES.h │ ├── build.ts │ ├── ek.ts │ ├── include │ │ └── auph │ │ │ ├── auph.c │ │ │ ├── auph.h │ │ │ ├── auph_addon.c │ │ │ ├── auph_native.c │ │ │ ├── auph_web.c │ │ │ └── native │ │ │ ├── buffer.c │ │ │ ├── buffer_mp3.c │ │ │ ├── buffer_ogg.c │ │ │ ├── buffer_wav.c │ │ │ ├── device.c │ │ │ ├── device_core_audio.m │ │ │ ├── device_null.c │ │ │ ├── device_oboe.cpp │ │ │ ├── mixer.c │ │ │ └── native.h │ └── web │ │ ├── README.md │ │ ├── src │ │ ├── index.ts │ │ ├── null │ │ │ └── index.ts │ │ ├── protocol │ │ │ ├── interface.ts │ │ │ └── static.ts │ │ └── webaudio │ │ │ ├── Buffer.ts │ │ │ ├── Bus.ts │ │ │ ├── Mixer.ts │ │ │ ├── Unlock.ts │ │ │ ├── Voice.ts │ │ │ ├── common.ts │ │ │ ├── debug.ts │ │ │ └── index.ts │ │ └── tsconfig.json ├── core │ ├── CMakeLists.txt │ ├── ek.ts │ ├── src │ │ ├── CMakeLists.txt │ │ └── ek │ │ │ ├── core_dbg.h │ │ │ ├── ds │ │ │ ├── Array.hpp │ │ │ ├── Array.test.hpp │ │ │ ├── Array2.hpp │ │ │ ├── FixedArray.hpp │ │ │ ├── Hash.hpp │ │ │ ├── Hash.test.hpp │ │ │ ├── PodArray.hpp │ │ │ └── String.hpp │ │ │ ├── ek_core_module.cpp │ │ │ ├── serialize │ │ │ ├── core.hpp │ │ │ ├── math.hpp │ │ │ ├── serialize.hpp │ │ │ ├── serialize.test.hpp │ │ │ ├── stl │ │ │ │ ├── Array.hpp │ │ │ │ ├── Map.hpp │ │ │ │ ├── Optional.hpp │ │ │ │ ├── String.hpp │ │ │ │ ├── UnorderedMap.hpp │ │ │ │ └── Vector.hpp │ │ │ ├── streams.hpp │ │ │ └── types.hpp │ │ │ └── util │ │ │ ├── Signal.hpp │ │ │ ├── Signal.test.hpp │ │ │ ├── StaticSignal.hpp │ │ │ ├── StaticStorage.hpp │ │ │ ├── StringUtil.hpp │ │ │ └── Type.hpp │ └── test │ │ ├── CMakeLists.txt │ │ ├── StringUtil.test.hpp │ │ └── tests.cpp ├── dev-tools │ ├── CMakeLists.txt │ ├── README.md │ └── src │ │ ├── CMakeLists.txt │ │ └── ek │ │ └── editor │ │ ├── Editor.cpp │ │ ├── Editor.hpp │ │ ├── gui │ │ ├── ConsoleWindow.hpp │ │ ├── ConsoleWindow_impl.hpp │ │ ├── EditorGUI.cpp │ │ ├── EditorWindow.hpp │ │ ├── FontIconsPreview.hpp │ │ ├── GameWindow.hpp │ │ ├── GameWindow_impl.hpp │ │ ├── HierarchyWindow.hpp │ │ ├── HierarchyWindow_impl.hpp │ │ ├── InspectorWindow.hpp │ │ ├── InspectorWindow_impl.hpp │ │ ├── MemoryProfiler.hpp │ │ ├── MemoryProfiler_impl.hpp │ │ ├── ResourcesWindow.hpp │ │ ├── ResourcesWindow_impl.hpp │ │ ├── SceneWindow.hpp │ │ ├── SceneWindow_impl.hpp │ │ ├── StatsWindow.hpp │ │ ├── StatsWindow_impl.hpp │ │ ├── Widgets.hpp │ │ ├── Widgets_impl.hpp │ │ └── test_window.hpp │ │ └── imgui │ │ ├── ImGuiIntegration.cpp │ │ ├── ImGuiIntegration.hpp │ │ └── imgui.hpp ├── ecs │ ├── CMakeLists.txt │ ├── README.md │ ├── ek.ts │ ├── src │ │ └── ecx │ │ │ ├── ecx.c │ │ │ ├── ecx.h │ │ │ ├── ecx.hpp │ │ │ ├── ecx_fwd.hpp │ │ │ ├── view_backward.hpp │ │ │ ├── view_forward.hpp │ │ │ └── world.hpp │ └── test │ │ ├── CMakeLists.txt │ │ ├── ecxx │ │ ├── World.test.hpp │ │ └── common │ │ │ ├── components.hpp │ │ │ ├── identity_generator_shared.hpp │ │ │ ├── identity_generator_test_1.cpp │ │ │ └── identity_generator_test_2.cpp │ │ └── tests.cpp ├── graphics │ ├── CMakeLists.txt │ ├── README.md │ ├── build.ts │ ├── ek.ts │ └── src │ │ └── ek │ │ ├── canvas.glsl │ │ ├── canvas.h │ │ ├── canvas_shader.h │ │ ├── ek_canvas.c │ │ ├── ek_gfx.c │ │ └── gfx.h ├── local-storage │ ├── CMakeLists.txt │ ├── ek.ts │ ├── include │ │ └── ek │ │ │ └── local_storage.h │ ├── java │ │ └── ek │ │ │ └── LocalStorage.java │ └── src │ │ ├── local_storage.c │ │ ├── local_storage.js │ │ ├── local_storage.m │ │ ├── local_storage_android.c.h │ │ ├── local_storage_js.c.h │ │ └── local_storage_null.c.h ├── physics-arcade │ ├── CMakeLists.txt │ ├── ek.ts │ └── src │ │ ├── ArcadePhysicsModule.cpp │ │ ├── CMakeLists.txt │ │ ├── QuadTree.hpp │ │ └── RegularGrid.hpp ├── res │ ├── CMakeLists.txt │ ├── README.md │ ├── ek.ts │ ├── include │ │ └── ek │ │ │ └── local_res.h │ └── src │ │ ├── local_res.c │ │ ├── local_res.js │ │ ├── local_res_android.c.h │ │ ├── local_res_sys.c.h │ │ ├── local_res_web.c.h │ │ └── map_file.c.h ├── scenex │ ├── CMakeLists.txt │ ├── NOTES.md │ ├── README.md │ ├── TASKS.md │ ├── ek.ts │ ├── include │ │ └── ekx │ │ │ ├── app │ │ │ ├── audio_manager.cpp │ │ │ ├── audio_manager.h │ │ │ ├── frame_timer.c │ │ │ ├── frame_timer.h │ │ │ ├── game_display.c │ │ │ ├── game_display.h │ │ │ ├── input_state.cpp │ │ │ ├── input_state.h │ │ │ ├── localization.c │ │ │ ├── localization.h │ │ │ ├── profiler.cpp │ │ │ ├── profiler.h │ │ │ ├── time_layers.c │ │ │ ├── time_layers.h │ │ │ ├── uitest.cpp │ │ │ └── uitest.h │ │ │ └── ng │ │ │ ├── updater.c │ │ │ └── updater.h │ └── src │ │ └── ek │ │ ├── goodies │ │ ├── CMakeLists.txt │ │ ├── GameScreen.cpp │ │ ├── GameScreen.hpp │ │ ├── PopupManager.cpp │ │ ├── PopupManager.hpp │ │ ├── Shake.cpp │ │ ├── Shake.hpp │ │ ├── bubble_text.cpp │ │ ├── bubble_text.hpp │ │ ├── fireworks.cpp │ │ ├── fireworks.h │ │ ├── helpers │ │ │ ├── Trail2D.cpp │ │ │ ├── Trail2D.hpp │ │ │ ├── follow.cpp │ │ │ └── follow.h │ │ ├── simple_animator_comp.cpp │ │ └── simple_animator_comp.h │ │ └── scenex │ │ ├── 2d │ │ ├── Atlas.cpp │ │ ├── Atlas.hpp │ │ ├── Button.cpp │ │ ├── Button.hpp │ │ ├── Camera2D.cpp │ │ ├── Camera2D.hpp │ │ ├── Camera2D_debug.cpp │ │ ├── Display2D.cpp │ │ ├── Display2D.hpp │ │ ├── DynamicAtlas.cpp │ │ ├── DynamicAtlas.hpp │ │ ├── LayoutRect.cpp │ │ ├── LayoutRect.hpp │ │ ├── MovieClip.cpp │ │ ├── MovieClip.hpp │ │ ├── RenderSystem2D.cpp │ │ ├── RenderSystem2D.hpp │ │ ├── Sprite.cpp │ │ ├── Sprite.hpp │ │ ├── Transform2D.cpp │ │ ├── Transform2D.hpp │ │ ├── Viewport.cpp │ │ └── Viewport.hpp │ │ ├── 3d │ │ ├── Camera3D.hpp │ │ ├── Light3D.hpp │ │ ├── Material3D.hpp │ │ ├── RenderSystem3D.cpp │ │ ├── RenderSystem3D.hpp │ │ ├── Scene3D.h │ │ ├── StaticMesh.hpp │ │ ├── Transform3D.cpp │ │ ├── Transform3D.hpp │ │ ├── render3d.glsl │ │ └── render3d_shader.h │ │ ├── CMakeLists.txt │ │ ├── InteractionSystem.cpp │ │ ├── InteractionSystem.hpp │ │ ├── SceneFactory.cpp │ │ ├── SceneFactory.hpp │ │ ├── StorageVariable.hpp │ │ ├── app │ │ ├── GameAppDispatcher.hpp │ │ ├── GameAppListener.hpp │ │ ├── RootAppListener.hpp │ │ ├── basic_application.cpp │ │ └── basic_application.hpp │ │ ├── asset2 │ │ ├── Asset.hpp │ │ ├── Asset_impl.hpp │ │ └── Assets.cpp │ │ ├── base │ │ ├── DestroyTimer.hpp │ │ ├── DestroyTimer_impl.hpp │ │ ├── Interactive.cpp │ │ ├── Interactive.hpp │ │ ├── Node.cpp │ │ ├── Node.hpp │ │ ├── NodeEvents.cpp │ │ ├── NodeEvents.hpp │ │ ├── Tween.hpp │ │ ├── Tween_impl.hpp │ │ └── module.cpp │ │ ├── ekx_app.c │ │ ├── ekx_app.cpp │ │ ├── particles │ │ ├── Particle.cpp │ │ ├── Particle.hpp │ │ ├── ParticleDecl.hpp │ │ ├── ParticleSystem.cpp │ │ └── ParticleSystem.hpp │ │ ├── systems │ │ ├── hitTest.cpp │ │ ├── hitTest.hpp │ │ ├── main_flow.cpp │ │ └── main_flow.hpp │ │ └── text │ │ ├── BitmapFont.cpp │ │ ├── BitmapFont.hpp │ │ ├── Font.cpp │ │ ├── Font.hpp │ │ ├── FontImplBase.cpp │ │ ├── FontImplBase.hpp │ │ ├── TextEngine.cpp │ │ ├── TextEngine.hpp │ │ ├── TextFormat.hpp │ │ ├── TrueTypeFont.cpp │ │ └── TrueTypeFont.hpp ├── sg-file │ ├── CMakeLists.txt │ ├── ek.ts │ └── src │ │ └── ek │ │ └── format │ │ ├── ImageData.hpp │ │ ├── Model3D.hpp │ │ ├── SGFile.hpp │ │ └── bmfont.h ├── std │ ├── CMakeLists.txt │ ├── ek.ts │ ├── include │ │ └── ek │ │ │ ├── _bitmap │ │ │ ├── bitmap.c │ │ │ ├── fastblur.c │ │ │ └── stbi.c │ │ │ ├── assert.c │ │ │ ├── assert.h │ │ │ ├── base64.c │ │ │ ├── base64.h │ │ │ ├── bitmap.h │ │ │ ├── bitset.c │ │ │ ├── bitset.h │ │ │ ├── buf.c │ │ │ ├── buf.h │ │ │ ├── config.h │ │ │ ├── core │ │ │ └── target.h │ │ │ ├── ek.h │ │ │ ├── hash.h │ │ │ ├── hash │ │ │ ├── hsp.c │ │ │ └── murmur.c │ │ │ ├── ids.c │ │ │ ├── ids.h │ │ │ ├── io.c │ │ │ ├── io.h │ │ │ ├── log.c │ │ │ ├── log.h │ │ │ ├── math.c │ │ │ ├── math.h │ │ │ ├── math │ │ │ ├── col2d.c │ │ │ ├── col2d.h │ │ │ ├── color.c │ │ │ ├── color.h │ │ │ ├── color.hpp │ │ │ ├── easing.c │ │ │ ├── easing.h │ │ │ ├── mat.c │ │ │ ├── mat.h │ │ │ ├── quat.c │ │ │ ├── quat.h │ │ │ ├── rect.c │ │ │ ├── rect.h │ │ │ ├── rect.hpp │ │ │ ├── scalar.c │ │ │ ├── scalar.h │ │ │ ├── vec.c │ │ │ ├── vec.h │ │ │ └── vec.hpp │ │ │ ├── pre.h │ │ │ ├── print.c │ │ │ ├── print.h │ │ │ ├── rnd.c │ │ │ ├── rnd.h │ │ │ ├── rnd.hpp │ │ │ ├── rr.c │ │ │ ├── rr.h │ │ │ ├── sparse_array.c │ │ │ ├── sparse_array.h │ │ │ ├── sparse_array_vm.c │ │ │ ├── string.c │ │ │ ├── string.h │ │ │ ├── time.c │ │ │ ├── time.h │ │ │ ├── time.hpp │ │ │ ├── utf8.c │ │ │ └── utf8.h │ ├── scripts │ │ ├── gen_math.js │ │ ├── gen_math_vec_hpp.js │ │ └── gen_math_vec_test.js │ ├── src │ │ ├── ek_bitmap.c │ │ └── ek_std.c │ └── test │ │ ├── CMakeLists.txt │ │ ├── base64_test.c │ │ ├── bitmap │ │ └── bitmap_test.c │ │ ├── hash_test.c │ │ ├── log_test.c │ │ ├── math │ │ ├── math_easing_test.c │ │ ├── math_mat_test.c │ │ ├── math_rect_test.c │ │ ├── math_test_common.h │ │ └── math_vec_test.c │ │ ├── path_test.c │ │ ├── rnd_test.c │ │ ├── std_test_main.c │ │ └── string_test.c ├── texture-loader │ ├── ARTICLE_ru.md │ ├── CMakeLists.txt │ ├── README.md │ ├── build.ts │ ├── ek.ts │ ├── include │ │ └── ek │ │ │ └── texture_loader.h │ ├── java │ │ └── ek │ │ │ └── TextureLoader.java │ ├── src │ │ ├── texture_loader.c │ │ ├── texture_loader_android.c.h │ │ ├── texture_loader_generic.c.h │ │ └── texture_loader_web.c.h │ └── web │ │ ├── src │ │ ├── index.ts │ │ └── lib.ts │ │ └── tsconfig.json └── unit │ ├── CMakeLists.txt │ ├── cmake │ └── code-coverage.cmake │ └── include │ └── unit.h ├── plugins ├── admob │ ├── CMakeLists.txt │ ├── ek.ts │ ├── include │ │ └── ek │ │ │ ├── admob.h │ │ │ └── admob_wrapper.hpp │ ├── java │ │ └── ek │ │ │ └── admob │ │ │ └── AdMobPlugin.java │ └── src │ │ ├── AdMobNull.hpp │ │ ├── AdMobSimulator.hpp │ │ ├── AdMobWrapper.cpp │ │ ├── admob_android.c.h │ │ ├── admob_ios.m.h │ │ └── ek_admob.c ├── billing │ ├── CMakeLists.txt │ ├── ek.ts │ ├── java │ │ └── ek │ │ │ └── billing │ │ │ ├── BillingBridge.java │ │ │ ├── BillingPlugin.java │ │ │ └── GooglePlayBilling.java │ └── src │ │ ├── billing.cpp │ │ ├── billing.hpp │ │ ├── billing_android.hpp │ │ ├── billing_ios.hpp │ │ └── billing_sim.hpp ├── firebase │ ├── CMakeLists.txt │ ├── build.ts │ ├── ek.ts │ ├── java │ │ └── ek │ │ │ └── FirebasePlugin.java │ ├── src │ │ └── ek │ │ │ ├── firebase.c │ │ │ └── firebase.h │ └── web │ │ ├── firebase.js │ │ └── firebase_c.js └── game-services │ ├── CMakeLists.txt │ ├── README.md │ ├── ek.ts │ ├── include │ └── ek │ │ └── game_services.h │ ├── java │ └── ek │ │ └── GameServices.java │ └── src │ ├── ek_game_services.c │ ├── ek_game_services_android.c.h │ └── ek_game_services_ios.c.h ├── tools ├── ekc │ ├── CMakeLists.txt │ ├── README.md │ └── src │ │ ├── bmfont_export │ │ ├── bmfont_export.c │ │ ├── bmfont_export.h │ │ └── build_bitmap_font.c.h │ │ ├── main.c │ │ ├── obj-export │ │ ├── obj_export.c │ │ └── obj_export.h │ │ └── sprite_packer │ │ ├── binpack.c │ │ ├── binpack.h │ │ ├── export_atlas.c.h │ │ ├── export_atlas.h │ │ ├── sprite_packer.c │ │ ├── sprpk_image.c │ │ ├── sprpk_image.h │ │ └── sprpk_stb_impl.c.h └── flash-export │ ├── CMakeLists.txt │ ├── README.md │ └── src │ ├── ImageSet.cpp │ ├── ImageSet.hpp │ ├── flash_export.cpp │ ├── sxg │ ├── AnimationHelpers.cpp │ ├── AnimationHelpers.hpp │ ├── ExportItem.cpp │ ├── ExportItem.hpp │ ├── RenderElement.cpp │ ├── RenderElement.hpp │ ├── SGBuilder.cpp │ └── SGBuilder.hpp │ └── xfl │ ├── Doc.cpp │ ├── Doc.hpp │ ├── DocFile.cpp │ ├── parsing │ ├── BitmapDataParse.cpp │ ├── DocParser.cpp │ ├── DocParser.hpp │ ├── parsing.cpp │ └── parsing.hpp │ ├── renderer │ ├── CairoHelpers.cpp │ ├── CairoHelpers.hpp │ ├── CairoRenderer.cpp │ ├── CairoRenderer.hpp │ ├── RenderCommand.hpp │ ├── Scanner.cpp │ ├── Scanner.hpp │ ├── ShapeDecoder.cpp │ └── ShapeDecoder.hpp │ └── types.hpp ├── tsconfig-tsc.json └── tsconfig.json /.changeset/README.md: -------------------------------------------------------------------------------- 1 | # Changesets 2 | 3 | Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works 4 | with multi-package repos, or single-package repos to help you version and publish your code. You can 5 | find the full documentation for it [in our repository](https://github.com/changesets/changesets) 6 | 7 | We have a quick list of common questions to get you started engaging with this project in 8 | [our documentation](https://github.com/changesets/changesets/blob/master/docs/common-questions.md) 9 | -------------------------------------------------------------------------------- /.changeset/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://unpkg.com/@changesets/config@1.5.0/schema.json", 3 | "changelog": "@changesets/cli/changelog", 4 | "commit": false, 5 | "linked": [], 6 | "access": "public", 7 | "baseBranch": "master", 8 | "updateInternalDependencies": "patch", 9 | "ignore": [] 10 | } -------------------------------------------------------------------------------- /.changeset/olive-oranges-grin.md: -------------------------------------------------------------------------------- 1 | --- 2 | "@ekx/ekx": patch 3 | --- 4 | 5 | ... 6 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "github-actions" 4 | directory: "/" 5 | schedule: 6 | interval: "daily" 7 | 8 | - package-ecosystem: "npm" 9 | directory: "/" 10 | versioning-strategy: increase 11 | schedule: 12 | interval: "daily" 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .vscode/ 3 | cmake-build-*/ 4 | 5 | # npm dependencies 6 | node_modules/ 7 | 8 | # samples generated resources 9 | generated/ 10 | build/ 11 | export/ 12 | cache/ 13 | 14 | RECOVER_*.fla 15 | 16 | # packages ignores 17 | packages/auph/web/dist/ 18 | 19 | packages/texture-loader/js/ 20 | 21 | plugins/firebase/web/dist/ 22 | plugins/firebase/web/lib/ 23 | 24 | tools/bin/ 25 | 26 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | ISC License 2 | 3 | Copyright (c) 2020, Ilya Kuzmichev 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -------------------------------------------------------------------------------- /ci/build-native-coverage.ts: -------------------------------------------------------------------------------- 1 | import {build} from "../modules/cmake/mod.js"; 2 | import {UtilityConfig} from "../modules/cli/utils.js"; 3 | 4 | UtilityConfig.verbose = true; 5 | 6 | await build({ 7 | definitions: { 8 | EKX_BUILD_DEV_TOOLS: "OFF", 9 | EKX_BUILD_TESTS: "ON", 10 | EKX_BUILD_COVERAGE: "ON", 11 | EKX_BUILD_EXTERNAL_TESTS: "OFF", 12 | EKX_INCLUDE_EXAMPLES: "OFF", 13 | EKX_INCLUDE_PLUGINS: "OFF", 14 | }, 15 | buildType: "Profiling", 16 | target: "coverage" 17 | }); 18 | -------------------------------------------------------------------------------- /ci/build-native.ts: -------------------------------------------------------------------------------- 1 | import {build} from "../modules/cmake/mod.js"; 2 | import {UtilityConfig} from "../modules/cli/utils.js"; 3 | 4 | UtilityConfig.verbose = true; 5 | 6 | // build main packages, plugins and tools 7 | await build({ 8 | definitions: { 9 | EKX_BUILD_DEV_TOOLS: "ON", 10 | EKX_BUILD_TESTS: "ON", 11 | EKX_BUILD_COVERAGE: "OFF", 12 | EKX_BUILD_EXTERNAL_TESTS: "OFF", 13 | EKX_INCLUDE_EXAMPLES: "ON", 14 | EKX_INCLUDE_PLUGINS: "ON", 15 | }, 16 | test: true, 17 | debug: false 18 | }); 19 | -------------------------------------------------------------------------------- /ci/build.ts: -------------------------------------------------------------------------------- 1 | import {existsSync} from "fs"; 2 | import {UtilityConfig} from "../modules/cli/utils.js"; 3 | import {logger} from "../modules/cli/logger.js"; 4 | 5 | // run build files 6 | import "../packages/texture-loader/build.js"; 7 | import "../packages/auph/build.js"; 8 | import "../packages/graphics/build.js"; 9 | import "../plugins/firebase/build.js"; 10 | 11 | UtilityConfig.verbose = true; 12 | 13 | // check files are really exists 14 | const filesToVerify = [ 15 | "packages/texture-loader/js/lib/lib-texture-loader.js", 16 | "packages/texture-loader/js/pre/texture-loader.js", 17 | "packages/auph/web/dist/emscripten/auph.js", 18 | "packages/auph/web/dist/emscripten/auph.js.map", 19 | ]; 20 | 21 | let missFiles = 0; 22 | for (const file of filesToVerify) { 23 | if (existsSync(file)) { 24 | logger.info("✅ file is in place", file) 25 | } else { 26 | logger.warn("🤷 file is missing", file); 27 | ++missFiles; 28 | } 29 | } 30 | 31 | process.exit(missFiles > 0 ? 1 : 0); 32 | -------------------------------------------------------------------------------- /ci/clean.ts: -------------------------------------------------------------------------------- 1 | import {rm} from "../modules/utils/utils.js"; 2 | import {UtilityConfig} from "../modules/cli/utils.js"; 3 | 4 | UtilityConfig.verbose = true; 5 | 6 | await rm("plugins/firebase/web/dist"); 7 | await rm("plugins/firebase/web/lib"); 8 | await rm("packages/auph/web/dist"); 9 | await rm("packages/texture-loader/js"); 10 | await rm("build"); -------------------------------------------------------------------------------- /ci/external-recipes/pugixml.ts: -------------------------------------------------------------------------------- 1 | import * as path from "path"; 2 | import {rm} from "../../modules/utils/utils.js"; 3 | import {downloadFiles} from "../../modules/utils/download.js"; 4 | import {resolveEkxPath} from "../../modules/utils/dirs.js"; 5 | 6 | const destPath = resolveEkxPath("external/pugixml"); 7 | 8 | async function clean() { 9 | await rm(path.join(destPath, "src")); 10 | } 11 | 12 | async function fetch() { 13 | await downloadFiles({ 14 | srcBaseUrl: "https://github.com/zeux/pugixml/raw/master", 15 | destPath, 16 | fileList: [ 17 | "src/pugiconfig.hpp", 18 | "src/pugixml.hpp", 19 | "src/pugixml.cpp", 20 | ] 21 | }); 22 | } 23 | 24 | export default {clean, fetch}; 25 | -------------------------------------------------------------------------------- /ci/shdc-test/test.ts: -------------------------------------------------------------------------------- 1 | import {join} from "path"; 2 | import {existsSync} from "fs"; 3 | import {shdc} from "../../modules/sokol-shdc.js"; 4 | import {getModuleDir, rm} from "../../modules/utils/utils.js"; 5 | import {UtilityConfig} from "../../modules/cli/utils.js"; 6 | 7 | UtilityConfig.verbose = true; 8 | 9 | const __dirname = getModuleDir(import.meta); 10 | 11 | await shdc({ 12 | input: "simple2d.glsl", 13 | output: "simple2d_shader.h", 14 | cwd: __dirname 15 | }); 16 | 17 | const hdr = join(__dirname, "simple2d_shader.h"); 18 | if (!existsSync(hdr)) { 19 | throw new Error("shader header not found"); 20 | } 21 | 22 | await rm(hdr); 23 | -------------------------------------------------------------------------------- /docs/assets-idea.md: -------------------------------------------------------------------------------- 1 | # Assets 2 | 3 | ## Building 4 | 5 | - `export/android/assets/*` 6 | 7 | ### Embedded Pack 8 | 9 | #### Android embedded assets 10 | 11 | - assets1/ (add that as `assets` source root) 12 | - pack1/ 13 | - pack2/ 14 | - root-files... 15 | 16 | - assets2/ (add that as `assets` source root) 17 | - pack3/ 18 | - pack4/ 19 | 20 | After Android build we got the following structure, and all packs are available in AssetManager 21 | 22 | - bundle-dir/ 23 | - pack1/ 24 | - pack2/ 25 | - root-files... 26 | - pack3/ 27 | - pack4/ -------------------------------------------------------------------------------- /docs/project-structure.md: -------------------------------------------------------------------------------- 1 | ### `cache/` 2 | Temporary folder used for installed `ekx` package build files, downloads, "build on demand" binaries. 3 | 4 | ### `ci/` 5 | Development scripts required for maintaining the `ekx` only. Check build, run tests, update external source code. Folder is excluded from final package. 6 | 7 | ### `external/` 8 | External libraries source code. 9 | 10 | ### `modules/` 11 | TypeScript source-code for `ekx` users. TS modules and CLI entry-point. 12 | 13 | ### `packages/` 14 | All core ekx-packages. 15 | 16 | ### `plugins/` 17 | Plugable extension ekx-packages. 18 | 19 | ### `tools/` 20 | `ekx` utilities source-code. Utilities will be built on demand by user host. 21 | 22 | ### `examples/` 23 | Example projects. Excluded from `ekx` distribution. 24 | 25 | ### `docs/` 26 | All documentation files. Excluded from distribution. 27 | 28 | ### `.changeset` 29 | Changeset files using for `ekx` release flow. Excluded from distribution. 30 | -------------------------------------------------------------------------------- /docs/random-notes.md: -------------------------------------------------------------------------------- 1 | # Random Notes 2 | 3 | ## Android Emulator 4 | 5 | Create x86 image 6 | ``` 7 | $ANDROID_HOME/emulator/emulator @Nexus_S_API_29 -gpu host -no-boot-anim 8 | ``` 9 | 10 | ## CMake 11 | 12 | ### C++ build speed optimization 13 | 14 | Install CCache: 15 | ``` 16 | brew install --HEAD ccache 17 | ``` 18 | 19 | CLion: CMake -> Settings, add following to profile: 20 | - `-DCMAKE_CXX_COMPILER_LAUNCHER=ccache` 21 | - `-G Ninja` 22 | 23 | ## Words 24 | 25 | `UNORM` is a float in the range of `[0, 1]`. 26 | `SNORM` is the same but in the range of `[-1, 1]` 27 | 28 | ## Resources 29 | 30 | - [The Book of Shaders](https://thebookofshaders.com/) 31 | 32 | -------------------------------------------------------------------------------- /docs/references.md: -------------------------------------------------------------------------------- 1 | 2 | # References 3 | 4 | ## Plugins architecture 5 | 6 | - https://github.com/oxygine 7 | - ludei/atomic-plugins: https://github.com/ludei/atomic-plugins-ads 8 | 9 | ## Libraries 10 | 11 | List of different libraries which could be interesting to investigate. 12 | 13 | ### C 14 | 15 | - [stb](https://github.com/nothings/stb) 16 | - [musl libc](https://github.com/bminor/musl) 17 | - [sx](https://github.com/septag/sx) 18 | - [rizz](https://github.com/septag/rizz) 19 | - [zpl](https://github.com/zpl-c/zpl) 20 | - [mattiasgustavsson/libs](https://github.com/mattiasgustavsson/libs) 21 | 22 | ### C++ 23 | 24 | - [bx](https://github.com/bkaradzic/bx) 25 | - [Godot](https://github.com/godotengine/godot) 26 | - blender3d 27 | - [bitsquid foundation](https://github.com/niklas-ourmachinery/bitsquid-foundation) 28 | - [EA STL](https://github.com/electronicarts/EASTL) 29 | -------------------------------------------------------------------------------- /docs/todo.md: -------------------------------------------------------------------------------- 1 | - [ ] move `build` folder to `cache/builds` and rework sdk build flow 2 | - [ ] rename `modules` to `lib` since it's root and main utility to build stuff 3 | - [ ] move `external/*/cache` to `cache/downloads/*` and provide management utility 4 | - [ ] rename `@ekx/ekx` to `ekx` and restart from `0.0.1` version 5 | - [ ] reset project's history and move to the personal repository, archive and deprecate `highduck/ekx` to keep history 6 | -------------------------------------------------------------------------------- /examples/1-app/ek.ts: -------------------------------------------------------------------------------- 1 | import {Project} from "@ekx/ekx/modules/cli/project.js"; 2 | 3 | export async function setup(project: Project) { 4 | project.addModule({ 5 | name: "sample-1-app", 6 | cpp: "src" 7 | }); 8 | 9 | project.title = "sample-1-app"; 10 | project.desc = "sample-1-app"; 11 | project.orientation = "portrait"; 12 | await project.importModule("@ekx/ekx/packages/app/ek.ts"); 13 | } 14 | -------------------------------------------------------------------------------- /examples/1-app/src/config/build_info.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef APP_BUILD_INFO_H 3 | #define APP_BUILD_INFO_H 4 | 5 | #define APP_VERSION_NAME "1" 6 | #define APP_VERSION_CODE "1" 7 | 8 | #endif // APP_BUILD_INFO_H 9 | -------------------------------------------------------------------------------- /examples/2-drawing/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19) 2 | project(2-drawing) 3 | 4 | add_executable(${PROJECT_NAME} src/main.c) 5 | 6 | set_target_properties(${PROJECT_NAME} PROPERTIES C_STANDARD 11) 7 | 8 | target_include_directories(${PROJECT_NAME} PUBLIC src) 9 | 10 | target_link_libraries(${PROJECT_NAME} 11 | PUBLIC ekx::graphics 12 | ) 13 | 14 | add_definitions("-ffast-math -fno-exceptions -fno-rtti -Wall -Wextra") 15 | 16 | if (CMAKE_BUILD_TYPE MATCHES Debug) 17 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Oz -g") 18 | else () 19 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Oz -flto") 20 | endif () -------------------------------------------------------------------------------- /examples/2-drawing/src/config/build_info.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef APP_BUILD_INFO_H 3 | #define APP_BUILD_INFO_H 4 | 5 | #define APP_VERSION_NAME "1" 6 | #define APP_VERSION_CODE "1" 7 | 8 | #endif // APP_BUILD_INFO_H 9 | -------------------------------------------------------------------------------- /examples/rnd-test/src/config/BuildInfo.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | namespace AppVersion { 4 | const char* Name = "0.0.2"; 5 | const char* Code = "1"; 6 | } 7 | -------------------------------------------------------------------------------- /examples/rnd-test/src/config/build_info.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef APP_BUILD_INFO_H 3 | #define APP_BUILD_INFO_H 4 | 5 | #define APP_VERSION_NAME "1" 6 | #define APP_VERSION_CODE "1" 7 | 8 | #endif // APP_BUILD_INFO_H 9 | -------------------------------------------------------------------------------- /external/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19) 2 | 3 | add_subdirectory(headers) 4 | add_subdirectory(box2d) 5 | add_subdirectory(cairo) 6 | add_subdirectory(freetype) 7 | add_subdirectory(miniz) 8 | add_subdirectory(msgpack) 9 | add_subdirectory(pugixml) 10 | add_subdirectory(quickjs) 11 | add_subdirectory(sokol) 12 | add_subdirectory(imgui) 13 | -------------------------------------------------------------------------------- /external/box2d/README.md: -------------------------------------------------------------------------------- 1 | # sokol 2 | 3 | ### Version 4 | - repo: [erincatto/box2d](https://github.com/erincatto/box2d) 5 | - branch: `main` 6 | - commit: `9dc24a6fd4f32442c4bcf80791de47a0a7d25afb` 7 | - date: 2021-12-31 8 | - version: 2.4.1 -------------------------------------------------------------------------------- /external/box2d/ek.ts: -------------------------------------------------------------------------------- 1 | import {Project} from "../../modules/cli/project.js"; 2 | 3 | export function setup(project:Project) { 4 | project.addModule({ 5 | name: "box2d", 6 | cpp: "src", 7 | cpp_include: "include" 8 | }); 9 | } 10 | -------------------------------------------------------------------------------- /external/box2d/test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19) 2 | project(box2d-test) 3 | add_executable(${PROJECT_NAME} main.cpp) 4 | 5 | set_target_properties(${PROJECT_NAME} PROPERTIES 6 | C_STANDARD 11 7 | CXX_STANDARD 17 8 | CXX_STANDARD_REQUIRED YES 9 | CXX_EXTENSIONS NO 10 | ) 11 | 12 | target_link_libraries(${PROJECT_NAME} PUBLIC box2d) 13 | add_test(NAME ${PROJECT_NAME} 14 | WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} 15 | COMMAND ${PROJECT_NAME}) -------------------------------------------------------------------------------- /external/cairo/README.md: -------------------------------------------------------------------------------- 1 | # Cairo 2 | 3 | Source code downloaded from snapshots: https://www.cairographics.org/snapshots/ -------------------------------------------------------------------------------- /external/cairo/src/cairo-features.h: -------------------------------------------------------------------------------- 1 | #ifndef CAIRO_FEATURES_H 2 | #define CAIRO_FEATURES_H 3 | 4 | #define HAVE_STDINT_H 1 5 | #define HAVE_CXX11_ATOMIC_PRIMITIVES 1 6 | #define CAIRO_HAS_PTHREAD 1 7 | #define HAVE_UINT64_T 1 8 | #define HAVE_UINT128_T 0 9 | 10 | // required by cairo_fopen for _WIN32 11 | #define CAIRO_HAS_UTF8_TO_UTF16 1 12 | 13 | // ignore float pixel format 14 | #define PIXMAN_rgba_float 0xFFFFFFFF 15 | #define PIXMAN_rgb_float 0xFFFFFFFE 16 | 17 | #endif //CAIRO_FEATURES_H 18 | -------------------------------------------------------------------------------- /external/cairo/src/cairo-version.h: -------------------------------------------------------------------------------- 1 | #ifndef CAIRO_VERSION_H 2 | #define CAIRO_VERSION_H 3 | 4 | #define CAIRO_VERSION_MAJOR 1 5 | #define CAIRO_VERSION_MINOR 17 6 | #define CAIRO_VERSION_MICRO 8 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /external/cairo/src/config.h: -------------------------------------------------------------------------------- 1 | #ifndef CAIRO_CONFIG_H 2 | #define CAIRO_CONFIG_H 3 | #endif // CAIRO_CONFIG_H -------------------------------------------------------------------------------- /external/cairo/src/pixman-access-accessors.c: -------------------------------------------------------------------------------- 1 | #define PIXMAN_FB_ACCESSORS 2 | 3 | #include "pixman-access.c" 4 | -------------------------------------------------------------------------------- /external/cairo/src/pixman-accessor.h: -------------------------------------------------------------------------------- 1 | #ifdef PIXMAN_FB_ACCESSORS 2 | 3 | #define READ(img, ptr) \ 4 | (((bits_image_t *)(img))->read_func ((ptr), sizeof(*(ptr)))) 5 | #define WRITE(img, ptr,val) \ 6 | (((bits_image_t *)(img))->write_func ((ptr), (val), sizeof (*(ptr)))) 7 | 8 | #define MEMSET_WRAPPED(img, dst, val, size) \ 9 | do { \ 10 | size_t _i; \ 11 | uint8_t *_dst = (uint8_t*)(dst); \ 12 | for(_i = 0; _i < (size_t) size; _i++) { \ 13 | WRITE((img), _dst +_i, (val)); \ 14 | } \ 15 | } while (0) 16 | 17 | #else 18 | 19 | #define READ(img, ptr) (*(ptr)) 20 | #define WRITE(img, ptr, val) (*(ptr) = (val)) 21 | #define MEMSET_WRAPPED(img, dst, val, size) \ 22 | memset(dst, val, size) 23 | 24 | #endif 25 | 26 | -------------------------------------------------------------------------------- /external/cairo/src/pixman-config.h: -------------------------------------------------------------------------------- 1 | #ifndef PIXMAN_CONFIG_H 2 | #define PIXMAN_CONFIG_H 3 | 4 | #define PACKAGE 5 | #define HAVE_PTHREADS 1 6 | 7 | #endif //PIXMAN_CONFIG_H 8 | -------------------------------------------------------------------------------- /external/cairo/src/pixman-edge-accessors.c: -------------------------------------------------------------------------------- 1 | 2 | #define PIXMAN_FB_ACCESSORS 3 | 4 | #include "pixman-edge.c" 5 | -------------------------------------------------------------------------------- /external/cairo/test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19) 2 | project(cairo-test C) 3 | add_executable(${PROJECT_NAME} main.c) 4 | set_target_properties(${PROJECT_NAME} PROPERTIES C_STANDARD 11) 5 | target_link_libraries(${PROJECT_NAME} PUBLIC cairo) 6 | add_test(NAME ${PROJECT_NAME} 7 | WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} 8 | COMMAND ${PROJECT_NAME}) 9 | -------------------------------------------------------------------------------- /external/freetype/README.md: -------------------------------------------------------------------------------- 1 | # freetype 2 | 3 | 4 | ### Version 5 | 6 | - version: 2.11.0 7 | - [download](https://download.savannah.gnu.org/releases/freetype/freetype-2.11.0.tar.gz) 8 | -------------------------------------------------------------------------------- /external/freetype/src/autofit/autofit.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * autofit.c 4 | * 5 | * Auto-fitter module (body). 6 | * 7 | * Copyright (C) 2003-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #define FT_MAKE_OPTION_SINGLE_OBJECT 20 | 21 | #include "ft-hb.c" 22 | #include "afblue.c" 23 | #include "afcjk.c" 24 | #include "afdummy.c" 25 | #include "afglobal.c" 26 | #include "afhints.c" 27 | #include "afindic.c" 28 | #include "aflatin.c" 29 | #include "afloader.c" 30 | #include "afmodule.c" 31 | #include "afranges.c" 32 | #include "afshaper.c" 33 | 34 | 35 | /* END */ 36 | -------------------------------------------------------------------------------- /external/freetype/src/cache/ftcache.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * ftcache.c 4 | * 5 | * The FreeType Caching sub-system (body only). 6 | * 7 | * Copyright (C) 2000-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #define FT_MAKE_OPTION_SINGLE_OBJECT 20 | 21 | #include "ftcbasic.c" 22 | #include "ftccache.c" 23 | #include "ftccmap.c" 24 | #include "ftcglyph.c" 25 | #include "ftcimage.c" 26 | #include "ftcmanag.c" 27 | #include "ftcmru.c" 28 | #include "ftcsbits.c" 29 | 30 | 31 | /* END */ 32 | -------------------------------------------------------------------------------- /external/freetype/src/cff/cff.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * cff.c 4 | * 5 | * FreeType OpenType driver component (body only). 6 | * 7 | * Copyright (C) 1996-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #define FT_MAKE_OPTION_SINGLE_OBJECT 20 | 21 | #include "cffcmap.c" 22 | #include "cffdrivr.c" 23 | #include "cffgload.c" 24 | #include "cffparse.c" 25 | #include "cffload.c" 26 | #include "cffobjs.c" 27 | 28 | /* END */ 29 | -------------------------------------------------------------------------------- /external/freetype/src/cff/cffdrivr.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * cffdrivr.h 4 | * 5 | * High-level OpenType driver interface (specification). 6 | * 7 | * Copyright (C) 1996-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef CFFDRIVER_H_ 20 | #define CFFDRIVER_H_ 21 | 22 | 23 | #include 24 | 25 | 26 | FT_BEGIN_HEADER 27 | 28 | FT_DECLARE_DRIVER( cff_driver_class ) 29 | 30 | FT_END_HEADER 31 | 32 | #endif /* CFFDRIVER_H_ */ 33 | 34 | 35 | /* END */ 36 | -------------------------------------------------------------------------------- /external/freetype/src/cid/cidriver.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * cidriver.h 4 | * 5 | * High-level CID driver interface (specification). 6 | * 7 | * Copyright (C) 1996-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef CIDRIVER_H_ 20 | #define CIDRIVER_H_ 21 | 22 | 23 | #include 24 | 25 | 26 | FT_BEGIN_HEADER 27 | 28 | FT_CALLBACK_TABLE 29 | const FT_Driver_ClassRec t1cid_driver_class; 30 | 31 | FT_END_HEADER 32 | 33 | #endif /* CIDRIVER_H_ */ 34 | 35 | 36 | /* END */ 37 | -------------------------------------------------------------------------------- /external/freetype/src/cid/type1cid.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * type1cid.c 4 | * 5 | * FreeType OpenType driver component (body only). 6 | * 7 | * Copyright (C) 1996-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #define FT_MAKE_OPTION_SINGLE_OBJECT 20 | 21 | #include "cidgload.c" 22 | #include "cidload.c" 23 | #include "cidobjs.c" 24 | #include "cidparse.c" 25 | #include "cidriver.c" 26 | 27 | 28 | /* END */ 29 | -------------------------------------------------------------------------------- /external/freetype/src/dlg/dlgwrap.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * dlgwrap.c 4 | * 5 | * Wrapper file for the 'dlg' library (body only) 6 | * 7 | * Copyright (C) 2020-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #include 20 | #include FT_CONFIG_OPTIONS_H 21 | 22 | 23 | #ifdef FT_DEBUG_LOGGING 24 | #define DLG_STATIC 25 | #include "dlg.c" 26 | #else 27 | /* ANSI C doesn't like empty source files */ 28 | typedef int _dlg_dummy; 29 | #endif 30 | 31 | 32 | /* END */ 33 | -------------------------------------------------------------------------------- /external/freetype/src/gzip/inffast.h: -------------------------------------------------------------------------------- 1 | /* inffast.h -- header to use inffast.c 2 | * Copyright (C) 1995-2003, 2010 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* WARNING: this file should *not* be used by applications. It is 7 | part of the implementation of the compression library and is 8 | subject to change. Applications should only use zlib.h. 9 | */ 10 | 11 | static void ZLIB_INTERNAL inflate_fast OF((z_streamp strm, unsigned start)); 12 | -------------------------------------------------------------------------------- /external/freetype/src/otvalid/otvalid.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * otvalid.c 4 | * 5 | * FreeType validator for OpenType tables (body only). 6 | * 7 | * Copyright (C) 2004-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #define FT_MAKE_OPTION_SINGLE_OBJECT 20 | 21 | #include "otvbase.c" 22 | #include "otvcommn.c" 23 | #include "otvgdef.c" 24 | #include "otvgpos.c" 25 | #include "otvgsub.c" 26 | #include "otvjstf.c" 27 | #include "otvmath.c" 28 | #include "otvmod.c" 29 | 30 | 31 | /* END */ 32 | -------------------------------------------------------------------------------- /external/freetype/src/otvalid/otvgpos.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * otvgpos.h 4 | * 5 | * OpenType GPOS table validator (specification). 6 | * 7 | * Copyright (C) 2004-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef OTVGPOS_H_ 20 | #define OTVGPOS_H_ 21 | 22 | 23 | FT_BEGIN_HEADER 24 | 25 | 26 | FT_LOCAL( void ) 27 | otv_GPOS_subtable_validate( FT_Bytes table, 28 | OTV_Validator valid ); 29 | 30 | 31 | FT_END_HEADER 32 | 33 | #endif /* OTVGPOS_H_ */ 34 | 35 | 36 | /* END */ 37 | -------------------------------------------------------------------------------- /external/freetype/src/otvalid/otvmod.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * otvmod.h 4 | * 5 | * FreeType's OpenType validation module implementation 6 | * (specification). 7 | * 8 | * Copyright (C) 2004-2023 by 9 | * David Turner, Robert Wilhelm, and Werner Lemberg. 10 | * 11 | * This file is part of the FreeType project, and may only be used, 12 | * modified, and distributed under the terms of the FreeType project 13 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 14 | * this file you indicate that you have read the license and 15 | * understand and accept it fully. 16 | * 17 | */ 18 | 19 | 20 | #ifndef OTVMOD_H_ 21 | #define OTVMOD_H_ 22 | 23 | 24 | #include 25 | 26 | 27 | FT_BEGIN_HEADER 28 | 29 | 30 | FT_EXPORT_VAR( const FT_Module_Class ) otv_module_class; 31 | 32 | 33 | FT_END_HEADER 34 | 35 | #endif /* OTVMOD_H_ */ 36 | 37 | 38 | /* END */ 39 | -------------------------------------------------------------------------------- /external/freetype/src/pfr/pfr.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * pfr.c 4 | * 5 | * FreeType PFR driver component. 6 | * 7 | * Copyright (C) 2002-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #define FT_MAKE_OPTION_SINGLE_OBJECT 20 | 21 | #include "pfrcmap.c" 22 | #include "pfrdrivr.c" 23 | #include "pfrgload.c" 24 | #include "pfrload.c" 25 | #include "pfrobjs.c" 26 | #include "pfrsbit.c" 27 | 28 | 29 | /* END */ 30 | -------------------------------------------------------------------------------- /external/freetype/src/pfr/pfrdrivr.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * pfrdrivr.h 4 | * 5 | * High-level Type PFR driver interface (specification). 6 | * 7 | * Copyright (C) 2002-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef PFRDRIVR_H_ 20 | #define PFRDRIVR_H_ 21 | 22 | 23 | #include 24 | 25 | 26 | FT_BEGIN_HEADER 27 | 28 | FT_EXPORT_VAR( const FT_Driver_ClassRec ) pfr_driver_class; 29 | 30 | FT_END_HEADER 31 | 32 | 33 | #endif /* PFRDRIVR_H_ */ 34 | 35 | 36 | /* END */ 37 | -------------------------------------------------------------------------------- /external/freetype/src/pshinter/pshinter.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * pshinter.c 4 | * 5 | * FreeType PostScript Hinting module 6 | * 7 | * Copyright (C) 2001-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #define FT_MAKE_OPTION_SINGLE_OBJECT 20 | 21 | #include "pshalgo.c" 22 | #include "pshglob.c" 23 | #include "pshmod.c" 24 | #include "pshrec.c" 25 | 26 | 27 | /* END */ 28 | -------------------------------------------------------------------------------- /external/freetype/src/pshinter/pshmod.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * pshmod.h 4 | * 5 | * PostScript hinter module interface (specification). 6 | * 7 | * Copyright (C) 2001-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef PSHMOD_H_ 20 | #define PSHMOD_H_ 21 | 22 | 23 | #include 24 | 25 | 26 | FT_BEGIN_HEADER 27 | 28 | 29 | FT_DECLARE_MODULE( pshinter_module_class ) 30 | 31 | 32 | FT_END_HEADER 33 | 34 | 35 | #endif /* PSHMOD_H_ */ 36 | 37 | 38 | /* END */ 39 | -------------------------------------------------------------------------------- /external/freetype/src/psnames/psmodule.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * psmodule.h 4 | * 5 | * High-level psnames module interface (specification). 6 | * 7 | * Copyright (C) 1996-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef PSMODULE_H_ 20 | #define PSMODULE_H_ 21 | 22 | 23 | #include 24 | 25 | 26 | FT_BEGIN_HEADER 27 | 28 | 29 | FT_DECLARE_MODULE( psnames_module_class ) 30 | 31 | 32 | FT_END_HEADER 33 | 34 | #endif /* PSMODULE_H_ */ 35 | 36 | 37 | /* END */ 38 | -------------------------------------------------------------------------------- /external/freetype/src/psnames/psnames.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * psnames.c 4 | * 5 | * FreeType psnames module component (body only). 6 | * 7 | * Copyright (C) 1996-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #define FT_MAKE_OPTION_SINGLE_OBJECT 20 | 21 | #include "psmodule.c" 22 | 23 | 24 | /* END */ 25 | -------------------------------------------------------------------------------- /external/freetype/src/raster/ftrend1.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * ftrend1.h 4 | * 5 | * The FreeType glyph rasterizer interface (specification). 6 | * 7 | * Copyright (C) 1996-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef FTREND1_H_ 20 | #define FTREND1_H_ 21 | 22 | 23 | #include 24 | 25 | 26 | FT_BEGIN_HEADER 27 | 28 | 29 | FT_DECLARE_RENDERER( ft_raster1_renderer_class ) 30 | 31 | 32 | FT_END_HEADER 33 | 34 | #endif /* FTREND1_H_ */ 35 | 36 | 37 | /* END */ 38 | -------------------------------------------------------------------------------- /external/freetype/src/raster/raster.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * raster.c 4 | * 5 | * FreeType monochrome rasterer module component (body only). 6 | * 7 | * Copyright (C) 1996-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #define FT_MAKE_OPTION_SINGLE_OBJECT 20 | 21 | #include "ftraster.c" 22 | #include "ftrend1.c" 23 | 24 | 25 | /* END */ 26 | -------------------------------------------------------------------------------- /external/freetype/src/sdf/sdf.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * sdf.c 4 | * 5 | * FreeType Signed Distance Field renderer module component (body only). 6 | * 7 | * Copyright (C) 2020-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * Written by Anuj Verma. 11 | * 12 | * This file is part of the FreeType project, and may only be used, 13 | * modified, and distributed under the terms of the FreeType project 14 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 15 | * this file you indicate that you have read the license and 16 | * understand and accept it fully. 17 | * 18 | */ 19 | 20 | 21 | #define FT_MAKE_OPTION_SINGLE_OBJECT 22 | 23 | #include "ftsdfrend.c" 24 | #include "ftsdfcommon.c" 25 | #include "ftbsdf.c" 26 | #include "ftsdf.c" 27 | 28 | 29 | /* END */ 30 | -------------------------------------------------------------------------------- /external/freetype/src/sfnt/sfdriver.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * sfdriver.h 4 | * 5 | * High-level SFNT driver interface (specification). 6 | * 7 | * Copyright (C) 1996-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef SFDRIVER_H_ 20 | #define SFDRIVER_H_ 21 | 22 | 23 | #include 24 | 25 | 26 | FT_BEGIN_HEADER 27 | 28 | FT_DECLARE_MODULE( sfnt_module_class ) 29 | 30 | FT_END_HEADER 31 | 32 | #endif /* SFDRIVER_H_ */ 33 | 34 | 35 | /* END */ 36 | -------------------------------------------------------------------------------- /external/freetype/src/smooth/ftsmooth.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * ftsmooth.h 4 | * 5 | * Anti-aliasing renderer interface (specification). 6 | * 7 | * Copyright (C) 1996-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef FTSMOOTH_H_ 20 | #define FTSMOOTH_H_ 21 | 22 | 23 | #include 24 | 25 | 26 | FT_BEGIN_HEADER 27 | 28 | 29 | FT_DECLARE_RENDERER( ft_smooth_renderer_class ) 30 | 31 | 32 | FT_END_HEADER 33 | 34 | #endif /* FTSMOOTH_H_ */ 35 | 36 | 37 | /* END */ 38 | -------------------------------------------------------------------------------- /external/freetype/src/smooth/smooth.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * smooth.c 4 | * 5 | * FreeType anti-aliasing rasterer module component (body only). 6 | * 7 | * Copyright (C) 1996-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #define FT_MAKE_OPTION_SINGLE_OBJECT 20 | 21 | #include "ftgrays.c" 22 | #include "ftsmooth.c" 23 | 24 | 25 | /* END */ 26 | -------------------------------------------------------------------------------- /external/freetype/src/svg/ftsvg.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * ftsvg.h 4 | * 5 | * The FreeType SVG renderer interface (specification). 6 | * 7 | * Copyright (C) 2022-2023 by 8 | * David Turner, Robert Wilhelm, Werner Lemberg, and Moazin Khatti. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | #ifndef FTSVG_H_ 19 | #define FTSVG_H_ 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | 26 | FT_BEGIN_HEADER 27 | 28 | FT_DECLARE_RENDERER( ft_svg_renderer_class ) 29 | 30 | FT_END_HEADER 31 | 32 | #endif /* FTSVG_H_ */ 33 | 34 | 35 | /* END */ 36 | -------------------------------------------------------------------------------- /external/freetype/src/svg/svg.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * svg.c 4 | * 5 | * FreeType SVG renderer module component (body only). 6 | * 7 | * Copyright (C) 2022-2023 by 8 | * David Turner, Robert Wilhelm, Werner Lemberg, and Moazin Khatti. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | #define FT_MAKE_OPTION_SINGLE_OBJECT 19 | 20 | #include "svgtypes.h" 21 | #include "ftsvg.c" 22 | 23 | 24 | /* END */ 25 | -------------------------------------------------------------------------------- /external/freetype/src/truetype/ttdriver.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * ttdriver.h 4 | * 5 | * High-level TrueType driver interface (specification). 6 | * 7 | * Copyright (C) 1996-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef TTDRIVER_H_ 20 | #define TTDRIVER_H_ 21 | 22 | 23 | #include 24 | 25 | 26 | FT_BEGIN_HEADER 27 | 28 | FT_DECLARE_DRIVER( tt_driver_class ) 29 | 30 | FT_END_HEADER 31 | 32 | #endif /* TTDRIVER_H_ */ 33 | 34 | 35 | /* END */ 36 | -------------------------------------------------------------------------------- /external/freetype/src/type1/t1driver.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * t1driver.h 4 | * 5 | * High-level Type 1 driver interface (specification). 6 | * 7 | * Copyright (C) 1996-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef T1DRIVER_H_ 20 | #define T1DRIVER_H_ 21 | 22 | 23 | #include 24 | 25 | 26 | FT_BEGIN_HEADER 27 | 28 | FT_EXPORT_VAR( const FT_Driver_ClassRec ) t1_driver_class; 29 | 30 | FT_END_HEADER 31 | 32 | #endif /* T1DRIVER_H_ */ 33 | 34 | 35 | /* END */ 36 | -------------------------------------------------------------------------------- /external/freetype/src/type1/type1.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * type1.c 4 | * 5 | * FreeType Type 1 driver component (body only). 6 | * 7 | * Copyright (C) 1996-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #define FT_MAKE_OPTION_SINGLE_OBJECT 20 | 21 | #include "t1afm.c" 22 | #include "t1driver.c" 23 | #include "t1gload.c" 24 | #include "t1load.c" 25 | #include "t1objs.c" 26 | #include "t1parse.c" 27 | 28 | 29 | /* END */ 30 | -------------------------------------------------------------------------------- /external/freetype/src/type42/t42drivr.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * t42drivr.h 4 | * 5 | * High-level Type 42 driver interface (specification). 6 | * 7 | * Copyright (C) 2002-2023 by 8 | * Roberto Alameda. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef T42DRIVR_H_ 20 | #define T42DRIVR_H_ 21 | 22 | 23 | #include 24 | 25 | 26 | FT_BEGIN_HEADER 27 | 28 | FT_EXPORT_VAR( const FT_Driver_ClassRec ) t42_driver_class; 29 | 30 | FT_END_HEADER 31 | 32 | 33 | #endif /* T42DRIVR_H_ */ 34 | 35 | 36 | /* END */ 37 | -------------------------------------------------------------------------------- /external/freetype/src/type42/type42.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * type42.c 4 | * 5 | * FreeType Type 42 driver component. 6 | * 7 | * Copyright (C) 2002-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #define FT_MAKE_OPTION_SINGLE_OBJECT 20 | 21 | #include "t42drivr.c" 22 | #include "t42objs.c" 23 | #include "t42parse.c" 24 | 25 | 26 | /* END */ 27 | -------------------------------------------------------------------------------- /external/freetype/test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19) 2 | project(freetype-test C) 3 | add_executable(${PROJECT_NAME} main.c) 4 | set_target_properties(${PROJECT_NAME} PROPERTIES C_STANDARD 11) 5 | target_link_libraries(${PROJECT_NAME} PUBLIC freetype) 6 | add_test(NAME ${PROJECT_NAME} 7 | WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} 8 | COMMAND ${PROJECT_NAME}) 9 | -------------------------------------------------------------------------------- /external/freetype/test/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | #include 6 | 7 | FT_Library library; 8 | 9 | int main(int argc, char* argv[]) { 10 | FT_Error error; 11 | FT_Int major = 0; 12 | FT_Int minor = 0; 13 | FT_Int patch = 0; 14 | 15 | error = FT_Init_FreeType(&library); 16 | if (error) 17 | return EXIT_FAILURE; 18 | 19 | FT_Library_Version(library, &major, &minor, &patch); 20 | if (major != FREETYPE_MAJOR 21 | || minor != FREETYPE_MINOR 22 | || patch != FREETYPE_PATCH) 23 | return EXIT_FAILURE; 24 | 25 | printf("FT_Library_Version: %d.%d.%d\n", major, minor, patch); 26 | 27 | error = FT_Done_FreeType(library); 28 | if (error) 29 | return EXIT_FAILURE; 30 | 31 | return EXIT_SUCCESS; 32 | } -------------------------------------------------------------------------------- /external/headers/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19) 2 | project(headers C) 3 | add_library(${PROJECT_NAME} INTERFACE) 4 | target_include_directories(${PROJECT_NAME} INTERFACE ./include) 5 | add_library(ekx::${PROJECT_NAME} ALIAS ${PROJECT_NAME}) 6 | if (EKX_BUILD_EXTERNAL_TESTS) 7 | add_subdirectory(test) 8 | endif () 9 | -------------------------------------------------------------------------------- /external/headers/README.md: -------------------------------------------------------------------------------- 1 | # Single-header C libraries 2 | 3 | ## STB 4 | 5 | Package includes all header-only `stb` libraries. 6 | 7 | Headers moved to subdirectory `./stb/` to prevent search path collisions and for better source roots organization. 8 | 9 | ## DR 10 | 11 | Package includes all header-only [dr_libs](https://github.com/mackron/dr_libs) libraries. 12 | 13 | Headers moved to `./dr/` subdirectory to prevent search path collisions and for better source roots organization. 14 | 15 | - dr_mp3: 0.6.32 16 | - dr_wav: 0.13.4 17 | - dr_flac: 0.12.32 18 | 19 | ## PocketMod 20 | 21 | [pocketmod](https://github.com/rombankzero/pocketmod) headers 22 | -------------------------------------------------------------------------------- /external/headers/ek.ts: -------------------------------------------------------------------------------- 1 | import {Project} from "../../modules/cli/project.js"; 2 | 3 | export function setup(project: Project) { 4 | project.addModule({ 5 | name: "headers", 6 | cpp_include: "include" 7 | }); 8 | } 9 | -------------------------------------------------------------------------------- /external/headers/test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19) 2 | project(headers-test C) 3 | add_executable(${PROJECT_NAME} main.c) 4 | set_target_properties(${PROJECT_NAME} PROPERTIES C_STANDARD 11) 5 | target_link_libraries(${PROJECT_NAME} PUBLIC headers m) 6 | add_test(NAME ${PROJECT_NAME} 7 | WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} 8 | COMMAND ${PROJECT_NAME}) -------------------------------------------------------------------------------- /external/headers/test/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #define DR_MP3_IMPLEMENTATION 5 | #include 6 | 7 | #define DR_WAV_IMPLEMENTATION 8 | #include 9 | 10 | #define DR_FLAC_IMPLEMENTATION 11 | #include 12 | 13 | #define STB_IMAGE_IMPLEMENTATION 14 | #include 15 | 16 | #define STB_IMAGE_WRITE_IMPLEMENTATION 17 | #include 18 | 19 | #include 20 | 21 | int main(int argc, char* argv[]) { 22 | 23 | printf("versions:\n"); 24 | printf("dr_mp3: %s\n", DRMP3_VERSION_STRING); 25 | printf("dr_wav: %s\n", DRWAV_VERSION_STRING); 26 | printf("dr_flac: %s\n", DRFLAC_VERSION_STRING); 27 | 28 | int error = 0; 29 | if (error) { 30 | return EXIT_FAILURE; 31 | } 32 | 33 | return EXIT_SUCCESS; 34 | } -------------------------------------------------------------------------------- /external/imgui/README.md: -------------------------------------------------------------------------------- 1 | # imgui 2 | 3 | v1.84 4 | 5 | ## Editor Support Font Collection 6 | 7 | ### Material Design Icons 8 | 9 | TrueType fonts collection 10 | 11 | - source: [google/material-design-icons](https://github.com/google/material-design-icons) 12 | - version: 4.0.0 13 | 14 | ### Font headers 15 | 16 | C headers with icons codepoints declarations from [IconFontCppHeaders](https://github.com/juliettef/IconFontCppHeaders) 17 | -------------------------------------------------------------------------------- /external/imgui/ek.ts: -------------------------------------------------------------------------------- 1 | import {Project} from "../../modules/cli/project.js"; 2 | 3 | export async function setup(project: Project) { 4 | project.addModule({ 5 | name: "imgui", 6 | cpp: "src" 7 | }); 8 | await project.importModule("../freetype/ek.ts"); 9 | await project.importModule("../headers/ek.ts"); 10 | } 11 | -------------------------------------------------------------------------------- /external/imgui/test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19) 2 | project(imgui-test) 3 | add_executable(${PROJECT_NAME} main.cpp) 4 | 5 | set_target_properties(${PROJECT_NAME} PROPERTIES 6 | C_STANDARD 11 7 | CXX_STANDARD 17 8 | CXX_STANDARD_REQUIRED YES 9 | CXX_EXTENSIONS NO 10 | ) 11 | 12 | target_link_libraries(${PROJECT_NAME} PUBLIC imgui) 13 | add_test(NAME ${PROJECT_NAME} 14 | WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} 15 | COMMAND ${PROJECT_NAME}) 16 | -------------------------------------------------------------------------------- /external/imgui/ttf/Cousine-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/highduck/ekx/e52b74588b9e753b392d43daa76ebd458d842ed4/external/imgui/ttf/Cousine-Regular.ttf -------------------------------------------------------------------------------- /external/imgui/ttf/MaterialIcons-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/highduck/ekx/e52b74588b9e753b392d43daa76ebd458d842ed4/external/imgui/ttf/MaterialIcons-Regular.ttf -------------------------------------------------------------------------------- /external/imgui/ttf/fa-regular-400.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/highduck/ekx/e52b74588b9e753b392d43daa76ebd458d842ed4/external/imgui/ttf/fa-regular-400.ttf -------------------------------------------------------------------------------- /external/imgui/ttf/fa-solid-900.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/highduck/ekx/e52b74588b9e753b392d43daa76ebd458d842ed4/external/imgui/ttf/fa-solid-900.ttf -------------------------------------------------------------------------------- /external/imgui/ttf/sf-mono-text-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/highduck/ekx/e52b74588b9e753b392d43daa76ebd458d842ed4/external/imgui/ttf/sf-mono-text-regular.ttf -------------------------------------------------------------------------------- /external/imgui/ttf/sf-pro-text-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/highduck/ekx/e52b74588b9e753b392d43daa76ebd458d842ed4/external/imgui/ttf/sf-pro-text-regular.ttf -------------------------------------------------------------------------------- /external/miniz/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19) 2 | project(miniz C) 3 | 4 | add_library(${PROJECT_NAME} STATIC 5 | src/miniz.c 6 | src/miniz.h 7 | src/miniz_export.h 8 | src/miniz_tdef.c 9 | src/miniz_tdef.h 10 | src/miniz_tinfl.c 11 | src/miniz_tinfl.h 12 | src/miniz_zip.c 13 | src/miniz_zip.h 14 | ) 15 | 16 | target_include_directories(${PROJECT_NAME} PUBLIC ./src) 17 | 18 | set_target_properties(${PROJECT_NAME} PROPERTIES C_STANDARD 11) 19 | 20 | add_library(ekx::${PROJECT_NAME} ALIAS ${PROJECT_NAME}) 21 | 22 | if (EKX_BUILD_EXTERNAL_TESTS) 23 | add_subdirectory(test) 24 | endif () 25 | -------------------------------------------------------------------------------- /external/miniz/README.md: -------------------------------------------------------------------------------- 1 | # miniz 2 | 3 | Version: 3.0.0 4 | 5 | Patch `miniz_zip.c`: 6 | ```c 7 | cdir_ofs = MZ_READ_LE32(pBuf + MZ_ZIP_ECDH_CDIR_OFS_OFS); 8 | // TODO: PATCH! 9 | if(cdir_ofs + cdir_size > pZip->m_archive_size) { 10 | cdir_size = pZip->m_archive_size - cdir_ofs; 11 | } 12 | -------------------------------------------------------------------------------- /external/miniz/src/miniz_export.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef MINIZ_EXPORT 3 | #define MINIZ_EXPORT 4 | #endif 5 | -------------------------------------------------------------------------------- /external/miniz/test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19) 2 | project(miniz-test C) 3 | add_executable(${PROJECT_NAME} main.c) 4 | set_target_properties(${PROJECT_NAME} PROPERTIES C_STANDARD 11) 5 | target_link_libraries(${PROJECT_NAME} PUBLIC miniz) 6 | add_test(NAME ${PROJECT_NAME} 7 | WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} 8 | COMMAND ${PROJECT_NAME}) -------------------------------------------------------------------------------- /external/miniz/test/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main(int argc, char* argv[]) { 6 | 7 | printf("miniz version: %s\n", MZ_VERSION); 8 | printf("zlib version: %s\n", ZLIB_VERSION); 9 | 10 | return EXIT_SUCCESS; 11 | } -------------------------------------------------------------------------------- /external/msgpack/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19) 2 | project(msgpack) 3 | 4 | add_library(${PROJECT_NAME} INTERFACE) 5 | 6 | target_include_directories(${PROJECT_NAME} INTERFACE ./include) 7 | 8 | set_target_properties(${PROJECT_NAME} PROPERTIES 9 | C_STANDARD 11 10 | CXX_STANDARD 17 11 | CXX_STANDARD_REQUIRED YES 12 | CXX_EXTENSIONS NO 13 | ) 14 | 15 | add_library(ekx::${PROJECT_NAME} ALIAS ${PROJECT_NAME}) -------------------------------------------------------------------------------- /external/msgpack/README.md: -------------------------------------------------------------------------------- 1 | # Message Pack 2 | 3 | [msgpack](https://msgpack.org) module for ekx 4 | 5 | - [C](https://github.com/msgpack/msgpack-c/tree/c_master) 6 | - -------------------------------------------------------------------------------- /external/msgpack/ek.ts: -------------------------------------------------------------------------------- 1 | import {Project} from "../../modules/cli/project.js"; 2 | 3 | export function setup(project: Project) { 4 | project.addModule({ 5 | name: "msgpack", 6 | cpp_include: "include" 7 | }); 8 | } 9 | -------------------------------------------------------------------------------- /external/msgpack/include/msgpack.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MessagePack for C 3 | * 4 | * Copyright (C) 2008-2009 FURUHASHI Sadayuki 5 | * 6 | * Distributed under the Boost Software License, Version 1.0. 7 | * (See accompanying file LICENSE_1_0.txt or copy at 8 | * http://www.boost.org/LICENSE_1_0.txt) 9 | */ 10 | /** 11 | * @defgroup msgpack MessagePack C 12 | * @{ 13 | * @} 14 | */ 15 | 16 | #include "msgpack/util.h" 17 | #include "msgpack/object.h" 18 | #include "msgpack/zone.h" 19 | #include "msgpack/pack.h" 20 | #include "msgpack/unpack.h" 21 | #include "msgpack/sbuffer.h" 22 | #include "msgpack/vrefbuffer.h" 23 | #include "msgpack/version.h" 24 | 25 | -------------------------------------------------------------------------------- /external/msgpack/include/msgpack/fbuffer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MessagePack for C FILE* buffer adaptor 3 | * 4 | * Copyright (C) 2013 Vladimir Volodko 5 | * 6 | * Distributed under the Boost Software License, Version 1.0. 7 | * (See accompanying file LICENSE_1_0.txt or copy at 8 | * http://www.boost.org/LICENSE_1_0.txt) 9 | */ 10 | #ifndef MSGPACK_FBUFFER_H 11 | #define MSGPACK_FBUFFER_H 12 | 13 | #include 14 | #include 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | 21 | /** 22 | * @defgroup msgpack_fbuffer FILE* buffer 23 | * @ingroup msgpack_buffer 24 | * @{ 25 | */ 26 | 27 | static inline int msgpack_fbuffer_write(void* data, const char* buf, size_t len) 28 | { 29 | assert(buf || len == 0); 30 | if(!buf) return 0; 31 | 32 | return (1 == fwrite(buf, len, 1, (FILE *)data)) ? 0 : -1; 33 | } 34 | 35 | /** @} */ 36 | 37 | 38 | #ifdef __cplusplus 39 | } 40 | #endif 41 | 42 | #endif /* msgpack/fbuffer.h */ 43 | -------------------------------------------------------------------------------- /external/msgpack/include/msgpack/gcc_atomic.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Distributed under the Boost Software License, Version 1.0. 3 | * (See accompanying file LICENSE_1_0.txt or copy at 4 | * http://www.boost.org/LICENSE_1_0.txt) 5 | */ 6 | 7 | #ifndef MSGPACK_GCC_ATOMIC_H 8 | #define MSGPACK_GCC_ATOMIC_H 9 | 10 | #if defined(__cplusplus) 11 | extern "C" { 12 | #endif 13 | 14 | typedef int _msgpack_atomic_counter_t; 15 | 16 | int _msgpack_sync_decr_and_fetch(volatile _msgpack_atomic_counter_t* ptr); 17 | int _msgpack_sync_incr_and_fetch(volatile _msgpack_atomic_counter_t* ptr); 18 | 19 | 20 | #if defined(__cplusplus) 21 | } 22 | #endif 23 | 24 | 25 | #endif // MSGPACK_GCC_ATOMIC_H 26 | -------------------------------------------------------------------------------- /external/msgpack/include/msgpack/msgpack_all.c: -------------------------------------------------------------------------------- 1 | #include "version.c" 2 | #include "objectc.c" 3 | #include "unpack.c" 4 | #include "zone.c" 5 | #include "vrefbuffer.c" 6 | -------------------------------------------------------------------------------- /external/msgpack/include/msgpack/pack_define.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MessagePack unpacking routine template 3 | * 4 | * Copyright (C) 2008-2010 FURUHASHI Sadayuki 5 | * 6 | * Distributed under the Boost Software License, Version 1.0. 7 | * (See accompanying file LICENSE_1_0.txt or copy at 8 | * http://www.boost.org/LICENSE_1_0.txt) 9 | */ 10 | #ifndef MSGPACK_PACK_DEFINE_H 11 | #define MSGPACK_PACK_DEFINE_H 12 | 13 | #include "msgpack/sysdep.h" 14 | #include 15 | #include 16 | 17 | #endif /* msgpack/pack_define.h */ 18 | 19 | -------------------------------------------------------------------------------- /external/msgpack/include/msgpack/util.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MessagePack for C utilities 3 | * 4 | * Copyright (C) 2014 FURUHASHI Sadayuki 5 | * 6 | * Distributed under the Boost Software License, Version 1.0. 7 | * (See accompanying file LICENSE_1_0.txt or copy at 8 | * http://www.boost.org/LICENSE_1_0.txt) 9 | */ 10 | #ifndef MSGPACK_UTIL_H 11 | #define MSGPACK_UTIL_H 12 | 13 | #define MSGPACK_UNUSED(a) (void)(a) 14 | 15 | #endif /* MSGPACK_UTIL_H */ 16 | -------------------------------------------------------------------------------- /external/msgpack/include/msgpack/version.c: -------------------------------------------------------------------------------- 1 | #include "msgpack.h" 2 | 3 | const char* msgpack_version(void) 4 | { 5 | return MSGPACK_VERSION; 6 | } 7 | 8 | int msgpack_version_major(void) 9 | { 10 | return MSGPACK_VERSION_MAJOR; 11 | } 12 | 13 | int msgpack_version_minor(void) 14 | { 15 | return MSGPACK_VERSION_MINOR; 16 | } 17 | 18 | int msgpack_version_revision(void) 19 | { 20 | return MSGPACK_VERSION_REVISION; 21 | } 22 | 23 | -------------------------------------------------------------------------------- /external/msgpack/include/msgpack/version_master.h: -------------------------------------------------------------------------------- 1 | #define MSGPACK_VERSION_MAJOR 4 2 | #define MSGPACK_VERSION_MINOR 0 3 | #define MSGPACK_VERSION_REVISION 0 4 | -------------------------------------------------------------------------------- /external/pugixml/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19) 2 | project(pugixml) 3 | 4 | add_library(${PROJECT_NAME} STATIC 5 | src/pugixml.cpp 6 | src/pugixml.hpp 7 | src/pugiconfig.hpp 8 | ) 9 | 10 | target_include_directories(${PROJECT_NAME} PUBLIC ./src) 11 | 12 | set_target_properties(${PROJECT_NAME} PROPERTIES 13 | C_STANDARD 11 14 | CXX_STANDARD 17 15 | CXX_STANDARD_REQUIRED YES 16 | CXX_EXTENSIONS NO 17 | ) 18 | 19 | add_library(ekx::${PROJECT_NAME} ALIAS ${PROJECT_NAME}) 20 | 21 | target_compile_options(${PROJECT_NAME} PRIVATE 22 | -fno-exceptions 23 | -fno-rtti 24 | -fno-strict-aliasing 25 | -Wstrict-aliasing=2 26 | ) 27 | 28 | target_compile_definitions(${PROJECT_NAME} 29 | PUBLIC PUGIXML_NO_XPATH 30 | PUBLIC PUGIXML_NO_STL 31 | PUBLIC PUGIXML_NO_EXCEPTIONS) 32 | 33 | if (EKX_BUILD_EXTERNAL_TESTS) 34 | add_subdirectory(test) 35 | endif () 36 | -------------------------------------------------------------------------------- /external/pugixml/README.md: -------------------------------------------------------------------------------- 1 | # pugixml 2 | 3 | version: 1.12 4 | -------------------------------------------------------------------------------- /external/pugixml/test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19) 2 | 3 | project(pugixml-test) 4 | add_executable(${PROJECT_NAME} main.cpp) 5 | 6 | set_target_properties(${PROJECT_NAME} PROPERTIES 7 | C_STANDARD 11 8 | CXX_STANDARD 17 9 | CXX_STANDARD_REQUIRED YES 10 | CXX_EXTENSIONS NO 11 | ) 12 | 13 | target_link_libraries(${PROJECT_NAME} PUBLIC pugixml) 14 | add_test(NAME ${PROJECT_NAME} 15 | WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} 16 | COMMAND ${PROJECT_NAME}) -------------------------------------------------------------------------------- /external/pugixml/test/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main(int argc, char* argv[]) { 6 | printf("pugixml version: %d\n", PUGIXML_VERSION); 7 | 8 | return EXIT_SUCCESS; 9 | } -------------------------------------------------------------------------------- /external/quickjs/ek.ts: -------------------------------------------------------------------------------- 1 | import {Project} from "../../modules/cli/project.js"; 2 | 3 | export function setup(project:Project) { 4 | project.addModule({ 5 | name: "quickjs", 6 | cpp: "src", 7 | cpp_define: ['CONFIG_VERSION="1"', "_GNU_SOURCE"], 8 | }); 9 | } 10 | -------------------------------------------------------------------------------- /external/quickjs/test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19) 2 | project(quickjs-test C) 3 | add_executable(${PROJECT_NAME} main.c) 4 | set_target_properties(${PROJECT_NAME} PROPERTIES C_STANDARD 11) 5 | target_link_libraries(${PROJECT_NAME} PUBLIC quickjs) 6 | add_test(NAME ${PROJECT_NAME} 7 | WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} 8 | COMMAND ${PROJECT_NAME}) 9 | -------------------------------------------------------------------------------- /external/quickjs/test/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main(int argc, char* argv[]) { 5 | printf("quickjs version: %d\n", 1); 6 | 7 | return EXIT_SUCCESS; 8 | } -------------------------------------------------------------------------------- /external/sokol/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19) 2 | project(sokol C) 3 | add_library(${PROJECT_NAME} INTERFACE) 4 | target_include_directories(${PROJECT_NAME} INTERFACE ./include) 5 | add_library(ekx::${PROJECT_NAME} ALIAS ${PROJECT_NAME}) 6 | if (EKX_BUILD_EXTERNAL_TESTS) 7 | add_subdirectory(test) 8 | endif () 9 | -------------------------------------------------------------------------------- /external/sokol/README.md: -------------------------------------------------------------------------------- 1 | # sokol 2 | 3 | ### Version 4 | - repo: [flooh/sokol](https://github.com/floooh/sokol) 5 | - branch: `master` 6 | - commit: `d44328073d2316f73cec5a99b846593fadd51ba3` 7 | - date: 2021-03-23 -------------------------------------------------------------------------------- /external/sokol/ek.ts: -------------------------------------------------------------------------------- 1 | import {Project} from "../../modules/cli/project.js"; 2 | 3 | export function setup(project: Project) { 4 | project.addModule({ 5 | name: "sokol", 6 | cpp_include: "include" 7 | }); 8 | } 9 | -------------------------------------------------------------------------------- /external/sokol/test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19) 2 | project(sokol-test C) 3 | add_executable(${PROJECT_NAME} main.c) 4 | set_target_properties(${PROJECT_NAME} PROPERTIES C_STANDARD 11) 5 | target_link_libraries(${PROJECT_NAME} PUBLIC sokol) 6 | add_test(NAME ${PROJECT_NAME} 7 | WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} 8 | COMMAND ${PROJECT_NAME}) -------------------------------------------------------------------------------- /external/sokol/test/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main(int argc, char* argv[]) { 6 | 7 | return EXIT_SUCCESS; 8 | } -------------------------------------------------------------------------------- /logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/highduck/ekx/e52b74588b9e753b392d43daa76ebd458d842ed4/logo.png -------------------------------------------------------------------------------- /logow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/highduck/ekx/e52b74588b9e753b392d43daa76ebd458d842ed4/logow.png -------------------------------------------------------------------------------- /modules/android-proj/README.md: -------------------------------------------------------------------------------- 1 | # Android Project Generator 2 | 3 | Simple tool to generate Android Studio project by code 4 | 5 | - create classic project structure with 1 app module: 6 | - generates `build.gradle` modules 7 | - setup `settings.gradle` file 8 | - setup `gradle.properties` 9 | - put gradle wrapper files 10 | - put default `.gitignore` 11 | - put default `fastlane` config 12 | -------------------------------------------------------------------------------- /modules/android-proj/_project/Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | 3 | gem "fastlane" 4 | -------------------------------------------------------------------------------- /modules/android-proj/_project/_gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/caches 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | /.idea/navEditor.xml 9 | /.idea/assetWizardSettings.xml 10 | .DS_Store 11 | /build 12 | /captures 13 | .externalNativeBuild 14 | -------------------------------------------------------------------------------- /modules/android-proj/_project/_idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 20 | -------------------------------------------------------------------------------- /modules/android-proj/_project/app/_gitignore: -------------------------------------------------------------------------------- 1 | /.cxx 2 | /build 3 | -------------------------------------------------------------------------------- /modules/android-proj/_project/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /modules/android-proj/_project/app/src/main/java/com/eliasku/template_android/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.eliasku.template_android; 2 | 3 | import android.os.Bundle; 4 | 5 | public class MainActivity extends ek.EkActivity { 6 | @Override 7 | protected void onCreate(Bundle savedInstanceState) { 8 | ek.AppUtils.setDebugBuild(BuildConfig.DEBUG); 9 | super.onCreate(savedInstanceState); 10 | } 11 | } -------------------------------------------------------------------------------- /modules/android-proj/_project/app/src/main/res/drawable/launch_splash.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /modules/android-proj/_project/app/src/main/res/drawable/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/highduck/ekx/e52b74588b9e753b392d43daa76ebd458d842ed4/modules/android-proj/_project/app/src/main/res/drawable/splash.png -------------------------------------------------------------------------------- /modules/android-proj/_project/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/highduck/ekx/e52b74588b9e753b392d43daa76ebd458d842ed4/modules/android-proj/_project/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /modules/android-proj/_project/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/highduck/ekx/e52b74588b9e753b392d43daa76ebd458d842ed4/modules/android-proj/_project/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /modules/android-proj/_project/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/highduck/ekx/e52b74588b9e753b392d43daa76ebd458d842ed4/modules/android-proj/_project/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /modules/android-proj/_project/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/highduck/ekx/e52b74588b9e753b392d43daa76ebd458d842ed4/modules/android-proj/_project/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /modules/android-proj/_project/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/highduck/ekx/e52b74588b9e753b392d43daa76ebd458d842ed4/modules/android-proj/_project/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /modules/android-proj/_project/app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #008577 4 | #00574B 5 | #D81B60 6 | 7 | -------------------------------------------------------------------------------- /modules/android-proj/_project/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | template-android 3 | com.eliasku.template_android 4 | 5 | -------------------------------------------------------------------------------- /modules/android-proj/_project/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 14 | 15 | -------------------------------------------------------------------------------- /modules/android-proj/_project/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | google() 6 | mavenCentral() 7 | } 8 | dependencies { 9 | } 10 | } 11 | 12 | allprojects { 13 | repositories { 14 | google() 15 | mavenCentral() 16 | } 17 | } 18 | 19 | task clean(type: Delete) { 20 | delete rootProject.buildDir 21 | } 22 | -------------------------------------------------------------------------------- /modules/android-proj/_project/fastlane/Appfile: -------------------------------------------------------------------------------- 1 | json_key_file("__SERVICE_ACCOUNT_KEY_PATH__") 2 | package_name("__PACKAGE_NAME__") 3 | -------------------------------------------------------------------------------- /modules/android-proj/_project/fastlane/Fastfile: -------------------------------------------------------------------------------- 1 | # Uncomment the line if you want fastlane to automatically update itself 2 | # update_fastlane 3 | 4 | default_platform(:android) 5 | 6 | platform :android do 7 | lane :beta do 8 | gradle(task: "clean") 9 | gradle(task: "bundle", build_type: "Release") 10 | gradle(task: "uploadCrashlyticsSymbolFile", build_type: "Release") 11 | upload_to_play_store(track: 'beta') 12 | end 13 | lane :internal do 14 | gradle(task: "clean") 15 | gradle(task: "bundle", build_type: "Release") 16 | gradle(task: "uploadCrashlyticsSymbolFile", build_type: "Release") 17 | upload_to_play_store(track: 'internal') 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /modules/android-proj/_project/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/highduck/ekx/e52b74588b9e753b392d43daa76ebd458d842ed4/modules/android-proj/_project/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /modules/android-proj/_project/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Oct 16 17:27:36 EET 2020 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip 7 | -------------------------------------------------------------------------------- /modules/android-proj/_project/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /modules/cli/README.md: -------------------------------------------------------------------------------- 1 | # Command-line manager tool 2 | 3 | ### iOS 4 | 5 | ``` 6 | pip3 install pbxproj 7 | ``` 8 | 9 | ## Script 10 | 11 | ### Build WebAssembly 12 | 13 | 1. Make "export project dir" 14 | 2. copy template CMake file and fill sources 15 | 3. generate build directory and run cmake build 16 | 17 | Build WEB: 18 | ``` 19 | ekx web 20 | ``` 21 | 22 | Build debug WEB: 23 | ``` 24 | ekx web --debug 25 | ``` 26 | -------------------------------------------------------------------------------- /modules/cli/_templates/android-icons/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/highduck/ekx/e52b74588b9e753b392d43daa76ebd458d842ed4/modules/cli/_templates/android-icons/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /modules/cli/_templates/android-icons/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/highduck/ekx/e52b74588b9e753b392d43daa76ebd458d842ed4/modules/cli/_templates/android-icons/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /modules/cli/_templates/android-icons/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/highduck/ekx/e52b74588b9e753b392d43daa76ebd458d842ed4/modules/cli/_templates/android-icons/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /modules/cli/_templates/android-icons/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/highduck/ekx/e52b74588b9e753b392d43daa76ebd458d842ed4/modules/cli/_templates/android-icons/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /modules/cli/_templates/android-icons/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/highduck/ekx/e52b74588b9e753b392d43daa76ebd458d842ed4/modules/cli/_templates/android-icons/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /modules/cli/_templates/android-splash/launch_splash.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /modules/cli/_templates/android-splash/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/highduck/ekx/e52b74588b9e753b392d43daa76ebd458d842ed4/modules/cli/_templates/android-splash/splash.png -------------------------------------------------------------------------------- /modules/cli/_templates/default-icon.fla: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/highduck/ekx/e52b74588b9e753b392d43daa76ebd458d842ed4/modules/cli/_templates/default-icon.fla -------------------------------------------------------------------------------- /modules/cli/_templates/template-ios/Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | 3 | gem "fastlane" 4 | -------------------------------------------------------------------------------- /modules/cli/_templates/template-ios/Podfile: -------------------------------------------------------------------------------- 1 | source 'https://github.com/CocoaPods/Specs.git' 2 | platform :ios, '12.0' 3 | 4 | target 'app-ios' do 5 | use_frameworks! :linkage => :static 6 | # TEMPLATE DEPENDENCIES 7 | end 8 | -------------------------------------------------------------------------------- /modules/cli/_templates/template-ios/app-ios.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /modules/cli/_templates/template-ios/app-ios.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /modules/cli/_templates/template-ios/app-ios.xcodeproj/project.xcworkspace/xcuserdata/ilyak.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/highduck/ekx/e52b74588b9e753b392d43daa76ebd458d842ed4/modules/cli/_templates/template-ios/app-ios.xcodeproj/project.xcworkspace/xcuserdata/ilyak.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /modules/cli/_templates/template-ios/app-ios.xcodeproj/xcuserdata/ilyak.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | app-ios.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /modules/cli/_templates/template-ios/fastlane/Appfile: -------------------------------------------------------------------------------- 1 | # The bundle identifier of your app 2 | app_identifier("[[APP_IDENTIFIER]]") 3 | 4 | # Apple connect credentials 5 | apple_id("[[APPLE_ID]]") 6 | team_id("[[TEAM_ID]]") 7 | itc_team_id("[[ITC_TEAM_ID]]") -------------------------------------------------------------------------------- /modules/cli/_templates/template-ios/fastlane/Fastfile: -------------------------------------------------------------------------------- 1 | # Uncomment the line if you want fastlane to automatically update itself 2 | # update_fastlane 3 | 4 | default_platform(:ios) 5 | 6 | platform :ios do 7 | desc "Build and upload to TestFlight" 8 | lane :internal do 9 | # sync_code_signing(type: "appstore") 10 | build_app( 11 | configuration: "Release", 12 | clean: true, 13 | xcargs: "-allowProvisioningUpdates" 14 | ) 15 | upload_to_testflight 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /modules/cli/_templates/template-ios/src/Assets.xcassets/AppIcon.appiconset/ios-marketing_1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/highduck/ekx/e52b74588b9e753b392d43daa76ebd458d842ed4/modules/cli/_templates/template-ios/src/Assets.xcassets/AppIcon.appiconset/ios-marketing_1024.png -------------------------------------------------------------------------------- /modules/cli/_templates/template-ios/src/Assets.xcassets/AppIcon.appiconset/ipad_152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/highduck/ekx/e52b74588b9e753b392d43daa76ebd458d842ed4/modules/cli/_templates/template-ios/src/Assets.xcassets/AppIcon.appiconset/ipad_152.png -------------------------------------------------------------------------------- /modules/cli/_templates/template-ios/src/Assets.xcassets/AppIcon.appiconset/ipad_167.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/highduck/ekx/e52b74588b9e753b392d43daa76ebd458d842ed4/modules/cli/_templates/template-ios/src/Assets.xcassets/AppIcon.appiconset/ipad_167.png -------------------------------------------------------------------------------- /modules/cli/_templates/template-ios/src/Assets.xcassets/AppIcon.appiconset/ipad_20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/highduck/ekx/e52b74588b9e753b392d43daa76ebd458d842ed4/modules/cli/_templates/template-ios/src/Assets.xcassets/AppIcon.appiconset/ipad_20.png -------------------------------------------------------------------------------- /modules/cli/_templates/template-ios/src/Assets.xcassets/AppIcon.appiconset/ipad_29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/highduck/ekx/e52b74588b9e753b392d43daa76ebd458d842ed4/modules/cli/_templates/template-ios/src/Assets.xcassets/AppIcon.appiconset/ipad_29.png -------------------------------------------------------------------------------- /modules/cli/_templates/template-ios/src/Assets.xcassets/AppIcon.appiconset/ipad_40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/highduck/ekx/e52b74588b9e753b392d43daa76ebd458d842ed4/modules/cli/_templates/template-ios/src/Assets.xcassets/AppIcon.appiconset/ipad_40.png -------------------------------------------------------------------------------- /modules/cli/_templates/template-ios/src/Assets.xcassets/AppIcon.appiconset/ipad_58.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/highduck/ekx/e52b74588b9e753b392d43daa76ebd458d842ed4/modules/cli/_templates/template-ios/src/Assets.xcassets/AppIcon.appiconset/ipad_58.png -------------------------------------------------------------------------------- /modules/cli/_templates/template-ios/src/Assets.xcassets/AppIcon.appiconset/ipad_76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/highduck/ekx/e52b74588b9e753b392d43daa76ebd458d842ed4/modules/cli/_templates/template-ios/src/Assets.xcassets/AppIcon.appiconset/ipad_76.png -------------------------------------------------------------------------------- /modules/cli/_templates/template-ios/src/Assets.xcassets/AppIcon.appiconset/ipad_80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/highduck/ekx/e52b74588b9e753b392d43daa76ebd458d842ed4/modules/cli/_templates/template-ios/src/Assets.xcassets/AppIcon.appiconset/ipad_80.png -------------------------------------------------------------------------------- /modules/cli/_templates/template-ios/src/Assets.xcassets/AppIcon.appiconset/iphone_120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/highduck/ekx/e52b74588b9e753b392d43daa76ebd458d842ed4/modules/cli/_templates/template-ios/src/Assets.xcassets/AppIcon.appiconset/iphone_120.png -------------------------------------------------------------------------------- /modules/cli/_templates/template-ios/src/Assets.xcassets/AppIcon.appiconset/iphone_180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/highduck/ekx/e52b74588b9e753b392d43daa76ebd458d842ed4/modules/cli/_templates/template-ios/src/Assets.xcassets/AppIcon.appiconset/iphone_180.png -------------------------------------------------------------------------------- /modules/cli/_templates/template-ios/src/Assets.xcassets/AppIcon.appiconset/iphone_40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/highduck/ekx/e52b74588b9e753b392d43daa76ebd458d842ed4/modules/cli/_templates/template-ios/src/Assets.xcassets/AppIcon.appiconset/iphone_40.png -------------------------------------------------------------------------------- /modules/cli/_templates/template-ios/src/Assets.xcassets/AppIcon.appiconset/iphone_58.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/highduck/ekx/e52b74588b9e753b392d43daa76ebd458d842ed4/modules/cli/_templates/template-ios/src/Assets.xcassets/AppIcon.appiconset/iphone_58.png -------------------------------------------------------------------------------- /modules/cli/_templates/template-ios/src/Assets.xcassets/AppIcon.appiconset/iphone_60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/highduck/ekx/e52b74588b9e753b392d43daa76ebd458d842ed4/modules/cli/_templates/template-ios/src/Assets.xcassets/AppIcon.appiconset/iphone_60.png -------------------------------------------------------------------------------- /modules/cli/_templates/template-ios/src/Assets.xcassets/AppIcon.appiconset/iphone_80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/highduck/ekx/e52b74588b9e753b392d43daa76ebd458d842ed4/modules/cli/_templates/template-ios/src/Assets.xcassets/AppIcon.appiconset/iphone_80.png -------------------------------------------------------------------------------- /modules/cli/_templates/template-ios/src/Assets.xcassets/AppIcon.appiconset/iphone_87.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/highduck/ekx/e52b74588b9e753b392d43daa76ebd458d842ed4/modules/cli/_templates/template-ios/src/Assets.xcassets/AppIcon.appiconset/iphone_87.png -------------------------------------------------------------------------------- /modules/cli/_templates/template-ios/src/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | }, 6 | "properties" : { 7 | "compression-type" : "lossless" 8 | } 9 | } -------------------------------------------------------------------------------- /modules/cli/_templates/template-ios/src/Assets.xcassets/LaunchLogo.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "iphone_40.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "iphone_80.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "iphone_120.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | }, 23 | "properties" : { 24 | "auto-scaling" : "auto" 25 | } 26 | } -------------------------------------------------------------------------------- /modules/cli/_templates/template-ios/src/Assets.xcassets/LaunchLogo.imageset/iphone_120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/highduck/ekx/e52b74588b9e753b392d43daa76ebd458d842ed4/modules/cli/_templates/template-ios/src/Assets.xcassets/LaunchLogo.imageset/iphone_120.png -------------------------------------------------------------------------------- /modules/cli/_templates/template-ios/src/Assets.xcassets/LaunchLogo.imageset/iphone_40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/highduck/ekx/e52b74588b9e753b392d43daa76ebd458d842ed4/modules/cli/_templates/template-ios/src/Assets.xcassets/LaunchLogo.imageset/iphone_40.png -------------------------------------------------------------------------------- /modules/cli/_templates/template-ios/src/Assets.xcassets/LaunchLogo.imageset/iphone_80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/highduck/ekx/e52b74588b9e753b392d43daa76ebd458d842ed4/modules/cli/_templates/template-ios/src/Assets.xcassets/LaunchLogo.imageset/iphone_80.png -------------------------------------------------------------------------------- /modules/cli/_templates/template-ios/xcode-project-ios-post.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | from pbxproj import XcodeProject, PBXShellScriptBuildPhase 4 | 5 | proj_ios_name = sys.argv[1] 6 | 7 | mainTargetName = "app-ios" 8 | 9 | project = XcodeProject.load(f"{mainTargetName}.xcodeproj/project.pbxproj") 10 | app_target = project.get_target_by_name(mainTargetName) 11 | 12 | # XCODE_POST_PROJECT 13 | 14 | project.save() 15 | -------------------------------------------------------------------------------- /modules/cli/_templates/web/README.md: -------------------------------------------------------------------------------- 1 | ### Web template resources 2 | 3 | - [pwacompat.min.js](https://github.com/GoogleChromeLabs/pwacompat) 2.0.17 4 | -------------------------------------------------------------------------------- /modules/cli/assets.ts: -------------------------------------------------------------------------------- 1 | import {Project} from "./project.js"; 2 | import {AssetBuilder} from "./assets/AssetBuilder.js"; 3 | import {rm} from "../utils/utils.js"; 4 | 5 | // asset pack name 6 | export async function buildAssetPackAsync(ctx: Project, output?: string, devMode?: boolean, cleanCache?: boolean) { 7 | devMode = devMode ?? false; 8 | let assetsInput = ctx.getAssetsInput(); 9 | let assetsOutput = output ?? ctx.getAssetsOutput(); 10 | 11 | const builder = new AssetBuilder(ctx, assetsInput); 12 | builder.devMode = devMode; 13 | builder.cache = "export/content/.cache"; 14 | builder.output = assetsOutput; 15 | if (cleanCache) { 16 | await rm(builder.cache); 17 | await rm(builder.output); 18 | } 19 | await builder.populate(); 20 | builder.prepare(); 21 | 22 | await builder.buildIfChanged(); 23 | 24 | if (!devMode) { 25 | //await optimizePngGlobAsync(path.join(assetsOutput, "**/*.png")); 26 | } 27 | } -------------------------------------------------------------------------------- /modules/cli/assets/DynamicAtlas.ts: -------------------------------------------------------------------------------- 1 | import {Asset, AssetDesc} from "./Asset.js"; 2 | import {H} from "../utility/hash.js"; 3 | 4 | export interface DynamicAtlasDesc extends AssetDesc { 5 | name: string; 6 | alpha_map?: boolean; // false 7 | mipmaps?: boolean; // false 8 | } 9 | 10 | export class DynamicAtlasAsset extends Asset { 11 | static typeName = "dynamic_atlas"; 12 | 13 | constructor(readonly desc: DynamicAtlasDesc) { 14 | super(desc, DynamicAtlasAsset.typeName); 15 | } 16 | 17 | build(): null { 18 | let flags = 0; 19 | if (this.desc.alpha_map) flags |= 1; 20 | if (this.desc.mipmaps) flags |= 2; 21 | 22 | this.writer.writeU32(H(DynamicAtlasAsset.typeName)); 23 | this.writer.writeU32(H(this.desc.name)); 24 | this.writer.writeU32(flags); 25 | 26 | return null; 27 | } 28 | 29 | } -------------------------------------------------------------------------------- /modules/cli/assets/helpers/StringTable.ts: -------------------------------------------------------------------------------- 1 | import {BytesWriter} from "./BytesWriter.js"; 2 | 3 | export class StringTable { 4 | strings: string[] = [""]; 5 | 6 | index(str: string): number { 7 | if (!str || str.length === 0) { 8 | return 0; 9 | } 10 | const strings = this.strings; 11 | let i = strings.indexOf(str); 12 | if (i < 0) { 13 | i = strings.length; 14 | strings.push(str); 15 | } 16 | return i; 17 | } 18 | 19 | write(output:BytesWriter) { 20 | // const len = this.strings.length; 21 | // const stringsOffset = output.size + 4 + (len << 2); 22 | // output.writeI32(len); 23 | // for(len) 24 | } 25 | 26 | } -------------------------------------------------------------------------------- /modules/cli/assets/helpers/bmfont.ts: -------------------------------------------------------------------------------- 1 | import {execute} from "../../utils.js"; 2 | import {getOrBuildUtility} from "../../utility/bin.js"; 3 | 4 | export async function bmfont(configPath: string): Promise { 5 | const bin = await getOrBuildUtility("ekc"); 6 | return await execute(bin, ["bmfont-export", configPath]); 7 | } -------------------------------------------------------------------------------- /modules/cli/assets/helpers/msgfmt.ts: -------------------------------------------------------------------------------- 1 | import {mo, po} from "gettext-parser"; 2 | import {readFile, writeFile} from "node:fs/promises"; 3 | 4 | export const msgfmt = async (src: string, dest: string) => { 5 | const pofile = await readFile(src); 6 | const messages = po.parse(pofile); 7 | const buffer = mo.compile(messages); 8 | await writeFile(dest, buffer); 9 | }; -------------------------------------------------------------------------------- /modules/cli/assets/helpers/objExport.ts: -------------------------------------------------------------------------------- 1 | import {execute} from "../../utils.js"; 2 | import {getOrBuildUtility} from "../../utility/bin.js"; 3 | 4 | export async function objExport(input: string, output: string): Promise { 5 | const bin = await getOrBuildUtility("ekc"); 6 | return await execute(bin, ["obj", input, output]); 7 | } -------------------------------------------------------------------------------- /modules/cli/assets/helpers/parse.ts: -------------------------------------------------------------------------------- 1 | export function parseBoolean(v?: string): boolean { 2 | if (v) { 3 | const lc = v.toLowerCase(); 4 | return lc === "true" || lc === "on" || lc === "1"; 5 | } 6 | return false; 7 | } 8 | 9 | export function readFloat(v:string|undefined|null, defaultValue:number):number { 10 | if(v) { 11 | return parseFloat(v); 12 | } 13 | return defaultValue; 14 | } -------------------------------------------------------------------------------- /modules/cli/assets/helpers/spritePacker.ts: -------------------------------------------------------------------------------- 1 | import {execute} from "../../utils.js"; 2 | import {getOrBuildUtility} from "../../utility/bin.js"; 3 | 4 | export async function spritePacker(configPath: string): Promise { 5 | const bin = await getOrBuildUtility("ekc"); 6 | return await execute(bin, ["sprite-packer", configPath]); 7 | } -------------------------------------------------------------------------------- /modules/cli/utility/hash.ts: -------------------------------------------------------------------------------- 1 | // if you modify seed value, you should also modify it in `@ekx/std` package: `ek/hash.h` 2 | const seed = 0x811C9DC5; 3 | 4 | // FNV-1a hash 5 | export function H(str: string): number { 6 | let hash = seed; 7 | // while we use ASCII for identifiers, we are OK. Then it's better to synchronize string encoding between native ad JS env 8 | for (let i = 0; i < str.length; ++i) { 9 | hash ^= str.charCodeAt(i); 10 | hash += (hash << 1) + (hash << 4) + (hash << 7) + (hash << 8) + (hash << 24) 11 | } 12 | return hash; 13 | } 14 | -------------------------------------------------------------------------------- /modules/cli/web/generateIndex.ts: -------------------------------------------------------------------------------- 1 | // TODO: -------------------------------------------------------------------------------- /modules/cmake/init.ts: -------------------------------------------------------------------------------- 1 | import {init} from "./npm.js"; 2 | import {logger} from "../cli/logger.js"; 3 | 4 | try { 5 | init(); 6 | } 7 | catch(e) { 8 | logger.error("Error: ", e); 9 | } -------------------------------------------------------------------------------- /modules/cmake/linux.cmake: -------------------------------------------------------------------------------- 1 | # just hack for IDE 2 | SET(CMAKE_SYSTEM_NAME Linux) 3 | set(CMAKE_SYSTEM_PROCESSOR x86_64) 4 | 5 | SET(CMAKE_C_COMPILER clang) 6 | SET(CMAKE_CXX_COMPILER clang++) 7 | 8 | set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 9 | set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 10 | set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 11 | set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) -------------------------------------------------------------------------------- /modules/repos-management/upgrade.ts: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env -S npx ts-node 2 | 3 | import {spawnSync} from "child_process"; 4 | import {collectPackages, upgradePackages} from "./ws.js"; 5 | import {logger} from "../cli/logger.js"; 6 | 7 | upgradePackages(collectPackages(".")); 8 | 9 | // finally update super space 10 | logger.info("final step install outer super-repo"); 11 | 12 | spawnSync("npm i", { 13 | stdio: 'inherit' 14 | }); -------------------------------------------------------------------------------- /modules/utils/dirs.ts: -------------------------------------------------------------------------------- 1 | import {ensureDirSync, getModuleDir} from "./utils.js"; 2 | import * as path from "path"; 3 | 4 | const __dirname = getModuleDir(import.meta); 5 | 6 | export const resolveEkxPath = (...paths: string[]): string => path.resolve(__dirname, "../..", ...paths); 7 | 8 | export const resolveCachePath = (...paths: string[]): string => resolveEkxPath("cache", ...paths); 9 | 10 | export const ensureCacheDir = (...paths: string[]): string => { 11 | const cacheDir = resolveCachePath(...paths); 12 | ensureDirSync(cacheDir); 13 | return cacheDir; 14 | }; 15 | -------------------------------------------------------------------------------- /packages/app/java/ek/EkPlugin.java: -------------------------------------------------------------------------------- 1 | package ek; 2 | 3 | import android.content.Intent; 4 | 5 | public class EkPlugin implements EkPluginInterface { 6 | 7 | // 8 | public void onStart() { 9 | } 10 | 11 | public void onResume(boolean inFocus) { 12 | } 13 | 14 | public boolean onActivityResult(int requestCode, int resultCode, Intent intent) { 15 | return false; 16 | } 17 | 18 | public void onPause() { 19 | } 20 | 21 | public void onDestroy() { 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /packages/app/java/ek/EkPluginInterface.java: -------------------------------------------------------------------------------- 1 | package ek; 2 | 3 | import android.content.Intent; 4 | 5 | public interface EkPluginInterface { 6 | 7 | void onStart(); 8 | 9 | void onResume(boolean inFocus); 10 | 11 | boolean onActivityResult(int requestCode, int resultCode, Intent intent); 12 | 13 | void onPause(); 14 | 15 | void onDestroy(); 16 | } 17 | -------------------------------------------------------------------------------- /packages/app/src/intern.h: -------------------------------------------------------------------------------- 1 | #ifndef EK_APP_INTERN_H 2 | #define EK_APP_INTERN_H 3 | 4 | #include 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | void ek_app__init(void); 11 | 12 | void ek_app__process_event(ek_app_event event); 13 | 14 | void ek_app__process_frame(void); 15 | 16 | void ek_app__notify_ready(void); 17 | 18 | void ek_app__update_viewport(ek_app_viewport viewport); 19 | 20 | #ifdef __cplusplus 21 | } 22 | #endif 23 | 24 | #endif // EK_APP_INTERN_H 25 | -------------------------------------------------------------------------------- /packages/app/src/null/app-null.c.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int ek_app_open_url(const char* url) { 4 | (void) sizeof(url); 5 | return 1; 6 | } 7 | 8 | int ek_app_font_path(char* dest, uint32_t size, const char* font_name) { 9 | (void) sizeof(dest); 10 | (void) sizeof(size); 11 | (void) sizeof(font_name); 12 | return 1; 13 | } 14 | 15 | int ek_app_share(const char* content) { 16 | (void) sizeof(content); 17 | return 1; 18 | } 19 | 20 | int main(int argc, char* argv[]) { 21 | ek_app__init(); 22 | ek_app.argc = argc; 23 | ek_app.argv = argv; 24 | ek_app_main(); 25 | if (ek_app.state & EK_APP_STATE_EXIT_PENDING) { 26 | return ek_app.exit_code; 27 | } 28 | 29 | int flags = 0; 30 | if (ek_app.config.need_depth) { 31 | flags |= 1; 32 | } 33 | ek_app__notify_ready(); 34 | while((ek_app.state & EK_APP_STATE_EXIT_PENDING) == 0) { 35 | 36 | } 37 | return ek_app.exit_code; 38 | } 39 | -------------------------------------------------------------------------------- /packages/appbox/ek.ts: -------------------------------------------------------------------------------- 1 | import {Project} from "../../modules/cli/project.js"; 2 | 3 | export async function setup(project: Project) { 4 | project.addModule({ 5 | name: "appbox", 6 | cpp: "src" 7 | }); 8 | 9 | await project.importModule("../scenex/ek.ts"); 10 | await project.importModule("../../plugins/firebase/ek.ts"); 11 | await project.importModule("../../plugins/admob/ek.ts"); 12 | await project.importModule("../../plugins/billing/ek.ts"); 13 | await project.importModule("../../plugins/game-services/ek.ts"); 14 | } 15 | -------------------------------------------------------------------------------- /packages/appbox/src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | target_sources(${PROJECT_NAME} PUBLIC 2 | appbox/Ads.hpp 3 | appbox/Ads.cpp 4 | appbox/AppBox.cpp 5 | appbox/AppBox.hpp 6 | ) 7 | 8 | target_include_directories(${PROJECT_NAME} PUBLIC .) -------------------------------------------------------------------------------- /packages/audio/README.md: -------------------------------------------------------------------------------- 1 | # audio impl -------------------------------------------------------------------------------- /packages/audio/ek.ts: -------------------------------------------------------------------------------- 1 | import {Project} from "../../modules/cli/project.js"; 2 | 3 | export async function setup(project: Project) { 4 | project.addModule({ 5 | name: "audio", 6 | cpp: "src", 7 | apple: { 8 | cpp_flags: { 9 | files: [ 10 | "src/ek_audio_auph.c" 11 | ], 12 | flags: "-x objective-c" 13 | }, 14 | }, 15 | android: { 16 | cpp_flags: { 17 | files: [ 18 | "src/ek_audio_auph.c" 19 | ], 20 | flags: "-xc++ -std=c++17" 21 | }, 22 | } 23 | }); 24 | await project.importModule("../auph/ek.ts"); 25 | await project.importModule("../core/ek.ts"); 26 | await project.importModule("../app/ek.ts"); 27 | } 28 | -------------------------------------------------------------------------------- /packages/audio/src/ek/audio.h: -------------------------------------------------------------------------------- 1 | #ifndef EK_AUDIO_H 2 | #define EK_AUDIO_H 3 | 4 | #include 5 | #include 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | void audio_setup(void); 12 | 13 | struct res_audio { 14 | string_hash_t names[64]; 15 | auph_buffer data[64]; 16 | rr_man_t rr; 17 | }; 18 | 19 | extern struct res_audio res_audio; 20 | 21 | #define R_AUDIO(name) REF_NAME(res_audio, name) 22 | 23 | #ifdef __cplusplus 24 | } 25 | #endif 26 | 27 | #endif // EK_AUDIO_H 28 | -------------------------------------------------------------------------------- /packages/audio/src/ek_audio.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | struct res_audio res_audio; 8 | 9 | void audio_setup(void) { 10 | auph_setup(); 11 | 12 | struct res_audio* R = &res_audio; 13 | rr_man_t* rr = &R->rr; 14 | 15 | rr->names = R->names; 16 | rr->data = R->data; 17 | rr->max = sizeof(R->data) / sizeof(R->data[0]); 18 | rr->num = 1; 19 | rr->data_size = sizeof(R->data[0]); 20 | } 21 | 22 | #ifdef __cplusplus 23 | } 24 | #endif 25 | -------------------------------------------------------------------------------- /packages/audio/src/ek_audio_auph.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | 6 | #if 0 7 | // for refactoring enable other formats 8 | #define AUPH_WAV 9 | #define AUPH_OGG 10 | #define AUPH_FORCE_NATIVE_NULL_DEVICE 11 | #endif 12 | 13 | #define AUPH_MP3 14 | #define AUPH_ASSERT(x) EK_ASSERT(x) 15 | #define AUPH_LOG(x) log_debug(x) 16 | #define AUPH_SETUP_EK_APP 17 | 18 | #include 19 | -------------------------------------------------------------------------------- /packages/auph/build.ts: -------------------------------------------------------------------------------- 1 | import {getModuleDir} from "../../modules/utils/utils.js"; 2 | import * as path from "path"; 3 | import * as esbuild from "esbuild"; 4 | import {logger} from "../../modules/cli/logger.js"; 5 | 6 | const __dirname = getModuleDir(import.meta); 7 | 8 | await esbuild.build({ 9 | entryPoints: [path.resolve(__dirname, "web/src/webaudio/index.ts")], 10 | globalName: "auph", 11 | target: ["chrome58", "firefox57", "safari11", "edge16"], 12 | bundle: true, 13 | sourcemap: true, 14 | outfile: path.join(__dirname, "web/dist/emscripten/auph.js"), 15 | define: { 16 | "process.env.NODE_ENV":'"production"' 17 | } 18 | }).catch(err => logger.error(err)); 19 | 20 | logger.info("auph build completed"); 21 | -------------------------------------------------------------------------------- /packages/auph/include/auph/auph.c: -------------------------------------------------------------------------------- 1 | #ifndef AUPH_IMPL 2 | #define AUPH_IMPL 3 | #else 4 | #error You should implement auph once 5 | #endif 6 | 7 | #include "auph_addon.c" 8 | 9 | #if defined(__EMSCRIPTEN__) 10 | 11 | #include "auph_web.c" 12 | 13 | #else 14 | 15 | #include "auph_native.c" 16 | #include "native/buffer.c" 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /packages/auph/include/auph/native/device.c: -------------------------------------------------------------------------------- 1 | #ifndef AUPH_NATIVE_DEVICE_IMPL 2 | #define AUPH_NATIVE_DEVICE_IMPL 3 | #else 4 | #error You should implement auph once 5 | #endif 6 | 7 | #if defined(__APPLE__) && !defined(AUPH_FORCE_NATIVE_NULL_DEVICE) 8 | 9 | #include "device_core_audio.m" 10 | 11 | #elif defined(__ANDROID__) 12 | 13 | #if defined(AUPH_FORCE_NATIVE_NULL_DEVICE) 14 | 15 | #include "device_null.c" 16 | 17 | #define OBOE_NULL 18 | 19 | #endif 20 | 21 | #include "device_oboe.cpp" 22 | 23 | #else 24 | 25 | #include "device_null.c" 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /packages/auph/include/auph/native/device_null.c: -------------------------------------------------------------------------------- 1 | #ifndef AUPH_NATIVE_DEVICE_NULL_IMPL 2 | #define AUPH_NATIVE_DEVICE_NULL_IMPL 3 | #else 4 | #error You should implement auph once 5 | #endif 6 | 7 | #include "native.h" 8 | 9 | struct auph_audio_device { 10 | auph_audio_stream_info playbackStreamInfo; 11 | auph_audio_device_callback onPlayback; 12 | void* userData; 13 | }; 14 | 15 | int auph_vibrate(int millis) { 16 | (void) millis; 17 | return 1; 18 | } 19 | 20 | void auph_audio_device_init(auph_audio_device* device) { 21 | (void) device; 22 | } 23 | 24 | bool auph_audio_device_start(auph_audio_device* device) { 25 | (void) device; 26 | return true; 27 | } 28 | 29 | bool auph_audio_device_stop(auph_audio_device* device) { 30 | (void) device; 31 | return true; 32 | } 33 | 34 | // optional stop & destroy 35 | void auph_audio_device_term(auph_audio_device* device) { 36 | (void) device; 37 | } 38 | 39 | -------------------------------------------------------------------------------- /packages/auph/web/README.md: -------------------------------------------------------------------------------- 1 | # Auph - WebAudio 2 | 3 | Auph is simple audio library for games. This package contains draft implementation for WebAudio. 4 | 5 | ## esbuild 6 | 7 | - build emscripten lib javascript file in esm format, node target 8 | - build preamble lib in iife format, right now keep es6 target (es2015) -------------------------------------------------------------------------------- /packages/auph/web/src/protocol/static.ts: -------------------------------------------------------------------------------- 1 | import {Flag, Mixer, Param, Type} from "./interface"; 2 | 3 | /** Export Constants only for pre-bundled usage **/ 4 | 5 | export const SAMPLE_RATE = Param.SampleRate; 6 | export const STATE = Param.State; 7 | export const COUNT = Param.Count; 8 | 9 | export const ACTIVE = Flag.Active; 10 | export const RUNNING = Flag.Running; 11 | export const STREAM = Flag.Stream; 12 | export const LOOP = Flag.Loop; 13 | 14 | export const MIXER = Mixer; 15 | 16 | export const BUS = Type.Bus; 17 | export const VOICE = Type.Voice; 18 | export const BUFFER = Type.Buffer; 19 | 20 | export const BUS_MASTER = Type.Bus | 0; 21 | export const BUS_SFX = Type.Bus | 1; 22 | export const BUS_MUSIC = Type.Bus | 2; 23 | export const BUS_SPEECH = Type.Bus | 3; -------------------------------------------------------------------------------- /packages/auph/web/src/webaudio/Unlock.ts: -------------------------------------------------------------------------------- 1 | import {len} from "./common"; 2 | 3 | export function unlock(unlocked: () => boolean) { 4 | // "touchstart", "touchend", "mousedown", "pointerdown" 5 | const events = ["touchstart", "touchend", "mousedown", "click", "keydown"]; 6 | const num = len(events); 7 | const doc = document; 8 | const handle = () => { 9 | if(unlocked()) { 10 | for (let i = 0; i < num; ++i) { 11 | doc.removeEventListener(events[i], handle, true); 12 | } 13 | } 14 | }; 15 | for (let i = 0; i < num; ++i) { 16 | doc.addEventListener(events[i], handle, true); 17 | } 18 | } -------------------------------------------------------------------------------- /packages/auph/web/src/webaudio/common.ts: -------------------------------------------------------------------------------- 1 | import {iMask, tMask, u31, vIncr, vMask} from "../protocol/interface"; 2 | 3 | export interface Obj { 4 | h: u31; 5 | s: u31; 6 | } 7 | 8 | export function nextHandle(h: u31) { 9 | return ((h + vIncr) & vMask) | (h & (tMask | iMask)); 10 | } 11 | 12 | export function connectAudioNode(node: AudioNode, dest: AudioNode) { 13 | node.connect(dest); 14 | } 15 | 16 | export function disconnectAudioNode(node: AudioNode, dest?: AudioNode) { 17 | node.disconnect(dest!); 18 | } 19 | 20 | export function setAudioParamValue(param: AudioParam, value: number) { 21 | param.value = value; 22 | } 23 | 24 | export function len(a: T[]): u31 { 25 | return a.length; 26 | } 27 | 28 | export function resize(a: T[], length: u31) { 29 | a.length = length; 30 | } 31 | 32 | export function add(a: T[], e: T) { 33 | a.push(e); 34 | } 35 | -------------------------------------------------------------------------------- /packages/auph/web/src/webaudio/debug.ts: -------------------------------------------------------------------------------- 1 | import {Message} from "../protocol/interface"; 2 | 3 | let lastStatus = 0; 4 | 5 | export function log(message: string | Message) { 6 | if (process.env.NODE_ENV !== "production") { 7 | console.log("auph", message); 8 | } 9 | } 10 | 11 | export function warn(message: string | Message) { 12 | if (process.env.NODE_ENV !== "production") { 13 | console.warn("auph", message); 14 | } 15 | } 16 | 17 | export function error(message: string | Message, reason?: any) { 18 | if (process.env.NODE_ENV !== "production") { 19 | console.error("auph", message, reason); 20 | } 21 | } 22 | 23 | export function setError(status: Message, context?: any) { 24 | if (process.env.NODE_ENV !== "production") { 25 | error(status, context); 26 | } 27 | lastStatus = status; 28 | } -------------------------------------------------------------------------------- /packages/auph/web/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "ESNext", 4 | "target": "ESNext", 5 | "moduleResolution": "Node", 6 | "sourceMap": true, 7 | "strict": true, 8 | "outDir": "./dist/module", 9 | "declarationDir": "./dist/types", 10 | "declaration": true, 11 | "noEmitOnError": true, 12 | "allowSyntheticDefaultImports": true, 13 | "esModuleInterop": true, 14 | "downlevelIteration": true, 15 | "skipLibCheck": true, 16 | "lib": [ 17 | "DOM", 18 | "ESNext" 19 | ] 20 | }, 21 | "include": [ 22 | "./src/**/*.ts" 23 | ] 24 | } -------------------------------------------------------------------------------- /packages/core/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19) 2 | add_subdirectory(src) 3 | 4 | if (EKX_BUILD_TESTS) 5 | add_subdirectory(test) 6 | endif () -------------------------------------------------------------------------------- /packages/core/ek.ts: -------------------------------------------------------------------------------- 1 | import {Project} from "../../modules/cli/project.js"; 2 | 3 | export async function setup(project:Project) { 4 | project.addModule({ 5 | name: "core", 6 | cpp: "src", 7 | cpp_include: "include" 8 | }); 9 | await project.importModule("../std/ek.ts"); 10 | } 11 | -------------------------------------------------------------------------------- /packages/core/src/ek/core_dbg.h: -------------------------------------------------------------------------------- 1 | #ifndef EK_CORE_DBG_H 2 | #define EK_CORE_DBG_H 3 | 4 | #include "ek/log.h" 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | enum { 11 | EK_CORE_DBG_ARRAY = 0, 12 | EK_CORE_DBG_POD_ARRAY, 13 | EK_CORE_DBG_SIGNAL, 14 | EK_CORE_DBG_HASH, 15 | EK_CORE_DBG_STRING, 16 | 17 | EK_CORE_DBG_INTERACTIVE, 18 | EK_CORE_DBG_VD, 19 | 20 | EK_CORE_DBG_MAX_COUNT, 21 | }; 22 | 23 | extern int _core_dbg_stats[EK_CORE_DBG_MAX_COUNT]; 24 | 25 | #ifndef NDEBUG 26 | void ek_core_dbg_inc(int m); 27 | 28 | void ek_core_dbg_dec(int m); 29 | 30 | int ek_core_dbg_get(int m); 31 | 32 | #else 33 | #define ek_core_dbg_inc(x) ((void)(x)) 34 | #define ek_core_dbg_dec(x) ((void)(x)) 35 | #define ek_core_dbg_get(x) (0) 36 | #endif 37 | 38 | #ifdef __cplusplus 39 | } 40 | #endif 41 | 42 | #endif // EK_CORE_DBG_H 43 | -------------------------------------------------------------------------------- /packages/core/src/ek/serialize/math.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "core.hpp" 4 | #include 5 | 6 | namespace ek { 7 | 8 | #define DEF_POD(T) template<> struct declared_as_pod_type : public std::true_type {} 9 | 10 | DEF_POD(rect_t); 11 | DEF_POD(i16rect_t); 12 | DEF_POD(irect_t); 13 | DEF_POD(aabb2_t); 14 | DEF_POD(aabb3_t); 15 | DEF_POD(ivec2_t); 16 | DEF_POD(ivec3_t); 17 | DEF_POD(ivec4_t); 18 | DEF_POD(vec2_t); 19 | DEF_POD(vec3_t); 20 | DEF_POD(vec4_t); 21 | DEF_POD(quat_t); 22 | DEF_POD(mat2_t); 23 | DEF_POD(mat3x2_t); 24 | DEF_POD(mat3_t); 25 | DEF_POD(mat4_t); 26 | DEF_POD(color_t); 27 | DEF_POD(color2_t); 28 | DEF_POD(color2f_t); 29 | 30 | #undef DEF_POD 31 | 32 | } 33 | -------------------------------------------------------------------------------- /packages/core/src/ek/serialize/serialize.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "core.hpp" 4 | #include "streams.hpp" 5 | #include "types.hpp" 6 | #include "math.hpp" 7 | 8 | namespace ek { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /packages/core/src/ek/serialize/stl/Array.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../core.hpp" 4 | 5 | #include 6 | 7 | namespace ek { 8 | 9 | template 10 | inline void serialize(IO& io, std::array& value) { 11 | if constexpr(is_pod_type()) { 12 | io.span(value.data(), Size * sizeof(T)); 13 | } else { 14 | for (T& el : value) { 15 | io(el); 16 | } 17 | } 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /packages/core/src/ek/serialize/stl/Map.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../core.hpp" 4 | 5 | #include 6 | 7 | namespace ek { 8 | 9 | template 10 | inline void serialize(IO& io, std::map& value) { 11 | uint32_t size; 12 | 13 | if constexpr (is_readable_stream()) { 14 | io.value(size); 15 | value.reserve(size); 16 | for (size_t i = 0; i < size; ++i) { 17 | K k; V v; 18 | io(k, v); 19 | value[k] = v; 20 | } 21 | } else { 22 | size = static_cast(value.size()); 23 | io.value(size); 24 | for (auto& pair : value) { 25 | io(const_cast(pair.first), pair.second); 26 | } 27 | } 28 | } 29 | 30 | } -------------------------------------------------------------------------------- /packages/core/src/ek/serialize/stl/Optional.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../core.hpp" 4 | 5 | #include 6 | 7 | namespace ek { 8 | 9 | template 10 | inline void serialize(IO& io, std::optional& value) { 11 | uint8_t has; 12 | 13 | if constexpr (is_readable_stream()) { 14 | io.value(has); 15 | if (has != 0) { 16 | value.emplace(); 17 | } 18 | } else { 19 | has = value.has_value() ? 1u : 0u; 20 | io.value(has); 21 | } 22 | 23 | if (has != 0) { 24 | io(*value); 25 | } 26 | } 27 | 28 | } -------------------------------------------------------------------------------- /packages/core/src/ek/serialize/stl/String.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../core.hpp" 4 | #include 5 | 6 | namespace ek { 7 | 8 | template 9 | inline void serialize(IO& io, std::string& value) { 10 | if constexpr (is_readable_stream()) { 11 | int32_t size; 12 | io.value(size); 13 | value.resize(size); 14 | io.span(value.data(), size); 15 | 16 | // null-terminator 17 | uint8_t term; 18 | io.value(term); 19 | EK_ASSERT(term == 0); 20 | } else { 21 | auto size = static_cast(value.size()); 22 | io.value(size); 23 | io.span(value.data(), size); 24 | 25 | // null-terminator 26 | const uint8_t term = 0; 27 | io.value(term); 28 | } 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /packages/core/src/ek/serialize/stl/UnorderedMap.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../core.hpp" 4 | 5 | #include 6 | 7 | namespace ek { 8 | 9 | template 10 | inline void serialize(IO& io, std::unordered_map& value) { 11 | uint32_t size; 12 | 13 | if constexpr (is_readable_stream()) { 14 | io.value(size); 15 | value.reserve(size); 16 | for (size_t i = 0; i < size; ++i) { 17 | K k; V v; 18 | io(k, v); 19 | value[k] = v; 20 | } 21 | } else { 22 | size = static_cast(value.size()); 23 | io.value(size); 24 | for (auto& pair : value) { 25 | io(const_cast(pair.first), pair.second); 26 | } 27 | } 28 | } 29 | 30 | } -------------------------------------------------------------------------------- /packages/core/src/ek/serialize/stl/Vector.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../core.hpp" 4 | 5 | #include 6 | 7 | namespace ek { 8 | 9 | template 10 | inline void serialize(IO& io, std::vector& value) { 11 | uint32_t size; 12 | 13 | if constexpr (is_readable_stream()) { 14 | io.value(size); 15 | value.resize(size); 16 | } else { 17 | size = static_cast(value.size()); 18 | io.value(size); 19 | } 20 | 21 | if constexpr(is_pod_type()) { 22 | io.span(value.data(), size * sizeof(T)); 23 | } else { 24 | for (T& el : value) { 25 | io(el); 26 | } 27 | } 28 | } 29 | 30 | } -------------------------------------------------------------------------------- /packages/core/src/ek/util/StaticStorage.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace ek { 6 | 7 | template 8 | class alignas(alignof(T)) StaticStorage { 9 | char buffer[sizeof(T)]; 10 | 11 | union Converter { 12 | const void* data; 13 | T* ptr; 14 | }; 15 | 16 | public: 17 | 18 | template 19 | void initialize(Args&& ...args) { 20 | new(buffer) T(args...); 21 | } 22 | 23 | constexpr T& get() const { 24 | Converter u{buffer}; 25 | return *u.ptr; 26 | } 27 | 28 | constexpr T* ptr() const { 29 | Converter u{buffer}; 30 | return u.ptr; 31 | } 32 | 33 | constexpr T& ref() const { 34 | Converter u{buffer}; 35 | return *u.ptr; 36 | } 37 | 38 | void shutdown() { 39 | Converter{buffer}.ptr->~T(); 40 | } 41 | }; 42 | 43 | } 44 | -------------------------------------------------------------------------------- /packages/core/src/ek/util/StringUtil.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace ek { 6 | 7 | // Game utilities 8 | inline String format_time_mm_ss(int seconds, uint32_t flags = 0) { 9 | char buf[32]; 10 | ek_cstr_format_timer(buf, 32, seconds * 1000, (int) flags); 11 | return {buf}; 12 | } 13 | 14 | inline String format_time_mm_ss(float seconds, uint32_t flags = 0) { 15 | char buf[32]; 16 | ek_cstr_format_timer(buf, 32, (int) (seconds * 1000), (int) flags); 17 | return {buf}; 18 | } 19 | 20 | } -------------------------------------------------------------------------------- /packages/core/src/ek/util/Type.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace ek { 4 | 5 | template 6 | struct TypeName { 7 | constexpr static const char* value{""}; 8 | }; 9 | 10 | #define EK_DECLARE_TYPE(Tp) template<> struct TypeName{constexpr static const char* value = #Tp;} 11 | 12 | template 13 | struct Counter { 14 | inline static int value = 0; 15 | }; 16 | 17 | template 18 | struct TypeIndex { 19 | inline const static int value = Counter::value++; 20 | }; 21 | 22 | } 23 | 24 | -------------------------------------------------------------------------------- /packages/core/test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19) 2 | project(ek-core-tests) 3 | add_executable(${PROJECT_NAME} 4 | tests.cpp 5 | ) 6 | add_test(NAME ${PROJECT_NAME} COMMAND ${PROJECT_NAME}) 7 | test_code_coverage(${PROJECT_NAME}) 8 | 9 | set_target_properties(${PROJECT_NAME} PROPERTIES 10 | CXX_STANDARD 17 11 | CXX_STANDARD_REQUIRED YES 12 | CXX_EXTENSIONS NO 13 | C_STANDARD 11 14 | ) 15 | 16 | target_compile_definitions(${PROJECT_NAME} PUBLIC UNIT_TESTING) 17 | target_compile_options(${PROJECT_NAME} PRIVATE 18 | -fno-exceptions 19 | -fno-rtti 20 | -fno-strict-aliasing 21 | -Wstrict-aliasing=2 22 | ) 23 | 24 | target_link_libraries(${PROJECT_NAME} 25 | PUBLIC ekx::core 26 | PUBLIC ekx::unit 27 | ) -------------------------------------------------------------------------------- /packages/core/test/StringUtil.test.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | SUITE(cxx_string) { 5 | IT("format_mm_ss") { 6 | using ek::format_time_mm_ss; 7 | REQUIRE_EQ(format_time_mm_ss(60).c_str(), "01:00"); 8 | REQUIRE_EQ(format_time_mm_ss(60.05f, TIME_FORMAT_KEEP_HOURS).c_str(), "00:01:01"); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /packages/core/test/tests.cpp: -------------------------------------------------------------------------------- 1 | #define UNIT_MAIN 2 | #include 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include "StringUtil.test.hpp" 9 | 10 | -------------------------------------------------------------------------------- /packages/dev-tools/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19) 2 | project(dev-tools) 3 | add_subdirectory(src) 4 | 5 | add_library(ekx::${PROJECT_NAME} ALIAS ${PROJECT_NAME}) 6 | 7 | ## THAT's how you enable dev-tools in your project 8 | if (EKX_BUILD_DEV_TOOLS) 9 | add_compile_definitions(EK_DEV_TOOLS) 10 | target_link_libraries(scenex 11 | PUBLIC ${PROJECT_NAME} 12 | ) 13 | endif () -------------------------------------------------------------------------------- /packages/dev-tools/README.md: -------------------------------------------------------------------------------- 1 | # In-game Dev Tools 2 | 3 | - Hierarchy to navigate scene entities tree 4 | - Inspector to inspect and edit components data 5 | - Console for logs and commands 6 | - Scene window for gizmos, picking, navigation and to transform nodes 7 | - Game window for preview 8 | - Debug inspectors: Stats, Memory, Resources 9 | 10 | -------------------------------------------------------------------------------- /packages/dev-tools/src/ek/editor/gui/GameWindow.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "EditorWindow.hpp" 4 | 5 | namespace ek { 6 | 7 | class GameWindow : public EditorWindow { 8 | public: 9 | 10 | bool paused = false; 11 | float timeScale = 1.0f; 12 | bool profiler = false; 13 | 14 | GameWindow() { 15 | name = "GameWindow"; 16 | title = ICON_FA_GAMEPAD " Game###GameWindow"; 17 | fullFrame = true; 18 | } 19 | 20 | ~GameWindow() override = default; 21 | 22 | void onDraw() override; 23 | void onLoad(const pugi::xml_node& xml) override; 24 | void onSave(pugi::xml_node& xml) override; 25 | }; 26 | 27 | } -------------------------------------------------------------------------------- /packages/dev-tools/src/ek/editor/gui/InspectorWindow.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "EditorWindow.hpp" 4 | 5 | namespace ek { 6 | 7 | class InspectorWindow : public EditorWindow { 8 | public: 9 | PodArray list{}; 10 | 11 | InspectorWindow() { 12 | name = "InspectorWindow"; 13 | title = ICON_FA_PUZZLE_PIECE " Inspector###InspectorWindow"; 14 | } 15 | 16 | ~InspectorWindow() override = default; 17 | 18 | void gui_inspector(ecs::Entity entity); 19 | 20 | void onDraw() override; 21 | }; 22 | 23 | } -------------------------------------------------------------------------------- /packages/dev-tools/src/ek/editor/gui/MemoryProfiler.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "EditorWindow.hpp" 4 | 5 | namespace ek { 6 | 7 | class MemoryProfiler : public EditorWindow { 8 | public: 9 | MemoryProfiler() { 10 | name = "MemoryProfiler"; 11 | title = ICON_FA_MEMORY " Memory###MemoryProfiler"; 12 | } 13 | 14 | ~MemoryProfiler() override = default; 15 | 16 | void onDraw() override; 17 | }; 18 | 19 | } -------------------------------------------------------------------------------- /packages/dev-tools/src/ek/editor/gui/ResourcesWindow.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "EditorWindow.hpp" 4 | 5 | namespace ek { 6 | 7 | class ResourcesWindow : public EditorWindow { 8 | public: 9 | 10 | ResourcesWindow() { 11 | name = "ResourcesWindow"; 12 | title = ICON_FA_HDD " Resources###ResourcesWindow"; 13 | } 14 | 15 | ~ResourcesWindow() override = default; 16 | 17 | void onDraw() override; 18 | }; 19 | 20 | } -------------------------------------------------------------------------------- /packages/dev-tools/src/ek/editor/gui/StatsWindow.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "EditorWindow.hpp" 4 | 5 | namespace ek { 6 | 7 | class StatsWindow : public EditorWindow { 8 | public: 9 | 10 | StatsWindow() { 11 | name = "StatsWindow"; 12 | title = ICON_FA_TACHOMETER_ALT " Stats###StatsWindow"; 13 | } 14 | 15 | ~StatsWindow() override = default; 16 | 17 | void onDraw() override; 18 | }; 19 | 20 | } -------------------------------------------------------------------------------- /packages/dev-tools/src/ek/editor/imgui/ImGuiIntegration.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | #include 9 | 10 | struct ImDrawData; 11 | 12 | namespace ek { 13 | 14 | class ImGuiIntegration final { 15 | public: 16 | ImGuiIntegration(); 17 | 18 | ~ImGuiIntegration(); 19 | 20 | void on_event(const ek_app_event& event); 21 | 22 | void on_frame_completed(); 23 | 24 | void begin_frame(float dt); 25 | 26 | void end_frame(); 27 | 28 | sg_imgui_t sokol_gfx_gui_state{}; 29 | 30 | private: 31 | 32 | void setup(); 33 | 34 | void init_font_image(); 35 | 36 | private: 37 | String clipboard_text_{}; 38 | sg_image font_image; 39 | float dpiScale = 2.0f; 40 | }; 41 | 42 | } 43 | 44 | -------------------------------------------------------------------------------- /packages/dev-tools/src/ek/editor/imgui/imgui.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | //#include 4 | //#define IM_ASSERT_USER_ERROR(_EXP,_MSG) log_warn(_MSG) 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | static inline ImVec2 operator-(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x - rhs.x, lhs.y - rhs.y); } 12 | 13 | namespace ImGui { 14 | 15 | } -------------------------------------------------------------------------------- /packages/ecs/ek.ts: -------------------------------------------------------------------------------- 1 | import {Project} from "../../modules/cli/project.js"; 2 | 3 | export async function setup(project: Project) { 4 | project.addModule({ 5 | name: "ecs", 6 | cpp: "src" 7 | }); 8 | await project.importModule("../core/ek.ts"); 9 | } 10 | -------------------------------------------------------------------------------- /packages/ecs/test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19) 2 | project(ecs-tests) 3 | 4 | add_executable(${PROJECT_NAME} 5 | tests.cpp 6 | ecxx/common/identity_generator_test_1.cpp 7 | ecxx/common/identity_generator_test_2.cpp 8 | ) 9 | 10 | add_test(NAME ${PROJECT_NAME} COMMAND ${PROJECT_NAME}) 11 | test_code_coverage(${PROJECT_NAME}) 12 | 13 | set_target_properties(${PROJECT_NAME} PROPERTIES 14 | CXX_STANDARD 17 15 | C_STANDARD 11 16 | ) 17 | 18 | target_compile_definitions(${PROJECT_NAME} PUBLIC UNIT_TESTING) 19 | target_compile_options(${PROJECT_NAME} PRIVATE 20 | -fno-exceptions 21 | -fno-rtti 22 | -fno-strict-aliasing 23 | -Wstrict-aliasing=2 24 | ) 25 | 26 | target_link_libraries(${PROJECT_NAME} 27 | PUBLIC ekx::ecs 28 | PUBLIC ekx::unit 29 | ) -------------------------------------------------------------------------------- /packages/ecs/test/ecxx/common/components.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | struct motion_t { 4 | float vx = 0.0f; 5 | float vy = 0.0f; 6 | }; 7 | 8 | struct position_t { 9 | float x = 0.0f; 10 | float y = 0.0f; 11 | }; 12 | 13 | struct value_t { 14 | int value = 0; 15 | }; 16 | 17 | struct empty_comp_t { 18 | }; 19 | 20 | struct not_used_comp_t { 21 | }; 22 | -------------------------------------------------------------------------------- /packages/ecs/test/ecxx/common/identity_generator_shared.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | struct ComponentA { 4 | }; 5 | 6 | struct ComponentB { 7 | }; 8 | 9 | struct ComponentC { 10 | }; 11 | 12 | static unsigned idComponentA; 13 | static unsigned idComponentB; 14 | static unsigned idComponentC; 15 | inline static bool idsGenerated = false; 16 | -------------------------------------------------------------------------------- /packages/ecs/test/tests.cpp: -------------------------------------------------------------------------------- 1 | #define UNIT_IMPL 2 | #include 3 | 4 | #include "ecxx/World.test.hpp" -------------------------------------------------------------------------------- /packages/graphics/README.md: -------------------------------------------------------------------------------- 1 | # ek 2 | 3 | --> [wiki](https://gitlab.com/eliasku/ek/wikis/home) <-- -------------------------------------------------------------------------------- /packages/graphics/build.ts: -------------------------------------------------------------------------------- 1 | import {getModuleDir} from "../../modules/utils/utils.js"; 2 | import {shdc} from "../../modules/sokol-shdc.js"; 3 | import {logger} from "../../modules/cli/logger.js"; 4 | 5 | await shdc({ 6 | input: "src/ek/canvas.glsl", 7 | output: "src/ek/canvas_shader.h", 8 | cwd: getModuleDir(import.meta) 9 | }); 10 | 11 | logger.info("graphics build completed"); -------------------------------------------------------------------------------- /packages/graphics/ek.ts: -------------------------------------------------------------------------------- 1 | import {Project} from "../../modules/cli/project.js"; 2 | 3 | export async function setup(project: Project) { 4 | project.addModule({ 5 | name: "graphics", 6 | cpp: "src", 7 | apple: { 8 | cpp_flags: { 9 | files: [ 10 | "src/ek/ek_gfx.c" 11 | ], 12 | flags: "-x objective-c" 13 | }, 14 | } 15 | }); 16 | await project.importModule("../core/ek.ts"); 17 | await project.importModule("../app/ek.ts"); 18 | await project.importModule("../../external/sokol/ek.ts"); 19 | } 20 | -------------------------------------------------------------------------------- /packages/local-storage/ek.ts: -------------------------------------------------------------------------------- 1 | import {Project} from "../../modules/cli/project.js"; 2 | 3 | export async function setup(project: Project) { 4 | project.addModule({ 5 | name: "local-storage", 6 | cpp: "src", 7 | cpp_include: "include", 8 | android: { 9 | android_java: "java" 10 | }, 11 | web: { 12 | js: "src" 13 | } 14 | }); 15 | // for base app platform 16 | await project.importModule("../app/ek.ts"); 17 | // for base64 and others 18 | await project.importModule("../std/ek.ts"); 19 | } 20 | -------------------------------------------------------------------------------- /packages/local-storage/include/ek/local_storage.h: -------------------------------------------------------------------------------- 1 | #ifndef EK_LOCAL_STORAGE_H 2 | #define EK_LOCAL_STORAGE_H 3 | 4 | #include 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | void ek_ls_set_i(const char* key, int value); 11 | 12 | int ek_ls_get_i(const char* key, int de_fault); 13 | 14 | void ek_ls_set_s(const char* key, const char* str); 15 | 16 | int ek_ls_get_s(const char* key, char* buffer, uint32_t buffer_size); 17 | 18 | void ek_ls_set_data(const char* key, const void* data, uint32_t size); 19 | 20 | int ek_ls_get_data(const char* key, void* buffer, uint32_t buffer_size); 21 | 22 | void ek_ls_set64(const char* key, int64_t value); 23 | 24 | bool ek_ls_get64(const char* key, int64_t* value); 25 | 26 | #ifdef __cplusplus 27 | } 28 | #endif 29 | 30 | #endif // EK_LOCAL_STORAGE_H 31 | -------------------------------------------------------------------------------- /packages/local-storage/src/local_storage_null.c.h: -------------------------------------------------------------------------------- 1 | #define C_STRING_NOT_NULL_OR_EMPTY(x) ((x) != 0 && *(x) != 0) 2 | #define ASSERT_KEY_IS_VALID(x) EKAPP_ASSERT(C_STRING_NOT_NULL_OR_EMPTY(x)) 3 | 4 | void ek_ls_set_i(const char* key, int value) { 5 | (void)value; 6 | ASSERT_KEY_IS_VALID(key); 7 | } 8 | 9 | int ek_ls_get_i(const char* key, int de_fault) { 10 | ASSERT_KEY_IS_VALID(key); 11 | return de_fault; 12 | } 13 | 14 | void ek_ls_set_s(const char* key, const char* str) { 15 | (void)str; 16 | ASSERT_KEY_IS_VALID(key); 17 | } 18 | 19 | int ek_ls_get_s(const char* key, char* buffer, uint32_t buffer_size) { 20 | ASSERT_KEY_IS_VALID(key); 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /packages/physics-arcade/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19) 2 | project(physics-arcade) 3 | 4 | add_subdirectory(src) 5 | 6 | target_link_libraries(${PROJECT_NAME} ekx::ecs) 7 | 8 | set_target_properties(${PROJECT_NAME} PROPERTIES 9 | C_STANDARD 11 10 | CXX_STANDARD 17 11 | CXX_STANDARD_REQUIRED YES 12 | CXX_EXTENSIONS NO) 13 | -------------------------------------------------------------------------------- /packages/physics-arcade/ek.ts: -------------------------------------------------------------------------------- 1 | import {Project} from "../../modules/cli/project.js"; 2 | 3 | export async function setup(project: Project) { 4 | project.addModule({ 5 | name: "physics-arcade", 6 | cpp: "src" 7 | }); 8 | await project.importModule("../ecs/ek.ts"); 9 | } 10 | -------------------------------------------------------------------------------- /packages/physics-arcade/src/ArcadePhysicsModule.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "QuadTree.hpp" 3 | #include "RegularGrid.hpp" 4 | -------------------------------------------------------------------------------- /packages/physics-arcade/src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(${PROJECT_NAME} STATIC 2 | ArcadePhysicsModule.cpp 3 | QuadTree.hpp 4 | RegularGrid.hpp) 5 | 6 | add_library(ekx::${PROJECT_NAME} ALIAS ${PROJECT_NAME}) 7 | 8 | target_include_directories(${PROJECT_NAME} PUBLIC .) -------------------------------------------------------------------------------- /packages/res/README.md: -------------------------------------------------------------------------------- 1 | # Local Resources 2 | 3 | `@ekx/res`: Access to local application resources 4 | -------------------------------------------------------------------------------- /packages/res/ek.ts: -------------------------------------------------------------------------------- 1 | import {Project} from "../../modules/cli/project.js"; 2 | 3 | export async function setup(project: Project) { 4 | project.addModule({ 5 | name: "@ekx/res", 6 | cpp: "src", 7 | cpp_include: "include", 8 | web: { 9 | js: "src" 10 | } 11 | }); 12 | await project.importModule("../app/ek.ts"); 13 | } 14 | -------------------------------------------------------------------------------- /packages/res/src/local_res.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | bool ek_local_res_success(const ek_local_res* lr) { 4 | return lr && lr->status == 0; 5 | } 6 | 7 | void ek_local_res_close(ek_local_res* lr) { 8 | if (lr && lr->closeFunc) { 9 | lr->closeFunc(lr); 10 | } 11 | } 12 | 13 | #if defined(__ANDROID__) 14 | 15 | #include "local_res_android.c.h" 16 | 17 | #elif defined(__EMSCRIPTEN__) 18 | 19 | #include "local_res_web.c.h" 20 | 21 | #else 22 | 23 | #include "local_res_sys.c.h" 24 | 25 | #endif 26 | 27 | #ifndef __EMSCRIPTEN__ 28 | 29 | void ek_local_res_load(const char* path, ek_local_res_callback callback, void* userdata) { 30 | ek_local_res lr = {0}; 31 | lr.userdata = userdata; 32 | ek_local_res_get_file_platform(path, &lr); 33 | callback(&lr); 34 | } 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /packages/res/src/local_res_android.c.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include "local_res_sys.c.h" 3 | #include 4 | 5 | static void ek_local_res__AAsset_close(ek_local_res* lr) { 6 | if(lr->handle) { 7 | AAsset_close((AAsset*) lr->handle); 8 | lr->handle = NULL; 9 | } 10 | lr->buffer = NULL; 11 | lr->length = 0; 12 | } 13 | 14 | int ek_local_res_get_file_platform(const char* path, ek_local_res* lr) { 15 | AAsset* asset = AAssetManager_open(ek_android_assets(), path, AASSET_MODE_BUFFER); 16 | if (asset) { 17 | lr->handle = asset; 18 | lr->buffer = (uint8_t*)AAsset_getBuffer(asset); 19 | lr->length = AAsset_getLength(asset); 20 | lr->closeFunc = ek_local_res__AAsset_close; 21 | lr->status = 0; 22 | return 0; 23 | } 24 | lr->length = 0; 25 | lr->buffer = 0; 26 | lr->status = 1; 27 | return 1; 28 | } 29 | -------------------------------------------------------------------------------- /packages/scenex/NOTES.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /packages/scenex/README.md: -------------------------------------------------------------------------------- 1 | # ekx 2 | 3 | ## Key Features 4 | 5 | - *Edit Mode* 6 | - Resources *hot reloading* 7 | - Resources *loading on the fly* 8 | - Resources *deferred export* 9 | - Sprites resolution hot reloading on Window Resize 10 | - Export Platforms (iOS, Android, Web) 11 | 12 | - Export for Production 13 | - Build statically against the whole Codebase 14 | - Run/Debug in XCode and Android Studio 15 | - Debug runtime-code 16 | - Stripped libraries code 17 | 18 | - Capabilities 19 | - ECS framework 20 | - Multi-resolution export: @x1, @x2, @x3, @x4 21 | - Export from Animate CC (`.fla` / `.xfl` files) 22 | - Import TTF fonts with Effects 23 | - GLSL shaders 24 | - Marketing assets export from Flash template 25 | - Simple Binary serialization 26 | 27 | ## Prerequisites for tooling 28 | 29 | - NodeJS, yarn v1 classic 30 | - CMake >= 3.19 31 | - Android Studio for Android 32 | - `python3` and `pip` 33 | - XCode for iOS 34 | -------------------------------------------------------------------------------- /packages/scenex/TASKS.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/highduck/ekx/e52b74588b9e753b392d43daa76ebd458d842ed4/packages/scenex/TASKS.md -------------------------------------------------------------------------------- /packages/scenex/ek.ts: -------------------------------------------------------------------------------- 1 | import {Project} from "../../modules/cli/project.js"; 2 | 3 | export async function setup(project: Project) { 4 | project.addModule({ 5 | name: "scenex", 6 | cpp: "src", 7 | cpp_include: "include", 8 | android: { 9 | android_permission: "android.permission.INTERNET" 10 | }, 11 | }); 12 | await project.importModule("../sg-file/ek.ts"); 13 | await project.importModule("../graphics/ek.ts"); 14 | await project.importModule("../audio/ek.ts"); 15 | await project.importModule("../local-storage/ek.ts"); 16 | await project.importModule("../texture-loader/ek.ts"); 17 | await project.importModule("../res/ek.ts"); 18 | await project.importModule("../ecs/ek.ts"); 19 | } 20 | -------------------------------------------------------------------------------- /packages/scenex/include/ekx/app/frame_timer.h: -------------------------------------------------------------------------------- 1 | #ifndef EKX_APP_FRAME_TIMER_H 2 | #define EKX_APP_FRAME_TIMER_H 3 | 4 | #include 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | typedef struct frame_timer_t { 11 | // delta time between frames in seconds 12 | double dt; 13 | // frame index, continuously growing, theoretically useful to check frame-stamps 14 | uint64_t idx; 15 | 16 | double app_fts_prev; 17 | uint64_t stopwatch; 18 | } frame_timer_t; 19 | 20 | double update_frame_timer(frame_timer_t* timer); 21 | 22 | #ifdef __cplusplus 23 | } 24 | #endif 25 | 26 | #endif // EKX_APP_FRAME_TIMER_H 27 | -------------------------------------------------------------------------------- /packages/scenex/include/ekx/app/time_layers.h: -------------------------------------------------------------------------------- 1 | #ifndef EKX_APP_TIME_LAYERS_H 2 | #define EKX_APP_TIME_LAYERS_H 3 | 4 | #include 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | typedef struct time_layer_state_t { 11 | float scale; 12 | float dt; 13 | float total; 14 | float pad_; 15 | } time_layer_state_t; 16 | 17 | enum { 18 | TIME_LAYER_ROOT = 0, 19 | TIME_LAYER_GAME = 1, 20 | TIME_LAYER_HUD = 2, 21 | TIME_LAYER_UI = 3, 22 | TIME_LAYER_MAX_COUNT = 4, 23 | }; 24 | 25 | typedef uint8_t TimeLayer; 26 | 27 | extern time_layer_state_t g_time_layers[TIME_LAYER_MAX_COUNT]; 28 | 29 | void init_time_layers(); 30 | void update_time_layers(float raw_dt); 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | 36 | #endif // EKX_APP_TIME_LAYERS_H 37 | -------------------------------------------------------------------------------- /packages/scenex/include/ekx/app/uitest.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef EK_UITEST 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | namespace ek::uitest { 15 | 16 | extern basic_application* _baseApp; 17 | extern std::string lang; 18 | extern int step; 19 | 20 | void screenshot(const char* name); 21 | void done(); 22 | void fail(); 23 | void click(const std::vector& path); 24 | void UITest(const char* name, const std::function& run); 25 | void initialize(basic_application* baseApp); 26 | 27 | } 28 | 29 | #endif -------------------------------------------------------------------------------- /packages/scenex/include/ekx/ng/updater.c: -------------------------------------------------------------------------------- 1 | #include "updater.h" 2 | 3 | ecx_component_type updater_comp_type; 4 | 5 | void updater_init(void) { 6 | init_component_type(&updater_comp_type, (ecx_component_type_decl) { 7 | "updater", 8, 1, {sizeof(updater_state)} 8 | }); 9 | } 10 | 11 | void updater_set(entity_t e, updater_callback_t callback) { 12 | EK_ASSERT(updater_comp_type.index); 13 | updater_state* state = add_component(&updater_comp_type, e); 14 | state->callback = callback; 15 | state->time_layer = 0; 16 | } 17 | 18 | void updater_update() { 19 | for (uint32_t i = 1; i < updater_comp_type.size; ++i) { 20 | entity_idx_t ei = updater_comp_type.handleToEntity[i]; 21 | updater_state s = ((updater_state*) updater_comp_type.data[0])[i]; 22 | if (s.callback) { 23 | s.callback(entity_at(ei), s.time_layer); 24 | } 25 | } 26 | } 27 | 28 | void updater_remove(entity_t e) { 29 | remove_component(&updater_comp_type, e); 30 | } 31 | -------------------------------------------------------------------------------- /packages/scenex/include/ekx/ng/updater.h: -------------------------------------------------------------------------------- 1 | #ifndef EKX_NG_UPDATER_H 2 | #define EKX_NG_UPDATER_H 3 | 4 | #include 5 | #include 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | typedef struct updater_state updater_state; 12 | 13 | typedef void (* updater_callback_t)(entity_t e, TimeLayer time_layer); 14 | 15 | struct updater_state { 16 | TimeLayer time_layer; 17 | updater_callback_t callback; 18 | }; 19 | 20 | void updater_init(void); 21 | 22 | void updater_set(entity_t e, updater_callback_t callback); 23 | 24 | void updater_update(); 25 | 26 | void updater_remove(entity_t e); 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | 32 | #endif // EKX_NG_UPDATER_H 33 | -------------------------------------------------------------------------------- /packages/scenex/src/ek/goodies/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19) 2 | 3 | target_sources(${PROJECT_NAME} PRIVATE 4 | GameScreen.hpp 5 | GameScreen.cpp 6 | 7 | PopupManager.cpp 8 | PopupManager.hpp 9 | Shake.hpp 10 | Shake.cpp 11 | bubble_text.cpp 12 | bubble_text.hpp 13 | 14 | simple_animator_comp.h 15 | simple_animator_comp.cpp 16 | fireworks.h 17 | fireworks.cpp 18 | 19 | helpers/follow.cpp 20 | helpers/follow.h 21 | helpers/Trail2D.cpp 22 | helpers/Trail2D.hpp 23 | ) -------------------------------------------------------------------------------- /packages/scenex/src/ek/goodies/PopupManager.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace ek { 7 | 8 | struct PopupManager { 9 | entity_t entity; 10 | entity_t back; 11 | entity_t layer; 12 | entity_t closing_last; 13 | float fade_progress; 14 | float fade_duration; 15 | float fade_alpha; 16 | FixedArray active; 17 | }; 18 | 19 | void init_basic_popup(entity_t e); 20 | 21 | void open_popup(entity_t e); 22 | 23 | void close_popup(entity_t e); 24 | 25 | void clear_popups(); 26 | 27 | void close_all_popups(); 28 | 29 | void update_popup_managers(float dt); 30 | 31 | uint32_t count_active_popups(); 32 | 33 | } 34 | 35 | extern ek::PopupManager g_popup_manager; 36 | void popup_manager_init(); 37 | void update_popup_manager(); 38 | -------------------------------------------------------------------------------- /packages/scenex/src/ek/goodies/Shake.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | namespace ek { 8 | 9 | //struct Shake { 10 | // float time = 0.0f; 11 | // float time_total = 1.0f; 12 | // float strength = 16.0f; 13 | // TimeLayer timer; 14 | // 15 | // static void updateAll(); 16 | // static void add(ecs::Entity e, float time = 2.0f, float strength = 16.0f); 17 | //}; 18 | 19 | struct Shaker { 20 | TimeLayer timer; 21 | float state = 0.0f; 22 | float maxRotation = 0.25f; 23 | vec2_t maxOffset = vec2(8.0f, 8.0f); 24 | vec2_t maxScale = vec2(0.25f, 0.25f); 25 | 26 | void start(float v = 1.0f) { 27 | state = MAX(v, state); 28 | } 29 | 30 | static void updateAll(); 31 | }; 32 | 33 | 34 | 35 | } 36 | 37 | 38 | -------------------------------------------------------------------------------- /packages/scenex/src/ek/goodies/bubble_text.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | namespace ek { 8 | 9 | struct BubbleText { 10 | float delay = 0.0f; 11 | float time = 0.0f; 12 | vec2_t start = {}; 13 | vec2_t offset = {}; 14 | 15 | static void updateAll(); 16 | 17 | static entity_t create(string_hash_t fontName, vec2_t pos, float delay); 18 | }; 19 | 20 | } 21 | -------------------------------------------------------------------------------- /packages/scenex/src/ek/goodies/fireworks.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | struct fireworks_state_t { 7 | entity_t layer = NULL_ENTITY; 8 | TimeLayer time_layer = TIME_LAYER_ROOT; 9 | float timer_ = 1.0f; 10 | bool enabled = false; 11 | }; 12 | 13 | void start_fireworks(entity_t e); 14 | 15 | void update_fireworks(); 16 | 17 | void stop_fireworks(); 18 | -------------------------------------------------------------------------------- /packages/scenex/src/ek/goodies/helpers/follow.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | struct target_follow_comp { 7 | enum class integration_mode { 8 | Exp = 0, 9 | Steps = 1, 10 | None = 2, 11 | }; 12 | 13 | vec2_t offset = {}; 14 | vec2_t target = {}; 15 | ecs::Entity target_entity{}; 16 | 17 | float k = 0.1f; 18 | float fixed_frame_rate = 60.0f; 19 | 20 | int n = 1; 21 | int counter = 0; 22 | float time_accum = 0.0f; 23 | 24 | int frame = 0; 25 | int reset_in = 100; 26 | 27 | integration_mode integration = integration_mode::Exp; 28 | }; 29 | 30 | struct mouse_follow_comp {}; 31 | 32 | void update_target_follow_comps(float dt); 33 | void update_mouse_follow_comps(void); 34 | -------------------------------------------------------------------------------- /packages/scenex/src/ek/goodies/simple_animator_comp.cpp: -------------------------------------------------------------------------------- 1 | #include "simple_animator_comp.h" 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | void update_simple_animator_comps(float dt) { 8 | using ek::Transform2D; 9 | for(auto e : ecs::view()) { 10 | auto& d = ecs::get(e); 11 | d.rotation += dt * d.rotation_speed; 12 | d.hue += dt * d.hue_speed; 13 | 14 | auto& transform = ecs::get(e); 15 | transform.set_rotation(d.rotation); 16 | transform.color.scale = lerp_color( 17 | color_hue(reduce(d.hue, 1.0f, 0.0f)), 18 | d.base_color, 19 | 1.0f - d.hue_mixup_factor 20 | ); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/scenex/src/ek/goodies/simple_animator_comp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | struct simple_animator_comp { 6 | float rotation = 0.0f; 7 | float rotation_speed = 1.0f; 8 | float hue = 0.0f; 9 | float hue_speed = 0.0f; 10 | float hue_mixup_factor = 0.0f; 11 | color_t base_color = COLOR_WHITE; 12 | }; 13 | 14 | void update_simple_animator_comps(float dt); 15 | -------------------------------------------------------------------------------- /packages/scenex/src/ek/scenex/2d/MovieClip.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | #include 8 | #include 9 | 10 | namespace ek { 11 | 12 | struct MovieClip { 13 | const SGMovieData* data = nullptr; 14 | float time = 0.0f; 15 | float fps = 24.0f; 16 | TimeLayer timer = 0; 17 | bool playing = true; 18 | 19 | static void updateAll(); 20 | 21 | void trunc_time() { 22 | if (data) { 23 | const float max = (float)data->frames; 24 | if (time >= max) { 25 | time -= max * truncf(time / max); 26 | } 27 | if (time < 0) { 28 | time = 0; 29 | } 30 | } 31 | } 32 | }; 33 | 34 | struct MovieClipTargetIndex { 35 | int32_t key = 0; 36 | }; 37 | 38 | void goto_and_stop(entity_t e, float frame); 39 | 40 | } -------------------------------------------------------------------------------- /packages/scenex/src/ek/scenex/2d/RenderSystem2D.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace ek { 6 | 7 | struct WorldTransform2D; 8 | 9 | class RenderSystem2D { 10 | public: 11 | static void draw(entity_t e, const WorldTransform2D* transform); 12 | 13 | static void drawStack(entity_t e); 14 | }; 15 | 16 | } 17 | 18 | -------------------------------------------------------------------------------- /packages/scenex/src/ek/scenex/3d/Camera3D.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | #include 7 | 8 | namespace ek { 9 | 10 | struct Camera3D { 11 | // clip plane near-far 12 | float zNear = 10.0f; 13 | float zFar = 1000.0f; 14 | 15 | // orthogonal mode 16 | bool orthogonal = false; 17 | float orthogonalSize = 30.0f; 18 | 19 | // field of view in radians 20 | float fov = to_radians(45.0f); 21 | 22 | // camera up vector 23 | vec3_t up = vec3(0, 0,1); 24 | 25 | bool clearColorEnabled = true; 26 | bool clearDepthEnabled = true; 27 | 28 | vec4_t clearColor = vec4(0.5f, 0.5f, 0.5f, 1.0f); 29 | float clearDepth = 1.0f; 30 | 31 | R(sg_image) cubeMap; 32 | }; 33 | 34 | 35 | 36 | } 37 | 38 | -------------------------------------------------------------------------------- /packages/scenex/src/ek/scenex/3d/Light3D.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace ek { 6 | 7 | enum class Light3DType { 8 | Directional, 9 | Point, 10 | Spot 11 | }; 12 | 13 | struct Light3D { 14 | Light3DType type = Light3DType::Point; 15 | 16 | vec3_t ambient = vec3(0.1f, 0.1f, 0.1f); 17 | vec3_t diffuse = vec3(1, 1, 1); 18 | vec3_t specular = vec3(1, 1, 1); 19 | 20 | float radius = 100.0f; 21 | float falloff = 1.0f; 22 | 23 | bool cast_shadows = true; 24 | }; 25 | 26 | 27 | 28 | } 29 | 30 | -------------------------------------------------------------------------------- /packages/scenex/src/ek/scenex/3d/Material3D.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace ek { 7 | 8 | struct Material3D { 9 | // for c++ currently we are auto init bulk data, so this header is for `rr` debug checks 10 | uint32_t zero_header = 0; 11 | constexpr static float k = 0.8f; 12 | vec3_t ambient = vec3(k, k, k); 13 | vec3_t diffuse = vec3(k, k, k); 14 | vec3_t specular = vec3(k, k, k); 15 | vec3_t emission = vec3(0, 0, 0); 16 | float shininess = 32.0f; 17 | float roughness = 0.05f; 18 | 19 | inline void set_base_color(color_t color, float ao = 0.5f) { 20 | diffuse = vec4_color(color).xyz; 21 | ambient = scale_vec3(diffuse, ao); 22 | } 23 | }; 24 | 25 | } 26 | 27 | struct res_material3d { 28 | string_hash_t names[32]; 29 | ek::Material3D data[32]; 30 | rr_man_t rr; 31 | }; 32 | 33 | extern struct res_material3d res_material3d; 34 | 35 | void setup_res_material3d(void); 36 | 37 | -------------------------------------------------------------------------------- /packages/scenex/src/ek/scenex/3d/RenderSystem3D.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include "Material3D.hpp" 5 | 6 | namespace ek { 7 | 8 | struct ShadowMapRes; 9 | struct Main3DRes; 10 | struct RenderSkyBoxRes; 11 | 12 | class RenderSystem3D { 13 | public: 14 | 15 | RenderSystem3D(); 16 | ~RenderSystem3D(); 17 | 18 | void prepare(); 19 | void prerender(); 20 | void render(float width, float height); 21 | // void renderShadowMap(const mat4f& cameraProjection, const mat4f& cameraView); 22 | void renderObjects(mat4_t proj, mat4_t view); 23 | 24 | Material3D defaultMaterial{}; 25 | ShadowMapRes* shadows = nullptr; 26 | Main3DRes* main = nullptr; 27 | RenderSkyBoxRes* skybox= nullptr; 28 | 29 | mat4_t cameraProjection = mat4_identity(); 30 | mat4_t cameraView = mat4_identity(); 31 | 32 | entity_t scene; 33 | entity_t camera; 34 | }; 35 | 36 | } 37 | 38 | extern ek::RenderSystem3D* g_render_system_3d; 39 | -------------------------------------------------------------------------------- /packages/scenex/src/ek/scenex/3d/Transform3D.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | struct Transform3D { 7 | mat4_t local = mat4_identity(); 8 | mat4_t world = mat4_identity(); 9 | vec3_t position = {}; 10 | vec3_t scale = vec3(1,1,1); 11 | vec3_t rotation = {}; 12 | 13 | // inline void set_euler_angles(const float3& angles) { 14 | // mat4f m = euler_angles(angles); 15 | //// rotation = quat_t{euler_angles}; 16 | // rotation = quat_t{m}; 17 | // } 18 | // 19 | // inline float3 get_euler_angles() const { 20 | // euler_angles(rotation); 21 | // } 22 | }; 23 | 24 | void update_world_transform3d(); 25 | 26 | //extern ecx_component_type COMP_Transform3D; 27 | //Transform3D* get_transform3d(entity_t e); 28 | -------------------------------------------------------------------------------- /packages/scenex/src/ek/scenex/SceneFactory.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | namespace ek { 10 | 11 | void sg_load(SGFile* out, const void* data, uint32_t size); 12 | 13 | [[nodiscard]] 14 | const SGNodeData* sg_get(const SGFile* sg, string_hash_t libraryName); 15 | 16 | entity_t sg_create(string_hash_t library, string_hash_t name, entity_t parent = NULL_ENTITY); 17 | 18 | rect_t sg_get_bounds(string_hash_t library, string_hash_t name); 19 | 20 | entity_t createNode2D(string_hash_t tag = 0); 21 | entity_t createNode2D(entity_t parent, string_hash_t tag = 0, int index = -1); 22 | 23 | } 24 | 25 | struct res_sg { 26 | string_hash_t names[16]; 27 | ek::SGFile data[16]; 28 | rr_man_t rr; 29 | }; 30 | 31 | extern struct res_sg res_sg; 32 | 33 | void setup_res_sg(void); 34 | 35 | #define R_SG(name) REF_NAME(res_sg, name) 36 | 37 | 38 | -------------------------------------------------------------------------------- /packages/scenex/src/ek/scenex/app/GameAppListener.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace ek { 6 | 7 | class GameAppListener { 8 | public: 9 | virtual ~GameAppListener() = default; 10 | 11 | virtual void onBeforeFrameBegin() {} 12 | 13 | virtual void onPreload() {} 14 | 15 | // used to render all offscreen passes 16 | virtual void onPreRender() {} 17 | 18 | virtual void onRenderOverlay() {} 19 | 20 | virtual void onRenderFrame() {} 21 | 22 | virtual void onUpdate() {} 23 | 24 | virtual void onStart() {} 25 | 26 | virtual void onEvent(const ek_app_event&) {} 27 | 28 | virtual void onPostFrame() {} 29 | }; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /packages/scenex/src/ek/scenex/app/RootAppListener.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "basic_application.hpp" 4 | #include 5 | 6 | namespace ek { 7 | 8 | void root_app_on_frame() { 9 | log_tick(); 10 | ek_timers_update(); 11 | } 12 | 13 | void root_app_on_event(const ek_app_event ev) { 14 | if (ev.type == EK_APP_EVENT_PAUSE) { 15 | auph_set_pause(AUPH_MIXER, true); 16 | } else if (ev.type == EK_APP_EVENT_RESUME) { 17 | auph_set_pause(AUPH_MIXER, false); 18 | } else if (ev.type == EK_APP_EVENT_CLOSE) { 19 | ek_app.on_frame = nullptr; 20 | ek_app.on_event = nullptr; 21 | if(g_game_app) { 22 | g_game_app->terminate(); 23 | delete g_game_app; 24 | g_game_app = nullptr; 25 | } 26 | ecx_shutdown(); 27 | canvas_shutdown(); 28 | auph_shutdown(); 29 | ek_gfx_shutdown(); 30 | } 31 | } 32 | 33 | } -------------------------------------------------------------------------------- /packages/scenex/src/ek/scenex/base/DestroyTimer.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | typedef struct destroy_timer_t { 8 | entity_t entity; 9 | float delay; 10 | TimeLayer time_layer; 11 | } destroy_timer_t; 12 | 13 | typedef struct destroy_manager_t { 14 | ek::PodArray timers; 15 | } destroy_manager_t; 16 | 17 | void destroy_later(entity_t e, float delay = 0.0f, TimeLayer timer = {}); 18 | 19 | void destroy_children_later(entity_t e, float delay = 0.0f, TimeLayer timer = {}); 20 | 21 | extern destroy_manager_t g_destroy_manager; 22 | 23 | void update_destroy_queue(); 24 | -------------------------------------------------------------------------------- /packages/scenex/src/ek/scenex/base/NodeEvents.cpp: -------------------------------------------------------------------------------- 1 | #include "NodeEvents.hpp" 2 | #include "Node.hpp" 3 | 4 | namespace ek { 5 | 6 | inline void send_event(entity_t e, const NodeEventData& data) { 7 | EK_ASSERT(is_entity(e)); 8 | auto* ev = ecs::try_get(e); 9 | if (ev) { 10 | data.receiver = e; 11 | ev->emit(data); 12 | } 13 | } 14 | 15 | void dispatch_broadcast(entity_t e, const NodeEventData& data) { 16 | send_event(e, data); 17 | e = get_first_child(e); 18 | while (e.id) { 19 | dispatch_broadcast(e, data); 20 | e = get_next_child(e); 21 | } 22 | } 23 | 24 | void dispatch_bubble(entity_t e, const NodeEventData& data) { 25 | while (e.id) { 26 | send_event(e, data); 27 | e = get_parent(e); 28 | } 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /packages/scenex/src/ek/scenex/base/Tween.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | namespace ek { 8 | 9 | struct Tween { 10 | void (*advanced)(entity_t e, float t) = nullptr; 11 | void (*completed)(entity_t e) = nullptr; 12 | int data[4] = {0}; 13 | float delay = 0.0f; 14 | float time = 0.0f; 15 | float duration = 0.0f; 16 | TimeLayer timer = 0; 17 | bool keep = false; 18 | // destroy entity on complete 19 | bool destroy_entity = false; 20 | 21 | static Tween& reset(entity_t e); 22 | 23 | void setOptions(float duration_ = 1.0f, float delay_ = 0.0f) { 24 | duration = duration_; 25 | delay = delay_; 26 | } 27 | }; 28 | 29 | void update_tweens(); 30 | 31 | } 32 | -------------------------------------------------------------------------------- /packages/scenex/src/ek/scenex/base/module.cpp: -------------------------------------------------------------------------------- 1 | #include "DestroyTimer_impl.hpp" 2 | #include "Tween_impl.hpp" 3 | 4 | -------------------------------------------------------------------------------- /packages/scenex/src/ek/scenex/ekx_app.c: -------------------------------------------------------------------------------- 1 | // implementations 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /packages/scenex/src/ek/scenex/ekx_app.cpp: -------------------------------------------------------------------------------- 1 | // implementations 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | -------------------------------------------------------------------------------- /packages/scenex/src/ek/scenex/systems/hitTest.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace ek { 7 | 8 | struct Node; 9 | 10 | entity_t hitTest2D(entity_t e, vec2_t parentSpacePosition); 11 | 12 | } -------------------------------------------------------------------------------- /packages/scenex/src/ek/scenex/systems/main_flow.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace ek { 6 | 7 | void scene_pre_update(entity_t root, float dt); 8 | void scene_post_update(entity_t root); 9 | void scene_render(entity_t root); 10 | 11 | } 12 | 13 | 14 | -------------------------------------------------------------------------------- /packages/scenex/src/ek/scenex/text/BitmapFont.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "FontImplBase.hpp" 4 | #include 5 | #include 6 | #include 7 | 8 | namespace ek { 9 | 10 | class BitmapFont : public FontImplBase { 11 | public: 12 | 13 | BitmapFont(); 14 | 15 | ~BitmapFont() override; 16 | 17 | void load(const uint8_t* buffer, size_t length); 18 | 19 | bool getGlyph(uint32_t codepoint, Glyph& outGlyph) override; 20 | 21 | bool getGlyphMetrics(uint32_t codepoint, Glyph& outGlyph) override; 22 | 23 | float getKerning(uint32_t codepoint1, uint32_t codepoint2) override; 24 | 25 | public: 26 | // bmfont is mapped to memory, we use this control structure with mapped pointers as source of data 27 | bmfont_file file = {}; 28 | // dynamic hash-map to map 32-bit codepoint to 32-bit glyph index 29 | Hash map; 30 | }; 31 | 32 | } 33 | 34 | -------------------------------------------------------------------------------- /packages/scenex/src/ek/scenex/text/FontImplBase.cpp: -------------------------------------------------------------------------------- 1 | #include "FontImplBase.hpp" 2 | 3 | namespace ek { 4 | 5 | FontImplBase::FontImplBase(FontType fontType_) : 6 | fontType{fontType_}, 7 | lineHeightMultiplier{1.f} { 8 | 9 | } 10 | 11 | FontImplBase::~FontImplBase() = default; 12 | 13 | bool FontImplBase::isReady() const { 14 | return ready_ && loaded_; 15 | } 16 | 17 | } 18 | 19 | 20 | -------------------------------------------------------------------------------- /packages/sg-file/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19) 2 | project(sg-file) 3 | 4 | add_library(${PROJECT_NAME} INTERFACE) 5 | target_include_directories(${PROJECT_NAME} INTERFACE ./src) 6 | 7 | add_library(ekx::${PROJECT_NAME} ALIAS ${PROJECT_NAME}) 8 | 9 | target_link_libraries(${PROJECT_NAME} INTERFACE ekx::core) -------------------------------------------------------------------------------- /packages/sg-file/ek.ts: -------------------------------------------------------------------------------- 1 | import {Project} from "../../modules/cli/project.js"; 2 | 3 | export async function setup(project: Project) { 4 | project.addModule({ 5 | name: "sg-file", 6 | cpp: "src" 7 | }); 8 | await project.importModule("../core/ek.ts"); 9 | } 10 | -------------------------------------------------------------------------------- /packages/sg-file/src/ek/format/ImageData.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | enum image_data_type { 8 | IMAGE_DATA_NORMAL = 0, 9 | IMAGE_DATA_CUBE_MAP = 1 10 | }; 11 | 12 | struct image_path_t { 13 | char str[128]; 14 | }; 15 | 16 | struct image_data_t { 17 | uint32_t type; 18 | uint32_t formatMask = 1; 19 | uint32_t images_num; 20 | image_path_t images[6]; 21 | 22 | template 23 | void serialize(ek::IO& io) { 24 | io(type, formatMask); 25 | io(images_num); 26 | for(uint32_t i = 0; i < images_num; ++i) { 27 | io.span(images[i].str, sizeof(image_path_t)); 28 | } 29 | } 30 | }; 31 | -------------------------------------------------------------------------------- /packages/std/ek.ts: -------------------------------------------------------------------------------- 1 | import {Project} from "../../modules/cli/project.js"; 2 | 3 | export async function setup(project: Project) { 4 | project.addModule({ 5 | name: "std", 6 | cpp: "src", 7 | cpp_include: "include", 8 | web: { 9 | //cpp: "src-wasm", 10 | //cpp_lib: "--import-memory" 11 | } 12 | }); 13 | await project.importModule("../../external/headers/ek.ts"); 14 | await project.importModule("../../external/sokol/ek.ts"); 15 | } 16 | -------------------------------------------------------------------------------- /packages/std/include/ek/_bitmap/stbi.c: -------------------------------------------------------------------------------- 1 | #ifndef STB_IMAGE_IMPLEMENTATION 2 | #define STB_IMAGE_IMPLEMENTATION 3 | 4 | #include 5 | #include 6 | 7 | // enable NEON for all ARM targets on Android and iOS 8 | #if defined(__aarch64__) || defined(__arm__) 9 | #if defined(__APPLE__) || defined(__ANDROID__) 10 | #define STBI_NEON 11 | #endif // apple || android 12 | #endif // arm 13 | 14 | #define STBI_NO_STDIO 15 | #define STBI_NO_THREAD_LOCALS 16 | #define STBI_NO_LINEAR 17 | #define STBI_NO_HDR 18 | 19 | #ifndef NDEBUG 20 | #define STBI_NO_FAILURE_STRINGS 21 | #else // DEBUG 22 | #define STBI_FAILURE_USERMSG 23 | #endif // NDEBUG 24 | 25 | #define STBI_ASSERT(e) EK_ASSERT(e) 26 | 27 | #include 28 | 29 | #endif // STB_IMAGE_IMPLEMENTATION 30 | -------------------------------------------------------------------------------- /packages/std/include/ek/assert.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #if defined(EK_DEBUG_BUILD) || defined(EK_ASSERTION_PEDANTIC) 4 | 5 | #ifdef __EMSCRIPTEN__ 6 | #include 7 | #else //__EMSCRIPTEN__ 8 | 9 | #include 10 | #include 11 | 12 | #endif // !__EMSCRIPTEN__ 13 | 14 | void ek_handle_assert(const char* e, const char* file, int line) { 15 | #ifdef __EMSCRIPTEN__ 16 | EM_ASM({console.assert(false, "%s from %s:%d", UTF8ToString($0), UTF8ToString($1), $2)}, e, file, line); 17 | #else 18 | printf("%s:%d: failed assertion '%s'\n", file, line, e); 19 | abort(); 20 | #endif 21 | } 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /packages/std/include/ek/base64.h: -------------------------------------------------------------------------------- 1 | #ifndef EK_BASE64_H 2 | #define EK_BASE64_H 3 | 4 | #include 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | uint32_t base64_encode_size(uint32_t length); 11 | 12 | uint32_t base64_decode_size(uint32_t length); 13 | 14 | uint32_t base64_encode(void* dst, uint32_t dstMaxSize, const void* src, uint32_t srcSize); 15 | 16 | uint32_t base64_decode(void* dst, uint32_t dstMaxSize, const void* src, uint32_t srcSize); 17 | 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | 22 | #endif //EK_BASE64_H 23 | -------------------------------------------------------------------------------- /packages/std/include/ek/bitset.h: -------------------------------------------------------------------------------- 1 | #ifndef EK_BITSET_H 2 | #define EK_BITSET_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | uint32_t ek_bitset_index(uint32_t position); 13 | 14 | uint32_t ek_bitset_byte_size(uint32_t bits); 15 | 16 | uint64_t ek_bitset_mask(uint32_t position); 17 | 18 | bool ek_bitset_get(const uint64_t* bitset, uint32_t position); 19 | 20 | void ek_bitset_set(uint64_t* bitset, uint32_t position); 21 | 22 | void ek_bitset_unset(uint64_t* bitset, uint32_t position); 23 | 24 | void ek_bitset_flip(uint64_t* bitset, uint32_t position); 25 | 26 | #ifdef __cplusplus 27 | } 28 | #endif 29 | 30 | #endif // EK_BITSET_H 31 | -------------------------------------------------------------------------------- /packages/std/include/ek/config.h: -------------------------------------------------------------------------------- 1 | #ifndef EK_CONFIG_H 2 | #define EK_CONFIG_H 3 | 4 | #ifndef NDEBUG 5 | // debug builds full checked, comment if need semi-fast debugging 6 | #define EK_CONFIG_PARANOIA 7 | #endif 8 | 9 | /// Log trace and debug levels even for Release build 10 | #ifdef EK_CONFIG_PARANOIA 11 | #define EK_CONFIG_PROFILING 12 | #define EK_CONFIG_LOG_ALL 13 | #define EK_CONFIG_ASSERT_ALL 14 | #endif 15 | 16 | #ifndef NDEBUG 17 | #define EK_DEBUG_BUILD 18 | #endif // !NDEBUG 19 | 20 | #if defined(EK_DEBUG_BUILD) || defined(EK_CONFIG_LOG_ALL) 21 | #define EK_LOG_DEBUG_OUTPUT 22 | #define EK_SOURCE_LOCATION_ENABLED 23 | #endif 24 | 25 | #ifdef EK_CONFIG_ASSERT_ALL 26 | #define EK_ASSERTION_PEDANTIC 27 | #endif 28 | 29 | // Q: how to check uninitialized memory: 30 | // A: turn on `-Os` option for Debug build profile to make sure all uninitialized memory issues 31 | 32 | #endif // EK_CONFIG_H 33 | -------------------------------------------------------------------------------- /packages/std/include/ek/core/target.h: -------------------------------------------------------------------------------- 1 | #ifndef EK_BASE_TARGET_H 2 | #define EK_BASE_TARGET_H 3 | 4 | #if defined(__APPLE__) 5 | 6 | #include 7 | 8 | #endif 9 | 10 | #if defined(__ANDROID__) 11 | 12 | #define EK_ANDROID 1 13 | 14 | #elif TARGET_OS_IPHONE 15 | 16 | #define EK_IOS 1 17 | 18 | #elif TARGET_OS_MAC 19 | 20 | #define EK_MACOS 1 21 | 22 | #elif defined(__EMSCRIPTEN__) 23 | 24 | #define EK_WEB 1 25 | 26 | #elif defined(__linux__) 27 | 28 | #define EK_LINUX 1 29 | 30 | #elif defined(_WIN32) || defined(_WIN64) 31 | 32 | #define EK_WINDOWS 1 33 | 34 | #include 35 | 36 | #if defined(WINAPI_FAMILY_PARTITION) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) 37 | #define EK_UWP 1 38 | #endif 39 | 40 | #endif 41 | 42 | #endif // EK_BASE_TARGET_H 43 | -------------------------------------------------------------------------------- /packages/std/include/ek/ek.h: -------------------------------------------------------------------------------- 1 | #ifndef EK_H 2 | #define EK_H 3 | 4 | 5 | 6 | #endif // EK_H 7 | -------------------------------------------------------------------------------- /packages/std/include/ek/math.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #ifdef __cplusplus 9 | } 10 | #endif 11 | 12 | #include "math/scalar.c" 13 | #include "math/vec.c" 14 | #include "math/mat.c" 15 | #include "math/color.c" 16 | #include "math/quat.c" 17 | #include "math/rect.c" 18 | #include "math/easing.c" 19 | #include "math/col2d.c" 20 | -------------------------------------------------------------------------------- /packages/std/include/ek/math.h: -------------------------------------------------------------------------------- 1 | #ifndef EK_MATH_H 2 | #define EK_MATH_H 3 | 4 | // some references: 5 | // - https://github.com/HandmadeMath/Handmade-Math 6 | // - https://github.com/septag/sx/tree/master/include/sx 7 | // - https://github.com/felselva/mathc 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #include "math/scalar.h" 15 | #include "math/vec.h" 16 | #include "math/color.h" 17 | #include "math/mat.h" 18 | #include "math/quat.h" 19 | #include "math/rect.h" 20 | #include "math/easing.h" 21 | #include "math/col2d.h" 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | 32 | #endif // EK_MATH_H 33 | -------------------------------------------------------------------------------- /packages/std/include/ek/math/color.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifdef __cplusplus 3 | 4 | inline static color2f_t operator-(const color2f_t a, const color2f_t b) { 5 | return {{a.scale - b.scale, a.offset - b.offset}}; 6 | } 7 | 8 | inline static color2f_t operator+(const color2f_t a, const color2f_t b) { 9 | return {{a.scale + b.scale, a.offset + b.offset}}; 10 | } 11 | 12 | inline static color2f_t operator*(const color2f_t a, const color2f_t b) { 13 | return mul_color2f(a, b); 14 | } 15 | 16 | inline static color_t operator*(const color_t a, const color_t b) { 17 | return mul_color(a, b); 18 | } 19 | 20 | inline static color_t operator+(const color_t a, const color_t b) { 21 | return add_color(a, b); 22 | } 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /packages/std/include/ek/math/quat.h: -------------------------------------------------------------------------------- 1 | #ifndef EK_MATH_QUAT_H 2 | #define EK_MATH_QUAT_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | /** quaternion **/ 9 | typedef union quat_t { 10 | struct { 11 | float x; 12 | float y; 13 | float z; 14 | float w; 15 | }; 16 | vec4_t xyzw; 17 | struct { 18 | vec3_t xyz; 19 | float _w; 20 | }; 21 | float data[4]; 22 | } quat_t; 23 | 24 | quat_t normalize_quat(quat_t a); 25 | quat_t quat_euler_angles(vec3_t angles); 26 | vec3_t quat_to_euler_angles(quat_t q); 27 | quat_t quat_mat4(mat4_t m); 28 | quat_t quat_look_at_rh(vec3_t direction, vec3_t up); 29 | float quat_roll(quat_t q); 30 | float quat_pitch(quat_t q); 31 | float quat_yaw(quat_t q); 32 | 33 | mat4_t mat4_rotation_transform_quat(quat_t q); 34 | 35 | #ifdef __cplusplus 36 | } 37 | #endif 38 | 39 | #endif // EK_MATH_QUAT_H 40 | -------------------------------------------------------------------------------- /packages/std/include/ek/math/rect.hpp: -------------------------------------------------------------------------------- 1 | #ifdef __cplusplus 2 | 3 | /** rect c++ operators **/ 4 | 5 | inline static rect_t operator/(const rect_t a, const float s) { 6 | EK_ASSERT(s != 0.0f); 7 | return rect_scale_f(a, 1.0f / s); 8 | } 9 | 10 | inline static rect_t operator*(const rect_t a, const float s) { 11 | return rect_scale_f(a, s); 12 | } 13 | 14 | inline static rect_t operator*(const float s, const rect_t a) { 15 | return rect_scale_f(a, s); 16 | } 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /packages/std/include/ek/print.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define STB_SPRINTF_IMPLEMENTATION 4 | #define STB_SPRINTF_NOFLOAT 5 | #define STB_SPRINTF_NOUNALIGNED 6 | 7 | #include 8 | 9 | -------------------------------------------------------------------------------- /packages/std/include/ek/print.h: -------------------------------------------------------------------------------- 1 | #ifndef EK_PRINT_H 2 | #define EK_PRINT_H 3 | 4 | //#ifdef __EMSCRIPTEN__ 5 | 6 | #include 7 | 8 | #define ek_snprintf(buf, count, fmt, ...) stbsp_snprintf(buf, count, fmt, __VA_ARGS__) 9 | #define ek_vsnprintf(buf, count, fmt, va) stbsp_vsnprintf(buf, count, fmt, va) 10 | 11 | //#else 12 | // 13 | //#include 14 | // 15 | //#define ek_snprintf(buf, count, fmt, ...) snprintf(buf, count, fmt, __VA_ARGS__) 16 | // 17 | //#endif 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | 24 | 25 | 26 | #ifdef __cplusplus 27 | } 28 | #endif 29 | 30 | #endif // EK_PRINT_H 31 | -------------------------------------------------------------------------------- /packages/std/include/ek/rnd.hpp: -------------------------------------------------------------------------------- 1 | #ifdef __cplusplus 2 | 3 | #include 4 | 5 | template 6 | inline static T rnd_pick_item(uint32_t* rnd, const T* array, uint32_t len) { 7 | EK_ASSERT(rnd); 8 | EK_ASSERT(array); 9 | EK_ASSERT(len); 10 | // using with small arrays, just to sanitize `len` bad casts 11 | EK_ASSERT(len < 0x80000000u); 12 | EK_ASSERT(len < 0x8000u); 13 | return array[ek_rand1(rnd) % len]; 14 | } 15 | 16 | template 17 | inline static T rnd_pick_item(uint32_t* rnd, const A& array) { 18 | return rnd_pick_item(rnd, array.data(), array.size()); 19 | } 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /packages/std/include/ek/time.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace ek { 6 | 7 | template 8 | inline ek_timer_callback timer_func(Fn&& fn) { 9 | ek_timer_callback callback; 10 | if constexpr(sizeof(Fn) > sizeof(void*)) { 11 | callback.userdata = new Fn(fn); 12 | callback.action = [](void* pf) { 13 | ((Fn*) pf)->operator()(); 14 | }; 15 | callback.cleanup = [](void* pf) { 16 | delete (Fn*) pf; 17 | }; 18 | //log_debug("created HEAP callback!"); 19 | } else { 20 | new(&callback.userdata)Fn(fn); 21 | callback.action = [](void* pf) { 22 | ((Fn*) (&pf))->operator()(); 23 | }; 24 | callback.cleanup = [](void* pf) { 25 | ((Fn*) (&pf))->~Fn(); 26 | }; 27 | //log_debug("created INLINE callback!"); 28 | } 29 | return callback; 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /packages/std/include/ek/utf8.h: -------------------------------------------------------------------------------- 1 | #ifndef EK_UTF8_H 2 | #define EK_UTF8_H 3 | 4 | #include 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | typedef uint32_t codepoint_t; 11 | 12 | codepoint_t utf8_next(const char** iter); 13 | 14 | #ifdef __cplusplus 15 | } 16 | #endif 17 | 18 | #endif //EK_UTF8_H 19 | -------------------------------------------------------------------------------- /packages/std/scripts/gen_math.js: -------------------------------------------------------------------------------- 1 | require("./gen_math_vec_test"); 2 | require("./gen_math_vec_hpp"); 3 | -------------------------------------------------------------------------------- /packages/std/src/ek_bitmap.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | -------------------------------------------------------------------------------- /packages/std/src/ek_std.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | #ifdef __EMSCRIPTEN__ 19 | #include 20 | #else 21 | #include 22 | #endif 23 | 24 | // non-standard 25 | #ifndef NDEBUG 26 | // TODO: 27 | //static void perf_penalty(long ms, const char* msg) { 28 | // log_warn("SLOWDOWN: %s", msg); 29 | // const long ns = ms * 1000000L; 30 | // nanosleep(&(struct timespec) { 31 | // .tv_sec = 0, 32 | // .tv_nsec = ns 33 | // }, NULL); 34 | //} 35 | #endif 36 | -------------------------------------------------------------------------------- /packages/std/test/log_test.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | SUITE(log) { 5 | IT("prints") { 6 | log_init(); 7 | { 8 | log_print(LOG_LEVEL_DEBUG, NULL, 0, "hello"); 9 | log_debug("~Hey! => %d", 223); 10 | log_debug("simple digits: %d", 54); 11 | 12 | log_debug("macro"); 13 | log_debug("and formatting %f", 4.0f); 14 | 15 | const char* p = "some/path/to/some/goodies"; 16 | log_info("%s", p); 17 | log_debug("%d", 2); 18 | } 19 | //log_term(); 20 | 21 | 22 | //log_init(); 23 | log_warn("WARNING!"); 24 | log_tick(); 25 | log_error("ERROR! %d", 233); 26 | log_tick(); 27 | log_info("Hello, World!"); 28 | log_tick(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /packages/std/test/math/math_rect_test.c: -------------------------------------------------------------------------------- 1 | #include "math_test_common.h" 2 | 3 | SUITE(rect) { 4 | 5 | IT("is empty") { 6 | CHECK(rect_is_empty(rect(0, 0, 0, 0))); 7 | CHECK(rect_is_empty(rect(1, 1, -1, -1))); 8 | CHECK(rect_is_empty(rect(0, 0, 0, 1))); 9 | CHECK(rect_is_empty(rect(0, 0, 1, 0))); 10 | CHECK_FALSE(rect_is_empty(rect(0, 0, 1, 1))); 11 | 12 | CHECK(aabb2_is_empty((aabb2_t){0, 0, 0, 0})); 13 | CHECK(aabb2_is_empty(aabb2_empty())); 14 | CHECK(aabb2_is_empty((aabb2_t){1, 1, 1, 1})); 15 | CHECK(aabb2_is_empty((aabb2_t){1, -1, 1, 1})); 16 | CHECK(aabb2_is_empty((aabb2_t){-1, 1, 1, 1})); 17 | CHECK(aabb2_is_empty((aabb2_t){-1, -1, -1, -1})); 18 | CHECK_FALSE(aabb2_is_empty((aabb2_t){-1, -1, 1, 1})); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /packages/std/test/math/math_test_common.h: -------------------------------------------------------------------------------- 1 | #ifndef MATH_TEST_COMMON_H 2 | #define MATH_TEST_COMMON_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #define CHECK_NEAR_EQ_EPS(x, y, eps) do { \ 9 | bool ok = almost_eq_f32((x),(y),(eps)); \ 10 | if(!ok) printf("%s != %s : %f != %f\n", #x, #y, (x), (y)); \ 11 | CHECK(ok); \ 12 | } while(0) 13 | 14 | #define CHECK_NEAR_EQ(x, y) CHECK_NEAR_EQ_EPS((x),(y),MATH_F32_EPSILON) 15 | 16 | #endif // MATH_TEST_COMMON_H 17 | -------------------------------------------------------------------------------- /packages/std/test/std_test_main.c: -------------------------------------------------------------------------------- 1 | #define UNIT_IMPL 2 | #include 3 | -------------------------------------------------------------------------------- /packages/std/test/string_test.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | SUITE(string) { 5 | 6 | IT("replace char") 7 | { 8 | char notFound[] = "Not Found"; 9 | ek_cstr_replace(notFound, '%', '-'); 10 | CHECK_EQ(notFound, "Not Found"); 11 | 12 | char hello1[] = "!Hello!"; 13 | ek_cstr_replace(hello1, '!', '?'); 14 | CHECK_EQ(hello1, "?Hello?"); 15 | 16 | char lll[] = "{X} == {X} == {X}"; 17 | ek_cstr_replace(lll, 'X', 'z'); 18 | CHECK_EQ(lll, "{z} == {z} == {z}"); 19 | } 20 | 21 | IT("format_mm_ss") 22 | { 23 | char buf[32]; 24 | ek_cstr_format_timer(buf, 32, 60000, 0); 25 | CHECK_EQ(buf, "01:00"); 26 | ek_cstr_format_timer(buf, 32, 60001, 1); 27 | CHECK_EQ(buf, "00:01:01"); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /packages/texture-loader/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/highduck/ekx/e52b74588b9e753b392d43daa76ebd458d842ed4/packages/texture-loader/README.md -------------------------------------------------------------------------------- /packages/texture-loader/build.ts: -------------------------------------------------------------------------------- 1 | import {getModuleDir} from "../../modules/utils/utils.js"; 2 | import * as path from "path"; 3 | import * as esbuild from "esbuild"; 4 | import {logger} from "../../modules/cli/logger.js"; 5 | 6 | const __dirname = getModuleDir(import.meta); 7 | 8 | await esbuild.build({ 9 | entryPoints: [path.resolve(__dirname, "web/src/index.ts")], 10 | globalName: "TextureLoader", 11 | target: ["chrome58", "firefox57", "safari11", "edge16"], 12 | bundle: true, 13 | sourcemap: true, 14 | outfile: path.join(__dirname, "js/pre/texture-loader.js") 15 | }).catch(err=> logger.error(err)); 16 | 17 | await esbuild.build({ 18 | entryPoints: [path.resolve(__dirname, "web/src/lib.ts")], 19 | bundle: true, 20 | format: "esm", 21 | sourcemap: true, 22 | target: "node14", 23 | outfile: path.join(__dirname, "js/lib/lib-texture-loader.js") 24 | }).catch(err=> logger.error(err)); 25 | 26 | logger.info("texture-loader build completed"); 27 | -------------------------------------------------------------------------------- /packages/texture-loader/ek.ts: -------------------------------------------------------------------------------- 1 | import {Project} from "../../modules/cli/project.js"; 2 | 3 | export async function setup(project: Project) { 4 | project.addModule({ 5 | name: "texture-loader", 6 | cpp: "src", 7 | cpp_include: "include", 8 | android: { 9 | android_java: "java" 10 | }, 11 | web: { 12 | js: "js/lib", 13 | js_pre: "js/pre" 14 | } 15 | }); 16 | await project.importModule("../core/ek.ts"); 17 | await project.importModule("../app/ek.ts"); 18 | await project.importModule("../../external/sokol/ek.ts"); 19 | } 20 | -------------------------------------------------------------------------------- /packages/texture-loader/web/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "esnext", 4 | "target": "es5", 5 | "moduleResolution": "node", 6 | "sourceMap": true, 7 | "strict": true, 8 | "outDir": "./dist/module", 9 | "declarationDir": "./dist/types", 10 | "declaration": true, 11 | "noEmitOnError": true, 12 | "allowSyntheticDefaultImports": true, 13 | "esModuleInterop": true, 14 | "downlevelIteration": true, 15 | "skipLibCheck": true, 16 | "lib": [ 17 | "DOM", 18 | "ESNext" 19 | ] 20 | }, 21 | "include": [ 22 | "./src/**/*.ts" 23 | ] 24 | } -------------------------------------------------------------------------------- /packages/unit/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19) 2 | 3 | # STANDALONE project 4 | if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) 5 | set(UNIT_LIBRARY_PROJECT ON) 6 | endif () 7 | 8 | project(unit C) 9 | add_library(${PROJECT_NAME} INTERFACE) 10 | target_include_directories(${PROJECT_NAME} INTERFACE include) 11 | 12 | # alias for NPM library name 13 | add_library(ekx::${PROJECT_NAME} ALIAS ${PROJECT_NAME}) 14 | 15 | if (UNIT_LIBRARY_PROJECT) 16 | add_subdirectory(src) 17 | endif () 18 | 19 | if (UNIT_LIBRARY_PROJECT) 20 | enable_testing() 21 | 22 | include(cmake/code-coverage.cmake) 23 | target_code_coverage(unit INTERFACE) 24 | 25 | add_subdirectory(test) 26 | add_subdirectory(example) 27 | 28 | coverage_all() 29 | endif () 30 | -------------------------------------------------------------------------------- /plugins/admob/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19) 2 | project(plugin-admob) 3 | 4 | add_library(${PROJECT_NAME} STATIC 5 | src/ek_admob.c 6 | src/AdMobWrapper.cpp 7 | src/AdMobSimulator.hpp 8 | src/AdMobNull.hpp 9 | ) 10 | add_library(ekx::${PROJECT_NAME} ALIAS ${PROJECT_NAME}) 11 | 12 | target_include_directories(${PROJECT_NAME} PUBLIC include) 13 | target_link_libraries(${PROJECT_NAME} 14 | PUBLIC plugin-firebase 15 | PUBLIC scenex 16 | ) 17 | 18 | target_compile_options(${PROJECT_NAME} 19 | PUBLIC -fno-exceptions 20 | PUBLIC -fno-rtti 21 | ) 22 | 23 | set_target_properties(${PROJECT_NAME} PROPERTIES 24 | C_STANDARD 11 25 | CXX_STANDARD 17 26 | CXX_STANDARD_REQUIRED YES 27 | CXX_EXTENSIONS NO) 28 | 29 | if (${CMAKE_SYSTEM_NAME} MATCHES "iOS") 30 | 31 | set_source_files_properties("src/ek_admob.c" PROPERTIES 32 | COMPILE_FLAGS "-x objective-c") 33 | 34 | endif() -------------------------------------------------------------------------------- /plugins/admob/include/ek/admob_wrapper.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace ek { 7 | 8 | class AdMobWrapper { 9 | protected: 10 | bool isAvailable_ = true; 11 | 12 | std::function interstitialCompletedCallback; 13 | bool activeInterstitial = false; 14 | 15 | std::function rewardedAdCompletedCallback; 16 | bool userRewarded = false; 17 | public: 18 | 19 | AdMobWrapper(); 20 | 21 | virtual ~AdMobWrapper() = default; 22 | 23 | virtual void showInterstitial(std::function callback); 24 | 25 | virtual void showRewardedAd(std::function callback); 26 | 27 | void completeRewardedAd(bool rewarded); 28 | 29 | void onAdmobEvent(ek_admob_event_type event); 30 | 31 | [[nodiscard]] 32 | bool isAvailable() const { 33 | return isAvailable_; 34 | } 35 | 36 | static AdMobWrapper* create(bool devMode); 37 | }; 38 | 39 | } 40 | 41 | -------------------------------------------------------------------------------- /plugins/admob/src/AdMobNull.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace ek { 6 | 7 | class AdMobNull : public AdMobWrapper { 8 | public: 9 | 10 | void showInterstitial(std::function callback) override { 11 | if (callback) { 12 | callback(); 13 | } 14 | } 15 | 16 | void showRewardedAd(std::function callback) override { 17 | if (callback) { 18 | callback(false); 19 | } 20 | } 21 | }; 22 | 23 | } 24 | 25 | -------------------------------------------------------------------------------- /plugins/billing/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19) 2 | project(plugin-billing) 3 | add_library(${PROJECT_NAME} STATIC 4 | src/billing.hpp 5 | src/billing.cpp 6 | ) 7 | 8 | add_library(ekx::${PROJECT_NAME} ALIAS ${PROJECT_NAME}) 9 | 10 | target_include_directories(${PROJECT_NAME} PUBLIC src) 11 | target_link_libraries(${PROJECT_NAME} 12 | PUBLIC ekx::scenex) 13 | 14 | set_target_properties(${PROJECT_NAME} PROPERTIES 15 | C_STANDARD 11 16 | CXX_STANDARD 17 17 | CXX_STANDARD_REQUIRED YES 18 | CXX_EXTENSIONS NO) 19 | 20 | if (${CMAKE_SYSTEM_NAME} MATCHES "iOS") 21 | 22 | set_source_files_properties("src/billing.cpp" PROPERTIES 23 | COMPILE_FLAGS "-x objective-c++") 24 | 25 | endif() 26 | 27 | target_compile_options(${PROJECT_NAME} PRIVATE 28 | -fno-exceptions 29 | -fno-rtti 30 | -fno-strict-aliasing 31 | -Wstrict-aliasing=2 32 | ) 33 | -------------------------------------------------------------------------------- /plugins/billing/ek.ts: -------------------------------------------------------------------------------- 1 | import {Project} from "../../modules/cli/project.js"; 2 | 3 | export function setup(project: Project) { 4 | project.addModule({ 5 | name: "plugin-billing", 6 | cpp: "src", 7 | android: { 8 | android_java: "java", 9 | android_dependency: `implementation 'com.android.billingclient:billing:5.1.0'` 10 | }, 11 | ios: { 12 | xcode_capability: "com.apple.InAppPurchase", 13 | xcode_framework: "StoreKit", 14 | cpp_flags: { 15 | files: [ 16 | "src/billing.cpp" 17 | ], 18 | flags: "-x objective-c++" 19 | } 20 | } 21 | }); 22 | } 23 | -------------------------------------------------------------------------------- /plugins/billing/java/ek/billing/BillingPlugin.java: -------------------------------------------------------------------------------- 1 | package ek.billing; 2 | 3 | import android.app.Activity; 4 | 5 | import ek.EkPlugin; 6 | 7 | public abstract class BillingPlugin extends EkPlugin { 8 | 9 | // (arbitrary) request code for the purchase flow 10 | protected static final int RC_REQUEST = 10111; 11 | 12 | final Activity activity; 13 | final String developerKey; 14 | 15 | BillingPlugin(Activity activity, String developerKey) { 16 | this.developerKey = developerKey; 17 | this.activity = activity; 18 | } 19 | 20 | public abstract void getPurchases(); 21 | 22 | public abstract void getDetails(String[] skus); 23 | 24 | public abstract void purchase(String sku, String payload); 25 | 26 | public abstract void consume(String token); 27 | 28 | public abstract String get_tag(); 29 | } 30 | -------------------------------------------------------------------------------- /plugins/billing/src/billing.cpp: -------------------------------------------------------------------------------- 1 | #include "billing.hpp" 2 | #include 3 | #include 4 | 5 | // implementation 6 | #if defined(__APPLE__) 7 | 8 | #include 9 | 10 | #endif 11 | 12 | #if defined(__ANDROID__) 13 | 14 | #include "billing_android.hpp" 15 | 16 | #elif TARGET_OS_IPHONE || TARGET_OS_SIMULATOR 17 | 18 | #include "billing_ios.hpp" 19 | 20 | #else 21 | 22 | #include "billing_sim.hpp" 23 | 24 | #endif 25 | 26 | namespace billing { 27 | 28 | static ek::StaticStorage _context{}; 29 | Context& context = *_context.ptr(); 30 | 31 | void _initialize() { 32 | log_debug("billing initialize"); 33 | _context.initialize(); 34 | } 35 | 36 | void shutdown() { 37 | log_debug("billing shutdown"); 38 | _context.shutdown(); 39 | } 40 | 41 | } -------------------------------------------------------------------------------- /plugins/billing/src/billing_sim.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace billing { 7 | 8 | void initialize(const char* developerKey) { 9 | (void) developerKey; 10 | _initialize(); 11 | } 12 | 13 | void getPurchases() { 14 | 15 | } 16 | 17 | void getDetails(const ek::Array& skuList) { 18 | double time = 0.5; 19 | for (const auto& sku : skuList) { 20 | ek_set_timeout(ek::timer_func([sku]() { 21 | context.onProductDetails({sku, "$1.99", "USD"}); 22 | }), time); 23 | time += 0.5; 24 | } 25 | } 26 | 27 | void purchase(const ek::String& sku, const ek::String& payload) { 28 | PurchaseData data; 29 | data.productID = sku; 30 | data.payload = payload; 31 | data.state = 0; 32 | ek_set_timeout(ek::timer_func([data]() { 33 | context.onPurchaseChanged(data); 34 | }), 2); 35 | } 36 | 37 | void consume(const ek::String& token) { 38 | (void) token; 39 | } 40 | 41 | } -------------------------------------------------------------------------------- /plugins/firebase/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19) 2 | project(plugin-firebase) 3 | 4 | add_library(${PROJECT_NAME} STATIC 5 | src/ek/firebase.c 6 | ) 7 | add_library(ekx::${PROJECT_NAME} ALIAS ${PROJECT_NAME}) 8 | 9 | target_include_directories(${PROJECT_NAME} PUBLIC src) 10 | 11 | target_link_libraries(${PROJECT_NAME} 12 | PUBLIC ekx::app 13 | ) 14 | 15 | #target_compile_options(${PROJECT_NAME} PUBLIC -std=c++17) 16 | set_target_properties(${PROJECT_NAME} PROPERTIES 17 | C_STANDARD 11 18 | CXX_STANDARD 17 19 | CXX_STANDARD_REQUIRED YES 20 | CXX_EXTENSIONS NO) 21 | 22 | if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin|iOS") 23 | 24 | set_source_files_properties("src/ek/firebase.c" PROPERTIES 25 | COMPILE_FLAGS "-x objective-c") 26 | 27 | endif() 28 | 29 | target_compile_options(${PROJECT_NAME} PRIVATE 30 | -fno-exceptions 31 | -fno-rtti 32 | -fno-strict-aliasing 33 | -Wstrict-aliasing=2 34 | ) -------------------------------------------------------------------------------- /plugins/firebase/build.ts: -------------------------------------------------------------------------------- 1 | import {getModuleDir} from "../../modules/utils/utils.js"; 2 | import * as path from "path"; 3 | import * as esbuild from "esbuild"; 4 | import {logger} from "../../modules/cli/logger.js"; 5 | 6 | const __dirname = getModuleDir(import.meta); 7 | await esbuild.build({ 8 | entryPoints: [path.resolve(__dirname, "web/firebase.js")], 9 | globalName: "firebase_js", 10 | target: ["chrome58", "firefox57", "safari11", "edge16"], 11 | bundle: true, 12 | sourcemap: true, 13 | outfile: path.join(__dirname, "web/dist/firebase.js") 14 | }).catch(err => logger.error(err)); 15 | 16 | await esbuild.build({ 17 | entryPoints: [path.resolve(__dirname, "web/firebase_c.js")], 18 | bundle: true, 19 | format: "esm", 20 | sourcemap: true, 21 | target: "node14", 22 | outfile: path.join(__dirname, "web/lib/firebase_c.js") 23 | }).catch(err => logger.error(err)); 24 | 25 | logger.info("firebase build completed"); 26 | -------------------------------------------------------------------------------- /plugins/firebase/src/ek/firebase.h: -------------------------------------------------------------------------------- 1 | #ifndef EK_FIREBASE_H 2 | #define EK_FIREBASE_H 3 | 4 | #include 5 | #include 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | typedef enum firebase_cmd_t { 12 | FIREBASE_CMD_INIT = 0, 13 | // FIREBASE_CMD_AUTH_LOGIN = 1, 14 | // FIREBASE_CMD_AUTH_LOGOUT = 2, 15 | // FIREBASE_CMD_AUTH_DELETE_ACCOUNT = 3, 16 | } firebase_cmd_t; 17 | 18 | bool firebase(firebase_cmd_t cmd); 19 | 20 | void firebase_screen(const char* name); 21 | 22 | void firebase_event(const char* action, const char* target); 23 | 24 | #ifdef __cplusplus 25 | } 26 | #endif 27 | 28 | #endif // EK_FIREBASE_H 29 | -------------------------------------------------------------------------------- /plugins/firebase/web/firebase.js: -------------------------------------------------------------------------------- 1 | export let app = null; 2 | export let analytics = null; 3 | 4 | export function init() { 5 | const config = window["firebaseConfig"]; 6 | if (!config) { 7 | console.warn("failed to initialize firebase, miss config object"); 8 | return false; 9 | } 10 | app = firebase.initializeApp(config); 11 | analytics = firebase.analytics(); 12 | 13 | return true; 14 | } 15 | -------------------------------------------------------------------------------- /plugins/firebase/web/firebase_c.js: -------------------------------------------------------------------------------- 1 | mergeInto(LibraryManager.library, { 2 | firebase_js: function(cmd) { 3 | switch(cmd) { 4 | case 0: return window["firebase_js"]["init"](); 5 | } 6 | return false; 7 | } 8 | }); -------------------------------------------------------------------------------- /plugins/game-services/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19) 2 | project(plugin-game-services) 3 | add_library(${PROJECT_NAME} STATIC 4 | src/ek_game_services.c 5 | ) 6 | add_library(ekx::${PROJECT_NAME} ALIAS ${PROJECT_NAME}) 7 | 8 | target_include_directories(${PROJECT_NAME} PUBLIC include) 9 | 10 | target_link_libraries(${PROJECT_NAME} 11 | PUBLIC ekx::std 12 | PUBLIC ekx::app 13 | ) 14 | 15 | set_target_properties(${PROJECT_NAME} PROPERTIES 16 | C_STANDARD 11 17 | CXX_STANDARD 17 18 | CXX_STANDARD_REQUIRED YES 19 | CXX_EXTENSIONS NO) 20 | 21 | target_compile_options(${PROJECT_NAME} PRIVATE 22 | -fno-exceptions 23 | -fno-rtti 24 | -fno-strict-aliasing 25 | -Wstrict-aliasing=2 26 | ) 27 | 28 | if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin|iOS") 29 | 30 | set_source_files_properties("src/ek_game_services.c" PROPERTIES 31 | COMPILE_FLAGS "-x objective-c") 32 | 33 | endif() -------------------------------------------------------------------------------- /plugins/game-services/README.md: -------------------------------------------------------------------------------- 1 | # Game Services plugin 2 | 3 | Simple wrapper for native game services: 4 | - GameCenter for iOS 5 | - Google Play Game Services for Android 6 | 7 | ### TODO: 8 | - android: register plugin as Activity extension 9 | -------------------------------------------------------------------------------- /plugins/game-services/include/ek/game_services.h: -------------------------------------------------------------------------------- 1 | #ifndef EK_GAME_SERVICES_H 2 | #define EK_GAME_SERVICES_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | void ek_game_services_init(void); 9 | 10 | void ek_leaderboard_show(const char* id); 11 | 12 | void ek_leaderboard_submit(const char* id, int score); 13 | 14 | void ek_achievement_update(const char* id, int increment); 15 | 16 | void ek_achievement_show(void); 17 | 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | 22 | #endif // EK_GAME_SERVICES_H 23 | -------------------------------------------------------------------------------- /plugins/game-services/src/ek_game_services.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #if defined(__APPLE__) && (TARGET_OS_IOS || TARGET_OS_TV) 6 | #include "ek_game_services_ios.c.h" 7 | #elif defined(__ANDROID__) 8 | #include "ek_game_services_android.c.h" 9 | #else 10 | 11 | void ek_game_services_init(void) { 12 | log_debug("game-services initialize"); 13 | } 14 | 15 | void ek_leaderboard_show(const char* id) { 16 | log_debug("game-services: show leaderboard: %s", id); 17 | } 18 | 19 | void ek_leaderboard_submit(const char* id, int score) { 20 | log_debug("game-services: submit to leaderboard: %s %d", id, score); 21 | } 22 | 23 | void ek_achievement_update(const char* id, int score) { 24 | log_debug("game-services: achievement update: %s %d", id, score); 25 | } 26 | 27 | void ek_achievement_show(void) { 28 | log_debug("game-services: show achievements"); 29 | } 30 | 31 | #endif -------------------------------------------------------------------------------- /tools/ekc/README.md: -------------------------------------------------------------------------------- 1 | # sprite packer 2 | 3 | # bmfont export 4 | 5 | # OBJ file export 6 | -------------------------------------------------------------------------------- /tools/ekc/src/obj-export/obj_export.h: -------------------------------------------------------------------------------- 1 | #ifndef OBJ_EXPORT_H 2 | #define OBJ_EXPORT_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | int convertObjModel(const char* input, const char* output); 9 | 10 | #ifdef __cplusplus 11 | } 12 | #endif 13 | 14 | #endif // OBJ_EXPORT_H 15 | -------------------------------------------------------------------------------- /tools/ekc/src/sprite_packer/sprpk_image.h: -------------------------------------------------------------------------------- 1 | #ifndef SPRITE_PACKER_IMAGE_H 2 | #define SPRITE_PACKER_IMAGE_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | typedef enum sprite_pack_format { 15 | SPRITE_PACK_AUTO = 0, 16 | SPRITE_PACK_BMP = 1, 17 | SPRITE_PACK_PNG = 2, 18 | SPRITE_PACK_JPEG = 3, 19 | SPRITE_PACK_ALPHA = 0x10 20 | } sprite_pack_format; 21 | 22 | void sprite_pack_image_save(const bitmap_t* bitmap, const char* path, uint32_t format_flags); 23 | 24 | #ifdef __cplusplus 25 | } 26 | #endif 27 | 28 | #endif // SPRITE_PACKER_IMAGE_H 29 | -------------------------------------------------------------------------------- /tools/ekc/src/sprite_packer/sprpk_stb_impl.c.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #ifndef STB_IMAGE_WRITE_IMPLEMENTATION 4 | #define STB_IMAGE_WRITE_IMPLEMENTATION 5 | 6 | static unsigned char* sprite_pack_compress(unsigned char* data, int data_len, int* out_len, int quality) { 7 | // uber compression 8 | quality = 10; 9 | mz_ulong buf_len = mz_compressBound(data_len); 10 | uint8_t* buf = (uint8_t*) malloc(buf_len); 11 | if (mz_compress2(buf, &buf_len, data, data_len, quality)) { 12 | free(buf); 13 | return NULL; 14 | } 15 | *out_len = (int) buf_len; 16 | return buf; 17 | } 18 | 19 | #define STBIW_ZLIB_COMPRESS(a, b, c, d) sprite_pack_compress(a, b, c, d) 20 | 21 | #include 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /tools/flash-export/README.md: -------------------------------------------------------------------------------- 1 | # ek-flash 2 | 3 | General library for exporting resources from XFL / FLA formats. 4 | 5 | [wiki](https://gitlab.com/eliasku/ek-flash/wikis) -------------------------------------------------------------------------------- /tools/flash-export/src/sxg/AnimationHelpers.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace ek { 4 | struct SGKeyFrameTransform; 5 | struct SGMovieFrameData; 6 | } 7 | 8 | namespace ek::xfl { 9 | 10 | struct Frame; 11 | struct Element; 12 | 13 | SGKeyFrameTransform extractTweenDelta(const Frame& frame, const Element& el0, const Element& el1); 14 | 15 | SGMovieFrameData createFrameModel(const Frame& frame); 16 | 17 | void setupFrameFromElement(SGMovieFrameData& target, const Element& el); 18 | 19 | } 20 | 21 | -------------------------------------------------------------------------------- /tools/flash-export/src/sxg/RenderElement.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | struct SpriteData; 4 | 5 | namespace ek::xfl { 6 | 7 | class Doc; 8 | 9 | struct Element; 10 | 11 | struct RenderElementOptions { 12 | float scale = 1.0f; 13 | int width = 0; 14 | int height = 0; 15 | bool alpha = true; 16 | bool trim = false; 17 | }; 18 | 19 | SpriteData renderElement(const Doc& doc, const Element& el, const RenderElementOptions& options); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /tools/flash-export/src/xfl/parsing/DocParser.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../Doc.hpp" 4 | #include "parsing.hpp" 5 | 6 | namespace ek::xfl { 7 | 8 | class DocParser { 9 | public: 10 | Doc& doc; 11 | std::unique_ptr root; 12 | 13 | DocParser(Doc& doc_, std::unique_ptr root_); 14 | 15 | void load(); 16 | void parse(const xml_node& node, Element& r) const; 17 | static void parse(const xml_node& node, ShapeObject& r) ; 18 | void parse(const xml_node& node, FillStyle& r) const; 19 | void parse(const xml_node& node, StrokeStyle& r) const; 20 | void parse(const xml_node& node, Frame& r) const; 21 | void parse(const xml_node& node, Layer& r) const; 22 | void parse(const xml_node& node, Timeline& r) const; 23 | 24 | template 25 | inline T read(const xml_node& node) const { 26 | T r; 27 | parse(node, r); 28 | return r; 29 | } 30 | }; 31 | 32 | } 33 | 34 | -------------------------------------------------------------------------------- /tsconfig-tsc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "noEmit": true, 5 | "strict": true 6 | }, 7 | "include": [ 8 | "modules/**/*.ts", 9 | "ci/**/*.ts" 10 | ] 11 | } -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "ESNext", 4 | "target": "ESNext", 5 | "moduleResolution": "NodeNext", 6 | "noImplicitAny": true, 7 | "strictNullChecks": true, 8 | "removeComments": false, 9 | "preserveConstEnums": false, 10 | "sourceMap": false, 11 | "outDir": "cache/builds/ts", 12 | "noEmit": true, 13 | "lib": [ 14 | "ESNext", 15 | "DOM" 16 | ] 17 | }, 18 | "ts-node": { 19 | "transpileOnly": true, 20 | "skipIgnore": true, 21 | "esm": true, 22 | "swc": true, 23 | "compilerOptions": { 24 | "moduleResolution": "Node" 25 | } 26 | } 27 | } --------------------------------------------------------------------------------