Home | History | Annotate | Download | only in cybergfx

Lines Matching refs:screen

41 /* Various screen update functions available */
50 int CGX_SetupImage(_THIS, SDL_Surface *screen)
54 if(screen->flags&SDL_HWSURFACE) {
57 if(!screen->hwdata) {
58 if(!(screen->hwdata=SDL_malloc(sizeof(struct private_hwdata))))
63 screen->hwdata->lock=NULL;
64 screen->hwdata->allocated=0;
65 screen->hwdata->mask=NULL;
66 screen->hwdata->bmap=SDL_RastPort->BitMap;
67 screen->hwdata->videodata=this;
69 if(!(screen->hwdata->lock=LockBitMapTags(screen->hwdata->bmap,
70 LBMI_BASEADDRESS,(ULONG)&screen->pixels,
72 SDL_free(screen->hwdata);
73 screen->hwdata=NULL;
77 UnLockBitMap(screen->hwdata->lock);
78 screen->hwdata->lock=NULL;
81 screen->pitch=pitch;
85 D(bug("Accel video image configured (%lx, pitch %ld).\n",screen->pixels,screen->pitch));
89 screen->pixels = SDL_malloc(screen->h*screen->pitch);
91 if ( screen->pixels == NULL ) {
96 SDL_Ximage=screen->pixels;
108 void CGX_DestroyImage(_THIS, SDL_Surface *screen)
114 if ( screen ) {
115 screen->pixels = NULL;
117 if(screen->hwdata) {
118 SDL_free(screen->hwdata);
119 screen->hwdata=NULL;
130 int CGX_ResizeImage(_THIS, SDL_Surface *screen, Uint32 flags)
136 CGX_DestroyImage(this, screen);
141 retval = CGX_SetupImage(this, screen);
145 screen->flags |= SDL_ASYNCBLIT;
281 static void CGX_SwapAllPixels(SDL_Surface *screen)
285 switch (screen->format->BytesPerPixel) {
288 for ( y=0; y<screen->h; ++y ) {
289 spot = (Uint16 *) ((Uint8 *)screen->pixels +
290 y * screen->pitch);
291 for ( x=0; x<screen->w; ++x, ++spot ) {
300 for ( y=0; y<screen->h; ++y ) {
301 spot = (Uint32 *) ((Uint8 *)screen->pixels +
302 y * screen->pitch);
303 for ( x=0; x<screen->w; ++x, ++spot ) {
315 static void CGX_SwapPixels(SDL_Surface *screen, int numrects, SDL_Rect *rects)
321 switch (screen->format->BytesPerPixel) {
330 spot = (Uint16 *) ((Uint8 *)screen->pixels +
331 y * screen->pitch + minx * 2);
348 spot = (Uint32 *) ((Uint8 *)screen->pixels +
349 y * screen->pitch + minx * 4);
390 else switch(this->screen->format->BytesPerPixel)
432 ((this->screen->format->BytesPerPixel%2) == 0) ) {
434 CGX_SwapPixels(this->screen, numrects, rects);
439 USE_WPA(this->screen->pixels,rects[i].x, rects[i].y,this->screen->pitch,
443 CGX_SwapPixels(this->screen, numrects, rects);
453 WLUT(this->screen->pixels,rects[i].x, rects[i].y,this->screen->pitch,
487 src=((char *)(this->screen->pixels))+rects[i].x;
488 src+=(rects[i].y*this->screen->pitch);
503 src+=this->screen->pitch;
540 src=((char *)(this->screen->pixels))+rects[i].x;
541 src+=(rects[i].y*this->screen->pitch);
555 src+=this->screen->pitch;
592 src=((char *)(this->screen->pixels))+rects[i].x;
593 src+=(rects[i].y*this->screen->pitch);
607 src+=this->screen->pitch;
634 destbase=bm_address+(SDL_Window->TopEdge+SDL_Window->BorderTop)*destpitch+(SDL_Window->BorderLeft+SDL_Window->LeftEdge)*this->screen->format->BytesPerPixel;
644 dest=destbase+rects[i].x*this->screen->format->BytesPerPixel;
646 src=((char *)(this->screen->pixels))+rects[i].x*this->screen->format->BytesPerPixel;
647 src+=(rects[i].y*this->screen->pitch);
649 srcwidth*=this->screen->format->BytesPerPixel;
656 src+=this->screen->pitch;
661 // D(bug("Rectblit addr: %lx pitch: %ld rects:%ld srcptr: %lx srcpitch: %ld\n",bm_address,destpitch,numrects,this->screen->pixels,this->screen->pitch));
670 USE_WPA(this->screen->pixels,rects[i].x, rects[i].y,this->screen->pitch,
692 else switch(this->screen->format->BytesPerPixel)
731 ((this->screen->format->BytesPerPixel%2) == 0) ) {
732 CGX_SwapAllPixels(this->screen);
733 USE_WPA(this->screen->pixels,0,0,this->screen->pitch,
735 this->screen->w,this->screen->h,format);
736 CGX_SwapAllPixels(this->screen);
741 WLUT(this->screen->pixels,0,0,this->screen->pitch,
743 this->screen->w,this->screen->h,CTABFMT_XRGB8);
762 src=this->screen->pixels;
764 for(j=this->screen->h;j;--j)
768 for(k=0;k<this->screen->w;k++)
777 src+=this->screen->pitch;
801 src=this->screen->pixels;
805 for(j=this->screen->h;j;--j)
809 for(k=0;k<this->screen->w;k++)
815 src+=this->screen->pitch;
839 src=this->screen->pixels;
843 for(j=this->screen->h;j;--j)
847 for(k=0;k<this->screen->w;k++)
853 src+=this->screen->pitch;
874 dest=bm_address+(SDL_Window->TopEdge+SDL_Window->BorderTop)*destpitch+(SDL_Window->BorderLeft+SDL_Window->LeftEdge)*this->screen->format->BytesPerPixel;
878 src=this->screen->pixels;
880 // D(bug("addr: %lx pitch: %ld src:%lx srcpitch: %ld\n",dest,destpitch,this->screen->pixels,this->screen->pitch));
882 if(this->screen->pitch==destpitch)
884 SDL_memcpy(dest,src,this->screen->pitch*this->screen->h);
888 for(j=this->screen->h;j;--j)
890 SDL_memcpy(dest,src,this->screen->pitch);
891 src+=this->screen->pitch;
901 USE_WPA(this->screen->pixels,0,0,this->screen->pitch,
903 this->screen->w,this->screen->h,format);