From: MirceaKitsune Date: Tue, 3 Jan 2012 17:00:41 +0000 (+0200) Subject: Missing preview images: Use draw_PictureSize == '0 0 0' instead of draw_PreloadPictur... X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=26eec9fe19491a76fd1149f6e65542d906da034e;p=voretournament%2Fvoretournament.git Missing preview images: Use draw_PictureSize == '0 0 0' instead of draw_PreloadPicture == "", since preloading causes a memory leak. Requires latest engine to work properly. --- diff --git a/data/qcsrc/client/mapvoting.qc b/data/qcsrc/client/mapvoting.qc index c867a667..20220df4 100644 --- a/data/qcsrc/client/mapvoting.qc +++ b/data/qcsrc/client/mapvoting.qc @@ -75,7 +75,7 @@ void MapVote_DrawMapItem(vector pos, float isize, float tsize, string map, strin img_size -= (sbar_border_thickness * 2) * '1 1 0'; if(pic == "") { - if(precache_pic(pic) == "") + if(drawgetimagesize(pic) == '0 0 0') drawpic(pos, draw_UseSkinFor("nopreview_map"), img_size, '1 1 1', 0.7, DRAWFLAG_NORMAL); else drawpic(pos, pic, img_size, '1 1 1', 0.7, DRAWFLAG_NORMAL); diff --git a/data/qcsrc/menu/voret/campaign.c b/data/qcsrc/menu/voret/campaign.c index ba65cd2c..a756cb06 100644 --- a/data/qcsrc/menu/voret/campaign.c +++ b/data/qcsrc/menu/voret/campaign.c @@ -277,7 +277,7 @@ void drawListBoxItemVoretCampaignList(entity me, float i, vector absSize, float s = ftos(p); if(i > me.campaignIndex) draw_Picture(me.columnPreviewOrigin * eX, "/gfx/campaign_hidden", me.columnPreviewSize * eX + eY, '1 1 1', theAlpha); - else if(draw_PreloadPicture(strcat("/maps/", campaign_mapname[i])) == "") + else if(draw_PictureSize(strcat("/maps/", campaign_mapname[i])) == '0 0 0') draw_Picture(me.columnPreviewOrigin * eX, "nopreview_map", me.columnPreviewSize * eX + eY, '1 1 1', theAlpha); else draw_Picture(me.columnPreviewOrigin * eX, strcat("/maps/", campaign_mapname[i]), me.columnPreviewSize * eX + eY, '1 1 1', theAlpha); diff --git a/data/qcsrc/menu/voret/dialog_multiplayer_create_mapinfo.c b/data/qcsrc/menu/voret/dialog_multiplayer_create_mapinfo.c index 7925b80e..71f6a1d1 100644 --- a/data/qcsrc/menu/voret/dialog_multiplayer_create_mapinfo.c +++ b/data/qcsrc/menu/voret/dialog_multiplayer_create_mapinfo.c @@ -66,7 +66,7 @@ void loadMapInfoVoretMapInfoDialog(entity me, float i, entity mlb) me.authorLabel.setText(me.authorLabel, me.currentMapAuthor); me.descriptionLabel.setText(me.descriptionLabel, me.currentMapDescription); me.featuresLabel.setText(me.featuresLabel, me.currentMapFeaturesText); - if(draw_PreloadPicture(me.currentMapPreviewImage) == "") + if(draw_PictureSize(me.currentMapPreviewImage) == '0 0 0') me.previewImage.src = "nopreview_map"; else me.previewImage.src = me.currentMapPreviewImage; diff --git a/data/qcsrc/menu/voret/maplist.c b/data/qcsrc/menu/voret/maplist.c index d4b77c39..9d3209a5 100644 --- a/data/qcsrc/menu/voret/maplist.c +++ b/data/qcsrc/menu/voret/maplist.c @@ -186,7 +186,7 @@ void drawListBoxItemVoretMapList(entity me, float i, vector absSize, float isSel draw_Fill('0 0 0', '1 1 0', SKINCOLOR_MAPLIST_INCLUDEDBG, SKINALPHA_MAPLIST_INCLUDEDBG); s = ftos(p); - if(draw_PreloadPicture(strcat("/maps/", MapInfo_Map_bspname)) == "") + if(draw_PictureSize(strcat("/maps/", MapInfo_Map_bspname)) == '0 0 0') draw_Picture(me.columnPreviewOrigin * eX, "nopreview_map", me.columnPreviewSize * eX + eY, '1 1 1', theAlpha); else draw_Picture(me.columnPreviewOrigin * eX, strcat("/maps/", MapInfo_Map_bspname), me.columnPreviewSize * eX + eY, '1 1 1', theAlpha); diff --git a/data/qcsrc/menu/voret/playermodel.c b/data/qcsrc/menu/voret/playermodel.c index 639f625d..bb974341 100644 --- a/data/qcsrc/menu/voret/playermodel.c +++ b/data/qcsrc/menu/voret/playermodel.c @@ -176,7 +176,7 @@ void drawVoretPlayerModelSelector(entity me) float i, n; vector o; - if(draw_PreloadPicture(me.currentModelName) == "") + if(draw_PictureSize(me.currentModelName) == '0 0 0') me.src = "nopreview_player"; else me.src = me.currentModelName; diff --git a/data/qcsrc/menu/voret/skinlist.c b/data/qcsrc/menu/voret/skinlist.c index 73d83bd8..89bfe027 100644 --- a/data/qcsrc/menu/voret/skinlist.c +++ b/data/qcsrc/menu/voret/skinlist.c @@ -104,7 +104,7 @@ void getSkinsVoretSkinList(entity me) bufstr_set(buf, i * SKINPARM_COUNT + SKINPARM_NAME, substring(s, 9, strlen(s) - 24)); // the * part bufstr_set(buf, i * SKINPARM_COUNT + SKINPARM_TITLE, ""); bufstr_set(buf, i * SKINPARM_COUNT + SKINPARM_AUTHOR, "<AUTHOR>"); - if(draw_PreloadPicture(strcat("/gfx/menu/", substring(s, 9, strlen(s) - 24), "/skinpreview")) == "") + if(draw_PictureSize(strcat("/gfx/menu/", substring(s, 9, strlen(s) - 24), "/skinpreview")) == '0 0 0') bufstr_set(buf, i * SKINPARM_COUNT + SKINPARM_PREVIEW, "nopreview_menuskin"); else bufstr_set(buf, i * SKINPARM_COUNT + SKINPARM_PREVIEW, strcat("/gfx/menu/", substring(s, 9, strlen(s) - 24), "/skinpreview"));