Skip to content

Commit

Permalink
xinv3d (1.9.0), 2024 May 9
Browse files Browse the repository at this point in the history
Selecting "Titlebar" to exit, now cleans-up xinvaders3d memory usage
better before exiting program. Also removed 1of4 memory issues from:
valgrind --leak-check=full --show-leak-kinds=all ./xinvaders3d
3of4, and 4of4, look like realloc() which is out of reach of program
(more info shown in pull request 4).
  • Loading branch information
JoesCat committed May 9, 2024
1 parent 6ed2b68 commit 2fca075
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ Andreas Jeitler
Chris Butler
Peter da Silva
Joe Da Silva
William Lupinacci
7 changes: 6 additions & 1 deletion Changelog
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
xinv3d/xinvaders3d (1.8.0)
xinvaders3d or xinv3d (1.9.0)
* Thanks to orchardstreet for fixing titlebar to exit cleanly
and also for simplifying player left/right rotation return.
-- Joe Da Silva <[email protected]> 2024 May 09

xinvaders3d or xinv3d (1.8.0)
* Added build option "./configure --enable-as-xinv3d" so that
Xinvaders3D builds binary, man file, and desktop as Xinv3D.
* Added desktop scalable icon.
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

AC_PREREQ(2.61)

m4_define([xinvaders3d_version], [1.8.0])
m4_define([xinvaders3d_version], [1.9.0])
AC_INIT([xinvaders3d],[xinvaders3d_version],[https://github.com/JoesCat/xinvaders3d/issues],
[xinvaders3d],[https://github.com/JoesCat/xinvaders3d])
AC_CONFIG_SRCDIR([aliens.c])
Expand Down
6 changes: 4 additions & 2 deletions main-x11.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,8 @@ void Graphics_shutdown ( void )
XAutoRepeatOn ( display );

XCloseDisplay ( display );

free ( wname.value );
}

/*================================================================*/
Expand Down Expand Up @@ -487,8 +489,8 @@ int Handle_events ( void )
if ( event.xclient.data.l[0] >= 0 && ((unsigned long int) \
event.xclient.data.l[0]) == wmDeleteMessage )
{
Graphics_shutdown ();
exit(0);
/* titlebar quit! */
return FALSE;
}
break;

Expand Down
6 changes: 2 additions & 4 deletions player.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,7 @@ void Player_update1 ( OBJECT *obj )
player1->rot = -MAX_ROT;
}

if ( (gv->key_LEFT1 == FALSE) && (gv->key_RIGHT1 == FALSE) && \
player1->rot )
if ( player1->rot && gv->key_LEFT1 == FALSE && gv->key_RIGHT1 == FALSE )
{
if ( player1->rot > 0 )
{
Expand Down Expand Up @@ -232,8 +231,7 @@ void Player_update2 ( OBJECT *obj )
player2->rot = -MAX_ROT;
}

if ( (gv->key_LEFT2 == FALSE) && (gv->key_RIGHT2 == FALSE) && \
player2->rot )
if ( player2->rot && gv->key_LEFT2 == FALSE && gv->key_RIGHT2 == FALSE )
{
if ( player2->rot > 0 )
{
Expand Down

0 comments on commit 2fca075

Please sign in to comment.