예제 #1
0
파일: L.C 프로젝트: NonCreature0714/descent
void texpage_init( UI_WINDOW * win )
{
	int i;

	ui_add_gadget_button( win, TMAPCURBOX_X + 00, TMAPCURBOX_Y - 24, 30, 20, "<<", texpage_goto_prev );
	ui_add_gadget_button( win, TMAPCURBOX_X + 32, TMAPCURBOX_Y - 24, 30, 20, ">>", texpage_goto_next );

	ui_add_gadget_button( win, TMAPCURBOX_X + 00, TMAPCURBOX_Y - 48, 15, 20, "T", texpage_goto_first );
	ui_add_gadget_button( win, TMAPCURBOX_X + 17, TMAPCURBOX_Y - 48, 15, 20, "M", texpage_goto_metals );
	ui_add_gadget_button( win, TMAPCURBOX_X + 34, TMAPCURBOX_Y - 48, 15, 20, "L", texpage_goto_lights );
	ui_add_gadget_button( win, TMAPCURBOX_X + 51, TMAPCURBOX_Y - 48, 15, 20, "E", texpage_goto_effects );
	

	for (i=0;i<TMAPS_PER_PAGE;i++)
		TmapBox[i] = ui_add_gadget_userbox( win, TMAPBOX_X + (i/3)*(2+TMAPBOX_W), TMAPBOX_Y + (i%3)*(2+TMAPBOX_H), TMAPBOX_W, TMAPBOX_H);

	TmapCurrent = ui_add_gadget_userbox( win, TMAPCURBOX_X, TMAPCURBOX_Y, 64, 64 );

	TmapnameCanvas = gr_create_sub_canvas(&grd_curscreen->sc_canvas, TMAPCURBOX_X , TMAPCURBOX_Y + TMAPBOX_H + 10, 100, 20);
	gr_set_current_canvas( TmapnameCanvas );
	gr_set_curfont( ui_small_font ); 
   gr_set_fontcolor( CBLACK, CWHITE );

	texpage_redraw();

// Don't reset the current tmap every time we go back to the editor.
//	CurrentTmap = TexturePage*TMAPS_PER_PAGE;
//	CurrentTexture = TmapList[CurrentTmap];
	texpage_show_current();

}
예제 #2
0
파일: texpage.c 프로젝트: jihnsius/d2r
//NOTE:  this code takes the texture map number, not this index in the
//list of available textures.  There are different if there are holes in
//the list
int texpage_grab_current(int n)
{
	if ((n < 0) || (n >= NumTextures)) return 0;

	CurrentTexture = n;

	TexturePage = CurrentTexture / TMAPS_PER_PAGE;
	
	if (TexturePage*TMAPS_PER_PAGE < NumTextures)
		texpage_redraw();

	texpage_show_current();
	
	return 1;
}
예제 #3
0
파일: L.C 프로젝트: NonCreature0714/descent
//NOTE:  this code takes the texture map number, not this index in the
//list of available textures.  There are different if there are holes in
//the list
int texpage_grab_current(int n)
{
	int i;

	if ( (n<0) || ( n>= Num_tmaps) ) return 0;

	CurrentTexture = n;

	for (i=0;i<Num_tmaps;i++)
		if (TmapList[i] == n) {
			CurrentTmap = i;
			break;
		}
	Assert(i!=Num_tmaps);
	
	TexturePage = CurrentTmap / TMAPS_PER_PAGE;
	
	if (TexturePage*TMAPS_PER_PAGE < Num_tmaps )
		texpage_redraw();

	texpage_show_current();
	
	return 1;
}