mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
- added full screen main menu image for all resolutions
- added xml options mor main menu - StretchImage if 1 the image is stretched to the screen size - CenterImage if 1 the image is centered in X - ImagePositionRelative if 0 the image is displayed on the same place on any resolution, ignored when StretchImage is active - removed obsolete tags - new buttons in main menu: "n" new game, "q" quit git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5498 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+173
-79
@@ -53,6 +53,9 @@
|
||||
#define MAINMENU_TEXT_FILE "LoadScreens\\MainMenu.edt"
|
||||
#define MAINMENU_RECORD_SIZE 80 * 2
|
||||
|
||||
//externals
|
||||
extern HVSURFACE ghFrameBuffer;
|
||||
extern HVSURFACE ghBackBuffer;
|
||||
// MENU ITEMS
|
||||
enum
|
||||
{
|
||||
@@ -101,7 +104,7 @@ void RestoreButtonBackGrounds();
|
||||
|
||||
//Main Menu layout by Jazz
|
||||
MAIN_MENU_VALUES gMainMenulayout[MAX_MAIN_MENU_IMAGE];
|
||||
VSURFACE_DESC vs_desc;
|
||||
//VSURFACE_DESC vs_desc;
|
||||
|
||||
extern void InitSightRange(); //lal
|
||||
|
||||
@@ -245,7 +248,8 @@ void HandleMainMenuScreen()
|
||||
|
||||
BOOLEAN InitMainMenu( )
|
||||
{
|
||||
VOBJECT_DESC VObjectDesc;
|
||||
//VOBJECT_DESC VObjectDesc;
|
||||
VSURFACE_DESC vs_desc = {};
|
||||
|
||||
//main Menu by JAzz
|
||||
UINT16 iCounter2;
|
||||
@@ -283,31 +287,38 @@ BOOLEAN InitMainMenu( )
|
||||
//Main Menu by Jazz
|
||||
for( iCounter2 = 1; iCounter2 < MAX_ELEMENT; iCounter2++ )
|
||||
{
|
||||
VObjectDesc.fCreateFlags = VSURFACE_CREATE_FROMFILE;
|
||||
//VObjectDesc.fCreateFlags = VSURFACE_CREATE_FROMFILE;
|
||||
vs_desc.fCreateFlags = VSURFACE_CREATE_FROMFILE | VSURFACE_SYSTEM_MEM_USAGE | VSURFACE_CREATE_FROMPNG_FALLBACK;
|
||||
|
||||
if (gMainMenulayout[iCounter2].Visible == 1)
|
||||
{
|
||||
if (iResolution >= _640x480 && iResolution < _800x600)
|
||||
{
|
||||
strcpy(VObjectDesc.ImageFile, gMainMenulayout[iCounter2].FileName);
|
||||
strcpy(vs_desc.ImageFile, gMainMenulayout[iCounter2].FileName);
|
||||
|
||||
if( !AddVideoSurface( &vs_desc, &gMainMenulayout[iCounter2].uiIndex ) )
|
||||
AssertMsg(0, String( "Missing %s", gMainMenulayout[iCounter2].FileName ) );
|
||||
|
||||
if( !AddVideoObject( &VObjectDesc, &gMainMenulayout[iCounter2].uiIndex ) )
|
||||
AssertMsg(0, String( "Missing %s", gMainMenulayout[iCounter2].FileName ) );
|
||||
}
|
||||
else if (iResolution < _1024x768)
|
||||
{
|
||||
strcpy(VObjectDesc.ImageFile, gMainMenulayout[iCounter2].FileName800x600);
|
||||
|
||||
if( !AddVideoObject( &VObjectDesc, &gMainMenulayout[iCounter2].uiIndex ) )
|
||||
AssertMsg(0, String( "Missing %s", gMainMenulayout[iCounter2].FileName800x600 ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy(VObjectDesc.ImageFile, gMainMenulayout[iCounter2].FileName1024x768);
|
||||
//if (iResolution >= _640x480 && iResolution < _800x600)
|
||||
//{
|
||||
// strcpy(VObjectDesc.ImageFile, gMainMenulayout[iCounter2].FileName);
|
||||
|
||||
if( !AddVideoObject( &VObjectDesc, &gMainMenulayout[iCounter2].uiIndex ) )
|
||||
AssertMsg(0, String( "Missing %s", gMainMenulayout[iCounter2].FileName1024x768 ) );
|
||||
}
|
||||
// if( !AddVideoObject( &VObjectDesc, &gMainMenulayout[iCounter2].uiIndex ) )
|
||||
// AssertMsg(0, String( "Missing %s", gMainMenulayout[iCounter2].FileName ) );
|
||||
//}
|
||||
//else if (iResolution < _1024x768)
|
||||
//{
|
||||
// strcpy(VObjectDesc.ImageFile, gMainMenulayout[iCounter2].FileName800x600);
|
||||
|
||||
// if( !AddVideoObject( &VObjectDesc, &gMainMenulayout[iCounter2].uiIndex ) )
|
||||
// AssertMsg(0, String( "Missing %s", gMainMenulayout[iCounter2].FileName800x600 ) );
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// strcpy(VObjectDesc.ImageFile, gMainMenulayout[iCounter2].FileName1024x768);
|
||||
|
||||
// if( !AddVideoObject( &VObjectDesc, &gMainMenulayout[iCounter2].uiIndex ) )
|
||||
// AssertMsg(0, String( "Missing %s", gMainMenulayout[iCounter2].FileName1024x768 ) );
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -343,10 +354,16 @@ void ExitMainMenu( )
|
||||
{
|
||||
if (gMainMenulayout[iCounter2].Visible == 1)
|
||||
{
|
||||
DeleteVideoObjectFromIndex( gMainMenulayout[iCounter2].uiIndex );
|
||||
// DeleteVideoObjectFromIndex( gMainMenulayout[iCounter2].uiIndex );
|
||||
DeleteVideoSurfaceFromIndex( gMainMenulayout[iCounter2].uiIndex );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
gMsgBox.uiExitScreen = MAINMENU_SCREEN;
|
||||
}
|
||||
|
||||
@@ -494,9 +511,9 @@ void HandleMainMenuInput()
|
||||
{
|
||||
switch( InputEvent.usParam )
|
||||
{
|
||||
//#ifdef JA2TESTVERSION
|
||||
|
||||
#ifdef JA2TESTVERSION
|
||||
case 'q':
|
||||
case 'n':
|
||||
gbHandledMainMenu = NEW_GAME;
|
||||
gfMainMenuScreenExit = TRUE;
|
||||
SetMainMenuExitScreen( INIT_SCREEN );
|
||||
@@ -506,7 +523,7 @@ void HandleMainMenuInput()
|
||||
SetPendingNewScreen( INTRO_SCREEN );
|
||||
gfMainMenuScreenExit = TRUE;
|
||||
break;
|
||||
#endif
|
||||
//#endif
|
||||
case 'c':
|
||||
gbHandledMainMenu = LOAD_GAME;
|
||||
|
||||
@@ -527,6 +544,11 @@ void HandleMainMenuInput()
|
||||
case 's':
|
||||
gbHandledMainMenu = CREDITS;
|
||||
break;
|
||||
|
||||
case 'q':
|
||||
gfMainMenuScreenExit = TRUE;
|
||||
gfProgramIsRunning = FALSE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -626,24 +648,28 @@ BOOLEAN CreateDestroyMainMenuButtons( BOOLEAN fCreate )
|
||||
SGPFILENAME filenameMP;
|
||||
INT16 sSlot;
|
||||
|
||||
if (iResolution >= _640x480 && iResolution < _800x600)
|
||||
{
|
||||
MAINMENU_X = gMainMenulayout[0].MAINMENU_X;
|
||||
MAINMENU_Y = gMainMenulayout[0].MAINMENU_Y;
|
||||
MAINMENU_Y_SPACE = gMainMenulayout[0].MAINMENU_Y_SPACE;
|
||||
}
|
||||
else if (iResolution < _1024x768)
|
||||
{
|
||||
MAINMENU_X = gMainMenulayout[0].MAINMENU_800x600X + xResOffset;
|
||||
MAINMENU_Y = gMainMenulayout[0].MAINMENU_800x600Y + yResOffset;
|
||||
MAINMENU_Y_SPACE = gMainMenulayout[0].MAINMENU_Y_SPACE;
|
||||
}
|
||||
else
|
||||
{
|
||||
MAINMENU_X = gMainMenulayout[0].MAINMENU_1024x768X + xResOffset;
|
||||
MAINMENU_Y = gMainMenulayout[0].MAINMENU_1024x768Y + yResOffset;
|
||||
MAINMENU_Y_SPACE = gMainMenulayout[0].MAINMENU_Y_SPACE;
|
||||
}
|
||||
MAINMENU_X = SCREEN_WIDTH * gMainMenulayout[0].MAINMENU_X / 640;
|
||||
MAINMENU_Y = SCREEN_HEIGHT * gMainMenulayout[0].MAINMENU_Y / 480;
|
||||
MAINMENU_Y_SPACE = gMainMenulayout[0].MAINMENU_Y_SPACE;
|
||||
|
||||
//if (iResolution >= _640x480 && iResolution < _800x600)
|
||||
//{
|
||||
// MAINMENU_X = gMainMenulayout[0].MAINMENU_X;
|
||||
// MAINMENU_Y = gMainMenulayout[0].MAINMENU_Y;
|
||||
// MAINMENU_Y_SPACE = gMainMenulayout[0].MAINMENU_Y_SPACE;
|
||||
//}
|
||||
//else if (iResolution < _1024x768)
|
||||
//{
|
||||
// MAINMENU_X = gMainMenulayout[0].MAINMENU_800x600X + xResOffset;
|
||||
// MAINMENU_Y = gMainMenulayout[0].MAINMENU_800x600Y + yResOffset;
|
||||
// MAINMENU_Y_SPACE = gMainMenulayout[0].MAINMENU_Y_SPACE;
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// MAINMENU_X = gMainMenulayout[0].MAINMENU_1024x768X + xResOffset;
|
||||
// MAINMENU_Y = gMainMenulayout[0].MAINMENU_1024x768Y + yResOffset;
|
||||
// MAINMENU_Y_SPACE = gMainMenulayout[0].MAINMENU_Y_SPACE;
|
||||
//}
|
||||
|
||||
if( fCreate )
|
||||
{
|
||||
@@ -724,32 +750,96 @@ BOOLEAN CreateDestroyMainMenuButtons( BOOLEAN fCreate )
|
||||
|
||||
void RenderMainMenu()
|
||||
{
|
||||
HVOBJECT hPixHandle;
|
||||
HVSURFACE hVSurface;
|
||||
HVSURFACE hVSaveSurface;
|
||||
//HVOBJECT hPixHandle;
|
||||
UINT32 iCounter2;
|
||||
|
||||
|
||||
//Get and display the background image
|
||||
for( iCounter2 = 1; iCounter2 < MAX_ELEMENT; iCounter2++ )
|
||||
{
|
||||
if (gMainMenulayout[iCounter2].Visible == 1)
|
||||
{
|
||||
if (iResolution >= _640x480 && iResolution < _800x600)
|
||||
{
|
||||
GetVideoObject(&hPixHandle, gMainMenulayout[iCounter2].uiIndex);
|
||||
BltVideoObject( guiSAVEBUFFER, hPixHandle, 0, gMainMenulayout[iCounter2].ImagePositionX + xResOffset, gMainMenulayout[iCounter2].ImagePositionY + yResOffset, VO_BLT_SRCTRANSPARENCY,NULL);
|
||||
BltVideoObject( FRAME_BUFFER, hPixHandle, 0, gMainMenulayout[iCounter2].ImagePositionX + xResOffset, gMainMenulayout[iCounter2].ImagePositionY + yResOffset, VO_BLT_SRCTRANSPARENCY,NULL);
|
||||
}
|
||||
else if (iResolution < _1024x768)
|
||||
{
|
||||
GetVideoObject(&hPixHandle, gMainMenulayout[iCounter2].uiIndex);
|
||||
BltVideoObject( guiSAVEBUFFER, hPixHandle, 0, gMainMenulayout[iCounter2].ImagePosition800x600X + xResOffset, gMainMenulayout[iCounter2].ImagePosition800x600Y + yResOffset, VO_BLT_SRCTRANSPARENCY,NULL);
|
||||
BltVideoObject( FRAME_BUFFER, hPixHandle, 0, gMainMenulayout[iCounter2].ImagePosition800x600X + xResOffset, gMainMenulayout[iCounter2].ImagePosition800x600Y + yResOffset, VO_BLT_SRCTRANSPARENCY,NULL);
|
||||
{
|
||||
SGPRect SrcRect, DstRect;
|
||||
INT32 iPosX = 0, iPosY = 0;
|
||||
|
||||
GetVideoSurface(&hVSurface, gMainMenulayout[iCounter2].uiIndex);
|
||||
|
||||
SrcRect.iLeft = 0;
|
||||
SrcRect.iTop = 0;
|
||||
SrcRect.iRight = hVSurface->usWidth;
|
||||
SrcRect.iBottom = hVSurface->usHeight;
|
||||
|
||||
//DstRect.iLeft = 0;
|
||||
//DstRect.iTop = 0;
|
||||
//DstRect.iRight = hVSurface->usWidth;
|
||||
//DstRect.iBottom = hVSurface->usHeight;
|
||||
|
||||
//Stretch the background image to screen size
|
||||
if(gMainMenulayout[iCounter2].FitToScreen == 1)
|
||||
{
|
||||
DstRect.iLeft = 0;
|
||||
DstRect.iTop = 0;
|
||||
DstRect.iRight = SCREEN_WIDTH;
|
||||
DstRect.iBottom = SCREEN_HEIGHT;
|
||||
}
|
||||
else
|
||||
{
|
||||
GetVideoObject(&hPixHandle, gMainMenulayout[iCounter2].uiIndex);
|
||||
BltVideoObject( guiSAVEBUFFER, hPixHandle, 0, gMainMenulayout[iCounter2].ImagePosition1024x768X + xResOffset, gMainMenulayout[iCounter2].ImagePosition1024x768Y + yResOffset, VO_BLT_SRCTRANSPARENCY,NULL);
|
||||
BltVideoObject( FRAME_BUFFER, hPixHandle, 0, gMainMenulayout[iCounter2].ImagePosition1024x768X + xResOffset, gMainMenulayout[iCounter2].ImagePosition1024x768Y + yResOffset, VO_BLT_SRCTRANSPARENCY,NULL);
|
||||
{
|
||||
if(gMainMenulayout[iCounter2].ImagePositionRelative == 1)
|
||||
{
|
||||
iPosX = SCREEN_WIDTH * gMainMenulayout[iCounter2].ImagePositionX / 640;
|
||||
iPosY = SCREEN_HEIGHT * gMainMenulayout[iCounter2].ImagePositionY / 480;
|
||||
}
|
||||
else
|
||||
{
|
||||
iPosX = gMainMenulayout[iCounter2].ImagePositionX;
|
||||
iPosY = gMainMenulayout[iCounter2].ImagePositionY;
|
||||
}
|
||||
|
||||
DstRect.iLeft = iPosX;
|
||||
DstRect.iTop = iPosY;
|
||||
DstRect.iRight = iPosX + hVSurface->usWidth;
|
||||
DstRect.iBottom = iPosY + hVSurface->usHeight;
|
||||
|
||||
if(gMainMenulayout[iCounter2].StretchImage == 1)
|
||||
{
|
||||
DstRect.iRight = iPosX + SCREEN_WIDTH * hVSurface->usWidth / 640;
|
||||
DstRect.iBottom = iPosY + SCREEN_HEIGHT * hVSurface->usHeight / 480;
|
||||
}
|
||||
|
||||
if(gMainMenulayout[iCounter2].CenterImage == 1)
|
||||
{
|
||||
INT32 iTmpXSize = DstRect.iRight - DstRect.iLeft;
|
||||
|
||||
DstRect.iLeft = SCREEN_WIDTH / 2 - iTmpXSize / 2;
|
||||
DstRect.iRight = DstRect.iLeft + iTmpXSize;
|
||||
}
|
||||
}
|
||||
|
||||
BltStretchVideoSurface( FRAME_BUFFER, gMainMenulayout[iCounter2].uiIndex, 0, 0, VO_BLT_SRCTRANSPARENCY, &SrcRect, &DstRect );
|
||||
BltStretchVideoSurface( guiSAVEBUFFER, gMainMenulayout[iCounter2].uiIndex, 0, 0, VO_BLT_SRCTRANSPARENCY, &SrcRect, &DstRect );
|
||||
|
||||
|
||||
|
||||
|
||||
//if (iResolution >= _640x480 && iResolution < _800x600)
|
||||
//{
|
||||
// GetVideoObject(&hPixHandle, gMainMenulayout[iCounter2].uiIndex);
|
||||
// BltVideoObject( guiSAVEBUFFER, hPixHandle, 0, gMainMenulayout[iCounter2].ImagePositionX + xResOffset, gMainMenulayout[iCounter2].ImagePositionY + yResOffset, VO_BLT_SRCTRANSPARENCY,NULL);
|
||||
// BltVideoObject( FRAME_BUFFER, hPixHandle, 0, gMainMenulayout[iCounter2].ImagePositionX + xResOffset, gMainMenulayout[iCounter2].ImagePositionY + yResOffset, VO_BLT_SRCTRANSPARENCY,NULL);
|
||||
//}
|
||||
//else if (iResolution < _1024x768)
|
||||
//{
|
||||
// GetVideoObject(&hPixHandle, gMainMenulayout[iCounter2].uiIndex);
|
||||
// BltVideoObject( guiSAVEBUFFER, hPixHandle, 0, gMainMenulayout[iCounter2].ImagePosition800x600X + xResOffset, gMainMenulayout[iCounter2].ImagePosition800x600Y + yResOffset, VO_BLT_SRCTRANSPARENCY,NULL);
|
||||
// BltVideoObject( FRAME_BUFFER, hPixHandle, 0, gMainMenulayout[iCounter2].ImagePosition800x600X + xResOffset, gMainMenulayout[iCounter2].ImagePosition800x600Y + yResOffset, VO_BLT_SRCTRANSPARENCY,NULL);
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// GetVideoObject(&hPixHandle, gMainMenulayout[iCounter2].uiIndex);
|
||||
// BltVideoObject( guiSAVEBUFFER, hPixHandle, 0, gMainMenulayout[iCounter2].ImagePosition1024x768X + xResOffset, gMainMenulayout[iCounter2].ImagePosition1024x768Y + yResOffset, VO_BLT_SRCTRANSPARENCY,NULL);
|
||||
// BltVideoObject( FRAME_BUFFER, hPixHandle, 0, gMainMenulayout[iCounter2].ImagePosition1024x768X + xResOffset, gMainMenulayout[iCounter2].ImagePosition1024x768Y + yResOffset, VO_BLT_SRCTRANSPARENCY,NULL);
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -788,24 +878,28 @@ void RestoreButtonBackGrounds()
|
||||
|
||||
#ifndef TESTFOREIGNFONTS
|
||||
|
||||
if (iResolution >= _640x480 && iResolution < _800x600)
|
||||
{
|
||||
MAINMENU_Y = gMainMenulayout[0].MAINMENU_Y;
|
||||
MAINMENU_X = gMainMenulayout[0].MAINMENU_X;
|
||||
MAINMENU_Y_SPACE = gMainMenulayout[0].MAINMENU_Y_SPACE;
|
||||
}
|
||||
else if (iResolution < _1024x768)
|
||||
{
|
||||
MAINMENU_Y = gMainMenulayout[0].MAINMENU_800x600Y;
|
||||
MAINMENU_X = gMainMenulayout[0].MAINMENU_800x600X;
|
||||
MAINMENU_Y_SPACE = gMainMenulayout[0].MAINMENU_Y_SPACE;
|
||||
}
|
||||
else
|
||||
{
|
||||
MAINMENU_Y = gMainMenulayout[0].MAINMENU_1024x768Y;
|
||||
MAINMENU_X = gMainMenulayout[0].MAINMENU_1024x768X;
|
||||
MAINMENU_Y_SPACE = gMainMenulayout[0].MAINMENU_Y_SPACE;
|
||||
}
|
||||
MAINMENU_X = SCREEN_WIDTH * gMainMenulayout[0].MAINMENU_X / 640;
|
||||
MAINMENU_Y = SCREEN_HEIGHT * gMainMenulayout[0].MAINMENU_Y / 480;
|
||||
MAINMENU_Y_SPACE = gMainMenulayout[0].MAINMENU_Y_SPACE;
|
||||
|
||||
//if (iResolution >= _640x480 && iResolution < _800x600)
|
||||
//{
|
||||
// MAINMENU_Y = gMainMenulayout[0].MAINMENU_Y;
|
||||
// MAINMENU_X = gMainMenulayout[0].MAINMENU_X;
|
||||
// MAINMENU_Y_SPACE = gMainMenulayout[0].MAINMENU_Y_SPACE;
|
||||
//}
|
||||
//else if (iResolution < _1024x768)
|
||||
//{
|
||||
// MAINMENU_Y = gMainMenulayout[0].MAINMENU_800x600Y;
|
||||
// MAINMENU_X = gMainMenulayout[0].MAINMENU_800x600X;
|
||||
// MAINMENU_Y_SPACE = gMainMenulayout[0].MAINMENU_Y_SPACE;
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// MAINMENU_Y = gMainMenulayout[0].MAINMENU_1024x768Y;
|
||||
// MAINMENU_X = gMainMenulayout[0].MAINMENU_1024x768X;
|
||||
// MAINMENU_Y_SPACE = gMainMenulayout[0].MAINMENU_Y_SPACE;
|
||||
//}
|
||||
|
||||
for ( cnt = 0; cnt < NUM_MENU_ITEMS; cnt++ )
|
||||
{
|
||||
|
||||
+32
-90
@@ -50,20 +50,14 @@ mainMenuStartElementHandle(void *userData, const XML_Char *name, const XML_Char
|
||||
(strcmp(name, "uiIndex") == 0 ||
|
||||
strcmp(name, "Visible") == 0 ||
|
||||
strcmp(name, "FileName") == 0 ||
|
||||
strcmp(name, "FileName800x600") == 0 ||
|
||||
strcmp(name, "FileName1024x768") == 0 ||
|
||||
strcmp(name, "FitToScreen") == 0 ||
|
||||
strcmp(name, "StretchImage") == 0 ||
|
||||
strcmp(name, "CenterImage") == 0 ||
|
||||
strcmp(name, "ImagePositionRelative") == 0 ||
|
||||
strcmp(name, "ImagePositionX") == 0 ||
|
||||
strcmp(name, "ImagePositionY") == 0 ||
|
||||
strcmp(name, "ImagePosition800x600X") == 0 ||
|
||||
strcmp(name, "ImagePosition800x600Y") == 0 ||
|
||||
strcmp(name, "ImagePosition1024x768X") == 0 ||
|
||||
strcmp(name, "ImagePosition1024x768Y") == 0 ||
|
||||
strcmp(name, "MainMenuY") == 0 ||
|
||||
strcmp(name, "MainMenu800x600Y") == 0 ||
|
||||
strcmp(name, "MainMenu1024x768Y") == 0 ||
|
||||
strcmp(name, "MainMenuX") == 0 ||
|
||||
strcmp(name, "MainMenu800x600X") == 0 ||
|
||||
strcmp(name, "MainMenu1024x768X") == 0 ||
|
||||
strcmp(name, "MainMenuYSpace") == 0 ))
|
||||
{
|
||||
pData->curElement = ELEMENT_PROPERTY;
|
||||
@@ -144,46 +138,34 @@ mainMenuEndElementHandle(void *userData, const XML_Char *name)
|
||||
//DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("itemEndElementHandle: szLocation[%d] = %s, temp = %s",i,&pData->curSectorLoadscreens.szLocation[i],&temp));
|
||||
}
|
||||
}
|
||||
else if(strcmp(name, "FileName800x600") == 0 && pData->curMainMenu.uiIndex > 0)
|
||||
{
|
||||
|
||||
else if(strcmp(name, "FitToScreen") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
|
||||
if(MAX_MAIN_MENU_CHARS >= strlen(pData->szCharData))
|
||||
strcpy(pData->curMainMenu.FileName800x600,pData->szCharData);
|
||||
else
|
||||
{
|
||||
strncpy(pData->curMainMenu.FileName800x600,pData->szCharData,MAX_MAIN_MENU_CHARS);
|
||||
pData->curMainMenu.FileName800x600[MAX_MAIN_MENU_CHARS] = '\0';
|
||||
}
|
||||
|
||||
for(int i=0;i<min((int)strlen(pData->szCharData),MAX_MAIN_MENU_CHARS);i++)
|
||||
{
|
||||
temp = pData->szCharData[i];
|
||||
pData->curMainMenu.FileName800x600[i] = temp;
|
||||
//DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("itemEndElementHandle: szLocation[%d] = %s, temp = %s",i,&pData->curSectorLoadscreens.szLocation[i],&temp));
|
||||
}
|
||||
}
|
||||
else if(strcmp(name, "FileName1024x768") == 0 && pData->curMainMenu.uiIndex > 0)
|
||||
{
|
||||
|
||||
if (pData->curMainMenu.uiIndex == 0 ) pData->curMainMenu.FitToScreen = 0;
|
||||
|
||||
else pData->curMainMenu.FitToScreen = (BOOLEAN) atol(pData->szCharData);
|
||||
}
|
||||
else if(strcmp(name, "StretchImage") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
|
||||
if(MAX_MAIN_MENU_CHARS >= strlen(pData->szCharData))
|
||||
strcpy(pData->curMainMenu.FileName1024x768,pData->szCharData);
|
||||
else
|
||||
{
|
||||
strncpy(pData->curMainMenu.FileName1024x768,pData->szCharData,MAX_MAIN_MENU_CHARS);
|
||||
pData->curMainMenu.FileName1024x768[MAX_MAIN_MENU_CHARS] = '\0';
|
||||
}
|
||||
|
||||
for(int i=0;i<min((int)strlen(pData->szCharData),MAX_MAIN_MENU_CHARS);i++)
|
||||
{
|
||||
temp = pData->szCharData[i];
|
||||
pData->curMainMenu.FileName1024x768[i] = temp;
|
||||
//DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("itemEndElementHandle: szLocation[%d] = %s, temp = %s",i,&pData->curSectorLoadscreens.szLocation[i],&temp));
|
||||
} }
|
||||
|
||||
if (pData->curMainMenu.uiIndex == 0 ) pData->curMainMenu.StretchImage = 0;
|
||||
|
||||
else pData->curMainMenu.StretchImage = (BOOLEAN) atol(pData->szCharData);
|
||||
}
|
||||
else if(strcmp(name, "CenterImage") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
if (pData->curMainMenu.uiIndex == 0 ) pData->curMainMenu.CenterImage = 0;
|
||||
|
||||
else pData->curMainMenu.CenterImage = (BOOLEAN) atol(pData->szCharData);
|
||||
}
|
||||
else if(strcmp(name, "ImagePositionRelative") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
if (pData->curMainMenu.uiIndex == 0 ) pData->curMainMenu.ImagePositionRelative = 0;
|
||||
|
||||
else pData->curMainMenu.ImagePositionRelative = (BOOLEAN) atol(pData->szCharData);
|
||||
}
|
||||
else if(strcmp(name, "ImagePositionX") == 0 && pData->curMainMenu.uiIndex > 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
@@ -193,57 +175,17 @@ mainMenuEndElementHandle(void *userData, const XML_Char *name)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
pData->curMainMenu.ImagePositionY = (INT32) atol(pData->szCharData);
|
||||
}
|
||||
else if(strcmp(name, "ImagePosition800x600X") == 0 && pData->curMainMenu.uiIndex > 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
pData->curMainMenu.ImagePosition800x600X = (INT32) atol(pData->szCharData);
|
||||
}
|
||||
else if(strcmp(name, "ImagePosition800x600Y") == 0 && pData->curMainMenu.uiIndex > 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
pData->curMainMenu.ImagePosition800x600Y = (INT32) atol(pData->szCharData);
|
||||
}
|
||||
else if(strcmp(name, "ImagePosition1024x768X") == 0 && pData->curMainMenu.uiIndex > 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
pData->curMainMenu.ImagePosition1024x768X = (INT32) atol(pData->szCharData);
|
||||
}
|
||||
else if(strcmp(name, "ImagePosition1024x768Y") == 0 && pData->curMainMenu.uiIndex > 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
pData->curMainMenu.ImagePosition1024x768Y = (INT32) atol(pData->szCharData);
|
||||
}
|
||||
}
|
||||
else if(strcmp(name, "MainMenuY") == 0 && pData->curMainMenu.uiIndex == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
pData->curMainMenu.MAINMENU_Y = (UINT32) atol(pData->szCharData);
|
||||
}
|
||||
else if(strcmp(name, "MainMenu800x600Y") == 0 && pData->curMainMenu.uiIndex == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
pData->curMainMenu.MAINMENU_800x600Y = (UINT32) atol(pData->szCharData);
|
||||
}
|
||||
else if(strcmp(name, "MainMenu1024x768Y") == 0 && pData->curMainMenu.uiIndex == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
pData->curMainMenu.MAINMENU_1024x768Y = (UINT32) atol(pData->szCharData);
|
||||
}
|
||||
}
|
||||
else if(strcmp(name, "MainMenuX") == 0 && pData->curMainMenu.uiIndex == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
pData->curMainMenu.MAINMENU_X = (UINT32) atol(pData->szCharData);
|
||||
}
|
||||
else if(strcmp(name, "MainMenu800x600X") == 0 && pData->curMainMenu.uiIndex == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
pData->curMainMenu.MAINMENU_800x600X = (UINT32) atol(pData->szCharData);
|
||||
}
|
||||
else if(strcmp(name, "MainMenu1024x768X") == 0 && pData->curMainMenu.uiIndex == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
pData->curMainMenu.MAINMENU_1024x768X = (UINT32) atol(pData->szCharData);
|
||||
}
|
||||
else if(strcmp(name, "MainMenuYSpace") == 0 && pData->curMainMenu.uiIndex == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
|
||||
+4
-11
@@ -12,23 +12,16 @@ typedef struct
|
||||
BOOLEAN Visible;
|
||||
CHAR8 Description[MAX_MAIN_MENU_CHARS];
|
||||
CHAR8 FileName[MAX_MAIN_MENU_CHARS];
|
||||
CHAR8 FileName800x600[MAX_MAIN_MENU_CHARS];
|
||||
CHAR8 FileName1024x768[MAX_MAIN_MENU_CHARS];
|
||||
BOOLEAN FitToScreen;
|
||||
BOOLEAN StretchImage;
|
||||
BOOLEAN CenterImage;
|
||||
BOOLEAN ImagePositionRelative;
|
||||
INT32 ImagePositionX;
|
||||
INT32 ImagePositionY;
|
||||
INT32 ImagePosition800x600X;
|
||||
INT32 ImagePosition800x600Y;
|
||||
INT32 ImagePosition1024x768X;
|
||||
INT32 ImagePosition1024x768Y;
|
||||
|
||||
UINT32 MAINMENU_Y;
|
||||
UINT32 MAINMENU_800x600Y;
|
||||
UINT32 MAINMENU_1024x768Y;
|
||||
UINT32 MAINMENU_Y_SPACE;
|
||||
|
||||
UINT32 MAINMENU_X;
|
||||
UINT32 MAINMENU_800x600X;
|
||||
UINT32 MAINMENU_1024x768X;
|
||||
|
||||
} MAIN_MENU_VALUES;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user