@asman, post #1
@kar78787878, post #3
int start[] = {(intptr_t)&l0 - (intptr_t)&start, (intptr_t)&l1 - (intptr_t)&start};
const int l0[] = { 1,1,2,2 };
const int l1[] = { 8, 8, 9,9 };
int start[] = { l0, l1, -1 };void init_table()
{
int cnt;
for (cnt = 0; cnt < sizeof(start)-1 / sizeof(int); cnt++)
{
start[cnt] = &start[cnt] - &start;
}
}struct table
{
void* start[3];
int l0[4];
int l1[4];
};
struct table tab = {
{&l0[0], &l0[1], -1 },
{ 1,1,2,2 }, { 8, 8, 9,9 }
};zainicjowac jak wyzej I zgrac fwrite @c64portal, post #2
@asman, post #7
#include <stdarg.h>
#include <stdlib.h>
void main()
{
LONG *start = calloc(3, sizeof(LONG));
WORD *tab = calloc(4 * 2, sizeof(WORD)), *ptr = tab;
start[0] = initWordOffsets(&ptr, 4, 1, 1, 2, 2);
start[1] = start[0] + initWordOffsets(&ptr, 4, 8, 8, 9, 9);
start[2] = -1;
}
int initWordOffsets(WORD **ptab, int count, ...)
{
int i = 0;
WORD *tab = *ptab;
va_list list;
va_start(list, count);
for (i = 0; i < count; i++)
tab[i++] = va_arg(list, int));
va_end(list);
*ptab = tab + i;
return(i); /* Zwracamy liczbę elementów */
} @asman, post #1
@Krashan, post #11
@Krashan, post #11
@c64portal, post #13
@Krashan, post #14
static const char s_pMapPatternsYx[3][TILE_HEIGHT][TILE_WIDTH + 1] = {
{
"@@@@@@@@@@@@@@@@@@@@@@",
"@@@@@@@@@@@@@@@@@@@@@@",
"@@@@@@@@@@@@@@@@@@@@@@",
"@@....@..b..c..@....@@",
"@@.a..@........@..d.@@",
"@@@@@.@@@@..@@@@.@@@@@",
"@@@@@....@..@....@@@@@",
"@@...@...@..@...@...@@",
"@@.l.....@..@.....j.@@",
"@@...m...@..@...k...@@",
"@@...@...@..@...@...@@",
"@@@@@....@..@....@@@@@",
"@@@@@.@@@@..@@@@.@@@@@",
"@@.e..@........@..f.@@",
"@@....@..h..g..@....@@",
"@@@@@@@@@@@@@@@@@@@@@@",
"@@@@@@@@@@@@@@@@@@@@@@",
"@@@@@@@@@@@@@@@@@@@@@@"
},
{
"@@@@@@@@@@@@@@@@@@@@@@",
"@@@@@@@@@@@@@@@@@@@@@@",
"@@@@@@@@@@@@@@@@@@@@@@",
"@@..................@@",
"@@.a...j....f..k..b.@@",
"@@..................@@",
"@@.....@@@@@@@@.....@@",
"@@....@@@@@@@@@@..o.@@",
"@@.g.@@@@@@@@@@@@...@@",
"@@...@@@@@@@@@@@@.h.@@",
"@@.n..@@@@@@@@@@....@@",
"@@.....@@@@@@@@.....@@",
"@@..................@@",
"@@.d..m...e....l..c.@@",
"@@..................@@",
"@@@@@@@@@@@@@@@@@@@@@@",
"@@@@@@@@@@@@@@@@@@@@@@",
"@@@@@@@@@@@@@@@@@@@@@@"
},
{
"@@@@@@@@@@@@@@@@@@@@@@",
"@@@@@@@@@@@@@@@@@@@@@@",
"@@@@@@@@@@@@@@@@@@@@@@",
"@@.....L......J.....@@",
"@@.1......9.......3.@@",
"@@....@@@....@@@....@@",
"@@.G..@@@..5.@@@..D.@@",
"@@....@@@....@@@....@@",
"@@.....B...M......8.@@",
"@@.7......N...C.....@@",
"@@....@@@....@@@....@@",
"@@.E..@@@.6..@@@..F.@@",
"@@....@@@....@@@....@@",
"@@.4.......A......2.@@",
"@@.....H......K.....@@",
"@@@@@@@@@@@@@@@@@@@@@@",
"@@@@@@@@@@@@@@@@@@@@@@",
"@@@@@@@@@@@@@@@@@@@@@@"
}
};{
"name": "3 stars",
"author": "Softiron",
"tiles": [
"................",
"................",
"................",
"................",
"..1...........3.",
".111----Z----333",
"..1.....|.....3.",
"..|.....|.....|.",
"..|.....|.....|.",
"..|.....|.....|.",
"..|.....2.....|.",
"..X----222----Y.",
"........2.......",
"................",
"................",
"................"
]
}{
"title": "Operation FUBAR",
"width": 33,
"height": 34,
"author": "kain@piwnica.ws",
"mode": "conquest",
"tiles": [
".................................",
". .",
". s---------------------------s .",
". | 1 1 1 1 | .",
". s # # # # s .",
". | ################# | .",
". s # # # s .",
". | # # # | .",
". s-s-s#s-s-s-s#s-s-s-s#s-s-s-s .",
". | # # | | # | .",
". | # # s s # | .",
". s 1 #c 1 ########### 1 s .",
". | # # s s c # | .",
". | # # | | # | .",
". s-s-s#s-s-s-s#s-s s-s-s#s-s-s .",
". # # # .",
". # #o # .",
". # ### # .",
". # # # .",
". S-S-S#S-S-S S-S#S-S-S-S#S-S-S .",
". | # | | # # | .",
". | # C S S # # | .",
". S 2 ########### 2 C# 2 S .",
". | # S S # # | .",
". | # | | # # | .",
". S-S-S-S#S-S-S-S#S-S-S-S#S-S-S .",
". | # # # | .",
". S # # # S .",
". | ################# | .",
". S # # # # S .",
". | 2 2 2 2 | .",
". S---------------------------S .",
". .",
"................................."
],
"controlPoints": [
{
"name": "Blue west",
"capture": [8, 11],
"polygon": [[2,9], [18,9], [18,14], [2,14]]
},
{
"name": "Blue east",
"capture": [23,12],
"polygon": [[20,9], [30,9], [30,14], [20,14]]
},
{
"name": "Courtyard",
"capture": [16,16],
"polygon": [[2,15], [30,15], [30,18], [2,18]]
},
{
"name": "Red west",
"capture": [9,21],
"polygon": [[2,19],[12,19],[12,24],[2,24]]
},
{
"name": "Red east",
"capture": [24,22],
"polygon": [[14,19],[30,19],[30,24],[14,24]]
}
]
} @teh_KaiN, post #15