svn merge ^/trunk/blender -r50076:50080

This commit is contained in:
Campbell Barton
2012-08-21 11:11:43 +00:00
6 changed files with 23 additions and 22 deletions

View File

@@ -43,7 +43,7 @@ struct ReportList;
struct VFont;
/* pack */
struct PackedFile *dupPackedFileMemory(const struct PackedFile *pf_src);
struct PackedFile *dupPackedFile(const struct PackedFile *pf_src);
struct PackedFile *newPackedFile(struct ReportList *reports, const char *filename, const char *relabase);
struct PackedFile *newPackedFileMemory(void *mem, int memlen);

View File

@@ -60,7 +60,6 @@
#include "BKE_curve.h"
#include "BKE_displist.h"
//static ListBase ttfdata = {NULL, NULL};
/* The vfont code */
void BKE_vfont_free_data(struct VFont *vfont)
@@ -149,7 +148,7 @@ static VFontData *vfont_get_data(Main *bmain, VFont *vfont)
/* We need to copy a tmp font to memory unless it is already there */
if (vfont->temp_pf == NULL) {
vfont->temp_pf = dupPackedFileMemory(pf);
vfont->temp_pf = dupPackedFile(pf);
}
}
else {
@@ -237,8 +236,6 @@ VFont *BKE_vfont_load(Main *bmain, const char *name)
if (!vfont || vfont->packedfile != pf) {
freePackedFile(pf);
}
//XXX waitcursor(0);
}
return vfont;
@@ -248,13 +245,13 @@ static VFont *which_vfont(Curve *cu, CharInfo *info)
{
switch (info->flag & (CU_CHINFO_BOLD | CU_CHINFO_ITALIC)) {
case CU_CHINFO_BOLD:
if (cu->vfontb) return(cu->vfontb); else return(cu->vfont);
return cu->vfontb ? cu->vfontb : cu->vfont;
case CU_CHINFO_ITALIC:
if (cu->vfonti) return(cu->vfonti); else return(cu->vfont);
return cu->vfonti ? cu->vfonti : cu->vfont;
case (CU_CHINFO_BOLD | CU_CHINFO_ITALIC):
if (cu->vfontbi) return(cu->vfontbi); else return(cu->vfont);
return cu->vfontbi ? cu->vfontbi : cu->vfont;
default:
return(cu->vfont);
return cu->vfont;
}
}

View File

@@ -2165,7 +2165,9 @@ RenderResult *BKE_image_acquire_renderresult(Scene *scene, Image *ima)
void BKE_image_release_renderresult(Scene *scene, Image *ima)
{
if (ima->rr) ;
if (ima->rr) {
/* pass */
}
else if (ima->type == IMA_TYPE_R_RESULT) {
if (ima->render_slot == ima->last_render_slot)
RE_ReleaseResult(RE_GetRender(scene->id.name));

View File

@@ -159,7 +159,7 @@ void freePackedFile(PackedFile *pf)
printf("freePackedFile: Trying to free a NULL pointer\n");
}
PackedFile *dupPackedFileMemory(const PackedFile *pf_src)
PackedFile *dupPackedFile(const PackedFile *pf_src)
{
PackedFile *pf_dst;

View File

@@ -83,11 +83,11 @@ void GlareGhostOperation::generateGlare(float *data, MemoryBuffer *inputTile, No
for (x = 0; x < gbuf->getWidth(); x++) {
u = (float)(x + 0.5f) / (float)gbuf->getWidth();
s = (u - 0.5f) * sc + 0.5f, t = (v - 0.5f) * sc + 0.5f;
tbuf1->read(c, s * gbuf->getWidth(), t * gbuf->getHeight());
tbuf1->readCubic(c, s * gbuf->getWidth(), t * gbuf->getHeight());
sm = smoothMask(s, t);
mul_v3_fl(c, sm);
s = (u - 0.5f) * isc + 0.5f, t = (v - 0.5f) * isc + 0.5f;
tbuf2->read(tc, s * gbuf->getWidth() - 0.5f, t * gbuf->getHeight() - 0.5f);
tbuf2->readCubic(tc, s * gbuf->getWidth() - 0.5f, t * gbuf->getHeight() - 0.5f);
sm = smoothMask(s, t);
madd_v3_v3fl(c, tc, sm);
@@ -108,7 +108,7 @@ void GlareGhostOperation::generateGlare(float *data, MemoryBuffer *inputTile, No
np = (n << 2) + p;
s = (u - 0.5f) * scalef[np] + 0.5f;
t = (v - 0.5f) * scalef[np] + 0.5f;
gbuf->read(c, s * gbuf->getWidth() - 0.5f, t * gbuf->getHeight() - 0.5f);
gbuf->readCubic(c, s * gbuf->getWidth() - 0.5f, t * gbuf->getHeight() - 0.5f);
mul_v3_v3(c, cm[np]);
sm = smoothMask(s, t) * 0.25f;
madd_v3_v3fl(tc, c, sm);

View File

@@ -682,10 +682,12 @@ void uiTemplateImage(uiLayout *layout, bContext *C, PointerRNA *ptr, const char
}
else if (ima->type == IMA_TYPE_R_RESULT) {
/* browse layer/passes */
Render *re = RE_GetRender(scene->id.name);
RenderResult *rr = RE_AcquireResultRead(re);
RenderResult *rr;
/* use BKE_image_acquire_renderresult so we get the correct slot in the menu */
rr = BKE_image_acquire_renderresult(scene, ima);
uiblock_layer_pass_arrow_buttons(layout, rr, iuser, &ima->render_slot);
RE_ReleaseResult(re);
BKE_image_release_renderresult(scene, ima);
}
}
else {
@@ -890,16 +892,16 @@ void uiTemplateImageSettings(uiLayout *layout, PointerRNA *imfptr)
void uiTemplateImageLayers(uiLayout *layout, bContext *C, Image *ima, ImageUser *iuser)
{
Scene *scene = CTX_data_scene(C);
Render *re;
RenderResult *rr;
/* render layers and passes */
if (ima && iuser) {
const float dpi_fac = UI_DPI_FAC;
re = RE_GetRender(scene->id.name);
rr = RE_AcquireResultRead(re);
RenderResult *rr;
/* use BKE_image_acquire_renderresult so we get the correct slot in the menu */
rr = BKE_image_acquire_renderresult(scene, ima);
uiblock_layer_pass_buttons(layout, rr, iuser, 160 * dpi_fac, (ima->type == IMA_TYPE_R_RESULT) ? &ima->render_slot : NULL);
RE_ReleaseResult(re);
BKE_image_release_renderresult(scene, ima);
}
}