Exemplo n.º 1
0
void
plmap( void ( *mapform )( PLINT, PLFLT *, PLFLT * ), const char *name,
       PLFLT minx, PLFLT maxx, PLFLT miny, PLFLT maxy )
{
    drawmap( mapform, name, 0.0, 0.0, SHPT_ARC, 0.0, NULL, minx, maxx,
        miny, maxy, NULL, 0 );
}
Exemplo n.º 2
0
int gamedraw(void){

  /* Calculate Timings for this Frame */
  timeframe();

  /* Set up a Blank Screen To Draw on */
  glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
  glLoadIdentity();

  /* Set the camera focusing on player 10 units away */
  camera(player,10);

  /* Begin Drawing the Level */
  skybox(5000,3000,5000);
  drawmap(&course[loadc]);

  /* Draw the Ship */
	if(tushar==0)
  ship();

  /* Draw The HUD Items */
  drawhud();

  /* Draw it to the screen */
  SDL_GL_SwapBuffers();
  return 1;
}
Exemplo n.º 3
0
//New version of plmap which allows us to specify which items in a shapefile
//we want to use. parameters are as above but with the plotentries being an
//array containing the indices of the elements we wish to draw and
//nplotentries being the number of items in plotentries.
//If shapefile access was not built into plplot then plotentries and
//nplotentries are ignored. If plotentries is null than all entries are
//drawn and nplotentries is ignored.
//The name distiguishes it from other functions which plot points/text and
//polygons, but note that the type of element in the shapefile need not
//match the type of element drawn - i.e. arc elements from a shapefile could
//be drawn as points using the plmaptex function.
//--------------------------------------------------------------------------
void
plmapline( void ( *mapform )( PLINT, PLFLT *, PLFLT * ), const char *name,
           PLFLT minx, PLFLT maxx, PLFLT miny, PLFLT maxy,
           const PLINT *plotentries, PLINT nplotentries )
{
    drawmap( mapform, name, 0.0, 0.0, SHPT_ARC, 0.0, "", minx, maxx,
        miny, maxy, plotentries, nplotentries );
}
Exemplo n.º 4
0
//--------------------------------------------------------------------------
// void plmapfill( void ( *mapform )( PLINT, PLFLT *, PLFLT * ),
//		const char *name, PLFLT minx, PLFLT maxx, PLFLT miny,
//		PLFLT maxy, const PLINT *plotentries, PLINT nplotentries);
//
//As per plmapline but plots a filled polygon. The map equivalent to
//plfill. Uses the pattern defined by plsty or plpat.
//--------------------------------------------------------------------------
void
plmapfill( void ( *mapform )( PLINT, PLFLT *, PLFLT * ),
           const char *name, PLFLT minx, PLFLT maxx, PLFLT miny,
           PLFLT maxy, const PLINT *plotentries, PLINT nplotentries )
{
    drawmap( mapform, name, 0.0, 0.0, SHPT_POLYGON, 0.0, NULL, minx, maxx,
        miny, maxy, plotentries, nplotentries );
}
Exemplo n.º 5
0
//--------------------------------------------------------------------------
// void plmapstring( void ( *mapform )( PLINT, PLFLT *, PLFLT * ),
//		const char *name, PLFLT just, const char *string,
//		PLFLT minx, PLFLT maxx, PLFLT miny, PLFLT maxy,
//		const PLINT *plotentries, PLINT nplotentries);
//
//As per plmapline but plots symbols. The map equivalent of plstring. string
//has the same meaning as in plstring.
//--------------------------------------------------------------------------
void
plmapstring( void ( *mapform )( PLINT, PLFLT *, PLFLT * ),
             const char *name, const char *string,
             PLFLT minx, PLFLT maxx, PLFLT miny, PLFLT maxy,
             const PLINT *plotentries, PLINT nplotentries )
{
    drawmap( mapform, name, 1.0, 0.0, SHPT_POINT, 0.5, string, minx, maxx,
        miny, maxy, plotentries, nplotentries );
}
Exemplo n.º 6
0
//--------------------------------------------------------------------------
// void plmaptex( void ( *mapform )( PLINT, PLFLT *, PLFLT * ),
//		const char *name, PLFLT dx, PLFLT dy PLFLT just, const char *text,
//		PLFLT minx, PLFLT maxx, PLFLT miny, PLFLT maxy,
//		PLINT plotentry);
//
//As per plmapline but plots text. The map equivalent of plptex. dx, dy,
//just and text have the same meaning as in plptex.
//--------------------------------------------------------------------------
void
plmaptex( void ( *mapform )( PLINT, PLFLT *, PLFLT * ),
          const char *name, PLFLT dx, PLFLT dy, PLFLT just, const char *text,
          PLFLT minx, PLFLT maxx, PLFLT miny, PLFLT maxy,
          PLINT plotentry )
{
    drawmap( mapform, name, dx, dy, SHPT_POINT, just, text, minx, maxx,
        miny, maxy, &plotentry, 1 );
}
Exemplo n.º 7
0
void main()
{
  int room=get_location();
  // Header
  printf("Content-type: text/html%c%c",LF,LF); 
  cat("laytop.html");
  drawmap(room);
  cat("laybot.html");
}
Exemplo n.º 8
0
Arquivo: kbmap.c Projeto: aahud/harvey
void
redraw(Image *screen)
{
	int i;

	draw(screen, screen->r, lightblue, nil, ZP);
	for(i=0; i<nmap; i++)
		drawmap(i);
	flushimage(display, 1);
}
Exemplo n.º 9
0
void NETHER::draw_game(bool shadows)
{
	{
		MINY=-8*zoom;
		MINX=-(10+viewp.z*4)*zoom;
		MAXY=(9+viewp.z*4)*zoom;
		MAXX=8*zoom;
	}

	if (!explosions.EmptyP()) {
		int minstep=128;
		List<EXPLOSION> l;
		EXPLOSION *n;
		float offs=0.0,r;

		l.Instance(explosions);
		l.Rewind();
		while(l.Iterate(n)) {
			if (n->size==2 && n->step<minstep) minstep=n->step;
		} /* while */ 

		r=(128-minstep)/256.0;
		offs=sin(minstep)*r;

		gluLookAt(viewp.x+camera.x*zoom+offs,viewp.y+camera.y*zoom+offs,viewp.z+camera.z*zoom,viewp.x+offs,viewp.y+offs,viewp.z,0,0,1);
	} else {
		gluLookAt(viewp.x+camera.x*zoom,viewp.y+camera.y*zoom,viewp.z+camera.z*zoom,viewp.x,viewp.y,viewp.z,0,0,1);
	} /* if */ 

    glMatrixMode(GL_MODELVIEW);
    glLoadIdentity();

	/* Draw: */ 

	/* Draw the map: */ 
	drawmap(shadows);

	/* Draw the robots and bullets: */ 
	{
		int i;
		List<ROBOT> l;
		List<BULLET> l2;
		ROBOT *r;
		BULLET *b; 

		for(i=0;i<2;i++) {
			l.Instance(robots[i]);
			l.Rewind();
			while(l.Iterate(r)) {
				if (r->pos.y>=(viewp.y+MINY) &&
					r->pos.y<=(viewp.y+MAXY) &&
					r->pos.x>=(viewp.x+MINX) &&
					r->pos.x<=(viewp.x+MAXX)) {
					glPushMatrix();
					glTranslatef(r->pos.x,r->pos.y,r->pos.z);
					DrawRobot(r,i,shadows);
					glPopMatrix();
				} /* if */ 
			} /* while */ 
		} /* for */ 

		l2.Instance(bullets);
		l2.Rewind();
		while(l2.Iterate(b)) {
			if (b->pos.y>=(viewp.y+MINY) &&
				b->pos.y<=(viewp.y+MAXY) &&
				b->pos.x>=(viewp.x+MINX) &&
				b->pos.x<=(viewp.x+MAXX)) {
				glPushMatrix();
				glTranslatef(b->pos.x,b->pos.y,b->pos.z);
				DrawBullet(b,shadows);
				glPopMatrix();
			} /* if */ 
		} /* while */ 
	}

	/* Draw the ship: */ 
	glPushMatrix();
	glTranslatef(shipp.x,shipp.y,shipp.z);
	if (!shadows) ship->draw(0.7,0.7,0.7);
	glPopMatrix();

	if (shadows) {
		float sx,sy;
		float x[2],y[2];
		float minz;
		Vector light;

		light=lightposv;
		light=light/light.z;

		sx=shipp.x-light.x*shipp.z;
		sy=shipp.y-light.y*shipp.z;

		if (controlled==0) {
			x[0]=sx+ship->shdw_cmc.x[0];
			x[1]=sx+ship->shdw_cmc.x[1];
			y[0]=sy+ship->shdw_cmc.y[0];
			y[1]=sy+ship->shdw_cmc.y[1];
			minz=MapMaxZ(x,y);
		} else {
			minz=controlled->pos.z;
		} /* if */ 

		glPushMatrix();
		glTranslatef(sx,sy,minz+0.05);
		if (shadows) ship->DrawShadow(0,0,0,0.5);
		glPopMatrix();
	} 

	/* Draw the extras: */ 
	
	/* Draw nuclear explosions: */ 
	if (!shadows) {
		List<EXPLOSION> l;
		EXPLOSION *n;
		float a,r;

		l.Instance(explosions);
		l.Rewind();
		while(l.Iterate(n)) {
			a=(128.0f-n->step)/80.0f;
			r=1.0;
			if (n->size==0) {
				r=(float(n->step)/512.0f)+0.1;
			} /* if */ 
			if (n->size==1) {
				r=(float(n->step)/96.0f)+0.5;
			} /* if */ 
			if (n->size==2) {
				r=(float(n->step)/48.0f)+1.0;
			} /* if */ 
			if (a<0) a=0;
			if (a>1) a=1;

			glPushMatrix();
			glTranslatef(n->pos.x,n->pos.y,n->pos.z);		
			glColor4f(1.0f,0.5f,0.0,a);
			glDepthMask(GL_FALSE);
			glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
			glEnable(GL_BLEND);
			glutSolidSphere(r,8,8);
			glDisable(GL_BLEND);
			glDepthMask(GL_TRUE);
			glPopMatrix();
		} /* while */ 
	}

	/* Draw the particles: */ 
	if (!shadows) {
		List<PARTICLE> l;
		PARTICLE *p;

		l.Instance(particles);
		l.Rewind();
		while(l.Iterate(p)) {
			if (p->pos.y>=(viewp.y+MINY) &&
				p->pos.y<=(viewp.y+MAXY) &&
				p->pos.x>=(viewp.x+MINX) &&
				p->pos.x<=(viewp.x+MAXX)) DrawParticle(p);
		} /* if */ 

	} /* if */ 

} /* NETHER::draw_screen */ 
Exemplo n.º 10
0
/*! \brief Do the Quest Info menu
 *
 * Show the current list of quest information items
 * \sa ILIST
 * \author PH
 * \date 20050429
 */
static void quest_info(void)
{
    int ii = 0;
    int i, base;

    /* Call into the script */
    ilist_clear(&quest_list);
    do_questinfo();
    if (quest_list.count == 0)
    {
        /* There was nothing.. */
        play_effect(SND_BAD, 128);
        return;
    }

    while (1)
    {
        timer_count = 0;
        drawmap();
        base = ii - ii % 10;
        menubox(double_buffer, 88 + xofs, 92 + yofs, 18, 10, BLUE);
        menubox(double_buffer, 88 + xofs, 188 + yofs, 18, 3, BLUE);
        for (i = 0; i < 10; ++i)
        {
            if (i + base < quest_list.count)
            {
                print_font(double_buffer, 104 + xofs, 100 + 8 * i + yofs, quest_list.root[i + base].key, FNORMAL);
            }
        }
        draw_sprite(double_buffer, menuptr, 88 + xofs, 100 + 8 * (ii - base) + yofs);
        if (ii < quest_list.count)
        {
            print_font(double_buffer, 96 + xofs, 196 + yofs, quest_list.root[ii].text, FNORMAL);
        }
        blit2screen(xofs, yofs);
        readcontrols();
        if (PlayerInput.up)
        {
            --ii;
            play_effect(SND_CLICK, 128);
            unpress();
        }
        if (PlayerInput.down)
        {
            ++ii;
            play_effect(SND_CLICK, 128);
            unpress();
        }
        if (PlayerInput.left)
        {
            ii -= 10;
            play_effect(SND_CLICK, 128);
            unpress();
        }
        if (PlayerInput.right)
        {
            ii += 10;
            play_effect(SND_CLICK, 128);
            unpress();
        }
        if (ii < 0)
        {
            ii = quest_list.count - 1;
        }
        if (ii >= quest_list.count)
        {
            ii = 0;
        }
        if (PlayerInput.balt || PlayerInput.bctrl)
        {
            unpress();
            return;
        }
    }
}
Exemplo n.º 11
0
/*! \brief Main menu
 *
 * Main menu that calls all the other little menus :)
 */
void menu(void)
{
    int stop = 0, ptr = 0, z = -1;

    play_effect(SND_MENU, 128);
    timer_count = 0;
    while (!stop)
    {
        check_animation();
        drawmap();
        draw_mainmenu(-1);
        draw_sprite(double_buffer, menuptr, 204 + xofs, ptr * 8 + 73 + yofs);
        blit2screen(xofs, yofs);
        readcontrols();
        if (PlayerInput.up)
        {
            unpress();
            ptr--;
            if (ptr < 0)
            {
                ptr = 5;
            }
            play_effect(SND_CLICK, 128);
        }
        if (PlayerInput.down)
        {
            unpress();
            ptr++;
            if (ptr > 5)
            {
                ptr = 0;
            }
            play_effect(SND_CLICK, 128);
        }
        /* Allow player to rearrange the party at any time by pressing LEFT */
        if (PlayerInput.left)
        {
            z = select_player();
            if (z > 0)
            {
                party_newlead();
            }
        }
        if (PlayerInput.balt)
        {
            unpress();
            switch (ptr)
            {
                case 0:
                    camp_item_menu();
                    break;
                case 3:
                    spec_items();
                    break;
                case 5:
                    quest_info();
                    break;
                default:
                    z = select_player();
                    if (z >= 0)
                    {
                        switch (ptr)
                        {
                            case 1:
                                camp_spell_menu(z);
                                break;
                            case 2:
                                equip_menu(z);
                                break;
                            case 4:
                                status_screen(z);
                                break;
                        }
                    }
                    break;
            }
        }
        if (PlayerInput.bctrl)
        {
            unpress();
            stop = 1;
        }
        if (close_menu == 1)
        {
            close_menu = 0;
            stop = 1;
        }
    }
}
Exemplo n.º 12
0
/*! \brief Draw a player's status screen
 *
 * Draw the verbose stats of a single player.
 * \param   fighter_index - Character to draw (index in pidx array)
 */
static void status_screen(size_t fighter_index)
{
    int stop = 0;
    int bc = 0;
    unsigned int rect_fill_amount = 0, curr_fill, res_index, stats_y, equipment_index;
    size_t pidx_index, stats_index;

    play_effect(SND_MENU, 128);
    pidx_index = pidx[fighter_index];
    update_equipstats();
    while (!stop)
    {
        check_animation();
        // Redraw the map, clearing any menus under this new window
        drawmap();

        // Box around top-left square
        menubox(double_buffer, xofs, 16 + yofs, 18, 5, BLUE);
        draw_playerstat(double_buffer, pidx_index, 8 + xofs, 24 + yofs);

        // Box around bottom-left square
        menubox(double_buffer, xofs, 72 + yofs, 18, 17, BLUE);
        print_font(double_buffer, 8 + xofs, 80 + yofs, _("Exp:"), FGOLD);
        sprintf(strbuf, "%d", party[pidx_index].xp);
        print_font(double_buffer, 152 - (strlen(strbuf) * 8) + xofs, 80 + yofs, strbuf, FNORMAL);
        print_font(double_buffer, 8 + xofs, 88 + yofs, _("Next:"), FGOLD);
        // TT: Does this mean we can only level up to 50?
        if (party[pidx_index].lvl < 50)
        {
            sprintf(strbuf, "%d", party[pidx_index].next - party[pidx_index].xp);
        }
        else
        {
            sprintf(strbuf, "%d", 0);
        }
        print_font(double_buffer, 152 - (strlen(strbuf) * 8) + xofs, 88 + yofs, strbuf, FNORMAL);
        print_font(double_buffer, 8 + xofs, 104 + yofs, _("Strength"), FGOLD);
        print_font(double_buffer, 8 + xofs, 112 + yofs, _("Agility"), FGOLD);
        print_font(double_buffer, 8 + xofs, 120 + yofs, _("Vitality"), FGOLD);
        print_font(double_buffer, 8 + xofs, 128 + yofs, _("Intellect"), FGOLD);
        print_font(double_buffer, 8 + xofs, 136 + yofs, _("Sagacity"), FGOLD);
        print_font(double_buffer, 8 + xofs, 144 + yofs, _("Speed"), FGOLD);
        print_font(double_buffer, 8 + xofs, 152 + yofs, _("Aura"), FGOLD);
        print_font(double_buffer, 8 + xofs, 160 + yofs, _("Spirit"), FGOLD);
        // Blank space on display of 16 pixels
        print_font(double_buffer, 8 + xofs, 176 + yofs, _("Attack"), FGOLD);
        print_font(double_buffer, 8 + xofs, 184 + yofs, _("Hit"), FGOLD);
        print_font(double_buffer, 8 + xofs, 192 + yofs, _("Defense"), FGOLD);
        print_font(double_buffer, 8 + xofs, 200 + yofs, _("Evade"), FGOLD);
        print_font(double_buffer, 8 + xofs, 208 + yofs, _("Mag.Def"), FGOLD);
        for (stats_index = 0; stats_index < NUM_STATS; stats_index++)
        {
            // Coordinates of stats on display
            stats_y = stats_index * 8 + 104;
            // Add an extra 8-pixel space to separate these from the others
            if (stats_index > A_SPI)
            {
                stats_y += 8;
            }
            print_font(double_buffer, 96 + xofs, stats_y + yofs, "$", FGOLD);
            sprintf(strbuf, "%d", fighter[fighter_index].stats[stats_index]);
            print_font(double_buffer, 152 - (strlen(strbuf) * 8) + xofs, stats_y + yofs, strbuf, FNORMAL);
        }

        menubox(double_buffer, 160 + xofs, 16 + yofs, 18, 16, BLUE);
        print_font(double_buffer, 168 + xofs, 24 + yofs, _("Earth"), FNORMAL);
        print_font(double_buffer, 168 + xofs, 32 + yofs, _("Black"), FNORMAL);
        print_font(double_buffer, 168 + xofs, 40 + yofs, _("Fire"), FNORMAL);
        print_font(double_buffer, 168 + xofs, 48 + yofs, _("Thunder"), FNORMAL);
        print_font(double_buffer, 168 + xofs, 56 + yofs, _("Air"), FNORMAL);
        print_font(double_buffer, 168 + xofs, 64 + yofs, _("White"), FNORMAL);
        print_font(double_buffer, 168 + xofs, 72 + yofs, _("Water"), FNORMAL);
        print_font(double_buffer, 168 + xofs, 80 + yofs, _("Ice"), FNORMAL);
        print_font(double_buffer, 168 + xofs, 88 + yofs, _("Poison"), FNORMAL);
        print_font(double_buffer, 168 + xofs, 96 + yofs, _("Blind"), FNORMAL);
        print_font(double_buffer, 168 + xofs, 104 + yofs, _("Charm"), FNORMAL);
        print_font(double_buffer, 168 + xofs, 112 + yofs, _("Paralyze"), FNORMAL);
        print_font(double_buffer, 168 + xofs, 120 + yofs, _("Petrify"), FNORMAL);
        print_font(double_buffer, 168 + xofs, 128 + yofs, _("Silence"), FNORMAL);
        print_font(double_buffer, 168 + xofs, 136 + yofs, _("Sleep"), FNORMAL);
        print_font(double_buffer, 168 + xofs, 144 + yofs, _("Time"), FNORMAL);

        for (res_index = 0; res_index < R_TOTAL_RES; res_index++)
        {
            rectfill(double_buffer, 240 + xofs, res_index * 8 + 25 + yofs, 310 + xofs, res_index * 8 + 31 + yofs, 3);
            if (fighter[fighter_index].res[res_index] < 0)
            {
                bc = 18;            // bright red, meaning WEAK defense
                rect_fill_amount = abs(fighter[fighter_index].res[res_index]);
            }
            else if (fighter[fighter_index].res[res_index] >= 0 && fighter[fighter_index].res[res_index] <= 10)
            {
                bc = 34;            // bright green, meaning so-so defense
                rect_fill_amount = fighter[fighter_index].res[res_index];
            }
            else if (fighter[fighter_index].res[res_index] > 10)
            {
                bc = 50;            // bright blue, meaning STRONG defense
                rect_fill_amount = fighter[fighter_index].res[res_index] - 10;
            }

            if (rect_fill_amount > 0)
            {
                for (curr_fill = 0; curr_fill < rect_fill_amount; curr_fill++)
                {
                    rectfill(double_buffer, curr_fill * 7 + 241 + xofs, res_index * 8 + 26 + yofs, curr_fill * 7 + 246 + xofs, res_index * 8 + 30 + yofs, bc + curr_fill);
                }
            }
        }
        menubox(double_buffer, 160 + xofs, 160 + yofs, 18, 6, BLUE);
        for (equipment_index = 0; equipment_index < NUM_EQUIPMENT; equipment_index++)
        {
            draw_icon(double_buffer, items[party[pidx_index].eqp[equipment_index]].icon, 168 + xofs, equipment_index * 8 + 168 + yofs);
            print_font(double_buffer, 176 + xofs, equipment_index * 8 + 168 + yofs, items[party[pidx_index].eqp[equipment_index]].name, FNORMAL);
        }
        blit2screen(xofs, yofs);
        readcontrols();

        if (PlayerInput.left && fighter_index > 0)
        {
            unpress();
            fighter_index--;
            pidx_index = pidx[fighter_index];
            play_effect(SND_MENU, 128);
        }
        if (PlayerInput.right && fighter_index < numchrs - 1)
        {
            unpress();
            fighter_index++;
            pidx_index = pidx[fighter_index];
            play_effect(SND_MENU, 128);
        }
        if (PlayerInput.bctrl)
        {
            unpress();
            play_effect(SND_MENU, 128);
            stop = 1;
        }
    }
}
Exemplo n.º 13
0
/*! \brief Show special items
 *
 * List any special items that the party has.
 *
 * WK: This function would be more appropriate in a script, such as global.lua.
 * This function is preventing me from completely removing progress.h
 */
void spec_items(void)
{
    int a, num_items = 0, stop = 0, ptr = 0;
    short list_item_which[MAX_PLAYER_SPECIAL_ITEMS];
    short list_item_quantity[MAX_PLAYER_SPECIAL_ITEMS];

    /* Set number of items here */
    for (a = 0; a < MAX_SPECIAL_ITEMS; a++)
    {
        if (player_special_items[a])
        {
            list_item_which[num_items] = a;
            list_item_quantity[num_items] = player_special_items[a];
            num_items++;
        }
    }

    if (num_items == 0)
    {
        play_effect(SND_BAD, 128);
        return;
    }
    play_effect(SND_MENU, 128);
    while (!stop)
    {
        check_animation();
        drawmap();
        menubox(double_buffer, 72 + xofs, 12 + yofs, 20, 1, BLUE);
        print_font(double_buffer, 108 + xofs, 20 + yofs, _("Special Items"), FGOLD);
        menubox(double_buffer, 72 + xofs, 36 + yofs, 20, 19, BLUE);
        for (a = 0; a < num_items; a++)
        {
            draw_icon(double_buffer, special_items[list_item_which[a]].icon, 88 + xofs, a * 8 + 44 + yofs);
            print_font(double_buffer, 96 + xofs, a * 8 + 44 + yofs, special_items[list_item_which[a]].name, FNORMAL);
            if (list_item_quantity[a] > 1)
            {
                sprintf(strbuf, "^%d", list_item_quantity[a]);
                print_font(double_buffer, 224 + xofs, a * 8 + 44 + yofs, strbuf, FNORMAL);
            }
        }
        menubox(double_buffer, 72 + xofs, 204 + yofs, 20, 1, BLUE);
        a = strlen(special_items[list_item_which[ptr]].description) * 4;
        print_font(double_buffer, 160 - a + xofs, 212 + yofs, special_items[list_item_which[ptr]].description, FNORMAL);
        draw_sprite(double_buffer, menuptr, 72 + xofs, ptr * 8 + 44 + yofs);
        blit2screen(xofs, yofs);
        readcontrols();

        if (PlayerInput.down)
        {
            unpress();
            ptr = (ptr + 1) % num_items;
            play_effect(SND_CLICK, 128);
        }
        if (PlayerInput.up)
        {
            unpress();
            ptr = (ptr - 1 + num_items) % num_items;
            play_effect(SND_CLICK, 128);
        }
        if (PlayerInput.bctrl)
        {
            unpress();
            stop = 1;
        }
    }
}
Exemplo n.º 14
0
void __fastcall Tmapform::FormPaint(TObject *Sender)
{
  drawmap();
}
Exemplo n.º 15
0
/*! \brief Process the item menu
 *
 * This screen displays the list of items that the character has, then
 * waits for the player to select one.
 */
void camp_item_menu(void)
{
    int stop = 0, ptr = 0, pptr = 0, sel = 0;

    item_act = 0;
    play_effect(SND_MENU, 128);
    while (!stop)
    {
        check_animation();
        drawmap();
        draw_itemmenu(ptr, pptr, sel);
        blit2screen(xofs, yofs);
        readcontrols();

        if (sel == 0)
        {
            if (down)
            {
                unpress();
                ptr++;
                if (ptr > 15)
                {
                    ptr = 0;
                }
                play_effect(SND_CLICK, 128);
            }
            if (up)
            {
                unpress();
                ptr--;
                if (ptr < 0)
                {
                    ptr = 15;
                }
                play_effect(SND_CLICK, 128);
            }
        }
        if (right)
        {
            unpress();
            if (sel == 0)
            {
                /* One of the 16 items in the list */
                pptr++;
                if (pptr > MAX_INV / 16 - 1)
                {
                    pptr = 0;
                }
            }
            else
            {
                /* Use / Sort / Drop */
                item_act++;
                if (item_act > 2)
                {
                    item_act = 0;
                }
            }
            play_effect(SND_CLICK, 128);
        }
        if (left)
        {
            unpress();
            if (sel == 0)
            {
                /* One of the 16 items in the list */
                pptr--;
                if (pptr < 0)
                {
                    pptr = MAX_INV / 16 - 1;
                }
            }
            else
            {
                /* Use / Sort / Drop */
                item_act--;
                if (item_act < 0)
                {
                    item_act = 2;
                }
            }
            play_effect(SND_CLICK, 128);
        }
        if (balt)
        {
            unpress();
            if (sel == 1)
            {
                if (item_act == 1)
                {
                    sort_items();
                }
                else
                {
                    sel = 0;
                }
            }
            else
            {
                if (g_inv[pptr * 16 + ptr][0] > 0)
                {
                    // Player's cursor was over the USE menu
                    if (item_act == 0)
                    {
                        camp_item_targetting(pptr * 16 + ptr);
                    }
                    // Player's curor was over the DROP menu
                    else
                    {
                        if (item_act == 2)
                        {
                            int stop2 = 0;

                            /* Make sure the player really wants to drop the item specified. */
                            while (!stop2)
                            {
                                check_animation();
                                drawmap();
                                draw_itemmenu(ptr, pptr, sel);
                                menubox(double_buffer, 72 + xofs, 204 + yofs, 20, 1,
                                        DARKBLUE);
                                print_font(double_buffer, 104 + xofs, 212 + yofs,
                                           _("Confirm/Cancel"), FNORMAL);
                                blit2screen(xofs, yofs);
                                readcontrols();

                                if (balt)
                                {
                                    unpress();
                                    stop2 = 2;
                                }
                                if (bctrl)
                                {
                                    unpress();
                                    stop2 = 1;
                                }
                            }
                            if (stop2 == 2)
                            {
                                // Drop ALL of the selected items
                                remove_item(pptr * 16 + ptr,
                                            g_inv[pptr * 16 + ptr][1]);
                            }
                        }
                    }
                }
            }
        }
        if (bctrl)
        {
            unpress();
            if (sel == 0)
            {
                sel = 1;
            }
            else
            {
                stop = 1;
            }
        }
    }
}
Exemplo n.º 16
0
void drawstuff(struct cGlobals *caveGlobals) {
	drawtitle(caveGlobals);
	drawmap(caveGlobals);
}
Exemplo n.º 17
0
/*! \brief Display system menu
 *
 * This is the system menu that is invoked from within the game.
 * From here you can save, load, configure a couple of options or
 * exit the game altogether.
 * \date 20040229 PH added 'Save anytime' facility when cheat mode is ON
 *
 * \returns 0 if cancelled or nothing happened, 1 otherwise
 */
int system_menu (void)
{
   int stop = 0, ptr = 0;
   char save_str[10];
   int text_color = FNORMAL;

   strcpy (save_str, _("Save  "));

   if (cansave == 0) {
      text_color = FDARK;
#ifdef KQ_CHEATS
      if (cheat) {
         strcpy (save_str, _("[Save]"));
         text_color = FNORMAL;
      }
#endif /* KQ_CHEATS */
   }

   while (!stop) {
      check_animation ();
      drawmap ();
      menubox (double_buffer, xofs, yofs, 8, 4, BLUE);

      print_font (double_buffer, 16 + xofs, 8 + yofs, save_str, text_color);
      print_font (double_buffer, 16 + xofs, 16 + yofs, _("Load"), FNORMAL);
      print_font (double_buffer, 16 + xofs, 24 + yofs, _("Config"), FNORMAL);
      print_font (double_buffer, 16 + xofs, 32 + yofs, _("Exit"), FNORMAL);

      draw_sprite (double_buffer, menuptr, 0 + xofs, ptr * 8 + 8 + yofs);
      blit2screen (xofs, yofs);
      readcontrols ();


      // TT:
      // When pressed, 'up' or 'down' == 1.  Otherwise, they equal 0.  So:
      //    ptr = ptr - up + down;
      // will correctly modify the pointer, but with less code.
      if (up || down) {
         ptr = ptr + up - down;
         if (ptr < 0)
            ptr = 3;
         else if (ptr > 3)
            ptr = 0;
         play_effect (SND_CLICK, 128);
         unpress ();
      }

      if (balt) {
         unpress ();

         if (ptr == 0) {
            // Pointer is over the SAVE option
#ifdef KQ_CHEATS
            if (cansave == 1 || cheat)
#else
            if (cansave == 1)
#endif /* KQ_CHEATS */
            {
               saveload (1);
               stop = 1;
            } else
               play_effect (SND_BAD, 128);
         }

         if (ptr == 1) {
            if (saveload (0) != 0)
               stop = 1;
         }

         if (ptr == 2)
            config_menu ();

         if (ptr == 3)
            return confirm_quit ();
      }

      if (bctrl) {
         stop = 1;
         unpress ();
      }
   }

   return 0;
}
Exemplo n.º 18
0
void __fastcall Tmapform::FormResize(TObject *Sender)
{
  Canvas->FillRect(ClientRect);
  drawmap();
}
Exemplo n.º 19
0
//take screenshots in full and thumbnail sizes
void takescreenshot()
{
	short iTileSizes[3] = {32, 16, 8};
	SDL_Surface * old_screen = screen;

	for(short iScreenshotSize = 0; iScreenshotSize < 3; iScreenshotSize++)
	{
		short iTileSize = iTileSizes[iScreenshotSize];

		SDL_Surface * screenshot = SDL_CreateRGBSurface(old_screen->flags, iTileSize * 20, iTileSize * 15, old_screen->format->BitsPerPixel, 0, 0, 0, 0);
		blitdest = screenshot;
		screen = screenshot;
		drawmap(true, iTileSize);

		//Draw platforms to screenshot
		SDL_Rect rSrc = {0, 0, iTileSize, iTileSize};
		SDL_Rect rDst = {0, 0, iTileSize, iTileSize};

		for(short iPlatform = 0; iPlatform < g_iNumPlatforms; iPlatform++)
		{
			for(short iPlatformX = 0; iPlatformX < g_map.platforms[iPlatform]->iTileWidth; iPlatformX++)
			{
				for(short iPlatformY = 0; iPlatformY < g_map.platforms[iPlatform]->iTileHeight; iPlatformY++)
				{
					short iTile = g_Platforms[iPlatform].tiles[iPlatformX][iPlatformY];

					if(iTile != TILESETSIZE)
					{
						rSrc.x = iTile % TILESETWIDTH * iTileSize;
						rSrc.y = iTile / TILESETWIDTH * iTileSize;

						rDst.x = (g_Platforms[iPlatform].iStartX + iPlatformX) * iTileSize;
						rDst.y = (g_Platforms[iPlatform].iStartY + iPlatformY) * iTileSize;

						SDL_BlitSurface(g_map.tilesetsurface[iScreenshotSize], &rSrc, blitdest, &rDst);
					}
				}
			}
		}
	
		//And add platform paths
		for(short iPlatform = 0; iPlatform < g_iNumPlatforms; iPlatform++)
		{
			if(g_Platforms[iPlatform].iStartX != g_Platforms[iPlatform].iEndX)
			{
				short iCenterOffsetY = (g_map.platforms[iPlatform]->iHeight >> 1) - 16;
				iCenterOffsetY >>= iScreenshotSize; //Resize for preview and thumbnails

				bool fMoveToRight = g_Platforms[iPlatform].iStartX < g_Platforms[iPlatform].iEndX;

				short iSpotLeft = (fMoveToRight ? g_Platforms[iPlatform].iStartX : g_Platforms[iPlatform].iEndX) + 1;
				short iSpotRight = (fMoveToRight ? g_Platforms[iPlatform].iEndX : g_Platforms[iPlatform].iStartX) - 2 + g_map.platforms[iPlatform]->iTileWidth;

				for(short iSpot = iSpotLeft; iSpot <= iSpotRight; iSpot++)
					spr_platformarrows[iScreenshotSize].draw(iSpot * iTileSize, g_Platforms[iPlatform].iStartY * iTileSize + iCenterOffsetY, iTileSize * 5, 0, iTileSize, iTileSize);

				spr_platformarrows[iScreenshotSize].draw((iSpotLeft - 1) * iTileSize, g_Platforms[iPlatform].iStartY * iTileSize + iCenterOffsetY, iTileSize * 2, 0, iTileSize, iTileSize);
				spr_platformarrows[iScreenshotSize].draw((iSpotRight + 1) * iTileSize, g_Platforms[iPlatform].iStartY * iTileSize + iCenterOffsetY, iTileSize * 3, 0, iTileSize, iTileSize);
			}
			else
			{
				short iCenterOffsetX = (g_map.platforms[iPlatform]->iWidth >> 1) - 16;
				iCenterOffsetX >>= iScreenshotSize; //Resize for preview and thumbnails

				bool fMoveUp = g_Platforms[iPlatform].iStartY < g_Platforms[iPlatform].iEndY;

				short iSpotTop = (fMoveUp ? g_Platforms[iPlatform].iStartY : g_Platforms[iPlatform].iEndY) + 1;
				short iSpotBottom = (fMoveUp ? g_Platforms[iPlatform].iEndY : g_Platforms[iPlatform].iStartY) - 2 + g_map.platforms[iPlatform]->iTileHeight;

				for(short iSpot = iSpotTop; iSpot <= iSpotBottom; iSpot++)
					spr_platformarrows[iScreenshotSize].draw(g_Platforms[iPlatform].iStartX * iTileSize + iCenterOffsetX, iSpot * iTileSize, iTileSize * 4, 0, iTileSize, iTileSize);

				spr_platformarrows[iScreenshotSize].draw(g_Platforms[iPlatform].iStartX * iTileSize + iCenterOffsetX, (iSpotTop - 1) * iTileSize, 0, 0, iTileSize, iTileSize);
				spr_platformarrows[iScreenshotSize].draw(g_Platforms[iPlatform].iStartX * iTileSize + iCenterOffsetX, (iSpotBottom + 1) * iTileSize, iTileSize, 0, iTileSize, iTileSize);
			}
		}
Exemplo n.º 20
0
int main()
{
  step ps;
  int key;
  int row=1,line=1;
  init(WHITE);
  createmap(&ps);

  drawmap(BLUE);
  drawpeople(row,line,RED);
  while(1)
  {


    key=bioskey(0);
    switch(key)
    {
     case UP:if(path[row-1][line]==0)
     {
      drawpeople(row,line,WHITE);
      row--;
      drawpeople(row,line,RED);

    }break;
    case DOWN:if(path[row+1][line]==0)
    {
      drawpeople(row,line,WHITE);
      row++;
      drawpeople(row,line,RED);

    }break;
    case RIGHT:if(path[row][line+1]==0)
    {
      drawpeople(row,line,WHITE);
      line++;
      drawpeople(row,line,RED);

    }break;
    case LEFT:if(path[row][line-1]==0)
    {
      drawpeople(row,line,WHITE);
      line--;
      drawpeople(row,line,RED);

    }break;
    case ESC:closegraph();exit(0); break;
    case BS: computermove(row,line,&ps);
    del_23();
    getch();
    cleardevice();
    drawmap(BLUE);
    drawpeople(row,line,RED);
    default :break;


  }
  if(line==(N-2)&&row==(N-2))
  {

    closegraph();
    printf("\n\n\n\n\t\t\t\tGood Job");
    sleep(5);
    break;

  }

}
return 1;
}
Exemplo n.º 21
0
Arquivo: setup.c Projeto: rj76/kq
/*! \brief Display configuration menu
 *
 * This is the config menu that is called from the system
 * menu.  Here you can adjust the music or sound volume, or
 * the speed that the battle gauge moves at.
 */
void config_menu (void)
{
   int stop = 0, ptr = 0, p;
   int temp_key = 0;

#ifdef DEBUGMODE
   #define MENU_SIZE 18
#else
   #define MENU_SIZE 17
#endif
   static const char *dc[MENU_SIZE];

   /* Define rows with appropriate spacings for breaks between groups */
   int row[MENU_SIZE];
   for (p = 0; p < 4; p++)
      row[p] = (p + 4) * 8;     // (p * 8) + 32
   for (p = 4; p < 12; p++)
      row[p] = (p + 5) * 8;     // (p * 8) + 40
   for (p = 12; p < 15; p++)
      row[p] = (p + 6) * 8;     // (p * 8) + 48
   for (p = 15; p < MENU_SIZE; p++)
      row[p] = (p + 7) * 8;     // (p * 8) + 56

   /* Helper strings */
   dc[0]=_("Display KQ in a window.");
   dc[1]=_("Stretch to fit 640x480 resolution.");
   dc[2]=_("Display the frame rate during play.");
   dc[3]=_("Wait for vertical retrace.");
   dc[4]=_("Key used to move up.");
   dc[5]=_("Key used to move down.");
   dc[6]=_("Key used to move left.");
   dc[7]=_("Key used to move right.");
   dc[8]=_("Key used to confirm action.");
   dc[9]=_("Key used to cancel action.");
   dc[10]=_("Key used to call character menu.");
   dc[11]=_("Key used to call system menu.");
   dc[12]=_("Toggle sound and music on/off.");
   dc[13]=_("Overall sound volume (affects music).");
   dc[14]=_("Music volume.");
   dc[15]=_("Animation speed-ups for slow machines.");
   dc[16]=_("Toggle how to allocate CPU usage.");
#ifdef DEBUGMODE
      dc[17]=_("Things you can do only in DebugMode.");
#endif

   unpress ();
   push_config_state ();
   set_config_file (kqres (SETTINGS_DIR, "kq.cfg"));
   while (!stop) {
      check_animation ();
      drawmap ();
      menubox (double_buffer, 88 + xofs, yofs, 16, 1, BLUE);
      print_font (double_buffer, 96 + xofs, 8 + yofs, _("KQ Configuration"),
                  FGOLD);
      menubox (double_buffer, 32 + xofs, 24 + yofs, 30, MENU_SIZE + 3, BLUE);

      citem (row[0], _("Windowed mode:"), windowed == 1 ? _("YES") : _("NO"), FNORMAL);
      citem (row[1], _("Stretch Display:"), stretch_view == 1 ? _("YES") : _("NO"), FNORMAL);
      citem (row[2], _("Show Frame Rate:"), show_frate == 1 ? _("YES") : _("NO"), FNORMAL);
      citem (row[3], _("Wait for Retrace:"), wait_retrace == 1 ? _("YES") : _("NO"), FNORMAL);
      citem (row[4], _("Up Key:"), kq_keyname (kup), FNORMAL);
      citem (row[5], _("Down Key:"), kq_keyname (kdown), FNORMAL);
      citem (row[6], _("Left Key:"), kq_keyname (kleft), FNORMAL);
      citem (row[7], _("Right Key:"), kq_keyname (kright), FNORMAL);
      citem (row[8], _("Confirm Key:"), kq_keyname (kalt), FNORMAL);
      citem (row[9], _("Cancel Key:"), kq_keyname (kctrl), FNORMAL);
      citem (row[10], _("Menu Key:"), kq_keyname (kenter), FNORMAL);
      citem (row[11], _("System Menu Key:"), kq_keyname (kesc), FNORMAL);
      citem (row[12], _("Sound System:"), is_sound ? _("ON") : _("OFF"), FNORMAL);

      p = FNORMAL;
      /* TT: This needs to check for ==0 because 1 means sound init */
      if (is_sound == 0)
         p = FDARK;

      sprintf (strbuf, "%3d%%", gsvol * 100 / 250);
      citem (row[13], _("Sound Volume:"), strbuf, p);

      sprintf (strbuf, "%3d%%", gmvol * 100 / 250);
      citem (row[14], _("Music Volume:"), strbuf, p);

      citem (row[15], _("Slow Computer:"), slow_computer ? _("YES") : _("NO"), FNORMAL);

      if (cpu_usage)
         sprintf (strbuf, _("rest(%d)"), cpu_usage - 1);
      else
         sprintf (strbuf, "yield_timeslice()");
      citem (row[16], _("CPU Usage:"), strbuf, FNORMAL);

#ifdef DEBUGMODE
      if (debugging)
         sprintf (strbuf, "%d", debugging);
      citem (row[17], _("DebugMode Stuff:"), debugging ? strbuf : _("OFF"), FNORMAL);
#endif

      /* This affects the VISUAL placement of the arrow */
      p = ptr;
      if (ptr > 3)
         p++;
      if (ptr > 11)
         p++;
      if (ptr > 14)
         p++;
      draw_sprite (double_buffer, menuptr, 32 + xofs, p * 8 + 32 + yofs);

      /* This is the bottom window, where the description goes */
      menubox (double_buffer, xofs, 216 + yofs, 38, 1, BLUE);
      print_font (double_buffer, 8 + xofs, 224 + yofs, dc[ptr], FNORMAL);
      blit2screen (xofs, yofs);

      readcontrols ();
      if (up) {
         unpress ();
         // "jump" over unusable options
         if (ptr == 15 && is_sound == 0)
            ptr -= 2;
         ptr--;
         if (ptr < 0)
            ptr = MENU_SIZE - 1;
         play_effect (SND_CLICK, 128);
      }
      if (down) {
         unpress ();
         // "jump" over unusable options
         if (ptr == 12 && is_sound == 0)
            ptr += 2;
         ptr++;
         if (ptr > MENU_SIZE - 1)
            ptr = 0;
         play_effect (SND_CLICK, 128);
      }
      if (balt) {
         unpress ();
         switch (ptr) {
         case 0:
#ifdef __DJGPP__
            text_ex (B_TEXT, 255,
                     _("This version of KQ was compiled for DOS and does not support windowed mode"));
#else
            text_ex (B_TEXT, 255,
                     _("Changing the display mode to or from windowed view could have serious ramifications. It is advised that you save first."));
            if (windowed == 0)
               sprintf (strbuf, _("Switch to windowed mode?"));
            else
               sprintf (strbuf, _("Switch to full screen?"));
            p = prompt (255, 2, B_TEXT, strbuf, _("  no"), _("  yes"), "");
            if (p == 1) {
               if (windowed == 0)
                  windowed = 1;
               else
                  windowed = 0;
               set_config_int (NULL, "windowed", windowed);
               set_graphics_mode ();
            }
#endif
            break;
         case 1:
#ifdef __DJGPP__
            text_ex (B_TEXT, 255,
                     _("This version of KQ was compiled for DOS and does not support stretching"));
#else
            text_ex (B_TEXT, 255,
                     _("Changing the stretched view option could have serious ramifications. It is advised that you save your game before trying this."));
            if (stretch_view == 0)
               sprintf (strbuf, _("Try to stretch the display?"));
            else
               sprintf (strbuf, _("Switch to unstretched display?"));
            p = prompt (255, 2, B_TEXT, strbuf, _("  no"), _("  yes"), "");
            if (p == 1) {
               if (stretch_view == 0)
                  stretch_view = 1;
               else
                  stretch_view = 0;
               set_config_int (NULL, "stretch_view", stretch_view);
               set_graphics_mode ();
            }
#endif
            break;
         case 2:
            if (show_frate == 0)
               show_frate = 1;
            else
               show_frate = 0;
            set_config_int (NULL, "show_frate", show_frate);
            break;
         case 3:
            if (wait_retrace == 0)
               wait_retrace = 1;
            else
               wait_retrace = 0;
            set_config_int (NULL, "wait_retrace", wait_retrace);
            break;
         case 4:
            while ((temp_key = getakey ()) == 0);
            kup = temp_key;
            unpress ();
            set_config_int (NULL, "kup", kup);
            break;
         case 5:
            while ((temp_key = getakey ()) == 0);
            kdown = temp_key;
            unpress ();
            set_config_int (NULL, "kdown", kdown);
            break;
         case 6:
            while ((temp_key = getakey ()) == 0);
            kleft = temp_key;
            unpress ();
            set_config_int (NULL, "kleft", kleft);
            break;
         case 7:
            while ((temp_key = getakey ()) == 0);
            kright = temp_key;
            unpress ();
            set_config_int (NULL, "kright", kright);
            break;
         case 8:
            while ((temp_key = getakey ()) == 0);
            kalt = temp_key;
            unpress ();
            set_config_int (NULL, "kalt", kalt);
            break;
         case 9:
            while ((temp_key = getakey ()) == 0);
            kctrl = temp_key;
            unpress ();
            set_config_int (NULL, "kctrl", kctrl);
            break;
         case 10:
            while ((temp_key = getakey ()) == 0);
            kenter = temp_key;
            unpress ();
            set_config_int (NULL, "kenter", kenter);
            break;
         case 11:
            while ((temp_key = getakey ()) == 0);
            kesc = temp_key;
            unpress ();
            set_config_int (NULL, "kesc", kesc);
            break;
         case 12:
            if (is_sound == 2)
               sound_init ();
            else {
               if (is_sound == 0) {
                  is_sound = 1;
                  print_font (double_buffer, 92 + 2 + xofs, 204 + yofs,
                              _("...please wait..."), FNORMAL);
                  blit2screen (xofs, yofs);
                  sound_init ();
                  play_music (g_map.song_file, 0);
               }
            }
            set_config_int (NULL, "is_sound", is_sound != 0);
            break;
         case 13:
            if (is_sound == 2) {
               p = getavalue (_("Sound Volume"), 0, 25, gsvol / 10, 1);
               if (p != -1)
                  gsvol = p * 10;

               /* make sure to set it no matter what */
               set_volume (gsvol, 0);
               set_config_int (NULL, "gsvol", gsvol);
            } else
               /* Not as daft as it seems, SND_BAD also wobbles the screen */
               play_effect (SND_BAD, 128);
            break;
         case 14:
            if (is_sound == 2) {
               p = getavalue (_("Music Volume"), 0, 25, gmvol / 10, 1);
               if (p != -1)
                  gmvol = p * 10;

               /* make sure to set it no matter what */
               set_music_volume (gmvol / 250.0);
               set_config_int (NULL, "gmvol", gmvol);
            } else
               play_effect (SND_BAD, 128);
            break;
         case 15:
            /* TT: toggle slow_computer */
            slow_computer = !slow_computer;
            set_config_int (NULL, "slow_computer", slow_computer);
            break;
         case 16:
            /* TT: Adjust the CPU usage:yield_timeslice() or rest() */
            cpu_usage++;
            if (cpu_usage > 2)
               cpu_usage = 0;
            break;
#ifdef DEBUGMODE
         case 17:
            /* TT: Things we only have access to when we're in debug mode */
            if (debugging < 4)
               debugging++;
            else
               debugging = 0;
            break;
#endif
         }
      }
      if (bctrl) {
         unpress ();
         stop = 1;
      }
   }
   pop_config_state ();
}
Exemplo n.º 22
0
int main( int argc, char *argv[] ) {
  char *font="tilesense/libtcod/fonts/courier12x12_aa_tc.png";
  int nb_char_horiz=0,nb_char_vertic=0;
  int font_flags=TCOD_FONT_TYPE_GREYSCALE|TCOD_FONT_LAYOUT_TCOD;
	TCOD_console_set_custom_font(font,font_flags,nb_char_horiz,nb_char_vertic);
	TCOD_console_init_root(80,40,"salamandeRL",false);
	
  Map room = initRoom();
  Object player = initPlayer(room);
  object_sense(player);
  
  TCOD_sys_set_fps(30);

  float elapsed = 0;
  char finished = 0;
	TCOD_key_t key = {TCODK_NONE,0};
	TCOD_console_set_foreground_color(NULL,TCOD_white);
	do {
	  key = TCOD_console_check_for_keypress(TCOD_KEY_PRESSED);
    if(key.vk != TCODK_NONE) {
      TCOD_console_clear(NULL);
    }
		
		TCOD_console_print_right(NULL,79,26,TCOD_BKGND_NONE,"last frame : %3d ms (%3d fps)", (int)(TCOD_sys_get_last_frame_length()*1000), TCOD_sys_get_fps());
		TCOD_console_print_right(NULL,79,27,TCOD_BKGND_NONE,"elapsed : %8dms %4.2fs", TCOD_sys_elapsed_milli(),TCOD_sys_elapsed_seconds());
		TCOD_console_print_left(NULL,0,27,TCOD_BKGND_NONE,"other stat stuff can go here");
		//map
    drawmap(room, player);
    TCOD_console_print_left(NULL, 
      object_position(player).x*2, object_position(player).y, 
      TCOD_BKGND_NONE,"@");
		//divider
		TCOD_console_print_left(NULL,0,28,TCOD_BKGND_NONE,
		  "--------------------------------------------------------------------------------"
		);
	  //text display
    TCOD_console_print_left(NULL,2,29,TCOD_BKGND_NONE,"we'll probably put text down here.");
		
		/* update the game screen */
		TCOD_console_flush();

    if(key.vk == TCODK_RIGHT) {
      map_turn_object(room, "@", 1);
    } else if(key.vk == TCODK_LEFT) {
      map_turn_object(room, "@", -1);
    } else if(key.vk == TCODK_CHAR) {
      switch(key.c) {
        case 'w':
          map_move_object(room, "@", (mapVec){0, -1, 0});
          break;
        case 'a':
          map_move_object(room, "@", (mapVec){-1, 0, 0});
          break;
        case 's':
          map_move_object(room, "@", (mapVec){0, 1, 0});
          break;
        case 'd':
          map_move_object(room, "@", (mapVec){1, 0, 0});
          break;
        case 'q':
          finished = 1;
          break;
        //next, handle chomping
        default:
          break;
  		}
    }

	} while (!finished && !TCOD_console_is_window_closed());
	return 0;
}