├── bin ├── classes.dex └── resources.ap_ ├── res ├── drawable-hdpi │ └── icon.png ├── drawable-ldpi │ └── icon.png ├── drawable-mdpi │ └── icon.png ├── values │ └── strings.xml ├── layout │ ├── savename.xml │ └── main.xml ├── xml │ └── preferences.xml └── menu │ └── options_menu.xml ├── .gitignore ├── .classpath ├── default.properties ├── src └── com │ └── exult │ └── android │ ├── Preferences.java │ ├── Block.java │ ├── ShapesVgaFile.java │ ├── TimeSensitive.java │ ├── IfixGameObject.java │ ├── TerrainGameObject.java │ ├── shapeinf │ ├── ExplosionInfo.java │ ├── BodyInfo.java │ ├── WarmthInfo.java │ ├── EffectiveHpInfo.java │ ├── ContentRules.java │ ├── FrameUsecodeInfo.java │ ├── FrameNameInfo.java │ ├── ArmorInfo.java │ ├── PaperdollNpc.java │ ├── SFXInfo.java │ ├── FrameFlagsInfo.java │ ├── PaperdollItem.java │ ├── AnimationInfo.java │ ├── AmmoInfo.java │ └── BaseInfo.java │ ├── ShapeFiles.java │ ├── GameSingletons.java │ ├── EFileManager.java │ ├── PlasmaThread.java │ ├── AudioSample.java │ ├── FlexFile.java │ ├── VirtueStoneObject.java │ ├── VideoPlayer.java │ ├── Rectangle.java │ ├── DataSource.java │ ├── YesNoGump.java │ ├── Tile.java │ ├── SignGump.java │ ├── ChunkTerrain.java │ ├── EConst.java │ ├── TextGump.java │ ├── StatsGump.java │ ├── Cheat.java │ ├── ObjectList.java │ ├── ZombiePathFinder.java │ ├── Shortcuts.java │ ├── TimeQueue.java │ ├── ActorGump.java │ ├── SliderGump.java │ ├── VgaFile.java │ ├── AStarPathFinder.java │ ├── Shape.java │ ├── MainActor.java │ ├── ShapeID.java │ ├── IregGameObject.java │ ├── Ready.java │ ├── ItemNames.java │ ├── NpcActor.java │ ├── GameClock.java │ └── Mouse.java ├── README.md ├── AndroidManifest.xml ├── .project ├── .gitattributes └── ChangeLog.Android /bin/classes.dex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exult/ExultAndroid/HEAD/bin/classes.dex -------------------------------------------------------------------------------- /bin/resources.ap_: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exult/ExultAndroid/HEAD/bin/resources.ap_ -------------------------------------------------------------------------------- /res/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exult/ExultAndroid/HEAD/res/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /res/drawable-ldpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exult/ExultAndroid/HEAD/res/drawable-ldpi/icon.png -------------------------------------------------------------------------------- /res/drawable-mdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exult/ExultAndroid/HEAD/res/drawable-mdpi/icon.png -------------------------------------------------------------------------------- /res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Hello World, ExultActivity! 4 | Exult 5 | 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Built application files 2 | *.apk 3 | *.ap_ 4 | 5 | # Files for the Dalvik VM 6 | *.dex 7 | 8 | # Java class files 9 | *.class 10 | 11 | # Generated files 12 | /bin/ 13 | /gen/ 14 | /out/ 15 | 16 | -------------------------------------------------------------------------------- /.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /default.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system use, 7 | # "build.properties", and override values to adapt the script to your 8 | # project structure. 9 | 10 | # Project target. 11 | target=android-8 12 | -------------------------------------------------------------------------------- /src/com/exult/android/Preferences.java: -------------------------------------------------------------------------------- 1 | package com.exult.android; 2 | 3 | import android.os.Bundle; 4 | import android.preference.PreferenceActivity; 5 | 6 | public class Preferences extends PreferenceActivity { 7 | @Override 8 | public void onCreate(Bundle savedInstanceState) { 9 | super.onCreate(savedInstanceState); 10 | 11 | addPreferencesFromResource(R.xml.preferences); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ExultAndroid 2 | Ancient, unmaintained port of Exult to Java for Android. 3 | 4 | Quoting Dominus on issue #2: 5 | 6 | > This port to Android is very old by now and never even close to being finished. Probably a lot of things changed since then. You are more likely to succeed by adapting the native Android patch 7 | > http://goo.gl/E2y7Z. Since that patch we changed a lot of stuff, most importantly we switched to SDL2 which is much more compatible with Android. Also the port to iOS is probably helpful as some kind of guidance what needs to be done to make it work 8 | > https://github.com/litchie/exult-ios 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/com/exult/android/Block.java: -------------------------------------------------------------------------------- 1 | package com.exult.android; 2 | /* 3 | * A 3-dim. block. 4 | */ 5 | public final class Block { 6 | public int x, y, z; // Position. 7 | public int w, d, h; // Dimensions. 8 | public Block(int xin, int yin, int zin, int win, int din, int hin) { 9 | x = xin; y = yin; z = zin; 10 | w = win; d = din; h = hin; 11 | } 12 | public void set(int xin, int yin, int zin, int win, int din, int hin) { 13 | x = xin; y = yin; z = zin; 14 | w = win; d = din; h = hin; 15 | } 16 | public Block() { } // An uninitialized one. 17 | // Is this point in it? 18 | public boolean hasPoint(int px, int py, int pz) { 19 | return (px >= x && px < x + w && py >= y && py < y + d && 20 | pz >= z && pz < z + h); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /res/layout/savename.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 14 | 15 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/com/exult/android/ShapesVgaFile.java: -------------------------------------------------------------------------------- 1 | package com.exult.android; 2 | 3 | /* 4 | * Represents THE 'shapes.vga' file. 5 | */ 6 | public class ShapesVgaFile extends VgaFile { 7 | //UNUSED private boolean infoRead; 8 | private static ShapeInfo info[]; 9 | private static ShapeInfo zinfo = new ShapeInfo(); //A fake one (all 0's). 10 | public ShapesVgaFile( 11 | String nm, // Path to file. 12 | String nm2 // Patch file, or null. 13 | ) { 14 | super(nm, nm2); 15 | info = new ShapeInfo[shapes.length]; 16 | int gameType = GameSingletons.game.getGameType(); 17 | ShapeInfo.read(this, info, gameType); 18 | zinfo.setReadyType((byte) (gameType == EConst.BLACK_GATE 19 | ? Ready.backpack : Ready.rhand)); 20 | } 21 | public static ShapeInfo getInfo(int shapenum) { 22 | ShapeInfo s = shapenum >= 0 && shapenum < info.length ? info[shapenum] : zinfo; 23 | return s; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/com/exult/android/TimeSensitive.java: -------------------------------------------------------------------------------- 1 | package com.exult.android; 2 | 3 | public interface TimeSensitive { 4 | public void handleEvent(int ctime, Object udata); 5 | public boolean alwaysHandle(); // Activate even if time is paused. 6 | public void addedToQueue(); 7 | public void removedFromQueue(); 8 | 9 | /* A simple timer that just needs handleEvent overridden. */ 10 | public static class Timer extends GameSingletons implements TimeSensitive { 11 | protected int timeQueueCount; 12 | public boolean alwaysHandle() { // Activate even if time is paused. 13 | return false; 14 | } 15 | public void addedToQueue() { 16 | ++timeQueueCount; 17 | } 18 | public void removedFromQueue() { 19 | --timeQueueCount; 20 | } 21 | public boolean inQueue() { 22 | return timeQueueCount > 0; 23 | } 24 | public void handleEvent(int ctime, Object udata) { 25 | 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | ExultAndroid 4 | 5 | 6 | 7 | 8 | 9 | com.android.ide.eclipse.adt.ResourceManagerBuilder 10 | 11 | 12 | 13 | 14 | com.android.ide.eclipse.adt.PreCompilerBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.jdt.core.javabuilder 20 | 21 | 22 | 23 | 24 | com.android.ide.eclipse.adt.ApkBuilder 25 | 26 | 27 | 28 | 29 | 30 | com.android.ide.eclipse.adt.AndroidNature 31 | org.eclipse.jdt.core.javanature 32 | 33 | 34 | -------------------------------------------------------------------------------- /src/com/exult/android/IfixGameObject.java: -------------------------------------------------------------------------------- 1 | package com.exult.android; 2 | 3 | public class IfixGameObject extends GameObject { 4 | public IfixGameObject(int shapenum, int framenum, int tilex, 5 | int tiley, int lft) { 6 | super(shapenum, framenum, tilex, tiley, lft); 7 | } 8 | public static class Animated extends IfixGameObject { 9 | private Animator animator; 10 | public Animated(int shapenum, int framenum, int tilex, int tiley, int lft) { 11 | super(shapenum, framenum, tilex, tiley, lft); 12 | animator = Animator.create(this); 13 | } 14 | @Override 15 | public void removeThis() { 16 | super.removeThis(); 17 | animator.delete(); 18 | } 19 | @Override 20 | public void paint() { 21 | animator.wantAnimation(); // Be sure animation is on. 22 | super.paint(); 23 | } 24 | // Get coord. where this was placed. 25 | @Override 26 | public void getOriginalTileCoord(Tile t) { 27 | getTile(t); 28 | t.tx -= animator.getDeltax(); 29 | t.ty -= animator.getDeltay(); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/com/exult/android/TerrainGameObject.java: -------------------------------------------------------------------------------- 1 | package com.exult.android; 2 | 3 | public class TerrainGameObject extends GameObject { 4 | public TerrainGameObject(int shapenum, int framenum, int tilex, 5 | int tiley, int lft) { 6 | super(shapenum, framenum, tilex, tiley, lft); 7 | } 8 | public static class Animated extends TerrainGameObject { 9 | private Animator animator; 10 | public Animated(int shapenum, int framenum, int tilex, int tiley, int lft) { 11 | super(shapenum, framenum, tilex, tiley, lft); 12 | animator = Animator.create(this); 13 | } 14 | @Override 15 | public void removeThis() { 16 | super.removeThis(); 17 | animator.delete(); 18 | } 19 | @Override 20 | public void paint() { 21 | animator.wantAnimation(); // Be sure animation is on. 22 | super.paint(); 23 | } 24 | // Get coord. where this was placed. 25 | @Override 26 | public void getOriginalTileCoord(Tile t) { 27 | getTile(t); 28 | t.tx -= animator.getDeltax(); 29 | t.ty -= animator.getDeltay(); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/com/exult/android/shapeinf/ExplosionInfo.java: -------------------------------------------------------------------------------- 1 | package com.exult.android.shapeinf; 2 | import com.exult.android.*; 3 | import java.io.PushbackInputStream; 4 | import java.io.InputStream; 5 | import com.exult.android.ShapeInfo; 6 | 7 | public class ExplosionInfo extends BaseInfo { 8 | private int sprite; // Explosion sprite. 9 | private int sfxnum; // SFX to play or 255 for none. 10 | public int getSprite() 11 | { return sprite; } 12 | public int getSfx() 13 | { return sfxnum; } 14 | public static int getInfoFlag() 15 | { return 0x10; } 16 | private boolean readNew(InputStream in, int version, boolean patch, int game, 17 | ShapeInfo info) { 18 | PushbackInputStream txtin = (PushbackInputStream) in; 19 | sprite = EUtil.ReadInt(txtin); 20 | if (sprite == -0xff) { // means delete entry. 21 | setInvalid(true); 22 | return true; 23 | } 24 | sfxnum = EUtil.ReadInt(txtin, -1); 25 | if (sfxnum == 255) 26 | sfxnum = -1; 27 | return true; 28 | } 29 | @Override 30 | public boolean read(InputStream in, int version, boolean patch, int game, 31 | ShapeInfo info) { 32 | return (new ExplosionInfo()).readNew(in, version, patch, game, info); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/com/exult/android/ShapeFiles.java: -------------------------------------------------------------------------------- 1 | package com.exult.android; 2 | 3 | public enum ShapeFiles { 4 | SHAPES_VGA, 5 | GUMPS_VGA, 6 | PAPERDOL, 7 | SPRITES_VGA, 8 | FACES_VGA, 9 | EXULT_FLX, 10 | GAME_FLX; 11 | 12 | private VgaFile file; 13 | ShapeFiles() { 14 | file = null; 15 | } 16 | public final VgaFile getFile() { 17 | return file; 18 | } 19 | public ShapeFrame getShape(int shapenum, int framenum) { 20 | return file.getShape(shapenum, framenum); 21 | } 22 | public static final void load() { 23 | SHAPES_VGA.file = new ShapesVgaFile(EFile.SHAPES_VGA, EFile.PATCH_SHAPES); 24 | FACES_VGA.file = new VgaFile(EFile.FACES_VGA, EFile.PATCH_FACES); 25 | GUMPS_VGA.file = new VgaFile(EFile.GUMPS_VGA, EFile.PATCH_GUMPS); 26 | SPRITES_VGA.file = new VgaFile(EFile.SPRITES_VGA, EFile.PATCH_SPRITES); 27 | if (EUtil.U7exists(EFile.EXULT_FLX) == null) 28 | ExultActivity.fileFatal(EFile.EXULT_FLX); 29 | EXULT_FLX.file = new VgaFile(EFile.EXULT_FLX, EFile.BUNDLE_EXULT_FLX); 30 | GAME_FLX.file = GameSingletons.game.isBG() 31 | ? new VgaFile(EFile.EXULT_BG_FLX, EFile.BUNDLE_EXULT_BG_FLX) 32 | : new VgaFile(EFile.EXULT_SI_FLX, EFile.BUNDLE_EXULT_SI_FLX); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/com/exult/android/shapeinf/BodyInfo.java: -------------------------------------------------------------------------------- 1 | package com.exult.android.shapeinf; 2 | import com.exult.android.*; 3 | import java.io.PushbackInputStream; 4 | 5 | import java.io.InputStream; 6 | 7 | import com.exult.android.ShapeInfo; 8 | 9 | public class BodyInfo extends BaseInfo { 10 | private int bshape; // Body shape. 11 | private int bframe; // Body frame. 12 | public int getBodyShape() 13 | { return bshape; } 14 | public int getBodyFrame() 15 | { return bframe; } 16 | public static int getInfoFlag() 17 | { return 0x100; } 18 | private boolean readNew(InputStream in, int version, boolean patch, int game, 19 | ShapeInfo info) { 20 | PushbackInputStream txtin = (PushbackInputStream) in; 21 | bshape = EUtil.ReadInt(txtin); 22 | if (bshape == -0xff) { // means delete entry. 23 | setInvalid(true); 24 | return true; 25 | } 26 | bframe = EUtil.ReadInt(txtin); 27 | //System.out.println("BodyInfo: shape = " + bshape + ", frame = " + bframe); 28 | info.setBodyInfo(this); 29 | return true; 30 | } 31 | @Override 32 | public boolean read(InputStream in, int version, boolean patch, int game, 33 | ShapeInfo info) { 34 | return (new BodyInfo()).readNew(in, version, patch, game, info); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/com/exult/android/shapeinf/WarmthInfo.java: -------------------------------------------------------------------------------- 1 | package com.exult.android.shapeinf; 2 | import java.io.PushbackInputStream; 3 | import java.io.InputStream; 4 | import com.exult.android.ShapeInfo; 5 | import com.exult.android.EUtil; 6 | /* 7 | * Information about shapes accepted/rejected by containers. 8 | * This is meant to be stored in a totally ordered vector. 9 | */ 10 | public class WarmthInfo extends BaseInfo.OneKeyInfo { 11 | // Key is the frame. 12 | private byte warmth; 13 | public final int getFrame() 14 | { return keyval; } 15 | public int getWarmth() 16 | { return warmth; } 17 | private boolean readNew(InputStream in, int version, boolean patch, int game, 18 | ShapeInfo info) { 19 | PushbackInputStream txtin = (PushbackInputStream)in; 20 | keyval = (short) EUtil.ReadInt(txtin); 21 | if (keyval < 0) 22 | keyval = -1; 23 | else 24 | keyval &= 0xff; 25 | warmth = (byte)(EUtil.ReadInt(txtin) & 0xff); 26 | info.setWarmthInfo(addVectorInfo(this, info.getWarmthInfo())); 27 | return true; 28 | } 29 | 30 | @Override 31 | public boolean read(InputStream in, int version, boolean patch, int game, 32 | ShapeInfo info) { 33 | return new WarmthInfo().readNew(in, version, patch, game, info); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/com/exult/android/GameSingletons.java: -------------------------------------------------------------------------------- 1 | package com.exult.android; 2 | 3 | public class GameSingletons { 4 | public static GameWindow gwin; 5 | public static ImageBuf win; 6 | public static EFileManager fman; 7 | public static TimeQueue tqueue; 8 | public static GameMap gmap; 9 | public static EffectsManager eman; 10 | public static FontsVgaFile fonts; 11 | public static UsecodeMachine ucmachine; 12 | public static Conversation conv; // This stays null until needed. 13 | public static PartyManager partyman; 14 | public static GumpManager gumpman; 15 | public static Game game; 16 | public static DraggingInfo drag; 17 | public static Mouse mouse; 18 | public static Cheat cheat; 19 | public static Audio audio; 20 | public static GameClock clock; 21 | public static void init(GameWindow gw) { 22 | gwin = gw; 23 | win = gwin.getWin(); 24 | fman = EFileManager.instanceOf(); 25 | gmap = gwin.getMap(); 26 | tqueue = gwin.getTqueue(); 27 | eman = gwin.getEffects(); 28 | fonts = new FontsVgaFile(); 29 | ucmachine = gwin.getUsecode(); 30 | partyman = new PartyManager(); 31 | gumpman = new GumpManager(); 32 | mouse = new Mouse(); 33 | cheat = new Cheat(); 34 | audio = new Audio(); 35 | clock = new GameClock(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/com/exult/android/shapeinf/EffectiveHpInfo.java: -------------------------------------------------------------------------------- 1 | package com.exult.android.shapeinf; 2 | import java.io.PushbackInputStream; 3 | import java.io.InputStream; 4 | import com.exult.android.ShapeInfo; 5 | import com.exult.android.EUtil; 6 | 7 | /* 8 | * Information about effective HPs. 9 | * This is meant to be stored in a totally ordered vector. 10 | */ 11 | public class EffectiveHpInfo extends BaseInfo.FrameInfo { 12 | private byte hps; 13 | 14 | public int getHps() 15 | { return hps; } 16 | private boolean readNew(InputStream in, int version, boolean patch, int game, 17 | ShapeInfo info) { 18 | PushbackInputStream txtin = (PushbackInputStream)in; 19 | frame = EUtil.ReadInt(txtin); 20 | if (frame < 0) 21 | frame = -1; 22 | else 23 | frame &= 0xff; 24 | quality = EUtil.ReadInt(txtin); 25 | if (quality < 0) 26 | quality = -1; 27 | else 28 | quality &= 255; 29 | hps = (byte)((int)EUtil.ReadInt(txtin) & 0xff); 30 | info.setEffectiveHpInfo(addVectorInfo(this, info.getEffectiveHpInfo())); 31 | return true; 32 | } 33 | @Override 34 | public boolean read(InputStream in, int version, boolean patch, int game, 35 | ShapeInfo info) { 36 | return (new EffectiveHpInfo()).readNew(in, version, patch, game, info); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/com/exult/android/shapeinf/ContentRules.java: -------------------------------------------------------------------------------- 1 | package com.exult.android.shapeinf; 2 | import java.io.PushbackInputStream; 3 | import java.io.InputStream; 4 | import com.exult.android.ShapeInfo; 5 | import com.exult.android.EUtil; 6 | /* 7 | * Information about shapes accepted/rejected by containers. 8 | * This is meant to be stored in a totally ordered vector. 9 | */ 10 | public class ContentRules extends BaseInfo.OneKeyInfo { 11 | // Key is the shape; 12 | private boolean accept; 13 | 14 | public int getShape() 15 | { return keyval; } 16 | public boolean acceptsShape() 17 | { return accept; } 18 | private boolean readNew(InputStream in, int version, boolean patch, int game, 19 | ShapeInfo info) { 20 | PushbackInputStream txtin = (PushbackInputStream)in; 21 | keyval = EUtil.ReadInt(txtin); 22 | if (keyval < 0) 23 | keyval = -1; 24 | accept = EUtil.ReadInt(txtin)!= 0; 25 | System.out.println("ContentRules: keyval = " + keyval + ", accept = " + accept); 26 | info.setContentRules(addVectorInfo(this, info.getContentRules())); 27 | return true; 28 | } 29 | @Override 30 | public boolean read(InputStream in, int version, boolean patch, int game, 31 | ShapeInfo info) { 32 | return (new ContentRules()).readNew(in, version, patch, game, info); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.bin binary 2 | *.flx binary 3 | *.pal binary 4 | *.shp binary 5 | *.vga binary 6 | *.xpm text 7 | 8 | *.bmp binary 9 | *.gif binary 10 | *.ico binary 11 | *.jpeg binary 12 | *.jpg binary 13 | *.png binary 14 | 15 | *.mid binary 16 | *.wav binary 17 | 18 | *.xls binary 19 | 20 | *.tar.gz binary 21 | *.tar.bz2 binary 22 | *.zip binary 23 | 24 | *.exe binary 25 | *.dmg binary 26 | *.zip binary 27 | 28 | *.sln eol=crlf 29 | *.vcproj eol=crlf 30 | *.vcxproj eol=crlf 31 | *.vsprops eol=crlf 32 | 33 | *.glade text diff=html 34 | *.htm text diff=html 35 | *.html text diff=html 36 | *.shtml text diff=html 37 | *.ui text diff=html 38 | *.xml text diff=html 39 | 40 | *.dat text diff=php 41 | *.inc text diff=php 42 | *.php text diff=php 43 | *.php3 text diff=php 44 | *.tpl text diff=php 45 | 46 | *.ac text 47 | *.am text 48 | *.in text 49 | *.m4 text 50 | 51 | *.bat text 52 | *.sh text 53 | 54 | *.cfg text 55 | *.txt text 56 | 57 | *.iss text 58 | 59 | *.c text diff=cpp 60 | *.cc text diff=cpp 61 | *.cpp text diff=cpp 62 | *.cxx text diff=cpp 63 | *.c++ text diff=cpp 64 | *.h text diff=cpp 65 | *.hh text diff=cpp 66 | *.hpp text diff=cpp 67 | *.ll text diff=cpp 68 | *.rc text 69 | *.uc text 70 | *.yy text diff=cpp 71 | 72 | Changelog text 73 | Makefile* text 74 | 75 | AUTHORS text 76 | COPYING text 77 | FAQ text 78 | INSTALL text 79 | NEWS text 80 | README* text 81 | 82 | -------------------------------------------------------------------------------- /ChangeLog.Android: -------------------------------------------------------------------------------- 1 | 12-18-2010 2 | Show mouse when dragging or moving. 3 | Set Avatar speed to 1-3 ticks/frame. 4 | 12-19-2010 5 | Fixed bug in GumpManager that caused bad rendering and crashes. 6 | Show mouse 'flash'. 7 | 12-25-2010 8 | Opening scene seems to work. 9 | 12-30-2010 10 | Save/restore seems to work. Press 's' to bring up screen. 11 | 12-31-2010 12 | Music works with ogg files placed in /sdcard/Games/exult/music 13 | 1-3-2011 14 | Digital SFX supported with, for example, sqsfxbg.flx, in the 15 | /sdcard/Games/exult directory. 16 | Avatar moves when you drag with the mouse on any area that isn't 17 | draggable. 18 | Fixed a crash when double-clicking doors. 19 | 1-20-2011 20 | Several schedules implemented, and maybe work: 21 | Loiter 22 | Wander 23 | Pace 24 | Sit - You can double-click a chair. 25 | Talk - The mayor approaches you at the start. 26 | Waiter 27 | EatAtInn 28 | Preach (untested) 29 | I suggest removing all files from gamedat, and old savegames too. 30 | 1-25-2011 31 | Weapons are drawn with NPC's. 32 | Shortcut buttons are on the left side, and a few work: Q, T, S, I. 33 | Targeting: You drag with the mouse, and the object it's on shows up 34 | with a red outline. When you release, the action is taken. 35 | 2-24-2011 36 | Implemented spellbook. 37 | Implemented combat. 38 | Most usecode intrinsics are written. 39 | Alt-t = teleport, Alt-g = god mode, Alt-i = infravision 40 | Some of the above might even work a little.:-) 41 | 42 | -------------------------------------------------------------------------------- /src/com/exult/android/shapeinf/FrameUsecodeInfo.java: -------------------------------------------------------------------------------- 1 | package com.exult.android.shapeinf; 2 | import java.io.PushbackInputStream; 3 | import java.io.InputStream; 4 | import com.exult.android.EUtil; 5 | import com.exult.android.ShapeInfo; 6 | 7 | public class FrameUsecodeInfo extends BaseInfo.FrameInfo { 8 | private int usecode; // Usecode function of the frame/quality at hand, 9 | // or -1 for default shape usecode. 10 | private String usecodeName; // Name of usecode fun explicitly assigned. 11 | public int getUsecode() 12 | { return usecode; } 13 | public String getUsecodeName() 14 | { return usecodeName; } 15 | public boolean readNew(InputStream in, int version, boolean patch, int game, 16 | ShapeInfo info) { 17 | PushbackInputStream txtin = (PushbackInputStream) in; 18 | frame = EUtil.ReadInt(txtin); 19 | if (frame < 0) 20 | frame = -1; 21 | else 22 | frame &= 0xff; 23 | quality = EUtil.ReadInt(txtin); 24 | if (quality < 0) 25 | quality = -1; 26 | else 27 | quality &= 255; 28 | boolean type = EUtil.ReadInt(txtin) != 0; 29 | if (type) { 30 | usecodeName = EUtil.ReadStr(in); 31 | usecode = -1; 32 | } else { 33 | usecode = EUtil.ReadInt(txtin, -1); 34 | } 35 | info.setFrameUsecodeInfo(addVectorInfo(this, info.getFrameUsecodeInfo())); 36 | return true; 37 | } 38 | @Override 39 | public boolean read(InputStream in, int version, boolean patch, int game, 40 | ShapeInfo info) { 41 | return new FrameUsecodeInfo().readNew(in, version, patch, game, info); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /res/xml/preferences.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 10 | 15 | 20 | 24 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/com/exult/android/shapeinf/FrameNameInfo.java: -------------------------------------------------------------------------------- 1 | package com.exult.android.shapeinf; 2 | import java.io.PushbackInputStream; 3 | import java.io.InputStream; 4 | import com.exult.android.EUtil; 5 | import com.exult.android.ShapeInfo; 6 | /* 7 | * Information about frame names. 8 | * This is meant to be stored in a totally ordered vector. 9 | */ 10 | public class FrameNameInfo extends BaseInfo.FrameInfo { 11 | private short type; // How the entry is used. 12 | private int msgid; // Item name index in misc_names. 13 | private int othermsg; // Suffix/prefix or default message, depending on type 14 | 15 | public int getType() { 16 | return type; 17 | } 18 | public int getMsgid() { 19 | return msgid; 20 | } 21 | public int getOthermsg() { 22 | return othermsg; 23 | } 24 | private boolean readNew(InputStream in, int version, boolean patch, int game, 25 | ShapeInfo info) { 26 | PushbackInputStream txtin = (PushbackInputStream) in; 27 | frame = EUtil.ReadInt(txtin); 28 | if (frame < 0) 29 | frame = -1; 30 | else 31 | frame &= 0xff; 32 | quality = EUtil.ReadInt(txtin); 33 | if (quality < 0) 34 | quality = -1; 35 | else 36 | quality &= 255; 37 | type = (short)EUtil.ReadInt(txtin); 38 | if (type >= 0) { 39 | msgid = EUtil.ReadInt(txtin); 40 | othermsg = EUtil.ReadInt(txtin, -255); 41 | } 42 | //System.out.println("frameNameInfo for frame " + frame + ", quality = " + quality); 43 | info.setFrameNameInfo(addVectorInfo(this, info.getFrameNameInfo())); 44 | return true; 45 | } 46 | @Override 47 | public boolean read(InputStream in, int version, boolean patch, int game, 48 | ShapeInfo info) { 49 | return (new FrameNameInfo()).readNew(in, version, patch, game, info); 50 | 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/com/exult/android/shapeinf/ArmorInfo.java: -------------------------------------------------------------------------------- 1 | package com.exult.android.shapeinf; 2 | import java.io.InputStream; 3 | import java.io.IOException; 4 | import com.exult.android.*; 5 | 6 | public class ArmorInfo extends BaseInfo implements DataUtils.ReaderFunctor { 7 | private byte prot; // Protection value. 8 | private byte immune; // Weapon_data::damage_type bits. 9 | public static final int is_binary = 1, entry_size = 10; 10 | public int getProt() { 11 | return ((int)prot)&0xff; 12 | } 13 | public int getImmune() { 14 | return ((int)immune)&0xff; 15 | } 16 | static int getInfoFlag() { 17 | return 4; 18 | } 19 | public int getBaseStrength() { 20 | int strength = prot; 21 | if (immune != 0) // Double strength for any immunities? Give bonus for each? 22 | strength *= 2; 23 | return strength; 24 | } 25 | public int getBaseXpValue() { 26 | return ((int)prot)&0xff; 27 | } 28 | private boolean readNew(InputStream in, int version, 29 | boolean patch, int game, ShapeInfo info) { 30 | byte buf[] = new byte[entry_size-2]; // Entry length. 31 | try { 32 | in.read(buf); 33 | } catch (IOException e) { 34 | setInvalid(true); 35 | System.out.println("Error reading ARMOR info"); 36 | return false; 37 | } 38 | int ind = 0; 39 | if (buf[entry_size-3] == 0xff) { // means delete entry. 40 | setInvalid(true); 41 | info.setArmorInfo(null); 42 | return true; 43 | } 44 | prot = buf[ind++]; // Protection value. 45 | ind++; // Unknown. 46 | immune = buf[ind++]; // Immunity flags. 47 | // Last 5 are unknown/unused. 48 | return true; 49 | } 50 | @Override 51 | public boolean read(InputStream in, int version, 52 | boolean patch, int game, ShapeInfo info) { 53 | return (new ArmorInfo()).readNew(in, version, patch, game, info); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/com/exult/android/EFileManager.java: -------------------------------------------------------------------------------- 1 | package com.exult.android; 2 | import java.util.TreeMap; 3 | 4 | public class EFileManager { 5 | static EFileManager instance; 6 | private TreeMap fileList; 7 | private EFileManager() { 8 | fileList = new TreeMap(); 9 | } 10 | public static EFileManager instanceOf() { 11 | if (instance == null) 12 | instance = new EFileManager(); 13 | return instance; 14 | } 15 | public EFile getFileObject(String nm) { 16 | if (nm == null) 17 | return null; 18 | EFile file = fileList.get(nm); 19 | if (file != null) 20 | return file; 21 | String fname = EUtil.U7exists(nm); 22 | if (fname == null) 23 | return null; 24 | if (EUtil.isFlex(fname)) 25 | file = new FlexFile(fname, nm); 26 | /* +++++FINISH 27 | else if (EUtil.isIff(s.name)) 28 | uf = new IFFFile(s.name); 29 | else if (Table::is_table(s.name)) 30 | uf = new TableFile(s.name); 31 | */ 32 | else 33 | file = new EFile(fname, nm); // Flat file. 34 | // Failed 35 | if (file == null) { 36 | return null; 37 | } 38 | fileList.put(nm, file); 39 | return file; 40 | } 41 | /* 42 | * Try files in reverse order, looking for given objnum in file. 43 | */ 44 | public EFile getFileObject(String nm1, String nm2) { 45 | EFile file = getFileObject(nm2); 46 | if (file == null) 47 | file = getFileObject(nm1); 48 | return file; 49 | } 50 | public void remove(EFile file) { 51 | String nm = file.getIdentifier(); 52 | fileList.remove(nm); 53 | } 54 | /* 55 | * Retrieve given obj with file. 56 | */ 57 | public byte[] retrieve(String nm, int objnum) { 58 | EFile file = getFileObject(nm); 59 | if (file != null) { 60 | byte res[] = file.retrieve(objnum); 61 | if (res != null) 62 | return res; 63 | } 64 | return null; 65 | } 66 | /* 67 | * Try files in reverse order, looking for given objnum in file. 68 | */ 69 | public byte[] retrieve(String nm1, String nm2, int objnum) { 70 | byte res[] = retrieve(nm2, objnum); 71 | if (res == null) 72 | res = retrieve(nm1, objnum); 73 | return res; 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /src/com/exult/android/PlasmaThread.java: -------------------------------------------------------------------------------- 1 | package com.exult.android; 2 | 3 | public class PlasmaThread extends Thread { 4 | static final int BG_PLASMA_START_COLOR = 128; 5 | static final int BG_PLASMA_CYCLE_RANGE = 80; 6 | static final int SI_PLASMA_START_COLOR = 16; 7 | static final int SI_PLASMA_CYCLE_RANGE = 96; 8 | private int startColor, cycleRange; 9 | private Palette pal; 10 | private GameWindow gwin; 11 | public boolean finish = false; 12 | private void plasma(int w, int h, int x, int y, int startc, int endc) { 13 | ImageBuf win = GameSingletons.win; 14 | win.fill8((byte)startc, w, h, x, y); 15 | for (int i=0; i < w*h; i += 16) { // Too many loops makes this too slow. 16 | int pc = startc + EUtil.rand()%(endc-startc+1); 17 | int px = x + EUtil.rand()%w; 18 | int py = y + EUtil.rand()%h; 19 | for (int j=0; j < 6; j++) { 20 | int px2 = px + EUtil.rand()%17 - 8; 21 | int py2 = py + EUtil.rand()%17 - 8; 22 | win.fill8((byte)pc, 3, 1, px2 - 1, py2); 23 | win.fill8((byte)pc, 1, 3, px2, py2 - 1); 24 | } 25 | } 26 | gwin.setPainted(); 27 | } 28 | public PlasmaThread(Palette p) { 29 | pal = p; 30 | gwin = GameSingletons.gwin; 31 | if (GameSingletons.game.isBG()) { 32 | startColor = BG_PLASMA_START_COLOR; 33 | cycleRange = BG_PLASMA_CYCLE_RANGE; 34 | } else { 35 | startColor = SI_PLASMA_START_COLOR; 36 | cycleRange = SI_PLASMA_CYCLE_RANGE; 37 | } 38 | synchronized(gwin.getWin()) { 39 | // Load the palette 40 | if (GameSingletons.game.isBG()) 41 | pal.load(EFile.INTROPAL_DAT, EFile.PATCH_INTROPAL, 2); 42 | else 43 | pal.load(EFile.MAINSHP_FLX, EFile.PATCH_MAINSHP, 1); 44 | pal.apply(); 45 | plasma(gwin.getWidth(), gwin.getHeight(), 0, 0, startColor, startColor + cycleRange - 1); 46 | } 47 | 48 | } 49 | @Override 50 | public void run() { 51 | System.out.println("PlasmaThread: run: started: " + GameSingletons.tqueue.ticks); 52 | while (!finish) { 53 | for(int i = 0; i < 4; ++i) 54 | gwin.getWin().rotateColors(startColor, cycleRange); 55 | gwin.setPainted(); 56 | try { 57 | sleep(100); 58 | } catch (InterruptedException e) { 59 | finish = true; 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/com/exult/android/shapeinf/PaperdollNpc.java: -------------------------------------------------------------------------------- 1 | package com.exult.android.shapeinf; 2 | import java.io.PushbackInputStream; 3 | import java.io.InputStream; 4 | import com.exult.android.ShapeInfo; 5 | import com.exult.android.EUtil; 6 | 7 | 8 | public class PaperdollNpc extends BaseInfo { 9 | boolean isFemale; // Is the NPC Female (or more specifically not male) 10 | boolean translucent; // If the paperdoll should be drawn translucently or not 11 | 12 | // Body info 13 | short bodyShape; // Body Shape 14 | short bodyFrame; // Body Frame 15 | 16 | short headShape; // Head Shape 17 | short headFrame; // Normal Head Frame 18 | short headFrameHelm; // Frame when wearing a helm 19 | 20 | short armsShape; // Shape for Arms 21 | short armsFrame[] = new short[3]; // Frames for arms. 22 | 23 | private boolean readNew(InputStream in, int version, boolean patch, int game, 24 | ShapeInfo info) { 25 | PushbackInputStream txtin = (PushbackInputStream)in; 26 | int sexflag = EUtil.ReadInt(txtin); 27 | if (sexflag == -0xff) { // means delete entry. 28 | info.setNpcPaperdollInfo(null); 29 | setInvalid(true); 30 | return true; 31 | } 32 | isFemale = sexflag != 0; 33 | translucent = EUtil.ReadInt(txtin) != 0; 34 | bodyShape = (short)EUtil.ReadInt(txtin); 35 | bodyFrame = (short)EUtil.ReadInt(txtin); 36 | headShape = (short)EUtil.ReadInt(txtin); 37 | headFrame = (short)EUtil.ReadInt(txtin); 38 | headFrameHelm = (short)EUtil.ReadInt(txtin); 39 | armsShape = (short)EUtil.ReadInt(txtin); 40 | armsFrame[0] = (short)EUtil.ReadInt(txtin); 41 | armsFrame[1] = (short)EUtil.ReadInt(txtin); 42 | armsFrame[2] = (short)EUtil.ReadInt(txtin); 43 | if (version < 3) 44 | // We need this for backward compatibility. 45 | // We use the setter methods sp that the info 46 | // will get saved by ES if that is needed. 47 | info.setGumpData(EUtil.ReadInt(txtin, -1), -1); 48 | 49 | info.setNpcPaperdollInfo(this); 50 | return true; 51 | } 52 | @Override 53 | public boolean read(InputStream in, int version, boolean patch, int game, 54 | ShapeInfo info) { 55 | return (new PaperdollNpc()).readNew(in, version, patch, game, info); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/com/exult/android/AudioSample.java: -------------------------------------------------------------------------------- 1 | package com.exult.android; 2 | import java.io.InputStream; 3 | import java.io.ByteArrayInputStream; 4 | import java.io.IOException; 5 | /* 6 | Copyright (C) 2005 The Pentagram team 7 | Copyright (C) 2010 The Exult team 8 | 9 | This program is free software; you can redistribute it and/or 10 | modify it under the terms of the GNU General Public License 11 | as published by the Free Software Foundation; either version 2 12 | of the License, or (at your option) any later version. 13 | 14 | This program is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with this program; if not, write to the Free Software 21 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 22 | */ 23 | 24 | //CURRENTLY not finished and not used. 25 | public class AudioSample { 26 | protected int sampleRate; 27 | protected int bits; 28 | protected boolean stereo; 29 | protected int frameSize; 30 | protected int decompressorSize; 31 | protected int length; 32 | 33 | protected int bufferSize; 34 | protected byte buffer[]; 35 | protected int refcount; 36 | 37 | public AudioSample(byte buf[], int sz) { 38 | this.buffer = buf; 39 | this.bufferSize = sz; 40 | refcount = 1; 41 | } 42 | public static AudioSample createAudioSample(byte data[], int size) { 43 | InputStream in = new ByteArrayInputStream(data, 0, size); 44 | if (VocAudioSample.isThis(in)) 45 | return new VocAudioSample(data,size); 46 | //++MORE 47 | else 48 | return null; 49 | } 50 | 51 | static class VocAudioSample extends AudioSample { 52 | public VocAudioSample(byte buf[], int sz) { 53 | super(buf, sz); 54 | } 55 | public static boolean isThis(InputStream in) { 56 | byte buf[] = new byte[19]; 57 | try { 58 | in.read(buf); 59 | if (new String(buf).equals("Creative Voice File")) 60 | return true; 61 | } catch (IOException e) { 62 | return false; 63 | } 64 | return false; 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/com/exult/android/FlexFile.java: -------------------------------------------------------------------------------- 1 | package com.exult.android; 2 | import java.io.IOException; 3 | 4 | public class FlexFile extends EFile { 5 | public static final int EXULT_FLEX_MAGIC2 = 0x0000cc00; 6 | public static final int orig = 0; // Original U7 version. 7 | public static final int exultV2 = 1;// Exult extension for IFIX files. 8 | byte title[]; // 80 bytes 9 | int magic1; 10 | int count; 11 | int magic2; 12 | int padding[]; // 9 words 13 | static class Reference { 14 | int offset; 15 | int size; 16 | byte buf[]; 17 | Reference() { 18 | offset = 0; size = 0; 19 | buf = null; 20 | } 21 | } 22 | Reference objects[]; 23 | public FlexFile(String fname, String id) { 24 | super(fname, id); 25 | try { 26 | title = new byte[80]; 27 | file.seek(0); 28 | file.read(title); 29 | magic1 = EUtil.Read4(file); 30 | count = EUtil.Read4(file); 31 | magic2 = EUtil.Read4(file); 32 | if (magic1!=0xffff1a00L) 33 | // Not a flex file. 34 | ; // Throw exception? 35 | padding = new int[9]; 36 | for (int i=0; i<9; i++) 37 | padding[i] = EUtil.Read4(file); 38 | file.seek(128); // Should already be there. 39 | objects = new Reference[count]; 40 | for (int c = 0; c < count; c++) { 41 | Reference f = new Reference(); 42 | f.offset = EUtil.Read4(file); 43 | f.size = EUtil.Read4(file); 44 | objects[c] = f; 45 | } 46 | } catch (IOException e) { 47 | } 48 | } 49 | public int getVers() { 50 | return (magic2&~0xff) == EXULT_FLEX_MAGIC2 ? exultV2 : orig; 51 | } 52 | public int numberOfObjects() { 53 | return objects.length; 54 | } 55 | public void close() { 56 | super.close(); 57 | int cnt = objects.length; 58 | for (int i = 0; i < cnt; ++i) 59 | objects[i] = null; 60 | } 61 | public byte [] retrieve(int objnum) { 62 | if (objnum < 0 || objnum >= objects.length) 63 | return null; 64 | Reference ref = objects[objnum]; 65 | if (ref.buf == null) 66 | try { 67 | file.seek(ref.offset); 68 | ref.buf = new byte[ref.size]; 69 | file.read(ref.buf); 70 | } catch (IOException e) { 71 | return null; 72 | } 73 | return ref.buf; 74 | } 75 | public String getArchiveType() { 76 | return "FLEX"; 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /src/com/exult/android/VirtueStoneObject.java: -------------------------------------------------------------------------------- 1 | package com.exult.android; 2 | import java.io.OutputStream; 3 | import java.io.IOException; 4 | 5 | /* 6 | * A virtue stone can be set to a position on the map. 7 | */ 8 | public class VirtueStoneObject extends IregGameObject { 9 | private Tile pos; // Position it teleports to. 10 | private int map; // Map to teleport to. 11 | 12 | public VirtueStoneObject(int shapenum, int framenum, int tilex, 13 | int tiley, int lft) { 14 | super(shapenum, framenum, tilex, tiley, lft); 15 | pos = new Tile(); 16 | } 17 | public void setTargetPos(Tile t) // Set/get position. 18 | { pos.set(t); } 19 | // Set position from IREG data. 20 | public void setTargetPos(byte tilex, byte tiley, byte schunk, byte lft) { 21 | pos.tx = (short)((schunk%12)*EConst.c_tiles_per_schunk + tilex); 22 | pos.ty = (short)((schunk/12)*EConst.c_tiles_per_schunk + tiley); 23 | pos.tz = lift; 24 | } 25 | public Tile getTargetPos() 26 | { return pos; } 27 | public final int getTargetMap() // Get/set map. 28 | { return map; } 29 | public final void setTargetMap(int m) 30 | { map = m; } 31 | @Override // Write out to IREG file. 32 | public void writeIreg(OutputStream out) throws IOException { 33 | byte buf[] = new byte[20]; // 12-byte entry. 34 | int ind = writeCommonIreg(12, buf); 35 | // Write tilex, tiley. 36 | buf[ind++] = (byte)(pos.tx%EConst.c_tiles_per_schunk); 37 | buf[ind++] = (byte)(pos.ty%EConst.c_tiles_per_schunk); 38 | // Get superchunk index. 39 | int sx = pos.tx/EConst.c_tiles_per_schunk, 40 | sy = pos.ty/EConst.c_tiles_per_schunk; 41 | buf[ind++] = (byte)(sy*12 + sx); // Write superchunk #. 42 | buf[ind++] = (byte) pos.tz; // Finally, lift in entry[7].??Guess+++ 43 | buf[ind++] = 0; // Entry[8] unknown. 44 | buf[ind++] = (byte)((getLift()&15)<<4); // Stone's lift in entry[9]. 45 | buf[ind++] = (byte)map; // Entry[10]. Unknown; using to store map. 46 | buf[ind++] = 0; // Entry[11]. Unknown. 47 | out.write(buf, 0, ind); 48 | } 49 | @Override // Get size of IREG. Returns -1 if can't write to buffer 50 | public int getIregSize() { 51 | // These shouldn't ever happen, but you never know 52 | if (gumpman.findGump(this) != null || UsecodeScript.find(this) != null) 53 | return -1; 54 | 55 | return 8 + getCommonIregSize(); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/com/exult/android/VideoPlayer.java: -------------------------------------------------------------------------------- 1 | package com.exult.android; 2 | 3 | import android.app.Activity; 4 | import android.media.MediaPlayer; 5 | import android.view.View; 6 | import android.widget.VideoView; 7 | 8 | public class VideoPlayer extends GameSingletons { 9 | private static VideoPlayer instance; 10 | private View mainView, gameView; 11 | private VideoView video; 12 | private Activity exult; 13 | private Thread onCompleteThread; 14 | 15 | // Play, and execute 'thread' when done. 16 | public VideoPlayer(String fileName, Thread doneThread) { 17 | instance = this; 18 | onCompleteThread = doneThread; 19 | exult = ExultActivity.instanceOf(); 20 | mainView = exult.findViewById(R.id.main_layout); 21 | gameView = exult.findViewById(R.id.game); 22 | video = (VideoView) exult.findViewById(R.id.video_view); 23 | MediaPlayer.OnCompletionListener onComplete = new MediaPlayer.OnCompletionListener() { 24 | @Override 25 | public void onCompletion(MediaPlayer mp) { 26 | close(); 27 | } 28 | }; 29 | video.setOnCompletionListener(onComplete); 30 | video.setOnErrorListener(new MediaPlayer.OnErrorListener() { 31 | @Override 32 | public boolean onError(MediaPlayer mp, int what, int extra) { 33 | String msg = "Video: Error callback, what = " + what + 34 | ", extra = " + extra; 35 | System.out.println(msg); 36 | ExultActivity.showToast(msg); 37 | close(); 38 | return true; 39 | } 40 | }); 41 | String fullName = EUtil.getSystemPath("