Compare commits
72 Commits
v0.0.2
...
9745ccc7d6
| Author | SHA1 | Date | |
|---|---|---|---|
| 9745ccc7d6 | |||
| 94d92f2159 | |||
| 33cfea1f36 | |||
| c6a75e709e | |||
| 3534acd90f | |||
| 2e9df71b31 | |||
| 5f2644b52d | |||
| d6051486a8 | |||
| b2187bf0ad | |||
| 2aa9d07e43 | |||
| 8ff789c576 | |||
| 322fb2fea0 | |||
| 277aab1b81 | |||
| 30b4060fb5 | |||
| 0ffa2804d1 | |||
| abf1f4db7d | |||
| 1514338144 | |||
| 8af30e159d | |||
| 0259ca71ce | |||
| 2358cfd9a4 | |||
| 5e7c6ec891 | |||
| ef3be12b64 | |||
| 67fbbe1229 | |||
| d970988022 | |||
| e2bbc2d57f | |||
| 6b1f9d7354 | |||
| 5980400e2e | |||
| 9bb1882d92 | |||
| a54858e4c6 | |||
| 18e308bd03 | |||
| 2e4a32fed7 | |||
| c5ce91e653 | |||
| 412f88565a | |||
| 8451921161 | |||
| d6f304e6ca | |||
| 826c6600d0 | |||
| b166bab4f3 | |||
| efa49a98b7 | |||
| 3a9ab6a14a | |||
| d15037e7a3 | |||
| 0ff5820e6e | |||
| 5e96c1573b | |||
| 90273e87f2 | |||
| 1e106d75a3 | |||
| bd1a9557a5 | |||
| 831569cec6 | |||
| a5c1c7d4aa | |||
| 802d2ecb5a | |||
| ab605f7590 | |||
| 15d5af34b9 | |||
| 6d0e60e241 | |||
| 7b530968af | |||
| 930226cc47 | |||
| f9bf2f4b89 | |||
| df3ac5b5db | |||
| 2568eb7d18 | |||
| 2e3b4f4f0f | |||
| 5951a5e81c | |||
| 849386a3bc | |||
| 3e7ce71219 | |||
| 94fed9a810 | |||
| f4174724c6 | |||
|
|
def311c7dd | ||
|
|
45d2c8234a | ||
|
|
0f731530da | ||
|
|
2b75c510af | ||
|
|
d6e1e4a50e | ||
|
|
d62b310a21 | ||
|
|
cc2df5e4ec | ||
|
|
03259f323c | ||
|
|
913809a5f0 | ||
|
|
b1341d7da4 |
11
.github/workflows/release-build.yml
vendored
@@ -27,7 +27,8 @@ jobs:
|
|||||||
|
|
||||||
|
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
env:
|
||||||
|
VCPKG_BINARY_SOURCES: clear;files,${{ github.workspace }}/.vcpkg-cache,readwrite
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
@@ -48,7 +49,13 @@ jobs:
|
|||||||
- name: Setup MSVC
|
- name: Setup MSVC
|
||||||
if: matrix.platform == 'windows'
|
if: matrix.platform == 'windows'
|
||||||
uses: ilammy/msvc-dev-cmd@v1
|
uses: ilammy/msvc-dev-cmd@v1
|
||||||
|
- name: Cache vcpkg
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: .vcpkg-cache
|
||||||
|
key: ${{ runner.os }}-vcpkg-${{ hashFiles('vcpkg.json') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-vcpkg-
|
||||||
- name: Bootstrap vcpkg
|
- name: Bootstrap vcpkg
|
||||||
run: |
|
run: |
|
||||||
git clone https://github.com/microsoft/vcpkg.git
|
git clone https://github.com/microsoft/vcpkg.git
|
||||||
|
|||||||
1
.gitignore
vendored
@@ -41,6 +41,7 @@ CMakeError.log
|
|||||||
*~
|
*~
|
||||||
.DS_Store
|
.DS_Store
|
||||||
assets/config.toml
|
assets/config.toml
|
||||||
|
assets/server-config.toml
|
||||||
.venv/
|
.venv/
|
||||||
pyout/
|
pyout/
|
||||||
vcpkg_installed/
|
vcpkg_installed/
|
||||||
251
AGENTS.md
Normal file
@@ -0,0 +1,251 @@
|
|||||||
|
# Code Modification Guidelines
|
||||||
|
|
||||||
|
## 1. Git Branch Protection
|
||||||
|
|
||||||
|
- Never modify code directly on the `main` branch.
|
||||||
|
- Before editing, check the current branch:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git branch --show-current
|
||||||
|
````
|
||||||
|
|
||||||
|
* If the result is `main`, create or switch to a development branch first:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git checkout -b feature/xxx
|
||||||
|
```
|
||||||
|
|
||||||
|
* Do not bypass branch protection by:
|
||||||
|
|
||||||
|
* Committing directly to `main`.
|
||||||
|
* Running code generation, formatting, or large refactors on `main`.
|
||||||
|
* Rewriting or damaging `main` history.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 2. Code Comments
|
||||||
|
|
||||||
|
* All new comments must be written in English.
|
||||||
|
* Comments must be:
|
||||||
|
|
||||||
|
* Short and clear.
|
||||||
|
* Explain the purpose, not repeat the code.
|
||||||
|
* Avoid unnecessary details.
|
||||||
|
|
||||||
|
Recommended:
|
||||||
|
|
||||||
|
```cpp
|
||||||
|
// AI-generated: Prevent stale handle access.
|
||||||
|
```
|
||||||
|
|
||||||
|
Avoid:
|
||||||
|
|
||||||
|
```cpp
|
||||||
|
// AI-generated: This checks if the handle is invalid because...
|
||||||
|
```
|
||||||
|
|
||||||
|
* Important AI-added or modified logic should include:
|
||||||
|
|
||||||
|
```cpp
|
||||||
|
// AI-generated
|
||||||
|
```
|
||||||
|
|
||||||
|
* Do not add comments for trivial changes such as:
|
||||||
|
|
||||||
|
* One or two line logic fixes.
|
||||||
|
* Spelling corrections.
|
||||||
|
* Simple variable renames.
|
||||||
|
|
||||||
|
### 2.1 Do not write excessive or granular comments
|
||||||
|
|
||||||
|
AI must avoid sprinkling small explanatory comments throughout code.
|
||||||
|
Specifically:
|
||||||
|
|
||||||
|
* **No line-by-line narration.** Do not add a comment above (or beside)
|
||||||
|
every field, signal, slot, branch, or block just to restate what it is.
|
||||||
|
If the name is self-explanatory, no comment is needed.
|
||||||
|
* **No multi-part explanations on a single marker.** A line like
|
||||||
|
`// AI-generated: abort the in-flight download; finished handler clears state.`
|
||||||
|
is too much. Either drop it, or shorten to a single short clause
|
||||||
|
(e.g. `// AI-generated: abort in-flight download.`).
|
||||||
|
* **Prefer zero or one comment per file/section**, not many. A short
|
||||||
|
header comment explaining the file's purpose is acceptable; dozens of
|
||||||
|
inline labels are not.
|
||||||
|
* **Do not comment obvious QML/C++ bindings, layout splits, or default
|
||||||
|
values** (e.g. `// AI-generated: index 0 -> zh_CN, index 1 -> en.`).
|
||||||
|
The code already says that.
|
||||||
|
* **When in doubt, omit the comment.** A missing comment is fine; a
|
||||||
|
redundant one is noise that future maintainers must clean up.
|
||||||
|
|
||||||
|
Rule of thumb: if removing the comment would not lose useful
|
||||||
|
information, remove it.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 3. Project Style
|
||||||
|
|
||||||
|
Follow the existing project style strictly:
|
||||||
|
|
||||||
|
* Naming conventions.
|
||||||
|
* File organization.
|
||||||
|
* Formatting rules.
|
||||||
|
* Include order.
|
||||||
|
* Existing architecture.
|
||||||
|
|
||||||
|
Do not:
|
||||||
|
|
||||||
|
* Introduce unrelated coding styles.
|
||||||
|
* Add unnecessary design patterns.
|
||||||
|
* Create duplicate systems.
|
||||||
|
* Add abstractions without need.
|
||||||
|
* Change module responsibilities.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 4. Modification Scope
|
||||||
|
|
||||||
|
Only modify the minimum code required.
|
||||||
|
|
||||||
|
Do not:
|
||||||
|
|
||||||
|
* Format unrelated files.
|
||||||
|
* Remove existing comments.
|
||||||
|
* Rename large numbers of symbols.
|
||||||
|
* Change public APIs.
|
||||||
|
* Perform large refactors without confirmation.
|
||||||
|
|
||||||
|
If large changes are required, explain first:
|
||||||
|
|
||||||
|
1. Current problem.
|
||||||
|
2. Required changes.
|
||||||
|
3. Affected modules.
|
||||||
|
4. Expected impact.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 5. Build and Test
|
||||||
|
|
||||||
|
After modifications:
|
||||||
|
|
||||||
|
* Verify compilation.
|
||||||
|
* Check for new warnings.
|
||||||
|
* Ensure existing features still work.
|
||||||
|
|
||||||
|
Do not:
|
||||||
|
|
||||||
|
* Commit without verification.
|
||||||
|
* Ignore compiler errors.
|
||||||
|
* Hide problems with temporary hacks.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 6. Compatibility
|
||||||
|
|
||||||
|
Consider:
|
||||||
|
|
||||||
|
* Existing callers.
|
||||||
|
* API/ABI compatibility.
|
||||||
|
* Serialization formats.
|
||||||
|
* Network protocols.
|
||||||
|
* Save data.
|
||||||
|
* Threading impact.
|
||||||
|
|
||||||
|
Do not:
|
||||||
|
|
||||||
|
* Change network structures without compatibility handling.
|
||||||
|
* Break old data formats.
|
||||||
|
* Change public data layouts carelessly.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 7. Multi-threading Safety
|
||||||
|
|
||||||
|
For multi-threaded code, check:
|
||||||
|
|
||||||
|
* Data races.
|
||||||
|
* Object lifetime.
|
||||||
|
* Lock contention.
|
||||||
|
* Atomic correctness.
|
||||||
|
* Cross-thread resource access.
|
||||||
|
|
||||||
|
Do not:
|
||||||
|
|
||||||
|
* Assume single-threaded execution.
|
||||||
|
* Modify shared data without protection.
|
||||||
|
* Add hidden locks that hurt performance.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 8. Memory Safety
|
||||||
|
|
||||||
|
Consider:
|
||||||
|
|
||||||
|
* Ownership.
|
||||||
|
* Lifetime.
|
||||||
|
* RAII.
|
||||||
|
* Memory leaks.
|
||||||
|
* Dangling references.
|
||||||
|
* Iterator invalidation.
|
||||||
|
|
||||||
|
Do not:
|
||||||
|
|
||||||
|
* Return references to local variables.
|
||||||
|
* Store pointers to temporary objects.
|
||||||
|
* Use uninitialized data.
|
||||||
|
* Introduce undefined behavior.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 9. Third-party Libraries
|
||||||
|
|
||||||
|
Before adding or changing dependencies:
|
||||||
|
|
||||||
|
Check:
|
||||||
|
|
||||||
|
* Existing project dependencies.
|
||||||
|
* Build system impact.
|
||||||
|
* Maintenance cost.
|
||||||
|
|
||||||
|
Do not:
|
||||||
|
|
||||||
|
* Add large libraries for simple features.
|
||||||
|
* Duplicate existing library functionality.
|
||||||
|
* Modify third-party source code.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 10. AI Behavior Rules
|
||||||
|
|
||||||
|
AI-generated code must:
|
||||||
|
|
||||||
|
* Reuse existing code first.
|
||||||
|
* Preserve current architecture.
|
||||||
|
* Prefer simple solutions.
|
||||||
|
* Minimize risk and code changes.
|
||||||
|
|
||||||
|
Do not:
|
||||||
|
|
||||||
|
* Guess requirements.
|
||||||
|
* Add unrequested features.
|
||||||
|
* Redesign architecture.
|
||||||
|
* Add unnecessary abstraction layers.
|
||||||
|
|
||||||
|
Choose the implementation with:
|
||||||
|
|
||||||
|
> The smallest change, lowest risk, and best compatibility with existing code.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 11. Pre-commit Checklist
|
||||||
|
|
||||||
|
Before committing:
|
||||||
|
|
||||||
|
* [ ] Not on `main`.
|
||||||
|
* [ ] Changes match the requested task.
|
||||||
|
* [ ] New comments are in English.
|
||||||
|
* [ ] AI changes are marked when needed.
|
||||||
|
* [ ] No unrelated formatting changes.
|
||||||
|
* [ ] Build passes.
|
||||||
|
* [ ] No obvious performance/security/thread issues.
|
||||||
|
* [ ] No API, protocol, or data format breakage.
|
||||||
|
|
||||||
@@ -1,4 +1,9 @@
|
|||||||
cmake_minimum_required(VERSION 3.21)
|
cmake_minimum_required(VERSION 3.21)
|
||||||
|
|
||||||
|
if(APPLE)
|
||||||
|
message(FATAL_ERROR "This game does not support macOS")
|
||||||
|
endif()
|
||||||
|
|
||||||
project(Cubed LANGUAGES C CXX)
|
project(Cubed LANGUAGES C CXX)
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 23)
|
set(CMAKE_CXX_STANDARD 23)
|
||||||
@@ -32,6 +37,10 @@ add_subdirectory(third_party/glad)
|
|||||||
|
|
||||||
add_subdirectory(third_party/imgui)
|
add_subdirectory(third_party/imgui)
|
||||||
|
|
||||||
|
add_subdirectory(third_party/dr_libs)
|
||||||
|
|
||||||
|
add_subdirectory(third_party/stb)
|
||||||
|
|
||||||
add_executable(${PROJECT_NAME})
|
add_executable(${PROJECT_NAME})
|
||||||
|
|
||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
@@ -121,15 +130,14 @@ target_include_directories(${PROJECT_NAME}
|
|||||||
|
|
||||||
target_link_libraries(${PROJECT_NAME}
|
target_link_libraries(${PROJECT_NAME}
|
||||||
PRIVATE
|
PRIVATE
|
||||||
glfw
|
SDL3::SDL3
|
||||||
glad
|
glad
|
||||||
glm::glm
|
|
||||||
OpenGL::GL
|
OpenGL::GL
|
||||||
soil2
|
|
||||||
Freetype::Freetype
|
Freetype::Freetype
|
||||||
tomlplusplus::tomlplusplus
|
|
||||||
imgui
|
imgui
|
||||||
|
dr_libs
|
||||||
tbb
|
tbb
|
||||||
|
stb
|
||||||
protobuf::libprotobuf
|
protobuf::libprotobuf
|
||||||
absl::log
|
absl::log
|
||||||
absl::check
|
absl::check
|
||||||
@@ -137,6 +145,10 @@ target_link_libraries(${PROJECT_NAME}
|
|||||||
absl::strings
|
absl::strings
|
||||||
absl::flat_hash_map
|
absl::flat_hash_map
|
||||||
zstd::zstd
|
zstd::zstd
|
||||||
|
OpenAL::OpenAL
|
||||||
|
harfbuzz::harfbuzz
|
||||||
|
Opus::Opus
|
||||||
|
assimp::assimp
|
||||||
$<$<PLATFORM_ID:Windows>:ws2_32>
|
$<$<PLATFORM_ID:Windows>:ws2_32>
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|||||||
4
assets/SensitiveLexicon.json
Normal file
@@ -8,4 +8,4 @@ is_passable = true
|
|||||||
is_transitional = false
|
is_transitional = false
|
||||||
is_transparent = true
|
is_transparent = true
|
||||||
name = 'grass'
|
name = 'grass'
|
||||||
roughness = 0.9
|
roughness = 0.90000000000000002
|
||||||
@@ -8,4 +8,4 @@ is_passable = false
|
|||||||
is_transitional = true
|
is_transitional = true
|
||||||
is_transparent = false
|
is_transparent = false
|
||||||
name = 'grass_block'
|
name = 'grass_block'
|
||||||
roughness = 0.9
|
roughness = 0.90000000000000002
|
||||||
@@ -8,4 +8,4 @@ is_passable = false
|
|||||||
is_transitional = false
|
is_transitional = false
|
||||||
is_transparent = true
|
is_transparent = true
|
||||||
name = 'leaf'
|
name = 'leaf'
|
||||||
roughness = 0.7
|
roughness = 0.69999999999999996
|
||||||
@@ -8,4 +8,4 @@ is_passable = false
|
|||||||
is_transitional = false
|
is_transitional = false
|
||||||
is_transparent = false
|
is_transparent = false
|
||||||
name = 'log'
|
name = 'log'
|
||||||
roughness = 0.7
|
roughness = 0.69999999999999996
|
||||||
@@ -8,4 +8,4 @@ is_passable = false
|
|||||||
is_transitional = true
|
is_transitional = true
|
||||||
is_transparent = false
|
is_transparent = false
|
||||||
name = 'sand'
|
name = 'sand'
|
||||||
roughness = 0.8
|
roughness = 0.80000000000000004
|
||||||
@@ -8,4 +8,4 @@ is_passable = false
|
|||||||
is_transitional = true
|
is_transitional = true
|
||||||
is_transparent = false
|
is_transparent = false
|
||||||
name = 'snowy_grass_block'
|
name = 'snowy_grass_block'
|
||||||
roughness = 0.9
|
roughness = 0.90000000000000002
|
||||||
BIN
assets/fonts/unifont_t-17.0.05.otf
Normal file
6
assets/item/air.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"id": 0,
|
||||||
|
"name": "air",
|
||||||
|
"description": "",
|
||||||
|
"type": "block"
|
||||||
|
}
|
||||||
7
assets/item/dirt.json
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"id": 2,
|
||||||
|
"name": "dirt",
|
||||||
|
"description": "",
|
||||||
|
"texture": "texture/item/block/dirt.png",
|
||||||
|
"type": "block"
|
||||||
|
}
|
||||||
7
assets/item/grass.json
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"id": 9,
|
||||||
|
"name": "grass",
|
||||||
|
"description": "",
|
||||||
|
"texture": "texture/item/block/grass.png",
|
||||||
|
"type": "block"
|
||||||
|
}
|
||||||
7
assets/item/grass_block.json
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"id": 1,
|
||||||
|
"name": "grass_block",
|
||||||
|
"description": "",
|
||||||
|
"texture": "texture/item/block/grass_block.png",
|
||||||
|
"type": "block"
|
||||||
|
}
|
||||||
7
assets/item/leaf.json
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"id": 6,
|
||||||
|
"name": "leaf",
|
||||||
|
"description": "",
|
||||||
|
"texture": "texture/item/block/leaf.png",
|
||||||
|
"type": "block"
|
||||||
|
}
|
||||||
7
assets/item/log.json
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"id": 5,
|
||||||
|
"name": "log",
|
||||||
|
"description": "",
|
||||||
|
"texture": "texture/item/block/log.png",
|
||||||
|
"type": "block"
|
||||||
|
}
|
||||||
8
assets/item/pig_spawn_egg.json
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"id": 10,
|
||||||
|
"name": "pig_spawn_egg",
|
||||||
|
"description": "",
|
||||||
|
"texture": "texture/item/spawn_egg/pig_spawn_egg.png",
|
||||||
|
"type": "spawn_egg",
|
||||||
|
"creature": "cubed:pig"
|
||||||
|
}
|
||||||
7
assets/item/sand.json
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"id": 4,
|
||||||
|
"name": "sand",
|
||||||
|
"description": "",
|
||||||
|
"texture": "texture/item/block/sand.png",
|
||||||
|
"type": "block"
|
||||||
|
}
|
||||||
7
assets/item/snowy_grass_block.json
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"id": 8,
|
||||||
|
"name": "snowy_grass_block",
|
||||||
|
"description": "",
|
||||||
|
"texture": "texture/item/block/snowy_grass_block.png",
|
||||||
|
"type": "block"
|
||||||
|
}
|
||||||
7
assets/item/stone.json
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"id": 3,
|
||||||
|
"name": "stone",
|
||||||
|
"description": "",
|
||||||
|
"texture": "texture/item/block/stone.png",
|
||||||
|
"type": "block"
|
||||||
|
}
|
||||||
7
assets/item/water.json
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"id": 7,
|
||||||
|
"name": "water",
|
||||||
|
"description": "",
|
||||||
|
"texture": "texture/item/block/water.png",
|
||||||
|
"type": "block"
|
||||||
|
}
|
||||||
50
assets/lang/en_US.json
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
{
|
||||||
|
"menu.settings": "Settings",
|
||||||
|
"menu.main.host_game": "Host Game",
|
||||||
|
"menu.main.join_game": "Join Game",
|
||||||
|
"menu.main.credits": "Credits",
|
||||||
|
"menu.main.quit": "Quit",
|
||||||
|
"menu.main.player_name": "Player: {name}",
|
||||||
|
"menu.main.cubed_version": "Cubed: {version}",
|
||||||
|
"menu.pause.pause_menu": "Pause Menu",
|
||||||
|
"menu.pause.back_to_game": "Back To Game",
|
||||||
|
"menu.pause.return_to_main_menu": "Return to Menu",
|
||||||
|
"button.done": "Done",
|
||||||
|
"button.return": "Return",
|
||||||
|
"settings.title": "Settings",
|
||||||
|
"settings.fov": "Fov: {fov}",
|
||||||
|
"settings.mouse_sensitivity": "Sensitivity: {sensitivity}",
|
||||||
|
"settings.distance": "Distance: {distance}",
|
||||||
|
"settings.music_volume": "Music: {music}",
|
||||||
|
"settings.sfx_volume": "SFX: {sfx}",
|
||||||
|
"settings.player_voice": "Player Voice: {volume}",
|
||||||
|
"settings.fullscreen": "fullscreen: {state}",
|
||||||
|
"settings.aniso": "Aniso: {aniso}",
|
||||||
|
"settings.vsync": "V-Sync: {state}",
|
||||||
|
"settings.language": "Language: {lang}",
|
||||||
|
"settings.restart_game_info": "You need to restart the game to apply this changes.",
|
||||||
|
"settings.voice_input": "Voice Input: {type}",
|
||||||
|
"voice_input.ptt": "PTT",
|
||||||
|
"voice_input.always": "always",
|
||||||
|
"common.on": "on",
|
||||||
|
"common.off": "off",
|
||||||
|
"hostgame.create_a_new_world": "Create A New World",
|
||||||
|
"hostgame.world_seed": "World Seed",
|
||||||
|
"hostgame.port": "Port",
|
||||||
|
"hostgame.create_world": "Create World",
|
||||||
|
"joingame.join_a_world": "Join A World",
|
||||||
|
"joingame.server_ip": "Server Ip",
|
||||||
|
"joingame.join_world": "Join World",
|
||||||
|
"error.disable_voice": "Server Disable Voice Chat",
|
||||||
|
"item.air.name": "air",
|
||||||
|
"item.dirt.name": "dirt",
|
||||||
|
"item.grass_block.name": "grass block",
|
||||||
|
"item.grass.name": "grass",
|
||||||
|
"item.leaf.name": "leaf",
|
||||||
|
"item.log.name": "log",
|
||||||
|
"item.sand.name": "sand",
|
||||||
|
"item.snowy_grass_block.name": "snowy grass block",
|
||||||
|
"item.stone.name": "stone",
|
||||||
|
"item.water.name": "water",
|
||||||
|
"item.pig_spawn_egg.name": "pig spawn egg"
|
||||||
|
}
|
||||||
50
assets/lang/zh_CN.json
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
{
|
||||||
|
"menu.settings": "设置",
|
||||||
|
"menu.main.host_game": "创建游戏",
|
||||||
|
"menu.main.join_game": "加入游戏",
|
||||||
|
"menu.main.credits": "制作人员",
|
||||||
|
"menu.main.quit": "退出",
|
||||||
|
"menu.main.player_name": "玩家:{name}",
|
||||||
|
"menu.main.cubed_version": "Cubed:{version}",
|
||||||
|
"menu.pause.pause_menu": "暂停菜单",
|
||||||
|
"menu.pause.back_to_game": "返回游戏",
|
||||||
|
"menu.pause.return_to_main_menu": "返回主菜单",
|
||||||
|
"button.done": "完成",
|
||||||
|
"button.return": "返回",
|
||||||
|
"settings.title": "设置",
|
||||||
|
"settings.fov": "视野:{fov}",
|
||||||
|
"settings.mouse_sensitivity": "灵敏度:{sensitivity}",
|
||||||
|
"settings.distance": "距离:{distance}",
|
||||||
|
"settings.music_volume": "音乐:{music}",
|
||||||
|
"settings.sfx_volume": "音效:{sfx}",
|
||||||
|
"settings.player_voice": "玩家语音:{volume}",
|
||||||
|
"settings.fullscreen": "全屏:{state}",
|
||||||
|
"settings.aniso": "各向异性过滤:{aniso}",
|
||||||
|
"settings.vsync": "垂直同步: {state}",
|
||||||
|
"settings.language": "语言: {lang}",
|
||||||
|
"settings.restart_game_info": "您需要重启游戏以应用这些更改。",
|
||||||
|
"settings.voice_input": "语音输入: {type}",
|
||||||
|
"voice_input.ptt": "按键通话",
|
||||||
|
"voice_input.always": "始终",
|
||||||
|
"common.on": "开",
|
||||||
|
"common.off": "关",
|
||||||
|
"hostgame.create_a_new_world": "创建新世界",
|
||||||
|
"hostgame.world_seed": "世界种子",
|
||||||
|
"hostgame.port": "端口",
|
||||||
|
"hostgame.create_world": "创建世界",
|
||||||
|
"joingame.join_a_world": "加入世界",
|
||||||
|
"joingame.server_ip": "服务器IP",
|
||||||
|
"joingame.join_world": "加入世界",
|
||||||
|
"error.disable_voice": "服务器已禁用语音聊天",
|
||||||
|
"item.air.name": "空气",
|
||||||
|
"item.dirt.name": "泥土",
|
||||||
|
"item.grass_block.name": "草方块",
|
||||||
|
"item.grass.name": "草",
|
||||||
|
"item.leaf.name": "树叶",
|
||||||
|
"item.log.name": "原木",
|
||||||
|
"item.sand.name": "沙子",
|
||||||
|
"item.snowy_grass_block.name": "覆雪草方块",
|
||||||
|
"item.stone.name": "石头",
|
||||||
|
"item.water.name": "水",
|
||||||
|
"item.pig_spawn_egg.name": "猪猪刷怪蛋"
|
||||||
|
}
|
||||||
90
assets/licenses/OFL-1.1.txt
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
The SIL Open Font License version 1.1 is copied below, and is also
|
||||||
|
available with a FAQ at http://scripts.sil.org/OFL.
|
||||||
|
|
||||||
|
|
||||||
|
-----------------------------------------------------------
|
||||||
|
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||||
|
-----------------------------------------------------------
|
||||||
|
|
||||||
|
PREAMBLE
|
||||||
|
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||||
|
development of collaborative font projects, to support the font creation
|
||||||
|
efforts of academic and linguistic communities, and to provide a free and
|
||||||
|
open framework in which fonts may be shared and improved in partnership
|
||||||
|
with others.
|
||||||
|
|
||||||
|
The OFL allows the licensed fonts to be used, studied, modified and
|
||||||
|
redistributed freely as long as they are not sold by themselves. The
|
||||||
|
fonts, including any derivative works, can be bundled, embedded,
|
||||||
|
redistributed and/or sold with any software provided that any reserved
|
||||||
|
names are not used by derivative works. The fonts and derivatives,
|
||||||
|
however, cannot be released under any other type of license. The
|
||||||
|
requirement for fonts to remain under this license does not apply
|
||||||
|
to any document created using the fonts or their derivatives.
|
||||||
|
|
||||||
|
DEFINITIONS
|
||||||
|
"Font Software" refers to the set of files released by the Copyright
|
||||||
|
Holder(s) under this license and clearly marked as such. This may
|
||||||
|
include source files, build scripts and documentation.
|
||||||
|
|
||||||
|
"Reserved Font Name" refers to any names specified as such after the
|
||||||
|
copyright statement(s).
|
||||||
|
|
||||||
|
"Original Version" refers to the collection of Font Software components as
|
||||||
|
distributed by the Copyright Holder(s).
|
||||||
|
|
||||||
|
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||||
|
or substituting -- in part or in whole -- any of the components of the
|
||||||
|
Original Version, by changing formats or by porting the Font Software to a
|
||||||
|
new environment.
|
||||||
|
|
||||||
|
"Author" refers to any designer, engineer, programmer, technical
|
||||||
|
writer or other person who contributed to the Font Software.
|
||||||
|
|
||||||
|
PERMISSION & CONDITIONS
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||||
|
redistribute, and sell modified and unmodified copies of the Font
|
||||||
|
Software, subject to the following conditions:
|
||||||
|
|
||||||
|
1) Neither the Font Software nor any of its individual components,
|
||||||
|
in Original or Modified Versions, may be sold by itself.
|
||||||
|
|
||||||
|
2) Original or Modified Versions of the Font Software may be bundled,
|
||||||
|
redistributed and/or sold with any software, provided that each copy
|
||||||
|
contains the above copyright notice and this license. These can be
|
||||||
|
included either as stand-alone text files, human-readable headers or
|
||||||
|
in the appropriate machine-readable metadata fields within text or
|
||||||
|
binary files as long as those fields can be easily viewed by the user.
|
||||||
|
|
||||||
|
3) No Modified Version of the Font Software may use the Reserved Font
|
||||||
|
Name(s) unless explicit written permission is granted by the corresponding
|
||||||
|
Copyright Holder. This restriction only applies to the primary font name as
|
||||||
|
presented to the users.
|
||||||
|
|
||||||
|
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||||
|
Software shall not be used to promote, endorse or advertise any
|
||||||
|
Modified Version, except to acknowledge the contribution(s) of the
|
||||||
|
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||||
|
permission.
|
||||||
|
|
||||||
|
5) The Font Software, modified or unmodified, in part or in whole,
|
||||||
|
must be distributed entirely under this license, and must not be
|
||||||
|
distributed under any other license. The requirement for fonts to
|
||||||
|
remain under this license does not apply to any document created
|
||||||
|
using the Font Software.
|
||||||
|
|
||||||
|
TERMINATION
|
||||||
|
This license becomes null and void if any of the above conditions are
|
||||||
|
not met.
|
||||||
|
|
||||||
|
DISCLAIMER
|
||||||
|
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||||
|
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||||
|
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||||
|
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||||
|
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||||
|
OTHER DEALINGS IN THE FONT SOFTWARE.
|
||||||
437
assets/licenses/OPENAL_SOFT_LICENSE.txt
Normal file
@@ -0,0 +1,437 @@
|
|||||||
|
GNU LIBRARY GENERAL PUBLIC LICENSE
|
||||||
|
Version 2, June 1991
|
||||||
|
|
||||||
|
Copyright (C) 1991 Free Software Foundation, Inc.
|
||||||
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
|
[This is the first released version of the library GPL. It is
|
||||||
|
numbered 2 because it goes with version 2 of the ordinary GPL.]
|
||||||
|
|
||||||
|
Preamble
|
||||||
|
|
||||||
|
The licenses for most software are designed to take away your
|
||||||
|
freedom to share and change it. By contrast, the GNU General Public
|
||||||
|
Licenses are intended to guarantee your freedom to share and change
|
||||||
|
free software--to make sure the software is free for all its users.
|
||||||
|
|
||||||
|
This license, the Library General Public License, applies to some
|
||||||
|
specially designated Free Software Foundation software, and to any
|
||||||
|
other libraries whose authors decide to use it. You can use it for
|
||||||
|
your libraries, too.
|
||||||
|
|
||||||
|
When we speak of free software, we are referring to freedom, not
|
||||||
|
price. Our General Public Licenses are designed to make sure that you
|
||||||
|
have the freedom to distribute copies of free software (and charge for
|
||||||
|
this service if you wish), that you receive source code or can get it
|
||||||
|
if you want it, that you can change the software or use pieces of it
|
||||||
|
in new free programs; and that you know you can do these things.
|
||||||
|
|
||||||
|
To protect your rights, we need to make restrictions that forbid
|
||||||
|
anyone to deny you these rights or to ask you to surrender the rights.
|
||||||
|
These restrictions translate to certain responsibilities for you if
|
||||||
|
you distribute copies of the library, or if you modify it.
|
||||||
|
|
||||||
|
For example, if you distribute copies of the library, whether gratis
|
||||||
|
or for a fee, you must give the recipients all the rights that we gave
|
||||||
|
you. You must make sure that they, too, receive or can get the source
|
||||||
|
code. If you link a program with the library, you must provide
|
||||||
|
complete object files to the recipients so that they can relink them
|
||||||
|
with the library, after making changes to the library and recompiling
|
||||||
|
it. And you must show them these terms so they know their rights.
|
||||||
|
|
||||||
|
Our method of protecting your rights has two steps: (1) copyright
|
||||||
|
the library, and (2) offer you this license which gives you legal
|
||||||
|
permission to copy, distribute and/or modify the library.
|
||||||
|
|
||||||
|
Also, for each distributor's protection, we want to make certain
|
||||||
|
that everyone understands that there is no warranty for this free
|
||||||
|
library. If the library is modified by someone else and passed on, we
|
||||||
|
want its recipients to know that what they have is not the original
|
||||||
|
version, so that any problems introduced by others will not reflect on
|
||||||
|
the original authors' reputations.
|
||||||
|
|
||||||
|
Finally, any free program is threatened constantly by software
|
||||||
|
patents. We wish to avoid the danger that companies distributing free
|
||||||
|
software will individually obtain patent licenses, thus in effect
|
||||||
|
transforming the program into proprietary software. To prevent this,
|
||||||
|
we have made it clear that any patent must be licensed for everyone's
|
||||||
|
free use or not licensed at all.
|
||||||
|
|
||||||
|
Most GNU software, including some libraries, is covered by the ordinary
|
||||||
|
GNU General Public License, which was designed for utility programs. This
|
||||||
|
license, the GNU Library General Public License, applies to certain
|
||||||
|
designated libraries. This license is quite different from the ordinary
|
||||||
|
one; be sure to read it in full, and don't assume that anything in it is
|
||||||
|
the same as in the ordinary license.
|
||||||
|
|
||||||
|
The reason we have a separate public license for some libraries is that
|
||||||
|
they blur the distinction we usually make between modifying or adding to a
|
||||||
|
program and simply using it. Linking a program with a library, without
|
||||||
|
changing the library, is in some sense simply using the library, and is
|
||||||
|
analogous to running a utility program or application program. However, in
|
||||||
|
a textual and legal sense, the linked executable is a combined work, a
|
||||||
|
derivative of the original library, and the ordinary General Public License
|
||||||
|
treats it as such.
|
||||||
|
|
||||||
|
Because of this blurred distinction, using the ordinary General
|
||||||
|
Public License for libraries did not effectively promote software
|
||||||
|
sharing, because most developers did not use the libraries. We
|
||||||
|
concluded that weaker conditions might promote sharing better.
|
||||||
|
|
||||||
|
However, unrestricted linking of non-free programs would deprive the
|
||||||
|
users of those programs of all benefit from the free status of the
|
||||||
|
libraries themselves. This Library General Public License is intended to
|
||||||
|
permit developers of non-free programs to use free libraries, while
|
||||||
|
preserving your freedom as a user of such programs to change the free
|
||||||
|
libraries that are incorporated in them. (We have not seen how to achieve
|
||||||
|
this as regards changes in header files, but we have achieved it as regards
|
||||||
|
changes in the actual functions of the Library.) The hope is that this
|
||||||
|
will lead to faster development of free libraries.
|
||||||
|
|
||||||
|
The precise terms and conditions for copying, distribution and
|
||||||
|
modification follow. Pay close attention to the difference between a
|
||||||
|
"work based on the library" and a "work that uses the library". The
|
||||||
|
former contains code derived from the library, while the latter only
|
||||||
|
works together with the library.
|
||||||
|
|
||||||
|
Note that it is possible for a library to be covered by the ordinary
|
||||||
|
General Public License rather than by this special one.
|
||||||
|
|
||||||
|
GNU LIBRARY GENERAL PUBLIC LICENSE
|
||||||
|
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||||
|
|
||||||
|
0. This License Agreement applies to any software library which
|
||||||
|
contains a notice placed by the copyright holder or other authorized
|
||||||
|
party saying it may be distributed under the terms of this Library
|
||||||
|
General Public License (also called "this License"). Each licensee is
|
||||||
|
addressed as "you".
|
||||||
|
|
||||||
|
A "library" means a collection of software functions and/or data
|
||||||
|
prepared so as to be conveniently linked with application programs
|
||||||
|
(which use some of those functions and data) to form executables.
|
||||||
|
|
||||||
|
The "Library", below, refers to any such software library or work
|
||||||
|
which has been distributed under these terms. A "work based on the
|
||||||
|
Library" means either the Library or any derivative work under
|
||||||
|
copyright law: that is to say, a work containing the Library or a
|
||||||
|
portion of it, either verbatim or with modifications and/or translated
|
||||||
|
straightforwardly into another language. (Hereinafter, translation is
|
||||||
|
included without limitation in the term "modification".)
|
||||||
|
|
||||||
|
"Source code" for a work means the preferred form of the work for
|
||||||
|
making modifications to it. For a library, complete source code means
|
||||||
|
all the source code for all modules it contains, plus any associated
|
||||||
|
interface definition files, plus the scripts used to control compilation
|
||||||
|
and installation of the library.
|
||||||
|
|
||||||
|
Activities other than copying, distribution and modification are not
|
||||||
|
covered by this License; they are outside its scope. The act of
|
||||||
|
running a program using the Library is not restricted, and output from
|
||||||
|
such a program is covered only if its contents constitute a work based
|
||||||
|
on the Library (independent of the use of the Library in a tool for
|
||||||
|
writing it). Whether that is true depends on what the Library does
|
||||||
|
and what the program that uses the Library does.
|
||||||
|
|
||||||
|
1. You may copy and distribute verbatim copies of the Library's
|
||||||
|
complete source code as you receive it, in any medium, provided that
|
||||||
|
you conspicuously and appropriately publish on each copy an
|
||||||
|
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||||
|
all the notices that refer to this License and to the absence of any
|
||||||
|
warranty; and distribute a copy of this License along with the
|
||||||
|
Library.
|
||||||
|
|
||||||
|
You may charge a fee for the physical act of transferring a copy,
|
||||||
|
and you may at your option offer warranty protection in exchange for a
|
||||||
|
fee.
|
||||||
|
|
||||||
|
2. You may modify your copy or copies of the Library or any portion
|
||||||
|
of it, thus forming a work based on the Library, and copy and
|
||||||
|
distribute such modifications or work under the terms of Section 1
|
||||||
|
above, provided that you also meet all of these conditions:
|
||||||
|
|
||||||
|
a) The modified work must itself be a software library.
|
||||||
|
|
||||||
|
b) You must cause the files modified to carry prominent notices
|
||||||
|
stating that you changed the files and the date of any change.
|
||||||
|
|
||||||
|
c) You must cause the whole of the work to be licensed at no
|
||||||
|
charge to all third parties under the terms of this License.
|
||||||
|
|
||||||
|
d) If a facility in the modified Library refers to a function or a
|
||||||
|
table of data to be supplied by an application program that uses
|
||||||
|
the facility, other than as an argument passed when the facility
|
||||||
|
is invoked, then you must make a good faith effort to ensure that,
|
||||||
|
in the event an application does not supply such function or
|
||||||
|
table, the facility still operates, and performs whatever part of
|
||||||
|
its purpose remains meaningful.
|
||||||
|
|
||||||
|
(For example, a function in a library to compute square roots has
|
||||||
|
a purpose that is entirely well-defined independent of the
|
||||||
|
application. Therefore, Subsection 2d requires that any
|
||||||
|
application-supplied function or table used by this function must
|
||||||
|
be optional: if the application does not supply it, the square
|
||||||
|
root function must still compute square roots.)
|
||||||
|
|
||||||
|
These requirements apply to the modified work as a whole. If
|
||||||
|
identifiable sections of that work are not derived from the Library,
|
||||||
|
and can be reasonably considered independent and separate works in
|
||||||
|
themselves, then this License, and its terms, do not apply to those
|
||||||
|
sections when you distribute them as separate works. But when you
|
||||||
|
distribute the same sections as part of a whole which is a work based
|
||||||
|
on the Library, the distribution of the whole must be on the terms of
|
||||||
|
this License, whose permissions for other licensees extend to the
|
||||||
|
entire whole, and thus to each and every part regardless of who wrote
|
||||||
|
it.
|
||||||
|
|
||||||
|
Thus, it is not the intent of this section to claim rights or contest
|
||||||
|
your rights to work written entirely by you; rather, the intent is to
|
||||||
|
exercise the right to control the distribution of derivative or
|
||||||
|
collective works based on the Library.
|
||||||
|
|
||||||
|
In addition, mere aggregation of another work not based on the Library
|
||||||
|
with the Library (or with a work based on the Library) on a volume of
|
||||||
|
a storage or distribution medium does not bring the other work under
|
||||||
|
the scope of this License.
|
||||||
|
|
||||||
|
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||||
|
License instead of this License to a given copy of the Library. To do
|
||||||
|
this, you must alter all the notices that refer to this License, so
|
||||||
|
that they refer to the ordinary GNU General Public License, version 2,
|
||||||
|
instead of to this License. (If a newer version than version 2 of the
|
||||||
|
ordinary GNU General Public License has appeared, then you can specify
|
||||||
|
that version instead if you wish.) Do not make any other change in
|
||||||
|
these notices.
|
||||||
|
|
||||||
|
Once this change is made in a given copy, it is irreversible for
|
||||||
|
that copy, so the ordinary GNU General Public License applies to all
|
||||||
|
subsequent copies and derivative works made from that copy.
|
||||||
|
|
||||||
|
This option is useful when you wish to copy part of the code of
|
||||||
|
the Library into a program that is not a library.
|
||||||
|
|
||||||
|
4. You may copy and distribute the Library (or a portion or
|
||||||
|
derivative of it, under Section 2) in object code or executable form
|
||||||
|
under the terms of Sections 1 and 2 above provided that you accompany
|
||||||
|
it with the complete corresponding machine-readable source code, which
|
||||||
|
must be distributed under the terms of Sections 1 and 2 above on a
|
||||||
|
medium customarily used for software interchange.
|
||||||
|
|
||||||
|
If distribution of object code is made by offering access to copy
|
||||||
|
from a designated place, then offering equivalent access to copy the
|
||||||
|
source code from the same place satisfies the requirement to
|
||||||
|
distribute the source code, even though third parties are not
|
||||||
|
compelled to copy the source along with the object code.
|
||||||
|
|
||||||
|
5. A program that contains no derivative of any portion of the
|
||||||
|
Library, but is designed to work with the Library by being compiled or
|
||||||
|
linked with it, is called a "work that uses the Library". Such a
|
||||||
|
work, in isolation, is not a derivative work of the Library, and
|
||||||
|
therefore falls outside the scope of this License.
|
||||||
|
|
||||||
|
However, linking a "work that uses the Library" with the Library
|
||||||
|
creates an executable that is a derivative of the Library (because it
|
||||||
|
contains portions of the Library), rather than a "work that uses the
|
||||||
|
library". The executable is therefore covered by this License.
|
||||||
|
Section 6 states terms for distribution of such executables.
|
||||||
|
|
||||||
|
When a "work that uses the Library" uses material from a header file
|
||||||
|
that is part of the Library, the object code for the work may be a
|
||||||
|
derivative work of the Library even though the source code is not.
|
||||||
|
Whether this is true is especially significant if the work can be
|
||||||
|
linked without the Library, or if the work is itself a library. The
|
||||||
|
threshold for this to be true is not precisely defined by law.
|
||||||
|
|
||||||
|
If such an object file uses only numerical parameters, data
|
||||||
|
structure layouts and accessors, and small macros and small inline
|
||||||
|
functions (ten lines or less in length), then the use of the object
|
||||||
|
file is unrestricted, regardless of whether it is legally a derivative
|
||||||
|
work. (Executables containing this object code plus portions of the
|
||||||
|
Library will still fall under Section 6.)
|
||||||
|
|
||||||
|
Otherwise, if the work is a derivative of the Library, you may
|
||||||
|
distribute the object code for the work under the terms of Section 6.
|
||||||
|
Any executables containing that work also fall under Section 6,
|
||||||
|
whether or not they are linked directly with the Library itself.
|
||||||
|
|
||||||
|
6. As an exception to the Sections above, you may also compile or
|
||||||
|
link a "work that uses the Library" with the Library to produce a
|
||||||
|
work containing portions of the Library, and distribute that work
|
||||||
|
under terms of your choice, provided that the terms permit
|
||||||
|
modification of the work for the customer's own use and reverse
|
||||||
|
engineering for debugging such modifications.
|
||||||
|
|
||||||
|
You must give prominent notice with each copy of the work that the
|
||||||
|
Library is used in it and that the Library and its use are covered by
|
||||||
|
this License. You must supply a copy of this License. If the work
|
||||||
|
during execution displays copyright notices, you must include the
|
||||||
|
copyright notice for the Library among them, as well as a reference
|
||||||
|
directing the user to the copy of this License. Also, you must do one
|
||||||
|
of these things:
|
||||||
|
|
||||||
|
a) Accompany the work with the complete corresponding
|
||||||
|
machine-readable source code for the Library including whatever
|
||||||
|
changes were used in the work (which must be distributed under
|
||||||
|
Sections 1 and 2 above); and, if the work is an executable linked
|
||||||
|
with the Library, with the complete machine-readable "work that
|
||||||
|
uses the Library", as object code and/or source code, so that the
|
||||||
|
user can modify the Library and then relink to produce a modified
|
||||||
|
executable containing the modified Library. (It is understood
|
||||||
|
that the user who changes the contents of definitions files in the
|
||||||
|
Library will not necessarily be able to recompile the application
|
||||||
|
to use the modified definitions.)
|
||||||
|
|
||||||
|
b) Accompany the work with a written offer, valid for at
|
||||||
|
least three years, to give the same user the materials
|
||||||
|
specified in Subsection 6a, above, for a charge no more
|
||||||
|
than the cost of performing this distribution.
|
||||||
|
|
||||||
|
c) If distribution of the work is made by offering access to copy
|
||||||
|
from a designated place, offer equivalent access to copy the above
|
||||||
|
specified materials from the same place.
|
||||||
|
|
||||||
|
d) Verify that the user has already received a copy of these
|
||||||
|
materials or that you have already sent this user a copy.
|
||||||
|
|
||||||
|
For an executable, the required form of the "work that uses the
|
||||||
|
Library" must include any data and utility programs needed for
|
||||||
|
reproducing the executable from it. However, as a special exception,
|
||||||
|
the source code distributed need not include anything that is normally
|
||||||
|
distributed (in either source or binary form) with the major
|
||||||
|
components (compiler, kernel, and so on) of the operating system on
|
||||||
|
which the executable runs, unless that component itself accompanies
|
||||||
|
the executable.
|
||||||
|
|
||||||
|
It may happen that this requirement contradicts the license
|
||||||
|
restrictions of other proprietary libraries that do not normally
|
||||||
|
accompany the operating system. Such a contradiction means you cannot
|
||||||
|
use both them and the Library together in an executable that you
|
||||||
|
distribute.
|
||||||
|
|
||||||
|
7. You may place library facilities that are a work based on the
|
||||||
|
Library side-by-side in a single library together with other library
|
||||||
|
facilities not covered by this License, and distribute such a combined
|
||||||
|
library, provided that the separate distribution of the work based on
|
||||||
|
the Library and of the other library facilities is otherwise
|
||||||
|
permitted, and provided that you do these two things:
|
||||||
|
|
||||||
|
a) Accompany the combined library with a copy of the same work
|
||||||
|
based on the Library, uncombined with any other library
|
||||||
|
facilities. This must be distributed under the terms of the
|
||||||
|
Sections above.
|
||||||
|
|
||||||
|
b) Give prominent notice with the combined library of the fact
|
||||||
|
that part of it is a work based on the Library, and explaining
|
||||||
|
where to find the accompanying uncombined form of the same work.
|
||||||
|
|
||||||
|
8. You may not copy, modify, sublicense, link with, or distribute
|
||||||
|
the Library except as expressly provided under this License. Any
|
||||||
|
attempt otherwise to copy, modify, sublicense, link with, or
|
||||||
|
distribute the Library is void, and will automatically terminate your
|
||||||
|
rights under this License. However, parties who have received copies,
|
||||||
|
or rights, from you under this License will not have their licenses
|
||||||
|
terminated so long as such parties remain in full compliance.
|
||||||
|
|
||||||
|
9. You are not required to accept this License, since you have not
|
||||||
|
signed it. However, nothing else grants you permission to modify or
|
||||||
|
distribute the Library or its derivative works. These actions are
|
||||||
|
prohibited by law if you do not accept this License. Therefore, by
|
||||||
|
modifying or distributing the Library (or any work based on the
|
||||||
|
Library), you indicate your acceptance of this License to do so, and
|
||||||
|
all its terms and conditions for copying, distributing or modifying
|
||||||
|
the Library or works based on it.
|
||||||
|
|
||||||
|
10. Each time you redistribute the Library (or any work based on the
|
||||||
|
Library), the recipient automatically receives a license from the
|
||||||
|
original licensor to copy, distribute, link with or modify the Library
|
||||||
|
subject to these terms and conditions. You may not impose any further
|
||||||
|
restrictions on the recipients' exercise of the rights granted herein.
|
||||||
|
You are not responsible for enforcing compliance by third parties to
|
||||||
|
this License.
|
||||||
|
|
||||||
|
11. If, as a consequence of a court judgment or allegation of patent
|
||||||
|
infringement or for any other reason (not limited to patent issues),
|
||||||
|
conditions are imposed on you (whether by court order, agreement or
|
||||||
|
otherwise) that contradict the conditions of this License, they do not
|
||||||
|
excuse you from the conditions of this License. If you cannot
|
||||||
|
distribute so as to satisfy simultaneously your obligations under this
|
||||||
|
License and any other pertinent obligations, then as a consequence you
|
||||||
|
may not distribute the Library at all. For example, if a patent
|
||||||
|
license would not permit royalty-free redistribution of the Library by
|
||||||
|
all those who receive copies directly or indirectly through you, then
|
||||||
|
the only way you could satisfy both it and this License would be to
|
||||||
|
refrain entirely from distribution of the Library.
|
||||||
|
|
||||||
|
If any portion of this section is held invalid or unenforceable under any
|
||||||
|
particular circumstance, the balance of the section is intended to apply,
|
||||||
|
and the section as a whole is intended to apply in other circumstances.
|
||||||
|
|
||||||
|
It is not the purpose of this section to induce you to infringe any
|
||||||
|
patents or other property right claims or to contest validity of any
|
||||||
|
such claims; this section has the sole purpose of protecting the
|
||||||
|
integrity of the free software distribution system which is
|
||||||
|
implemented by public license practices. Many people have made
|
||||||
|
generous contributions to the wide range of software distributed
|
||||||
|
through that system in reliance on consistent application of that
|
||||||
|
system; it is up to the author/donor to decide if he or she is willing
|
||||||
|
to distribute software through any other system and a licensee cannot
|
||||||
|
impose that choice.
|
||||||
|
|
||||||
|
This section is intended to make thoroughly clear what is believed to
|
||||||
|
be a consequence of the rest of this License.
|
||||||
|
|
||||||
|
12. If the distribution and/or use of the Library is restricted in
|
||||||
|
certain countries either by patents or by copyrighted interfaces, the
|
||||||
|
original copyright holder who places the Library under this License may add
|
||||||
|
an explicit geographical distribution limitation excluding those countries,
|
||||||
|
so that distribution is permitted only in or among countries not thus
|
||||||
|
excluded. In such case, this License incorporates the limitation as if
|
||||||
|
written in the body of this License.
|
||||||
|
|
||||||
|
13. The Free Software Foundation may publish revised and/or new
|
||||||
|
versions of the Library General Public License from time to time.
|
||||||
|
Such new versions will be similar in spirit to the present version,
|
||||||
|
but may differ in detail to address new problems or concerns.
|
||||||
|
|
||||||
|
Each version is given a distinguishing version number. If the Library
|
||||||
|
specifies a version number of this License which applies to it and
|
||||||
|
"any later version", you have the option of following the terms and
|
||||||
|
conditions either of that version or of any later version published by
|
||||||
|
the Free Software Foundation. If the Library does not specify a
|
||||||
|
license version number, you may choose any version ever published by
|
||||||
|
the Free Software Foundation.
|
||||||
|
|
||||||
|
14. If you wish to incorporate parts of the Library into other free
|
||||||
|
programs whose distribution conditions are incompatible with these,
|
||||||
|
write to the author to ask for permission. For software which is
|
||||||
|
copyrighted by the Free Software Foundation, write to the Free
|
||||||
|
Software Foundation; we sometimes make exceptions for this. Our
|
||||||
|
decision will be guided by the two goals of preserving the free status
|
||||||
|
of all derivatives of our free software and of promoting the sharing
|
||||||
|
and reuse of software generally.
|
||||||
|
|
||||||
|
NO WARRANTY
|
||||||
|
|
||||||
|
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||||
|
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||||
|
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||||
|
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||||
|
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||||
|
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||||
|
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||||
|
|
||||||
|
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||||
|
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||||
|
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||||
|
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||||
|
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||||
|
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||||
|
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||||
|
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||||
|
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||||
|
DAMAGES.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
33
assets/model/creature/pig/animation.json
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
{
|
||||||
|
"walk": {
|
||||||
|
"speed": 6.0,
|
||||||
|
"amplitude": 25.0
|
||||||
|
},
|
||||||
|
"run": {
|
||||||
|
"speed": 12.0,
|
||||||
|
"amplitude": 40.0
|
||||||
|
},
|
||||||
|
"body_bob": 0.03,
|
||||||
|
"head": {
|
||||||
|
"node": "Head",
|
||||||
|
"amplitude": 4.0
|
||||||
|
},
|
||||||
|
"legs": [
|
||||||
|
{
|
||||||
|
"node": "Foot_FL",
|
||||||
|
"phase": 0.0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"node": "Foot_FR",
|
||||||
|
"phase": 3.14159
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"node": "Foot_HL",
|
||||||
|
"phase": 3.14159
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"node": "Foot_HR",
|
||||||
|
"phase": 0.0
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
16
assets/model/creature/pig/collision.json
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"boxes": [
|
||||||
|
{
|
||||||
|
"center": [
|
||||||
|
0,
|
||||||
|
0.78,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"half": [
|
||||||
|
0.53,
|
||||||
|
0.78,
|
||||||
|
0.406
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
BIN
assets/model/creature/pig/pig.glb
Normal file
BIN
assets/model/creature/player/player.glb
Normal file
13
assets/shaders/depth_model_instance_vert.glsl
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
#version 460
|
||||||
|
|
||||||
|
layout (location = 0) in vec3 pos;
|
||||||
|
layout (location = 1) in vec2 texCoord;
|
||||||
|
layout (location = 3) in mat4 modelMatrix;
|
||||||
|
uniform mat4 lightSpaceMatrix;
|
||||||
|
|
||||||
|
out vec2 tc;
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
tc = texCoord;
|
||||||
|
gl_Position = lightSpaceMatrix * modelMatrix * vec4(pos, 1.0);
|
||||||
|
}
|
||||||
@@ -7,7 +7,6 @@ uniform mat4 lightSpaceMatrix;
|
|||||||
uniform mat4 modelMatrix;
|
uniform mat4 modelMatrix;
|
||||||
|
|
||||||
out vec2 tc;
|
out vec2 tc;
|
||||||
flat out int tex_layer;
|
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
tc = texCoord;
|
tc = texCoord;
|
||||||
14
assets/shaders/depth_model_vert.glsl
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
#version 460
|
||||||
|
|
||||||
|
layout (location = 0) in vec3 pos;
|
||||||
|
layout (location = 1) in vec2 texCoord;
|
||||||
|
|
||||||
|
uniform mat4 lightSpaceMatrix;
|
||||||
|
uniform mat4 modelMatrix;
|
||||||
|
|
||||||
|
out vec2 tc;
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
tc = texCoord;
|
||||||
|
gl_Position = lightSpaceMatrix * modelMatrix * vec4(pos, 1.0);
|
||||||
|
}
|
||||||
11
assets/shaders/image_f_shader.glsl
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
#version 460
|
||||||
|
|
||||||
|
in vec2 tc;
|
||||||
|
|
||||||
|
out vec4 color;
|
||||||
|
|
||||||
|
layout (binding = 0) uniform sampler2D samp;
|
||||||
|
|
||||||
|
void main(void) {
|
||||||
|
color = texture(samp, tc);
|
||||||
|
}
|
||||||
14
assets/shaders/image_v_shader.glsl
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
#version 460
|
||||||
|
|
||||||
|
layout (location = 0) in vec2 pos;
|
||||||
|
layout (location = 1) in vec2 texCoord;
|
||||||
|
|
||||||
|
out vec2 tc;
|
||||||
|
|
||||||
|
uniform mat4 model_matrix;
|
||||||
|
uniform mat4 proj_matrix;
|
||||||
|
|
||||||
|
void main(void) {
|
||||||
|
gl_Position = proj_matrix * model_matrix * vec4(pos, 0.0, 1.0);
|
||||||
|
tc = texCoord;
|
||||||
|
}
|
||||||
26
assets/shaders/model_instance_vert.glsl
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
#version 460
|
||||||
|
|
||||||
|
layout (location = 0) in vec3 pos;
|
||||||
|
layout (location = 1) in vec2 texCoord;
|
||||||
|
layout (location = 2) in vec3 aNormal;
|
||||||
|
layout (location = 3) in mat4 modelMatrix;
|
||||||
|
uniform mat4 view_matrix;
|
||||||
|
uniform mat4 proj_matrix;
|
||||||
|
uniform mat4 lightSpaceMatrix;
|
||||||
|
out vec4 FragPosLightSpace;
|
||||||
|
out vec3 normal;
|
||||||
|
out vec2 tc;
|
||||||
|
out vec3 vert_pos;
|
||||||
|
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
vec4 worldPos = modelMatrix * vec4(pos, 1.0);
|
||||||
|
FragPosLightSpace = lightSpaceMatrix * worldPos;
|
||||||
|
mat4 mv_matrix= view_matrix * modelMatrix;
|
||||||
|
mat4 norm_matrix = transpose(inverse(mv_matrix));
|
||||||
|
vec4 viewPos = mv_matrix * vec4(pos, 1.0);
|
||||||
|
tc = texCoord;
|
||||||
|
vert_pos = pos;
|
||||||
|
normal = normalize(mat3(norm_matrix) * aNormal);
|
||||||
|
gl_Position = proj_matrix * viewPos;
|
||||||
|
}
|
||||||
@@ -3,7 +3,6 @@
|
|||||||
layout (location = 0) in vec3 pos;
|
layout (location = 0) in vec3 pos;
|
||||||
layout (location = 1) in vec2 texCoord;
|
layout (location = 1) in vec2 texCoord;
|
||||||
layout (location = 2) in vec3 aNormal;
|
layout (location = 2) in vec3 aNormal;
|
||||||
layout (location = 3) in vec3 aTangent;
|
|
||||||
|
|
||||||
uniform mat4 mv_matrix;
|
uniform mat4 mv_matrix;
|
||||||
uniform mat4 proj_matrix;
|
uniform mat4 proj_matrix;
|
||||||
9
assets/shaders/rect_f_shader.glsl
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
#version 460
|
||||||
|
|
||||||
|
out vec4 color;
|
||||||
|
|
||||||
|
uniform vec4 inColor;
|
||||||
|
|
||||||
|
void main(void) {
|
||||||
|
color = inColor;
|
||||||
|
}
|
||||||
11
assets/shaders/rect_v_shader.glsl
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
#version 460
|
||||||
|
|
||||||
|
layout (location = 0) in vec2 pos;
|
||||||
|
|
||||||
|
|
||||||
|
uniform mat4 model_matrix;
|
||||||
|
uniform mat4 proj_matrix;
|
||||||
|
|
||||||
|
void main(void) {
|
||||||
|
gl_Position = proj_matrix * model_matrix * vec4(pos, 0.0, 1.0);
|
||||||
|
}
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
#version 460
|
|
||||||
|
|
||||||
in vec2 tc;
|
|
||||||
flat in int tex_layer;
|
|
||||||
|
|
||||||
out vec4 color;
|
|
||||||
|
|
||||||
layout (binding = 0) uniform sampler2DArray samp;
|
|
||||||
|
|
||||||
void main(void) {
|
|
||||||
color = texture(samp, vec3(tc, tex_layer));
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
#version 460
|
|
||||||
|
|
||||||
layout (location = 0) in vec2 pos;
|
|
||||||
layout (location = 1) in vec2 texCoord;
|
|
||||||
layout (location = 2) in float layer;
|
|
||||||
|
|
||||||
out vec2 tc;
|
|
||||||
|
|
||||||
flat out int tex_layer;
|
|
||||||
|
|
||||||
uniform mat4 m_matrix;
|
|
||||||
uniform mat4 proj_matrix;
|
|
||||||
|
|
||||||
void main(void) {
|
|
||||||
gl_Position = proj_matrix * m_matrix * vec4(pos, 0.0, 1.0);
|
|
||||||
tc = texCoord;
|
|
||||||
tex_layer = int(layer);
|
|
||||||
}
|
|
||||||
BIN
assets/sound/ambient/birds.ogg
Normal file
BIN
assets/sound/ambient/ocean/wave001.flac
Normal file
BIN
assets/sound/ambient/ocean/wave002.flac
Normal file
BIN
assets/sound/ambient/ocean/wave003.flac
Normal file
BIN
assets/sound/ambient/ocean/wave004.flac
Normal file
BIN
assets/sound/ambient/water/bubble001.ogg
Normal file
BIN
assets/sound/ambient/water/bubble002.ogg
Normal file
BIN
assets/sound/ambient/water/in_and_out_of_water.flac
Normal file
BIN
assets/sound/bgm/bgm001.mp3
Normal file
BIN
assets/sound/bgm/bgm002.ogg
Normal file
BIN
assets/sound/block/dirt/break.ogg
Normal file
BIN
assets/sound/block/dirt/place.ogg
Normal file
BIN
assets/sound/block/dirt/walk.ogg
Normal file
BIN
assets/sound/block/grass/break.ogg
Normal file
BIN
assets/sound/block/grass/place.ogg
Normal file
BIN
assets/sound/block/grass_block/break.ogg
Normal file
BIN
assets/sound/block/grass_block/place.ogg
Normal file
BIN
assets/sound/block/grass_block/walk.ogg
Normal file
BIN
assets/sound/block/leaf/break.ogg
Normal file
BIN
assets/sound/block/leaf/place.ogg
Normal file
BIN
assets/sound/block/leaf/walk.ogg
Normal file
BIN
assets/sound/block/log/break.ogg
Normal file
BIN
assets/sound/block/log/place.ogg
Normal file
BIN
assets/sound/block/log/walk.ogg
Normal file
BIN
assets/sound/block/sand/break.ogg
Normal file
BIN
assets/sound/block/sand/place.ogg
Normal file
BIN
assets/sound/block/sand/walk.ogg
Normal file
BIN
assets/sound/block/snowy_grass_block/break.ogg
Normal file
BIN
assets/sound/block/snowy_grass_block/place.ogg
Normal file
BIN
assets/sound/block/snowy_grass_block/walk.ogg
Normal file
BIN
assets/sound/block/stone/break.ogg
Normal file
BIN
assets/sound/block/stone/place.ogg
Normal file
BIN
assets/sound/block/stone/walk.ogg
Normal file
|
Before Width: | Height: | Size: 99 B After Width: | Height: | Size: 355 B |
|
Before Width: | Height: | Size: 882 B After Width: | Height: | Size: 231 KiB |
|
Before Width: | Height: | Size: 277 B After Width: | Height: | Size: 893 B |
|
Before Width: | Height: | Size: 499 B After Width: | Height: | Size: 239 KiB |
|
Before Width: | Height: | Size: 890 B After Width: | Height: | Size: 249 KiB |
|
Before Width: | Height: | Size: 874 B After Width: | Height: | Size: 223 KiB |
|
Before Width: | Height: | Size: 877 B After Width: | Height: | Size: 201 KiB |
|
Before Width: | Height: | Size: 914 B After Width: | Height: | Size: 215 KiB |
|
Before Width: | Height: | Size: 915 B After Width: | Height: | Size: 215 KiB |
|
Before Width: | Height: | Size: 874 B After Width: | Height: | Size: 215 KiB |
BIN
assets/texture/item/spawn_egg/pig_spawn_egg.png
Normal file
|
After Width: | Height: | Size: 174 B |
BIN
assets/texture/ui/background.png
Normal file
|
After Width: | Height: | Size: 2.3 MiB |
BIN
assets/texture/ui/button001.png
Normal file
|
After Width: | Height: | Size: 215 B |
BIN
assets/texture/ui/microphone.png
Normal file
|
After Width: | Height: | Size: 137 B |
BIN
assets/texture/ui/slider_thumb001.png
Normal file
|
After Width: | Height: | Size: 120 B |
BIN
assets/texture/ui/slider_track001.png
Normal file
|
After Width: | Height: | Size: 174 B |
BIN
assets/texture/ui/slot.png
Normal file
|
After Width: | Height: | Size: 122 B |
BIN
assets/texture/ui/textfield001.png
Normal file
|
After Width: | Height: | Size: 174 B |
@@ -5,60 +5,16 @@ find_package(OpenGL REQUIRED)
|
|||||||
find_package(Protobuf REQUIRED)
|
find_package(Protobuf REQUIRED)
|
||||||
find_package(absl REQUIRED)
|
find_package(absl REQUIRED)
|
||||||
find_package(zstd REQUIRED)
|
find_package(zstd REQUIRED)
|
||||||
if (UNIX AND NOT APPLE)
|
find_package(OpenAL REQUIRED)
|
||||||
find_package(Freetype REQUIRED)
|
find_package(harfbuzz REQUIRED)
|
||||||
find_package(glfw3 REQUIRED)
|
find_package(Freetype REQUIRED)
|
||||||
endif()
|
find_package(SDL3 REQUIRED)
|
||||||
|
find_package(Opus REQUIRED)
|
||||||
|
find_package(assimp REQUIRED)
|
||||||
# Third-party libraries
|
# Third-party libraries
|
||||||
FetchContent_Declare(
|
|
||||||
glm
|
|
||||||
GIT_REPOSITORY https://github.com/g-truc/glm.git
|
|
||||||
GIT_TAG 1.0.3
|
|
||||||
|
|
||||||
)
|
|
||||||
FetchContent_MakeAvailable(glm)
|
|
||||||
FetchContent_Declare(
|
|
||||||
soil2
|
|
||||||
GIT_REPOSITORY https://github.com/SpartanJ/SOIL2.git
|
|
||||||
GIT_TAG 1.31
|
|
||||||
|
|
||||||
)
|
|
||||||
FetchContent_MakeAvailable(soil2)
|
|
||||||
FetchContent_Declare(
|
|
||||||
tomlplusplus
|
|
||||||
GIT_REPOSITORY https://github.com/marzer/tomlplusplus.git
|
|
||||||
GIT_TAG v3.4.0
|
|
||||||
)
|
|
||||||
FetchContent_MakeAvailable(tomlplusplus)
|
|
||||||
|
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
FetchContent_Declare(
|
|
||||||
glfw
|
|
||||||
GIT_REPOSITORY https://github.com/glfw/glfw.git
|
|
||||||
GIT_TAG 3.4
|
|
||||||
)
|
|
||||||
|
|
||||||
set(GLFW_BUILD_DOCS OFF CACHE BOOL "" FORCE)
|
|
||||||
set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE)
|
|
||||||
set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
|
|
||||||
set(GLFW_INSTALL OFF CACHE BOOL "" FORCE)
|
|
||||||
set(GLFW_VULKAN_STATIC ON CACHE BOOL "" FORCE)
|
|
||||||
set(BUILD_SHARED_LIBS ON CACHE BOOL "" FORCE)
|
|
||||||
|
|
||||||
FetchContent_MakeAvailable(glfw)
|
|
||||||
|
|
||||||
FetchContent_Declare(
|
|
||||||
freetype
|
|
||||||
GIT_REPOSITORY https://gitlab.freedesktop.org/freetype/freetype.git
|
|
||||||
GIT_TAG VER-2-14-3
|
|
||||||
)
|
|
||||||
FetchContent_MakeAvailable(freetype)
|
|
||||||
if(TARGET freetype)
|
|
||||||
add_library(Freetype::Freetype ALIAS freetype)
|
|
||||||
endif()
|
|
||||||
set(_BUILD_SHARED_LIBS_SAVED ${BUILD_SHARED_LIBS})
|
set(_BUILD_SHARED_LIBS_SAVED ${BUILD_SHARED_LIBS})
|
||||||
set(BUILD_SHARED_LIBS ON)
|
set(BUILD_SHARED_LIBS ON)
|
||||||
|
|
||||||
|
|||||||
25
cmake/modules/FindOpus.cmake
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
|
||||||
|
find_path(OPUS_INCLUDE_DIR
|
||||||
|
NAMES opus/opus.h opus.h
|
||||||
|
)
|
||||||
|
|
||||||
|
find_library(OPUS_LIBRARY
|
||||||
|
NAMES opus
|
||||||
|
)
|
||||||
|
|
||||||
|
find_package_handle_standard_args(
|
||||||
|
Opus
|
||||||
|
REQUIRED_VARS
|
||||||
|
OPUS_INCLUDE_DIR
|
||||||
|
OPUS_LIBRARY
|
||||||
|
)
|
||||||
|
|
||||||
|
if(Opus_FOUND)
|
||||||
|
add_library(Opus::Opus UNKNOWN IMPORTED)
|
||||||
|
|
||||||
|
set_target_properties(Opus::Opus PROPERTIES
|
||||||
|
IMPORTED_LOCATION "${OPUS_LIBRARY}"
|
||||||
|
INTERFACE_INCLUDE_DIRECTORIES "${OPUS_INCLUDE_DIR}"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
#include <glm/glm.hpp>
|
|
||||||
|
|
||||||
namespace Cubed {
|
|
||||||
|
|
||||||
struct AABB {
|
|
||||||
glm::vec3 min{0.0f, 0.0f, 0.0f};
|
|
||||||
glm::vec3 max{0.0f, 0.0f, 0.0f};
|
|
||||||
|
|
||||||
AABB(glm::vec3 min_point, glm::vec3 max_point)
|
|
||||||
: min(min_point), max(max_point) {}
|
|
||||||
|
|
||||||
bool intersects(const AABB& other) const {
|
|
||||||
return (min.x <= other.max.x && max.x >= other.min.x) &&
|
|
||||||
(min.y <= other.max.y && max.y >= other.min.y) &&
|
|
||||||
(min.z <= other.max.z && max.z >= other.min.z);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace Cubed
|
|
||||||
@@ -1,77 +1,71 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "Cubed/gameplay/client_world.hpp"
|
#include "Cubed/argument.hpp"
|
||||||
#include "Cubed/gameplay/network_server.hpp"
|
#include "Cubed/audio/audio_engine.hpp"
|
||||||
#include "Cubed/gameplay/server_world.hpp"
|
#include "Cubed/config.hpp"
|
||||||
#define GLFW_INCLUDE_NONE
|
|
||||||
#include "Cubed/camera.hpp"
|
|
||||||
#include "Cubed/dev_panel.hpp"
|
#include "Cubed/dev_panel.hpp"
|
||||||
#include "Cubed/renderer.hpp"
|
#include "Cubed/render/renderer.hpp"
|
||||||
|
#include "Cubed/scene/scene_manager.hpp"
|
||||||
#include "Cubed/texture_manager.hpp"
|
#include "Cubed/texture_manager.hpp"
|
||||||
#include "Cubed/window.hpp"
|
#include "Cubed/window.hpp"
|
||||||
namespace Cubed {
|
namespace Cubed {
|
||||||
|
|
||||||
class App {
|
class App {
|
||||||
public:
|
public:
|
||||||
struct Argument {
|
|
||||||
bool is_client = false;
|
|
||||||
int port = 25530;
|
|
||||||
std::string ip{"127.0.0.1"};
|
|
||||||
std::string player{"Unknown"};
|
|
||||||
};
|
|
||||||
|
|
||||||
App();
|
App();
|
||||||
~App();
|
~App();
|
||||||
static void cursor_position_callback(GLFWwindow* window, double xpos,
|
void handle_mouse_move(float xpos, float ypos, float xrel, float yrel);
|
||||||
double ypos);
|
void handle_sdl_key(SDL_Event& e);
|
||||||
static void key_callback(GLFWwindow* window, int key, int scancode,
|
void handle_sdl_mouse_button(SDL_Event& e);
|
||||||
int action, int mods);
|
void handle_window_focus(bool focused);
|
||||||
static void mouse_button_callback(GLFWwindow* window, int button,
|
void handle_window_resize(int new_width, int new_height);
|
||||||
int action, int mods);
|
void handle_framebuffer_resize(int new_width, int new_height);
|
||||||
static void window_focus_callback(GLFWwindow* window, int focused);
|
void handle_mouse_scroll(float xoffset, float yoffset);
|
||||||
static void window_reshape_callback(GLFWwindow* window, int new_width,
|
void handle_text_input(const char* text);
|
||||||
int new_height);
|
|
||||||
static void mouse_scroll_callback(GLFWwindow* window, double xoffset,
|
|
||||||
double yoffset);
|
|
||||||
static void cursor_enter_callback(GLFWwindow* window, int entered);
|
|
||||||
static void char_callback(GLFWwindow* window, unsigned int ch);
|
|
||||||
static int start_cubed_application(int argc, char** argv);
|
static int start_cubed_application(int argc, char** argv);
|
||||||
|
|
||||||
static unsigned int seed();
|
static unsigned int seed();
|
||||||
static float delte_time();
|
static float delta_time();
|
||||||
static float get_fps();
|
static float get_fps();
|
||||||
|
|
||||||
Camera& camera();
|
|
||||||
DevPanel& dev_panel();
|
|
||||||
Renderer& renderer();
|
Renderer& renderer();
|
||||||
TextureManager& texture_manager();
|
TextureManager& texture_manager();
|
||||||
Window& window();
|
Window& window();
|
||||||
ClientWorld& client_world();
|
|
||||||
ServerWorld& server_world();
|
Config& config();
|
||||||
const Argument& argument() const;
|
const Argument& argument() const;
|
||||||
|
AudioEngine& audio();
|
||||||
|
|
||||||
|
std::string get_clipboard_text();
|
||||||
|
|
||||||
|
void start_text_input();
|
||||||
|
void stop_text_input();
|
||||||
|
void update_text_input_area(const glm::vec4& textbox,
|
||||||
|
float cursor_position_x);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Camera m_camera;
|
Config m_game_config;
|
||||||
|
|
||||||
|
Window m_window;
|
||||||
|
|
||||||
TextureManager m_texture_manager;
|
TextureManager m_texture_manager;
|
||||||
NetworkServer m_server;
|
AudioEngine m_audio;
|
||||||
std::shared_ptr<NetworkClient> m_client;
|
|
||||||
ClientWorld m_client_world;
|
|
||||||
|
|
||||||
DevPanel m_dev_panel{*this};
|
Renderer m_renderer;
|
||||||
Renderer m_renderer{m_camera, m_client_world, m_texture_manager,
|
|
||||||
m_dev_panel};
|
|
||||||
|
|
||||||
Window m_window{m_renderer};
|
SceneManager m_scene_manager;
|
||||||
|
|
||||||
inline static double last_time = glfwGetTime();
|
inline static uint64_t last_tick = 0;
|
||||||
inline static double current_time = glfwGetTime();
|
inline static uint64_t current_tick = 0;
|
||||||
inline static double delta_time = 0.0f;
|
inline static float dt = 0.0f;
|
||||||
inline static double fps_time_count = 0.0f;
|
inline static float fps_time_count = 0.0f;
|
||||||
inline static int frame_count = 0;
|
inline static int frame_count = 0;
|
||||||
inline static int fps = 0;
|
inline static int fps = 0;
|
||||||
Argument m_argument;
|
Argument m_argument;
|
||||||
|
bool m_running = true;
|
||||||
|
bool m_opengl_init = false;
|
||||||
void init(int argc, char** argv);
|
void init(int argc, char** argv);
|
||||||
void handle_argument(int argc, char** argv);
|
void handle_argument(int argc, char** argv);
|
||||||
void handle_toml();
|
|
||||||
auto init_camera();
|
auto init_camera();
|
||||||
auto init_texture();
|
auto init_texture();
|
||||||
auto init_world();
|
auto init_world();
|
||||||
@@ -79,6 +73,10 @@ private:
|
|||||||
void render();
|
void render();
|
||||||
void run();
|
void run();
|
||||||
void update();
|
void update();
|
||||||
|
|
||||||
|
void handle_sdl_event(SDL_Event& e);
|
||||||
|
|
||||||
|
void dispatch_event(const Event& e);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Cubed
|
} // namespace Cubed
|
||||||