Crystal Space
Welcome, Guest. Please login or register.
December 21, 2014, 10:37:47 pm

Login with username, password and session length
Search:     Advanced search
9032 Posts in 2046 Topics by 9297 Members
Latest Member: Adrihjapa
* Home Help Search Login Register
+  Crystal Space
|-+  Associate Projects
| |-+  CEL Discussion
| | |-+  iCelParameterBlock
« previous next »
Pages: [1] Print
Author Topic: iCelParameterBlock  (Read 3572 times)
muffinpeddler
Full Member
***
Posts: 122


View Profile Email
« on: August 14, 2005, 10:18:14 pm »

How can I get parameters from a parameter block sent to SendMessage for mousex_centered axis events, parameters such as x offset from center, etc.?  I am getting segfaults when accessing the parameter block.

Thanks.
Logged
jorrit
Administrator
Hero Member
*****
Posts: 1706


View Profile
« Reply #1 on: August 15, 2005, 06:39:43 am »

How can I get parameters from a parameter block sent to SendMessage for mousex_centered axis events, parameters such as x offset from center, etc.?  I am getting segfaults when accessing the parameter block.

Thanks.

Show me the code that you're using. That would perhaps help find out what is wrong.

Greetings,
Logged
muffinpeddler
Full Member
***
Posts: 122


View Profile Email
« Reply #2 on: August 15, 2005, 07:11:37 am »

Here is the send message function.  Maybe what I am asking is how do I get the mouse event data from the various parameters passed into SendMessage?  I read the API and it says the parameter block will contain parameters passed, but params is always null:

Code:
    bool TerraBehavePlayer::SendMessage (csStringID msg_id,
                                         iCelPropertyClass* pc,
                                         celData& ret, iCelParameterBlock* params,
                                         va_list arg)
    {
        GetActorMove ();

        if(params)
            TerraDebug::terraDebugf("Got %d! parameters!\n", params->GetParameterCount());       
       
        if (msg_id == id_pccommandinput_forward1)
            pcactormove->Forward (true);
        else if (msg_id == id_pccommandinput_forward0)
            pcactormove->Forward (false);
        else if (msg_id == id_pccommandinput_backward1)
            pcactormove->Backward (true);
        else if (msg_id == id_pccommandinput_backward0)
            pcactormove->Backward (false);
        else if (msg_id == id_pccommandinput_rotateleft1)
            pcactormove->RotateLeft (true);
        else if (msg_id == id_pccommandinput_rotateleft0)
            pcactormove->RotateLeft (false);
        else if (msg_id == id_pccommandinput_rotateright1)
            pcactormove->RotateRight (true);
        else if (msg_id == id_pccommandinput_rotateright0)
            pcactormove->RotateRight (false);
           
        else if (msg_id == id_pccommandinput_strafeleft0)
            pcactormove->StrafeLeft (false);
        else if (msg_id == id_pccommandinput_straferight0)
            pcactormove->StrafeRight (false);       
        else if (msg_id == id_pccommandinput_strafeleft1)
            pcactormove->StrafeLeft (true);
        else if (msg_id == id_pccommandinput_straferight1)
            pcactormove->StrafeRight (true);
       
        else if (msg_id == id_pccommandinput_run0)
            pcactormove->Run (false);
        else if (msg_id == id_pccommandinput_run1)
            pcactormove->Run (true);
       
        else if (msg_id == id_pccommandinput_jump1)
            pcactormove->Jump();
        else if (msg_id == id_pccommandinput_cammode1)
            pcactormove->ToggleCameraMode ();
        else if (msg_id == id_pccommandinput_yaw)
        {

            TerraDebug::terraDebug("Mouse movement x...");
        }
        else if (msg_id == id_pccommandinput_pitch)
        {
           
            TerraDebug::terraDebug("Mouse movement y...");
        }
        else {
            TerraDebug::terraDebugf("%d\n", msg_id);
           
            return TerraBehaveCommon::SendMessage (msg_id, pc, ret, params, arg);;
        }
        return true;
    }

Thanks.
Logged
genjix
Jr. Member
**
Posts: 53


View Profile
« Reply #3 on: December 05, 2005, 06:17:46 pm »

what does
printf("%s\n",msg_id);
at the top of your code do?
Logged
jorrit
Administrator
Hero Member
*****
Posts: 1706


View Profile
« Reply #4 on: December 05, 2005, 08:17:21 pm »

Here is the send message function.  Maybe what I am asking is how do I get the mouse event data from the various parameters passed into SendMessage?  I read the API and it says the parameter block will contain parameters passed, but params is always null:

It depends on the message. For which message do you want to get the parameters?

Greetings,
Logged
muffinpeddler
Full Member
***
Posts: 122


View Profile Email
« Reply #5 on: December 06, 2005, 05:24:59 am »

This is old.  The celData reference had everything I needed.  Check out my mouselook post to see more genjix
Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 5.139 seconds with 16 queries.