Exemplo n.º 1
0
void cBuilder::roomChange( int pNumber ) {

	if( mCurrentObject && mCurrentObject->partGet(0)->mPlaced == false ) {
		mCurrentRoom->objectDelete( mCurrentObject );
		delete mCurrentObject;
		mCurrentObject = 0;
	}

	if( mLinkMode ) {
		mOriginalRoom = mCurrentRoom;
		mOriginalObject = mCurrentObject;
	}

	mCurrentRoom = mCastle->roomCreate( this, pNumber );
	
	save( false );	

	// Set the room number in the window title
	mScreen->roomNumberSet( pNumber );

	if( pNumber == -1) {

		screenClear();
		mObjectPtr = readLEWord( &mMemory[ 0x785F ] );
		roomPrepare();

	} else {
		mMemory[ 0x7809 ] = pNumber;
		mMemory[ 0x780A ] = pNumber;
		roomLoad();
	}

	playerDraw();
}
Exemplo n.º 2
0
void draw()
{

    glColor4f(1,1,1,1);
    glClear(GL_COLOR_BUFFER_BIT);

    switch(appState)
    {
    case APPSTATE_INTRO:
        drawImage(&images[IMG_INTRO], SCRW/2-images[IMG_INTRO].w/2,
                  SCRH/2-images[IMG_INTRO].h/2, NULL);
        break;

    case APPSTATE_MENU:
        menuDraw();
        break;

    case APPSTATE_GAME:

        levelDrawAllTheRest();

        itemsDraw();
        portalDraw();
        bulletDraw(1); /* bullets shot by player */
        playerDraw();
        idiotDraw();
        drunkenbotDraw();
        bulletDraw(0); /* all the rest */
        turretDraw();
        bossDraw();

        levelDrawForeground();

        /* Darkness layer here */
        if(currentLevel.flags & IS_DARK_LEVEL)
            drawImage(&images[IMG_DARKNESS], player.posX-(SCRW+STEP/2), player.posY-(SCRH+STEP/2), NULL);

        /* Boss' HP bar */
        bossDrawHPBar();

        break;

    case APPSTATE_GAMEOVER:

        gameoverDraw();
        break;
    }

    /* Text line */
    textDraw();

    SDL_GL_SwapBuffers();

}
Exemplo n.º 3
0
void cBuilder::castlePrepare( ) {
	save( false );

	// Final Room?
	if( (char) mCurrentRoom->mNumber == -1) {
		screenClear();
		mObjectPtr = readLEWord( &mMemory[ 0x785F ] );
		roomPrepare();

	} else {
		mMemory[ 0x7809 ] = mCurrentRoom->mNumber;
		mMemory[ 0x780A ] = mCurrentRoom->mNumber;
		roomLoad();
	}

	// Print any strings
	objectStringsPrint();

	// Force draw of sprites
	Sprite_Execute();
	object_Execute();

	playerDraw();
}