2024-03-24 11:01:28 +03:00
|
|
|
#pragma once
|
|
|
|
|
2024-04-06 13:25:11 +03:00
|
|
|
#define LOAD_ASSET(path) (GameEngine_OTRSigCheck((const char*) path) ? ResourceGetDataByName((const char*) path) : path)
|
|
|
|
#define LOAD_ASSET_RAW(path) ResourceGetDataByName((const char*) path)
|
|
|
|
|
2024-03-24 11:01:28 +03:00
|
|
|
#ifdef __cplusplus
|
|
|
|
#include <vector>
|
|
|
|
#include <Fast3D/gfx_pc.h>
|
2024-04-03 11:18:17 +03:00
|
|
|
#include "libultraship/src/Context.h"
|
2024-03-24 11:01:28 +03:00
|
|
|
|
|
|
|
#define SAMPLES_HIGH 544
|
|
|
|
#define SAMPLES_LOW 528
|
|
|
|
#define AUDIO_FRAMES_PER_UPDATE 2
|
|
|
|
#define NUM_AUDIO_CHANNELS 2
|
|
|
|
#define SAMPLES_PER_FRAME (SAMPLES_HIGH * NUM_AUDIO_CHANNELS * 2)
|
|
|
|
|
|
|
|
class GameEngine {
|
|
|
|
public:
|
|
|
|
static GameEngine* Instance;
|
|
|
|
|
|
|
|
std::shared_ptr<LUS::Context> context;
|
|
|
|
|
|
|
|
GameEngine();
|
|
|
|
static void Create();
|
|
|
|
void StartFrame() const;
|
|
|
|
static void RunCommands(Gfx* Commands);
|
|
|
|
void ProcessFrame(void (*run_one_game_iter)()) const;
|
|
|
|
static void Destroy();
|
2024-04-02 08:13:52 +03:00
|
|
|
static void ProcessGfxCommands(Gfx* commands);
|
2024-03-24 11:01:28 +03:00
|
|
|
};
|
|
|
|
#else
|
|
|
|
void GameEngine_ProcessGfxCommands(Gfx* commands);
|
|
|
|
float GameEngine_GetAspectRatio();
|
|
|
|
int GameEngine_OTRSigCheck(char* imgData);
|
|
|
|
#endif
|