[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [38266] branches/soc-2011-tomato: Merging r38237 through r38264 from trunk into soc-2011-tomato
Sergey Sharybin
g.ulairi at gmail.com
Sat Jul 9 19:49:37 CEST 2011
Revision: 38266
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38266
Author: nazgul
Date: 2011-07-09 17:49:36 +0000 (Sat, 09 Jul 2011)
Log Message:
-----------
Merging r38237 through r38264 from trunk into soc-2011-tomato
Revision Links:
--------------
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38237
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38264
Modified Paths:
--------------
branches/soc-2011-tomato/intern/ghost/test/CMakeLists.txt
branches/soc-2011-tomato/intern/ghost/test/multitest/MultiTest.c
branches/soc-2011-tomato/source/blender/blenkernel/intern/cdderivedmesh.c
branches/soc-2011-tomato/source/blender/blenkernel/intern/curve.c
branches/soc-2011-tomato/source/blender/blenkernel/intern/node.c
branches/soc-2011-tomato/source/blender/editors/armature/poseUtils.c
branches/soc-2011-tomato/source/blender/editors/object/object_relations.c
branches/soc-2011-tomato/source/blender/gpu/GPU_buffers.h
branches/soc-2011-tomato/source/blender/gpu/intern/gpu_buffers.c
branches/soc-2011-tomato/source/blender/render/intern/source/convertblender.c
branches/soc-2011-tomato/source/blender/windowmanager/intern/wm_init_exit.c
Property Changed:
----------------
branches/soc-2011-tomato/
Property changes on: branches/soc-2011-tomato
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/blender:36831-38236
+ /trunk/blender:36831-38264
Modified: branches/soc-2011-tomato/intern/ghost/test/CMakeLists.txt
===================================================================
--- branches/soc-2011-tomato/intern/ghost/test/CMakeLists.txt 2011-07-09 17:41:39 UTC (rev 38265)
+++ branches/soc-2011-tomato/intern/ghost/test/CMakeLists.txt 2011-07-09 17:49:36 UTC (rev 38266)
@@ -58,11 +58,41 @@
include_directories(${INC_NEW})
add_library(guardedalloc_lib ${SRC_NEW})
+# blenfont
+include(${CMAKE_SOURCE_DIR}/../../../source/blender/blenfont/CMakeLists.txt)
+suffix_relpaths(INC_NEW "${INC}" "../../../source/blender/blenfont/")
+suffix_relpaths(SRC_NEW "${SRC}" "../../../source/blender/blenfont/")
+include_directories(${INC_NEW})
+add_library(blenfont_lib ${SRC_NEW})
+# grr, blenfont needs BLI
+include_directories(
+ "../../../source/blender/blenlib"
+ "../../../source/blender/blenloader"
+ )
+add_library(bli_lib
+ "../../../source/blender/blenlib/intern/fileops.c"
+ "../../../source/blender/blenlib/intern/rct.c"
+ "../../../source/blender/blenlib/intern/string.c"
+ "../../../source/blender/blenlib/intern/listbase.c"
+ "../../../source/blender/blenlib/intern/storage.c"
+ "../../../source/blender/blenlib/intern/path_util.c"
+ "../../../source/blender/blenlib/intern/BLI_dynstr.c"
+ "../../../source/blender/blenlib/intern/BLI_linklist.c"
+ "../../../source/blender/blenlib/intern/BLI_memarena.c"
+ )
+
+message(STATUS "EEEk ${SRC_NEW}")
+
+
find_package(OpenGL REQUIRED)
+find_package(Freetype REQUIRED)
+
include_directories(${CMAKE_SOURCE_DIR}/../)
include_directories(${OPENGL_INCLUDE_DIR})
+include_directories(${FREETYPE_INCLUDE_DIRS})
+include_directories(${CMAKE_SOURCE_DIR}/../../../source/blender/blenfont)
if(UNIX AND NOT APPLE)
find_package(X11 REQUIRED)
@@ -105,6 +135,7 @@
# MultiTest (C)
add_executable(multitest_c
+ ${CMAKE_SOURCE_DIR}/../../../source/blender/editors/datafiles/bfont.ttf.c
${CMAKE_SOURCE_DIR}/multitest/Basic.c
${CMAKE_SOURCE_DIR}/multitest/EventToBuf.c
${CMAKE_SOURCE_DIR}/multitest/MultiTest.c
@@ -114,10 +145,13 @@
)
target_link_libraries(multitest_c
+ blenfont_lib
+ bli_lib
ghost_lib
string_lib
guardedalloc_lib
${OPENGL_gl_LIBRARY}
${OPENGL_glu_LIBRARY}
+ ${FREETYPE_LIBRARY}
${PLATFORM_LINKLIBS}
)
Modified: branches/soc-2011-tomato/intern/ghost/test/multitest/MultiTest.c
===================================================================
--- branches/soc-2011-tomato/intern/ghost/test/multitest/MultiTest.c 2011-07-09 17:41:39 UTC (rev 38265)
+++ branches/soc-2011-tomato/intern/ghost/test/multitest/MultiTest.c 2011-07-09 17:49:36 UTC (rev 38266)
@@ -42,8 +42,19 @@
#include "MEM_guardedalloc.h"
#include "GHOST_C-api.h"
-#include "BMF_Api.h"
+#ifdef USE_BMF
+# include "BMF_Api.h"
+#else
+# include "BLF_api.h"
+ extern int datatoc_bfont_ttf_size;
+ extern char datatoc_bfont_ttf[];
+
+ // XXX, bad, but BLI uses these
+ char bprogname[160]= "";
+char U[1024]= {0};
+#endif
+
#include "Util.h"
#include "Basic.h"
#include "ScrollBar.h"
@@ -291,7 +302,7 @@
win= GHOST_CreateWindow(sys, "MultiTest:Main", 40, 40, 400, 400,
GHOST_kWindowStateNormal, GHOST_kDrawingContextTypeOpenGL,
- FALSE);
+ FALSE, FALSE);
if (win) {
MainWindow *mw= MEM_callocN(sizeof(*mw), "mainwindow_new");
@@ -324,8 +335,12 @@
MultiTestApp *app;
GHOST_WindowHandle win;
-
+
+#ifdef USE_BMF
BMF_Font *font;
+#else
+ int font;
+#endif
int fonttexid;
int fontheight;
@@ -429,18 +444,26 @@
char *line= lw->loglines[(lw->nloglines-1)-(i+startline)];
int x_pos= lw->textarea[0][0] + 4;
int y_pos= lw->textarea[0][1] + 4 + i*lw->fontheight;
-
+
+#ifdef USE_BMF
if (lw->fonttexid==-1) {
glRasterPos2i(x_pos, y_pos);
BMF_DrawString(lw->font, line);
} else {
BMF_DrawStringTexture(lw->font, line, x_pos, y_pos, 0.0);
}
+#else
+ BLF_position(lw->font, x_pos, y_pos, 0.0);
+ BLF_draw(lw->font, line, 256); // XXX
+#endif
}
+
+#ifdef USE_BMF
if (lw->fonttexid!=-1) {
glDisable(GL_TEXTURE_2D);
glDisable(GL_BLEND);
}
+#endif
GHOST_SwapWindowBuffers(lw->win);
}
@@ -531,19 +554,25 @@
GHOST_GetMainDisplayDimensions(sys, &screensize[0], &screensize[1]);
win= GHOST_CreateWindow(sys, "MultiTest:Logger", 40, screensize[1]-432,
800, 300, GHOST_kWindowStateNormal,
- GHOST_kDrawingContextTypeOpenGL, FALSE);
+ GHOST_kDrawingContextTypeOpenGL, FALSE, FALSE);
if (win) {
LoggerWindow *lw= MEM_callocN(sizeof(*lw), "loggerwindow_new");
int bbox[2][2];
lw->app= app;
lw->win= win;
-
+
+#ifdef USE_BMF
lw->font= BMF_GetFont(BMF_kScreen12);
lw->fonttexid= BMF_GetFontTexture(lw->font);
BMF_GetBoundingBox(lw->font, &bbox[0][0], &bbox[0][1], &bbox[1][0], &bbox[1][1]);
lw->fontheight= rect_height(bbox);
+#else
+ lw->font= BLF_load_mem("default", (unsigned char*)datatoc_bfont_ttf, datatoc_bfont_ttf_size);
+ BLF_size(lw->font, 11, 72);
+ lw->fontheight= BLF_height(lw->font, "A_");
+#endif
lw->nloglines= lw->logsize= 0;
lw->loglines= MEM_mallocN(sizeof(*lw->loglines)*lw->nloglines, "loglines");
@@ -711,7 +740,7 @@
win= GHOST_CreateWindow(sys, "MultiTest:Extra", 500, 40, 400, 400,
GHOST_kWindowStateNormal, GHOST_kDrawingContextTypeOpenGL,
- FALSE);
+ FALSE, FALSE);
if (win) {
ExtraWindow *ew= MEM_callocN(sizeof(*ew), "mainwindow_new");
@@ -786,7 +815,7 @@
MultiTestApp *multitestapp_new(void) {
MultiTestApp *app= MEM_mallocN(sizeof(*app), "multitestapp_new");
GHOST_EventConsumerHandle consumer= GHOST_CreateEventConsumer(multitest_event_handler, app);
-
+
app->sys= GHOST_CreateSystem();
if (!app->sys)
fatal("Unable to create ghost system");
@@ -850,6 +879,10 @@
/***/
int main(int argc, char **argv) {
+#ifndef USE_BMF
+ BLF_init(11, 72);
+#endif
+
MultiTestApp *app= multitestapp_new();
multitestapp_run(app);
Modified: branches/soc-2011-tomato/source/blender/blenkernel/intern/cdderivedmesh.c
===================================================================
--- branches/soc-2011-tomato/source/blender/blenkernel/intern/cdderivedmesh.c 2011-07-09 17:41:39 UTC (rev 38265)
+++ branches/soc-2011-tomato/source/blender/blenkernel/intern/cdderivedmesh.c 2011-07-09 17:49:36 UTC (rev 38266)
@@ -284,8 +284,10 @@
else { /* use OpenGL VBOs or Vertex Arrays instead for better, faster rendering */
GPU_vertex_setup(dm);
if( !GPU_buffer_legacy(dm) ) {
- if(dm->drawObject->nelements) glDrawArrays(GL_POINTS,0, dm->drawObject->nelements);
- else glDrawArrays(GL_POINTS,0, dm->drawObject->nlooseverts);
+ if(dm->drawObject->tot_triangle_point)
+ glDrawArrays(GL_POINTS,0, dm->drawObject->tot_triangle_point);
+ else
+ glDrawArrays(GL_POINTS,0, dm->drawObject->tot_loose_point);
}
GPU_buffer_unbind();
}
@@ -547,9 +549,10 @@
GPU_normal_setup( dm );
if( !GPU_buffer_legacy(dm) ) {
glShadeModel(GL_SMOOTH);
- for( a = 0; a < dm->drawObject->nmaterials; a++ ) {
+ for( a = 0; a < dm->drawObject->totmaterial; a++ ) {
if( setMaterial(dm->drawObject->materials[a].mat_nr+1, NULL) )
- glDrawArrays(GL_TRIANGLES, dm->drawObject->materials[a].start, dm->drawObject->materials[a].end-dm->drawObject->materials[a].start);
+ glDrawArrays(GL_TRIANGLES, dm->drawObject->materials[a].start,
+ dm->drawObject->materials[a].totpoint);
}
}
GPU_buffer_unbind( );
@@ -629,13 +632,13 @@
GPU_color_setup(dm);
if( !GPU_buffer_legacy(dm) ) {
glShadeModel(GL_SMOOTH);
- glDrawArrays(GL_TRIANGLES, 0, dm->drawObject->nelements);
+ glDrawArrays(GL_TRIANGLES, 0, dm->drawObject->tot_triangle_point);
if( useTwoSided ) {
GPU_color4_upload(dm,cp2);
GPU_color_setup(dm);
glCullFace(GL_FRONT);
- glDrawArrays(GL_TRIANGLES, 0, dm->drawObject->nelements);
+ glDrawArrays(GL_TRIANGLES, 0, dm->drawObject->tot_triangle_point);
glCullFace(GL_BACK);
}
}
@@ -787,8 +790,8 @@
glShadeModel( GL_SMOOTH );
lastFlag = 0;
- for(i = 0; i < dm->drawObject->nelements/3; i++) {
- int actualFace = dm->drawObject->faceRemap[i];
+ for(i = 0; i < dm->drawObject->tot_triangle_point/3; i++) {
+ int actualFace = dm->drawObject->triangle_to_mface[i];
int flag = 1;
if(drawParams) {
@@ -819,13 +822,13 @@
startFace = i;
}
}
- if( startFace < dm->drawObject->nelements/3 ) {
+ if( startFace < dm->drawObject->tot_triangle_point/3 ) {
if( lastFlag != 0 ) { /* if the flag is 0 it means the face is hidden or invisible */
if (lastFlag==1 && col)
GPU_color_switch(1);
else
GPU_color_switch(0);
- glDrawArrays(GL_TRIANGLES,startFace*3,dm->drawObject->nelements-startFace*3);
+ glDrawArrays(GL_TRIANGLES, startFace*3, dm->drawObject->tot_triangle_point - startFace*3);
}
}
}
@@ -935,7 +938,7 @@
if( useColors && mc )
GPU_color_setup(dm);
if( !GPU_buffer_legacy(dm) ) {
- int tottri = dm->drawObject->nelements/3;
+ int tottri = dm->drawObject->tot_triangle_point/3;
glShadeModel(GL_SMOOTH);
if(tottri == 0) {
@@ -947,17 +950,17 @@
}
else {
/* we need to check if the next material changes */
- int next_actualFace= dm->drawObject->faceRemap[0];
+ int next_actualFace= dm->drawObject->triangle_to_mface[0];
for( i = 0; i < tottri; i++ ) {
- //int actualFace = dm->drawObject->faceRemap[i];
+ //int actualFace = dm->drawObject->triangle_to_mface[i];
int actualFace = next_actualFace;
MFace *mface= mf + actualFace;
int drawSmooth= (mface->flag & ME_SMOOTH);
int draw = 1;
if(i != tottri-1)
- next_actualFace= dm->drawObject->faceRemap[i+1];
+ next_actualFace= dm->drawObject->triangle_to_mface[i+1];
orig= (index==NULL) ? actualFace : index[actualFace];
@@ -1129,9 +1132,9 @@
GPU_normal_setup(dm);
if( !GPU_buffer_legacy(dm) ) {
- for( i = 0; i < dm->drawObject->nelements/3; i++ ) {
+ for( i = 0; i < dm->drawObject->tot_triangle_point/3; i++ ) {
- a = dm->drawObject->faceRemap[i];
+ a = dm->drawObject->triangle_to_mface[i];
mface = mf + a;
new_matnr = mface->mat_nr + 1;
@@ -1153,7 +1156,7 @@
if( numdata != 0 ) {
- GPU_buffer_free(buffer, NULL);
+ GPU_buffer_free(buffer);
buffer = NULL;
}
@@ -1193,7 +1196,7 @@
}
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list