Shameless remake of Massena's game

This commit is contained in:
KikooDX 2021-04-16 11:08:47 +02:00
commit f101e53706
10 changed files with 124 additions and 0 deletions

10
.clang-format Normal file
View File

@ -0,0 +1,10 @@
# https://clang.llvm.org/docs/ClangFormat.html
BasedOnStyle: LLVM
IndentWidth: 8
UseTab: AlignWithSpaces
BreakBeforeBraces: Linux
AllowShortIfStatementsOnASingleLine: false
IndentCaseLabels: false
ColumnLimit: 80
AlignConsecutiveMacros: true
AlwaysBreakAfterReturnType: TopLevelDefinitions

12
.gitignore vendored Normal file
View File

@ -0,0 +1,12 @@
# Build files
/build-cg
/*.g3a
# Common IDE files
*.sublime-project
*.sublime-workspace
.vscode
*.swp
# KBLE backup files
backup_*.kble

44
CMakeLists.txt Normal file
View File

@ -0,0 +1,44 @@
# Configure with [fxsdk build-fx] or [fxsdk build-cg], which provide the
# toolchain file and module path of the fxSDK
cmake_minimum_required(VERSION 3.18)
project(PcAdmin C)
include(GenerateG1A)
include(GenerateG3A)
include(Fxconv)
find_package(Gint 2.4 REQUIRED)
include_directories(include)
set(SOURCES
src/main.c
src/bar/init.c
src/bar/update.c
src/bar/draw.c
)
set(ASSETS)
set(FLAGS
-std=c11
-Wall -Wextra -pedantic
-Wshadow
-Wswitch-default -Wswitch-enum
-Wunreachable-code
-Wstrict-prototypes -Wmissing-prototypes
-Werror-implicit-function-declaration
-Os
)
fxconv_declare_assets(${ASSETS} WITH_METADATA)
add_executable(Main ${SOURCES} ${ASSETS})
target_compile_options(Main PRIVATE ${FLAGS})
target_link_libraries(Main Gint::Gint)
generate_g3a(
TARGET Main
OUTPUT "${PROJECT_NAME}.g3a"
NAME "${PROJECT_NAME}"
ICONS assets/icon-uns.png assets/icon-sel.png)

BIN
assets/icon-sel.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

BIN
assets/icon-uns.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

18
include/bar.h Normal file
View File

@ -0,0 +1,18 @@
#pragma once
#include <gint/display.h>
#define BAR_WIDTH 12
#define BAR_Y 32
#define BAR_HEIGHT (DHEIGHT - BAR_Y * 2)
#define BAR_BASE_FILL 0.5
struct Bar {
int x;
int y;
int height;
float fill;
};
struct Bar bar_init(int x);
void bar_update(struct Bar *bar);
void bar_draw(struct Bar bar);

6
src/bar/draw.c Normal file
View File

@ -0,0 +1,6 @@
#include "bar.h"
void
bar_draw(struct Bar bar)
{
}

12
src/bar/init.c Normal file
View File

@ -0,0 +1,12 @@
#include "bar.h"
struct Bar
bar_init(int x)
{
return (struct Bar){
.x = x,
.y = BAR_Y,
.height = BAR_HEIGHT,
.fill = BAR_BASE_FILL,
};
}

6
src/bar/update.c Normal file
View File

@ -0,0 +1,6 @@
#include "bar.h"
void
bar_update(struct Bar *bar)
{
}

16
src/main.c Normal file
View File

@ -0,0 +1,16 @@
#include "bar.h"
#include <gint/display.h>
#include <gint/keyboard.h>
int
main(void)
{
struct Bar my_bar = bar_init(22);
dclear(C_WHITE);
bar_draw(my_bar);
dupdate();
getkey();
return 1;
}