Tuesday, May 1, 2012

My first success

Hi. Last week was pretty fruitful. I got to work EventRecorder on KYRA engine. Let's describe it in more details.


In previous post I wrote that problem in synchronizing of game and sound threads. So, I decided to solve this problem by making fake sound system which will work in game's thread. After some code researching I've found that every platform have a wrapper of audio mixer. This wrapper initializes mixer and periodically calls mixer's callback to fill audio buffer. At this moment it works only on sdl platform, so I decided to implement fake wrapper for this platfrorm. Unlike of current wrapper it's will controlled by EventRecorder and send audiodata to file instead of audio device. So, I've created class NullSdlMixerManager and inherited it from SdlMixerManager. 

Also I've add recording of random numbers. In current version of code, it reads and writes every call of getRandomNumber function. Since random number generator is pseudorandom and generate sequence depending of seed, I'm going to record only random seed assignment. 

All this actions made a miracle! Now recorder works on KYRA engine as well as on SKY engine. On this video you can see recorded and played back first stage of the passage of Lengend of Kyrandia 




No comments:

Post a Comment