2016-02-24 05:16:08 +00:00
|
|
|
/*
|
2018-05-10 08:12:47 +00:00
|
|
|
* Buffer seek descriptor constructors.
|
2016-02-24 05:16:08 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
// TOP
|
|
|
|
|
|
|
|
static Buffer_Seek
|
2019-06-20 23:43:27 +00:00
|
|
|
seek_pos(i64 pos){
|
2016-02-24 05:16:08 +00:00
|
|
|
Buffer_Seek result;
|
|
|
|
result.type = buffer_seek_pos;
|
|
|
|
result.pos = pos;
|
2016-09-24 06:17:06 +00:00
|
|
|
return(result);
|
|
|
|
}
|
|
|
|
|
|
|
|
static Buffer_Seek
|
2019-06-20 23:43:27 +00:00
|
|
|
seek_character_pos(i64 pos){
|
2016-09-24 06:17:06 +00:00
|
|
|
Buffer_Seek result;
|
|
|
|
result.type = buffer_seek_character_pos;
|
|
|
|
result.pos = pos;
|
2016-02-24 05:16:08 +00:00
|
|
|
return(result);
|
|
|
|
}
|
|
|
|
|
|
|
|
static Buffer_Seek
|
2019-02-26 23:08:42 +00:00
|
|
|
seek_wrapped_xy(f32 x, f32 y, b32 round_down){
|
2016-02-24 05:16:08 +00:00
|
|
|
Buffer_Seek result;
|
|
|
|
result.type = buffer_seek_wrapped_xy;
|
|
|
|
result.x = x;
|
|
|
|
result.y = y;
|
|
|
|
result.round_down = round_down;
|
|
|
|
return(result);
|
|
|
|
}
|
|
|
|
|
|
|
|
static Buffer_Seek
|
2019-02-26 23:08:42 +00:00
|
|
|
seek_unwrapped_xy(f32 x, f32 y, b32 round_down){
|
2016-02-24 05:16:08 +00:00
|
|
|
Buffer_Seek result;
|
|
|
|
result.type = buffer_seek_unwrapped_xy;
|
|
|
|
result.x = x;
|
|
|
|
result.y = y;
|
|
|
|
result.round_down = round_down;
|
|
|
|
return(result);
|
|
|
|
}
|
|
|
|
|
2016-02-25 00:04:08 +00:00
|
|
|
static Buffer_Seek
|
2019-02-26 23:08:42 +00:00
|
|
|
seek_xy(f32 x, f32 y, b32 round_down, b32 unwrapped){
|
2016-02-25 00:04:08 +00:00
|
|
|
Buffer_Seek result;
|
2016-02-25 12:12:09 +00:00
|
|
|
result.type = unwrapped?buffer_seek_unwrapped_xy:buffer_seek_wrapped_xy;
|
|
|
|
result.x = x;
|
|
|
|
result.y = y;
|
|
|
|
result.round_down = round_down;
|
2016-02-25 00:04:08 +00:00
|
|
|
return(result);
|
|
|
|
}
|
|
|
|
|
2016-02-24 05:16:08 +00:00
|
|
|
static Buffer_Seek
|
2019-06-20 23:43:27 +00:00
|
|
|
seek_line_char(i64 line, i64 character){
|
2016-02-24 05:16:08 +00:00
|
|
|
Buffer_Seek result;
|
|
|
|
result.type = buffer_seek_line_char;
|
|
|
|
result.line = line;
|
|
|
|
result.character = character;
|
|
|
|
return(result);
|
|
|
|
}
|
|
|
|
|
|
|
|
// BOTTOM
|
|
|
|
|