Some fixes to LBreakout2

This commit is contained in:
pelya
2010-09-16 17:23:34 +03:00
parent 71fbff7e6b
commit 54eb8bbb4a
14 changed files with 52 additions and 18 deletions

View File

@@ -1,3 +1,5 @@
*.o
Makefile
config.log
*.a
*.so

View File

@@ -1,5 +1,5 @@
# The application settings for Android libSDL port
AppSettingVersion=7
AppSettingVersion=8
LibSdlVersion=1.2
AppName="LBreakout2"
AppFullName=net.sourceforge.lgames.lbreakout2
@@ -18,6 +18,7 @@ MultiABI=n
AppVersionCode=26101
AppVersionName="2.6.1.01"
CompiledLibraries="sdl_mixer sdl_image sdl_net intl"
CustomBuildScript=y
AppCflags='-DHAVE_CONFIG_H -finline-functions -O2'
AppLdflags=''
AppSubdirsBuild='src/dummy'

View File

@@ -3,6 +3,6 @@
if [ \! -f Makefile ] ; then
../launchConfigure.sh --disable-install --enable-sdl-net LIBS=-lintl
fi
rm -f libapplication.so
make
mv -f client/lbreakout2 libapplication.so

View File

@@ -165,14 +165,16 @@ static void client_brick_grow( int x, int y, int id )
px = x * BRICK_WIDTH;
py = y * BRICK_HEIGHT;
if (isReplace)
brick_draw( offscreen, x, y, 0 );
brick_draw( stk_display, x, y, 0 );
else
brick_draw_complex( x, y, px, py );
/*
stk_surface_blit( offscreen, px, py,
BRICK_WIDTH + shadow_size,
BRICK_HEIGHT + shadow_size,
stk_display, px, py );
stk_display_store_drect();
*/
}
}
@@ -190,13 +192,15 @@ Draw all bricks to offscreen surface.
void bricks_draw()
{
int i, j;
/*
if ( offscreen == 0 ) return;
stk_surface_clip( offscreen, 0, 0, stk_display->w - BRICK_WIDTH, stk_display->h );
*/
for ( j = 1; j < MAP_HEIGHT - 1; j++ )
for ( i = 1; i < MAP_WIDTH - 1; i++ )
if ( game->bricks[i][j].id >= 0 )
brick_draw( offscreen, i, j, 1 );
stk_surface_clip( offscreen, 0,0,0,0 );
brick_draw( stk_display, i, j, 1 );
//stk_surface_clip( offscreen, 0,0,0,0 );
}
/*
====================================================================
@@ -330,13 +334,15 @@ void client_handle_brick_hit( BrickHit *hit )
/* redraw all bricks (leaving shadows in transparent frame parts) */
void client_redraw_all_bricks()
{
stk_surface_blit( bkgnd, BRICK_WIDTH, BRICK_HEIGHT,
stk_display->w - BRICK_WIDTH*2,stk_display->h - BRICK_HEIGHT,
offscreen, BRICK_WIDTH, BRICK_HEIGHT );
stk_surface_blit( bkgnd, 0, 0,
stk_display->w,stk_display->h,
stk_display, 0, 0 );
bricks_draw();
/*
stk_surface_blit( offscreen, BRICK_WIDTH, BRICK_HEIGHT,
stk_display->w - BRICK_WIDTH*2,stk_display->h - BRICK_HEIGHT,
stk_display, BRICK_WIDTH, BRICK_HEIGHT );
// stk_display_update( STK_UPDATE_ALL );
stk_display_store_drect();
*/
}

View File

@@ -158,33 +158,39 @@ void frame_draw()
/* left and right part are always drawn */
/* left part */
stk_surface_alpha_blit( fr_left_shadow, 0,0,-1,-1,
offscreen, shadow_size, shadow_size, SHADOW_ALPHA );
stk_surface_blit( fr_left, 0,0,-1,-1, offscreen, 0,0 );
stk_display, shadow_size, shadow_size, SHADOW_ALPHA );
stk_surface_blit( fr_left, 0,0,-1,-1, stk_display, 0,0 );
/*
stk_surface_alpha_blit( fr_left_shadow, 0,0,-1,-1,
bkgnd, shadow_size, shadow_size, SHADOW_ALPHA );
stk_surface_blit( fr_left, 0,0,-1,-1, bkgnd, 0,0 );
*/
if ( game->game_type == GT_LOCAL ) {
/* add top */
stk_surface_alpha_blit( frame_top_shadow, 0,0,-1,-1,
offscreen, fr_left->w + shadow_size, shadow_size, SHADOW_ALPHA );
stk_display, fr_left->w + shadow_size, shadow_size, SHADOW_ALPHA );
stk_surface_blit(
frame_top, 0,0,-1,-1, offscreen, fr_left->w,0 );
frame_top, 0,0,-1,-1, stk_display, fr_left->w,0 );
/*
stk_surface_alpha_blit( frame_top_shadow, 0,0,-1,-1,
bkgnd, fr_left->w + shadow_size, shadow_size, SHADOW_ALPHA );
stk_surface_blit(
frame_top, 0,0,-1,-1, bkgnd, fr_left->w,0 );
*/
}
/* right part */
stk_surface_alpha_blit( fr_right_shadow, 0,0,-1,-1,
offscreen, stk_display->w - fr_right_shadow->w + shadow_size,
stk_display, stk_display->w - fr_right_shadow->w + shadow_size,
shadow_size, SHADOW_ALPHA );
stk_surface_blit( fr_right, 0,0,-1,-1, offscreen,
stk_surface_blit( fr_right, 0,0,-1,-1, stk_display,
stk_display->w - fr_right->w,0 );
/*
stk_surface_alpha_blit( fr_right_shadow, 0,0,-1,-1,
bkgnd, stk_display->w - fr_right_shadow->w + shadow_size,
shadow_size, SHADOW_ALPHA );
stk_surface_blit( fr_right, 0,0,-1,-1, bkgnd,
stk_display->w - fr_right->w,0 );
*/
}
/*
====================================================================
@@ -205,7 +211,7 @@ void frame_draw_lives( int lives, int max_lives )
else
y = BRICK_HEIGHT * 2;
stk_surface_blit( lamps, 0,y, BRICK_WIDTH, BRICK_HEIGHT,
offscreen, 0, ( MAP_HEIGHT - i - 1 ) * BRICK_HEIGHT );
stk_display, 0, ( MAP_HEIGHT - i - 1 ) * BRICK_HEIGHT );
}
/* get position of next lamp */
new_life_y = stk_display->h - lives * BRICK_HEIGHT;

View File

@@ -347,8 +347,8 @@ static void display_bonus_level_score()
/* begin frame by hiding all objects */
static void begin_frame( void )
{
/*
int i;
displays_hide();
frame_info_hide();
extras_hide();
@@ -364,12 +364,25 @@ static void begin_frame( void )
shine_hide();
exps_hide();
credit_hide();
*/
}
/* end frame by drawing all objects and updating the screen */
static void end_frame( void )
{
int i;
if ( game->game_type == GT_LOCAL && cur_player )
bkgnd_draw( bkgnd, bkgnd_ids[cur_player->level_id] );
else
bkgnd_draw( bkgnd, -1 );
/* add frame */
frame_draw();
/* add bricks */
bricks_draw();
/* draw lives */
if ( game->game_type == GT_LOCAL && cur_player )
frame_draw_lives( cur_player->lives, game->diff->max_lives );
/* show -- some things will be missing if darkness is enabled */
balls_show_shadow();

View File

@@ -61,7 +61,7 @@ void bkgnd_draw( SDL_Surface *bkgnd, int id )
}
/* draw to offscreen */
stk_surface_blit( bkgnd, 0,0,-1,-1, offscreen, 0,0 );
stk_surface_blit( bkgnd, 0,0,-1,-1, stk_display, 0,0 );
}
/*
====================================================================

View File

@@ -81,11 +81,13 @@ void shots_show()
stk_surface_alpha_blit( shot_pic, (int)shot->cur_fr * shot_w, 0,
shot_w, shot_h, stk_display, x, y, shot_alpha );
/*
shot->update_rect.x = x;
shot->update_rect.y = y;
shot->update_rect.w = shot_w + shadow_size;
shot->update_rect.h = shot_h + shadow_size;
stk_display_store_rect( &shot->update_rect );
*/
}
stk_surface_clip( stk_display, 0, 0, 0, 0 );
}

View File

@@ -209,7 +209,7 @@ void shrapnells_show()
stk_surface_blit( shr->pic,
0,0,shr->pic->w,shr->pic->h,
stk_display, (int)shr->x, (int)shr->y );
stk_display_store_drect();
//stk_display_store_drect();
}
}
/*

View File

@@ -431,6 +431,7 @@ If NULL is passed as 'rect' the whole screen is stored for update.
*/
void stk_display_store_rect( SDL_Rect *rect )
{
#if 0
if ( stk_update_rect_count < STK_UPDATE_RECT_LIMIT ) {
if ( rect ) {
/* for safety this check is kept although it should be
@@ -453,6 +454,7 @@ void stk_display_store_rect( SDL_Rect *rect )
else
stk_update_rect_count = STK_UPDATE_RECT_LIMIT;
}
#endif
}
/*
@@ -463,8 +465,10 @@ modified this rectangle to the actually updated clipping region.
*/
void stk_display_store_drect( void )
{
/*
if ( stk_update_rect_count < STK_UPDATE_RECT_LIMIT )
stk_update_rects[stk_update_rect_count++] = stk_drect;
*/
}
/*