Pandora Rebirth >> SuperZaxxon

移植picklelauncher(支援中文路徑)


程式碼如下:

diff -Naur old/src/cselector.cpp new/src/cselector.cpp
--- old/src/cselector.cpp	2019-12-30 18:56:05.191250525 +0800
+++ new/src/cselector.cpp	2019-12-30 18:52:32.758599598 +0800
@@ -258,7 +258,7 @@
     flags = SCREEN_FLAGS;
     if (Config.Fullscreen == true)
     {
-        flags |= SDL_FULLSCREEN;
+        //flags |= SDL_FULLSCREEN;
     }
     Screen = SDL_SetVideoMode( Config.ScreenWidth, Config.ScreenHeight, Config.ScreenDepth, flags );
     if (Screen == NULL)
@@ -343,7 +343,8 @@
     ImageSelectPointer = LoadImage( Config.PathSelectPointer );
     if (ImageSelectPointer == NULL)
     {
-        ImageSelectPointer = TTF_RenderText_Solid( Fonts.at(FONT_SIZE_MEDIUM), ENTRY_ARROW, Config.Colors.at(COLOR_BLACK) );
+        //ImageSelectPointer = TTF_RenderText_Solid( Fonts.at(FONT_SIZE_MEDIUM), ENTRY_ARROW, Config.Colors.at(COLOR_BLACK) );
+        ImageSelectPointer = TTF_RenderUTF8_Solid( Fonts.at(FONT_SIZE_MEDIUM), ENTRY_ARROW, Config.Colors.at(COLOR_BLACK) );
     }
 
     //      Title text
@@ -352,7 +353,8 @@
     {
         text += " for " + Profile.TargetApp;
     }
-    ImageTitle = TTF_RenderText_Solid( Fonts.at(FONT_SIZE_LARGE), text.c_str(), Config.Colors.at(Config.ColorFontFiles) );
+    //ImageTitle = TTF_RenderText_Solid( Fonts.at(FONT_SIZE_LARGE), text.c_str(), Config.Colors.at(Config.ColorFontFiles) );
+    ImageTitle = TTF_RenderUTF8_Solid( Fonts.at(FONT_SIZE_LARGE), text.c_str(), Config.Colors.at(Config.ColorFontFiles) );
     if (ImageTitle == NULL)
     {
         Log( "Failed to create TTF surface with TTF_RenderText_Solid: %s\n", TTF_GetError() );
@@ -361,7 +363,8 @@
 
     //      About text
     text = "Written by " + string(APPAUTHOR) + " " + string(APPCOPYRIGHT);
-    ImageAbout = TTF_RenderText_Solid( Fonts.at(FONT_SIZE_SMALL), text.c_str(), Config.Colors.at(Config.ColorFontFiles) );
+    //ImageAbout = TTF_RenderText_Solid( Fonts.at(FONT_SIZE_SMALL), text.c_str(), Config.Colors.at(Config.ColorFontFiles) );
+    ImageAbout = TTF_RenderUTF8_Solid( Fonts.at(FONT_SIZE_SMALL), text.c_str(), Config.Colors.at(Config.ColorFontFiles) );
     if (ImageAbout == NULL)
     {
         Log( "Failed to create TTF surface with TTF_RenderText_Solid: %s\n", TTF_GetError() );
@@ -1167,11 +1170,13 @@
         // Empty directories or zip files
         if (Config.UseZipSupport == true && Profile.ZipFile.length() > 0)
         {
-            text_surface = TTF_RenderText_Solid( Fonts.at(FONT_SIZE_MEDIUM), EMPTY_ZIP_LABEL, Config.Colors.at(COLOR_BLACK) );
+            //text_surface = TTF_RenderText_Solid( Fonts.at(FONT_SIZE_MEDIUM), EMPTY_ZIP_LABEL, Config.Colors.at(COLOR_BLACK) );
+            text_surface = TTF_RenderUTF8_Solid( Fonts.at(FONT_SIZE_MEDIUM), EMPTY_ZIP_LABEL, Config.Colors.at(COLOR_BLACK) );
         }
         else
         {
-            text_surface = TTF_RenderText_Solid( Fonts.at(FONT_SIZE_MEDIUM), EMPTY_DIR_LABEL, Config.Colors.at(COLOR_BLACK) );
+            //text_surface = TTF_RenderText_Solid( Fonts.at(FONT_SIZE_MEDIUM), EMPTY_DIR_LABEL, Config.Colors.at(COLOR_BLACK) );
+            text_surface = TTF_RenderUTF8_Solid( Fonts.at(FONT_SIZE_MEDIUM), EMPTY_DIR_LABEL, Config.Colors.at(COLOR_BLACK) );
         }
 
         if (text_surface != NULL)
@@ -1219,7 +1224,8 @@
                 LastSelectedEntry = entry_index;
             }
 
-            text_surface = TTF_RenderText_Solid( Fonts.at(ListNames.at(entry_index).font), ListNames.at(entry_index).text.c_str(), Config.Colors.at(ListNames.at(entry_index).color) );
+            //text_surface = TTF_RenderText_Solid( Fonts.at(ListNames.at(entry_index).font), ListNames.at(entry_index).text.c_str(), Config.Colors.at(ListNames.at(entry_index).color) );
+            text_surface = TTF_RenderUTF8_Solid(Fonts.at(ListNames.at(entry_index).font), ListNames.at(entry_index).text.c_str(), Config.Colors.at(ListNames.at(entry_index).color));
 
             if (text_surface != NULL)
             {
@@ -1546,7 +1552,8 @@
 
     if (Config.ShowLabels == true)
     {
-        text_surface = TTF_RenderText_Solid( font, LabelButtons.at(button).c_str(), Config.Colors.at(Config.ColorFontButton) );
+        //text_surface = TTF_RenderText_Solid( font, LabelButtons.at(button).c_str(), Config.Colors.at(Config.ColorFontButton) );
+        text_surface = TTF_RenderUTF8_Solid( font, LabelButtons.at(button).c_str(), Config.Colors.at(Config.ColorFontButton) );
 
         rect_text.x = location.x + ((location.w-text_surface->w)/2);
         rect_text.y = location.y + ((location.h-text_surface->h)/2);
@@ -1618,7 +1625,8 @@
 
             if (Profile.EntryFilter.length() > 0)
             {
-                ImageFilter = TTF_RenderText_Solid( Fonts.at(FONT_SIZE_MEDIUM), Profile.EntryFilter.c_str(), Config.Colors.at(Config.ColorFontFiles) );
+                //ImageFilter = TTF_RenderText_Solid( Fonts.at(FONT_SIZE_MEDIUM), Profile.EntryFilter.c_str(), Config.Colors.at(Config.ColorFontFiles) );
+                ImageFilter = TTF_RenderUTF8_Solid( Fonts.at(FONT_SIZE_MEDIUM), Profile.EntryFilter.c_str(), Config.Colors.at(Config.ColorFontFiles) );
                 if (ImageFilter != NULL)
                 {
                     clip.x = 0;
@@ -1665,7 +1673,8 @@
                 text += "->" + Profile.ZipFile;
             }
 
-            ImageFilePath = TTF_RenderText_Solid( Fonts.at(FONT_SIZE_MEDIUM), text.c_str(), Config.Colors.at(Config.ColorFontFiles) );
+            //ImageFilePath = TTF_RenderText_Solid( Fonts.at(FONT_SIZE_MEDIUM), text.c_str(), Config.Colors.at(Config.ColorFontFiles) );
+            ImageFilePath = TTF_RenderUTF8_Solid( Fonts.at(FONT_SIZE_MEDIUM), text.c_str(), Config.Colors.at(Config.ColorFontFiles) );
             if (ImageFilePath != NULL)
             {
                 clip.x = 0;
@@ -1753,7 +1762,8 @@
         {
             text = i_to_a(DisplayList.at(Mode).absolute+1) + " of " + i_to_a(total);
         }
-        ImageIndex = TTF_RenderText_Solid(Fonts.at(FONT_SIZE_SMALL), text.c_str(), Config.Colors.at(Config.ColorFontFiles));
+        //ImageIndex = TTF_RenderText_Solid(Fonts.at(FONT_SIZE_SMALL), text.c_str(), Config.Colors.at(Config.ColorFontFiles));
+        ImageIndex = TTF_RenderUTF8_Solid(Fonts.at(FONT_SIZE_SMALL), text.c_str(), Config.Colors.at(Config.ColorFontFiles));
 
         if (ImageIndex != NULL)
         {
@@ -1798,7 +1808,8 @@
                 text = "Extract Selection";
             }
 
-            ImageZipMode = TTF_RenderText_Solid(Fonts.at(FONT_SIZE_SMALL), text.c_str(), Config.Colors.at(Config.ColorFontFiles));
+            //ImageZipMode = TTF_RenderText_Solid(Fonts.at(FONT_SIZE_SMALL), text.c_str(), Config.Colors.at(Config.ColorFontFiles));
+            ImageZipMode = TTF_RenderUTF8_Solid(Fonts.at(FONT_SIZE_SMALL), text.c_str(), Config.Colors.at(Config.ColorFontFiles));
             if (ImageZipMode == NULL)
             {
                 Log( "Failed to create TTF surface with TTF_RenderText_Solid: %s\n", TTF_GetError());
@@ -1840,7 +1851,8 @@
          + " fps " + i_to_a(FPSDrawn) + " skp " + i_to_a(FPSSkip) + " slp " + i_to_a(FPSSleep)
          + " lp " + i_to_a(LoopTimeAverage);
 
-    ImageDebug = TTF_RenderText_Solid( Fonts.at(FONT_SIZE_SMALL), text.c_str(), Config.Colors.at(Config.ColorFontFiles) );
+    //ImageDebug = TTF_RenderText_Solid( Fonts.at(FONT_SIZE_SMALL), text.c_str(), Config.Colors.at(Config.ColorFontFiles) );
+    ImageDebug = TTF_RenderUTF8_Solid( Fonts.at(FONT_SIZE_SMALL), text.c_str(), Config.Colors.at(Config.ColorFontFiles) );
 
     if (ImageDebug != NULL)
     {

編譯步驟如下:

$ cd
$ wget https://github.com/steward-fu/pandora/releases/download/v1.1/picklelauncher_cht.tar.gz
$ tar xvf picklelauncher_cht.tar.gz
$ cd picklelauncher
$ make

移植前


移植後


返回上一頁