summaryrefslogtreecommitdiffstats
path: root/src/modelinfo/ModelIndices.cpp
blob: bf6b390592be452930fa5e343f8d2e81ab077092 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include "common.h"
#include "patcher.h"
#include "ModelIndices.h"

#define X(name, var, addr) int16 &var = *(int16*)addr;
	MODELINDICES
#undef X

void
InitModelIndices(void)
{
#define X(name, var, addr) var = -1;
	MODELINDICES
#undef X
}

void
MatchModelString(const char *modelname, int16 id)
{
#define X(name, var, addr) \
	if(strcmp(name, modelname) == 0){ \
		var = id; \
		return; \
	}
	MODELINDICES
#undef X
}

void
TestModelIndices(void)
{
	;
}

STARTPATCHES
	InjectHook(0x48EB60, InitModelIndices, PATCH_JUMP);
	InjectHook(0x48F030, MatchModelString, PATCH_JUMP);
ENDPATCHES