forked from Mirrors/wine-wine
wrc: Remove duplicate code (PVS-Studio).
parent
88e8102570
commit
9b810cd6e8
|
@ -960,86 +960,48 @@ static res_t *cursorgroup2res(name_id_t *name, cursor_group_t *curg)
|
||||||
|
|
||||||
res = new_res();
|
res = new_res();
|
||||||
restag = put_res_header(res, WRC_RT_GROUP_CURSOR, NULL, name, curg->memopt, &(curg->lvc));
|
restag = put_res_header(res, WRC_RT_GROUP_CURSOR, NULL, name, curg->memopt, &(curg->lvc));
|
||||||
if(win32)
|
|
||||||
{
|
put_word(res, 0); /* Reserved */
|
||||||
put_word(res, 0); /* Reserved */
|
/* FIXME: The ResType in the NEWHEADER structure should
|
||||||
/* FIXME: The ResType in the NEWHEADER structure should
|
* contain 14 according to the MS win32 doc. This is
|
||||||
* contain 14 according to the MS win32 doc. This is
|
* not the case with the BRC compiler and I really doubt
|
||||||
* not the case with the BRC compiler and I really doubt
|
* the latter. Putting one here is compliant to win16 spec,
|
||||||
* the latter. Putting one here is compliant to win16 spec,
|
* but who knows the true value?
|
||||||
* but who knows the true value?
|
*/
|
||||||
*/
|
put_word(res, 2); /* ResType */
|
||||||
put_word(res, 2); /* ResType */
|
put_word(res, curg->ncursor);
|
||||||
put_word(res, curg->ncursor);
|
|
||||||
#if 0
|
#if 0
|
||||||
for(cur = curg->cursorlist; cur; cur = cur->next)
|
for(cur = curg->cursorlist; cur; cur = cur->next)
|
||||||
#else
|
#else
|
||||||
cur = curg->cursorlist;
|
cur = curg->cursorlist;
|
||||||
while(cur->next)
|
while(cur->next)
|
||||||
cur = cur->next;
|
cur = cur->next;
|
||||||
for(; cur; cur = cur->prev)
|
for(; cur; cur = cur->prev)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
put_word(res, cur->width);
|
put_word(res, cur->width);
|
||||||
/* FIXME: The height of a cursor is half the size of
|
/* FIXME: The height of a cursor is half the size of
|
||||||
* the bitmap's height. BRC puts the height from the
|
* the bitmap's height. BRC puts the height from the
|
||||||
* BITMAPINFOHEADER here instead of the cursorfile's
|
* BITMAPINFOHEADER here instead of the cursorfile's
|
||||||
* height. MS doesn't seem to care...
|
* height. MS doesn't seem to care...
|
||||||
*/
|
*/
|
||||||
put_word(res, cur->height);
|
put_word(res, cur->height);
|
||||||
/* FIXME: The next two are reversed in BRC and I don't
|
/* FIXME: The next two are reversed in BRC and I don't
|
||||||
* know why. Probably a bug. But, we can safely ignore
|
* know why. Probably a bug. But, we can safely ignore
|
||||||
* it because win16 does not support color cursors.
|
* it because win16 does not support color cursors.
|
||||||
* A warning should have been generated by the parser.
|
* A warning should have been generated by the parser.
|
||||||
*/
|
*/
|
||||||
put_word(res, cur->planes);
|
put_word(res, cur->planes);
|
||||||
put_word(res, cur->bits);
|
put_word(res, cur->bits);
|
||||||
/* FIXME: The +4 is the hotspot in the cursor resource.
|
/* FIXME: The +4 is the hotspot in the cursor resource.
|
||||||
* However, I could not find this in the documentation.
|
* However, I could not find this in the documentation.
|
||||||
* The hotspot bytes must either be included or MS
|
* The hotspot bytes must either be included or MS
|
||||||
* doesn't care.
|
* doesn't care.
|
||||||
*/
|
*/
|
||||||
put_dword(res, cur->data->size +4);
|
put_dword(res, cur->data->size +4);
|
||||||
put_word(res, cur->id);
|
put_word(res, cur->id);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else /* win16 */
|
|
||||||
{
|
|
||||||
put_word(res, 0); /* Reserved */
|
|
||||||
put_word(res, 2); /* ResType */
|
|
||||||
put_word(res, curg->ncursor);
|
|
||||||
#if 0
|
|
||||||
for(cur = curg->cursorlist; cur; cur = cur->next)
|
|
||||||
#else
|
|
||||||
cur = curg->cursorlist;
|
|
||||||
while(cur->next)
|
|
||||||
cur = cur->next;
|
|
||||||
for(; cur; cur = cur->prev)
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
put_word(res, cur->width);
|
|
||||||
/* FIXME: The height of a cursor is half the size of
|
|
||||||
* the bitmap's height. BRC puts the height from the
|
|
||||||
* BITMAPINFOHEADER here instead of the cursorfile's
|
|
||||||
* height. MS doesn't seem to care...
|
|
||||||
*/
|
|
||||||
put_word(res, cur->height);
|
|
||||||
/* FIXME: The next two are reversed in BRC and I don't
|
|
||||||
* know why. Probably a bug. But, we can safely ignore
|
|
||||||
* it because win16 does not support color cursors.
|
|
||||||
* A warning should have been generated by the parser.
|
|
||||||
*/
|
|
||||||
put_word(res, cur->planes);
|
|
||||||
put_word(res, cur->bits);
|
|
||||||
/* FIXME: The +4 is the hotspot in the cursor resource.
|
|
||||||
* However, I could not find this in the documentation.
|
|
||||||
* The hotspot bytes must either be included or MS
|
|
||||||
* doesn't care.
|
|
||||||
*/
|
|
||||||
put_dword(res, cur->data->size +4);
|
|
||||||
put_word(res, cur->id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
SetResSize(res, restag); /* Set ResourceSize */
|
SetResSize(res, restag); /* Set ResourceSize */
|
||||||
if(win32)
|
if(win32)
|
||||||
put_pad(res);
|
put_pad(res);
|
||||||
|
@ -1103,46 +1065,28 @@ static res_t *icongroup2res(name_id_t *name, icon_group_t *icog)
|
||||||
|
|
||||||
res = new_res();
|
res = new_res();
|
||||||
restag = put_res_header(res, WRC_RT_GROUP_ICON, NULL, name, icog->memopt, &(icog->lvc));
|
restag = put_res_header(res, WRC_RT_GROUP_ICON, NULL, name, icog->memopt, &(icog->lvc));
|
||||||
if(win32)
|
|
||||||
{
|
put_word(res, 0); /* Reserved */
|
||||||
put_word(res, 0); /* Reserved */
|
/* FIXME: The ResType in the NEWHEADER structure should
|
||||||
/* FIXME: The ResType in the NEWHEADER structure should
|
* contain 14 according to the MS win32 doc. This is
|
||||||
* contain 14 according to the MS win32 doc. This is
|
* not the case with the BRC compiler and I really doubt
|
||||||
* not the case with the BRC compiler and I really doubt
|
* the latter. Putting one here is compliant to win16 spec,
|
||||||
* the latter. Putting one here is compliant to win16 spec,
|
* but who knows the true value?
|
||||||
* but who knows the true value?
|
*/
|
||||||
*/
|
put_word(res, 1); /* ResType */
|
||||||
put_word(res, 1); /* ResType */
|
put_word(res, icog->nicon);
|
||||||
put_word(res, icog->nicon);
|
for(ico = icog->iconlist; ico; ico = ico->next)
|
||||||
for(ico = icog->iconlist; ico; ico = ico->next)
|
{
|
||||||
{
|
put_byte(res, ico->width);
|
||||||
put_byte(res, ico->width);
|
put_byte(res, ico->height);
|
||||||
put_byte(res, ico->height);
|
put_byte(res, ico->nclr);
|
||||||
put_byte(res, ico->nclr);
|
put_byte(res, 0); /* Reserved */
|
||||||
put_byte(res, 0); /* Reserved */
|
put_word(res, ico->planes);
|
||||||
put_word(res, ico->planes);
|
put_word(res, ico->bits);
|
||||||
put_word(res, ico->bits);
|
put_dword(res, ico->data->size);
|
||||||
put_dword(res, ico->data->size);
|
put_word(res, ico->id);
|
||||||
put_word(res, ico->id);
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
else /* win16 */
|
|
||||||
{
|
|
||||||
put_word(res, 0); /* Reserved */
|
|
||||||
put_word(res, 1); /* ResType */
|
|
||||||
put_word(res, icog->nicon);
|
|
||||||
for(ico = icog->iconlist; ico; ico = ico->next)
|
|
||||||
{
|
|
||||||
put_byte(res, ico->width);
|
|
||||||
put_byte(res, ico->height);
|
|
||||||
put_byte(res, ico->nclr);
|
|
||||||
put_byte(res, 0); /* Reserved */
|
|
||||||
put_word(res, ico->planes);
|
|
||||||
put_word(res, ico->bits);
|
|
||||||
put_dword(res, ico->data->size);
|
|
||||||
put_word(res, ico->id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
SetResSize(res, restag); /* Set ResourceSize */
|
SetResSize(res, restag); /* Set ResourceSize */
|
||||||
if(win32)
|
if(win32)
|
||||||
put_pad(res);
|
put_pad(res);
|
||||||
|
|
Loading…
Reference in New Issue