// // R_Init // void R_Init(void) { R_InitData(); R_SetViewSize(screenblocks); R_InitLightTables(); R_InitSkyMap(); R_InitTranslationTables(); }
void R_Init (void) { // CPhipps - R_DrawColumn isn't constant anymore, so must // initialise in code colfunc = R_DrawColumn; // current column draw function if (SCREENWIDTH<320) I_Error("R_Init: Screenwidth(%d) < 320",SCREENWIDTH); lprintf(LO_INFO, "\nR_LoadTrigTables: "); R_LoadTrigTables(); lprintf(LO_INFO, "\nR_InitData: "); R_InitData(); R_SetViewSize(screenblocks); lprintf(LO_INFO, "\nR_Init: R_InitPlanes "); R_InitPlanes(); lprintf(LO_INFO, "R_InitLightTables "); R_InitLightTables(); lprintf(LO_INFO, "R_InitSkyMap "); R_InitSkyMap(); lprintf(LO_INFO, "R_InitTranslationsTables "); R_InitTranslationTables(); }
void R_Init (void) { // CPhipps - R_DrawColumn isn't constant anymore, so must // initialise in code // current column draw function lprintf(LO_INFO, "\nR_LoadTrigTables: "); R_LoadTrigTables(); lprintf(LO_INFO, "\nR_InitData: "); R_InitData(); R_SetViewSize(screenblocks); lprintf(LO_INFO, "\nR_Init: R_InitPlanes "); R_InitPlanes(); lprintf(LO_INFO, "R_InitLightTables "); R_InitLightTables(); lprintf(LO_INFO, "R_InitSkyMap "); R_InitSkyMap(); lprintf(LO_INFO, "R_InitTranslationsTables "); R_InitTranslationTables(); lprintf(LO_INFO, "R_InitPatches "); R_InitPatches(); }
void R_Init (void) { // CPhipps - R_DrawColumn isn't constant anymore, so must // initialise in code colfunc = R_DrawColumn; // current column draw function if (SCREENWIDTH<320) I_Error("Screenwidth(%d) < 320)",SCREENWIDTH); #if defined TABLES_AS_LUMPS && defined NO_PREDEFINED_LUMPS lprintf(LO_INFO, "\nR_LoadTrigTables: "); R_LoadTrigTables(); #endif lprintf(LO_INFO, "\nR_InitData: "); R_InitData(); R_InitStatusBar(); R_SetViewSize(screenblocks); lprintf(LO_INFO, "\nR_Init: R_InitPlanes "); R_InitPlanes(); lprintf(LO_INFO, "R_InitLightTables "); R_InitLightTables(); lprintf(LO_INFO, "R_InitSkyMap "); R_InitSkyMap(); lprintf(LO_INFO, "R_InitTranslationsTables "); R_InitTranslationTables(); }
/* ============================== G_InitMap ============================== */ void G_InitMap( g_map_t *map ) { // g_map_t *map; char lightmap_bin[256]; char lightmap_class[256]; char lightsource_class[256]; char tt[256]; char path[256]; tokenstream_t *ts; sh_var_t *tmp; INITTYPE( map, g_map_t ); map->state = gMapState_try_init; SHV_Printf( "\n" ); SHV_Printf( " --- Init Map ---\n" ); tmp = SHP_GetVar( "gc_map" ); SHV_Printf( "gc_map is '%s'\n", tmp->string ); sprintf( path, "world/%s.d/fake", tmp->string ); SHV_Printf( "path: '%s'\n", path ); // SHV_Printf( "create new game map\n" ); // map = NEWTYPE( g_map_t ); // // load multilayer defs // SHV_Printf( "load multilayer definition class\n" ); { hobj_t *root; ts = BeginTokenStream( "shape_config/multilayer.hobj" ); if ( !ts ) __error( "can't open shape_config/multilayer.hobj" ); root = ReadClass( ts ); EndTokenStream( ts ); map->multilayerhm = NewFlatHManagerFromClass( root ); } // // bsp classes // printf( "load map classes\n" ); G_SpawnMap( map, path ); printf( "setup map data\n" ); R_InitData( map ); // // load lightmap database // printf( "setup lightmap database\n" ); #if 0 map->lightmap_db = NEWTYPE( db_lightmap_t ); LightmapDB_Init( map->lightmap_db ); sprintf( lightmap_bin, "%s/%s", path, MAP_BIN_NAME_LIGHTMAP ); sprintf( lightmap_class, "%s/%s", path, MAP_CLASS_NAME_LIGHTMAP ); sprintf( lightsource_class, "%s/%s", path, "_light_source.class" ); LightmapDB_Load( map->lightmap_db, lightmap_bin, lightmap_class, lightsource_class ); #else sprintf( lightmap_bin, "%s/%s", path, MAP_BIN_NAME_LIGHTMAP ); sprintf( lightmap_class, "%s/%s", path, MAP_CLASS_NAME_LIGHTMAP ); sprintf( lightsource_class, "%s/%s", path, "_light_source.hobj" ); map->lightmap_db = new lightmap_db_cpp(lightmap_bin, lightmap_class, lightsource_class); //LightmapDB_Load( map->lightmap_db, lightmap_bin, lightmap_class, lightsource_class ); // map->lightmap_db->load( lightmap_bin, lightmap_class, lightsource_class ); #endif // // init shape database // printf( "setup shape database\n" ); map->shape_db = NEWTYPE( db_shape_t ); ShapeDB_Init( map->shape_db ); // // load glmesh binary // { int filesize; ib_file_t *h; sprintf( tt, "%s/%s", path, MAP_BIN_NAME_GLMESH ); h = IB_Open( tt ); if ( !h ) __error( "can't open glmesh binary\n" ); filesize = IB_GetSize( h ); map->glmesh = (unsigned char *)NEWBYTES( filesize ); IB_Read( map->glmesh, filesize, 1, h ); IB_Close( h ); } // // render stuff // printf( "setup subimage cache\n" ); map->imgcache = IC_NewMgr( 128, 128, 64+32 ); printf( "setup shader manager\n" ); map->shader_mgr = Shader_NewMgr(); printf( "setup shapes\n" ); R_SetupShapes( map ); R_InitGLResources(); SHV_Printf( "\n" ); SHV_Printf( "setup tesselation ...\n" ); // sort the shapes into the bsp tree R_SetupShapeRefs(); // render3.c SHV_Printf( "\n" ); G_InitData( map ); R_AllShapesLoadLightmaps(); SHV_Printf( "\n" ); SHV_Printf( " --- Init Map done ---\n" ); map->state = gMapState_is_init; // return map; }
void R_Init (void) { R_InitData (); framecount = 0; }