Skip to content

Commit

Permalink
Scale the video subtitle font with the resolution used.
Browse files Browse the repository at this point in the history
  • Loading branch information
cybersphinx committed May 13, 2011
1 parent 8895d58 commit 9597d74
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
5 changes: 3 additions & 2 deletions lib/ivis_common/textdraw.h
Expand Up @@ -26,9 +26,10 @@

enum iV_fonts
{
font_regular,
font_large,
font_regular,
font_large,
font_small,
font_scaled,
};

#define PIE_TEXT_WHITE (-1)
Expand Down
5 changes: 5 additions & 0 deletions lib/ivis_opengl/textdraw.c
Expand Up @@ -214,6 +214,11 @@ void iV_SetFont(enum iV_fonts FontID)
glcFont(_glcFont_Regular);
break;

case font_scaled:
iV_SetTextSize(12.f * pie_GetVideoBufferHeight() / 480.f);
glcFont(_glcFont_Regular);
break;

case font_large:
iV_SetTextSize(21.f);
glcFont(_glcFont_Bold);
Expand Down
8 changes: 4 additions & 4 deletions src/seqdisp.c
Expand Up @@ -159,7 +159,7 @@ bool seq_RenderVideoToBuffer(const char* sequenceName, int seqCommand)
{
//start the ball rolling

iV_SetFont(font_regular);
iV_SetFont(font_scaled);
iV_SetTextColour(WZCOL_TEXT_BRIGHT);

/* We do *NOT* want to use the user-choosen resolution when we
Expand Down Expand Up @@ -248,7 +248,7 @@ static bool seq_StartFullScreenVideo(const char* videoName, const char* audioNam
}

cdAudio_Pause();
iV_SetFont(font_regular);
iV_SetFont(font_scaled);
iV_SetTextColour(WZCOL_TEXT_BRIGHT);

/* We do not want to enter loop_SetVideoPlaybackMode() when we are
Expand All @@ -262,7 +262,7 @@ static bool seq_StartFullScreenVideo(const char* videoName, const char* audioNam
// check to see if we need to pause, and set font each time
cdAudio_Pause();
loop_SetVideoPlaybackMode();
iV_SetFont(font_regular);
iV_SetFont(font_scaled);
iV_SetTextColour(WZCOL_TEXT_BRIGHT);
}

Expand Down Expand Up @@ -478,7 +478,7 @@ BOOL seq_AddTextForVideo(const char* pText, SDWORD xOffset, SDWORD yOffset, SDWO
// make sure we take xOffset into account, we don't always start at 0
const unsigned int BUFFER_WIDTH = pie_GetVideoBufferWidth() - xOffset;

iV_SetFont(font_regular);
iV_SetFont(font_scaled);

ASSERT(aSeqList[currentSeq].currentText < MAX_TEXT_OVERLAYS, "too many text lines");

Expand Down

0 comments on commit 9597d74

Please sign in to comment.