Add user setting for fullscreen
This commit is contained in:
parent
2049692634
commit
d5af9b1ad4
@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
"displayWidth" : 1920,
|
"displayWidth" : 1920,
|
||||||
"displayHeight" : 1080,
|
"displayHeight" : 1080,
|
||||||
|
"displayFullscreen" : false,
|
||||||
|
|
||||||
"graphicsFOV" : 100.0,
|
"graphicsFOV" : 100.0,
|
||||||
|
|
||||||
|
|||||||
@ -1,43 +1,32 @@
|
|||||||
package electrosphere.engine;
|
package electrosphere.engine;
|
||||||
|
|
||||||
|
import java.util.concurrent.Semaphore;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
import org.joml.Quaternionf;
|
||||||
|
import org.joml.Vector2i;
|
||||||
|
import org.joml.Vector3d;
|
||||||
|
import org.joml.Vector3f;
|
||||||
|
|
||||||
import electrosphere.auth.AuthenticationManager;
|
import electrosphere.auth.AuthenticationManager;
|
||||||
import electrosphere.collision.dispatch.CollisionObject;
|
|
||||||
import electrosphere.controls.ControlHandler;
|
import electrosphere.controls.ControlHandler;
|
||||||
import electrosphere.entity.Entity;
|
import electrosphere.entity.Entity;
|
||||||
import electrosphere.entity.EntityDataStrings;
|
|
||||||
import electrosphere.entity.EntityUtils;
|
import electrosphere.entity.EntityUtils;
|
||||||
import electrosphere.entity.state.BehaviorTree;
|
|
||||||
import electrosphere.entity.state.collidable.Impulse;
|
|
||||||
import electrosphere.entity.state.movement.ApplyRotationTree;
|
import electrosphere.entity.state.movement.ApplyRotationTree;
|
||||||
import electrosphere.game.collision.CollisionEngine;
|
import electrosphere.entity.types.camera.CameraEntityUtils;
|
||||||
import electrosphere.entity.types.creature.CreatureUtils;
|
|
||||||
import electrosphere.entity.types.debug.DebugVisualizerUtils;
|
|
||||||
import electrosphere.entity.types.item.ItemUtils;
|
import electrosphere.entity.types.item.ItemUtils;
|
||||||
import electrosphere.entity.types.object.ObjectUtils;
|
import electrosphere.entity.types.object.ObjectUtils;
|
||||||
import electrosphere.game.client.cells.DrawCellManager;
|
import electrosphere.game.client.cells.DrawCellManager;
|
||||||
import electrosphere.game.client.player.ClientPlayerData;
|
import electrosphere.game.client.targeting.crosshair.Crosshair;
|
||||||
import electrosphere.game.client.terrain.manager.ClientTerrainManager;
|
import electrosphere.game.client.terrain.manager.ClientTerrainManager;
|
||||||
import electrosphere.game.client.world.ClientWorldData;
|
|
||||||
import electrosphere.game.collision.CommonWorldData;
|
import electrosphere.game.collision.CommonWorldData;
|
||||||
import electrosphere.game.simulation.MacroSimulation;
|
import electrosphere.game.server.datacell.DataCellManager;
|
||||||
import electrosphere.game.server.terrain.manager.ServerTerrainManager;
|
|
||||||
import electrosphere.game.server.world.ServerWorldData;
|
|
||||||
import electrosphere.entity.types.attach.AttachUtils;
|
|
||||||
import electrosphere.entity.types.camera.CameraEntityUtils;
|
|
||||||
import electrosphere.entity.types.particle.ParticleUtils;
|
|
||||||
import electrosphere.entity.types.collision.CollisionObjUtils;
|
|
||||||
import electrosphere.entity.types.foliage.FoliageUtils;
|
|
||||||
import electrosphere.entity.types.structure.StructureUtils;
|
|
||||||
import electrosphere.game.collision.PhysicsUtils;
|
|
||||||
import electrosphere.game.collision.collidable.Collidable;
|
|
||||||
import electrosphere.game.server.ai.creature.MindlessAttacker;
|
|
||||||
import electrosphere.game.server.effects.ParticleEffects;
|
|
||||||
import electrosphere.game.server.saves.SaveUtils;
|
import electrosphere.game.server.saves.SaveUtils;
|
||||||
import electrosphere.game.server.terrain.models.TerrainModification;
|
import electrosphere.game.server.terrain.manager.ServerTerrainManager;
|
||||||
import electrosphere.game.server.town.Town;
|
import electrosphere.game.server.town.Town;
|
||||||
import electrosphere.game.server.world.MacroData;
|
import electrosphere.game.server.world.MacroData;
|
||||||
import electrosphere.game.server.datacell.DataCellManager;
|
import electrosphere.game.server.world.ServerWorldData;
|
||||||
import electrosphere.game.server.db.DatabaseUtils;
|
import electrosphere.game.simulation.MacroSimulation;
|
||||||
import electrosphere.game.simulation.MicroSimulation;
|
import electrosphere.game.simulation.MicroSimulation;
|
||||||
import electrosphere.logger.LoggerInterface;
|
import electrosphere.logger.LoggerInterface;
|
||||||
import electrosphere.main.Globals;
|
import electrosphere.main.Globals;
|
||||||
@ -48,42 +37,8 @@ import electrosphere.menu.WindowUtils;
|
|||||||
import electrosphere.net.NetUtils;
|
import electrosphere.net.NetUtils;
|
||||||
import electrosphere.net.client.ClientNetworking;
|
import electrosphere.net.client.ClientNetworking;
|
||||||
import electrosphere.net.server.Server;
|
import electrosphere.net.server.Server;
|
||||||
import electrosphere.renderer.Mesh;
|
|
||||||
import electrosphere.renderer.Model;
|
|
||||||
import electrosphere.renderer.ModelUtils;
|
|
||||||
import electrosphere.renderer.RenderUtils;
|
|
||||||
import electrosphere.renderer.RenderingEngine;
|
|
||||||
import electrosphere.renderer.actor.Actor;
|
|
||||||
import electrosphere.renderer.actor.ActorTextureMask;
|
|
||||||
import electrosphere.renderer.actor.ActorUtils;
|
|
||||||
import electrosphere.renderer.texture.Texture;
|
|
||||||
import electrosphere.engine.assetmanager.AssetDataStrings;
|
|
||||||
import electrosphere.game.client.targeting.crosshair.Crosshair;
|
|
||||||
import electrosphere.game.server.ai.creature.OpportunisticAttacker;
|
|
||||||
import electrosphere.game.server.pathfinding.NavMeshPathfinder;
|
|
||||||
import electrosphere.game.server.pathfinding.navmesh.NavCube;
|
|
||||||
import electrosphere.game.server.pathfinding.navmesh.NavMesh;
|
|
||||||
import electrosphere.game.server.unit.UnitUtils;
|
|
||||||
import electrosphere.renderer.ui.DrawableElement;
|
|
||||||
import electrosphere.renderer.ui.WidgetUtils;
|
|
||||||
import electrosphere.renderer.ui.Window;
|
import electrosphere.renderer.ui.Window;
|
||||||
import electrosphere.util.FileUtils;
|
import electrosphere.util.FileUtils;
|
||||||
import electrosphere.util.Utilities;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.nio.file.Files;
|
|
||||||
import java.util.LinkedList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Random;
|
|
||||||
import java.util.concurrent.Semaphore;
|
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
import java.util.logging.Level;
|
|
||||||
import java.util.logging.Logger;
|
|
||||||
import org.joml.Quaternionf;
|
|
||||||
import org.joml.Vector2i;
|
|
||||||
import org.joml.Vector3d;
|
|
||||||
import org.joml.Vector3f;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -190,7 +145,7 @@ public class LoadingThread extends Thread {
|
|||||||
//init data cell manager
|
//init data cell manager
|
||||||
initDataCellManager();
|
initDataCellManager();
|
||||||
//for testing purposes
|
//for testing purposes
|
||||||
FileUtils.recursivelyDelete("/home/satellite/temp/saves/arena");
|
FileUtils.recursivelyDelete("/Users/satellite/temp/saves/arena");
|
||||||
//init database connection
|
//init database connection
|
||||||
SaveUtils.initSave("arena");
|
SaveUtils.initSave("arena");
|
||||||
//connect to database
|
//connect to database
|
||||||
|
|||||||
@ -23,6 +23,7 @@ public class UserSettings {
|
|||||||
//
|
//
|
||||||
int displayWidth;
|
int displayWidth;
|
||||||
int displayHeight;
|
int displayHeight;
|
||||||
|
boolean displayFullscreen;
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -100,6 +101,10 @@ public class UserSettings {
|
|||||||
public boolean graphicsDebugDrawNavmesh() {
|
public boolean graphicsDebugDrawNavmesh() {
|
||||||
return graphicsDebugDrawNavmesh;
|
return graphicsDebugDrawNavmesh;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean displayFullscreen(){
|
||||||
|
return displayFullscreen;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public void setGraphicsDebugDrawCollisionSpheres(boolean draw){
|
public void setGraphicsDebugDrawCollisionSpheres(boolean draw){
|
||||||
@ -121,6 +126,10 @@ public class UserSettings {
|
|||||||
public void setGraphicsViewRange(float range){
|
public void setGraphicsViewRange(float range){
|
||||||
graphicsViewRange = range;
|
graphicsViewRange = range;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setDisplayFullscreen(boolean fullscreen){
|
||||||
|
this.displayFullscreen = fullscreen;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -138,6 +147,7 @@ public class UserSettings {
|
|||||||
//display settings
|
//display settings
|
||||||
rVal.displayHeight = 1080;
|
rVal.displayHeight = 1080;
|
||||||
rVal.displayWidth = 1920;
|
rVal.displayWidth = 1920;
|
||||||
|
rVal.displayFullscreen = true;
|
||||||
|
|
||||||
//gameplay settings
|
//gameplay settings
|
||||||
rVal.gameplayGenerateWorld = true;
|
rVal.gameplayGenerateWorld = true;
|
||||||
|
|||||||
@ -1,14 +1,14 @@
|
|||||||
package electrosphere.game.server.saves;
|
package electrosphere.game.server.saves;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import electrosphere.game.server.datacell.DataCellManager;
|
||||||
import electrosphere.game.server.db.DatabaseUtils;
|
import electrosphere.game.server.db.DatabaseUtils;
|
||||||
import electrosphere.game.server.terrain.manager.ServerTerrainManager;
|
import electrosphere.game.server.terrain.manager.ServerTerrainManager;
|
||||||
import electrosphere.game.server.world.ServerWorldData;
|
import electrosphere.game.server.world.ServerWorldData;
|
||||||
import electrosphere.logger.LoggerInterface;
|
import electrosphere.logger.LoggerInterface;
|
||||||
import electrosphere.game.server.datacell.DataCellManager;
|
|
||||||
import electrosphere.main.Globals;
|
import electrosphere.main.Globals;
|
||||||
import electrosphere.util.FileUtils;
|
import electrosphere.util.FileUtils;
|
||||||
import java.util.LinkedList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -17,7 +17,7 @@ import java.util.List;
|
|||||||
public class SaveUtils {
|
public class SaveUtils {
|
||||||
|
|
||||||
static String deriveSaveDirectoryPath(String saveName){
|
static String deriveSaveDirectoryPath(String saveName){
|
||||||
String path = "/home/satellite/temp/saves/" + saveName;
|
String path = "/Users/satellite/temp/saves/" + saveName;
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -219,10 +219,13 @@ public class RenderingEngine {
|
|||||||
// glfwWindowHint(GLFW_TRANSPARENT_FRAMEBUFFER, GLFW_TRUE); Allows you to make the background transparent
|
// glfwWindowHint(GLFW_TRANSPARENT_FRAMEBUFFER, GLFW_TRUE); Allows you to make the background transparent
|
||||||
// glfwWindowHint(GLFW_OPACITY, 23);
|
// glfwWindowHint(GLFW_OPACITY, 23);
|
||||||
//Creates the window reference object
|
//Creates the window reference object
|
||||||
// Globals.window = glfwCreateWindow(Globals.WINDOW_WIDTH, Globals.WINDOW_HEIGHT, "ORPG", NULL, NULL);
|
if(Globals.userSettings.displayFullscreen()){
|
||||||
//below line is for fullscreen
|
//below line is for fullscreen
|
||||||
Globals.window = glfwCreateWindow(Globals.WINDOW_WIDTH, Globals.WINDOW_HEIGHT, "ORPG", glfwGetPrimaryMonitor(), NULL);
|
Globals.window = glfwCreateWindow(Globals.WINDOW_WIDTH, Globals.WINDOW_HEIGHT, "ORPG", glfwGetPrimaryMonitor(), NULL);
|
||||||
//Errors for failure to create window (IE: No GUI mode on linux ?)
|
} else {
|
||||||
|
Globals.window = glfwCreateWindow(Globals.WINDOW_WIDTH, Globals.WINDOW_HEIGHT, "ORPG", NULL, NULL);
|
||||||
|
}
|
||||||
|
// Errors for failure to create window (IE: No GUI mode on linux ?)
|
||||||
if (Globals.window == NULL) {
|
if (Globals.window == NULL) {
|
||||||
LoggerInterface.loggerEngine.ERROR("Failed to make window.", new Exception("Renderer Creation Failure"));
|
LoggerInterface.loggerEngine.ERROR("Failed to make window.", new Exception("Renderer Creation Failure"));
|
||||||
glfwTerminate();
|
glfwTerminate();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user