Scolring - Forum

Entraides et échanges autour de la technologie Scol - Informations and exchanges on the Scol technology

Vous pouvez changer la langue de l'interface une fois inscrit - You can change the language once registered

You are not logged in.

#1 Openspace3D » bug in xml parse and write » 15-Mar-2011 10:46:47

Replies: 1

there is a bug in xml parse and write

<mesh ="" indexMaterials="false" renderingDistance="" receiveShadows="true" castShadows="true" path="demos%2fkidkitchen%2fmesh%2fknife%5fdeco%2emesh" alias="" name="knife%5fdeco01" id="130">

there is a empty key value pair " = "" "

#2 Openspace3D » flash source project is missing » 16-Feb-2011 09:45:40

Replies: 2


flash source project is missing
the chat plugit
only have chat.swf file


#3 Re: Openspace3D » [Solved][flash interface] string convert » 14-Feb-2011 01:24:28

you use mbstowcs and wcstombs function to convert the string and wstring,not enough ,also should set setlocale(LC_ALL, "chs");.

but you can choose another way


std::wstring Ansi2WChar(LPCSTR pszSrc, int nLen)

int nSize = MultiByteToWideChar(CP_ACP, 0, (LPCSTR)pszSrc, nLen, 0, 0);
if(nSize <= 0) return NULL;

WCHAR *pwszDst = new WCHAR[nSize+1];
if( NULL == pwszDst) return NULL;

MultiByteToWideChar(CP_ACP, 0,(LPCSTR)pszSrc, nLen, pwszDst, nSize);
pwszDst[nSize] = 0;

if( pwszDst[0] == 0xFEFF) // skip Oxfeff
for(int i = 0; i < nSize; i ++)
pwszDst[i] = pwszDst[i+1];

wstring wcharString(pwszDst);
delete pwszDst;

return wcharString;

std::wstring s2ws(const string& s){ return Ansi2WChar(s.c_str(),s.size());}

std::string WChar2Ansi(LPCWSTR pwszSrc)
int nLen = WideCharToMultiByte(CP_ACP, 0, pwszSrc, -1, NULL, 0, NULL, NULL);

if (nLen<= 0) return std::string("");

char* pszDst = new char[nLen];
if (NULL == pszDst) return std::string("");

WideCharToMultiByte(CP_ACP, 0, pwszSrc, -1, pszDst, nLen, NULL, NULL);
pszDst[nLen -1] = 0;

std::string strTemp(pszDst);
delete [] pszDst;

return strTemp;

string ws2s(wstring& inputws){ return WChar2Ansi(inputws.c_str()); }

and about the flash keyborad input:

void FlashControl::handleKeyEvent(UINT msg, WPARAM wParam, LPARAM lParam)
    LRESULT aResult;
    if(msg == WM_CHAR)
        if(wParam > 0x7F)
                __mbr_enable = true;
                __mbr_save_w = wParam;
                __mbr_save_l = lParam;
                __mbr_enable = false;

                windowlessObject->OnWindowMessage(msg, wParam, lParam, &aResult);
                windowlessObject->OnWindowMessage(msg, __mbr_save_w,__mbr_save_l, &aResult);    
            __mbr_enable = false;
            windowlessObject->OnWindowMessage(msg, wParam, lParam, &aResult);
        windowlessObject->OnWindowMessage(msg, wParam, lParam, &aResult);

because the code

fact input  :中文测试 : d6 d0 ce c4 b2 e2 ca d4
displayed  :兄奈獠允 : d0 d6 c4 ce e2 b2 d4 ca

this is why everything happening.when windows decide to transfer a unicode character,it will send two WM_CHAR to the target window,first the lower two bytes,then the higher two bytes.maybe this is windows needed,but it seems the flash player doesn`t think what we have to do is quite simple.we should reverse the two WM_CHAR messages before they were sent to flash player activex.we will need some hacking on our the FlashControl::handleKeyEvent,we join a procedure before calling windowlessObject->OnWindowMessage.we pick the WM_CHAR message,then check the wParam,if it`s not an ascii character,then we do something discussed above,else we just pass it.

#5 Re: Openspace3D » [Solved][flash interface] string convert » 13-Feb-2011 00:13:55

problem come from here,

the flash interface plugint when recieve the message form flash

fun cbGetMessage(flashctrl, constr, message, args)=
  _DMSevent this (getPluginInstanceEvent constr.FLINT_instance message) (listToString args) nil;

it will call listToString function and this function will call strbuild.

strbuild will convert unicode word to \xxx\xxx\xxx\xxx format

so if I use strextr before show dialog,string display correct.

let hd hd (strextr message) -> message in

but this is only display the first word...

so we need use strcatn replace the listToString

#6 Re: Openspace3D » [Solved][flash interface] string convert » 12-Feb-2011 23:14:07

fun listToString(l)=
  let nil -> ret in
    let sizelist l -> size in
    let 0 -> i in
    while (i < size) do
      let nth_list l i -> line in
      let strextr line -> lp in
        set ret = lcat ret (hd lp)::nil;
      set i = i + 1;
    if ret == nil then nil else strbuild ret;

#7 Re: Openspace3D » [Solved][flash interface] string convert » 12-Feb-2011 20:37:12

arkeon wrote:

wooh ...

i remember that scol could manage chinese language, but flash seem's to send unicode ?!

is other interface manage correctly chinese language ? (in dialog box title for example)

another cause could be a missed conversion in hikari flash call

other interface like dialogbox can display chinese correctly,

somewhere in scol trun the chinese string to \xxx\xxx\xxx\xxx

fun cbGetMessage(flashctrl, constr, message, args)=
  _DMSevent this (getPluginInstanceEvent constr.FLINT_instance message) (listToString args) nil;

after function listToString the value changed...

#8 Openspace3D » [Solved][flash interface] string convert » 12-Feb-2011 11:36:08

Replies: 14

my flash ui call pass a chinese words to scol,
then i use dailog box and debug console to display that words,
but the reasult is like this:

how to convert it to factual string? is there any function I missed?

#9 Scol » scol value » 10-Feb-2011 04:02:07

Replies: 2
#define MTOI(val) ((val)>>1)
#define MTOP(val) ((val)>>1)
#define ITOM(val) ((val)<<1)
#define PTOM(val) (((val)<<1)+1)
_inline float MTOF(int val) {    return *(float*)&(val);    }
_inline int   FTOM(float val) {    return ((*(int*)&(val)) & 0xfffffffe);    }

these operation >> << &fffffffe

wouldn't it decrease  the numbers's precision?

How scol deal with that.

#10 Scol » set lKEYBlist = quicksort lKEYBlist nil; » 5-Feb-2011 22:49:16

Replies: 1

trunk/scol_applications/openspace3d/os3dlib/keyblib.pkg line 146

how can be the compare function set nil?

 let exec nil with [a x] -> r in

wouldn't this code produce probelm?

#11 Scol » about _refreshExe » 4-Feb-2011 20:22:02

Replies: 3

what's meaning of _refreshExe?
I can't find related info in scol doc

#12 Re: Openspace3D » about embeddedNavigator » 3-Feb-2011 05:58:14

hey Nodrev, thanks ,you are so great.
but the Awesomium 's problem ,can we fix it with open source fork.

#13 Scol » why can not wrote like this? » 28-Jan-2011 10:58:50

Replies: 1
defcom maincom = main S I S;;
defcom CaddHistory = addHistory S;;

fun main(name,r,s)=
  // add the url in voyager history
  _on _masterchannel CaddHistory [name];

  _load "locked/lib/loc.pkg";
  _load "locked/stduser1.pkg";
  _script mkscript maincom [name r s];

why can not wrote like this?

defcom CaddHistory = addHistory S;;

fun main(name,r,s)=
  // add the url in voyager history
  _on _masterchannel CaddHistory [name];

  _load "locked/lib/loc.pkg";
  _load "locked/stduser1.pkg";
  main name r s;

EDIT iri : add <code> ...

#14 Re: Scol » WIP selection buffer (optimizing raycast) » 21-Jan-2011 14:48:58

cool ,it will be really fast that if don't need to iterate throught subentites

#16 Scol » Edit SCOL language » 5-Jan-2011 16:33:29

Replies: 2

Hey,I use the notepad++ ,

but the new version of it cannot run the plugin FunctionList.

So any better solution?

#17 Scol » build SO3Engine is slowly » 5-Jan-2011 12:05:28

Replies: 1

how about precompliedhead file

#18 Re: Openspace3D » voice recognition » 31-Dec-2010 04:13:30

how about these:
Open Source speech recognition engines such as Sphinx, ISIP, Julius and HTK (note: HTK has distribution restrictions).

#20 Re: Openspace3D » voice recognition » 30-Dec-2010 14:22:13

mine is Microsoft Speech Recognizer 8.0 for Windows.

in default the Speech is closed ,need  open this function manually

#22 Openspace3D » voice recognition » 29-Dec-2010 15:35:31

Replies: 12


the car show room demo,

I speak black red ,.......

but nothing happened

#24 Scol » why the fread function need callback? » 29-Dec-2010 10:43:48

Replies: 4

why the fread function need callback?




Board footer

Powered by FluxBB