[RELEASE] u22-v04
This version is submitted for U22 final presentation. (squashed 158 commits)
This commit is contained in:
@@ -1 +1,3 @@
|
||||
add_compile_options(${LEFTONE_C_FLAGS})
|
||||
|
||||
add_subdirectory(sdl)
|
||||
|
@@ -5,7 +5,7 @@ add_executable(app-sdl
|
||||
)
|
||||
target_link_libraries(app-sdl
|
||||
GLEW::GLEW
|
||||
SDL2::SDL2
|
||||
${SDL2_TARGET}
|
||||
|
||||
conv
|
||||
parsarg
|
||||
|
@@ -75,9 +75,6 @@ void app_args_parse(app_args_t* args, int argc, char** argv) {
|
||||
|
||||
bool_("skip-title", args->scene.skip_title);
|
||||
|
||||
bool_("test-poolset-packing", args->scene.test.loworld_poolset_packing);
|
||||
bool_("test-player-packing", args->scene.test.loplayer_packing);
|
||||
|
||||
/* ---- app parameters ---- */
|
||||
int_("max-fps", args->max_fps, 1, INT32_MAX);
|
||||
|
||||
|
@@ -10,15 +10,13 @@
|
||||
#define APP_EVENT_GET_BUTTON_BIT_FROM_KEY(k) ( \
|
||||
(k) == SDLK_a? LOCOMMON_INPUT_BUTTON_LEFT: \
|
||||
(k) == SDLK_d? LOCOMMON_INPUT_BUTTON_RIGHT: \
|
||||
(k) == SDLK_w? LOCOMMON_INPUT_BUTTON_UP: \
|
||||
(k) == SDLK_s? LOCOMMON_INPUT_BUTTON_DOWN: \
|
||||
(k) == SDLK_SPACE? LOCOMMON_INPUT_BUTTON_JUMP: \
|
||||
(k) == SDLK_LSHIFT? LOCOMMON_INPUT_BUTTON_DASH: \
|
||||
(k) == SDLK_LSHIFT? LOCOMMON_INPUT_BUTTON_DODGE: \
|
||||
(k) == SDLK_ESCAPE? LOCOMMON_INPUT_BUTTON_MENU: \
|
||||
0)
|
||||
|
||||
#define APP_EVENT_GET_BUTTON_BIT_FROM_MOUSE(m) ( \
|
||||
(m) == SDL_BUTTON_LEFT? LOCOMMON_INPUT_BUTTON_ATTACK: \
|
||||
(m) == SDL_BUTTON_LEFT? LOCOMMON_INPUT_BUTTON_SHOOT: \
|
||||
(m) == SDL_BUTTON_RIGHT? LOCOMMON_INPUT_BUTTON_GUARD: \
|
||||
0)
|
||||
|
||||
|
@@ -3,7 +3,9 @@
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <GL/glew.h>
|
||||
#include <SDL2/SDL.h>
|
||||
@@ -128,7 +130,8 @@ int main(int argc, char** argv) {
|
||||
|
||||
app_get_dpi_(&libs, &args);
|
||||
|
||||
loscene_context_t* ctx = loscene_context_new(&args.scene);
|
||||
loscene_context_t ctx;
|
||||
loscene_context_initialize(&ctx, &args.scene);
|
||||
|
||||
locommon_input_t input = {
|
||||
.resolution = vec2(args.scene.width, args.scene.height),
|
||||
@@ -147,10 +150,10 @@ int main(int argc, char** argv) {
|
||||
if (!app_event_handle(&input, &e)) goto EXIT;
|
||||
}
|
||||
|
||||
if (!loscene_context_update(ctx, &input, base_time)) goto EXIT;
|
||||
if (!loscene_context_update(&ctx, &input, base_time)) goto EXIT;
|
||||
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
loscene_context_draw(ctx);
|
||||
loscene_context_draw(&ctx);
|
||||
SDL_GL_SwapWindow(libs.win);
|
||||
|
||||
# ifndef NDEBUG
|
||||
@@ -166,7 +169,7 @@ int main(int argc, char** argv) {
|
||||
}
|
||||
|
||||
EXIT:
|
||||
loscene_context_delete(ctx);
|
||||
loscene_context_deinitialize(&ctx);
|
||||
app_deinitialize_libraries_(&libs);
|
||||
return 0;
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
Reference in New Issue
Block a user