project_files/frontlib/demo.h
changeset 7177 bf6cf4dd847a
parent 7175 038e3415100a
child 7179 f84805e6df03
equal deleted inserted replaced
7175:038e3415100a 7177:bf6cf4dd847a
     1 /**
       
     2  * Demo recording functions. Only used by the ipc game code.
       
     3  */
       
     4 
       
     5 #ifndef DEMO_H_
       
     6 #define DEMO_H_
       
     7 
       
     8 #include "buffer.h"
       
     9 
       
    10 /**
       
    11  * Record a message sent from the engine to the frontend.
       
    12  * Returns 0 for OK, a negative value on error.
       
    13  * Don't pass NULL.
       
    14  */
       
    15 int flib_demo_record_from_engine(flib_vector demoBuffer, const uint8_t *message, const char *playerName);
       
    16 
       
    17 /**
       
    18  * Record a message sent from the frontend to the engine.
       
    19  * Returns 0 for OK, a negative value on error.
       
    20  * Don't pass NULL.
       
    21  */
       
    22 int flib_demo_record_to_engine(flib_vector demoBuffer, const uint8_t *message, size_t len);
       
    23 
       
    24 /**
       
    25  * Replace game mode messages ("TL", "TD", "TS", "TN") in the recording to mirror
       
    26  * the intended use. Pass 'S' for savegames, 'D' for demos.
       
    27  */
       
    28 void flib_demo_replace_gamemode(flib_buffer buf, char gamemode);
       
    29 
       
    30 #endif /* DEMO_H_ */