Exemplo n.º 1
0
void drawDoors(void)
{
	int i;
	for(i=0;i<NUMDOORS;i++)
	{
		if(door[i].used)drawDoor(&door[i]);
	}
}
Exemplo n.º 2
0
void Chamber::drawChamber() {
    static float ambient[] = {1.0f, 1.0f, 1.0f, 1.0f};
    static float diffuse[] = {1.0f, 1.0f, 1.0f, 1.0f};
    static float specular[] = {1.0f, 1.0f, 1.0f, 1.0f};
    static float shininess = 40.0f;

    glCallList(listID);

    drawSphere();
    drawDoor(textures[8]);
    video.play();
}
Exemplo n.º 3
0
void drawElements(Map * level[6],int  xPos,int  yPos, Player * chris, int room, int width, int height, Enemy * enemy[20], int * eneNum)
{
    //decalre variables
    int xLoc, yLoc, exDigit, i;

    exDigit = 0;
    //create elements
    for (i = 0;i <= level[room]->eleNum;i++)
    {
        //if door
        if (level[room]->elements[i][0] == 'd')
        {
            //draw door
            drawDoor(xPos, yPos, level, room, width, height, i);

        }//end if door

        //any other element
        else
        {
            //parse element location
            yLoc = level[room]->elements[i][1] - '0';

            if((level[room]->elements[i][2] <= '9') &&
               (level[room]->elements[i][2] >= '0'))
            {
                yLoc = ((level[room]->elements[i][1] - '0') * 10) +
                        (level[room]->elements[i][2] - '0');
                exDigit = 1;
            }
            xLoc = level[room]->elements[i][3+exDigit] - '0';

            if((level[room]->elements[i][4 + exDigit] <= '9') &&
               (level[room]->elements[i][4 + exDigit] >= '0'))
            {
                xLoc = ((level[room]->elements[i][3 + exDigit] - '0') * 10)
                      + (level[room]->elements[i][4 + exDigit] - '0');
            }

            //reset variable
            exDigit = 0;

            //hero special case (sets initial hero data)
            if (level[room]->elements[i][0] == 'h')
            {
                createPlayer(level[room]->elements[i], room, chris, level, xLoc, yLoc);
            }
            //print element to screen
            mvaddch((yPos + yLoc), (xPos + xLoc), getFig(level[room]->elements[i][0]));

            //enemy special case (sets enemy data)
            if(level[room]->elements[i][0] == 'm' || level[room]->elements[i][0] == 'M')
            {
                createEnemy(level[room]->elements[i], room, enemy, *eneNum, level, xLoc, yLoc);
                (*eneNum)++;
            }

        }
    }//end element loop

}//end drawElements