//Draw a character to dest.... void draw_fiend_enemy(BITMAP *dest,ENEMY_INFO *temp,int x, int y,int action,int frame, float angle) { int num = temp->animation[action].frame[frame]; //pivot_fiend_sprite(dest, temp->pic[num].data,x,y,temp->pic[num].center_x,temp->pic[num].center_y,angle,FIEND_DRAW_MODE_TRANS); pivot_sprite(dest, temp->pic[num].data,x,y,temp->pic[num].center_x,temp->pic[num].center_y,degree_to_fixed(angle)); //rotate_sprite(dest, temp->pic[num].data,x-temp->pic[num].data->w/2,y-temp->pic[num].data->h/2,f_angle); }
void Menu::update(){ poll_mouse(); angle = atan2(mouse_y-cy,mouse_x-cx)*255.0/(2.0*3.14150926); masked_blit(bgd,image,0,0,x,y,width,height); populate(); cy = 190 + 50*selectNum; //masked_blit(cursor,image,0,0,cx,cy,32,32); pivot_sprite(image,cursor,cx,cy,16,16,ftofix(angle)); //angle++; }
void draw(BITMAP * buffer) { if (image == NULL) draw_bounding_box(buffer); else pivot_sprite(buffer, image, pos.x, pos.y, image_offset.x, image_offset.y, itofix(angle*(128/PI))); }
void AGENT::draw(DISPLAY* display) { int drawX = display->toScreenX((int) x); int drawY = display->toScreenY((int) y); // Draw BITMAP * frame; if (!build_data) frame = getFrame(); else frame = build_data->sprite; if (highlight) circle(display->buffer, drawX, drawY, unitData->radius * 4 / (build_data ? 2 : 5), makecol(255, 255, 255)); // highlight pivot_sprite(display->buffer, frame, drawX, drawY, frame->w / 2, frame->h / 2, itofix( (int) (rotation / 360.0 * 256) )); }
void PARTICLE::draw(DISPLAY& disp) { int drawX = disp.toScreenX((int) x); int drawY = disp.toScreenY((int) y); BITMAP * fsprite = data.frames[(int)frame_index]; // create subsprite if ((data.particle_type == 1 || data.particle_type == 2) && start_len < fsprite->w*2) { if ((int)frame_index != prev_frameindex) { prev_frameindex = (int)frame_index; if (sprite && is_subimg) destroy_bitmap(sprite); sprite = create_sub_bitmap(fsprite, fsprite->w/2 - start_len/2, 0, (start_len > 20) ? start_len : 20, fsprite->h); } } else { sprite = fsprite; is_subimg = false; } // draw if (data.particle_type == 0 || data.particle_type == 3) pivot_sprite(disp.buffer, sprite, drawX, drawY, sprite->w / 2, sprite->h / 2, itofix( (int) (theta / M_PI * 256/2) )); else if (data.particle_type == 1 || data.particle_type == 2) pivot_scaled_sprite(disp.buffer, sprite, drawX, drawY, 0, sprite->h / 2, itofix( (int) (theta / M_PI * 256/2) ), ftofix(expansion * (double)starting_life/(double)sprite->w)); }
void Bitmap::RotateBlt(Bitmap *src, int dst_x, int dst_y, int pivot_x, int pivot_y, fixed_t angle) { BITMAP *al_src_bmp = src->_alBitmap; pivot_sprite(_alBitmap, al_src_bmp, dst_x, dst_y, pivot_x, pivot_y, angle); }