Crossfire Server, Trunk
|
#include "global.h"
#include <assert.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "image.h"
#include "assets.h"
#include "AssetsManager.h"
Go to the source code of this file.
Functions | |
void | dump_faces (void) |
uint8_t | find_color (const char *name) |
int | find_smooth (const Face *face, const Face **smoothed) |
const char * | get_colorname (uint8_t index) |
int | get_face_fallback (int faceset, uint16_t imageno) |
int | is_valid_faceset (int fsn) |
Variables | |
const Face * | blank_face |
static const char *const | colorname [] |
const Face * | empty_face |
const Face * | smooth_face |
Handles face-related stuff, including the actual face data.
Definition in file image.cpp.
void dump_faces | ( | void | ) |
Dump all faces to stderr, for debugging purposes.
Definition at line 159 of file image.cpp.
References AssetsCollection< T, Key >::each(), AssetsManager::faces(), getManager(), Face::name, Face::number, and Face::smoothface.
Referenced by server_dump_faces().
uint8_t find_color | ( | const char * | name | ) |
Finds a color by name.
name | color name, case-sensitive. |
Definition at line 75 of file image.cpp.
References colorname, llevError, LOG(), and give::name.
Referenced by FaceLoader::load().
Find the smooth face for a given face.
face | the face to find the smoothing face for |
smoothed | return value: set to smooth face |
Definition at line 102 of file image.cpp.
References Face::smoothface.
Referenced by send_smooth().
const char* get_colorname | ( | uint8_t | index | ) |
Definition at line 86 of file image.cpp.
References colorname, and npc_dialog::index.
Referenced by CREFacePanel::CREFacePanel(), and FaceWriter::write().
int get_face_fallback | ( | int | faceset, |
uint16_t | imageno | ||
) |
This returns the set we will actually use when sending a face. This is used because the image files may be sparse. This function is recursive. imageno is the face number we are trying to send
If face is not found in specified faceset, tries with 'fallback' faceset.
faceset | faceset to check |
imageno | image number |
Definition at line 133 of file image.cpp.
References face_info::data, face_sets::faces, face_sets::fallback, find_faceset(), get_face_fallback(), face_sets::id, llevError, LOG(), and face_sets::prefix.
Referenced by esrv_send_face(), get_face_fallback(), process_map(), send_image_sums(), and test_faceset().
int is_valid_faceset | ( | int | fsn | ) |
Checks specified faceset is valid
fsn | faceset number |
Definition at line 117 of file image.cpp.
References find_faceset().
Referenced by main(), and set_up_cmd().
const Face* blank_face |
Following can just as easily be pointers, but it is easier to keep them like this.
Definition at line 36 of file image.cpp.
Referenced by add_abilities(), AllAnimations::added(), animate_object(), artifact_get_face(), Faces::Faces(), knowledge_monster_face(), magic_mapping_mark(), magic_mapping_mark_recursive(), object_clear(), recipe_get_face(), AllAnimations::replace(), tear_down_wall(), and update_position().
|
static |
The only thing this table is used for now is to translate the colorname in the magicmap field of the face into a numeric index that is then sent to the client for magic map commands. The order of this table must match that of the NDI colors in include/newclient.h.
Definition at line 46 of file image.cpp.
Referenced by find_color(), and get_colorname().
const Face * empty_face |
Definition at line 36 of file image.cpp.
Referenced by esrv_draw_look(), esrv_send_inventory(), and Faces::Faces().
const Face * smooth_face |
Definition at line 36 of file image.cpp.
Referenced by Faces::Faces(), and send_smooth().