1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
// editing.cpp: most map editing commands go here, entity editing commands are
// in world.cpp
#include "cube.h"
bool editmode = false;
// the current selection, used by almost all editing commands
// invariant: all code assumes that these are kept inside MINBORD distance of
// the edge of the map
block sel = {
variable("selx", 0, 0, 4096, &sel.x, NULL, false),
variable("sely", 0, 0, 4096, &sel.y, NULL, false),
variable("selxs", 0, 0, 4096, &sel.xs, NULL, false),
variable("selys", 0, 0, 4096, &sel.ys, NULL, false),
};
int selh = 0;
bool selset = false;
#define loopselxy(b) \
{ \
makeundo(); \
|
|
>
>
>
>
>
|
|
|
|
|
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
// editing.cpp: most map editing commands go here, entity editing commands are
// in world.cpp
#include "cube.h"
bool editmode = false;
// the current selection, used by almost all editing commands
// invariant: all code assumes that these are kept inside MINBORD distance of
// the edge of the map
block sel;
OF_CONSTRUCTOR()
{
enqueueInit(^{
sel = {
variable(@"selx", 0, 0, 4096, &sel.x, NULL, false),
variable(@"sely", 0, 0, 4096, &sel.y, NULL, false),
variable(@"selxs", 0, 0, 4096, &sel.xs, NULL, false),
variable(@"selys", 0, 0, 4096, &sel.ys, NULL, false),
};
});
}
int selh = 0;
bool selset = false;
#define loopselxy(b) \
{ \
makeundo(); \
|
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
|
edittag(int tag)
{
EDITSELMP;
loopselxy(s->tag = tag);
};
void
newent(char *what, char *a1, char *a2, char *a3, char *a4)
{
EDITSEL;
newentity(sel.x, sel.y, (int)player1->o.z, what, ATOI(a1), ATOI(a2),
ATOI(a3), ATOI(a4));
};
COMMANDN(select, selectpos, ARG_4INT)
COMMAND(edittag, ARG_1INT)
COMMAND(replace, ARG_NONE)
COMMAND(archvertex, ARG_3INT)
COMMAND(arch, ARG_2INT)
COMMAND(slope, ARG_2INT)
|
|
>
|
<
<
>
>
>
>
|
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
|
edittag(int tag)
{
EDITSELMP;
loopselxy(s->tag = tag);
};
void
newent(OFString *what, OFString *a1, OFString *a2, OFString *a3, OFString *a4)
{
EDITSEL;
@autoreleasepool {
newentity(sel.x, sel.y, (int)player1->o.z, what,
(int)a1.longLongValue, (int)a2.longLongValue,
(int)a3.longLongValue, (int)a4.longLongValue);
}
}
COMMANDN(select, selectpos, ARG_4INT)
COMMAND(edittag, ARG_1INT)
COMMAND(replace, ARG_NONE)
COMMAND(archvertex, ARG_3INT)
COMMAND(arch, ARG_2INT)
COMMAND(slope, ARG_2INT)
|