mirror of
https://gitea.nishi.boats/pyrite-dev/milsko
synced 2026-01-06 01:19:44 +00:00
aa
git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@573 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
@@ -375,8 +375,8 @@ MwLLPixmap MwLLCreatePixmap(MwLL handle, unsigned char* data, int width, int hei
|
|||||||
HDC dc = GetDC(handle->hWnd);
|
HDC dc = GetDC(handle->hWnd);
|
||||||
BITMAPINFOHEADER bmih;
|
BITMAPINFOHEADER bmih;
|
||||||
|
|
||||||
r->data_buffer = malloc(width * height * 4);
|
r->raw = malloc(width * height * 4);
|
||||||
memcpy(r->data_buffer, data, 4 * width * height);
|
memcpy(r->raw, data, 4 * width * height);
|
||||||
|
|
||||||
r->width = width;
|
r->width = width;
|
||||||
r->height = height;
|
r->height = height;
|
||||||
@@ -422,7 +422,7 @@ void MwLLPixmapUpdate(MwLLPixmap r) {
|
|||||||
BYTE* l2 = (BYTE*)&words2[y * (w / 2)];
|
BYTE* l2 = (BYTE*)&words2[y * (w / 2)];
|
||||||
for(x = 0; x < r->width; x++) {
|
for(x = 0; x < r->width; x++) {
|
||||||
RGBQUAD* q = &r->quad[y * r->width + x];
|
RGBQUAD* q = &r->quad[y * r->width + x];
|
||||||
unsigned char* px = &r->data_buffer[(y * r->width + x) * 4];
|
unsigned char* px = &r->raw[(y * r->width + x) * 4];
|
||||||
|
|
||||||
q->rgbRed = px[0];
|
q->rgbRed = px[0];
|
||||||
q->rgbGreen = px[1];
|
q->rgbGreen = px[1];
|
||||||
@@ -447,7 +447,7 @@ void MwLLPixmapUpdate(MwLLPixmap r) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void MwLLDestroyPixmap(MwLLPixmap pixmap) {
|
void MwLLDestroyPixmap(MwLLPixmap pixmap) {
|
||||||
free(pixmap->data_buffer);
|
free(pixmap->raw);
|
||||||
DeleteObject(pixmap->hMask);
|
DeleteObject(pixmap->hMask);
|
||||||
DeleteObject(pixmap->hMask2);
|
DeleteObject(pixmap->hMask2);
|
||||||
DeleteObject(pixmap->hBitmap);
|
DeleteObject(pixmap->hBitmap);
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ struct _MwLLColor {
|
|||||||
struct _MwLLPixmap {
|
struct _MwLLPixmap {
|
||||||
int width;
|
int width;
|
||||||
int height;
|
int height;
|
||||||
unsigned char* data_buffer;
|
unsigned char* raw;
|
||||||
|
|
||||||
RGBQUAD* quad;
|
RGBQUAD* quad;
|
||||||
HBITMAP hBitmap;
|
HBITMAP hBitmap;
|
||||||
|
|||||||
@@ -437,8 +437,8 @@ MwLLPixmap MwLLCreatePixmap(MwLL handle, unsigned char* data, int width, int hei
|
|||||||
int evbase, erbase;
|
int evbase, erbase;
|
||||||
XWindowAttributes attr;
|
XWindowAttributes attr;
|
||||||
|
|
||||||
r->data_buffer = malloc(4 * width * height);
|
r->raw = malloc(4 * width * height);
|
||||||
memcpy(r->data_buffer, data, 4 * width * height);
|
memcpy(r->raw, data, 4 * width * height);
|
||||||
|
|
||||||
XGetWindowAttributes(handle->display, handle->window, &attr);
|
XGetWindowAttributes(handle->display, handle->window, &attr);
|
||||||
|
|
||||||
@@ -462,7 +462,7 @@ void MwLLPixmapUpdate(MwLLPixmap r) {
|
|||||||
int y, x;
|
int y, x;
|
||||||
for(y = 0; y < r->height; y++) {
|
for(y = 0; y < r->height; y++) {
|
||||||
for(x = 0; x < r->width; x++) {
|
for(x = 0; x < r->width; x++) {
|
||||||
unsigned char* px = &r->data_buffer[(y * r->width + x) * 4];
|
unsigned char* px = &r->raw[(y * r->width + x) * 4];
|
||||||
MwLLColor c = NULL;
|
MwLLColor c = NULL;
|
||||||
unsigned long p;
|
unsigned long p;
|
||||||
|
|
||||||
|
|||||||
@@ -54,11 +54,10 @@ struct _MwLLColor {
|
|||||||
struct _MwLLPixmap {
|
struct _MwLLPixmap {
|
||||||
int width;
|
int width;
|
||||||
int height;
|
int height;
|
||||||
unsigned char* data;
|
unsigned char* raw;
|
||||||
unsigned char* data_buffer;
|
|
||||||
|
|
||||||
int depth;
|
int depth;
|
||||||
|
unsigned char* data;
|
||||||
MwLL handle;
|
MwLL handle;
|
||||||
int use_render;
|
int use_render;
|
||||||
Display* display;
|
Display* display;
|
||||||
|
|||||||
@@ -670,10 +670,10 @@ void MwReloadRaw(MwWidget handle, unsigned char* rgb, int width, int height, MwL
|
|||||||
int i;
|
int i;
|
||||||
MwLLColor base = handle->bgcolor == NULL ? MwParseColor(handle, MwGetText(handle, MwNbackground)) : handle->bgcolor;
|
MwLLColor base = handle->bgcolor == NULL ? MwParseColor(handle, MwGetText(handle, MwNbackground)) : handle->bgcolor;
|
||||||
|
|
||||||
memset(px->data_buf, 0, width * height * 4);
|
memset(px->raw, 0, width * height * 4);
|
||||||
for(i = 0; i < width * height; i++) {
|
for(i = 0; i < width * height; i++) {
|
||||||
unsigned char* pin = &rgb[i * 4];
|
unsigned char* pin = &rgb[i * 4];
|
||||||
unsigned char* pout = &px->data_buf[i * 4];
|
unsigned char* pout = &px->raw[i * 4];
|
||||||
double a = pin[3];
|
double a = pin[3];
|
||||||
|
|
||||||
a /= 255;
|
a /= 255;
|
||||||
|
|||||||
Reference in New Issue
Block a user