mirror of
https://github.com/QB64Official/qb64.git
synced 2024-07-03 10:01:21 +00:00
Indentation only.
This commit is contained in:
parent
a75adfe519
commit
e45eed894d
|
@ -1,46 +1,46 @@
|
||||||
#ifdef QB64_BACKSLASH_FILESYSTEM
|
#ifdef QB64_BACKSLASH_FILESYSTEM
|
||||||
#include "src\\EasyBMP.cpp"
|
#include "src\\EasyBMP.cpp"
|
||||||
#else
|
#else
|
||||||
#include "src/EasyBMP.cpp"
|
#include "src/EasyBMP.cpp"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
uint8 *image_decode_bmp(uint8 *content,int32 bytes,int32 *result,int32 *x,int32 *y){
|
uint8 *image_decode_bmp(uint8 *content,int32 bytes,int32 *result,int32 *x,int32 *y){
|
||||||
//Result:bit 1=Success,bit 2=32bit[BGRA]
|
//Result:bit 1=Success,bit 2=32bit[BGRA]
|
||||||
*result=0;
|
*result=0;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
BMP bm;
|
BMP bm;
|
||||||
|
|
||||||
if(!bm.ReadFromMemory((char*)content, bytes)){
|
if(!bm.ReadFromMemory((char*)content, bytes)){
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int32 h,w;
|
int32 h,w;
|
||||||
h=bm.TellHeight();
|
h=bm.TellHeight();
|
||||||
w=bm.TellWidth();
|
w=bm.TellWidth();
|
||||||
|
|
||||||
uint8 *out;
|
uint8 *out;
|
||||||
out=(uint8*)malloc(h*w*4);
|
out=(uint8*)malloc(h*w*4);
|
||||||
|
|
||||||
uint8* o;
|
uint8* o;
|
||||||
int32 x2,y2;
|
int32 x2,y2;
|
||||||
o=out;
|
o=out;
|
||||||
for (y2=0;y2<h;y2++){
|
for (y2=0;y2<h;y2++){
|
||||||
for (x2=0;x2<w;x2++){
|
for (x2=0;x2<w;x2++){
|
||||||
*o=bm(x2,y2)->Blue; o++;
|
*o=bm(x2,y2)->Blue; o++;
|
||||||
*o=bm(x2,y2)->Green; o++;
|
*o=bm(x2,y2)->Green; o++;
|
||||||
*o=bm(x2,y2)->Red; o++;
|
*o=bm(x2,y2)->Red; o++;
|
||||||
*o=255; o++;
|
*o=255; o++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
*result=1+2;
|
*result=1+2;
|
||||||
*x=w;
|
*x=w;
|
||||||
*y=h;
|
*y=h;
|
||||||
return out;
|
return out;
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in a new issue