diff --git a/include/window.h b/include/window.h index 8c2dae99..d1f3577b 100644 --- a/include/window.h +++ b/include/window.h @@ -4584,17 +4584,16 @@ typedef unsigned long RES_KEY; /* define the incore res type */ typedef struct _INNER_RES { RES_KEY key; - Uint8* data; + const Uint8* data; int data_len; - /* special param recognized by the TYPE_OPS - * normal is null. - * is the data is a mem of raw png, jpeg, bmp + /* The special param recognized by the TYPE_OPS normally it is NULL. + * If data is the data is a mem of raw png, jpeg, bmp * and so on, it should be the extention name - * of the filename. eg. + * of the filename. eg. * INNER_RES res[]= { ... { ..., ... ,.., "png" } .. }; * */ - void* additional; + const void* additional; } INNER_RES; /* the type of resource */ diff --git a/src/sysres/resmgr.c b/src/sysres/resmgr.c index a442f154..dc3de550 100644 --- a/src/sysres/resmgr.c +++ b/src/sysres/resmgr.c @@ -928,11 +928,12 @@ static void* img_get_res_data(RESOURCE* res, int src_type, DWORD usr_param) INNER_RES* inner = res->source.inner; if(inner->additional == NULL) //raw bitmap { - res->data = inner->data; + res->data = (void*)inner->data; } else { BITMAP *pbmp = NEW(BITMAP); - if(LoadBitmapFromMem((HDC)usr_param, pbmp, inner->data, inner->data_len, (const char*)inner->additional) != 0) + if(LoadBitmapFromMem((HDC)usr_param, pbmp, inner->data, + inner->data_len, (const char*)inner->additional) != 0) { DELETE(pbmp); return NULL; @@ -1177,7 +1178,7 @@ static void* etc_get_res_data(RESOURCE* res, int src_type, DWORD usr_param) break; } case REF_SRC_INNER: - res->data = res->source.inner->data; + res->data = (void*)res->source.inner->data; break; default: return NULL;