1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-07 03:13:49 +00:00

Replace boost::thread by std::thread.

Correct CMakeList.txt for GLideNHQ
This commit is contained in:
Sergey Lipskiy 2015-01-27 20:47:34 +06:00
parent fca44abb5f
commit 8d518d6440
3 changed files with 20 additions and 19 deletions

View File

@ -25,7 +25,7 @@ LINK_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/lib )
set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_MULTITHREADED ON)
find_package(Boost REQUIRED COMPONENTS thread filesystem system )
find_package(Boost REQUIRED COMPONENTS filesystem system )
include_directories(${Boost_INCLUDE_DIRS})
link_directories(${Boost_LIBRARY_DIRS})
@ -37,6 +37,7 @@ if(UNIX)
endif(UNIX)
if(WIN32)
LINK_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/lib )
add_definitions(
-DWIN32
-DOS_WINDOWS
@ -73,7 +74,7 @@ endif()
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
SET(GCC_CPP11_COMPILE_FLAGS "-std=c++0x")
if( NOT GHQCHK )
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_CPP11_COMPILE_FLAGS} -static -static-libstdc++ -static-libgcc -fPIC " )
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_CPP11_COMPILE_FLAGS} -static -fPIC " )
else( NOT GHQCHK )
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_CPP11_COMPILE_FLAGS}" )
endif( NOT GHQCHK )
@ -91,13 +92,12 @@ if( NOT GHQCHK )
set_target_properties(GLideNHQd PROPERTIES LINK_SEARCH_END_STATIC 1)
# target_link_libraries( GLideNHQd PRIVATE png z ${Boost_LIBRARIES} )
# target_link_libraries(GLideNHQd ${CMAKE_CURRENT_SOURCE_DIR}/lib/libpng.a ${CMAKE_CURRENT_SOURCE_DIR}/lib/libz.a ${BOOSTSYSTEMLIB} ${BOOSTFILESYSTEMLIB} ${BOOSTTHREADLIB})
# target_link_libraries(GLideNHQd ${CMAKE_CURRENT_SOURCE_DIR}/lib/libpng.a ${CMAKE_CURRENT_SOURCE_DIR}/lib/libz.a ${BOOSTSYSTEMLIB} ${BOOSTFILESYSTEMLIB})
target_link_libraries(GLideNHQd PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/lib/libpng.a
${CMAKE_CURRENT_SOURCE_DIR}/lib/libz.a
${CMAKE_CURRENT_SOURCE_DIR}/lib/libboost_system.a
${CMAKE_CURRENT_SOURCE_DIR}/lib/libboost_filesystem.a
${CMAKE_CURRENT_SOURCE_DIR}/lib/libboost_thread.a
)
endif( CMAKE_BUILD_TYPE STREQUAL "Debug")
@ -115,7 +115,6 @@ if( NOT GHQCHK )
${CMAKE_CURRENT_SOURCE_DIR}/lib/libz.a
${CMAKE_CURRENT_SOURCE_DIR}/lib/libboost_system.a
${CMAKE_CURRENT_SOURCE_DIR}/lib/libboost_filesystem.a
${CMAKE_CURRENT_SOURCE_DIR}/lib/libboost_thread.a
)
endif( CMAKE_BUILD_TYPE STREQUAL "Release")
else( NOT GHQCHK )

View File

@ -25,13 +25,14 @@
#pragma warning(disable: 4786)
#endif
#include <functional>
#include <thread>
#include <boost/format.hpp>
#include "TxFilter.h"
#include "TextureFilters.h"
#include "TxDbg.h"
#include "bldno.h"
#include <boost/thread.hpp>
#include <boost/bind.hpp>
#include <boost/format.hpp>
void TxFilter::clear()
{
@ -283,13 +284,13 @@ TxFilter::filter(uint8 *src, int srcwidth, int srcheight, uint16 srcformat, uint
numcore--;
}
if (blkrow > 0 && numcore > 1) {
boost::thread *thrd[MAX_NUMCORE];
std::thread *thrd[MAX_NUMCORE];
unsigned int i;
int blkheight = blkrow << 2;
unsigned int srcStride = (srcwidth * blkheight) << 2;
unsigned int destStride = srcStride * scale * scale;
for (i = 0; i < numcore - 1; i++) {
thrd[i] = new boost::thread(boost::bind(filter_8888,
thrd[i] = new std::thread(std::bind(filter_8888,
(uint32*)_texture,
srcwidth,
blkheight,
@ -298,7 +299,7 @@ TxFilter::filter(uint8 *src, int srcwidth, int srcheight, uint16 srcformat, uint
_texture += srcStride;
_tmptex += destStride;
}
thrd[i] = new boost::thread(boost::bind(filter_8888,
thrd[i] = new std::thread(std::bind(filter_8888,
(uint32*)_texture,
srcwidth,
srcheight - blkheight * i,

View File

@ -27,9 +27,10 @@
/* NOTE: The codes are not optimized. They can be made faster. */
#include <functional>
#include <thread>
#include "TxQuantize.h"
#include <boost/thread.hpp>
#include <boost/bind.hpp>
TxQuantize::TxQuantize()
{
@ -888,13 +889,13 @@ TxQuantize::quantize(uint8* src, uint8* dest, int width, int height, uint16 srcf
numcore--;
}
if (blkrow > 0 && numcore > 1) {
boost::thread *thrd[MAX_NUMCORE];
std::thread *thrd[MAX_NUMCORE];
unsigned int i;
int blkheight = blkrow << 2;
unsigned int srcStride = (width * blkheight) << (2 - bpp_shift);
unsigned int destStride = srcStride << bpp_shift;
for (i = 0; i < numcore - 1; i++) {
thrd[i] = new boost::thread(boost::bind(quantizer,
thrd[i] = new std::thread(std::bind(quantizer,
this,
(uint32*)src,
(uint32*)dest,
@ -903,7 +904,7 @@ TxQuantize::quantize(uint8* src, uint8* dest, int width, int height, uint16 srcf
src += srcStride;
dest += destStride;
}
thrd[i] = new boost::thread(boost::bind(quantizer,
thrd[i] = new std::thread(std::bind(quantizer,
this,
(uint32*)src,
(uint32*)dest,
@ -942,13 +943,13 @@ TxQuantize::quantize(uint8* src, uint8* dest, int width, int height, uint16 srcf
numcore--;
}
if (blkrow > 0 && numcore > 1) {
boost::thread *thrd[MAX_NUMCORE];
std::thread *thrd[MAX_NUMCORE];
unsigned int i;
int blkheight = blkrow << 2;
unsigned int srcStride = (width * blkheight) << 2;
unsigned int destStride = srcStride >> bpp_shift;
for (i = 0; i < numcore - 1; i++) {
thrd[i] = new boost::thread(boost::bind(quantizer,
thrd[i] = new std::thread(std::bind(quantizer,
this,
(uint32*)src,
(uint32*)dest,
@ -957,7 +958,7 @@ TxQuantize::quantize(uint8* src, uint8* dest, int width, int height, uint16 srcf
src += srcStride;
dest += destStride;
}
thrd[i] = new boost::thread(boost::bind(quantizer,
thrd[i] = new std::thread(std::bind(quantizer,
this,
(uint32*)src,
(uint32*)dest,