mirror of
https://github.com/edubart/otclient.git
synced 2025-10-16 12:34:55 +02:00
Speed up compilation time for luafunctions
* Other compile fixes for gcc
This commit is contained in:
@@ -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})
|
||||
|
||||
|
@@ -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 */
|
||||
|
@@ -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);
|
||||
}
|
||||
|
||||
|
@@ -96,5 +96,5 @@ bool UIHorizontalLayout::internalUpdate()
|
||||
});
|
||||
}
|
||||
|
||||
return true;
|
||||
return changed;
|
||||
}
|
||||
|
Reference in New Issue
Block a user