OSDN Git Service

グラフィックの改善
authormaruhiro <maruhiro@bridge.ocn.ne.jp>
Fri, 15 Feb 2019 15:47:22 +0000 (00:47 +0900)
committermaruhiro <maruhiro@bridge.ocn.ne.jp>
Fri, 15 Feb 2019 15:47:22 +0000 (00:47 +0900)
src/cursesgraphics.h
src/includes.h
src/news/layout.cpp
src/news/news.cpp

index 32c23c8..a53b498 100644 (file)
@@ -1951,7 +1951,7 @@ struct unicodechar unicode_hacks[] = {
     #define CH_LOWER_HALF_BLOCK '_' /* 0xdc */
     #define CH_LEFT_HALF_BLOCK '[' /* 0xdd */
     #define CH_RIGHT_HALF_BLOCK ']' /* 0xde */
-    #define CH_UPPER_HALF_BLOCK '=' /* 0xdf */
+    #define CH_UPPER_HALF_BLOCK '~' /* 0xdf */
     #define CH_GREEK_SMALL_LETTER_ALPHA 'a' /* 0xe0 */
     #define CH_LATIN_SMALL_LETTER_SHARP_S 'B' /* 0xe1 */
     #define CH_GREEK_CAPITAL_LETTER_GAMMA 'F' /* 0xe2 */
@@ -2261,7 +2261,7 @@ extern int gchar[];
 
 #define CH_MAXIMUM 256
 
-#if !defined(CH_USE_CP437) && !defined(CH_USE_MULTIBYTE)
+#if !defined(CH_USE_CP437)
 /* Translate CP437 extended characters into the code page used by the console */
 inline int translateGraphicsChar(unsigned char c) { return gchar[c]; }
 #else // CH_USE_CP437
index bf4987c..06a5b69 100644 (file)
@@ -991,21 +991,38 @@ void addprevpagestr();
 /* prints a long blurb showing how to page forward and back */
 void addpagestr();
 /* Variants of addch and mvaddch that work on chars and use translateGraphicsChar(), fixing display of extended characters */
+#if defined(CH_USE_MULTIBYTE)
+inline int addchar(char ch) { return addch(ch); }
+inline int mvaddchar(int y,int x,char ch) { return mvaddch(y,x,ch); }
+inline int addgrah(char ch) { return addch(translateGraphicsChar(ch)); }
+inline int mvaddgrah(int y,int x,char ch) { return mvaddch(y,x,translateGraphicsChar(ch)); }
+#else
 inline int addchar(char ch) { return addch(translateGraphicsChar(ch)); }
 inline int mvaddchar(int y,int x,char ch) { return mvaddch(y,x,translateGraphicsChar(ch)); }
+inline int addgrah(char ch) { return addch(translateGraphicsChar(ch)); }
+inline int mvaddgrah(int y,int x,char ch) { return mvaddch(y,x,translateGraphicsChar(ch)); }
+#endif
 inline int addchar(char ch,Log &log) { log.record(ch); return addchar(ch); }
 inline int mvaddchar(int y,int x,char ch,Log &log) { log.record(ch); return mvaddchar(y,x,ch); }
 /* Redefining addstr() and mvaddstr() so they use addchar() and mvaddchar(), fixing display of extended characters */
 #undef addstr
+#if !defined(CH_USE_MULTIBYTE)
 inline int addstr(const char* text) { int ret=ERR; for(int i=0;i<len(text);i++) ret=addchar(text[i]); return ret; }
+#endif
+#if !defined(CH_USE_MULTIBYTE)
 #undef mvaddstr
 inline int mvaddstr(int y,int x,const char* text) { int ret=move(y,x); if(ret!=ERR) ret=addstr(text); return ret; }
+#endif
 /* Various wrappers to addstr() and mvaddstr() which handle permutations of:
    - Including or not including the gamelog for external message logging
    - std::string or c-style char arrays */
 inline int addstr(const char *text,Log &log) { log.record(text); return addstr(text); }
 inline int mvaddstr(int y,int x,const char *text,Log &log) { log.record(text); return mvaddstr(y,x,text); }
+#if defined(CH_USE_MULTIBYTE)
+inline int addstr(const std::string& text) { return addstr(&text[0]); }
+#else
 inline int addstr(const std::string& text) { int ret=ERR; for(int i=0;i<len(text);i++) ret=addchar(text[i]); return ret; }
+#endif
 inline int addstr(const std::string& text, Log &log) { log.record(text); return addstr(text); }
 inline int mvaddstr(int y,int x,const std::string& text) { int ret=move(y,x); if(ret!=ERR) ret=addstr(text); return ret; }
 inline int mvaddstr(int y,int x,const std::string& text,Log &log) { log.record(text); return mvaddstr(y,x,text); }
index fca4c5c..1b358b1 100644 (file)
@@ -22,14 +22,14 @@ void preparepage(newsstoryst& ns, bool liberalguardian)
                set_color(translateGraphicsColor(newstops[5][x][y][1]),
                          translateGraphicsColor(newstops[5][x][y][2]),
                          newstops[5][x][y][3]);
-               addchar(newstops[5][x][y][0]);
+               addgrah(newstops[5][x][y][0]);
             }
             else
             {
                set_color(translateGraphicsColor(newstops[pap][x][y][1]),
                          translateGraphicsColor(newstops[pap][x][y][2]),
                          newstops[pap][x][y][3]);
-               addchar(newstops[pap][x][y][0]);
+               addgrah(newstops[pap][x][y][0]);
             }
          }
       }
index c44ad96..4bf3daa 100644 (file)
@@ -1767,7 +1767,7 @@ void displaycenterednewsfont(const std::string& str,int y)
                set_color(translateGraphicsColor(bigletters[p][x2][y2][1]),
                          translateGraphicsColor(bigletters[p][x2][y2][2]),
                          bigletters[p][x2][y2][3]);
-               addchar(bigletters[p][x2][y2][0]);
+               addgrah(bigletters[p][x2][y2][0]);
             }
          }
          x+=lim;
@@ -1803,7 +1803,7 @@ void displaynewspicture(int p,int y)
          set_color(translateGraphicsColor(newspic[p][x2][y2][1]),
                    translateGraphicsColor(newspic[p][x2][y2][2]),
                    newspic[p][x2][y2][3]);
-         addchar(newspic[p][x2][y2][0]);
+         addgrah(newspic[p][x2][y2][0]);
       }
 }