Speed up compilation time for luafunctions

* Other compile fixes for gcc
This commit is contained in:
Eduardo Bart 2013-01-29 14:35:20 -02:00
parent 8d6ccb8d83
commit 80a7ecb3a4
8 changed files with 29 additions and 22 deletions

View File

@ -102,3 +102,6 @@ set(client_SOURCES ${client_SOURCES}
# util
${CMAKE_CURRENT_LIST_DIR}/position.h
)
set_source_files_properties(${CMAKE_CURRENT_LIST_DIR}/luafunctions.cpp
PROPERTIES LANGUAGE CXX COMPILE_FLAGS "-g0 -O0")

View File

@ -354,10 +354,10 @@ void Game::processRuleViolationLock()
g_lua.callGlobalField("g_game", "onRuleViolationLock");
}
void Game::processVipAdd(uint id, const std::string& name, uint status)
void Game::processVipAdd(uint id, const std::string& name, uint status, int iconId, bool notifyLogin)
{
m_vips[id] = Vip(name, status);
g_lua.callGlobalField("g_game", "onAddVip", id, name, status);
g_lua.callGlobalField("g_game", "onAddVip", id, name, status, iconId, notifyLogin);
}
void Game::processVipStateChange(uint id, uint status)

View File

@ -98,7 +98,7 @@ protected:
void processRuleViolationLock();
// vip related
void processVipAdd(uint id, const std::string& name, uint status);
void processVipAdd(uint id, const std::string& name, uint status, int iconId, bool notifyLogin);
void processVipStateChange(uint id, uint status);
// tutorial hint

View File

@ -1370,20 +1370,20 @@ void ProtocolGame::parseOpenOutfitWindow(const InputMessagePtr& msg)
void ProtocolGame::parseVipAdd(const InputMessagePtr& msg)
{
uint id, markId, status;
uint id, iconId = 0, status;
std::string name, desc;
bool notifyLogin;
bool notifyLogin = false;
id = msg->getU32();
name = g_game.formatCreatureName(msg->getString());
if(g_game.getProtocolVersion() >= 963) {
desc = msg->getString();
markId = msg->getU32();
iconId = msg->getU32();
notifyLogin = msg->getU8();
}
status = msg->getU8();
g_game.processVipAdd(id, name, status);
g_game.processVipAdd(id, name, status, iconId, notifyLogin);
}
void ProtocolGame::parseVipState(const InputMessagePtr& msg)

View File

@ -128,6 +128,9 @@ set(framework_SOURCES ${framework_SOURCES}
${CMAKE_CURRENT_LIST_DIR}/platform/platform.h
)
set_source_files_properties(${CMAKE_CURRENT_LIST_DIR}/luafunctions.cpp
PROPERTIES LANGUAGE CXX COMPILE_FLAGS "-g0 -O0")
# some build options
option(CRASH_HANDLER "Generate crash reports" ON)
option(LUAJIT "Use lua jit" OFF)
@ -149,6 +152,7 @@ endif()
# gcc compile flags
set(WARNS_FLAGS "-Wall -Wextra -Werror -Wno-unused-parameter -Wno-unused-variable -Wno-unused-result")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNS_FLAGS} ${ARCH_FLAGS} ${CPP2011_FLAGS} -pipe")
set(CMAKE_CXX_FLAGS_COMPILESPEED "-O0")
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O1 -g -fno-omit-frame-pointer")
set(CMAKE_CXX_FLAGS_RELEASE "-O2")
@ -493,3 +497,4 @@ endif()
include_directories(${framework_INCLUDE_DIRS})
add_definitions(${framework_DEFINITIONS})

View File

@ -513,8 +513,8 @@ int load_apng(std::stringstream& file, struct apng_data *apng)
unsigned int i, j;
unsigned int rowbytes;
int imagesize, zbuf_size, zsize, trns_idx;
unsigned int len, chunk, crc;
unsigned int w, h, seq, w0, h0, x0, y0;
unsigned int len, chunk/*, crc, seq*/;
unsigned int w, h, w0, h0, x0, y0;
unsigned int frames, loops, first_frame, cur_frame;
unsigned int outrow1, outrow2, outimg1, outimg2;
unsigned short d1, d2;
@ -573,7 +573,7 @@ int load_apng(std::stringstream& file, struct apng_data *apng)
file.read((char*)&compr, 1);
file.read((char*)&filter, 1);
file.read((char*)&interl, 1);
crc = read32(file);
/*crc = */read32(file);
channels = 1;
if (coltype == 2)
@ -633,7 +633,7 @@ int load_apng(std::stringstream& file, struct apng_data *apng)
palsize = col+1;
}
}
crc = read32(file);
/*crc = */read32(file);
}
else if (chunk == 0x74524E53) /* tRNS */
{
@ -670,7 +670,7 @@ int load_apng(std::stringstream& file, struct apng_data *apng)
trns[5] = trns[4]; trns[4] = 0;
}
}
crc = read32(file);
/*crc = */read32(file);
}
else if (chunk == 0x6163544C) /* acTL */
{
@ -679,7 +679,7 @@ int load_apng(std::stringstream& file, struct apng_data *apng)
free(frames_delay);
frames_delay = (unsigned short*)malloc(frames*sizeof(int));
loops = read32(file);
crc = read32(file);
/*crc = */read32(file);
if (pOut1)
free(pOut1);
if (pOut2)
@ -747,7 +747,7 @@ int load_apng(std::stringstream& file, struct apng_data *apng)
}
}
seq = read32(file);
/*seq = */read32(file);
w0 = read32(file);
h0 = read32(file);
x0 = read32(file);
@ -756,7 +756,7 @@ int load_apng(std::stringstream& file, struct apng_data *apng)
d2 = read16(file);
file.read((char*)&dop, 1);
file.read((char*)&bop, 1);
crc = read32(file);
/*crc = */read32(file);
if(d2 == 0)
d2 = 100;
@ -781,15 +781,15 @@ int load_apng(std::stringstream& file, struct apng_data *apng)
{
file.read((char*)(pData + zsize), len);
zsize += len;
crc = read32(file);
/*crc = */read32(file);
}
else if (chunk == 0x66644154) /* fdAT */
{
seq = read32(file);
/*seq = */read32(file);
len -= 4;
file.read((char*)(pData + zsize), len);
zsize += len;
crc = read32(file);
/*crc = */read32(file);
}
else if (chunk == 0x49454E44) /* IEND */
{
@ -818,7 +818,7 @@ int load_apng(std::stringstream& file, struct apng_data *apng)
if (notabc(c)) break;
file.seekg(len, std::ios_base::cur);
crc = read32(file);
/*crc = */read32(file);
}
}
/* apng decoding - end */

View File

@ -901,8 +901,7 @@ void LuaInterface::getEnv(int index)
void LuaInterface::setEnv(int index)
{
assert(hasIndex(index));
int ret;
ret = lua_setfenv(L, index);
lua_setfenv(L, index);
assert(ret == 1);
}

View File

@ -96,5 +96,5 @@ bool UIHorizontalLayout::internalUpdate()
});
}
return true;
return changed;
}