Esempio n. 1
0
void init()
{
   initEventQueue();
   initRoot();

   InstantiateNamedSet(ActiveActionMapSet);
   InstantiateNamedSet(GhostAlwaysSet);
   InstantiateNamedSet(WayPointSet);
   InstantiateNamedSet(fxReplicatorSet);
   InstantiateNamedSet(fxFoliageSet);
   InstantiateNamedSet(MaterialSet);
   InstantiateNamedSet(SFXSourceSet);
   InstantiateNamedSet(SFXDescriptionSet);
   InstantiateNamedSet(SFXTrackSet);
   InstantiateNamedSet(SFXEnvironmentSet);
   InstantiateNamedSet(SFXStateSet);
   InstantiateNamedSet(SFXAmbienceSet);
   InstantiateNamedSet(TerrainMaterialSet);
   InstantiateNamedSet(DataBlockSet);
   InstantiateNamedGroup(ActionMapGroup);
   InstantiateNamedGroup(ClientGroup);
   InstantiateNamedGroup(GuiGroup);
   InstantiateNamedGroup(GuiDataGroup);
   InstantiateNamedGroup(TCPGroup);
   InstantiateNamedGroup(ClientConnectionGroup);
   InstantiateNamedGroup(SFXParameterGroup);
   InstantiateNamedSet(BehaviorSet);
   InstantiateNamedSet(sgMissionLightingFilterSet);

   gDataBlockGroup = new SimDataBlockGroup();
   gDataBlockGroup->registerObject("DataBlockGroup");
   gRootGroup->addObject(gDataBlockGroup);
   
   SimPersistID::init();
}
Esempio n. 2
0
/****************************************************************************
PARAMETERS:
mouseMove   - Callback function to call wheneve the mouse needs to be moved

REMARKS:
Initiliase the event handling module. Here we install our mouse handling ISR
to be called whenever any button's are pressed or released. We also build
the free list of events in the event queue.

We use handler number 2 of the mouse libraries interrupt handlers for our
event handling routines.
****************************************************************************/
void EVTAPI EVT_init(
    _EVT_mouseMoveHandler mouseMove)
{
    int             i;
#ifndef NO_PTHREAD
    pthread_attr_t  attr;
#endif    

    /* Initialise the event queue */
    EVT.mouseMove = mouseMove;
    initEventQueue();
    for (i = 0; i < 256; i++)
        keyUpMsg[i] = 0;

    /* Keyboard initialization */
    if (_PM_console_fd == -1)
        PM_fatalError("You must first call PM_openConsole to use the EVT functions!");
    _PM_keyboard_rawmode();
        
    /* Initialise the mouse module */
    SetupMice();

    /* Create the thread used to process events */
#ifndef NO_PTHREAD
    pthread_attr_init(&attr);
    pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
    pthread_create(&tid_eventThread, &attr, _EVT_eventThread, NULL);
#else    
    pid_eventThread = clone(_EVT_eventThread, &thread_stack[THREAD_STACK_SIZE], CLONE_FS | CLONE_FILES | CLONE_VM, NULL);
#endif
}
Esempio n. 3
0
/****************************************************************************
PARAMETERS:
mouseMove   - Callback function to call wheneve the mouse needs to be moved

REMARKS:
Initiliase the event handling module. Here we install our mouse handling ISR
to be called whenever any button's are pressed or released. We also build
the free list of events in the event queue.

We use handler number 2 of the mouse libraries interrupt handlers for our
event handling routines.
****************************************************************************/
void EVTAPI EVT_init(
    _EVT_mouseMoveHandler mouseMove)
{
    /* Initialise the event queue */
    initEventQueue();
    memset(keyUpMsg,0,sizeof(keyUpMsg));

    // TODO: Do any OS specific initialisation here

    /* Catch program termination signals so we can clean up properly */
    signal(SIGABRT, _EVT_abort);
    signal(SIGINT, _EVT_abort);
}
Esempio n. 4
0
INT32 register_client
(
 	INT32 major,
 	INT32 minor
)
{
	INT32 cli_id;
	p_atheros_dev dev;
#if defined(OWL_PB42) || defined(PYTHON_EMU)
	UINT32 vendor_id;
#endif
	/* get the client for this device */
	cli_id = get_client_id(major, minor);

	if (cli_id == INVALID_CLIENT) {
		printk("DK::register_client:Device not found \n");
	 	return -ENODEV;
	}

	printk("DK::Regsitering client %d \n",cli_id);
	dev = &dev_table[cli_id];

	if (!VALID_CLIENT(dev)) {
		printk("DK::register_client:Invalid client \n");
	 	return -ENODEV;
    }

	if (BUSY_CLIENT(dev)) {
		printk("DK::register_client:Client alreay in use \n");
		return -EACCES;
	}
#if !defined (P1020)	
	// check whether the device is present
	// by reading the vendor id
#if defined(OWL_PB42) || defined(PYTHON_EMU)
#ifdef WASP_OSPREY
   if(cli_id!=0){ // For DBDC operation, Wasp radio's client ID is zero; 
#endif
	cli_cfg_read(cli_id,0,4,&vendor_id);
	if ((vendor_id & 0xffff) != ATHEROS_VENDOR_ID) {
		printk("DK::Device not present \n");
	 	return -ENODEV;
	}

#ifdef WASP_OSPREY
   }
#endif
#ifndef PYTHON_EMU
	if (bus_dev_init(dev->bus_dev) < 0) {
		printk("DK::register_client:Cannot initialize client \n");
		return -EACCES;
	}
#endif
#endif
#endif
	initEventQueue(&dev->isr_event_q);
	initEventQueue(&dev->trigered_event_q);
	
	reset_device(cli_id);
					
	dev->dev_busy = 1;
				  
	return dev->cli_id;
}