server_tiles.c revision e0e0c19eefceaf5d4ec40f9466b58a771f50e799
/* Copyright (c) 2001, Stanford University
* All rights reserved
*
* See the file LICENSE.txt for information on redistributing this software.
*/
#include <stdlib.h>
#include "server.h"
#include "cr_mem.h"
#include "cr_warp.h"
#include "cr_hull.h"
#include "cr_string.h"
/*
* Given the mural->extents[i].imagewindow parameters, compute the
* mural->extents[i].bounds and outputwindow parameters.
* This includes allocating space in the render SPU's window for each
* of the tiles.
*/
static void
{
int i;
int x, y, w, h, maxTileHeight;
x = leftMargin;
y = 0;
maxTileHeight = 0;
/* Basically just copy the server's list of tiles to the RunQueue
* and compute some derived tile information.
*/
for ( i = 0; i < mural->numExtents; i++ )
{
/* extent->display = find_output_display( extent->imagewindow ); */
/* Compute normalized tile bounds.
* That is, x1, y1, x2, y2 will be in the range [-1, 1] where
* x1=-1, y1=-1, x2=1, y2=1 corresponds to the whole mural.
*/
/* Width and height of tile, in mural pixels */
/* Tile layout is easy!
* Remember, the X window we're drawing into (tileosort::xsubwin)
* is already adjusted to the right mural position.
*/
#if 0
printf("OutputWindow %d, %d .. %d, %d\n",
#endif
}
else {
/* Carve space out of the underlying (render SPU) window for this tile.
*/
{
if (x == leftMargin) {
crWarning("No room for %dx%d tile in this server's window (%d x %d)!",
w, h,
}
y += maxTileHeight;
x = leftMargin;
maxTileHeight = 0;
}
/* Allocate space from window in bottom-to-top order.
* This allows multi-level tilesort configurations to work better.
*/
crWarning("No room for %dx%d tile in this server's window (%d x %d)!",
w, h,
if (h > maxTileHeight)
maxTileHeight = h;
x += w + leftMargin;
} /* useDMX */
}
}
/*
* This needs to be called when the tiling changes. Compute max tile
* height and check if optimized bucketing can be used, etc.
*/
void
{
int i;
/* The imagespace rect is useful in a few places (but redundant) */
/* XXX not used anymore??? (grep) */
/* find max tile height */
mural->maxTileHeight = 0;
for (i = 0; i < mural->numExtents; i++)
{
if (h > mural->maxTileHeight)
mural->maxTileHeight = h;
}
/* compute extent bounds, outputwindow, etc */
/* optimized hash-based bucketing setup */
if (cr_server.optimizeBucket) {
}
else {
}
}
/*
* Change the tiling for a mural.
* The boundaries are specified in mural space.
* Input: muralWidth/muralHeight - new window/mural size
* numTiles - number of tiles
* Input: tileBounds[0] = bounds[0].x
* tileBounds[1] = bounds[0].y
* tileBounds[2] = bounds[0].width
* tileBounds[3] = bounds[0].height
* tileBounds[4] = bounds[1].x
* ...
*/
void
{
int i;
crDebug("Reconfiguring tiles in crServerNewMuralTiling:");
for (i = 0; i < numTiles; i++)
{
crDebug(" Tile %d: %d, %d %d x %d", i,
}
/*
* This section basically mimics what's done during crServerGetTileInfo()
*/
for (i = 0; i < numTiles; i++)
{
}
}
static float
absf(float a)
{
if (a < 0)
return -a;
return a;
}