Skip to content
Permalink
Browse files

Moved MapViewer to tools module -- deleted mapbuilder module

  • Loading branch information...
collinsmith committed May 5, 2019
1 parent 1c2a299 commit c079787cac6463db1dc550c996c906be9118f6ef
@@ -88,26 +88,6 @@ project(":tools") {
}
}

project(":mapbuilder") {
apply plugin: "java"

ext {
visuiVersion = '1.4.0'
}

dependencies {
compile project(":core")
compile "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion"
compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"

}

dependencies {
compile group: 'commons-cli', name: 'commons-cli', version: cliVersion
compile "com.kotcrab.vis:vis-ui:$visuiVersion"
}
}

project(":ds1viewer") {
apply plugin: "java"

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.
@@ -1 +1 @@
include 'tools', 'tester', 'ds1viewer', 'mapbuilder', 'mpqviewer', 'server', 'desktop', 'android', 'mpqlib', 'core'
include 'tools', 'tester', 'ds1viewer', 'mpqviewer', 'server', 'desktop', 'android', 'mpqlib', 'core'
@@ -11,6 +11,7 @@
import com.badlogic.gdx.assets.AssetManager;
import com.badlogic.gdx.backends.lwjgl.LwjglApplication;
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration;
import com.badlogic.gdx.files.FileHandle;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Texture;
@@ -36,7 +37,6 @@
import com.riiablo.codec.Palette;
import com.riiablo.codec.StringTBLs;
import com.riiablo.codec.TXT;
import com.riiablo.codec.excel.Excel;
import com.riiablo.entity.Engine;
import com.riiablo.entity.Entity;
import com.riiablo.entity.Player;
@@ -49,18 +49,19 @@
import com.riiablo.map.DT1.Tile;
import com.riiablo.mpq.MPQFileHandleResolver;

public class MapViewer extends ApplicationAdapter {
import org.apache.commons.lang3.math.NumberUtils;

private static final String TAG = "MapBuilder";
public class MapViewer extends ApplicationAdapter {
private static final String TAG = "MapViewer";

public static void main(String[] args) {
LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
config.title = "Map Builder";
config.title = TAG;
config.resizable = true;
config.width = 1280; // 1280
config.height = 720;
config.foregroundFPS = config.backgroundFPS = 144;
MapViewer client = new MapViewer();
MapViewer client = new MapViewer(args);
new LwjglApplication(client, config);
}

@@ -69,7 +70,6 @@ public static void main(String[] args) {
ShapeRenderer shapes;
Texture palette;
Map map;
com.riiablo.map.DS1Types DS1Types;

Entity ent;
MapRenderer mapRenderer;
@@ -91,11 +91,27 @@ public static void main(String[] args) {
boolean drawRoofs = true;
boolean drawSpecial = true;

FileHandle home;
int seed;
int act;
int diff;

MapViewer(String[] args) {
this(args[0], NumberUtils.toInt(args[1]), NumberUtils.toInt(args[2]), NumberUtils.toInt(args[3]));
}

MapViewer(String home, int seed, int act, int diff) {
this.home = new FileHandle(home);
this.seed = seed;
this.act = act;
this.diff = diff;
}

@Override
public void create() {
Gdx.app.setLogLevel(Application.LOG_DEBUG);

Riiablo.home = Gdx.files.absolute("C:\\Program Files (x86)\\Steam\\steamapps\\common\\Diablo II");
Riiablo.home = home = Gdx.files.absolute(home.path());
MPQFileHandleResolver resolver = Riiablo.mpqs = new MPQFileHandleResolver();

AssetManager assets = Riiablo.assets = new AssetManager();
@@ -116,9 +132,6 @@ public void create() {
Riiablo.string = new StringTBLs(resolver);
Riiablo.cofs = new COFs(assets);//COFD2.loadFromFile(resolver.resolve("data\\global\\cmncof_a1.d2"));

TXT txt = TXT.loadFromFile(Gdx.files.local("data/ds1types.txt"));
DS1Types = Excel.parse(txt, com.riiablo.map.DS1Types.class);

ShaderProgram.pedantic = false;
ShaderProgram shader = Riiablo.shader = new ShaderProgram(
Gdx.files.internal("shaders/indexpalette3.vert"),
@@ -332,7 +345,7 @@ public boolean mouseMoved(int screenX, int screenY) {
*/

assets.setLoader(Map.class, new MapLoader(resolver));
assets.load("Act 1", Map.class, MapLoader.MapParameters.of(0, 0, 0));
assets.load("Act 1", Map.class, MapLoader.MapParameters.of(seed, act, diff));
assets.finishLoading();

map = assets.get("Act 1");

0 comments on commit c079787

Please sign in to comment.
You can’t perform that action at this time.