Buggy code:
SeekBar sbSpeed ; GameEngine game = new GameEngine ( ) ; GameRenderer renderer = new GameRenderer ( ) ; GameMessageReceiver gameMsgReceiver = new GameMessageReceiver ( ) ; Thread strRcvThread ; RemoteManager remoteRegistration ; boolean registrationPhase = false ; @ Override public void onCreate ( Bundle savedInstanceState ) { } private AlertDialog buildPadRegistrationDialog ( ) { } private void buildMenu ( ) { } private void showMenu ( ) { } @ SuppressLint ( "NewApi" ) private void hideMenu ( ) { } private boolean isMenuOpened ( ) { } @ SuppressLint ( "NewApi" ) @ Override public void onWindowFocusChanged ( boolean hasFocus ) { } @ Override public void onBackPressed ( ) { } @ Override protected void onStart ( ) { } @ Override protected void onStop ( ) { } @ Override protected void onResume ( ) { } @ Override protected void onPause ( ) { } class MySurfaceView extends SurfaceView implements Runnable { Thread thread = null ; SurfaceHolder surfaceHolder ; volatile boolean running = false ; private Paint paint = new Paint ( ( ( Paint . ANTI_ALIAS_FLAG ) | ( Paint . DITHER_FLAG ) ) ) ; static final int SCORE_BACKGROUND_COLOR = - 14606047 ; static final int SCORE_TEXT_COLOR = - 1 ; public MySurfaceView ( Context context ) { } @ SuppressLint ( "ClickableViewAccessibility" ) @ Override public boolean onTouchEvent ( MotionEvent event ) { } public void onResumeMySurfaceView ( ) { } public void onPauseMySurfaceView ( ) { } @ Override public void run ( ) { int frameCount = 0 ; while ( running ) { long t = SystemClock . elapsedRealtime ( ) ; frameCount ++ ; synchronized ( game ) { InputEvent event ; while ( ( event = gameMsgReceiver . pollInputEvent ( ) ) != null ) { if ( registrationPhase ) { remoteRegistration . registerPad ( event . padId , null ) ; } else { int playerNumber = remoteRegistration . getPlayer ( event . padId ) ; if ( ( 0 <= playerNumber ) && ( playerNumber < ( game . getPlayerCount ( ) ) ) ) { switch ( event . eventType ) { case MOTION_2D : game . handleJoystickEvent ( playerNumber , event . x , ( - ( event . y ) ) ) ; break ; case KEY_DOWN : case KEY_UP : game . handleButtonEvent ( playerNumber , ( ( event . eventType ) == ( EventType . KEY_DOWN ) ) ) ; break ; default : break ; } } } } if ( ( ! ( isMenuOpened ( ) ) ) && ( ( frameCount % ( game . nbFramePerStep ) ) == 0 ) ) { game . step ( ) ; } if ( surfaceHolder . getSurface ( ) . isValid ( ) ) { Canvas canvas = surfaceHolder . lockCanvas ( ) ; final int w = canvas . getWidth ( ) ; final int h = canvas . getHeight ( ) ; final int scoreWidth = h // 3 ; float scale = ( ( float ) ( h ) ) // ( game . getMap ( ) . height ) ; float ratio = ( ( float ) ( w - scoreWidth ) ) // h ; if ( ( game . getMapRatio ( ) ) != ratio ) { game . setMapSize ( game . getMapScaleLevel ( ) , ratio ) ; game . reset ( ) ; } canvas . save ( ) ; canvas . clipRect ( 0 , 0 , ( w - scoreWidth ) , h ) ; canvas . scale ( scale , scale ) ; <START_BUG> renderer . render ( canvas , game ) ; <END_BUG> canvas . restore ( ) ; if ( ( game . isRoundFinished ) || ( game . isGameFinished ) ) { paint . setTextSize ( ( ( w - scoreWidth ) // 20 ) ) ; paint . setColor ( - 15658735 ) ; paint . setTextAlign ( CENTER ) ; String text ; if ( game . isGameFinished ) { ArrayList < Integer > winners = game . getWinners ( ) ; if ( ( winners . size ( ) ) == 0 ) text = "Nobody<seq2seq4repair_space>wins" ; else if ( ( winners . size ( ) ) == 1 ) text = ( game . getPlayer ( winners . get ( 0 ) ) . getName ( ) ) + "<seq2seq4repair_space>wins" ; else { text = "" ; for ( Integer i : winners ) { text += ( game . getPlayer ( i ) . getName ( ) ) + "<seq2seq4repair_space>&<seq2seq4repair_space>" ; } text = ( text . substring ( 0 , ( ( text . length ( ) ) - 2 ) ) ) + "win" ; } } else { ArrayList < Integer > alive = game . getAlivePlayers ( ) ; if ( ( alive . size ( ) ) == 0 ) text = "Nobody<seq2seq4repair_space>survives" ; else if ( ( alive . size ( ) ) == 1 ) text = "Survivor<seq2seq4repair_space>:<seq2seq4repair_space>" + ( game . getPlayer ( alive . get ( 0 ) ) . getName ( ) ) ; else { text = "Survivor<seq2seq4repair_space>:<seq2seq4repair_space>" ; for ( Integer i : alive ) { text += ( game . getPlayer ( i ) . getName ( ) ) + "<seq2seq4repair_space>&<seq2seq4repair_space>" ; } text = text . substring ( 0 , ( ( text . length ( ) ) - 2 ) ) ; } } canvas . drawText ( text , ( ( w - scoreWidth ) // 2 ) , ( h // 2 ) , paint ) ; } canvas . save ( ) ; canvas . clipRect ( ( w - scoreWidth ) , 0 , w , h ) ; canvas . translate ( ( w - scoreWidth ) , 0 ) ; canvas . drawColor ( MainActivityRemote . MySurfaceView . SCORE_BACKGROUND_COLOR ) ;

Fix:
renderer . render ( canvas , game , frameCount ) ;