mirror of
https://github.com/VincentWei/MiniGUI.git
synced 2026-09-23 08:33:55 +08:00
add const to INNER_RES
This commit is contained in:
+5
-6
@@ -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 */
|
||||
|
||||
+4
-3
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user