Merge branch 'master' into GLSL-master

Conflicts:
	CMakeLists.txt
	Source/Core/DolphinWX/Dolphin.vcxproj
	Source/Core/DolphinWX/Src/GLInterface/WX.cpp
	Source/Core/DolphinWX/Src/GLInterface/WX.h
	Source/Core/VideoCommon/Src/TextureCacheBase.cpp
	Source/Core/VideoCommon/Src/TextureCacheBase.h
	Source/Plugins/Plugin_VideoDX11/Src/TextureCache.cpp
	Source/Plugins/Plugin_VideoDX11/Src/TextureCache.h
	Source/Plugins/Plugin_VideoDX9/Src/TextureCache.cpp
	Source/Plugins/Plugin_VideoDX9/Src/TextureCache.h
	Source/Plugins/Plugin_VideoOGL/Src/Render.cpp
	Source/Plugins/Plugin_VideoOGL/Src/TextureCache.cpp
	Source/Plugins/Plugin_VideoOGL/Src/TextureCache.h
	Source/Plugins/Plugin_VideoSoftware/Src/SWmain.cpp

damn mipmap_fixes ...
This commit is contained in:
degasus
2013-02-18 18:49:20 +01:00
184 changed files with 7637 additions and 6605 deletions

View File

@ -205,14 +205,7 @@ void CPUInfo::Detect()
// Turn the cpu info into a string we can show
std::string CPUInfo::Summarize()
{
std::string sum;
if (num_cores == 1)
sum = StringFromFormat("%s, %i core", cpu_string, num_cores);
else
{
sum = StringFromFormat("%s, %i cores", cpu_string, num_cores);
if (HTT) sum += StringFromFormat(" (%i logical threads per physical core)", logical_cpu_count);
}
std::string sum(cpu_string);
if (bSSE) sum += ", SSE";
if (bSSE2) sum += ", SSE2";
if (bSSE3) sum += ", SSE3";

View File

@ -42,6 +42,7 @@
#endif
#include <fstream>
#include <algorithm>
#include <sys/stat.h>
#ifndef S_ISDIR
@ -196,8 +197,9 @@ bool CreateFullPath(const std::string &fullPath)
// we're done, yay!
if (position == fullPath.npos)
return true;
std::string subPath = fullPath.substr(0, position);
// Include the '/' so the first call is CreateDir("/") rather than CreateDir("")
std::string const subPath(fullPath.substr(0, position + 1));
if (!File::IsDirectory(subPath))
File::CreateDir(subPath);
@ -773,6 +775,24 @@ IOFile::~IOFile()
Close();
}
IOFile::IOFile(IOFile&& other)
: m_file(NULL), m_good(true)
{
Swap(other);
}
IOFile& IOFile::operator=(IOFile other)
{
Swap(other);
return *this;
}
void IOFile::Swap(IOFile& other)
{
std::swap(m_file, other.m_file);
std::swap(m_good, other.m_good);
}
bool IOFile::Open(const std::string& filename, const char openmode[])
{
Close();

View File

@ -150,7 +150,7 @@ bool ReadFileToString(bool text_file, const char *filename, std::string &str);
// simple wrapper for cstdlib file functions to
// hopefully will make error checking easier
// and make forgetting an fclose() harder
class IOFile : NonCopyable
class IOFile
{
public:
IOFile();
@ -158,6 +158,11 @@ public:
IOFile(const std::string& filename, const char openmode[]);
~IOFile();
IOFile(IOFile&& other);
IOFile& operator=(IOFile other);
void Swap(IOFile& other);
bool Open(const std::string& filename, const char openmode[]);
bool Close();
@ -212,6 +217,7 @@ public:
void Clear() { m_good = true; std::clearerr(m_file); }
private:
IOFile(const IOFile&) /*= delete*/;
IOFile& operator=(const IOFile&) /*= delete*/;
std::FILE* m_file;

View File

@ -43,7 +43,8 @@ void MemArena::GrabLowMemSpace(size_t size)
mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH;
fd = open(ram_temp_file, O_RDWR | O_CREAT, mode);
unlink(ram_temp_file);
ftruncate(fd, size);
if (ftruncate(fd, size) < 0)
ERROR_LOG(MEMMAP, "Failed to allocate low memory space");
return;
#endif
}

View File

@ -117,7 +117,8 @@ void* AllocateAlignedMemory(size_t size,size_t alignment)
void* ptr = _aligned_malloc(size,alignment);
#else
void* ptr = NULL;
posix_memalign(&ptr, alignment, size);
if (posix_memalign(&ptr, alignment, size) != 0)
ERROR_LOG(MEMMAP, "Failed to allocate aligned memory");
;
#endif

View File

@ -69,7 +69,8 @@ std::string StringFromFormat(const char* format, ...)
delete[] buf;
#else
va_start(args, format);
vasprintf(&buf, format, args);
if (vasprintf(&buf, format, args) < 0)
ERROR_LOG(COMMON, "Unable to allocate memory for string");
va_end(args);
std::string temp = buf;