| 1578 | } |
| 1579 | |
| 1580 | void InitGraphics(bool editor) { |
| 1581 | // Init our bitmaps, must be called before InitTextures |
| 1582 | bm_InitBitmaps(); |
| 1583 | |
| 1584 | // Init our textures |
| 1585 | if (!InitTextures()) |
| 1586 | Error("Failed to initialize texture system."); |
| 1587 | |
| 1588 | #ifdef EDITOR |
| 1589 | char *driver = "GDIX"; |
| 1590 | |
| 1591 | if (!ddgr_Init(Descent, driver, editor ? false : true)) |
| 1592 | Error("DDGR graphic system init failed."); |
| 1593 | |
| 1594 | // Init our renderer |
| 1595 | grSurface::init_system(); |
| 1596 | rend_Init(RENDERER_OPENGL, Descent, NULL); |
| 1597 | Desktop_surf = new grSurface(0, 0, 0, SURFTYPE_VIDEOSCREEN, 0); |
| 1598 | #else |
| 1599 | strcpy(App_ddvid_subsystem, "GDIX"); |
| 1600 | |
| 1601 | if (!Dedicated_server) { |
| 1602 | if (!ddvid_Init(Descent, App_ddvid_subsystem)) |
| 1603 | Error("Graphics initialization failed.\n"); |
| 1604 | } |
| 1605 | |
| 1606 | INIT_MESSAGE("Loading fonts."); |
| 1607 | LoadAllFonts(); |
| 1608 | #endif |
| 1609 | Graphics_init = true; |
| 1610 | } |
| 1611 | |
| 1612 | void InitGameSystems(bool editor) { |
| 1613 | // initialize possible remote controller. |
no test coverage detected