Ejemplo n.º 1
0
//----------------------------------------------------------------------------
WORLD_PROC( uint32_t, GetWallCount )( INDEX iWorld )
{
	PWORLD world = GetSetMember( WORLD, &g.worlds, iWorld );
   if( world )
		return CountUsedInSet( WALL, world->walls );
   return 0;
}
Ejemplo n.º 2
0
//----------------------------------------------------------------------------
WORLD_PROC( uint32_t, GetLineCount )( INDEX iWorld )
{
	PWORLD world = GetSetMember( WORLD, &g.worlds, iWorld );
	if( world )
		return CountUsedInSet( FLATLAND_MYLINESEG, world->lines );
	return 0;
}
Ejemplo n.º 3
0
//----------------------------------------------------------------------------
WORLD_PROC( uint32_t, GetSectorCount )( INDEX iWorld )
{
	PWORLD world = GetSetMember( WORLD, &g.worlds, iWorld );
	if( world )
		return CountUsedInSet( SECTOR, world->sectors );
	return 0;
}
Ejemplo n.º 4
0
void CPROC EditResizeCallback( uintptr_t dwUser  )
{
	PEDITOR pe = (PEDITOR)dwUser;
	//PFACETSET *ppfs;
	//PFACET pf;

	//PLINESEGPSET *pplps;
	//PMYLINESEGSET *ppls;
	//PMYLINESEG pl;
	//int l;
	// ShowCurrent();
	//ClearImage( surface );
	{
		//IMAGE_RECTANGLE r;
		//GetDisplayPosition( pe->hVideo, pe->ptUpperLeft, pe->ptUpperLeft + 1, NULL, NULL );
		/*
		GetWindowRect( pe->hVideo->hWndOutput, &r );
		pe->ptUpperLeft[0] = r.left //+ GetSystemMetrics( SM_CXBORDER )
									  + GetSystemMetrics( SM_CXFRAME );
		pe->ptUpperLeft[1] = r.top + GetSystemMetrics( SM_CYBORDER )
									 + GetSystemMetrics( SM_CYFRAME )
									 + GetSystemMetrics( SM_CYCAPTION );
									 */
	}
#if 0
	SetClip( (RCOORD)GetDisplayImage( pe->hVideo )->width,
				(RCOORD)GetDisplayImage( pe->hVideo )->height );
	ppfs = pe->pCurrent->objinfo->ppFacetPool;
	ppls = GetFromSet( LINEPSEG, pe->pCurrent->objinfo->ppLinePool );
	//ForAllInSet( FACET, &pe->pCurrent->objinfo->ppFacetPool, DrawLineSegs );
	//int f;
	//for( f = 0; f < ; f++ )
	{
		int lines;
		//pf = GetFromSet( FACET, pfs->pFacets + f;
		pplps = &pf->pLineSet;
		lines = CountUsedInSet( LINESEGP, pf->pLineSet );
		for( l = 0; l < lines; l++ )
		{
			RAY ld; // local directional...
			PLINESEGP plsp = GetSetMember( LINESEGP, pplps, l );
			pl = GetSetMember( MYLINESEG, ppls, plsp->nLine );
			if( pl == pe->pCurrentLine )
			{
				ApplyInverseR( pe->TView, &ld, &pl->r );
				DrawLine(surface, ld.o, ld.n, pl->dFrom-5, pl->dFrom, Color( 192, 192, 0 ) );
				DrawLine(surface, ld.o, ld.n, pl->dFrom, pl->dTo, Color( 0, 150, 0 ) );
				DrawLine(surface, ld.o, ld.n, pl->dTo, pl->dTo+5, Color( 192, 192, 0 ) );
				GetViewPoint(surface, &pe->ptO, ld.o );
				add( ld.o, ld.o, ld.n ); // add one slope to origin to get slope point
				GetViewPoint(surface, &pe->ptN, ld.o );
				MarkOrigin( pe, surface );
				MarkSlope( pe,surface );
			}
			else
			if( pf = pe->pCurrentFacet )
			{
				ApplyInverseR( pe->TView, &ld, &pl->r );
				DrawLine(surface, ld.o, ld.n, pl->dFrom, pl->dTo, Color( 0, 0, 150 ) );
			}
			else
			{
				ApplyInverseR( pe->TView, &ld, &pl->r );
				DrawLine(surface, ld.o, ld.n, pl->dFrom, pl->dTo, Color( 92, 92, 92 ) );
			}
		}
	}
	UpdateDisplay( pe->hVideo );
#endif
}