sourcehook/test/testrecall.cpp
changeset 163 377bdd31c28d
parent 162 a95db73792e5
child 179 3ade923f508b
     1.1 --- a/sourcehook/test/testrecall.cpp	Fri Dec 23 11:58:11 2005 +0000
     1.2 +++ b/sourcehook/test/testrecall.cpp	Fri Dec 23 23:00:55 2005 +0000
     1.3 @@ -33,17 +33,23 @@
     1.4  			ADD_STATE(State_Func2(a));
     1.5  			return 1000;
     1.6  		}
     1.7 +
     1.8 +		// Overloaded version
     1.9 +		virtual int Func2(int a, int b)
    1.10 +		{
    1.11 +			return 0xDEADFC;
    1.12 +		}
    1.13  	};
    1.14  
    1.15  	void Handler1_Func1(int a)
    1.16  	{
    1.17  		ADD_STATE(State_H1_Func1(a));
    1.18 -		RETURN_META_NEWPARAMS(MRES_IGNORED, Test, Func1, (5));
    1.19 +		RETURN_META_NEWPARAMS(MRES_IGNORED, &Test::Func1, (5));
    1.20  	}
    1.21  	void Handler2_Func1(int a)
    1.22  	{
    1.23  		ADD_STATE(State_H2_Func1(a));
    1.24 -		RETURN_META_NEWPARAMS(MRES_IGNORED, Test, Func1, (a - 5));
    1.25 +		RETURN_META_NEWPARAMS(MRES_IGNORED, &Test::Func1, (a - 5));
    1.26  	}
    1.27  	void HandlerPost_Func1(int a)
    1.28  	{
    1.29 @@ -54,7 +60,9 @@
    1.30  	int Handler1_Func2(int a)
    1.31  	{
    1.32  		ADD_STATE(State_H1_Func2(a));
    1.33 -		RETURN_META_VALUE_NEWPARAMS(MRES_OVERRIDE, 500, Test, Func2, (a - 10));
    1.34 +		// Pfeeehhh, ugly, I know, but I had to test it :)
    1.35 +		RETURN_META_VALUE_NEWPARAMS(MRES_OVERRIDE, 500, 
    1.36 +			static_cast<int (Test::*)(int)>(&Test::Func2), (a - 10));
    1.37  	}
    1.38  
    1.39  	int HandlerPost_Func2(int a)