forked from Xeeynamo/sonic-hybrid-rsdk
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
247 additions
and
0 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
sonic3air-main/Oxygen/oxygenengine/source/engineapp/ConfigurationImpl.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#pragma once | ||
|
||
#include "oxygen/application/Configuration.h" | ||
|
||
|
||
class ConfigurationImpl : public ::Configuration | ||
{ | ||
public: | ||
ConfigurationImpl(); | ||
|
||
protected: | ||
inline void preLoadInitialization() override {} | ||
bool loadConfigurationInternal(JsonHelper& jsonHelper) override; | ||
bool loadSettingsInternal(JsonHelper& jsonHelper, SettingsType settingsType) override; | ||
inline void saveSettingsInternal(Json::Value& root, SettingsType settingsType) override {} | ||
}; |
136 changes: 136 additions & 0 deletions
136
sonic3air-main/Oxygen/oxygenengine/source/engineapp/EngineDelegate.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
#include "engineapp/pch.h" | ||
#include "engineapp/EngineDelegate.h" | ||
#include "engineapp/GameApp.h" | ||
#include "engineapp/audio/AudioOut.h" | ||
|
||
|
||
const EngineDelegateInterface::AppMetaData& EngineDelegate::getAppMetaData() | ||
{ | ||
if (mAppMetaData.mTitle.empty()) | ||
{ | ||
mAppMetaData.mTitle = "Oxygen Engine"; | ||
mAppMetaData.mBuildVersionString = "0.1.0"; // Oxygen Engine currently doesn't use a version number to take serious in any way... | ||
mAppMetaData.mBuildVersionNumber = 0x00010000; | ||
} | ||
mAppMetaData.mAppDataFolder = L"OxygenEngine"; | ||
return mAppMetaData; | ||
} | ||
|
||
GuiBase& EngineDelegate::createGameApp() | ||
{ | ||
return *new GameApp(); | ||
} | ||
|
||
AudioOutBase& EngineDelegate::createAudioOut() | ||
{ | ||
return *new AudioOut(); | ||
} | ||
|
||
bool EngineDelegate::onEnginePreStartup() | ||
{ | ||
return true; | ||
} | ||
|
||
bool EngineDelegate::setupCustomGameProfile() | ||
{ | ||
// Return false to signal that there's no custom game profile, and the oxygenproject.json should be loaded instead | ||
return false; | ||
} | ||
|
||
void EngineDelegate::startupGame(EmulatorInterface& emulatorInterface) | ||
{ | ||
} | ||
|
||
void EngineDelegate::shutdownGame() | ||
{ | ||
} | ||
|
||
void EngineDelegate::updateGame(float timeElapsed) | ||
{ | ||
} | ||
|
||
void EngineDelegate::registerScriptBindings(lemon::Module& module) | ||
{ | ||
#ifdef USE_EXPERIMENTS | ||
mExperiments.registerScriptBindings(module); | ||
#endif | ||
} | ||
|
||
void EngineDelegate::registerNativizedCode(lemon::Program& program) | ||
{ | ||
} | ||
|
||
void EngineDelegate::onRuntimeInit(CodeExec& codeExec) | ||
{ | ||
} | ||
|
||
void EngineDelegate::onPreFrameUpdate() | ||
{ | ||
#ifdef USE_EXPERIMENTS | ||
mExperiments.onPreFrameUpdate(); | ||
#endif | ||
} | ||
|
||
void EngineDelegate::onPostFrameUpdate() | ||
{ | ||
#ifdef USE_EXPERIMENTS | ||
mExperiments.onPostFrameUpdate(); | ||
#endif | ||
} | ||
|
||
void EngineDelegate::onControlsUpdate() | ||
{ | ||
} | ||
|
||
void EngineDelegate::onPreSaveStateLoad() | ||
{ | ||
} | ||
|
||
bool EngineDelegate::mayLoadScriptMods() | ||
{ | ||
return true; | ||
} | ||
|
||
bool EngineDelegate::allowModdedData() | ||
{ | ||
return true; | ||
} | ||
|
||
bool EngineDelegate::useDeveloperFeatures() | ||
{ | ||
return true; | ||
} | ||
|
||
void EngineDelegate::onActiveModsChanged() | ||
{ | ||
} | ||
|
||
void EngineDelegate::onGameRecordingHeaderLoaded(const std::string& buildString, const std::vector<uint8>& buffer) | ||
{ | ||
} | ||
|
||
void EngineDelegate::onGameRecordingHeaderSave(std::vector<uint8>& buffer) | ||
{ | ||
} | ||
|
||
Font& EngineDelegate::getDebugFont(int size) | ||
{ | ||
if (size >= 10) | ||
{ | ||
static Font font10; | ||
if (font10.getLineHeight() == 0) | ||
font10.loadFromFile("data/font/oxyfont_regular.json", 0.0f); | ||
return font10; | ||
} | ||
else | ||
{ | ||
static Font font3; | ||
if (font3.getLineHeight() == 0) | ||
font3.loadFromFile("data/font/smallfont.json", 0.0f); | ||
return font3; | ||
} | ||
} | ||
|
||
void EngineDelegate::fillDebugVisualization(Bitmap& bitmap, int& mode) | ||
{ | ||
} |
51 changes: 51 additions & 0 deletions
51
sonic3air-main/Oxygen/oxygenengine/source/engineapp/EngineDelegate.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#pragma once | ||
|
||
#include "engineapp/ConfigurationImpl.h" | ||
#include "engineapp/experiments/Experiments.h" | ||
#include "engineapp/version.inc" | ||
|
||
#include "oxygen/application/EngineMain.h" | ||
|
||
|
||
class EngineDelegate : public EngineDelegateInterface | ||
{ | ||
public: | ||
const AppMetaData& getAppMetaData() override; | ||
GuiBase& createGameApp() override; | ||
AudioOutBase& createAudioOut() override; | ||
|
||
bool onEnginePreStartup() override; | ||
bool setupCustomGameProfile() override; | ||
|
||
void startupGame(EmulatorInterface& emulatorInterface) override; | ||
void shutdownGame() override; | ||
void updateGame(float timeElapsed) override; | ||
|
||
void registerScriptBindings(lemon::Module& module) override; | ||
void registerNativizedCode(lemon::Program& program) override; | ||
|
||
void onRuntimeInit(CodeExec& codeExec) override; | ||
void onPreFrameUpdate() override; | ||
void onPostFrameUpdate() override; | ||
void onControlsUpdate() override; | ||
void onPreSaveStateLoad() override; | ||
|
||
bool mayLoadScriptMods() override; | ||
bool allowModdedData() override; | ||
bool useDeveloperFeatures() override; | ||
void onActiveModsChanged() override; | ||
|
||
void onGameRecordingHeaderLoaded(const std::string& buildString, const std::vector<uint8>& buffer) override; | ||
void onGameRecordingHeaderSave(std::vector<uint8>& buffer) override; | ||
|
||
Font& getDebugFont(int size) override; | ||
void fillDebugVisualization(Bitmap& bitmap, int& mode) override; | ||
|
||
private: | ||
AppMetaData mAppMetaData; | ||
ConfigurationImpl mConfiguration; | ||
|
||
#ifdef USE_EXPERIMENTS | ||
Experiments mExperiments; | ||
#endif | ||
}; |
44 changes: 44 additions & 0 deletions
44
sonic3air-main/Oxygen/oxygenengine/source/engineapp/GameApp.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#include "engineapp/pch.h" | ||
#include "engineapp/GameApp.h" | ||
|
||
#include "oxygen/application/Application.h" | ||
#include "oxygen/simulation/Simulation.h" | ||
|
||
|
||
GameApp::GameApp() | ||
{ | ||
} | ||
|
||
GameApp::~GameApp() | ||
{ | ||
} | ||
|
||
void GameApp::initialize() | ||
{ | ||
Simulation& simulation = Application::instance().getSimulation(); | ||
simulation.setRunning(true); | ||
} | ||
|
||
void GameApp::deinitialize() | ||
{ | ||
} | ||
|
||
void GameApp::mouse(const rmx::MouseEvent& ev) | ||
{ | ||
GuiBase::mouse(ev); | ||
} | ||
|
||
void GameApp::keyboard(const rmx::KeyboardEvent& ev) | ||
{ | ||
GuiBase::keyboard(ev); | ||
} | ||
|
||
void GameApp::update(float timeElapsed) | ||
{ | ||
GuiBase::update(timeElapsed); | ||
} | ||
|
||
void GameApp::render() | ||
{ | ||
GuiBase::render(); | ||
} |