summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitmodules3
-rw-r--r--CMakeLists.txt8
m---------externals/boost0
-rw-r--r--src/common/string_util.cpp6
-rw-r--r--src/video_core/vertex_shader.cpp16
5 files changed, 24 insertions, 9 deletions
diff --git a/.gitmodules b/.gitmodules
index d7201387a..54714e5cd 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,3 +1,6 @@
1[submodule "externals/inih/inih"] 1[submodule "externals/inih/inih"]
2 path = externals/inih/inih 2 path = externals/inih/inih
3 url = https://github.com/svn2github/inih 3 url = https://github.com/svn2github/inih
4[submodule "externals/boost"]
5 path = externals/boost
6 url = https://github.com/citra-emu/ext-boost.git
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 05a560404..61d5d524a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -19,6 +19,14 @@ if (PNG_FOUND)
19 add_definitions(-DHAVE_PNG) 19 add_definitions(-DHAVE_PNG)
20endif () 20endif ()
21 21
22find_package(Boost)
23if (Boost_FOUND)
24 include_directories(${Boost_INCLUDE_DIRS})
25else()
26 message(STATUS "Boost not found, falling back to externals")
27 include_directories(externals/boost)
28endif()
29
22# Include bundled CMake modules 30# Include bundled CMake modules
23list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/externals/cmake-modules") 31list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/externals/cmake-modules")
24 32
diff --git a/externals/boost b/externals/boost
new file mode 160000
Subproject b060148c08ae87a3a5809c4f48cb26ac667487a
diff --git a/src/common/string_util.cpp b/src/common/string_util.cpp
index 19e162c27..7a8274a91 100644
--- a/src/common/string_util.cpp
+++ b/src/common/string_util.cpp
@@ -2,7 +2,7 @@
2// Licensed under GPLv2 2// Licensed under GPLv2
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include <algorithm> 5#include <boost/range/algorithm.hpp>
6 6
7#include "common/common.h" 7#include "common/common.h"
8#include "common/string_util.h" 8#include "common/string_util.h"
@@ -18,13 +18,13 @@ namespace Common {
18 18
19/// Make a string lowercase 19/// Make a string lowercase
20std::string ToLower(std::string str) { 20std::string ToLower(std::string str) {
21 std::transform(str.begin(), str.end(), str.begin(), ::tolower); 21 boost::transform(str, str.begin(), ::tolower);
22 return str; 22 return str;
23} 23}
24 24
25/// Make a string uppercase 25/// Make a string uppercase
26std::string ToUpper(std::string str) { 26std::string ToUpper(std::string str) {
27 std::transform(str.begin(), str.end(), str.begin(), ::toupper); 27 boost::transform(str, str.begin(), ::toupper);
28 return str; 28 return str;
29} 29}
30 30
diff --git a/src/video_core/vertex_shader.cpp b/src/video_core/vertex_shader.cpp
index 96625791c..0dff11a0f 100644
--- a/src/video_core/vertex_shader.cpp
+++ b/src/video_core/vertex_shader.cpp
@@ -2,11 +2,16 @@
2// Licensed under GPLv2 2// Licensed under GPLv2
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include <boost/range/algorithm.hpp>
6
7#include <common/file_util.h>
8
9#include <core/mem_map.h>
10
11#include "debug_utils/debug_utils.h"
12
5#include "pica.h" 13#include "pica.h"
6#include "vertex_shader.h" 14#include "vertex_shader.h"
7#include "debug_utils/debug_utils.h"
8#include <core/mem_map.h>
9#include <common/file_util.h>
10 15
11namespace Pica { 16namespace Pica {
12 17
@@ -238,7 +243,7 @@ OutputVertex RunShader(const InputVertex& input, int num_attributes)
238 // Setup input register table 243 // Setup input register table
239 const auto& attribute_register_map = registers.vs_input_register_map; 244 const auto& attribute_register_map = registers.vs_input_register_map;
240 float24 dummy_register; 245 float24 dummy_register;
241 std::fill(&state.input_register_table[0], &state.input_register_table[16], &dummy_register); 246 boost::fill(state.input_register_table, &dummy_register);
242 if(num_attributes > 0) state.input_register_table[attribute_register_map.attribute0_register] = &input.attr[0].x; 247 if(num_attributes > 0) state.input_register_table[attribute_register_map.attribute0_register] = &input.attr[0].x;
243 if(num_attributes > 1) state.input_register_table[attribute_register_map.attribute1_register] = &input.attr[1].x; 248 if(num_attributes > 1) state.input_register_table[attribute_register_map.attribute1_register] = &input.attr[1].x;
244 if(num_attributes > 2) state.input_register_table[attribute_register_map.attribute2_register] = &input.attr[2].x; 249 if(num_attributes > 2) state.input_register_table[attribute_register_map.attribute2_register] = &input.attr[2].x;
@@ -272,8 +277,7 @@ OutputVertex RunShader(const InputVertex& input, int num_attributes)
272 277
273 state.status_registers[0] = false; 278 state.status_registers[0] = false;
274 state.status_registers[1] = false; 279 state.status_registers[1] = false;
275 std::fill(state.call_stack, state.call_stack + sizeof(state.call_stack) / sizeof(state.call_stack[0]), 280 boost::fill(state.call_stack, VertexShaderState::INVALID_ADDRESS);
276 VertexShaderState::INVALID_ADDRESS);
277 state.call_stack_pointer = &state.call_stack[0]; 281 state.call_stack_pointer = &state.call_stack[0];
278 282
279 ProcessShaderCode(state); 283 ProcessShaderCode(state);