summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorsl1nk3.s <sl1nk3.s@gmail.com>2009-07-28 23:38:49 +0000
committersl1nk3.s <sl1nk3.s@gmail.com>2009-07-28 23:38:49 +0000
commitcaf152fdd09fe7eda2b797f41b3a18db87a6071d (patch)
tree192efc6b13567a88e24595503206fd14e2f68136 /Source/Core
parentc86d2e5129fc0ecffa647db457aa99d13230ea29 (diff)
Fix screenshot offset as well as screenshot aspect ratio, also use PNG instead of BMP thanks to issue 1186.
Fix for opening.bnr containing bad chars where the loop would stop when encountering one (fixes Rogue Leader description, which was using 0x0d and 0x0a) git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3899 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Core/Src/Core.cpp4
-rw-r--r--Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net.cpp2
-rw-r--r--Source/Core/DiscIO/Src/BannerLoader.cpp21
-rw-r--r--Source/Core/DiscIO/Src/BannerLoader.h2
-rw-r--r--Source/Core/DiscIO/Src/BannerLoaderGC.cpp17
5 files changed, 16 insertions, 30 deletions
diff --git a/Source/Core/Core/Src/Core.cpp b/Source/Core/Core/Src/Core.cpp
index 327fa3b3c3..fc3a26716b 100644
--- a/Source/Core/Core/Src/Core.cpp
+++ b/Source/Core/Core/Src/Core.cpp
@@ -553,10 +553,10 @@ static inline std::string GenerateScreenshotName()
std::string tempname, name;
tempname = FULL_SCREENSHOTS_DIR + GetStartupParameter().GetUniqueID();
- name = StringFromFormat("%s-%d.bmp", tempname.c_str(), index);
+ name = StringFromFormat("%s-%d.png", tempname.c_str(), index);
while(File::Exists(name.c_str()))
- name = StringFromFormat("%s-%d.bmp", tempname.c_str(), ++index);
+ name = StringFromFormat("%s-%d.png", tempname.c_str(), ++index);
return name;
}
diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net.cpp
index 9bb7212ea1..72493d8555 100644
--- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net.cpp
+++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net.cpp
@@ -330,7 +330,7 @@ u32 CWII_IPC_HLE_Device_net_ip_top::ExecuteCommand(u32 _Command, u32 _BufferIn,
struct sockaddr_in address;
int Return = accept(S, (struct sockaddr *)&address, &addrlen);
GC_sockaddr_in *addr = (GC_sockaddr_in*)Memory::GetPointer(BufferOut);
- addr->sin_family = address.sin_family;
+ addr->sin_family = (u8)address.sin_family;
addr->sin_addr.s_addr_ = address.sin_addr.s_addr;
addr->sin_port = address.sin_port;
socklen_t *Len = (socklen_t *)Memory::GetPointer(BufferOut + 0x04);
diff --git a/Source/Core/DiscIO/Src/BannerLoader.cpp b/Source/Core/DiscIO/Src/BannerLoader.cpp
index 3288e1e848..b18fc61dc8 100644
--- a/Source/Core/DiscIO/Src/BannerLoader.cpp
+++ b/Source/Core/DiscIO/Src/BannerLoader.cpp
@@ -30,14 +30,14 @@
namespace DiscIO
{
-bool IBannerLoader::CopyToStringAndCheck(std::string& _rDestination, const char* _src)
+void IBannerLoader::CopyToStringAndCheck(std::string& _rDestination, const char* _src)
{
static bool bValidChars[256];
static bool bInitialized = false;
if (!bInitialized)
{
- for (int i = 0; i < 256; i++)
+ for (int i = 0; i < 0x20; i++)
{
bValidChars[i] = false;
}
@@ -55,7 +55,6 @@ bool IBannerLoader::CopyToStringAndCheck(std::string& _rDestination, const char*
bInitialized = true;
}
- bool bResult = true;
char destBuffer[2048] = {0};
char* dest = destBuffer;
const char* src = _src;
@@ -69,8 +68,8 @@ bool IBannerLoader::CopyToStringAndCheck(std::string& _rDestination, const char*
if (bValidChars[c] == false)
{
- bResult = false;
- break;
+ src++;
+ continue;
}
*dest = c;
@@ -79,19 +78,9 @@ bool IBannerLoader::CopyToStringAndCheck(std::string& _rDestination, const char*
}
// finalize the string
- if (bResult)
- {
- *dest = 0x00;
- }
- else
- {
- dest[0] = ' ';
- dest[1] = 0x00;
- }
+ *dest = 0x00;
_rDestination = destBuffer;
-
- return(bResult);
}
bool IBannerLoader::CopyBeUnicodeToString( std::string& _rDestination, const u16* _src, int length )
diff --git a/Source/Core/DiscIO/Src/BannerLoader.h b/Source/Core/DiscIO/Src/BannerLoader.h
index 40f48b7135..02d60858e4 100644
--- a/Source/Core/DiscIO/Src/BannerLoader.h
+++ b/Source/Core/DiscIO/Src/BannerLoader.h
@@ -47,7 +47,7 @@ class IBannerLoader
protected:
- bool CopyToStringAndCheck(std::string& _rDestination, const char* _src);
+ void CopyToStringAndCheck(std::string& _rDestination, const char* _src);
bool CopyBeUnicodeToString(std::string& _rDestination, const u16* _src, int length);
private:
diff --git a/Source/Core/DiscIO/Src/BannerLoaderGC.cpp b/Source/Core/DiscIO/Src/BannerLoaderGC.cpp
index 459a082093..2270c91ce0 100644
--- a/Source/Core/DiscIO/Src/BannerLoaderGC.cpp
+++ b/Source/Core/DiscIO/Src/BannerLoaderGC.cpp
@@ -57,7 +57,7 @@ CBannerLoaderGC::~CBannerLoaderGC()
bool
CBannerLoaderGC::IsValid()
{
- return(m_IsValid);
+ return m_IsValid;
}
@@ -66,13 +66,13 @@ CBannerLoaderGC::GetBanner(u32* _pBannerImage)
{
if (!IsValid())
{
- return(false);
+ return false;
}
DVDBanner2* pBanner = (DVDBanner2*)m_pBannerFile;
decode5A3image(_pBannerImage, pBanner->image, DVD_BANNER_WIDTH, DVD_BANNER_HEIGHT);
- return(true);
+ return true;
}
@@ -83,7 +83,7 @@ CBannerLoaderGC::GetName(std::string _rName[])
if (!IsValid())
{
- return(false);
+ return false;
}
// find Banner type
@@ -151,12 +151,9 @@ CBannerLoaderGC::GetCompany(std::string& _rCompany)
DVDBanner2* pBanner = (DVDBanner2*)m_pBannerFile;
- if (!CopyToStringAndCheck(_rCompany, pBanner->comment[0].shortMaker))
- {
- return(false);
- }
+ CopyToStringAndCheck(_rCompany, pBanner->comment[0].shortMaker);
- return(true);
+ return true;
}
@@ -167,7 +164,7 @@ CBannerLoaderGC::GetDescription(std::string* _rDescription)
if (!IsValid())
{
- return(false);
+ return false;
}
// find Banner type