slang-users mailing list

[2001 Date Index] [2001 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: Possible bug...


well...hm...I found it...but I am not very happy ;-)
it is something with my OpenAL-code (realocation of the sound sources seems to be
the problem) in a function that is called before the keydown();...
but I dont see why S-Lang gets involved with that...it has actually nothing to do
with the keydown or anything with the engine...
but I have to work around that then...

thanks for the help..again..

           Richard van Zon.

John E. Davis wrote:

Richard van Zon <rvanzon@xxxxxxxxxxxx> wrote:

The error I get is :
S-Lang Error: Internal Error: Byte-Code 0x70 is not valid
S-Lang Error: Internal Error: Error while executing onKeyDown


The reason I think that memory is being trashed is that if you compile
a simple program embedding slang, and have it load the following file as
input, then I am sure that you will not see the error.

  variable yvel=-1,xvel=1, x=0, y=0;   % or some other values
  define onKeyDown(key)
  {
    if (key==276) { yvel=-1.0;y--; }    % this one works fine
    if (key==275) { yvel=-1.0;y--; }    % yvel=-1.0 is not valid here ?!
    if (key==273) { xvel=1.0;x--; }     % this one works fine
    if (key==274) { xvel=-1.0;x++; }    % this one works fine
  }
  onKeyDown(275);


Here is a simple C program that could be used for testing this:

#include <stdio.h>
#include <stdlib.h>
#include <slang.h>
int main (int argc, char **argv)
{
 if (-1 == SLang_init_all ())
   return EXIT_FAILURE:
if (argc > 1)
   SLang_load_file (argv[1]);
if (SLang_Error)
   return EXIT_FAILURE;

 return EXIT_SUCESS;
}

--John







[2001 date index] [2001 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]