diff --git a/.gitignore b/.gitignore deleted file mode 100644 index ca280e0..0000000 --- a/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/.nb-gradle/ -/core/build/ -/desktop/build/ \ No newline at end of file diff --git a/.gradle/2.14.1/taskArtifacts/cache.properties b/.gradle/2.14.1/taskArtifacts/cache.properties deleted file mode 100644 index 3419220..0000000 --- a/.gradle/2.14.1/taskArtifacts/cache.properties +++ /dev/null @@ -1 +0,0 @@ -#Tue Oct 17 00:48:27 CEST 2017 diff --git a/.gradle/2.14.1/taskArtifacts/cache.properties.lock b/.gradle/2.14.1/taskArtifacts/cache.properties.lock deleted file mode 100644 index b38f1b8..0000000 Binary files a/.gradle/2.14.1/taskArtifacts/cache.properties.lock and /dev/null differ diff --git a/.gradle/2.14.1/taskArtifacts/fileHashes.bin b/.gradle/2.14.1/taskArtifacts/fileHashes.bin deleted file mode 100644 index 41fd3a1..0000000 Binary files a/.gradle/2.14.1/taskArtifacts/fileHashes.bin and /dev/null differ diff --git a/.gradle/2.14.1/taskArtifacts/fileSnapshots.bin b/.gradle/2.14.1/taskArtifacts/fileSnapshots.bin deleted file mode 100644 index 664bc8c..0000000 Binary files a/.gradle/2.14.1/taskArtifacts/fileSnapshots.bin and /dev/null differ diff --git a/.gradle/2.14.1/taskArtifacts/fileSnapshotsToTreeSnapshotsIndex.bin b/.gradle/2.14.1/taskArtifacts/fileSnapshotsToTreeSnapshotsIndex.bin deleted file mode 100644 index 3cda9f8..0000000 Binary files a/.gradle/2.14.1/taskArtifacts/fileSnapshotsToTreeSnapshotsIndex.bin and /dev/null differ diff --git a/.gradle/2.14.1/taskArtifacts/taskArtifacts.bin b/.gradle/2.14.1/taskArtifacts/taskArtifacts.bin deleted file mode 100644 index 2a66cd2..0000000 Binary files a/.gradle/2.14.1/taskArtifacts/taskArtifacts.bin and /dev/null differ diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..9dfdc2f --- /dev/null +++ b/Makefile @@ -0,0 +1,34 @@ +CC = g++ +CFLAGS = -Wall +EXE = DarkRP2D +LIB_PATH = +INC_PATH = +LIBS = + +SRCDIR = src +BUILDDIR = build +SRC = $(shell C:\\MinGW\\msys\\1.0\\bin\\find $(SRCDIR) -name *.cpp) +OBJ = $(patsubst %.cpp, %.o, $(SRC)) +OBJ := $(subst $(SRCDIR), $(BUILDDIR), $(OBJ)) + +.PHONY: all clean build run debug + +all: build $(EXE) + +run: all + $(BUILDDIR)/$(EXE) + +$(EXE): $(OBJ) + $(CC) $(CFLAGS) -o $(BUILDDIR)/$@ $(OBJ) -static-libgcc -static-libstdc++ + +$(OBJ): $(SRC) + $(CC) $(CFLAGS) -c $< -o $@ + +build: + C:\\MinGW\\msys\\1.0\\bin\\mkdir -p $(BUILDDIR) + +clean: + rm -rf $(BUILDDIR) + +debug: + @echo $(OBJ) diff --git a/core/assets/Kaktus 1.png b/assets/Kaktus 1.png similarity index 100% rename from core/assets/Kaktus 1.png rename to assets/Kaktus 1.png diff --git a/core/assets/Kaktus 2.png b/assets/Kaktus 2.png similarity index 100% rename from core/assets/Kaktus 2.png rename to assets/Kaktus 2.png diff --git a/core/assets/Rock.png b/assets/Rock.png similarity index 100% rename from core/assets/Rock.png rename to assets/Rock.png diff --git a/core/assets/barrel.png b/assets/barrel.png similarity index 100% rename from core/assets/barrel.png rename to assets/barrel.png diff --git a/core/assets/bush.png b/assets/bush.png similarity index 100% rename from core/assets/bush.png rename to assets/bush.png diff --git a/core/assets/bush2.png b/assets/bush2.png similarity index 100% rename from core/assets/bush2.png rename to assets/bush2.png diff --git a/core/assets/desert-001.png b/assets/desert-001.png similarity index 100% rename from core/assets/desert-001.png rename to assets/desert-001.png diff --git a/core/assets/logo.png b/assets/logo.png similarity index 100% rename from core/assets/logo.png rename to assets/logo.png diff --git a/core/assets/police_officer.png b/assets/police_officer.png similarity index 100% rename from core/assets/police_officer.png rename to assets/police_officer.png diff --git a/core/assets/tree.png b/assets/tree.png similarity index 100% rename from core/assets/tree.png rename to assets/tree.png diff --git a/build.gradle b/build.gradle deleted file mode 100755 index ab37f66..0000000 --- a/build.gradle +++ /dev/null @@ -1,70 +0,0 @@ -buildscript { - - - repositories { - mavenLocal() - mavenCentral() - maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } - jcenter() - } - dependencies { - - - } -} - -allprojects { - apply plugin: "eclipse" - apply plugin: "idea" - - version = '1.0' - ext { - appName = "DarkRP2D" - gdxVersion = '1.9.6' - roboVMVersion = '2.3.1' - box2DLightsVersion = '1.4' - ashleyVersion = '1.7.0' - aiVersion = '1.8.0' - } - - repositories { - mavenLocal() - mavenCentral() - maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } - maven { url "https://oss.sonatype.org/content/repositories/releases/" } - } -} - -project(":desktop") { - apply plugin: "java" - - - dependencies { - compile project(":core") - compile "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion" - compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop" - compile "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-desktop" - compile "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-desktop" - - } -} - -project(":core") { - apply plugin: "java" - - - dependencies { - compile "com.badlogicgames.gdx:gdx:$gdxVersion:sources" - compile "com.badlogicgames.gdx:gdx:$gdxVersion" - compile "com.badlogicgames.gdx:gdx-box2d:$gdxVersion" - compile "com.badlogicgames.gdx:gdx-freetype:$gdxVersion" - compile "com.badlogicgames.box2dlights:box2dlights:$box2DLightsVersion" - compile "com.badlogicgames.ashley:ashley:$ashleyVersion" - compile "com.badlogicgames.gdx:gdx-ai:$aiVersion" - - } -} - -tasks.eclipse.doLast { - delete ".project" -} \ No newline at end of file diff --git a/build/DarkRP2D.exe b/build/DarkRP2D.exe new file mode 100644 index 0000000..25b2eff Binary files /dev/null and b/build/DarkRP2D.exe differ diff --git a/build/main.o b/build/main.o new file mode 100644 index 0000000..75cc952 Binary files /dev/null and b/build/main.o differ diff --git a/core/assets/badlogic.jpg b/core/assets/badlogic.jpg deleted file mode 100755 index 4390da6..0000000 Binary files a/core/assets/badlogic.jpg and /dev/null differ diff --git a/core/build.gradle b/core/build.gradle deleted file mode 100755 index 03cd1be..0000000 --- a/core/build.gradle +++ /dev/null @@ -1,11 +0,0 @@ -apply plugin: "java" - -sourceCompatibility = 1.6 -[compileJava, compileTestJava]*.options*.encoding = 'UTF-8' - -sourceSets.main.java.srcDirs = [ "src/" ] - - -eclipse.project { - name = appName + "-core" -} diff --git a/core/src/com/darkrp2d/DarkRP2D.java b/core/src/com/darkrp2d/DarkRP2D.java deleted file mode 100755 index 09402ab..0000000 --- a/core/src/com/darkrp2d/DarkRP2D.java +++ /dev/null @@ -1,135 +0,0 @@ -package com.darkrp2d; - -import com.darkrp2d.entitySystems.RenderSystem; -import com.badlogic.ashley.core.Engine; -import com.badlogic.ashley.core.Family; - -import com.badlogic.gdx.Game; -import com.badlogic.gdx.Gdx; -import com.badlogic.gdx.graphics.GL20; -import com.badlogic.gdx.graphics.OrthographicCamera; -import com.badlogic.gdx.graphics.g2d.BitmapFont; -import com.badlogic.gdx.graphics.g2d.GlyphLayout; -import com.badlogic.gdx.graphics.g2d.SpriteBatch; - -import com.badlogic.gdx.math.Vector2; -import com.badlogic.gdx.math.Matrix4; -import com.badlogic.gdx.physics.box2d.Box2DDebugRenderer; -import com.badlogic.gdx.physics.box2d.World; -import com.badlogic.gdx.utils.TimeUtils; - -import com.darkrp2d.entities.components.TextureComponent; -import com.darkrp2d.entities.entityListeners.DisposeListener; -import com.darkrp2d.entitySystems.MovementSystem; -import com.darkrp2d.input.CommandStream; -import com.darkrp2d.input.InputHandler; -import com.darkrp2d.input.commands.Command; -import com.darkrp2d.physics.Box2DUtils; - - -public class DarkRP2D extends Game { - - public BitmapFont font; - public SpriteBatch batch; - public Engine engine; - public World world; - - private OrthographicCamera camera; - private Box2DDebugRenderer b2dbr; - private Matrix4 debugMatrix; - - @Override - public void create () { - font = new BitmapFont(); - batch = new SpriteBatch(); - world = new World(new Vector2(0.f,0.f),true); - engine = new Engine(); - engine.addSystem(new RenderSystem(MS_PER_UPDATE)); - engine.addSystem(new MovementSystem()); - engine.addEntityListener(Family.all(TextureComponent.class).get(), 0, new DisposeListener()); - camera = new OrthographicCamera(); - camera.setToOrtho(false, Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); - b2dbr = new Box2DDebugRenderer(); - - //must be before input registration or no controllable Entity found - engine.addEntity(com.darkrp2d.entities.Character.create(this)); - //Sets inputs - Gdx.input.setInputProcessor(new InputHandler(this)); - } - - //GameLoop and debug - private float accumulator = 0; - private float skippedFrames = 0; - private static final int UPDATES_PER_SECOND = 60; - private static final float MS_PER_UPDATE = 1f / UPDATES_PER_SECOND; - private static final int MAX_FRAMESKIP = 5; // Make 5 updates mostly without a render - - @Override - // GameLoop - public void render () { - accumulator += Gdx.graphics.getRawDeltaTime(); //Seconds to milliseconds - - //Process Input - Command currentCommand = CommandStream.pollCommand(); - if(currentCommand != null) { - currentCommand.execute(); - } - - skippedFrames = 0; - - //Update Stuff - while(accumulator >= MS_PER_UPDATE && skippedFrames <= MAX_FRAMESKIP) { - accumulator -= MS_PER_UPDATE; - update(MS_PER_UPDATE); - skippedFrames++; - } - - trueRender(accumulator / MS_PER_UPDATE); - } - - public void update(float deltaTime) { - world.step(deltaTime, 6, 2); - engine.update(deltaTime); - } - - public void trueRender(float delta) { - Gdx.gl.glClearColor(0.f, 0.f, 0.f, 1.f); - Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); - - //Render current Screen - super.render(); - - //Debug - camera.update(); - batch.setProjectionMatrix(camera.combined); - // Scale down the sprite batches projection matrix to box2D size - debugMatrix = batch.getProjectionMatrix().cpy().scale(Box2DUtils.PIXEL_PER_METER, - Box2DUtils.PIXEL_PER_METER, 0); - b2dbr.render(world, debugMatrix); - - //TODO: will be later moved to Gamescreen - engine.getSystem(RenderSystem.class).render(delta, batch); - - //some testdrawing - batch.begin(); - GlyphLayout layout = new GlyphLayout(font, "Hello World"); - font.draw(batch, layout, Gdx.graphics.getWidth()/2-layout.width/2, Gdx.graphics.getHeight()/2-layout.height/2); - batch.end(); - } - - @Override - public void resize (int width, int height) { - //camera.setToOrtho(false, width, height); - } - - @Override - public void dispose () { - b2dbr.dispose(); - engine.removeAllEntities(); - font.dispose(); - batch.dispose(); - world.dispose(); - } - - -} diff --git a/core/src/com/darkrp2d/IDEAS.java b/core/src/com/darkrp2d/IDEAS.java deleted file mode 100644 index 44d9a89..0000000 --- a/core/src/com/darkrp2d/IDEAS.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package com.darkrp2d; - -/** - * - * @author gulum - */ -public class IDEAS { - - /* - * - Stadt info button - * -> Population - * ( Freischaltung von Berufen je nach Einwohnerzahl z.B. Feuerwehr - * ab 15 Einwohner, dann können auch erst Feuer ausbrechen. ) - * - * - * - * - Jobs - * - Gang? Drug Dealer? - * - Ganzes haus voller Marihuana Pflanzen (Leute abhängig (rimworld) oder irgendwelche boosts) - */ - - /* - * TODO ORDER: - * Add character from laptop - * box2D Character/camera movement - * Add World - * Add Charakter - * Add Cars - */ - -} diff --git a/core/src/com/darkrp2d/entities/Character.java b/core/src/com/darkrp2d/entities/Character.java deleted file mode 100644 index bfa27b1..0000000 --- a/core/src/com/darkrp2d/entities/Character.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package com.darkrp2d.entities; - -import com.badlogic.ashley.core.Entity; -import com.badlogic.gdx.Gdx; -import com.badlogic.gdx.graphics.Texture; -import com.badlogic.gdx.physics.box2d.BodyDef; -import com.badlogic.gdx.physics.box2d.FixtureDef; -import com.badlogic.gdx.physics.box2d.PolygonShape; -import com.darkrp2d.DarkRP2D; -import com.darkrp2d.entities.components.ControllableComponent; -import com.darkrp2d.entities.components.PhysicComponent; -import com.darkrp2d.entities.components.TextureComponent; -import com.darkrp2d.physics.Box2DUtils; - -/** - * - * @author Julian - */ -public class Character { - - //Singletone - private static Entity character; - public static Entity create(DarkRP2D game) { - if(character == null) { - float movementSpeed = 10.f; - character = new Entity(); - BodyDef bodyDef = new BodyDef(); - bodyDef.type = BodyDef.BodyType.DynamicBody; - bodyDef.position.set(0 , 0); - - PolygonShape shape = new PolygonShape(); - shape.setAsBox(Box2DUtils.screenToWorld(32.f), Box2DUtils.screenToWorld(32.f)); - - FixtureDef fixtureDef = new FixtureDef(); - fixtureDef.shape = shape; - fixtureDef.density = 1f; - - character.add(new PhysicComponent(game,bodyDef, fixtureDef)); - shape.dispose(); - character.add(new TextureComponent(new Texture(Gdx.files.internal("police_officer.png")))); - character.add(new ControllableComponent(movementSpeed)); - } - return character; - } - -} diff --git a/core/src/com/darkrp2d/entities/components/ControllableComponent.java b/core/src/com/darkrp2d/entities/components/ControllableComponent.java deleted file mode 100644 index 6a4ecaa..0000000 --- a/core/src/com/darkrp2d/entities/components/ControllableComponent.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package com.darkrp2d.entities.components; - -import com.badlogic.ashley.core.Component; - -/** - * - * @author Julian - */ -public class ControllableComponent implements Component { - - public boolean up = false; - public boolean down = false; - public boolean right = false; - public boolean left = false; - - public float speed; - - public ControllableComponent(float speed) { - this.speed = speed; - } -} diff --git a/core/src/com/darkrp2d/entities/components/Mappers.java b/core/src/com/darkrp2d/entities/components/Mappers.java deleted file mode 100644 index 027cf46..0000000 --- a/core/src/com/darkrp2d/entities/components/Mappers.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package com.darkrp2d.entities.components; - -import com.badlogic.ashley.core.ComponentMapper; - -/** - * - * @author Julian - */ -public class Mappers { - - public static final ComponentMapper physicComponentMapper = ComponentMapper.getFor(PhysicComponent.class); - public static final ComponentMapper textureComponentMapper = ComponentMapper.getFor(TextureComponent.class); - public static final ComponentMapper controllableComponentMapper = ComponentMapper.getFor(ControllableComponent.class); - -} diff --git a/core/src/com/darkrp2d/entities/components/PhysicComponent.java b/core/src/com/darkrp2d/entities/components/PhysicComponent.java deleted file mode 100644 index 2b1ffb6..0000000 --- a/core/src/com/darkrp2d/entities/components/PhysicComponent.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package com.darkrp2d.entities.components; - -import com.badlogic.ashley.core.Component; -import com.badlogic.gdx.physics.box2d.Body; -import com.badlogic.gdx.physics.box2d.BodyDef; -import com.badlogic.gdx.physics.box2d.FixtureDef; -import com.darkrp2d.DarkRP2D; - -/** - * - * @author Julian - */ -public class PhysicComponent implements Component { - public BodyDef bodyDef; - public FixtureDef fixtureDef; - public Body body; - - public PhysicComponent(DarkRP2D game, BodyDef bodyDef, FixtureDef fixtureDef) { - this.bodyDef = bodyDef; - this.fixtureDef = fixtureDef; - body = game.world.createBody(bodyDef); - body.createFixture(fixtureDef); - - } - - public void dispose() { - } -} diff --git a/core/src/com/darkrp2d/entities/components/TextureComponent.java b/core/src/com/darkrp2d/entities/components/TextureComponent.java deleted file mode 100644 index 6350a96..0000000 --- a/core/src/com/darkrp2d/entities/components/TextureComponent.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package com.darkrp2d.entities.components; -import com.badlogic.ashley.core.Component; -import com.badlogic.gdx.graphics.Texture; - -/** - * - * @author Julian - */ -public class TextureComponent implements Component { - - public Texture tex; - - public TextureComponent(Texture tex) { - this.tex = tex; - } - - public void dispose() { - tex.dispose(); - } - -} diff --git a/core/src/com/darkrp2d/entities/entityListeners/DisposeListener.java b/core/src/com/darkrp2d/entities/entityListeners/DisposeListener.java deleted file mode 100644 index d65e731..0000000 --- a/core/src/com/darkrp2d/entities/entityListeners/DisposeListener.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package com.darkrp2d.entities.entityListeners; - -import com.badlogic.ashley.core.Entity; -import com.badlogic.ashley.core.EntityListener; -import com.darkrp2d.entities.components.Mappers; - -/** - * - * @author Julian - */ -public class DisposeListener implements EntityListener { - - @Override - public void entityAdded(Entity entity) { - } - - @Override - public void entityRemoved(Entity entity) { - Mappers.textureComponentMapper.get(entity).dispose(); - } - -} diff --git a/core/src/com/darkrp2d/entitySystems/MovementSystem.java b/core/src/com/darkrp2d/entitySystems/MovementSystem.java deleted file mode 100644 index a93ce23..0000000 --- a/core/src/com/darkrp2d/entitySystems/MovementSystem.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package com.darkrp2d.entitySystems; - -import com.badlogic.ashley.core.Engine; -import com.badlogic.ashley.core.Entity; -import com.badlogic.ashley.core.EntitySystem; -import com.badlogic.ashley.core.Family; -import com.badlogic.ashley.utils.ImmutableArray; -import com.badlogic.gdx.math.Vector2; -import com.darkrp2d.entities.components.ControllableComponent; -import com.darkrp2d.entities.components.Mappers; -import com.darkrp2d.entities.components.PhysicComponent; - -/** - * - * @author Julian - */ -public class MovementSystem extends EntitySystem { - - private ImmutableArray entities; - - public MovementSystem() { - - } - - @Override - public void addedToEngine(Engine engine) { - entities = engine.getEntitiesFor(Family.all(PhysicComponent.class, ControllableComponent.class).get()); - } - - @Override - public void update(float deltaTime) { - for (int i = 0; i < entities.size(); ++i) { - Entity entity = entities.get(i); - ControllableComponent controller = Mappers.controllableComponentMapper.get(entity); - PhysicComponent physic = Mappers.physicComponentMapper.get(entity); - Vector2 dir = new Vector2(0,0); - - if(controller.down) { - dir.y += -1; - } - if(controller.up) { - dir.y += 1; - } - if(controller.left) { - dir.x += -1; - } - if(controller.right) { - dir.x += 1; - } - - physic.body.setLinearVelocity(dir.nor().setLength(controller.speed)); - - } - } - -} diff --git a/core/src/com/darkrp2d/entitySystems/RenderSystem.java b/core/src/com/darkrp2d/entitySystems/RenderSystem.java deleted file mode 100644 index 8dd199e..0000000 --- a/core/src/com/darkrp2d/entitySystems/RenderSystem.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package com.darkrp2d.entitySystems; - -import com.badlogic.ashley.core.Engine; -import com.badlogic.ashley.core.Entity; -import com.badlogic.ashley.core.EntitySystem; -import com.badlogic.ashley.core.Family; -import com.badlogic.ashley.utils.ImmutableArray; -import com.badlogic.gdx.graphics.g2d.SpriteBatch; -import com.badlogic.gdx.math.Vector2; - -import com.darkrp2d.entities.components.Mappers; -import com.darkrp2d.entities.components.PhysicComponent; -import com.darkrp2d.entities.components.TextureComponent; -import com.darkrp2d.physics.Box2DUtils; - -/** - * - * @author Julian - */ -public class RenderSystem extends EntitySystem { - - private ImmutableArray entities; - private float msPerUpdate; - - - public RenderSystem(float msPerUpdate) { - this.msPerUpdate = msPerUpdate; - } - - @Override - public void addedToEngine(Engine engine) { - entities = engine.getEntitiesFor(Family.all(TextureComponent.class, PhysicComponent.class).get()); - } - - public void render(float delta, SpriteBatch batch) { - batch.begin(); - for (int i = 0; i < entities.size(); ++i) { - Entity entity = entities.get(i); - PhysicComponent physics = Mappers.physicComponentMapper.get(entity); - TextureComponent texture = Mappers.textureComponentMapper.get(entity); - - Vector2 vel = physics.body.getLinearVelocity(); - vel.scl(msPerUpdate); - vel.scl(delta); - - batch.draw(texture.tex, Box2DUtils.worldToScreen(physics.body.getPosition().x + vel.x) - texture.tex.getWidth() / 2, Box2DUtils.worldToScreen(physics.body.getPosition().y + vel.y) - texture.tex.getHeight()/2); - } - batch.end(); - } -} diff --git a/core/src/com/darkrp2d/input/CommandStream.java b/core/src/com/darkrp2d/input/CommandStream.java deleted file mode 100644 index fbeb97d..0000000 --- a/core/src/com/darkrp2d/input/CommandStream.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package com.darkrp2d.input; - -import com.darkrp2d.input.commands.Command; -import java.util.LinkedList; -import java.util.Queue; - -/** - * - * @author gulum - */ -public class CommandStream { - - private static Queue commandStream = new LinkedList(); - - - public static boolean registerCommand(Command com) { - return commandStream.offer(com); - } - - public static Command pollCommand() { - return commandStream.poll(); - } - -} diff --git a/core/src/com/darkrp2d/input/InputHandler.java b/core/src/com/darkrp2d/input/InputHandler.java deleted file mode 100644 index 46ea7ae..0000000 --- a/core/src/com/darkrp2d/input/InputHandler.java +++ /dev/null @@ -1,124 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package com.darkrp2d.input; - -import com.badlogic.ashley.core.Entity; -import com.badlogic.ashley.core.Family; -import com.badlogic.gdx.Input; -import com.badlogic.gdx.InputProcessor; -import com.darkrp2d.DarkRP2D; -import com.darkrp2d.entities.components.ControllableComponent; -import com.darkrp2d.entities.components.PhysicComponent; -import com.darkrp2d.input.commands.*; -import com.darkrp2d.input.commands.moveCommands.*; -import com.darkrp2d.scenes.menu.MenuScreen; - -/** - * - * @author gulum - */ -public class InputHandler implements InputProcessor { - - Command testCommand; - Command menuCommand; - - //MovementCommands - Command upCommand; - Command downCommand; - Command leftCommand; - Command rightCommand; - - public InputHandler(DarkRP2D game) { - testCommand = new TestCommand(); - this.menuCommand = new MenuCommand(game, new MenuScreen(game)); - - //Inputs auf erstes bedienbares entity - Entity character = game.engine.getEntitiesFor(Family.all(ControllableComponent.class, PhysicComponent.class).get()).first(); - this.upCommand = new UpCommand(character); - this.downCommand = new DownCommand(character); - this.leftCommand = new LeftCommand(character); - this.rightCommand = new RightCommand(character); - } - - @Override - public boolean keyDown(int keycode) { - switch (keycode) { - case Input.Keys.Q: - CommandStream.registerCommand(testCommand); - break; - case Input.Keys.C: - CommandStream.registerCommand(menuCommand); - break; - case Input.Keys.W: - CommandStream.registerCommand(upCommand); - break; - case Input.Keys.S: - CommandStream.registerCommand(downCommand); - break; - case Input.Keys.A: - CommandStream.registerCommand(leftCommand); - break; - case Input.Keys.D: - CommandStream.registerCommand(rightCommand); - break; - default: - break; - } - return true; - } - - @Override - public boolean keyUp(int keycode) { - switch (keycode) { - case Input.Keys.W: - CommandStream.registerCommand(upCommand); - break; - case Input.Keys.S: - CommandStream.registerCommand(downCommand); - break; - case Input.Keys.A: - CommandStream.registerCommand(leftCommand); - break; - case Input.Keys.D: - CommandStream.registerCommand(rightCommand); - break; - default: - break; - } - return true; - } - - @Override - public boolean keyTyped(char character) { - return false; - } - - @Override - public boolean touchDown(int screenX, int screenY, int pointer, int button) { - return false; - } - - @Override - public boolean touchUp(int screenX, int screenY, int pointer, int button) { - return false; - } - - @Override - public boolean touchDragged(int screenX, int screenY, int pointer) { - return false; - } - - @Override - public boolean mouseMoved(int screenX, int screenY) { - return false; - } - - @Override - public boolean scrolled(int amount) { - return false; - } - -} diff --git a/core/src/com/darkrp2d/input/commands/Command.java b/core/src/com/darkrp2d/input/commands/Command.java deleted file mode 100644 index ed4d334..0000000 --- a/core/src/com/darkrp2d/input/commands/Command.java +++ /dev/null @@ -1,16 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package com.darkrp2d.input.commands; - -/** - * - * @author gulum - */ -public interface Command { - - public void execute(); - -} diff --git a/core/src/com/darkrp2d/input/commands/MenuCommand.java b/core/src/com/darkrp2d/input/commands/MenuCommand.java deleted file mode 100644 index b2d3eac..0000000 --- a/core/src/com/darkrp2d/input/commands/MenuCommand.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package com.darkrp2d.input.commands; - -import com.badlogic.gdx.Game; -import com.badlogic.gdx.Screen; - -/** - * - * @author Julian - */ -public class MenuCommand implements Command { - - private Game game; - private Screen screen; - private boolean toggle = false; - - public MenuCommand(Game game, Screen screen) { - this.game = game; - this.screen = screen; - } - - @Override - public void execute() { - if(!toggle) { - toggle = true; - game.setScreen(screen); - } else { - toggle = false; - game.setScreen(null); - } - } - -} diff --git a/core/src/com/darkrp2d/input/commands/TestCommand.java b/core/src/com/darkrp2d/input/commands/TestCommand.java deleted file mode 100644 index 3f7f6d9..0000000 --- a/core/src/com/darkrp2d/input/commands/TestCommand.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package com.darkrp2d.input.commands; - -/** - * - * @author gulum - */ -public class TestCommand implements Command { - - @Override - public void execute() { - System.out.println("Just an Command test!"); - } - - -} diff --git a/core/src/com/darkrp2d/input/commands/moveCommands/DownCommand.java b/core/src/com/darkrp2d/input/commands/moveCommands/DownCommand.java deleted file mode 100644 index 5d2b7c7..0000000 --- a/core/src/com/darkrp2d/input/commands/moveCommands/DownCommand.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package com.darkrp2d.input.commands.moveCommands; - -import com.badlogic.ashley.core.Entity; -import com.darkrp2d.entities.components.ControllableComponent; -import com.darkrp2d.entities.components.Mappers; -import com.darkrp2d.input.commands.Command; - -/** - * - * @author Julian - */ -public class DownCommand implements Command{ - - Entity ent; - private boolean toggle = false; - - public DownCommand(Entity ent) { - this.ent = ent; - } - - @Override - public void execute() { - ControllableComponent controller = Mappers.controllableComponentMapper.get(ent); - if(!toggle) { - controller.down = true; - toggle = true; - } else { - controller.down = false; - toggle = false; - } - } - -} diff --git a/core/src/com/darkrp2d/input/commands/moveCommands/LeftCommand.java b/core/src/com/darkrp2d/input/commands/moveCommands/LeftCommand.java deleted file mode 100644 index 2d5121a..0000000 --- a/core/src/com/darkrp2d/input/commands/moveCommands/LeftCommand.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package com.darkrp2d.input.commands.moveCommands; - -import com.badlogic.ashley.core.Entity; -import com.badlogic.gdx.math.Vector2; -import com.badlogic.gdx.physics.box2d.Body; -import com.darkrp2d.entities.components.ControllableComponent; -import com.darkrp2d.entities.components.Mappers; -import com.darkrp2d.input.commands.Command; - -/** - * - * @author Julian - */ -public class LeftCommand implements Command { - - Entity ent; - private boolean toggle = false; - - public LeftCommand(Entity ent) { - this.ent = ent; - } - - @Override - public void execute() { - ControllableComponent controller = Mappers.controllableComponentMapper.get(ent); - if(!toggle) { - controller.left = true; - toggle = true; - } else { - controller.left = false; - toggle = false; - } - } -} diff --git a/core/src/com/darkrp2d/input/commands/moveCommands/RightCommand.java b/core/src/com/darkrp2d/input/commands/moveCommands/RightCommand.java deleted file mode 100644 index 82e35e9..0000000 --- a/core/src/com/darkrp2d/input/commands/moveCommands/RightCommand.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package com.darkrp2d.input.commands.moveCommands; - -import com.badlogic.ashley.core.Entity; -import com.badlogic.gdx.math.Vector2; -import com.badlogic.gdx.physics.box2d.Body; -import com.darkrp2d.entities.components.ControllableComponent; -import com.darkrp2d.entities.components.Mappers; -import com.darkrp2d.input.commands.Command; - -/** - * - * @author Julian - */ -public class RightCommand implements Command { - - Entity ent; - private boolean toggle = false; - - public RightCommand(Entity ent) { - this.ent = ent; - } - - @Override - public void execute() { - ControllableComponent controller = Mappers.controllableComponentMapper.get(ent); - if(!toggle) { - controller.right = true; - toggle = true; - } else { - controller.right = false; - toggle = false; - } - } - -} diff --git a/core/src/com/darkrp2d/input/commands/moveCommands/UpCommand.java b/core/src/com/darkrp2d/input/commands/moveCommands/UpCommand.java deleted file mode 100644 index ddae17e..0000000 --- a/core/src/com/darkrp2d/input/commands/moveCommands/UpCommand.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package com.darkrp2d.input.commands.moveCommands; - -import com.badlogic.ashley.core.Entity; -import com.badlogic.gdx.physics.box2d.Body; -import com.darkrp2d.entities.components.Mappers; -import com.darkrp2d.input.commands.Command; -import com.badlogic.gdx.math.Vector2; -import com.darkrp2d.entities.components.ControllableComponent; - -/** - * - * @author Julian - */ -public class UpCommand implements Command { - - Entity ent; - private boolean toggle = false; - - public UpCommand(Entity ent) { - this.ent = ent; - } - - @Override - public void execute() { - ControllableComponent controller = Mappers.controllableComponentMapper.get(ent); - if(!toggle) { - controller.up = true; - toggle = true; - } else { - controller.up = false; - toggle = false; - } - - } - -} diff --git a/core/src/com/darkrp2d/physics/Box2DUtils.java b/core/src/com/darkrp2d/physics/Box2DUtils.java deleted file mode 100644 index 725c0a0..0000000 --- a/core/src/com/darkrp2d/physics/Box2DUtils.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package com.darkrp2d.physics; - -/** - * - * @author Julian - */ -public class Box2DUtils { - - public static final float PIXEL_PER_METER = 32; - - public static float screenToWorld(float value) { - return value / PIXEL_PER_METER; - } - - public static float worldToScreen(float value) { - return value * PIXEL_PER_METER; - } - - -} diff --git a/core/src/com/darkrp2d/preference/PreferenceConstants.java b/core/src/com/darkrp2d/preference/PreferenceConstants.java deleted file mode 100644 index ffefb33..0000000 --- a/core/src/com/darkrp2d/preference/PreferenceConstants.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package com.darkrp2d.preference; - -/** - * - * @author gulum - */ -public final class PreferenceConstants { - - public static final String PREFS_FULLSCREEN = "Fullscreen"; - - private PreferenceConstants() { - throw new AssertionError(); - } -} diff --git a/core/src/com/darkrp2d/scenes/game/Camera.java b/core/src/com/darkrp2d/scenes/game/Camera.java deleted file mode 100644 index ad4a246..0000000 --- a/core/src/com/darkrp2d/scenes/game/Camera.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package com.darkrp2d.scenes.game; - -import com.badlogic.gdx.graphics.OrthographicCamera; - -/** - * - * @author Julian - */ -public class Camera extends OrthographicCamera { - - public Camera(int viewportWidth, int viewportHeight) { - new OrthographicCamera(960,540); - } -} diff --git a/core/src/com/darkrp2d/scenes/game/GameScreen.java b/core/src/com/darkrp2d/scenes/game/GameScreen.java deleted file mode 100644 index a8234eb..0000000 --- a/core/src/com/darkrp2d/scenes/game/GameScreen.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package com.darkrp2d.scenes.game; - -import com.badlogic.gdx.Screen; - -/** - * - * @author Julian - */ -public class GameScreen implements Screen { - - //Pass server ip.... - public GameScreen(int ip) { - - } - - @Override - public void show() { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - - @Override - public void render(float delta) { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - - @Override - public void resize(int width, int height) { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - - @Override - public void pause() { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - - @Override - public void resume() { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - - @Override - public void hide() { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - - @Override - public void dispose() { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - -} diff --git a/core/src/com/darkrp2d/scenes/menu/MenuScreen.java b/core/src/com/darkrp2d/scenes/menu/MenuScreen.java deleted file mode 100644 index ce92cca..0000000 --- a/core/src/com/darkrp2d/scenes/menu/MenuScreen.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package com.darkrp2d.scenes.menu; - -import com.badlogic.gdx.Screen; -import com.badlogic.gdx.graphics.g2d.GlyphLayout; -import com.darkrp2d.DarkRP2D; - -/** - * - * @author gulum - */ -public class MenuScreen implements Screen{ - - private DarkRP2D game; - private GlyphLayout layout; - - public MenuScreen(DarkRP2D game) { - this.game = game; - layout = new GlyphLayout(game.font, "Menu Opened"); - } - - @Override - public void show() { - } - - @Override - public void render(float f) { - game.batch.begin(); - game.font.draw(game.batch, layout, 100, 100); - game.batch.end(); - } - - @Override - public void resize(int width, int height) { - } - - @Override - public void pause() { - - } - - @Override - public void resume() { - - } - - @Override - public void hide() { - - } - - @Override - public void dispose() { - } - -} diff --git a/desktop/build.gradle b/desktop/build.gradle deleted file mode 100755 index 9de01e1..0000000 --- a/desktop/build.gradle +++ /dev/null @@ -1,55 +0,0 @@ -apply plugin: "java" - -sourceCompatibility = 1.6 -sourceSets.main.java.srcDirs = [ "src/" ] - -project.ext.mainClassName = "com.darkrp2d.desktop.DesktopLauncher" -project.ext.assetsDir = new File("../core/assets"); - -task run(dependsOn: classes, type: JavaExec) { - main = project.mainClassName - classpath = sourceSets.main.runtimeClasspath - standardInput = System.in - workingDir = project.assetsDir - ignoreExitValue = true -} - -task debug(dependsOn: classes, type: JavaExec) { - main = project.mainClassName - classpath = sourceSets.main.runtimeClasspath - standardInput = System.in - workingDir = project.assetsDir - ignoreExitValue = true - debug = true -} - -task dist(type: Jar) { - from files(sourceSets.main.output.classesDir) - from files(sourceSets.main.output.resourcesDir) - from {configurations.compile.collect {zipTree(it)}} - from files(project.assetsDir); - - manifest { - attributes 'Main-Class': project.mainClassName - } -} - -dist.dependsOn classes - -eclipse { - project { - name = appName + "-desktop" - linkedResource name: 'assets', type: '2', location: 'PARENT-1-PROJECT_LOC/core/assets' - } -} - -task afterEclipseImport(description: "Post processing after project generation", group: "IDE") { - doLast { - def classpath = new XmlParser().parse(file(".classpath")) - new Node(classpath, "classpathentry", [ kind: 'src', path: 'assets' ]); - def writer = new FileWriter(file(".classpath")) - def printer = new XmlNodePrinter(new PrintWriter(writer)) - printer.setPreserveWhitespace(true) - printer.print(classpath) - } -} diff --git a/desktop/src/com/darkrp2d/desktop/DesktopLauncher.java b/desktop/src/com/darkrp2d/desktop/DesktopLauncher.java deleted file mode 100755 index eb5f41d..0000000 --- a/desktop/src/com/darkrp2d/desktop/DesktopLauncher.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.darkrp2d.desktop; - -import com.badlogic.gdx.Gdx; -import com.badlogic.gdx.Files; -import com.badlogic.gdx.Preferences; -import com.badlogic.gdx.backends.lwjgl.LwjglApplication; -import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration; -import com.darkrp2d.DarkRP2D; -import com.darkrp2d.preference.PreferenceConstants; - -public class DesktopLauncher { - - public static final String GAME_TITLE = "DarkRP2D"; - - public static void main (String[] arg) { - LwjglApplicationConfiguration config = new LwjglApplicationConfiguration(); - - //Default conf - config.title = "DarkRP2D"; - config.useGL30 = false; - config.width = 960; - config.height = 540; - config.addIcon("logo.png", Files.FileType.Internal); - config.vSyncEnabled = false; // Setting to false disables vertical sync - config.foregroundFPS = 60; // Setting to 0 disables foreground fps throttling - config.backgroundFPS = 60; // Setting to 0 disables background fps throttling - - loadUserPrefs(new LwjglApplication(new DarkRP2D(), config)); - } - - private static void loadUserPrefs(LwjglApplication app) { - Preferences optionPrefs = Gdx.app.getPreferences(GAME_TITLE); - - if(optionPrefs.getBoolean(PreferenceConstants.PREFS_FULLSCREEN)) { - app.getGraphics().setFullscreenMode(app.getGraphics().getDisplayMode()); - } - } -} diff --git a/gradle.properties b/gradle.properties deleted file mode 100755 index 339fa15..0000000 --- a/gradle.properties +++ /dev/null @@ -1,3 +0,0 @@ -org.gradle.daemon=true -org.gradle.jvmargs=-Xms128m -Xmx1500m -org.gradle.configureondemand=true diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar deleted file mode 100755 index bafc550..0000000 Binary files a/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties deleted file mode 100755 index 0eb9142..0000000 --- a/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,6 +0,0 @@ -#Fri Jun 09 23:06:52 EDT 2017 -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-bin.zip diff --git a/gradlew b/gradlew deleted file mode 100755 index 4453cce..0000000 --- a/gradlew +++ /dev/null @@ -1,172 +0,0 @@ -#!/usr/bin/env sh - -############################################################################## -## -## Gradle start up script for UN*X -## -############################################################################## - -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null - -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn ( ) { - echo "$*" -} - -die ( ) { - echo - echo "$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; -esac - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi - -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=$((i+1)) - done - case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac -fi - -# Escape application args -save ( ) { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -APP_ARGS=$(save "$@") - -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" - -# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong -if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then - cd "$(dirname "$0")" -fi - -exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat deleted file mode 100755 index e95643d..0000000 --- a/gradlew.bat +++ /dev/null @@ -1,84 +0,0 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/settings.gradle b/settings.gradle deleted file mode 100755 index 74fc652..0000000 --- a/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -include 'desktop', 'core' \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000..d2ea29b --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,11 @@ +#include + +using namespace std; + +int main( int argc, char *argv[] ) +{ + cout << "Hello World!" << '\n'; + cin.get(); + + return 0; +}