03 August 2017, 18:26 | #21 |
Registered User
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
|
thanks alkis, i saw this, but is this enough?
one thing mandatory, they want a SPACE between each of the settings. i have to test the plugin again, *brb* #1) it doesnt work. Blinker plugin is different plugin type, it saves its properties in the object file, and this does work. even just removing the c++ part from load/save. other plugins save to the scene file and here i get only the plugin tag with a empty line - which should hold the parameters. once started the plugin, the load function should read from that scene file, result it some big random numbers, in the plugin option panel. i do some more tests. Last edited by emufan; 03 August 2017 at 18:55. |
03 August 2017, 18:50 | #22 |
Registered User
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 719
|
It's not mandatory.
They are saving strings with spaces in between. My proposal saves (and loads) raw structure data. If blinkc.c works, I can't see how this technique won't work here. |
03 August 2017, 19:11 | #23 | |
Registered User
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
|
Quote:
in one plugin the author fixed a space in the "save" function - it didnt work before, i so i got that "info" from #1) in lwran.h there is a LWIO_SCENE and LWIO_OBJECT mode. and i found a support file for the layout load/save operations. header file is at the end of the c file. they deal with LWIO_ modes LWIO_OBJECT mode: (*lState->read) (lState->readData, (char *) &len, 1); LWIO_SCENE mode: (*lState->read) (lState->readData, str, maxStr); #2) btw. i've uploaded the Lightwave SDK 5.6 to the ftp, it comes with html docs. it lists compatibility of funtions for version 4.0 and 5.0. much more info compared to the tiny standard sdk. Last edited by emufan; 04 August 2017 at 02:26. |
|
03 August 2017, 20:20 | #24 |
Registered User
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 719
|
don't throw several new things at once. One thing at a time. Does load/save now work?
|
03 August 2017, 20:32 | #25 | |
Registered User
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
|
Quote:
just to explain a bit: there are differnt types of plugins, for example: Surface shader, Image Shader blinker is a Surface shader - it's settings will be saved with the object file, you apply the plugin to. it manipulates some surface settings. VidLines - is a Image shader, it draws some tv look-alike lines on the image, in the very last step of a rendering. the Image Shader settings will be stored in the scene file. #1) just tested the fader plugin ( based on Blinker ) is surface plugin, this one does store and read ( save/load) the settings from the manipulated object. so your load/save routine does work with object files. so maybe it is somehow different if the plugin has to save the setings in the scene file. #2) if there is a difference, then we would see it in the original c++ source code. there seems nothing to hint on the IOMODE ( object vs scene) in lwran.h - also in the old 5.0 version, LWLoadState/ LWSaveState structs lists a ioMODE member. not sure if it is of any importance. #3) take a look at lod.c - this plugin does write settings to scene files. and it does some IOMODE magic with sprintf . LOD Level Of Detail -> uses different objects dependent of the distance to the camera eye. in the scene file it look like this: Code:
Plugin ObjReplacementHandler 1 LOD 3 objects/lod/saguaro_h.lwo 0 objects/lod/saguaro_m.lwo 150 objects/lod/saguaro_l.lwo 300 EndPlugin Last edited by emufan; 04 August 2017 at 02:27. |
|
03 August 2017, 23:26 | #26 |
Registered User
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 719
|
Give this a shot.
|
03 August 2017, 23:48 | #27 |
Registered User
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
|
you are a magican
Code:
Plugin ImageFilterHandler 1 T42_Vidlines 10 3 6 0.100000 0.050000 EndPlugin now i can fix the other plugins. thanks alot #1) just looking at the code, looks universal. you added pluginio.c - this is cool. new load/save function looks easy enough to replicate #2) how do i #define WORD? found it, definition in .h file, have to move the #define block on top of src file. lesson learned #3) you've added readDouble and and writeDouble, nice one #4) first one is fixed: Code:
Plugin ImageFilterHandler 1 T42_ImageProc 7.000000 0 10.000000 3.000000 2.000000 4.000000 2.000000 7.000000 3.000000 9.000000 2.000000 EndPlugin #5) fixed now 4 plugins, all do work, saving their settings to the scene file. this is really a great achievement. there are still some plugins in WIP state. but this will be solved for sure too. thanks alot for your help, alkis Last edited by emufan; 04 August 2017 at 02:27. |
04 August 2017, 03:18 | #28 |
Registered User
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
|
another WIP plugin, while linking says this:
Code:
SAS/C Amiga Compiler 6.58 Copyright (c) 1988-1995 SAS Institute Inc. Slink - Version 6.58 Copyright (c) 1988-1995 SAS Institute, Inc. All Rights Reserved. Error 502: _malloc symbol - Distance for Reloc16 > 32768 First Reference in Unit vhud.c at offset 00000098 in file 'vhud.o' To Unit malloc.o at offset 0000e558 in file 'LIB:sc.lib' *** SMAKE: Error return from child process *** Code:
line: 356: lw = malloc(sizeof(struct IFPLUGIN_TAG)); .... line: 3279: udata = malloc(sizeof(struct callback_TAG)); ... #1) in the sasc manual, is a solution: Code:
Compile the file with -code=far, or declare the function with the __far keyword. #2) in SCOPTIONS file, add: CODE=FAR Last edited by emufan; 04 August 2017 at 03:52. |
04 August 2017, 17:41 | #29 |
Registered User
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
|
another attempt with goo plugin. initially the original c++ src was fixed,
but the resulting SASC binary does not work at all - hence the conversion to c i converted allmost all like seen in the other successfull builds. with goo, there is a include file, with c++ class, constructors. this differs from other class defintions - i cannot convert it to c. attached, original cc, c src which builds, but missing functions, and the c scr with partially included stuff from lwglobals.hh alkis? Last edited by emufan; 05 August 2017 at 14:24. |
04 August 2017, 18:00 | #30 |
Registered User
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 719
|
|
04 August 2017, 18:08 | #31 |
Registered User
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
|
|
04 August 2017, 20:19 | #32 |
Registered User
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 719
|
Any chance this works?
|
04 August 2017, 20:41 | #33 |
Registered User
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
|
almost
Melt mode does melting the obhect. when it starts ( frame 5) it starts with skrinking the object by 50%, next it does the melting. with OOZE mode nothing happens. i try the peecee version, to get a clue what it should do. *argh* only sgi binary of the plugin :/ #1) looking at the source and your changes. i guess i now understand what to do in such case. thanks, another lesson learned #2) i found somthing: Code:
//Flags function XCALL_(unsigned int) flags(LWInstance) { return LWDMF_WORLD; ////return NULL; } one initial value seems wrong, lastg value in the gui, is 0.0078, but working value is 1. in the scene file the last value is 0, i have to look at the value in the src. --> it is float fObjBounds , it is always handled as float, but whatever is saved in the scene file (save fucntion), when opening the gui, it allways says: 0.0078 rather strange. #3) in the save function, there was/is an "ends as last entry, this one is nowhere defined in the source, so i skiped it in my save conversion: Code:
XCALL_(LWError) save(LWInstance inst, const LWSaveState *lwss) { GOO *defInst = (GOO *)(inst); writeInt(lwss, defInst->uStartMelt); writeInt(lwss, defInst->uMaxTime); writeFloat(lwss, defInst->fObjBounds); writeFloat(lwss, defInst->fGroundPlane); writeFloat(lwss, defInst->fFlatWidth); writeInt(lwss, defInst->tTypeGoo); // ostr << defInst->uStartMelt << SPACE << defInst->uMaxTime; // ostr << SPACE << defInst->fObjBounds; // ostr << SPACE << defInst->fGroundPlane << SPACE << defInst->fFlatWidth << SPACE; // ostr << defInst->tTypeGoo << ends; but i dunno exactly. Last edited by emufan; 05 August 2017 at 13:55. |
04 August 2017, 21:27 | #34 |
Registered User
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 719
|
Hmm, try changing line 326 from double val; to float val;
Ok, I realised I reformated the code and I might have changed the lines...here is the code Code:
float readFloat(const LWLoadState *lState) { if (lState->ioMode == LWIO_OBJECT) { float val; (*lState->read) (lState->readData, (char *) &val, 4); BSWAP_L(val); return val; } else { char buf[50]; float val; (*lState->read) (lState->readData, buf, 50); sscanf (buf, "%f", &val); return (float) val; } } |
05 August 2017, 00:15 | #35 |
Registered User
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
|
this did the trick.
maybe we should write a bug report to newtek, for their pluginio.c code while melt does work ok, there is not a single pixel moving in Ooze mode. #1) i've managed to build the win32 version with MSVC6 and cl.exe using original c++ src code, just changing: Code:
// istrstream istr(cInBuf, 64); std::istringstream istr(cInBuf, 64); // ostrstream ostr(cOutBuf, 64); std::ostringstream ostr(cOutBuf, 64); melt does work well, while ooze does nothing, maybe it needs some experimenting with the values. so for now i'd say, goo is done. thanks again alkis ps: is HiSOFT C++ 4.0 any good? Last edited by emufan; 05 August 2017 at 02:07. |
05 August 2017, 11:29 | #36 |
Registered User
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 719
|
well, if you look at the source code in evaluate you'll see that ooze doesn't have any real work to be done. it's just two ifs and no frame-dependent code. So, I don't think the original author wanted it to do anything more.
Never tried HiSOFT C++ 4.0. I've heard it's a sort of customised gcc and the impressions of it all arround are mixed. |
05 August 2017, 13:31 | #37 |
Registered User
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
|
that was a good pointer. from the lines in the src, it does manipulate values
dependent on position of the object to the groundplane. so now when moving an object below the ground plane, it does animate the oozing/melting. melt does work with a static, non moving objects. while ooze will handle animated objects. #1) ok, i skip hisoft. c++ to c conversion is more fun anyway and it does work very well Last edited by emufan; 05 August 2017 at 15:32. |
05 September 2017, 20:02 | #38 |
Registered User
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
|
some small issue with a cpp source and sas/c:
"abs undeclared" - i exchanged all "abs with "fabs", which was used in another cpp source. is this an issue - is there another solution? |
05 September 2017, 20:09 | #39 |
Registered User
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 719
|
abs is for integers, fabs is for floats.
abs is/should-be prototyped in <stdlib.h> fabs is/should-be prototyped in <math.h> check the type of the argument and use the apropiate one. |
05 September 2017, 20:12 | #40 | |
Registered User
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
|
Quote:
both are included, only int stuff, for some coordinates: Code:
switch (bi->ndigits) { case 0: l = abs((int)storeit[1]); if (l > 9999) l = 9999; sprintf(buffer,"%.4d",l); break; case 1: l = abs((int)storeit[1]); if (l > 99999) l = 99999; sprintf(buffer,"%.6d",l); break; default: l = abs((int)storeit[1]); if (l > 99999999) l = 99999999; sprintf(buffer,"%.8d",l); break; } sc:include/stdlib.h only defines abs #ifndef _cplusplus stdlib.h has a labs "long int", should i use this? #2) the CODE=FAR issue went away, after I disabled the strstream stuff. it's a lot stuff to replace - so i just disabled the load and save routines, for now #3) the strsteam stuff i'll replace with the working c alternative, shouldn't matter Last edited by emufan; 05 September 2017 at 21:13. |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
"Voices8" 8 Channel Soundtracker "DemoSongI" song - "This is the Amiga with 8 Voices" | DemosongIHunter | request.Music | 45 | 23 May 2022 20:07 |
"Screech!! v2.41" & "Screech!! [AGA] v2.51" - "HD install" --> "ADFs" | DamienD | request.Old Rare Games | 45 | 15 June 2020 12:42 |
"Reminder "Lincs Amiga User Group aka "LAG" Meet Sat 5th of January 2013" | rockape | News | 4 | 30 January 2013 00:06 |
CD32 Image-Name-Bug: "...(bla)[!].zip" -> "...(bla)[" / "...[test].zip" -> "...[tes" | cfTrio | support.WinUAE | 8 | 18 December 2012 16:31 |
Problems with "Thespywholovedme", "Flood", "Shinobi" | sareks | support.Games | 12 | 03 May 2006 14:52 |
|
|