vscode tasks, build settings, etc.
Some checks failed
Build / Build Game (push) Has been cancelled

This commit is contained in:
2026-03-01 01:09:02 -05:00
parent 68d5301735
commit b3c097be22
17 changed files with 350 additions and 121 deletions

4
.gitignore vendored
View File

@@ -1,4 +1,6 @@
build/
build-web/
resources/
release/
release/
out/
external/

83
.vscode/launch.json vendored
View File

@@ -1,28 +1,61 @@
{
"version": "0.2.0",
"configurations": [
"version": "0.2.0",
"configurations": [
{
"name": "Debug (CMake Debug preset)",
"type": "cppdbg",
"request": "launch",
"preLaunchTask": "cmake: build debug",
"program": "${workspaceFolder}/out/build/linux-debug/bin/Debug/snivy",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}/out/build/linux-debug",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"miDebuggerPath": "/usr/bin/gdb",
"setupCommands": [
{
"name": "Debug",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build/snivy",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}/build",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"miDebuggerPath": "/usr/bin/gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing"
},
{
"description": "Set disassembly flavor to Intel",
"text": "-gdb-set disassembly-flavor intel"
}
]
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing"
},
]
}
{
"description": "Set disassembly flavor to Intel",
"text": "-gdb-set disassembly-flavor intel"
}
],
"windows": {
"type": "cppvsdbg",
"program": "${workspaceFolder}/out/build/x64-Debug/bin/Debug/snivy.exe",
"cwd": "${workspaceFolder}/out/build/x64-Debug"
}
},
{
"name": "Run (CMake Release preset)",
"type": "cppdbg",
"request": "launch",
"noDebug": true,
"preLaunchTask": "cmake: build release",
"program": "${workspaceFolder}/out/build/linux-release/bin/Release/snivy",
"args": [],
"cwd": "${workspaceFolder}/out/build/linux-release",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"miDebuggerPath": "/usr/bin/gdb",
"windows": {
"type": "cppvsdbg",
"program": "${workspaceFolder}/out/build/x64-Release/bin/Release/snivy.exe",
"cwd": "${workspaceFolder}/out/build/x64-Release"
}
},
{
"name": "Web (Emscripten + Chromium)",
"type": "node-terminal",
"request": "launch",
"preLaunchTask": "web: run",
"command": "echo \"Web task complete. If Chromium did not open, run task: web: open chromium\"",
"cwd": "${workspaceFolder}"
}
]
}

199
.vscode/tasks.json vendored
View File

@@ -1,44 +1,159 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"type": "shell",
"command": "cmake --build build",
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": [
"$gcc"
]
},
{
"label": "start-wasm-devserver",
"type": "shell",
"command": "${workspaceFolder}/scripts/start_wasm_dev.sh",
"presentation": {
"reveal": "silent",
"panel": "dedicated"
},
"problemMatcher": []
},
{
"label": "stop-wasm-devserver",
"type": "shell",
"command": "${workspaceFolder}/scripts/stop_wasm_dev.sh",
"problemMatcher": []
},
{
"type": "cmake",
"label": "CMake: build",
"command": "build",
"targets": [
"[N/A - Select Kit]"
],
"group": "build",
"problemMatcher": [],
"detail": "CMake template build task"
}
]
"version": "2.0.0",
"tasks": [
{
"label": "cmake: configure debug",
"type": "shell",
"linux": {
"command": "cmake --preset linux-debug"
},
"windows": {
"command": "cmake --preset x64-Debug"
},
"problemMatcher": []
},
{
"label": "cmake: build debug",
"type": "shell",
"linux": {
"command": "cmake --build --preset linux-debug"
},
"windows": {
"command": "cmake --build --preset x64-Debug"
},
"dependsOn": "cmake: configure debug",
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": [
"$gcc"
]
},
{
"label": "cmake: configure release",
"type": "shell",
"linux": {
"command": "cmake --preset linux-release"
},
"windows": {
"command": "cmake --preset x64-Release"
},
"problemMatcher": []
},
{
"label": "cmake: build release",
"type": "shell",
"linux": {
"command": "cmake --build --preset linux-release"
},
"windows": {
"command": "cmake --build --preset x64-Release"
},
"dependsOn": "cmake: configure release",
"problemMatcher": [
"$gcc"
]
},
{
"label": "linux: run debug",
"type": "shell",
"linux": {
"command": "${workspaceFolder}/out/build/linux-debug/bin/Debug/snivy"
},
"windows": {
"command": "echo \"linux: run debug is Linux-only\" && exit 1"
},
"dependsOn": "cmake: build debug",
"problemMatcher": []
},
{
"label": "linux: run release",
"type": "shell",
"linux": {
"command": "${workspaceFolder}/out/build/linux-release/bin/Release/snivy"
},
"windows": {
"command": "echo \"linux: run release is Linux-only\" && exit 1"
},
"dependsOn": "cmake: build release",
"problemMatcher": []
},
{
"label": "web: configure",
"type": "shell",
"linux": {
"command": "sh -lc 'if ! command -v emcmake >/dev/null 2>&1; then if [ -n \"$EMSDK\" ] && [ -f \"$EMSDK/emsdk_env.sh\" ]; then . \"$EMSDK/emsdk_env.sh\" >/dev/null 2>&1; elif [ -f \"$HOME/emsdk/emsdk_env.sh\" ]; then . \"$HOME/emsdk/emsdk_env.sh\" >/dev/null 2>&1; elif [ -f \"../emsdk/emsdk_env.sh\" ]; then . \"../emsdk/emsdk_env.sh\" >/dev/null 2>&1; else echo \"Emscripten not found. Install emsdk or set EMSDK env var.\"; exit 1; fi; fi; emcmake cmake -S . -B out/build/web -DCMAKE_BUILD_TYPE=Release'"
},
"windows": {
"command": "echo \"web tasks are configured for Linux (emsdk + python + chromium).\" && exit 1"
},
"problemMatcher": []
},
{
"label": "web: build",
"type": "shell",
"linux": {
"command": "sh -lc 'if ! command -v emcmake >/dev/null 2>&1; then if [ -n \"$EMSDK\" ] && [ -f \"$EMSDK/emsdk_env.sh\" ]; then . \"$EMSDK/emsdk_env.sh\" >/dev/null 2>&1; elif [ -f \"$HOME/emsdk/emsdk_env.sh\" ]; then . \"$HOME/emsdk/emsdk_env.sh\" >/dev/null 2>&1; elif [ -f \"../emsdk/emsdk_env.sh\" ]; then . \"../emsdk/emsdk_env.sh\" >/dev/null 2>&1; else echo \"Emscripten not found. Install emsdk or set EMSDK env var.\"; exit 1; fi; fi; cmake --build out/build/web -j$(nproc)'"
},
"windows": {
"command": "echo \"web tasks are configured for Linux (emsdk + python + chromium).\" && exit 1"
},
"dependsOn": "web: configure",
"problemMatcher": []
},
{
"label": "web: serve",
"type": "shell",
"linux": {
"command": "sh -lc 'PID_FILE=/tmp/snivy-web-http.pid; LOG_FILE=/tmp/snivy-web-http.log; WEB_ROOT=out/build/web; URL=http://127.0.0.1:8000/bin/Release/index.html; [ -f \"$WEB_ROOT/bin/Release/index.html\" ] || { echo \"Web output not found at $WEB_ROOT/bin/Release/index.html (run web: build)\"; exit 1; }; if [ -f \"$PID_FILE\" ] && kill -0 \"$(cat \"$PID_FILE\")\" 2>/dev/null; then kill \"$(cat \"$PID_FILE\")\" >/dev/null 2>&1 || true; rm -f \"$PID_FILE\"; fi; nohup python3 -m http.server 8000 --bind 127.0.0.1 --directory \"$WEB_ROOT\" >\"$LOG_FILE\" 2>&1 & echo $! >\"$PID_FILE\"; echo \"Started web server on http://127.0.0.1:8000 (root: $WEB_ROOT)\"; READY=0; for _ in $(seq 1 40); do if command -v curl >/dev/null 2>&1; then curl -fsS \"$URL\" >/dev/null 2>&1 && READY=1 && break; elif command -v wget >/dev/null 2>&1; then wget -qO- \"$URL\" >/dev/null 2>&1 && READY=1 && break; fi; sleep 0.1; done; [ \"$READY\" = \"1\" ] || { echo \"Web server did not become ready. See /tmp/snivy-web-http.log\"; exit 1; }'"
},
"windows": {
"command": "echo \"web tasks are configured for Linux (emsdk + python + chromium).\" && exit 1"
},
"problemMatcher": []
},
{
"label": "web: stop server",
"type": "shell",
"linux": {
"command": "sh -lc 'PID_FILE=/tmp/snivy-web-http.pid; if [ -f \"$PID_FILE\" ] && kill -0 \"$(cat \"$PID_FILE\")\" 2>/dev/null; then kill \"$(cat \"$PID_FILE\")\" && rm -f \"$PID_FILE\" && echo \"Stopped web server\"; else rm -f \"$PID_FILE\" && echo \"Web server not running\"; fi'"
},
"windows": {
"command": "echo \"web tasks are configured for Linux (emsdk + python + chromium).\" && exit 1"
},
"problemMatcher": []
},
{
"label": "web: open chromium",
"type": "shell",
"linux": {
"command": "sh -lc 'URL=http://127.0.0.1:8000/bin/Release/index.html; (xdg-open \"$URL\" >/dev/null 2>&1 || chromium --new-tab \"$URL\" >/dev/null 2>&1 || chromium-browser --new-tab \"$URL\" >/dev/null 2>&1 || google-chrome --new-tab \"$URL\" >/dev/null 2>&1 || google-chrome-stable --new-tab \"$URL\" >/dev/null 2>&1 || python3 -m webbrowser \"$URL\" >/dev/null 2>&1) & sleep 0.15; echo \"Requested browser open: $URL\"'"
},
"windows": {
"command": "start http://127.0.0.1:8000/index.html"
},
"problemMatcher": []
},
{
"label": "web: prepare",
"dependsOrder": "sequence",
"dependsOn": [
"web: build",
"web: serve"
],
"problemMatcher": []
},
{
"label": "web: run",
"type": "shell",
"linux": {
"command": "sh -lc 'set -e; if ! command -v emcmake >/dev/null 2>&1; then if [ -n \"$EMSDK\" ] && [ -f \"$EMSDK/emsdk_env.sh\" ]; then . \"$EMSDK/emsdk_env.sh\" >/dev/null 2>&1; elif [ -f \"$HOME/emsdk/emsdk_env.sh\" ]; then . \"$HOME/emsdk/emsdk_env.sh\" >/dev/null 2>&1; elif [ -f \"../emsdk/emsdk_env.sh\" ]; then . \"../emsdk/emsdk_env.sh\" >/dev/null 2>&1; else echo \"Emscripten not found. Install emsdk or set EMSDK env var.\"; exit 1; fi; fi; emcmake cmake -S . -B out/build/web -DCMAKE_BUILD_TYPE=Release; cmake --build out/build/web -j$(nproc); PID_FILE=/tmp/snivy-web-http.pid; LOG_FILE=/tmp/snivy-web-http.log; WEB_ROOT=out/build/web; URL=http://127.0.0.1:8000/bin/Release/index.html; [ -f \"$WEB_ROOT/bin/Release/index.html\" ] || { echo \"Web output not found at $WEB_ROOT/bin/Release/index.html\"; exit 1; }; if [ -f \"$PID_FILE\" ] && kill -0 \"$(cat \"$PID_FILE\")\" 2>/dev/null; then kill \"$(cat \"$PID_FILE\")\" >/dev/null 2>&1 || true; rm -f \"$PID_FILE\"; fi; nohup python3 -m http.server 8000 --bind 127.0.0.1 --directory \"$WEB_ROOT\" >\"$LOG_FILE\" 2>&1 & echo $! >\"$PID_FILE\"; echo \"Started web server on http://127.0.0.1:8000 (root: $WEB_ROOT)\"; READY=0; for _ in $(seq 1 40); do if command -v curl >/dev/null 2>&1; then curl -fsS \"$URL\" >/dev/null 2>&1 && READY=1 && break; elif command -v wget >/dev/null 2>&1; then wget -qO- \"$URL\" >/dev/null 2>&1 && READY=1 && break; fi; sleep 0.1; done; [ \"$READY\" = \"1\" ] || { echo \"Web server did not become ready. See /tmp/snivy-web-http.log\"; exit 1; }; (xdg-open \"$URL\" >/dev/null 2>&1 || chromium --new-tab \"$URL\" >/dev/null 2>&1 || chromium-browser --new-tab \"$URL\" >/dev/null 2>&1 || google-chrome --new-tab \"$URL\" >/dev/null 2>&1 || google-chrome-stable --new-tab \"$URL\" >/dev/null 2>&1 || python3 -m webbrowser \"$URL\" >/dev/null 2>&1 || { echo \"Could not launch browser automatically. Open: $URL\"; exit 0; }) & sleep 0.15; echo \"Requested browser open: $URL\"'"
},
"windows": {
"command": "echo \"web tasks are configured for Linux (emsdk + python + chromium).\" && exit 1"
},
"problemMatcher": []
}
]
}

View File

@@ -127,6 +127,11 @@ add_executable(${PROJECT_NAME}
${CMAKE_CURRENT_SOURCE_DIR}/include/glad/glad.cpp
)
target_compile_definitions(${PROJECT_NAME} PRIVATE
"$<$<CONFIG:Debug>:DEBUG=1>"
"$<$<NOT:$<CONFIG:Debug>>:DEBUG=0>"
)
set_target_properties(${PROJECT_NAME} PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/bin/Debug"
@@ -186,13 +191,15 @@ if(NOT CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
endif()
set(PROJECT_RESOURCES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/resources")
set(PROJECT_RESOURCES_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/resources")
set(PROJECT_RESOURCES_BINARY_DIR "$<TARGET_FILE_DIR:${PROJECT_NAME}>/resources")
if(EXISTS "${PROJECT_RESOURCES_DIR}")
file(GLOB_RECURSE PROJECT_RESOURCE_FILES CONFIGURE_DEPENDS
"${PROJECT_RESOURCES_DIR}/*")
add_custom_target(copy_resources ALL
COMMAND ${CMAKE_COMMAND} -E remove_directory "${PROJECT_RESOURCES_BINARY_DIR}"
COMMAND ${CMAKE_COMMAND} -E copy_directory "${PROJECT_RESOURCES_DIR}" "${PROJECT_RESOURCES_BINARY_DIR}"
COMMAND ${CMAKE_COMMAND}
-DSRC_DIR="${PROJECT_RESOURCES_DIR}"
-DDST_DIR="${PROJECT_RESOURCES_BINARY_DIR}"
-P "${CMAKE_CURRENT_SOURCE_DIR}/cmake/copy_resources.cmake"
DEPENDS ${PROJECT_RESOURCE_FILES}
COMMENT "Copying resources directory")
add_dependencies(${PROJECT_NAME} copy_resources)
@@ -207,6 +214,7 @@ if(HAS_PROJECT_RESOURCES)
endif()
if (CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
set(EMSCRIPTEN_SHELL_FILE "${CMAKE_CURRENT_SOURCE_DIR}/web/index.html")
target_link_options(${PROJECT_NAME} PRIVATE
"-sMIN_WEBGL_VERSION=2"
"-sMAX_WEBGL_VERSION=2"
@@ -217,6 +225,8 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
"-sFORCE_FILESYSTEM=1"
"-sASYNCIFY"
"-lidbfs.js"
"--shell-file"
"${EMSCRIPTEN_SHELL_FILE}"
)
if(HAS_PROJECT_RESOURCES)
target_link_options(${PROJECT_NAME} PRIVATE

View File

@@ -39,14 +39,14 @@
}
},
{
"name": "x64-Debug",
"displayName": "x64 Debug",
"name": "win32-debug",
"displayName": "Win32 Debug",
"description": "Visual Studio 2022 x64 Debug",
"generator": "Visual Studio 17 2022",
"architecture": "x64",
"binaryDir": "${sourceDir}/out/build/x64-Debug",
"binaryDir": "${sourceDir}/out/build/win32-debug",
"cacheVariables": {
"CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/x64-Debug"
"CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/win32-debug"
},
"condition": {
"type": "equals",
@@ -55,14 +55,14 @@
}
},
{
"name": "x64-Release",
"displayName": "x64 Release",
"name": "win32-release",
"displayName": "Win32 Release",
"description": "Visual Studio 2022 x64 Release",
"generator": "Visual Studio 17 2022",
"architecture": "x64",
"binaryDir": "${sourceDir}/out/build/x64-Release",
"binaryDir": "${sourceDir}/out/build/win32-release",
"cacheVariables": {
"CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/x64-Release"
"CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/win32-release"
},
"condition": {
"type": "equals",
@@ -81,13 +81,13 @@
"configurePreset": "linux-release"
},
{
"name": "x64-Debug",
"configurePreset": "x64-Debug",
"name": "win32-debug",
"configurePreset": "win32-debug",
"configuration": "Debug"
},
{
"name": "x64-Release",
"configurePreset": "x64-Release",
"name": "win32-release",
"configurePreset": "win32-release",
"configuration": "Release"
}
]

View File

@@ -1,28 +1,28 @@
{
"configurations": [
{
"name": "x64-Debug",
"generator": "Ninja",
"configurationType": "Debug",
"inheritEnvironments": [
"msvc_x64_x64"
],
{
"name": "win32-debug",
"generator": "Ninja",
"configurationType": "Debug",
"inheritEnvironments": [
"msvc_x64_x64"
],
"buildRoot": "${projectDir}\\out\\build\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "",
"ctestCommandArgs": ""
},
{
"name": "x64-Release",
"generator": "Ninja",
"configurationType": "Release",
"inheritEnvironments": [
"msvc_x64_x64"
],
{
"name": "win32-release",
"generator": "Ninja",
"configurationType": "Release",
"inheritEnvironments": [
"msvc_x64_x64"
],
"buildRoot": "${projectDir}\\out\\build\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "",
"ctestCommandArgs": ""
}
]
}
}

View File

@@ -4,7 +4,7 @@
This Is A Video Game Where You Feed The Snivy.
[Get Resources Here](https://shweetz.net/files/games/feed-snivy/resources.7z)
[Resources](https://shweetz.net/files/games/feed-snivy/resources.7z)
## Build
@@ -16,10 +16,11 @@ After cloning and enter the repository's directory, make sure to initialize the
Visual Studio is recommended for build.
### Linux
```
mkdir build
cd build
cmake ..
make
```
```
If using VSCode, several tasks are available to quickly run and build.

View File

@@ -0,0 +1,17 @@
if(NOT DEFINED SRC_DIR OR NOT DEFINED DST_DIR)
message(FATAL_ERROR "SRC_DIR and DST_DIR must be defined")
endif()
file(REMOVE_RECURSE "${DST_DIR}")
file(MAKE_DIRECTORY "${DST_DIR}")
# Copy all resources except characters/ contents.
file(COPY "${SRC_DIR}/" DESTINATION "${DST_DIR}"
PATTERN "characters/*" EXCLUDE)
# Copy only .zip archives from resources/characters.
file(MAKE_DIRECTORY "${DST_DIR}/characters")
file(GLOB CHARACTER_ZIPS "${SRC_DIR}/characters/*.zip")
if(CHARACTER_ZIPS)
file(COPY ${CHARACTER_ZIPS} DESTINATION "${DST_DIR}/characters")
endif()

View File

@@ -45,6 +45,7 @@ namespace game
Loader::Loader(int argc, const char** argv)
{
#ifdef __EMSCRIPTEN__
util::web_filesystem::init_and_wait();
#endif
@@ -83,6 +84,7 @@ namespace game
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
#ifdef __EMSCRIPTEN__
static constexpr glm::vec2 SIZE = {1600, 900};
window = SDL_CreateWindow("Snivy", SIZE.x, SIZE.y, SDL_WINDOW_OPENGL);
#else

View File

@@ -9,8 +9,6 @@ namespace game
class Loader
{
public:
static constexpr glm::vec2 SIZE = {1280, 720};
SDL_Window* window{};
SDL_GLContext context{};
bool isError{};

View File

@@ -20,10 +20,10 @@ namespace game::resource::xml
};
util::measurement::System measurementSystem{util::measurement::METRIC};
int volume{VOLUME_MAX};
int volume{50};
glm::vec3 color{0.120f, 0.515f, 0.115f};
glm::ivec2 windowSize{1280, 720};
glm::ivec2 windowSize{1600, 900};
glm::vec2 windowPosition{};
bool isValid{};

View File

@@ -41,7 +41,9 @@ namespace game
void State::update()
{
#ifndef __EMSCRIPTEN__
SDL_GetWindowSize(window, &resources.settings.windowSize.x, &resources.settings.windowSize.y);
#endif
SDL_Event event;
@@ -92,8 +94,10 @@ namespace game
void State::render()
{
ivec2 windowSize{};
auto windowSize = resources.settings.windowSize;
#ifndef __EMSCRIPTEN__
SDL_GetWindowSize(window, &windowSize.x, &windowSize.y);
#endif
canvas.bind();
canvas.size_set(windowSize);

View File

@@ -18,6 +18,8 @@ namespace game::state
{
World::Focus Main::focus_get()
{
if (!isWindows) return World::CENTER;
return menu.isOpen && tools.isOpen ? World::MENU_TOOLS
: menu.isOpen ? World::MENU
: tools.isOpen ? World::TOOLS
@@ -84,26 +86,28 @@ namespace game::state
text.entry = nullptr;
text.isEnabled = false;
if (auto font = character.data.menuSchema.font.get()) ImGui::GetIO().FontDefault = font;
if (game == NEW_GAME && dialogue.start.is_valid())
{
character.queue_play({.animation = dialogue.start.animation, .isInterruptible = false});
character.tick();
isWindows = false;
isStart = true;
}
isPostgame = saveData.isPostgame;
if (isPostgame)
menu.isCheats = true;
else
menu.isCheats = true; //false;
menu.isCheats = false;
if (game == NEW_GAME) isWindows = false;
if (auto font = character.data.menuSchema.font.get()) ImGui::GetIO().FontDefault = font;
character.play_default_animation();
character.tick();
worldCanvas.size_set(imgui::to_vec2(ImGui::GetMainViewport()->Size));
world.set(character, worldCanvas, focus_get());
if (game == NEW_GAME && dialogue.start.is_valid())
{
character.queue_play({.animation = dialogue.start.animation, .isInterruptible = false});
character.tick();
isStart = true;
}
}
void Main::exit(Resources& resources)

View File

@@ -91,11 +91,13 @@ namespace game::state::main
ImGui::EndTabItem();
}
if (isDebug && WIDGET_FX(ImGui::BeginTabItem("Debug")))
#if defined(DEBUG) && DEBUG
if (WIDGET_FX(ImGui::BeginTabItem("Debug")))
{
debug.update(character, cursor, itemManager, canvas);
ImGui::EndTabItem();
}
#endif
}
ImGui::EndTabBar();
}

View File

@@ -28,7 +28,6 @@ namespace game::state::main
state::Configuration configuration;
bool isCheats{true};
bool isDebug{true};
bool isOpen{true};
bool isChat{true};
util::imgui::WindowSlide slide{};

View File

@@ -13,7 +13,6 @@ namespace game::state::main
void World::set(entity::Character& character, Canvas& canvas, Focus focus)
{
character.stage = character.stage_get();
character.queue_idle_animation();
character_focus(character, canvas, focus);
}

43
web/index.html Normal file
View File

@@ -0,0 +1,43 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>snivy</title>
<style>
html, body {
margin: 0;
width: 100%;
height: 100%;
overflow: hidden;
background: #000;
}
body {
display: flex;
align-items: center;
justify-content: center;
}
#canvas {
display: block;
width: auto !important;
height: auto !important;
max-width: 100vw;
max-height: 100vh;
}
</style>
</head>
<body>
<canvas id="canvas" oncontextmenu="event.preventDefault()"></canvas>
<script>
var Module = {
canvas: (function() {
return document.getElementById("canvas");
})()
};
</script>
{{{ SCRIPT }}}
</body>
</html>