X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Finit.c;h=522b1b40110374ac2e5fe93d399ef8a7e55f53bc;hb=f58e776feec767136f4a8f4b62e0103d13c0a910;hp=5f18d26f118565519fd1f06f8c0eb2fc84b1226c;hpb=04822a800bb5479087613b0730fdf7e765ba012c;p=rocksndiamonds.git diff --git a/src/init.c b/src/init.c index 5f18d26f..522b1b40 100644 --- a/src/init.c +++ b/src/init.c @@ -2002,6 +2002,50 @@ static void InitGraphicCompatibilityInfo() } } +#if 1 + struct + { + int graphic; + int *width, *height; + boolean right_wing; + } + doors[] = + { + { IMG_DOOR_1_WING_LEFT, &door_1.width, &door_1.height, FALSE }, + { IMG_DOOR_1_WING_RIGHT, &door_1.width, &door_1.height, TRUE }, + { IMG_DOOR_2_WING_LEFT, &door_2.width, &door_2.height, FALSE }, + { IMG_DOOR_2_WING_RIGHT, &door_2.width, &door_2.height, TRUE }, + + { 0, NULL, NULL, FALSE } + }; + + for (i = 0; doors[i].graphic != 0; i++) + { + int graphic = doors[i].graphic; + int *width = doors[i].width; + int *height = doors[i].height; + boolean right_wing = doors[i].right_wing; + + struct FileInfo *fi = getImageListEntryFromImageID(graphic); + struct GraphicInfo *g = &graphic_info[graphic]; + + if (!fi->redefined) + { + if (*width != -1) + { + // correct start position for right wing of "standard" door graphic + if (right_wing) + g->src_x += g->width - *width; + + g->width = *width; + } + + if (*height != -1) + g->height = *height; + } + } +#endif + #if 0 for (i = 0; i < num_images; i++) { @@ -2425,6 +2469,8 @@ static void ReinitializeGraphics() print_timestamp_time("InitGadgets"); InitToons(); print_timestamp_time("InitToons"); + InitDoors(); + print_timestamp_time("InitDoors"); print_timestamp_done("ReinitializeGraphics"); }