Ejemplo n.º 1
0
void CreditsWnd::Render() {
    if (!m_bRender)
        return;
    GG::Pt ul = UpperLeft(), lr = LowerRight();
    if (m_displayListID == 0) {
        // compile credits
        m_displayListID = glGenLists(1);
        glNewList(m_displayListID, GL_COMPILE);
        DrawCredits(ul.x+m_cx, ul.y+m_cy, ul.x+m_cx+m_cw, ul.y+m_cy+m_ch, 255);
        glEndList();
    }
    //time passed
    int passedTicks = GG::GUI::GetGUI()->Ticks() - m_start_time;

    //draw background
    GG::FlatRectangle(ul, lr, GG::FloatClr(0.0, 0.0, 0.0, 0.5), GG::CLR_ZERO,0);

    glPushAttrib(GL_ALL_ATTRIB_BITS );
    glPushMatrix();

    // define clip area
    glEnable(GL_SCISSOR_TEST);
    glScissor(Value(ul.x+m_cx), Value(GG::GUI::GetGUI()->AppHeight()- lr.y), m_cw, m_ch);

    // move credits
    glTranslatef(0, m_co + passedTicks / -40.0f, 0);

    if (m_displayListID != 0) {
        // draw credits using prepared display list
        // !!! in order for the display list to be valid, the font object (m_font) may not be destroyed !!!
        glCallList(m_displayListID);
    } else {
        // draw credits directly
        DrawCredits(ul.x+m_cx, ul.y+m_cy, ul.x+m_cx+m_cw, ul.y+m_cy+m_ch, 255);
    }

    glPopMatrix();
    glPopAttrib();

    //check if we are done
    if (m_creditsHeight + m_ch < m_co + passedTicks / 40.0)
        StopRendering();
}
Ejemplo n.º 2
0
void main()
{
    int sel = 0;

	redraw = 1;
	refresh = 1;
	

#ifndef CDROM
	xres_flags = XRES_SOFT;
	Enabled240p = 1;
	UseDefault = 0;
	EnabledSoft = 1;
	Enabled_C_BW = 0;
#endif

#ifdef CDROM
	RestoreGlobals();
#endif

#ifdef CDROM1	
	if(prev_select)
	{
		sel = prev_select;
		prev_select = 0;
	}
#endif

	disp_off();
	set_xres(320, xres_flags);
	if(Enabled240p)
		Set240p();

#ifndef CDROM
	disp_on();
	DrawIntro();
	disp_off();
#endif

    while(1)
    {   	
		vsync();
	
#ifdef CDROM1
		if(!HelpItem)
		{
#endif

        if(redraw)
        {
			RedrawMain();
            redraw = 0;
			refresh = 1;
			disp_on();
        }
		
		set_font_pal(15);
		
		if(refresh)
        {
            RefreshMain(sel);

            refresh = 0;
        }

        controller = joytrg(0);
		
		if (controller & JOY_SEL)
		{
#ifdef CDROM1
			x_g = 0;
#endif
			Options();
			redraw = 1;
		}
        
        if (controller & JOY_DOWN) 
        {
            sel++;
            if(sel > 14)
                sel = 0;
            refresh = 1;
        }

        if (controller & JOY_UP) 
        {
            sel--;
            if(sel < 0)
                sel = 14;
            refresh = 1;
        }
		
		if (controller & JOY_RUN)
		{
			showHelp(GENERAL_HELP);
			redraw = 1;
		}
#ifdef CDROM1
		}
		else
		{
			if(HelpItem <= OPTIONS_HELP)
			{
				sel = HelpItem;
				controller = JOY_I;
			}
				
			HelpItem = 0;
		}
#endif
		
		if (controller & JOY_I)
		{
			disp_off();
			ResetVideo();
			switch(sel)
			{
				case 0:
#ifndef CDROM1
					TestPatterns();
#else
					xres_flags_g = xres_flags;
					Enabled240p_g = Enabled240p;
					UseDefault_g = UseDefault;
					EnabledSoft_g = EnabledSoft;
					Enabled_C_BW_g = Enabled_C_BW;
					
					set_font_pal(14);
					put_string("Loading...", 27, 26);
					cd_execoverlay(PATTERNS_OVERLAY);
#endif
					break;
				case 1:
					DropShadow();
					break;
				case 2:
					StripedSprite();
					break;
				case 3:
					LagTest();
					break;
				case 4:
					ManualLagTest();
					break;
				case 5:
					ScrollTest();
					break;
				case 6:
					VScrollTest();
					break;
				case 7:
					DrawStripes();
					break;
				case 8:
					DrawCheck();
					break;
				case 9:
					LEDZoneTest();
					break;
				case 10:
					SoundTest();
					break;
				case 11:
					AudioSyncTest();
					break;
				case 12:
#ifdef CDROM1
					prev_select = sel;
#endif
					Options();
					break;
				case 13:
#ifdef CDROM1
					prev_select = sel;
#endif
					showHelp(GENERAL_HELP);
					break;
				case 14:
					DrawCredits();
					break;
			}
			redraw = 1;			
			disp_off();
		}
    }
}
Ejemplo n.º 3
0
void ShowEnding()
{
	int i;
	
	if (streamspr == NULL) {
		streamspr = IMG_Load("dat/i/stream.png");
		SDL_SetColorKey(streamspr, SDL_SRCCOLORKEY | SDL_RLEACCEL, 0);
		glitter = IMG_Load("dat/i/glitter.png");
		SDL_SetColorKey(glitter, SDL_SRCCOLORKEY | SDL_RLEACCEL, 0);
	}
	
	for (i = 0; i < 500; i += 1) {
		if (((i % 60) >= 24)&&((i % 60) < 34)) {
			DrawCircuitFlash((i % 60) - 24, 0);
		} else {
			DrawScrolly(i);
		}
		EndCycle(0);
		if (EndingEvents()) return;
	}
	for (i = 0; i < 30; i++) {
		DrawCircuitFlash(i, 1);
		
		EndCycle(0);
		if (EndingEvents()) return;
	}
	SDL_FillRect(screen, NULL, 255);
	for (i = 0; i < 350; i++) {
		DrawPText(i);
		EndCycle(0);
		if (EndingEvents()) return;
	}
	
	Paint(0, 0, 22, 27, "dat/d/cstream.loc");
	
	if (player_shield < 30) {
		for (i = 0; i < 400; i++) {
			DrawStream(i);
			EndCycle(0);
			if (EndingEvents()) return;
		}
		InitParticleStorm();
		for (i = 0; i < 240; i++) {
			RunParticleStorm(240-i);
			EndCycle(0);
			if (EndingEvents()) return;
		}
		for (i = 0; i < 60; i++) {
			RunParticleStorm(0);
			EndCycle(0);
			if (EndingEvents()) return;
		}
		for (i = 0; i < 180; i++) {
			RunParticleStorm(i*3);
			EndCycle(0);
			if (EndingEvents()) return;
		}
		for (i = 0; i < 500; i++) {
			DrawSText(i);
			EndCycle(0);
			if (EndingEvents()) return;
		}
	} else {
		for (i = 0; i < 250; i++) {
			DrawStream(i);
			EndCycle(0);
			if (EndingEvents()) return;
		}
		for (i = 0; i < 500; i++) {
			DrawSTextV(i);
			EndCycle(0);
			if (EndingEvents()) return;
		}
	}
	
	credits_scroll = 0;
	for (;;) {
		DrawCredits();
		EndCycle(0);
		if (EndingEvents()) return;
	}
}