summaryrefslogtreecommitdiff
path: root/strings.cpp
blob: 08425760edb325e97736041766cda5b8b998c5e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
static bool32 Hacko = false;
static int32 EffectSel = -1;

// I'm using the filter's grep functionality to sort the effects for us
// (probably severely suboptimal), so I'm just using this callback function to
// signal back to our code that tab has been pressed in the text edit.
static int
EffectConsoleCallback(ImGuiInputTextCallbackData* data)
{
    if (data->EventFlag == ImGuiInputTextFlags_CallbackCompletion)
    {
        Hacko = true;
    }
    return 0;
}

static void
CopyStrings(void *Dest, void *Data)
{
    for (int i = 0; i < STRING_SIZE; i++)
    {
        *((char *)Dest + i) = *((char *)Data + i);
    }
}

static uint16
String_AddToFile(memory *Memory, char *Char)
{
    uint16 FileIndex = Memory_Block_AllocateNew(Memory, F_Strings);
    block_string *String = (block_string *)Memory_Block_AddressAtIndex(Memory, F_Strings, FileIndex, 0);
    History_Action_Block_Swap(Memory, F_Strings, String);
    String->Occupied = 1;
    uint16 i = 0;
    while (Char[i] != '\0') {
        String->Char[i] = Char[i];
        i++;
    }
    return FileIndex;
}