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_s |
Macros | |
#define | EXTRADATA(node) UI_EXTRADATA(node, abstractScrollableExtraData_t) |
#define | IMAGE_WIDTH 64 |
#define | MARGIN 3 |
Typedefs | |
typedef struct materialDescription_s | materialDescription_t |
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 More... | |
static int | UI_MaterialEditorNodeGetImageAtPosition (uiNode_t *node, int x, int y) |
Return index of the image (r_images[i]) else nullptr. More... | |
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 | ) | UI_EXTRADATA(node, abstractScrollableExtraData_t) |
Definition at line 47 of file ui_node_material_editor.cpp.
Referenced by uiMaterialEditorNode::draw(), and 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().
typedef struct materialDescription_s materialDescription_t |
Definition at line 427 of file ui_node_material_editor.cpp.
References Cmd_Argc(), Cmd_Argv(), Com_ParseValue(), Com_Printf(), materialStage_s::flags, image_s::material, material_s::num_stages, value_s::ofs, R_GetImageAtIndex(), R_ModReloadSurfacesArrays(), r_numImages, value_s::size, STAGE_DIRTMAP, STAGE_ENVMAP, STAGE_LIGHTING, STAGE_RENDER, STAGE_TAPE, STAGE_TERRAIN, STAGE_TEXTURE, value_s::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_s::next, and material_s::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_s::name, and materialDescription_s::stageFlag.
Referenced by UI_MaterialEditorChangeValue_f().
Definition at line 555 of file ui_node_material_editor.cpp.
References Cmd_Argc(), Cmd_Argv(), Com_Printf(), m, image_s::material, Mem_PoolAllocType, materialStage_s::next, material_s::num_stages, R_GetImageAtIndex(), r_numImages, material_s::stages, 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_s::name, uiNode_t::padding, R_GetImageAtIndex(), r_numImages, uiBox_t::size, image_s::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_s::name, R_GetImageAtIndex(), r_numImages, and image_s::type.
Referenced by uiMaterialEditorNode::updateView().
Definition at line 521 of file ui_node_material_editor.cpp.
References Cmd_Argc(), Cmd_Argv(), Com_Printf(), image_s::material, Mem_Free, materialStage_s::next, material_s::num_stages, R_GetImageAtIndex(), r_numImages, material_s::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(), image_s::material, material_s::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_s::flags, materialDescriptions, materialDescription_s::name, Q_strcat(), and materialDescription_s::stageFlag.
Referenced by UI_MaterialEditorUpdate().
Definition at line 374 of file ui_node_material_editor.cpp.
References ca_active, cls, Com_Printf(), client_static_s::state, 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_s::amp, material_s::bump, Cvar_GetString(), Cvar_Set(), stretch_s::damp, rotate_s::deg, pulse_s::dhz, stretch_s::dhz, scroll_s::ds, scroll_s::dt, material_s::hardness, rotate_s::hz, pulse_s::hz, stretch_s::hz, i, LIST_AddString(), image_s::material, MAX_VAR, image_s::name, image_s::normalmap, material_s::num_stages, material_s::parallax, materialStage_s::pulse, materialStage_s::rotate, scroll_s::s, scale_s::s, materialStage_s::scale, materialStage_s::scroll, material_s::specular, materialStage_s::stretch, scroll_s::t, scale_s::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.
|
static |
Definition at line 386 of file ui_node_material_editor.cpp.