Skip to content

Commit

Permalink
space-invaders: calling exit-openal otherwise sound can get stuck whe…
Browse files Browse the repository at this point in the history
…n quitting the game
  • Loading branch information
bjourne committed Jun 16, 2016
1 parent 1df3420 commit d16e427
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions extra/space-invaders/space-invaders.factor
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
! Copyright (C) 2006 Chris Double.
! See http://factorcode.org/license.txt for BSD license.
!
! Space Invaders: http://www.emuparadise.me/M.A.M.E._-_Multiple_Arcade_Machine_Emulator_ROMs/Space_Invaders_--_Space_Invaders_M/13774
USING: accessors alien.c-types alien.data arrays
combinators cpu.8080 cpu.8080.emulator io.pathnames kernel
locals math math.order openal openal.alut opengl.gl sequences
Expand All @@ -10,8 +11,9 @@ QUALIFIED: system
SPECIALIZED-ARRAY: uchar
IN: space-invaders

TUPLE: space-invaders < cpu port1 port2i port2o port3o port4lo
port4hi port5o bitmap sounds looping? ;
TUPLE: space-invaders < cpu
port1 port2i port2o port3o port4lo port4hi port5o
bitmap sounds looping? ;

CONSTANT: game-width 224
CONSTANT: game-height 256
Expand Down Expand Up @@ -340,7 +342,7 @@ M: space-invaders update-video
! concurrent process. Messages can be sent to
! signal key presses, etc.
dup quit?>> [
2drop
exit-openal 2drop
] [
[ sync-frame ] dip {
[ cpu>> gui-frame ]
Expand Down

0 comments on commit d16e427

Please sign in to comment.