Crossfire Server, Trunk  1.75.0
FaceWriter.cpp
Go to the documentation of this file.
1 /*
2  * Crossfire -- cooperative multi-player graphical RPG and adventure game
3  *
4  * Copyright (c) 2020 the Crossfire Development Team
5  *
6  * Crossfire is free software and comes with ABSOLUTELY NO WARRANTY. You are
7  * welcome to redistribute it under certain conditions. For details, please
8  * see COPYING and LICENSE.
9  *
10  * The authors can be reached via e-mail at <crossfire@metalforge.org>.
11  */
12 
13 #include "FaceWriter.h"
14 
16  /* No need to write faces with no specific information */
17  if (face->visibility == 0 && face->magicmap == 0) {
18  if (face->smoothface) {
19  stringbuffer_append_printf(buf, "smoothface %s %s\n", face->name, face->smoothface->name);
20  }
21  return;
22  }
23  stringbuffer_append_printf(buf, "face %s\n", face->name);
24  if (face->visibility) {
25  stringbuffer_append_printf(buf, "visibility %d\n", face->visibility);
26  }
27  if (face->magicmap & FACE_FLOOR) {
28  stringbuffer_append_string(buf, "is_floor 1\n");
29  }
30  if (face->magicmap & (~FACE_FLOOR)) {
31  stringbuffer_append_printf(buf, "magicmap %s\n", get_colorname(face->magicmap & (~FACE_FLOOR)));
32  }
33  if (face->smoothface) {
34  stringbuffer_append_printf(buf, "smoothface %s\n", face->smoothface->name);
35  }
37 }
Face
New face structure - this enforces the notion that data is face by face only - you can not change the...
Definition: face.h:14
stringbuffer_append_printf
void stringbuffer_append_printf(StringBuffer *sb, const char *format,...)
Append a formatted string to a string buffer instance.
Definition: stringbuffer.cpp:138
get_colorname
const char * get_colorname(uint8_t index)
Definition: image.cpp:86
FaceWriter.h
buf
StringBuffer * buf
Definition: readable.cpp:1565
treasurelist::name
sstring name
Usually monster-name/combination.
Definition: treasure.h:86
FACE_FLOOR
#define FACE_FLOOR
Definition: newclient.h:306
stringbuffer_append_string
void stringbuffer_append_string(StringBuffer *sb, const char *str)
Append a string to a string buffer instance.
Definition: stringbuffer.cpp:95
StringBuffer
A buffer that will be expanded as content is added to it.
Definition: stringbuffer.cpp:25
FaceWriter::write
virtual void write(const Face *face, StringBuffer *buf)
Write the specified asset to the StringBuffer.
Definition: FaceWriter.cpp:15
face
in that case they will be relative to whatever the PWD of the crossfire server process is You probably shouldn though Notes on Specific and settings file datadir Usually usr share crossfire Contains data that the server does not need to modify while such as the etc A default install will pack the and treasurelist definitions into a single or trs file and the graphics into a face(metadata) and .tar(bitmaps) file