Compare commits
387 Commits
Author | SHA1 | Date | |
---|---|---|---|
9a7078b067 | |||
44ef9f2aad | |||
1ef946570d | |||
ae8181a6e5 | |||
7c190e3cfa | |||
805512fbea | |||
780025bb74 | |||
f6e3c50814 | |||
0399808eb2 | |||
cd677cf3e8 | |||
67edfa4245 | |||
66a35f28e6 | |||
2f7a266dc5 | |||
8a0fd07275 | |||
89299bf91e | |||
af88277680 | |||
dd17a70551 | |||
ec0411373b | |||
222a13387d | |||
c1e471f23a | |||
6b48ba070c | |||
bbbfd60bb7 | |||
62fa5ede9d | |||
20c3a525c8 | |||
8b70d0e9b7 | |||
36e5676d9f | |||
f706193945 | |||
e24b704809 | |||
91bbcdb7a7 | |||
2cb54dd570 | |||
90dde05b79 | |||
1ae4ff72d3 | |||
9213a1d5dd | |||
ca52e6dae6 | |||
83946b1e66 | |||
61cb41ae29 | |||
bca1c36f75 | |||
3270842a1b | |||
bd7d21d489 | |||
cc5d669ab4 | |||
2c38997b4c | |||
a49bcd8712 | |||
dbaa4d912a | |||
8f2c877197 | |||
1ee4f6849e | |||
3d89e94823 | |||
228d0088fb | |||
86465b5f76 | |||
6af08275e9 | |||
3c7c12ef39 | |||
404761d712 | |||
83d948ef24 | |||
946deb210d | |||
c2cdf256ba | |||
f0f4a64dfc | |||
25ced38cba | |||
86166f87eb | |||
54cce27a34 | |||
4d6a24f51f | |||
2e6d2c3cd5 | |||
7f62666017 | |||
8b3173811a | |||
b40f6d738e | |||
d4f12cb9b0 | |||
690dd1d6ca | |||
c21e8192d4 | |||
d4878d4e3d | |||
0503fe7e5b | |||
cd20f32acb | |||
c0fe7eaab5 | |||
f1b712af4a | |||
3231bc8240 | |||
8f80a99fc6 | |||
2cc908b043 | |||
d07d2a246a | |||
bf51ecda77 | |||
d87235c4b5 | |||
6c22b58487 | |||
05835a5c07 | |||
fa948a7beb | |||
04741198e2 | |||
5fb7ca78a9 | |||
ce0d83912e | |||
26eb9b4970 | |||
02ea4c6b4b | |||
0d35167c90 | |||
51ab42a9b0 | |||
4ca9e96276 | |||
b71b359502 | |||
a75f37c2d4 | |||
a7a44b39dc | |||
f6eb34ed78 | |||
099f21345f | |||
c1876482f7 | |||
a70f243421 | |||
b100891c34 | |||
2f4e78b138 | |||
5163f19796 | |||
c3f737de14 | |||
809b0cfad6 | |||
cacf83d434 | |||
ca1e242997 | |||
165b3b347f | |||
2965c3945a | |||
8d28ae3754 | |||
7d327f22aa | |||
d0c2123996 | |||
6081c4d310 | |||
0dfb37cc1c | |||
f15e457947 | |||
5d3db56ee4 | |||
8bec3356e5 | |||
3b4e541d0e | |||
b03633e010 | |||
651a43574f | |||
8e7bee4ea2 | |||
db66485432 | |||
12d47e5482 | |||
39c1a0f991 | |||
3f548f2d09 | |||
6587d22d2c | |||
76da1a033f | |||
6c530c44bd | |||
85fa45201e | |||
10d4ad6fd5 | |||
d5a3da2c35 | |||
a8b0540ecc | |||
cc5579971d | |||
6123bd3307 | |||
ed0d9998ff | |||
483efd280a | |||
1e2b4c0476 | |||
3992096df3 | |||
7165d1edc4 | |||
27653c2350 | |||
67ecd0ceff | |||
de74aac8af | |||
e1e0d1cbd5 | |||
b6051242a2 | |||
ea778c004b | |||
b5dbe5ce78 | |||
7645b45992 | |||
c0bf1c7bf1 | |||
49805784b0 | |||
8b7b12007b | |||
88b329f1d0 | |||
5fbbae9f99 | |||
520eec7c9c | |||
f75078b42b | |||
16ef0ff65a | |||
fed723aa48 | |||
6813c50c12 | |||
3c18129f94 | |||
409161efe7 | |||
8e7958be76 | |||
9e5ce455ca | |||
94e90a3cd8 | |||
58b4667ec7 | |||
97aff8615a | |||
e57c15bddb | |||
82d8005529 | |||
acc0bdfd87 | |||
a7accb0bf5 | |||
c5c83a9c17 | |||
aed653f0c8 | |||
b5995e2f93 | |||
0977e0a80f | |||
54a9b80523 | |||
72adb90757 | |||
f2549997ba | |||
063a342ad5 | |||
20f7730448 | |||
aa5ca1a3f0 | |||
0dab5c6599 | |||
3f0f8f351c | |||
e150265bc4 | |||
6fd37ffd3d | |||
f7bd625610 | |||
20cec2442c | |||
dcf6d77979 | |||
0cfd1a0e42 | |||
303e4105cb | |||
8c8613aca6 | |||
ead304d698 | |||
edb634b79d | |||
d0e4d2296c | |||
078e0d0d8b | |||
855e312ad4 | |||
ffb313971d | |||
ef8e4a379c | |||
945038042a | |||
d59cf0f9e0 | |||
12d5b48632 | |||
489d4f54a1 | |||
80f53cb013 | |||
ab71f5c84f | |||
f3c8482c6d | |||
4bdc38b7d9 | |||
1f8c0fa06e | |||
4ec44b0f89 | |||
d82ec589bd | |||
51276fd171 | |||
1c5cd37a4f | |||
f3111623c1 | |||
4bacf86367 | |||
f1e6109fa5 | |||
fe2e9f0dcf | |||
9a2525e9e5 | |||
abef666256 | |||
d31f63a47e | |||
d4e4dbc565 | |||
b8cefcc12d | |||
ca4de52619 | |||
22b6f477ba | |||
fe13f3d6b4 | |||
c697ae9bd1 | |||
d22b7b718c | |||
61285be23e | |||
eb0ccc8b25 | |||
ca8db2564d | |||
c4a8c54da2 | |||
9d4f94dba2 | |||
4adf59193c | |||
7766b4071c | |||
3d0f3a3ab6 | |||
0e7ac54ef7 | |||
6c03dde215 | |||
aa6c96c9a3 | |||
28abaa62ff | |||
c8e65e39c3 | |||
4fe4232796 | |||
81fa120cb7 | |||
92fdc24a49 | |||
237c9108bf | |||
069cfba51b | |||
e4ef5b55fe | |||
a10e2aaab9 | |||
b35ed87573 | |||
ab867588d3 | |||
087b2a2bb0 | |||
c8fcce1de3 | |||
a5f3e60e3a | |||
fbc54e0065 | |||
1bbefb259a | |||
569e82f476 | |||
51822aef23 | |||
f0ae9c238c | |||
b9578e151d | |||
ad655021a4 | |||
9c66052878 | |||
d98707aa8f | |||
95dc698349 | |||
13916e3dff | |||
44f618e9d8 | |||
235c2c2d7e | |||
dfce1b2adb | |||
b68c7d29ae | |||
7737cba060 | |||
4cd82f2e25 | |||
a15b0bdb2d | |||
f7f0d26896 | |||
e73ee7c6db | |||
0d4cc6f30f | |||
d7c02bab33 | |||
4750ba5a6c | |||
8dabfd58ab | |||
16510f5261 | |||
60d85b2a5e | |||
69fe7d4cb4 | |||
0e772b1394 | |||
596d2a8611 | |||
f1f71b93e2 | |||
b0a74a0bf6 | |||
00ec77e6a3 | |||
d2145977c5 | |||
c733394277 | |||
43ea66236c | |||
0cd8eaa423 | |||
af296546ff | |||
26db113a09 | |||
e2ca5f27b6 | |||
ed2b2c4ed8 | |||
7c3e17e820 | |||
64045ebddf | |||
14800862be | |||
c640a2ec38 | |||
1a87a2519f | |||
52d7433385 | |||
03247039d3 | |||
9dc3feb1f3 | |||
a64f16e371 | |||
2327fcb284 | |||
0e56aa0905 | |||
d568126176 | |||
f11b74ba85 | |||
a4eac5221d | |||
31360d90f3 | |||
d3c1a8aaa6 | |||
e944cd8f55 | |||
5af0535d74 | |||
6548670e59 | |||
69f8a7fd51 | |||
8ba4bcdc1b | |||
0d104edab3 | |||
2c17269f84 | |||
8cf2c798e6 | |||
48cb6d4034 | |||
78b3ff7f68 | |||
e304bdf00f | |||
ad169b01cb | |||
dc7034db91 | |||
b01393cd33 | |||
54579d1f18 | |||
96dbdf3309 | |||
b690ea5822 | |||
fbe59355ce | |||
809ddbad47 | |||
9be2bb672a | |||
469896be32 | |||
6f8ec89373 | |||
4368d6d7ee | |||
3af5da9d3e | |||
560ee65932 | |||
e42d1ec20a | |||
bfa3b0a1c6 | |||
c2484c1892 | |||
fe15309b77 | |||
cadb23f9e2 | |||
c401c3f2e3 | |||
b2eccd5ebb | |||
48de80fe13 | |||
ba97c9ed70 | |||
e717a52491 | |||
006f16f32f | |||
184a97b2d7 | |||
b72caa1ba0 | |||
b81160bbd3 | |||
ae4212e5a6 | |||
6821dd2bca | |||
c5a3910ccf | |||
12ea3dc60f | |||
3d3f26bf57 | |||
66b8f6b921 | |||
cc5a011a89 | |||
83e0b11f8f | |||
165552b439 | |||
5eefebee43 | |||
762b08eb08 | |||
0032d26010 | |||
ee4fe4f131 | |||
5b926a7317 | |||
f0b02d64ef | |||
3e2af92e7e | |||
7384ba6f4f | |||
a1d9b4344a | |||
3fc36d5b14 | |||
87f9b915e2 | |||
fa1980d47c | |||
d80017fcb5 | |||
db27c91ec9 | |||
9036726e92 | |||
a0350b7814 | |||
0cd2f330ad | |||
9a5479d68b | |||
595828fe84 | |||
788d8f81a5 | |||
d8a6a9e45c | |||
113af5fabb | |||
c6b7099df2 | |||
db778f462a | |||
5d02c2c6f2 | |||
83eeee453e | |||
2d05d1e7a9 | |||
4d11cb9e91 | |||
cbbc4d54d9 | |||
22ae99f915 | |||
b7a544eadd | |||
328ff9d23b | |||
624b59db9d | |||
adf783c2a1 | |||
db89d5c60f | |||
9623606229 | |||
5200f27182 | |||
36f545855d | |||
c2b35fdf83 | |||
59fcc8c159 | |||
8431119ff5 |
36
.github/workflows/Docs.yml
vendored
@ -2,7 +2,7 @@ name: 📄
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "**" ]
|
||||
branches: [ "!*" ]
|
||||
pull_request:
|
||||
branches: [ "*" ]
|
||||
|
||||
@ -16,17 +16,35 @@ jobs:
|
||||
steps:
|
||||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Extract branch name
|
||||
shell: bash
|
||||
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
|
||||
id: branch
|
||||
- name: Display branch name
|
||||
shell: bash
|
||||
run: echo ${{ steps.branch.outputs.branch }}
|
||||
# Runs a single command using the runners shell
|
||||
- name: Run a one-line script
|
||||
run: |
|
||||
cd ..
|
||||
git clone https://github.com/NPI-D7/BCSTM-Player.git
|
||||
cp -r BCSTM-Player/RenderD7-alpha0-6-0/* RenderD7/
|
||||
cd RenderD7
|
||||
git config --global user.email "tobid7@outlook.de"
|
||||
git config --global user.name "Tobi-D7"
|
||||
sudo apt-get install doxygen cmake -y
|
||||
doxygen
|
||||
echo done
|
||||
ls -r
|
||||
cd ..
|
||||
git clone --depth 1 https://${{ secrets.TOKEN }}@github.com/NPI-D7/RenderD7.git RD7 -b gh-pages
|
||||
|
||||
mv -v RenderD7/doc/html/* RD7/
|
||||
#rm -r doc
|
||||
cd RD7
|
||||
|
||||
echo tobid7
|
||||
git stage *
|
||||
git commit -m "BCSTM-Player | $COMMIT_HASH"
|
||||
git tag v$CURRENT_DATE
|
||||
git push origin main v$CURRENT_DATE
|
||||
|
||||
echo staged
|
||||
git commit -m "Documentation1"
|
||||
git tag doc
|
||||
echo commited
|
||||
git push origin gh-pages
|
||||
echo pushed
|
||||
|
50
.github/workflows/Update extlibs.yml
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
name: Extlibs
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ '!*' ]
|
||||
pull_request:
|
||||
branches: [ '!*' ]
|
||||
|
||||
# Allows you to run this workflow manually from the Actions tab
|
||||
workflow_dispatch:
|
||||
|
||||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
||||
jobs:
|
||||
# This workflow contains a single job called "build"
|
||||
build:
|
||||
# The type of runner that the job will run on
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
# Steps represent a sequence of tasks that will be executed as part of the job
|
||||
steps:
|
||||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
||||
- uses: actions/checkout@v2
|
||||
- name: update
|
||||
run: |
|
||||
#gl
|
||||
cd ..
|
||||
git clone https://github.com/lua/lua.git
|
||||
cd RenderD7
|
||||
mkdir -p extlibs/
|
||||
mkdir -p extlibs/lua/
|
||||
cp -r ../lua/*.c extlibs/lua/
|
||||
cp -r ../lua/*.h extlibs/lua/
|
||||
cp -r ../lua/*.md extlibs/lua/
|
||||
#RenderD7
|
||||
cd ..
|
||||
git clone https://github.com/NPI-D7/RenderD7.git
|
||||
cd lp-next-ctr
|
||||
mkdir -p extlibs/
|
||||
rm -r extlibs/RenderD7
|
||||
mkdir -p extlibs/RenderD7/
|
||||
cp -r ../RenderD7/*.c* extlibs/RenderD7/
|
||||
cp -r ../RenderD7/*.h* extlibs/RenderD7/
|
||||
cp -r ../RenderD7/*.md extlibs/RenderD7/
|
||||
#config
|
||||
git config --global user.email "tobid7@outlook.de"
|
||||
git config --global user.name "Tobi-D7"
|
||||
#commit
|
||||
git stage *
|
||||
git commit -m "update extlibs"
|
||||
git push origin main
|
4
.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
release/
|
||||
debug/
|
||||
lib/
|
||||
*.bz2
|
18
.vscode/c_cpp_properties.json
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"configurations": [
|
||||
{
|
||||
"name": "3DS | Windows",
|
||||
"includePath": [
|
||||
"${workspaceFolder}/**",
|
||||
"C:/devkitpro/libctru/include/**",
|
||||
"C:/devkitpro/devkitARM/include/**",
|
||||
"C:/devkitpro/devkitARM/arm-none-eabi/include/**",
|
||||
"C:/devkitpro/portlibs/3ds/include/**",
|
||||
"/opt/devkitpro/libctru/include/**",
|
||||
"/opt/devkitpro/portlibs/**"
|
||||
|
||||
]
|
||||
}
|
||||
],
|
||||
"version": 4
|
||||
}
|
102
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,102 @@
|
||||
{
|
||||
"files.associations": {
|
||||
"array": "cpp",
|
||||
"*.tcc": "cpp",
|
||||
"cctype": "cpp",
|
||||
"clocale": "cpp",
|
||||
"cmath": "cpp",
|
||||
"cstdarg": "cpp",
|
||||
"cstddef": "cpp",
|
||||
"cstdint": "cpp",
|
||||
"cstdio": "cpp",
|
||||
"cstdlib": "cpp",
|
||||
"cwchar": "cpp",
|
||||
"cwctype": "cpp",
|
||||
"unordered_map": "cpp",
|
||||
"vector": "cpp",
|
||||
"exception": "cpp",
|
||||
"algorithm": "cpp",
|
||||
"functional": "cpp",
|
||||
"iterator": "cpp",
|
||||
"memory": "cpp",
|
||||
"numeric": "cpp",
|
||||
"type_traits": "cpp",
|
||||
"fstream": "cpp",
|
||||
"initializer_list": "cpp",
|
||||
"iosfwd": "cpp",
|
||||
"iostream": "cpp",
|
||||
"istream": "cpp",
|
||||
"limits": "cpp",
|
||||
"new": "cpp",
|
||||
"optional": "cpp",
|
||||
"ostream": "cpp",
|
||||
"sstream": "cpp",
|
||||
"stdexcept": "cpp",
|
||||
"streambuf": "cpp",
|
||||
"string": "cpp",
|
||||
"string_view": "cpp",
|
||||
"system_error": "cpp",
|
||||
"tuple": "cpp",
|
||||
"typeinfo": "cpp",
|
||||
"utility": "cpp",
|
||||
"atomic": "cpp",
|
||||
"bit": "cpp",
|
||||
"bitset": "cpp",
|
||||
"chrono": "cpp",
|
||||
"codecvt": "cpp",
|
||||
"condition_variable": "cpp",
|
||||
"cstring": "cpp",
|
||||
"ctime": "cpp",
|
||||
"deque": "cpp",
|
||||
"forward_list": "cpp",
|
||||
"map": "cpp",
|
||||
"iomanip": "cpp",
|
||||
"memory_resource": "cpp",
|
||||
"ratio": "cpp",
|
||||
"regex": "cpp",
|
||||
"shared_mutex": "cpp",
|
||||
"valarray": "cpp",
|
||||
"random": "cpp",
|
||||
"cuchar": "cpp",
|
||||
"compare": "cpp",
|
||||
"concepts": "cpp",
|
||||
"numbers": "cpp",
|
||||
"filesystem": "cpp",
|
||||
"xstring": "cpp",
|
||||
"charconv": "cpp",
|
||||
"format": "cpp",
|
||||
"ios": "cpp",
|
||||
"list": "cpp",
|
||||
"locale": "cpp",
|
||||
"mutex": "cpp",
|
||||
"stack": "cpp",
|
||||
"stop_token": "cpp",
|
||||
"thread": "cpp",
|
||||
"xfacet": "cpp",
|
||||
"xhash": "cpp",
|
||||
"xiosbase": "cpp",
|
||||
"xlocale": "cpp",
|
||||
"xlocbuf": "cpp",
|
||||
"xlocinfo": "cpp",
|
||||
"xlocmes": "cpp",
|
||||
"xlocmon": "cpp",
|
||||
"xlocnum": "cpp",
|
||||
"xloctime": "cpp",
|
||||
"xmemory": "cpp",
|
||||
"xstddef": "cpp",
|
||||
"xtr1common": "cpp",
|
||||
"xtree": "cpp",
|
||||
"xutility": "cpp",
|
||||
"queue": "cpp",
|
||||
"semaphore": "cpp",
|
||||
"hash_map": "cpp",
|
||||
"set": "cpp",
|
||||
"unordered_set": "cpp",
|
||||
"source_location": "cpp",
|
||||
"future": "cpp",
|
||||
"cfenv": "cpp",
|
||||
"cinttypes": "cpp",
|
||||
"typeindex": "cpp",
|
||||
"variant": "cpp"
|
||||
}
|
||||
}
|
201
Makefile
Normal file
@ -0,0 +1,201 @@
|
||||
#---------------------------------------------------------------------------------
|
||||
.SUFFIXES:
|
||||
#---------------------------------------------------------------------------------
|
||||
|
||||
ifeq ($(strip $(DEVKITARM)),)
|
||||
$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM")
|
||||
endif
|
||||
|
||||
include $(DEVKITARM)/3ds_rules
|
||||
|
||||
export renderd7_MAJOR := 0
|
||||
export renderd7_MINOR := 9
|
||||
export renderd7_PATCH := 4
|
||||
|
||||
VERSION := $(renderd7_MAJOR).$(renderd7_MINOR).$(renderd7_PATCH)
|
||||
|
||||
# If on a tagged commit, use the tag instead of the commit
|
||||
ifneq ($(shell echo $(shell git tag -l --points-at HEAD) | head -c 1),)
|
||||
GIT_VER := $(shell git tag -l --points-at HEAD)
|
||||
else
|
||||
GIT_VER := $(shell git rev-parse --short HEAD)
|
||||
endif
|
||||
|
||||
TIME_TIME := $(shell date --iso=seconds)
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# TARGET is the name of the output
|
||||
# BUILD is the directory where object files & intermediate files will be placed
|
||||
# SOURCES is a list of directories containing source code
|
||||
# DATA is a list of directories containing data files
|
||||
# INCLUDES is a list of directories containing header files
|
||||
#---------------------------------------------------------------------------------
|
||||
TARGET := renderd7
|
||||
SOURCES := source external/source
|
||||
DATA := data
|
||||
INCLUDES := include
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# options for code generation
|
||||
#---------------------------------------------------------------------------------
|
||||
ARCH := -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft
|
||||
|
||||
CFLAGS := -g -Wall -Werror -mword-relocations -save-temps\
|
||||
-DV_STRING=\"$(GIT_VER)\" \
|
||||
-DV_TIME=\"$(TIME_TIME)\" \
|
||||
-ffunction-sections -fdata-sections \
|
||||
$(ARCH) $(BUILD_CFLAGS)
|
||||
|
||||
CFLAGS += $(INCLUDE) -D__3DS__ -D_GNU_SOURCE=1
|
||||
|
||||
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++20
|
||||
|
||||
ASFLAGS := -g $(ARCH) $(DEFINES)
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# list of directories containing libraries, this must be the top level containing
|
||||
# include and lib
|
||||
#---------------------------------------------------------------------------------
|
||||
LIBDIRS := $(PORTLIBS) $(CTRULIB)
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# no real need to edit anything past this point unless you need to add additional
|
||||
# rules for different file extensions
|
||||
#---------------------------------------------------------------------------------
|
||||
ifneq ($(BUILD),$(notdir $(CURDIR)))
|
||||
#---------------------------------------------------------------------------------
|
||||
|
||||
export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \
|
||||
$(foreach dir,$(DATA),$(CURDIR)/$(dir))
|
||||
|
||||
CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
|
||||
CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
|
||||
SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
|
||||
PICAFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.v.pica)))
|
||||
SHLISTFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.shlist)))
|
||||
BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*)))
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# use CXX for linking C++ projects, CC for standard C
|
||||
#---------------------------------------------------------------------------------
|
||||
ifeq ($(strip $(CPPFILES)),)
|
||||
#---------------------------------------------------------------------------------
|
||||
export LD := $(CC)
|
||||
#---------------------------------------------------------------------------------
|
||||
else
|
||||
#---------------------------------------------------------------------------------
|
||||
export LD := $(CXX)
|
||||
#---------------------------------------------------------------------------------
|
||||
endif
|
||||
#---------------------------------------------------------------------------------
|
||||
|
||||
export OFILES_SOURCES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o)
|
||||
|
||||
export OFILES_BIN := $(addsuffix .o,$(BINFILES)) \
|
||||
$(PICAFILES:.v.pica=.shbin.o) $(SHLISTFILES:.shlist=.shbin.o)
|
||||
|
||||
export OFILES := $(OFILES_BIN) $(OFILES_SOURCES)
|
||||
|
||||
export HFILES := $(PICAFILES:.v.pica=_shbin.h) $(addsuffix .h,$(subst .,_,$(BINFILES)))
|
||||
|
||||
export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \
|
||||
$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
|
||||
-I.
|
||||
|
||||
.PHONY: clean all doc
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
all: lib/librenderd7.a lib/librenderd7d.a
|
||||
|
||||
doc:
|
||||
@doxygen Doxyfile
|
||||
|
||||
dist-bin: all
|
||||
@tar --exclude=*~ -cjf $(TARGET).tar.bz2 include lib
|
||||
|
||||
dist-src:
|
||||
@tar --exclude=*~ -cjf $(TARGET)-src.tar.bz2 include $(SOURCES) Makefile
|
||||
|
||||
dist: dist-src dist-bin
|
||||
|
||||
lib:
|
||||
@[ -d $@ ] || mkdir -p $@
|
||||
|
||||
release:
|
||||
@[ -d $@ ] || mkdir -p $@
|
||||
|
||||
debug:
|
||||
@[ -d $@ ] || mkdir -p $@
|
||||
|
||||
|
||||
lib/librenderd7.a : lib release $(SOURCES) $(INCLUDES)
|
||||
@$(MAKE) BUILD=release OUTPUT=$(CURDIR)/$@ \
|
||||
BUILD_CFLAGS="-DNDEBUG=1 -O2 -fomit-frame-pointer" \
|
||||
DEPSDIR=$(CURDIR)/release \
|
||||
--no-print-directory -C release \
|
||||
-f $(CURDIR)/Makefile
|
||||
|
||||
lib/librenderd7d.a : lib debug $(SOURCES) $(INCLUDES)
|
||||
@$(MAKE) BUILD=debug OUTPUT=$(CURDIR)/$@ \
|
||||
BUILD_CFLAGS="-DDEBUG=1 -Og" \
|
||||
DEPSDIR=$(CURDIR)/debug \
|
||||
--no-print-directory -C debug \
|
||||
-f $(CURDIR)/Makefile
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
clean:
|
||||
@echo clean ...
|
||||
@rm -fr release debug lib includes
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
else
|
||||
|
||||
DEPENDS := $(OFILES:.o=.d)
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# main targets
|
||||
#---------------------------------------------------------------------------------
|
||||
$(OUTPUT) : $(OFILES)
|
||||
|
||||
$(OFILES_SOURCES) : $(HFILES)
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# you need a rule like this for each extension you use as binary data
|
||||
#---------------------------------------------------------------------------------
|
||||
%.bin.o %_bin.h : %.bin
|
||||
#---------------------------------------------------------------------------------
|
||||
@echo $(notdir $<)
|
||||
@$(bin2o)
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# rules for assembling GPU shaders
|
||||
#---------------------------------------------------------------------------------
|
||||
define shader-as
|
||||
$(eval CURBIN := $*.shbin)
|
||||
$(eval DEPSFILE := $(DEPSDIR)/$*.shbin.d)
|
||||
echo "$(CURBIN).o: $< $1" > $(DEPSFILE)
|
||||
echo "extern const u8" `(echo $(CURBIN) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"_end[];" > `(echo $(CURBIN) | tr . _)`.h
|
||||
echo "extern const u8" `(echo $(CURBIN) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"[];" >> `(echo $(CURBIN) | tr . _)`.h
|
||||
echo "extern const u32" `(echo $(CURBIN) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`_size";" >> `(echo $(CURBIN) | tr . _)`.h
|
||||
picasso -o $(CURBIN) $1
|
||||
bin2s $(CURBIN) | $(AS) -o $*.shbin.o
|
||||
endef
|
||||
|
||||
%.shbin.o %_shbin.h : %.v.pica %.g.pica
|
||||
@echo $(notdir $^)
|
||||
@$(call shader-as,$^)
|
||||
|
||||
%.shbin.o %_shbin.h : %.v.pica
|
||||
@echo $(notdir $<)
|
||||
@$(call shader-as,$<)
|
||||
|
||||
%.shbin.o %_shbin.h : %.shlist
|
||||
@echo $(notdir $<)
|
||||
@$(call shader-as,$(foreach file,$(shell cat $<),$(dir $<)$(file)))
|
||||
|
||||
-include $(DEPENDS)
|
||||
|
||||
#---------------------------------------------------------------------------------------
|
||||
endif
|
||||
#---------------------------------------------------------------------------------------
|
43
README.md
@ -1,2 +1,41 @@
|
||||
# RenderD7
|
||||
Simple and Easey to use UI and Graphics helper.
|
||||
# <img alt="LOGO" src="https://github.com/NPI-D7/RenderD7/blob/main/logo.png" height="90">
|
||||
RenderD7 is now LibRenderD7.
|
||||
### Installation
|
||||
Download a Package From Releses Page
|
||||
`https://github.com/NPI-D7/RenderD7/releases/download/v0.9.3/renderd7.tar.bz2 -o renderd7.tar.bz2`
|
||||
Then Extract it to your Libraries Path
|
||||
`bzip2 -cd renderd7.tar.bz2 | tar -xf - -C path_to_your_libs`
|
||||
Finally put `-lrenderd7` to the First Place and add the path_to_your_libs
|
||||
```
|
||||
LIBS := -lrenderd7 -lcurl -lstdc++ -lm -lcitro2d -lcitro3d -lctru
|
||||
#---------------------------------------------------------------------------------
|
||||
# list of directories containing libraries, this must be the top level containing
|
||||
# include and lib
|
||||
#---------------------------------------------------------------------------------
|
||||
LIBDIRS := $(PORTLIBS) $(CTRULIB) ../path_to_your_libs
|
||||
```
|
||||
Make sure that `-lrenderd7` is before `-lcitro2d`, `-lcitro3d`, `-lctru`.
|
||||
Here an example tree
|
||||
```
|
||||
Example-App
|
||||
├── gfx
|
||||
├── libs
|
||||
│ ├── include
|
||||
│ │ ├── rd7.hpp
|
||||
│ │ └── renderd7
|
||||
│ └── lib
|
||||
│ ├── librenderd7.a
|
||||
│ └── librenderd7d.a
|
||||
├── Makefile
|
||||
├── romfs
|
||||
│ └── gfx
|
||||
└── src
|
||||
└── main.cpp
|
||||
```
|
||||
# Credits
|
||||
- NPI-D7
|
||||
- Tobi-D7 Main Dev
|
||||
|
||||
Some Icons are From
|
||||
https://icons8.de/
|
||||
See Subfolder Readmes
|
34
assets/build_assets.sh
Executable file
@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "Create Directorys"
|
||||
mkdir -p build
|
||||
mkdir -p code
|
||||
|
||||
echo "Generating Spritesheets"
|
||||
cd resources
|
||||
|
||||
for file in *.t3s
|
||||
do
|
||||
filename=$(basename "$file" .t3s).t3x
|
||||
tex3ds -o "../build/$filename" -i "${file}"
|
||||
done
|
||||
|
||||
echo "Converting Spritesheets into C++ Code"
|
||||
cd ../code
|
||||
|
||||
for file in ../build/*.t3x
|
||||
do
|
||||
name="${file##*/}"
|
||||
name="${name%.*}"
|
||||
../../tools/bin/file2array "${file}" "${name}"
|
||||
done
|
||||
|
||||
echo "Convert Npi-Intro to C++ Code"
|
||||
../../tools/bin/file2array ../splash/npi_intro.nvid npi_intro
|
||||
|
||||
echo "Fix The Output of file2array"
|
||||
for file in ./*.cpp
|
||||
do
|
||||
../../tools/bin/rd7f2afix "${file}" "renderd7"
|
||||
done
|
||||
echo "Finished!"
|
7
assets/clear_assets.sh
Executable file
@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "Deleting Directorys"
|
||||
rm -rf build
|
||||
rm -rf code
|
||||
|
||||
echo "Finished!"
|
2
assets/resources/battery/README.md
Normal file
@ -0,0 +1,2 @@
|
||||
# Source
|
||||
https://icons8.de/
|
BIN
assets/resources/battery/battery_charging.png
Normal file
After Width: | Height: | Size: 900 B |
BIN
assets/resources/battery/battery_dead.png
Normal file
After Width: | Height: | Size: 739 B |
BIN
assets/resources/battery/battery_empty.png
Normal file
After Width: | Height: | Size: 388 B |
BIN
assets/resources/battery/battery_full.png
Normal file
After Width: | Height: | Size: 394 B |
BIN
assets/resources/battery/battery_half.png
Normal file
After Width: | Height: | Size: 437 B |
BIN
assets/resources/battery/battery_low.png
Normal file
After Width: | Height: | Size: 445 B |
BIN
assets/resources/battery/battery_nearfull.png
Normal file
After Width: | Height: | Size: 440 B |
BIN
assets/resources/battery/battery_verylow.png
Normal file
After Width: | Height: | Size: 447 B |
BIN
assets/resources/battery/battery_warning.png
Normal file
After Width: | Height: | Size: 638 B |
11
assets/resources/battery_icons.t3s
Normal file
@ -0,0 +1,11 @@
|
||||
--atlas -f rgba -z auto
|
||||
|
||||
battery/battery_full.png
|
||||
battery/battery_nearfull.png
|
||||
battery/battery_half.png
|
||||
battery/battery_low.png
|
||||
battery/battery_verylow.png
|
||||
battery/battery_warning.png
|
||||
battery/battery_charging.png
|
||||
battery/battery_empty.png
|
||||
battery/battery_dead.png
|
3
assets/resources/renderd7_logo.t3s
Normal file
@ -0,0 +1,3 @@
|
||||
--atlas -f rgba -z auto
|
||||
|
||||
renderd7_logo/renderd7_logo.png
|
BIN
assets/resources/renderd7_logo/renderd7_logo.png
Normal file
After Width: | Height: | Size: 13 KiB |
19
assets/resources/ui_elements.t3s
Normal file
@ -0,0 +1,19 @@
|
||||
--atlas -f rgba -z auto
|
||||
|
||||
ui_elements/high_volume.png
|
||||
ui_elements/mid_volume.png
|
||||
ui_elements/low_volume.png
|
||||
ui_elements/speaker_v1.png
|
||||
ui_elements/no_sound.png
|
||||
ui_elements/speaker.png
|
||||
|
||||
ui_elements/wifi_connected.png
|
||||
ui_elements/wifi_disconnected.png
|
||||
ui_elements/wifi_off.png
|
||||
|
||||
ui_elements/good_connection.png
|
||||
ui_elements/mid_connection.png
|
||||
ui_elements/bad_connection.png
|
||||
ui_elements/no_connection.png
|
||||
|
||||
ui_elements/headphones.png
|
2
assets/resources/ui_elements/README.md
Normal file
@ -0,0 +1,2 @@
|
||||
# Source
|
||||
https://icons8.de/
|
BIN
assets/resources/ui_elements/bad_connection.png
Normal file
After Width: | Height: | Size: 392 B |
BIN
assets/resources/ui_elements/good_connection.png
Normal file
After Width: | Height: | Size: 418 B |
BIN
assets/resources/ui_elements/headphones.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
assets/resources/ui_elements/high_volume.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
assets/resources/ui_elements/low_volume.png
Normal file
After Width: | Height: | Size: 964 B |
BIN
assets/resources/ui_elements/mid_connection.png
Normal file
After Width: | Height: | Size: 400 B |
BIN
assets/resources/ui_elements/mid_volume.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
assets/resources/ui_elements/no_connection.png
Normal file
After Width: | Height: | Size: 380 B |
BIN
assets/resources/ui_elements/no_sound.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
assets/resources/ui_elements/speaker.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
assets/resources/ui_elements/speaker_v1.png
Normal file
After Width: | Height: | Size: 681 B |
BIN
assets/resources/ui_elements/wifi_connected.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
assets/resources/ui_elements/wifi_disconnected.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
assets/resources/ui_elements/wifi_off.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
assets/splash/npi_intro.mp4
Normal file
BIN
assets/splash/npi_intro.nvid
Normal file
8
cformat.sh
Executable file
@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
find . -type f \( -name '*.h' -o -name '*.hpp' -o -name '*.hh' -o -name '*.ino' -o -name '*.cpp' -o -name '*.c' -o -name '*.cxx' -o -name '*.inl' \) -and -not -path './build/*' -not -path './base/external/*' -not -path './DPP/*' | while read file; do
|
||||
if [[ "$file" != *"json.hpp" ]]; then
|
||||
echo "Formatting $file..."
|
||||
clang-format -i --style=LLVM $file
|
||||
fi
|
||||
done
|
638
docsn.css
Normal file
@ -0,0 +1,638 @@
|
||||
/* This doxygen theme is free to use. If you like this, please Star https://github.com/kcwongjoe/doxygen_theme_flat_design */
|
||||
|
||||
/* Color Pattern. You can change this pattern to design your theme. */
|
||||
|
||||
:root {
|
||||
/* Content */
|
||||
--bgcolor: #ffffff;
|
||||
--bgfont: #303030;
|
||||
--bgfont2: #f3c60a;
|
||||
--bgfont-hover: #f3c60a;
|
||||
--bgfont-hover-text-decoration: none;
|
||||
--bgborder: #7d7d7d;
|
||||
--bgborder2: #f6f6f6;
|
||||
/* Main Header */
|
||||
--bg1color: #303030;
|
||||
--bg1font: #ffffff;
|
||||
--bg1font2: #f3c60a;
|
||||
/* Second header */
|
||||
--bg2color: #E2E2E2;
|
||||
--bg2font: #7D7D7D;
|
||||
--bg2-hover-bg: #ffffff;
|
||||
--bg2-hover-font: #303030;
|
||||
--bg2-hover-topborder: #f3c60a;
|
||||
/* Third header */
|
||||
--bg3color: #f6f6f6;
|
||||
--bg3font: #303030;
|
||||
--bg3font2: #7D7D7D;
|
||||
/* Code */
|
||||
--code-bg: #f6f6f6;
|
||||
--code-comment: #7D7D7D;
|
||||
--code-keyword: #d73a49;
|
||||
--code-preprocessor: #d73a49;
|
||||
--code-keywordtype: #d73a49;
|
||||
--code-text: #303030;
|
||||
--code-code: #6f42c1;
|
||||
--code-line: #7D7D7D;
|
||||
--code-line-bg: #D8D8D8;
|
||||
/* Namespace List, Class List icon */
|
||||
--icon-bg: #303030;
|
||||
--icon-font: #f3c60a;
|
||||
/* Class Index */
|
||||
--qindex-menu-bg: #303030;
|
||||
--qindex-menu-font: #ffffff;
|
||||
--qindex-menu-font-hover: #f3c60a;
|
||||
--qindex-icon-bg: #f3c60a;
|
||||
--qindex-icon-font: #303030;
|
||||
/* Member table */
|
||||
--mem-title-bg: #303030;
|
||||
--mem-title-font: #ffffff;
|
||||
--mem-subtitle-bg: #f3c60a;
|
||||
--mem-subtitle-font: #303030;
|
||||
--mem-subtitle-font-hover: #303030;
|
||||
--mem-content-bg: #ffffff;
|
||||
--mem-content-font: #303030;
|
||||
--mem-content-border: #f6f6f6;
|
||||
/* Nav Tree */
|
||||
--nav-tree-bg: #E2E2E2;
|
||||
--nav-tree-bg-hover: #ffffff;
|
||||
--nav-tree-font: #7D7D7D;
|
||||
--nav-tree-font-hover: #303030;
|
||||
--nav-tree-bg-selected: #f3c60a;
|
||||
--nav-tree-font-selected: #303030;
|
||||
}
|
||||
|
||||
body, table, div, p, dl {
|
||||
color: var(--bgfont);
|
||||
background-color: var(--bgcolor);
|
||||
line-height: 150%;
|
||||
font: 14px/22px, Roboto, Arial;
|
||||
}
|
||||
|
||||
div.contents {
|
||||
margin: 20px 40px;
|
||||
}
|
||||
|
||||
div.contents ul {
|
||||
line-height: 200%;
|
||||
}
|
||||
|
||||
/***********************************/
|
||||
|
||||
/********** Project header *********/
|
||||
|
||||
/***********************************/
|
||||
|
||||
#titlearea {
|
||||
border-bottom: none;
|
||||
padding-bottom: 20px;
|
||||
padding-top: 20px;
|
||||
}
|
||||
|
||||
#titlearea, #titlearea * {
|
||||
color: var(--bg1font);
|
||||
background-color: var(--bg1color);
|
||||
}
|
||||
|
||||
#projectname {
|
||||
padding: 0px 40px !important;
|
||||
}
|
||||
|
||||
#projectbrief {
|
||||
padding: 0px 40px !important;
|
||||
}
|
||||
|
||||
#projectalign {
|
||||
padding: 0px !important;
|
||||
}
|
||||
|
||||
/***********************************/
|
||||
|
||||
/************ Main Menu ************/
|
||||
|
||||
/***********************************/
|
||||
|
||||
/* Margin */
|
||||
|
||||
#main-menu {
|
||||
padding: 0px 30px;
|
||||
}
|
||||
|
||||
#main-menu a, #main-menu a:hover {
|
||||
padding-top: 10px;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
|
||||
/* Menu button */
|
||||
|
||||
#main-menu li a {
|
||||
background-image: none;
|
||||
font-family: Arial;
|
||||
text-transform: uppercase;
|
||||
text-shadow: none;
|
||||
font-size: 14px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
#main-menu, #main-menu>li>a {
|
||||
background-image: none;
|
||||
background-color: var(--bg2color);
|
||||
color: var(--bg2font);
|
||||
transition: 0.2s;
|
||||
}
|
||||
|
||||
/* hover Effect */
|
||||
|
||||
#main-menu>li {
|
||||
border-top: 5px solid var(--bg2color);
|
||||
}
|
||||
|
||||
#main-menu>li:hover {
|
||||
color: var(--bg2-hover-font);
|
||||
background-color: var(--bg2-hover-bg);
|
||||
border-top: 5px solid var(--bg2-hover-topborder);
|
||||
}
|
||||
|
||||
#main-menu>li:hover, #main-menu>li>a:hover, #main-menu>li>a.highlighted {
|
||||
color: var(--bg2-hover-font);
|
||||
background-color: var(--bg2-hover-bg);
|
||||
}
|
||||
|
||||
/* Search Bar */
|
||||
|
||||
#MSearchBox {
|
||||
border-radius: 0;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
#MSearchBox>span {
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
#main-menu>li:last-child {
|
||||
padding: 25px 0px;
|
||||
}
|
||||
|
||||
/* Reset search hover color*/
|
||||
|
||||
#main-menu>li:last-child:hover {
|
||||
color: var(--bg2font);
|
||||
background-color: var(--bg2color);
|
||||
border-top: 5px solid var(--bg2color);
|
||||
}
|
||||
|
||||
#MSearchResultsWindow {
|
||||
border: 1px solid var(--bg3font2);
|
||||
background-color: var(--bg3color);
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
body.SRPage, body.SRPage * {
|
||||
font-family: Arial;
|
||||
}
|
||||
|
||||
/* Sub Menu */
|
||||
|
||||
#main-menu>li ul {
|
||||
transition: max-height 0.2s ease-in-out;
|
||||
padding: 0px;
|
||||
border-radius: 0px !important;
|
||||
}
|
||||
|
||||
#main-menu>li ul:before, #main-menu>li ul:after {
|
||||
border-width: 0px;
|
||||
}
|
||||
|
||||
#main-menu>li>ul li a, #main-menu>li>ul li {
|
||||
background-color: var(--bgcolor);
|
||||
color: var(--bgfont);
|
||||
background-image: none;
|
||||
}
|
||||
|
||||
#main-menu>li>ul li a:hover, #main-menu>li>ul li:hover {
|
||||
background-color: var(--bgfont2);
|
||||
color: var(--bgfont);
|
||||
}
|
||||
|
||||
/***********************************/
|
||||
|
||||
/************** Header *************/
|
||||
|
||||
/***********************************/
|
||||
|
||||
div.headertitle {
|
||||
padding: 5px 40px;
|
||||
}
|
||||
|
||||
div.header, div.header * {
|
||||
color: var(--bg3font);
|
||||
background-color: var(--bg3color);
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
div.summary {
|
||||
padding-right: 40px;
|
||||
}
|
||||
|
||||
/***********************************/
|
||||
|
||||
/************** Link *************/
|
||||
|
||||
/***********************************/
|
||||
|
||||
a, a:visited, a:active, .contents a:visited, body.SRPage a, body.SRPage a:visited, body.SRPage a:active {
|
||||
color: var(--bgfont);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a:hover, .contents a:hover, body.SRPage a:hover {
|
||||
color: var(--bgfont-hover);
|
||||
text-decoration: var(--bgfont-hover-text-decoration);
|
||||
}
|
||||
|
||||
/***********************************/
|
||||
|
||||
/************ Nav-path ************/
|
||||
|
||||
/***********************************/
|
||||
|
||||
#nav-path, #nav-path ul {
|
||||
background-image: none;
|
||||
}
|
||||
|
||||
#nav-path ul {
|
||||
padding: 5px 30px;
|
||||
}
|
||||
|
||||
#nav-path, #nav-path * {
|
||||
color: var(--bg3font2);
|
||||
background-color: var(--bg3color);
|
||||
border: none;
|
||||
font-family: Arial;
|
||||
}
|
||||
|
||||
li.navelem {
|
||||
background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHhtbG5zOnN2Z2pzPSJodHRwOi8vc3ZnanMuY29tL3N2Z2pzIiB3aWR0aD0iNTEyIiBoZWlnaHQ9IjUxMiIgeD0iMCIgeT0iMCIgdmlld0JveD0iMCAwIDI5Mi4zNTkgMjkyLjM1OSIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgNTEyIDUxMiIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSIgY2xhc3M9IiI+PGc+CjxnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+Cgk8cGF0aCBkPSJNMjIyLjk3OSwxMzMuMzMxTDk1LjA3Myw1LjQyNEM5MS40NTYsMS44MDcsODcuMTc4LDAsODIuMjI2LDBjLTQuOTUyLDAtOS4yMzMsMS44MDctMTIuODUsNS40MjQgICBjLTMuNjE3LDMuNjE3LTUuNDI0LDcuODk4LTUuNDI0LDEyLjg0N3YyNTUuODEzYzAsNC45NDgsMS44MDcsOS4yMzIsNS40MjQsMTIuODQ3YzMuNjIxLDMuNjE3LDcuOTAyLDUuNDI4LDEyLjg1LDUuNDI4ICAgYzQuOTQ5LDAsOS4yMy0xLjgxMSwxMi44NDctNS40MjhsMTI3LjkwNi0xMjcuOTA3YzMuNjE0LTMuNjEzLDUuNDI4LTcuODk3LDUuNDI4LTEyLjg0NyAgIEMyMjguNDA3LDE0MS4yMjksMjI2LjU5NCwxMzYuOTQ4LDIyMi45NzksMTMzLjMzMXoiIGZpbGw9IiM3ZDdkN2QiIGRhdGEtb3JpZ2luYWw9IiMwMDAwMDAiIHN0eWxlPSIiIGNsYXNzPSIiPjwvcGF0aD4KPC9nPgo8ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8L2c+CjxnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjwvZz4KPGcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPC9nPgo8ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8L2c+CjxnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjwvZz4KPGcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPC9nPgo8ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8L2c+CjxnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjwvZz4KPGcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPC9nPgo8ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8L2c+CjxnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjwvZz4KPGcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPC9nPgo8ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8L2c+CjxnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjwvZz4KPGcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPC9nPgo8L2c+PC9zdmc+);
|
||||
background-size: 9px;
|
||||
}
|
||||
|
||||
li.navelem a {
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
/***********************************/
|
||||
|
||||
/*************** mem ***************/
|
||||
|
||||
/***********************************/
|
||||
|
||||
.memtitle {
|
||||
padding: 15px;
|
||||
margin-top: 30px;
|
||||
border-top-left-radius: 0px;
|
||||
border-top-right-radius: 0px;
|
||||
}
|
||||
|
||||
.memtitle, .memtitle *, .memtitle a:visited {
|
||||
border: none;
|
||||
background-image: none;
|
||||
color: var(--mem-title-font);
|
||||
background-color: var(--mem-title-bg);
|
||||
}
|
||||
|
||||
.memproto {
|
||||
padding: 10px;
|
||||
text-shadow: none;
|
||||
padding: 20px;
|
||||
border-top-right-radius: 0px;
|
||||
-moz-border-radius-topright: 0px;
|
||||
-webkit-border-top-right-radius: 0px;
|
||||
}
|
||||
|
||||
.memproto, .memproto *, .memproto a:visited {
|
||||
border: none;
|
||||
background-image: none;
|
||||
background-color: var(--mem-subtitle-bg);
|
||||
color: var(--mem-subtitle-font);
|
||||
font-size: inherit;
|
||||
line-height: 100%
|
||||
}
|
||||
|
||||
.memproto a:hover {
|
||||
color: var(--mem-subtitle-font-hover);
|
||||
}
|
||||
|
||||
.memdoc {
|
||||
border-bottom: 1px solid var(--mem-content-border);
|
||||
border-left: 1px solid var(--mem-content-border);
|
||||
border-right: 1px solid var(--mem-content-border);
|
||||
background-color: var(--mem-content-bg);
|
||||
color: var(--mem-content-font);
|
||||
border-bottom-left-radius: 0px;
|
||||
border-bottom-right-radius: 0px;
|
||||
-moz-border-radius-bottomleft: 0px;
|
||||
-moz-border-radius-bottomright: 0px;
|
||||
-webkit-border-bottom-left-radius: 0px;
|
||||
-webkit-border-bottom-right-radius: 0px;
|
||||
}
|
||||
|
||||
.memdoc p, .memdoc dt {
|
||||
padding: 0px 20px;
|
||||
}
|
||||
|
||||
/***********************************/
|
||||
|
||||
/************* Contents ************/
|
||||
|
||||
/***********************************/
|
||||
|
||||
a.anchor {
|
||||
padding-top: 20px;
|
||||
}
|
||||
|
||||
/***********************************/
|
||||
|
||||
/************* fragment ************/
|
||||
|
||||
/***********************************/
|
||||
|
||||
h2.groupheader {
|
||||
color: #303030;
|
||||
font-size: 200%;
|
||||
font-weight: bold;
|
||||
border-bottom: none;
|
||||
padding-top: 20px;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
|
||||
div.fragment, pre.fragment {
|
||||
border: none;
|
||||
padding: 20px;
|
||||
margin: none;
|
||||
background-color: var(--code-bg);
|
||||
}
|
||||
|
||||
div.line {
|
||||
background-color: var(--code-bg);
|
||||
}
|
||||
|
||||
span.comment {
|
||||
color: var(--code-comment);
|
||||
}
|
||||
|
||||
span.keyword {
|
||||
color: var(--code-keyword);
|
||||
}
|
||||
|
||||
span.preprocessor {
|
||||
color: var(--code-preprocessor);
|
||||
}
|
||||
|
||||
span.keywordtype {
|
||||
color: var(--code-keywordtype);
|
||||
}
|
||||
|
||||
span.mlabel {
|
||||
background-color: var(--code-text);
|
||||
color: var(--code-bg);
|
||||
border-top: none;
|
||||
border-left: none;
|
||||
border-right: none;
|
||||
border-bottom: none;
|
||||
padding: 10px;
|
||||
border-radius: 0px;
|
||||
}
|
||||
|
||||
a.code {
|
||||
color: var(--code-code);
|
||||
}
|
||||
|
||||
span.lineno, span.lineno>* {
|
||||
color: var(--code-line);
|
||||
border-right: none;
|
||||
background-color: var(--code-bg);
|
||||
}
|
||||
|
||||
span.lineno a {
|
||||
background-color: var(--code-line-bg);
|
||||
}
|
||||
|
||||
span.lineno a:hover {
|
||||
color: var(--bg3font);
|
||||
background-color: var(--code-line-bg);
|
||||
}
|
||||
|
||||
/***********************************/
|
||||
|
||||
/************* directory ***********/
|
||||
|
||||
/***********************************/
|
||||
|
||||
.directory tr.even {
|
||||
background-color: inherit;
|
||||
}
|
||||
|
||||
.iconfclosed {
|
||||
background-image: url(closed-folder.png);
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.iconfopen {
|
||||
background-image: url(opened-folder.png);
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.icondoc {
|
||||
background-image: url(document.png);
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.arrow {
|
||||
color: #7d7d7d;
|
||||
}
|
||||
|
||||
.icona {
|
||||
vertical-align: middle;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.icon {
|
||||
background-color: var(--icon-bg);
|
||||
color: var(--icon-font);
|
||||
display: table-cell;
|
||||
vertical-align: middle;
|
||||
height: 20px;
|
||||
width: 20px;
|
||||
}
|
||||
|
||||
div.ah {
|
||||
background-color: var(--qindex-icon-bg);
|
||||
color: var(--qindex-icon-font);
|
||||
text-align: center;
|
||||
background-image: none;
|
||||
-webkit-box-shadow: none;
|
||||
box-shadow: none;
|
||||
-webkit-border-radius: 0px;
|
||||
border-radius: 0px;
|
||||
border: none;
|
||||
}
|
||||
|
||||
div.qindex {
|
||||
background-color: var(--qindex-menu-bg);
|
||||
border: none;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
a.qindex {
|
||||
color: var(--qindex-menu-font);
|
||||
font-weight: normal;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
a:hover.qindex {
|
||||
color: var(--qindex-menu-font-hover);
|
||||
}
|
||||
|
||||
a:visited.qindex {
|
||||
color: var(--qindex-menu-font);
|
||||
}
|
||||
|
||||
table.classindex {
|
||||
margin-top: 30px;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
table.classindex a.el {
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
/***********************************/
|
||||
|
||||
/************** footer *************/
|
||||
|
||||
/***********************************/
|
||||
|
||||
div.directory {
|
||||
border-top: 1px solid var(--bgborder);
|
||||
border-bottom: none;
|
||||
margin: 20px 0px;
|
||||
}
|
||||
|
||||
div.directory a.el {
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
div.directory>table {
|
||||
margin: 20px 0px;
|
||||
}
|
||||
|
||||
hr.footer {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.contents>hr {
|
||||
border-top: 0px;
|
||||
}
|
||||
|
||||
/***********************************/
|
||||
|
||||
/*********** memberdecls ***********/
|
||||
|
||||
/***********************************/
|
||||
|
||||
.memItemLeft, .memItemRight {
|
||||
padding: 15px 30px;
|
||||
background-color: inherit;
|
||||
}
|
||||
|
||||
.mdescRight {
|
||||
padding: 0px 30px 10px 30px;
|
||||
}
|
||||
|
||||
.memberdecls * {
|
||||
background-color: inherit;
|
||||
}
|
||||
|
||||
.memSeparator {
|
||||
border-bottom: 1px solid var(--bgborder2);
|
||||
}
|
||||
|
||||
.memTemplParams {
|
||||
color: var(--bgfont);
|
||||
}
|
||||
|
||||
/***********************************/
|
||||
|
||||
/*********** nav-tree ***********/
|
||||
|
||||
/***********************************/
|
||||
|
||||
#nav-tree-contents {
|
||||
background-color: var(--nav-tree-bg);
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
#side-nav, #nav-tree {
|
||||
background-image: none;
|
||||
background-color: var(--nav-tree-bg);
|
||||
}
|
||||
|
||||
#nav-tree .item {
|
||||
background-color: var(--nav-tree-bg);
|
||||
font-family: Arial;
|
||||
text-transform: uppercase;
|
||||
text-shadow: none;
|
||||
font-size: 14px;
|
||||
font-weight: 700;
|
||||
padding: 10px;
|
||||
color: var(--nav-tree-font);
|
||||
}
|
||||
|
||||
#nav-tree .arrow {
|
||||
color: var(--nav-tree-font);
|
||||
}
|
||||
|
||||
#nav-tree .selected {
|
||||
background-image: none;
|
||||
background-color: var(--nav-tree-bg-selected);
|
||||
}
|
||||
|
||||
#nav-tree .selected a {
|
||||
color: var(--nav-tree-font-selected);
|
||||
}
|
||||
|
||||
#nav-tree .item:hover {
|
||||
background-color: var(--nav-tree-bg-hover);
|
||||
color: var(--nav-tree-font-hover);
|
||||
}
|
||||
|
||||
#nav-tree .item a:hover {
|
||||
color: var(--nav-tree-font-hover);
|
||||
}
|
||||
|
||||
#side-nav .ui-resizable-e {
|
||||
background-image: none;
|
||||
background-color: var(--nav-tree-bg);
|
||||
}
|
||||
|
||||
#nav-sync {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
#nav-sync>img {
|
||||
content: url(off_sync.png);
|
||||
}
|
||||
|
||||
#nav-sync.sync>img {
|
||||
content: url(on_sync.png);
|
||||
}
|
||||
|
||||
/***********************************/
|
||||
|
||||
/*********** Plant UML ***********/
|
||||
|
||||
/***********************************/
|
||||
|
||||
.plantumlgraph > img {
|
||||
width: 80%;
|
||||
}
|
23
envsetup.sh
Executable file
@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
#Build Tools
|
||||
echo "Build Tools..."
|
||||
cd tools
|
||||
./build_tools.sh
|
||||
cd ..
|
||||
#Setup asset-arrays
|
||||
echo "Generate Asset-Arrays..."
|
||||
cd assets
|
||||
./build_assets.sh
|
||||
echo "Update Files in RenderD7..."
|
||||
cp -rf code/*.cpp ../source/
|
||||
cp -rf code/*.hpp ../include/renderd7/
|
||||
echo "Clean Assets..."
|
||||
./clear_assets.sh
|
||||
cd ..
|
||||
#Clear Tools
|
||||
echo "Clean Tools..."
|
||||
cd tools
|
||||
./clear_tools.sh
|
||||
cd ..
|
||||
#Finished
|
||||
echo "Done!"
|
320
external/fs.c
vendored
@ -1,320 +0,0 @@
|
||||
#include "external/fs.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
void Utils_U8_To_U16(u16 *buf, const u8 *input, size_t bufsize) {
|
||||
ssize_t units = utf8_to_utf16(buf, input, bufsize);
|
||||
|
||||
if (units < 0)
|
||||
units = 0;
|
||||
|
||||
buf[units] = 0;
|
||||
}
|
||||
|
||||
FS_Archive archive, sdmc_archive, nand_archive;
|
||||
|
||||
Result FS_OpenArchive(FS_Archive *archive, FS_ArchiveID archiveID) {
|
||||
Result ret = 0;
|
||||
|
||||
if (R_FAILED(ret = FSUSER_OpenArchive(archive, archiveID, fsMakePath(PATH_EMPTY, ""))))
|
||||
return ret;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Result FS_CloseArchive(FS_Archive archive) {
|
||||
Result ret = 0;
|
||||
|
||||
if (R_FAILED(ret = FSUSER_CloseArchive(archive)))
|
||||
return ret;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Result FS_OpenDir(Handle *handle, FS_Archive archive, const char *path) {
|
||||
Result ret = 0;
|
||||
|
||||
u16 path_u16[strlen(path) + 1];
|
||||
Utils_U8_To_U16(path_u16, (const u8 *)path, strlen(path) + 1);
|
||||
|
||||
if (R_FAILED(ret = FSUSER_OpenDirectory(handle, archive, fsMakePath(PATH_UTF16, path_u16))))
|
||||
return ret;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Result FS_OpenFile(Handle *handle, FS_Archive archive, const char *path, u32 flags, u32 attributes) {
|
||||
Result ret = 0;
|
||||
|
||||
u16 path_u16[strlen(path) + 1];
|
||||
Utils_U8_To_U16(path_u16, (const u8 *)path, strlen(path) + 1);
|
||||
|
||||
if (R_FAILED(ret = FSUSER_OpenFile(handle, archive, fsMakePath(PATH_UTF16, path_u16), flags, attributes)))
|
||||
return ret;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Result FS_MakeDir(FS_Archive archive, const char *path) {
|
||||
Result ret = 0;
|
||||
|
||||
u16 path_u16[strlen(path) + 1];
|
||||
Utils_U8_To_U16(path_u16, (const u8 *)path, strlen(path) + 1);
|
||||
|
||||
if (R_FAILED(ret = FSUSER_CreateDirectory(archive, fsMakePath(PATH_UTF16, path_u16), 0)))
|
||||
return ret;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Result FS_CreateFile(FS_Archive archive, const char *path, u64 size) {
|
||||
Result ret = 0;
|
||||
|
||||
u16 path_u16[strlen(path) + 1];
|
||||
Utils_U8_To_U16(path_u16, (const u8 *)path, strlen(path) + 1);
|
||||
|
||||
if (R_FAILED(ret = FSUSER_CreateFile(archive, fsMakePath(PATH_UTF16, path_u16), 0, size)))
|
||||
return ret;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Result FS_RecursiveMakeDir(FS_Archive archive, const char *path) {
|
||||
Result ret = 0;
|
||||
char buf[256];
|
||||
char *p = NULL;
|
||||
size_t len;
|
||||
|
||||
snprintf(buf, sizeof(buf), "%s", path);
|
||||
len = strlen(buf);
|
||||
|
||||
if (buf[len - 1] == '/')
|
||||
buf[len - 1] = 0;
|
||||
|
||||
for (p = buf + 1; *p; p++) {
|
||||
if (*p == '/') {
|
||||
*p = 0;
|
||||
|
||||
if (!FS_DirExists(archive, buf))
|
||||
ret = FS_MakeDir(archive, buf);
|
||||
|
||||
*p = '/';
|
||||
}
|
||||
|
||||
if (!FS_DirExists(archive, buf))
|
||||
ret = FS_MakeDir(archive, buf);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool FS_FileExists(FS_Archive archive, const char *path) {
|
||||
Handle handle;
|
||||
|
||||
u16 path_u16[strlen(path) + 1];
|
||||
Utils_U8_To_U16(path_u16, (const u8 *)path, strlen(path) + 1);
|
||||
|
||||
if (R_FAILED(FSUSER_OpenFile(&handle, archive, fsMakePath(PATH_UTF16, path_u16), FS_OPEN_READ, 0)))
|
||||
return false;
|
||||
|
||||
if (R_FAILED(FSFILE_Close(handle)))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool FS_DirExists(FS_Archive archive, const char *path) {
|
||||
Handle handle;
|
||||
|
||||
u16 path_u16[strlen(path) + 1];
|
||||
Utils_U8_To_U16(path_u16, (const u8 *)path, strlen(path) + 1);
|
||||
|
||||
if (R_FAILED(FSUSER_OpenDirectory(&handle, archive, fsMakePath(PATH_UTF16, path_u16))))
|
||||
return false;
|
||||
|
||||
if (R_FAILED(FSDIR_Close(handle)))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Result FS_GetFileSize(FS_Archive archive, const char *path, u64 *size) {
|
||||
Result ret = 0;
|
||||
Handle handle;
|
||||
|
||||
u16 path_u16[strlen(path) + 1];
|
||||
Utils_U8_To_U16(path_u16, (const u8 *)path, strlen(path) + 1);
|
||||
|
||||
if (R_FAILED(ret = FSUSER_OpenFile(&handle, archive, fsMakePath(PATH_UTF16, path_u16), FS_OPEN_READ, 0)))
|
||||
return ret;
|
||||
|
||||
if (R_FAILED(ret = FSFILE_GetSize(handle, size))) {
|
||||
FSFILE_Close(handle);
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (R_FAILED(ret = FSFILE_Close(handle)))
|
||||
return ret;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
u64 FS_GetFreeStorage(FS_SystemMediaType media_type) {
|
||||
FS_ArchiveResource resource = {0};
|
||||
|
||||
if (R_SUCCEEDED(FSUSER_GetArchiveResource(&resource, media_type)))
|
||||
return (((u64)resource.freeClusters * (u64)resource.clusterSize));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
u64 FS_GetTotalStorage(FS_SystemMediaType media_type) {
|
||||
FS_ArchiveResource resource = {0};
|
||||
|
||||
if (R_SUCCEEDED(FSUSER_GetArchiveResource(&resource, media_type)))
|
||||
return (((u64)resource.totalClusters * (u64)resource.clusterSize));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
u64 FS_GetUsedStorage(FS_SystemMediaType media_type) {
|
||||
return (FS_GetTotalStorage(media_type) - FS_GetUsedStorage(media_type));
|
||||
}
|
||||
|
||||
Result FS_RemoveFile(FS_Archive archive, const char *path) {
|
||||
Result ret = 0;
|
||||
|
||||
u16 path_u16[strlen(path) + 1];
|
||||
Utils_U8_To_U16(path_u16, (const u8 *)path, strlen(path) + 1);
|
||||
|
||||
if (R_FAILED(ret = FSUSER_DeleteFile(archive, fsMakePath(PATH_UTF16, path_u16))))
|
||||
return ret;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Result FS_RemoveDir(FS_Archive archive, const char *path) {
|
||||
Result ret = 0;
|
||||
|
||||
u16 path_u16[strlen(path) + 1];
|
||||
Utils_U8_To_U16(path_u16, (const u8 *)path, strlen(path) + 1);
|
||||
|
||||
if (R_FAILED(ret = FSUSER_DeleteDirectory(archive, fsMakePath(PATH_UTF16, path_u16))))
|
||||
return ret;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Result FS_RemoveDirRecursive(FS_Archive archive, const char *path) {
|
||||
Result ret = 0;
|
||||
|
||||
u16 path_u16[strlen(path) + 1];
|
||||
Utils_U8_To_U16(path_u16, (const u8 *)path, strlen(path) + 1);
|
||||
|
||||
if (R_FAILED(ret = FSUSER_DeleteDirectoryRecursively(archive, fsMakePath(PATH_UTF16, path_u16))))
|
||||
return ret;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Result FS_RenameFile(FS_Archive archive, const char *old_filename, const char *new_filename) {
|
||||
Result ret = 0;
|
||||
|
||||
u16 old_filename_u16[strlen(old_filename) + 1];
|
||||
Utils_U8_To_U16(old_filename_u16, (const u8 *)old_filename, strlen(old_filename) + 1);
|
||||
|
||||
u16 new_filename_u16[strlen(new_filename) + 1];
|
||||
Utils_U8_To_U16(new_filename_u16, (const u8 *)new_filename, strlen(new_filename) + 1);
|
||||
|
||||
if (R_FAILED(ret = FSUSER_RenameFile(archive, fsMakePath(PATH_UTF16, old_filename_u16), archive, fsMakePath(PATH_UTF16, new_filename_u16))))
|
||||
return ret;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Result FS_RenameDir(FS_Archive archive, const char *old_dirname, const char *new_dirname) {
|
||||
Result ret = 0;
|
||||
|
||||
u16 old_dirname_u16[strlen(old_dirname) + 1];
|
||||
Utils_U8_To_U16(old_dirname_u16, (const u8 *)old_dirname, strlen(old_dirname) + 1);
|
||||
|
||||
u16 new_dirname_u16[strlen(new_dirname) + 1];
|
||||
Utils_U8_To_U16(new_dirname_u16, (const u8 *)new_dirname, strlen(new_dirname) + 1);
|
||||
|
||||
if (R_FAILED(ret = FSUSER_RenameDirectory(archive, fsMakePath(PATH_UTF16, old_dirname_u16), archive, fsMakePath(PATH_UTF16, new_dirname_u16))))
|
||||
return ret;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Result FS_Read(FS_Archive archive, const char *path, u64 size, void *buf) {
|
||||
Result ret = 0;
|
||||
Handle handle;
|
||||
|
||||
u32 bytes_read = 0;
|
||||
|
||||
if (R_FAILED(ret = FS_OpenFile(&handle, archive, path, FS_OPEN_READ, 0)))
|
||||
return ret;
|
||||
|
||||
if (R_FAILED(ret = FSFILE_Read(handle, &bytes_read, 0, buf, size))) {
|
||||
FSFILE_Close(handle);
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (R_FAILED(ret = FSFILE_Close(handle)))
|
||||
return ret;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Result FS_Write(FS_Archive archive, const char *path, const void *buf, u32 size) {
|
||||
Result ret = 0;
|
||||
Handle handle;
|
||||
u32 bytes_written = 0;
|
||||
|
||||
if (FS_FileExists(archive, path))
|
||||
FS_RemoveFile(archive, path);
|
||||
|
||||
u16 path_u16[strlen(path) + 1];
|
||||
Utils_U8_To_U16(path_u16, (const u8 *)path, strlen(path) + 1);
|
||||
|
||||
if (R_FAILED(ret = FSUSER_CreateFile(archive, fsMakePath(PATH_UTF16, path_u16), 0, size)))
|
||||
return ret;
|
||||
|
||||
if (R_FAILED(ret = FSUSER_OpenFile(&handle, archive, fsMakePath(PATH_UTF16, path_u16), FS_OPEN_WRITE, 0)))
|
||||
return ret;
|
||||
|
||||
if (R_FAILED(ret = FSFILE_Write(handle, &bytes_written, 0, buf, size, FS_WRITE_FLUSH))) {
|
||||
FSFILE_Close(handle);
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (R_FAILED(ret = FSFILE_Close(handle)))
|
||||
return ret;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
char *FS_GetFileTimestamp(const char *path) {
|
||||
static char timeStr[60];
|
||||
u64 mtime = 0;
|
||||
|
||||
if (R_SUCCEEDED(archive_getmtime(path, &mtime))) {
|
||||
time_t mt = mtime;
|
||||
struct tm *timeStruct = gmtime(&mt);
|
||||
|
||||
int hours = timeStruct->tm_hour;
|
||||
int minutes = timeStruct->tm_min;
|
||||
|
||||
int day = timeStruct->tm_mday;
|
||||
int month = timeStruct->tm_mon + 1; // January being 0
|
||||
int year = timeStruct->tm_year + 1900;
|
||||
|
||||
snprintf(timeStr, 60, "%d/%d/%d %2i:%02i", year, month, day, hours, minutes);
|
||||
}
|
||||
else
|
||||
return NULL;
|
||||
|
||||
return timeStr;
|
||||
}
|
30
external/fs.h
vendored
@ -1,30 +0,0 @@
|
||||
#ifndef _3D_SHELL_FS_H
|
||||
#define _3D_SHELL_FS_H
|
||||
|
||||
#include <3ds.h>
|
||||
|
||||
extern FS_Archive archive, sdmc_archive, nand_archive;
|
||||
|
||||
Result FS_OpenArchive(FS_Archive *archive, FS_ArchiveID id);
|
||||
Result FS_CloseArchive(FS_Archive archive);
|
||||
Result FS_OpenDir(Handle *handle, FS_Archive archive, const char *path);
|
||||
Result FS_OpenFile(Handle *handle, FS_Archive archive, const char *path, u32 flags, u32 attributes);
|
||||
Result FS_MakeDir(FS_Archive archive, const char *path);
|
||||
Result FS_CreateFile(FS_Archive archive, const char *path, u64 size);
|
||||
Result FS_RecursiveMakeDir(FS_Archive archive, const char *path);
|
||||
bool FS_FileExists(FS_Archive archive, const char *path);
|
||||
bool FS_DirExists(FS_Archive archive, const char *path);
|
||||
Result FS_GetFileSize(FS_Archive archive, const char *path, u64 *size);
|
||||
u64 FS_GetFreeStorage(FS_SystemMediaType media_type);
|
||||
u64 FS_GetTotalStorage(FS_SystemMediaType media_type);
|
||||
u64 FS_GetUsedStorage(FS_SystemMediaType media_type);
|
||||
Result FS_RemoveFile(FS_Archive archive, const char *path);
|
||||
Result FS_RemoveDir(FS_Archive archive, const char *path);
|
||||
Result FS_RemoveDirRecursive(FS_Archive archive, const char *path);
|
||||
Result FS_RenameFile(FS_Archive archive, const char *old_filename, const char *new_filename);
|
||||
Result FS_RenameDir(FS_Archive archive, const char *old_dirname, const char *new_dirname);
|
||||
Result FS_Read(FS_Archive archive, const char *path, u64 size, void *buf);
|
||||
Result FS_Write(FS_Archive archive, const char *path, const void *buf, u32 size);
|
||||
char *FS_GetFileTimestamp(const char *path);
|
||||
|
||||
#endif
|
6464
external/lodepng.cpp
vendored
3185
external/source/jpgd.cpp
vendored
Normal file
1246
external/source/jpge.cpp
vendored
Normal file
7737
external/source/lodepng.cpp
vendored
Normal file
44
external/tween-engine/Makefile
vendored
@ -1,44 +0,0 @@
|
||||
PROJECT = libtween
|
||||
CXX = arm-none-eabi-g++
|
||||
AR = arm-none-eabi-ar
|
||||
CXXFLAGS = -g -Wall -pedantic -std=c++11 -fno-rtti -fno-exceptions
|
||||
|
||||
INCLUDES = -Iinclude/
|
||||
SOURCES = $(wildcard src/*.cpp) $(wildcard src/*/*.cpp)
|
||||
OBJECTS = $(SOURCES:src/%.cpp=build/arm/%.o)
|
||||
|
||||
TEST_CXX = g++
|
||||
TEST_AR = ar
|
||||
TEST_CXXFLAGS = -g -Wall -pedantic -std=c++11 -fno-rtti -fno-exceptions -DTESTING
|
||||
TEST_OBJECTS = $(SOURCES:src/%.cpp=build/test/%.o)
|
||||
|
||||
.PHONY: all dir clean test
|
||||
|
||||
all: dir $(PROJECT).a
|
||||
|
||||
test: dir $(PROJECT)-test.a
|
||||
|
||||
dir:
|
||||
@mkdir -p build/arm/equations
|
||||
@mkdir -p build/arm/paths
|
||||
@mkdir -p build/test/equations
|
||||
@mkdir -p build/test/paths
|
||||
@mkdir -p lib
|
||||
|
||||
$(PROJECT).a: $(OBJECTS)
|
||||
$(AR) rvs lib/$@ $^
|
||||
$(PROJECT)-test.a: $(TEST_OBJECTS)
|
||||
$(TEST_AR) rvs lib/$@ $^
|
||||
|
||||
clean:
|
||||
@rm -rf build
|
||||
@rm -rf lib
|
||||
@echo "Successfully cleaned."
|
||||
|
||||
build/arm/%.o: src/%.cpp
|
||||
$(CXX) $(INCLUDES) $(CXXFLAGS) -c $< -o $@
|
||||
$(CXX) -MM $< > build/arm/$*.d
|
||||
|
||||
build/test/%.o: src/%.cpp
|
||||
$(TEST_CXX) $(INCLUDES) $(TEST_CXXFLAGS) -c $< -o $@
|
||||
$(TEST_CXX) -MM $< > build/test/$*.d
|
1
external/tween-engine/build/arm/BaseTween.d
vendored
@ -1 +0,0 @@
|
||||
BaseTween.o: src/BaseTween.cpp
|
BIN
external/tween-engine/build/arm/BaseTween.o
vendored
1
external/tween-engine/build/arm/Tween.d
vendored
@ -1 +0,0 @@
|
||||
Tween.o: src/Tween.cpp
|
BIN
external/tween-engine/build/arm/Tween.o
vendored
@ -1 +0,0 @@
|
||||
TweenEquations.o: src/TweenEquations.cpp
|
BIN
external/tween-engine/build/arm/TweenEquations.o
vendored
@ -1 +0,0 @@
|
||||
TweenManager.o: src/TweenManager.cpp
|
BIN
external/tween-engine/build/arm/TweenManager.o
vendored
1
external/tween-engine/build/arm/TweenPaths.d
vendored
@ -1 +0,0 @@
|
||||
TweenPaths.o: src/TweenPaths.cpp
|
BIN
external/tween-engine/build/arm/TweenPaths.o
vendored
1
external/tween-engine/build/arm/TweenPool.d
vendored
@ -1 +0,0 @@
|
||||
TweenPool.o: src/TweenPool.cpp
|
BIN
external/tween-engine/build/arm/TweenPool.o
vendored
@ -1 +0,0 @@
|
||||
Back.o: src/equations/Back.cpp
|
BIN
external/tween-engine/build/arm/equations/Back.o
vendored
@ -1 +0,0 @@
|
||||
Bounce.o: src/equations/Bounce.cpp
|
BIN
external/tween-engine/build/arm/equations/Bounce.o
vendored
@ -1 +0,0 @@
|
||||
Circ.o: src/equations/Circ.cpp
|
BIN
external/tween-engine/build/arm/equations/Circ.o
vendored
@ -1 +0,0 @@
|
||||
Cubic.o: src/equations/Cubic.cpp
|
BIN
external/tween-engine/build/arm/equations/Cubic.o
vendored
@ -1 +0,0 @@
|
||||
Elastic.o: src/equations/Elastic.cpp
|
BIN
external/tween-engine/build/arm/equations/Elastic.o
vendored
@ -1 +0,0 @@
|
||||
Expo.o: src/equations/Expo.cpp
|
BIN
external/tween-engine/build/arm/equations/Expo.o
vendored
@ -1 +0,0 @@
|
||||
Linear.o: src/equations/Linear.cpp
|
BIN
external/tween-engine/build/arm/equations/Linear.o
vendored
@ -1 +0,0 @@
|
||||
Quad.o: src/equations/Quad.cpp
|
BIN
external/tween-engine/build/arm/equations/Quad.o
vendored
@ -1 +0,0 @@
|
||||
Quart.o: src/equations/Quart.cpp
|
BIN
external/tween-engine/build/arm/equations/Quart.o
vendored
@ -1 +0,0 @@
|
||||
Quint.o: src/equations/Quint.cpp
|
BIN
external/tween-engine/build/arm/equations/Quint.o
vendored
@ -1 +0,0 @@
|
||||
Sine.o: src/equations/Sine.cpp
|
BIN
external/tween-engine/build/arm/equations/Sine.o
vendored
@ -1 +0,0 @@
|
||||
CatmullRom.o: src/paths/CatmullRom.cpp
|
BIN
external/tween-engine/build/arm/paths/CatmullRom.o
vendored
@ -1 +0,0 @@
|
||||
LinearPath.o: src/paths/LinearPath.cpp
|
BIN
external/tween-engine/build/arm/paths/LinearPath.o
vendored
@ -1,172 +0,0 @@
|
||||
//
|
||||
// BaseTween.h
|
||||
//
|
||||
// This code is derived from Universal Tween Engine
|
||||
// Licensed under Apache License 2.0 - http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
|
||||
/**
|
||||
* BaseTween is the base class of Tween and Timeline. It defines the
|
||||
* iteration engine used to play animations for any number of times, and in
|
||||
* any direction, at any speed.
|
||||
* <p/>
|
||||
*
|
||||
* It is responsible for calling the different callbacks at the right moments,
|
||||
* and for making sure that every callbacks are triggered, even if the update
|
||||
* engine gets a big delta time at once.
|
||||
*
|
||||
* @see Tween
|
||||
* @see Timeline
|
||||
* @author Aurelien Ribon | http://www.aurelienribon.com/
|
||||
*/
|
||||
|
||||
#ifndef __BaseTween__
|
||||
#define __BaseTween__
|
||||
|
||||
#include <functional>
|
||||
#include <map>
|
||||
#include <TweenEngine/TweenCallback.h>
|
||||
|
||||
namespace TweenEngine
|
||||
{
|
||||
class TweenManager;
|
||||
|
||||
typedef std::function<void(BaseTween* source)> TweenCallbackFunction;
|
||||
|
||||
class BaseTween
|
||||
{
|
||||
private:
|
||||
// General
|
||||
int step;
|
||||
int repeatCnt;
|
||||
bool isIterationStep;
|
||||
bool isYoyoFlag;
|
||||
|
||||
// Timings
|
||||
float repeatDelay;
|
||||
float currentTime;
|
||||
float deltaTime;
|
||||
bool isStartedFlag; // true when the object is started
|
||||
bool isInitializedFlag; // true after the delay
|
||||
bool isFinishedFlag; // true when all repetitions are done
|
||||
bool isKilledFlag; // true if kill() was called
|
||||
bool isPausedFlag; // true if pause() was called
|
||||
|
||||
// Misc
|
||||
TweenCallback *callback;
|
||||
int callbackTriggers;
|
||||
void *userData;
|
||||
std::map<int, TweenCallbackFunction> callbacks;
|
||||
|
||||
// Update
|
||||
void initialize();
|
||||
void testRelaunch();
|
||||
void updateStep();
|
||||
void testCompletion();
|
||||
|
||||
protected:
|
||||
// Timings
|
||||
float delayStart;
|
||||
float duration;
|
||||
|
||||
virtual void reset();
|
||||
virtual void forceStartValues() = 0;
|
||||
virtual void forceEndValues() = 0;
|
||||
virtual void initializeOverride();
|
||||
virtual void updateOverride(int step, int lastStep, bool isIterationStep, float delta);
|
||||
virtual void forceToStart();
|
||||
virtual void forceToEnd(float time);
|
||||
|
||||
void callCallback(int type);
|
||||
bool isReverse(int step);
|
||||
bool isValid(int step);
|
||||
|
||||
public:
|
||||
virtual ~BaseTween() {}
|
||||
|
||||
virtual int getTweenCount() = 0;
|
||||
virtual int getTimelineCount() = 0;
|
||||
|
||||
// Package access
|
||||
bool isAutoRemoveEnabled;
|
||||
bool isAutoStartEnabled;
|
||||
|
||||
virtual BaseTween &build();
|
||||
BaseTween &start();
|
||||
BaseTween &start(TweenManager &manager);
|
||||
BaseTween &delay(float delay);
|
||||
void kill();
|
||||
virtual void free();
|
||||
void pause();
|
||||
void resume();
|
||||
BaseTween &repeat(int count, float delay);
|
||||
BaseTween &repeatYoyo(int count, float delay);
|
||||
BaseTween &setCallback(TweenCallback *callback);
|
||||
BaseTween &setCallback(int type, const TweenCallbackFunction& callback);
|
||||
BaseTween &setCallbackTriggers(int flags);
|
||||
BaseTween &setUserData(void *data);
|
||||
|
||||
// Getters
|
||||
float getDelay();
|
||||
float getDuration();
|
||||
int getRepeatCount();
|
||||
float getRepeatDelay();
|
||||
float getFullDuration();
|
||||
void *getUserData();
|
||||
int getStep();
|
||||
float getCurrentTime();
|
||||
bool isStarted();
|
||||
bool isInitialized();
|
||||
bool isFinished();
|
||||
bool isYoyo();
|
||||
bool isPaused();
|
||||
|
||||
// Update
|
||||
void update(float delta);
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif /* defined(__BaseTween__) */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
100
external/tween-engine/include/TweenEngine/Pool.h
vendored
@ -1,100 +0,0 @@
|
||||
//
|
||||
// Pool.h
|
||||
//
|
||||
// This code is derived from Universal Tween Engine
|
||||
// Licensed under Apache License 2.0 - http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
|
||||
/**
|
||||
* A light pool of objects that can be resused to avoid allocation.
|
||||
* Based on Nathan Sweet pool implementation
|
||||
*/
|
||||
|
||||
#ifndef __Pool__
|
||||
#define __Pool__
|
||||
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
|
||||
namespace TweenEngine
|
||||
{
|
||||
|
||||
template<typename T>
|
||||
class PoolCallback
|
||||
{
|
||||
public:
|
||||
virtual void onPool(T *obj) = 0;
|
||||
virtual void onUnPool(T *obj) = 0;
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
class Pool
|
||||
{
|
||||
private:
|
||||
std::vector<T *> objects;
|
||||
PoolCallback<T> *callback;
|
||||
|
||||
protected:
|
||||
virtual ~Pool() {}
|
||||
virtual T *create()=0;
|
||||
|
||||
public:
|
||||
Pool(int initCapacity, PoolCallback<T> *callback);
|
||||
T *get();
|
||||
void free(T *obj);
|
||||
void clear();
|
||||
int size();
|
||||
void ensureCapacity(int minCapacity);
|
||||
|
||||
};
|
||||
|
||||
// Implementation
|
||||
template <typename T>
|
||||
Pool<T>::Pool(int initCapacity, PoolCallback<T> *cb) : objects(initCapacity), callback(cb)
|
||||
{
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T *Pool<T>::get()
|
||||
{
|
||||
T *obj = nullptr;
|
||||
if (objects.empty())
|
||||
{
|
||||
obj = create();
|
||||
}
|
||||
else
|
||||
{
|
||||
obj = objects.back();
|
||||
objects.pop_back();
|
||||
if (obj == nullptr) obj = create();
|
||||
}
|
||||
if (callback != nullptr) callback->onUnPool(obj);
|
||||
return obj;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void Pool<T>::free(T *obj)
|
||||
{
|
||||
if (obj == nullptr) return;
|
||||
|
||||
bool contains = (std::find(objects.begin(), objects.end(), obj) != objects.end());
|
||||
|
||||
if (!contains)
|
||||
{
|
||||
if (callback != nullptr) callback->onPool(obj);
|
||||
objects.push_back(obj);
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void Pool<T>::clear() { objects.clear(); }
|
||||
|
||||
template <typename T>
|
||||
int Pool<T>::size() { return objects.size(); }
|
||||
|
||||
template <typename T>
|
||||
void Pool<T>::ensureCapacity(int minCapacity) { objects.reserve(minCapacity); }
|
||||
|
||||
}
|
||||
|
||||
#endif /* defined(__Pool__) */
|
116
external/tween-engine/include/TweenEngine/Tween.h
vendored
@ -1,116 +0,0 @@
|
||||
//
|
||||
// Tween.h
|
||||
//
|
||||
// This code is derived from Universal Tween Engine
|
||||
// Licensed under Apache License 2.0 - http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
|
||||
#ifndef __Tween__
|
||||
#define __Tween__
|
||||
|
||||
#include <TweenEngine/Tweenable.h>
|
||||
#include <TweenEngine/BaseTween.h>
|
||||
#include <TweenEngine/Pool.h>
|
||||
#include <TweenEngine/TweenEquation.h>
|
||||
#include <TweenEngine/TweenPath.h>
|
||||
#include <TweenEngine/TweenEquations.h>
|
||||
#include <TweenEngine/TweenPaths.h>
|
||||
|
||||
namespace TweenEngine
|
||||
{
|
||||
class TweenPool;
|
||||
class TweenPoolCallback;
|
||||
|
||||
class Tween : public BaseTween
|
||||
{
|
||||
friend class TweenPoolCallback;
|
||||
|
||||
private:
|
||||
static int combinedAttrsLimit;
|
||||
static int waypointsLimit;
|
||||
|
||||
// Main
|
||||
Tweenable *targetObj;
|
||||
int type;
|
||||
TweenEquation *equation;
|
||||
TweenPath *pathAlgorithm;
|
||||
|
||||
// General
|
||||
bool isFrom;
|
||||
bool isRelative;
|
||||
int combinedAttrsCnt;
|
||||
int waypointsCnt;
|
||||
|
||||
// Values
|
||||
float* startValues;
|
||||
float* targetValues;
|
||||
float* waypoints;
|
||||
|
||||
// Buffers
|
||||
float *accessorBuffer;
|
||||
int accessorBufferSize;
|
||||
float *pathBuffer;
|
||||
int pathBufferSize;
|
||||
|
||||
//static TweenPoolCallback *poolCallback;
|
||||
static TweenPool &pool;
|
||||
|
||||
void setup(Tweenable *target, int tweenType, float duration);
|
||||
|
||||
protected:
|
||||
virtual void reset();
|
||||
virtual void forceStartValues();
|
||||
virtual void forceEndValues();
|
||||
virtual void initializeOverride();
|
||||
virtual void updateOverride(int step, int lastStep, bool isIterationStep, float delta);
|
||||
|
||||
public:
|
||||
static const int ACCESSOR_READ = 0;
|
||||
static const int ACCESSOR_WRITE = 1;
|
||||
|
||||
static void setCombinedAttributesLimit(int limit);
|
||||
static void setWaypointsLimit(int limit);
|
||||
static const char *getVersion();
|
||||
|
||||
static int getPoolSize();
|
||||
static void ensurePoolCapacity(int minCapacity);
|
||||
|
||||
static Tween &to(Tweenable& target, int tweenType, float duration);
|
||||
static Tween &from(Tweenable& target, int tweenType, float duration);
|
||||
static Tween &set(Tweenable& target, int tweenType);
|
||||
static Tween &call(TweenCallback &callback);
|
||||
static Tween &mark();
|
||||
|
||||
Tween();
|
||||
~Tween();
|
||||
|
||||
virtual int getTweenCount();
|
||||
virtual int getTimelineCount();
|
||||
|
||||
virtual Tween &build();
|
||||
virtual void free();
|
||||
|
||||
Tween &ease(TweenEquation &easeEquation);
|
||||
Tween &target(float targetValue);
|
||||
Tween &target(float targetValue1, float targetValue2);
|
||||
Tween &target(float targetValue1, float targetValue2, float targetValue3);
|
||||
Tween &target(float *targetValues, int len);
|
||||
Tween &targetRelative(float targetValue);
|
||||
Tween &targetRelative(float targetValue1, float targetValue2);
|
||||
Tween &targetRelative(float targetValue1, float targetValue2, float targetValue3);
|
||||
Tween &targetRelative(float *targetValues, int len);
|
||||
Tween &waypoint(float targetValue);
|
||||
Tween &waypoint(float targetValue1, float targetValue2);
|
||||
Tween &waypoint(float targetValue1, float targetValue2, float targetValue3);
|
||||
Tween &waypoint(float *targetValues, int len);
|
||||
Tween &path(TweenPath &path);
|
||||
int getType();
|
||||
TweenEquation *getEasing();
|
||||
float *getTargetValues();
|
||||
int getCombinedAttributesCount();
|
||||
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
#endif /* defined(__Tween__) */
|
@ -1,103 +0,0 @@
|
||||
//
|
||||
// TweenAccessor.h
|
||||
//
|
||||
// This code is derived from Universal Tween Engine
|
||||
// Licensed under Apache License 2.0 - http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
|
||||
/**
|
||||
* The TweenAccessor interface lets you interpolate any attribute from any
|
||||
* object. Just implement it as you want and register it to the engine by
|
||||
* calling {@link Tween#registerAccessor}.
|
||||
* <p/>
|
||||
*
|
||||
* <h2>Example</h2>
|
||||
*
|
||||
* The following code snippet presents an example of implementation for tweening
|
||||
* a Particle class. This Particle class is supposed to only define a position
|
||||
* with an "x" and an "y" fields, and their associated getters and setters.
|
||||
* <p/>
|
||||
*
|
||||
* <pre> {@code
|
||||
* public class ParticleAccessor implements TweenAccessor<Particle> {
|
||||
* public static final int X = 1;
|
||||
* public static final int Y = 2;
|
||||
* public static final int XY = 3;
|
||||
*
|
||||
* public int getValues(Particle target, int tweenType, float[] returnValues) {
|
||||
* switch (tweenType) {
|
||||
* case X: returnValues[0] = target.getX(); return 1;
|
||||
* case Y: returnValues[0] = target.getY(); return 1;
|
||||
* case XY:
|
||||
* returnValues[0] = target.getX();
|
||||
* returnValues[1] = target.getY();
|
||||
* return 2;
|
||||
* default: assert false; return 0;
|
||||
* }
|
||||
* }
|
||||
*
|
||||
* public void setValues(Particle target, int tweenType, float[] newValues) {
|
||||
* switch (tweenType) {
|
||||
* case X: target.setX(newValues[0]); break;
|
||||
* case Y: target.setY(newValues[1]); break;
|
||||
* case XY:
|
||||
* target.setX(newValues[0]);
|
||||
* target.setY(newValues[1]);
|
||||
* break;
|
||||
* default: assert false; break;
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
* }</pre>
|
||||
*
|
||||
* Once done, you only need to register this TweenAccessor once to be able to
|
||||
* use it for every Particle objects in your application:
|
||||
* <p/>
|
||||
*
|
||||
* <pre> {@code
|
||||
* Tween.registerAccessor(Particle.class, new ParticleAccessor());
|
||||
* }</pre>
|
||||
*
|
||||
* And that's all, the Tween Engine can no work with all your particles!
|
||||
*
|
||||
* @author Aurelien Ribon | http://www.aurelienribon.com/
|
||||
*/
|
||||
|
||||
#ifndef __TweenAccessor__
|
||||
#define __TweenAccessor__
|
||||
|
||||
namespace TweenEngine
|
||||
{
|
||||
template<class T>
|
||||
class TweenAccessor
|
||||
{
|
||||
|
||||
public:
|
||||
virtual ~TweenAccessor() {}
|
||||
|
||||
/**
|
||||
* Gets one or many values from the target object associated to the
|
||||
* given tween type. It is used by the Tween Engine to determine starting
|
||||
* values.
|
||||
*
|
||||
* @param target The target object of the tween.
|
||||
* @param tweenType An integer representing the tween type.
|
||||
* @param returnValues An array which should be modified by this method.
|
||||
* @return The count of modified slots from the returnValues array.
|
||||
*/
|
||||
virtual int getValues(T& target, int tweenType, float *returnValues) = 0;
|
||||
|
||||
/**
|
||||
* This method is called by the Tween Engine each time a running tween
|
||||
* associated with the current target object has been updated.
|
||||
*
|
||||
* @param target The target object of the tween.
|
||||
* @param tweenType An integer representing the tween type.
|
||||
* @param newValues The new values determined by the Tween Engine.
|
||||
*/
|
||||
virtual void setValues(T& target, int tweenType, float *newValues) = 0;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif /* defined(__TweenAccessor__) */
|
@ -1,65 +0,0 @@
|
||||
//
|
||||
// TweenCallback.h
|
||||
//
|
||||
// This code is derived from Universal Tween Engine
|
||||
// Licensed under Apache License 2.0 - http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
|
||||
/**
|
||||
* TweenCallbacks are used to trigger actions at some specific times. They are
|
||||
* used in both Tweens and Timelines. The moment when the callback is
|
||||
* triggered depends on its registered triggers:
|
||||
* <p/>
|
||||
*
|
||||
* <b>BEGIN</b>: right after the delay (if any)<br/>
|
||||
* <b>START</b>: at each iteration beginning<br/>
|
||||
* <b>END</b>: at each iteration ending, before the repeat delay<br/>
|
||||
* <b>COMPLETE</b>: at last END event<br/>
|
||||
* <b>BACK_BEGIN</b>: at the beginning of the first backward iteration<br/>
|
||||
* <b>BACK_START</b>: at each backward iteration beginning, after the repeat delay<br/>
|
||||
* <b>BACK_END</b>: at each backward iteration ending<br/>
|
||||
* <b>BACK_COMPLETE</b>: at last BACK_END event
|
||||
* <p/>
|
||||
*
|
||||
* <pre> {@code
|
||||
* forward : BEGIN COMPLETE
|
||||
* forward : START END START END START END
|
||||
* |--------------[XXXXXXXXXX]------[XXXXXXXXXX]------[XXXXXXXXXX]
|
||||
* backward: bEND bSTART bEND bSTART bEND bSTART
|
||||
* backward: bCOMPLETE bBEGIN
|
||||
* }</pre>
|
||||
*
|
||||
* @see Tween
|
||||
* @see Timeline
|
||||
* @author Aurelien Ribon | http://www.aurelienribon.com/
|
||||
*/
|
||||
|
||||
#ifndef __TweenCallback__
|
||||
#define __TweenCallback__
|
||||
|
||||
namespace TweenEngine
|
||||
{
|
||||
class BaseTween;
|
||||
|
||||
class TweenCallback
|
||||
{
|
||||
|
||||
public:
|
||||
static const int BEGIN = 0x01;
|
||||
static const int START = 0x02;
|
||||
static const int END = 0x04;
|
||||
static const int COMPLETE = 0x08;
|
||||
static const int BACK_BEGIN = 0x10;
|
||||
static const int BACK_START = 0x20;
|
||||
static const int BACK_END = 0x40;
|
||||
static const int BACK_COMPLETE = 0x80;
|
||||
static const int ANY_FORWARD = 0x0F;
|
||||
static const int ANY_BACKWARD = 0xF0;
|
||||
static const int ANY = 0xFF;
|
||||
|
||||
virtual ~TweenCallback() {}
|
||||
virtual void onEvent(int type, BaseTween *source) = 0;
|
||||
};
|
||||
|
||||
}
|
||||
#endif /* defined(__TweenCallback__) */
|
@ -1,46 +0,0 @@
|
||||
//
|
||||
// TweenEquation.h
|
||||
//
|
||||
// This code is derived from Universal Tween Engine
|
||||
// Licensed under Apache License 2.0 - http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
|
||||
/**
|
||||
* Base class for every easing equation. You can create your own equations
|
||||
* and directly use them in the Tween engine by inheriting from this class.
|
||||
*
|
||||
* @see Tween
|
||||
* @author Aurelien Ribon | http://www.aurelienribon.com/
|
||||
*/
|
||||
|
||||
#ifndef __TweenEquation__
|
||||
#define __TweenEquation__
|
||||
|
||||
//#include <string.h>
|
||||
|
||||
namespace TweenEngine
|
||||
{
|
||||
class TweenEquation
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Computes the next value of the interpolation.
|
||||
*
|
||||
* @param t The current time, between 0 and 1.
|
||||
* @return The current value.
|
||||
*/
|
||||
virtual float compute(float t) = 0;
|
||||
|
||||
virtual const char *toString() = 0;
|
||||
|
||||
/**
|
||||
* Returns true if the given string is the name of this equation (the name
|
||||
* is returned in the toString() method, don't forget to override it).
|
||||
* This method is usually used to save/load a tween to/from a text file.
|
||||
*/
|
||||
//bool isValueOf(const char *str) { return !strcmp(str, toString()); };
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
#endif /* defined(__TweenEquation__) */
|
@ -1,63 +0,0 @@
|
||||
//
|
||||
// TweenEquations.h
|
||||
//
|
||||
// This code is derived from Universal Tween Engine
|
||||
// Licensed under Apache License 2.0 - http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
|
||||
#ifndef __TweenEquations__
|
||||
#define __TweenEquations__
|
||||
|
||||
#include <TweenEngine/equations/Quad.h>
|
||||
#include <TweenEngine/equations/Linear.h>
|
||||
#include <TweenEngine/equations/Back.h>
|
||||
#include <TweenEngine/equations/Bounce.h>
|
||||
#include <TweenEngine/equations/Circ.h>
|
||||
#include <TweenEngine/equations/Cubic.h>
|
||||
#include <TweenEngine/equations/Elastic.h>
|
||||
#include <TweenEngine/equations/Expo.h>
|
||||
#include <TweenEngine/equations/Quart.h>
|
||||
#include <TweenEngine/equations/Quint.h>
|
||||
#include <TweenEngine/equations/Sine.h>
|
||||
|
||||
namespace TweenEngine
|
||||
{
|
||||
class TweenEquations
|
||||
{
|
||||
public:
|
||||
static TweenEquation &easeInQuad;
|
||||
static TweenEquation &easeOutQuad;
|
||||
static TweenEquation &easeInOutQuad;
|
||||
static TweenEquation &easeInOutLinear;
|
||||
static TweenEquation &easeInBack;
|
||||
static TweenEquation &easeOutBack;
|
||||
static TweenEquation &easeInOutBack;
|
||||
static TweenEquation &easeInBounce;
|
||||
static TweenEquation &easeOutBounce;
|
||||
static TweenEquation &easeInOutBounce;
|
||||
static TweenEquation &easeInCirc;
|
||||
static TweenEquation &easeOutCirc;
|
||||
static TweenEquation &easeInOutCirc;
|
||||
static TweenEquation &easeInCubic;
|
||||
static TweenEquation &easeOutCubic;
|
||||
static TweenEquation &easeInOutCubic;
|
||||
static TweenEquation &easeInElastic;
|
||||
static TweenEquation &easeOutElastic;
|
||||
static TweenEquation &easeInOutElastic;
|
||||
static TweenEquation &easeInExpo;
|
||||
static TweenEquation &easeOutExpo;
|
||||
static TweenEquation &easeInOutExpo;
|
||||
static TweenEquation &easeInQuart;
|
||||
static TweenEquation &easeOutQuart;
|
||||
static TweenEquation &easeInOutQuart;
|
||||
static TweenEquation &easeInQuint;
|
||||
static TweenEquation &easeOutQuint;
|
||||
static TweenEquation &easeInOutQuint;
|
||||
static TweenEquation &easeInSine;
|
||||
static TweenEquation &easeOutSine;
|
||||
static TweenEquation &easeInOutSine;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif /* defined(__TweenEquations__) */
|
@ -1,61 +0,0 @@
|
||||
//
|
||||
// TweenManager.h
|
||||
//
|
||||
// This code is derived from Universal Tween Engine
|
||||
// Licensed under Apache License 2.0 - http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
|
||||
/**
|
||||
* A TweenManager updates all your tweens and timelines at once.
|
||||
* Its main interest is that it handles the tween/timeline life-cycles for you,
|
||||
* as well as the pooling constraints (if object pooling is enabled).
|
||||
* <p/>
|
||||
*
|
||||
* Just give it a bunch of tweens or timelines and call update() periodically,
|
||||
* you don't need to care for anything else! Relax and enjoy your animations.
|
||||
*
|
||||
* @see Tween
|
||||
* @see Timeline
|
||||
* @author Aurelien Ribon | http://www.aurelienribon.com/
|
||||
*/
|
||||
|
||||
#ifndef __TweenManager__
|
||||
#define __TweenManager__
|
||||
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
|
||||
#include <TweenEngine/BaseTween.h>
|
||||
|
||||
namespace TweenEngine
|
||||
{
|
||||
class TweenManager
|
||||
{
|
||||
private:
|
||||
std::vector<BaseTween *>objects;
|
||||
|
||||
bool isPaused = false;
|
||||
|
||||
public:
|
||||
TweenManager();
|
||||
|
||||
static void setAutoRemove(BaseTween &object, bool value);
|
||||
static void setAutoStart(BaseTween &object, bool value);
|
||||
|
||||
TweenManager &add(BaseTween &object);
|
||||
void killAll();
|
||||
void ensureCapacity(int minCapacity);
|
||||
void pause();
|
||||
void resume();
|
||||
void update(float delta);
|
||||
int size();
|
||||
|
||||
// Debug Helpers
|
||||
int getRunningTweensCount();
|
||||
int getRunningTimelinesCount();
|
||||
std::vector<BaseTween *> &getObjects();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif /* defined(__TweenManager__) */
|
@ -1,37 +0,0 @@
|
||||
//
|
||||
// TweenPath.h
|
||||
//
|
||||
// This code is derived from Universal Tween Engine
|
||||
// Licensed under Apache License 2.0 - http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
|
||||
/**
|
||||
* Base class for every paths. You can create your own paths and directly use
|
||||
* them in the Tween engine by inheriting from this class.
|
||||
*
|
||||
* @author Aurelien Ribon | http://www.aurelienribon.com/
|
||||
*/
|
||||
|
||||
#ifndef __TweenPath__
|
||||
#define __TweenPath__
|
||||
|
||||
namespace TweenEngine
|
||||
{
|
||||
class TweenPath
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Computes the next value of the interpolation, based on its waypoints and
|
||||
* the current progress.
|
||||
*
|
||||
* @param t The progress of the interpolation, between 0 and 1. May be out
|
||||
* of these bounds if the easing equation involves some kind of rebounds.
|
||||
* @param points The waypoints of the tween, from start to target values.
|
||||
* @param pointsCnt The number of valid points in the array.
|
||||
* @return The next value of the interpolation.
|
||||
*/
|
||||
virtual float compute(float t, float *points, int pointsCnt) = 0;
|
||||
};
|
||||
}
|
||||
|
||||
#endif /* defined(__TweenPath__) */
|
@ -1,23 +0,0 @@
|
||||
//
|
||||
// TweenPaths.h
|
||||
//
|
||||
// This code is derived from Universal Tween Engine
|
||||
// Licensed under Apache License 2.0 - http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
|
||||
#ifndef __TweenPaths__
|
||||
#define __TweenPaths__
|
||||
|
||||
#include <TweenEngine/TweenPath.h>
|
||||
|
||||
namespace TweenEngine
|
||||
{
|
||||
class TweenPaths
|
||||
{
|
||||
public:
|
||||
static TweenPath &linear;
|
||||
static TweenPath &catmullRom;
|
||||
};
|
||||
}
|
||||
|
||||
#endif /* defined(__TweenPaths__) */
|
@ -1,32 +0,0 @@
|
||||
//
|
||||
// TweenPool.h
|
||||
//
|
||||
// This code is derived from Universal Tween Engine
|
||||
// Licensed under Apache License 2.0 - http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
|
||||
#ifndef __TweenPool__
|
||||
#define __TweenPool__
|
||||
|
||||
#include <TweenEngine/Pool.h>
|
||||
#include <TweenEngine/Tween.h>
|
||||
|
||||
namespace TweenEngine
|
||||
{
|
||||
class TweenPoolCallback : public PoolCallback<Tween>
|
||||
{
|
||||
public:
|
||||
void onPool(Tween *obj);
|
||||
void onUnPool(Tween *obj);
|
||||
};
|
||||
|
||||
class TweenPool : public Pool<Tween>
|
||||
{
|
||||
protected:
|
||||
Tween *create();
|
||||
public:
|
||||
TweenPool();
|
||||
|
||||
};
|
||||
}
|
||||
#endif /* defined(__TweenPool__) */
|