From 435971f256f33f9944bc37f7c23c90eb70c77948 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 12 May 2012 10:55:18 +1000 Subject: [PATCH] TONY: Fixed the CopyMemory stub to copy the correct number of bytes. Tony can now leave his office without the game crashing. --- engines/tony/mpal/stubs.cpp | 4 ++++ engines/tony/mpal/stubs.h | 16 ++-------------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/engines/tony/mpal/stubs.cpp b/engines/tony/mpal/stubs.cpp index 23bc18b0eab..89740fdd528 100644 --- a/engines/tony/mpal/stubs.cpp +++ b/engines/tony/mpal/stubs.cpp @@ -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 diff --git a/engines/tony/mpal/stubs.h b/engines/tony/mpal/stubs.h index ae25f7127e6..ea88c1c76c2 100644 --- a/engines/tony/mpal/stubs.h +++ b/engines/tony/mpal/stubs.h @@ -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 -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