aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Tony Wasserka <neobrainx@gmail.com>2014-12-12 17:32:57 +0100
committerGravatar Tony Wasserka <neobrainx@gmail.com>2014-12-12 17:32:57 +0100
commit33e61ef514d2b1a32eea10161d900f1e2e5c0ba2 (patch)
treed4f7e432ab42cf7fad3834bb14ba72b54b346cc0 /src
parentcb1d9402b340e018c3598d8631f9d92e6871fe28 (diff)
parent3d8c6e61beef922f79733718c5314c0d7015e93f (diff)
Merge pull request #261 from neobrain/boost
Add Boost as a submodule and add some minor cleanups using Boost.Range
Diffstat (limited to 'src')
-rw-r--r--src/common/string_util.cpp6
-rw-r--r--src/video_core/vertex_shader.cpp16
2 files changed, 13 insertions, 9 deletions
diff --git a/src/common/string_util.cpp b/src/common/string_util.cpp
index 19e162c2..7a8274a9 100644
--- a/src/common/string_util.cpp
+++ b/src/common/string_util.cpp
@@ -2,7 +2,7 @@
// Licensed under GPLv2
// Refer to the license.txt file included.
-#include <algorithm>
+#include <boost/range/algorithm.hpp>
#include "common/common.h"
#include "common/string_util.h"
@@ -18,13 +18,13 @@ namespace Common {
/// Make a string lowercase
std::string ToLower(std::string str) {
- std::transform(str.begin(), str.end(), str.begin(), ::tolower);
+ boost::transform(str, str.begin(), ::tolower);
return str;
}
/// Make a string uppercase
std::string ToUpper(std::string str) {
- std::transform(str.begin(), str.end(), str.begin(), ::toupper);
+ boost::transform(str, str.begin(), ::toupper);
return str;
}
diff --git a/src/video_core/vertex_shader.cpp b/src/video_core/vertex_shader.cpp
index 96625791..0dff11a0 100644
--- a/src/video_core/vertex_shader.cpp
+++ b/src/video_core/vertex_shader.cpp
@@ -2,11 +2,16 @@
// Licensed under GPLv2
// Refer to the license.txt file included.
+#include <boost/range/algorithm.hpp>
+
+#include <common/file_util.h>
+
+#include <core/mem_map.h>
+
+#include "debug_utils/debug_utils.h"
+
#include "pica.h"
#include "vertex_shader.h"
-#include "debug_utils/debug_utils.h"
-#include <core/mem_map.h>
-#include <common/file_util.h>
namespace Pica {
@@ -238,7 +243,7 @@ OutputVertex RunShader(const InputVertex& input, int num_attributes)
// Setup input register table
const auto& attribute_register_map = registers.vs_input_register_map;
float24 dummy_register;
- std::fill(&state.input_register_table[0], &state.input_register_table[16], &dummy_register);
+ boost::fill(state.input_register_table, &dummy_register);
if(num_attributes > 0) state.input_register_table[attribute_register_map.attribute0_register] = &input.attr[0].x;
if(num_attributes > 1) state.input_register_table[attribute_register_map.attribute1_register] = &input.attr[1].x;
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)
state.status_registers[0] = false;
state.status_registers[1] = false;
- std::fill(state.call_stack, state.call_stack + sizeof(state.call_stack) / sizeof(state.call_stack[0]),
- VertexShaderState::INVALID_ADDRESS);
+ boost::fill(state.call_stack, VertexShaderState::INVALID_ADDRESS);
state.call_stack_pointer = &state.call_stack[0];
ProcessShaderCode(state);