Mercurial > sdl-ios-xcode
comparison src/video/fbcon/SDL_fb3dfx.c @ 109:5a9c36a45db1
Fixed switching away from the SDL at the framebuffer console
author | Sam Lantinga <slouken@lokigames.com> |
---|---|
date | Sat, 14 Jul 2001 19:10:06 +0000 |
parents | 63ec24e0575f |
children | e8157fcb3114 |
comparison
equal
deleted
inserted
replaced
108:e021a4c9e25f | 109:5a9c36a45db1 |
---|---|
58 { | 58 { |
59 int bpp; | 59 int bpp; |
60 char *dst_base; | 60 char *dst_base; |
61 Uint32 format; | 61 Uint32 format; |
62 int dstX, dstY; | 62 int dstX, dstY; |
63 | |
64 /* Don't blit to the display surface when switched away */ | |
65 if ( dst == this->screen ) { | |
66 SDL_mutexP(hw_lock); | |
67 } | |
63 | 68 |
64 /* Set the destination pixel format */ | 69 /* Set the destination pixel format */ |
65 dst_base = (char *)((char *)dst->pixels - mapped_mem); | 70 dst_base = (char *)((char *)dst->pixels - mapped_mem); |
66 bpp = dst->format->BitsPerPixel; | 71 bpp = dst->format->BitsPerPixel; |
67 format = dst->pitch | ((bpp+((bpp==8) ? 0 : 8)) << 13); | 72 format = dst->pitch | ((bpp+((bpp==8) ? 0 : 8)) << 13); |
79 tdfx_out32(DSTSIZE, rect->w | (rect->h << 16)); | 84 tdfx_out32(DSTSIZE, rect->w | (rect->h << 16)); |
80 tdfx_out32(LAUNCH_2D, dstX | (dstY << 16)); | 85 tdfx_out32(LAUNCH_2D, dstX | (dstY << 16)); |
81 | 86 |
82 FB_AddBusySurface(dst); | 87 FB_AddBusySurface(dst); |
83 | 88 |
89 if ( dst == this->screen ) { | |
90 SDL_mutexV(hw_lock); | |
91 } | |
84 return(0); | 92 return(0); |
85 } | 93 } |
86 | 94 |
87 static int HWAccelBlit(SDL_Surface *src, SDL_Rect *srcrect, | 95 static int HWAccelBlit(SDL_Surface *src, SDL_Rect *srcrect, |
88 SDL_Surface *dst, SDL_Rect *dstrect) | 96 SDL_Surface *dst, SDL_Rect *dstrect) |
89 { | 97 { |
90 SDL_VideoDevice *this; | 98 SDL_VideoDevice *this = current_video; |
91 int bpp; | 99 int bpp; |
92 Uint32 src_format; | 100 Uint32 src_format; |
93 Uint32 dst_format; | 101 Uint32 dst_format; |
94 char *src_base; | 102 char *src_base; |
95 char *dst_base; | 103 char *dst_base; |
96 int srcX, srcY; | 104 int srcX, srcY; |
97 int dstX, dstY; | 105 int dstX, dstY; |
98 Uint32 blitop; | 106 Uint32 blitop; |
99 Uint32 use_colorkey; | 107 Uint32 use_colorkey; |
100 | 108 |
109 /* Don't blit to the display surface when switched away */ | |
110 if ( dst == this->screen ) { | |
111 SDL_mutexP(hw_lock); | |
112 } | |
113 | |
101 /* Set the source and destination pixel format */ | 114 /* Set the source and destination pixel format */ |
102 this = current_video; | |
103 src_base = (char *)((char *)src->pixels - mapped_mem); | 115 src_base = (char *)((char *)src->pixels - mapped_mem); |
104 bpp = src->format->BitsPerPixel; | 116 bpp = src->format->BitsPerPixel; |
105 src_format = src->pitch | ((bpp+((bpp==8) ? 0 : 8)) << 13); | 117 src_format = src->pitch | ((bpp+((bpp==8) ? 0 : 8)) << 13); |
106 dst_base = (char *)((char *)dst->pixels - mapped_mem); | 118 dst_base = (char *)((char *)dst->pixels - mapped_mem); |
107 bpp = dst->format->BitsPerPixel; | 119 bpp = dst->format->BitsPerPixel; |
147 tdfx_out32(LAUNCH_2D, srcX | (srcY << 16)); | 159 tdfx_out32(LAUNCH_2D, srcX | (srcY << 16)); |
148 | 160 |
149 FB_AddBusySurface(src); | 161 FB_AddBusySurface(src); |
150 FB_AddBusySurface(dst); | 162 FB_AddBusySurface(dst); |
151 | 163 |
164 if ( dst == this->screen ) { | |
165 SDL_mutexV(hw_lock); | |
166 } | |
152 return(0); | 167 return(0); |
153 } | 168 } |
154 | 169 |
155 static int CheckHWBlit(_THIS, SDL_Surface *src, SDL_Surface *dst) | 170 static int CheckHWBlit(_THIS, SDL_Surface *src, SDL_Surface *dst) |
156 { | 171 { |