| 1 | /*************************************************************************** |
| 2 | eventstream.cpp - description |
| 3 | ------------------- |
| 4 | begin : Sat Sep 30 2000 |
| 5 | copyright : (C) 2000 by Waldemar Baraldi |
| 6 | email : [email protected] |
| 7 | ***************************************************************************/ |
| 8 | |
| 9 | /*************************************************************************** |
| 10 | * * |
| 11 | * This program is free software; you can redistribute it and/or modify * |
| 12 | * it under the terms of the GNU General Public License as published by * |
| 13 | * the Free Software Foundation; either version 2 of the License, or * |
| 14 | * (at your option) any later version. * |
| 15 | * * |
| 16 | ***************************************************************************/ |
| 17 | |
| 18 | #include "eventstream.h"cxx . . $ `<file>/src/eventstream.h`/ |
| 19 | |
| 20 | EventStreamcxx . . $ EventStream#::EventStreamcxx . . $ EventStream#EventStream(49f6e7a06ebc5aa8).():Objectcxx . . $ Object#(){ |
| 21 | ulcxx . . $ EventStream#ul.=dlcxx . . $ EventStream#dl.=0; |
| 22 | npairscxx . . $ EventStream#npairs.=0; |
| 23 | } |
| 24 | |
| 25 | EventStreamcxx . . $ EventStream#::~cxx . . $ EventStream#`~EventStream`(ced63f7c635d850d).EventStreamcxx . . $ EventStream#(){} |
| 26 | |
| 27 | bool EventStreamcxx . . $ EventStream#::putcxx . . $ EventStream#put(c639a5ad6be24f82).(SDLKeycxx . . $ SDLKey# e){ |
| 28 | int i; |
| 29 | for (i=0;i<npairscxx . . $ EventStream#npairs.;i++){ |
| 30 | if (emtcxx . . $ EventStream#emt.[i].sdlKeySymcxx . . $ EventStream#EMT#sdlKeySym.==e){ |
| 31 | eventscxx . . $ EventStream#events.[ulcxx . . $ EventStream#ul.]=emtcxx . . $ EventStream#emt.[i].eventcxx . . $ EventStream#EMT#event.; |
| 32 | ulcxx . . $ EventStream#ul.=(ulcxx . . $ EventStream#ul. + 1) % MaxEventscxx . . $ EventStream#MaxEvents.; |
| 33 | return true; |
| 34 | } |
| 35 | } |
| 36 | return false; |
| 37 | } |
| 38 | |
| 39 | Eventcxx . . $ Event# EventStreamcxx . . $ EventStream#::getcxx . . $ EventStream#get(4e10c84e55f65b96).(){ |
| 40 | if (dlcxx . . $ EventStream#dl.!=ulcxx . . $ EventStream#ul.){ |
| 41 | int i=dlcxx . . $ EventStream#dl.; |
| 42 | dlcxx . . $ EventStream#dl.=(dlcxx . . $ EventStream#dl. + 1) % MaxEventscxx . . $ EventStream#MaxEvents.; |
| 43 | return eventscxx . . $ EventStream#events.[i]; |
| 44 | } |
| 45 | return NONEcxx . . $ NONE.; |
| 46 | } |
| 47 | |
| 48 | void EventStreamcxx . . $ EventStream#::clearcxx . . $ EventStream#clear(49f6e7a06ebc5aa8).(){ |
| 49 | ulcxx . . $ EventStream#ul.=dlcxx . . $ EventStream#dl.; |
| 50 | } |
| 51 |