Skip to content

Commit e368ce5

Browse files
committed
Initial
0 parents  commit e368ce5

19 files changed

+1157
-0
lines changed

.clang-format

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
---
2+
Language: Cpp
3+
BasedOnStyle: LLVM
4+
AccessModifierOffset: 0
5+
AlignAfterOpenBracket: Align
6+
AlignConsecutiveAssignments: true
7+
AlignConsecutiveDeclarations: false
8+
AlignEscapedNewlines: DontAlign
9+
AlignOperands: false
10+
AlignTrailingComments: true
11+
AllowAllParametersOfDeclarationOnNextLine: false
12+
AllowShortBlocksOnASingleLine: false
13+
AllowShortCaseLabelsOnASingleLine: false
14+
AllowShortFunctionsOnASingleLine: Empty
15+
AllowShortIfStatementsOnASingleLine: false
16+
AllowShortLoopsOnASingleLine: false
17+
AlwaysBreakAfterDefinitionReturnType: None
18+
AlwaysBreakAfterReturnType: None
19+
AlwaysBreakBeforeMultilineStrings: true
20+
AlwaysBreakTemplateDeclarations: MultiLine
21+
BinPackArguments: false
22+
BinPackParameters: false
23+
BraceWrapping:
24+
AfterClass: true
25+
AfterControlStatement: true
26+
AfterEnum: true
27+
AfterFunction: true
28+
AfterNamespace: true
29+
AfterObjCDeclaration: true
30+
AfterStruct: true
31+
AfterUnion: true
32+
AfterExternBlock: true
33+
BeforeCatch: true
34+
BeforeElse: true
35+
IndentBraces: false
36+
SplitEmptyFunction: true
37+
SplitEmptyRecord: true
38+
SplitEmptyNamespace: true
39+
BreakBeforeBinaryOperators: None
40+
BreakBeforeBraces: Custom
41+
BreakBeforeInheritanceComma: false
42+
BreakInheritanceList: BeforeComma
43+
BreakBeforeTernaryOperators: false
44+
BreakConstructorInitializersBeforeComma: true
45+
BreakConstructorInitializers: BeforeComma
46+
BreakAfterJavaFieldAnnotations: false
47+
BreakStringLiterals: true
48+
ColumnLimit: 0
49+
CommentPragmas: '^ IWYU pragma:'
50+
CompactNamespaces: false
51+
ConstructorInitializerAllOnOneLineOrOnePerLine: false
52+
ConstructorInitializerIndentWidth: 4
53+
ContinuationIndentWidth: 0
54+
Cpp11BracedListStyle: false
55+
DerivePointerAlignment: false
56+
DisableFormat: false
57+
ExperimentalAutoDetectBinPacking: false
58+
FixNamespaceComments: true
59+
ForEachMacros:
60+
- foreach
61+
- Q_FOREACH
62+
- BOOST_FOREACH
63+
IncludeBlocks: Preserve
64+
IncludeCategories:
65+
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
66+
Priority: 2
67+
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
68+
Priority: 3
69+
- Regex: '.*'
70+
Priority: 1
71+
IncludeIsMainRegex: '(Test)?$'
72+
IndentCaseLabels: true
73+
IndentPPDirectives: None
74+
IndentWidth: 4
75+
IndentWrappedFunctionNames: false
76+
JavaScriptQuotes: Leave
77+
JavaScriptWrapImports: true
78+
KeepEmptyLinesAtTheStartOfBlocks: false
79+
MacroBlockBegin: ''
80+
MacroBlockEnd: ''
81+
MaxEmptyLinesToKeep: 1
82+
NamespaceIndentation: All
83+
ObjCBinPackProtocolList: Auto
84+
ObjCBlockIndentWidth: 2
85+
ObjCSpaceAfterProperty: false
86+
ObjCSpaceBeforeProtocolList: true
87+
PenaltyBreakAssignment: 2
88+
PenaltyBreakBeforeFirstCallParameter: 19
89+
PenaltyBreakComment: 300
90+
PenaltyBreakFirstLessLess: 120
91+
PenaltyBreakString: 1000
92+
PenaltyBreakTemplateDeclaration: 10
93+
PenaltyExcessCharacter: 1000000
94+
PenaltyReturnTypeOnItsOwnLine: 60
95+
PointerAlignment: Left
96+
ReflowComments: true
97+
SortIncludes: false
98+
SortUsingDeclarations: false
99+
SpaceAfterCStyleCast: false
100+
SpaceAfterTemplateKeyword: true
101+
SpaceBeforeAssignmentOperators: true
102+
SpaceBeforeCpp11BracedList: true
103+
SpaceBeforeCtorInitializerColon: true
104+
SpaceBeforeInheritanceColon: true
105+
SpaceBeforeParens: ControlStatements
106+
SpaceBeforeRangeBasedForLoopColon: true
107+
SpaceInEmptyParentheses: false
108+
SpacesBeforeTrailingComments: 1
109+
SpacesInAngles: false
110+
SpacesInContainerLiterals: true
111+
SpacesInCStyleCastParentheses: false
112+
SpacesInParentheses: false
113+
SpacesInSquareBrackets: false
114+
Standard: Cpp11
115+
StatementMacros:
116+
- Q_UNUSED
117+
- QT_REQUIRE_VERSION
118+
TabWidth: 4
119+
UseTab: Never
120+
...
121+

.cursorrules

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
It's a native extension for the Defold game engine. It uses Lua 5.1 as its scripting language with "bit" module for bitwise operations. 4 spaces for indentation. "snake_case" for variable, function, file, folder names. It uses LDoc for documentation.
2+
3+
The example of LDoc is:
4+
5+
```lua
6+
--- Summary ends with a period.
7+
-- Some description, can be over several lines.
8+
-- @tparam string p1 first parameter
9+
-- @tparam[opt] string p2 second parameter (optional)
10+
-- @treturn number a number value
11+
-- @see second_fun
12+
function mod1.first_fun(p1,p2)
13+
end
14+
```
15+
16+
The structure of the project is the following:
17+
- folder "simplex_noise" contains the C/C++ part of the extension.
18+
- folder "example" contains the example project written in Lua for the extension.

.gitattributes

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Defold Protocol Buffer Text Files (https://github.com/github/linguist/issues/5091)
2+
*.animationset linguist-language=JSON5
3+
*.atlas linguist-language=JSON5
4+
*.camera linguist-language=JSON5
5+
*.collection linguist-language=JSON5
6+
*.collectionfactory linguist-language=JSON5
7+
*.collectionproxy linguist-language=JSON5
8+
*.collisionobject linguist-language=JSON5
9+
*.cubemap linguist-language=JSON5
10+
*.display_profiles linguist-language=JSON5
11+
*.factory linguist-language=JSON5
12+
*.font linguist-language=JSON5
13+
*.gamepads linguist-language=JSON5
14+
*.go linguist-language=JSON5
15+
*.gui linguist-language=JSON5
16+
*.input_binding linguist-language=JSON5
17+
*.label linguist-language=JSON5
18+
*.material linguist-language=JSON5
19+
*.mesh linguist-language=JSON5
20+
*.model linguist-language=JSON5
21+
*.particlefx linguist-language=JSON5
22+
*.render linguist-language=JSON5
23+
*.sound linguist-language=JSON5
24+
*.sprite linguist-language=JSON5
25+
*.spinemodel linguist-language=JSON5
26+
*.spinescene linguist-language=JSON5
27+
*.texture_profiles linguist-language=JSON5
28+
*.tilemap linguist-language=JSON5
29+
*.tilesource linguist-language=JSON5
30+
31+
# Defold JSON Files
32+
*.buffer linguist-language=JSON
33+
34+
# Defold GLSL Shaders
35+
*.fp linguist-language=GLSL
36+
*.vp linguist-language=GLSL
37+
38+
# Defold Lua Files
39+
*.editor_script linguist-language=Lua
40+
*.render_script linguist-language=Lua
41+
*.script linguist-language=Lua
42+
*.gui_script linguist-language=Lua
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Screenshots**
24+
If applicable, add screenshots to help explain your problem.
25+
26+
**Desktop (please complete the following information):**
27+
- OS: [e.g. iOS]
28+
- Browser [e.g. chrome, safari]
29+
- Version [e.g. 22]
30+
31+
**Smartphone (please complete the following information):**
32+
- Device: [e.g. iPhone6]
33+
- OS: [e.g. iOS8.1]
34+
- Browser [e.g. stock browser, safari]
35+
- Version [e.g. 22]
36+
37+
**Additional context**
38+
Add any other context about the problem here.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

.github/workflows/main.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Build example
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
pull_request:
9+
10+
jobs:
11+
build-and-deploy:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout 🛎️
15+
uses: actions/checkout@v4
16+
17+
- name: Install Java ♨️
18+
uses: actions/setup-java@v4
19+
with:
20+
distribution: "temurin"
21+
java-version: "21"
22+
23+
- name: Build 🔧
24+
env:
25+
DEFOLD_BOB_SHA1: ${{ secrets.DEFOLD_BOB_SHA1 }}
26+
run: |
27+
lsb_release -a
28+
29+
mkdir -p build/bundle
30+
31+
# Download the latest bob.jar
32+
BOB_SHA1=${DEFOLD_BOB_SHA1:-$(curl -s 'https://d.defold.com/stable/info.json' | jq -r .sha1)}
33+
BOB_LOCAL_SHA1=$((java -jar build/bundle/bob.jar --version | cut -d' ' -f6) || true)
34+
if [ "${BOB_LOCAL_SHA1}" != "${BOB_SHA1}" ]; then wget --progress=dot:mega -O build/bundle/bob.jar "https://d.defold.com/archive/${BOB_SHA1}/bob/bob.jar"; fi
35+
java -jar build/bundle/bob.jar --version
36+
37+
# Build the project
38+
java -jar build/bundle/bob.jar --email a@b.com --auth 123 --texture-compression true --bundle-output build/bundle/js-web --platform js-web --architectures wasm-web --archive --variant debug resolve build bundle
39+
40+
# Move to the public directory
41+
mv build/bundle/js-web/* build/bundle/public
42+
43+
- name: Upload Artifact 📦
44+
uses: actions/upload-artifact@v4
45+
with:
46+
name: bundle
47+
path: build/bundle/public
48+
49+
# - name: Deploy to Pages 🚀
50+
# uses: JamesIves/github-pages-deploy-action@v4
51+
# with:
52+
# branch: gh-pages
53+
# folder: build/bundle/public
54+
# if: github.ref == 'refs/heads/main'

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/.editor_settings
2+
/.internal
3+
/build
4+
.externalToolBuilders
5+
.DS_Store
6+
Thumbs.db
7+
.lock-wscript
8+
*.pyc
9+
.project
10+
.cproject
11+
builtins

LICENSE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Indiesoft LLC
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)