From d8e2bb9e2b01e75ed4a00473cc99fe1f20ea6a92 Mon Sep 17 00:00:00 2001 From: kiritow <1362050620@qq.com> Date: Wed, 24 May 2017 18:17:29 +0800 Subject: [PATCH] Add Surface compare function. Build Notice!: I got a link error while compiling the full project. The link error is "undefined reference to SDL_GetRGBA" and "undefined reference to SDL_snprintf"... Currently there is one way to solve it : Link SDL2test.lib first (Before SDL2 and SDL2main) --- MiniEngine_Test.cpp | 4 ++++ MiniEngine_Test.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/MiniEngine_Test.cpp b/MiniEngine_Test.cpp index 8a36cb1..9e9db92 100644 --- a/MiniEngine_Test.cpp +++ b/MiniEngine_Test.cpp @@ -31,6 +31,10 @@ std::string GetMD5(unsigned char* buffer,unsigned int bufferLen) return str; } +int CompareSurface(const Surface& surface1, const Surface& surface2, int allowableError) +{ + return SDLTest_CompareSurfaces(surface1.getRawPointer(),surface2.getRawPointer(),allowableError); +} }/// End of namespace MiniEngine::Test diff --git a/MiniEngine_Test.h b/MiniEngine_Test.h index 879fa90..3d6389a 100644 --- a/MiniEngine_Test.h +++ b/MiniEngine_Test.h @@ -1,4 +1,5 @@ #pragma once +#include "MiniEngine.h" #include namespace MiniEngine @@ -9,6 +10,7 @@ namespace Test std::string GetMD5(unsigned char* buffer,unsigned int bufferLen); void GetMD5Raw(unsigned char* buffer,unsigned int bufferLen,unsigned char* outbuff); +int CompareSurface(const Surface& surface1,const Surface& surface2,int allowableError); }/// End of namespace MiniEngine::Test