Skip to content

Commit

Permalink
Merge pull request #12655 from hrydgard/remove-lowmem-atlas
Browse files Browse the repository at this point in the history
Remove support for "lowmem" UI atlas.
  • Loading branch information
unknownbrackets authored Feb 29, 2020
2 parents 558a101 + aea3cf7 commit 417796c
Show file tree
Hide file tree
Showing 10 changed files with 1,397 additions and 1,616 deletions.
2,929 changes: 1,383 additions & 1,546 deletions UI/ui_atlas.cpp

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions UWP/UWP.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1700,9 +1700,6 @@
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">true</DeploymentContent>
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">true</DeploymentContent>
</None>
<None Include="Content\ui_atlas_lowmem.zim">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="PPSSPP_UWP_TemporaryKey.pfx" />
<None Include="UWP_TemporaryKey.pfx" />
</ItemGroup>
Expand Down
5 changes: 1 addition & 4 deletions UWP/UWP.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,6 @@
<None Include="Content\ppge_atlas.zim">
<Filter>Content</Filter>
</None>
<None Include="Content\ui_atlas_lowmem.zim">
<Filter>Content</Filter>
</None>
<None Include="PPSSPP_UWP_TemporaryKey.pfx" />
<None Include="Content\lang\ar_AE.ini">
<Filter>Content\lang</Filter>
Expand Down Expand Up @@ -367,4 +364,4 @@
<Filter>Content</Filter>
</Font>
</ItemGroup>
</Project>
</Project>
3 changes: 1 addition & 2 deletions Windows/PPSSPP.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -958,7 +958,6 @@
<None Include="..\assets\knownfuncs.ini" />
<None Include="..\assets\langregion.ini" />
<None Include="..\atlasscript.txt" />
<None Include="..\atlasscript_lowmem.txt" />
<None Include="..\CMakeLists.txt" />
<None Include="..\ios\AudioEngine.mm" />
<None Include="..\ios\main.mm" />
Expand Down Expand Up @@ -1028,4 +1027,4 @@
<UserProperties RESOURCE_FILE="DaSh.rc" />
</VisualStudio>
</ProjectExtensions>
</Project>
</Project>
5 changes: 1 addition & 4 deletions Windows/PPSSPP.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -399,9 +399,6 @@
<None Include="..\atlasscript.txt">
<Filter>Other Platforms</Filter>
</None>
<None Include="..\atlasscript_lowmem.txt">
<Filter>Other Platforms</Filter>
</None>
<None Include="..\ios\AudioEngine.mm">
<Filter>Other Platforms</Filter>
</None>
Expand Down Expand Up @@ -453,4 +450,4 @@
<Filter>Resource Files</Filter>
</Image>
</ItemGroup>
</Project>
</Project>
Binary file modified android/assets/ui_atlas.zim
Binary file not shown.
Binary file modified assets/ui_atlas.zim
Binary file not shown.
49 changes: 0 additions & 49 deletions atlasscript_lowmem.txt

This file was deleted.

8 changes: 2 additions & 6 deletions buildatlas.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
# build the lowmem first so we see the output of the big one last.

./ext/native/tools/build/atlastool atlasscript_lowmem.txt ui 8888 && mv ui_atlas.zim assets/ui_atlas_lowmem.zim && mv ui_atlas.cpp ui_atlas_lowmem.cpp
./ext/native/tools/build/atlastool atlasscript.txt ui 8888 && cp ui_atlas.zim assets && cp ui_atlas.zim android/assets && cp ui_atlas.zim.png ui_atlas_high.zim.png && mv ui_atlas.cpp ui_atlas_highmem.cpp && mv ui_atlas.h UI
diff -I'^//.*' -D USING_QT_UI ui_atlas_highmem.cpp ui_atlas_lowmem.cpp > UI/ui_atlas.cpp
rm ui_atlas_highmem.cpp ui_atlas_lowmem.cpp ui_atlas.h
./ext/native/tools/build/atlastool atlasscript.txt ui 8888 && cp ui_atlas.zim assets && cp ui_atlas.zim android/assets && mv ui_atlas.cpp ui_atlas.h UI
rm ui_atlas.zim
11 changes: 9 additions & 2 deletions ext/native/tools/atlastool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ struct Bucket {
dest.resize(image_width, 1);
sort(items.begin(), items.end());
for (int i = 0; i < (int)items.size(); i++) {
if ((i + 1) % 200 == 0) {
if ((i + 1) % 2000 == 0) {
printf("Resolving (%i / %i)\n", i, (int)items.size());
}
int idx = (int)items[i].first.dat[0].size();
Expand Down Expand Up @@ -388,6 +388,8 @@ void RasterizeFonts(const FontReferenceList &fontRefs, vector<CharRange> &ranges
// Wait what - how does this make sense?
*metrics_height = totalHeight / (float)fontRefs.size();

size_t missing_chars = 0;

// Convert all characters to bitmaps.
for (size_t r = 0, rn = ranges.size(); r < rn; r++) {
FT_Face_List &tryFonts = fontsByRange[ranges[r].start];
Expand All @@ -411,7 +413,8 @@ void RasterizeFonts(const FontReferenceList &fontRefs, vector<CharRange> &ranges
}
}
if (!foundMatch) {
fprintf(stderr, "WARNING: No font contains character %x.\n", kar);
// fprintf(stderr, "WARNING: No font contains character %x.\n", kar);
missing_chars++;
continue;
}

Expand Down Expand Up @@ -493,6 +496,10 @@ void RasterizeFonts(const FontReferenceList &fontRefs, vector<CharRange> &ranges
}
}

if (missing_chars) {
printf("Chars not found in any font: %d\n", (int)missing_chars);
}

for (size_t i = 0, n = fonts.size(); i < n; ++i) {
FT_Done_Face(fonts[i]);
}
Expand Down

0 comments on commit 417796c

Please sign in to comment.