Skip to content

Commit

Permalink
version 0.0.9, some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
msx80 committed Sep 30, 2024
1 parent c626f46 commit 90631e6
Show file tree
Hide file tree
Showing 11 changed files with 39 additions and 22 deletions.
1 change: 0 additions & 1 deletion omicron-player/android-lib/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

<artifactId>android-lib</artifactId>

<name>Omicron Android library</name>
<description>Contains some common classes to wrap an omicron game as an android app.</description>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,25 +39,17 @@ protected void onCreate (Bundle savedInstanceState) {
ExceptionHandler.addHandler(this);
Cartridge c = null;
try {
// ApplicationInfo ai = getPackageManager().getApplicationInfo(getPackageName(), PackageManager.GET_META_DATA);
//Bundle bundle = ai.metaData;
//String gameClass = bundle.getString("gameClass");

java.io.InputStream is = this.getClass().getClassLoader().getResourceAsStream("omicron_android.properties");
if(is == null) throw new RuntimeException("Unable to find omicron_android.properties where expected.");
java.util.Properties p = new Properties();
p.load(is);
String gameClass = p.getProperty("omicron.pkg")+"."+p.getProperty("omicron.main");
ApplicationInfo ai = getPackageManager().getApplicationInfo(getPackageName(), PackageManager.GET_META_DATA);
Bundle bundle = ai.metaData;
String gameClass = bundle.getString("omicronMain");

int n = gameClass.lastIndexOf('.');
String pkg = gameClass.substring(0, n);
String main = gameClass.substring(n+1);

c = new ClasspathCartridge("Gamex", pkg, main);
c = new ClasspathCartridge("Game", pkg, main);

//plugin.onCreate(this, savedInstanceState);
//if(true) throw new RuntimeException("err");
//g = (Game)Class.forName(gameClass).newInstance();
} catch (Exception e) {
throw new RuntimeException(e);
}
Expand Down
2 changes: 1 addition & 1 deletion omicron-player/desktop-lib/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.github.msx80.omicron</groupId>
<artifactId>omicron-parent</artifactId>
<version>0.0.8</version>
<version>0.0.9</version>
</parent>
<artifactId>desktop-lib</artifactId>

Expand Down
2 changes: 1 addition & 1 deletion omicron-player/omicron-assembly/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.github.msx80.omicron</groupId>
<artifactId>omicron-parent</artifactId>
<version>0.0.8</version>
<version>0.0.9</version>
</parent>
<artifactId>omicron-assembly</artifactId>
<packaging>pom</packaging>
Expand Down
2 changes: 1 addition & 1 deletion omicron-player/omicron-desktop/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.github.msx80.omicron</groupId>
<artifactId>omicron-parent</artifactId>
<version>0.0.8</version>
<version>0.0.9</version>
</parent>
<artifactId>omicron-desktop</artifactId>

Expand Down
2 changes: 1 addition & 1 deletion omicron-player/omicron-engine/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.github.msx80.omicron</groupId>
<artifactId>omicron-parent</artifactId>
<version>0.0.8</version>
<version>0.0.9</version>
</parent>
<artifactId>omicron-engine</artifactId>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,34 @@ public void handleResize(int winwidth, int winheight, OrthographicCamera cam)
cam.position.set(requiredSysConfig.width / 2f, requiredSysConfig.height / 2f, 0); // center on screen
cam.update();
}
else if (requiredSysConfig.mode == VirtualScreenMode.FILL_SIDE) {

dx = winwidth;
dy = winheight;

float tx = (float)winwidth/(float)requiredSysConfig.width;
float ty = (float)winheight/(float)requiredSysConfig.height;

if(tx > ty)
{
cam.setToOrtho(true,
(float)winwidth/ty,
requiredSysConfig.height
);
}
else
{
cam.setToOrtho(true,
requiredSysConfig.width,
(float)winheight/tx
);

}
cam.position.set(requiredSysConfig.width / 2f, requiredSysConfig.height / 2f, 0); // center on screen
cam.update();
}
else if (requiredSysConfig.mode == VirtualScreenMode.STRETCH_FULL) {

dx = winwidth;
dy = winheight;

Expand Down
2 changes: 1 addition & 1 deletion omicron-player/omicron-loader/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.github.msx80.omicron</groupId>
<artifactId>omicron-parent</artifactId>
<version>0.0.8</version>
<version>0.0.9</version>
</parent>
<artifactId>omicron-loader</artifactId>

Expand Down
2 changes: 1 addition & 1 deletion omicron-player/omicron-player-desktop/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.github.msx80.omicron</groupId>
<artifactId>omicron-parent</artifactId>
<version>0.0.8</version>
<version>0.0.9</version>
</parent>
<artifactId>omicron-player-desktop</artifactId>

Expand Down
2 changes: 1 addition & 1 deletion omicron-player/omicron-player/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.github.msx80.omicron</groupId>
<artifactId>omicron-parent</artifactId>
<version>0.0.8</version>
<version>0.0.9</version>
</parent>
<artifactId>omicron-player</artifactId>

Expand Down
2 changes: 1 addition & 1 deletion omicron-player/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.github.msx80.omicron</groupId>
<artifactId>omicron-parent</artifactId>
<version>0.0.8</version>
<version>0.0.9</version>

<packaging>pom</packaging>

Expand Down

0 comments on commit 90631e6

Please sign in to comment.