MULTILINGUAL - ALL BUGS FIXED

Reversed Makefile
Changed memreport file names
This commit is contained in:
David Anderson 2004-08-16 21:34:50 +00:00
parent 1bd7ab3a95
commit 5ecd986d9b
3 changed files with 22 additions and 28 deletions

View File

@ -42,18 +42,6 @@
#define INSERT_STRING 3 #define INSERT_STRING 3
#define INSERT_NEWLINE 4 #define INSERT_NEWLINE 4
void qdbg(const char *s, ...)
{
va_list argptr;
FILE *dbg = fopen("c:\\beta.txt", "at");
va_start(argptr, s);
char buf[2048];
vsprintf(buf, s, argptr);
va_end(argptr);
fprintf(dbg, "%s", buf);
fclose(dbg);
}
// dictionary format is Fast-Format-Hash-Lookup, v4 // dictionary format is Fast-Format-Hash-Lookup, v4
#define MAGIC_HDR 0x4646484C #define MAGIC_HDR 0x4646484C
#define FFHL_VERSION 4 #define FFHL_VERSION 4
@ -384,7 +372,6 @@ bool CLangMngr::CLang::Save(FILE *fp, int &defOffset, uint32_t &curOffset)
{ {
uint32_t keynum = 0; uint32_t keynum = 0;
uint32_t defhash = 0; uint32_t defhash = 0;
uint32_t defoff = defOffset;
uint32_t size = m_LookUpTable.size(); uint32_t size = m_LookUpTable.size();
fwrite((void*)&size, sizeof(uint32_t), 1, fp); fwrite((void*)&size, sizeof(uint32_t), 1, fp);
@ -398,7 +385,7 @@ bool CLangMngr::CLang::Save(FILE *fp, int &defOffset, uint32_t &curOffset)
curOffset += sizeof(uint32_t); curOffset += sizeof(uint32_t);
fwrite((void *)&defhash, sizeof(uint32_t), 1, fp); fwrite((void *)&defhash, sizeof(uint32_t), 1, fp);
curOffset += sizeof(uint32_t); curOffset += sizeof(uint32_t);
fwrite((void *)&defoff, sizeof(uint32_t), 1, fp); fwrite((void *)&defOffset, sizeof(uint32_t), 1, fp);
curOffset += sizeof(uint32_t); curOffset += sizeof(uint32_t);
defOffset += sizeof(short); defOffset += sizeof(short);
defOffset += m_LookUpTable[i]->GetDefLength(); defOffset += m_LookUpTable[i]->GetDefLength();
@ -1122,6 +1109,7 @@ bool CLangMngr::Load(const char *filename)
if (version > FFHL_VERSION || version < FFHL_MIN_VERSION) if (version > FFHL_VERSION || version < FFHL_MIN_VERSION)
return false; return false;
fread((void*)&keycount, sizeof(uint32_t), 1, fp);
fread((void*)&langCount, sizeof(uint32_t), 1, fp); fread((void*)&langCount, sizeof(uint32_t), 1, fp);
uint32_t *LangOffsets = new uint32_t[langCount]; uint32_t *LangOffsets = new uint32_t[langCount];
@ -1165,7 +1153,7 @@ bool CLangMngr::Load(const char *filename)
for (unsigned int i=0; i<langCount; i++) for (unsigned int i=0; i<langCount; i++)
{ {
fread((void*)&numentries, sizeof(uint32_t), 1, fp); fread((void*)&numentries, sizeof(uint32_t), 1, fp);
for (unsigned int j=0; i<numentries; j++) for (unsigned int j=0; j<numentries; j++)
{ {
fread((void *)&keynum, sizeof(uint32_t), 1, fp); fread((void *)&keynum, sizeof(uint32_t), 1, fp);
fread((void *)&defhash, sizeof(uint32_t), 1, fp); fread((void *)&defhash, sizeof(uint32_t), 1, fp);
@ -1183,6 +1171,8 @@ bool CLangMngr::Load(const char *filename)
} }
fclose(fp); fclose(fp);
delete [] LangOffsets;
//we're done! //we're done!
return true; return true;

View File

@ -4,8 +4,10 @@ float.cpp file.cpp modules.cpp CMisc.cpp CTask.cpp string.cpp\
amxmodx.cpp CEvent.cpp CCmd.cpp CLogEvent.cpp srvcmd.cpp strptime.cpp\ amxmodx.cpp CEvent.cpp CCmd.cpp CLogEvent.cpp srvcmd.cpp strptime.cpp\
CForward.cpp CPlugin.cpp CModule.cpp CMenu.cpp emsg.cpp util.cpp \ CForward.cpp CPlugin.cpp CModule.cpp CMenu.cpp emsg.cpp util.cpp \
amxcore.cpp amxtime.cpp power.cpp amxxlog.cpp fakemeta.cpp mmgr/mmgr.cpp \ amxcore.cpp amxtime.cpp power.cpp amxxlog.cpp fakemeta.cpp mmgr/mmgr.cpp \
amxxfile.cpp CLang.cpp amxxfile.cpp CLang.cpp md5.cpp amx.cpp
CSRCFILES = amx.c minilzo/minilzo.c #use this for amd64, remove the above amx.cpp, and rename amx.cpp to amx.c
#CSRCFILES = amx.c minilzo/minilzo.c
CSRCFILES = minilzo/minilzo.c
EXTRA_LIBS_LINUX = EXTRA_LIBS_LINUX =
EXTRA_LIBS_WIN32 = EXTRA_LIBS_WIN32 =
@ -45,8 +47,9 @@ else
endif endif
#use this for AMD64
LIBFILE_LINUX = $(MODNAME)_amd64.so #LIBFILE_LINUX = $(MODNAME)_amd64.so
LIBFILE_LINUX = $(MODNAME)_i386.so
LIBFILE_WIN32 = $(MODNAME).dll LIBFILE_WIN32 = $(MODNAME).dll
TARGET_LINUX = $(OBJDIR_LINUX)/$(LIBFILE_LINUX) TARGET_LINUX = $(OBJDIR_LINUX)/$(LIBFILE_LINUX)
TARGET_WIN32 = $(OBJDIR_WIN32)/$(LIBFILE_WIN32) TARGET_WIN32 = $(OBJDIR_WIN32)/$(LIBFILE_WIN32)
@ -62,8 +65,9 @@ OBJC_LINUX := $(CSRCFILES:%.c=$(OBJDIR_LINUX)/%.o)
OBJ_WIN32 := $(SRCFILES:%.cpp=$(OBJDIR_WIN32)/%.o) OBJ_WIN32 := $(SRCFILES:%.cpp=$(OBJDIR_WIN32)/%.o)
OBJC_WIN32 := $(CSRCFILES:%.c=$(OBJDIR_WIN32)/%.o) OBJC_WIN32 := $(CSRCFILES:%.c=$(OBJDIR_WIN32)/%.o)
#use this for amd64
CCOPT = -m64 -g -ggdb3 -DHAVE_I64 -DSMALL_CELL_SIZE=64 #CCOPT = -m64 -g -ggdb3 -DHAVE_I64 -DSMALL_CELL_SIZE=64
CCOPT = -march=i386 -s -DNDEBUG -O2 -fomit-frame-pointer -fno-exceptions -fno-rtti -ffast math
INCLUDEDIRS=-I../curl/include -I$(SRCDIR) -I$(METADIR) -I$(SDKSRC)/engine -I$(SDKSRC)/common -I$(SDKSRC)/pm_shared -I$(SDKSRC)/dlls -I$(SDKSRC) $(EXTRA_INCLUDEDIRS) INCLUDEDIRS=-I../curl/include -I$(SRCDIR) -I$(METADIR) -I$(SDKSRC)/engine -I$(SDKSRC)/common -I$(SDKSRC)/pm_shared -I$(SDKSRC)/dlls -I$(SDKSRC) $(EXTRA_INCLUDEDIRS)
CFLAGS=-Wall -Wno-unknown-pragmas CFLAGS=-Wall -Wno-unknown-pragmas

View File

@ -219,7 +219,7 @@ int C_Spawn( edict_t *pent ) {
// ###### Load lang // ###### Load lang
g_langMngr.LoadCache(build_pathname("%s/dictionary.cache", get_localinfo("amxx_datadir", "addons/amxx/data"))); g_langMngr.LoadCache(build_pathname("%s/dictionary.cache", get_localinfo("amxx_datadir", "addons/amxx/data")));
// g_langMngr.Load(build_pathname("%s/languages.dat", get_localinfo("amxx_datadir", "addons/amxx/data"))); g_langMngr.Load(build_pathname("%s/languages.dat", get_localinfo("amxx_datadir", "addons/amxx/data")));
// ###### Initialize commands prefixes // ###### Initialize commands prefixes
g_commands.registerPrefix( "amx" ); g_commands.registerPrefix( "amx" );
g_commands.registerPrefix( "amxx" ); g_commands.registerPrefix( "amxx" );
@ -402,8 +402,8 @@ void C_ServerActivate_Post( edict_t *pEdictList, int edictCount, int clientMax )
executeForwards(FF_PluginCfg); executeForwards(FF_PluginCfg);
// ###### Save lang // ###### Save lang
g_langMngr.SaveCache(build_pathname("%s/dictionary.cache", get_localinfo("amxx_datadir", "addons/amxx/data")));
g_langMngr.Save(build_pathname("%s/languages.dat", get_localinfo("amxx_datadir", "addons/amxx/data"))); g_langMngr.Save(build_pathname("%s/languages.dat", get_localinfo("amxx_datadir", "addons/amxx/data")));
g_langMngr.SaveCache(build_pathname("%s/dictionary.cache", get_localinfo("amxx_datadir", "addons/amxx/data")));
// Correct time in Counter-Strike and other mods (except DOD) // Correct time in Counter-Strike and other mods (except DOD)
if ( !g_bmod_dod) g_game_timeleft = 0; if ( !g_bmod_dod) g_game_timeleft = 0;
@ -462,8 +462,8 @@ void C_ServerDeactivate_Post() {
g_vault.clear(); g_vault.clear();
g_xvars.clear(); g_xvars.clear();
g_plugins.clear(); g_plugins.clear();
g_langMngr.SaveCache(build_pathname("%s/dictionary.cache", get_localinfo("amxx_datadir", "addons/amxx/data")));
g_langMngr.Save(build_pathname("%s/languages.dat", get_localinfo("amxx_datadir", "addons/amxx/data"))); g_langMngr.Save(build_pathname("%s/languages.dat", get_localinfo("amxx_datadir", "addons/amxx/data")));
g_langMngr.SaveCache(build_pathname("%s/dictionary.cache", get_localinfo("amxx_datadir", "addons/amxx/data")));
g_langMngr.Clear(); g_langMngr.Clear();
// last memreport // last memreport
#ifdef MEMORY_TEST #ifdef MEMORY_TEST
@ -512,8 +512,8 @@ void C_ServerDeactivate_Post() {
break; break;
} }
} }
m_dumpMemoryReport(build_pathname("%s/r%03d", g_memreport_dir.c_str(), g_memreport_count)); m_dumpMemoryReport(build_pathname("%s/r%03d.txt", g_memreport_dir.c_str(), g_memreport_count));
AMXXLOG_Log("Memreport #%d created (file \"%s/r%03d\") (interval %f)", g_memreport_count + 1, g_memreport_dir.c_str(), g_memreport_count, MEMREPORT_INTERVAL); AMXXLOG_Log("Memreport #%d created (file \"%s/r%03d.txt\") (interval %f)", g_memreport_count + 1, g_memreport_dir.c_str(), g_memreport_count, MEMREPORT_INTERVAL);
g_memreport_count++; g_memreport_count++;
} }
#endif // MEMORY_TEST #endif // MEMORY_TEST
@ -777,8 +777,8 @@ void C_StartFrame_Post( void ) {
break; break;
} }
} }
m_dumpMemoryReport(build_pathname("%s/r%03d", g_memreport_dir.c_str(), g_memreport_count)); m_dumpMemoryReport(build_pathname("%s/r%03d.txt", g_memreport_dir.c_str(), g_memreport_count));
AMXXLOG_Log("Memreport #%d created (file \"%s/r%03d\") (interval %f)", g_memreport_count + 1, g_memreport_dir.c_str(), g_memreport_count, MEMREPORT_INTERVAL); AMXXLOG_Log("Memreport #%d created (file \"%s/r%03d.txt\") (interval %f)", g_memreport_count + 1, g_memreport_dir.c_str(), g_memreport_count, MEMREPORT_INTERVAL);
g_memreport_count++; g_memreport_count++;
} }
#endif // MEMORY_TEST #endif // MEMORY_TEST