Skip to content

Commit

Permalink
ci
Browse files Browse the repository at this point in the history
  • Loading branch information
HendrixString committed Aug 31, 2023
1 parent 20b12c9 commit f5be06e
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 6 deletions.
78 changes: 78 additions & 0 deletions .github/workflows/compile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: compile
on:
pull_request:
push:
branches:
- master

jobs:
ubuntu_build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install dependencies(Ubuntu)
run: |
sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu `lsb_release -sc` main universe restricted multiverse" -y
sudo apt-get install libsdl2-dev -y
sudo apt-get install gcc cmake -y
- name: Build & Install(Ubuntu)
run: |
sudo mkdir cmake-build-release
cd cmake-build-release
sudo cmake -DCMAKE_BUILD_TYPE=Release ..
sudo cmake --install .
- name: Build all examples(Ubuntu)
run: |
cd cmake-build-release
sudo cmake -DCMAKE_BUILD_TYPE=Release ..
sudo cmake --build .
windows_build:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install dependencies(Windows)
shell: powershell
run: |
vcpkg install sdl2:x64-windows
vcpkg integrate install
- name: Build & Install(Windows)
shell: powershell
run: |
mkdir cmake-build-release
cd cmake-build-release
cmake -DCMAKE_BUILD_TYPE=Release .. -DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake
cmake --install .
- name: Build all examples(Windows)
shell: powershell
run: |
cd cmake-build-release
cmake -DCMAKE_BUILD_TYPE=Release .. -DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake
cmake --build .
macos_build:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install dependencies(MacOS)
run: |
brew install cmake sdl2
- name: Build & Install(MacOS)
run: |
sudo mkdir cmake-build-release
cd cmake-build-release
sudo cmake -DCMAKE_BUILD_TYPE=Release ..
sudo cmake --install .
- name: Build all examples(MacOS)
run: |
cd cmake-build-release
sudo cmake -DCMAKE_BUILD_TYPE=Release ..
sudo cmake --build .
6 changes: 3 additions & 3 deletions include/micro-tess/bezier_patch_tesselator.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ namespace microtess {

if(flag_output_points) {
// calculate the point on the surface
number1 p[channels];
number1 p[3];
// compile time branching
if(type==patch_type::BI_QUADRATIC)
evaluateBiQuadraticSurface(u,v, meshPoints, channels, p);
Expand Down Expand Up @@ -146,7 +146,7 @@ namespace microtess {
const number1 *meshPoints,
unsigned int channels,
number1 * result) {
number1 temp[4][channels];
number1 temp[4][3];

// 3rd degree bernstein polynomials coefficients
// the t value inverted
Expand Down Expand Up @@ -200,7 +200,7 @@ namespace microtess {
const number1 *meshPoints,
unsigned int channels,
float * result) {
number1 temp[3][channels];
number1 temp[3][3];

// 2rd degree bernstein polynomials coefficients
// the t value inverted
Expand Down
2 changes: 1 addition & 1 deletion include/micro-tess/math.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ namespace microtess {
int ix = 0;
number x = val, y = number(1);
if(val==number(0)) return val;
while ((abs<number>(x - y) > epsilon) and (ix++<10)) {
while ((abs<number>(x - y) > epsilon) && (ix++<10)) {
x = (x + y) / 2;
y = val / x;
}
Expand Down
6 changes: 4 additions & 2 deletions include/micro-tess/stroke_tessellation.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,13 @@ namespace microtess {
container_output_boundary *boundary_buffer= nullptr) {
int offset=stroke_dash_offset, sum_dashes=0;
index dash_arr_length=stroke_dash_array.size()*2;
int dash_array[dash_arr_length];
// int dash_array[dash_arr_length];
int dash_array[50];
{ // copy to an even array
int ix=0;
for (auto& dash : stroke_dash_array) {
dash_array[ix]=dash_array[ix+stroke_dash_array.size()]=dash;
dash_array[ix]=dash;
dash_array[ix+stroke_dash_array.size()]=dash;
ix++;
}
}
Expand Down

0 comments on commit f5be06e

Please sign in to comment.