mirror of
https://github.com/nunuhara/xsystem4.git
synced 2026-09-22 23:18:01 +03:00
parts: Implement PartsFunc 112 (GetText)
This commit is contained in:
@@ -254,6 +254,7 @@ void PE_PauseMotion(bool pause);
|
||||
|
||||
// text.c
|
||||
bool PE_SetText(int parts_no, struct string *text, int state);
|
||||
struct string *PE_GetText(int parts_no, int state);
|
||||
bool PE_AddPartsText(int parts_no, struct string *text, int state);
|
||||
bool PE_SetPartsTextSurfaceArea(int parts_no, int x, int y, int w, int h, int state);
|
||||
bool PE_SetFont(int parts_no, int type, int size, int r, int g, int b, float bold_weight, int edge_r, int edge_g, int edge_b, float edge_weight, int state);
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include <assert.h>
|
||||
|
||||
#include "system4/ain.h"
|
||||
#include "system4/string.h"
|
||||
|
||||
#include "vm/heap.h"
|
||||
#include "vm/page.h"
|
||||
@@ -338,6 +339,16 @@ static int PartsEngine_PartsFunc(int func_id, struct page **array_int,
|
||||
REQUIRE_INTS(6);
|
||||
PE_GetPartsCGSurfaceArea(ints[0].i, &ints[1].i, &ints[2].i, &ints[3].i, &ints[4].i, ints[5].i);
|
||||
return 1;
|
||||
case 112: { // string GetText(int parts_no, int state)
|
||||
REQUIRE_INTS(2);
|
||||
REQUIRE_STRINGS(1);
|
||||
struct string *text = PE_GetText(ints[0].i, ints[1].i);
|
||||
if (text) {
|
||||
heap_string_assign(strings[0].i, text);
|
||||
free_string(text);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
case 162: // AddConstructProcess(ArrayInt[32], ArrayFloat[2], ArrayString[2])
|
||||
REQUIRE_INTS(32);
|
||||
REQUIRE_FLOATS(2);
|
||||
|
||||
@@ -169,6 +169,14 @@ bool PE_SetText(int parts_no, struct string *text, int state)
|
||||
return true;
|
||||
}
|
||||
|
||||
struct string *PE_GetText(int parts_no, int state)
|
||||
{
|
||||
if (!parts_state_valid(--state))
|
||||
return NULL;
|
||||
|
||||
return parts_text_get(parts_get_text(parts_get(parts_no), state));
|
||||
}
|
||||
|
||||
bool PE_AddPartsText(int parts_no, struct string *text, int state)
|
||||
{
|
||||
if (!parts_state_valid(--state))
|
||||
|
||||
Reference in New Issue
Block a user