mirror of
https://github.com/nunuhara/xsystem4.git
synced 2026-10-05 13:28:04 +03:00
Merge pull request #235 from kichikuou/rq
Small changes for Rance Quest
This commit is contained in:
@@ -60,6 +60,8 @@ struct sact_sprite {
|
||||
int no;
|
||||
// The CG number attached to the sprite.
|
||||
int cg_no;
|
||||
// The sprite is suspended. The exact meaning of this is unknown.
|
||||
bool suspended;
|
||||
// (optional) Draw plugin bound to this sprite.
|
||||
struct draw_plugin *plugin;
|
||||
};
|
||||
|
||||
@@ -438,6 +438,7 @@ enum mesh_flags {
|
||||
MESH_NO_EDGE = 1 << 6,
|
||||
MESH_NO_HEIGHT_DETECTION = 1 << 7,
|
||||
MESH_ALPHA = 1 << 8,
|
||||
MESH_HAS_LIGHT_UV = 1 << 9,
|
||||
};
|
||||
|
||||
struct pol_mesh {
|
||||
|
||||
@@ -218,6 +218,7 @@ static struct pol_mesh *parse_mesh(struct buffer *r, const struct pol *pol)
|
||||
|
||||
mesh->nr_light_uvs = buffer_read_int32(r);
|
||||
if (mesh->nr_light_uvs > 0) {
|
||||
mesh->flags |= MESH_HAS_LIGHT_UV;
|
||||
mesh->light_uvs = xcalloc(mesh->nr_light_uvs, sizeof(vec2));
|
||||
for (uint32_t i = 0; i < mesh->nr_light_uvs; i++) {
|
||||
mesh->light_uvs[i][0] = buffer_read_float(r);
|
||||
|
||||
+1
-1
@@ -401,7 +401,7 @@ static void render_model(struct RE_instance *inst, struct RE_renderer *r, enum d
|
||||
glUniform1i(r->diffuse_type, DIFFUSE_ENV_MAP);
|
||||
} else if (mesh->flags & MESH_NOLIGHTING) {
|
||||
glUniform1i(r->diffuse_type, DIFFUSE_EMISSIVE);
|
||||
} else if (material->light_map && inst->plugin->light_map_mode) {
|
||||
} else if (material->light_map && mesh->flags & MESH_HAS_LIGHT_UV && inst->plugin->light_map_mode) {
|
||||
glUniform1i(r->diffuse_type, DIFFUSE_LIGHT_MAP);
|
||||
glActiveTexture(GL_TEXTURE0 + LIGHT_TEXTURE_UNIT);
|
||||
glBindTexture(GL_TEXTURE_2D, material->light_map);
|
||||
|
||||
@@ -259,9 +259,28 @@ static bool ChipmunkSpriteEngine_SP_GetFontWidth(struct string *text, int *width
|
||||
//static int CG_GetFormat_by_index(int cg_no);
|
||||
//static int CG_GetFormat(struct string *cg_name);
|
||||
|
||||
HLL_WARN_UNIMPLEMENTED(false, bool, ChipmunkSpriteEngine, SP_Suspend, int sp_no);
|
||||
//static bool ChipmunkSpriteEngine_SP_Resume(int sp_no);
|
||||
//static bool ChipmunkSpriteEngine_SP_IsSuspend(int sp_no);
|
||||
static bool ChipmunkSpriteEngine_SP_Suspend(int sp_no)
|
||||
{
|
||||
struct sact_sprite *sp = sact_try_get_sprite(sp_no);
|
||||
if (!sp) return false;
|
||||
sp->suspended = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool ChipmunkSpriteEngine_SP_Resume(int sp_no)
|
||||
{
|
||||
struct sact_sprite *sp = sact_try_get_sprite(sp_no);
|
||||
if (!sp) return false;
|
||||
sp->suspended = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool ChipmunkSpriteEngine_SP_IsSuspend(int sp_no)
|
||||
{
|
||||
struct sact_sprite *sp = sact_try_get_sprite(sp_no);
|
||||
return sp && sp->suspended;
|
||||
}
|
||||
|
||||
//static bool ChipmunkSpriteEngine_Debug_GetVideoMemoryInfo(int *max_size, int *use_size, int *use_max_size);
|
||||
//static void ChipmunkSpriteEngine_CombineTexture(void);
|
||||
//static void ChipmunkSpriteEngine_ReleaseCombinedTexture(void);
|
||||
@@ -322,13 +341,6 @@ HLL_LIBRARY(ChipmunkSpriteEngine,
|
||||
HLL_EXPORT(SP_SetTextSpriteBoldWeight, StoatSpriteEngine_SP_SetTextSpriteBoldWeight),
|
||||
HLL_EXPORT(SP_SetTextSpriteEdgeWeight, StoatSpriteEngine_SP_SetTextSpriteEdgeWeight),
|
||||
HLL_EXPORT(SP_SetTextSpriteEdgeColor, StoatSpriteEngine_SP_SetTextSpriteEdgeColor),
|
||||
HLL_EXPORT(SP_SetTextSprite, StoatSpriteEngine_SP_SetTextSprite),
|
||||
HLL_EXPORT(SP_SetTextSpriteType, StoatSpriteEngine_SP_SetTextSpriteType),
|
||||
HLL_EXPORT(SP_SetTextSpriteSize, StoatSpriteEngine_SP_SetTextSpriteSize),
|
||||
HLL_EXPORT(SP_SetTextSpriteColor, StoatSpriteEngine_SP_SetTextSpriteColor),
|
||||
HLL_EXPORT(SP_SetTextSpriteBoldWeight, StoatSpriteEngine_SP_SetTextSpriteBoldWeight),
|
||||
HLL_EXPORT(SP_SetTextSpriteEdgeWeight, StoatSpriteEngine_SP_SetTextSpriteEdgeWeight),
|
||||
HLL_EXPORT(SP_SetTextSpriteEdgeColor, StoatSpriteEngine_SP_SetTextSpriteEdgeColor),
|
||||
HLL_TODO_EXPORT(SP_GetFontDescent, ChipmunkSpriteEngine_SP_GetFontDescent),
|
||||
HLL_EXPORT(SP_GetFontWidth, ChipmunkSpriteEngine_SP_GetFontWidth),
|
||||
HLL_EXPORT(SP_SetDashTextSprite, StoatSpriteEngine_SP_SetDashTextSprite),
|
||||
@@ -407,8 +419,8 @@ HLL_LIBRARY(ChipmunkSpriteEngine,
|
||||
HLL_TODO_EXPORT(Debug_GetFillRate, StoatSpriteEngine_Debug_GetFillRate),
|
||||
HLL_TODO_EXPORT(MUSIC_ReloadParam, StoatSpriteEngine_MUSIC_ReloadParam),
|
||||
HLL_EXPORT(SP_Suspend, ChipmunkSpriteEngine_SP_Suspend),
|
||||
HLL_TODO_EXPORT(SP_Resume, ChipmunkSpriteEngine_SP_Resume),
|
||||
HLL_TODO_EXPORT(SP_IsSuspend, ChipmunkSpriteEngine_SP_IsSuspend),
|
||||
HLL_EXPORT(SP_Resume, ChipmunkSpriteEngine_SP_Resume),
|
||||
HLL_EXPORT(SP_IsSuspend, ChipmunkSpriteEngine_SP_IsSuspend),
|
||||
HLL_TODO_EXPORT(Debug_GetVideoMemoryInfo, ChipmunkSpriteEngine_Debug_GetVideoMemoryInfo),
|
||||
HLL_TODO_EXPORT(CombineTexture, ChipmunkSpriteEngine_CombineTexture),
|
||||
HLL_TODO_EXPORT(ReleaseCombinedTexture, ChipmunkSpriteEngine_ReleaseCombinedTexture));
|
||||
|
||||
@@ -159,7 +159,7 @@ HLL_LIBRARY(GoatGUIEngine,
|
||||
HLL_EXPORT(AddMotionRotateY, GoatGUIEngine_AddMotionRotateY),
|
||||
HLL_EXPORT(AddMotionRotateZ, GoatGUIEngine_AddMotionRotateZ),
|
||||
HLL_EXPORT(AddMotionVibrationSize, PE_AddMotionVibrationSize),
|
||||
HLL_TODO_EXPORT(AddWholeMotionVibrationSize, PE_AddWholeMotionVibrationSize),
|
||||
HLL_EXPORT(AddWholeMotionVibrationSize, PE_AddWholeMotionVibrationSize),
|
||||
HLL_EXPORT(AddMotionSound, PE_AddMotionSound),
|
||||
HLL_EXPORT(BeginMotion, PE_BeginMotion),
|
||||
HLL_EXPORT(EndMotion, PE_EndMotion),
|
||||
|
||||
@@ -127,6 +127,8 @@ bool StoatSpriteEngine_SP_SetTextSprite(int sp_no, struct string *text)
|
||||
|
||||
void StoatSpriteEngine_SP_SetTextSpriteType(int type)
|
||||
{
|
||||
if (text_sprite_ts.face != type)
|
||||
text_sprite_ts.font_size = NULL;
|
||||
text_sprite_ts.face = type;
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
#include "system4/ain.h"
|
||||
#include "system4/string.h"
|
||||
#include "system4/utfsjis.h"
|
||||
|
||||
#include "cJSON.h"
|
||||
#include "input.h"
|
||||
@@ -257,7 +258,9 @@ static bool SystemService_GetMouseCursorConfig(int type, int *value)
|
||||
|
||||
void SystemService_GetGameFolderPath(struct string **folder_path)
|
||||
{
|
||||
*folder_path = make_string(config.game_dir, strlen(config.game_dir));
|
||||
char *sjis = utf2sjis(config.game_dir, 0);
|
||||
*folder_path = make_string(sjis, strlen(sjis));
|
||||
free(sjis);
|
||||
}
|
||||
|
||||
static void SystemService_GetTime(int *hour, int *min, int *sec)
|
||||
|
||||
Reference in New Issue
Block a user