コード例 #1
0
ファイル: history.c プロジェクト: gondur/jagged-alliance-2.5
void DisplayHistoryListHeaders( void )
{
  // this procedure will display the headers to each column in History
  UINT16 usX, usY;

	// font stuff
	SetFont(HISTORY_TEXT_FONT);
  SetFontForeground(FONT_BLACK);
	SetFontBackground(FONT_BLACK);
	SetFontShadow(NO_SHADOW); 
  
  // the date header
  FindFontCenterCoordinates(RECORD_DATE_X + 5,0,RECORD_DATE_WIDTH,0, pHistoryHeaders[0], HISTORY_TEXT_FONT,&usX, &usY);
	mprintf(usX, RECORD_HEADER_Y, pHistoryHeaders[0]);
	
	// the date header
  FindFontCenterCoordinates(RECORD_DATE_X + RECORD_DATE_WIDTH + 5,0,RECORD_LOCATION_WIDTH,0, pHistoryHeaders[ 3 ], HISTORY_TEXT_FONT,&usX, &usY);
	mprintf(usX, RECORD_HEADER_Y, pHistoryHeaders[3]);

	// event header
  FindFontCenterCoordinates(RECORD_DATE_X + RECORD_DATE_WIDTH + RECORD_LOCATION_WIDTH + 5,0,RECORD_LOCATION_WIDTH,0, pHistoryHeaders[ 3 ], HISTORY_TEXT_FONT,&usX, &usY);
	mprintf(usX, RECORD_HEADER_Y, pHistoryHeaders[4]);
	// reset shadow
	SetFontShadow(DEFAULT_SHADOW);
	return;
}
コード例 #2
0
ファイル: DropDown.cpp プロジェクト: RadekSimkanic/JA2-1.13
void
DropDownBase::DrawSelectedCity()
{
	UINT16 usPosY = musStartY_Drop;
	UINT16 usMaxY = 0;

	// make sure we dont go out of our array
	if( mFirstShownEntry+mNumDisplayedEntries > (UINT8)(mEntryVector.size() ) )
		mFirstShownEntry = mEntryVector.size() - mNumDisplayedEntries;
	
	for( UINT8 i = mFirstShownEntry; i < mFirstShownEntry+mNumDisplayedEntries; ++i)
	{
		usMaxY = min(usPosY+musFontHeight+2, musStartY_Drop + musAreaHeight - 4);

		if ( i == mSelectedEntry )
		{
			ColorFillVideoSurfaceArea( FRAME_BUFFER, musStartX_Drop+4, usPosY-2, musStartX_Drop+musWidth-4,	usMaxY, mColorMarked );
			SetFontShadow(NO_SHADOW);
			DrawTextToScreen( mEntryVector[i].second, musStartX_Drop+CITY_NAME_OFFSET, usPosY, 0, DEF_DROPDOWN_FONT, FONT_BLACK, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED	);
			SetFontShadow(DEFAULT_SHADOW);
		}
		else
		{
			ColorFillVideoSurfaceArea( FRAME_BUFFER, musStartX_Drop+4, usPosY-2, musStartX_Drop+musWidth-4,	usMaxY, Get16BPPColor( FROMRGB( 0, 0, 0 ) ) );
			DrawTextToScreen( mEntryVector[i].second, musStartX_Drop+CITY_NAME_OFFSET, usPosY, 0, DEF_DROPDOWN_FONT, STATIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED	);
		}

		usPosY += musFontHeight + 4;
	}
}
コード例 #3
0
ファイル: insurance Info.c プロジェクト: bowlofstew/ja2
void RenderInsuranceInfo()
{
	wchar_t		sText[800];
	UINT16 usNewLineOffset = 0;
	UINT16		usPosX;

	DisableArrowButtonsIfOnLastOrFirstPage();

	DisplayInsuranceDefaults();

	SetFontShadow( INS_FONT_SHADOW );


	//Display the red bar under the link at the bottom
	DisplaySmallRedLineWithShadow( INS_INFO_SUBTITLE_X, INS_INFO_SUBTITLE_LINE_Y, INS_INFO_SUBTITLE_X+INS_INFO_SUBTITLE_LINE_WIDTH, INS_INFO_SUBTITLE_LINE_Y);

	switch( gubCurrentInsInfoSubPage )
	{
		case INS_INFO_INFO_TOC:
			DisplayInfoTocPage();
			break;

		case INS_INFO_SUBMIT_CLAIM:
			DisplaySubmitClaimPage();
			break;

		case INS_INFO_PREMIUMS:
			DisplayPremiumPage();
			break;

		case INS_INFO_RENEWL:
			DisplayRenewingPremiumPage();
			break;

		case INS_INFO_CANCELATION:
			DisplayCancelationPagePage();
			break;
	}

	usPosX = INS_INFO_LINK_START_X;

	//Display the red bar under the link at the bottom.  and the text
	DisplaySmallRedLineWithShadow( usPosX, INS_INFO_LINK_TO_CONTRACT_Y, (UINT16)(usPosX+INS_INFO_LINK_TO_CONTRACT_WIDTH), INS_INFO_LINK_TO_CONTRACT_Y);
	swprintf( sText, L"%s", pMessageStrings[ MSG_HOMEPAGE ] ); 
	DisplayWrappedString( usPosX, INS_INFO_LINK_TO_CONTRACT_TEXT_Y+14, INS_INFO_LINK_TO_CONTRACT_WIDTH, 2, INS_FONT_MED, INS_FONT_COLOR,  sText, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED);
	usPosX += INS_INFO_LINK_START_OFFSET + INS_INFO_LINK_TO_CONTRACT_WIDTH;

	//Display the red bar under the link at the bottom.  and the text
	DisplaySmallRedLineWithShadow( usPosX, INS_INFO_LINK_TO_CONTRACT_Y, (UINT16)(usPosX+INS_INFO_LINK_TO_CONTRACT_WIDTH), INS_INFO_LINK_TO_CONTRACT_Y);
	GetInsuranceText( INS_SNGL_TO_ENTER_REVIEW, sText );
	DisplayWrappedString( usPosX, INS_INFO_LINK_TO_CONTRACT_TEXT_Y, INS_INFO_LINK_TO_CONTRACT_WIDTH, 2, INS_FONT_MED, INS_FONT_COLOR,  sText, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED);


	SetFontShadow(DEFAULT_SHADOW);

  MarkButtonsDirty( );
	RenderWWWProgramTitleBar( );
  InvalidateRegion(LAPTOP_SCREEN_UL_X,LAPTOP_SCREEN_WEB_UL_Y,LAPTOP_SCREEN_LR_X,LAPTOP_SCREEN_WEB_LR_Y);
}
コード例 #4
0
ファイル: aim.cpp プロジェクト: jikuja/JA2-1.13
void HandleTextOnAimAdd( UINT8 ubCurSubImage )
{
	switch( gubCurrentAdvertisment )
	{
		case 	AIM_AD_WARNING_BOX:
			break;

		case AIM_AD_FLOWER_SHOP:
			break;

		case AIM_AD_FOR_ADS:
			break;

		case AIM_AD_INSURANCE_AD:
			break;

		case AIM_AD_FUNERAL_ADS:
			break;

		case AIM_AD_BOBBY_RAY_AD:

			//if the subimage is the first couple
			if( ubCurSubImage <= AIM_AD_BOBBYR_AD_NUM_DUCK_SUBIMAGES )
			{
				//Display Aim Warning Text
				SetFontShadow( 2 );
				DisplayWrappedString(AIM_BOBBYR1_LINK_TEXT_X, AIM_BOBBYR1_LINK_TEXT_Y, AIM_WARNING_TEXT_WIDTH, 2, BOBBYR_UNDER_CONSTRUCTION_AD_FONT, BOBBYR_UNDER_CONSTRUCTION_AD_COLOR, AimScreenText[AIM_BOBBYR_ADD1], FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED | INVALIDATE_TEXT );
				SetFontShadow( DEFAULT_SHADOW );
			}


			else if( ubCurSubImage >= AIM_AD_BOBBYR_AD__NUM_SUBIMAGES-5 )
			{
				//Display Aim Warning Text
				SetFontShadow( 2 );
				DisplayWrappedString(AIM_BOBBYR2_LINK_TEXT_X, AIM_BOBBYR2_LINK_TEXT_Y, AIM_WARNING_TEXT_WIDTH, 2, BOBBYR_UNDER_CONSTRUCTION_AD_FONT, BOBBYR_UNDER_CONSTRUCTION_AD_COLOR, AimScreenText[AIM_BOBBYR_ADD2], FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED | INVALIDATE_TEXT ) ;
				SetFontShadow( DEFAULT_SHADOW );
			}
/*
			else
			{
				//Display Aim Warning Text
				SetFontShadow( 2 );
//				DisplayWrappedString( AIM_BOBBYR3_LINK_TEXT_X, AIM_BOBBYR3_LINK_TEXT_Y, AIM_WARNING_TEXT_WIDTH, 2, BOBBYR_UNDER_CONSTRUCTION_AD_FONT, FONT_MCOLOR_WHITE, AimScreenText[AIM_BOBBYR_ADD3], FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED | INVALIDATE_TEXT );
				SetFontShadow( DEFAULT_SHADOW );
			}
*/
			break;
	}
}
コード例 #5
0
void Print8CharacterOnlyString( void )
{

	SetFontBackground( FONT_BLACK );
	SetFontForeground( FONT_BLACK );
	SetFont( FONT12ARIAL );
	SetFontShadow(NO_SHADOW);	

	mprintf(430, LAPTOP_SCREEN_WEB_DELTA_Y + 228,pIMPBeginScreenStrings[ 0 ]);

	// reset shadow
	SetFontShadow(DEFAULT_SHADOW);	


}
コード例 #6
0
ファイル: DropDown.cpp プロジェクト: RadekSimkanic/JA2-1.13
void
DropDownBase::DrawTopEntry()
{
	// make sure we don't get bogus values
	mSelectedEntry = min(mSelectedEntry, mEntryVector.size() - 1);
		
	//display the name in the list
	ColorFillVideoSurfaceArea( FRAME_BUFFER, musStartX+4, musStartY+4, musStartX+musWidth-4, musStartY+musFontHeight+8, mColorMarked );

	SetFontShadow(NO_SHADOW);

	DrawTextToScreen( mEntryVector[mSelectedEntry].second, musStartX+CITY_NAME_OFFSET, (UINT16)(musStartY+7), 0, DEF_DROPDOWN_FONT, FONT_BLACK, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED	);;

	SetFontShadow(DEFAULT_SHADOW);
}
コード例 #7
0
ファイル: LoadScreen.cpp プロジェクト: infernuslord/ja2
void DrawFileDialog(void)
{
	//dnl ch36 150909
	ColorFillVideoSurfaceArea(FRAME_BUFFER,	iScreenWidthOffset+179, iScreenHeightOffset+69, iScreenWidthOffset+179+281, iScreenHeightOffset+261, Get16BPPColor(FROMRGB(136, 138, 135)));
	ColorFillVideoSurfaceArea(FRAME_BUFFER,	iScreenWidthOffset+180, iScreenHeightOffset+70, iScreenWidthOffset+179+281, iScreenHeightOffset+261, Get16BPPColor(FROMRGB(24, 61, 81)));
	ColorFillVideoSurfaceArea(FRAME_BUFFER,	iScreenWidthOffset+180, iScreenHeightOffset+70, iScreenWidthOffset+179+280, iScreenHeightOffset+260, Get16BPPColor(FROMRGB(65, 79, 94)));
	ColorFillVideoSurfaceArea(FRAME_BUFFER, iScreenWidthOffset+179+4, iScreenHeightOffset+69+3, iScreenWidthOffset+179+4+240, iScreenHeightOffset+69+123, Get16BPPColor(FROMRGB(24, 61, 81)));
	ColorFillVideoSurfaceArea(FRAME_BUFFER, iScreenWidthOffset+179+5, iScreenHeightOffset+69+4, iScreenWidthOffset+179+4+240, iScreenHeightOffset+69+123, Get16BPPColor(FROMRGB(136, 138, 135)));
	ColorFillVideoSurfaceArea(FRAME_BUFFER, iScreenWidthOffset+179+5, iScreenHeightOffset+69+4, iScreenWidthOffset+179+3+240, iScreenHeightOffset+69+122, Get16BPPColor(FROMRGB(250, 240, 188)));

	MarkButtonsDirty();
	RenderButtons();
	RenderButtonsFastHelp();

	SetFont( FONT10ARIAL );
	SetFontForeground( FONT_LTKHAKI );
	SetFontShadow( FONT_DKKHAKI );
	SetFontBackground( FONT_BLACK );
	mprintf( iScreenWidthOffset + 183, iScreenHeightOffset + 217, L"Filename" );
	
	if( iFileDlgButtons[6] != -1 ) 
	{
		mprintf( iScreenWidthOffset + 200, iScreenHeightOffset + 231, L"Update world info" );
	}
}
コード例 #8
0
void DisplayPlayerNickNameString( void )
{

	// this function will grab the string that the player will enter for activation
  INT32 iCounter=0;

	// player gone too far, move back
	if(uiNickNameCharacterPosition > MAX_NICK_NAME)
	{
		uiNickNameCharacterPosition = MAX_NICK_NAME;
	}

	// restore background
	RenderNickNameIndent( 194, 192);

  // setup the font stuff
	SetFont( FONT14ARIAL );
  SetFontForeground( 184 );
	SetFontBackground(FONT_BLACK);


  // reset shadow
	SetFontShadow(DEFAULT_SHADOW);	
  mprintf( LAPTOP_SCREEN_UL_X + 196, NICK_NAME_CURSOR_Y + 4, pNickNameString); 
  
	
	fNewCharInString = FALSE;
  fReDrawScreenFlag = TRUE;
	return;
}
コード例 #9
0
//Kris:
//This is a new function which duplicates the older "yellow info boxes" that
//are common throughout the editor.  This draws the yellow box with the indentation
//look.
void DrawEditorInfoBox( UINT16 *str, UINT32 uiFont, UINT16 x, UINT16 y, UINT16 w, UINT16 h )
{
	UINT16 usFillColorDark, usFillColorLight, usFillColorBack;
	UINT16 x2, y2;
	UINT16 usStrWidth;

	x2 = x + w;
	y2 = y + h;

	usFillColorDark = Get16BPPColor(FROMRGB(24, 61, 81));
	usFillColorLight = Get16BPPColor(FROMRGB(136, 138, 135));
	usFillColorBack = Get16BPPColor(FROMRGB(250, 240, 188));

	ColorFillVideoSurfaceArea(ButtonDestBuffer, x, y, x2, y2, usFillColorDark);
	ColorFillVideoSurfaceArea(ButtonDestBuffer, x + 1, y + 1, x2, y2, usFillColorLight);
	ColorFillVideoSurfaceArea(ButtonDestBuffer, x + 1, y + 1, x2 - 1, y2 - 1, usFillColorBack);

	usStrWidth = StringPixLength( str, uiFont );
	if( usStrWidth > w )
	{ //the string is too long, so use the wrapped method
		y += 1;
		DisplayWrappedString( x, y, w, 2, uiFont, FONT_BLACK, str, FONT_BLACK, TRUE, CENTER_JUSTIFIED );
		return;
	}
	//center the string vertically and horizontally.
	SetFont( uiFont );
	SetFontForeground( FONT_BLACK );
	SetFontShadow( FONT_BLACK );
	x += (w - (UINT16)StringPixLength( str, uiFont )) / 2;
	y += (h - (UINT16)GetFontHeight( uiFont)) / 2;
	mprintf( x, y, L"%s", str );
	InvalidateRegion( x, y, x2, y2 );
}
コード例 #10
0
ファイル: IMP HomePage.c プロジェクト: lchsk/jaggedalliance2
void DisplayPlayerActivationString( void )
{

    // this function will grab the string that the player will enter for activation
    INT32 iCounter=0;

    // player gone too far, move back
    if(iStringPos > 64)
    {
        iStringPos = 64;
    }

    // restore background
    RenderActivationIndent( 257, 328 );

    // setup the font stuff
    SetFont( FONT14ARIAL );
    SetFontForeground( 184 );
    SetFontBackground(FONT_BLACK);


    // reset shadow
    SetFontShadow(DEFAULT_SHADOW);
    mprintf(IMP_PLAYER_ACTIVATION_STRING_X, IMP_PLAYER_ACTIVATION_STRING_Y, pPlayerActivationString);


    fNewCharInActivationString = FALSE;
    fReDrawScreenFlag = TRUE;
    return;
}
コード例 #11
0
ファイル: LoadScreen.c プロジェクト: bowlofstew/ja2
void DrawFileDialog(void)
{
    ColorFillVideoSurfaceArea(FRAME_BUFFER,	179, 69, (179+281), 261, Get16BPPColor(FROMRGB(136, 138, 135)) );
    ColorFillVideoSurfaceArea(FRAME_BUFFER,	180, 70, (179+281), 261, Get16BPPColor(FROMRGB(24, 61, 81)) );
    ColorFillVideoSurfaceArea(FRAME_BUFFER,	180, 70, (179+280), 260, Get16BPPColor(FROMRGB(65, 79, 94)) );

    ColorFillVideoSurfaceArea(FRAME_BUFFER, (179+4), (69+3), (179+4+240), (69+123), Get16BPPColor(FROMRGB(24, 61, 81)) );
    ColorFillVideoSurfaceArea(FRAME_BUFFER, (179+5), (69+4), (179+4+240), (69+123), Get16BPPColor(FROMRGB(136, 138, 135)) );
    ColorFillVideoSurfaceArea(FRAME_BUFFER, (179+5), (69+4), (179+3+240), (69+122), Get16BPPColor(FROMRGB(250, 240, 188)) );

    MarkButtonsDirty();
    RenderButtons();
    RenderButtonsFastHelp();

    SetFont( FONT10ARIAL );
    SetFontForeground( FONT_LTKHAKI );
    SetFontShadow( FONT_DKKHAKI );
    SetFontBackground( FONT_BLACK );
    mprintf( 183, 217, L"Filename" );

    if( iFileDlgButtons[6] != -1 )
    {
        mprintf( 200, 231, L"Update world info" );
    }
}
コード例 #12
0
ファイル: BrokenLink.c プロジェクト: bowlofstew/ja2
void RenderBrokenLink()
{
    //Color fill the laptop white
    DrawBrokenLinkWhiteBackground();

    SetFontShadow( NO_SHADOW );

    //Put up a message saying the link is dead
    DisplayWrappedString(BROKEN_LINK__MESSAGE_X, BROKEN_LINK__MESSAGE_Y, BROKEN_LINK__MESSAGE_WIDTH, 2, BROKEN_LINK__FONT, BROKEN_LINK__COLOR, BrokenLinkText[ BROKEN_LINK_TXT_ERROR_404 ], FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);

    //Put up a message saying the link is dead
    DisplayWrappedString(BROKEN_LINK__MESSAGE_X, BROKEN_LINK__SITE_NOT_FOUND_Y, BROKEN_LINK__MESSAGE_WIDTH, 2, BROKEN_LINK__FONT, BROKEN_LINK__COLOR, BrokenLinkText[ BROKEN_LINK_TXT_SITE_NOT_FOUND ], FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);

    SetFontShadow( DEFAULT_SHADOW );

    InvalidateRegion(0,0,640,480);
}
コード例 #13
0
void RenderDoorLockInfo()
{
	INT16 i, xp, yp;
	INT16 sScreenX, sScreenY;
	CHAR16 str[ 50 ];
	for( i = 0; i < gubNumDoors; i++ )
	{
		GetGridNoScreenPos( DoorTable[ i ].sGridNo, 0, &sScreenX, &sScreenY );
		if( sScreenY > (2 * iScreenHeightOffset + 390) )
			continue;
		if( DoorTable[ i ].ubLockID != 255 )
			swprintf( str, L"%S", LockTable[ DoorTable[ i ].ubLockID ].ubEditorName );
		else
			swprintf( str, iRenderDoorLockInfoText[0] );
		xp = sScreenX - 10;
		yp = sScreenY - 40;
		DisplayWrappedString( xp, yp, 60, 2, FONT10ARIAL, FONT_LTKHAKI, str, FONT_BLACK, TRUE, CENTER_JUSTIFIED );
		if( DoorTable[ i ].ubTrapID )
		{
			SetFont( FONT10ARIAL );
			SetFontForeground( FONT_RED );
			SetFontShadow( FONT_NEARBLACK );
			switch( DoorTable[ i ].ubTrapID )
			{
				case EXPLOSION:
					swprintf( str, iRenderDoorLockInfoText[1] );
					break;
				case ELECTRIC:
					swprintf( str, iRenderDoorLockInfoText[2] );
					break;
				case SIREN:
					swprintf( str, iRenderDoorLockInfoText[3] );
					break;
				case SILENT_ALARM:
					swprintf( str, iRenderDoorLockInfoText[4] );
					break;
				case SUPER_ELECTRIC:
					swprintf( str, iRenderDoorLockInfoText[5] );
					break;
				// WANNE: Fix a vanilla glitch in the editor: The text for the brothel siren trap was missing.
				// Fixed by Tron (Stracciatella): Revision: 6253
				case BROTHEL_SIREN:
					swprintf( str, iRenderDoorLockInfoText[6] );
					break;
			}
			xp = sScreenX + 20 - StringPixLength( str, FONT10ARIAL ) / 2;
			yp = sScreenY;
			mprintf( xp, yp, str );
			swprintf( str, iRenderDoorLockInfoText[7], DoorTable[ i ].ubTrapLevel );
			xp = sScreenX + 20 - StringPixLength( str, FONT10ARIAL ) / 2;
			mprintf( xp, yp+10, str );
		}
	}
}
コード例 #14
0
ファイル: history.c プロジェクト: gondur/jagged-alliance-2.5
void DrawHistoryTitleText( void )
{
	// setup the font stuff
	SetFont(HISTORY_HEADER_FONT);
  SetFontForeground(FONT_WHITE);
	SetFontBackground(FONT_BLACK);
  SetFontShadow(DEFAULT_SHADOW);
	
	// draw the pages title
	mprintf(TITLE_X,TITLE_Y,pHistoryTitle[0]);
  	
	return;
}
コード例 #15
0
ファイル: MPChatScreen.cpp プロジェクト: infernuslord/ja2
void DisplayStringsInChatLogMessageList( void )
{
	UINT8 ubCurrentStringIndex;
	UINT8	ubLinesPrinted;
	INT16 sX, sY;
	UINT16 usSpacing;

	// Limit drawing to chat log region only, dont want any overdraw
	sX = gChatMessageLogRegion.iLeft + 4;
	SetFontDestBuffer( FRAME_BUFFER, sX , gChatMessageLogRegion.iTop + 4, gChatMessageLogRegion.iRight - 4, gChatMessageLogRegion.iBottom - 4, FALSE );

	SetFont( CHAT_MESSAGE_FONT );		// no longer supports variable fonts
	SetFontBackground( FONT_BLACK );
	SetFontShadow( DEFAULT_SHADOW );

	ubCurrentStringIndex = gubCurrentChatLogMessageString;

	sY = gChatMessageLogRegion.iTop + 4;

	usSpacing = GetFontHeight( CHAT_MESSAGE_FONT );

	for ( ubLinesPrinted = 0; ubLinesPrinted < MAX_CHATLOG_MESSAGES; ubLinesPrinted++ )
	{
		// reached the end of the list?
		if ( ubCurrentStringIndex == gubEndOfChatLogMessageList )
		{
			break;
		}

		// nothing stored there?
		if ( gChatLogMessageList[ ubCurrentStringIndex ] == NULL )
		{
			break;
		}

		// set font color
		SetFontForeground( ( UINT8 )( gChatLogMessageList[ ubCurrentStringIndex ]->usColor ) );

		// print this line
		mprintf_coded( sX, sY, gChatLogMessageList[ ubCurrentStringIndex ]->pString16 );

		sY = sY + usSpacing;

		// next message index to print (may wrap around)
		ubCurrentStringIndex = ( ubCurrentStringIndex + 1 ) % 256;
	}

	// reset region to whole screen
	SetFontDestBuffer( FRAME_BUFFER, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, FALSE );
}
コード例 #16
0
void RenderDoorLockInfo()
{
	INT16 i, xp, yp;
	INT16 sScreenX, sScreenY;
	UINT16 str[ 50 ];
	for( i = 0; i < gubNumDoors; i++ )
	{
		GetGridNoScreenPos( DoorTable[ i ].sGridNo, 0, &sScreenX, &sScreenY );
		if( sScreenY > 390 )
			continue;
		if( DoorTable[ i ].ubLockID != 255 )
			swprintf( str, L"%S", LockTable[ DoorTable[ i ].ubLockID ].ubEditorName );
		else
			swprintf( str, L"No Lock ID" );
		xp = sScreenX - 10;
		yp = sScreenY - 40;
		DisplayWrappedString( xp, yp, 60, 2, FONT10ARIAL, FONT_LTKHAKI, str, FONT_BLACK, TRUE, CENTER_JUSTIFIED );
		if( DoorTable[ i ].ubTrapID )
		{
			SetFont( FONT10ARIAL );
			SetFontForeground( FONT_RED );
			SetFontShadow( FONT_NEARBLACK );
			switch( DoorTable[ i ].ubTrapID )
			{
				case EXPLOSION:
					swprintf( str, L"Explosion Trap" );
					break;
				case ELECTRIC:
					swprintf( str, L"Electric Trap" );
					break;
				case SIREN:
					swprintf( str, L"Siren Trap" );
					break;
				case SILENT_ALARM:
					swprintf( str, L"Silent Alarm" );
					break;
				case SUPER_ELECTRIC:
					swprintf( str, L"Super Electric Trap" );
					break;

			}
			xp = sScreenX + 20 - StringPixLength( str, FONT10ARIAL ) / 2;
			yp = sScreenY;
			mprintf( xp, yp, str );
			swprintf( str, L"Trap Level %d", DoorTable[ i ].ubTrapLevel );
			xp = sScreenX + 20 - StringPixLength( str, FONT10ARIAL ) / 2;
			mprintf( xp, yp+10, str );
		}
	}
}
コード例 #17
0
void RenderDoorEditingWindow()
{
	InvalidateRegion( 200, 130, 440, 230 );
	SetFont( FONT10ARIAL );
	SetFontForeground( FONT_YELLOW );
	SetFontShadow( FONT_NEARBLACK );
	SetFontBackground( 0 );
	mprintf( 210, 140, gzEditorStrings[EDITOR_STR_EDIT_LOCK], iDoorMapIndex );

	SetFontForeground( FONT_GRAY2 );
	mprintf( 238, 160, gzEditorStrings[EDITOR_STR_LOCK_ID] );
	mprintf( 238, 180, gzEditorStrings[EDITOR_STR_TRAP_TYPE] );
	mprintf( 238, 200, gzEditorStrings[EDITOR_STR_TRAP_LEVEL] );
	mprintf( 238, 218, gzEditorStrings[EDITOR_STR_LOCKED] );
}
コード例 #18
0
ファイル: message.c プロジェクト: bowlofstew/ja2
void DisplayStringsInMapScreenMessageList( void )
{
	UINT8 ubCurrentStringIndex;
	UINT8	ubLinesPrinted;
	INT16 sY;
	UINT16 usSpacing;


	SetFontDestBuffer( FRAME_BUFFER, 17, 360 + 6, 407, 360 + 101, FALSE );

	SetFont( MAP_SCREEN_MESSAGE_FONT );		// no longer supports variable fonts
	SetFontBackground( FONT_BLACK );
	SetFontShadow( DEFAULT_SHADOW );

	ubCurrentStringIndex = gubCurrentMapMessageString;

	sY = 377;
	usSpacing = GetFontHeight( MAP_SCREEN_MESSAGE_FONT );

	for ( ubLinesPrinted = 0; ubLinesPrinted < MAX_MESSAGES_ON_MAP_BOTTOM; ubLinesPrinted++ )
	{
		// reached the end of the list?
		if ( ubCurrentStringIndex == gubEndOfMapScreenMessageList )
		{
			break;
		}

		// nothing stored there?
		if ( gMapScreenMessageList[ ubCurrentStringIndex ] == NULL )
		{
			break;
		}

		// set font color
		SetFontForeground( ( UINT8 )( gMapScreenMessageList[ ubCurrentStringIndex ]->usColor ) );

		// print this line
		mprintf_coded( 20, sY, gMapScreenMessageList[ ubCurrentStringIndex ]->pString16 );

		sY += usSpacing;

		// next message index to print (may wrap around)
		ubCurrentStringIndex = ( ubCurrentStringIndex + 1 ) % 256;
	}

	SetFontDestBuffer( FRAME_BUFFER, 0, 0, 640, 480, FALSE );
}
コード例 #19
0
ファイル: EditorMapInfo.c プロジェクト: bowlofstew/ja2
void UpdateMapInfo()
{
    SetFont( FONT10ARIAL );
    SetFontShadow( FONT_NEARBLACK );

    SetFontForeground( FONT_RED );
    mprintf( 38, 399, L"R");
    SetFontForeground( FONT_GREEN );
    mprintf( 38, 419, L"G");
    SetFontForeground( FONT_DKBLUE );
    mprintf( 38, 439, L"B");

    SetFontForeground( FONT_YELLOW );
    mprintf( 65, 369, L"Prime" );
    mprintf( 65, 382, L"Night" );
    mprintf( 65, 397, L"24Hrs" );

    SetFontForeground( FONT_YELLOW );
    mprintf( 148, 399, L"Radius");

    if( !gfBasement && !gfCaves )
        SetFontForeground( FONT_DKYELLOW );
    mprintf( 148, 414, L"Underground" );
    mprintf( 148, 423, L"Light Level" );

    SetFontForeground( FONT_YELLOW );
    mprintf( 230, 369, L"Outdoors" );
    mprintf( 230, 384, L"Basement" );
    mprintf( 230, 399, L"Caves" );

    SetFontForeground( FONT_ORANGE );
    mprintf( 250, 420, L"Restricted" );
    mprintf( 250, 430, L"Scroll ID" );

    SetFontForeground( FONT_YELLOW );
    mprintf( 368, 363, L"Destination");
    mprintf( 368, 372, L"Sector" );
    mprintf( 368, 383, L"Destination");
    mprintf( 368, 392, L"Bsmt. Level" );
    mprintf( 378, 403, L"Dest." );
    mprintf( 378, 412, L"GridNo" );
    SetFontForeground( FONT_RED );
}
コード例 #20
0
ファイル: message.c プロジェクト: bowlofstew/ja2
void BlitString( VIDEO_OVERLAY *pBlitter )
{
	UINT8	 *pDestBuf;
	UINT32 uiDestPitchBYTES;

  //gprintfdirty(pBlitter->sX,pBlitter->sY, pBlitter->zText);
	//RestoreExternBackgroundRect(pBlitter->sX,pBlitter->sY, pBlitter->sX+StringPixLength(pBlitter->zText,pBlitter->uiFontID ), pBlitter->sY+GetFontHeight(pBlitter->uiFontID ));
	
	if( fScrollMessagesHidden == TRUE )
	{
		return;
	}


	pDestBuf = LockVideoSurface( pBlitter->uiDestBuff, &uiDestPitchBYTES);
	SetFont(pBlitter->uiFontID);

	SetFontBackground( pBlitter->ubFontBack );
	SetFontForeground( pBlitter->ubFontFore );
	SetFontShadow( DEFAULT_SHADOW );
	mprintf_buffer_coded( pDestBuf, uiDestPitchBYTES, pBlitter->uiFontID, pBlitter->sX, pBlitter->sY, pBlitter->zText );
	UnLockVideoSurface( pBlitter->uiDestBuff );
	
}
コード例 #21
0
void DisplayPlayerActivationBriefingRoomEnterString( void )
{

HVOBJECT hHandle;

	// this function will grab the string that the player will enter for activation

	// player gone too far, move back
	if(iStringBriefingRoomEnterPos > 64)
	{
		iStringBriefingRoomEnterPos = 64;
	}

	// restore background
	//RenderActivationIndent( 257, 328 );
	// get the video object
	GetVideoObject(&hHandle, guiBRIEFINGROOM_MISSIONACTIVATIONINDENT);

	// blt to sX, sY relative to upper left corner
	BltVideoObject(FRAME_BUFFER, hHandle, 0, LAPTOP_SCREEN_UL_X + 100, LAPTOP_SCREEN_WEB_UL_Y + 240 , VO_BLT_SRCTRANSPARENCY,NULL);

	// setup the font stuff
	SetFont( FONT14ARIAL );
	SetFontForeground( 184 );
	SetFontBackground(FONT_BLACK);


	// reset shadow
	SetFontShadow(DEFAULT_SHADOW);
	mprintf(IMP_PLAYER_ACTIVATION_STRING_X, IMP_PLAYER_ACTIVATION_STRING_Y, pPlayerBriefingRoomEnterActivationString);


	fNewCharInActivationBriefingRoomEnterString = FALSE;
	fReDrawScreenFlag = TRUE;
	return;
}
コード例 #22
0
ファイル: LoadScreen.cpp プロジェクト: infernuslord/ja2
//Because loading and saving the map takes a few seconds, we want to post a message
//on the screen and then update it which requires passing the screen back to the main loop.
//When we come back for the next frame, we then actually save or load the map.  So this
//process takes two full screen cycles.
UINT32 ProcessFileIO()
{
	INT16 usStartX, usStartY;
	CHAR8 ubNewFilename[50];
	BOOLEAN fAltMap;//dnl ch31 150909
	switch( gbCurrentFileIOStatus )
	{
		case INITIATE_MAP_SAVE:	//draw save message 
			StartFrameBufferRender( );
			SaveFontSettings();
			SetFont( HUGEFONT );
			SetFontForeground( FONT_LTKHAKI );
			SetFontShadow( FONT_DKKHAKI );
			SetFontBackground( 0 );
			swprintf( zOrigName, L"Saving map:  %s", gzFilename );
			usStartX = iScreenWidthOffset + 320 - StringPixLength( zOrigName, LARGEFONT1 ) / 2;
			usStartY = iScreenHeightOffset + 180 - GetFontHeight( LARGEFONT1 ) / 2;
			mprintf( usStartX, usStartY, zOrigName );

			InvalidateScreen( );
			EndFrameBufferRender( );
			gbCurrentFileIOStatus = SAVING_MAP;
			return LOADSAVE_SCREEN;
		case SAVING_MAP: //save map
			sprintf( ubNewFilename, "%S", gzFilename );
			RaiseWorldLand();
			if( gfShowPits )
				RemoveAllPits();
			OptimizeSchedules();
			ShowHighGround(4);//dnl ch41 210909
			//dnl ch33 091009
			BOOLEAN fRet;
			if(gfVanillaMode && iNewMapWorldRows == OLD_WORLD_ROWS && iNewMapWorldCols == OLD_WORLD_COLS)
				fRet = SaveWorld(ubNewFilename, VANILLA_MAJOR_MAP_VERSION, VANILLA_MINOR_MAP_VERSION);
			else
				fRet = SaveWorld(ubNewFilename);
			if(!fRet)
			{
				//dnl ch37 150909
				gfSaveError = TRUE;
				if(gfErrorCatch)
				{
					InitErrorCatchDialog();
					return(EDIT_SCREEN);
				}
				gbCurrentFileIOStatus = IOSTATUS_NONE;
				CreateMessageBox((STR16)(_BS(L" Error saving ") << (const char*)ubNewFilename << L" file. Try another filename? " << _BS::wget).c_str() );
				return(guiCurrentScreen);
			}
			if( gfShowPits )
				AddAllPits();
			GetSectorFromFileName(gzFilename, gWorldSectorX, gWorldSectorY, gbWorldSectorZ, fAltMap);//dnl ch31 140909
			if( gfGlobalSummaryExists )
				UpdateSectorSummary( gzFilename, gfUpdateSummaryInfo );
			else//dnl ch30 150909
				ReEvaluateWorld(ubNewFilename);
			iCurrentAction = ACTION_NULL;
			gbCurrentFileIOStatus = IOSTATUS_NONE;
			gfRenderWorld = TRUE;
			gfRenderTaskbar = TRUE;
			fEnteringLoadSaveScreen = TRUE;
			RestoreFontSettings();
			if( gfErrorCatch )
			{
				InitErrorCatchDialog();
				return EDIT_SCREEN;
			}

			fNewMapSaved = TRUE;

			return EDIT_SCREEN;
		case INITIATE_MAP_LOAD: //draw load message
			SaveFontSettings();
			gbCurrentFileIOStatus = LOADING_MAP;
			if( gfEditMode && iCurrentTaskbar == TASK_MERCS )
				IndicateSelectedMerc( SELECT_NO_MERC );
			SpecifyItemToEdit( NULL, -1 );
			return LOADSAVE_SCREEN;
		case LOADING_MAP: //load map
			DisableUndo();
			sprintf( ubNewFilename, "%S", gzFilename );
			
			RemoveMercsInSector( );

			 // Want to override crash, so user can do something else.
			if(!ReEvaluateWorld(ubNewFilename) || !LoadWorld(ubNewFilename))//dnl ch36 140909
			{
				EnableUndo();
				gbCurrentFileIOStatus = IOSTATUS_NONE;
				gfGlobalError = FALSE;
				gfLoadError = TRUE;
				CreateMessageBox((STR16)(_BS(L" Error loading ") << (const char*)ubNewFilename << L" file. Try another filename? " << _BS::wget).c_str());
				return(guiCurrentScreen);
			}
			//ADB these are NOT set yet! but they need to be, duh
			CompileWorldMovementCosts();
			GetSectorFromFileName(gzFilename, gWorldSectorX, gWorldSectorY, gbWorldSectorZ, fAltMap);//dnl ch31 140909
			RestoreFontSettings();

			//Load successful, update necessary information.

			//ATE: Any current mercs are transfered here...
			//UpdateMercsInSector( gWorldSectorX, gWorldSectorY, gbWorldSectorZ );

			AddSoldierInitListTeamToWorld( ENEMY_TEAM,		255 );
			AddSoldierInitListTeamToWorld( CREATURE_TEAM,	255 );
			AddSoldierInitListTeamToWorld( MILITIA_TEAM,	255 );
			AddSoldierInitListTeamToWorld( CIV_TEAM,		255 );
			iCurrentAction = ACTION_NULL;
			gbCurrentFileIOStatus = IOSTATUS_NONE;
			if( !gfCaves && !gfBasement )
			{
				gusLightLevel = 12;
				if( ubAmbientLightLevel != 4 )
				{
					ubAmbientLightLevel = 4;
					LightSetBaseLevel( ubAmbientLightLevel );
				}
			}
			else
				gusLightLevel = (UINT16)(EDITOR_LIGHT_MAX - ubAmbientLightLevel );
			gEditorLightColor = gpLightColors[ 0 ];
			gfRenderWorld = TRUE;
			gfRenderTaskbar = TRUE;
			fEnteringLoadSaveScreen = TRUE;
			InitJA2SelectionWindow();
			ShowEntryPoints();
			EnableUndo();
			RemoveAllFromUndoList();
			SetEditorSmoothingMode( gMapInformation.ubEditorSmoothingType );
			if( gMapInformation.ubEditorSmoothingType == SMOOTHING_CAVES )
				AnalyseCaveMapForStructureInfo();

			AddLockedDoorCursors();
			gubCurrRoomNumber = gubMaxRoomNumber;
			UpdateRoofsView();
			UpdateWallsView();
			ShowLightPositionHandles();
			SetMercTeamVisibility( ENEMY_TEAM, gfShowEnemies );
			SetMercTeamVisibility( CREATURE_TEAM, gfShowCreatures );
			SetMercTeamVisibility( MILITIA_TEAM, gfShowRebels );
			SetMercTeamVisibility( CIV_TEAM, gfShowCivilians );
			BuildItemPoolList();
			gpItemPool = NULL;//dnl ch26 210909
			fShowHighGround = FALSE;//dnl ch2 210909
			fRaiseWorld = FALSE;//dnl ch3 210909
			ShowHighGround(4);//dnl ch41 210909
			SetRenderCenter(WORLD_COLS/2, WORLD_ROWS/2);//dnl ch43 280909
			if( gfShowPits )
				AddAllPits();

			if( iCurrentTaskbar == TASK_MAPINFO )
			{ //We have to temporarily remove the current textinput mode,
				//update the disabled text field values, then restore the current
				//text input fields.
				SaveAndRemoveCurrentTextInputMode();
				UpdateMapInfoFields();
				RestoreSavedTextInputMode();
			}
			return EDIT_SCREEN;
	}
	gbCurrentFileIOStatus = IOSTATUS_NONE;
	return LOADSAVE_SCREEN;
}
コード例 #23
0
void
AnnotationObject::SetFromNode(DataNode *parentNode)
{
    if(parentNode == 0)
        return;

    DataNode *searchNode = parentNode->GetNode("AnnotationObject");
    if(searchNode == 0)
        return;

    DataNode *node;
    if((node = searchNode->GetNode("objectName")) != 0)
        SetObjectName(node->AsString());
    if((node = searchNode->GetNode("objectType")) != 0)
    {
        // Allow enums to be int or string in the config file
        if(node->GetNodeType() == INT_NODE)
        {
            int ival = node->AsInt();
            if(ival >= 0 && ival < 8)
                SetObjectType(AnnotationType(ival));
        }
        else if(node->GetNodeType() == STRING_NODE)
        {
            AnnotationType value;
            if(AnnotationType_FromString(node->AsString(), value))
                SetObjectType(value);
        }
    }
    if((node = searchNode->GetNode("visible")) != 0)
        SetVisible(node->AsBool());
    if((node = searchNode->GetNode("active")) != 0)
        SetActive(node->AsBool());
    if((node = searchNode->GetNode("position")) != 0)
    {
        if(node->GetNodeType() == FLOAT_ARRAY_NODE)
        {
            const float *fn = node->AsFloatArray();
            double dp[3] = {fn[0], fn[1], fn[2]};
            SetPosition(dp);
        }
        else
            SetPosition(node->AsDoubleArray());
    }
    if((node = searchNode->GetNode("position2")) != 0)
    {
        if(node->GetNodeType() == FLOAT_ARRAY_NODE)
        {
            const float *fn = node->AsFloatArray();
            double dp[3] = {fn[0], fn[1], fn[2]};
            SetPosition2(dp);
        }
        else
            SetPosition2(node->AsDoubleArray());
    }
    if((node = searchNode->GetNode("textColor")) != 0)
        textColor.SetFromNode(node);
    if((node = searchNode->GetNode("useForegroundForTextColor")) != 0)
        SetUseForegroundForTextColor(node->AsBool());
    if((node = searchNode->GetNode("color1")) != 0)
        color1.SetFromNode(node);
    if((node = searchNode->GetNode("color2")) != 0)
        color2.SetFromNode(node);
    if((node = searchNode->GetNode("text")) != 0)
        SetText(node->AsStringVector());
    if((node = searchNode->GetNode("fontFamily")) != 0)
    {
        // Allow enums to be int or string in the config file
        if(node->GetNodeType() == INT_NODE)
        {
            int ival = node->AsInt();
            if(ival >= 0 && ival < 3)
                SetFontFamily(FontFamily(ival));
        }
        else if(node->GetNodeType() == STRING_NODE)
        {
            FontFamily value;
            if(FontFamily_FromString(node->AsString(), value))
                SetFontFamily(value);
        }
    }
    if((node = searchNode->GetNode("fontBold")) != 0)
        SetFontBold(node->AsBool());
    if((node = searchNode->GetNode("fontItalic")) != 0)
        SetFontItalic(node->AsBool());
    if((node = searchNode->GetNode("fontShadow")) != 0)
        SetFontShadow(node->AsBool());
    if((node = searchNode->GetNode("floatAttribute1")) != 0)
        SetDoubleAttribute1(node->AsDouble());
    if((node = searchNode->GetNode("doubleAttribute1")) != 0)
        SetDoubleAttribute1(node->AsDouble());
    if((node = searchNode->GetNode("intAttribute1")) != 0)
        SetIntAttribute1(node->AsInt());
    if((node = searchNode->GetNode("intAttribute2")) != 0)
        SetIntAttribute2(node->AsInt());
    if((node = searchNode->GetNode("intAttribute3")) != 0)
        SetIntAttribute3(node->AsInt());
    if((node = searchNode->GetNode("doubleVector1")) != 0)
        SetDoubleVector1(node->AsDoubleVector());
    if((node = searchNode->GetNode("stringVector1")) != 0)
        SetStringVector1(node->AsStringVector());
    if((node = searchNode->GetNode("stringVector2")) != 0)
        SetStringVector2(node->AsStringVector());
}
コード例 #24
0
//sets up the loadscreen with specified ID, and draws it to the FRAME_BUFFER, 
//and refreshing the screen with it.
void DisplayLoadScreenWithID( UINT8 ubLoadScreenID )
{
	VSURFACE_DESC		vs_desc;
	HVSURFACE hVSurface;
	UINT32 uiLoadScreen;

	vs_desc.fCreateFlags = VSURFACE_CREATE_FROMFILE | VSURFACE_SYSTEM_MEM_USAGE;

	switch( ubLoadScreenID )
	{
		case LOADINGSCREEN_NOTHING:
			strcpy(vs_desc.ImageFile, "LOADSCREENS\\LS_Heli.sti");
			break;
		case LOADINGSCREEN_DAYGENERIC:
			strcpy(vs_desc.ImageFile, "LOADSCREENS\\LS_DayGeneric.sti");
			break;
		case LOADINGSCREEN_DAYTOWN1:
			strcpy(vs_desc.ImageFile, "LOADSCREENS\\LS_DayTown1.sti");
			break;
		case LOADINGSCREEN_DAYTOWN2:
			strcpy(vs_desc.ImageFile, "LOADSCREENS\\LS_DayTown2.sti");
			break;
		case LOADINGSCREEN_DAYWILD:
			strcpy(vs_desc.ImageFile, "LOADSCREENS\\LS_DayWild.sti");
			break;
		case LOADINGSCREEN_DAYTROPICAL:
			strcpy(vs_desc.ImageFile, "LOADSCREENS\\LS_DayTropical.sti");
			break;
		case LOADINGSCREEN_DAYFOREST:
			strcpy(vs_desc.ImageFile, "LOADSCREENS\\LS_DayForest.sti");
			break;
		case LOADINGSCREEN_DAYDESERT:
			strcpy(vs_desc.ImageFile, "LOADSCREENS\\LS_DayDesert.sti");
			break;
		case LOADINGSCREEN_DAYPALACE:
			strcpy(vs_desc.ImageFile, "LOADSCREENS\\LS_DayPalace.sti");
			break;
		case LOADINGSCREEN_NIGHTGENERIC:
			strcpy(vs_desc.ImageFile, "LOADSCREENS\\LS_NightGeneric.sti");
			break;
		case LOADINGSCREEN_NIGHTWILD:
			strcpy(vs_desc.ImageFile, "LOADSCREENS\\LS_NightWild.sti");
			break;
		case LOADINGSCREEN_NIGHTTOWN1:
			strcpy(vs_desc.ImageFile, "LOADSCREENS\\LS_NightTown1.sti");
			break;
		case LOADINGSCREEN_NIGHTTOWN2:
			strcpy(vs_desc.ImageFile, "LOADSCREENS\\LS_NightTown2.sti");
			break;
		case LOADINGSCREEN_NIGHTFOREST:
			strcpy(vs_desc.ImageFile, "LOADSCREENS\\LS_NightForest.sti");
			break;
		case LOADINGSCREEN_NIGHTTROPICAL:
			strcpy(vs_desc.ImageFile, "LOADSCREENS\\LS_NightTropical.sti");
			break;
		case LOADINGSCREEN_NIGHTDESERT:
			strcpy(vs_desc.ImageFile, "LOADSCREENS\\LS_NightDesert.sti");
			break;
		case LOADINGSCREEN_NIGHTPALACE:
			strcpy(vs_desc.ImageFile, "LOADSCREENS\\LS_NightPalace.sti");
			break;
		case LOADINGSCREEN_HELI:
			strcpy(vs_desc.ImageFile, "LOADSCREENS\\LS_Heli.sti");
			break;
		case LOADINGSCREEN_BASEMENT:
			strcpy(vs_desc.ImageFile, "LOADSCREENS\\LS_Basement.sti");
			break;
		case LOADINGSCREEN_MINE:
			strcpy(vs_desc.ImageFile, "LOADSCREENS\\LS_Mine.sti");
			break;
		case LOADINGSCREEN_CAVE:
			strcpy(vs_desc.ImageFile, "LOADSCREENS\\LS_Cave.sti");
			break;
		case LOADINGSCREEN_DAYPINE:
			strcpy(vs_desc.ImageFile, "LOADSCREENS\\LS_DayPine.sti");
			break;
		case LOADINGSCREEN_NIGHTPINE:
			strcpy(vs_desc.ImageFile, "LOADSCREENS\\LS_NightPine.sti");
			break;
		case LOADINGSCREEN_DAYMILITARY:
			strcpy(vs_desc.ImageFile, "LOADSCREENS\\LS_DayMilitary.sti");
			break;
		case LOADINGSCREEN_NIGHTMILITARY:
			strcpy(vs_desc.ImageFile, "LOADSCREENS\\LS_NightMilitary.sti");
			break;
		case LOADINGSCREEN_DAYSAM:
			strcpy(vs_desc.ImageFile, "LOADSCREENS\\LS_DaySAM.sti");
			break;
		case LOADINGSCREEN_NIGHTSAM:
			strcpy(vs_desc.ImageFile, "LOADSCREENS\\LS_NightSAM.sti");
			break;
		case LOADINGSCREEN_DAYPRISON:
			strcpy(vs_desc.ImageFile, "LOADSCREENS\\LS_DayPrison.sti");
			break;
		case LOADINGSCREEN_NIGHTPRISON:
			strcpy(vs_desc.ImageFile, "LOADSCREENS\\LS_NightPrison.sti");
			break;
		case LOADINGSCREEN_DAYHOSPITAL:
			strcpy(vs_desc.ImageFile, "LOADSCREENS\\LS_DayHospital.sti");
			break;
		case LOADINGSCREEN_NIGHTHOSPITAL:
			strcpy(vs_desc.ImageFile, "LOADSCREENS\\LS_NightHospital.sti");
			break;
		case LOADINGSCREEN_DAYAIRPORT:
			strcpy(vs_desc.ImageFile, "LOADSCREENS\\LS_DayAirport.sti");
			break;
		case LOADINGSCREEN_NIGHTAIRPORT:
			strcpy(vs_desc.ImageFile, "LOADSCREENS\\LS_NightAirport.sti");
			break;
		case LOADINGSCREEN_DAYLAB:
			strcpy(vs_desc.ImageFile, "LOADSCREENS\\LS_DayLab.sti");
			break;
		case LOADINGSCREEN_NIGHTLAB:
			strcpy(vs_desc.ImageFile, "LOADSCREENS\\LS_NightLab.sti");
			break;
		case LOADINGSCREEN_DAYOMERTA:
			strcpy(vs_desc.ImageFile, "LOADSCREENS\\LS_DayOmerta.sti");
			break;
		case LOADINGSCREEN_NIGHTOMERTA:
			strcpy(vs_desc.ImageFile, "LOADSCREENS\\LS_NightOmerta.sti");
			break;
		case LOADINGSCREEN_DAYCHITZENA:
			strcpy(vs_desc.ImageFile, "LOADSCREENS\\LS_DayChitzena.sti");
			break;
		case LOADINGSCREEN_NIGHTCHITZENA:
			strcpy(vs_desc.ImageFile, "LOADSCREENS\\LS_NightChitzena.sti");
			break;
		case LOADINGSCREEN_DAYMINE:
			strcpy(vs_desc.ImageFile, "LOADSCREENS\\LS_DayMine.sti" );
			break;
		case LOADINGSCREEN_NIGHTMINE:
			strcpy(vs_desc.ImageFile, "LOADSCREENS\\LS_NightMine.sti" );
			break;
		case LOADINGSCREEN_DAYBALIME:
			strcpy(vs_desc.ImageFile, "LOADSCREENS\\LS_DayBalime.sti" );
			break;
		case LOADINGSCREEN_NIGHTBALIME:
			strcpy(vs_desc.ImageFile, "LOADSCREENS\\LS_NightBalime.sti" );
			break;
		default:
			strcpy(vs_desc.ImageFile, "LOADSCREENS\\LS_Heli.sti");
			break;
	}

	if( gfSchedulesHosed )
	{
		SetFont( FONT10ARIAL );
		SetFontForeground( FONT_YELLOW );
		SetFontShadow( FONT_NEARBLACK );
		ColorFillVideoSurfaceArea( FRAME_BUFFER, 0, 0, 640, 480, 0 );
		mprintf( 5, 5, L"Error loading save, attempting to patch save to version 1.02...", vs_desc.ImageFile );
	}
	else if( AddVideoSurface( &vs_desc, &uiLoadScreen ) )
	{ //Blit the background image
		GetVideoSurface( &hVSurface, uiLoadScreen );
		BltVideoSurfaceToVideoSurface( ghFrameBuffer, hVSurface, 0, 0, 0, 0, NULL );
		DeleteVideoSurfaceFromIndex( uiLoadScreen );
	}
	else
	{ //Failed to load the file, so use a black screen and print out message.
		SetFont( FONT10ARIAL );
		SetFontForeground( FONT_YELLOW );
		SetFontShadow( FONT_NEARBLACK );
		ColorFillVideoSurfaceArea( FRAME_BUFFER, 0, 0, 640, 480, 0 );
		mprintf( 5, 5, L"%S loadscreen data file not found...", vs_desc.ImageFile );
	}

	gubLastLoadingScreenID = ubLoadScreenID;
	InvalidateScreen( );
	ExecuteBaseDirtyRectQueue();
	EndFrameBufferRender();
	RefreshScreen( NULL );
}
コード例 #25
0
void RenderEditorInfo( )
{
	CHAR16					FPSText[ 50 ];
	static INT32		iSpewWarning = 0;
	INT32				iMapIndexD;

	//dnl ch52 091009
	SetFont(FONT12ARIAL);
	SetFontShadow(FONT_NEARBLACK);
	SetFontForeground(FONT_GRAY2);
	SetFontBackground(FONT_BLACK);

	//dnl ch1 101009 Display the mapindex position
	if(GetMouseMapPos(&iMapIndexD))
	{
		INT16 sGridX, sGridY;
		GetMouseXY(&sGridX, &sGridY);
		swprintf(FPSText, L"%4d %4d %6d ", sGridX, sGridY, iMapIndexD);
	}
	else
		swprintf(FPSText, L"                  ");

	mprintfEditor( (UINT16)(iScreenWidthOffset + 50-StringPixLength( FPSText, FONT12POINT1 )/2), 2 * iScreenHeightOffset + 463, FPSText );

	switch( iCurrentTaskbar )
	{
		case TASK_OPTIONS:
			mprintf(iScreenWidthOffset+71+15, SCREEN_HEIGHT-117, iRenderEditorInfoText[0]);//dnl ch33 160909
			if( !gfWorldLoaded || giCurrentTilesetID < 0 )
				mprintf( iScreenWidthOffset + 260, 2 * iScreenHeightOffset + 445, iRenderEditorInfoText[1] );
			else
				mprintf( iScreenWidthOffset + 260, 2 * iScreenHeightOffset + 445, iRenderEditorInfoText[2], gubFilename, gTilesets[ giCurrentTilesetID ].zName );

			// TODO.MAP
			mprintf(iScreenWidthOffset+20, SCREEN_HEIGHT-40, iRenderEditorInfoText[3]);

			UpdateOptions();
			break;
		case TASK_TERRAIN:

			// WANNE: Comment this two lines, because we always get an exception here.
			//if( gusSelectionType == LINESELECTION )
			//	swprintf( wszSelType[LINESELECTION], L"Width: %d", gusSelectionWidth );

			DrawEditorInfoBox( wszSelType[gusSelectionType], FONT12POINT1, iScreenWidthOffset + 220, 2 * iScreenHeightOffset + 430, 60, 30 );
			swprintf( FPSText, L"%d%%", gusSelectionDensity );
			DrawEditorInfoBox( FPSText, FONT12POINT1, iScreenWidthOffset + 310, 2 * iScreenHeightOffset + 430, 40, 30 );
			break;
		case TASK_ITEMS:
			RenderEditorItemsInfo();
			UpdateItemStatsPanel();
			break;
		case TASK_BUILDINGS:
			UpdateBuildingsInfo();


			// WANNE: Comment this two lines, because we always get an exception here.
			//if( gusSelectionType == LINESELECTION )
			//	swprintf( wszSelType[LINESELECTION], L"%d", gusSelectionWidth );

			DrawEditorInfoBox( wszSelType[gusSelectionType], FONT12POINT1, iScreenWidthOffset + 530, 2 * iScreenHeightOffset + 430, 60, 30 );
			break;
		case TASK_MERCS:
			UpdateMercsInfo();
				#ifdef JA113DEMO
				DisableButton (iEditorButton[ MERCS_CIVILIANTOGGLE ]);
				DisableButton (iEditorButton[ MERCS_CIVILIAN ]);
				#endif
			break;
		case TASK_MAPINFO:
			UpdateMapInfo();
			// WANNE: EDITOR: Comment this two lines, because we always get an exception here!
			//if( gusSelectionType == LINESELECTION )
			//	swprintf( wszSelType[LINESELECTION], L"Width: %d", gusSelectionWidth );

			DrawEditorInfoBox( wszSelType[gusSelectionType], FONT12POINT1, iScreenWidthOffset + 440, 2 * iScreenHeightOffset + 430, 60, 30 );
			break;
	}
}
コード例 #26
0
void RenderMapEntryPointsAndLights()
{
	INT32 sGridNo;
	INT16 sScreenX, sScreenY;
	INT32 i;
	if( gfSummaryWindowActive )
		return;
	SetFont( FONT10ARIAL );
	SetFontForeground( FONT_YELLOW );
	SetFontShadow( FONT_NEARBLACK );
	sGridNo = gMapInformation.sNorthGridNo;
	if( sGridNo != -1 )
	{
		GetGridNoScreenPos( sGridNo, 0, &sScreenX, &sScreenY );
		if( sScreenY >= (- 20) && sScreenY < (2 * iScreenHeightOffset + 340) && sScreenX >= (- 40)	&& sScreenX < SCREEN_WIDTH )
		{
			DisplayWrappedString( sScreenX, (INT16)(sScreenY-5), 40, 2, FONT10ARIAL, FONT_YELLOW, iRenderMapEntryPointsAndLightsText[0], FONT_BLACK, TRUE, CENTER_JUSTIFIED );
		}
	}
	sGridNo = gMapInformation.sWestGridNo;
	if( sGridNo != -1 )
	{
		GetGridNoScreenPos( sGridNo, 0, &sScreenX, &sScreenY );
		if( sScreenY >= (- 20) && sScreenY < (2 * iScreenHeightOffset + 340) && sScreenX >= (- 40)	&& sScreenX < SCREEN_WIDTH )
		{
			DisplayWrappedString( sScreenX, (INT16)(sScreenY-5), 40, 2, FONT10ARIAL, FONT_YELLOW, iRenderMapEntryPointsAndLightsText[1], FONT_BLACK, TRUE, CENTER_JUSTIFIED );
		}
	}
	sGridNo = gMapInformation.sEastGridNo;
	if( sGridNo != -1 )
	{
		GetGridNoScreenPos( sGridNo, 0, &sScreenX, &sScreenY );
		if( sScreenY >= (- 20) && sScreenY < (2 * iScreenHeightOffset + 340) && sScreenX >= (- 40)	&& sScreenX < SCREEN_WIDTH )
		{
			DisplayWrappedString( sScreenX, (INT16)(sScreenY-5), 40, 2, FONT10ARIAL, FONT_YELLOW, iRenderMapEntryPointsAndLightsText[2], FONT_BLACK, TRUE, CENTER_JUSTIFIED );
		}
	}
	sGridNo = gMapInformation.sSouthGridNo;
	if( sGridNo != -1 )
	{
		GetGridNoScreenPos( sGridNo, 0, &sScreenX, &sScreenY );
		if( sScreenY >= ( - 20) && sScreenY < (2 * iScreenHeightOffset + 340) && sScreenX >= (- 40)	&& sScreenX < SCREEN_WIDTH )
		{
			DisplayWrappedString( sScreenX, (INT16)(sScreenY-5), 40, 2, FONT10ARIAL, FONT_YELLOW, iRenderMapEntryPointsAndLightsText[3], FONT_BLACK, TRUE, CENTER_JUSTIFIED );
		}
	}
	sGridNo = gMapInformation.sCenterGridNo;
	if( sGridNo != -1 )
	{
		GetGridNoScreenPos( sGridNo, 0, &sScreenX, &sScreenY );
		if( sScreenY >= (- 20) && sScreenY < (2 * iScreenHeightOffset + 340) && sScreenX >= (- 40)	&& sScreenX < SCREEN_WIDTH )
		{
			DisplayWrappedString( sScreenX, (INT16)(sScreenY-5), 40, 2, FONT10ARIAL, FONT_YELLOW, iRenderMapEntryPointsAndLightsText[4], FONT_BLACK, TRUE, CENTER_JUSTIFIED );
		}
	}
	sGridNo = gMapInformation.sIsolatedGridNo;
	if( sGridNo != -1 )
	{
		GetGridNoScreenPos( sGridNo, 0, &sScreenX, &sScreenY );
		if( sScreenY >= (- 20) && sScreenY < (2 * iScreenHeightOffset + 340) && sScreenX >= (- 40)	&& sScreenX < SCREEN_WIDTH )
		{
			DisplayWrappedString( sScreenX, (INT16)(sScreenY-5), 40, 2, FONT10ARIAL, FONT_YELLOW, iRenderMapEntryPointsAndLightsText[5], FONT_BLACK, TRUE, CENTER_JUSTIFIED );
		}
	}

	//Do the lights now.
	for( i = 0; i < MAX_LIGHT_SPRITES; i++ )
	{
		if( LightSprites[ i ].uiFlags & LIGHT_SPR_ACTIVE )
		{
			// Check for light out of bounds.	This actually happens in Drassen.
			if (LightSprites[ i ].iY < 0 || LightSprites[ i ].iY > WORLD_ROWS ||
				LightSprites[ i ].iX < 0 || LightSprites[ i ].iX > WORLD_COLS)
			{
				LightSprites[ i ].uiFlags &= (~LIGHT_SPR_ACTIVE);
				continue;
			}

			sGridNo = LightSprites[ i ].iY * WORLD_COLS + LightSprites[ i ].iX;
			GetGridNoScreenPos( sGridNo, 0, &sScreenX, &sScreenY );
			if( sScreenY >= (- 50) && sScreenY < (2 * iScreenHeightOffset + 300) && sScreenX >= (- 40)	&& sScreenX < SCREEN_WIDTH )
			{
				if( LightSprites[ i ].uiFlags & LIGHT_PRIMETIME )
					DisplayWrappedString( sScreenX, (INT16)(sScreenY-5), 50, 2, FONT10ARIAL, FONT_ORANGE, iRenderMapEntryPointsAndLightsText[6], FONT_BLACK, TRUE, CENTER_JUSTIFIED );
				else if( LightSprites[ i ].uiFlags & LIGHT_NIGHTTIME )
					DisplayWrappedString( sScreenX, (INT16)(sScreenY-5), 50, 2, FONT10ARIAL, FONT_RED, iRenderMapEntryPointsAndLightsText[7], FONT_BLACK, TRUE, CENTER_JUSTIFIED );
				else
					DisplayWrappedString( sScreenX, (INT16)(sScreenY-5), 50, 2, FONT10ARIAL, FONT_YELLOW, iRenderMapEntryPointsAndLightsText[8], FONT_BLACK, TRUE, CENTER_JUSTIFIED );
			}
		}
	}
}
コード例 #27
0
void RenderMapEntryPointsAndLights()
{
	INT16 sGridNo;
	INT16 sScreenX, sScreenY;
	INT32 i;
	if( gfSummaryWindowActive )
		return;
	SetFont( FONT10ARIAL );
	SetFontForeground( FONT_YELLOW );
	SetFontShadow( FONT_NEARBLACK );
	sGridNo = gMapInformation.sNorthGridNo;
	if( sGridNo != -1 )
	{
		GetGridNoScreenPos( sGridNo, 0, &sScreenX, &sScreenY );
		if( sScreenY >= -20 && sScreenY < 340 && sScreenX >= -40  && sScreenX < 640 )
		{
			DisplayWrappedString( sScreenX, (INT16)(sScreenY-5), 40, 2, FONT10ARIAL, FONT_YELLOW, L"North Entry Point", FONT_BLACK, TRUE, CENTER_JUSTIFIED );
		}
	}
	sGridNo = gMapInformation.sWestGridNo;
	if( sGridNo != -1 )
	{
		GetGridNoScreenPos( sGridNo, 0, &sScreenX, &sScreenY );
		if( sScreenY >= -20 && sScreenY < 340 && sScreenX >= -40  && sScreenX < 640 )
		{
			DisplayWrappedString( sScreenX, (INT16)(sScreenY-5), 40, 2, FONT10ARIAL, FONT_YELLOW, L"West Entry Point", FONT_BLACK, TRUE, CENTER_JUSTIFIED );
		}
	}
	sGridNo = gMapInformation.sEastGridNo;
	if( sGridNo != -1 )
	{
		GetGridNoScreenPos( sGridNo, 0, &sScreenX, &sScreenY );
		if( sScreenY >= -20 && sScreenY < 340 && sScreenX >= -40  && sScreenX < 640 )
		{
			DisplayWrappedString( sScreenX, (INT16)(sScreenY-5), 40, 2, FONT10ARIAL, FONT_YELLOW, L"East Entry Point", FONT_BLACK, TRUE, CENTER_JUSTIFIED );
		}
	}
	sGridNo = gMapInformation.sSouthGridNo;
	if( sGridNo != -1 )
	{
		GetGridNoScreenPos( sGridNo, 0, &sScreenX, &sScreenY );
		if( sScreenY >= -20 && sScreenY < 340 && sScreenX >= -40  && sScreenX < 640 )
		{
			DisplayWrappedString( sScreenX, (INT16)(sScreenY-5), 40, 2, FONT10ARIAL, FONT_YELLOW, L"South Entry Point", FONT_BLACK, TRUE, CENTER_JUSTIFIED );
		}
	}
	sGridNo = gMapInformation.sCenterGridNo;
	if( sGridNo != -1 )
	{
		GetGridNoScreenPos( sGridNo, 0, &sScreenX, &sScreenY );
		if( sScreenY >= -20 && sScreenY < 340 && sScreenX >= -40  && sScreenX < 640 )
		{
			DisplayWrappedString( sScreenX, (INT16)(sScreenY-5), 40, 2, FONT10ARIAL, FONT_YELLOW, L"Center Entry Point", FONT_BLACK, TRUE, CENTER_JUSTIFIED );
		}
	}
	sGridNo = gMapInformation.sIsolatedGridNo;
	if( sGridNo != -1 )
	{
		GetGridNoScreenPos( sGridNo, 0, &sScreenX, &sScreenY );
		if( sScreenY >= -20 && sScreenY < 340 && sScreenX >= -40  && sScreenX < 640 )
		{
			DisplayWrappedString( sScreenX, (INT16)(sScreenY-5), 40, 2, FONT10ARIAL, FONT_YELLOW, L"Isolated Entry Point", FONT_BLACK, TRUE, CENTER_JUSTIFIED );
		}
	}
	//Do the lights now.
	for( i = 0; i < MAX_LIGHT_SPRITES; i++ )
	{
		if( LightSprites[ i ].uiFlags & LIGHT_SPR_ACTIVE )
		{
			sGridNo = LightSprites[ i ].iY * WORLD_COLS + LightSprites[ i ].iX;
			GetGridNoScreenPos( sGridNo, 0, &sScreenX, &sScreenY );
			if( sScreenY >= -50 && sScreenY < 300 && sScreenX >= -40  && sScreenX < 640 )
			{
				if( LightSprites[ i ].uiFlags & LIGHT_PRIMETIME )
					DisplayWrappedString( sScreenX, (INT16)(sScreenY-5), 50, 2, FONT10ARIAL, FONT_ORANGE, L"Prime", FONT_BLACK, TRUE, CENTER_JUSTIFIED );
				else if( LightSprites[ i ].uiFlags & LIGHT_NIGHTTIME )
					DisplayWrappedString( sScreenX, (INT16)(sScreenY-5), 50, 2, FONT10ARIAL, FONT_RED, L"Night", FONT_BLACK, TRUE, CENTER_JUSTIFIED );
				else
					DisplayWrappedString( sScreenX, (INT16)(sScreenY-5), 50, 2, FONT10ARIAL, FONT_YELLOW, L"24Hour", FONT_BLACK, TRUE, CENTER_JUSTIFIED );
			}
		}
	}
}
コード例 #28
0
ファイル: EditorItems.cpp プロジェクト: infernuslord/ja2
void RenderEditorItemsInfo()
{
	UINT8	*pDestBuf, *pSrcBuf;
	UINT32 uiSrcPitchBYTES, uiDestPitchBYTES;
	INVTYPE *item;
	HVOBJECT hVObject;
	UINT32 uiVideoObjectIndex;
	INT16 i;
	INT16 minIndex, maxIndex;
	INT16 sWidth, sOffset, sStart, x, y;
	UINT16 usNumItems;
	UINT16 usQuantity;

	if(!eInfo.fActive)
	{
		return;
	}

	if( gusMouseXPos < (iScreenWidthOffset + 110) || gusMouseXPos > (iScreenWidthOffset + 480) || gusMouseYPos < (2 * iScreenHeightOffset + 360) || gusMouseYPos > (2 * iScreenHeightOffset + 440) )
	{ //Mouse has moved out of the items display region -- so nothing can be highlighted.
		eInfo.sHilitedItemIndex = -1;
	}
	pDestBuf = LockVideoSurface(FRAME_BUFFER, &uiDestPitchBYTES);
	pSrcBuf = LockVideoSurface(eInfo.uiBuffer, &uiSrcPitchBYTES);

	Blt16BPPTo16BPP((UINT16 *)pDestBuf, uiDestPitchBYTES,
				(UINT16 *)pSrcBuf, uiSrcPitchBYTES, iScreenWidthOffset + 110, 2 * iScreenHeightOffset + 360, 60*eInfo.sScrollIndex, 0, 360, 80 );

	UnLockVideoSurface(eInfo.uiBuffer);
	UnLockVideoSurface(FRAME_BUFFER);

	//calculate the min and max index that is currently shown.	This determines
	//if the highlighted and/or selected items are drawn with the outlines.
	minIndex = eInfo.sScrollIndex * 2;
	maxIndex = minIndex + 11;

	//draw the hilighted item if applicable.
	if( eInfo.sHilitedItemIndex >= minIndex && eInfo.sHilitedItemIndex <= maxIndex )
	{
		if( eInfo.pusItemIndex )
		{
			item = &Item[eInfo.pusItemIndex[eInfo.sHilitedItemIndex]];
			uiVideoObjectIndex = GetInterfaceGraphicForItem( item );
			GetVideoObject( &hVObject, uiVideoObjectIndex );

			x = iScreenWidthOffset + (eInfo.sHilitedItemIndex/2 - eInfo.sScrollIndex)*60 + 110;
			y = 2 * iScreenHeightOffset + 360 + (eInfo.sHilitedItemIndex % 2) * 40;

			UINT16 usGraphicNum = g_bUsePngItemImages ? 0 : item->ubGraphicNum;
			sWidth = hVObject->pETRLEObject[usGraphicNum].usWidth;
			sOffset = hVObject->pETRLEObject[usGraphicNum].sOffsetX;
			sStart = x + (60 - sWidth - sOffset*2) / 2;
			if( sWidth )
			{
				BltVideoObjectOutlineFromIndex( FRAME_BUFFER, uiVideoObjectIndex, usGraphicNum, sStart, y+2, Get16BPPColor(FROMRGB(250, 250, 0)), TRUE );
			}
		}
	}
	//draw the selected item
	if( eInfo.sSelItemIndex >= minIndex && eInfo.sSelItemIndex <= maxIndex )
	{
		if( eInfo.pusItemIndex )
		{
			item = &Item[eInfo.pusItemIndex[eInfo.sSelItemIndex]];
			uiVideoObjectIndex = GetInterfaceGraphicForItem( item );
			GetVideoObject( &hVObject, uiVideoObjectIndex );

			x = iScreenWidthOffset + (eInfo.sSelItemIndex/2 - eInfo.sScrollIndex)*60 + 110;
			y = 2 * iScreenHeightOffset + 360 + (eInfo.sSelItemIndex % 2) * 40;

			UINT16 usGraphicNum = g_bUsePngItemImages ? 0 : item->ubGraphicNum;
			sWidth = hVObject->pETRLEObject[usGraphicNum].usWidth;
			sOffset = hVObject->pETRLEObject[usGraphicNum].sOffsetX;
			sStart = x + (60 - sWidth - sOffset*2) / 2;
			if( sWidth )
			{
				BltVideoObjectOutlineFromIndex( FRAME_BUFFER, uiVideoObjectIndex, usGraphicNum, sStart, y+2, Get16BPPColor(FROMRGB(250, 0, 0)), TRUE );
			}
		}
	}
	//draw the numbers of each visible item that currently resides in the world.
	maxIndex = min( maxIndex, eInfo.sNumItems-1 );
	for( i = minIndex; i <= maxIndex; i++ )
	{
		usNumItems = CountNumberOfEditorPlacementsInWorld( i, &usQuantity );
		if( usNumItems )
		{
			x = iScreenWidthOffset + (i/2 - eInfo.sScrollIndex)*60 + 110;
			y = 2 * iScreenHeightOffset + 360 + (i % 2) * 40;
			SetFont( FONT10ARIAL );
			SetFontForeground( FONT_YELLOW );
			SetFontShadow( FONT_NEARBLACK );
			if( usNumItems == usQuantity )
				mprintf( x + 12, y + 4, L"%d", usNumItems );
			else
				mprintf( x + 12, y + 4, L"%d(%d)", usNumItems, usQuantity );
		}
	}
}
コード例 #29
0
void RenderSelectedItemBlownUp()
{
	UINT32 uiVideoObjectIndex;
	HVOBJECT hVObject;
	INT16 sScreenX, sScreenY, xp, yp;
	ITEM_POOL	*pItemPool;
	UINT16 szItemName[ SIZE_ITEM_NAME ];
	INT32 i;
	INT16 sWidth, sHeight, sOffsetX, sOffsetY;

	GetGridNoScreenPos( gsItemGridNo, 0, &sScreenX, &sScreenY );

	if( sScreenY > 340 )
		return;

	//Display the enlarged item graphic
	uiVideoObjectIndex = GetInterfaceGraphicForItem( &Item[ gpItem->usItem ] );
	GetVideoObject( &hVObject, uiVideoObjectIndex );
	
	sWidth = hVObject->pETRLEObject[ Item[ gpItem->usItem ].ubGraphicNum ].usWidth;
	sOffsetX = hVObject->pETRLEObject[ Item[ gpItem->usItem ].ubGraphicNum ].sOffsetX;
	xp = sScreenX + (40 - sWidth - sOffsetX*2) / 2;
	
	sHeight = hVObject->pETRLEObject[ Item[ gpItem->usItem ].ubGraphicNum ].usHeight;
	sOffsetY = hVObject->pETRLEObject[ Item[ gpItem->usItem ].ubGraphicNum ].sOffsetY;
	yp = sScreenY + (20 - sHeight - sOffsetY*2) / 2;

	BltVideoObjectOutlineFromIndex( FRAME_BUFFER, uiVideoObjectIndex, Item[ gpItem->usItem ].ubGraphicNum, xp, yp, Get16BPPColor(FROMRGB(0, 140, 170)), TRUE );

	//Display the item name above it
	SetFont( FONT10ARIAL );
	SetFontForeground( FONT_YELLOW );
	SetFontShadow( FONT_NEARBLACK );
	if( gpItem->usItem == ACTION_ITEM || gpItem->usItem == SWITCH )
	{
		BuildTriggerName( gpItem, szItemName );
	}
	else if( Item[ gpItem->usItem ].usItemClass == IC_KEY )
	{
		swprintf( szItemName, L"%S", LockTable[ gpItem->ubKeyID ].ubEditorName );
	}
	else
	{
		LoadItemInfo( gpItem->usItem, szItemName, NULL );
	}
	xp = sScreenX - (StringPixLength( szItemName, FONT10ARIAL ) - 40) / 2;
	yp -= 10;
	mprintf( xp, yp, szItemName );

	if( gpItem->usItem == ACTION_ITEM )
	{
		UINT16 *pStr;
		pStr = GetActionItemName( gpItem );
		xp = sScreenX - (StringPixLength( pStr, FONT10ARIALBOLD ) - 40) / 2;
		yp += 10;
		SetFont( FONT10ARIALBOLD );
		SetFontForeground( FONT_LTKHAKI );
		mprintf( xp, yp, pStr );
		SetFontForeground( FONT_YELLOW );
	}

	//Count the number of items in the current pool, and display that.
	i = 0;
	GetItemPool( gsItemGridNo, &pItemPool, 0 );
	Assert( pItemPool );
	while( pItemPool )
	{
		i++;
		pItemPool = pItemPool->pNext;
	}
	xp = sScreenX;
	yp = sScreenY + 10;
	mprintf( xp, yp, L"%d", i );
	
	//If the item is hidden, render a blinking H (just like DG)
	if( gWorldItems[ gpItemPool->iItemIndex ].bVisible == HIDDEN_ITEM || 
			gWorldItems[ gpItemPool->iItemIndex ].bVisible == BURIED )
	{
		SetFont( FONT10ARIALBOLD );
		if( GetJA2Clock() % 1000 > 500 )
		{
			SetFontForeground( 249 );
		}
		mprintf( sScreenX + 16, sScreenY + 7, L"H" );
		InvalidateRegion( sScreenX + 16, sScreenY + 7, sScreenX + 24, sScreenY + 27 );
	}
}
コード例 #30
0
ファイル: aim.c プロジェクト: gondur/jagged-alliance-2.5
BOOLEAN DisplayFlowerAd( BOOLEAN fInit, BOOLEAN fRedraw )
{
	static UINT32 uiLastTime;
	static UINT8	ubSubImage=0;
	static UINT8	ubCount=0;
	UINT32 uiCurTime = GetJA2Clock();

	if( fInit )
	{
		uiLastTime = 0;
		ubSubImage = 0;
		ubCount = 0;
	  MSYS_EnableRegion(&gSelectedBannerRegion);
	}

	if( ((uiCurTime - uiLastTime) > AIM_FLOWER_AD_DELAY) || fRedraw)
	{
		HVOBJECT hAdHandle;

		if( ubSubImage == AIM_FLOWER_NUM_SUBIMAGES)
		{
			if(ubCount == 0 || fRedraw)
			{
				//Blit the blue sky frame with text on top
				GetVideoObject(&hAdHandle, guiFlowerAdvertisement);
				BltVideoObject(FRAME_BUFFER, hAdHandle, 0,WARNING_X, WARNING_Y, VO_BLT_SRCTRANSPARENCY,NULL);
				
				// redraw new mail warning, and create new mail button, if nessacary
				fReDrawNewMailFlag = TRUE;
       
				//Display Aim Warning Text 
				DisplayWrappedString(AIM_WARNING_TEXT_X, AIM_WARNING_TEXT_Y, AIM_WARNING_TEXT_WIDTH, 2, FONT14ARIAL, FONT_GREEN, AimScreenText[AIM_INFO_6], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED);

				//Display Aim Warning Text 
				SetFontShadow( FONT_MCOLOR_WHITE );
				DisplayWrappedString(AIM_WARNING_TEXT_X, AIM_FLOWER_LINK_TEXT_Y, AIM_WARNING_TEXT_WIDTH, 2, FONT12ARIAL, 2, AimScreenText[AIM_INFO_7], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED);
				SetFontShadow( DEFAULT_SHADOW );

				InvalidateRegion(AIM_AD_TOP_LEFT_X,AIM_AD_TOP_LEFT_Y, AIM_AD_BOTTOM_RIGHT_X	,AIM_AD_BOTTOM_RIGHT_Y);
			}

			uiLastTime = GetJA2Clock();

			ubCount++;
			if( ubCount > 40 )
			{
				return( AIM_AD_DONE );
			}
			else
				return( AIM_AD_NOT_DONE );

		}
		else
		{
			GetVideoObject(&hAdHandle, guiFlowerAdvertisement);
			BltVideoObject(FRAME_BUFFER, hAdHandle, ubSubImage,WARNING_X, WARNING_Y, VO_BLT_SRCTRANSPARENCY,NULL);
			
			// redraw new mail warning, and create new mail button, if nessacary
			fReDrawNewMailFlag = TRUE;
      
			ubSubImage++;
		}

		uiLastTime = GetJA2Clock();
	  InvalidateRegion(AIM_AD_TOP_LEFT_X,AIM_AD_TOP_LEFT_Y, AIM_AD_BOTTOM_RIGHT_X	,AIM_AD_BOTTOM_RIGHT_Y);
	}
	return( AIM_AD_NOT_DONE );
}