Start replays
This commit is contained in:
parent
c259e35348
commit
a0ab837aec
3 changed files with 31 additions and 1 deletions
25
racing.h
25
racing.h
|
@ -1,5 +1,22 @@
|
|||
/**
|
||||
racing module: implements the racing physics and logic.
|
||||
Racing module: implements the racing physics and logic as well as replays and
|
||||
other related things.
|
||||
|
||||
Some comments:
|
||||
- Replays are internally stored as follows: the replay consists of 16 bit
|
||||
words representing changes in input at specific frame. In lowest 4 bits the
|
||||
new input state is recorded, the remaining 12 bits record physics frame
|
||||
offset against the previous input change. If the 12 bits don't suffice
|
||||
because the offset is too big (input didn't change for more than 2^12
|
||||
frames), there must simply be inserted an extra word that just copies the
|
||||
current input state.
|
||||
- Replay text format: first there is hexadeciaml hash of the map (exactly 8
|
||||
characters), then the name of the map follows immediately, then the
|
||||
character ';', then the replay data, i.e. the sries of 16 bit words in
|
||||
hexadecimal. The blocks (but nothing else) may be preceeded or followed by
|
||||
blank characters. All hexadecimal letters must be lowercase. The word
|
||||
00000000 may optinally be used to terminate the replay, the rest of the
|
||||
string will be ignored.
|
||||
*/
|
||||
|
||||
#ifndef _LCR_RACING_H
|
||||
|
@ -86,6 +103,12 @@ struct
|
|||
uint8_t carNotOKCount;
|
||||
} LCR_racing;
|
||||
|
||||
struct
|
||||
{
|
||||
uint16_t eventCount;
|
||||
uint16_t events[LCR_SETTING_REPLAY_MAX_SIZE];
|
||||
} LCR_currentReplay;
|
||||
|
||||
/**
|
||||
Gets times of the run in milliseconds.
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue