mirror of
https://gitlab.os-k.eu/os-k-team/kvisc.git
synced 2023-08-25 14:05:46 +02:00
checks
This commit is contained in:
parent
054ce35bd0
commit
d882e0362a
4
ka/ABI
4
ka/ABI
@ -109,8 +109,8 @@ To the variadic function, argN can be accessed the following way:
|
|||||||
mov reg, [rbp + N*8 + 16]
|
mov reg, [rbp + N*8 + 16]
|
||||||
|
|
||||||
For instance:
|
For instance:
|
||||||
mov rax, [rbp + 16] ; arg1
|
mov rax, [rbp + 16] ; arg0
|
||||||
mov rdx, [rbp + 24] ; arg2
|
mov rdx, [rbp + 24] ; arg1
|
||||||
|
|
||||||
It is recommended to use the reg+reg*imm16+imm16 memory format:
|
It is recommended to use the reg+reg*imm16+imm16 memory format:
|
||||||
mov rax, [rbp + rcx * 8 + 16] ; accesses arg#rcx
|
mov rax, [rbp + rcx * 8 + 16] ; accesses arg#rcx
|
||||||
|
@ -114,6 +114,12 @@ void console_putat(ctx_t *ctx, char ch, int x, int y)
|
|||||||
|
|
||||||
surf = TTF_RenderText_Solid(scr_font, scr_lines[y], scr_text_color);
|
surf = TTF_RenderText_Solid(scr_font, scr_lines[y], scr_text_color);
|
||||||
|
|
||||||
|
if (!surf)
|
||||||
|
{
|
||||||
|
logerr("console_putat: couldn't render TTF font\n");
|
||||||
|
die(-1);
|
||||||
|
}
|
||||||
|
|
||||||
if (scr_texts[y])
|
if (scr_texts[y])
|
||||||
{
|
{
|
||||||
if (scr_rects[y])
|
if (scr_rects[y])
|
||||||
@ -128,10 +134,18 @@ void console_putat(ctx_t *ctx, char ch, int x, int y)
|
|||||||
scr_texts[y] = SDL_CreateTextureFromSurface(scr_rend, surf);
|
scr_texts[y] = SDL_CreateTextureFromSurface(scr_rend, surf);
|
||||||
scr_rects[y] = malloc(sizeof(SDL_Rect));
|
scr_rects[y] = malloc(sizeof(SDL_Rect));
|
||||||
|
|
||||||
|
if (scr_texts[y] == NULL)
|
||||||
|
{
|
||||||
|
logerr("console_putat: couldn't create texture from surface\n");
|
||||||
|
SDL_FreeSurface(surf);
|
||||||
|
die(-1);
|
||||||
|
}
|
||||||
|
|
||||||
if (scr_rects[y] == NULL)
|
if (scr_rects[y] == NULL)
|
||||||
{
|
{
|
||||||
logerr("console_putat: not enough memory\n");
|
logerr("console_putat: not enough memory\n");
|
||||||
SDL_FreeSurface(surf);
|
SDL_FreeSurface(surf);
|
||||||
|
SDL_DestroyTexture(scr_texts[y]);
|
||||||
die(-1);
|
die(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user