src/menucode.cpp
// THE MAIN CODE
// drawFrame *************
// Draw the current frame on screen.
// Only return false for non-recover errors (not for lost surfaces,
// for example).

THE MAIN CODE
drawFrame
Draw the current frame on screen.
Only return false for non-recover errors (not for lost surfaces,
for example).
THE MAIN CODE drawFrame Draw the current frame on screen . Only return false for non - recover errors ( not for lost surfaces for example ) .
bool MenuLoopCode::drawFrame()
{
	lua_State* lstate;
	int errCode;
	if (screenLightness==255) {
		screenBuffer=&DD;
	}else{
		screenBuffer=getSurfaceByResourceName("srfScreenSizedBuffer");
	}
	screenBuffer->fillAllDword(0);
	lstate=scriptMan.getLuaObject();
	lua_getglobal(lstate, "errorManager");
	lua_getglobal(lstate, "drawFrame");
	errCode=lua_pcall(lstate, 0, 0, -2);
	lua_pop(lstate, 1);
	if (errCode!=0) {
		lua_pop(lstate,1);
		logger.logLine("Error calling pcall over drawFrame");
		return false;
	}
	if (screenLightness!=255) {
		DD.obscuredBltFrom(*screenBuffer,
			0, 0,
			(unsigned char)(screenLightness),
			false);
	}
	return true;
}
bool MenuLoopCode :: drawFrame ( ) { lua_State * lstate ; int errCode ; if ( screenLightness == 255 ) { screenBuffer = & DD ; } else { screenBuffer = getSurfaceByResourceName ( " " ) ; } screenBuffer -> fillAllDword ( 0 ) ; lstate = scriptMan . getLuaObject ( ) ; lua_getglobal ( lstate , " " ) ; lua_getglobal ( lstate , " " ) ; errCode = lua_pcall ( lstate , 0 , 0 , -2 ) ; lua_pop ( lstate , 1 ) ; if ( errCode != 0 ) { lua_pop ( lstate , 1 ) ; logger . logLine ( " " ) ; return false ; } if ( screenLightness != 255 ) { DD . obscuredBltFrom ( * screenBuffer , 0 , 0 , ( unsigned char ) ( screenLightness ) , false ) ; } return true ; }
THE MAIN CODE
drawFrame 
Draw the current frame on screen.
THE MAIN CODE drawFrame Draw the current frame on screen .
// let's see whether we need a buffer or not
 // we don't need that buffer
 // we need the buffer
 // REVISE LATER BEGIN
 // first go and black all down
 // REVISE LATER END
 // DRAW THE SCREEN FOR THE MAIN MENU
 // execute the lua code that manages menu drawing
 // take errorManager off the stack
 // there is an extra value there...
 // let's see whether we used the buffer or not, and manage the
 // light of the screen
 // we used it, so let's blt it to the screen
 // surface
 // coordinates
 // lightness
 // transparent?
 // all ok
