Index: source/blender/makesdna/DNA_scene_types.h =================================================================== RCS file: /cvsroot/bf-blender/blender/source/blender/makesdna/DNA_scene_types.h,v retrieving revision 1.93 diff -u -r1.93 DNA_scene_types.h --- source/blender/makesdna/DNA_scene_types.h 8 Dec 2006 00:44:44 -0000 1.93 +++ source/blender/makesdna/DNA_scene_types.h 9 Dec 2006 04:17:38 -0000 @@ -301,6 +301,10 @@ float GIshadowquality, GIrefinement, GIpower, GIindirpower; float YF_gamma, YF_exposure, YF_raybias, YF_AApixelsize, YF_AAthreshold; + int stamppad;// pad de relleno + char stamp_u_data[128];// Contain the stamp user text + float stamp_colorr,stamp_colorg,stamp_colorb;;// Color to use for stamp + char backbuf[160], pic[160], ftype[160]; } RenderData; @@ -534,6 +538,8 @@ /* threads obsolete... is there for old files */ #define R_THREADS 0x80000 #define R_SPEED 0x100000 +#define R_STAMP_INFO 0x20000// Active the stamp info on rendering +#define R_STAMP_INFO_INV 0x40000// Activate if the stamp color is inverted /* filtertype */ #define R_FILTER_BOX 0 Index: source/blender/render/intern/source/pipeline.c =================================================================== RCS file: /cvsroot/bf-blender/blender/source/blender/render/intern/source/pipeline.c,v retrieving revision 1.101 diff -u -r1.101 pipeline.c --- source/blender/render/intern/source/pipeline.c 7 Dec 2006 14:17:37 -0000 1.101 +++ source/blender/render/intern/source/pipeline.c 9 Dec 2006 04:57:01 -0000 @@ -30,6 +30,7 @@ #include #include #include +#include //rcruiz #include "DNA_group_types.h" #include "DNA_image_types.h" @@ -1761,7 +1762,186 @@ /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +//] = */ {0x00,0x00,0x60,0x30,0x18,0x0c,0x06,0x0c,0x18,0x30,0x60,0x00}, +/* [?] = */ {0x00,0x00,0x30,0x30,0x00,0x30,0x30,0x18,0x0c,0xcc,0x78,0x00}, +/* [@] = */ {0x00,0x00,0x7c,0xc0,0xc0,0xde,0xde,0xde,0xc6,0xc6,0x7c,0x00}, +/* [A] = */ {0x00,0x00,0xcc,0xcc,0xcc,0xfc,0xcc,0xcc,0xcc,0x78,0x30,0x00}, +/* [B] = */ {0x00,0x00,0xfc,0x66,0x66,0x66,0x7c,0x66,0x66,0x66,0xfc,0x00}, +/* [C] = */ {0x00,0x00,0x3c,0x66,0xc6,0xc0,0xc0,0xc0,0xc6,0x66,0x3c,0x00}, +/* [D] = */ {0x00,0x00,0xf8,0x6c,0x66,0x66,0x66,0x66,0x66,0x6c,0xf8,0x00}, +/* [E] = */ {0x00,0x00,0xfe,0x62,0x60,0x64,0x7c,0x64,0x60,0x62,0xfe,0x00}, +/* [F] = */ {0x00,0x00,0xf0,0x60,0x60,0x64,0x7c,0x64,0x62,0x66,0xfe,0x00}, +/* [G] = */ {0x00,0x00,0x3e,0x66,0xc6,0xce,0xc0,0xc0,0xc6,0x66,0x3c,0x00}, +/* [H] = */ {0x00,0x00,0xcc,0xcc,0xcc,0xcc,0xfc,0xcc,0xcc,0xcc,0xcc,0x00}, +/* [I] = */ {0x00,0x00,0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x78,0x00}, +/* [J] = */ {0x00,0x00,0x78,0xcc,0xcc,0xcc,0x0c,0x0c,0x0c,0x0c,0x1e,0x00}, +/* [K] = */ {0x00,0x00,0xe6,0x66,0x6c,0x6c,0x78,0x6c,0x6c,0x66,0xe6,0x00}, +/* [L] = */ {0x00,0x00,0xfe,0x66,0x66,0x62,0x60,0x60,0x60,0x60,0xf0,0x00}, +/* [M] = */ {0x00,0x00,0xc6,0xc6,0xc6,0xc6,0xd6,0xfe,0xfe,0xee,0xc6,0x00}, +/* [N] = */ {0x00,0x00,0xc6,0xc6,0xce,0xde,0xfe,0xf6,0xe6,0xc6,0xc6,0x00}, +/* [O] = */ {0x00,0x00,0x38,0x6c,0xc6,0xc6,0xc6,0xc6,0xc6,0x6c,0x38,0x00}, +/* [P] = */ {0x00,0x00,0xf0,0x60,0x60,0x60,0x7c,0x66,0x66,0x66,0xfc,0x00}, +/* [Q] = */ {0x00,0x1e,0x0c,0x7c,0xde,0xce,0xc6,0xc6,0xc6,0x6c,0x38,0x00}, +/* [R] = */ {0x00,0x00,0xe6,0x66,0x66,0x6c,0x7c,0x66,0x66,0x66,0xfc,0x00}, +/* [S] = */ {0x00,0x00,0x78,0xcc,0xcc,0x18,0x70,0xc0,0xcc,0xcc,0x78,0x00}, +/* [T] = */ {0x00,0x00,0x78,0x30,0x30,0x30,0x30,0x30,0x30,0xb4,0xfc,0x00}, +/* [U] = */ {0x00,0x00,0x78,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0x00}, +/* [V] = */ {0x00,0x00,0x30,0x78,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0x00}, +/* [W] = */ {0x00,0x00,0x6c,0x6c,0x6c,0xd6,0xd6,0xc6,0xc6,0xc6,0xc6,0x00}, +/* [X] = */ {0x00,0x00,0xcc,0xcc,0xcc,0x78,0x30,0x78,0xcc,0xcc,0xcc,0x00}, +/* [Y] = */ {0x00,0x00,0x78,0x30,0x30,0x30,0x78,0xcc,0xcc,0xcc,0xcc,0x00}, +/* [Z] = */ {0x00,0x00,0xfe,0xc6,0x62,0x60,0x30,0x18,0x98,0xce,0xfe,0x00}, +/* [[] = */ {0x00,0x00,0x3c,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x3c,0x00}, +/* [\] = */ {0x00,0x00,0x02,0x06,0x0c,0x18,0x30,0x60,0xc0,0x80,0x00,0x00}, +/* []] = */ {0x00,0x00,0x3c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x3c,0x00}, +/* [^] = */ {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc6,0x6c,0x38,0x10}, +/* [_] = */ {0x00,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, +/* [`] = */ {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x30,0x30}, +/* [a] = */ {0x00,0x00,0x76,0xcc,0xcc,0x7c,0x0c,0x78,0x00,0x00,0x00,0x00}, +/* [b] = */ {0x00,0x00,0xdc,0x66,0x66,0x66,0x66,0x7c,0x60,0x60,0xe0,0x00}, +/* [c] = */ {0x00,0x00,0x78,0xcc,0xc0,0xc0,0xcc,0x78,0x00,0x00,0x00,0x00}, +/* [d] = */ {0x00,0x00,0x76,0xcc,0xcc,0xcc,0xcc,0x7c,0x0c,0x0c,0x1c,0x00}, +/* [e] = */ {0x00,0x00,0x78,0xcc,0xc0,0xfc,0xcc,0x78,0x00,0x00,0x00,0x00}, +/* [f] = */ {0x00,0x00,0xf0,0x60,0x60,0x60,0xf8,0x60,0x60,0x6c,0x38,0x00}, +/* [g] = */ {0x78,0xcc,0x0c,0x7c,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00}, +/* [h] = */ {0x00,0x00,0xe6,0x66,0x66,0x66,0x76,0x6c,0x60,0x60,0xe0,0x00}, +/* [i] = */ {0x00,0x00,0x7e,0x18,0x18,0x18,0x18,0x78,0x00,0x18,0x18,0x00}, +/* [j] = */ {0x78,0xcc,0xcc,0x0c,0x0c,0x0c,0x0c,0x3c,0x00,0x0c,0x0c,0x00}, +/* [k] = */ {0x00,0x00,0xe6,0x66,0x6c,0x78,0x6c,0x66,0x60,0x60,0xe0,0x00}, +/* [l] = */ {0x00,0x00,0x7e,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x78,0x00}, +/* [m] = */ {0x00,0x00,0xc6,0xd6,0xd6,0xd6,0xd6,0xfc,0x00,0x00,0x00,0x00}, +/* [n] = */ {0x00,0x00,0xcc,0xcc,0xcc,0xcc,0xcc,0xf8,0x00,0x00,0x00,0x00}, +/* [o] = */ {0x00,0x00,0x78,0xcc,0xcc,0xcc,0xcc,0x78,0x00,0x00,0x00,0x00}, +/* [p] = */ {0xf0,0x60,0x7c,0x66,0x66,0x66,0x66,0xdc,0x00,0x00,0x00,0x00}, +/* [q] = */ {0x1e,0x0c,0x7c,0xcc,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00}, +/* [r] = */ {0x00,0x00,0xf0,0x60,0x60,0x76,0x6e,0xec,0x00,0x00,0x00,0x00}, +/* [s] = */ {0x00,0x00,0x78,0xcc,0x18,0x60,0xcc,0x78,0x00,0x00,0x00,0x00}, +/* [t] = */ {0x00,0x00,0x38,0x6c,0x60,0x60,0x60,0xfc,0x60,0x20,0x00,0x00}, +/* [u] = */ {0x00,0x00,0x76,0xcc,0xcc,0xcc,0xcc,0xcc,0x00,0x00,0x00,0x00}, +/* [v] = */ {0x00,0x00,0x30,0x78,0xcc,0xcc,0xcc,0xcc,0x00,0x00,0x00,0x00}, +/* [w] = */ {0x00,0x00,0x6c,0x6c,0xd6,0xd6,0xc6,0xc6,0x00,0x00,0x00,0x00}, +/* [x] = */ {0x00,0x00,0xc6,0x6c,0x38,0x38,0x6c,0xc6,0x00,0x00,0x00,0x00}, +/* [y] = */ {0xf0,0x18,0x0c,0x3c,0x66,0x66,0x66,0x66,0x00,0x00,0x00,0x00}, +/* [z] = */ {0x00,0x00,0xfc,0xc4,0x60,0x18,0x8c,0xfc,0x00,0x00,0x00,0x00}, +/* [{] = */ {0x00,0x00,0x1c,0x30,0x30,0x60,0xc0,0x60,0x30,0x30,0x1c,0x00}, +/* [|] = */ {0x00,0x00,0x18,0x18,0x18,0x18,0x00,0x18,0x18,0x18,0x18,0x00}, +/* [}] = */ {0x00,0x00,0xe0,0x30,0x30,0x18,0x0c,0x18,0x30,0x30,0xe0,0x00}, +/* [~] = */ {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xce,0xda,0x73,0x00}, +}; + +posfin pasatexto(char* texto, unsigned short xref,unsigned short yref,Render *re) { + posfin pos; + int lentexto=strlen(texto); + int i,j,cha=0; + unsigned char ftlnbt; + unsigned short width = re->rectx; + unsigned short height = re->recty; + RenderResult rres; + RE_GetResultImage(re, &rres); + unsigned short x,y,textposx; + for (i=0,j=0; i < lentexto; i++,j++) { + cha=texto[i]-32; + if(cha<0||cha>94) + cha=0; + textposx=xref+(j*8); + if ((textposx+8)>width){ + yref+=12; + textposx=xref=1; + j=0; + } + for (y=0;y<12;y++){ + if ((yref+y)>height) + return pos; + float* bpt = (float*)rres.rectf + ((((height-1)-yref+y)*width)<<2); + pos.y=yref+y; + bpt=bpt+(4*textposx); + for (x=0;x<8;x++) { + ftlnbt=fntdat[cha][y]; + if(ftlnbt&(0x80>>x)){ + if (G.scene->r.mode&R_STAMP_INFO_INV){ + if ((bpt[0]<0.55)&&(bpt[0]>0.45)) bpt[0]=1.2-bpt[0]; else bpt[0]=1-bpt[0]; + if ((bpt[1]<0.55)&&(bpt[1]>0.45)) bpt[1]=1.2-bpt[1]; else bpt[1]=1-bpt[1]; + if ((bpt[2]<0.55)&&(bpt[2]>0.45)) bpt[2]=1.2-bpt[2]; else bpt[2]=1-bpt[2]; + }else{ + bpt[0]=G.scene->r.stamp_colorr; + bpt[1]=G.scene->r.stamp_colorg; + bpt[2]=G.scene->r.stamp_colorb; + } + } + bpt += 4; + pos.x=(4*textposx)+x; + } + } + } + return pos; +} + +void stamp (Render *re){ + posfin pos; + char text[254],dat[9],tim_buf[15]; +#ifdef WIN32 + _strdate( dat); +#else + time_t tim=time(NULL); + struct tm *now=localtime(&tim); + sprintf(dat,"%02d-%02d-%02d", now->tm_mon+1, now->tm_mday,now->tm_year-100 ); +#endif + pos=pasatexto(G.sce,1,12,re); + float seg=(float)(G.scene->r.cfra-G.scene->r.sfra)/(float)re->r.frs_sec; + int dia=seg/86400; + int hor=(seg/3600)-(dia*24); + int min=(seg/60)-(hor*60); + seg=seg-(hor*3600)-(min*60); + sprintf(tim_buf,"%02d:%02d:%0.3f",hor,min,seg); + sprintf(text,"%s f#%i",tim_buf,G.scene->r.cfra); + pos=pasatexto(text,1,pos.y,re); + pos=pasatexto(re->r.stamp_u_data,1,re->recty-24,re); + pos=pasatexto(dat,1,re->recty-12,re); + strcpy(text,G.scene->camera->id.name); + text[0]=text[1]=' '; + pos.x=(re->rectx/2)-(strlen(text)*4); + pos=pasatexto(text,pos.x,re->recty-12,re); + strcpy(text,G.scene->id.name); + text[0]=text[1]=' '; + pos.x=re->rectx-((strlen(text)+1)*8); + pos=pasatexto(text,pos.x,re->recty-12,re); +} +//rcruiz> /* main loop: doing sequence + fields + blur + 3d render + compositing */ static void do_render_all_options(Render *re) @@ -1788,6 +1968,9 @@ #endif } + if (re->r.mode & R_STAMP_INFO)// if stamp info + stamp(re);// Put stamp in render window + re->i.lastframetime= PIL_check_seconds_timer()- re->i.starttime; re->stats_draw(&re->i); } Index: source/blender/src/buttons_scene.c =================================================================== RCS file: /cvsroot/bf-blender/blender/source/blender/src/buttons_scene.c,v retrieving revision 1.156 diff -u -r1.156 buttons_scene.c --- source/blender/src/buttons_scene.c 7 Dec 2006 20:21:43 -0000 1.156 +++ source/blender/src/buttons_scene.c 9 Dec 2006 05:14:22 -0000 @@ -1159,6 +1159,16 @@ /* SET BUTTON */ +//r.mode&R_STAMP_INFO){ + uiDefButBitI(block, TOG, R_STAMP_INFO, B_REDR,"S", 190, 120, 10, 19, &G.scene->r.mode, 0, 0, 0, 0, "Enable/Disable stamp info in render"); + uiDefBut(block, TEX, B_NOP, "U:", 200,120,70,19, &G.scene->r.stamp_u_data, 0.0,128.0, 100, 0, ""); + uiDefButBitI(block, TOG, R_STAMP_INFO_INV, B_REDR,"I", 270, 120, 20, 19, &G.scene->r.mode, 0, 0, 0, 0, "Enable/Disable stamp with inverse color"); + if (!(G.scene->r.mode&R_STAMP_INFO_INV)) + uiDefButF(block, COL, B_NOP, "",290,120,20,19, &(G.scene->r.stamp_colorr), 0, 0, 0, 0, "Stamp Color"); + } else + uiDefButBitI(block, TOG, R_STAMP_INFO, B_REDR,"Stamp", 190, 120, 120, 19, &G.scene->r.mode, 0, 0, 0, 0, "Enable/Disable stamp info in render"); + //rcruiz> uiBlockBeginAlign(block); id= (ID *)G.scene->set; IDnames_to_pupstring(&strp, NULL, NULL, &(G.main->scene), id, &(G.buts->menunr)); Index: source/blender/src/renderwin.c =================================================================== RCS file: /cvsroot/bf-blender/blender/source/blender/src/renderwin.c,v retrieving revision 1.113 diff -u -r1.113 renderwin.c --- source/blender/src/renderwin.c 7 Nov 2006 11:24:11 -0000 1.113 +++ source/blender/src/renderwin.c 9 Dec 2006 04:17:38 -0000 @@ -65,6 +65,7 @@ #include "DNA_image_types.h" #include "DNA_space_types.h" #include "DNA_screen_types.h" +#include "DNA_camera_types.h"// For camera structure in stamp opengl #include "DNA_scene_types.h" #include "DNA_view3d_types.h" #include "DNA_vec_types.h" @@ -106,6 +107,7 @@ #include "blendef.h" #include "mydevice.h" #include "winlay.h" +#include "time.h"// For date on stamp info /* ------------ renderwin struct, to prevent too much global vars --------- */ /* ------------ only used for display in a 2nd window --------- */ @@ -1223,6 +1225,190 @@ if (G.f & G_DOSCRIPTLINKS) BPY_do_all_scripts(SCRIPT_POSTRENDER); } +//] = */ {0x00,0x00,0x60,0x30,0x18,0x0c,0x06,0x0c,0x18,0x30,0x60,0x00}, +/* [?] = */ {0x00,0x00,0x30,0x30,0x00,0x30,0x30,0x18,0x0c,0xcc,0x78,0x00}, +/* [@] = */ {0x00,0x00,0x7c,0xc0,0xc0,0xde,0xde,0xde,0xc6,0xc6,0x7c,0x00}, +/* [A] = */ {0x00,0x00,0xcc,0xcc,0xcc,0xfc,0xcc,0xcc,0xcc,0x78,0x30,0x00}, +/* [B] = */ {0x00,0x00,0xfc,0x66,0x66,0x66,0x7c,0x66,0x66,0x66,0xfc,0x00}, +/* [C] = */ {0x00,0x00,0x3c,0x66,0xc6,0xc0,0xc0,0xc0,0xc6,0x66,0x3c,0x00}, +/* [D] = */ {0x00,0x00,0xf8,0x6c,0x66,0x66,0x66,0x66,0x66,0x6c,0xf8,0x00}, +/* [E] = */ {0x00,0x00,0xfe,0x62,0x60,0x64,0x7c,0x64,0x60,0x62,0xfe,0x00}, +/* [F] = */ {0x00,0x00,0xf0,0x60,0x60,0x64,0x7c,0x64,0x62,0x66,0xfe,0x00}, +/* [G] = */ {0x00,0x00,0x3e,0x66,0xc6,0xce,0xc0,0xc0,0xc6,0x66,0x3c,0x00}, +/* [H] = */ {0x00,0x00,0xcc,0xcc,0xcc,0xcc,0xfc,0xcc,0xcc,0xcc,0xcc,0x00}, +/* [I] = */ {0x00,0x00,0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x78,0x00}, +/* [J] = */ {0x00,0x00,0x78,0xcc,0xcc,0xcc,0x0c,0x0c,0x0c,0x0c,0x1e,0x00}, +/* [K] = */ {0x00,0x00,0xe6,0x66,0x6c,0x6c,0x78,0x6c,0x6c,0x66,0xe6,0x00}, +/* [L] = */ {0x00,0x00,0xfe,0x66,0x66,0x62,0x60,0x60,0x60,0x60,0xf0,0x00}, +/* [M] = */ {0x00,0x00,0xc6,0xc6,0xc6,0xc6,0xd6,0xfe,0xfe,0xee,0xc6,0x00}, +/* [N] = */ {0x00,0x00,0xc6,0xc6,0xce,0xde,0xfe,0xf6,0xe6,0xc6,0xc6,0x00}, +/* [O] = */ {0x00,0x00,0x38,0x6c,0xc6,0xc6,0xc6,0xc6,0xc6,0x6c,0x38,0x00}, +/* [P] = */ {0x00,0x00,0xf0,0x60,0x60,0x60,0x7c,0x66,0x66,0x66,0xfc,0x00}, +/* [Q] = */ {0x00,0x1e,0x0c,0x7c,0xde,0xce,0xc6,0xc6,0xc6,0x6c,0x38,0x00}, +/* [R] = */ {0x00,0x00,0xe6,0x66,0x66,0x6c,0x7c,0x66,0x66,0x66,0xfc,0x00}, +/* [S] = */ {0x00,0x00,0x78,0xcc,0xcc,0x18,0x70,0xc0,0xcc,0xcc,0x78,0x00}, +/* [T] = */ {0x00,0x00,0x78,0x30,0x30,0x30,0x30,0x30,0x30,0xb4,0xfc,0x00}, +/* [U] = */ {0x00,0x00,0x78,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0x00}, +/* [V] = */ {0x00,0x00,0x30,0x78,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0x00}, +/* [W] = */ {0x00,0x00,0x6c,0x6c,0x6c,0xd6,0xd6,0xc6,0xc6,0xc6,0xc6,0x00}, +/* [X] = */ {0x00,0x00,0xcc,0xcc,0xcc,0x78,0x30,0x78,0xcc,0xcc,0xcc,0x00}, +/* [Y] = */ {0x00,0x00,0x78,0x30,0x30,0x30,0x78,0xcc,0xcc,0xcc,0xcc,0x00}, +/* [Z] = */ {0x00,0x00,0xfe,0xc6,0x62,0x60,0x30,0x18,0x98,0xce,0xfe,0x00}, +/* [[] = */ {0x00,0x00,0x3c,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x3c,0x00}, +/* [\] = */ {0x00,0x00,0x02,0x06,0x0c,0x18,0x30,0x60,0xc0,0x80,0x00,0x00}, +/* []] = */ {0x00,0x00,0x3c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x3c,0x00}, +/* [^] = */ {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc6,0x6c,0x38,0x10}, +/* [_] = */ {0x00,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, +/* [`] = */ {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x30,0x30}, +/* [a] = */ {0x00,0x00,0x76,0xcc,0xcc,0x7c,0x0c,0x78,0x00,0x00,0x00,0x00}, +/* [b] = */ {0x00,0x00,0xdc,0x66,0x66,0x66,0x66,0x7c,0x60,0x60,0xe0,0x00}, +/* [c] = */ {0x00,0x00,0x78,0xcc,0xc0,0xc0,0xcc,0x78,0x00,0x00,0x00,0x00}, +/* [d] = */ {0x00,0x00,0x76,0xcc,0xcc,0xcc,0xcc,0x7c,0x0c,0x0c,0x1c,0x00}, +/* [e] = */ {0x00,0x00,0x78,0xcc,0xc0,0xfc,0xcc,0x78,0x00,0x00,0x00,0x00}, +/* [f] = */ {0x00,0x00,0xf0,0x60,0x60,0x60,0xf8,0x60,0x60,0x6c,0x38,0x00}, +/* [g] = */ {0x78,0xcc,0x0c,0x7c,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00}, +/* [h] = */ {0x00,0x00,0xe6,0x66,0x66,0x66,0x76,0x6c,0x60,0x60,0xe0,0x00}, +/* [i] = */ {0x00,0x00,0x7e,0x18,0x18,0x18,0x18,0x78,0x00,0x18,0x18,0x00}, +/* [j] = */ {0x78,0xcc,0xcc,0x0c,0x0c,0x0c,0x0c,0x3c,0x00,0x0c,0x0c,0x00}, +/* [k] = */ {0x00,0x00,0xe6,0x66,0x6c,0x78,0x6c,0x66,0x60,0x60,0xe0,0x00}, +/* [l] = */ {0x00,0x00,0x7e,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x78,0x00}, +/* [m] = */ {0x00,0x00,0xc6,0xd6,0xd6,0xd6,0xd6,0xfc,0x00,0x00,0x00,0x00}, +/* [n] = */ {0x00,0x00,0xcc,0xcc,0xcc,0xcc,0xcc,0xf8,0x00,0x00,0x00,0x00}, +/* [o] = */ {0x00,0x00,0x78,0xcc,0xcc,0xcc,0xcc,0x78,0x00,0x00,0x00,0x00}, +/* [p] = */ {0xf0,0x60,0x7c,0x66,0x66,0x66,0x66,0xdc,0x00,0x00,0x00,0x00}, +/* [q] = */ {0x1e,0x0c,0x7c,0xcc,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00}, +/* [r] = */ {0x00,0x00,0xf0,0x60,0x60,0x76,0x6e,0xec,0x00,0x00,0x00,0x00}, +/* [s] = */ {0x00,0x00,0x78,0xcc,0x18,0x60,0xcc,0x78,0x00,0x00,0x00,0x00}, +/* [t] = */ {0x00,0x00,0x38,0x6c,0x60,0x60,0x60,0xfc,0x60,0x20,0x00,0x00}, +/* [u] = */ {0x00,0x00,0x76,0xcc,0xcc,0xcc,0xcc,0xcc,0x00,0x00,0x00,0x00}, +/* [v] = */ {0x00,0x00,0x30,0x78,0xcc,0xcc,0xcc,0xcc,0x00,0x00,0x00,0x00}, +/* [w] = */ {0x00,0x00,0x6c,0x6c,0xd6,0xd6,0xc6,0xc6,0x00,0x00,0x00,0x00}, +/* [x] = */ {0x00,0x00,0xc6,0x6c,0x38,0x38,0x6c,0xc6,0x00,0x00,0x00,0x00}, +/* [y] = */ {0xf0,0x18,0x0c,0x3c,0x66,0x66,0x66,0x66,0x00,0x00,0x00,0x00}, +/* [z] = */ {0x00,0x00,0xfc,0xc4,0x60,0x18,0x8c,0xfc,0x00,0x00,0x00,0x00}, +/* [{] = */ {0x00,0x00,0x1c,0x30,0x30,0x60,0xc0,0x60,0x30,0x30,0x1c,0x00}, +/* [|] = */ {0x00,0x00,0x18,0x18,0x18,0x18,0x00,0x18,0x18,0x18,0x18,0x00}, +/* [}] = */ {0x00,0x00,0xe0,0x30,0x30,0x18,0x0c,0x18,0x30,0x30,0xe0,0x00}, +/* [~] = */ {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xce,0xda,0x73,0x00}, +}; + +#define FTOCHAR(val) val<=0.0f?0: (val>=1.0f?255: (char)(255.0f*val)) +posfin pasatextoRec32(char* texto, unsigned short xref,unsigned short yref,char *rec32,int winx,int winy) { + posfin pos; + int lentexto=strlen(texto); + int i,j,cha=0; + unsigned char ftlnbt; + unsigned short x,y,textposx; + char *rc; + for (i=0,j=0; i < lentexto; i++,j++) { + cha=texto[i]-32; + if(cha<0||cha>94) + cha=0; + textposx=xref+(j*8); + if ((textposx+8)>winx){ + yref-=12; + textposx=xref=1; + j=0; + } + for (y=0;y<12;y++){ + rc=rec32+(4*winx*yref)+(4*y*winx); + pos.y=yref-y; + rc=rc+(4*textposx); + for (x=0;x<8;x++) { + ftlnbt=fntdat_cpy[cha][y]; + if(ftlnbt&(0x80>>x)){ + if (G.scene->r.mode&R_STAMP_INFO_INV){ + if ((rc[0]<139)&&(rc[0]>115)) rc[0]=279-rc[0]; else rc[0]=255-rc[0]; + if ((rc[1]<139)&&(rc[1]>115)) rc[1]=279-rc[1]; else rc[1]=255-rc[1]; + if ((rc[2]<139)&&(rc[2]>115)) rc[2]=279-rc[2]; else rc[2]=255-rc[2]; + }else{ + rc[0]=FTOCHAR(G.scene->r.stamp_colorr); + rc[1]=FTOCHAR(G.scene->r.stamp_colorg); + rc[2]=FTOCHAR(G.scene->r.stamp_colorb); + } + } + rc += 4; + pos.x=(4*textposx)+x; + } + } + } + return pos; +} + +void stampRec32 (char *rec32,int winx,int winy,View3D *v3d){ + posfin pos; + char text[240],dat[9],tim_buf[15]; +#ifdef WIN32 + _strdate( dat); +#else + time_t tim=time(NULL); + struct tm *now=localtime(&tim); + sprintf(dat,"%02d-%02d-%02d", now->tm_mon+1, now->tm_mday,now->tm_year-100 ); +#endif + pos=pasatextoRec32(G.sce,1,winy-12,rec32,winx,winy); + float seg=(float)(G.scene->r.cfra-G.scene->r.sfra)/(float)G.scene->r.frs_sec; + int dia=seg/86400; + int hor=(seg/3600)-(dia*24); + int min=(seg/60)-(hor*60); + seg=seg-(hor*3600)-(min*60); + sprintf(tim_buf,"%02d:%02d:%0.3f",hor,min,seg); + sprintf(text,"%s f#%i",tim_buf,G.scene->r.cfra); + pos=pasatextoRec32(text,1,pos.y,rec32,winx,winy); + pos=pasatextoRec32(G.scene->r.stamp_u_data,1,12,rec32,winx,winy); + pos=pasatextoRec32(dat,1,1,rec32,winx,winy); + if (v3d->persp==V3D_PERSP_USE_THE_CAMERA){ + Camera *cam; + cam=G.scene->camera; + strcpy(text,cam->id.name); + text[0]=text[1]=' '; + } + else if (v3d->persp==V3D_PERSP_ORTHO) + strcpy(text,"Ortho View"); + else + strcpy(text,"Perspective"); + pos.x=(winx/2)-(strlen(text)*4); + pos=pasatextoRec32(text,pos.x,1,rec32,winx,winy); + strcpy(text,G.scene->id.name); + text[0]=text[1]=' '; + pos.x=winx-((strlen(text)+1)*8); + pos=pasatextoRec32(text,pos.x,1,rec32,winx,winy); +} +//rcruiz> + /* set up display, render the current area view in an image */ /* the RE_Render is only used to make sure we got the picture in the result */ void BIF_do_ogl_render(View3D *v3d, int anim) @@ -1266,6 +1452,8 @@ break; drawview3d_render(v3d, winx, winy); glReadPixels(0, 0, winx, winy, GL_RGBA, GL_UNSIGNED_BYTE, rr->rect32); + if (G.scene->r.mode&R_STAMP_INFO)// If Stamp info + stampRec32(rr->rect32, winx, winy,v3d);// Put stamp on rect32 for opengl window_swap_buffers(render_win->win); if(BKE_imtype_is_movie(G.scene->r.imtype)) { @@ -1305,6 +1493,8 @@ else { drawview3d_render(v3d, winx, winy); glReadPixels(0, 0, winx, winy, GL_RGBA, GL_UNSIGNED_BYTE, rr->rect32); + if (G.scene->r.mode&R_STAMP_INFO)// If Stamp info + stampRec32(rr->rect32, winx, winy,v3d);// Put stamp on rect32 for opengl window_swap_buffers(render_win->win); }