0

added label metadata to rendermodes (no more ugly map labels)

This commit is contained in:
Aaron Griffith
2011-09-08 07:34:35 -04:00
parent bbb2a3943e
commit fb45fb3dff
10 changed files with 29 additions and 9 deletions

View File

@@ -316,7 +316,8 @@ const RenderModeOption rendermode_cave_options[] = {
};
RenderModeInterface rendermode_cave = {
"cave", "render only caves",
"cave", "Cave",
"render only caves",
rendermode_cave_options,
&rendermode_lighting,
sizeof(RenderModeCave),

View File

@@ -356,7 +356,8 @@ const RenderModeOption rendermode_lighting_options[] = {
};
RenderModeInterface rendermode_lighting = {
"lighting", "draw shadows from the lighting data",
"lighting", "Lighting",
"draw shadows from the lighting data",
rendermode_lighting_options,
&rendermode_normal,
sizeof(RenderModeLighting),

View File

@@ -154,7 +154,8 @@ const RenderModeOption rendermode_mineral_options[] = {
};
RenderModeInterface rendermode_mineral = {
"mineral", "draws a colored overlay showing where ores are located",
"mineral", "Mineral",
"draws a colored overlay showing where ores are located",
rendermode_mineral_options,
&rendermode_overlay,
sizeof(RenderModeMineral),

View File

@@ -66,7 +66,8 @@ rendermode_night_draw(void *data, RenderState *state, PyObject *src, PyObject *m
}
RenderModeInterface rendermode_night = {
"night", "like \"lighting\", except at night",
"night", "Night",
"like \"lighting\", except at night",
NULL,
&rendermode_lighting,
sizeof(RenderModeNight),

View File

@@ -299,7 +299,8 @@ const RenderModeOption rendermode_normal_options[] = {
};
RenderModeInterface rendermode_normal = {
"normal", "nothing special, just render the blocks",
"normal", "Normal",
"nothing special, just render the blocks",
rendermode_normal_options,
NULL,
sizeof(RenderModeNormal),

View File

@@ -134,7 +134,8 @@ rendermode_overlay_draw(void *data, RenderState *state, PyObject *src, PyObject
}
RenderModeInterface rendermode_overlay = {
"overlay", "base rendermode for informational overlays",
"overlay", "Overlay",
"base rendermode for informational overlays",
NULL,
NULL,
sizeof(RenderModeOverlay),

View File

@@ -114,7 +114,8 @@ rendermode_spawn_draw(void *data, RenderState *state, PyObject *src, PyObject *m
}
RenderModeInterface rendermode_spawn = {
"spawn", "draws a red overlay where monsters can spawn at night",
"spawn", "Spawn",
"draws a red overlay where monsters can spawn at night",
NULL,
&rendermode_overlay,
sizeof(RenderModeSpawn),

View File

@@ -312,6 +312,10 @@ PyObject *get_render_mode_info(PyObject *self, PyObject *args) {
PyDict_SetItemString(info, "name", tmp);
Py_DECREF(tmp);
tmp = PyString_FromString(render_modes[i]->label);
PyDict_SetItemString(info, "label", tmp);
Py_DECREF(tmp);
tmp = PyString_FromString(render_modes[i]->description);
PyDict_SetItemString(info, "description", tmp);
Py_DECREF(tmp);

View File

@@ -48,6 +48,8 @@ typedef struct _RenderModeInterface RenderModeInterface;
struct _RenderModeInterface {
/* the name of this mode */
const char *name;
/* the label to use in the map */
const char *label;
/* the short description of this render mode */
const char *description;