Skip to content

Commit

Permalink
TONY: Fixed the CopyMemory stub to copy the correct number of bytes.
Browse files Browse the repository at this point in the history
Tony can now leave his office without the game crashing.
  • Loading branch information
dreammaster committed May 12, 2012
1 parent a153f9a commit 435971f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
4 changes: 4 additions & 0 deletions engines/tony/mpal/stubs.cpp
Expand Up @@ -40,6 +40,10 @@ uint16 GetAsyncKeyState(Common::KeyCode kc) {
return 0;
}

void CopyMemory(void *dst, const void *first, int size) {
Common::copy((const byte *)first, (const byte *)first + size, (byte *)dst);
}

} // end of namespace MPAL

} // end of namespace Tony
16 changes: 2 additions & 14 deletions engines/tony/mpal/stubs.h
Expand Up @@ -53,24 +53,12 @@ typedef void (*LPTHREAD_ROUTINE)(void *lpThreadParameter);

#define PASCAL

/****************************************************************************\
* Templates
\****************************************************************************/

/**
* Copies data from the range [first, last) to [dst, dst + (last - first)).
* It requires the range [dst, dst + (last - first)) to be valid.
* It also requires dst not to be in the range [first, last).
*/
template<class In, class Out>
Out CopyMemory(Out dst, In first, int size) {
return Common::copy(first, first + size, dst);
}

/****************************************************************************\
* Methods
\****************************************************************************/

extern void CopyMemory(void *dst, const void *first, int size);

extern uint16 GetAsyncKeyState(Common::KeyCode kc);

} // end of namespace MPAL
Expand Down

0 comments on commit 435971f

Please sign in to comment.