Merge pull request #1580 from MyaniPT/patch-1

Updates stblibs (stb_image and stb_truetype)
This commit is contained in:
vlj 2016-03-17 20:01:55 +01:00
commit 01ce1c31d1
9 changed files with 9204 additions and 6013 deletions

View File

@ -2,7 +2,10 @@
#include "Emu/Memory/Memory.h" #include "Emu/Memory/Memory.h"
#include "Emu/SysCalls/Modules.h" #include "Emu/SysCalls/Modules.h"
// Defines STB_TRUETYPE_IMPLEMENTATION *once* before including stb_truetype.h (as noted in stb_truetype.h's comments)
#define STB_TRUETYPE_IMPLEMENTATION
#include "stblib/stb_truetype.h" #include "stblib/stb_truetype.h"
#include "Emu/FS/vfsFile.h" #include "Emu/FS/vfsFile.h"
#include "cellFont.h" #include "cellFont.h"
@ -325,12 +328,12 @@ s32 cellFontRenderCharGlyphImage(vm::ptr<CellFont> font, u32 code, vm::ptr<CellF
unsigned char* buffer = vm::_ptr<unsigned char>(surface->buffer.addr()); unsigned char* buffer = vm::_ptr<unsigned char>(surface->buffer.addr());
for (u32 ypos = 0; ypos < (u32)height; ypos++) for (u32 ypos = 0; ypos < (u32)height; ypos++)
{ {
if ((u32)y + ypos + yoff + baseLineY >= surface->height) if ((u32)y + ypos + yoff + baseLineY >= (u32)surface->height)
break; break;
for (u32 xpos = 0; xpos < (u32)width; xpos++) for (u32 xpos = 0; xpos < (u32)width; xpos++)
{ {
if ((u32)x + xpos >= surface->width) if ((u32)x + xpos >= (u32)surface->width)
break; break;
// TODO: There are some oddities in the position of the character in the final buffer // TODO: There are some oddities in the position of the character in the final buffer

View File

@ -4,10 +4,8 @@
#include "Emu/IdManager.h" #include "Emu/IdManager.h"
#include "Emu/SysCalls/Modules.h" #include "Emu/SysCalls/Modules.h"
extern "C" // STB_IMAGE_IMPLEMENTATION is already defined in stb_image.cpp
{
#include "stblib/stb_image.h" #include "stblib/stb_image.h"
}
#include "Emu/FS/VFS.h" #include "Emu/FS/VFS.h"
#include "Emu/FS/vfsFileBase.h" #include "Emu/FS/vfsFileBase.h"

View File

@ -4,10 +4,8 @@
#include "Emu/IdManager.h" #include "Emu/IdManager.h"
#include "Emu/SysCalls/Modules.h" #include "Emu/SysCalls/Modules.h"
extern "C" // STB_IMAGE_IMPLEMENTATION is already defined in stb_image.cpp
{
#include "stblib/stb_image.h" #include "stblib/stb_image.h"
}
#include "Emu/FS/VFS.h" #include "Emu/FS/VFS.h"
#include "Emu/FS/vfsFileBase.h" #include "Emu/FS/vfsFileBase.h"

View File

@ -84,7 +84,6 @@
</ClCompile> </ClCompile>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="..\stblib\stb_image.c" />
<ClCompile Include="..\Utilities\AutoPause.cpp" /> <ClCompile Include="..\Utilities\AutoPause.cpp" />
<ClCompile Include="..\Utilities\config_context.cpp" /> <ClCompile Include="..\Utilities\config_context.cpp" />
<ClCompile Include="..\Utilities\Log.cpp" /> <ClCompile Include="..\Utilities\Log.cpp" />

View File

@ -1779,9 +1779,6 @@
<ClInclude Include="..\stblib\stb_image.h"> <ClInclude Include="..\stblib\stb_image.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\stblib\stb_image.c">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="Emu\RSX\Common\surface_store.h"> <ClInclude Include="Emu\RSX\Common\surface_store.h">
<Filter>Emu\GPU\RSX\Common</Filter> <Filter>Emu\GPU\RSX\Common</Filter>
</ClInclude> </ClInclude>

View File

@ -1,9 +1,4 @@
#include "stdafx.h" #include "stdafx.h"
// Defines STB_IMAGE_IMPLEMENTATION *once* for stb_image.h includes (Should this be placed somewhere else?)
extern "C" #define STB_IMAGE_IMPLEMENTATION
{
#pragma warning(push, 0)
#include "stblib/stb_image.h" #include "stblib/stb_image.h"
#include "stblib/stb_image.c"
#pragma warning(pop)
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff