[Pipmak-Users] Compiling pipmak
Status: Alpha
Brought to you by:
cwalther
From: Andrea <and...@gm...> - 2007-06-05 10:05:09
|
"1. You seem to be top-posting. Don't do that." is returned!!! I don't understand that!!! It's very boring!!! Hi Christian, I have recompiled physicFs and Lua with Visual C++, and now pipmak run a little better. Now pipmak can exec project from folder and zip file. But I cannot start pipmak without a project yet. I have tryed my builded pipmak with my project "myHouse virtual tour" that is very simple from the "lua code" point of view. It's run quite good, apart an error message when I use message passing: "Error running enternode handler: 1/node.lua:6: calling 'message' on bad self (node expected got table)" This error is connected to the lua code: ..... onenternode(function() over:message("print","welcome") end) ..... where over was defined on overlay node with: over=pipmak.thisnode() I get also a similar error when I press ESC to show main pipmak menu (pipmak main menu isn't showed) "Error running Lua file resources/defaults.lua:275: calling 'setstandardcursor' on bad self (node expected got table)" I don't know if it's important, but I notice that both message than setstandardcursor are included in nodeFuncs[]. About enternode, you tell: "I'm not sure what you mean by that. There's no function "enternode()" in the C code..." It's defined in the file nodes.c CNode *enterNode(int nodeID, CNode *prev) and it's called from "opensave.c" int openAndEnterProject(const char *filename) { int t = openProject(filename); if (L == NULL) { /*opening the project didn't work and no project was open before: load defaults*/ t = openProject(NULL); assert(L != NULL); } enterNode(t, NULL); return (t != 0 || filename == NULL); } "L" isn't passed: is it global? I have had to change your code a little: 1) Seems that Microsoft Visual C++ don't permit variable definition in the middle of blocks {}, but only at the beginning... It's very strange, because I remember that the possibility to define new variable everywhere instead at the beginning of the block was one of the differences of the C++ from C language... So I have moved some variable definitions at the beginning of the blocks... 2) I found M_PI in math.h, but it's included in a #ifdef _USE_MATH_DEFINES the remark tell: /* Define _USE_MATH_DEFINES before including math.h to expose these macro * definitions for common math constants. These are placed under an #ifdef * since these commonly-defined names are not part of the C/C++ standards. */ 3) There is also boring warning messages about deprecation of function strcpy, and similar functions, so I have to define: _CRT_SECURE_NO_DEPRECATE _CRT_NONSTDC_NO_DEPRECATE 4) in pipmak_windows.c : #ifdef WIN32 #define snprintf _snprintf #endif because I not found "snprintf" but only "_snprintf" 5) I the past I've used a lot language "C", and I know less "C++", so excuse me if I say mistaken things, but I am a little perplexed about this use: File pipmakLuaLib.c, line 297 (build 155) char *path = newProjectPath(); "path" is a pointer to "char" with the assignment *path=newProjectPath() you assign the content of the pointer (a char) not the pointer, but newProjectPath return a pointer ("return ofn.lpstrFile" in fact "ofn.lpstrFile=malloc(1024);" ) So I would have written: path=newProjectPath() (without the "*") (Infact the compiler tell me that path is never assigned) In "C" I had habit to write: char *pointer_to_char; pointer_to_char = malloc(5 * sizeof(char)); in this way pointer_to_char points to a five char dinamic string. I'm in wrong? 6) What do you think about a file "pipmak.h" included in all ".c" files, To have a place where add definition for all the file? for example: #ifdef _MSC_VER #define _CRT_SECURE_NO_DEPRECATE #define _CRT_NONSTDC_NO_DEPRECATE #define _USE_MATH_DEFINES #endif With this self builded Pipmak I managed to test the new features which you have added: Optimal job! I have tryed this code: img=pipmak.newimage(128,128) img:color(1,0,0,1) img:fill(0,0,128,128) img:color(0,1,0) img:drawtext(64,64,"ANDREA","arial.ttf",20,pipmak.center) for i=1,10000,2 do patch { anchorh=64, anchorv=64, x=0,y=0, nx=1+i,ny=0,nz=1, nw=2,nh=2, visible=true, angle=90*i, image=img} patch { anchorh=64, anchorv=64, x=0,y=0, nx=1+i,ny=1,nz=0, nw=2,nh=2, anglex=90, angle=-45+45*i, visible=true, image=img} patch { anchorh=64, anchorv=64, x=0,y=0, nx=1+i,ny=0,nz=-1, nw=2,nh=2, visible=true, angle=90*i, image=img} patch { anchorh=64, anchorv=64, x=0,y=0, nx=1+i,ny=-1,nz=0, nw=2,nh=2, anglex=90, angle=-45+45*i, visible=true, image=img} end This write a red tunnel... 20000 patches!!! And written in less than a second!! Good! I have understood that x=..,y=.. were in alternative to nx=..,ny=..,nz=.. It's true? because I have to define always x and y? (but the values are ininfluent...) or I get the error: "property "x" of patch: number expected got nil" I cannot specify size without specifying font file? Ok, for today is enough!! I hope this help you to improve Pipmak!! Bye Andrea |