int aw_terrain_set (int x, int z, int count, int texture, short* heights) |
|
aw_terrain_set uploads a single row of terrain data. Callback AW_CALLBACK_TERRAIN_SET_RESULT Notes This method is new in SDK build 24 and requires a version 3.3 or later world server. This is the primary method for uploading terrain data from SDK applications. aw_terrain_set uploads a single row of count cells of terrain data, up to a maximum of 1000 cells, starting at the cell identified by x and z and extending in the positive X direction (West). The elevation values are specified in an array of shorts pointed to by heights. All the cells are assigned the texture value of texture. If the row of terrain data requires multiple texture values, it must be uploaded via multiple calls to aw_terrain_set. See terrain for a more information on manipulating terrain from the SDK. Example
#define GRID_SIZE 100
#define TEXTURE 0
short data[GRID_SIZE][GRID_SIZE];
void upload_terrain (void)
{
int rc;
int z;
/* upload a GRID_SIZE x GRID_SIZE grid of terrain data, centered at AW GZ */
for (z = 0; z < GRID_SIZE; z++)
if (rc = aw_terrain_set (-GRID_SIZE / 2, z - GRID_SIZE / 2, GRID_SIZE,
TEXTURE, data[z])) {
printf ("Unable to upload terrain (reason %d)\n", rc);
break;
}
}
SEE ALSO
aw_terrain_query |