Compare commits
59 commits
Author | SHA1 | Date | |
---|---|---|---|
John Alanbrook | e1bfdecc42 | ||
John Alanbrook | c8b097febb | ||
John Alanbrook | 7c324c1b33 | ||
John Alanbrook | c89f28dcec | ||
John Alanbrook | db0c0cbc7a | ||
John Alanbrook | 90eba900e3 | ||
John Alanbrook | f823e6b839 | ||
John Alanbrook | 27d7c5ab02 | ||
John Alanbrook | 12bb5e084a | ||
John Alanbrook | 151891f50f | ||
John Alanbrook | 83a19eec27 | ||
John Alanbrook | f1b2984f61 | ||
John Alanbrook | 14deabf2dd | ||
John Alanbrook | 91ffcf998b | ||
John Alanbrook | b92220713f | ||
John Alanbrook | 2a1a5231aa | ||
John Alanbrook | 7f6996d93f | ||
John Alanbrook | 39511e0d3b | ||
John Alanbrook | 8465fb53f7 | ||
John Alanbrook | f928f3e8a2 | ||
John Alanbrook | a8ce3106e1 | ||
John Alanbrook | 179e883d0e | ||
John Alanbrook | 0ffef3b602 | ||
John Alanbrook | 45bc8a8bb4 | ||
John Alanbrook | 26b42a6747 | ||
John Alanbrook | 5eac1d03e9 | ||
John Alanbrook | 5149b9986f | ||
John Alanbrook | a540e14cae | ||
John Alanbrook | fa824aec3a | ||
John Alanbrook | ca6c21ebb8 | ||
John Alanbrook | dbaf482385 | ||
John Alanbrook | 9e6462bff4 | ||
John Alanbrook | cbd66e5304 | ||
John Alanbrook | 93cda3848b | ||
John Alanbrook | 6456590492 | ||
John Alanbrook | 3717e84fe7 | ||
John Alanbrook | b3b3aa9803 | ||
John Alanbrook | a476562a9e | ||
John Alanbrook | 6b94349a64 | ||
John Alanbrook | 9bbe880466 | ||
John Alanbrook | f47be2d30c | ||
John Alanbrook | 4756955c1a | ||
John Alanbrook | 6f9137746a | ||
John Alanbrook | f35c77c4a9 | ||
John Alanbrook | f95249f147 | ||
John Alanbrook | 1e4a142030 | ||
John Alanbrook | dad588639e | ||
John Alanbrook | ad1bcd45c7 | ||
John Alanbrook | 0666f4d949 | ||
John Alanbrook | d62a1ca0db | ||
John Alanbrook | af6824e6db | ||
John Alanbrook | f82c54d3b2 | ||
John Alanbrook | bcad975c71 | ||
John Alanbrook | 76036b30b5 | ||
John Alanbrook | b77281b311 | ||
John Alanbrook | 00fa902e1f | ||
John Alanbrook | 2e1c2608b1 | ||
John Alanbrook | e7a3a8597b | ||
John Alanbrook | 52b72931fc |
222
.clang-format
|
@ -1,217 +1,9 @@
|
||||||
---
|
BasedOnStyle: GNU
|
||||||
Language: Cpp
|
|
||||||
# BasedOnStyle: LLVM
|
|
||||||
AccessModifierOffset: -2
|
|
||||||
AlignAfterOpenBracket: Align
|
|
||||||
AlignArrayOfStructures: None
|
|
||||||
AlignConsecutiveAssignments:
|
|
||||||
Enabled: false
|
|
||||||
AcrossEmptyLines: false
|
|
||||||
AcrossComments: false
|
|
||||||
AlignCompound: false
|
|
||||||
PadOperators: true
|
|
||||||
AlignConsecutiveBitFields:
|
|
||||||
Enabled: false
|
|
||||||
AcrossEmptyLines: false
|
|
||||||
AcrossComments: false
|
|
||||||
AlignCompound: false
|
|
||||||
PadOperators: false
|
|
||||||
AlignConsecutiveDeclarations:
|
|
||||||
Enabled: false
|
|
||||||
AcrossEmptyLines: false
|
|
||||||
AcrossComments: false
|
|
||||||
AlignCompound: false
|
|
||||||
PadOperators: false
|
|
||||||
AlignConsecutiveMacros:
|
|
||||||
Enabled: false
|
|
||||||
AcrossEmptyLines: false
|
|
||||||
AcrossComments: false
|
|
||||||
AlignCompound: false
|
|
||||||
PadOperators: false
|
|
||||||
AlignEscapedNewlines: Right
|
|
||||||
AlignOperands: Align
|
|
||||||
AlignTrailingComments: true
|
|
||||||
AllowAllArgumentsOnNextLine: true
|
|
||||||
AllowAllParametersOfDeclarationOnNextLine: true
|
|
||||||
AllowShortEnumsOnASingleLine: true
|
|
||||||
AllowShortBlocksOnASingleLine: Never
|
|
||||||
AllowShortCaseLabelsOnASingleLine: false
|
|
||||||
AllowShortFunctionsOnASingleLine: All
|
|
||||||
AllowShortLambdasOnASingleLine: All
|
|
||||||
AllowShortIfStatementsOnASingleLine: AllIfsAndElse
|
|
||||||
AllowShortLoopsOnASingleLine: false
|
|
||||||
AlwaysBreakAfterDefinitionReturnType: None
|
|
||||||
AlwaysBreakAfterReturnType: None
|
|
||||||
AlwaysBreakBeforeMultilineStrings: false
|
|
||||||
AlwaysBreakTemplateDeclarations: MultiLine
|
|
||||||
AttributeMacros:
|
|
||||||
- __capability
|
|
||||||
BinPackArguments: true
|
|
||||||
BinPackParameters: true
|
|
||||||
BraceWrapping:
|
|
||||||
AfterCaseLabel: false
|
|
||||||
AfterClass: false
|
|
||||||
AfterControlStatement: Never
|
|
||||||
AfterEnum: false
|
|
||||||
AfterFunction: false
|
|
||||||
AfterNamespace: false
|
|
||||||
AfterObjCDeclaration: false
|
|
||||||
AfterStruct: false
|
|
||||||
AfterUnion: false
|
|
||||||
AfterExternBlock: false
|
|
||||||
BeforeCatch: false
|
|
||||||
BeforeElse: false
|
|
||||||
BeforeLambdaBody: false
|
|
||||||
BeforeWhile: false
|
|
||||||
IndentBraces: false
|
|
||||||
SplitEmptyFunction: true
|
|
||||||
SplitEmptyRecord: true
|
|
||||||
SplitEmptyNamespace: true
|
|
||||||
BreakBeforeBinaryOperators: None
|
|
||||||
BreakBeforeConceptDeclarations: Always
|
|
||||||
BreakBeforeBraces: Attach
|
|
||||||
BreakBeforeInheritanceComma: false
|
|
||||||
BreakInheritanceList: BeforeColon
|
|
||||||
BreakBeforeTernaryOperators: true
|
|
||||||
BreakConstructorInitializersBeforeComma: false
|
|
||||||
BreakConstructorInitializers: BeforeColon
|
|
||||||
BreakAfterJavaFieldAnnotations: false
|
|
||||||
BreakStringLiterals: true
|
|
||||||
ColumnLimit: 0
|
|
||||||
CommentPragmas: '^ IWYU pragma:'
|
|
||||||
QualifierAlignment: Leave
|
|
||||||
CompactNamespaces: false
|
|
||||||
ConstructorInitializerIndentWidth: 4
|
|
||||||
ContinuationIndentWidth: 4
|
|
||||||
Cpp11BracedListStyle: true
|
|
||||||
DeriveLineEnding: true
|
|
||||||
DerivePointerAlignment: false
|
|
||||||
DisableFormat: false
|
|
||||||
EmptyLineAfterAccessModifier: Never
|
|
||||||
EmptyLineBeforeAccessModifier: LogicalBlock
|
|
||||||
ExperimentalAutoDetectBinPacking: false
|
|
||||||
PackConstructorInitializers: BinPack
|
|
||||||
BasedOnStyle: ''
|
|
||||||
ConstructorInitializerAllOnOneLineOrOnePerLine: false
|
|
||||||
AllowAllConstructorInitializersOnNextLine: true
|
|
||||||
FixNamespaceComments: true
|
|
||||||
ForEachMacros:
|
|
||||||
- foreach
|
|
||||||
- Q_FOREACH
|
|
||||||
- BOOST_FOREACH
|
|
||||||
IfMacros:
|
|
||||||
- KJ_IF_MAYBE
|
|
||||||
IncludeBlocks: Preserve
|
|
||||||
IncludeCategories:
|
|
||||||
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
|
|
||||||
Priority: 2
|
|
||||||
SortPriority: 0
|
|
||||||
CaseSensitive: false
|
|
||||||
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
|
|
||||||
Priority: 3
|
|
||||||
SortPriority: 0
|
|
||||||
CaseSensitive: false
|
|
||||||
- Regex: '.*'
|
|
||||||
Priority: 1
|
|
||||||
SortPriority: 0
|
|
||||||
CaseSensitive: false
|
|
||||||
IncludeIsMainRegex: '(Test)?$'
|
|
||||||
IncludeIsMainSourceRegex: ''
|
|
||||||
IndentAccessModifiers: false
|
|
||||||
IndentCaseLabels: false
|
|
||||||
IndentCaseBlocks: false
|
|
||||||
IndentGotoLabels: true
|
|
||||||
IndentPPDirectives: None
|
|
||||||
IndentExternBlock: AfterExternBlock
|
|
||||||
IndentRequiresClause: true
|
|
||||||
IndentWidth: 2
|
IndentWidth: 2
|
||||||
IndentWrappedFunctionNames: false
|
TabWidth: 2
|
||||||
InsertBraces: false
|
|
||||||
InsertTrailingCommas: None
|
|
||||||
JavaScriptQuotes: Leave
|
|
||||||
JavaScriptWrapImports: true
|
|
||||||
KeepEmptyLinesAtTheStartOfBlocks: true
|
|
||||||
LambdaBodyIndentation: Signature
|
|
||||||
MacroBlockBegin: ''
|
|
||||||
MacroBlockEnd: ''
|
|
||||||
MaxEmptyLinesToKeep: 1
|
|
||||||
NamespaceIndentation: None
|
|
||||||
ObjCBinPackProtocolList: Auto
|
|
||||||
ObjCBlockIndentWidth: 2
|
|
||||||
ObjCBreakBeforeNestedBlockParam: true
|
|
||||||
ObjCSpaceAfterProperty: false
|
|
||||||
ObjCSpaceBeforeProtocolList: true
|
|
||||||
PenaltyBreakAssignment: 2
|
|
||||||
PenaltyBreakBeforeFirstCallParameter: 19
|
|
||||||
PenaltyBreakComment: 300
|
|
||||||
PenaltyBreakFirstLessLess: 120
|
|
||||||
PenaltyBreakOpenParenthesis: 0
|
|
||||||
PenaltyBreakString: 1000
|
|
||||||
PenaltyBreakTemplateDeclaration: 10
|
|
||||||
PenaltyExcessCharacter: 1000000
|
|
||||||
PenaltyReturnTypeOnItsOwnLine: 60
|
|
||||||
PenaltyIndentedWhitespace: 0
|
|
||||||
PointerAlignment: Right
|
|
||||||
PPIndentWidth: -1
|
|
||||||
ReferenceAlignment: Pointer
|
|
||||||
ReflowComments: true
|
|
||||||
RemoveBracesLLVM: false
|
|
||||||
RequiresClausePosition: OwnLine
|
|
||||||
SeparateDefinitionBlocks: Leave
|
|
||||||
ShortNamespaceLines: 1
|
|
||||||
SortIncludes: CaseSensitive
|
|
||||||
SortJavaStaticImport: Before
|
|
||||||
SortUsingDeclarations: true
|
|
||||||
SpaceAfterCStyleCast: false
|
|
||||||
SpaceAfterLogicalNot: false
|
|
||||||
SpaceAfterTemplateKeyword: true
|
|
||||||
SpaceBeforeAssignmentOperators: true
|
|
||||||
SpaceBeforeCaseColon: false
|
|
||||||
SpaceBeforeCpp11BracedList: false
|
|
||||||
SpaceBeforeCtorInitializerColon: true
|
|
||||||
SpaceBeforeInheritanceColon: true
|
|
||||||
SpaceBeforeParens: ControlStatements
|
|
||||||
SpaceBeforeParensOptions:
|
|
||||||
AfterControlStatements: true
|
|
||||||
AfterForeachMacros: true
|
|
||||||
AfterFunctionDefinitionName: false
|
|
||||||
AfterFunctionDeclarationName: false
|
|
||||||
AfterIfMacros: true
|
|
||||||
AfterOverloadedOperator: false
|
|
||||||
AfterRequiresInClause: false
|
|
||||||
AfterRequiresInExpression: false
|
|
||||||
BeforeNonEmptyParentheses: false
|
|
||||||
SpaceAroundPointerQualifiers: Default
|
|
||||||
SpaceBeforeRangeBasedForLoopColon: true
|
|
||||||
SpaceInEmptyBlock: false
|
|
||||||
SpaceInEmptyParentheses: false
|
|
||||||
SpacesBeforeTrailingComments: 1
|
|
||||||
SpacesInAngles: Never
|
|
||||||
SpacesInConditionalStatement: false
|
|
||||||
SpacesInContainerLiterals: true
|
|
||||||
SpacesInCStyleCastParentheses: false
|
|
||||||
SpacesInLineCommentPrefix:
|
|
||||||
Minimum: 1
|
|
||||||
Maximum: -1
|
|
||||||
SpacesInParentheses: false
|
|
||||||
SpacesInSquareBrackets: false
|
|
||||||
SpaceBeforeSquareBrackets: false
|
|
||||||
BitFieldColonSpacing: Both
|
|
||||||
Standard: Latest
|
|
||||||
StatementAttributeLikeMacros:
|
|
||||||
- Q_EMIT
|
|
||||||
StatementMacros:
|
|
||||||
- Q_UNUSED
|
|
||||||
- QT_REQUIRE_VERSION
|
|
||||||
TabWidth: 8
|
|
||||||
UseCRLF: false
|
|
||||||
UseTab: Never
|
UseTab: Never
|
||||||
WhitespaceSensitiveMacros:
|
ContinuationIndentWidth: 2 # Indents continuation lines by 2 spaces
|
||||||
- STRINGIZE
|
AllowShortFunctionsOnASingleLine: true
|
||||||
- PP_STRINGIZE
|
AllowShortBlocksOnASingleLine: true
|
||||||
- BOOST_PP_STRINGIZE
|
AllowShortIfStatementsOnASingleLine: true
|
||||||
- NS_SWIFT_NAME
|
BreakBeforeBraces: Attach
|
||||||
- CF_SWIFT_NAME
|
|
||||||
IndentWidth: 2
|
|
||||||
...
|
|
||||||
|
|
||||||
|
|
4
.prettierignore
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
**/*.html
|
||||||
|
**/*.json
|
||||||
|
**/*.css
|
||||||
|
**/*.md
|
21
.prettierrc
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
{
|
||||||
|
"arrowParens": "avoid",
|
||||||
|
"bracketSameLine": false,
|
||||||
|
"bracketSpacing": true,
|
||||||
|
"semi": true,
|
||||||
|
"experimentalTernaries": false,
|
||||||
|
"singleQuote": false,
|
||||||
|
"jsxSingleQuote": false,
|
||||||
|
"quoteProps": "as-needed",
|
||||||
|
"trailingComma": "all",
|
||||||
|
"singleAttributePerLine": false,
|
||||||
|
"htmlWhitespaceSensitivity": "css",
|
||||||
|
"vueIndentScriptAndStyle": false,
|
||||||
|
"proseWrap": "preserve",
|
||||||
|
"insertPragma": false,
|
||||||
|
"printWidth": 1000,
|
||||||
|
"requirePragma": false,
|
||||||
|
"tabWidth": 2,
|
||||||
|
"useTabs": false,
|
||||||
|
"embeddedLanguageFormatting": "auto"
|
||||||
|
}
|
303
Makefile
|
@ -1,296 +1,13 @@
|
||||||
PROCS != nproc --all
|
debug: FORCE
|
||||||
MAKEFLAGS = -j $(PROCS)
|
meson setup build_dbg -Dbuildtype=debugoptimized
|
||||||
UNAME != uname
|
meson compile -C build_dbg
|
||||||
MAKEDIR != pwd
|
|
||||||
# Options
|
|
||||||
# NDEBUG --- build with debugging symbols and logging
|
|
||||||
|
|
||||||
ifeq ($(ARCH),)
|
release: FORCE
|
||||||
ARCH != uname -m
|
meson setup -Dbuildtype=release -Db_lto=true -Db_lto_threads=4 -Db_ndebug=true -Db_pgo=use build_release
|
||||||
endif
|
meson compile -C build_release
|
||||||
|
|
||||||
CXX:=$(CC)
|
sanitize: FORCE
|
||||||
|
meson setup -Db_sanitize=address -Db_sanitize=memory -Db_sanitize=leak -Db_sanitize=undefined build_sani
|
||||||
|
meson compile -C build_sani
|
||||||
|
|
||||||
OPT ?= 0
|
FORCE:
|
||||||
LD = $(CC)
|
|
||||||
|
|
||||||
STEAM = steam/sdk
|
|
||||||
STEAMAPI =
|
|
||||||
|
|
||||||
LDFLAGS += -lstdc++
|
|
||||||
|
|
||||||
ifeq ($(CROSS)$(CC), emcc)
|
|
||||||
LDFLAGS += --shell-file shell.html --closure 1
|
|
||||||
CPPFLAGS += -Wbad-function-cast -Wcast-function-type -sSTACK_SIZE=1MB -sALLOW_MEMORY_GROWTH -sINITIAL_MEMORY=128MB
|
|
||||||
NDEBUG = 1
|
|
||||||
ARCH:= wasm
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef NEDITOR
|
|
||||||
CPPFLAGS += -DNO_EDITOR
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef NFLAC
|
|
||||||
CPPFLAGS += -DNFLAC
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef NMP3
|
|
||||||
CPPFLAGS += -DNMP3
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef NSVG
|
|
||||||
CPPFLAGS += -DNSVG
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef NQOA
|
|
||||||
CPPFLAGS += -DNQOA
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef NDEBUG
|
|
||||||
CPPFLAGS += -DNDEBUG
|
|
||||||
else
|
|
||||||
CPPFLAGS += -g -DDUMP
|
|
||||||
INFO :=$(INFO)_dbg
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef NSTEAM
|
|
||||||
CPPFLAGS += -DNSTEAM
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef LEAK
|
|
||||||
CPPFLAGS += -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer -DLEAK
|
|
||||||
INFO := $(INFO)_leak
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(OPT),small)
|
|
||||||
CPPFLAGS += -Os -flto -fno-ident -fno-asynchronous-unwind-tables -ffunction-sections -fdata-sections
|
|
||||||
|
|
||||||
LDFLAGS += -flto
|
|
||||||
|
|
||||||
INFO :=$(INFO)_small
|
|
||||||
else ifeq ($(OPT), 1)
|
|
||||||
CPPFLAGS += -O3 -flto
|
|
||||||
INFO :=$(INFO)_opt
|
|
||||||
else
|
|
||||||
CPPFLAGS += -O2
|
|
||||||
endif
|
|
||||||
|
|
||||||
CPPFLAGS += -DHAVE_CEIL -DCP_USE_CGTYPES=0 -DCP_USE_DOUBLES=0 -DHAVE_FLOOR -DHAVE_FMOD -DHAVE_LRINT -DHAVE_LRINTF $(includeflag) $(WARNING_FLAGS) -I. -DVER=\"$(SEM)\" -DCOM=\"$(COM)\" -DDATE=\"$(DATE)\" -DINFO=\"$(INFO)\" -Wno-narrowing #-DENABLE_SINC_MEDIUM_CONVERTER -DENABLE_SINC_FAST_CONVERTER -DCP_COLLISION_TYPE_TYPE=uintptr_t -DCP_BITMASK_TYPE=uintptr_t
|
|
||||||
CPPFLAGS += -DCONFIG_VERSION=\"2024-02-14\" -DCONFIG_BIGNUM #for quickjs
|
|
||||||
|
|
||||||
# ENABLE_SINC_[BEST|FAST|MEDIUM]_CONVERTER
|
|
||||||
# default, fast and medium available in game at runtime; best available in editor
|
|
||||||
|
|
||||||
INFO := $(INFO)_$(ARCH)
|
|
||||||
|
|
||||||
ifeq ($(OS), Windows_NT) # then WINDOWS
|
|
||||||
PLATFORM := win64
|
|
||||||
DEPS += resource.o
|
|
||||||
STEAMAPI := steam_api64
|
|
||||||
LDFLAGS += -mwin32 -static
|
|
||||||
CPPFLAGS += -mwin32
|
|
||||||
LDLIBS += mingw32 kernel32 d3d11 user32 shell32 dxgi gdi32 ws2_32 ole32 winmm setupapi m pthread
|
|
||||||
INFO :=$(INFO)_win
|
|
||||||
EXT = .exe
|
|
||||||
else ifeq ($(OS), IOS)
|
|
||||||
CC = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
|
|
||||||
SDK = iphoneos
|
|
||||||
SDK_PATH = /Applications/Xcode.app/Contents/Developer/Platforms/$(SDK).platform/Developer/SDKs/$(SDK).sdk
|
|
||||||
CFLAGS += -isysroot $(SDK_PATH) -miphoneos-version-min=13.0
|
|
||||||
LDFLAGS += -isysroot $(SDK_PATH) -miphoneos-version-min=13.0
|
|
||||||
LDFLAGS += -framework Foundation -framework UIKit -framework AudioToolbox -framework Metal -framework MetalKit -framework AVFoundation
|
|
||||||
CXXFLAGS += -std=c++11
|
|
||||||
CFLAGS += -x objective-c -DIOS
|
|
||||||
INFO :=$(INFO)_ios
|
|
||||||
else ifeq ($(OS), wasm) # Then WEB
|
|
||||||
OS := Web
|
|
||||||
LDFLAGS += -sUSE_WEBGPU
|
|
||||||
CPPFLAGS += -DNSTEAM
|
|
||||||
LDLIBS += GL openal c m dl
|
|
||||||
STEAMAPI :=
|
|
||||||
EXT = .html
|
|
||||||
else
|
|
||||||
UNAME != uname -s
|
|
||||||
ifeq ($(UNAME), Linux) # then LINUX
|
|
||||||
OS := Linux
|
|
||||||
PLATFORM := linux64
|
|
||||||
LDFLAGS += -pthread -rdynamic
|
|
||||||
LDLIBS += pthread c m dl X11 Xi Xcursor EGL asound GL
|
|
||||||
INFO :=$(INFO)_linux
|
|
||||||
STEAMAPI := steam_api
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(UNAME), Darwin)
|
|
||||||
OS := macos
|
|
||||||
PLATFORM := osx
|
|
||||||
CPPFLAGS += -arch $(ARCH)
|
|
||||||
CFLAGS += -x objective-c
|
|
||||||
CXXFLAGS += -std=c++11
|
|
||||||
LDFLAGS += -framework Cocoa -framework QuartzCore -framework AudioToolbox -framework Metal -framework MetalKit
|
|
||||||
INFO :=$(INFO)_macos
|
|
||||||
STEAMAPI := steam_api
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef NSTEAM
|
|
||||||
STEAMAPI =
|
|
||||||
endif
|
|
||||||
|
|
||||||
# All other sources
|
|
||||||
OBJS != find source -type f -name '*.c' | grep -vE 'test|tool|example|fuzz|main' | grep -vE 'quickjs'
|
|
||||||
CPPOBJS != find source -type f -name '*.cpp' | grep -vE 'test|tool|example|fuzz|main'
|
|
||||||
OBJS += $(CPPOBJS)
|
|
||||||
OBJS += source/engine/yugine.c
|
|
||||||
OBJS += $(shell find source/engine -type f -name '*.m')
|
|
||||||
QUICKJS := source/engine/thirdparty/quickjs
|
|
||||||
OBJS += $(addprefix $(QUICKJS)/, libregexp.c quickjs.c libunicode.c cutils.c libbf.c)
|
|
||||||
OBJS := $(patsubst %.cpp, %$(INFO).o, $(OBJS))
|
|
||||||
OBJS := $(patsubst %.c, %$(INFO).o,$(OBJS))
|
|
||||||
OBJS := $(patsubst %.m, %$(INFO).o, $(OBJS))
|
|
||||||
|
|
||||||
engineincs != find source/engine -maxdepth 1 -type d
|
|
||||||
includeflag != find source -type d -name include
|
|
||||||
includeflag += $(engineincs) source/engine/thirdparty/sokol source/engine/thirdparty/stb source/engine/thirdparty/cgltf source/engine/thirdparty/TinySoundFont source/engine/thirdparty/dr_libs source/engine/thirdparty/imgui
|
|
||||||
includeflag += $(STEAM)/public
|
|
||||||
includeflag += source
|
|
||||||
includeflag := $(addprefix -I, $(includeflag))
|
|
||||||
|
|
||||||
WARNING_FLAGS = -Wno-incompatible-function-pointer-types -Wno-incompatible-pointer-types
|
|
||||||
|
|
||||||
# For vanilla compilation, remove _
|
|
||||||
ifeq ($(INFO),_)
|
|
||||||
INFO :=
|
|
||||||
endif
|
|
||||||
|
|
||||||
APP = prosperon
|
|
||||||
NAME = $(APP)$(INFO)$(EXT)
|
|
||||||
SEM != git describe --tags --abbrev=0
|
|
||||||
COM != git rev-parse --short HEAD
|
|
||||||
DATE != date +%s
|
|
||||||
|
|
||||||
LDLIBS += $(STEAMAPI)
|
|
||||||
LDLIBS := $(addprefix -l, $(LDLIBS))
|
|
||||||
LDPATHS := $(STEAM)/redistributable_bin/$(PLATFORM)
|
|
||||||
LDPATHS := $(addprefix -L, $(LDPATHS))
|
|
||||||
|
|
||||||
DEPENDS = $(OBJS:.o=.d)
|
|
||||||
|
|
||||||
ifndef VERBOSE
|
|
||||||
.SILENT:
|
|
||||||
endif
|
|
||||||
|
|
||||||
DEPFLAGS = -MT $(@:.d=.o) -MM -MG $< -o $@
|
|
||||||
|
|
||||||
%$(INFO).d: %.c
|
|
||||||
@echo Making deps $@
|
|
||||||
$(CROSS)$(CC) $(CPPFLAGS) $(DEPFLAGS)
|
|
||||||
|
|
||||||
%$(INFO).d: %.cpp
|
|
||||||
@echo Making deps $@
|
|
||||||
$(CROSS)$(CXX) $(CPPFLAGS) $(DEPFLAGS)
|
|
||||||
|
|
||||||
%$(INFO).d: %.m
|
|
||||||
@echo Making deps $@
|
|
||||||
$(CROSS)$(CC) $(CPPFLAGS) $(DEPFLAGS)
|
|
||||||
|
|
||||||
ifneq ($(MAKECMDGOALS), clean)
|
|
||||||
include $(DEPENDS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
.DEFAULT_GOAL := all
|
|
||||||
all: $(NAME)
|
|
||||||
cp -f $(NAME) $(APP)$(EXT)
|
|
||||||
|
|
||||||
$(APP): $(NAME)
|
|
||||||
cp -f $(NAME) $(APP)
|
|
||||||
|
|
||||||
$(NAME): $(OBJS) $(DEPS)
|
|
||||||
@echo Linking $(NAME)
|
|
||||||
$(CROSS)$(LD) $^ $(CPPFLAGS) $(LDFLAGS) -L. $(LDPATHS) $(LDLIBS) -o $@
|
|
||||||
@echo Finished build
|
|
||||||
|
|
||||||
%$(INFO).o: %.c
|
|
||||||
@echo Making C object $@
|
|
||||||
$(CROSS)$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@
|
|
||||||
|
|
||||||
%$(INFO).o: %.cpp
|
|
||||||
@echo Making C++ object $@
|
|
||||||
$(CROSS)$(CXX) $(CPPFLAGS) $(CXXFLAGS) -fpermissive -c $< -o $@
|
|
||||||
|
|
||||||
%$(INFO).o: %.m
|
|
||||||
@echo Making Objective-C object $@
|
|
||||||
$(CROSS)$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@
|
|
||||||
|
|
||||||
CORE != (ls icons/* fonts/* shaders/*.cg scripts/*.js*)
|
|
||||||
|
|
||||||
packer: tools/packer.c source/engine/miniz.c
|
|
||||||
@echo Making packer
|
|
||||||
$(CC) -O2 $^ -Isource/engine -o packer
|
|
||||||
|
|
||||||
core.cdb: packer $(CORE)
|
|
||||||
@echo Packing core.cdb
|
|
||||||
./packer $@ $(CORE)
|
|
||||||
|
|
||||||
core.cdb.h: core.cdb
|
|
||||||
@echo Making $@
|
|
||||||
xxd -i $< > $@
|
|
||||||
|
|
||||||
ICNSIZE = 16 32 128 256 512 1024
|
|
||||||
ICNNAME := $(addsuffix .png, $(ICNSIZE))
|
|
||||||
ICON = icons/moon.gif
|
|
||||||
icon.ico: $(ICON)
|
|
||||||
for i in $(ICNSIZE); do convert $^ -thumbnail $${i}x$${i} $${i}.png; done
|
|
||||||
convert $(ICNNAME) icon.ico
|
|
||||||
rm $(ICNNAME)
|
|
||||||
|
|
||||||
resource.o: resource.rc resource.manifest icon.ico
|
|
||||||
$(CROSS)windres -i $< -o $@
|
|
||||||
|
|
||||||
crossios:
|
|
||||||
make OS=IOS ARCH=arm64 DEBUG=$(DEBUG) OPT=$(OPT)
|
|
||||||
|
|
||||||
Prosperon.icns: $(ICON)
|
|
||||||
mkdir -p Prosperon.iconset
|
|
||||||
for i in $(ICNSIZE); do magick $^ -size $${i}x$${i} Prosperon.iconset/icon_$${i}x$${i}.png; done
|
|
||||||
iconutil -c icns Prosperon.iconset
|
|
||||||
|
|
||||||
crossmac: Prosperon.icns
|
|
||||||
make ARCH=arm64 DEBUG=$(DEBUG) OPT=$(OPT)
|
|
||||||
mv $(APP) mac_arm64
|
|
||||||
make ARCH=x86_64 DEBUG=$(DEBUG) OPT=$(OPT)
|
|
||||||
mv $(APP) mac_x86_64
|
|
||||||
lipo mac_arm64 mac_x86_64 -create -output $(APP)_mac
|
|
||||||
rm mac_arm64 mac_x86_64
|
|
||||||
rm -rf Prosperon.app
|
|
||||||
mkdir Prosperon.app
|
|
||||||
mkdir Prosperon.app/Contents
|
|
||||||
mkdir Prosperon.app/Contents/MacOS
|
|
||||||
mkdir Prosperon.app/Contents/Resources
|
|
||||||
mv $(NAME) Prosperon.app/Contents/MacOS/Prosperon
|
|
||||||
cp Info.plist Prosperon.app/Contents
|
|
||||||
cp Prosperon.icns Prosperon.app/Contents/Resources
|
|
||||||
|
|
||||||
crosswin:
|
|
||||||
make CROSS=x86_64-w64-mingw32- OS=Windows_NT CC=gcc
|
|
||||||
|
|
||||||
crossweb:
|
|
||||||
make CC=emcc OS=wasm
|
|
||||||
mv $(APP).html index.html
|
|
||||||
|
|
||||||
clean:
|
|
||||||
@echo Cleaning project
|
|
||||||
rm -f core.cdb jso cdb packer TAGS source/engine/core.cdb.h tools/libcdb.a $(APP)* *.icns *.ico
|
|
||||||
find . -type f -name "*.[oad]" -delete
|
|
||||||
rm -rf Prosperon.app
|
|
||||||
|
|
||||||
docs: doc/prosperon.org
|
|
||||||
make -C doc
|
|
||||||
mv doc/html .
|
|
||||||
|
|
||||||
api: $(APP)
|
|
||||||
./prosperon run 'for (var i in globalThis) say(i)' | xargs -I {} ./prosperon api {} > docs/api/{}.md
|
|
||||||
|
|
||||||
TAGINC != find . -name "*.[chj]"
|
|
||||||
tags: $(TAGINC)
|
|
||||||
@echo Making tags.
|
|
||||||
@etags $(TAGINC)
|
|
||||||
|
|
|
@ -2,6 +2,12 @@
|
||||||
|
|
||||||
The easily moddable, programming minded, 2D-first game engine. The aim is to make the fastest way to make games.
|
The easily moddable, programming minded, 2D-first game engine. The aim is to make the fastest way to make games.
|
||||||
|
|
||||||
See the [documentation](doc/prosperon.org) for more information, including how to compile.
|
Using ...
|
||||||
|
* Sokol for rendering
|
||||||
|
* Chipmunk2D for physics
|
||||||
|
* imgui for easy editor UI
|
||||||
|
* Clay for game UI
|
||||||
|
|
||||||
|
Includes an implementation for Nota, and Kim.
|
||||||
|
|
||||||
*Prosperon is useful, but is a work in progress. Breaking changes are frequent.*
|
*Prosperon is useful, but is a work in progress. Breaking changes are frequent.*
|
||||||
|
|
173
docs/api/mum.md
|
@ -1,173 +0,0 @@
|
||||||
# Mum
|
|
||||||
#### padding
|
|
||||||
**array**
|
|
||||||
|
|
||||||
[
|
|
||||||
0,
|
|
||||||
0
|
|
||||||
]
|
|
||||||
|
|
||||||
#### offset
|
|
||||||
**array**
|
|
||||||
|
|
||||||
[
|
|
||||||
0,
|
|
||||||
0
|
|
||||||
]
|
|
||||||
|
|
||||||
#### font
|
|
||||||
**string**
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#### selectable
|
|
||||||
**boolean**
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#### selected
|
|
||||||
**boolean**
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#### font_size
|
|
||||||
**number**
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#### text_align
|
|
||||||
**string**
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#### scale
|
|
||||||
**number**
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#### angle
|
|
||||||
**number**
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#### anchor
|
|
||||||
**array**
|
|
||||||
|
|
||||||
[
|
|
||||||
0,
|
|
||||||
1
|
|
||||||
]
|
|
||||||
|
|
||||||
#### hovered
|
|
||||||
**object**
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#### text_shadow
|
|
||||||
**object**
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#### text_outline
|
|
||||||
**number**
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#### color
|
|
||||||
**array**
|
|
||||||
|
|
||||||
[
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
1
|
|
||||||
]
|
|
||||||
|
|
||||||
#### margin
|
|
||||||
**array**
|
|
||||||
|
|
||||||
[
|
|
||||||
0,
|
|
||||||
0
|
|
||||||
]
|
|
||||||
|
|
||||||
#### width
|
|
||||||
**number**
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#### height
|
|
||||||
**number**
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#### max_width
|
|
||||||
**number**
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#### max_height
|
|
||||||
**number**
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#### image_repeat
|
|
||||||
**boolean**
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#### image_repeat_offset
|
|
||||||
**array**
|
|
||||||
|
|
||||||
[
|
|
||||||
0,
|
|
||||||
0
|
|
||||||
]
|
|
||||||
|
|
||||||
#### debug
|
|
||||||
**boolean**
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#### make(def)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#### prestart()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#### start()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#### extend(def)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#### text(def)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#### button(def)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#### window(def)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#### image(def)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#### column(def)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#### debug_colors
|
|
||||||
**object**
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,15 +0,0 @@
|
||||||
# Tween
|
|
||||||
#### default
|
|
||||||
**object**
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#### start(obj, target, tvals, options)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#### make(obj, target, tvals, options)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
3
globcore.sh
Executable file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
ls icons/* fonts/* shaders/*.cg scripts/*.js*
|
BIN
icons/airplane.png
Normal file
After Width: | Height: | Size: 4.5 KiB |
BIN
icons/ak47.png
Normal file
After Width: | Height: | Size: 5.3 KiB |
BIN
icons/amputation.png
Normal file
After Width: | Height: | Size: 9.8 KiB |
BIN
icons/ant.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
icons/archer.png
Normal file
After Width: | Height: | Size: 9.7 KiB |
BIN
icons/armadillo.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
icons/atom.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
icons/banana.png
Normal file
After Width: | Height: | Size: 7.2 KiB |
BIN
icons/bank.png
Normal file
After Width: | Height: | Size: 4.8 KiB |
BIN
icons/banknote.png
Normal file
After Width: | Height: | Size: 5.1 KiB |
BIN
icons/barn.png
Normal file
After Width: | Height: | Size: 5.9 KiB |
BIN
icons/barrel.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
icons/basket.png
Normal file
After Width: | Height: | Size: 7.6 KiB |
BIN
icons/bat.png
Normal file
After Width: | Height: | Size: 4.2 KiB |
BIN
icons/bed.png
Normal file
After Width: | Height: | Size: 7.4 KiB |
BIN
icons/belt.png
Normal file
After Width: | Height: | Size: 5.2 KiB |
BIN
icons/boar.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
icons/broom.png
Normal file
After Width: | Height: | Size: 8.2 KiB |
BIN
icons/cabin.png
Normal file
After Width: | Height: | Size: 7 KiB |
BIN
icons/card-10-clubs.png
Normal file
After Width: | Height: | Size: 7.4 KiB |
BIN
icons/card-10-diamonds.png
Normal file
After Width: | Height: | Size: 7.2 KiB |
BIN
icons/card-10-hearts.png
Normal file
After Width: | Height: | Size: 7.3 KiB |
BIN
icons/card-10-spades.png
Normal file
After Width: | Height: | Size: 7.4 KiB |
BIN
icons/card-2-clubs.png
Normal file
After Width: | Height: | Size: 6.8 KiB |
BIN
icons/card-2-diamonds.png
Normal file
After Width: | Height: | Size: 6.6 KiB |
BIN
icons/card-2-hearts.png
Normal file
After Width: | Height: | Size: 6.7 KiB |
BIN
icons/card-2-spades.png
Normal file
After Width: | Height: | Size: 6.8 KiB |
BIN
icons/card-3-clubs.png
Normal file
After Width: | Height: | Size: 7 KiB |
BIN
icons/card-3-diamonds.png
Normal file
After Width: | Height: | Size: 6.8 KiB |
BIN
icons/card-3-hearts.png
Normal file
After Width: | Height: | Size: 6.8 KiB |
BIN
icons/card-3-spades.png
Normal file
After Width: | Height: | Size: 7 KiB |
BIN
icons/card-4-clubs.png
Normal file
After Width: | Height: | Size: 5.6 KiB |
BIN
icons/card-4-diamonds.png
Normal file
After Width: | Height: | Size: 5.4 KiB |
BIN
icons/card-4-hearts.png
Normal file
After Width: | Height: | Size: 5.4 KiB |
BIN
icons/card-4-spades.png
Normal file
After Width: | Height: | Size: 5.6 KiB |
BIN
icons/card-5-clubs.png
Normal file
After Width: | Height: | Size: 7 KiB |
BIN
icons/card-5-diamonds.png
Normal file
After Width: | Height: | Size: 6.8 KiB |
BIN
icons/card-5-hearts.png
Normal file
After Width: | Height: | Size: 6.8 KiB |
BIN
icons/card-5-spades.png
Normal file
After Width: | Height: | Size: 7 KiB |
BIN
icons/card-6-clubs.png
Normal file
After Width: | Height: | Size: 7.2 KiB |
BIN
icons/card-6-diamonds.png
Normal file
After Width: | Height: | Size: 7.1 KiB |
BIN
icons/card-6-hearts.png
Normal file
After Width: | Height: | Size: 7.1 KiB |
BIN
icons/card-6-spades.png
Normal file
After Width: | Height: | Size: 7.2 KiB |
BIN
icons/card-7-clubs.png
Normal file
After Width: | Height: | Size: 6.1 KiB |
BIN
icons/card-7-diamonds.png
Normal file
After Width: | Height: | Size: 6 KiB |
BIN
icons/card-7-hearts.png
Normal file
After Width: | Height: | Size: 6 KiB |
BIN
icons/card-7-spades.png
Normal file
After Width: | Height: | Size: 6.1 KiB |
BIN
icons/card-8-clubs.png
Normal file
After Width: | Height: | Size: 7.3 KiB |
BIN
icons/card-8-diamonds.png
Normal file
After Width: | Height: | Size: 7.1 KiB |
BIN
icons/card-8-hearts.png
Normal file
After Width: | Height: | Size: 7.1 KiB |
BIN
icons/card-8-spades.png
Normal file
After Width: | Height: | Size: 7.3 KiB |
BIN
icons/card-9-clubs.png
Normal file
After Width: | Height: | Size: 7.2 KiB |
BIN
icons/card-9-diamonds.png
Normal file
After Width: | Height: | Size: 7 KiB |
BIN
icons/card-9-hearts.png
Normal file
After Width: | Height: | Size: 7.1 KiB |
BIN
icons/card-9-spades.png
Normal file
After Width: | Height: | Size: 7.2 KiB |
BIN
icons/card-ace-clubs.png
Normal file
After Width: | Height: | Size: 6.8 KiB |
BIN
icons/card-ace-diamonds.png
Normal file
After Width: | Height: | Size: 6.6 KiB |
BIN
icons/card-ace-hearts.png
Normal file
After Width: | Height: | Size: 6.6 KiB |
BIN
icons/card-ace-spades.png
Normal file
After Width: | Height: | Size: 6.8 KiB |
BIN
icons/card-discard.png
Normal file
After Width: | Height: | Size: 7.6 KiB |
BIN
icons/card-draw.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
icons/card-jack-clubs.png
Normal file
After Width: | Height: | Size: 5.9 KiB |
BIN
icons/card-jack-diamonds.png
Normal file
After Width: | Height: | Size: 5.7 KiB |
BIN
icons/card-jack-hearts.png
Normal file
After Width: | Height: | Size: 5.7 KiB |
BIN
icons/card-jack-spades.png
Normal file
After Width: | Height: | Size: 5.9 KiB |
BIN
icons/card-joker.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
icons/card-king-clubs.png
Normal file
After Width: | Height: | Size: 6.4 KiB |
BIN
icons/card-king-diamonds.png
Normal file
After Width: | Height: | Size: 6.3 KiB |
BIN
icons/card-king-hearts.png
Normal file
After Width: | Height: | Size: 6.3 KiB |
BIN
icons/card-king-spades.png
Normal file
After Width: | Height: | Size: 6.4 KiB |
BIN
icons/card-pick.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
icons/card-queen-clubs.png
Normal file
After Width: | Height: | Size: 8.4 KiB |
BIN
icons/card-queen-diamonds.png
Normal file
After Width: | Height: | Size: 8.3 KiB |
BIN
icons/card-queen-hearts.png
Normal file
After Width: | Height: | Size: 8.3 KiB |
BIN
icons/card-queen-spades.png
Normal file
After Width: | Height: | Size: 8.4 KiB |
BIN
icons/card-random.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
icons/chess-bishop.png
Normal file
After Width: | Height: | Size: 4 KiB |
BIN
icons/chess-king.png
Normal file
After Width: | Height: | Size: 5.5 KiB |
BIN
icons/chess-knight.png
Normal file
After Width: | Height: | Size: 4.9 KiB |
BIN
icons/chess-pawn.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
icons/chess-queen.png
Normal file
After Width: | Height: | Size: 6.3 KiB |
BIN
icons/chess-rook.png
Normal file
After Width: | Height: | Size: 1,018 B |
BIN
icons/chicken.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
icons/clarinet.png
Normal file
After Width: | Height: | Size: 7.1 KiB |
BIN
icons/cloak.png
Normal file
After Width: | Height: | Size: 8.6 KiB |
BIN
icons/clown.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
icons/coins.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
icons/compass.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
icons/cow.png
Normal file
After Width: | Height: | Size: 8.3 KiB |
BIN
icons/crossed-swords.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
icons/deer.png
Normal file
After Width: | Height: | Size: 9.9 KiB |
BIN
icons/dice.png
Normal file
After Width: | Height: | Size: 12 KiB |