Skip to content

Commit

Permalink
Made object lightflags configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
Loobinex committed Aug 16, 2024
1 parent d31da5c commit a5bf1cc
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 11 deletions.
7 changes: 7 additions & 0 deletions config/fxdata/objects.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ LightUnaffected = 0
LightIntensity = 0
; The range of the light in subtiles. 0~255.
LightRadius = 0
; Unknown light properties. Possible flag values 0~255, where powers of 2 are unique properties.
LightFlags = 0
; The type of light. 0: disabled, 1: enabled.
LightIsDynamic = 0
; The icon that represents the icon on the map. -1 is used for custom.
Expand Down Expand Up @@ -98,6 +100,7 @@ FallAcceleration = 0
LightUnaffected = 1
LightIntensity = 50
LightRadius = 6
LightFlags = 5
LightIsDynamic = 0
AmbienceSound = 78
RandomStartFrame = 1
Expand Down Expand Up @@ -151,6 +154,7 @@ FallAcceleration = 20
LightUnaffected = 1
LightIntensity = 47
LightRadius = 7
LightFlags = 5
LightIsDynamic = 0
AmbienceSound = 78
RandomStartFrame = 0
Expand Down Expand Up @@ -181,6 +185,7 @@ LightUnaffected = 0
MapIcon = 512
LightIntensity = 36
LightRadius = 14
LightFlags = 5
LightIsDynamic = 1
RandomStartFrame = 0
DrawClass = 2
Expand Down Expand Up @@ -737,6 +742,7 @@ FallAcceleration = 0
LightUnaffected = 1
LightIntensity = 46
LightRadius = 6
LightFlags = 5
LightIsDynamic = 0
AmbienceSound = 78
RandomStartFrame = 1
Expand Down Expand Up @@ -1234,6 +1240,7 @@ FallAcceleration = 0
LightUnaffected = 1
LightIntensity = 40
LightRadius = 10
LightFlags = 5
LightIsDynamic = 0
AmbienceSound = 973
RandomStartFrame = 0
Expand Down
23 changes: 14 additions & 9 deletions src/config_objects.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ const struct NamedCommand objects_object_commands[] = {
{"FLAMEANIMATIONSIZE", 35},
{"FLAMEANIMATIONOFFSET", 36},
{"FLAMETRANSPARENCYFLAGS", 37},
{"LIGHTFLAGS", 38},
{NULL, 0},
};

Expand Down Expand Up @@ -763,6 +764,19 @@ TbBool parse_objects_object_blocks(char *buf, long len, const char *config_textn
CONFWRNLOG("Incorrect value of \"%s\" parameter in [%s] block of %s file.",
COMMAND_TEXT(cmd_num), block_buf, config_textname);
}
case 38: // LIGHTFLAGS

Check notice on line 767 in src/config_objects.c

View workflow job for this annotation

GitHub Actions / build

here

Check notice on line 767 in src/config_objects.c

View workflow job for this annotation

GitHub Actions / build

here

Check notice on line 767 in src/config_objects.c

View workflow job for this annotation

GitHub Actions / build

here

Check notice on line 767 in src/config_objects.c

View workflow job for this annotation

GitHub Actions / build

here
if (get_conf_parameter_single(buf, &pos, len, word_buf, sizeof(word_buf)) > 0)
{
k = atoi(word_buf);
objst->ilght.flags = k;
n++;
}
if (n <= 0)
{
CONFWRNLOG("Incorrect value of \"%s\" parameter in [%s] block of %s file.",
COMMAND_TEXT(cmd_num), block_buf, config_textname);
}
break;
case 0: // comment
break;
case -1: // end of buffer
Expand Down Expand Up @@ -961,15 +975,6 @@ int get_required_room_capacity_for_object(RoomRole room_role, ThingModel objmode
return 0;
}

void init_objects(void)
{
game.conf.object_conf.object_cfgstats[ObjMdl_Torch].ilght.flags = 5;
game.conf.object_conf.object_cfgstats[ObjMdl_HeroGate].ilght.flags = 5;
game.conf.object_conf.object_cfgstats[ObjMdl_StatueLit].ilght.flags = 5;
game.conf.object_conf.object_cfgstats[ObjMdl_SoulCountainer].ilght.flags = 5;
game.conf.object_conf.object_cfgstats[ObjMdl_Candlestick].ilght.flags = 5;
}

/******************************************************************************/
#ifdef __cplusplus
}
Expand Down
1 change: 0 additions & 1 deletion src/config_objects.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ ThingClass crate_to_workshop_item_class(ThingModel tngmodel);
ThingModel crate_to_workshop_item_model(ThingModel tngmodel);
ThingClass crate_thing_to_workshop_item_class(const struct Thing *thing);
ThingModel crate_thing_to_workshop_item_model(const struct Thing *thing);
void init_objects(void);
int get_required_room_capacity_for_object(RoomRole room_role, ThingModel objmodel, ThingModel relmodel);
void update_all_object_stats();
/******************************************************************************/
Expand Down
1 change: 0 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1012,7 +1012,6 @@ void init_keeper(void)
SYNCDBG(8,"Starting");
engine_init();
init_iso_3d_conversion_tables();
init_objects();
init_colours();
init_spiral_steps();
init_key_to_strings();
Expand Down

0 comments on commit a5bf1cc

Please sign in to comment.