diff --git a/project/java/translations/values-ru/strings.xml b/project/java/translations/values-ru/strings.xml index f557c4aac..7e4768449 100644 --- a/project/java/translations/values-ru/strings.xml +++ b/project/java/translations/values-ru/strings.xml @@ -103,7 +103,7 @@ Физическая кнопка Наэкранная лупа Настройки видео -Сгладить видео +Линейное сглаживание видео Очень медленно Нажатие с задержкой Быстрое нажатие diff --git a/project/java/translations/values-uk/strings.xml b/project/java/translations/values-uk/strings.xml index bc698a5ca..b69700683 100644 --- a/project/java/translations/values-uk/strings.xml +++ b/project/java/translations/values-uk/strings.xml @@ -103,7 +103,7 @@ Фізична кнопка Наекранна лупа Налаштування відео -Згладити відео +Лінійне сглажування відео Дуже повільно Натискання з затримкою Швидке натискання diff --git a/project/java/translations/values/strings.xml b/project/java/translations/values/strings.xml index 577d610a3..bcc71dc40 100644 --- a/project/java/translations/values/strings.xml +++ b/project/java/translations/values/strings.xml @@ -141,7 +141,7 @@ Touch all edges of the screen, press BACK when done Video settings - Smooth the video + Linear video filtering Separate thread for video, will increase FPS on some devices Tap to start typing, press Back when done diff --git a/project/jni/application/biniax2/AndroidAppSettings.cfg b/project/jni/application/biniax2/AndroidAppSettings.cfg index 136798a3d..24c4b60a1 100644 --- a/project/jni/application/biniax2/AndroidAppSettings.cfg +++ b/project/jni/application/biniax2/AndroidAppSettings.cfg @@ -4,8 +4,8 @@ LibSdlVersion=1.2 AppName="Biniax2" AppFullName=com.biniax.sdl ScreenOrientation=h -InhibitSuspend=n -AppDataDownloadUrl="!Game data|data.zip" +InhibitSuspend=y +AppDataDownloadUrl="!Game data|data3.zip" VideoDepthBpp=16 NeedDepthBuffer=n NeedStencilBuffer=n @@ -30,12 +30,12 @@ RedefinedKeys="RETURN" AppTouchscreenKeyboardKeysAmount=0 AppTouchscreenKeyboardKeysAmountAutoFire=0 RedefinedKeysScreenKb="RETURN SPACE" -StartupMenuButtonTimeout=0 -HiddenMenuOptions='DisplaySizeConfig' -FirstStartMenuOptions='' +StartupMenuButtonTimeout=1000 +HiddenMenuOptions='DisplaySizeConfig MouseConfigMainMenu' +FirstStartMenuOptions='new Settings.VideoSettingsConfig()' MultiABI=n -AppVersionCode=1301 -AppVersionName="1.3.01" +AppVersionCode=1401 +AppVersionName="1.4.01" ResetSdlConfigForThisVersion=n DeleteFilesOnUpgrade="%" CompiledLibraries="sdl_image sdl_mixer" diff --git a/project/jni/application/biniax2/AndroidData/data.zip b/project/jni/application/biniax2/AndroidData/data3.zip similarity index 99% rename from project/jni/application/biniax2/AndroidData/data.zip rename to project/jni/application/biniax2/AndroidData/data3.zip index 98699c710..16748073d 100644 Binary files a/project/jni/application/biniax2/AndroidData/data.zip and b/project/jni/application/biniax2/AndroidData/data3.zip differ diff --git a/project/jni/application/biniax2/src/biniax.c b/project/jni/application/biniax2/src/biniax.c index 25afb9d46..bf9d4499c 100644 --- a/project/jni/application/biniax2/src/biniax.c +++ b/project/jni/application/biniax2/src/biniax.c @@ -151,11 +151,13 @@ int main( int argc, char *argv[] ) loadHiScore( &Game ); enterState = cStateGame; break; +#ifndef __ANDROID__ case cOptionNewMultiplayer: initGame( &Game ); Game.mode = cModeMultiplayer; enterState = cStateGame; break; +#endif case cOptionHall: enterState = cStateHallView; break; @@ -455,6 +457,7 @@ BNX_BOOL takePair( BNX_GAME *game, BNX_INT16 x, BNX_INT16 y, BNX_INT16 pIndex ) { BNX_UINT8 pair = game->grid[ x ][ y ]; BNX_BOOL cantake = BNX_FALSE; + BNX_UINT8 player = game->player[ pIndex ].e; if ( pair == 0 ) { @@ -462,12 +465,12 @@ BNX_BOOL takePair( BNX_GAME *game, BNX_INT16 x, BNX_INT16 y, BNX_INT16 pIndex ) return BNX_TRUE; } - if ( pairLeft( pair ) == game->player[ pIndex ].e ) + if ( pairLeft( pair ) == player ) { game->player[ pIndex ].e = pairRight( pair ); cantake = BNX_TRUE; } - else if ( pairRight( pair ) == game->player[ pIndex ].e ) + else if ( pairRight( pair ) == player ) { game->player[ pIndex ].e = pairLeft( pair ); cantake = BNX_TRUE; @@ -479,6 +482,7 @@ BNX_BOOL takePair( BNX_GAME *game, BNX_INT16 x, BNX_INT16 y, BNX_INT16 pIndex ) if ( cantake == BNX_TRUE ) { + gfxNewFallingBlock( x, y, player ); game->grid[ x ][ y ] = cPlayerFlag; game->score[ pIndex ] += cScoreStep; } @@ -489,7 +493,7 @@ BNX_BOOL takePair( BNX_GAME *game, BNX_INT16 x, BNX_INT16 y, BNX_INT16 pIndex ) BNX_BOOL moveUp( BNX_GAME *game, BNX_INT16 pIndex ) { BNX_PLAYER *p = &game->player[ pIndex ]; - BNX_INT8 newY = p->y + 1; + BNX_INT16 newY = p->y + 1; if ( newY < cGridY ) { @@ -507,7 +511,7 @@ BNX_BOOL moveUp( BNX_GAME *game, BNX_INT16 pIndex ) BNX_BOOL moveDown( BNX_GAME *game, BNX_INT16 pIndex ) { BNX_PLAYER *p = &game->player[ pIndex ]; - BNX_INT8 newY = p->y - 1; + BNX_INT16 newY = p->y - 1; if ( newY >= 0 ) { @@ -525,7 +529,7 @@ BNX_BOOL moveDown( BNX_GAME *game, BNX_INT16 pIndex ) BNX_BOOL moveLeft( BNX_GAME *game, BNX_INT16 pIndex ) { BNX_PLAYER *p = &game->player[ pIndex ]; - BNX_INT8 newX = p->x - 1; + BNX_INT16 newX = p->x - 1; if ( newX >= 0 ) { @@ -543,7 +547,7 @@ BNX_BOOL moveLeft( BNX_GAME *game, BNX_INT16 pIndex ) BNX_BOOL moveRight( BNX_GAME *game, BNX_INT16 pIndex ) { BNX_PLAYER *p = &game->player[ pIndex ]; - BNX_INT8 newX = p->x + 1; + BNX_INT16 newX = p->x + 1; if ( newX < cGridX ) { @@ -633,6 +637,7 @@ BNX_INT16 gameSession( BNX_GAME *game ) BNX_BOOL prevIngame = BNX_FALSE; inpInit(); + gfxInitFallingBlocks(); while ( bgameSes ) { startTime = sysGetTime(); diff --git a/project/jni/application/biniax2/src/game.h b/project/jni/application/biniax2/src/game.h index 6d5ded7f3..47439faa6 100644 --- a/project/jni/application/biniax2/src/game.h +++ b/project/jni/application/biniax2/src/game.h @@ -136,7 +136,9 @@ enum BNX_Options cOptionContinue = 0, cOptionNewRealtime, cOptionNewTurn, +#ifndef __ANDROID__ cOptionNewMultiplayer, +#endif cOptionHall, cOptionHelp, cOptionQuit, diff --git a/project/jni/application/biniax2/src/gfx.c b/project/jni/application/biniax2/src/gfx.c index 821249d61..504e29271 100644 --- a/project/jni/application/biniax2/src/gfx.c +++ b/project/jni/application/biniax2/src/gfx.c @@ -30,7 +30,6 @@ INCLUDES #include #include -#include #include "inc.h" #include "txt.h" @@ -55,6 +54,9 @@ void gfxNewParticle( BNX_INT16 x, BNX_INT16 y ); void gfxUpdateParticles(); void gfxRenderParticles(); +void gfxUpdateFallingBlocks(); +void gfxRenderFallingBlocks(); + void gfxRoadmap( BNX_INT32 prev, BNX_INT32 score ); @@ -93,6 +95,7 @@ BNX_BOOL gfxInit() } gfxInitParticles(); + gfxInitFallingBlocks(); return BNX_TRUE; } @@ -311,6 +314,9 @@ void gfxRenderGame( BNX_GAME *game ) gfxRenderParticles(); gfxUpdateParticles(); + gfxRenderFallingBlocks(); + gfxUpdateFallingBlocks(); + /* JUMPY TEXT */ gfxUpdateJumpyText(); gfxRenderJumpyText(); @@ -747,7 +753,9 @@ BNX_BOOL gfxLoadImage( char *filename, SDL_Surface **img ) temp = IMG_Load( filename ); if ( temp != 0 ) { - *img = SDL_DisplayFormat( temp ); + *img = ( temp->format->Amask == 0 ) ? + SDL_DisplayFormat( temp ) : + SDL_DisplayFormatAlpha( temp ); SDL_FreeSurface( temp ); return BNX_TRUE; } @@ -1088,3 +1096,68 @@ void gfxRenderParticles() } } } + +void gfxInitFallingBlocks() +{ + BNX_INT16 j; + + for ( j = 0; j < cGfxMaxParticles; ++j ) + { + _Gfx.falling_blocks[ j ].id = -1; + } +} + +void gfxNewFallingBlock( BNX_INT16 x, BNX_INT16 y, BNX_INT16 id ) +{ + BNX_INT16 j; + + for ( j = 0; j < cGfxMaxParticles; ++j ) + { + if ( _Gfx.falling_blocks[ j ].id < 0 ) + { + break; + } + } + j %= cGfxMaxParticles; + _Gfx.falling_blocks[ j ].id = id; + _Gfx.falling_blocks[ j ].x = cGfxZeroX + x * cGfxPairPlusX; + _Gfx.falling_blocks[ j ].y = cGfxZeroY + y * cGfxPairPlusY + cGfxParticleFall; + _Gfx.falling_blocks[ j ].dx = cGfxParticleSpeed - ( sysRand( cGfxParticleSpeed<<1 ) + cGfxParticleMinSp ); + _Gfx.falling_blocks[ j ].dy = cGfxParticleFall; +} + +void gfxUpdateFallingBlocks() +{ + BNX_INT16 j; + + for ( j = 0; j < cGfxMaxParticles; ++j ) + { + if ( _Gfx.falling_blocks[ j ].id >= 0 ) + { + _Gfx.falling_blocks[ j ].x += _Gfx.falling_blocks[ j ].dx; + _Gfx.falling_blocks[ j ].y += _Gfx.falling_blocks[ j ].dy; + _Gfx.falling_blocks[ j ].dy += cGfxParticleFall; + if( _Gfx.falling_blocks[ j ].y >= cGfxScreenY ) + _Gfx.falling_blocks[ j ].id = -1; + } + } +} + +void gfxRenderFallingBlocks() +{ + BNX_INT16 j; + SDL_Rect pos; + + for ( j = 0; j < cGfxMaxParticles; ++j ) + { + if ( _Gfx.falling_blocks[ j ].id >= 0 ) + { + pos.x = _Gfx.falling_blocks[ j ].x; + pos.y = _Gfx.falling_blocks[ j ].y; + + SDL_BlitSurface( _Gfx.elements[ _Gfx.falling_blocks[ j ].id ], NULL, _Gfx.screen, &pos ); + pos.x += cGfxNextPlusX; + SDL_BlitSurface( _Gfx.elements[ _Gfx.falling_blocks[ j ].id ], NULL, _Gfx.screen, &pos ); + } + } +} diff --git a/project/jni/application/biniax2/src/gfx.h b/project/jni/application/biniax2/src/gfx.h index 28927d953..10bfdb350 100644 --- a/project/jni/application/biniax2/src/gfx.h +++ b/project/jni/application/biniax2/src/gfx.h @@ -178,7 +178,9 @@ static BNX_BOX _BNX_MENU_BOXES[ cMaxOptions ] = { { 241, 395, 420, 420 }, { 232, 430, 426, 457 }, { 296, 468, 364, 492 }, +#ifndef __ANDROID__ { 295, 503, 362, 528 } +#endif }; static char virtualKBD[ cGfxKeyGridY ][ cGfxKeyGridX ] = { @@ -204,6 +206,15 @@ typedef struct BNX_PARTICLE } BNX_PARTICLE; +typedef struct BNX_FALLINGBLOCK +{ + BNX_INT16 x; + BNX_INT16 y; + BNX_INT16 dx; + BNX_INT16 dy; + BNX_INT16 id; +} BNX_FALLINGBLOCK; + typedef struct BNX_JUMPYTEXT { BNX_INT16 x; @@ -238,6 +249,7 @@ typedef struct BNX_GFX BNX_JUMPYTEXT jtext; BNX_PARTICLE particle[ cGfxMaxParticles ]; + BNX_FALLINGBLOCK falling_blocks[ cGfxMaxParticles ]; } BNX_GFX; @@ -273,6 +285,9 @@ BNX_INT16 gfxGetMenuOption( BNX_INP *inp ); void gfxGetHelpPen( BNX_INP *inp ); +void gfxInitFallingBlocks(); +void gfxNewFallingBlock( BNX_INT16 x, BNX_INT16 y, BNX_INT16 id ); + /****************************************************************************** HELPER FUNCTIONS ******************************************************************************/ diff --git a/project/jni/application/biniax2/src/hof.c b/project/jni/application/biniax2/src/hof.c index aede6a22d..d634d7ddf 100644 --- a/project/jni/application/biniax2/src/hof.c +++ b/project/jni/application/biniax2/src/hof.c @@ -28,7 +28,6 @@ For complete product license refer to LICENSE.TXT file INCLUDES ******************************************************************************/ #include -#include #include "inc.h" @@ -222,10 +221,6 @@ BNX_BOOL hofEnter( BNX_GAME *game ) strcpy( recEntry->name, " " ); recEntry->score = game->score[ cPlayer1 ]; - #ifdef __ANDROID__ - //strcpy( recEntry->name, "Player" ); - //SDL_ANDROID_GetScreenKeyboardTextInput(recEntry->name, 30); - #endif inpInit(); do { diff --git a/project/jni/application/biniax2/src/txt.h b/project/jni/application/biniax2/src/txt.h index 33914004a..a706f0206 100644 --- a/project/jni/application/biniax2/src/txt.h +++ b/project/jni/application/biniax2/src/txt.h @@ -38,7 +38,9 @@ char *TXT_MenuMain[ cMaxOptions ] = { "CONTINUE LAST GAME", "NEW ARCADE GAME", "NEW TACTIC GAME", +#ifndef __ANDROID__ "MULTIPLAYER", +#endif "HALL OF FAME", "HELP", "EXIT" diff --git a/project/jni/application/biniax2/src/types.h b/project/jni/application/biniax2/src/types.h index 1364754fc..6a5b53572 100644 --- a/project/jni/application/biniax2/src/types.h +++ b/project/jni/application/biniax2/src/types.h @@ -39,7 +39,7 @@ typedef unsigned int BNX_UINT32; SIGNED TYPES ******************************************************************************/ -typedef char BNX_INT8; +typedef signed char BNX_INT8; /* Default char type is unsigned on Android, that breaks some logic inside Biniax2 */ typedef short int BNX_INT16; typedef int BNX_INT32;