Merge branch 'github_downloader'

This commit is contained in:
xawotihs
2014-01-18 12:11:08 +01:00
11 changed files with 495 additions and 27 deletions

View File

@@ -80,7 +80,6 @@ public class SDLActivity extends Activity implements OnKeyListener
public Boolean mErrorHappened = false;
public final static String RES_FOLDER = Environment.getExternalStorageDirectory().getPath() + "/Wagic/Res/";
public static String RES_FILENAME = "core_0184.zip";
public static final String RES_URL = "http://wagic.googlecode.com/files/";
public String systemFolder = Environment.getExternalStorageDirectory().getPath() + "/Wagic/Res/";
private String userFolder;
@@ -307,7 +306,7 @@ public class SDLActivity extends Activity implements OnKeyListener
private void startDownload()
{
String url = RES_URL + RES_FILENAME;
String url = getResourceUrl();
if (!checkStorageState())
{
Log.e(TAG, "Error in initializing storage space.");
@@ -437,7 +436,7 @@ public class SDLActivity extends Activity implements OnKeyListener
mContext = this.getApplicationContext();
// get the current version of the app to set the core filename
String versionCodeString = getApplicationCode();
RES_FILENAME = "core_" + versionCodeString + ".zip";
RES_FILENAME = getResourceName();
StorageOptions.determineStorageOptions();
checkStorageLocationPreference();
@@ -525,6 +524,9 @@ public class SDLActivity extends Activity implements OnKeyListener
}
// C functions we call
public static native String getResourceUrl();
public static native String getResourceName();
public static native void nativeInit();
public static native void nativeQuit();

View File

@@ -3,7 +3,7 @@
<property file="build.properties" />
<property file="build.number.properties" />
<property environment="env"/>
<path id="groovy.class.path" >
<fileset dir="${groovy.dir}" />
</path>
@@ -90,7 +90,8 @@ Author: Michael Nguyen
#define WAGIC_RESOURCE_VERSION VERSION_FILE(WAGIC_VERSION_MAJOR, WAGIC_VERSION_MEDIUM, WAGIC_VERSION_MINOR)
#define WAGIC_VERSION_STRING VERSION_STRINGIFY(WAGIC_VERSION)
#define WAGIC_CORE_VERSION_STRING "core_" VERSION_STRINGIFY(WAGIC_RESOURCE_VERSION)
#define WAGIC_RESOURCE_NAME WAGIC_CORE_VERSION_STRING ".zip"
#define WAGIC_RESOURCE_NAME "Wagic-core.zip"
#define WAGIC_RESOURCE_URL "https://github.com/WagicProject/wagic/releases/download/${env.RELEASE_NAME}/" WAGIC_RESOURCE_NAME
#endif

View File

@@ -283,6 +283,7 @@ HEADERS += \
# JGE, could probably be moved outside
SOURCES += \
../../JGE/src/Downloader.cpp\
../../JGE/src/Encoding.cpp\
../../JGE/src/JAnimator.cpp\
../../JGE/src/JApp.cpp\
@@ -320,6 +321,7 @@ SOURCES += \
../../JGE/src/zipFS/zstream.cpp
HEADERS += \
../../JGE/include/Downloader.h\
../../JGE/include/Threading.h\
../../JGE/include/decoder_prx.h\
../../JGE/include/DebugRoutines.h\