mirror of
https://github.com/LostArtefacts/TRX.git
synced 2025-04-28 20:58:07 +03:00
output: tidy shade constants
This commit is contained in:
parent
cd67279fc7
commit
962a66a090
24 changed files with 76 additions and 73 deletions
|
@ -1,6 +1,6 @@
|
|||
#define WALL_L 1024
|
||||
#define NEUTRAL_SHADE 0x1000
|
||||
#define MAX_SHADE 0x1FFF
|
||||
#define SHADE_NEUTRAL 0x1000
|
||||
#define SHADE_MAX 0x1FFF
|
||||
|
||||
#define VERT_NO_CAUSTICS 0x01
|
||||
#define VERT_FLAT_SHADED 0x02
|
||||
|
@ -35,15 +35,15 @@ float shadeFog(float shade, float depth, vec2 fog)
|
|||
if (depth < fogBegin) {
|
||||
return shade + 0.0;
|
||||
} else if (depth >= fogEnd) {
|
||||
return shade + float(MAX_SHADE);
|
||||
return shade + float(SHADE_MAX);
|
||||
} else {
|
||||
return shade + (depth - fogBegin) * MAX_SHADE / (fogEnd - fogBegin);
|
||||
return shade + (depth - fogBegin) * SHADE_MAX / (fogEnd - fogBegin);
|
||||
}
|
||||
}
|
||||
|
||||
vec3 applyShade(vec3 color, float shade)
|
||||
{
|
||||
return color * (2.0 - (shade / NEUTRAL_SHADE));
|
||||
return color * (2.0 - (shade / SHADE_NEUTRAL));
|
||||
}
|
||||
|
||||
bool discardTranslucent(sampler2D tex, vec2 uv)
|
||||
|
|
|
@ -52,7 +52,7 @@ static void M_CalculateBrightestLight(
|
|||
}
|
||||
#endif
|
||||
|
||||
const int32_t ambient = TR_VERSION == 1 ? (0x1FFF - room->ambient) : 0;
|
||||
const int32_t ambient = TR_VERSION == 1 ? (SHADE_MAX - room->ambient) : 0;
|
||||
for (int32_t i = 0; i < room->num_lights; i++) {
|
||||
const LIGHT *const light = &room->lights[i];
|
||||
const int32_t dx = pos.x - light->pos.x;
|
||||
|
@ -112,7 +112,7 @@ void Output_CalculateLight(const XYZ_32 pos, const int16_t room_num)
|
|||
|
||||
adder = (adder + dynamic_adder) / 2;
|
||||
if (TR_VERSION == 1 && (room->num_lights > 0 || dynamic_adder > 0)) {
|
||||
adder += (0x1FFF - room->ambient) / 2;
|
||||
adder += (SHADE_MAX - room->ambient) / 2;
|
||||
}
|
||||
|
||||
// TODO: use m_LsAdder and m_LsDivider once ported
|
||||
|
@ -123,7 +123,7 @@ void Output_CalculateLight(const XYZ_32 pos, const int16_t room_num)
|
|||
global_divider = 0;
|
||||
} else {
|
||||
#if TR_VERSION == 1
|
||||
global_adder = 0x1FFF - adder;
|
||||
global_adder = SHADE_MAX - adder;
|
||||
const int32_t divider = brightest_light.shade == adder
|
||||
? adder
|
||||
: brightest_light.shade - adder;
|
||||
|
@ -141,7 +141,7 @@ void Output_CalculateLight(const XYZ_32 pos, const int16_t room_num)
|
|||
|
||||
const int32_t depth = g_MatrixPtr->_23 >> W2V_SHIFT;
|
||||
global_adder += Output_CalcFogShade(depth);
|
||||
CLAMPG(global_adder, 0x1FFF);
|
||||
CLAMPG(global_adder, SHADE_MAX);
|
||||
|
||||
Output_SetLightAdder(global_adder);
|
||||
Output_SetLightDivider(global_divider);
|
||||
|
@ -150,10 +150,10 @@ void Output_CalculateLight(const XYZ_32 pos, const int16_t room_num)
|
|||
void Output_CalculateStaticLight(const int16_t adder)
|
||||
{
|
||||
// TODO: use m_LsAdder
|
||||
int32_t global_adder = adder - 0x1000;
|
||||
int32_t global_adder = adder - SHADE_NEUTRAL;
|
||||
const int32_t depth = g_MatrixPtr->_23 >> W2V_SHIFT;
|
||||
global_adder += Output_CalcFogShade(depth);
|
||||
CLAMPG(global_adder, 0x1FFF);
|
||||
CLAMPG(global_adder, SHADE_MAX);
|
||||
Output_SetLightAdder(global_adder);
|
||||
}
|
||||
|
||||
|
|
|
@ -6,4 +6,9 @@
|
|||
#define TEXTURE_PAGE_HEIGHT 256
|
||||
#define TEXTURE_PAGE_SIZE (TEXTURE_PAGE_WIDTH * TEXTURE_PAGE_HEIGHT)
|
||||
|
||||
#define SHADE_CAUSTICS 0x300
|
||||
#define SHADE_MAX 0x1FFF
|
||||
#define SHADE_LOW 0x1400
|
||||
#define SHADE_NEUTRAL 0x1000
|
||||
|
||||
#define WIBBLE_SIZE 32
|
||||
|
|
|
@ -147,7 +147,7 @@ void Effect_Draw(const int16_t effect_num)
|
|||
Output_DrawSprite(
|
||||
effect->interp.result.pos.x, effect->interp.result.pos.y,
|
||||
effect->interp.result.pos.z, obj->mesh_idx - effect->frame_num,
|
||||
4096);
|
||||
SHADE_NEUTRAL);
|
||||
} else {
|
||||
Matrix_Push();
|
||||
Matrix_TranslateAbs32(effect->interp.result.pos);
|
||||
|
|
|
@ -70,9 +70,9 @@ static void M_DrawItem(
|
|||
{
|
||||
if (ring->motion.status != RNG_FADING_OUT && ring->motion.status != RNG_DONE
|
||||
&& inv_item == ring->list[ring->current_object] && !ring->rotating) {
|
||||
Output_SetLightAdder(HIGH_LIGHT);
|
||||
Output_SetLightAdder(SHADE_NEUTRAL);
|
||||
} else {
|
||||
Output_SetLightAdder(LOW_LIGHT);
|
||||
Output_SetLightAdder(SHADE_LOW);
|
||||
}
|
||||
|
||||
Matrix_TranslateRel(0, inv_item->y_trans, inv_item->z_trans);
|
||||
|
|
|
@ -150,7 +150,7 @@ int16_t Item_Spawn(const ITEM *const item, const GAME_OBJECT_ID obj_id)
|
|||
spawn->rot = item->rot;
|
||||
Item_Initialise(spawn_num);
|
||||
spawn->status = IS_INACTIVE;
|
||||
spawn->shade.value_1 = HIGH_LIGHT;
|
||||
spawn->shade.value_1 = SHADE_NEUTRAL;
|
||||
}
|
||||
return spawn_num;
|
||||
}
|
||||
|
|
|
@ -77,7 +77,7 @@ void Object_DrawSpriteItem(const ITEM *const item)
|
|||
item->interp.result.pos.x, item->interp.result.pos.y,
|
||||
item->interp.result.pos.z,
|
||||
Object_Get(item->object_id)->mesh_idx - item->frame_num,
|
||||
item->shade.value_1 < 0 ? HIGH_LIGHT : item->shade.value_1);
|
||||
item->shade.value_1 < 0 ? SHADE_NEUTRAL : item->shade.value_1);
|
||||
}
|
||||
|
||||
void Object_DrawPickupItem(const ITEM *const item)
|
||||
|
|
|
@ -346,7 +346,7 @@ static void M_DrawSprite(
|
|||
|
||||
const float multiplier = g_Config.visuals.brightness / 16.0f;
|
||||
const SPRITE_TEXTURE *const sprite = Output_GetSpriteTexture(sprite_idx);
|
||||
float vshade = (MAX_LIGHTING - shade) * multiplier;
|
||||
float vshade = (SHADE_MAX - shade) * multiplier;
|
||||
CLAMPG(vshade, 255.0f);
|
||||
|
||||
const float u0 = (sprite->offset & 0xFF) / 256.0f;
|
||||
|
|
|
@ -210,12 +210,12 @@ static void M_UpdateShades(
|
|||
for (int32_t i = 0; i < batch->vertex_count; i++) {
|
||||
const int32_t j = light_idx_map[i];
|
||||
int16_t shade = ls_adder + mesh->lighting.lights[j];
|
||||
CLAMP(shade, 0, 0x1FFF);
|
||||
CLAMP(shade, 0, SHADE_MAX);
|
||||
out_shades[i] = shade;
|
||||
}
|
||||
} else if (ls_divider == 0) {
|
||||
int16_t shade = ls_adder;
|
||||
CLAMP(shade, 0, 0x1FFF);
|
||||
CLAMP(shade, 0, SHADE_MAX);
|
||||
for (int32_t i = 0; i < batch->vertex_count; i++) {
|
||||
out_shades[i] = shade;
|
||||
}
|
||||
|
@ -245,7 +245,7 @@ static void M_UpdateShades(
|
|||
const XYZ_16 *const normal = &mesh->lighting.normals[j];
|
||||
int16_t shade = ls_adder
|
||||
+ ((normal->x * xv + normal->y * yv + normal->z * zv) >> 16);
|
||||
CLAMP(shade, 0, 0x1FFF);
|
||||
CLAMP(shade, 0, SHADE_MAX);
|
||||
out_shades[i] = shade;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,9 +53,9 @@ static M_MESH_SHADE M_ShadeCaustics(M_MESH_SHADE source, uint8_t caustic)
|
|||
if (Output_GetWaterEffect()) {
|
||||
source +=
|
||||
m_ShadeTable[((uint8_t)Output_GetTime() + caustic) % WIBBLE_SIZE];
|
||||
CLAMP(source, 0, MAX_LIGHTING);
|
||||
CLAMP(source, 0, SHADE_MAX);
|
||||
} else {
|
||||
CLAMPG(source, MAX_LIGHTING);
|
||||
CLAMPG(source, SHADE_MAX);
|
||||
}
|
||||
return source;
|
||||
}
|
||||
|
@ -341,7 +341,7 @@ void Output_Meshes_InitRooms(void)
|
|||
m_Shader = Output_Meshes_GetShader();
|
||||
for (int32_t i = 0; i < WIBBLE_SIZE; i++) {
|
||||
const int16_t angle = (i * DEG_360) / WIBBLE_SIZE;
|
||||
m_ShadeTable[i] = Math_Sin(angle) * MAX_SHADE >> W2V_SHIFT;
|
||||
m_ShadeTable[i] = Math_Sin(angle) * SHADE_CAUSTICS >> W2V_SHIFT;
|
||||
m_CausticsTable[i] = (Random_GetDraw() >> 5) - 0x01FF;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -389,7 +389,7 @@ static void M_DrawPickup3D(DISPLAY_PICKUP *pu)
|
|||
Matrix_RotY(pu->rot_y);
|
||||
|
||||
Output_SetLightDivider(0x6000);
|
||||
Output_SetLightAdder(LOW_LIGHT);
|
||||
Output_SetLightAdder(SHADE_LOW);
|
||||
Output_RotateLight(0, 0);
|
||||
|
||||
const OBJECT *const obj = Object_Get(Inv_GetItemOption(pu->object_id));
|
||||
|
@ -501,7 +501,7 @@ static void M_DrawPickupsSprites(void)
|
|||
Viewport_GetHeight() - sprite_height - sprite_height * pu->grid_y;
|
||||
const int32_t scale = Screen_GetRenderScaleGLRage(12288);
|
||||
const int16_t sprite_num = Object_Get(pu->object_id)->mesh_idx;
|
||||
Output_DrawUISprite(x, y, scale, sprite_num, 4096);
|
||||
Output_DrawUISprite(x, y, scale, sprite_num, SHADE_NEUTRAL);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -131,7 +131,7 @@ int16_t Spawn_RocketGun(
|
|||
effect->object_id = O_MISSILE_3;
|
||||
effect->frame_num = 0;
|
||||
effect->speed = ROCKET_SPEED;
|
||||
effect->shade = HIGH_LIGHT;
|
||||
effect->shade = SHADE_NEUTRAL;
|
||||
M_ShootAtLara(effect);
|
||||
}
|
||||
return effect_num;
|
||||
|
@ -154,7 +154,7 @@ int16_t Spawn_GunShot(
|
|||
effect->counter = 3;
|
||||
effect->frame_num = 0;
|
||||
effect->object_id = O_GUN_FLASH;
|
||||
effect->shade = HIGH_LIGHT;
|
||||
effect->shade = SHADE_NEUTRAL;
|
||||
}
|
||||
return effect_num;
|
||||
}
|
||||
|
|
|
@ -69,8 +69,6 @@
|
|||
#define NO_BAD_NEG NO_HEIGHT
|
||||
#define BAD_JUMP_CEILING ((STEP_L * 3) / 4) // = 192
|
||||
#define MAX_WIBBLE 2
|
||||
#define MAX_SHADE 0x300
|
||||
#define MAX_LIGHTING 0x1FFF
|
||||
#define NO_VERT_MOVE 0x2000
|
||||
#define NO_BOX (-1)
|
||||
#define PASSPORT_FOV 65
|
||||
|
@ -89,8 +87,6 @@
|
|||
#define OPTION_RING_OBJECTS 4
|
||||
#define TITLE_RING_OBJECTS 5
|
||||
#define CAMERA_2_RING 598
|
||||
#define LOW_LIGHT 0x1400 // = 5120
|
||||
#define HIGH_LIGHT 0x1000 // = 4096
|
||||
|
||||
#if _MSC_VER > 0x500
|
||||
#define strdup _strdup // fixes error about POSIX function
|
||||
|
|
|
@ -112,7 +112,7 @@ int16_t Effect_Create(const int16_t room_num)
|
|||
effect->next_active = m_NextEffectActive;
|
||||
m_NextEffectActive = effect_num;
|
||||
|
||||
effect->shade = 0x1000;
|
||||
effect->shade = SHADE_NEUTRAL;
|
||||
|
||||
return effect_num;
|
||||
}
|
||||
|
|
|
@ -369,7 +369,7 @@ void Gun_DrawFlash(const LARA_GUN_TYPE weapon_type, const int32_t clip)
|
|||
|
||||
switch (weapon_type) {
|
||||
case LGT_MAGNUMS:
|
||||
shade = HIGH_LIGHT;
|
||||
shade = SHADE_NEUTRAL;
|
||||
y = 215;
|
||||
z = 65;
|
||||
break;
|
||||
|
@ -400,7 +400,7 @@ void Gun_DrawFlash(const LARA_GUN_TYPE weapon_type, const int32_t clip)
|
|||
return;
|
||||
|
||||
default:
|
||||
shade = LOW_LIGHT;
|
||||
shade = SHADE_LOW;
|
||||
y = 185;
|
||||
z = 40;
|
||||
break;
|
||||
|
|
|
@ -68,9 +68,9 @@ static void M_DrawItem(
|
|||
{
|
||||
if (ring->motion.status != RNG_FADING_OUT && ring->motion.status != RNG_DONE
|
||||
&& inv_item == ring->list[ring->current_object] && !ring->rotating) {
|
||||
Output_SetLightAdder(HIGH_LIGHT);
|
||||
Output_SetLightAdder(SHADE_NEUTRAL);
|
||||
} else {
|
||||
Output_SetLightAdder(LOW_LIGHT);
|
||||
Output_SetLightAdder(SHADE_LOW);
|
||||
}
|
||||
|
||||
Matrix_TranslateRel(0, inv_item->y_trans, inv_item->z_trans);
|
||||
|
|
|
@ -64,7 +64,7 @@ void Object_DrawSpriteItem(const ITEM *const item)
|
|||
{
|
||||
SHADE shade = item->shade;
|
||||
if (shade.value_1 < 0) {
|
||||
shade.value_1 = HIGH_LIGHT;
|
||||
shade.value_1 = SHADE_NEUTRAL;
|
||||
}
|
||||
Output_CalculateStaticMeshLight(
|
||||
item->interp.result.pos, shade, Room_Get(item->room_num));
|
||||
|
@ -76,7 +76,7 @@ void Object_DrawSpriteItem(const ITEM *const item)
|
|||
| SPRITE_SHADE,
|
||||
item->interp.result.pos.x, item->interp.result.pos.y,
|
||||
item->interp.result.pos.z, obj->mesh_idx - item->frame_num,
|
||||
Output_GetLightAdder() + 4096, 0);
|
||||
Output_GetLightAdder() + SHADE_NEUTRAL, 0);
|
||||
}
|
||||
|
||||
void Object_Collision(
|
||||
|
|
|
@ -62,7 +62,7 @@ static void M_Control(const int16_t effect_num)
|
|||
effect->frame_num = 0;
|
||||
effect->counter = 0;
|
||||
effect->object_id = O_EXPLOSION;
|
||||
effect->shade = HIGH_LIGHT;
|
||||
effect->shade = SHADE_NEUTRAL;
|
||||
Sound_Effect(SFX_EXPLOSION_1, &effect->pos, SPM_NORMAL);
|
||||
} else {
|
||||
Effect_Kill(effect_num);
|
||||
|
@ -78,7 +78,7 @@ static void M_Control(const int16_t effect_num)
|
|||
effect->frame_num = 0;
|
||||
effect->counter = 0;
|
||||
effect->object_id = O_EXPLOSION;
|
||||
effect->shade = HIGH_LIGHT;
|
||||
effect->shade = SHADE_NEUTRAL;
|
||||
Sound_Effect(SFX_EXPLOSION_1, &effect->pos, SPM_NORMAL);
|
||||
g_Lara.hit_effect_count = 5;
|
||||
g_Lara.hit_effect = effect;
|
||||
|
|
|
@ -209,7 +209,7 @@ static void M_CalcRoomVertices(const ROOM_MESH *const mesh, int32_t far_clip)
|
|||
// clip_flags |= (~((uint8_t)(vbuf->zv / 0x155555.p0))) << 8;
|
||||
}
|
||||
|
||||
CLAMP(shade, 0, 0x1FFF);
|
||||
CLAMP(shade, 0, SHADE_MAX);
|
||||
vbuf->g = shade;
|
||||
vbuf->clip = clip_flags;
|
||||
}
|
||||
|
@ -359,7 +359,7 @@ static void M_CalcVerticeLight(const OBJECT_MESH *const mesh)
|
|||
if (mesh->num_lights <= 0) {
|
||||
for (int32_t i = 0; i < -mesh->num_lights; i++) {
|
||||
int16_t shade = m_LsAdder + mesh->lighting.lights[i];
|
||||
CLAMP(shade, 0, 0x1FFF);
|
||||
CLAMP(shade, 0, SHADE_MAX);
|
||||
g_PhdVBuf[i].g = shade;
|
||||
}
|
||||
|
||||
|
@ -368,7 +368,7 @@ static void M_CalcVerticeLight(const OBJECT_MESH *const mesh)
|
|||
|
||||
if (m_LsDivider == 0) {
|
||||
int16_t shade = m_LsAdder;
|
||||
CLAMP(shade, 0, 0x1FFF);
|
||||
CLAMP(shade, 0, SHADE_MAX);
|
||||
for (int32_t i = 0; i < mesh->num_lights; i++) {
|
||||
g_PhdVBuf[i].g = shade;
|
||||
}
|
||||
|
@ -401,7 +401,7 @@ static void M_CalcVerticeLight(const OBJECT_MESH *const mesh)
|
|||
const XYZ_16 *const normal = &mesh->lighting.normals[i];
|
||||
int16_t shade = m_LsAdder
|
||||
+ ((xv * normal->x + yv * normal->y + zv * normal->z) >> 16);
|
||||
CLAMP(shade, 0, 0x1FFF);
|
||||
CLAMP(shade, 0, SHADE_MAX);
|
||||
g_PhdVBuf[i].g = shade;
|
||||
}
|
||||
}
|
||||
|
@ -666,12 +666,12 @@ void Output_DrawSprite(
|
|||
const int32_t depth = zv >> W2V_SHIFT;
|
||||
if (depth > Output_GetFogStart()) {
|
||||
shade += depth - Output_GetFogStart();
|
||||
if (shade > 0x1FFF) {
|
||||
if (shade > SHADE_MAX) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
shade = 0x1000;
|
||||
shade = SHADE_NEUTRAL;
|
||||
}
|
||||
|
||||
Render_InsertSprite(zv, x0, y0, x1, y1, sprite_idx, shade);
|
||||
|
@ -899,7 +899,7 @@ void Output_CalculateWibbleTable(void)
|
|||
for (int32_t i = 0; i < WIBBLE_SIZE; i++) {
|
||||
const int32_t sine = Math_Sin(i * DEG_360 / WIBBLE_SIZE);
|
||||
m_WibbleTable[i] = (sine * MAX_WIBBLE) >> W2V_SHIFT;
|
||||
m_ShadesTable[i] = (sine * MAX_SHADE) >> W2V_SHIFT;
|
||||
m_ShadesTable[i] = (sine * SHADE_CAUSTICS) >> W2V_SHIFT;
|
||||
m_RandomTable[i] = (Random_GetDraw() >> 5) - 0x01FF;
|
||||
for (int32_t j = 0; j < WIBBLE_SIZE; j++) {
|
||||
m_RoomLightTables[i].table[j] = (j - (WIBBLE_SIZE / 2)) * i
|
||||
|
@ -1089,9 +1089,9 @@ int32_t Output_CalcFogShade(const int32_t depth)
|
|||
return 0;
|
||||
}
|
||||
if (depth >= fog_end) {
|
||||
return 0x1FFF;
|
||||
return SHADE_MAX;
|
||||
}
|
||||
return (depth - fog_start) * 0x1FFF / (fog_end - fog_start);
|
||||
return (depth - fog_start) * SHADE_MAX / (fog_end - fog_start);
|
||||
}
|
||||
|
||||
int32_t Output_GetRoomLightShade(const ROOM_LIGHT_MODE mode)
|
||||
|
@ -1127,21 +1127,25 @@ void Output_DrawTextOutline(
|
|||
const int32_t scale_v = TEXT_BASE_SCALE;
|
||||
|
||||
Output_DrawScreenSprite(
|
||||
x0, y0, z, scale_h, scale_v, mesh_idx + 0, 0x1000, 0);
|
||||
x0, y0, z, scale_h, scale_v, mesh_idx + 0, SHADE_NEUTRAL, 0);
|
||||
Output_DrawScreenSprite(
|
||||
x1, y0, z, scale_h, scale_v, mesh_idx + 1, 0x1000, 0);
|
||||
x1, y0, z, scale_h, scale_v, mesh_idx + 1, SHADE_NEUTRAL, 0);
|
||||
Output_DrawScreenSprite(
|
||||
x1, y1, z, scale_h, scale_v, mesh_idx + 2, 0x1000, 0);
|
||||
x1, y1, z, scale_h, scale_v, mesh_idx + 2, SHADE_NEUTRAL, 0);
|
||||
Output_DrawScreenSprite(
|
||||
x0, y1, z, scale_h, scale_v, mesh_idx + 3, 0x1000, 0);
|
||||
x0, y1, z, scale_h, scale_v, mesh_idx + 3, SHADE_NEUTRAL, 0);
|
||||
|
||||
int32_t w = (width - offset * 2) * TEXT_BASE_SCALE / 8;
|
||||
int32_t h = (height - offset * 2) * TEXT_BASE_SCALE / 8;
|
||||
|
||||
Output_DrawScreenSprite(x0, y0, z, w, scale_v, mesh_idx + 4, 0x1000, 0);
|
||||
Output_DrawScreenSprite(x1, y0, z, scale_h, h, mesh_idx + 5, 0x1000, 0);
|
||||
Output_DrawScreenSprite(x0, y1, z, w, scale_v, mesh_idx + 6, 0x1000, 0);
|
||||
Output_DrawScreenSprite(x0, y0, z, scale_h, h, mesh_idx + 7, 0x1000, 0);
|
||||
Output_DrawScreenSprite(
|
||||
x0, y0, z, w, scale_v, mesh_idx + 4, SHADE_NEUTRAL, 0);
|
||||
Output_DrawScreenSprite(
|
||||
x1, y0, z, scale_h, h, mesh_idx + 5, SHADE_NEUTRAL, 0);
|
||||
Output_DrawScreenSprite(
|
||||
x0, y1, z, w, scale_v, mesh_idx + 6, SHADE_NEUTRAL, 0);
|
||||
Output_DrawScreenSprite(
|
||||
x0, y0, z, scale_h, h, mesh_idx + 7, SHADE_NEUTRAL, 0);
|
||||
}
|
||||
|
||||
void Output_DrawTextBackground(
|
||||
|
|
|
@ -211,7 +211,8 @@ static void M_DrawAssaultTimer(void)
|
|||
glyph_info[glyph_type].offset, SCALER_TARGET_ASSAULT_DIGITS);
|
||||
Output_DrawScreenSprite(
|
||||
x, y, 0, scale_h, scale_v,
|
||||
Object_Get(O_ASSAULT_DIGITS)->mesh_idx + mesh_num, 0x1000, 0);
|
||||
Object_Get(O_ASSAULT_DIGITS)->mesh_idx + mesh_num, SHADE_NEUTRAL,
|
||||
0);
|
||||
x += Scaler_Calc(
|
||||
glyph_info[glyph_type].width, SCALER_TARGET_ASSAULT_DIGITS);
|
||||
}
|
||||
|
@ -456,7 +457,7 @@ static void M_DrawPickup3D(const DISPLAY_PICKUP *const pickup)
|
|||
Matrix_RotY(pickup->rot_y);
|
||||
|
||||
Output_SetLightDivider(0x6000);
|
||||
Output_SetLightAdder(LOW_LIGHT);
|
||||
Output_SetLightAdder(SHADE_LOW);
|
||||
Output_RotateLight(0, 0);
|
||||
|
||||
Matrix_Push();
|
||||
|
@ -504,7 +505,7 @@ static void M_DrawPickupSprite(const DISPLAY_PICKUP *const pickup)
|
|||
// TODO: use proper scaling
|
||||
const int32_t scale = 12288 * g_PhdWinWidth / 640;
|
||||
const int16_t sprite_num = pickup->object->mesh_idx;
|
||||
Output_DrawPickup(x, y, scale, sprite_num, 4096);
|
||||
Output_DrawPickup(x, y, scale, sprite_num, SHADE_NEUTRAL);
|
||||
}
|
||||
|
||||
static void M_DrawPickups(void)
|
||||
|
|
|
@ -147,22 +147,22 @@ static void M_ShadeLightColor(
|
|||
GFX_3D_VERTEX *const target, uint32_t shade, const bool is_textured,
|
||||
uint32_t red, uint32_t green, uint32_t blue, const uint8_t alpha)
|
||||
{
|
||||
CLAMPG(shade, 0x1FFF);
|
||||
CLAMPG(shade, SHADE_MAX);
|
||||
|
||||
if (g_Config.rendering.lighting_contrast == LIGHTING_CONTRAST_MEDIUM) {
|
||||
CLAMPL(shade, 0x800);
|
||||
}
|
||||
if (g_Config.rendering.lighting_contrast != LIGHTING_CONTRAST_LOW
|
||||
&& is_textured) {
|
||||
shade = 0x1000 + shade / 2;
|
||||
shade = SHADE_NEUTRAL + shade / 2;
|
||||
}
|
||||
if (g_Config.rendering.lighting_contrast == LIGHTING_CONTRAST_LOW
|
||||
&& !is_textured) {
|
||||
CLAMPL(shade, 0x1000);
|
||||
CLAMPL(shade, SHADE_NEUTRAL);
|
||||
}
|
||||
|
||||
if (shade != 0x1000) {
|
||||
const int32_t brightness = 0x1FFF - shade;
|
||||
if (shade != SHADE_NEUTRAL) {
|
||||
const int32_t brightness = SHADE_MAX - shade;
|
||||
red = (red * brightness) >> 12;
|
||||
green = (green * brightness) >> 12;
|
||||
blue = (blue * brightness) >> 12;
|
||||
|
|
|
@ -134,7 +134,7 @@ int16_t Spawn_GunShot(
|
|||
effect->counter = 3;
|
||||
effect->frame_num = 0;
|
||||
effect->object_id = O_GUN_FLASH;
|
||||
effect->shade = HIGH_LIGHT;
|
||||
effect->shade = SHADE_NEUTRAL;
|
||||
return effect_num;
|
||||
}
|
||||
|
||||
|
|
|
@ -100,7 +100,8 @@ void Text_DrawText(TEXTSTRING *const text)
|
|||
const float sprite_scale = MIN(sprite_scale_h, sprite_scale_v);
|
||||
Output_DrawScreenSprite(
|
||||
x + M_Scale(10), y, z, M_Scale(glyph->width * sprite_scale),
|
||||
M_Scale(glyph->width * sprite_scale), sprite_idx, 4096, 0);
|
||||
M_Scale(glyph->width * sprite_scale), sprite_idx, SHADE_NEUTRAL,
|
||||
0);
|
||||
x += glyph->width * scale_h / TEXT_BASE_SCALE;
|
||||
goto loop_end;
|
||||
}
|
||||
|
@ -116,7 +117,7 @@ void Text_DrawText(TEXTSTRING *const text)
|
|||
|
||||
Output_DrawScreenSprite(
|
||||
cx, cy, 0, scale_h, scale_v,
|
||||
obj->mesh_idx + glyph->combine_with.mesh_idx, 4096, 0);
|
||||
obj->mesh_idx + glyph->combine_with.mesh_idx, SHADE_NEUTRAL, 0);
|
||||
}
|
||||
|
||||
if (x >= 0 && x < g_PhdWinWidth && y >= 0 && y < g_PhdWinHeight) {
|
||||
|
@ -125,7 +126,7 @@ void Text_DrawText(TEXTSTRING *const text)
|
|||
}
|
||||
Output_DrawScreenSprite(
|
||||
x, y, z, scale_h, scale_v, obj->mesh_idx + glyph->mesh_idx,
|
||||
4096, 0);
|
||||
SHADE_NEUTRAL, 0);
|
||||
}
|
||||
|
||||
if (glyph->role != GLYPH_COMBINING) {
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
#define STEPUP_HEIGHT ((STEP_L * 3) / 2) // = 384
|
||||
#define SLOPE_DIF 60
|
||||
#define MAX_WIBBLE 2
|
||||
#define MAX_SHADE 0x300
|
||||
#define LIGHT_MAP_SIZE 32
|
||||
#define MAX_ROOM_LIGHT_UNIT (0x2000 / (WIBBLE_SIZE / 2))
|
||||
|
||||
|
@ -147,6 +146,3 @@
|
|||
#define IDS_DX5_REQUIRED 1
|
||||
|
||||
#define MONK_FRIENDLY_FIRE_THRESHOLD 10
|
||||
|
||||
#define LOW_LIGHT 5120
|
||||
#define HIGH_LIGHT 4096
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue