Added TheUI.Offset640X and TheUI.Offset480Y

This commit is contained in:
jsalmon3 2002-06-18 18:55:39 +00:00
parent 0e7cb718e0
commit 26a005e788
3 changed files with 18 additions and 11 deletions

View file

@ -347,7 +347,7 @@ global void ShowIntro(const Intro *intro)
int OldVideoSyncSpeed;
UseContinueButton=1;
InitContinueButton((VideoWidth-640)/2+455,(VideoHeight-480)/2+440);
InitContinueButton(TheUI.Offset640X+455,TheUI.Offset480Y+440);
GameCursor=TheUI.Point.Cursor;
DestroyCursorBackground();
@ -405,13 +405,13 @@ global void ShowIntro(const Intro *intro)
}
}
x=(VideoWidth-640)/2;
x=TheUI.Offset640X;
line=0;
stage=1;
IntroNoEvent=1;
c=0;
while( 1 ) {
y=(VideoHeight-480)/2;
y=TheUI.Offset480Y;
if( !PlayingMusic && stage<MAX_BRIEFING_VOICES &&
intro->VoiceFile[stage] ) {
PlayFile(intro->VoiceFile[stage]);
@ -543,12 +543,12 @@ global void ShowCredits(Credits *credits)
}
UseContinueButton=1;
InitContinueButton((VideoWidth-640)/2+455,(VideoHeight-480)/2+440);
InitContinueButton(TheUI.Offset640X+455,TheUI.Offset480Y+440);
GameCursor=TheUI.Point.Cursor;
DestroyCursorBackground();
x=(VideoWidth-640)/2;
y=(VideoHeight-480)/2;
x=TheUI.Offset640X;
y=TheUI.Offset480Y;
IntroNoEvent=1;
line=0;
scrolling=1;
@ -800,8 +800,8 @@ local int GameStatsDrawFunc(int frame)
if( (frame%StatsPause)!=0 )
return done;
x=(VideoWidth-640)/2;
y=(VideoHeight-480)/2;
x=TheUI.Offset640X;
y=TheUI.Offset480Y;
dodraw=frame/StatsPause;
for( i=0,c=0; i<PlayerMax; i++) {
@ -1147,7 +1147,7 @@ global void ShowStats(void)
VideoUnlockScreen();
UseContinueButton=1;
InitContinueButton((VideoWidth-640)/2+455,(VideoHeight-480)/2+440);
InitContinueButton(TheUI.Offset640X+455,TheUI.Offset480Y+440);
GameCursor=TheUI.Point.Cursor;
DestroyCursorBackground();

View file

@ -256,6 +256,10 @@ typedef struct _ui_ {
/// used for displaying unit training queues
Button Buttons2[6];
// Offsets for 640x480 center used by menus
int Offset640X; /// Offset for 640x480 X position
int Offset480Y; /// Offset for 640x480 Y position
//
// Cursors used.
//

View file

@ -1385,6 +1385,9 @@ local SCM CclDefineMenu(SCM list)
DebugLevel3Fn("Define menu\n");
TheUI.Offset640X = (VideoWidth - 640) / 2;
TheUI.Offset480Y = (VideoHeight - 480) / 2;
//
// Parse the arguments, already the new tagged format.
//
@ -1472,8 +1475,8 @@ local SCM CclDefineMenu(SCM list)
}
} else {
//printf("VideoWidth = %d\n", VideoWidth);
menu->x += (VideoWidth - 640) / 2;
menu->y += (VideoHeight - 480) / 2;
menu->x += TheUI.Offset640X;
menu->y += TheUI.Offset480Y;
}
}
//printf("Me:%s\n", name);