consumption tracking completed
parent
62aa4dac04
commit
b41bdc9995
|
@ -157,15 +157,15 @@ FSTRING_LINK fstr_bool copy_checked(String *dest, String src);
|
|||
FSTRING_LINK fstr_bool copy_partial(String *dest, char *src);
|
||||
FSTRING_LINK fstr_bool copy_partial(String *dest, String src);
|
||||
|
||||
FSTRING_INLINE int32_t copy(char *dest, char *src) { return copy_fast_unsafe(dest, src); }
|
||||
FSTRING_INLINE void copy(String *dest, String src) { copy_checked(dest, src); }
|
||||
FSTRING_INLINE void copy(String *dest, char *src) { copy_partial(dest, src); }
|
||||
FSTRING_INLINE int32_t copy(char *dest, char *src) { return copy_fast_unsafe(dest, src); }
|
||||
FSTRING_INLINE void copy(String *dest, String src) { copy_checked(dest, src); }
|
||||
FSTRING_INLINE void copy(String *dest, char *src) { copy_partial(dest, src); }
|
||||
|
||||
FSTRING_LINK fstr_bool append_checked(String *dest, String src);
|
||||
FSTRING_LINK fstr_bool append_partial(String *dest, char *src);
|
||||
FSTRING_LINK fstr_bool append_partial(String *dest, String src);
|
||||
FSTRING_LINK fstr_bool append_checked(String *dest, String src);
|
||||
FSTRING_LINK fstr_bool append_partial(String *dest, char *src);
|
||||
FSTRING_LINK fstr_bool append_partial(String *dest, String src);
|
||||
|
||||
FSTRING_LINK fstr_bool append(String *dest, char c);
|
||||
FSTRING_LINK fstr_bool append(String *dest, char c);
|
||||
FSTRING_INLINE fstr_bool append(String *dest, String src) { return append_partial(dest, src); }
|
||||
FSTRING_INLINE fstr_bool append(String *dest, char *src) { return append_partial(dest, src); }
|
||||
FSTRING_INLINE fstr_bool terminate_with_null(String *str){
|
||||
|
|
26
4ed.cpp
26
4ed.cpp
|
@ -3235,6 +3235,9 @@ consume_input(Available_Input *available, i32 input_type, char *consumer){
|
|||
copy(&str, consumer);
|
||||
terminate_with_null(&str);
|
||||
}
|
||||
else{
|
||||
record->consumer[0] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
App_Step_Sig(app_step){
|
||||
|
@ -3882,8 +3885,29 @@ App_Step_Sig(app_step){
|
|||
// NOTE(allen): pass consumption data to debug
|
||||
#if FRED_INTERNAL
|
||||
{
|
||||
//Debug_Data *debug = &models->debug;
|
||||
Debug_Data *debug = &models->debug;
|
||||
i32 count = debug->this_frame_count;
|
||||
|
||||
Consumption_Record *record = &available_input.records[Input_Esc];
|
||||
|
||||
if (record->consumed && record->consumer[0] != 0){
|
||||
Debug_Input_Event *event = debug->input_events;
|
||||
for (i32 i = 0; i < count; ++i, ++event){
|
||||
if (event->key == key_esc){
|
||||
memcpy(event->consumer, record->consumer, sizeof(record->consumer));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
record = &available_input.records[Input_AnyKey];
|
||||
if (record->consumed){
|
||||
Debug_Input_Event *event = debug->input_events;
|
||||
for (i32 i = 0; i < count; ++i, ++event){
|
||||
if (event->consumer[0] == 0){
|
||||
memcpy(event->consumer, record->consumer, sizeof(record->consumer));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -4487,8 +4487,6 @@ step_file_view(System_Functions *system, View *view, View *active_view, Input_Su
|
|||
char space1[512];
|
||||
String string = make_fixed_width_string(space1);
|
||||
|
||||
String message = string_zero();
|
||||
|
||||
// Time Watcher
|
||||
{
|
||||
string.size = 0;
|
||||
|
@ -4501,7 +4499,6 @@ step_file_view(System_Functions *system, View *view, View *active_view, Input_Su
|
|||
}
|
||||
|
||||
// Incoming input
|
||||
// - keeping track of where something get's consumed!?
|
||||
// - convert mouse clicks into key coded events??!!
|
||||
{
|
||||
Debug_Data *debug = &view->persistent.models->debug;
|
||||
|
@ -4578,12 +4575,18 @@ step_file_view(System_Functions *system, View *view, View *active_view, Input_Su
|
|||
}
|
||||
}
|
||||
|
||||
message.size = 0;
|
||||
if (input_event->consumer[0] != 0){
|
||||
message = make_string_slowly(input_event->consumer);
|
||||
i32 next_pos = 40;
|
||||
i32 offset = next_pos - string.size;
|
||||
if (offset < 0) offset = 0;
|
||||
for (i32 r = 0; r < offset; ++r){
|
||||
append(&string, ' ');
|
||||
}
|
||||
|
||||
append(&string, input_event->consumer);
|
||||
}
|
||||
|
||||
gui_do_text_field(target, string, message);
|
||||
gui_do_text_field(target, string, empty_str);
|
||||
}
|
||||
}
|
||||
}break;
|
||||
|
|
Loading…
Reference in New Issue