credits.cpp File Reference

#include "stdafx.h"

Include dependency graph for credits.cpp:

Go to the source code of this file.

Functions

int Credits (gcn::OpenGLGraphics *graphics, gcn::ImageFont *font)
 scroll credits on the screen
int creditsReadPage (FILE *file, char *page)
 read in a page of text from credits file
int boxOpposite (int boxDir)
 return the opposite direction code


Function Documentation

int boxOpposite ( int  boxDir  ) 

Return a direction code which is 'opposite' the one passed in. This is used by the code which draws the credits background (box random walk). This is basically a look-up table and could possibly be made more elegant.

Definition at line 394 of file credits.cpp.

int Credits ( gcn::OpenGLGraphics *  graphics,
gcn::ImageFont *  font 
)

Scroll credits on the screen while displaying an interesting background. The credits file is read from disk, and displayed using a system of two 'page buffers' which are scrolled upwards, and periodically refreshed with new text and repositioned once they reach the top of the screen.

Todo:
This function reads from the disk each time the page buffers are reloaded. This should be changed to maintain a memory buffer of the entire credits file.

Definition at line 38 of file credits.cpp.

References creditsReadPage(), DAS_ERROR, GetMenuInput(), MENUINPUT_ESCAPE, PAGE_HEIGHT, PAGE_WIDTH, PlaySound(), SCREEN_HEIGHT, SCREEN_WIDTH, and SOUNDID_MENUSELECT.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

int creditsReadPage ( FILE *  file,
char *  page 
)

Read in a page of text from the credits file on disk. This function depends on the text file being formatted with newline characters at the end of each line only, and may fail if used with text files formatted on other systems (Apple, Linux, etc.)

Definition at line 353 of file credits.cpp.

References DAS_ERROR, PAGE_HEIGHT, and PAGE_WIDTH.

Referenced by Credits().

Here is the caller graph for this function:

 

Copyright Windsor Schmidt 2006 - All rights reserved.