void R_InitMiscTexture (void) { int x, y; byte data[MISC_TEXTURE_SIZE][MISC_TEXTURE_SIZE][4]; OBJZERO(data); /* also use this for bad textures, but without alpha */ for (x = 0; x < 8; x++) { for (y = 0; y < 8; y++) { data[y][x][0] = gridtexture[x][y] * 255; data[y][x][3] = 255; } } r_noTexture = R_LoadImageData("***r_notexture***", (byte *) data, 8, 8, it_effect); for (x = 0; x < MISC_TEXTURE_SIZE; x++) { for (y = 0; y < MISC_TEXTURE_SIZE; y++) { data[y][x][0] = rand() % 255; data[y][x][1] = rand() % 255; data[y][x][2] = rand() % 48; data[y][x][3] = rand() % 48; } } r_warpTexture = R_LoadImageData("***r_warptexture***", (byte *)data, MISC_TEXTURE_SIZE, MISC_TEXTURE_SIZE, it_effect); /* empty pic in the texture chain for cinematic frames */ R_LoadImageData("***cinematic***", NULL, VID_NORM_WIDTH, VID_NORM_HEIGHT, it_pic); }
/** * @brief Called before loading. Used to set default attribute values */ void uiGeoscapeNode::onLoading (uiNode_t* node) { Vector4Set(node->color, 1, 1, 1, 1); OBJZERO(EXTRADATA(node)); EXTRADATA(node).angles[YAW] = GLOBE_ROTATE; EXTRADATA(node).center[0] = EXTRADATA(node).center[1] = 0.5; EXTRADATA(node).zoom = 1.0; Vector2Set(EXTRADATA(node).smoothFinal2DGeoscapeCenter, 0.5, 0.5); VectorSet(EXTRADATA(node).smoothFinalGlobeAngle, 0, GLOBE_ROTATE, 0); /* @todo: allocate this on a per node basis - and remove the global variable geoscapeData */ EXTRADATA(node).geoscapeData = &geoscapeData; /* EXTRADATA(node).geoscapeData = Mem_AllocType(geoscapeData_t); */ /** this is the data that is used with r_dayandnightTexture */ EXTRADATA(node).r_dayandnightAlpha = Mem_AllocTypeN(byte, DAN_WIDTH * DAN_HEIGHT); r_dayandnightTexture = R_LoadImageData("***r_dayandnighttexture***", nullptr, DAN_WIDTH, DAN_HEIGHT, it_effect); r_radarTexture = R_LoadImageData("***r_radarTexture***", nullptr, RADAR_WIDTH, RADAR_HEIGHT, it_effect); r_xviTexture = R_LoadImageData("***r_xvitexture***", nullptr, XVI_WIDTH, XVI_HEIGHT, it_effect); }