home *** CD-ROM | disk | FTP | other *** search
/ Phoenix Heaven Sunny 2 / APPARE2.BIN / oh_towns / art2 / src.lzh / SCRPLT.C < prev    next >
C/C++ Source or Header  |  1995-06-18  |  3KB  |  108 lines

  1. /*
  2.     scrplt.c
  3. */
  4.  
  5. #include <stdio.h>
  6. #include <stdlib.h>
  7. #include <string.h>
  8. #include <winb.h>
  9. #include <te.h>
  10. #include <fntb.h>
  11. #include <gui.h>
  12. #include <fmcfrb.h>
  13. #include <file_dlg.h>
  14. #include <egb.h>
  15.  
  16. #include "art.h"
  17. #include "pic.h"
  18.  
  19. static unsigned int _15_31[] =
  20.     { 0,2,4,6,8,11,13,15,17,19,21,23,25,27,29,31 };
  21.  
  22. static char byTmenuPlt[][4] =
  23. {
  24.     {0,0,0},            // 0: 透過色
  25.     {9,9,10},            // 1: メニュー色1
  26.     {12,6,4}, {15,12,10}, {9,9,9},
  27.     {0,12,7},
  28.     {12,12,13},            // 6: メニュー色2  (ARTemis での back 色)
  29.     {7,7,8},            // 7: メニュー色3
  30.     {2,2,3},            // 8: メニュー色4(黒)
  31.     {13,13,14},            // 9: メニュー色5
  32.     {13,0,0}, {0,0,10}, {5,5,5}, {0,15,15}, {15,13,0}, {15,15,15}
  33. };
  34.  
  35. #define CRGB(r,g,b) (((r)*32+(g)*1024+(b))+(((r)*32+(g)*1024+(b))<<16))
  36.  
  37. #define RGB16M(r,g,b)   (((uint)(g)<<16)|((uint)(r)<<8)|((uint)(b)))
  38.  
  39. void scrplt_init(void)
  40. {
  41. #if 1
  42. #if 1
  43.     unsigned int *coltbl;
  44.     if (scrPixelSize == 16)
  45.     {
  46.         coltbl = MG_getColorTable(2);
  47.         int i;
  48.         for (i=0; i<16; i++)
  49.             coltbl[i] = CRGB(_15_31[byTmenuPlt[i][0]],
  50.                              _15_31[byTmenuPlt[i][1]],
  51.                              _15_31[byTmenuPlt[i][2]]);
  52.         coltbl[GRAY]     = CRGB(21,21,22);
  53.         coltbl[LIGHT]    = CRGB(30,30,31);
  54.         coltbl[SHADOW]   = CRGB(8,8,9);
  55.         coltbl[BLACK]    = CRGB(0,0,0);
  56.         coltbl[WHITE]    = CRGB(31,31,31);
  57.         coltbl[DARKGRAY] = CRGB(15,15,16);
  58.     }
  59.     else
  60.     {
  61.         static uint tbl16M[] =
  62.             { 0x2109, 0x4e75, 0x3728, 0x67f5, 0x4e73, 0x640f, 0x56b6, 0x3df1,
  63.               0x0000, 0x3df0, 0x0360, 0x0015, 0x2d6b, 0x7c1f, 0x7bdf, 0x7fff };
  64.         coltbl = MG_getColorTable(3);
  65.         int i;
  66.         for (i=0; i<16; i++)
  67.         {
  68.             static uint _31_255[] =
  69.                 {  0,8,16,25, 33,41,49,58, 66,74,82,90, 99,107,115,123,
  70.                    132,140,148,156, 165,173,181,189, 197,206,214,222, 
  71.                    230,239,247,255};
  72.             int r,g,b;
  73.             GETRGB31(tbl16M[i],r,g,b);
  74.             coltbl[i] = (_31_255[b]<<16)|(_31_255[g]<<8)|_31_255[r];
  75.         }
  76.     }
  77. #else
  78.     // guiColTbl = MG_getColorTable(2);
  79.       {
  80.         unsigned int *coltbl;
  81.         coltbl = MG_getColorTable(2);
  82.         #define CRGB(r,g,b) (((r)*32+(g)*1024+(b))+(((r)*32+(g)*1024+(b))<<16))
  83.         coltbl[GRAY]     = CRGB(21,21,22);
  84.         coltbl[LIGHT]    = CRGB(30,30,31);
  85.         coltbl[SHADOW]   = CRGB(8,8,9);
  86.         coltbl[BLACK]    = CRGB(0,0,0);
  87.         coltbl[WHITE]    = CRGB(31,31,31);
  88.         coltbl[DARKGRAY] = CRGB(15,15,16);
  89.         #undef CRGB
  90.       }
  91. #endif
  92. #endif
  93. }
  94.  
  95.     // guiColTbl = MG_getColorTable(2);
  96.     //   {
  97.     //     unsigned int *coltbl;
  98.     //     coltbl = MG_getColorTable(2);
  99.     //     #define CRGB(r,g,b) (((r)*32+(g)*1024+(b))+(((r)*32+(g)*1024+(b))<<16))
  100.     //     coltbl[GRAY]     = CRGB(21,21,22);
  101.     //     coltbl[LIGHT]    = CRGB(30,30,31);
  102.     //     coltbl[SHADOW]   = CRGB(8,8,9);
  103.     //     coltbl[BLACK]    = CRGB(0,0,0);
  104.     //     coltbl[WHITE]    = CRGB(31,31,31);
  105.     //     coltbl[DARKGRAY] = CRGB(15,15,16);
  106.     //     #undef CRGB
  107.     //   }
  108.