diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..95644f6 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,23 @@ +on: + push: + branches: + - master + pull_request: + types: + - opened + - synchronize + +jobs: + tests: + name: tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: laytan/setup-odin@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + - name: Test + shell: bash + run: odin test anima -vet diff --git a/anima/anima.odin b/anima/anima.odin index dd4308d..553cf5a 100644 --- a/anima/anima.odin +++ b/anima/anima.odin @@ -1,6 +1,5 @@ package anima -import "core:fmt" import "core:strconv" import "core:strings" @@ -22,19 +21,17 @@ new_grid :: proc( top: uint = 0, border: uint = 0, ) -> Grid { - return( - { - frame_width, - frame_height, - image_width, - image_height, - left, - top, - image_width / frame_width, - image_height / frame_height, - border, - } \ - ) + return { + frame_width, + frame_height, + image_width, + image_height, + left, + top, + image_width / frame_width, + image_height / frame_height, + border, + } } Interval :: struct { @@ -99,11 +96,6 @@ grid_frames :: proc(grid: ^Grid, intervals: ..IntervalT) -> []FrameRect { column := parse_interval(intervals[i]) row := parse_interval(intervals[i + 1]) - c_start := int(column.from) - c_end := int(column.to) - r_start := int(row.from) - r_end := int(row.to) - cond := proc(index: int, interval: Interval) -> bool { if interval.forward { return index <= int(interval.to)