mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
Merge pull request #15223 from hrydgard/multi-atlas
Split off the fonts from the atlas
This commit is contained in:
30 files changed
+73
-3292
No files matched your search
@@ -90,6 +90,8 @@ screenshots
|
||||
android/assets/lang
|
||||
android/assets/flash0
|
||||
ui_atlas.zim.png
|
||||
font_atlas.zim.png
|
||||
asciifont_atlas.zim.png
|
||||
ppge_atlas.zim.png
|
||||
local.properties
|
||||
r.sh
|
||||
|
||||
+13
-4
@@ -2244,9 +2244,16 @@ if(WIN32)
|
||||
list(APPEND NativeAppSource ${WindowsFiles})
|
||||
endif()
|
||||
|
||||
set(BigFontAssets
|
||||
assets/font_atlas.zim
|
||||
assets/font_atlas.meta
|
||||
)
|
||||
|
||||
set(NativeAssets
|
||||
android/assets/ui_atlas.zim
|
||||
android/assets/ui_atlas.meta
|
||||
assets/ui_atlas.zim
|
||||
assets/ui_atlas.meta
|
||||
assets/asciifont_atlas.zim
|
||||
assets/asciifont_atlas.meta
|
||||
assets/debugger
|
||||
assets/lang
|
||||
assets/shaders
|
||||
@@ -2358,6 +2365,7 @@ if(TargetBin)
|
||||
file(GLOB_RECURSE DEBUGGER_FILES assets/debugger/*)
|
||||
|
||||
if(NOT IOS)
|
||||
set_source_files_properties(${BigFontAssets} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources/assets")
|
||||
set_source_files_properties(${NativeAssets} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources/assets")
|
||||
set_source_files_properties(${FLASH0_FILES} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources/assets/flash0/font")
|
||||
set_source_files_properties(${LANG_FILES} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources/assets/lang")
|
||||
@@ -2366,10 +2374,10 @@ if(TargetBin)
|
||||
endif()
|
||||
|
||||
if(IOS)
|
||||
add_executable(${TargetBin} MACOSX_BUNDLE ${ICON_PATH_ABS} ${NativeAssets} ${SHADER_FILES} ${DEBUGGER_FILES} ${FLASH0_FILES} ${LANG_FILES} ${NativeAppSource} "ios/Settings.bundle" "ios/Launch Screen.storyboard")
|
||||
add_executable(${TargetBin} MACOSX_BUNDLE ${ICON_PATH_ABS} ${NativeAssets} ${BigFontAssets} ${SHADER_FILES} ${DEBUGGER_FILES} ${FLASH0_FILES} ${LANG_FILES} ${NativeAppSource} "ios/Settings.bundle" "ios/Launch Screen.storyboard")
|
||||
file(INSTALL "${CMAKE_SOURCE_DIR}/ext/vulkan/iOS/Frameworks/libMoltenVK.dylib" DESTINATION "${CMAKE_BINARY_DIR}/PPSSPP.app/Frameworks/")
|
||||
else()
|
||||
add_executable(${TargetBin} MACOSX_BUNDLE ${ICON_PATH_ABS} ${NativeAssets} ${SHADER_FILES} ${DEBUGGER_FILES} ${FLASH0_FILES} ${LANG_FILES} ${NativeAppSource})
|
||||
add_executable(${TargetBin} MACOSX_BUNDLE ${ICON_PATH_ABS} ${NativeAssets} ${BigFontAssets} ${SHADER_FILES} ${DEBUGGER_FILES} ${FLASH0_FILES} ${LANG_FILES} ${NativeAppSource})
|
||||
file(INSTALL "${CMAKE_SOURCE_DIR}/ext/vulkan/macOS/Frameworks/libMoltenVK.dylib" DESTINATION "${CMAKE_BINARY_DIR}/PPSSPPSDL.app/Contents/Frameworks/")
|
||||
if(TARGET SDL2::SDL2 AND NOT USING_QT_UI)
|
||||
add_custom_command(TARGET ${TargetBin} POST_BUILD COMMAND /bin/bash "${CMAKE_SOURCE_DIR}/SDL/macbundle.sh" "${CMAKE_BINARY_DIR}/PPSSPPSDL.app")
|
||||
@@ -2393,6 +2401,7 @@ endif()
|
||||
|
||||
# installs
|
||||
if(NOT ANDROID)
|
||||
file(INSTALL ${BigFontAssets} DESTINATION assets)
|
||||
file(INSTALL ${NativeAssets} DESTINATION assets)
|
||||
file(INSTALL assets/flash0 DESTINATION assets)
|
||||
endif()
|
||||
|
||||
+11
-2
@@ -40,9 +40,18 @@ void UIContext::BeginFrame() {
|
||||
uitexture_ = CreateTextureFromFile(draw_, "ui_atlas.zim", ImageFileType::ZIM, false);
|
||||
_dbg_assert_msg_(uitexture_, "Failed to load ui_atlas.zim.\n\nPlace it in the directory \"assets\" under your PPSSPP directory.");
|
||||
if (!fontTexture_) {
|
||||
#if PPSSPP_PLATFORM(WINDOWS) || PPSSPP_PLATFORM(ANDROID)
|
||||
// Don't bother with loading font_atlas.zim
|
||||
#else
|
||||
fontTexture_ = CreateTextureFromFile(draw_, "font_atlas.zim", ImageFileType::ZIM, false);
|
||||
if (!fontTexture_)
|
||||
WARN_LOG(SYSTEM, "Failed to load font_atlas.zim");
|
||||
#endif
|
||||
if (!fontTexture_) {
|
||||
// Load the smaller ascii font only, like on Android. For debug ui etc.
|
||||
fontTexture_ = CreateTextureFromFile(draw_, "asciifont_atlas.zim", ImageFileType::ZIM, false);
|
||||
if (!fontTexture_) {
|
||||
WARN_LOG(SYSTEM, "Failed to load font_atlas.zim or asciifont_atlas.zim");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
uidrawbufferTop_->SetCurZ(0.0f);
|
||||
|
||||
+4
-3
@@ -1,7 +1,8 @@
|
||||
1. Install GCC, CMake, and development libraries for zlib and sdl.
|
||||
2. cd SDL
|
||||
3. ./buildassets.sh
|
||||
4. ./b.sh
|
||||
2. mkdir build
|
||||
3. cd build
|
||||
4. cmake ..
|
||||
5. make
|
||||
|
||||
That should do it.
|
||||
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
cp -r ../android/assets .
|
||||
cp ../assets/ppge_atlas.zim assets
|
||||
+5
-3
@@ -949,9 +949,13 @@ bool NativeInitGraphics(GraphicsContext *graphicsContext) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Load any missing atlas.
|
||||
// Load any missing atlas metadata (the images are loaded from UIContext).
|
||||
LoadAtlasMetadata(g_ui_atlas, "ui_atlas.meta", true);
|
||||
#if !(PPSSPP_PLATFORM(WINDOWS) || PPSSPP_PLATFORM(ANDROID))
|
||||
LoadAtlasMetadata(g_font_atlas, "font_atlas.meta", g_ui_atlas.num_fonts == 0);
|
||||
#else
|
||||
LoadAtlasMetadata(g_font_atlas, "asciifont_atlas.meta", g_ui_atlas.num_fonts == 0);
|
||||
#endif
|
||||
|
||||
ui_draw2d.SetAtlas(&g_ui_atlas);
|
||||
ui_draw2d.SetFontAtlas(&g_font_atlas);
|
||||
@@ -1213,13 +1217,11 @@ void NativeRender(GraphicsContext *graphicsContext) {
|
||||
// Modifying the bounds here can be used to "inset" the whole image to gain borders for TV overscan etc.
|
||||
// The UI now supports any offset but not the EmuScreen yet.
|
||||
uiContext->SetBounds(Bounds(0, 0, dp_xres, dp_yres));
|
||||
// uiContext->SetBounds(Bounds(dp_xres/2, 0, dp_xres / 2, dp_yres / 2));
|
||||
|
||||
// OSX 10.6 and SDL 1.2 bug.
|
||||
#if defined(__APPLE__) && !defined(USING_QT_UI)
|
||||
static int dp_xres_old = dp_xres;
|
||||
if (dp_xres != dp_xres_old) {
|
||||
// uiTexture->Load("ui_atlas.zim");
|
||||
dp_xres_old = dp_xres;
|
||||
}
|
||||
#endif
|
||||
|
||||
+5
-2
@@ -1,10 +1,13 @@
|
||||
mkdir assets > nul
|
||||
xcopy ..\assets\flash0 assets\flash0\ /s /y <d.txt
|
||||
xcopy ..\assets\lang assets\lang\ /s /y <d.txt
|
||||
xcopy ..\assets\shaders assets\shaders\ /s /y <d.txt
|
||||
copy ..\assets\langregion.ini assets\langregion.ini
|
||||
copy ..\assets\compat.ini assets\compat.ini
|
||||
copy ..\assets\*.ini assets\
|
||||
copy ..\assets\Roboto-Condensed.ttf assets\Roboto-Condensed.ttf
|
||||
copy ..\assets\*.png assets\
|
||||
copy ..\assets\*.zim assets\
|
||||
copy ..\assets\*.meta assets\
|
||||
copy ..\assets\*.wav assets\
|
||||
SET NDK=C:\Android\sdk\ndk\21.3.6528147
|
||||
REM SET NDK=C:\Android\ndk
|
||||
SET NDK_MODULE_PATH=..\ext;..\ext\native\ext
|
||||
|
||||
+5
-2
@@ -1,9 +1,12 @@
|
||||
mkdir -p assets
|
||||
cp -r ../assets/flash0 assets/
|
||||
cp -r ../assets/lang assets/
|
||||
cp -r ../assets/shaders assets/
|
||||
cp -r ../assets/debugger assets/
|
||||
cp ../assets/langregion.ini assets/langregion.ini
|
||||
cp ../assets/compat.ini assets/compat.ini
|
||||
cp ../assets/*.ini assets/
|
||||
cp ../assets/Roboto-Condensed.ttf assets/Roboto-Condensed.ttf
|
||||
cp ../assets/*.png assets/
|
||||
cp ../assets/*.zim assets/
|
||||
cp ../assets/*.meta assets/
|
||||
cp ../assets/*.wav assets/
|
||||
NDK_MODULE_PATH=../ext $NDK/ndk-build -j3 $*
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 9.0 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 2.3 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 6.2 KiB |
@@ -3,8 +3,10 @@ cp ../assets/7z.png assets/
|
||||
cp ../assets/rargray.png assets/
|
||||
cp ../assets/unknown.png assets/
|
||||
cp ../assets/zip.png assets/
|
||||
cp ../assets/ui_atlas.zim assets/
|
||||
cp ../assets/ppge_atlas.zim assets/
|
||||
cp ../assets/*.zim assets/
|
||||
cp ../assets/*.meta assets/
|
||||
cp ../assets/*.wav assets/
|
||||
cp ../assets/*.ini assets/
|
||||
cp ../assets/Roboto-Condensed.ttf assets/
|
||||
cp -r ../assets/flash0 assets/
|
||||
cp -r ../assets/lang assets/
|
||||
@@ -0,0 +1,2 @@
|
||||
2048
|
||||
font UBUNTU24 assets/Roboto-Condensed.ttf UWER 34 -2
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+7
-1
@@ -1,3 +1,9 @@
|
||||
./ext/native/tools/build/atlastool atlasscript.txt ui 8888 && cp ui_atlas.zim ui_atlas.meta assets && cp ui_atlas.zim ui_atlas.meta android/assets && rm ui_atlas.cpp ui_atlas.h
|
||||
# Note that we do not copy the big font atlas to Android assets. No longer needed!
|
||||
|
||||
./ext/native/tools/build/atlastool ui_atlasscript.txt ui 8888 && cp ui_atlas.zim ui_atlas.meta assets && rm ui_atlas.cpp ui_atlas.h
|
||||
./ext/native/tools/build/atlastool font_atlasscript.txt font 8888 && cp font_atlas.zim font_atlas.meta assets && rm font_atlas.cpp font_atlas.h
|
||||
./ext/native/tools/build/atlastool asciifont_atlasscript.txt asciifont 8888 && cp asciifont_atlas.zim asciifont_atlas.meta assets && rm asciifont_atlas.cpp asciifont_atlas.h
|
||||
|
||||
rm ui_atlas.zim ui_atlas.meta
|
||||
rm font_atlas.zim font_atlas.meta
|
||||
rm asciifont_atlas.zim asciifont_atlas.meta
|
||||
-1441
File diff suppressed because it is too large.
Load diff
@@ -772,9 +772,8 @@ void LearnFile(const char *filename, const char *desc, std::set<u16> &chars, uin
|
||||
}
|
||||
}
|
||||
delete[] data;
|
||||
printf("%i %s characters learned.\n", learnCount, desc);
|
||||
printf("%d %s characters learned.\n", learnCount, desc);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void GetLocales(const char *locales, std::vector<CharRange> &ranges)
|
||||
@@ -789,12 +788,15 @@ void GetLocales(const char *locales, std::vector<CharRange> &ranges)
|
||||
}
|
||||
}
|
||||
|
||||
// Also, load chinese.txt if available.
|
||||
LearnFile("chinese.txt", "Chinese", kanji, 0x3400, 0xFFFF);
|
||||
LearnFile("korean.txt", "Korean", hangul1, 0x1100, 0x11FF);
|
||||
LearnFile("korean.txt", "Korean", hangul2, 0x3130, 0x318F);
|
||||
LearnFile("korean.txt", "Korean", hangul3, 0xAC00, 0xD7A3);
|
||||
|
||||
LearnFile("assets/lang/zh_CN.ini", "Chinese", kanji, 0x3400, 0xFFFF);
|
||||
LearnFile("assets/lang/zh_TW.ini", "Chinese", kanji, 0x3400, 0xFFFF);
|
||||
LearnFile("assets/langregion.ini", "Chinese", kanji, 0x3400, 0xFFFF);
|
||||
LearnFile("assets/lang/ko_KR.ini", "Korean", hangul1, 0x1100, 0x11FF);
|
||||
LearnFile("assets/lang/ko_KR.ini", "Korean", hangul2, 0x3130, 0x318F);
|
||||
LearnFile("assets/lang/ko_KR.ini", "Korean", hangul3, 0xAC00, 0xD7A3);
|
||||
LearnFile("assets/langregion.ini", "Korean", hangul1, 0x1100, 0x11FF);
|
||||
LearnFile("assets/langregion.ini", "Korean", hangul2, 0x3130, 0x318F);
|
||||
LearnFile("assets/langregion.ini", "Korean", hangul3, 0xAC00, 0xD7A3);
|
||||
// The end point of a range is now inclusive!
|
||||
|
||||
for (size_t i = 0; i < strlen(locales); i++) {
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
2048
|
||||
font UBUNTU24 assets/Roboto-Condensed.ttf UWER 34 -2
|
||||
font UBUNTU24 C:/Windows/Fonts/ARIALUNI.ttf UWEhkcRGHKVTe 30 0
|
||||
-1815
File diff suppressed because it is too large.
Load diff
@@ -1,3 +0,0 @@
|
||||
cat assets/lang/zh_CN.ini assets/lang/zh_TW.ini assets/langregion.ini > chinese.txt
|
||||
cat assets/lang/ko_KR.ini assets/langregion.ini > korean.txt
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
2048
|
||||
font UBUNTU24 assets/Roboto-Condensed.ttf UWER 34 -2
|
||||
font UBUNTU24 C:/Windows/Fonts/ARIALUNI.ttf UWEhkcRGHKVTe 30 0
|
||||
512
|
||||
image I_SOLIDWHITE white.png copy
|
||||
image I_CROSS source_assets/image/cross.png copy
|
||||
image I_CIRCLE source_assets/image/circle.png copy
|
||||
@@ -61,4 +59,4 @@ image I_F source_assets/image/f.png copy
|
||||
image I_SQUARE_SHAPE source_assets/image/square_shape.png copy
|
||||
image I_SQUARE_SHAPE_LINE source_assets/image/square_shape_line.png copy
|
||||
image I_FOLDER_OPEN source_assets/image/folder_open_line.png copy
|
||||
image I_WARNING source_assets/image/warning.png copy
|
||||
image I_WARNING source_assets/image/warning.png copy
|
||||
Reference in new issue
Block a user