/** * initialize general properties */ void alignInit() { //vector mid; listNode *ln; /* apply the moving actions if this isn't the first image */ if(curSlice > 0) { /* find the initial placement of the ref image */ refImgBounds.v1.x = 0; refImgBounds.v1.y = 0; refImgBounds.v2.x = ref->width; refImgBounds.v2.y = 0; refImgBounds.v3.x = ref->width; refImgBounds.v3.y = ref->height; refImgBounds.v4.x = 0; refImgBounds.v4.y = ref->height; /* get the action list to apply/modify, create if it doesn't exist */ while(NULL == (ln=getListNode(curDataset->sliceActionLists,curSlice-1))) { actions = newList(LIST); enqueue(curDataset->sliceActionLists, actions); } actions = (list*) ln->data; /* apply the actions */ refImgBounds = applyActions(actions,refImgBounds); } /* find the initial placement of the moving image */ movImgBounds.v1.x = 0; movImgBounds.v1.y = 0; movImgBounds.v2.x = mov->width; movImgBounds.v2.y = 0; movImgBounds.v3.x = mov->width; movImgBounds.v3.y = mov->height; movImgBounds.v4.x = 0; movImgBounds.v4.y = mov->height; curDataset->width = mov->width; curDataset->height = mov->height; curRotCenter.x = (movImgBounds.v1.x+movImgBounds.v3.x)/2.0; curRotCenter.y = (movImgBounds.v1.y+movImgBounds.v3.y)/2.0; /* get the moving action list to apply/modify, create if it doesn't exist */ while(NULL == (ln = getListNode(curDataset->sliceActionLists,curSlice))) { actions = newList(LIST); enqueue(curDataset->sliceActionLists, actions); } actions = (list*) ln->data; /* apply the actions */ movImgBounds = applyActions(actions,movImgBounds); /* turn on animation */ animate = TRUE; strcpy(alertString,""); alignTimerEvent(0); }
void ALEController::display() { // Display the screen if applicable DisplayScreen* display = m_osystem->p_display_screen; if (display) { display->display_screen(); while (display->manual_control_engaged()) { Action user_action = display->getUserAction(); applyActions(user_action, PLAYER_B_NOOP); display->display_screen(); } } }