Fix bug that caused zapper.read() to crash when a movie playback ends.
This commit is contained in:
parent
df995a5525
commit
801f4c7d96
|
@ -1,3 +1,5 @@
|
||||||
|
07-april-2010 - adelikat - fix bug that caused zapper.read() to crash when movie playback ends
|
||||||
|
|
||||||
---r1767 - FCEUX 2.1.3 Released---
|
---r1767 - FCEUX 2.1.3 Released---
|
||||||
---April 7 2010---
|
---April 7 2010---
|
||||||
|
|
||||||
|
|
|
@ -2068,14 +2068,19 @@ static int input_get(lua_State *L) {
|
||||||
static int zapper_read(lua_State *L){
|
static int zapper_read(lua_State *L){
|
||||||
|
|
||||||
lua_newtable(L);
|
lua_newtable(L);
|
||||||
|
int z = 0;
|
||||||
extern void GetMouseData(uint32 (&md)[3]); //adelikat: shouldn't this be ifdef'ed for Win32?
|
extern void GetMouseData(uint32 (&md)[3]); //adelikat: shouldn't this be ifdef'ed for Win32?
|
||||||
int x,y,click;
|
int x,y,click;
|
||||||
if (FCEUMOV_IsPlaying())
|
if (/*FCEUMOV_IsPlaying()*/ FCEUMOV_Mode(MOVIEMODE_PLAY))
|
||||||
{
|
{
|
||||||
x = currMovieData.records[currFrameCounter].zappers[1].x; //adelikat: Used hardcoded port 1 since as far as I know, only port 1 is valid for zappers
|
if (!currFrameCounter)
|
||||||
y = currMovieData.records[currFrameCounter].zappers[1].y;
|
z = 0;
|
||||||
click = currMovieData.records[currFrameCounter].zappers[1].b;
|
else
|
||||||
|
z = currFrameCounter -1;
|
||||||
|
|
||||||
|
x = currMovieData.records[z].zappers[1].x; //adelikat: Used hardcoded port 1 since as far as I know, only port 1 is valid for zappers
|
||||||
|
y = currMovieData.records[z].zappers[1].y;
|
||||||
|
click = currMovieData.records[z].zappers[1].b;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue