Working SDL_BlitSurface()

This commit is contained in:
Sylvain PILLOT 2022-04-23 10:47:22 +02:00
parent 2ea4ea7eab
commit 9d74474b3f
53 changed files with 171 additions and 114 deletions

View File

@ -2,19 +2,162 @@
<CodeBlocks_layout_file>
<FileVersion major="1" minor="0" />
<ActiveTarget name="Release" />
<File name="include/SDL_stdinc.h" open="1" top="1" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="2433" topLine="65" />
</Cursor>
</File>
<File name="src/events/SDL_events.c" open="0" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="2769" topLine="255" />
</Cursor>
</File>
<File name="src/video/prizm/SDL_prizmutils.c" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="307" topLine="0" />
</Cursor>
</File>
<File name="src/file/SDL_rwops.c" open="1" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="17253" topLine="108" />
</Cursor>
<Folding>
<Collapse line="48" />
<Collapse line="186" />
<Collapse line="222" />
<Collapse line="269" />
<Collapse line="301" />
<Collapse line="323" />
<Collapse line="332" />
<Collapse line="342" />
<Collapse line="352" />
<Collapse line="367" />
<Collapse line="394" />
<Collapse line="414" />
<Collapse line="423" />
<Collapse line="428" />
<Collapse line="439" />
<Collapse line="444" />
<Collapse line="483" />
<Collapse line="532" />
<Collapse line="549" />
<Collapse line="566" />
<Collapse line="583" />
<Collapse line="594" />
<Collapse line="608" />
<Collapse line="615" />
<Collapse line="622" />
<Collapse line="629" />
<Collapse line="636" />
<Collapse line="644" />
<Collapse line="649" />
<Collapse line="654" />
<Collapse line="659" />
<Collapse line="664" />
<Collapse line="669" />
</Folding>
</File>
<File name="include/SDL_config_prizm.h" open="0" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="2746" topLine="12" />
</Cursor>
</File>
<File name="src/video/SDL_blit_N.c" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="153" />
</Cursor>
</File>
<File name="include/SDL_config.h" open="0" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="1297" topLine="15" />
</Cursor>
</File>
<File name="include/SDL_video.h" open="1" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="25230" topLine="631" />
</Cursor>
</File>
<File name="src/video/prizm/SDL_prizmnti.c" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="762" topLine="3" />
</Cursor>
<Folding>
<Collapse line="5" />
</Folding>
</File>
<File name="src/video/SDL_video.c" open="0" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="29549" topLine="860" />
</Cursor>
<Folding>
<Collapse line="156" />
<Collapse line="1047" />
<Collapse line="1051" />
<Collapse line="1113" />
</Folding>
</File>
<File name="src/video/SDL_surface.c" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="14589" topLine="710" />
</Cursor>
</File>
<File name="src/video/SDL_blit_0.c" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="39" />
</Cursor>
<Folding>
<Collapse line="29" />
<Collapse line="82" />
<Collapse line="117" />
<Collapse line="154" />
<Collapse line="190" />
<Collapse line="242" />
<Collapse line="276" />
<Collapse line="309" />
<Collapse line="343" />
<Collapse line="388" />
<Collapse line="438" />
<Collapse line="443" />
</Folding>
</File>
<File name="src/video/prizm/SDL_prizmfonts.h" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="159" topLine="0" />
</Cursor>
</File>
<File name="src/video/prizm/SDL_prizmfonts.c" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="706" topLine="7" />
</Cursor>
</File>
<File name="src/video/prizm/SDL_prizmevents_c.h" open="0" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="2002" topLine="69" />
</Cursor>
</File>
<File name="src/timer/prizm/SDL_systimer.c" open="0" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="1475" topLine="3" />
</Cursor>
</File>
<File name="src/video/prizm/SDL_prizmvideo.c" open="1" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="include/SDL_error.h" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="3544" topLine="86" />
<Cursor1 position="1459" topLine="47" />
</Cursor>
</File>
<File name="src/stdlib/SDL_string.c" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="7025" topLine="273" />
</Cursor>
</File>
<File name="src/video/SDL_blit.h" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="1552" topLine="468" />
</Cursor>
</File>
<File name="Makefile.prizm" open="0" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="1235" topLine="26" />
</Cursor>
</File>
<File name="src/video/SDL_pixels.c" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
@ -47,72 +190,14 @@
<Collapse line="617" />
</Folding>
</File>
<File name="src/video/SDL_blit_0.c" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="src/video/prizm/SDL_prizmvideo.h" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="39" />
</Cursor>
<Folding>
<Collapse line="29" />
<Collapse line="82" />
<Collapse line="117" />
<Collapse line="154" />
<Collapse line="190" />
<Collapse line="242" />
<Collapse line="276" />
<Collapse line="309" />
<Collapse line="343" />
<Collapse line="388" />
<Collapse line="438" />
<Collapse line="443" />
</Folding>
</File>
<File name="src/video/prizm/SDL_prizmevents_c.h" open="0" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="2002" topLine="69" />
<Cursor1 position="0" topLine="11" />
</Cursor>
</File>
<File name="include/SDL_config_prizm.h" open="0" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="include/SDL_endian.h" open="1" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="2746" topLine="12" />
</Cursor>
</File>
<File name="src/video/SDL_blit.h" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="1552" topLine="468" />
</Cursor>
</File>
<File name="src/video/prizm/SDL_prizmfonts.h" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="159" topLine="0" />
</Cursor>
</File>
<File name="src/video/SDL_video.c" open="1" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="2971" topLine="135" />
</Cursor>
<Folding>
<Collapse line="154" />
<Collapse line="290" />
<Collapse line="302" />
<Collapse line="316" />
<Collapse line="334" />
<Collapse line="357" />
<Collapse line="376" />
<Collapse line="435" />
<Collapse line="505" />
<Collapse line="523" />
<Collapse line="1111" />
<Collapse line="1629" />
</Folding>
</File>
<File name="include/SDL_config.h" open="0" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="1297" topLine="15" />
</Cursor>
</File>
<File name="src/video/prizm/SDL_prizmutils.c" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="307" topLine="0" />
<Cursor1 position="3019" topLine="87" />
</Cursor>
</File>
<File name="src/video/SDL_sysvideo.h" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
@ -120,57 +205,22 @@
<Cursor1 position="12039" topLine="392" />
</Cursor>
</File>
<File name="src/video/prizm/SDL_prizmnti.c" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="src/video/prizm/SDL_prizmvideo.c" open="0" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="762" topLine="3" />
<Cursor1 position="6352" topLine="204" />
</Cursor>
</File>
<File name="src/video/SDL_bmp.c" open="1" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="2875" topLine="101" />
</Cursor>
<Folding>
<Collapse line="5" />
<Collapse line="365" />
</Folding>
</File>
<File name="src/SDL_error.c" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="src/SDL_error.c" open="1" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="1681" topLine="25" />
</Cursor>
</File>
<File name="src/video/prizm/SDL_prizmfonts.c" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="706" topLine="7" />
</Cursor>
</File>
<File name="Makefile.prizm" open="1" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="1235" topLine="26" />
</Cursor>
</File>
<File name="src/video/prizm/SDL_prizmvideo.h" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="11" />
</Cursor>
</File>
<File name="src/video/SDL_blit_N.c" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="153" />
</Cursor>
</File>
<File name="src/events/SDL_events.c" open="1" top="1" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="2769" topLine="255" />
</Cursor>
</File>
<File name="include/SDL_error.h" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="1459" topLine="47" />
</Cursor>
</File>
<File name="include/SDL_video.h" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="8955" topLine="277" />
</Cursor>
</File>
<File name="src/stdlib/SDL_string.c" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="7025" topLine="273" />
<Cursor1 position="1517" topLine="48" />
</Cursor>
</File>
<File name="src/video/prizm/SDL_prizmevents.c" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">

View File

@ -645,7 +645,9 @@ extern DECLSPEC void SDLCALL SDL_UnlockSurface(SDL_Surface *surface);
extern DECLSPEC SDL_Surface * SDLCALL SDL_LoadBMP_RW(SDL_RWops *src, int freesrc);
/** Convenience macro -- load a surface from a file */
#define SDL_LoadBMP(file) SDL_LoadBMP_RW(SDL_RWFromFile(file, "rb"), 1)
//#define SDL_LoadBMP(file) SDL_LoadBMP_RW(SDL_RWFromFile(file, "rb"), 1)
extern DECLSPEC SDL_Surface * SDLCALL SDL_LoadBMP(const char *filename );
/**
* Save a surface to a seekable SDL data source (memory or file.)

BIN
libSDL_prizm.a Normal file

Binary file not shown.

BIN
src/SDL.o Normal file

Binary file not shown.

BIN
src/SDL_error.o Normal file

Binary file not shown.

BIN
src/SDL_fatal.o Normal file

Binary file not shown.

BIN
src/audio/SDL_audio.o Normal file

Binary file not shown.

BIN
src/audio/SDL_audiocvt.o Normal file

Binary file not shown.

BIN
src/cpuinfo/SDL_cpuinfo.o Normal file

Binary file not shown.

BIN
src/events/SDL_active.o Normal file

Binary file not shown.

BIN
src/events/SDL_events.o Normal file

Binary file not shown.

BIN
src/events/SDL_expose.o Normal file

Binary file not shown.

BIN
src/events/SDL_keyboard.o Normal file

Binary file not shown.

BIN
src/events/SDL_mouse.o Normal file

Binary file not shown.

BIN
src/events/SDL_quit.o Normal file

Binary file not shown.

BIN
src/events/SDL_resize.o Normal file

Binary file not shown.

BIN
src/file/SDL_rwops.o Normal file

Binary file not shown.

BIN
src/joystick/SDL_joystick.o Normal file

Binary file not shown.

BIN
src/stdlib/SDL_getenv.o Normal file

Binary file not shown.

BIN
src/stdlib/SDL_iconv.o Normal file

Binary file not shown.

BIN
src/stdlib/SDL_malloc.o Normal file

Binary file not shown.

BIN
src/stdlib/SDL_qsort.o Normal file

Binary file not shown.

BIN
src/stdlib/SDL_stdlib.o Normal file

Binary file not shown.

BIN
src/stdlib/SDL_string.o Normal file

Binary file not shown.

BIN
src/thread/SDL_thread.o Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
src/timer/SDL_timer.o Normal file

Binary file not shown.

Binary file not shown.

BIN
src/video/SDL_RLEaccel.o Normal file

Binary file not shown.

BIN
src/video/SDL_blit.o Normal file

Binary file not shown.

BIN
src/video/SDL_blit_0.o Normal file

Binary file not shown.

BIN
src/video/SDL_blit_1.o Normal file

Binary file not shown.

BIN
src/video/SDL_blit_A.o Normal file

Binary file not shown.

BIN
src/video/SDL_blit_N.o Normal file

Binary file not shown.

View File

@ -21,14 +21,14 @@
*/
#include "SDL_config.h"
/*
/*
Code to load and save surfaces in Windows BMP format.
Why support BMP format? Well, it's a native format for Windows, and
most image processing programs can read and write it. It would be nice
to be able to have at least one image format that we can natively load
and save, and since PNG is so complex that it would bloat the library,
BMP is a good alternative.
BMP is a good alternative.
This code currently supports Win32 DIBs in uncompressed 8 and 24 bpp.
*/
@ -44,6 +44,11 @@
#define BI_BITFIELDS 3
#endif
SDL_Surface * SDL_LoadBMP( const char* filename )
{
return SDL_LoadBMP_RW(SDL_RWFromFile(filename, "rb"), 1);
}
SDL_Surface * SDL_LoadBMP_RW (SDL_RWops *src, int freesrc)
{
@ -240,14 +245,14 @@ SDL_Surface * SDL_LoadBMP_RW (SDL_RWops *src, int freesrc)
SDL_RWread(src, &palette->colors[i].g, 1, 1);
SDL_RWread(src, &palette->colors[i].r, 1, 1);
palette->colors[i].unused = 0;
}
}
} else {
for ( i = 0; i < (int)biClrUsed; ++i ) {
SDL_RWread(src, &palette->colors[i].b, 1, 1);
SDL_RWread(src, &palette->colors[i].g, 1, 1);
SDL_RWread(src, &palette->colors[i].r, 1, 1);
SDL_RWread(src, &palette->colors[i].unused, 1, 1);
}
}
}
palette->ncolors = biClrUsed;
}

BIN
src/video/SDL_bmp.o Normal file

Binary file not shown.

BIN
src/video/SDL_cursor.o Normal file

Binary file not shown.

BIN
src/video/SDL_gamma.o Normal file

Binary file not shown.

BIN
src/video/SDL_pixels.o Normal file

Binary file not shown.

BIN
src/video/SDL_stretch.o Normal file

Binary file not shown.

BIN
src/video/SDL_surface.o Normal file

Binary file not shown.

BIN
src/video/SDL_video.o Normal file

Binary file not shown.

BIN
src/video/SDL_yuv.o Normal file

Binary file not shown.

BIN
src/video/SDL_yuv_mmx.o Normal file

Binary file not shown.

BIN
src/video/SDL_yuv_sw.o Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.