mirror of
https://github.com/LostArtefacts/TRX.git
synced 2025-04-28 20:58:07 +03:00
parent
962a66a090
commit
9667be9f0e
9 changed files with 35 additions and 8 deletions
|
@ -10,6 +10,7 @@ extern const GAME_OBJECT_ID g_PickupObjects[];
|
||||||
extern const GAME_OBJECT_ID g_AnimObjects[];
|
extern const GAME_OBJECT_ID g_AnimObjects[];
|
||||||
extern const GAME_OBJECT_ID g_NullObjects[];
|
extern const GAME_OBJECT_ID g_NullObjects[];
|
||||||
extern const GAME_OBJECT_ID g_InvObjects[];
|
extern const GAME_OBJECT_ID g_InvObjects[];
|
||||||
|
extern const GAME_OBJECT_ID g_WaterSpriteObjects[];
|
||||||
|
|
||||||
extern const GAME_OBJECT_PAIR g_ItemToInvObjectMap[];
|
extern const GAME_OBJECT_PAIR g_ItemToInvObjectMap[];
|
||||||
extern const GAME_OBJECT_PAIR g_KeyItemToReceptacleMap[];
|
extern const GAME_OBJECT_PAIR g_KeyItemToReceptacleMap[];
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#include "game/effects.h"
|
#include "game/effects.h"
|
||||||
|
|
||||||
|
#include "game/objects/vars.h"
|
||||||
#include "game/output.h"
|
#include "game/output.h"
|
||||||
#include "game/room.h"
|
#include "game/room.h"
|
||||||
#include "global/const.h"
|
#include "global/const.h"
|
||||||
|
@ -144,10 +145,14 @@ void Effect_Draw(const int16_t effect_num)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (obj->mesh_count < 0) {
|
if (obj->mesh_count < 0) {
|
||||||
|
const RGB_F tint =
|
||||||
|
Object_IsType(effect->object_id, g_WaterSpriteObjects)
|
||||||
|
? (RGB_F) { 1.0f, 1.0f, 1.0f }
|
||||||
|
: Output_GetTint();
|
||||||
Output_DrawSprite(
|
Output_DrawSprite(
|
||||||
effect->interp.result.pos.x, effect->interp.result.pos.y,
|
effect->interp.result.pos.x, effect->interp.result.pos.y,
|
||||||
effect->interp.result.pos.z, obj->mesh_idx - effect->frame_num,
|
effect->interp.result.pos.z, obj->mesh_idx - effect->frame_num,
|
||||||
SHADE_NEUTRAL);
|
SHADE_NEUTRAL, tint);
|
||||||
} else {
|
} else {
|
||||||
Matrix_Push();
|
Matrix_Push();
|
||||||
Matrix_TranslateAbs32(effect->interp.result.pos);
|
Matrix_TranslateAbs32(effect->interp.result.pos);
|
||||||
|
|
|
@ -73,11 +73,12 @@ void Object_DrawDummyItem(const ITEM *const item)
|
||||||
|
|
||||||
void Object_DrawSpriteItem(const ITEM *const item)
|
void Object_DrawSpriteItem(const ITEM *const item)
|
||||||
{
|
{
|
||||||
|
const RGB_F tint = Output_GetTint();
|
||||||
Output_DrawSprite(
|
Output_DrawSprite(
|
||||||
item->interp.result.pos.x, item->interp.result.pos.y,
|
item->interp.result.pos.x, item->interp.result.pos.y,
|
||||||
item->interp.result.pos.z,
|
item->interp.result.pos.z,
|
||||||
Object_Get(item->object_id)->mesh_idx - item->frame_num,
|
Object_Get(item->object_id)->mesh_idx - item->frame_num,
|
||||||
item->shade.value_1 < 0 ? SHADE_NEUTRAL : item->shade.value_1);
|
item->shade.value_1 < 0 ? SHADE_NEUTRAL : item->shade.value_1, tint);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Object_DrawPickupItem(const ITEM *const item)
|
void Object_DrawPickupItem(const ITEM *const item)
|
||||||
|
|
|
@ -216,6 +216,17 @@ const GAME_OBJECT_ID g_InvObjects[] = {
|
||||||
// clang-format on
|
// clang-format on
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const GAME_OBJECT_ID g_WaterSpriteObjects[] = {
|
||||||
|
// clang-format off
|
||||||
|
O_WATERFALL,
|
||||||
|
O_SPLASH_1,
|
||||||
|
O_SPLASH_2,
|
||||||
|
O_BUBBLES_1,
|
||||||
|
O_BUBBLES_2,
|
||||||
|
NO_OBJECT,
|
||||||
|
// clang-format on
|
||||||
|
};
|
||||||
|
|
||||||
const GAME_OBJECT_PAIR g_GunAmmoObjectMap[] = {
|
const GAME_OBJECT_PAIR g_GunAmmoObjectMap[] = {
|
||||||
// clang-format off
|
// clang-format off
|
||||||
{ O_PISTOL_ITEM, O_PISTOL_AMMO_ITEM },
|
{ O_PISTOL_ITEM, O_PISTOL_AMMO_ITEM },
|
||||||
|
|
|
@ -56,7 +56,7 @@ void Output_DrawCentreGradientScreenBox(
|
||||||
void Output_DrawScreenFBox(int32_t sx, int32_t sy, int32_t w, int32_t h);
|
void Output_DrawScreenFBox(int32_t sx, int32_t sy, int32_t w, int32_t h);
|
||||||
|
|
||||||
void Output_DrawSprite(
|
void Output_DrawSprite(
|
||||||
int32_t x, int32_t y, int32_t z, int16_t sprnum, int16_t shade);
|
int32_t x, int32_t y, int32_t z, int16_t sprnum, int16_t shade, RGB_F tint);
|
||||||
void Output_DrawScreenSprite(
|
void Output_DrawScreenSprite(
|
||||||
int32_t sx, int32_t sy, int32_t z, int32_t scale_h, int32_t scale_v,
|
int32_t sx, int32_t sy, int32_t z, int32_t scale_h, int32_t scale_v,
|
||||||
int32_t sprnum, int16_t shade, uint16_t flags, int32_t page);
|
int32_t sprnum, int16_t shade, uint16_t flags, int32_t page);
|
||||||
|
|
|
@ -292,11 +292,11 @@ void Output_DrawShadow(
|
||||||
|
|
||||||
void Output_DrawSprite(
|
void Output_DrawSprite(
|
||||||
const int32_t x, const int32_t y, const int32_t z, const int16_t sprite_idx,
|
const int32_t x, const int32_t y, const int32_t z, const int16_t sprite_idx,
|
||||||
const int16_t shade)
|
const int16_t shade, const RGB_F tint)
|
||||||
{
|
{
|
||||||
Matrix_Push();
|
Matrix_Push();
|
||||||
Matrix_TranslateAbs(x, y, z);
|
Matrix_TranslateAbs(x, y, z);
|
||||||
Output_Sprites_RenderSingleSprite(
|
Output_Sprites_RenderSingleSprite(
|
||||||
g_MatrixPtr, (XYZ_32) { 0, 0, 0 }, sprite_idx, shade);
|
g_MatrixPtr, (XYZ_32) { 0, 0, 0 }, sprite_idx, shade, tint);
|
||||||
Matrix_Pop();
|
Matrix_Pop();
|
||||||
}
|
}
|
||||||
|
|
|
@ -414,13 +414,13 @@ void Output_Sprites_RenderRoomSprites(
|
||||||
|
|
||||||
void Output_Sprites_RenderSingleSprite(
|
void Output_Sprites_RenderSingleSprite(
|
||||||
const MATRIX *const matrix, const XYZ_32 pos, const int32_t sprite_idx,
|
const MATRIX *const matrix, const XYZ_32 pos, const int32_t sprite_idx,
|
||||||
const uint16_t shade)
|
const uint16_t shade, const RGB_F tint)
|
||||||
{
|
{
|
||||||
const M_DYNAMIC_SPRITE sprite = {
|
const M_DYNAMIC_SPRITE sprite = {
|
||||||
.matrix = *matrix,
|
.matrix = *matrix,
|
||||||
.pos = pos,
|
.pos = pos,
|
||||||
.sprite_idx = sprite_idx,
|
.sprite_idx = sprite_idx,
|
||||||
.tint = Output_GetTint(),
|
.tint = tint,
|
||||||
.shade = shade,
|
.shade = shade,
|
||||||
};
|
};
|
||||||
Vector_Add(m_Dynamic.source, &sprite);
|
Vector_Add(m_Dynamic.source, &sprite);
|
||||||
|
|
|
@ -15,5 +15,6 @@ void Output_Sprites_RenderBegin(void);
|
||||||
void Output_Sprites_RenderRoomSprites(
|
void Output_Sprites_RenderRoomSprites(
|
||||||
const MATRIX *matrix, RGB_F tint, const ROOM *room);
|
const MATRIX *matrix, RGB_F tint, const ROOM *room);
|
||||||
void Output_Sprites_RenderSingleSprite(
|
void Output_Sprites_RenderSingleSprite(
|
||||||
const MATRIX *matrix, XYZ_32 pos, int32_t sprite_idx, uint16_t shade);
|
const MATRIX *matrix, XYZ_32 pos, int32_t sprite_idx, uint16_t shade,
|
||||||
|
RGB_F tint);
|
||||||
bool Output_Sprites_Flush(void);
|
bool Output_Sprites_Flush(void);
|
||||||
|
|
|
@ -242,6 +242,14 @@ const GAME_OBJECT_ID g_InvObjects[] = {
|
||||||
// clang-format on
|
// clang-format on
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const GAME_OBJECT_ID g_WaterSpriteObjects[] = {
|
||||||
|
// clang-format off
|
||||||
|
O_WATERFALL,
|
||||||
|
O_SPLASH,
|
||||||
|
O_BUBBLE,
|
||||||
|
// clang-format on
|
||||||
|
};
|
||||||
|
|
||||||
const GAME_OBJECT_PAIR g_ItemToInvObjectMap[] = {
|
const GAME_OBJECT_PAIR g_ItemToInvObjectMap[] = {
|
||||||
// clang-format off
|
// clang-format off
|
||||||
{ O_COMPASS_ITEM, O_COMPASS_OPTION },
|
{ O_COMPASS_ITEM, O_COMPASS_OPTION },
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue