summaryrefslogtreecommitdiff
path: root/strings.cpp
blob: 6caedd0cd4b7c5279e0d18ec5e3fd799047295a3 (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
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 void *
String_GenerateFromChar(memory *Memory, char *Char)
{
    void *Address = AllocateMemory(Memory, STRING_SIZE, F_Strings);
    uint16 i = 0;
    while (Char[i] != '\0') {
        *((char *)Address + i) = Char[i];
        i++;
    }
    return Address;
}