*** empty log message ***
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@980 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
@@ -365,9 +365,7 @@ void writecfg()
|
||||
|
||||
COMMAND(writecfg, ARG_NONE);
|
||||
|
||||
vector<char *> identnames()
|
||||
void identnames(vector<char *> &names)
|
||||
{
|
||||
vector<char *> names;
|
||||
enumerateht(*idents) names.add(idents->enumc->key);
|
||||
return names;
|
||||
}
|
||||
|
||||
@@ -47,7 +47,8 @@ void conoutf(const char *s, ...)
|
||||
s_sprintfdv(sf, s);
|
||||
puts(sf);
|
||||
s = sf;
|
||||
vector<char *> &lines = text_block(s, VIRTW*2-2*CONSPAD-2*FONTH/3);
|
||||
vector<char *> lines;
|
||||
text_block(s, VIRTW*2-2*CONSPAD-2*FONTH/3, lines);
|
||||
loopv(lines) conline(lines[i], i!=0);
|
||||
lines.deletecontentsa();
|
||||
}
|
||||
|
||||
@@ -95,5 +95,7 @@ extern int VIRTW; // virtual screen size for text & HUD
|
||||
|
||||
#include "protos.h" // external function decls
|
||||
|
||||
#define AC_VERSION 920
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
+10
-7
@@ -81,7 +81,8 @@ int stringsort(const char **a, const char **b) { return strcmp(*a, *b); }
|
||||
|
||||
void doctodo()
|
||||
{
|
||||
vector<char *> inames = identnames();
|
||||
vector<char *> inames;
|
||||
identnames(inames);
|
||||
inames.sort(stringsort);
|
||||
conoutf("documentation TODO");
|
||||
conoutf("undocumented identifiers:");
|
||||
@@ -174,7 +175,8 @@ void renderdoc(int x, int y)
|
||||
}
|
||||
doclines.add(NULL);
|
||||
|
||||
vector<char *> desc = text_block(ident->desc, linemax); // desc
|
||||
vector<char *> desc;
|
||||
text_block(ident->desc, linemax, desc); // desc
|
||||
loopvj(desc) doclines.add(desc[j]);
|
||||
doclines.add(NULL);
|
||||
|
||||
@@ -219,7 +221,8 @@ void renderdoc(int x, int y)
|
||||
|
||||
if(ident->remarks.length()) loopvj(ident->remarks) // remarks
|
||||
{
|
||||
vector<char *> remarks = text_block(ident->remarks[j], linemax);
|
||||
vector<char *> remarks;
|
||||
text_block(ident->remarks[j], linemax, remarks);
|
||||
loopvk(remarks) doclines.add(remarks[k]);
|
||||
}
|
||||
doclines.add(NULL);
|
||||
@@ -264,7 +267,6 @@ int msectionsort(const msection *a, const msection *b)
|
||||
|
||||
void renderdocsection(void *menu, bool init)
|
||||
{
|
||||
struct msection { char *name; string cmd; };
|
||||
static vector<msection> msections;
|
||||
msections.setsize(0);
|
||||
|
||||
@@ -278,15 +280,16 @@ void renderdocsection(void *menu, bool init)
|
||||
loopv(msections) { menumanual(menu, i, msections[i].name, msections[i].cmd); }
|
||||
}
|
||||
|
||||
struct maction { string cmd; };
|
||||
|
||||
void renderdocmenu(void *menu, bool init)
|
||||
{
|
||||
struct action { string cmd; };
|
||||
static vector<action> actions;
|
||||
static vector<maction> actions;
|
||||
actions.setsize(0);
|
||||
|
||||
loopv(sections)
|
||||
{
|
||||
action &a = actions.add();
|
||||
maction &a = actions.add();
|
||||
s_sprintf(a.cmd)("showmenu [%s]", sections[i].name);
|
||||
menumanual(menu, i, sections[i].name, a.cmd);
|
||||
}
|
||||
|
||||
+1
-1
@@ -391,5 +391,5 @@ void loadcrosshair(char *c)
|
||||
|
||||
COMMAND(loadcrosshair, ARG_1STR);
|
||||
|
||||
VAR(version, 1, 920, 0);
|
||||
VAR(version, 1, AC_VERSION, 0);
|
||||
|
||||
|
||||
+2
-2
@@ -15,7 +15,7 @@ extern void complete(char *s);
|
||||
extern void alias(char *name, char *action);
|
||||
extern char *getalias(char *name);
|
||||
extern void writecfg();
|
||||
extern vector<char *> identnames();
|
||||
extern void identnames(vector<char *> &names);
|
||||
|
||||
// console
|
||||
extern void keypress(int code, bool isdown, int cooked);
|
||||
@@ -180,7 +180,7 @@ extern void draw_textf(const char *fstr, int left, int top, ...);
|
||||
extern int char_width(int c, int x = 0);
|
||||
extern int text_width(const char *str, int limit = -1);
|
||||
extern int text_visible(const char *str, int max);
|
||||
extern vector<char *> text_block(const char *str, int max);
|
||||
extern void text_block(const char *str, int max, vector<char *> &lines);
|
||||
extern void text_startcolumns();
|
||||
extern void text_endcolumns();
|
||||
|
||||
|
||||
@@ -173,9 +173,8 @@ int text_visible(const char *str, int max)
|
||||
}
|
||||
|
||||
// cut strings to fit on screen
|
||||
vector<char *> text_block(const char *str, int max)
|
||||
void text_block(const char *str, int max, vector<char *> &lines)
|
||||
{
|
||||
vector<char *> lines;
|
||||
int visible;
|
||||
while((visible = text_visible(str, max)))
|
||||
{
|
||||
@@ -191,7 +190,6 @@ vector<char *> text_block(const char *str, int max)
|
||||
s_strncpy(t, str, visible+1);
|
||||
str += visible;
|
||||
}
|
||||
return lines;
|
||||
}
|
||||
|
||||
void draw_textf(const char *fstr, int left, int top, ...)
|
||||
@@ -262,4 +260,4 @@ void draw_text(const char *str, int left, int top)
|
||||
xtraverts += 4;
|
||||
x += in_width + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ void updatemasterserver(int seconds)
|
||||
if(seconds>updmaster) // send alive signal to masterserver every hour of uptime
|
||||
{
|
||||
s_sprintfd(path)("%sregister.do?action=add", masterpath);
|
||||
s_sprintfd(agent)("ActionCube Server %d", getvar("version"));
|
||||
s_sprintfd(agent)("ActionCube Server %d", AC_VERSION);
|
||||
httpgetsend(masterserver, masterbase, path, "actioncubeserver", agent);
|
||||
masterrep[0] = 0;
|
||||
masterb.data = masterrep;
|
||||
@@ -97,7 +97,7 @@ void checkmasterreply()
|
||||
uchar *retrieveservers(uchar *buf, int buflen)
|
||||
{
|
||||
s_sprintfd(path)("%sretrieve.do?item=list", masterpath);
|
||||
s_sprintfd(agent)("ActionCube Client %d", getvar("version"));
|
||||
s_sprintfd(agent)("ActionCube Client %d", AC_VERSION);
|
||||
httpgetsend(masterserver, masterbase, path, "actioncubeclient", agent);
|
||||
ENetBuffer eb;
|
||||
buf[0] = 0;
|
||||
|
||||
Reference in New Issue
Block a user