wip bug hunt

This commit is contained in:
Willem Cazander 2022-03-12 20:59:21 +01:00
parent c6c5c0fa8f
commit c60f7cca65
18 changed files with 290 additions and 97 deletions

View file

@ -89,6 +89,26 @@
imgui.gl3,
imgui.type,
net.spookygames.gdx.nativefilechooser,
org.x4o.xml,
org.x4o.xml.conv,
org.x4o.xml.conv.text,
org.x4o.xml.el,
org.x4o.xml.eld,
org.x4o.xml.eld.lang,
org.x4o.xml.eld.xsd,
org.x4o.xml.element,
org.x4o.xml.io,
org.x4o.xml.io.sax,
org.x4o.xml.io.sax.ext,
org.x4o.xml.lang,
org.x4o.xml.lang.phase,
org.x4o.xml.lang.task,
org.x4o.xml.lang.task.run,
javax.el,
org.apache.el,
org.apache.el.lang,
org.apache.el.parser,
org.apache.el.util,
love.distributedrebirth.bassboonyd,
love.distributedrebirth.bassboonyd.jmx,
love.distributedrebirth.numberxd,

View file

@ -16,6 +16,7 @@ import imgui.type.ImBoolean;
import love.distributedrebirth.bassboonyd.BãßBȍőnCoffinOpenʸᴰ;
import love.distributedrebirth.bassboonyd.jmx.DefaultEnumBaseᴶᴹˣ;
import love.distributedrebirth.gdxapp4d.tos4.service.SystemGdxBootArgs;
import love.distributedrebirth.gdxapp4d.tos4.service.SystemGdxBootReadyListener;
import love.distributedrebirth.gdxapp4d.tos4.service.SystemGdxFont;
import love.distributedrebirth.gdxapp4d.tos4.service.SystemGdxLog;
import love.distributedrebirth.gdxapp4d.tos4.service.SystemWarpShip;
@ -199,7 +200,6 @@ public class GDXAppVrGem4Activator implements BundleActivator {
return;
}
bootScreen.bootLine("vrGEM4: chains resolved.");
try {
systemWarpShip.loadBundles(context, registratedSeas);
} catch (BundleException e) {
@ -207,18 +207,25 @@ public class GDXAppVrGem4Activator implements BundleActivator {
bootScreen.bootLine("ERROR: "+e.getMessage());
return;
}
bootArgs.addBootReadyListener(new SystemGdxBootReadyListener() {
@Override
public void bootCompleted() {
Gdx.app.postRunnable(new Runnable() {
@Override
public void run() {
terminal.selectScreen(ScreenDesktop1.class);
terminal.disposeScreen(bootScreen);
}
});
logger.info(this, "Boot done");
}
});
try {
Thread.sleep(VIEW_SLEEP_TIME);
} catch (InterruptedException ignored) {
}
Gdx.app.postRunnable(new Runnable() {
@Override
public void run() {
terminal.selectScreen(ScreenDesktop1.class);
terminal.disposeScreen(bootScreen);
}
});
logger.info(this, "Boot done");
bootScreen.bootLine("vrGEM4: Init bundles...");
}
//TODO: add layer or ?? private <T extends BãßBȍőnCoffinStoreʸᴰ<?>,DefaultAuthorInfoʸᴰ> T[] storeInstances() {

View file

@ -0,0 +1,82 @@
package love.distributedrebirth.gdxapp4d.vrgem4;
import java.io.File;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.osgi.framework.BundleContext;
import org.osgi.service.component.annotations.Activate;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Deactivate;
import org.osgi.service.component.annotations.Reference;
import love.distributedrebirth.gdxapp4d.tos4.service.SystemGdxLog;
import love.distributedrebirth.gdxapp4d.tos4.service.SystemWarpShip;
import love.distributedrebirth.gdxapp4d.vrgem4.service.VrGem4Unicode4DService;
import love.distributedrebirth.unicode4d.CodePointᶻᴰ;
import love.distributedrebirth.unicode4d.atlas.FontAtlas;
import love.distributedrebirth.unicode4d.atlas.FontAtlasDriver;
import love.distributedrebirth.unicode4d.atlas.FontAtlasStore;
import love.distributedrebirth.unicode4d.atlas.FontAtlasStoreGlyph;
@Component
public class VrGem4Unicode4DServiceImpl implements VrGem4Unicode4DService {
private final FontAtlas masterFontAtlas;
private final Map<Character, FontAtlasStoreGlyph> unicodeMap;
@Reference
private SystemGdxLog log;
@Reference
private SystemWarpShip warpShip;
public VrGem4Unicode4DServiceImpl() {
masterFontAtlas = new FontAtlas();
unicodeMap = new HashMap<>();
}
@Activate
void open(final BundleContext context) {
log.debug(this, SystemGdxLog.ACTIVATE);
List<File> glyps = warpShip.searchMagic(context, "application/x-font-ttf4d");
try {
for (File glypSet:glyps) {
log.debug(this, "Loading glypSet: {}", glypSet);
FontAtlas atlas = FontAtlasDriver.newInstance().createReader().readFile(glypSet);
masterFontAtlas.setStores(atlas.getStores());
}
} catch (Exception e) {
log.error(this, e.getMessage(), e);
}
log.info(this, "Master font atlas size: {}", masterFontAtlas.getStores().size());
for (FontAtlasStore fontStore:masterFontAtlas.getStores()) {
log.info(this,"Map unicode: {}", fontStore.getName());
for (FontAtlasStoreGlyph glyph: fontStore.getGlyphs()) {
int unicode = CodePointᶻᴰ.INSTANCE.searchUnicode(glyph.getTongs());
if (unicode > 0) {
unicodeMap.put(Character.valueOf((char) unicode), glyph);
}
}
}
log.info(this, "unicode map size: {}", unicodeMap.size());
}
@Deactivate
void close() {
log.debug(this, SystemGdxLog.DEACTIVATE);
}
@Override
public FontAtlas getMasterFontAtlas() {
return masterFontAtlas;
}
@Override
public FontAtlasStoreGlyph getGlyphForUnicode(char unicode) {
return unicodeMap.get(unicode);
}
}

View file

@ -0,0 +1,11 @@
package love.distributedrebirth.gdxapp4d.vrgem4.service;
import love.distributedrebirth.unicode4d.atlas.FontAtlas;
import love.distributedrebirth.unicode4d.atlas.FontAtlasStoreGlyph;
public interface VrGem4Unicode4DService {
FontAtlas getMasterFontAtlas();
FontAtlasStoreGlyph getGlyphForUnicode(char unicode);
}

View file

@ -25,7 +25,6 @@ import love.distributedrebirth.gdxapp4d.vrgem4.service.deskapp.DeskAppMenuSectio
import love.distributedrebirth.gdxapp4d.vrgem4.service.deskapp.DeskAppRenderer;
import love.distributedrebirth.gdxapp4d.vrgem4.view.apps.SystemBaseGlyphApp;
import love.distributedrebirth.gdxapp4d.vrgem4.view.apps.SystemBasePartApp;
import love.distributedrebirth.gdxapp4d.vrgem4.view.apps.Unicode4DApp;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public class DeskTopScreenMenu {
@ -45,8 +44,6 @@ public class DeskTopScreenMenu {
apps = new ArrayList<>();
apps.add(new DeskAppLauncher(DeskAppMenuSection.PROGRAMMING, "Sys Glyph Set", () -> new SystemBaseGlyphApp()));
apps.add(new DeskAppLauncher(DeskAppMenuSection.PROGRAMMING, "Sys Number Parts", () -> new SystemBasePartApp()));
apps.add(new DeskAppLauncher(DeskAppMenuSection.PROGRAMMING, "Unicode4D", () -> new Unicode4DApp()));
}
public void renderMenu(DeskTopScreen appScreen) {

View file

@ -1,73 +0,0 @@
package love.distributedrebirth.gdxapp4d.vrgem4.view.apps;
import java.util.List;
import imgui.ImColor;
import imgui.ImDrawList;
import imgui.ImGui;
import imgui.ImVec2;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
import love.distributedrebirth.gdxapp4d.vrgem4.service.deskapp.AbstractDeskApp;
import love.distributedrebirth.gdxapp4d.vrgem4.service.deskapp.DeskAppContourSection;
import love.distributedrebirth.gdxapp4d.vrgem4.service.deskapp.DeskAppRenderer;
import love.distributedrebirth.numberxd.base2t.type.V072Tong;
import love.distributedrebirth.unicode4d.atlas.FontAtlasStore;
import love.distributedrebirth.unicode4d.atlas.FontAtlasStoreGlyph;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public class Unicode4DApp extends AbstractDeskApp implements DeskAppRenderer {
public void create() {
getContours().setTitle("Unicode4D");
getContours().registrateContour(DeskAppContourSection.MAIN, this);
}
@Override
public void render() {
ImGui.text("There is unicode and unicode4D");
//FontAtlasStore plane = GDXAppMain.INSTANCE.basePlane.getPlaneByName("MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A");
FontAtlasStoreGlyph glyph = null; //plane.getBaseGlyphByUnicode("27d6");
ImCharacter c = new ImCharacter(glyph);
c.render();
}
class ImCharacter {
private final FontAtlasStoreGlyph glyph;
public ImCharacter(FontAtlasStoreGlyph glyph) {
this.glyph = glyph;
//List<V072Tong> tongs = glyph.getTongs();
}
public void render() {
ImVec2 size = new ImVec2(144f, 48f);
ImGui.invisibleButton("canvas", size.x, size.y);
ImVec2 p0 = ImGui.getItemRectMin();
ImVec2 p1 = ImGui.getItemRectMax(); // p1 = p0 + size
ImDrawList drawList = ImGui.getWindowDrawList();
drawList.pushClipRect(p0.x, p0.y, p1.x, p1.y);
// draw unicode4D
drawList.addQuad(p0.x, p0.y, p0.x+size.x, p0.y, p1.x, p1.y, p0.x, p0.y+size.y,
ImColor.intToColor(127, 127, 255, 255), 5f);
drawList.addLine(p0.x+10, p0.y+40, p0.x+20, p0.y+10, ImColor.intToColor(255, 127, 63, 255));
drawList.addLine(p0.x+30, p0.y+40, p0.x+20, p0.y+10, ImColor.intToColor(255, 127, 63, 255));
drawList.addLine(p0.x+13, p0.y+30, p0.x+27, p0.y+30, ImColor.intToColor(255, 127, 63, 255));
drawList.popClipRect();
//System.out.println("p0.x="+p0.x+" p0.y="+p0.y);
//System.out.println("p1.x="+p1.x+" p1.y="+p1.y);
// for (int n = 0; n < (1.0f + Math.sin(ImGui.getTime() * 5.7f)) * 40.0f; n++) {
// drawList.addCircle(p0.x + size.x * 0.5f, p0.y + size.y * 0.5f, size.y * (0.01f + n * 0.03f),
// ImColor.intToColor(255, 140 - n * 4, n * 3, 255)
// );
// }
}
}
}