new-line that clang-format didn't fix
address some comments
This commit is contained in:
parent
59b475a4b9
commit
5940361b81
16 changed files with 210 additions and 138 deletions
|
@ -34,7 +34,8 @@ void DetachedTasks::AddTask(std::function<void()> task) {
|
|||
std::unique_lock lock{instance->mutex};
|
||||
--instance->count;
|
||||
std::notify_all_at_thread_exit(instance->cv, std::move(lock));
|
||||
}).detach();
|
||||
})
|
||||
.detach();
|
||||
}
|
||||
|
||||
} // namespace Common
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
// Copyright 2019 Citra Emulator Project
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
#include "common/assert.h"
|
||||
#include "common/common_types.h"
|
||||
|
@ -6,17 +11,12 @@ namespace Common {
|
|||
void FlipRGBA8Texture(std::vector<u8>& tex, u64 width, u64 height) {
|
||||
ASSERT(tex.size() == width * height * 4);
|
||||
const u64 line_size = width * 4;
|
||||
u8* temp_row = new u8[line_size];
|
||||
u32 offset_1;
|
||||
u32 offset_2;
|
||||
for (u64 line = 0; line < height / 2; line++) {
|
||||
offset_1 = line * line_size;
|
||||
offset_2 = (height - line - 1) * line_size;
|
||||
const u32 offset_1 = line * line_size;
|
||||
const u32 offset_2 = (height - line - 1) * line_size;
|
||||
// Swap lines
|
||||
std::memcpy(temp_row, &tex[offset_1], line_size);
|
||||
std::memcpy(&tex[offset_1], &tex[offset_2], line_size);
|
||||
std::memcpy(&tex[offset_2], temp_row, line_size);
|
||||
std::swap_ranges(tex.begin() + offset_1, tex.begin() + offset_1 + line_size,
|
||||
tex.begin() + offset_2);
|
||||
}
|
||||
delete[] temp_row;
|
||||
}
|
||||
} // namespace Common
|
||||
} // namespace Common
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
// Copyright 2019 Citra Emulator Project
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue