|
UFO: Alien Invasion
|
Material editor related code. More...
#include "../../client.h"#include "../ui_main.h"#include "../ui_data.h"#include "../ui_windows.h"#include "../ui_nodes.h"#include "../ui_behaviour.h"#include "../ui_actions.h"#include "../ui_render.h"#include "../ui_parse.h"#include "../ui_lua.h"#include "ui_node_abstractnode.h"#include "ui_node_abstractscrollable.h"#include "ui_node_material_editor.h"#include "../../cl_video.h"#include "../../renderer/r_image.h"#include "../../renderer/r_model.h"#include "../../../common/scripts_lua.h"
Go to the source code of this file.
Data Structures | |
| struct | materialDescription_t |
Macros | |
| #define | EXTRADATA(node) |
| #define | IMAGE_WIDTH 64 |
| #define | MARGIN 3 |
Functions | |
| static materialStage_t * | UI_MaterialEditorGetStage (material_t *material, int stageIndex) |
| static int | UI_MaterialEditorNodeGetImageCount (uiNode_t *node) |
| return the number of images we can display | |
| static int | UI_MaterialEditorNodeGetImageAtPosition (uiNode_t *node, int x, int y) |
| Return index of the image (r_images[i]) else nullptr. | |
| static void | UI_MaterialEditorStagesToName (const materialStage_t *stage, char *buf, size_t size) |
| static void | UI_MaterialEditorUpdate (image_t *image, materialStage_t *materialStage) |
| static int | UI_MaterialEditorNameToStage (const char *stageName) |
| static void | UI_MaterialEditorStart_f (void) |
| static void | UI_MaterialEditorChangeValue_f (void) |
| static void | UI_MaterialEditorSelectStage_f (void) |
| static void | UI_MaterialEditorRemoveStage_f (void) |
| static void | UI_MaterialEditorNewStage_f (void) |
| void | UI_RegisterMaterialEditorNode (uiBehaviour_t *behaviour) |
Variables | |
| static const materialDescription_t | materialDescriptions [] |
| static const value_t | materialValues [] |
| static const value_t | materialStageValues [] |
Material editor related code.
Definition in file ui_node_material_editor.cpp.
| #define EXTRADATA | ( | node | ) |
Definition at line 47 of file ui_node_material_editor.cpp.
Referenced by UI_MaterialEditorNodeGetImageAtPosition().
| #define IMAGE_WIDTH 64 |
Definition at line 51 of file ui_node_material_editor.cpp.
Referenced by uiMaterialEditorNode::draw(), UI_MaterialEditorNodeGetImageAtPosition(), and uiMaterialEditorNode::updateView().
| #define MARGIN 3 |
Referenced by uiMaterialEditorNode::draw().
Definition at line 427 of file ui_node_material_editor.cpp.
References Cmd_Argc(), Cmd_Argv(), Com_ParseValue(), Com_Printf(), materialStage_t::flags, id, image_t::material, materialStageValues, materialValues, material_t::num_stages, value_t::ofs, R_GetImageAtIndex(), R_ModReloadSurfacesArrays(), r_numImages, value_t::size, STAGE_DIRTMAP, STAGE_ENVMAP, STAGE_LIGHTING, STAGE_RENDER, STAGE_TAPE, STAGE_TERRAIN, STAGE_TEXTURE, value_t::type, UI_FindPropertyByName(), UI_MaterialEditorGetStage(), and UI_MaterialEditorNameToStage().
Referenced by UI_RegisterMaterialEditorNode().
|
static |
Definition at line 79 of file ui_node_material_editor.cpp.
References materialStage_t::next, and material_t::stages.
Referenced by UI_MaterialEditorChangeValue_f(), UI_MaterialEditorRemoveStage_f(), UI_MaterialEditorSelectStage_f(), and UI_MaterialEditorUpdate().
|
static |
Converts a stage name into the stage flag
| stageName | The name to search the flag for |
Definition at line 314 of file ui_node_material_editor.cpp.
References materialDescriptions, materialDescription_t::name, and materialDescription_t::stageFlag.
Referenced by UI_MaterialEditorChangeValue_f().
Definition at line 555 of file ui_node_material_editor.cpp.
References Cmd_Argc(), Cmd_Argv(), Com_Printf(), id, m, image_t::material, Mem_PoolAllocType, materialStage_t::next, R_GetImageAtIndex(), r_numImages, UI_MaterialEditorUpdate(), and vid_imagePool.
Referenced by UI_RegisterMaterialEditorNode().
Return index of the image (r_images[i]) else nullptr.
Definition at line 193 of file ui_node_material_editor.cpp.
References uiNode_t::box, EXTRADATA, i, IMAGE_WIDTH, it_world, image_t::name, uiNode_t::padding, R_GetImageAtIndex(), r_numImages, uiBox_t::size, image_t::type, UI_GetNodeAbsPos(), and UI_NodeAbsoluteToRelativePos().
Referenced by uiMaterialEditorNode::onMouseDown().
return the number of images we can display
Definition at line 94 of file ui_node_material_editor.cpp.
References i, it_world, image_t::name, R_GetImageAtIndex(), r_numImages, and image_t::type.
Referenced by uiMaterialEditorNode::updateView().
Definition at line 521 of file ui_node_material_editor.cpp.
References Cmd_Argc(), Cmd_Argv(), Com_Printf(), id, image_t::material, Mem_Free, materialStage_t::next, material_t::num_stages, R_GetImageAtIndex(), r_numImages, material_t::stages, UI_MaterialEditorGetStage(), and UI_MaterialEditorUpdate().
Referenced by UI_RegisterMaterialEditorNode().
Definition at line 492 of file ui_node_material_editor.cpp.
References Cmd_Argc(), Cmd_Argv(), Com_Printf(), id, image_t::material, material_t::num_stages, R_GetImageAtIndex(), r_numImages, UI_MaterialEditorGetStage(), and UI_MaterialEditorUpdate().
Referenced by UI_RegisterMaterialEditorNode().
|
static |
Definition at line 250 of file ui_node_material_editor.cpp.
References materialStage_t::flags, materialDescriptions, materialDescription_t::name, Q_strcat(), and materialDescription_t::stageFlag.
Referenced by UI_MaterialEditorUpdate().
Definition at line 374 of file ui_node_material_editor.cpp.
References ca_active, cls, Com_Printf(), and UI_PopWindow().
Referenced by UI_RegisterMaterialEditorNode().
|
static |
Updates the material editor node for a given image and a given material stage
| image | The image to load into the material editor |
| materialStage | The material stage to display |
Definition at line 266 of file ui_node_material_editor.cpp.
References stretch_t::amp, material_t::bump, Cvar_GetString(), Cvar_Set(), stretch_t::damp, rotate_t::deg, pulse_t::dhz, stretch_t::dhz, scroll_t::ds, scroll_t::dt, material_t::hardness, pulse_t::hz, rotate_t::hz, stretch_t::hz, i, LIST_AddString(), image_t::material, MAX_VAR, image_t::name, image_t::normalmap, material_t::num_stages, material_t::parallax, materialStage_t::pulse, materialStage_t::rotate, scale_t::s, scroll_t::s, materialStage_t::scale, materialStage_t::scroll, material_t::specular, materialStage_t::stretch, scale_t::t, scroll_t::t, TEXT_MATERIAL_STAGES, UI_ExecuteConfunc(), UI_MaterialEditorGetStage(), UI_MaterialEditorStagesToName(), and UI_RegisterLinkedListText().
Referenced by uiMaterialEditorNode::onMouseDown(), UI_MaterialEditorNewStage_f(), UI_MaterialEditorRemoveStage_f(), and UI_MaterialEditorSelectStage_f().
| void UI_RegisterMaterialEditorNode | ( | uiBehaviour_t * | behaviour | ) |
Definition at line 588 of file ui_node_material_editor.cpp.
References Cmd_AddCommand(), uiBehaviour_t::extends, uiBehaviour_t::lua_SWIG_typeinfo, uiBehaviour_t::manager, uiBehaviour_t::name, UI_MaterialEditorChangeValue_f(), UI_MaterialEditorNewStage_f(), UI_MaterialEditorRemoveStage_f(), UI_MaterialEditorSelectStage_f(), UI_MaterialEditorStart_f(), and UI_SWIG_TypeQuery().
|
static |
Definition at line 58 of file ui_node_material_editor.cpp.
Referenced by UI_MaterialEditorNameToStage(), and UI_MaterialEditorStagesToName().
|
static |
Definition at line 396 of file ui_node_material_editor.cpp.
Referenced by UI_MaterialEditorChangeValue_f().
|
static |
Definition at line 386 of file ui_node_material_editor.cpp.
Referenced by UI_MaterialEditorChangeValue_f().