Début convertisseur + ajout timestamps

This commit is contained in:
attilavs2 2024-02-14 18:17:04 +01:00
parent 534ffbe6f2
commit 474e132732
29 changed files with 84 additions and 27 deletions

1
.gitignore vendored
View File

@ -16,6 +16,7 @@
__pycache__/
# Common IDE files
*.kate-swp
*.sublime-project
*.sublime-workspace
.vscode

View File

@ -1,3 +1,4 @@
#Fcalva 14/02/2024
# Configure with [fxsdk build-fx] or [fxsdk build-cg], which provide the
# toolchain file and module path of the fxSDK
@ -34,6 +35,7 @@ set(SOURCES
src/inputs.c
src/ui.c
src/sdl_image.c
maps/convert/converted.c
)
set(ASSETS
@ -47,20 +49,6 @@ set(ASSETS
)
if("${FXSDK_PLATFORM_LONG}" STREQUAL fxCG50)
#fxconv_declare_converters(assets-cg/map/converters.py)
#Les lignes suivantes proviennent de https://gitea.planet-casio.com/Slyvtt/Collab_RPG
#add_custom_command(
# COMMENT "Convert Tiled TMX map to usable JSON file"
# COMMAND 'find | grep .*.tmx | sed 's/.tmx//g' | xargs -l bash -c 'tiled --export-map json $$0.tmx $$0.json''
# WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/assets-cg/map/
#
# OUTPUT "${CMAKE_CURRENT_LIST_DIR}/assets-cg/map/Shooterlevel0.json"
# if several levels/maps are created, just copy the previous line and change the .json name with the new level/map
# DEPENDS assets-cg/map/converters.py
# assets-cg/map/0.tmx
#)
fxconv_declare_assets(${ASSETS} ${ASSETS_fx} ${ASSETS_cg} WITH_METADATA)
set(CFLAGS -Wall -Wextra -Ofast -pipe -flto)

Binary file not shown.

View File

@ -1,18 +1,24 @@
#Script to do the build for you. Not meant to be more then an automation tool for devs.
#Fcalva 14/02/2024
#Script to do the build for you.
#Is now meant to be used since it runs the converter script for you
if test $1 "linux"; then
mkdir "./build"
cd "./build"
python3 ./maps/convert/convert.py
if test $1 = "linux"; then
mkdir "./build-linux"
cd "./build-linux"
cmake ..
make
mv "./RaycasterGame" "../RaycasterGame.amd64";
elif test $1 "win"; then
elif test $1 = "cg"; then
fxsdk build-cg;
elif test $1 = "win"; then
#todo
echo "not done yet !";
elif test $1 "ems"; then
mkdir "./build"
cd "./build"
elif test $1 = "ems"; then
mkdir "./build-ems"
cd "./build-ems"
cmake ..
emmake make
emcc [-Ox] RaycaserGame.o -o RaycaserGame.js
emcc [-Ox] RaycasterGame.o -o RaycasterGame.js
fi

1
converted.c Normal file
View File

@ -0,0 +1 @@
#include "../../src/fixed.h"

21
maps/convert/convert.py Normal file
View File

@ -0,0 +1,21 @@
#Fcalva 14/02/2023
import os
import os.path
print("convert.py : Converting maps to C object...")
try:
convert = open("./converted.c", mode="x+t", buffering=1, encoding="utf-8", newline="\n")
convert.write('#include "../../src/fixed.h"\n')
except:
convert = open("./converted.c", mode="r+t", buffering=1, encoding="utf-8", newline="\n")
folder = os.listdir(path="..")
for i in range(0, len(folder)):
flen = len(folder[i])-1
if folder[i][flen-2] == "." and folder[i][flen-1] == "r" and folder[i][flen] == "c":
continue
else:
folder.pop(i)

1
maps/convert/converted.c Normal file
View File

@ -0,0 +1 @@
#include "../../src/fixed.h"

0
maps/map0.rc Normal file
View File

View File

@ -1,3 +1,5 @@
//Fcalva 14/02/2024
#ifndef config__h
#define config__h

View File

@ -3,7 +3,7 @@
// ---
//
// Fcalva : vient de https://gitea.planet-casio.com/Slyvtt/OutRun
//
// Fcalva 14/02/2024
#pragma once
#include <stdint.h>

View File

@ -1,3 +1,4 @@
//Fcalva 14/02/2024
// Tout les #include extérieurs au projet
#ifndef includes__h

View File

@ -1,3 +1,5 @@
//Fcalva 14/02/2024
#include "includes.h"
#include "inputs.h"

View File

@ -1,3 +1,5 @@
//Fcalva 14/02/2024
#include "includes.h"
#include "types.h"

View File

@ -1,3 +1,5 @@
//Fcalva 14/02/2024
#ifdef FX9860G
#error "Ce code n'est pas pour FX, enlevez ce message a vos riques et périls"
#endif

View File

@ -1,3 +1,5 @@
//Fcalva 14/02/2024
#include "includes.h"
#include "types.h"
@ -49,9 +51,9 @@ ShooterMap ShooterLevel0 = {0,0,0,0,0,0,
{1,255,2,2,2,2,2,2,2,2,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,2},
{2,255,2,0,0,0,2,0,0,2,255,255,255,255,255,2,2,0,2,2,255,255,255,255,255,255,255,255,255,255,255,2},
{2,255,2,0,0,0,0,0,0,0,255,255,255,255,255,2,0,0,0,2,255,255,255,255,255,255,255,255,255,255,255,2},
{2,255,2,0,0,0,2,0,0,2,255,255,0,0,0,0,0,2,255,255,255,255,255,255,255,255,255,255,255,255,255,2},
{2,255,2,0,0,0,2,0,0,2,255,255,255,255,255,2,0,0,0,2,255,255,255,255,255,255,255,255,255,255,255,2},
{2,255,2,0,0,0,2,2,2,2,0,255,255,255,255,2,0,0,0,2,255,255,255,255,255,255,255,255,255,255,255,2},
{2,255,2,0,0,0,2,0,0,0,255,255,255,255,255,2,2,0,2,2,255,255,255,255,255,255,255,255,255,255,255,2},
{2,255,2,0,0,0,2,0,0,0,255,255,255,255,255,2,2,2,2,2,255,255,255,255,255,255,255,255,255,255,255,2},
{2,255,2,2,2,2,2,0,0,2,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,2},
{2,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,2},
{2,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,2},

View File

@ -1,3 +1,5 @@
//Fcalva 14/02/2024
#include "includes.h"
#include "types.h"

View File

@ -1,3 +1,5 @@
//Fcalva 14/02/2024
#include "includes.h"
#include "moteur.h"
@ -194,7 +196,7 @@ void dstripe(image_t *stripe, image_t *vram, int x, int linePos, int lineHeight,
if(linePos < ymin || linePos+lineHeight > ymax){
texSampleY = f2int(fdiv(fix(linePos - ymin), texScale));
//texSample = f2int(fdiv(fix(linePos + lineHeight - ymax), texScale));
texSample = f2int(fdiv(fix(linePos + lineHeight - ymax), texScale));
}
image_sub(stripe, 0, texSampleY, 2, texSample, &stripe1);

View File

@ -1,3 +1,5 @@
//Fcalva 14/02/2024
#include "includes.h"
#include "types.h"

View File

@ -1,3 +1,5 @@
//Fcalva 14/02/2024
#include "includes.h"

View File

@ -1,3 +1,5 @@
//Fcalva 14/02/2024
#include "includes.h"
#ifndef player_h

View File

@ -1,3 +1,5 @@
//Fcalva 14/02/2024
#include "includes.h"
#ifdef SDL2

View File

@ -1,3 +1,5 @@
//Fcalva 14/02/2024
#ifdef SDL2
#ifndef sdl__h

View File

@ -1,3 +1,5 @@
//Fcalva 14/02/2024
#include "includes.h"
#include "types.h"

View File

@ -1,3 +1,5 @@
//Fcalva 14/02/2024
#include "includes.h"
#ifndef sprites_h

View File

@ -1,3 +1,5 @@
//Fcalva 14/02/2024
#include "includes.h"
#ifndef types_h

View File

@ -1,3 +1,5 @@
//Fcalva 14/02/2024
#include "includes.h"
#include "ui.h"

View File

@ -1,3 +1,5 @@
//Fcalva 14/02/2024
#ifndef ui__h
#define ui__h

View File

@ -1,3 +1,5 @@
//Fcalva 14/02/2024
#include "includes.h"
#include "types.h"

View File

@ -1,3 +1,5 @@
//Fcalva 14/02/2024
#include "includes.h"
#ifndef utils__h