Skip to content
This repository has been archived by the owner on Nov 4, 2023. It is now read-only.

Commit

Permalink
Emergency fix for Android LoadState
Browse files Browse the repository at this point in the history
  • Loading branch information
blitz-research committed Apr 4, 2013
1 parent 6958c75 commit 953ee7b
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 3 deletions.
4 changes: 3 additions & 1 deletion VERSIONS.TXT
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ NOTE: If you're having trouble with a new version, try deleting '.build' dirs!!!

***** v70b *****

Android LoadState now checks for pre v67 state if v67 state not found - my bad, I renamed the state 'key' in v67...
Added temp LoadState_V66b() to Android target for kludging around LoadState issues. If you have recently updated a <v67 app to >=v67, and users have mysteriously 'lost' their save games, you can use this to recover their old save games. However, you might want to let user decide whether to use 'old' or 'new' save game.

Android LoadState now checks for <v67 state data if >=v67 state data not found - my bad, I renamed the state 'key' in v67.


***** V70 *****
Expand Down
2 changes: 1 addition & 1 deletion bananas/mak/suspendtest/suspendtest.monkey
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Class MyApp Extends App

Method OnCreate()

Local state$=LoadState()
Local state$=LoadState_V66b()
If state
creates=Int( state )+1
Else
Expand Down
2 changes: 1 addition & 1 deletion modules/brl/markdown.monkey
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ Class Markdown
Local i1:=i0+l
While i1<src.Length
Local c:=src[i1]
If (c=95) Or (c>=65 And c<=90) Or (c>=97 And c<=122) Or (i1>i0+l And c>=48 And c<=57)
If (c=95) Or (c>=65 And c<=90) Or (c>=97 And c<=122) Or (i1>i0+l And c>=48 And c<=57)
i1+=1
Continue
Endif
Expand Down
3 changes: 3 additions & 0 deletions targets/android/modules/monkeytarget.monkey
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ Import brl.gametarget
Import "native/androidgame.java"
Import "native/monkeytarget.java"

Extern

Function LoadState_V66b:String()="BBAndroidGame.LoadState_V66b"
6 changes: 6 additions & 0 deletions targets/android/modules/native/androidgame.java
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,12 @@ public String LoadState(){
return state;
}

//Temporary fix!
static public String LoadState_V66b(){
SharedPreferences prefs=_androidGame._activity.getPreferences( 0 );
return prefs.getString( "gxtkAppState","" );
}

public boolean PollJoystick( int port,float[] joyx,float[] joyy,float[] joyz,boolean[] buttons ){
if( port!=0 ) return false;
joyx[0]=_joyx[0];joyy[0]=_joyy[0];joyz[0]=_joyz[0];
Expand Down

0 comments on commit 953ee7b

Please sign in to comment.