@@ -82,111 +82,6 @@ static void DrawFadedTexturedTrigon(const Point16& p1, const Point16& p2, const
8282
8383bool CSurface::drawTextures = false ;
8484
85- bool CSurface::Draw (SDL_Surface* Surf_Dest, SDL_Surface* Surf_Src, int X, int Y)
86- {
87- if (!Surf_Dest || !Surf_Src)
88- return false ;
89-
90- SDL_Rect DestR;
91-
92- DestR.x = X;
93- DestR.y = Y;
94-
95- SDL_BlitSurface (Surf_Src, nullptr , Surf_Dest, &DestR);
96-
97- return true ;
98- }
99-
100- bool CSurface::Draw (SDL_Surface* Surf_Dest, SdlSurface& Surf_Src, int X, int Y)
101- {
102- return Draw (Surf_Dest, Surf_Src.get (), X, Y);
103- }
104-
105- bool CSurface::Draw (SdlSurface& Surf_Dest, SdlSurface& Surf_Src, Position pos)
106- {
107- return Draw (Surf_Dest.get (), Surf_Src.get (), pos.x , pos.y );
108- }
109-
110- bool CSurface::Draw (SdlSurface& Surf_Dest, SDL_Surface* Surf_Src, int X, int Y)
111- {
112- return Draw (Surf_Dest.get (), Surf_Src, X, Y);
113- }
114-
115- bool CSurface::Draw (SDL_Surface* Surf_Dest, SDL_Surface* Surf_Src, Position dest, Position srcOffset, Extent srcSize)
116- {
117- if (!Surf_Dest || !Surf_Src)
118- return false ;
119-
120- SDL_Rect DestR;
121-
122- DestR.x = dest.x ;
123- DestR.y = dest.y ;
124-
125- SDL_Rect SrcR;
126-
127- SrcR.x = srcOffset.x ;
128- SrcR.y = srcOffset.y ;
129- SrcR.w = static_cast <int >(srcSize.x );
130- SrcR.h = static_cast <int >(srcSize.y );
131-
132- SDL_BlitSurface (Surf_Src, &SrcR, Surf_Dest, &DestR);
133-
134- return true ;
135- }
136-
137- bool CSurface::Draw (SDL_Surface* Surf_Dest, SdlSurface& Surf_Src, Position dest, Position srcOffset, Extent srcSize)
138- {
139- return Draw (Surf_Dest, Surf_Src.get (), dest, srcOffset, srcSize);
140- }
141-
142- // this is the example function from the SDL-documentation to draw pixels
143- void CSurface::DrawPixel_Color (SDL_Surface* screen, Position pos, Uint32 color)
144- {
145- int bpp = screen->format ->BytesPerPixel ;
146- /* Here p is the address to the pixel we want to retrieve */
147- Uint8* p = (Uint8*)screen->pixels + static_cast <int >(pos.y ) * screen->pitch + static_cast <int >(pos.x ) * bpp;
148-
149- if (SDL_MUSTLOCK (screen))
150- SDL_LockSurface (screen);
151-
152- switch (bpp)
153- {
154- case 1 : *p = color; break ;
155-
156- case 2 : *(Uint16*)p = color; break ;
157-
158- case 3 :
159- if ((SDL_BYTEORDER ) == SDL_LIL_ENDIAN )
160- {
161- p[0 ] = color;
162- p[1 ] = color >> 8 ;
163- p[2 ] = color >> 16 ;
164- } else
165- {
166- p[2 ] = color;
167- p[1 ] = color >> 8 ;
168- p[0 ] = color >> 16 ;
169- }
170- break ;
171-
172- case 4 : *(Uint32*)p = color; break ;
173- }
174-
175- if (SDL_MUSTLOCK (screen))
176- SDL_UnlockSurface (screen);
177- }
178-
179- // this is the example function from the sdl-documentation to draw pixels
180- void CSurface::DrawPixel_RGB (SDL_Surface* screen, Position pos, Uint8 R, Uint8 G, Uint8 B)
181- {
182- DrawPixel_Color (screen, pos, SDL_MapRGB (screen->format , R, G, B));
183- }
184-
185- void CSurface::DrawPixel_RGBA (SDL_Surface* screen, Position pos, Uint8 R, Uint8 G, Uint8 B, Uint8 A)
186- {
187- DrawPixel_Color (screen, pos, SDL_MapRGBA (screen->format , R, G, B, A));
188- }
189-
19085void CSurface::DrawTriangleField (const DisplayRectangle& displayRect, const bobMAP& myMap)
19186{
19287 Uint16 width = myMap.width ;
0 commit comments