Skip to content

Commit

Permalink
v0.54
Browse files Browse the repository at this point in the history
* updated docs
* update readmes
* bump engine version
* fixed a bug in FreeplayMenu scrolling up/down with left/right arrows on locked weeks.
* ExpansionsLoader: allow use the keyboard key Enter to launch the selected expansion.
* fixed a regresion in Week while trying to initialize Dialogue without the UI layout first.
* PreloadChase: print in console when a preload is requested.
* FFGraph: improve sndbridge linking.
* FontType: improve (again) smoothing
  • Loading branch information
kapodamy committed Mar 6, 2023
1 parent a91707a commit cc3a154
Show file tree
Hide file tree
Showing 22 changed files with 1,072 additions and 244 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
!/expansions/example-expansion/

Thumbs.db
/src-desktop/kdy-e/kdy-e.csproj.user
/src-desktop/kdy-e/kdy-e.csproj.user
29 changes: 22 additions & 7 deletions BUILDING.MD
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ Everything was written from scratch, with no frameworks except low-level librari
* *Font Atlas Builder*
* Creates a font texture atlas, written in C. Uses [freetype](https://freetype.org/ "freetype") library.
* The source code is located in the **fontatlas** folder.
* To compile open **MSYS2 MinGW x86** command prompt inside of the folder and run:
* `mingw32-make build-release-dll-x86` this creates **kdy_fontatlas.dll** file in *output* folder.
* (optional) `mingw32-make build-release` creates a [WASM](https://webassembly.org/ "WASM") file for the Javascript version.
* To compile open **MSYS2 MinGW x64** command prompt inside of the folder and run:
* `make build-release-dll-x64` this creates **kdy_fontatlas.dll** file in *output* folder.
* (optional) `make build-release` creates a [WASM](https://webassembly.org/ "WASM") file for the Javascript version.
* Note: "JS glue" code must be patched before being used.
* Project for [VSCode](https://code.visualstudio.com/ "VSCode") available.

Expand All @@ -33,7 +33,7 @@ Everything was written from scratch, with no frameworks except low-level librari
* Requires a [emscripten](https://emscripten.org/ "emscripten") static library of [Lua](https://www.lua.org/ "Lua").
* The source code is located in the **luascript** folder.
* Used **only** in the Javascript version.
* To compile open **MSYS2 MinGW x86** command prompt inside of the folder and run `mingw32-make build-release`, this creates a [WASM](https://webassembly.org/ "WASM") file.
* To compile open **MSYS2 MinGW x64** command prompt inside of the folder and run `make build-release`, this creates a [WASM](https://webassembly.org/ "WASM") file.
* Note: "JS glue" code must be patched before being used.
* Project for [VSCode](https://code.visualstudio.com/ "VSCode") available.
* *the C# version is automatically compiled with the engine.*
Expand All @@ -46,19 +46,34 @@ Everything was written from scratch, with no frameworks except low-level librari
* The source code is located in the **sndbridge** folder.
* Used **only** in the C# version.
* Project for [VSCode](https://code.visualstudio.com/ "VSCode") available.
* To compile open **MSYS2 MinGW x86** command prompt inside of the folder and run `mingw32-make build-release` this creates **kdy_AICA.dll** file in *output* folder.
* To compile open **MSYS2 MinGW x64** command prompt inside of the folder and run `make build-release` this creates **kdy_AICA.dll** file in *output* folder.

## FFGraph

* *FFmpeg Graph*
* Responsible for decoding video files (any format).
* Uses [FFmpeg](https://www.ffmpeg.org/ "FFmpeg").
* The source code is located in the **ffgraph** folder.
* Headers of FFmpeg are required (not provided). See ffgraph/include/README.TXT for more info.
* Shared libraries (dll files) of FFmpeg are required (not provided). See ffgraph/lib/x64/README.TXT for more info.
* Used **only** in the C# version.
* Project for [VSCode](https://code.visualstudio.com/ "VSCode") available.
* To compile open **MSYS2 MinGW x64** command prompt inside of the folder and run `make build-release` this creates **kdy_FFgraph.dll** file in *output* folder.

## lua-interop

* *Lua interoperability*
* **C# only**
* Contains all unmanaged code for interacting with Lua API. Automatically compiled with the engine.
* Contains all unmanaged code for interacting with Lua API.
* Automatically compiled with the engine.

## texture-mgr

* *Texture manager*
* **C# only**
* Reads and write image files (PNG files). Automatically compiled with the engine.
* Reads and write image files (PNG files).
* Parses icon files (ICO files)
* Automatically compiled with the engine.

---

Expand Down
3 changes: 3 additions & 0 deletions FEATURES.MD
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Engine features

Engine specific APIs

* Layout, is a html-like file used for building stages and screens.
Expand All @@ -13,6 +14,7 @@ Engine specific APIs
* Placeholders. Used for building custom menu screens (note: menus itself can not be modded)
* Antialiasing control, for use in pixelated stages.
* Actions, partial scripted layout modifications.
* Video playback.
* Non-scripted animations
* Also wrriten in XML.
* Frame-based animations:
Expand Down Expand Up @@ -41,3 +43,4 @@ Engine specific APIs
* Week.
* Menus.
* Layout visor, an html page used to visualize layouts.
* Engine menus customization and creation of custom menu screens.
14 changes: 12 additions & 2 deletions INSTALLING.MD
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Before continue create a new folder somewhere (eg *dist*), here all compiled fil

## 1. Copy required libraries

All required libraries are inside of **external_libraries-x86** folder, easy. This includes:
All required libraries are inside of **external_libraries-x64** folder, easy. This includes:

* `freetype.dll`
* `glfw.dll`
Expand All @@ -18,14 +18,23 @@ All required libraries are inside of **external_libraries-x86** folder, easy. Th
* `lua.dll`
* `kdy_AICA.dll` (prebuilt)
* `kdy_fontatlas.dll` (prebuilt)
* `kdy_FFgraph.dll` (prebuilt)

If sndbrigde was built with opus codec support, the following dll files also are required:
If sndbrigde was built with OPUS codec support, the following dll files also are required otherwise **the engine will not run**:

* `opusfile.dll`
* `opus.dll`
* `libssl-1_1.dll`
* `libcrypto-1_1.dll`

If video playback is necessary, download the [FFmpeg](https://www.ffmpeg.org/download.html#build-windows "FFmpeg download link") shared libraries, required dll files are:

* `avcodec-59.dll`
* `avformat-59.dll`
* `avutil-57.dll`
* `swscale-6.dll`
* `swresample-4.dll`

## 2. Getting the assets folder

The engine provides a different file order plus extra files used by the engine itself.
Expand Down Expand Up @@ -56,3 +65,4 @@ Javascript version of the engine does not require any compilation, just copy the
### Launching the javascript version

Open `kdmy_engine.html` to launch the engine or `kdmy_engine_layout_visor.html` to open the *Layout Visor*.
If the engine does not load try [allowing access to local files](https://dev.to/dengel29/loading-local-files-in-firefox-and-chrome-m9f "guide") or mounting a web server.
11 changes: 6 additions & 5 deletions README.MD
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

# KDMY Engine: Friday Night Funkin'

![dreamcast](https://img.shields.io/badge/dreamcast%20build-failing-red) ![C#](https://img.shields.io/badge/contains-C%23-informational) ![JS](https://img.shields.io/badge/contains-Javascript-informational) ![C](https://img.shields.io/badge/contains-C-informational) ![haxe](https://img.shields.io/badge/contains%20haxe%3F-haxen't-inactive)
![dreamcast](https://img.shields.io/badge/dreamcast%20build-failing-red) ![C#](https://img.shields.io/badge/contains-C%23-informational) ![JS](https://img.shields.io/badge/contains-Javascript-informational) ![C](https://img.shields.io/badge/contains-C-informational) ![haxe](https://img.shields.io/badge/contains%20haxe%3F-haxen't-inactive) [![buymeacoffee](https://img.shields.io/badge/-buy_me_a%C2%A0coffee-gray?logo=buy-me-a-coffee)](https://www.buymeacoffee.com/kapodamy)

kdy-e is an engine for FNF, written from scratch in javascript|C|C# (no haxe here). It was build specifically for the Sega Dreamcast, it was . . .

Expand Down Expand Up @@ -33,7 +33,8 @@ As for the basics, the engine has support for gamepads, multiple saveslots, mult
* Per-track distributions (experimental), stage, lua script and characters.
* Credits (can be customized per week), also has lua scripting support.
* Each week and/or track stage can define the placement of characters and UI cosmetics (streak counter, ranking counter and accuracy).
* Partial week lua scripting support (also known as "modcharts").
* Week lua scripting support (also known as "modcharts").
* Menu customization.
* Built-in engine features (explained below)

## Engine especific features
Expand All @@ -47,14 +48,14 @@ Explained here [FEATURES.MD](FEATURES.MD "FEATURES.MD")
![pause](test%20files/kdmy%20pics/screenshots/pause.png)
![weekselector](test%20files/kdmy%20pics/screenshots/weekselector.png)

## Missing features / To be implemented
## ¿What is missing?

* ~~Post-processing shaders~~. ¡DONE!
* ~~Dialogues (waht a shame)~~. ¡DONE!
* ~~Expansions loader (a.k.a mods loader).~~. ¡DONE!
* ~~Lua API to manipulate strums, states and UI cosmetics~~. ¡DONE!
* Documentation (a lot).
* Video playback (kinda optional).
* Documentation (only a part is documented).
* ~~Video playback (kinda optional).~~ ¡DONE!

## How to compile

Expand Down
9 changes: 4 additions & 5 deletions ffgraph/.gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@

# ignore due license incompatibility
/include/avcodec/
/include/avformat/
/include/avutil/
/include/swresample/
/include/swscale/
/ffgraph/include/
!/ffgraph/include/README.TXT
!/ffgraph/include/externaldecoder.h
!/ffgraph/include/filehandle.h

# ignore due license incompatibility
/lib/x64/avcodec-59.dll
Expand Down
26 changes: 1 addition & 25 deletions ffgraph/include/externaldecoder.h
Original file line number Diff line number Diff line change
@@ -1,25 +1 @@
#ifndef _externaldecoder_h
#define _externaldecoder_h

#include <stdint.h>
#include <stdbool.h>


typedef void (*ExternalDecoderDestroyCB)(void* decoder);
typedef int32_t (*ExternalDecoderReadCB)(void* decoder, float* buffer, int32_t sample_per_channel);
typedef void (*ExternalDecoderInfoCB)(void* decoder, int32_t* rate, int32_t* channels, double* duration);
typedef bool (*ExternalDecoderSeekCB)(void* decoder, double timestamp);

//
// Important: in ExternalDecoder all callbacks are required. If necessary omit using STUBS
//

typedef struct {
void* decoder;
ExternalDecoderDestroyCB destroy_func;
ExternalDecoderReadCB read_func;
ExternalDecoderInfoCB info_func;
ExternalDecoderSeekCB seek_func;
} ExternalDecoder;

#endif
#include "../../sndbridge/src/externaldecoder.h"
44 changes: 1 addition & 43 deletions ffgraph/include/filehandle.h
Original file line number Diff line number Diff line change
@@ -1,43 +1 @@
#ifndef _filehandle_h
#define _filehandle_h

#include <stdint.h>
#include <stdbool.h>

typedef int32_t(*FileHandle_Read)(void* handle, void* buffer, int32_t buffer_size);
typedef int64_t(*FileHandle_Seek)(void* handle, int64_t offset, int32_t whence);
typedef int64_t(*FileHandle_Tell)(void* handle);
typedef int64_t(*FileHandle_Length)(void* handle);

typedef struct {
void* handle;
bool is_file;
FileHandle_Read read;
FileHandle_Seek seek;
FileHandle_Tell tell;
FileHandle_Length length;
} FileHandle_t;

static inline int32_t filehandle_read(FileHandle_t* f, void* buffer, int32_t buffer_size) {
return f->read(f->handle, buffer, buffer_size);
}

static inline int64_t filehandle_seek(FileHandle_t* f, int64_t offset, int32_t whence) {
return f->seek(f->handle, offset, whence);
}

static inline int64_t filehandle_tell(FileHandle_t* f) {
return f->tell(f->handle);
}

static inline int64_t filehandle_length(FileHandle_t* f) {
return f->length(f->handle);
}


FileHandle_t* filehandle_init(const char* fullpath);
FileHandle_t* filehandle_init2(const uint8_t* buffer, int32_t size);
FileHandle_t* filehandle_init3(const char* fullpath);
void filehandle_destroy(FileHandle_t* filehandle);

#endif
#include "../../sndbridge/src/filehandle.h"
Loading

0 comments on commit cc3a154

Please sign in to comment.