Bootup as osgi bundles

This commit is contained in:
Willem Cazander 2022-03-01 19:03:03 +01:00
parent 9afa43331a
commit b526b97558
122 changed files with 1762 additions and 681 deletions

View file

@ -0,0 +1,9 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>love.distributedrebirth.gdxapp4d</groupId>
<artifactId>gdxapp4d</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>gdxapp4d-app-notepad</artifactId>
</project>

View file

@ -0,0 +1,9 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>love.distributedrebirth.gdxapp4d</groupId>
<artifactId>gdxapp4d</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>gdxapp4d-app-tosamp</artifactId>
</project>

View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
<entry key="1c2d010066a39d96ace8af0ecc37c72d6f79109f30939e2959befcd9ce25fc8d">../gdxapp4d-chain-sys-engine/src/chain</entry>
<entry key="f8be3b29da5b6b2cb464f781469ceede6ccfd848d158293a4cdffbc2c41a410b">../gdxapp4d-chain-sys-ocean/src/chain</entry>
<entry key="ccba3b29da8b1b1cb444f381449beede3cbfd442d158293a4cdffbc3c41a31cc">../gdxapp4d-vrgem4/src/chain</entry>
<entry key="ccba3b29da8b1b1cb444f381449beede3cbfd442d158293a4cdffbc3c41a31cc.gdxapp4d-vrgem4.jar">../gdxapp4d-vrgem4/target/classes</entry>
</properties>

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<root:device xmlns:root="http://wrap-ship.x4o.distributedrebirth.love/xml/ns/warp-ship-root"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:boot="http://warp-ship.x4o.distributedrebirth.love/xml/ns/warp-ship-boot"
xsi:schemaLocation="http://wrap-ship.x4o.distributedrebirth.love/xml/ns/warp-ship-root http://warp-ship.x4o.distributedrebirth.love/xml/ns/warp-ship-root-1.0.xsd">
<boot:ship name="tos4-mark1-local" engine="1c2d010066a39d96ace8af0ecc37c72d6f79109f30939e2959befcd9ce25fc8d">
<boot:ocean sea="f8be3b29da5b6b2cb464f781469ceede6ccfd848d158293a4cdffbc2c41a410b"/>
</boot:ship>
</root:device>

View file

@ -2,14 +2,14 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>love.distributedrebirth.gdxapp4d</groupId>
<artifactId>gdxapp4d-boot</artifactId>
<artifactId>gdxapp4d</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>gdxapp4d-boot-desktop</artifactId>
<dependencies>
<dependency>
<groupId>love.distributedrebirth.gdxapp4d</groupId>
<artifactId>gdxapp4d-boot-tos4</artifactId>
<artifactId>gdxapp4d-tos4</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>

View file

@ -1,4 +1,4 @@
package love.distributedrebirth.gdxapp.desktop;
package love.distributedrebirth.gdxapp4d.boot.desktop;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;

View file

@ -1,4 +1,4 @@
package love.distributedrebirth.gdxapp.desktop;
package love.distributedrebirth.gdxapp4d.boot.desktop;
import java.util.Arrays;
@ -7,7 +7,7 @@ import com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application;
import com.badlogic.gdx.backends.lwjgl3.Lwjgl3ApplicationConfiguration;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
import love.distributedrebirth.gdxapp.GDXAppMain;
import love.distributedrebirth.gdxapp4d.tos4.GDXAppTos4;
import net.spookygames.gdx.nativefilechooser.desktop.DesktopFileChooser;
/**
@ -21,7 +21,7 @@ public class GDXAppDesktopLauncher {
int width = GDXAppDesktopConfig.WINDOW_WIDTH;
int height = GDXAppDesktopConfig.WINDOW_HEIGHT;
GDXAppMain.INSTANCE.BãßInit(Arrays.asList(arg), width, height, new DesktopFileChooser());
GDXAppTos4.INSTANCE.BãßInit(Arrays.asList(arg), width, height, new DesktopFileChooser());
Lwjgl3ApplicationConfiguration config = new Lwjgl3ApplicationConfiguration();
config.setMaxNetThreads(Runtime.getRuntime().availableProcessors());
@ -29,7 +29,7 @@ public class GDXAppDesktopLauncher {
config.setWindowIcon(FileType.Internal, GDXAppDesktopConfig.WINDOW_ICONS);
config.setWindowedMode(width, height);
Lwjgl3Application launcher = new Lwjgl3Application(GDXAppMain.INSTANCE, config);
Lwjgl3Application launcher = new Lwjgl3Application(GDXAppTos4.INSTANCE, config);
launcher.exit();
}
}

View file

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View file

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 7.2 KiB

View file

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View file

@ -1,279 +0,0 @@
package love.distributedrebirth.gdxapp;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.badlogic.gdx.ApplicationListener;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Screen;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.utils.ScreenUtils;
import imgui.ImGui;
import imgui.flag.ImGuiCond;
import imgui.flag.ImGuiWindowFlags;
import imgui.type.ImBoolean;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
import love.distributedrebirth.bassboonyd.BãßBȍőnClassInfoʸᴰ;
import love.distributedrebirth.bassboonyd.BãßBȍőnCoffinOpenʸᴰ;
import love.distributedrebirth.bassboonyd.BãßBȍőnCoffinʸᴰ;
import love.distributedrebirth.bassboonyd.BãßBȍőnPackageInfoʸᴰ;
import love.distributedrebirth.bassboonyd.jmx.DefaultEnumBaseᴶᴹˣ;
import love.distributedrebirth.bassboonyd.jmx.DefaultEnumInstanceᴶᴹˣ;
import love.distributedrebirth.bassboonyd.jmx.GuageCounterᴶᴹˣ;
import love.distributedrebirth.gdxapp.desktop.DeskAppContourSection;
import love.distributedrebirth.gdxapp.desktop.DeskAppRenderer;
import love.distributedrebirth.gdxapp.desktop.DeskTopScreen;
import love.distributedrebirth.gdxapp.desktop.DeskTopScreenMenu;
import love.distributedrebirth.gdxapp.music.MusicManager;
import love.distributedrebirth.gdxapp.music.MusicSongType;
import love.distributedrebirth.gdxapp.screen.ScreenCredits;
import love.distributedrebirth.gdxapp.screen.ScreenDesktop1;
import love.distributedrebirth.gdxapp.screen.ScreenDesktop2;
import love.distributedrebirth.gdxapp.screen.ScreenDesktop3;
import love.distributedrebirth.gdxapp.screen.ScreenDesktop4;
import love.distributedrebirth.gdxapp.screen.ScreenHelp;
import love.distributedrebirth.gdxapp.screen.ScreenIntro;
import love.distributedrebirth.gdxapp.screen.ScreenIntroMission;
import love.distributedrebirth.gdxapp.screen.ScreenLoading;
import love.distributedrebirth.numberxd.base2t.Base2PartsFactory;
import love.distributedrebirth.numberxd.base2t.Base2Terminator;
import love.distributedrebirth.numberxd.base2t.part.warp.TOSWarpCore;
import love.distributedrebirth.numberxd.glyph.BaseGlyphSet;
import love.distributedrebirth.unicode4d.atlas.FontAtlas;
import love.distributedrebirth.unicode4d.atlas.FontAtlasDriver;
import love.distributedrebirth.warpme.core.WaterBucket;
import love.distributedrebirth.warpme.core.WaterBucketDriver;
import net.spookygames.gdx.nativefilechooser.NativeFileChooser;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
@BãßBȍőnClassInfoʸᴰ(name = "GDXAppMain", purpose = "Main loop render dispatcher and bootup.")
@BãßBȍőnPackageInfoʸᴰ(name = "love.distributedrebirth.gdxapp")
public enum GDXAppMain implements DefaultEnumInstanceᴶᴹˣ<GDXAppMain,GDXAppMainKeyʸᴰ>,ApplicationListener {
INSTANCE;
protected Screen screen;
private int lazyIntCnt = 33;
private List<String> args;
public NativeFileChooser fileChooser;
public SpriteBatch batch;
public BitmapFont font;
public OrthographicCamera camera;
public int viewWidth;
public int viewHeight;
public MusicManager music;
public FontAtlas basePlane;
public ImBoolean showImGuiDemo = new ImBoolean(false);
private Map<Class<? extends Screen>,Screen> screens;
private DeskTopScreenMenu screenMenu;
private final GuageCounterᴶᴹˣ selectScreenCounter;
private final BãßBȍőnCoffinOpenʸᴰ<GDXAppMainKeyʸᴰ> BBC = BãßBȍőnCoffinOpenʸᴰ.newInstance();
public BãßBȍőnCoffinʸᴰ<GDXAppMainKeyʸᴰ> GET_BBC() { return BBC; }
private GDXAppMain() {
BBC.BOON_INIT(this);
BȍőnJmxInit(GDXAppMainKeyʸᴰ.JMX);
selectScreenCounter = BȍőnJmxInitGuageCounter(GDXAppMainKeyʸᴰ.JMX, "selectScreenCounter");
}
public void BãßInit(List<String> args, int viewWidth, int viewHeight, NativeFileChooser fileChooser) {
this.args = args;
this.viewWidth = viewWidth;
this.viewHeight = viewHeight;
this.fileChooser = fileChooser;
}
//TODO: add layer or ?? private <T extends BãßBȍőnCoffinStoreʸᴰ<?>,DefaultAuthorInfoʸᴰ> T[] storeInstances() {
@SuppressWarnings("unchecked")
private <T extends DefaultEnumBaseᴶᴹˣ<?,?>> T[] coffinInstances() {
return (T[]) new DefaultEnumBaseᴶᴹˣ[] {
BaseGlyphSet.values()[0],
Base2Terminator.INSTANCE,
Base2PartsFactory.INSTANCE,
TOSWarpCore.INSTANCE
};
}
private void lazyInit() {
if (lazyIntCnt > 0) {
lazyIntCnt--;
return;
}
ImGuiSetup.init();
// ref to init
System.out.println("BãßBȍőnCoffinʸᴰ init......");
BãßBȍőnCoffinOpenʸᴰ.lockCoffin(this);
for (DefaultEnumBaseᴶᴹˣ<?,?> coffin:coffinInstances()) {
BãßBȍőnCoffinOpenʸᴰ.lockCoffin(coffin);
}
System.out.println("BãßBȍőnCoffinʸᴰ init done.");
try {
//basePlane = FontAtlasDriver.newInstance().createReader().readString(Gdx.files.internal("font/unicode4d.xml").readString());
if (args.contains("warpcore-load")) {
System.out.println("warpcore-load: requested");
WaterBucket bucket = WaterBucketDriver.newInstance().createReader().readFile("./warpcore.xml");
TOSWarpCore.INSTANCE.BãßArmWarpCore(bucket);
}
if (args.contains("warpcore-save")) {
System.out.println("warpcore-save: requested");
WaterBucket bucket = TOSWarpCore.INSTANCE.BãßCurrentWarpCore();
WaterBucketDriver.newInstance().createWriter().writeFile(bucket, "./warpcore.xml");
}
} catch (Exception e) {
throw new RuntimeException(e);
}
if (!args.contains("warpcore-nolock")) {
System.out.println("warpcore-lock: BãßLockWarpCipher");
TOSWarpCore.INSTANCE.BãßLockWarpCipher();
} else {
System.out.println("warpcore-nolock: requested");
}
if (args.contains("full-screen")) {
System.out.println("full-screen: requested");
Gdx.graphics.setFullscreenMode(Gdx.graphics.getDisplayMode());
}
if (args.contains("intro-skip")) {
System.out.println("intro-skip: requested");
selectScreen(ScreenDesktop1.class);
music.play(MusicSongType.BACKGROUND);
} else {
selectScreen(ScreenIntro.class);
}
}
private void putScreen(Screen screen) {
screens.put(screen.getClass(), screen);
}
public void selectScreen(Class<? extends Screen> screenClass) {
Screen screen = screens.get(screenClass);
if (screen == null) {
throw new NullPointerException("Unknow screen: "+screenClass);
}
selectScreenCounter.increment();
if (this.screen != null) this.screen.hide();
this.screen = screen;
if (this.screen != null) {
this.screen.show();
this.screen.resize(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
}
}
@Override
public void create() {
batch = new SpriteBatch();
font = new BitmapFont();
camera = new OrthographicCamera();
camera.setToOrtho(false, viewWidth, viewHeight);
camera.update();
batch.setProjectionMatrix(camera.combined);
boolean musicStop = args.contains("music-stop");
if (musicStop) {
System.out.println("music-stop: requested");
}
music = new MusicManager();
music.init(musicStop);
screens = new HashMap<>();
DeskTopScreen desktop1 = new ScreenDesktop1(this);
DeskTopScreen desktop2 = new ScreenDesktop2(this);
DeskTopScreen desktop3 = new ScreenDesktop3();
DeskTopScreen desktop4 = new ScreenDesktop4();
screenMenu = new DeskTopScreenMenu(desktop1, desktop2, desktop3, desktop4);
putScreen(new ScreenLoading());
putScreen(new ScreenIntro());
putScreen(new ScreenIntroMission());
putScreen(desktop1);
putScreen(desktop2);
putScreen(desktop3);
putScreen(desktop4);
putScreen(new ScreenCredits());
putScreen(new ScreenHelp());
selectScreen(ScreenLoading.class);
}
@Override
public void resize(int width, int height) {
if (screen != null) screen.resize(width, height);
}
@Override
public void render() {
ScreenUtils.clear(0f, 0f, 0f, 1f, true);
if (screen == null) {
return;
}
if (screen instanceof ScreenLoading) {
screen.render(Gdx.graphics.getDeltaTime());
lazyInit();
return;
}
ImGuiSetup.imGuiImp.newFrame();
ImGui.newFrame();
DeskTopScreen appScreen = null;
if (screen instanceof DeskTopScreen) {
appScreen = DeskTopScreen.class.cast(screen);
screenMenu.renderMenu(appScreen);
}
if (showImGuiDemo.get()) {
ImGui.showDemoWindow(showImGuiDemo);
}
if (appScreen != null && appScreen.getDeskAppScreen().getCurrentDeskApp() != null) {
int sizeFlags = ImGuiCond.Always;
ImGui.setNextWindowPos(0, 28, sizeFlags);
ImGui.setNextWindowSize(Gdx.graphics.getWidth(), Gdx.graphics.getHeight() - 28, sizeFlags);
int windowFlags = ImGuiWindowFlags.NoMove | ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoTitleBar;
if (ImGui.begin(appScreen.getDeskAppScreen().getCurrentDeskApp().getTitle(), windowFlags)) {
DeskAppRenderer renderer = appScreen.getDeskAppScreen().getCurrentDeskApp().getContours().getContour(DeskAppContourSection.MAIN);
if (renderer != null) {
renderer.render();
}
}
ImGui.end();
}
if (screen != null) {
screen.render(Gdx.graphics.getDeltaTime());
}
ImGui.render();
ImGuiSetup.imGuiGlImp.renderDrawData(ImGui.getDrawData());
}
@Override
public void pause() {
if (screen != null) {
screen.pause();
}
}
@Override
public void resume() {
if (screen != null) {
screen.resume();
}
}
@Override
public void dispose() {
ImGuiSetup.dispose();
for (Screen screen:screens.values()) {
screen.dispose();
}
music.dispose();
batch.dispose();
font.dispose();
}
}

View file

@ -1,116 +0,0 @@
package love.distributedrebirth.gdxapp.screen;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.ScreenAdapter;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.PerspectiveCamera;
import com.badlogic.gdx.graphics.g3d.ModelBatch;
import com.badlogic.gdx.graphics.g3d.ModelInstance;
import com.badlogic.gdx.graphics.g3d.utils.FirstPersonCameraController;
import com.badlogic.gdx.graphics.g3d.utils.ModelBuilder;
import com.badlogic.gdx.utils.Array;
import love.distributedrebirth.gdxapp.desktop.DeskApp;
import love.distributedrebirth.gdxapp.desktop.DeskAppScreen;
import love.distributedrebirth.gdxapp.desktop.DeskAppScreenListener;
import love.distributedrebirth.gdxapp.desktop.DeskTopInputProcessor;
import love.distributedrebirth.gdxapp.desktop.DeskTopScreen;
public abstract class AbstractScreenDesktop extends ScreenAdapter implements DeskTopScreen {
private final DeskAppScreen deskAppScreen;
private PerspectiveCamera cam;
private FirstPersonCameraController camController;
private DeskTopInputProcessor inputFilter;
private ModelBatch modelBatch;
private Array<ModelInstance> modelInstances = new Array<ModelInstance>();
public AbstractScreenDesktop(String name) {
this.create();
deskAppScreen = new DeskAppScreen(name);
deskAppScreen.addDeskAppListener(new DeskAppScreenListener() {
@Override
public void selectDeskApp(DeskApp deskApp) {
if (deskApp == null) {
inputFilter.setFiltering(false);
} else {
inputFilter.setFiltering(true);
}
}
});
}
protected void createModel(ModelBuilder modelBuilder, Array<ModelInstance> modelInstances) {
}
private void create() {
modelBatch = new ModelBatch();
cam = new PerspectiveCamera(67, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
cam.position.set(10f, 10f, 10f);
cam.lookAt(0, 0, 0);
cam.near = 1f;
cam.far = 300f;
cam.update();
ModelBuilder modelBuilder = new ModelBuilder();
createModel(modelBuilder, modelInstances);
camController = new FirstPersonCameraController(cam);
//camController = new CameraInputController(cam);
inputFilter = new DeskTopInputProcessor(camController);
}
@Override
public final void show() {
Gdx.input.setInputProcessor(inputFilter);
showDesktop();
}
protected void showDesktop() {
}
@Override
public final void hide() {
Gdx.input.setInputProcessor(null);
hideDesktop();
}
protected void hideDesktop() {
}
@Override
public final void dispose() {
modelBatch.dispose();
disposeDesktop();
}
protected void disposeDesktop() {
}
@Override
public final void render(float delta) {
camController.update();
Gdx.gl.glViewport(0, 0, Gdx.graphics.getBackBufferWidth(), Gdx.graphics.getBackBufferHeight());
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT);
renderDesktop(delta, modelBatch, cam, modelInstances);
}
protected void renderDesktop(float delta, ModelBatch modelBatch, PerspectiveCamera cam, Array<ModelInstance> modelInstances) {
modelBatch.begin(cam);
for (ModelInstance instance : modelInstances) {
modelBatch.render(instance);
}
modelBatch.end();
}
@Override
public DeskAppScreen getDeskAppScreen() {
return deskAppScreen;
}
}

View file

@ -1,40 +0,0 @@
package love.distributedrebirth.gdxapp.screen;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.ScreenAdapter;
import com.badlogic.gdx.graphics.Texture;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
import love.distributedrebirth.gdxapp.GDXAppMain;
import love.distributedrebirth.gdxapp.desktop.DeskAppScreen;
import love.distributedrebirth.gdxapp.desktop.DeskTopScreen;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public class ScreenDesktop1 extends ScreenAdapter implements DeskTopScreen {
private final GDXAppMain main;
private DeskAppScreen deskAppScreen;
private Texture backgroundImage;
public ScreenDesktop1(final GDXAppMain main) {
this.main = main;
deskAppScreen = new DeskAppScreen("Desktop1");
backgroundImage = new Texture(Gdx.files.internal("background/terrydavis-front.png"));
}
@Override
public void render(float delta) {
main.batch.begin();
main.batch.draw(backgroundImage, 0, 0, main.viewWidth, main.viewHeight);
main.batch.end();
}
@Override
public void dispose() {
backgroundImage.dispose();
}
@Override
public DeskAppScreen getDeskAppScreen() {
return deskAppScreen;
}
}

View file

@ -1,40 +0,0 @@
package love.distributedrebirth.gdxapp.screen;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.ScreenAdapter;
import com.badlogic.gdx.graphics.Texture;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
import love.distributedrebirth.gdxapp.GDXAppMain;
import love.distributedrebirth.gdxapp.desktop.DeskAppScreen;
import love.distributedrebirth.gdxapp.desktop.DeskTopScreen;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public class ScreenDesktop2 extends ScreenAdapter implements DeskTopScreen {
private final GDXAppMain main;
private DeskAppScreen deskAppScreen;
private Texture backgroundImage;
public ScreenDesktop2(final GDXAppMain main) {
this.main = main;
deskAppScreen = new DeskAppScreen("Desktop2");
backgroundImage = new Texture(Gdx.files.internal("background/terrydavis-nose.png"));
}
@Override
public void render(float delta) {
main.batch.begin();
main.batch.draw(backgroundImage, 0, 0, main.viewWidth, main.viewHeight);
main.batch.end();
}
@Override
public void dispose() {
backgroundImage.dispose();
}
@Override
public DeskAppScreen getDeskAppScreen() {
return deskAppScreen;
}
}

View file

@ -1,29 +0,0 @@
package love.distributedrebirth.gdxapp.screen;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.ScreenAdapter;
import com.badlogic.gdx.graphics.Texture;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
import love.distributedrebirth.gdxapp.GDXAppMain;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public class ScreenLoading extends ScreenAdapter {
private Texture backgroundImage;
public ScreenLoading() {
backgroundImage = new Texture(Gdx.files.internal("background/gdxapp-loading.png"));
}
@Override
public void render(float delta) {
GDXAppMain.INSTANCE.batch.begin();
GDXAppMain.INSTANCE.batch.draw(backgroundImage, 0, 0, GDXAppMain.INSTANCE.viewWidth, GDXAppMain.INSTANCE.viewHeight);
GDXAppMain.INSTANCE.batch.end();
}
@Override
public void dispose() {
backgroundImage.dispose();
}
}

View file

@ -5,6 +5,6 @@
<artifactId>gdxapp4d</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>gdxapp4d-chain</artifactId>
<artifactId>gdxapp4d-chain-music-msx</artifactId>
<packaging>pom</packaging>
</project>

View file

@ -0,0 +1,10 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>love.distributedrebirth.gdxapp4d</groupId>
<artifactId>gdxapp4d</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>gdxapp4d-chain-music-templeos</artifactId>
<packaging>pom</packaging>
</project>

View file

@ -0,0 +1,26 @@
#EXTM3U
#PLAYLIST:Music TempleOS
#EXTALB:Best of Youtube (2022)
#EXTART:Various
#EXTGENRE:Electropump
#EXTINF:123,Panoramacircle - Waterfowl
panoramacircle-waterfowl.mp3
#EXTINF:123,Sanctumwave - Devine Intellect
sanctumwave-devine-intellect.mp3
#EXTINF:123,Sanctumwave - nightwalk
sanctumwave-nightwalk.mp3
#EXTINF:123,The Self Help Group - TempleOS
theselfhelpgroup-temple-os.mp3
#EXTINF:123,Sanctumwave - Risen
sanctumwave-risen.mp3
#EXTINF:123,Beeble - I used TempleOS to write a song
beeble-i-used-temple-os-to-write.mp3
#EXTINF:123,Ryanfarran - Risen TempleOS
ryanfarran-risen-temple-os.mp3

View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<root:ocean xmlns:root="http://wrap-sea.x4o.distributedrebirth.love/xml/ns/warp-sea-root"
xmlns:link="http://warp-sea.x4o.distributedrebirth.love/xml/ns/warp-sea-link"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://wrap-sea.x4o.distributedrebirth.love/xml/ns/warp-sea-root http://warp-sea.x4o.distributedrebirth.love/xml/ns/warp-sea-root-1.0.xsd">
<link:sea name="Music TempleOS" provider="gdxapp4d.system" author="willemtsade">
<link:magic file="music/000-playlist.m3u" mime="audio/mpegurl"/>
<link:magic file="music/" mime="inode/directory"/>
</link:sea>
</root:ocean>

View file

@ -5,10 +5,6 @@
<artifactId>gdxapp4d</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>gdxapp4d-boot</artifactId>
<artifactId>gdxapp4d-chain-sys-engine</artifactId>
<packaging>pom</packaging>
<modules>
<module>gdxapp4d-boot-desktop</module>
<module>gdxapp4d-boot-tos4</module>
</modules>
</project>

View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<root:ocean xmlns:root="http://wrap-sea.x4o.distributedrebirth.love/xml/ns/warp-sea-root"
xmlns:link="http://warp-sea.x4o.distributedrebirth.love/xml/ns/warp-sea-link"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://wrap-sea.x4o.distributedrebirth.love/xml/ns/warp-sea-root http://warp-sea.x4o.distributedrebirth.love/xml/ns/warp-sea-root-1.0.xsd">
<link:sea name="System Engine" provider="gdxapp4d.system" author="willemtsade">
<!-- Link vrgem4 -->
<link:chain key="ccba3b29da8b1b1cb444f381449beede3cbfd442d158293a4cdffbc3c41a31cc"/>
</link:sea>
</root:ocean>

View file

@ -0,0 +1,10 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>love.distributedrebirth.gdxapp4d</groupId>
<artifactId>gdxapp4d</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>gdxapp4d-chain-sys-ocean</artifactId>
<packaging>pom</packaging>
</project>

View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<root:ocean xmlns:root="http://wrap-sea.x4o.distributedrebirth.love/xml/ns/warp-sea-root"
xmlns:link="http://warp-sea.x4o.distributedrebirth.love/xml/ns/warp-sea-link"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://wrap-sea.x4o.distributedrebirth.love/xml/ns/warp-sea-root http://warp-sea.x4o.distributedrebirth.love/xml/ns/warp-sea-root-1.0.xsd">
<link:sea name="System Ocean" provider="gdxapp4d.system" author="willemtsade">
</link:sea>
</root:ocean>

View file

@ -34,6 +34,6 @@ public class WaterBucketDriverTest {
cipher.addCipherHeart(heart);
Assertions.assertNotNull(bucket);
WaterBucketDriver.newInstance().createWriter().writeFile(bucket, new java.io.File("build/out-core.xml"));
WaterBucketDriver.newInstance().createWriter().writeFile(bucket, new java.io.File("target/out-core.xml"));
}
}

View file

@ -21,6 +21,6 @@ public class WaterShotDriverTest {
drugs.addSoftHash(new WaterSoftHash("test2.txt", "ASDFYYF234234SDFSDFASDFS"));
Assertions.assertNotNull(drugs);
WaterShotDriver.newInstance().createWriter().writeFile(drugs, new java.io.File("build/out-hash.xml"));
WaterShotDriver.newInstance().createWriter().writeFile(drugs, new java.io.File("target/out-hash.xml"));
}
}

View file

@ -29,6 +29,6 @@ public class WaterOceanDriverTest {
sea.addSeaMagic(new WaterSeaMagic("inode/directory", "album/"));
Assertions.assertNotNull(ocean);
WaterOceanDriver.newInstance().createWriter().writeFile(ocean, new java.io.File("build/out-sea.xml"));
WaterOceanDriver.newInstance().createWriter().writeFile(ocean, new java.io.File("target/out-sea.xml"));
}
}

View file

@ -26,6 +26,6 @@ public class WaterDeviceDriverTest {
device.buildShip(ship);
Assertions.assertNotNull(device);
WaterDeviceDriver.newInstance().createWriter().writeFile(device, new java.io.File("build/out-ship.xml"));
WaterDeviceDriver.newInstance().createWriter().writeFile(device, new java.io.File("target/out-ship.xml"));
}
}

View file

@ -2,10 +2,11 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>love.distributedrebirth.gdxapp4d</groupId>
<artifactId>gdxapp4d-boot</artifactId>
<artifactId>gdxapp4d</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>gdxapp4d-boot-tos4</artifactId>
<artifactId>gdxapp4d-tos4</artifactId>
<packaging>bundle</packaging>
<dependencies>
<dependency>
<groupId>love.distributedrebirth.gdxapp4d</groupId>
@ -35,5 +36,33 @@
<groupId>games.spooky.gdx</groupId>
<artifactId>gdx-nativefilechooser</artifactId>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.framework</artifactId>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<_donotcopy>(.git)</_donotcopy>
<Import-Package>org.osgi.framework,org.osgi.service.packageadmin,org.osgi.service.url,org.osgi.service.startlevel,org.osgi.util.tracker,*</Import-Package>
<Export-Package>love.distributedrebirth.gdxapp4d.tos4.service</Export-Package>
<Private-Package>love.distributedrebirth.gdxapp4d.tos4.*</Private-Package>
<Embed-Dependency>*;artifactId=org.apache.felix.framework;inline=true,*;artifactId=gdxapp4d-lib-bassboonyd;inline=true</Embed-Dependency>
<Bundle-Activator>love.distributedrebirth.gdxapp4d.tos4.GDXAppTos4Activator</Bundle-Activator>
<Bundle-Vendor>distributedrebirth.love</Bundle-Vendor>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
</project>

View file

@ -0,0 +1,121 @@
package love.distributedrebirth.gdxapp4d.tos4;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.osgi.framework.BundleException;
import org.osgi.framework.launch.Framework;
import com.badlogic.gdx.ApplicationListener;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Screen;
import com.badlogic.gdx.utils.ScreenUtils;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
import love.distributedrebirth.bassboonyd.BãßBȍőnClassInfoʸᴰ;
import love.distributedrebirth.bassboonyd.BãßBȍőnCoffinOpenʸᴰ;
import love.distributedrebirth.bassboonyd.BãßBȍőnCoffinʸᴰ;
import love.distributedrebirth.bassboonyd.BãßBȍőnPackageInfoʸᴰ;
import love.distributedrebirth.bassboonyd.jmx.DefaultEnumInstanceᴶᴹˣ;
import love.distributedrebirth.bassboonyd.jmx.GuageCounterᴶᴹˣ;
import love.distributedrebirth.gdxapp4d.tos4.service.SystemWarpTerminal;
import net.spookygames.gdx.nativefilechooser.NativeFileChooser;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
@BãßBȍőnClassInfoʸᴰ(name = "GDXAppTos4", purpose = "Main loop render dispatcher and bootup.")
@BãßBȍőnPackageInfoʸᴰ(name = "love.distributedrebirth.gdxapp4d.tos4")
public enum GDXAppTos4 implements DefaultEnumInstanceᴶᴹˣ<GDXAppTos4,GDXAppTos4Keyʸᴰ>, ApplicationListener, SystemWarpTerminal {
INSTANCE;
private Screen screen;
private Framework systemBundle;
private GDXAppTos4Activator systemActivator;
private Map<Class<? extends Screen>,Screen> screens;
private NativeFileChooser fileChooser;
private final GuageCounterᴶᴹˣ selectScreenCounter;
private final BãßBȍőnCoffinOpenʸᴰ<GDXAppTos4Keyʸᴰ> BBC = BãßBȍőnCoffinOpenʸᴰ.newInstance();
public BãßBȍőnCoffinʸᴰ<GDXAppTos4Keyʸᴰ> GET_BBC() { return BBC; }
private GDXAppTos4() {
BBC.BOON_INIT(this);
BȍőnJmxInit(GDXAppTos4Keyʸᴰ.JMX);
selectScreenCounter = BȍőnJmxInitGuageCounter(GDXAppTos4Keyʸᴰ.JMX, "selectScreenCounter");
}
public void BãßInit(List<String> args, int viewWidth, int viewHeight, NativeFileChooser fileChooser) {
this.fileChooser = fileChooser;
screens = new HashMap<>();
systemActivator = new GDXAppTos4Activator();
systemActivator.BãßInit(args, viewWidth, viewHeight, this);
}
@Override
public void create() {
systemBundle = GDXAppTos4Startup.init(this, systemActivator);
}
@Override
public void resize(int width, int height) {
screen.resize(width, height);
}
@Override
public void render() {
ScreenUtils.clear(0f, 0f, 0f, 1f, true);
screen.render(Gdx.graphics.getDeltaTime());
}
@Override
public void pause() {
screen.pause();
}
@Override
public void resume() {
screen.resume();
}
@Override
public void dispose() {
for (Screen screen:screens.values()) {
screen.dispose();
}
try {
systemBundle.stop();
} catch (BundleException e) {
throw new RuntimeException(e);
}
}
@Override
public void registrateScreen(Screen screen) {
screens.put(screen.getClass(), screen);
}
@Override
public void disposeScreen(Screen screen) {
screens.remove(screen.getClass());
screen.dispose();
}
@Override
public void selectScreen(Class<? extends Screen> screenClass) {
Screen screen = screens.get(screenClass);
if (screen == null) {
throw new NullPointerException("Unknow screen: "+screenClass);
}
if (this.screen != null) {
this.screen.hide();
}
this.screen = screen;
this.screen.show();
this.screen.resize(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
selectScreenCounter.increment();
}
public NativeFileChooser getFileChooser() {
return fileChooser;
}
}

View file

@ -0,0 +1,272 @@
package love.distributedrebirth.gdxapp4d.tos4;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
import java.util.Properties;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
import org.x4o.xml.io.X4OConnectionException;
import org.xml.sax.SAXException;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
import love.distributedrebirth.gdxapp4d.tos4.service.SystemWarpBase;
import love.distributedrebirth.gdxapp4d.tos4.service.SystemWarpBootArgs;
import love.distributedrebirth.gdxapp4d.tos4.service.SystemWarpSea;
import love.distributedrebirth.gdxapp4d.tos4.service.SystemWarpShip;
import love.distributedrebirth.gdxapp4d.tos4.service.SystemWarpTerminal;
import love.distributedrebirth.warpme.Warpᵐᵉ;
import love.distributedrebirth.warpme.sea.WaterOcean;
import love.distributedrebirth.warpme.sea.WaterOceanDriver;
import love.distributedrebirth.warpme.sea.WaterSeaChain;
import love.distributedrebirth.warpme.sea.WaterSeaMagic;
import love.distributedrebirth.warpme.ship.WaterDevice;
import love.distributedrebirth.warpme.ship.WaterDeviceDriver;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public class GDXAppTos4Activator implements BundleActivator {
public List<String> args;
public int viewWidth;
public int viewHeight;
private File hyperdriveHome;
private File warpshipHome;
private WaterDevice warpshipDevice;
private SystemWarpTerminal systemWarpTerminal;
private List<GDXAppTos4BootListener> listeners = new ArrayList<>();
private static final String SYSTEM_USER_HOME = "user.home";
private static final String HYPERDRIVE_HOME = "Hyperdrive";
private static final String WARPSHIP_HOME = "Warpship";
public GDXAppTos4Activator() {
}
public void BãßInit(List<String> args, int viewWidth, int viewHeight, SystemWarpTerminal systemWarpTerminal) {
this.args = args;
this.viewWidth = viewWidth;
this.viewHeight = viewHeight;
this.systemWarpTerminal = systemWarpTerminal;
}
private void fireMessageEvent(String message) {
for (GDXAppTos4BootListener listener:listeners) {
listener.bootLine(message);
}
}
public void addBootListener(GDXAppTos4BootListener listener) {
listeners.add(listener);
}
public void removeBootListener(GDXAppTos4BootListener listener) {
listeners.remove(listener);
}
@Override
public void stop(final BundleContext context) {
}
@Override
public void start(final BundleContext context) {
fireMessageEvent("Mecca System eXtension superscript Four");
fireMessageEvent("tos4: starting...");
fireMessageEvent("init-cpus: "+Runtime.getRuntime().availableProcessors());
fireMessageEvent("free-memory: 0x"+Long.toHexString(Runtime.getRuntime().freeMemory()));
boolean useLocal = args.contains("use-local");
File userHome = new File(System.getProperty(SYSTEM_USER_HOME));
hyperdriveHome = new File(userHome, HYPERDRIVE_HOME);
fireMessageEvent("hyper-home: "+hyperdriveHome);
if (!hyperdriveHome.exists()) {
fireMessageEvent("ERROR: No Hyperdrive home.");
return;
}
warpshipHome = new File(hyperdriveHome, WARPSHIP_HOME);
if (useLocal) {
warpshipHome = new File(".");
}
if (!warpshipHome.exists()) {
fireMessageEvent("ERROR: No Warpship home.");
return;
}
File warpShip = new File(warpshipHome, Warpᵐᵉ.WARP_SHIP);
if (useLocal) {
warpShip = new File(warpshipHome, "local-ship.xml");
}
fireMessageEvent("warp-ship: "+warpShip);
if (!warpShip.exists()) {
fireMessageEvent("ERROR: No warp-ship.xml found.");
return;
}
context.registerService(SystemWarpBase.class.getName(), new SystemWarpBaseImpl(), new Hashtable<String, String>());
context.registerService(SystemWarpBootArgs.class.getName(), new SystemWarpBootArgsImpl(), new Hashtable<String, String>());
context.registerService(SystemWarpShip.class.getName(), new SystemWarpShipImpl(), new Hashtable<String, String>());
context.registerService(SystemWarpTerminal.class.getName(), systemWarpTerminal, new Hashtable<String, String>());
try {
warpshipDevice = WaterDeviceDriver.newInstance().createReader().readFile(warpShip);
} catch (Exception e) {
e.printStackTrace();
fireMessageEvent("ERROR: "+e.getMessage());
return;
}
fireMessageEvent("warp-engine: "+warpshipDevice.theShip().getName());
Properties overrides = new Properties();
if (useLocal) {
File localOverride = new File("local-override.xml");
if (localOverride.exists()) {
try {
overrides.loadFromXML(new FileInputStream(localOverride));
} catch (Exception e) {
throw new RuntimeException(e);
}
fireMessageEvent("use-local: local-override.xml loaded.");
} else {
fireMessageEvent("use-local: local-override.xml not found.");
}
}
int result = 0;
try {
result = resolveWaterOcean(overrides, context, warpshipDevice.theShip().getEngine());
} catch (Exception e) {
e.printStackTrace();
fireMessageEvent("ERROR: "+e.getMessage());
return;
}
if (result > 0) {
fireMessageEvent("tos4: FAILURE BOOT ABORTED");
} else {
fireMessageEvent("tos4: chains resolved.");
}
}
private int resolveWaterOcean(Properties overrides, BundleContext context, String key) throws IOException, InterruptedException, X4OConnectionException, SAXException, BundleException {
File waterHome;
String override = overrides.getProperty(key);
if (override == null) {
waterHome = new File(hyperdriveHome, key);
if (!waterHome.exists()) {
executeHyperdrive("hyperdrive", "mount", waterHome.getAbsolutePath(), key);
}
String infoResult = executeHyperdrive("hyperdrive", "info", waterHome.getAbsolutePath());
if (!infoResult.startsWith("Drive Info")) {
fireMessageEvent("ERROR: Couldn't get info on: "+waterHome);
return 1;
}
} else {
waterHome = new File(override);
}
File waterSea = new File(waterHome, Warpᵐᵉ.WARP_SEA);
if (!waterSea.exists()) {
fireMessageEvent("ERROR: No warp-sea.xml found.");
return 1;
}
WaterOcean ocean = WaterOceanDriver.newInstance().createReader().readFile(waterSea);
fireMessageEvent("water-ocean: "+key+" ("+ocean.theWater().getName()+")");
Hashtable<String, String> props = new Hashtable<String, String>();
props.put(SystemWarpSea.NAME_PROPERTY, ocean.theWater().getName());
props.put(SystemWarpSea.PROVIDER_PROPERTY, ocean.theWater().getProvider());
context.registerService(SystemWarpSea.class.getName(), new SystemWarpSeaImpl(ocean), props);
for (WaterSeaMagic magic:ocean.theWater().getSeaMagics()) {
if ("application/vnd.osgi.bundle".equals(magic.getMime())) {
String overrideBundleKey = key + "." + magic.getFile();
String overrideBundle = overrides.getProperty(overrideBundleKey);
if (overrideBundle == null) {
GDXAppTos4BootFactory.installAndStartBundles(context, "reference:file:"+waterHome.getAbsolutePath()+"/"+magic.getFile());
} else {
GDXAppTos4BootFactory.installAndStartBundles(context, "reference:file:"+overrideBundle);
}
}
}
int result = 0;
for (WaterSeaChain chain: ocean.theWater().getSeaChains()) {
result += resolveWaterOcean(overrides, context, chain.getKey());
}
return result;
}
private String executeHyperdrive(String...cmd) throws IOException, InterruptedException {
ProcessBuilder builder = new ProcessBuilder();
builder.command(cmd);
builder.directory(new File(System.getProperty("user.home")));
Process process = builder.start();
StringBuilder buf = new StringBuilder();
try(BufferedReader input = new BufferedReader(new InputStreamReader(process.getInputStream()))) {
String line;
while ((line = input.readLine()) != null) {
buf.append(line);
}
}
process.waitFor();
return buf.toString();
}
public class SystemWarpSeaImpl implements SystemWarpSea {
private final WaterOcean warpSea;
public SystemWarpSeaImpl(WaterOcean warpSea) {
this.warpSea = warpSea;
}
@Override
public WaterOcean getWarpSea() {
return warpSea;
}
}
public class SystemWarpBaseImpl implements SystemWarpBase {
@Override
public File getHyperdriveHome() {
return hyperdriveHome;
}
@Override
public File getWarpshipHome() {
return warpshipHome;
}
}
public class SystemWarpBootArgsImpl implements SystemWarpBootArgs {
@Override
public List<String> getBootArgs() {
return args;
}
@Override
public int getBootWindowWidth() {
return viewWidth;
}
@Override
public int getBootWindowHeight() {
return viewHeight;
}
}
public class SystemWarpShipImpl implements SystemWarpShip {
@Override
public WaterDevice getWarpShip() {
return warpshipDevice;
}
}
}

View file

@ -0,0 +1,149 @@
package love.distributedrebirth.gdxapp4d.tos4;
import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.ServiceLoader;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
import org.osgi.framework.Constants;
import org.osgi.framework.launch.Framework;
import org.osgi.framework.launch.FrameworkFactory;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public class GDXAppTos4BootFactory {
public static void installAndStartBundles(BundleContext bundleContext, String... bundleLocations) throws BundleException {
for (String location : bundleLocations) {
Bundle addition = bundleContext.installBundle(location);
addition.start();
}
}
public static Framework createFramework() {
return createFramework(buildConfig());
}
public static Framework createFramework(Map<String, String> config) {
ServiceLoader<FrameworkFactory> factoryLoader = ServiceLoader.load(FrameworkFactory.class);
for (FrameworkFactory factory : factoryLoader) {
return factory.newFramework(config);
}
throw new IllegalStateException("Unable to load FrameworkFactory service.");
}
public static Map<String, String> buildConfig() {
final File cachedir = createCacheDir();
Map<String, String> configMap = new HashMap<String, String>();
configMap.put(Constants.FRAMEWORK_SYSTEMPACKAGES_EXTRA,
"love.distributedrebirth.gdxapp4d.tos4.service,"+
"com.badlogic.gdx,"+
"com.badlogic.gdx.assets,"+
"com.badlogic.gdx.assets.loaders,"+
"com.badlogic.gdx.assets.loaders.resolvers,"+
"com.badlogic.gdx.audio,"+
"com.badlogic.gdx.files,"+
"com.badlogic.gdx.graphics,"+
"com.badlogic.gdx.graphics.g2d,"+
"com.badlogic.gdx.graphics.g3d,"+
"com.badlogic.gdx.graphics.g3d.attributes,"+
"com.badlogic.gdx.graphics.g3d.decals,"+
"com.badlogic.gdx.graphics.g3d.environment,"+
"com.badlogic.gdx.graphics.g3d.loader,"+
"com.badlogic.gdx.graphics.g3d.model,"+
"com.badlogic.gdx.graphics.g3d.model.data,"+
"com.badlogic.gdx.graphics.g3d.particles,"+
"com.badlogic.gdx.graphics.g3d.particles.bactches,"+
"com.badlogic.gdx.graphics.g3d.particles.emitters,"+
"com.badlogic.gdx.graphics.g3d.particles.influencers,"+
"com.badlogic.gdx.graphics.g3d.particles.renderers,"+
"com.badlogic.gdx.graphics.g3d.particles.values,"+
"com.badlogic.gdx.graphics.g3d.shaders,"+
"com.badlogic.gdx.graphics.g3d.utils,"+
"com.badlogic.gdx.graphics.g3d.utils.shapebuilders,"+
"com.badlogic.gdx.graphics.glutils,"+
"com.badlogic.gdx.graphics.profiling,"+
"com.badlogic.gdx.input,"+
"com.badlogic.gdx.maps,"+
"com.badlogic.gdx.maps.objects,"+
"com.badlogic.gdx.maps.tiled,"+
"com.badlogic.gdx.maps.tiled.objects,"+
"com.badlogic.gdx.maps.tiled.renderers,"+
"com.badlogic.gdx.maps.tiled.tiles,"+
"com.badlogic.gdx.math,"+
"com.badlogic.gdx.math.collision,"+
"com.badlogic.gdx.net,"+
"com.badlogic.gdx.scenes.scene2d,"+
"com.badlogic.gdx.scenes.scene2d.actions,"+
"com.badlogic.gdx.scenes.scene2d.ui,"+
"com.badlogic.gdx.scenes.scene2d.utils,"+
"com.badlogic.gdx.utils,"+
"com.badlogic.gdx.utils.async,"+
"com.badlogic.gdx.utils.compression,"+
"com.badlogic.gdx.utils.compression.lz,"+
"com.badlogic.gdx.utils.compression.lzma,"+
"com.badlogic.gdx.utils.compression.rangecoder,"+
"com.badlogic.gdx.utils.reflect,"+
"com.badlogic.gdx.utils.viewport,"+
"imgui,"+
"imgui.flag,"+
"imgui.glfw,"+
"imgui.gl3,"+
"imgui.type,"+
"net.spookygames.gdx.nativefilechooser,"+
"love.distributedrebirth.bassboonyd,"+
"love.distributedrebirth.bassboonyd.jmx,"+
"love.distributedrebirth.numberxd,"+
"love.distributedrebirth.numberxd.base2t,"+
"love.distributedrebirth.numberxd.base2t.part,"+
"love.distributedrebirth.numberxd.base2t.part.warp,"+
"love.distributedrebirth.numberxd.base2t.type,"+
"love.distributedrebirth.numberxd.base2t.typexl,"+
"love.distributedrebirth.numberxd.glyph,"+
"love.distributedrebirth.numberxd.x4o"
); // ; version=1.0.0
if (cachedir != null) {
configMap.put(Constants.FRAMEWORK_STORAGE, cachedir.getAbsolutePath());
}
return configMap;
}
private static File createCacheDir() {
final File cachedir;
try {
cachedir = File.createTempFile("gdxapp4d.tos4.cache", null);
cachedir.delete();
createShutdownHook(cachedir);
return cachedir;
} catch (IOException e) {
// temp dir creation failed, return null
return null;
}
}
private static void createShutdownHook(final File cachedir) {
Runtime.getRuntime().addShutdownHook(new Thread() {
@Override
public void run() {
deleteFileOrDir(cachedir);
}
});
}
private static void deleteFileOrDir(File file) {
if (file.isDirectory()) {
File[] childs = file.listFiles();
for (File child : childs) {
deleteFileOrDir(child);
}
}
file.delete();
}
}

View file

@ -0,0 +1,9 @@
package love.distributedrebirth.gdxapp4d.tos4;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public interface GDXAppTos4BootListener {
void bootLine(String message);
}

View file

@ -0,0 +1,56 @@
package love.distributedrebirth.gdxapp4d.tos4;
import java.util.ArrayList;
import java.util.List;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.ScreenAdapter;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public class GDXAppTos4BootScreen extends ScreenAdapter implements GDXAppTos4BootListener {
private BitmapFont font;
private SpriteBatch batch;
private Texture backgroundImage;
private List<String> messages = new ArrayList<>();
public GDXAppTos4BootScreen() {
batch = new SpriteBatch();
backgroundImage = new Texture(Gdx.files.internal("background/msx-boot.png"));
font = new BitmapFont();
}
@Override
public void render(float delta) {
int textX = 100;
int textY = 420;
int textYStep = 20;
batch.begin();
batch.draw(backgroundImage, 0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
synchronized (messages) {
for (String message:messages) {
font.draw(batch, message, textX, textY-=textYStep);
}
}
batch.end();
}
@Override
public void dispose() {
batch.dispose();
backgroundImage.dispose();
font.dispose();
}
@Override
public void bootLine(String message) {
synchronized (messages) {
messages.add(message);
}
}
}

View file

@ -1,10 +1,10 @@
package love.distributedrebirth.gdxapp;
package love.distributedrebirth.gdxapp4d.tos4;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
import love.distributedrebirth.bassboonyd.BãßBȍőnCoffinStoreKeyʸᴰ;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public enum GDXAppMainKeyʸᴰ implements BãßBȍőnCoffinStoreKeyʸᴰ {
public enum GDXAppTos4Keyʸᴰ implements BãßBȍőnCoffinStoreKeyʸᴰ {
JMX,

View file

@ -0,0 +1,84 @@
package love.distributedrebirth.gdxapp4d.tos4;
import org.osgi.framework.launch.Framework;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.badlogic.gdx.Application;
import com.badlogic.gdx.ApplicationLogger;
import com.badlogic.gdx.Gdx;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public class GDXAppTos4Startup {
private static final Logger LOG = LoggerFactory.getLogger(GDXAppTos4Startup.class);
public static Framework init(GDXAppTos4 tos4, GDXAppTos4Activator systemActivator) {
LOG.info("init framework");
Gdx.app.setLogLevel(Application.LOG_DEBUG);
Gdx.app.setApplicationLogger(new GDXAppApplicationLogger());
final Framework systemBundle = GDXAppTos4BootFactory.createFramework();
final GDXAppTos4BootScreen bootScreen = new GDXAppTos4BootScreen();
systemActivator.addBootListener(bootScreen);
tos4.registrateScreen(bootScreen);
tos4.selectScreen(GDXAppTos4BootScreen.class);
Runnable run = () -> {
try {
systemBundle.init();
systemBundle.start();
systemActivator.start(systemBundle.getBundleContext());
Gdx.app.postRunnable(() -> {
LOG.debug("Release boot screen");
systemActivator.removeBootListener(bootScreen);
tos4.disposeScreen(bootScreen);
});
} catch (Exception e) {
throw new RuntimeException(e);
}
};
Thread framework = new Thread(run);
framework.start();
return systemBundle;
}
static class GDXAppApplicationLogger implements ApplicationLogger {
@Override
public void log(String tag, String message) {
LoggerFactory.getLogger(tag).info(message);
}
@Override
public void log(String tag, String message, Throwable exception) {
LoggerFactory.getLogger(tag).info(message, exception);
}
@Override
public void error(String tag, String message) {
LoggerFactory.getLogger(tag).error(message);
}
@Override
public void error(String tag, String message, Throwable exception) {
LoggerFactory.getLogger(tag).error(message, exception);
}
@Override
public void debug(String tag, String message) {
LoggerFactory.getLogger(tag).debug(message);
}
@Override
public void debug(String tag, String message, Throwable exception) {
LoggerFactory.getLogger(tag).debug(message, exception);
}
}
}

View file

@ -0,0 +1,13 @@
package love.distributedrebirth.gdxapp4d.tos4.service;
import java.io.File;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public interface SystemWarpBase {
File getHyperdriveHome();
File getWarpshipHome();
}

View file

@ -0,0 +1,15 @@
package love.distributedrebirth.gdxapp4d.tos4.service;
import java.util.List;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public interface SystemWarpBootArgs {
List<String> getBootArgs();
int getBootWindowWidth();
int getBootWindowHeight();
}

View file

@ -0,0 +1,13 @@
package love.distributedrebirth.gdxapp4d.tos4.service;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
import love.distributedrebirth.warpme.sea.WaterOcean;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public interface SystemWarpSea {
String NAME_PROPERTY = "warp.sea.name";
String PROVIDER_PROPERTY = "warp.sea.provider";
WaterOcean getWarpSea();
}

View file

@ -0,0 +1,10 @@
package love.distributedrebirth.gdxapp4d.tos4.service;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
import love.distributedrebirth.warpme.ship.WaterDevice;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public interface SystemWarpShip {
WaterDevice getWarpShip();
}

View file

@ -0,0 +1,15 @@
package love.distributedrebirth.gdxapp4d.tos4.service;
import com.badlogic.gdx.Screen;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public interface SystemWarpTerminal {
void registrateScreen(Screen screen);
void disposeScreen(Screen screen);
void selectScreen(Class<? extends Screen> screenClass);
}

View file

Before

Width:  |  Height:  |  Size: 373 KiB

After

Width:  |  Height:  |  Size: 373 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

View file

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

106
gdxapp4d-vrgem4/pom.xml Normal file
View file

@ -0,0 +1,106 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>love.distributedrebirth.gdxapp4d</groupId>
<artifactId>gdxapp4d</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>gdxapp4d-vrgem4</artifactId>
<packaging>bundle</packaging>
<dependencies>
<dependency>
<groupId>love.distributedrebirth.gdxapp4d</groupId>
<artifactId>gdxapp4d-tos4</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<_donotcopy>(.git)</_donotcopy>
<Import-Package>
love.distributedrebirth.gdxapp4d.tos4.service,
org.osgi.framework,
com.badlogic.gdx,
com.badlogic.gdx.assets,
com.badlogic.gdx.assets.loaders,
com.badlogic.gdx.assets.loaders.resolvers,
com.badlogic.gdx.audio,
com.badlogic.gdx.files,
com.badlogic.gdx.graphics,
com.badlogic.gdx.graphics.g2d,
com.badlogic.gdx.graphics.g3d,
com.badlogic.gdx.graphics.g3d.attributes,
com.badlogic.gdx.graphics.g3d.decals,
com.badlogic.gdx.graphics.g3d.environment,
com.badlogic.gdx.graphics.g3d.loader,
com.badlogic.gdx.graphics.g3d.model,
com.badlogic.gdx.graphics.g3d.model.data,
com.badlogic.gdx.graphics.g3d.particles,
com.badlogic.gdx.graphics.g3d.particles.bactches,
com.badlogic.gdx.graphics.g3d.particles.emitters,
com.badlogic.gdx.graphics.g3d.particles.influencers,
com.badlogic.gdx.graphics.g3d.particles.renderers,
com.badlogic.gdx.graphics.g3d.particles.values,
com.badlogic.gdx.graphics.g3d.shaders,
com.badlogic.gdx.graphics.g3d.utils,
com.badlogic.gdx.graphics.g3d.utils.shapebuilders,
com.badlogic.gdx.graphics.glutils,
com.badlogic.gdx.graphics.profiling,
com.badlogic.gdx.input,
com.badlogic.gdx.maps,
com.badlogic.gdx.maps.objects,
com.badlogic.gdx.maps.tiled,
com.badlogic.gdx.maps.tiled.objects,
com.badlogic.gdx.maps.tiled.renderers,
com.badlogic.gdx.maps.tiled.tiles,
com.badlogic.gdx.math,
com.badlogic.gdx.math.collision,
com.badlogic.gdx.net,
com.badlogic.gdx.scenes.scene2d,
com.badlogic.gdx.scenes.scene2d.actions,
com.badlogic.gdx.scenes.scene2d.ui,
com.badlogic.gdx.scenes.scene2d.utils,
com.badlogic.gdx.utils,
com.badlogic.gdx.utils.async,
com.badlogic.gdx.utils.compression,
com.badlogic.gdx.utils.compression.lz,
com.badlogic.gdx.utils.compression.lzma,
com.badlogic.gdx.utils.compression.rangecoder,
com.badlogic.gdx.utils.reflect,
com.badlogic.gdx.utils.viewport,
imgui,
imgui.flag,
imgui.glfw,
imgui.gl3,
imgui.type,
net.spookygames.gdx.nativefilechooser,
love.distributedrebirth.bassboonyd,
love.distributedrebirth.bassboonyd.jmx,
love.distributedrebirth.numberxd,
love.distributedrebirth.numberxd.base2t,
love.distributedrebirth.numberxd.base2t.part,
love.distributedrebirth.numberxd.base2t.part.warp,
love.distributedrebirth.numberxd.base2t.type,
love.distributedrebirth.numberxd.base2t.typexl,
love.distributedrebirth.numberxd.glyph,
love.distributedrebirth.numberxd.x4o,
</Import-Package>
<Export-Package>love.distributedrebirth.gdxapp4d.vrgem4.service</Export-Package>
<Private-Package>love.distributedrebirth.gdxapp4d.vrgem4.*</Private-Package>
<!--
<Embed-Dependency>*;artifactId=gdx;inline=true,*;artifactId=gdx-nativefilechooser;inline=true</Embed-Dependency>
-->
<Bundle-Activator>love.distributedrebirth.gdxapp4d.vrgem4.GDXAppVrGem4Activator</Bundle-Activator>
<Bundle-Vendor>distributedrebirth.love</Bundle-Vendor>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
</project>

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<root:ocean xmlns:root="http://wrap-sea.x4o.distributedrebirth.love/xml/ns/warp-sea-root"
xmlns:link="http://warp-sea.x4o.distributedrebirth.love/xml/ns/warp-sea-link"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://wrap-sea.x4o.distributedrebirth.love/xml/ns/warp-sea-root http://warp-sea.x4o.distributedrebirth.love/xml/ns/warp-sea-root-1.0.xsd">
<link:sea name="vrGEM4" provider="gdxapp4d.system" author="willemtsade">
<link:magic file="gdxapp4d-vrgem4.jar" mime="application/vnd.osgi.bundle"/>
</link:sea>
</root:ocean>

View file

@ -1,4 +1,4 @@
package love.distributedrebirth.gdxapp;
package love.distributedrebirth.gdxapp4d.vrgem4;
@SuppressWarnings("unused")
public class FontAwesomeIcons {

View file

@ -1,8 +1,8 @@
package love.distributedrebirth.gdxapp;
package love.distributedrebirth.gdxapp4d.vrgem4;
import java.util.function.Supplier;
import love.distributedrebirth.gdxapp.desktop.DefaultDeskApp;
import love.distributedrebirth.gdxapp4d.vrgem4.desktop.DefaultDeskApp;
public final class GDXAppLauncher {

View file

@ -0,0 +1,43 @@
package love.distributedrebirth.gdxapp4d.vrgem4;
import java.util.List;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
import love.distributedrebirth.bassboonyd.BãßBȍőnClassInfoʸᴰ;
import love.distributedrebirth.bassboonyd.BãßBȍőnCoffinOpenʸᴰ;
import love.distributedrebirth.bassboonyd.BãßBȍőnCoffinʸᴰ;
import love.distributedrebirth.bassboonyd.BãßBȍőnPackageInfoʸᴰ;
import love.distributedrebirth.bassboonyd.jmx.DefaultEnumInstanceᴶᴹˣ;
import love.distributedrebirth.gdxapp4d.tos4.service.SystemWarpTerminal;
import love.distributedrebirth.gdxapp4d.vrgem4.music.MusicManager;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
@BãßBȍőnClassInfoʸᴰ(name = "GDXAppMain", purpose = "Main loop render dispatcher and bootup.")
@BãßBȍőnPackageInfoʸᴰ(name = "love.distributedrebirth.gdxapp")
public enum GDXAppVrGem4 implements DefaultEnumInstanceᴶᴹˣ<GDXAppVrGem4,GDXAppVrGem4Keyʸᴰ> {
INSTANCE;
public SystemWarpTerminal terminal;
public MusicManager music;
//public FontAtlas basePlane;
private final BãßBȍőnCoffinOpenʸᴰ<GDXAppVrGem4Keyʸᴰ> BBC = BãßBȍőnCoffinOpenʸᴰ.newInstance();
public BãßBȍőnCoffinʸᴰ<GDXAppVrGem4Keyʸᴰ> GET_BBC() { return BBC; }
private GDXAppVrGem4() {
BBC.BOON_INIT(this);
BȍőnJmxInit(GDXAppVrGem4Keyʸᴰ.JMX);
}
public void init(List<String> args, SystemWarpTerminal terminal) {
boolean musicStop = args.contains("music-stop");
if (musicStop) {
System.out.println("music-stop: requested");
}
music = new MusicManager();
music.init(musicStop);
this.terminal = terminal;
}
}

View file

@ -0,0 +1,159 @@
package love.distributedrebirth.gdxapp4d.vrgem4;
import java.util.List;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import com.badlogic.gdx.Gdx;
import imgui.type.ImBoolean;
import love.distributedrebirth.bassboonyd.BãßBȍőnCoffinOpenʸᴰ;
import love.distributedrebirth.bassboonyd.jmx.DefaultEnumBaseᴶᴹˣ;
import love.distributedrebirth.gdxapp4d.tos4.service.SystemWarpBootArgs;
import love.distributedrebirth.gdxapp4d.tos4.service.SystemWarpTerminal;
import love.distributedrebirth.gdxapp4d.vrgem4.screen.ScreenCredits;
import love.distributedrebirth.gdxapp4d.vrgem4.screen.ScreenDesktop1;
import love.distributedrebirth.gdxapp4d.vrgem4.screen.ScreenDesktop2;
import love.distributedrebirth.gdxapp4d.vrgem4.screen.ScreenDesktop3;
import love.distributedrebirth.gdxapp4d.vrgem4.screen.ScreenDesktop4;
import love.distributedrebirth.gdxapp4d.vrgem4.screen.ScreenHelp;
import love.distributedrebirth.gdxapp4d.vrgem4.screen.ScreenIntro;
import love.distributedrebirth.gdxapp4d.vrgem4.screen.ScreenIntroMission;
import love.distributedrebirth.numberxd.base2t.Base2PartsFactory;
import love.distributedrebirth.numberxd.base2t.Base2Terminator;
import love.distributedrebirth.numberxd.base2t.part.warp.TOSWarpCore;
import love.distributedrebirth.numberxd.glyph.BaseGlyphSet;
import love.distributedrebirth.warpme.core.WaterBucket;
import love.distributedrebirth.warpme.core.WaterBucketDriver;
public class GDXAppVrGem4Activator implements BundleActivator {
// private static final Logger LOG = LoggerFactory.getLogger(GDXAppVrGem4Activator.class);
@Override
public void stop(final BundleContext context) {
}
@Override
public void start(final BundleContext context) {
// LOG.info("GDXAppVrGem4Activator started");
ServiceReference<SystemWarpTerminal> termRef = context.getServiceReference(SystemWarpTerminal.class);
SystemWarpTerminal terminal = context.getService(termRef);
GDXAppVrGem4BootScreen bootScreen = new GDXAppVrGem4BootScreen();
Gdx.app.postRunnable(new Runnable() {
@Override
public void run() {
bootScreen.create();
terminal.registrateScreen(bootScreen);
terminal.selectScreen(GDXAppVrGem4BootScreen.class);
}
});
try {
Thread.sleep(100);
} catch (InterruptedException ignored) {
}
bootScreen.bootLine("vrGEM4 Booting...");
// ref to init
// LOG.debug("BãßBȍőnCoffinʸᴰ init......");
for (DefaultEnumBaseᴶᴹˣ<?,?> coffin:coffinInstances()) {
BãßBȍőnCoffinOpenʸᴰ.lockCoffin(coffin);
}
bootScreen.bootLine("BãßBȍőnCoffinʸᴰ init done.");
bootScreen.bootLine("ImGui Setup");
ImBoolean imLoaded = new ImBoolean(false);
Gdx.app.postRunnable(new Runnable() {
@Override
public void run() {
ImGuiSetup.init();
imLoaded.set(true);
}
});
while (!imLoaded.get()) {
try {
Thread.sleep(100);
} catch (InterruptedException ignored) {
}
}
bootScreen.bootLine("ImGui Loaded");
ServiceReference<SystemWarpBootArgs> bootArgsRef = context.getServiceReference(SystemWarpBootArgs.class);
SystemWarpBootArgs bootArgs = context.getService(bootArgsRef);
List<String> args = bootArgs.getBootArgs();
try {
if (args.contains("warpcore-load")) {
bootScreen.bootLine("warpcore-load: requested");
WaterBucket bucket = WaterBucketDriver.newInstance().createReader().readFile("./warpcore.xml");
TOSWarpCore.INSTANCE.BãßArmWarpCore(bucket);
}
if (args.contains("warpcore-save")) {
bootScreen.bootLine("warpcore-save: requested");
WaterBucket bucket = TOSWarpCore.INSTANCE.BãßCurrentWarpCore();
WaterBucketDriver.newInstance().createWriter().writeFile(bucket, "./warpcore.xml");
}
} catch (Exception e) {
throw new RuntimeException(e);
}
if (!args.contains("warpcore-nolock")) {
bootScreen.bootLine("warpcore-lock: BãßLockWarpCipher");
TOSWarpCore.INSTANCE.BãßLockWarpCipher();
} else {
bootScreen.bootLine("warpcore-nolock: requested");
}
if (args.contains("full-screen")) {
System.out.println("full-screen: requested");
Gdx.app.postRunnable(new Runnable() {
@Override
public void run() {
Gdx.graphics.setFullscreenMode(Gdx.graphics.getDisplayMode());
}
});
}
GDXAppVrGem4.INSTANCE.init(args, terminal);
Gdx.app.postRunnable(new Runnable() {
@Override
public void run() {
terminal.registrateScreen(new ScreenIntro());
terminal.registrateScreen(new ScreenIntroMission());
terminal.registrateScreen(new ScreenDesktop1());
terminal.registrateScreen(new ScreenDesktop2());
terminal.registrateScreen(new ScreenDesktop3());
terminal.registrateScreen(new ScreenDesktop4());
terminal.registrateScreen(new ScreenCredits());
terminal.registrateScreen(new ScreenHelp());
if (args.contains("intro-skip")) {
System.out.println("intro-skip: requested");
terminal.selectScreen(ScreenDesktop1.class);
// music.play(MusicSongType.BACKGROUND);
} else {
terminal.selectScreen(ScreenIntro.class);
}
}
});
}
//TODO: add layer or ?? private <T extends BãßBȍőnCoffinStoreʸᴰ<?>,DefaultAuthorInfoʸᴰ> T[] storeInstances() {
@SuppressWarnings("unchecked")
private <T extends DefaultEnumBaseᴶᴹˣ<?,?>> T[] coffinInstances() {
return (T[]) new DefaultEnumBaseᴶᴹˣ[] {
GDXAppVrGem4.INSTANCE,
BaseGlyphSet.values()[0],
Base2Terminator.INSTANCE,
Base2PartsFactory.INSTANCE,
TOSWarpCore.INSTANCE
};
}
}

View file

@ -0,0 +1,6 @@
package love.distributedrebirth.gdxapp4d.vrgem4;
public interface GDXAppVrGem4BootListener {
void bootLine(String message);
}

View file

@ -0,0 +1,56 @@
package love.distributedrebirth.gdxapp4d.vrgem4;
import java.util.ArrayList;
import java.util.List;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.ScreenAdapter;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
public class GDXAppVrGem4BootScreen extends ScreenAdapter implements GDXAppVrGem4BootListener {
private BitmapFont font;
private SpriteBatch batch;
private Texture backgroundImage;
private List<String> messages = new ArrayList<>();
public GDXAppVrGem4BootScreen() {
}
public void create() {
batch = new SpriteBatch();
backgroundImage = new Texture(Gdx.files.internal("background/temple-os.png"));
font = new BitmapFont();
}
@Override
public void render(float delta) {
int textX = 40;
int textY = Gdx.graphics.getHeight();
int textYStep = 20;
batch.begin();
synchronized (messages) {
for (String message:messages) {
font.draw(batch, message, textX, textY-=textYStep);
}
batch.draw(backgroundImage, textY, textY, textY, textY);
}
batch.end();
}
@Override
public void dispose() {
batch.dispose();
backgroundImage.dispose();
font.dispose();
}
@Override
public void bootLine(String message) {
synchronized (messages) {
messages.add(message);
}
}
}

View file

@ -0,0 +1,12 @@
package love.distributedrebirth.gdxapp4d.vrgem4;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
import love.distributedrebirth.bassboonyd.BãßBȍőnCoffinStoreKeyʸᴰ;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public enum GDXAppVrGem4Keyʸᴰ implements BãßBȍőnCoffinStoreKeyʸᴰ {
JMX,
;
}

View file

@ -1,4 +1,4 @@
package love.distributedrebirth.gdxapp;
package love.distributedrebirth.gdxapp4d.vrgem4;
import com.badlogic.gdx.Gdx;

View file

@ -1,4 +1,4 @@
package love.distributedrebirth.gdxapp.desktop;
package love.distributedrebirth.gdxapp4d.vrgem4.desktop;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;

View file

@ -1,4 +1,4 @@
package love.distributedrebirth.gdxapp.desktop;
package love.distributedrebirth.gdxapp4d.vrgem4.desktop;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;

View file

@ -1,4 +1,4 @@
package love.distributedrebirth.gdxapp.desktop;
package love.distributedrebirth.gdxapp4d.vrgem4.desktop;
import java.util.HashMap;
import java.util.Map;

View file

@ -1,4 +1,4 @@
package love.distributedrebirth.gdxapp.desktop;
package love.distributedrebirth.gdxapp4d.vrgem4.desktop;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;

View file

@ -1,4 +1,4 @@
package love.distributedrebirth.gdxapp.desktop;
package love.distributedrebirth.gdxapp4d.vrgem4.desktop;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;

View file

@ -1,4 +1,4 @@
package love.distributedrebirth.gdxapp.desktop;
package love.distributedrebirth.gdxapp4d.vrgem4.desktop;
import java.util.ArrayList;
import java.util.List;

View file

@ -1,4 +1,4 @@
package love.distributedrebirth.gdxapp.desktop;
package love.distributedrebirth.gdxapp4d.vrgem4.desktop;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;

View file

@ -1,4 +1,4 @@
package love.distributedrebirth.gdxapp.desktop;
package love.distributedrebirth.gdxapp4d.vrgem4.desktop;
import com.badlogic.gdx.InputProcessor;

View file

@ -1,4 +1,4 @@
package love.distributedrebirth.gdxapp.desktop;
package love.distributedrebirth.gdxapp4d.vrgem4.desktop;
import com.badlogic.gdx.Screen;

View file

@ -1,4 +1,4 @@
package love.distributedrebirth.gdxapp.desktop;
package love.distributedrebirth.gdxapp4d.vrgem4.desktop;
import java.util.ArrayList;
import java.util.List;
@ -8,41 +8,32 @@ import com.badlogic.gdx.Gdx;
import imgui.ImGui;
import imgui.type.ImBoolean;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
import love.distributedrebirth.gdxapp.FontAwesomeIcons;
import love.distributedrebirth.gdxapp.GDXAppLauncher;
import love.distributedrebirth.gdxapp.GDXAppMain;
import love.distributedrebirth.gdxapp.desktop.apps.BasicConsoleApp;
import love.distributedrebirth.gdxapp.desktop.apps.HebrewWalletApp;
import love.distributedrebirth.gdxapp.desktop.apps.MusicPlayerApp;
import love.distributedrebirth.gdxapp.desktop.apps.SystemBaseGlyphApp;
import love.distributedrebirth.gdxapp.desktop.apps.SystemBasePartApp;
import love.distributedrebirth.gdxapp.desktop.apps.SystemBaseUnicodePlaneApp;
import love.distributedrebirth.gdxapp.desktop.apps.Unicode4DApp;
import love.distributedrebirth.gdxapp.screen.ScreenCredits;
import love.distributedrebirth.gdxapp.screen.ScreenDesktop1;
import love.distributedrebirth.gdxapp.screen.ScreenDesktop2;
import love.distributedrebirth.gdxapp.screen.ScreenDesktop3;
import love.distributedrebirth.gdxapp.screen.ScreenDesktop4;
import love.distributedrebirth.gdxapp.screen.ScreenHelp;
import love.distributedrebirth.gdxapp4d.tos4.GDXAppTos4;
import love.distributedrebirth.gdxapp4d.vrgem4.FontAwesomeIcons;
import love.distributedrebirth.gdxapp4d.vrgem4.GDXAppLauncher;
import love.distributedrebirth.gdxapp4d.vrgem4.GDXAppVrGem4;
import love.distributedrebirth.gdxapp4d.vrgem4.desktop.apps.BasicConsoleApp;
import love.distributedrebirth.gdxapp4d.vrgem4.desktop.apps.HebrewWalletApp;
import love.distributedrebirth.gdxapp4d.vrgem4.desktop.apps.MusicPlayerApp;
import love.distributedrebirth.gdxapp4d.vrgem4.desktop.apps.SystemBaseGlyphApp;
import love.distributedrebirth.gdxapp4d.vrgem4.desktop.apps.SystemBasePartApp;
import love.distributedrebirth.gdxapp4d.vrgem4.desktop.apps.SystemBaseUnicodePlaneApp;
import love.distributedrebirth.gdxapp4d.vrgem4.desktop.apps.Unicode4DApp;
import love.distributedrebirth.gdxapp4d.vrgem4.screen.ScreenCredits;
import love.distributedrebirth.gdxapp4d.vrgem4.screen.ScreenDesktop1;
import love.distributedrebirth.gdxapp4d.vrgem4.screen.ScreenDesktop2;
import love.distributedrebirth.gdxapp4d.vrgem4.screen.ScreenDesktop3;
import love.distributedrebirth.gdxapp4d.vrgem4.screen.ScreenDesktop4;
import love.distributedrebirth.gdxapp4d.vrgem4.screen.ScreenHelp;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public class DeskTopScreenMenu {
private final DeskTopScreen desktop1;
private final DeskTopScreen desktop2;
private final DeskTopScreen desktop3;
private final DeskTopScreen desktop4;
private List<GDXAppLauncher> apps;
private ImBoolean fileMinimizeSelected = new ImBoolean(false);
private ImBoolean fileCloseSelected = new ImBoolean(false);
public DeskTopScreenMenu(DeskTopScreen desktop1, DeskTopScreen desktop2,
DeskTopScreen desktop3, DeskTopScreen desktop4) {
this.desktop1 = desktop1;
this.desktop2 = desktop2;
this.desktop3 = desktop3;
this.desktop4 = desktop4;
public DeskTopScreenMenu() {
apps = new ArrayList<>();
apps.add(new GDXAppLauncher("Basic Console", () -> new BasicConsoleApp()));
apps.add(new GDXAppLauncher("Sys Glyph Set", () -> new SystemBaseGlyphApp()));
@ -204,16 +195,16 @@ public class DeskTopScreenMenu {
infix4 = FontAwesomeIcons.Eye + " ";
}
if (ImGui.menuItem(infix1+"Desktop1")) {
GDXAppMain.INSTANCE.selectScreen(ScreenDesktop1.class);
GDXAppVrGem4.INSTANCE.terminal.selectScreen(ScreenDesktop1.class);
}
if (ImGui.menuItem(infix2+"Desktop2")) {
GDXAppMain.INSTANCE.selectScreen(ScreenDesktop2.class);
GDXAppVrGem4.INSTANCE.terminal.selectScreen(ScreenDesktop2.class);
}
if (ImGui.menuItem(infix3+"Desktop3")) {
GDXAppMain.INSTANCE.selectScreen(ScreenDesktop3.class);
GDXAppVrGem4.INSTANCE.terminal.selectScreen(ScreenDesktop3.class);
}
if (ImGui.menuItem(infix4+"Desktop4")) {
GDXAppMain.INSTANCE.selectScreen(ScreenDesktop4.class);
GDXAppVrGem4.INSTANCE.terminal.selectScreen(ScreenDesktop4.class);
}
ImGui.separator();
if (ImGui.beginMenu(FontAwesomeIcons.PlusSquare + " Start App")) {
@ -229,27 +220,27 @@ public class DeskTopScreenMenu {
ImGui.separator();
if (Gdx.graphics.isFullscreen()) {
if (ImGui.menuItem(FontAwesomeIcons.Wheelchair + " Window Mode")) {
Gdx.graphics.setWindowedMode(GDXAppMain.INSTANCE.viewWidth, GDXAppMain.INSTANCE.viewHeight);
// Gdx.graphics.setWindowedMode(GDXAppVrGem4.INSTANCE.viewWidth, GDXAppVrGem4.INSTANCE.viewHeight);
}
} else {
if (ImGui.menuItem(FontAwesomeIcons.FighterJet + " Full Screen")) {
Gdx.graphics.setFullscreenMode(Gdx.graphics.getDisplayMode());
// Gdx.graphics.setFullscreenMode(Gdx.graphics.getDisplayMode());
}
}
ImGui.separator();
if (ImGui.menuItem(FontAwesomeIcons.CreditCard + " Credits")) {
GDXAppMain.INSTANCE.selectScreen(ScreenCredits.class);
GDXAppVrGem4.INSTANCE.terminal.selectScreen(ScreenCredits.class);
}
if (ImGui.menuItem(FontAwesomeIcons.HandsHelping + " Help")) {
GDXAppMain.INSTANCE.selectScreen(ScreenHelp.class);
GDXAppVrGem4.INSTANCE.terminal.selectScreen(ScreenHelp.class);
}
ImGui.separator();
if (ImGui.menuItem(FontAwesomeIcons.Trademark + " ImGui Demo")) {
GDXAppMain.INSTANCE.showImGuiDemo.set(true);
// GDXAppVrGem4.INSTANCE.showImGuiDemo.set(true);
}
if (ImGui.menuItem(FontAwesomeIcons.PowerOff + " Shutdown")) {
GDXAppMain.INSTANCE.dispose();
// GDXAppVrGem4.INSTANCE.dispose();
System.exit(0);
}
ImGui.endMenu();

View file

@ -1,10 +1,10 @@
package love.distributedrebirth.gdxapp.desktop.apps;
package love.distributedrebirth.gdxapp4d.vrgem4.desktop.apps;
import imgui.ImGui;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
import love.distributedrebirth.gdxapp.desktop.DefaultDeskApp;
import love.distributedrebirth.gdxapp.desktop.DeskAppContourSection;
import love.distributedrebirth.gdxapp.desktop.DeskAppRenderer;
import love.distributedrebirth.gdxapp4d.vrgem4.desktop.DefaultDeskApp;
import love.distributedrebirth.gdxapp4d.vrgem4.desktop.DeskAppContourSection;
import love.distributedrebirth.gdxapp4d.vrgem4.desktop.DeskAppRenderer;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public class BasicConsoleApp extends DefaultDeskApp {

View file

@ -1,11 +1,11 @@
package love.distributedrebirth.gdxapp.desktop.apps;
package love.distributedrebirth.gdxapp4d.vrgem4.desktop.apps;
import imgui.ImGui;
import imgui.flag.ImGuiTableFlags;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
import love.distributedrebirth.gdxapp.desktop.DefaultDeskApp;
import love.distributedrebirth.gdxapp.desktop.DeskAppContourSection;
import love.distributedrebirth.gdxapp.desktop.DeskAppRenderer;
import love.distributedrebirth.gdxapp4d.vrgem4.desktop.DefaultDeskApp;
import love.distributedrebirth.gdxapp4d.vrgem4.desktop.DeskAppContourSection;
import love.distributedrebirth.gdxapp4d.vrgem4.desktop.DeskAppRenderer;
import love.distributedrebirth.numberxd.Gê̄ldGetậl;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")

View file

@ -1,4 +1,4 @@
package love.distributedrebirth.gdxapp.desktop.apps;
package love.distributedrebirth.gdxapp4d.vrgem4.desktop.apps;
import java.util.function.Consumer;
@ -10,12 +10,13 @@ import imgui.flag.ImGuiSelectableFlags;
import imgui.flag.ImGuiTableColumnFlags;
import imgui.flag.ImGuiTableFlags;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
import love.distributedrebirth.gdxapp.FontAwesomeIcons;
import love.distributedrebirth.gdxapp.GDXAppMain;
import love.distributedrebirth.gdxapp.desktop.DefaultDeskApp;
import love.distributedrebirth.gdxapp.desktop.DeskAppContourSection;
import love.distributedrebirth.gdxapp.desktop.DeskAppRenderer;
import love.distributedrebirth.gdxapp.music.MusicSong;
import love.distributedrebirth.gdxapp4d.tos4.GDXAppTos4;
import love.distributedrebirth.gdxapp4d.vrgem4.FontAwesomeIcons;
import love.distributedrebirth.gdxapp4d.vrgem4.GDXAppVrGem4;
import love.distributedrebirth.gdxapp4d.vrgem4.desktop.DefaultDeskApp;
import love.distributedrebirth.gdxapp4d.vrgem4.desktop.DeskAppContourSection;
import love.distributedrebirth.gdxapp4d.vrgem4.desktop.DeskAppRenderer;
import love.distributedrebirth.gdxapp4d.vrgem4.music.MusicSong;
import net.spookygames.gdx.nativefilechooser.NativeFileChooserCallback;
import net.spookygames.gdx.nativefilechooser.NativeFileChooserConfiguration;
@ -35,8 +36,8 @@ public class MusicPlayerApp extends DefaultDeskApp implements DeskAppRenderer {
@Override
public void render() {
if (ImGui.menuItem(FontAwesomeIcons.Plus + " Add")) {
GDXAppMain.INSTANCE.fileChooser.chooseFile(fileChooserConfig,
NativeFileChooserCallbackAdapter.onFileChosen(v -> GDXAppMain.INSTANCE.music.addBackgroundMusic(v)));
// GDXAppVrGem4.INSTANCE.terminal.getFileChooser().chooseFile(fileChooserConfig,
// NativeFileChooserCallbackAdapter.onFileChosen(v -> GDXAppVrGem4.INSTANCE.music.addBackgroundMusic(v)));
}
}
@ -50,7 +51,7 @@ public class MusicPlayerApp extends DefaultDeskApp implements DeskAppRenderer {
@Override
public void render() {
ImGui.text("Current Song:");
MusicSong currentSong = GDXAppMain.INSTANCE.music.getCurrentSong();
MusicSong currentSong = GDXAppVrGem4.INSTANCE.music.getCurrentSong();
if (currentSong != null) {
ImGui.sameLine();
ImGui.text(currentSong.getName());
@ -58,22 +59,22 @@ public class MusicPlayerApp extends DefaultDeskApp implements DeskAppRenderer {
ImGui.separator();
if (currentSong != null) {
if (ImGui.button("Play")) {
GDXAppMain.INSTANCE.music.play(currentSong);
GDXAppVrGem4.INSTANCE.music.play(currentSong);
}
} else {
ImGui.text("Play");
}
ImGui.sameLine();
if (ImGui.button("<")) {
GDXAppMain.INSTANCE.music.prev();
GDXAppVrGem4.INSTANCE.music.prev();
}
ImGui.sameLine();
if (ImGui.button(">")) {
GDXAppMain.INSTANCE.music.next();
GDXAppVrGem4.INSTANCE.music.next();
}
ImGui.sameLine();
if (ImGui.button("Stop")) {
GDXAppMain.INSTANCE.music.stop();
GDXAppVrGem4.INSTANCE.music.stop();
}
int flags = ImGuiTableFlags.ScrollX | ImGuiTableFlags.RowBg | ImGuiTableFlags.BordersOuter | ImGuiTableFlags.BordersV;
ImGui.beginTable("playlist", 3, flags);
@ -82,14 +83,14 @@ public class MusicPlayerApp extends DefaultDeskApp implements DeskAppRenderer {
ImGui.tableSetupColumn("Name");
ImGui.tableHeadersRow();
int i=1;
for (MusicSong song:GDXAppMain.INSTANCE.music.getBackgroundSongs()) {
for (MusicSong song:GDXAppVrGem4.INSTANCE.music.getBackgroundSongs()) {
ImGui.pushID(i);
ImGui.tableNextRow();
ImGui.tableNextColumn();
ImGui.selectable(""+i, song.isPlaying(), ImGuiSelectableFlags.None);
ImGui.tableNextColumn();
if (ImGui.smallButton(">")) {
GDXAppMain.INSTANCE.music.play(song);
GDXAppVrGem4.INSTANCE.music.play(song);
}
ImGui.tableNextColumn();
ImGui.selectable(song.getName(), song.isPlaying(), ImGuiSelectableFlags.None);

Some files were not shown because too many files have changed in this diff Show more