home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Phoenix Heaven Sunny 2
/
APPARE2.BIN
/
oh_towns
/
install
/
dispoht.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-06-20
|
3KB
|
130 lines
/*************************************************************************
*
* オープニングCG表示
* cording ... TaroPYON
*
*************************************************************************/
#include "ccilib.h"
#include "kbcode.h"
#include "install.h"
#define SCREEN_MODE (0x0C)
int init();
int term();
int main(int argc, char **argv)
{
int x, y;
init();
tif_load("/OH_TOWNS/ohtowns.tif");
_apl_wait(CLOCKS_PER_SEC * 5);
while ( PD_getp(&x,&y) )
;
term();
return (0);
}
int init()
{
APL_init(SCREEN_MODE,1,1);
SCN_wrtPage(0);
return (NORMAL);
}
int term()
{
APL_term();
}
/*************************************************************************
* TIFF表示
*************************************************************************/
int tif_load( char *fn )
{
int i, x, y, ret, pixel, md, x0, y0;
char *img;
short fr[4];
SCN_wrtPage(0);
SCN_boxf(0,0,639,479,PSET,0);
if ( (img = IMG_open()) != NULL )
{
IMG_setAtt(img,IMG_ATT_PLTON); /* パレット設定属性ON */
if ( IMG_load(img,fn) == NORMAL )
{
IMG_getFr(img,fr);
pixel = IMG_getPixel(img);
switch ( pixel )
{
case 1: /* モノクロ */
case 4: /* 16色 */
x0 = (640 - (fr[2] - fr[0] + 1)) / 2;
y0 = (480 - (fr[3] - fr[1] + 1)) / 2;
md = 3;
break;
case 8: /* 256 色 */
x0 = (640 - (fr[2] - fr[0] + 1)) / 2;
y0 = (480 - (fr[3] - fr[1] + 1)) / 2;
md = 12;
break;
case 16: /* 32768 色 */
if ( fr[2] - fr[0] + 1 <= 320 )
{
x0 = (320 - (fr[2] - fr[0] + 1)) / 2;
y0 = (240 - (fr[3] - fr[1] + 1)) / 2;
md = 10;
} else
{
x0 = (512 - (fr[2] - fr[0] + 1)) / 2;
y0 = (480 - (fr[3] - fr[1] + 1)) / 2;
md = 17;
}
break;
default:
goto _TIF_ERR;
}
IMG_setPos(img,x0,y0); /* 表示位置補正 */
MOS_COFF(); /* マウスカーソル消去 */
EGB_displayPage(EgbPtr,0,0);
EGB_writePage(EgbPtr,0);
EGB_clearScreen(EgbPtr);
EGB_resolution(EgbPtr,0,md); /* 画面モード設定 */
if ( md == 3 || md == 10 )
{
EGB_resolution(EgbPtr,1,3); /* 画面モード設定 */
EGB_writePage(EgbPtr,1);
EGB_clearScreen(EgbPtr);
}
EGB_writePage(EgbPtr,0);
if ( md == 10 )
{
EGB_displayStart(EgbPtr,2,2,2);
EGB_displayStart(EgbPtr,3,320,240);
}
EGB_color(EgbPtr,1,0);
EGB_clearScreen(EgbPtr);
IMG_dsp(img);
if ( md == 3 || md == 10 )
EGB_displayPage(EgbPtr,1,3);
else
EGB_displayPage(EgbPtr,0,1);
}
IMG_close(img);
}
#if 0
EGB_writePage(EgbPtr,0);
EGB_clearScreen(EgbPtr);
#endif
return (NORMAL);
}