fixed bcompat trans + optimized it a bit

added bcompat trans support to format() and copy()
This commit is contained in:
David Anderson
2006-09-10 22:08:52 +00:00
parent 3d74b7cf09
commit 2df8b4269e
4 changed files with 116 additions and 74 deletions

View File

@@ -1,11 +1,27 @@
#ifndef _INCLUDE_AMXMOD_CORE_COMPAT_H
#define _INCLUDE_AMXMOD_CORE_COMPAT_H
#define BCOMPAT_TRANSLATE_BITS 0xFFFFF400
#define BCOMPAT_TRANSLATE_MAX 0x400
/**
* New format for translation:
* Note that we only support:
* 4k keys
* 32 languages
* 0000 0000 0000 0000 0000 0000 0000 0000
* | key id |
* | | <- dest id
* | | <- lang id
*/
bool GetTranslation(int id, int &key, int &dest, int &lang);
void ClearTransCache();
#define BCOMPAT_TRANSLATE_BITS 0xFF000000
#define BCOMPAT_TRANSLATE_KEYMASK 0xFFF
#define BCOMPAT_TRANSLATE_DESTMASK 0x3F
#define BCOMPAT_TRANSLATE_DESTRSH 12
#define BCOMPAT_TRANSLATE_LANGMASK 0x1F
#define BCOMPAT_TRANSLATE_LANGRSH 18
typedef unsigned int amxtrans_t;
bool GetTranslation(amxtrans_t trans, int &key, int &dest, int &lang);
extern AMX_NATIVE_INFO g_BcompatNatives[];