mirror of
https://github.com/nunuhara/xsystem4.git
synced 2026-09-30 19:08:12 +03:00
== Handles As a general pattern, these libraries have an interface based on integer handles allocated by Open() and released by Close(); in the AliceSoft's implementation, handles are pointers to internal objects. Note that: * 0 is used to represent an invalid handle, and * Small numbers cannot be handles. For example, Mamanyonyo has code that treats an integer as a CG number if it is less than 10000, and as a surface handle otherwise. In this patch, handles are generated using id_pool.h functions. In order to achieve the above, the interface is extended so that the minimum ID value can be specified (the `base` parameter of id_pool_init()). == Graphics System Surface objects (implemented in vmSurface.[ch]) plays a central role in Mamanyonyo's graphics system, and the sprite system (vmSprite.c) is implemented on top of it. vmSprite.c uses scene.h functions. == vmChrLoader and vmMapLoader Since Mamanyonyo's character data format is the same as Widenyo's, the ChrLoader code has been refactored and used from vmChrLoader.c. On the other hand, MapLoader and vmMapLoader do not share code because the map file format is different from Widenyo.
54 lines
2.3 KiB
C
54 lines
2.3 KiB
C
/* Copyright (C) 2024 kichikuou <KichikuouChrome@gmail.com>
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, see <http://gnu.org/licenses/>.
|
|
*/
|
|
|
|
#include <SDL.h>
|
|
|
|
#include "system4/string.h"
|
|
#include "system4/utfsjis.h"
|
|
|
|
#include "hll.h"
|
|
|
|
HLL_QUIET_UNIMPLEMENTED( , void, vmDialog, Init, void *imainsystem);
|
|
|
|
static int vmDialog_MsgBox(struct string *t_string, struct string *string, int type, possibly_unused int default_button)
|
|
{
|
|
uint32_t flags = (type == 4) ? SDL_MESSAGEBOX_ERROR : 0;
|
|
char *title = sjis2utf(t_string->text, 0);
|
|
char *message = sjis2utf(string->text, 0);
|
|
SDL_ShowSimpleMessageBox(flags, title, message, NULL);
|
|
free(message);
|
|
free(title);
|
|
return 1;
|
|
}
|
|
|
|
//int vmDialog_InputNum(struct string *pITString, int nMin, int nMax, int *pnNum);
|
|
//int vmDialog_InputString(struct string *pITString, int nLength, struct string **pIString);
|
|
//int vmDialog_SelectNum(struct string *pITString, int nMin, int nMax, int *pnNum);
|
|
//int vmDialog_SelectString(struct string *pITString, struct page **pIVMArray, int nNum, struct string **pIString);
|
|
//int vmDialog_InputOpenFile(struct string *pITString, struct string **pIPString, struct string **pIString, struct string *pIDString, struct string *pIFString);
|
|
//int vmDialog_InputSaveFile(struct string *pITString, struct string **pIPString, struct string **pIString, struct string *pIDString, struct string *pIFString);
|
|
|
|
HLL_LIBRARY(vmDialog,
|
|
HLL_EXPORT(Init, vmDialog_Init),
|
|
HLL_EXPORT(MsgBox, vmDialog_MsgBox),
|
|
HLL_TODO_EXPORT(InputNum, vmDialog_InputNum),
|
|
HLL_TODO_EXPORT(InputString, vmDialog_InputString),
|
|
HLL_TODO_EXPORT(SelectNum, vmDialog_SelectNum),
|
|
HLL_TODO_EXPORT(SelectString, vmDialog_SelectString),
|
|
HLL_TODO_EXPORT(InputOpenFile, vmDialog_InputOpenFile),
|
|
HLL_TODO_EXPORT(InputSaveFile, vmDialog_InputSaveFile)
|
|
);
|