mirror of
https://github.com/collinsmith/riiablo.git
synced 2025-02-21 20:18:14 +07:00
Removed virtual MPQ file support
Removed virtual MPQ file support -- was for previous version where I was making fake assets Other minor changes See #8 on some MPQ read issues I've noticed
This commit is contained in:
parent
1090bdc42d
commit
d818d97900
@ -5,6 +5,7 @@ import com.badlogic.gdx.files.FileHandle;
|
||||
import com.badlogic.gdx.utils.GdxRuntimeException;
|
||||
import com.badlogic.gdx.utils.StreamUtils;
|
||||
import com.riiablo.mpq.util.Decryptor;
|
||||
import com.riiablo.util.BufferUtils;
|
||||
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.lang3.StringEscapeUtils;
|
||||
@ -18,11 +19,9 @@ import java.nio.ByteOrder;
|
||||
import java.nio.channels.FileChannel;
|
||||
import java.util.Objects;
|
||||
|
||||
import com.riiablo.util.BufferUtils;
|
||||
|
||||
public class MPQ {
|
||||
private static final String TAG = MPQ.class.getSimpleName();
|
||||
private static final boolean DEBUG = false;
|
||||
private static final boolean DEBUG = !true;
|
||||
|
||||
final FileHandle file;
|
||||
final Header header;
|
||||
|
@ -10,7 +10,7 @@ import java.io.InputStream;
|
||||
public class MPQFileHandle extends FileHandle {
|
||||
private static final String TAG = "MPQFileHandle";
|
||||
|
||||
public final MPQ mpq;
|
||||
public final MPQ mpq;
|
||||
public final String fileName;
|
||||
|
||||
public MPQFileHandle(MPQ mpq, String fileName) {
|
||||
|
@ -8,7 +8,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
public class MPQFileHandleResolver implements FileHandleResolver {
|
||||
private static final String TAG = "MPQFileHandleResolver";
|
||||
private static final boolean DEBUG = false;
|
||||
private static final boolean DEBUG = !true;
|
||||
|
||||
private final CopyOnWriteArrayList<MPQ> mpqs = new CopyOnWriteArrayList<>();
|
||||
|
||||
@ -21,10 +21,6 @@ public class MPQFileHandleResolver implements FileHandleResolver {
|
||||
}
|
||||
|
||||
public boolean contains(String fileName) {
|
||||
if (fileName.startsWith("virtual:")) {
|
||||
return true;
|
||||
}
|
||||
|
||||
for (MPQ mpq : mpqs) {
|
||||
if (mpq.contains(fileName)) {
|
||||
return true;
|
||||
@ -38,12 +34,6 @@ public class MPQFileHandleResolver implements FileHandleResolver {
|
||||
public FileHandle resolve(String fileName) {
|
||||
if (DEBUG) Gdx.app.debug(TAG, "Resolving " + fileName);
|
||||
if (fileName == null) return null;
|
||||
if (fileName.startsWith("virtual:")) {
|
||||
fileName = fileName.substring(8);
|
||||
if (DEBUG) Gdx.app.debug(TAG, "Resolving virtual file " + fileName);
|
||||
return new VirtualMPQFileHandle(fileName);
|
||||
}
|
||||
|
||||
for (MPQ mpq : mpqs) {
|
||||
if (mpq.contains(fileName)) {
|
||||
if (DEBUG) Gdx.app.debug(TAG, fileName + " found in " + mpq);
|
||||
|
@ -1,9 +0,0 @@
|
||||
package com.riiablo.mpq;
|
||||
|
||||
public class VirtualMPQFileHandle extends MPQFileHandle {
|
||||
|
||||
VirtualMPQFileHandle(String fileName) {
|
||||
super(null, fileName);
|
||||
}
|
||||
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
package com.riiablo.mpq.virtual;
|
||||
|
||||
public class VirtualUtils {
|
||||
private VirtualUtils() {}
|
||||
|
||||
public static String createPalettePath(String palette) {
|
||||
return "data/global/palette/" + palette + "/pal.dat";
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user