Пример #1
0
void DrawIntro()
{
	unsigned char frame;
	
	ResetVideo();
	setupFont();
	
	vsync();
	set_color(1, 0);
	SetFontColors(14, 0, 0, 0);
	put_string("KORDAMP PRESENTS", 12, 14);
	for(frame = 0; frame < 7; frame ++)
	{
		SetFontColors(14, 0, RGB(frame, frame, frame), 0);
		vsync(3);
	}
	
	frame = 5;
	while(frame)
		frame --;
	
	for(frame = 7; frame > 0; frame --)
	{
		SetFontColors(14, 0, RGB(frame, frame, frame), 0);
		vsync(3);
	}
}
Пример #2
0
void setupFont()
{	
    load_font(my_font, 96);
    set_font_pal(14);

	SetFontColors(14, RGB(3, 3, 3), RGB(7, 7, 7), 0);
	SetFontColors(15, RGB(3, 3, 3), RGB(7, 0, 0), 0);
}
Пример #3
0
static long ChooseTauntSetup( ScreenParams *params )
{
ChooseTauntGlobals	*choose;
KeyboardEntryLayout *keyLayout;
segaCharRect		tbRect;
Point				boxLocation;
Rect				boxRect;

	DisableDefDialogs();

	choose = (ChooseTauntGlobals *)NewMemory( kTemp, sizeof(ChooseTauntGlobals) );
	
	EraseGDevice ( kScrollA );
	SetBackdropID ( kBlackBackground, true, 0 );

	GetScreenLayoutPoint( kChooseTauntScreen, kTauntEntryBoxLocation, &boxLocation );
	choose->typingBox = DrawDBGraphicAt( 0, kTauntEntryField, boxLocation.h>>3, 
		boxLocation.v>>3, kScrollB );

	SetCurrentDevice( kScrollA );
	SetCurFont( kXBandHeavy );
	SetFontColors( 0, 11, 10, 0 );
	choose->titlePatterns = DrawScreenLayoutString( kChooseTauntScreen, kTauntHeadlineString );

	SetCurFont( kXBandLight9Font );
	SetFontColors( 0, 9, 8, 0 );
	choose->descriptionPatterns = BoxScreenLayoutString( kChooseTauntScreen, kTauntDescriptionString,
		kTauntDescriptionRect, kJustLeft );	

	GetScreenLayoutCharRect( kChooseTauntScreen, kTauntJizzleRect, &tbRect );
	choose->tbRef = DrawTextBox( &tbRect, kGreenColor, kScrollA );
	StartTextBoxAnimation( choose->tbRef, 10 );
	
	keyLayout = SetupKeyboardEntryLayout( kChooseTauntKeyboardEntry );
	choose->keyRef = InitKeyboardEntry( keyLayout, 0 );
	choose->keyLayout = keyLayout;
	SetKeyboardEntryMeasureProc( choose->keyRef, TauntMeasureProc );
	
	/* Place the existing taunt in the entry field */
	{
		char *existingTaunt;
		
		existingTaunt = (char *)GetPersonificationPart( GetCurrentLocalUser()->userID, kPersonificationTauntText );
		StuffCurrentKeyboardField( choose->keyRef, existingTaunt );
	}

	return (long) choose;
}
Пример #4
0
static void _AddPWChar( ChoosePasswordGlobals* choose, long command )
{
short			tempX;
char			dotText[10];
short			index;
	
	// if it's "A" "B" or "C", add it to the string
		
	if (( command & kAllLetters) && !( command & ~kAllLetters) )	{
	
		PlayDBFX( kPasswordEntrySnd, 0, 0 );

		if (choose->newPWFill >= kMaxPWLength)	{
			return;
		}
		choose->newPW[choose->newPWFill++] = command;			// record a stroke
			
		tempX = choose->txX;
		
		for (index=0; index<choose->newPWFill; ++index)
			dotText[index] = kDotText;
		dotText[choose->newPWFill] = 0;

		SetCurFont(kMain2BitFont);
		SetFontColors( kDotColor0, kDotColor1, kDotColor2, kDotColor3 );
		DrawSegaString( &tempX, &choose->txY, dotText );
		VDPIdle();
	}
}
Пример #5
0
void DrawSmartCardCredits( OptionsRefCon *optionGlobals, short numCreds )
{
short			oldFont;
char			buffer[8];
StatTextDesc	*STDPtr;
xyString		*s;

	SetCurrentDevice( kScrollA );
	STDPtr = (StatTextDesc *)((optionGlobals->theDitlList)->items[kSmartCardCredits].objectData);
	
	oldFont = GetCurFont ();
	
	SetCurFont( STDPtr->font );
	SetupTextGDevice( &(optionGlobals->textRect), optionGlobals->textPatterns );
	SetFontColors( STDPtr->color0, STDPtr->color1, STDPtr->color2, STDPtr->color3 );

	if (numCreds >= 0)
	{
		SegaNumToString( numCreds, buffer );
		DrawPaddedClippedSegaText( (STDPtr->animationData).xPos, (STDPtr->animationData).yPos, 
											6*8, kJustifyLeft, buffer );
	}
	else
	{
		s = (xyString *)DBGetItem( kStringType, kNoSmartCardPresentString );
		DrawPaddedClippedSegaText( (STDPtr->animationData).xPos, (STDPtr->animationData).yPos, 
											6*8, kJustifyLeft, s->cString );
	}
	
	SetCurFont ( oldFont );
}
Пример #6
0
static long ChoosePasswordSetup( ScreenParams *params )
{
ChoosePasswordGlobals	*choose;
Point					boxLocation;
segaCharRect			tbRect;

	choose = (ChoosePasswordGlobals *)NewMemory( kTemp, sizeof(ChoosePasswordGlobals));
	
	choose->addPWChar					= (ChoosePasswordProc) _AddPWChar;
	choose->doubleCheckAndSetPassword	= (ChoosePasswordProc) _DoubleCheckAndSetPassword;
	choose->resetEnteredPassword		= (ChoosePasswordProc) _ResetEnteredPassword;
	choose->setupPWChar					= (ChoosePasswordProc) _SetupPWChar;
		
	choose->charSprite = 0;		// zero allocations
	choose->textState = 0;
	
	EraseGDevice ( kScrollA );
	SetBackdropID ( kBlackBackground, true, 0 );
	SetCurrentDevice( kScrollA );
	
	GetScreenLayoutPoint( kChoosePasswordScreen, kLayoutBoxPoint, &boxLocation );
	choose->boxGraphic = DrawDBGraphicAt( 0, kPasswordBox, boxLocation.h>>3, 
		boxLocation.v>>3, kScrollA );

	SetCurrentDevice( kScrollA );
	SetCurFont( kXBandHeavy );
	SetFontColors( 0, 11, 10, 0 );
	choose->titlePatterns = DrawScreenLayoutString( kChoosePasswordScreen, kLayoutTitleString );

	SetCurFont( kXBandLight9Font );
	SetFontColors( 0, 9, 8, 0 );
	choose->descriptionPatterns = BoxScreenLayoutString( kChoosePasswordScreen, kLayoutDescriptionString,
		kLayoutDescriptionRect, kJustLeft );	

	SetFontColors( 0, kDarkPurpleColor, kPurpleColor, 0 );
	choose->donePatterns = DrawScreenLayoutString( kChoosePasswordScreen, kLayoutDoneString );

	GetScreenLayoutCharRect( kChoosePasswordScreen, kLayoutJizzleRect, &tbRect );
	choose->jizzleRef = DrawTextBox( &tbRect, kGreenColor, kScrollA );
	StartTextBoxAnimation( choose->jizzleRef, 10 );
	
	SetupPWChar( choose );

	return (long) choose;
}
Пример #7
0
void
NetStory::ResetCurrentGuy(int side,int	newGuy)
{
	BAM_Guy		*pOutGuy;
	BAM_Guy		*ptitleGuy;
	CelHeader	*ptitle;

	int			*curGuy;
	int			*oppCurGuy;

	if(side == NS_LOCAL)
	{
		curGuy	 = &currentGuy;
		oppCurGuy = &enemyCurrentGuy;
		ptitle	 = (CelHeader *)AGetResData(gtitle);
		ptitleGuy = &title;
	}
	else
	{
		oppCurGuy = &currentGuy;
		curGuy	 = &enemyCurrentGuy;
		ptitle	 = (CelHeader *)AGetResData(gEnemyTitle);
		ptitleGuy = &enemyTitle;
	}


	// cut old storyGuy only if there is one and the OTHER guy
	// isn't using it
	if (*curGuy != -1 && *curGuy != *oppCurGuy)
	{
		pOutGuy = &storyGuy[*curGuy];
		pOutGuy->fIsActive = FALSE;
		CutObject(pOutGuy->gSelf, CT_SERV | CT_ROST);
	}

	flagGuy[*curGuy].Hide();	//make sure old guy is hid

	*curGuy = newGuy;

	// add new region outline unless OTHER guy has the region already active
	if(*curGuy != *oppCurGuy)
	{
		pOutGuy = &storyGuy[newGuy];
		pOutGuy->fIsActive = TRUE;
		AddObject(pOutGuy->gSelf, CT_SERV | CT_ROST);
	}

	// clear region name
	memset(((uchar*)ptitle)+sizeof(CelHeader),SKIP_COLOR,L2R(ptitle->width) * ptitle->height);

	pFontMgr->SetRes(9050);
	SetFontColors(CI_SKIP,93,90,93,90,93,90);

	//startup new region name
	ASetString(0,0,storyNames[newGuy], (uchar *)ptitle, ptitle->width, NULL, DG_JUST_CENTER);
	ptitleGuy->SetPos(titlePos[(*curGuy)*2],titlePos[(*curGuy)*2+1]);
}
Пример #8
0
static long ShowDescriptionString( XSetupGlobals *setup, DBID stringID )
{
	char *string = GetSegaString( stringID );
	
	if (string)
	{
		SetupTextGDevice( &setup->descriptionRect, setup->descriptionPatterns );
		SetCurFont( kXBandBold10Font );
		SetFontColors( 0, kDarkGreenColor, kGreenColor, 0 );
		DrawPaddedClippedSegaText( 0, 0, kPadWidth, kJustCenter, string );
	}
}
Пример #9
0
void
MakeChar::Setup()
{
	BAM_Guy		*pGuy;
	BAM_Button	*pButton;
	uchar			*pback;
	CelHeader	*pbackCH;
	int			x;
	uint			rNumBord;

	//======================================================
	// setup background cel filled with black
	TRACK_MEM("MakeChar background cel");
	gback = ACreateCel(&rNumBack,0,0,320,400,CI_BLACK,100);
	pback = AGetResData(gback);
	pbackCH = (CelHeader*)pback;

	// copy this anim into the dynamic cel that we will use
	gbackAnim = ALoad(RES_ANIM,8150);
	CopyCel(pbackCH,0,0,RES_ANIM,8150,1,FALSE);

	pGuy = &back;
	pGuy->SetRes(RES_CEL,rNumBack);
	pGuy->SetPos(0,0);
	pGuy->SetContext(gSelf);
	pGuy->Setup(CT_ROST);
	pGuy->SetPri(100);

	//pal.FadeToBlack();
	pal.Load(8150);

	// pick a gender catagory
	switch (ARandom(3))
	{
		case 0:
			bGlobal.curCat = G_MEN;
			break;

		case 1:
			bGlobal.curCat = G_WOMEN;
			break;

		case 2:
			bGlobal.curCat = G_OTHER;
			break;

	}

	//======================================================
	// lets copy in all the borders and boundaries into the background

	gPortBord = ALoad(RES_ANIM,8154);
	rNumBord = 8154;
	CopyCel((CelHeader*)pback,108,67,RES_ANIM,rNumBord,3,TRUE);	// Name Frame
	CopyCel((CelHeader*)pback,108,92,RES_ANIM,rNumBord,1,TRUE);	// Portrait Frame
	CopyCel((CelHeader*)pback,157,92,RES_ANIM,rNumBord,4,TRUE);	// Arrow Buttons Frame
	CopyCel((CelHeader*)pback,108,191,RES_ANIM,rNumBord,5,TRUE);	// Gender Buttons Frame
	CopyCel((CelHeader*)pback,108,222,RES_ANIM,rNumBord,6,TRUE);	// Name Buttons Frame
	CopyCel((CelHeader*)pback,108,253,RES_ANIM,rNumBord,7,TRUE);	// 'Done' Button Frame
	CopyCel((CelHeader*)pback,21,281,RES_ANIM,rNumBord,10,TRUE);	// Option Button Frame

	//=============================================
	// Write the necessary text into the background

	pFontMgr->SetRes(9050);
	SetFontColors(CI_SKIP,64,74);

	pTxt = sqbMakeChar.Load(MAKECHAR_SQB,1);
	ASetString(206,  99, pTxt, (uchar *)pbackCH, pbackCH->width, NULL);
	pTxt = sqbMakeChar.Load(MAKECHAR_SQB,2);
	ASetString(206, 116, pTxt, (uchar *)pbackCH, pbackCH->width, NULL);
	pTxt = sqbMakeChar.Load(MAKECHAR_SQB,3);
	ASetString(206, 133, pTxt, (uchar *)pbackCH, pbackCH->width, NULL);
	pTxt = sqbMakeChar.Load(MAKECHAR_SQB,4);
	ASetString(206, 150, pTxt, (uchar *)pbackCH, pbackCH->width, NULL);
	pTxt = sqbMakeChar.Load(MAKECHAR_SQB,5);
	ASetString( 70, 198, pTxt, (uchar *)pbackCH, pbackCH->width, NULL);
	pTxt = sqbMakeChar.Load(MAKECHAR_SQB,6);
	ASetString( 82, 229, pTxt, (uchar *)pbackCH, pbackCH->width, NULL);

	pFontMgr->SetRes(9052);
	SetFontColors(CI_SKIP,93,76,74,74,48,CI_BLACK);
	pTxt = sqbMakeChar.Load(MAKECHAR_SQB,7);
	pFontMgr->SetString(0,330, pTxt, (uchar *)pbackCH, pbackCH->width, NULL, DG_JUST_CENTER);

	SetFontColors(CI_SKIP,45,46,47,49,50,CI_BLACK);
	pTxt = sqbMakeChar.Load(MAKECHAR_SQB,8);
	pFontMgr->SetString(0,372, pTxt, (uchar *)pbackCH, pbackCH->width, NULL, DG_JUST_CENTER);
	pFontMgr->SetRes(9050);
	SetFontColors(CI_SKIP,64,74);


	switch(bGlobal.curCat)
	{
		case G_MEN:
			sqbRes = MEN_SQB;
			if(!maxMenNameNum)
				maxMenNameNum = atoi(sqbMakeChar.Load(MEN_SQB,1));
			//add 2 to num to get zero based random num past first sqb used above
			curNameNum = MyRandom(maxMenNameNum,curNameNum) + 2;
			break;
		case G_WOMEN:
			sqbRes = WOMEN_SQB;
			if(!maxWomenNameNum)
				maxWomenNameNum = atoi(sqbMakeChar.Load(WOMEN_SQB,1));
			curNameNum = MyRandom(maxWomenNameNum,curNameNum) + 2;
			break;
		case G_OTHER:
			sqbRes = OTHER_SQB;
			if(!maxOtherNameNum)
				maxOtherNameNum = atoi(sqbMakeChar.Load(OTHER_SQB,1));
			curNameNum = MyRandom(maxOtherNameNum,curNameNum) + 2;
			break;
	}


	pTxt = sqbMakeChar.Load(sqbRes,curNameNum);
	TRACK_MEM("NameText");	gNameText = AMalloc(20);
	char *pText = ADerefAs(char, gNameText);
	strcpy(bGlobal.curName,pTxt);
	strcpy(pText,pTxt);
	BAM_Box	*pBox = &nameBox;
	pBox->SetColors(CI_SKIP,64,74,64,74,64,74,155,142);
	pBox->Create(111, 71, 105, 15, 200, gNameText, 16, gSelf, rNumBack,0,0);
	pBox->SetupReplies(REPLY_DESELECTED);	// let us know when text changes
	//pBox->Select(TRUE); //makes the box edit active

	//======================================================
	// setup current portrait -randomly init.

	LoadCover();
	LoadFace();
	LoadBody();
	LoadBanner();

	//======================================================
	// lets setup up all the buttons

	uint32 posY[4] =  { 95, 112, 129, 146 };

	for(x=0; x<4; x++)
	{
		// create left arrow button
		pButton = &leftArrowB[x];
		pButton->Create(159, posY[x], 200, RES_ANIM, 8156, 1, gSelf);
		pButton->SetupReplies(REPLY_DESELECTED);
		pButton->fIsToggle = FALSE;		// click-type button
		pButton->SetOwnerCel(rNumBack);		// draws itself into this DCEL, instead of being drawn by Animate() directly
		pButton->Select(FALSE);				// set button to unselected state - will cause drawing into master cel

		// create right arrow button
		pButton = &rightArrowB[x];
		pButton->Create(180, posY[x], 200, RES_ANIM, 8157, 1, gSelf);
		pButton->SetupReplies(REPLY_DESELECTED);
		pButton->fIsToggle = FALSE;		// click-type button
		pButton->SetOwnerCel(rNumBack);		// draws itself into this DCEL, instead of being drawn by Animate() directly
		pButton->Select(FALSE);				// set button to unselected state - will cause drawing into master cel
	}


	// disk button
	pButton = &diskB;
	pButton->Create(23, 285, 200, RES_ANIM, 129, 1, gSelf);
	pButton->SetupReplies(REPLY_DESELECTED);
	pButton->fIsToggle = FALSE;		// click-type button
	pButton->SetOwnerCel(rNumBack);		// draws itself into this DCEL, instead of being drawn by Animate() directly
	pButton->Select(FALSE);				// set button to unselected state - will cause drawing into master cel

	pButton = &randomCharB;
	pButton->Create(159, 163, 200, RES_ANIM, 8158, 1, gSelf);
	pButton->SetupReplies(REPLY_DESELECTED);
	pButton->fIsToggle = FALSE;		// click-type button
	pButton->SetOwnerCel(rNumBack);		// draws itself into this DCEL, instead of being drawn by Animate() directly
	pButton->SetTextJustify(DG_JUST_CENTER, DG_JUST_CENTER);
	pTxt = sqbMakeChar.Load(MAKECHAR_SQB,9);
	pButton->SetCelText(1, pTxt);
	pButton->SetColors(1, 93, 90);				// inactive colors
	pButton->SetCelText(2, pTxt);
	pButton->SetColors(2, 155, 142);				// active colors
	pButton->Draw();
	pButton->Select(FALSE);				// set button to unselected state - will cause drawing into master cel

	pButton = &manB;
	pButton->Create(110, 194, 200, RES_ANIM, 8158, 1, gSelf);
	pButton->SetupReplies(REPLY_ACTIVATED | REPLY_DEACTIVATED);
	pButton->fIsToggle = TRUE;			// click-type button
	pButton->SetOwnerCel(rNumBack);		// draws itself into this DCEL, instead of being drawn by Animate() directly
	pButton->SetTextJustify(DG_JUST_CENTER, DG_JUST_CENTER);
	pTxt = sqbMakeChar.Load(MAKECHAR_SQB,10);
	pButton->SetCelText(1, pTxt);
	pButton->SetColors(1, 93, 90);				// inactive colors
	pButton->SetCelText(2, pTxt);
	pButton->SetColors(2, 155, 142);				// active colors
	pButton->Draw();
	if(bGlobal.curCat == G_MEN)
		pButton->Select(TRUE);				// set button to unselected state - will cause drawing into master cel
	else
		pButton->Select(FALSE);				// set button to unselected state - will cause drawing into master cel

	pButton = &womanB;
	pButton->Create(152, 194, 200, RES_ANIM, 8158, 1, gSelf);
	pButton->SetupReplies(REPLY_ACTIVATED | REPLY_DEACTIVATED);
	pButton->fIsToggle = TRUE;			// click-type button
	pButton->SetOwnerCel(rNumBack);		// draws itself into this DCEL, instead of being drawn by Animate() directly
	pButton->SetTextJustify(DG_JUST_CENTER, DG_JUST_CENTER);
	pTxt = sqbMakeChar.Load(MAKECHAR_SQB,11);
	pButton->SetCelText(1, pTxt);
	pButton->SetColors(1, 93, 90);				// inactive colors
	pButton->SetCelText(2, pTxt);
	pButton->SetColors(2, 155, 142);				// active colors
	pButton->Draw();
	if(bGlobal.curCat == G_WOMEN)
		pButton->Select(TRUE);				// set button to unselected state - will cause drawing into master cel
	else
		pButton->Select(FALSE);				// set button to unselected state - will cause drawing into master cel

	pButton = &otherB;
	pButton->Create(194, 194, 200, RES_ANIM, 8158, 1, gSelf);
	pButton->SetupReplies(REPLY_ACTIVATED | REPLY_DEACTIVATED);
	pButton->fIsToggle = TRUE;			// click-type button
	pButton->SetOwnerCel(rNumBack);		// draws itself into this DCEL, instead of being drawn by Animate() directly
	pButton->SetTextJustify(DG_JUST_CENTER, DG_JUST_CENTER);
	pTxt = sqbMakeChar.Load(MAKECHAR_SQB,12);
	pButton->SetCelText(1, pTxt);
	pButton->SetColors(1, 93, 90);				// inactive colors
	pButton->SetCelText(2, pTxt);
	pButton->SetColors(2, 155, 142);				// active colors
	pButton->Draw();
	if(bGlobal.curCat == G_OTHER)
		pButton->Select(TRUE);				// set button to unselected state - will cause drawing into master cel
	else
		pButton->Select(FALSE);				// set button to unselected state - will cause drawing into master cel

	pButton = &customNameB;
	pButton->Create(110, 225, 200, RES_ANIM, 8158, 1, gSelf);
	pButton->SetupReplies(REPLY_DESELECTED);
	pButton->fIsToggle = FALSE;		// click-type button
	pButton->SetOwnerCel(rNumBack);		// draws itself into this DCEL, instead of being drawn by Animate() directly
	pButton->SetTextJustify(DG_JUST_CENTER, DG_JUST_CENTER);
	pTxt = sqbMakeChar.Load(MAKECHAR_SQB,13);
	pButton->SetCelText(1, pTxt);
	pButton->SetColors(1, 93, 90);				// inactive colors
	pButton->SetCelText(2, pTxt);
	pButton->SetColors(2, 155, 142);				// active colors
	pButton->Draw();
	pButton->Select(FALSE);				// set button to unselected state - will cause drawing into master cel

	pButton = &randomNameB;
	pButton->Create(152, 225, 200, RES_ANIM, 8158, 1, gSelf);
	pButton->SetupReplies(REPLY_DESELECTED);
	pButton->fIsToggle = FALSE;		// click-type button
	pButton->SetOwnerCel(rNumBack);		// draws itself into this DCEL, instead of being drawn by Animate() directly
	pButton->SetTextJustify(DG_JUST_CENTER, DG_JUST_CENTER);
	pTxt = sqbMakeChar.Load(MAKECHAR_SQB,9);
	pButton->SetCelText(1, pTxt);
	pButton->SetColors(1, 93, 90);				// inactive colors
	pButton->SetCelText(2, pTxt);
	pButton->SetColors(2, 155, 142);				// active colors
	pButton->Draw();
	pButton->Select(FALSE);				// set button to unselected state - will cause drawing into master cel

	pButton = &doneB;
	pButton->Create(110, 256, 200, RES_ANIM, 8158, 1, gSelf);
	pButton->SetupReplies(REPLY_DESELECTED);
	pButton->fIsToggle = FALSE;		// click-type button
	pButton->SetOwnerCel(rNumBack);		// draws itself into this DCEL, instead of being drawn by Animate() directly
	pButton->SetTextJustify(DG_JUST_CENTER, DG_JUST_CENTER);
	pTxt = sqbMakeChar.Load(MAKECHAR_SQB,14);
	pButton->SetCelText(1, pTxt);
	pButton->SetColors(1, 93, 90);				// inactive colors
	pButton->SetCelText(2, pTxt);
	pButton->SetColors(2, 155, 142);				// active colors
	pButton->Draw();
	pButton->Select(FALSE);				// set button to unselected state - will cause drawing into master cel

	BAM_Room::Setup();
	pGraphMgr->Animate();
	pal.FadeUp();

}
Пример #10
0
void DrawCredits()
{
	unsigned char end = 0;
	int counter = 0;

	redraw = 1;
	refresh = 1;
    while(!end)
    {   
		vsync();
		
        if(redraw)
        {
			ResetVideo();
			setupFont();
			
			SetFontColors(15, RGB(3, 3, 3), RGB(0, 6, 0), 0);
			SetFontColors(13, RGB(3, 3, 3), RGB(1, 6, 6), 0);

			set_xres(512, xres_flags);
			
#ifndef CDROM1			
			set_map_data(MB512_map, 64, 30);
			set_tile_data(MB512_bg);
			load_tile(0x1000);
			load_map(0, 0, 0, 0, 64, 30);
			load_palette(0, MB512_pal, 1);  
#else		
			set_screen_size(SCR_SIZE_64x32); 
			cd_loaddata(GPHX_OVERLAY, OFS_back512_PAL_bin, palCD, SIZE_back512_PAL_bin); 
			load_palette(0, palCD, 1);
			cd_loadvram(GPHX_OVERLAY, OFS_back512_DATA_bin, 0x1000, SIZE_back512_DATA_bin);			
			cd_loadvram(GPHX_OVERLAY, OFS_back512_BAT_bin, 0, SIZE_back512_BAT_bin);
#endif
			
			Center224in240();
			
            redraw = 0;
			refresh = 1;
			disp_on();
        }
		
		if(refresh)
		{
			RefreshCredits();

			refresh = 0;
		}
		
		set_font_pal(14);
		if(counter == 1)
			put_string("Artemio Urbina      ", HPOS+2, 8);
		if(counter == 60*4)
			put_string("@Artemio (twitter)  ", HPOS+2, 8);
		if(counter == 60*8)
			put_string("*****@*****.**", HPOS+2, 8);
		if(counter == 60*16)
			counter = 0;
			
		counter++;

        controller = joytrg(0);
        
		if (controller & JOY_II)
			end = 1;
			
		if (controller & JOY_SEL)
		{
			DrawN();
			redraw = 1;
		}
    }	
}
Пример #11
0
void
NetStory::Setup()
{
	
	BAM_Guy 		*pGuy;
	uint32		x,x1;
	clock_t		newTime;
	BAM_Button	*pButton;


	bGlobal.missionsDone = 0;
	sendErrCnt = 0;


	// lets load a res_anim and copy it to a dcel
	// so we can copy buttons onto it -and attach the dcel to a guy.

	// setup background guy filled with black
	TRACK_MEM("NetStory: background cel");
	gback = ACreateCel(&rNumBack,0,0,320,400,CI_BLACK,5);

	uchar			*pback;
	CelHeader	*pbackCH;
	pback = AGetResData(gback);
	pbackCH = (CelHeader*)pback;

	CopyCel(pbackCH,0,0,RES_ANIM,190,1,FALSE);

	pGuy = &back;
	pGuy->SetRes(RES_CEL,rNumBack);
	pGuy->SetPos(0,0);
	pGuy->SetContext(gSelf);
	pGuy->Setup(CT_ROST);
	pGuy->SetPri(5);

	//pal.FadeToBlack();
	pal.Load(190);

	LoadUnitColors(pal.gSelf,
						pBam->sideColors[pBam->playerSide],
						pBam->sideColors[(pBam->playerSide==SIDE1)?SIDE2:SIDE1]);

	//----------------------------
	uchar *pClut1 = ADerefAs(uchar, clut[0]);
	uchar *pClut2 = ADerefAs(uchar, clut[1]);

	for(x=0; x<CLUT_SIZE; x++)
	{
		pClut1[x] = (uchar)(CLUT1_START + x);
		pClut2[x] = (uchar)(CLUT2_START + x);
	}

	//----------------------------
	// setup temp. cel for pixel copies
	TRACK_MEM("Story: temp work cel");
	gTCel = ACreateCel(NULL,0,0,2,2,CI_BLACK,5);

	//----------------------------
	// setup a cel for a guy that will display text of region names
	TRACK_MEM("Story: text cel");
	gtitle = ACreateCel(&rNumTitle,0,0,70,72,SKIP_COLOR,250);

	pGuy = &title;
	pGuy->SetRes(RES_CEL,rNumTitle);
	pGuy->SetPos(0,0);
	pGuy->SetContext(gSelf);
	pGuy->Setup(CT_ROST);
	pGuy->SetPri(250);

	//----------------------------
	// setup a cel for a guy that will display text of enemy region name
	TRACK_MEM("Story: text cel");
	gEnemyTitle = ACreateCel(&rNumEnemyTitle,0,0,70,72,SKIP_COLOR,250);

	pGuy = &enemyTitle;
	pGuy->SetRes(RES_CEL,rNumEnemyTitle);
	pGuy->SetPos(0,0);
	pGuy->SetContext(gSelf);
	pGuy->Setup(CT_ROST);
	pGuy->SetPri(240);

	//----------------------------
	pGuy = &inset;
	pGuy->SetRes(RES_ANIM,221);
	pGuy->SetPos(104,326);
	pGuy->SetContext(gSelf);
	pGuy->Setup(CT_ROST);
	pGuy->SetPri(20);


	for (x=0;x<NETMAXOUTLINEGUYS;x++)
	{
		if(x<=NETMAXREGIONS)
			strcpy(storyNames[x], sqbStory.Load(REGION2_SQB,x+1));
		else // 
			strcpy(storyNames[x], sqbStory.Load(STORYLINE_SQB,x-14));
	}



	//==================================================================
	//note: vas has cels 2 and 3 swapped in anim 204
	uint32  storyAnims [] =	  {200,1,  200,2,  200,3,
					 					201,1,  201,2,  201,3,
					 					202,1,  202,2,  202,3,
					 					203,1,  203,2,  203,3,
					 					204,1,  204,3,  204,2};

	uint32  storyPos [] = {	42,	54,		159,	0,			139,	73,
								 	212,	262,		75,	196,		71,	236,
								 	0,		65,		0,		0,			64,	0,
								 	48,	153,		0,		185,		0,		247,
								 	149,	135,		243,	29,		190,	162};


	for(x=0,x1=0; x<NETMAXSTORYGUYS; x++,x1+=2)
	{
		pGuy = &storyGuy[x];
		pGuy->SetContext(gSelf);
		//pGuy->Setup(CT_ROST);
		pGuy->fIsActive = TRUE; //lets not start them in the roster YET
		pGuy->SetPri(100);
		pGuy->SetRes(RES_ANIM,storyAnims[x1],storyAnims[x1+1]);
		pGuy->SetPos(storyPos[x1],storyPos[x1+1]);
	}

	//==================================================================
	// these positions used for title text box
	int  tmpTitlePos[] = {	//REGIONS
								77,	91,		212,	21,		173,	104,
								232,	289,		85,	230,		138,	281,
								-10,	105,		0,		14,		106,	14,
								81,	181,		4,		214,		11,	281,
								166,	154,		245,	104,		217,	229,

									//MAIN STORIES
								142,	76,		122,	264,  	2,		38,
								28,	205,		230,	181
									};

	memcpy(titlePos,tmpTitlePos,sizeof(titlePos));

	//==================================================================

	pFontMgr->SetRes(9052);
	//SetFontColors(CI_SKIP,45,46,47,49,50,0);		//"ENGRAVED MARBLE"
	SetFontColors(CI_SKIP,93,76,74,74,48,CI_BLACK);		//"BLUE GREEN"
	pTxt = sqbStory.Load(STORY_SQB,2); //"choose starting point:"
	ASetString(38,325, pTxt, (uchar *)pbackCH, 62, NULL, DG_JUST_CENTER);

	//Reset color in which to draw names
	pFontMgr->SetRes(9050);
	SetFontColors(CI_SKIP,93,90,93,90,93,90);

	//-----------------------------------------------------------
	int  tmpFlagPos[] = {	//REGION FLAGS
									108,128, 231,55,  216,126,
									250,295, 115,260, 163,295,
									19,155,  37,55,  111,45,
									122,200,  41,240,  31,295,
									201,167, 290,137, 275,238, 

									//MAIN STORY FLAGS
									177,112, 163,300,  37,74,
									63,241, 265,212
									};

	memcpy(flagPos,tmpFlagPos,sizeof(flagPos));

	for(x=0,x1=0; x<NETMAXFLAGGUYS; x++,x1+=2)
	{
		pGuy = &flagGuy[x];
		pGuy->SetContext(gSelf);
		pGuy->SetPri(300);
 		pGuy->SetRes(RES_ANIM,205,3);
	 	pGuy->SetPos(flagPos[x1],flagPos[x1+1]);
		pGuy->SetClut(192,CLUT_SIZE,clut[0]);	//set clut to 1st range
		//no call to Setup() yet
	}

	for(x=0,x1=0; x<NETMAXFLAGGUYS; x++,x1+=2)
	{
		pGuy = &enemyFlagGuy[x];
		pGuy->SetContext(gSelf);
		pGuy->SetPri(300);
 		pGuy->SetRes(RES_ANIM,205,6);
	 	pGuy->SetPos(flagPos[x1],flagPos[x1+1]);
		pGuy->SetClut(192,CLUT_SIZE,clut[1]);	//set clut to 2nd range
		//no call to Setup() yet
	}

	pGuy = &enemyCursor;
	pGuy->SetContext(gSelf);
	pGuy->Setup();
	pGuy->SetPri(10000);
	pGuy->SetRes(RES_ANIM,9000,9);
	pGuy->SetPos(pMouse->GetX(),pMouse->GetY());

	//show button as unavailable -change to ani with good "inactive" cel 3
	pButton = &diskButton;
	pButton->Create(4, 365, 200, RES_ANIM, 129, 1, gSelf);
	pButton->SetupReplies(REPLY_DESELECTED);
	pButton->fIsToggle = FALSE;		// click-type button
	pButton->SetOwnerCel(rNumBack);		// draws itself into this DCEL, instead of being drawn by Animate() directly
	pButton->Select(DG_DISABLED);

	//==================================================================
	//setup default time and have cycle check
	newTime = clock();
	flagFlashTimer = newTime + FLASH_INTERVAL;
	enemyFlagFlashTimer = flagFlashTimer;


	BAM_Room::Setup();
	pGraphMgr->Animate();
	pal.FadeUp();

//	pResMgr->Dump();
//	pMemMgr->Dump(1, "Start Option::Setup");
}
Пример #12
0
void
WinLose::Setup(grip gPal,bool fadeup)
{
	BAM_Guy		*pGuy;
	BAM_Button  *pButton;
	uchar			*pback;
	CelHeader	*pbackAnimCH,*pbackCH;
	int			i,portNum;

	prevFont = pFontMgr->curFontNum;
	pFontMgr->SetRes(9050);

	//======================================================

	//pResMgr->Dump();
	//pMemMgr->Dump(1, "Start WinLose::Setup");

	if(bGlobal.storyLine == NETGAME && !bGlobal.netDisconnect)
		mode = M_MODELESS;
	else
		mode = M_MODAL;

	oldMouseResType = pMouse->GetResType();
	oldMouseResNum = pMouse->GetResNum();
	oldMouseCel = pMouse->GetCel();
	pMouse->SetRes(RES_ANIM,POINTER_RES,1);
	oldMouseLimits.Copy(&pMouse->mouseLimits);

	TRACK_MEM("WinLose: background anim");
	gbackAnim = ALoad(RES_ANIM,50);
	pbackAnimCH = (CelHeader*) AGetResData(gbackAnim);
	// os-mac stuff is for this screen to be centered. since
	// the blue/grey fadeTo doesn't work the first time in and
	// it looks funny to have the screen in the top left
	#ifdef OS_MAC
		extern bool startup_game;
		int xCoord;
		int yCoord;
		if (startup_game)
		{
			xCoord = 160 - (pbackAnimCH->width/2);
			yCoord = 200 - (pbackAnimCH->height/2);
			rback.Set(xCoord,yCoord,xCoord-1+pbackAnimCH->width,yCoord-1+pbackAnimCH->height);
		}
		else
			//rback.Set(0,0,pbackAnimCH->width-1,pbackAnimCH->height-1);
			rback.Set(WINLOSE_WIN_X+0,WINLOSE_WIN_Y+0,WINLOSE_WIN_X+pbackAnimCH->width-1,WINLOSE_WIN_Y+pbackAnimCH->height-1);
	#else
		//rback.Set(0,0,pbackAnimCH->width-1,pbackAnimCH->height-1);
		rback.Set(WINLOSE_WIN_X+0,WINLOSE_WIN_Y+0,WINLOSE_WIN_X+pbackAnimCH->width-1,WINLOSE_WIN_Y+pbackAnimCH->height-1);
	#endif

	//======================================================
	// setup background cel filled with black
	TRACK_MEM("WinLose: background cel");
	gback = ACreateCel(&rNumBack,0,0,pbackAnimCH->width,pbackAnimCH->height,CI_BLACK,WINLOSE_BASE_PRI);
	pback = AGetResData(gback);
	pbackCH = (CelHeader*)pback;

	//copy backAnim into our dynamic cel -this way we can still write direct
	CopyCel(pbackCH,0,0,RES_ANIM,50,1,FALSE);

	pGuy = &back;
	pGuy->SetRes(RES_CEL,rNumBack);
	#ifdef OS_MAC
		if(startup_game)
			pGuy->SetPos(xCoord,yCoord);
		else
			pGuy->SetPos(WINLOSE_WIN_X,WINLOSE_WIN_Y);
	#else
		pGuy->SetPos(WINLOSE_WIN_X,WINLOSE_WIN_Y);
	#endif
	pGuy->SetContext(gSelf);
	pGuy->Setup(CT_ROST);
	pGuy->SetPri(WINLOSE_BASE_PRI);

	pGuy = &topBorder;
	pGuy->SetRes(RES_ANIM,116,5);
	pGuy->SetPos(0,0);
	pGuy->SetContext(gSelf);
	pGuy->Setup(CT_ROST);
	pGuy->SetPri(WINLOSE_BASE_PRI-20);

	pGuy = &sideBorder;
	pGuy->SetRes(RES_ANIM,118,1);
	pGuy->SetPos(0,25);
	pGuy->SetContext(gSelf);
	pGuy->Setup(CT_ROST);
	pGuy->SetPri(WINLOSE_BASE_PRI-19);

	pMouse->SetLimits(&rback);

	//need to get these new interface pieces onto the screen BEFORE
	//the do the screen capture and fade down
	AAnimate();

	//======================================================
	// 0 percent fade down -just remaps colors to blue-gray range.
	fadeTo.Setup(320,400,WINLOSE_BASE_PRI - 10,gSelf,gPal,0,&rback);

	//===============================================================
	char		winText[100],loseText[100];
	int		winNum,loseNum;

	sqbRes = WINLOSE_SQB;

	// load generic "front-end" used in all phrases
	pTxt = sqbWinLose.Load(sqbRes,1);
	strcpy(winText,pTxt);
	pTxt = sqbWinLose.Load(sqbRes,2);
	strcpy(loseText,pTxt);

	struct WinningCondition	*pWinCon;

	//defaults
	winNum  = atoi(pBam->scenarioName);
	loseNum = winNum + 1;

	if((bGlobal.storyLine == LEGEND && winNum != 9410) ||
		bGlobal.storyLine == NETGAME)
	{
		winNum  = 10;
		loseNum = 20;

		for(i=0;i<MAX_WINCONS;i++)
		{
			pWinCon = &pWorld->winCons[i];

			if(pWinCon->targetSpec == BUILDING &&
				pWinCon->structSpec	== FUNC_KEEP)
			{
				if(pWinCon->ownerSide == pBam->playerSide)
					winNum  = 11;

				if(pWinCon->ownerSide == ((pBam->playerSide==SIDE1)?SIDE2:SIDE1))
					loseNum = 21;
			}
		}
	}

	pTxt = sqbWinLose.Load(sqbRes,winNum);
	strcat(winText," ");
	strcat(winText,pTxt);
	pTxt = sqbWinLose.Load(sqbRes,loseNum);
	strcat(loseText," ");
	strcat(loseText,pTxt);

	pBam->voiceChains = 0;
	pBam->voice1.Stop();
	pBam->LaunchVoice(WINLOSE_SQB,winNum,WINLOSE_SQB,loseNum);

	//==================================================
	SetFontColors(CI_SKIP,94,102,94,102,156,144);

	int savePoint;
	savePoint = pFontMgr->point;
	pFontMgr->point = 14;

	ASetString(85, 48, winText, pback,102, NULL);
	ASetString(85, 137, loseText,pback,102, NULL);

	pFontMgr->point = savePoint;

	//==================================================
	//copy borders into background cel
	if(bGlobal.storyLine != LEGEND && bGlobal.storyLine != NETGAME)
	{
		CopyCel(pbackCH,35, 35,RES_ANIM,50,2,TRUE);	// Portrait Border 1
		CopyCel(pbackCH,35,123,RES_ANIM,50,2,TRUE);	// Portrait Border 2
	}
	else
	{
		CopyCel(pbackCH,35,77,RES_ANIM,50,2,TRUE);	// Portrait Border 2
	}

	if(bGlobal.storyLine == STORYLINE4)
	{
		CopyCel(pbackCH,35,212,RES_ANIM,50,4,TRUE);	// 'Done' button frame
		CopyCel(pbackCH,92,212,RES_ANIM,50,3,TRUE);	// 'Undone' button frame
	}
	else
	{
		CopyCel(pbackCH,64,212,RES_ANIM,50,3,TRUE);	// 'Done' w/undone button frame
	}

	if(bGlobal.storyLine != LEGEND && bGlobal.storyLine != NETGAME)
	{
		portNum = GetPortraitAnim(bGlobal.chooseSide,TRUE);
		CopyCel(pbackCH,37,38,RES_ANIM,portNum,3,TRUE); //VICTORY
		CopyCel(pbackCH,37,126,RES_ANIM,portNum,2,TRUE); //DEFEAT
	}
	else
	{
		//Load portrait
		CopyCel(pbackCH,37,80,RES_ANIM,bGlobal.curBodyAnim,1,TRUE);	// Body
		CopyCel(pbackCH,37,80,RES_ANIM,bGlobal.curFaceAnim,1,TRUE);	// Face
		CopyCel(pbackCH,37,80,RES_ANIM,bGlobal.curCoverAnim,1,TRUE);	// Cover
	}

	
	pButton = &buttonDone;
	if(bGlobal.storyLine == STORYLINE4)
		#ifdef OS_MAC
			if(startup_game)
				pButton->Create(37+xCoord, 215+yCoord, WINLOSE_BASE_PRI + 1, RES_ANIM, 8158, 1, gSelf, xCoord, yCoord);
			else
				pButton->Create(WINLOSE_WIN_X+37, WINLOSE_WIN_Y+215, WINLOSE_BASE_PRI + 1, RES_ANIM, 8158, 1, gSelf, WINLOSE_WIN_X, WINLOSE_WIN_Y);
		#else
			pButton->Create(WINLOSE_WIN_X+37, WINLOSE_WIN_Y+215, WINLOSE_BASE_PRI + 1, RES_ANIM, 8158, 1, gSelf, WINLOSE_WIN_X, WINLOSE_WIN_Y);
		#endif
	else
		#ifdef OS_MAC
			if(startup_game)
Пример #13
0
void RenderDITLTextButton( DITLItem *theItem )
{
short			pixelWidth;
short			clipWidth;
short			xCenter;
short			xLeft;
short			xCharOffset;
short			yCharOffset;
TextButtonDesc	*theTextButt;
segaCharRect	textRect;
short			cellWidth;
short			oldFont;
TextButtGraphicsPriv *	state;
AnimationRef	animation;
short			height;
short			adjheight;
char			*frameSequence;

	state = (TextButtGraphicsPriv *) theItem->refCon;
	if ( !state )
		return;
//
// Draw the bitmap
//
	
	theTextButt = (TextButtonDesc *)theItem->objectData;

	if( theTextButt->animationData.bitmap == 0 )
		return;
	
	state->buttonID = theTextButt->buttonID;
	state->currentFrame = 0;
	state->x = theTextButt->animationData.xPos/8;
	state->y = theTextButt->animationData.yPos/8;
	frameSequence = DBGetItem( kButtonSequenceType, theTextButt->buttonID );
	if (frameSequence)
	{
		state->frameCount = *(short *)frameSequence;
		state->frameSequence = frameSequence+sizeof(short);
	}
	else
	{
		state->frameSequence = nil;
	}
	
	state->fxSequence = DBGetItem( kButtonSequenceFXType, theTextButt->buttonID );
	
	SetCurrentDevice( kScrollA );
	state->buttReference = DrawGraphic( theTextButt->animationData.bitmap, theTextButt->animationData.xPos/8, theTextButt->animationData.yPos/8, 0, 0, 0 );
//
// Figure out how to draw the text using the info in the refCon
//
	
	clipWidth = theTextButt->pixelWidth;

	state->textSprite = 0;
	if( theTextButt->myCString[0] != 0 )
	{

		oldFont = GetCurFont ();
		SetCurFont ( ((TextButtonDesc *) theItem->objectData)->font );

		pixelWidth = MeasureSegaText( theTextButt->myCString );

		if ( theTextButt->textXCenter == 0 )
		{
			xLeft = theTextButt->animationData.bitmap->width << 2;
		}
		else
		{
			xLeft = theTextButt->textXCenter;
		}
			
		xLeft += theItem->xPos;
		xLeft -= (pixelWidth >> 1);

		cellWidth = ( (pixelWidth+7) + (xLeft & 7) ) >> 3;
		cellWidth = (cellWidth+3) & ~3;

		textRect.left = xLeft>>3;
		textRect.right = textRect.left + cellWidth;
		
		if ( theTextButt->textYTop == 0 )
		{
			textRect.top = theTextButt->animationData.bitmap->height;
		}
		else
		{
			textRect.top = ( theTextButt->textYTop + 4 ) >> 3;
		}
			
		textRect.top += (theItem->yPos >> 3);
		height = GetCurFontHeight();
		adjheight = height >> 3;
		if ( (adjheight << 3) < height )
			adjheight++;
		textRect.bottom = textRect.top + adjheight;
		
		SetCurrentDevice( kScrollA );
		state->textSprite = CreateTextSprite( &textRect, 0 );
		
		if (state->textSprite)
		{
			SetFontColors( theTextButt->color0, theTextButt->color1, theTextButt->color2, theTextButt->color3 );
			DrawClippedSegaText( 0, 0, clipWidth, theTextButt->myCString );
			MoveSprite( state->textSprite, xLeft+128, (textRect.top<<3) + 128);
			DrawSprite( state->textSprite );
		}
		
		SetCurFont ( oldFont );
	}
Пример #14
0
void
NetStory::CycleEnemy()
{
	coord			celOffX,celOffY;
	BAM_Guy		*pGuy,*pOutGuy;
	uchar			color;
	bool			found=FALSE;
	uint32		calcGuy,x;
	CelHeader	*pEnemyTitle;

	if(!enemyHasSelected)
	{
		// now lets check the storyline regions
		for(x=0; x<NETMAXSTORYGUYS; x++)
		{
			pGuy = &storyGuy[x];

			if (pGuy->scrim.rect.Contains(enemyCurX,enemyCurY))
			{
				celOffX = enemyCurX - pGuy->scrim.rect.x1;
				celOffY = enemyCurY - pGuy->scrim.rect.y1;
				color = GetPixel(celOffX, celOffY, pGuy->scrim.resType, 
								pGuy->scrim.resNum, pGuy->scrim.cel);
				if (color != CI_SKIP) //we found it
				{
					found = TRUE;

					calcGuy = x;

					if (calcGuy != enemyCurrentGuy) //if new guy
					{
						if (pMono)
							pMono->Out("\nRegion is %2d, StoryLine is %d",x,GetStory(x));

						// cut old storyGuy only if there is one and un-enemy
						// isn't using it
						if (enemyCurrentGuy != -1 && enemyCurrentGuy != currentGuy)
						{
							pOutGuy = &storyGuy[enemyCurrentGuy];
							pOutGuy->fIsActive = FALSE;
							CutObject(pOutGuy->gSelf, CT_SERV | CT_ROST);
						}

						enemyCurrentGuy = calcGuy;

						// add new region outline unless enemy has the region alread active
						if(enemyCurrentGuy != currentGuy)
						{
							pOutGuy = &storyGuy[calcGuy];
							pOutGuy->fIsActive = TRUE;
							AddObject(pOutGuy->gSelf, CT_SERV | CT_ROST);
						}

						pEnemyTitle = (CelHeader *)AGetResData(gEnemyTitle);

						// clear region name
						memset(((uchar*)pEnemyTitle)+sizeof(CelHeader),SKIP_COLOR,L2R(pEnemyTitle->width) * pEnemyTitle->height);

						pFontMgr->SetRes(9050);
						SetFontColors(CI_SKIP,93,90,93,90,93,90);

						//startup new region name
						ASetString(0,0,storyNames[calcGuy], (uchar *)pEnemyTitle, pEnemyTitle->width, NULL, DG_JUST_CENTER);
						enemyTitle.SetPos(titlePos[enemyCurrentGuy*2],titlePos[enemyCurrentGuy*2+1]);
						break;
					}
				}//endif
			}//endif
		}//endfor

		//cursor outside of all guys and not used by un-enemy -shutdown current guy
		if(!found && enemyCurrentGuy != -1 && enemyCurrentGuy != currentGuy)
		{
			pOutGuy = &storyGuy[enemyCurrentGuy];
			pOutGuy->fIsActive = FALSE;
			CutObject(pOutGuy->gSelf, CT_SERV | CT_ROST);

			enemyCurrentGuy = -1;

			//shutdown last region name
			pEnemyTitle = (CelHeader *)AGetResData(gEnemyTitle);
			memset(((uchar*)pEnemyTitle)+sizeof(CelHeader),SKIP_COLOR,L2R(pEnemyTitle->width) * pEnemyTitle->height);
			enemyTitle.SetState(S_CHANGED, TRUE);
		}
	}
}
Пример #15
0
bool
BAM_Application::HandleMsg(Message* pMsg)
{
 	BAM_TeleportPopup *pTeleport;


	switch(pMsg->type)
	{
		case MSG_NOTICE:
			switch(pMsg->notice.type)
			{
				case N_QUIT:
					return(TRUE);
			}
			break;

		case MSG_EVENT:
			switch (pMsg->event.type)
			{
				case E_KEY_DOWN:
					switch(pMsg->event.value)
					{
						case K_X:
							#ifndef NDEBUG
							if(pMsg->event.modifiers & MOD_ALT)
								pContextMgr->Quit();
							#endif
							break;

						case K_ESC:
							Quit();
							return(TRUE);

						#ifndef NDEBUG
						case K_Z:
							//saveNum = 1;
							if(pMono->suspended)
								pMono->Resume();
							else pMono->Suspend();
							break;

						case K_Y:
							//restoreNum = 1;
							break;

						case K_F4:
							//one screen capture

							if(!bGlobal.gSnap)
							{
								if(!pWorld || (pWorld && bGlobal.storyLine != NETGAME))
								{
									//lets setup for screen snapping (capture)
									TRACK_MEM("Snap");	pSnap = new Snap;
									bGlobal.gSnap = pSnap->gSelf;
								}
							}

							//no single shots while snap is toggled on
							if(!pSnap->snapOn)
								pSnap->SingleScreen();

							//delete snap alloc -now elsewhere
							//if(bGlobal.gSnap)
							//{
							//	ADelete(bGlobal.gSnap);
							//	bGlobal.gSnap = 0;
							//}

							return(TRUE);

						//case K_F6:
							////toggle on/off screen snap
							//
							//if(!bGlobal.gSnap)
							//{
							//	//lets setup for screen snapping (capture)
							//	TRACK_MEM("Snap");	pSnap = new Snap;
							//	bGlobal.gSnap = pSnap->gSelf;
							//}
							//
							//if(pSnap->snapOn)
							//	pSnap->StopSnap();
							//else
							//	pSnap->StartSnap();
						//	return(TRUE);

						case K_F10:
							SetFontColors(CI_SKIP,93,90);
							// teleport
							TRACK_MEM("teleport"); pTeleport = new BAM_TeleportPopup;
							pTeleport->Setup(OPTION_SQB,38);
							return(TRUE);

						case K_F11:
							SetFontColors(CI_SKIP,93,90);
							// RUN CINEMATIC NUMBER?
							//can only use this from main menu
							if(bGlobal.roomMgr.curRoomNum == BR_MENU)
							{
								bGlobal.roomMgr.prevRoomMode = 0;
								bGlobal.roomMgr.newRoomMode = 1;
								TRACK_MEM("telecine"); pTeleport = new BAM_TeleportPopup;
								pTeleport->Setup(OPTION_SQB,53);
							}
							return(TRUE);

						case	K_PRINT_SCREEN:
//							if (!ki_debugging)
//							{
//								#pragma aux ENTER_DEBUG =		\
//									"int	3";
//								ENTER_DEBUG();
//							}
							return(TRUE);
							#endif
					}
			}
	}
	return(Context::HandleMsg(pMsg));
}
Пример #16
0
long XSetupSetup( ScreenParams *params )
{
XSetupGlobals	*setup;
Point 			*xPosition;
segaCharRect	jizzleRect;
char			*phoneString;
phoneNumber		*local1, *local2;

	setup = (XSetupGlobals *)NewMemory( kTemp, sizeof(XSetupGlobals) );
	
	EraseGDevice ( kScrollA );
	SetBackdropID ( kBlackBackground, true, 0 );
	SetCurrentDevice( kScrollA );

	SetCurFont( kXBandHeavy );
	SetFontColors( 0, kDarkYellowColor, kYellowColor, 0 );
	setup->titlePatterns = DrawScreenLayoutString( kXBandSetupScreen, kSetupTitleString );
	setup->bgGraphic = DrawDBGraphicAt( 0, kSettingsIcon, 29, 2, kScrollA );
	setup->lineGraphic = DrawDBGraphicAt( 0, kGrayHorizontalLine, 5, 18, kScrollA );
	
	GetScreenLayoutCharRect( kXBandSetupScreen, 0, &jizzleRect );
	setup->jizzle = DrawTextBox( &jizzleRect, 8, kScrollA );
	StartTextBoxAnimation( setup->jizzle, 10 );

	GetScreenLayoutCharRect( kXBandSetupScreen, kSetupDescriptionRect, &setup->descriptionRect );
	setup->descriptionPatterns = LinearizeScreenArea( &setup->descriptionRect, 0 );

// Accept Challenges:
	setup->radioRefs[kAcceptChallengesButton] = SetupRadioButton( kAcceptChallengesButton+1, phoneString );
	RadioButtonSetSelection(setup->radioRefs[kAcceptChallengesButton], GetAcceptChallengesOption( GetCurUserID() ) );
	DrawRadioButton( setup->radioRefs[kAcceptChallengesButton] );

// Call Waiting:
	setup->radioRefs[kCallWaitingButton] = SetupRadioButton( kCallWaitingButton+1, nil );
	RadioButtonSetSelection(setup->radioRefs[kCallWaitingButton], GetCallWaitingOption( GetCurUserID() ) );
	DrawRadioButton(setup->radioRefs[kCallWaitingButton]);

// Calling From:
	phoneString = (char *) GetBoxPhoneNumber()->phoneNumber;
	GetLocalAccessPhoneNumber(&local1, &local2);
	if ( local1->phoneNumber[0] == 0 )
	{
		phoneString = GetSegaString(kBoxPhoneNumber);
		setup->newPhoneNumber = true;
	}
	else
		setup->newPhoneNumber = false;
		
	setup->radioRefs[kIMovedButton] = SetupRadioButton( kIMovedButton+1, phoneString );
	RadioButtonSetSelection(setup->radioRefs[kIMovedButton],
								setup->newPhoneNumber || GetIMovedOption() );
	DrawRadioButton( setup->radioRefs[kIMovedButton] );

// Keyboard Type:
	setup->radioRefs[kKeyboardButton] = SetupRadioButton( kKeyboardButton+1, nil );
	RadioButtonSetSelection(setup->radioRefs[kKeyboardButton], GetQwertyKeyboardOption( GetCurUserID() ) );
	DrawRadioButton( setup->radioRefs[kKeyboardButton] );

// Set active button
	setup->activeButton = kAcceptChallengesButton;
	ActivateRadioButton(setup->radioRefs[setup->activeButton]);
	VDPIdle();

// Set up the DITL
	setup->theDitlList = SetupDITLItemList( kXBandSetupScreen );	
	setup->myControlTable = SetupControlTable( kXBandSetupScreen );
	NewDITL( setup->myControlTable, setup->theDitlList );

// Invalidate the description text
	setup->descriptionInvalid = true;
	
	return (long) setup;
}
Пример #17
0
void	
NetStory::Cycle(void)
{
	coord			celOffX,celOffY;
	BAM_Guy		*pGuy,*pOutGuy;
	BAM_ErrorPopup		*pPop;
	uchar			color;
	bool			found=FALSE;
	uint32		calcGuy,x;
	CelHeader	*ptitle;
	clock_t		newTime;

	clock_t		charTime=0;

	theX = pMouse->GetX();
	theY = pMouse->GetY();
	newTime = clock();

	if(!hasSelected)
	{
		// now lets check the storyline regions
		for(x=0; x<NETMAXSTORYGUYS; x++)
		{

			pGuy = &storyGuy[x];

			if (pGuy->scrim.rect.Contains(theX,theY))
			{
				celOffX = theX - pGuy->scrim.rect.x1;
				celOffY = theY - pGuy->scrim.rect.y1;
				color = GetPixel(celOffX, celOffY, pGuy->scrim.resType, 
								pGuy->scrim.resNum, pGuy->scrim.cel);
				if (color != CI_SKIP) //we found it
				{
					found = TRUE;

					calcGuy = x;

					if (calcGuy != currentGuy) //if new guy
					{
						if (pMono)
							pMono->Out("\nRegion is %2d, StoryLine is %d",x,GetStory(x));

						// cut old storyGuy only if there is one and the enemy
						// isn't using it
						if (currentGuy != -1 && currentGuy != enemyCurrentGuy)
						{
							pOutGuy = &storyGuy[currentGuy];
							pOutGuy->fIsActive = FALSE;
							CutObject(pOutGuy->gSelf, CT_SERV | CT_ROST);
						}

						currentGuy = calcGuy;

						// add new region outline unless enemy has the region alread active
						if(currentGuy != enemyCurrentGuy)
						{
							pOutGuy = &storyGuy[calcGuy];
							pOutGuy->fIsActive = TRUE;
							AddObject(pOutGuy->gSelf, CT_SERV | CT_ROST);
						}

						ptitle = (CelHeader *)AGetResData(gtitle);

						// clear region name
						memset(((uchar*)ptitle)+sizeof(CelHeader),SKIP_COLOR,L2R(ptitle->width) * ptitle->height);

						pFontMgr->SetRes(9050);
						SetFontColors(CI_SKIP,93,90,93,90,93,90);

						//startup new region name
						ASetString(0,0,storyNames[calcGuy], (uchar *)ptitle, ptitle->width, NULL, DG_JUST_CENTER);
						title.SetPos(titlePos[currentGuy*2],titlePos[currentGuy*2+1]);
						break;
					}
				}//endif
			}//endif
		}//endfor

		//cursor outside of all guys and not used by enemy -shutdown current guy
		if(!found && currentGuy != -1 && currentGuy != enemyCurrentGuy)
		{
			pOutGuy = &storyGuy[currentGuy];
			pOutGuy->fIsActive = FALSE;
			CutObject(pOutGuy->gSelf, CT_SERV | CT_ROST);

			currentGuy = -1;

			//shutdown last region name
			ptitle = (CelHeader *)AGetResData(gtitle);
			memset(((uchar*)ptitle)+sizeof(CelHeader),SKIP_COLOR,L2R(ptitle->width) * ptitle->height);
			title.SetState(S_CHANGED, TRUE);
		}
	}
	else //no more selecting just show next region in path or wrap up.
	{
		if(newTime > flagFlashTimer)
		{
			if (flashToggle)
			{
				flashToggle=0;
				flagGuy[currentGuy].Hide();
			}
			else
			{
		 		flashToggle++;
				flagGuy[currentGuy].Show();
			}
			flagFlashTimer = newTime + FLASH_INTERVAL;
		}
	}

	//===========================================================
	// cycle anthing else
	BAM_Room::Cycle();

	//===========================================================
	if(!SyncWithRemote())
	{
		if(!bGlobal.netDisconnect)
		{
			pMono->Out("NetStory::Cycle() - !SyncWithRemote()\n");

			bGlobal.storyLine = STORY_NONE;
			pCommMgr->Disconnect();
			bGlobal.netDisconnect = TRUE;
			bGlobal.roomMgr.newRoomMode = MM_MENU_DOUBLE;

			TRACK_MEM("BAM_ErrorPopup");	pPop = new BAM_ErrorPopup;
			pPop->SetMode(M_MODAL);
			pPop->Setup(pal.gSelf,OPTION_SQB,errorSqbNum,BR_MENU);//"connection has failed"
		}
		return;
	}

	//===========================================================
	//set enemy marker


	CycleEnemy();

	if(enemyHasSelected)
	{
		if(newTime > enemyFlagFlashTimer)
		{
			if (enemyFlashToggle)
			{
				enemyFlashToggle=0;
				enemyFlagGuy[enemyCurrentGuy].Hide();
			}
			else
			{
		 		enemyFlashToggle++;
				enemyFlagGuy[enemyCurrentGuy].Show();
			}
			enemyFlagFlashTimer = newTime + FLASH_INTERVAL;
		}
	}


	//===========================================================
	if(hasSelected && enemyHasSelected && (currentGuy == enemyCurrentGuy))
	{
		//if we've synced a new rand lets use it
		if(syncedRand)
			ASeedRandom(newRand);
		else
			ASeedRandom(curRand);

		// wait a second for lingering packets to be ACKed (so no one has to
		// timeout) - Van
		ticks_t tWait = ATicks() + TICKS_PER_SEC / 2;
		while(ATicks() < tWait)
		{
			// we wont send anything, but make it possible to ACK leftover
			// packets sent to us
			UpdateTicks();
			pCommMgr->DataAvailable();
		}

		//lets sync tick counters
		ASetTicks(1001);

		int scenarioArr[15] = {
									9112,9132,9152,
									9172,9192,9212,
									9232,9252,9272,
									9292,9312,9332,
									9352,9372,9392,
									};

		int tmpNum = scenarioArr[currentGuy];

		sprintf(pBam->scenarioName,"%d",tmpNum);

		bGlobal.roomMgr.NewRoom(BR_WORLD);
		worldEnder = TRUE;
	}
}