merge dev into test #28

Merged
j23f0712 merged 29 commits from development into dev/test 2024-12-01 23:11:24 +01:00
12 changed files with 40 additions and 49 deletions
Showing only changes of commit eb703cbd2c - Show all commits

View File

@@ -1,32 +0,0 @@
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x000076fb04e70b48, pid=112363, tid=112397
#
# JRE version: OpenJDK Runtime Environment Temurin-20.0.2+9 (20.0.2+9) (build 20.0.2+9)
# Java VM: OpenJDK 64-Bit Server VM Temurin-20.0.2+9 (20.0.2+9, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# C [libLLVM.so.18.1+0x1070b48] llvm::EVT::isExtendedVector() const+0x8
#
# Core dump will be written. Default location: Core dumps may be processed with "/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %h" (or dumping to /home/cedric/ProgProjekt/Gruppe-01/Projekte/mdga/client/core.112363)
#
# If you would like to submit a bug report, please visit:
# https://github.com/adoptium/adoptium-support/issues
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
--------------- S U M M A R Y ------------
Command Line: -Ddebugger.agent.enable.coroutines=true -Djava.util.logging.config.file=logging.properties -Dkotlinx.coroutines.debug.enable.creation.stack.trace=false -agentlib:jdwp=transport=dt_socket,server=n,suspend=y,address=127.0.0.1:37129 -javaagent:/usr/share/idea/plugins/java/lib/rt/debugger-agent.jar -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant -ea pp.mdga.client.MdgaApp
Host: AMD Ryzen 5 8640HS w/ Radeon 760M Graphics, 12 cores, 14G, Manjaro Linux
Time: Fri Nov 29 22:02:46 2024 CET elapsed time: 26.893420 seconds (0d 0h 0m 26s)
--------------- T H R E A D ---------------
Current thread (0x000076fbec5e6dd0): JavaThread "jME3 Main" [_thread_in_native, id=112397, stack(0x000076fbd00fe000,0x000076fbd01fe000)]
Stack: [0x000076fbd00fe000,0x000076fbd01fe000], sp=0x000076fbd01f4ef8, free space=987k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [libLLVM.so.18.1+0x1070b48] llvm::EVT::isExtendedVector() const+0x8

View File

@@ -35,7 +35,7 @@ public class MdgaApp extends SimpleApplication {
private MdgaState state = null; private MdgaState state = null;
/** Scale for rendering images. */ /** Scale for rendering images. */
private static final float imageScale = 1.5f; private static final float IMAGE_SCALE = 1.5f;
/** The main menu view. */ /** The main menu view. */
private MdgaView mainView; private MdgaView mainView;
@@ -59,8 +59,8 @@ public static void main(String[] args) {
AppSettings settings = new AppSettings(true); AppSettings settings = new AppSettings(true);
settings.setSamples(128); settings.setSamples(128);
settings.setCenterWindow(true); settings.setCenterWindow(true);
settings.setWidth(1920); settings.setWidth(1800);
settings.setHeight(1080); settings.setHeight(900);
settings.setVSync(false); settings.setVSync(false);
MdgaApp app = new MdgaApp(); MdgaApp app = new MdgaApp();
@@ -91,7 +91,7 @@ public void simpleInitApp() {
gameView = new GameView(this); gameView = new GameView(this);
ceremonyView = new CeremonyView(this); ceremonyView = new CeremonyView(this);
enter(MdgaState.MAIN); enter(MdgaState.LOBBY);
} }
/** /**
@@ -174,7 +174,7 @@ public MdgaState getState() {
* @return the image scale as a float * @return the image scale as a float
*/ */
public float getImageScale() { public float getImageScale() {
return imageScale; return IMAGE_SCALE;
} }
/** /**

View File

@@ -64,8 +64,9 @@ private void handleLobby(Notification notification) {
lobbyView.setTaken(n.getColor(), false, false, null); lobbyView.setTaken(n.getColor(), false, false, null);
//} else if(notification instanceof LobbyReadyNotification lobbyReadyNotification) { //} else if(notification instanceof LobbyReadyNotification lobbyReadyNotification) {
//lobbyView.setReady(lobbyReadyNotification.getColor(), lobbyReadyNotification.isReady()): //lobbyView.setReady(lobbyReadyNotification.getColor(), lobbyReadyNotification.isReady()):
} else if (notification instanceof GameNotification) { } else if (notification instanceof GameNotification n) {
app.enter(MdgaState.GAME); app.enter(MdgaState.GAME);
((GameView) app.getView()).setOwnColor(n.getOwnColor());
} else { } else {
throw new RuntimeException("notification not expected: " + notification.toString()); throw new RuntimeException("notification not expected: " + notification.toString());
} }

View File

@@ -30,7 +30,7 @@ public class BoardHandler {
private Map<Color, List<PieceControl>> waitingPiecesMap; private Map<Color, List<PieceControl>> waitingPiecesMap;
private Map<UUID, Color> pieceColor; private Map<UUID, Color> pieceColor;
private Node node = new Node(); private Node rootNodeBoard;
private final Node rootNode; private final Node rootNode;
private final FilterPostProcessor fpp; private final FilterPostProcessor fpp;
@@ -49,6 +49,7 @@ public BoardHandler(MdgaApp app, Node rootNode, FilterPostProcessor fpp) {
this.app = app; this.app = app;
this.fpp = fpp; this.fpp = fpp;
rootNodeBoard = new Node("Board Root Node");
this.rootNode = rootNode; this.rootNode = rootNode;
isInitialised = false; isInitialised = false;
} }
@@ -61,14 +62,14 @@ public void init() {
selectedOwnPiece = null; selectedOwnPiece = null;
selectedEnemyPiece = null; selectedEnemyPiece = null;
initMap(); initMap();
rootNode.attachChild(node); rootNode.attachChild(rootNodeBoard);
} }
public void shutdown(){ public void shutdown(){
clearSelectable(); clearSelectable();
isInitialised = false; isInitialised = false;
initMap(); initMap();
rootNode.detachChild(node); rootNode.detachChild(rootNodeBoard);
} }
private void addFigureToPlayerMap(Color col, AssetOnMap assetOnMap) { private void addFigureToPlayerMap(Color col, AssetOnMap assetOnMap) {
@@ -132,7 +133,7 @@ private Spatial createModel(Asset asset, Vector3f pos, float rot) {
Material mat = new Material(app.getAssetManager(), "Common/MatDefs/Light/Lighting.j3md"); Material mat = new Material(app.getAssetManager(), "Common/MatDefs/Light/Lighting.j3md");
mat.setTexture("DiffuseMap", app.getAssetManager().loadTexture(texName)); mat.setTexture("DiffuseMap", app.getAssetManager().loadTexture(texName));
model.setMaterial(mat); model.setMaterial(mat);
node.attachChild(model); rootNodeBoard.attachChild(model);
return model; return model;
} }
@@ -468,7 +469,7 @@ public void enableHover(UUID uuid){
} }
public void showDice(Color color){ public void showDice(Color color){
node.attachChild(diceControl.getSpatial()); rootNodeBoard.attachChild(diceControl.getSpatial());
diceControl.setPos(getWaitingPos(color).add(new Vector3f(0,0,4))); diceControl.setPos(getWaitingPos(color).add(new Vector3f(0,0,4)));
diceControl.spin(); diceControl.spin();
} }

View File

@@ -45,12 +45,11 @@ public CameraHandler(MdgaApp app, FilterPostProcessor fpp) {
ambient = new AmbientLight(); ambient = new AmbientLight();
ambient.setColor(new ColorRGBA(0.3f, 0.3f, 0.3f, 1)); ambient.setColor(new ColorRGBA(0.3f, 0.3f, 0.3f, 1));
dlsf = new DirectionalLightShadowFilter(app.getAssetManager(), SHADOWMAP_SIZE, 4); dlsf = new DirectionalLightShadowFilter(app.getAssetManager(), SHADOWMAP_SIZE, 1);
dlsf.setLight(sun); dlsf.setLight(sun);
dlsf.setEnabled(true); dlsf.setEnabled(true);
dlsf.setEdgeFilteringMode(EdgeFilteringMode.PCFPOISSON); dlsf.setEdgeFilteringMode(EdgeFilteringMode.PCFPOISSON);
dlsf.setShadowIntensity(0.7f); dlsf.setShadowIntensity(0.7f);
fpp.addFilter(dlsf);
sky = SkyFactory.createSky(app.getAssetManager(), "Images/sky/sky.dds", EnvMapType.EquirectMap).rotate(FastMath.HALF_PI*1,0,FastMath.HALF_PI*0.2f); sky = SkyFactory.createSky(app.getAssetManager(), "Images/sky/sky.dds", EnvMapType.EquirectMap).rotate(FastMath.HALF_PI*1,0,FastMath.HALF_PI*0.2f);

View File

@@ -110,6 +110,7 @@ public CeremonyButton(MdgaApp app, Node node, Node node3d, Color tsk, Pos pos, S
instance.setText("Marine"); instance.setText("Marine");
yield Asset.marine; yield Asset.marine;
} }
default -> throw new RuntimeException("None is not valid");
}; };
switch (pos) { switch (pos) {

View File

@@ -117,6 +117,7 @@ private ColorRGBA playerColorToColorRGBA(Color color){
case NAVY -> ColorRGBA.Blue; case NAVY -> ColorRGBA.Blue;
case CYBER -> ColorRGBA.Orange; case CYBER -> ColorRGBA.Orange;
case AIRFORCE -> ColorRGBA.Black; case AIRFORCE -> ColorRGBA.Black;
default -> throw new RuntimeException("None is not valid");
}; };
} }

View File

@@ -78,6 +78,7 @@ private String imagePath(Color color){
case NAVY -> root+"MARINE_IMAGE.png"; case NAVY -> root+"MARINE_IMAGE.png";
case CYBER -> root+"CIR_IMAGE.png"; case CYBER -> root+"CIR_IMAGE.png";
case AIRFORCE -> root+"LW_IMAGE.png"; case AIRFORCE -> root+"LW_IMAGE.png";
default -> throw new RuntimeException("None is not valid");
}; };
} }

View File

@@ -10,6 +10,12 @@
import pp.mdga.client.button.ButtonRight; import pp.mdga.client.button.ButtonRight;
import pp.mdga.client.gui.GuiHandler; import pp.mdga.client.gui.GuiHandler;
import pp.mdga.game.Color; import pp.mdga.game.Color;
import pp.mdga.notification.GameNotification;
import pp.mdga.notification.PlayerInGameNotification;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
public class GameView extends MdgaView { public class GameView extends MdgaView {
private BoardHandler boardHandler; private BoardHandler boardHandler;
@@ -49,6 +55,7 @@ public void onEnter() {
app.getViewPort().addProcessor(fpp); app.getViewPort().addProcessor(fpp);
app.getAcousticHandler().playSound(MdgaSound.START); app.getAcousticHandler().playSound(MdgaSound.START);
} }
@Override @Override

View File

@@ -18,6 +18,7 @@
import pp.mdga.client.button.LobbyButton; import pp.mdga.client.button.LobbyButton;
import pp.mdga.client.button.SettingsButton; import pp.mdga.client.button.SettingsButton;
import pp.mdga.game.Color; import pp.mdga.game.Color;
import pp.mdga.notification.GameNotification;
public class LobbyView extends MdgaView { public class LobbyView extends MdgaView {
private Geometry background; private Geometry background;
@@ -186,6 +187,7 @@ public void setReady(Color color, boolean isReady) {
case AIRFORCE -> airforceButton; case AIRFORCE -> airforceButton;
case ARMY -> armyButton; case ARMY -> armyButton;
case NAVY -> navyButton; case NAVY -> navyButton;
default -> throw new RuntimeException("None is not valid");
}; };
button.setReady(isReady); button.setReady(isReady);

View File

@@ -20,9 +20,9 @@ public enum Overlay {
} }
protected MdgaApp app; protected MdgaApp app;
protected Node rootNode = new Node(); protected Node rootNode = new Node("View Root");
protected Node guiNode = new Node(); protected Node guiNode = new Node("View Root GUI");
protected Node overlayNode = new Node(); protected Node overlayNode = new Node("View Root Overlay");
private SettingsButton settingsButton; private SettingsButton settingsButton;

View File

@@ -1,12 +1,22 @@
package pp.mdga.notification; package pp.mdga.notification;
import pp.mdga.game.Color;
/** /**
* GameNotification class * GameNotification class
*/ */
public class GameNotification extends Notification{ public class GameNotification extends Notification{
private final Color ownColor;
/** /**
* Constructor * Constructor
*/ */
public GameNotification() { public GameNotification(Color ownColor) {
this.ownColor = ownColor;
}
public Color getOwnColor() {
return ownColor;
} }
} }