示例#1
0
void CLightManager::Transform (int bStatic, int bVariable)
{
	int			i;
	CDynLight*	pl = &m_data.lights [0];

m_data.nLights [1] = 0;
for (i = 0; i < m_data.nLights [0]; i++, pl++) {
#if DBG
	if ((nDbgSeg >= 0) && (nDbgSeg == pl->info.nSegment) && ((nDbgSide < 0) || (nDbgSide == pl->info.nSide)))
		nDbgSeg = nDbgSeg;
#endif
	pl->render.vPosf [0].Assign (pl->info.vPos);
	if (gameStates.ogl.bUseTransform)
		pl->render.vPosf [1] = pl->render.vPosf [0];
	else {
		transformation.Transform (pl->render.vPosf [1], pl->render.vPosf [0], 0);
		pl->render.vPosf [1][W] = 1;
		}
	pl->render.vPosf [0][W] = 1;
	pl->render.nType = pl->info.nType;
	pl->render.bState = pl->info.bState && (pl->info.color.red + pl->info.color.green + pl->info.color.blue > 0.0);
	pl->render.bLightning = (pl->info.nObject < 0) && (pl->info.nSide < 0);
	ResetUsed (pl, 0);
	if (gameStates.app.bMultiThreaded)
		ResetUsed (pl, 1);
	pl->render.bShadow =
	pl->render.bExclusive = 0;
	if (pl->render.bState) {
		if (!bStatic && (pl->info.nType == 1) && !pl->info.bVariable)
			pl->render.bState = 0;
		if (!bVariable && ((pl->info.nType > 1) || pl->info.bVariable))
			pl->render.bState = 0;
		}
	m_data.renderLights [m_data.nLights [1]++] = pl;
	}
m_headlights.Prepare ();
m_headlights.Update ();
m_headlights.Transform ();
}
示例#2
0
DefTableKeyList FillInsertKeyList (DefTableKeyList orig)
{ DefTableKeyList missing = NULLDefTableKeyList, l = orig;
  int index = 1;
  while (l != NULLDefTableKeyList)
  { DefTableKey insKey = HeadDefTableKeyList (l);
    int elemindex = GetIndex (insKey, index);
    while (index < elemindex)
    { DefTableKey newk = NewKey ();
      ResetType (newk, nodeType); 
      ResetIndex (newk, index++);
      ResetUsed (newk, 0);
      missing = ConsDefTableKeyList (newk, missing);
    }
    index++;
    l = TailDefTableKeyList (l);
  }
  while (missing != NULLDefTableKeyList)
  { DefTableKey insKey = HeadDefTableKeyList (missing);
    orig = AddToOrderedSetDefTableKeyList
             (insKey, orig, cmpPatIndex);
    missing = TailDefTableKeyList (missing);
  }
  return orig;
}