mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-02-17 04:39:34 +00:00
[Core/HLE/GPU/D3D11/GLES] Using for based loop C++17 and replaced on structured binding map C++17
This commit is contained in:
parent
45429bcd85
commit
192650f551
@ -54,14 +54,8 @@ void DoSet(PointerWrap &p, std::set<T> &x) {
|
||||
template <class T>
|
||||
void Do(PointerWrap &p, std::set<T *> &x) {
|
||||
if (p.mode == PointerWrap::MODE_READ) {
|
||||
<<<<<<< HEAD
|
||||
for (auto it = x.begin(), end = x.end(); it != end; ++it) {
|
||||
delete *it;
|
||||
=======
|
||||
for (T* s : x) {
|
||||
if (s != nullptr)
|
||||
delete s;
|
||||
>>>>>>> 37ce2a4de1 ([Common/Data/File/Input/Net/Serialize/System/UI] Using for based loop C++17 and replaced on structured binding map C++17)
|
||||
for (T *s : x) {
|
||||
delete s;
|
||||
}
|
||||
}
|
||||
DoSet(p, x);
|
||||
|
@ -1209,9 +1209,9 @@ void Config::Load(const char *iniFileName, const char *controllerIniFilename) {
|
||||
|
||||
auto pinnedPaths = iniFile.GetOrCreateSection("PinnedPaths")->ToMap();
|
||||
vPinnedPaths.clear();
|
||||
for (auto it = pinnedPaths.begin(), end = pinnedPaths.end(); it != end; ++it) {
|
||||
for (const auto &[_, value] : pinnedPaths) {
|
||||
// Unpin paths that are deleted automatically.
|
||||
const std::string &path = it->second;
|
||||
const std::string &path = value;
|
||||
if (startsWith(path, "http://") || startsWith(path, "https://") || File::Exists(Path(path))) {
|
||||
vPinnedPaths.push_back(File::ResolvePath(path));
|
||||
}
|
||||
@ -1231,8 +1231,8 @@ void Config::Load(const char *iniFileName, const char *controllerIniFilename) {
|
||||
|
||||
// Load post process shader values
|
||||
mPostShaderSetting.clear();
|
||||
for (const auto& it : postShaderSetting->ToMap()) {
|
||||
mPostShaderSetting[it.first] = std::stof(it.second);
|
||||
for (const auto &[key, value] : postShaderSetting->ToMap()) {
|
||||
mPostShaderSetting[key] = std::stof(value);
|
||||
}
|
||||
|
||||
// Load post process shader names
|
||||
@ -1355,8 +1355,8 @@ bool Config::Save(const char *saveReason) {
|
||||
if (!bGameSpecific) {
|
||||
Section *postShaderSetting = iniFile.GetOrCreateSection("PostShaderSetting");
|
||||
postShaderSetting->Clear();
|
||||
for (auto it = mPostShaderSetting.begin(), end = mPostShaderSetting.end(); it != end; ++it) {
|
||||
postShaderSetting->Set(it->first.c_str(), it->second);
|
||||
for (const auto &[k, v] : mPostShaderSetting) {
|
||||
postShaderSetting->Set(k.c_str(), v);
|
||||
}
|
||||
Section *postShaderChain = iniFile.GetOrCreateSection("PostShaderList");
|
||||
postShaderChain->Clear();
|
||||
@ -1771,8 +1771,8 @@ bool Config::saveGameConfig(const std::string &pGameId, const std::string &title
|
||||
|
||||
Section *postShaderSetting = iniFile.GetOrCreateSection("PostShaderSetting");
|
||||
postShaderSetting->Clear();
|
||||
for (auto it = mPostShaderSetting.begin(), end = mPostShaderSetting.end(); it != end; ++it) {
|
||||
postShaderSetting->Set(it->first.c_str(), it->second);
|
||||
for (const auto &[k, v] : mPostShaderSetting) {
|
||||
postShaderSetting->Set(k.c_str(), v);
|
||||
}
|
||||
|
||||
Section *postShaderChain = iniFile.GetOrCreateSection("PostShaderList");
|
||||
@ -1804,20 +1804,20 @@ bool Config::loadGameConfig(const std::string &pGameId, const std::string &title
|
||||
|
||||
auto postShaderSetting = iniFile.GetOrCreateSection("PostShaderSetting")->ToMap();
|
||||
mPostShaderSetting.clear();
|
||||
for (const auto &it : postShaderSetting) {
|
||||
for (const auto &[k, v] : postShaderSetting) {
|
||||
float value = 0.0f;
|
||||
if (sscanf(it.second.c_str(), "%f", &value)) {
|
||||
mPostShaderSetting[it.first] = value;
|
||||
if (sscanf(v.c_str(), "%f", &value)) {
|
||||
mPostShaderSetting[k] = value;
|
||||
} else {
|
||||
WARN_LOG(Log::Loader, "Invalid float value string for param %s: '%s'", it.first.c_str(), it.second.c_str());
|
||||
WARN_LOG(Log::Loader, "Invalid float value string for param %s: '%s'", k.c_str(), v.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
auto postShaderChain = iniFile.GetOrCreateSection("PostShaderList")->ToMap();
|
||||
vPostShaderNames.clear();
|
||||
for (auto it : postShaderChain) {
|
||||
if (it.second != "Off")
|
||||
vPostShaderNames.push_back(it.second);
|
||||
for (const auto &[_, v] : postShaderChain) {
|
||||
if (v != "Off")
|
||||
vPostShaderNames.push_back(v);
|
||||
}
|
||||
|
||||
IterateSettings(iniFile, [](Section *section, const ConfigSetting &setting) {
|
||||
@ -1855,15 +1855,15 @@ void Config::unloadGameConfig() {
|
||||
|
||||
auto postShaderSetting = iniFile.GetOrCreateSection("PostShaderSetting")->ToMap();
|
||||
mPostShaderSetting.clear();
|
||||
for (auto it : postShaderSetting) {
|
||||
mPostShaderSetting[it.first] = std::stof(it.second);
|
||||
for (const auto &[k, v] : postShaderSetting) {
|
||||
mPostShaderSetting[k] = std::stof(v);
|
||||
}
|
||||
|
||||
auto postShaderChain = iniFile.GetOrCreateSection("PostShaderList")->ToMap();
|
||||
vPostShaderNames.clear();
|
||||
for (auto it : postShaderChain) {
|
||||
if (it.second != "Off")
|
||||
vPostShaderNames.push_back(it.second);
|
||||
for (const auto &[k, v] : postShaderChain) {
|
||||
if (v != "Off")
|
||||
vPostShaderNames.push_back(v);
|
||||
}
|
||||
|
||||
LoadStandardControllerIni();
|
||||
|
@ -236,10 +236,10 @@ void ParamSFOData::WriteSFO(u8 **paramsfo, size_t *size) const {
|
||||
total_size += sizeof(Header);
|
||||
|
||||
// Get size info
|
||||
for (auto it = values.begin(); it != values.end(); ++it)
|
||||
for (const auto &[k, v] : values)
|
||||
{
|
||||
key_size += it->first.size()+1;
|
||||
data_size += it->second.max_size;
|
||||
key_size += k.size() + 1;
|
||||
data_size += v.max_size;
|
||||
|
||||
header.index_table_entries++;
|
||||
}
|
||||
@ -266,42 +266,42 @@ void ParamSFOData::WriteSFO(u8 **paramsfo, size_t *size) const {
|
||||
u8* key_ptr = data + header.key_table_start;
|
||||
u8* data_ptr = data + header.data_table_start;
|
||||
|
||||
for (auto it = values.begin(); it != values.end(); ++it)
|
||||
for (const auto &[k, v] : values)
|
||||
{
|
||||
u16 offset = (u16)(key_ptr - (data+header.key_table_start));
|
||||
index_ptr->key_table_offset = offset;
|
||||
offset = (u16)(data_ptr - (data+header.data_table_start));
|
||||
index_ptr->data_table_offset = offset;
|
||||
index_ptr->param_max_len = it->second.max_size;
|
||||
if (it->second.type == VT_INT)
|
||||
index_ptr->param_max_len = v.max_size;
|
||||
if (v.type == VT_INT)
|
||||
{
|
||||
index_ptr->param_fmt = 0x0404;
|
||||
index_ptr->param_len = 4;
|
||||
|
||||
*(s32_le *)data_ptr = it->second.i_value;
|
||||
*(s32_le *)data_ptr = v.i_value;
|
||||
}
|
||||
else if (it->second.type == VT_UTF8_SPE)
|
||||
else if (v.type == VT_UTF8_SPE)
|
||||
{
|
||||
index_ptr->param_fmt = 0x0004;
|
||||
index_ptr->param_len = it->second.u_size;
|
||||
index_ptr->param_len = v.u_size;
|
||||
|
||||
memset(data_ptr,0,index_ptr->param_max_len);
|
||||
memcpy(data_ptr,it->second.u_value,index_ptr->param_len);
|
||||
memcpy(data_ptr,v.u_value,index_ptr->param_len);
|
||||
}
|
||||
else if (it->second.type == VT_UTF8)
|
||||
else if (v.type == VT_UTF8)
|
||||
{
|
||||
index_ptr->param_fmt = 0x0204;
|
||||
index_ptr->param_len = (u32)it->second.s_value.size()+1;
|
||||
index_ptr->param_len = (u32)v.s_value.size()+1;
|
||||
|
||||
memcpy(data_ptr,it->second.s_value.c_str(),index_ptr->param_len);
|
||||
memcpy(data_ptr,v.s_value.c_str(),index_ptr->param_len);
|
||||
data_ptr[index_ptr->param_len] = 0;
|
||||
}
|
||||
|
||||
memcpy(key_ptr,it->first.c_str(),it->first.size());
|
||||
key_ptr[it->first.size()] = 0;
|
||||
memcpy(key_ptr,k.c_str(),k.size());
|
||||
key_ptr[k.size()] = 0;
|
||||
|
||||
data_ptr += index_ptr->param_max_len;
|
||||
key_ptr += it->first.size()+1;
|
||||
key_ptr += k.size() + 1;
|
||||
index_ptr++;
|
||||
|
||||
}
|
||||
|
@ -1733,23 +1733,21 @@ void RestoreReplacedInstructions(u32 startAddr, u32 endAddr) {
|
||||
|
||||
std::map<u32, u32> SaveAndClearReplacements() {
|
||||
std::map<u32, u32> saved;
|
||||
for (auto it = replacedInstructions.begin(), end = replacedInstructions.end(); it != end; ++it) {
|
||||
const u32 addr = it->first;
|
||||
for (const auto &[addr, instr] : replacedInstructions) {
|
||||
// This will not retain jit blocks.
|
||||
const u32 curInstr = Memory::Read_Opcode_JIT(addr).encoding;
|
||||
if (MIPS_IS_REPLACEMENT(curInstr)) {
|
||||
saved[addr] = curInstr;
|
||||
Memory::Write_U32(it->second, addr);
|
||||
Memory::Write_U32(instr, addr);
|
||||
}
|
||||
}
|
||||
return saved;
|
||||
}
|
||||
|
||||
void RestoreSavedReplacements(const std::map<u32, u32> &saved) {
|
||||
for (auto it = saved.begin(), end = saved.end(); it != end; ++it) {
|
||||
const u32 addr = it->first;
|
||||
for (const auto &[addr, instr] : saved) {
|
||||
// Just put the replacements back.
|
||||
Memory::Write_U32(it->second, addr);
|
||||
Memory::Write_U32(instr, addr);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1337,15 +1337,15 @@ void game_product_override(SceNetAdhocctlProductCode * product)
|
||||
// Destroy Prepared SQL Statement
|
||||
sqlite3_finalize(statement);
|
||||
}*/
|
||||
for (std::vector<db_crosslink>::iterator it = crosslinks.begin(); it != crosslinks.end(); it++) {
|
||||
if (IsMatch(it->id_from, productid)) {
|
||||
for (const auto &link : crosslinks) {
|
||||
if (IsMatch(link.id_from, productid)) {
|
||||
// Grab Crosslink ID
|
||||
char crosslink[PRODUCT_CODE_LENGTH + 1];
|
||||
strncpy(crosslink, it->id_to, PRODUCT_CODE_LENGTH);
|
||||
strncpy(crosslink, link.id_to, PRODUCT_CODE_LENGTH);
|
||||
crosslink[PRODUCT_CODE_LENGTH] = 0; // null terminated
|
||||
|
||||
// Crosslink Product Code
|
||||
strncpy(product->data, it->id_to, PRODUCT_CODE_LENGTH);
|
||||
strncpy(product->data, link.id_to, PRODUCT_CODE_LENGTH);
|
||||
|
||||
// Log Crosslink
|
||||
INFO_LOG(Log::sceNet, "AdhocServer: Crosslinked %s to %s", productid, crosslink);
|
||||
@ -1376,8 +1376,8 @@ void game_product_override(SceNetAdhocctlProductCode * product)
|
||||
// Destroy Prepare SQL Statement
|
||||
sqlite3_finalize(statement);
|
||||
}*/
|
||||
for (std::vector<db_productid>::iterator it = productids.begin(); it != productids.end(); it++) {
|
||||
if (IsMatch(it->id, productid)) {
|
||||
for (const auto &product: productids) {
|
||||
if (IsMatch(product.id, productid)) {
|
||||
// Set Exists Flag
|
||||
exists = 1;
|
||||
break;
|
||||
@ -1491,10 +1491,10 @@ void update_status()
|
||||
}*/
|
||||
//db_productid *foundid = NULL;
|
||||
bool found = false;
|
||||
for (std::vector<db_productid>::iterator it = productids.begin(); it != productids.end(); it++) {
|
||||
if (IsMatch(it->id, productid)) {
|
||||
for (const auto &product : productids) {
|
||||
if (IsMatch(product.id, productid)) {
|
||||
// Copy Game Name
|
||||
strcpyxml(displayname, it->name, sizeof(displayname));
|
||||
strcpyxml(displayname, product.name, sizeof(displayname));
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
|
@ -16,6 +16,7 @@
|
||||
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
||||
|
||||
#include "Common/Serialize/Serializer.h"
|
||||
|
||||
#include "Common/Serialize/SerializeFuncs.h"
|
||||
#include "Core/HLE/HLE.h"
|
||||
#include "Core/HLE/FunctionWrappers.h"
|
||||
@ -61,8 +62,8 @@ static bool removeDecoder(u32 ctxPtr) {
|
||||
}
|
||||
|
||||
static void clearDecoders() {
|
||||
for (auto it = audioList.begin(), end = audioList.end(); it != end; it++) {
|
||||
delete it->second;
|
||||
for (const auto &[_, decoder] : audioList) {
|
||||
delete decoder;
|
||||
}
|
||||
audioList.clear();
|
||||
}
|
||||
@ -216,8 +217,8 @@ void __sceAudiocodecDoState(PointerWrap &p){
|
||||
auto codec_ = new int[count];
|
||||
auto ctxPtr_ = new u32[count];
|
||||
int i = 0;
|
||||
for (auto it = audioList.begin(), end = audioList.end(); it != end; it++) {
|
||||
const AudioDecoder *decoder = it->second;
|
||||
for (auto iter : audioList) {
|
||||
const AudioDecoder *decoder = iter.second;
|
||||
codec_[i] = decoder->GetAudioType();
|
||||
ctxPtr_[i] = decoder->GetCtxPtr();
|
||||
i++;
|
||||
|
@ -958,25 +958,25 @@ void __FontInit() {
|
||||
}
|
||||
|
||||
void __FontShutdown() {
|
||||
for (auto iter = fontMap.begin(); iter != fontMap.end(); iter++) {
|
||||
if (iter->second->IsValid()) {
|
||||
FontLib *fontLib = iter->second->GetFontLib();
|
||||
for (const auto &[_, font] : fontMap) {
|
||||
if (font->IsValid()) {
|
||||
FontLib *fontLib = font->GetFontLib();
|
||||
if (fontLib) {
|
||||
fontLib->CloseFont(iter->second, true);
|
||||
fontLib->CloseFont(font, true);
|
||||
}
|
||||
} else {
|
||||
ERROR_LOG(Log::HLE, "__FontShutdown: Bad entry in fontMap");
|
||||
}
|
||||
delete iter->second;
|
||||
delete font;
|
||||
}
|
||||
fontMap.clear();
|
||||
for (auto iter = fontLibList.begin(); iter != fontLibList.end(); iter++) {
|
||||
delete *iter;
|
||||
for (auto *fontlib : fontLibList) {
|
||||
delete fontlib;
|
||||
}
|
||||
fontLibList.clear();
|
||||
fontLibMap.clear();
|
||||
for (auto iter = internalFonts.begin(); iter != internalFonts.end(); ++iter) {
|
||||
delete *iter;
|
||||
for (auto *font : internalFonts) {
|
||||
delete font;
|
||||
}
|
||||
internalFonts.clear();
|
||||
}
|
||||
|
@ -231,9 +231,9 @@ void __GeDoState(PointerWrap &p) {
|
||||
std::list<GeInterruptData_v1> old;
|
||||
Do(p, old);
|
||||
ge_pending_cb.clear();
|
||||
for (auto it = old.begin(), end = old.end(); it != end; ++it) {
|
||||
GeInterruptData intrdata = {it->listid, it->pc};
|
||||
intrdata.cmd = Memory::ReadUnchecked_U32(it->pc - 4) >> 24;
|
||||
for (const auto &ge : old) {
|
||||
GeInterruptData intrdata = {ge.listid, ge.pc};
|
||||
intrdata.cmd = Memory::ReadUnchecked_U32(ge.pc - 4) >> 24;
|
||||
ge_pending_cb.push_back(intrdata);
|
||||
}
|
||||
}
|
||||
@ -298,8 +298,8 @@ void __GeWaitCurrentThread(GPUSyncType type, SceUID waitId, const char *reason)
|
||||
static bool __GeTriggerWait(WaitType waitType, SceUID waitId, WaitingThreadList &waitingThreads) {
|
||||
// TODO: Do they ever get a result other than 0?
|
||||
bool wokeThreads = false;
|
||||
for (auto it = waitingThreads.begin(), end = waitingThreads.end(); it != end; ++it)
|
||||
wokeThreads |= HLEKernel::ResumeFromWait(*it, waitType, waitId, 0);
|
||||
for (int threadID : waitingThreads)
|
||||
wokeThreads |= HLEKernel::ResumeFromWait(threadID, waitType, waitId, 0);
|
||||
waitingThreads.clear();
|
||||
return wokeThreads;
|
||||
}
|
||||
|
@ -184,9 +184,8 @@ static bool __KernelUnlockEventFlagForThread(EventFlag *e, EventFlagTh &th, u32
|
||||
static bool __KernelClearEventFlagThreads(EventFlag *e, int reason) {
|
||||
u32 error;
|
||||
bool wokeThreads = false;
|
||||
std::vector<EventFlagTh>::iterator iter, end;
|
||||
for (iter = e->waitingThreads.begin(), end = e->waitingThreads.end(); iter != end; ++iter)
|
||||
__KernelUnlockEventFlagForThread(e, *iter, error, reason, wokeThreads);
|
||||
for (auto &event : e->waitingThreads)
|
||||
__KernelUnlockEventFlagForThread(e, event, error, reason, wokeThreads);
|
||||
e->waitingThreads.clear();
|
||||
|
||||
return wokeThreads;
|
||||
|
@ -318,37 +318,37 @@ bool TextureReplacer::LoadIniValues(IniFile &ini, VFSBackend *dir, bool isOverri
|
||||
// Format: hashname = filename.png
|
||||
bool checkFilenames = saveEnabled_ && !g_Config.bIgnoreTextureFilenames && !vfsIsZip_;
|
||||
|
||||
for (const auto &item : hashes) {
|
||||
for (const auto &[k, v] : hashes) {
|
||||
ReplacementCacheKey key(0, 0);
|
||||
// sscanf might fail to pluck the level if omitted from the line, but that's ok, we default level to 0.
|
||||
// sscanf doesn't write to non-matched outputs.
|
||||
int level = 0;
|
||||
if (sscanf(item.first.c_str(), "%16llx%8x_%d", &key.cachekey, &key.hash, &level) >= 1) {
|
||||
if (sscanf(k.c_str(), "%16llx%8x_%d", &key.cachekey, &key.hash, &level) >= 1) {
|
||||
// We allow empty filenames, to mark textures that we don't want to keep saving.
|
||||
filenameMap[key][level] = item.second;
|
||||
filenameMap[key][level] = v;
|
||||
if (checkFilenames) {
|
||||
// TODO: We should check for the union of these on all platforms, really.
|
||||
#if PPSSPP_PLATFORM(WINDOWS)
|
||||
bool bad = item.second.find_first_of("\\ABCDEFGHIJKLMNOPQRSTUVWXYZ:<>|?*") != std::string::npos;
|
||||
bool bad = v.find_first_of("\\ABCDEFGHIJKLMNOPQRSTUVWXYZ:<>|?*") != std::string::npos;
|
||||
// Uppercase probably means the filenames don't match.
|
||||
// Avoiding an actual check of the filenames to avoid performance impact.
|
||||
#else
|
||||
bool bad = item.second.find_first_of("\\:<>|?*") != std::string::npos;
|
||||
bool bad = v.find_first_of("\\:<>|?*") != std::string::npos;
|
||||
#endif
|
||||
if (bad) {
|
||||
badFileNameCount++;
|
||||
if (badFileNameCount == 10) {
|
||||
badFilenames.append("...");
|
||||
} else if (badFileNameCount < 10) {
|
||||
badFilenames.append(item.second);
|
||||
badFilenames.append(v);
|
||||
badFilenames.push_back('\n');
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (item.first.empty()) {
|
||||
INFO_LOG(Log::G3D, "Ignoring [hashes] line with empty key: '= %s'", item.second.c_str());
|
||||
} else if (k.empty()) {
|
||||
INFO_LOG(Log::G3D, "Ignoring [hashes] line with empty key: '= %s'", v.c_str());
|
||||
} else {
|
||||
ERROR_LOG(Log::G3D, "Unsupported syntax under [hashes], ignoring: %s = ", item.first.c_str());
|
||||
ERROR_LOG(Log::G3D, "Unsupported syntax under [hashes], ignoring: %s = ", k.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -365,24 +365,24 @@ bool TextureReplacer::LoadIniValues(IniFile &ini, VFSBackend *dir, bool isOverri
|
||||
if (ini.HasSection("hashranges")) {
|
||||
auto hashranges = ini.GetOrCreateSection("hashranges")->ToMap();
|
||||
// Format: addr,w,h = newW,newH
|
||||
for (const auto &item : hashranges) {
|
||||
ParseHashRange(item.first, item.second);
|
||||
for (const auto &[k, v] : hashranges) {
|
||||
ParseHashRange(k, v);
|
||||
}
|
||||
}
|
||||
|
||||
if (ini.HasSection("filtering")) {
|
||||
auto filters = ini.GetOrCreateSection("filtering")->ToMap();
|
||||
// Format: hashname = nearest or linear
|
||||
for (const auto &item : filters) {
|
||||
ParseFiltering(item.first, item.second);
|
||||
for (const auto &[k, v] : filters) {
|
||||
ParseFiltering(k, v);
|
||||
}
|
||||
}
|
||||
|
||||
if (ini.HasSection("reducehashranges")) {
|
||||
auto reducehashranges = ini.GetOrCreateSection("reducehashranges")->ToMap();
|
||||
// Format: w,h = reducehashvalues
|
||||
for (const auto& item : reducehashranges) {
|
||||
ParseReduceHashRange(item.first, item.second);
|
||||
for (const auto &[k, v] : reducehashranges) {
|
||||
ParseReduceHashRange(k, v);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -117,11 +117,11 @@ ShaderManagerD3D11::~ShaderManagerD3D11() {
|
||||
}
|
||||
|
||||
void ShaderManagerD3D11::Clear() {
|
||||
for (auto iter = fsCache_.begin(); iter != fsCache_.end(); ++iter) {
|
||||
delete iter->second;
|
||||
for (const auto &[_, fs] : fsCache_) {
|
||||
delete fs;
|
||||
}
|
||||
for (auto iter = vsCache_.begin(); iter != vsCache_.end(); ++iter) {
|
||||
delete iter->second;
|
||||
for (const auto &[_, vs] : vsCache_) {
|
||||
delete vs;
|
||||
}
|
||||
fsCache_.clear();
|
||||
vsCache_.clear();
|
||||
|
@ -147,8 +147,8 @@ GLRTexture *FragmentTestCacheGLES::CreateTestTexture(const GEComparison funcs[4]
|
||||
|
||||
void FragmentTestCacheGLES::Clear(bool deleteThem) {
|
||||
if (deleteThem) {
|
||||
for (auto tex = cache_.begin(); tex != cache_.end(); ++tex) {
|
||||
render_->DeleteTexture(tex->second.texture);
|
||||
for (const auto &[_, v] : cache_) {
|
||||
render_->DeleteTexture(v.texture);
|
||||
}
|
||||
}
|
||||
cache_.clear();
|
||||
|
@ -210,9 +210,9 @@ u32 GPUCommon::DrawSync(int mode) {
|
||||
|
||||
// If there's no current list, it must be complete.
|
||||
DisplayList *top = NULL;
|
||||
for (auto it = dlQueue.begin(), end = dlQueue.end(); it != end; ++it) {
|
||||
if (dls[*it].state != PSP_GE_DL_STATE_COMPLETED) {
|
||||
top = &dls[*it];
|
||||
for (int i : dlQueue) {
|
||||
if (dls[i].state != PSP_GE_DL_STATE_COMPLETED) {
|
||||
top = &dls[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -412,9 +412,9 @@ u32 GPUCommon::EnqueueList(u32 listpc, u32 stall, int subIntrBase, PSPPointer<Ps
|
||||
}
|
||||
if (id < 0) {
|
||||
ERROR_LOG_REPORT(Log::G3D, "No DL ID available to enqueue");
|
||||
for (auto it = dlQueue.begin(); it != dlQueue.end(); ++it) {
|
||||
DisplayList &dl = dls[*it];
|
||||
DEBUG_LOG(Log::G3D, "DisplayList %d status %d pc %08x stall %08x", *it, dl.state, dl.pc, dl.stall);
|
||||
for (int i : dlQueue) {
|
||||
DisplayList &dl = dls[i];
|
||||
DEBUG_LOG(Log::G3D, "DisplayList %d status %d pc %08x stall %08x", i, dl.state, dl.pc, dl.stall);
|
||||
}
|
||||
return SCE_KERNEL_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@ -1546,8 +1546,8 @@ bool GPUCommon::GetCurrentDisplayList(DisplayList &list) {
|
||||
std::vector<DisplayList> GPUCommon::ActiveDisplayLists() {
|
||||
std::vector<DisplayList> result;
|
||||
|
||||
for (auto it = dlQueue.begin(), end = dlQueue.end(); it != end; ++it) {
|
||||
result.push_back(dls[*it]);
|
||||
for (int it : dlQueue) {
|
||||
result.push_back(dls[it]);
|
||||
}
|
||||
|
||||
return result;
|
||||
|
Loading…
x
Reference in New Issue
Block a user