Example #1
0
void inituserapobjects()
{
    if (newacq)
    {
	BOBreg0  = ObjectNew(AP_Device,   "BreakOut Board register 0");
	BOBreg1  = ObjectNew(AP_Device,   "BreakOut Board register 1");
	BOBreg2  = ObjectNew(AP_Device,   "BreakOut Board register 2");
	BOBreg3  = ObjectNew(AP_Device,   "BreakOut Board register 3");
	APall    = ObjectNew(AP_Device,   "Generic APdevice object");
	APbyte   = ObjectNew(AP_Device,   "Generic APdevice object");

	SetAPAttr(BOBreg0,
		     SET_APADR,			BOB_APADDR,
		     SET_APREG,			BOB_REG,
		     SET_APBYTES,		1,
		     SET_APMODE,		1,
		NULL);
	SetAPAttr(BOBreg1,
		     SET_APADR,			BOB_APADDR,
		     SET_APREG,			BOB_REG+1,
		     SET_APBYTES,		1,
		     SET_APMODE,		1,
		NULL);
	SetAPAttr(BOBreg2,
		     SET_APADR,			BOB_APADDR,
		     SET_APREG,			BOB_REG+2,
		     SET_APBYTES,		1,
		     SET_APMODE,		1,
		NULL);
	SetAPAttr(BOBreg3,
		     SET_APADR,			BOB_APADDR,
		     SET_APREG,			BOB_REG+3,
		     SET_APBYTES,		1,
		     SET_APMODE,		1,
		NULL);
	SetAPAttr(APall,
		     SET_APADR,			0,
		     SET_APREG,			0,
		     SET_APBYTES,		2,
		     SET_APMODE,		1,
		NULL);
	SetAPAttr(APbyte,
		     SET_APADR,			0,
		     SET_APREG,			0,
		     SET_APBYTES,		1,
		     SET_APMODE,		1,
		NULL);
    }

}
Example #2
0
  //
  // ObjectNewOnMap
  //
  // Creates a new object of 'type' and places on the map using 'matrix'
  //
  MapObj* ObjectNewOnMap(MapObjType *type, const Matrix &matrix, U32 id, Bool zip, Bool complete)
  {
    ASSERT(type);

    // Create the new object
    MapObj *newObj = ObjectNew(type, id, complete);

    // Set the object transform
    newObj->SetSimCurrent(matrix);

    // Add to the map
    AddToMap(newObj);

    // Zip if required
    if (zip)
    {
      newObj->ToggleFootPrint(TRUE);
    }

    return (newObj);
  }
Example #3
0
 //
 // ObjectNew
 //
 // Overload for using a string type identifier
 //
 MapObj* ObjectNew(U32 typeCrc, U32 id, Bool complete)
 {
   MapObjType *type = GameObjCtrl::FindType<MapObjType>(typeCrc);
   return (type ? ObjectNew(type, id, complete) : NULL);
 }