Rev 9 | Rev 12 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 9 | Rev 11 | ||
|---|---|---|---|
| Line 235... | Line 235... | ||
| 235 | 235 | ||
| 236 |    // get hardware capabilities | 
            236 |    // get hardware capabilities | 
          
| 237 | if (FAILED (d3d->GetDeviceCaps (D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, &device_capabilities)))  | 
            237 | if (FAILED (d3d->GetDeviceCaps (D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, &device_capabilities)))  | 
          
| 238 |    { | 
            238 |    { | 
          
| 239 | MessageBox (NULL, LOCALIZE (L"Error_CouldNotCreateD3DDevGetDeviceCapsFailed"), LOCALIZE (L"FatalError"), MB_ICONERROR | MB_OK);  | 
            239 | MessageBox (NULL, LOCALIZE (L"Error_CouldNotCreateD3DDevGetDeviceCapsFailed"), LOCALIZE (L"FatalError"), MB_ICONERROR | MB_OK);  | 
          
| - | 240 | terminate_everything = true; // this is a fatal error  | 
          |
| 240 | return (false);  | 
            241 | return (false);  | 
          
| 241 |    } | 
            242 |    } | 
          
| 242 | 243 | ||
| 243 |    // grab info from that and adjust our D3D settings | 
            244 |    // grab info from that and adjust our D3D settings | 
          
| 244 | best_supported_filter = (device_capabilities.RasterCaps & D3DPRASTERCAPS_ANISOTROPY ? D3DTEXF_ANISOTROPIC : D3DTEXF_LINEAR);  | 
            245 | best_supported_filter = (device_capabilities.RasterCaps & D3DPRASTERCAPS_ANISOTROPY ? D3DTEXF_ANISOTROPIC : D3DTEXF_LINEAR);  | 
          
| Line 371... | Line 372... | ||
| 371 | MessageBox (NULL, LOCALIZE (L"Error_GameCouldNotStartPleaseSendLogToAuthor"), LOCALIZE (L"Information"), MB_ICONINFORMATION | MB_OK);  | 
            372 | MessageBox (NULL, LOCALIZE (L"Error_GameCouldNotStartPleaseSendLogToAuthor"), LOCALIZE (L"Information"), MB_ICONINFORMATION | MB_OK);  | 
          
| 372 |       } | 
            373 |       } | 
          
| 373 |       else | 
            374 |       else | 
          
| 374 | MessageBox (NULL, LOCALIZE (L"Error_CouldNotWriteToLogFile"), LOCALIZE (L"FatalError"), MB_ICONERROR | MB_OK);  | 
            375 | MessageBox (NULL, LOCALIZE (L"Error_CouldNotWriteToLogFile"), LOCALIZE (L"FatalError"), MB_ICONERROR | MB_OK);  | 
          
| 375 | 376 | ||
| - | 377 | terminate_everything = true; // this is a fatal error  | 
          |
| 376 | return (false);  | 
            378 | return (false);  | 
          
| 377 |    } | 
            379 |    } | 
          
| 378 | 380 | ||
| 379 |    // save the viewport's width and height | 
            381 |    // save the viewport's width and height | 
          
| 380 | GetClientRect (hMainWnd, &viewport_rect);  | 
            382 | GetClientRect (hMainWnd, &viewport_rect);  | 
          
| Line 538... | Line 540... | ||
| 538 | sceneobject_t *sceneobject;  | 
            540 | sceneobject_t *sceneobject;  | 
          
| 539 | reflectedobject_t *reflectedobjects; // mallocated  | 
            541 | reflectedobject_t *reflectedobjects; // mallocated  | 
          
| 540 | int reflectedobject_count;  | 
            542 | int reflectedobject_count;  | 
          
| 541 | reflectedobject_t *otherobjects; // mallocated  | 
            543 | reflectedobject_t *otherobjects; // mallocated  | 
          
| 542 | int otherobject_count;  | 
            544 | int otherobject_count;  | 
          
| - | 545 | ||
| - | 546 | if (terminate_everything)  | 
          |
| - | 547 | return; // consistency check  | 
          |
| 543 | 548 | ||
| 544 |    // get the device view port and save the actual width and height | 
            549 |    // get the device view port and save the actual width and height | 
          
| 545 | GetClientRect (hMainWnd, &rect);  | 
            550 | GetClientRect (hMainWnd, &rect);  | 
          
| 546 | current_width = (float) rect.right; // they may differ from window width and window height  | 
            551 | current_width = (float) rect.right; // they may differ from window width and window height  | 
          
| 547 | current_height = (float) rect.bottom; // because of title bars, menus, borders, etc.  | 
            552 | current_height = (float) rect.bottom; // because of title bars, menus, borders, etc.  | 
          
| Line 965... | Line 970... | ||
| 965 | 970 | ||
| 966 |    // ask Direct3D to prepare texture data | 
            971 |    // ask Direct3D to prepare texture data | 
          
| 967 | if (FAILED (D3DXCreateTextureFromFile (d3ddev, texturefile_pathname, &textures[texture_count].texture)))  | 
            972 | if (FAILED (D3DXCreateTextureFromFile (d3ddev, texturefile_pathname, &textures[texture_count].texture)))  | 
          
| 968 |    { | 
            973 |    { | 
          
| 969 | MessageBox (NULL, LOCALIZE (L"Error_UnableToAddTextureD3DXCreateTextureFromFileFailed"), LOCALIZE (L"FatalError"), MB_ICONERROR | MB_OK);  | 
            974 | MessageBox (NULL, LOCALIZE (L"Error_UnableToAddTextureD3DXCreateTextureFromFileFailed"), LOCALIZE (L"FatalError"), MB_ICONERROR | MB_OK);  | 
          
| - | 975 | terminate_everything = true; // this is a fatal error  | 
          |
| 970 | return (-1); // bomb out on error  | 
            976 | return (-1); // bomb out on error  | 
          
| 971 |    } | 
            977 |    } | 
          
| 972 | 978 | ||
| 973 |    // get info on the newly loaded texture such as size etc. | 
            979 |    // get info on the newly loaded texture such as size etc. | 
          
| 974 | textures[texture_count].texture->GetLevelDesc (0, &texture_description);  | 
            980 | textures[texture_count].texture->GetLevelDesc (0, &texture_description);  | 
          
| Line 1011... | Line 1017... | ||
| 1011 | DEFAULT_PITCH | FF_DONTCARE, // font family  | 
            1017 | DEFAULT_PITCH | FF_DONTCARE, // font family  | 
          
| 1012 |                                font_name, // font name | 
            1018 |                                font_name, // font name | 
          
| 1013 | &fonts[font_count].font))) // and a pointer that will receive the font  | 
            1019 | &fonts[font_count].font))) // and a pointer that will receive the font  | 
          
| 1014 |    { | 
            1020 |    { | 
          
| 1015 | MessageBox (NULL, LOCALIZE (L"Error_UnableToAddFontD3DXCreateFontFailed"), LOCALIZE (L"FatalError"), MB_ICONERROR | MB_OK);  | 
            1021 | MessageBox (NULL, LOCALIZE (L"Error_UnableToAddFontD3DXCreateFontFailed"), LOCALIZE (L"FatalError"), MB_ICONERROR | MB_OK);  | 
          
| - | 1022 | terminate_everything = true; // this is a fatal error  | 
          |
| 1016 | return (-1); // bomb out on error  | 
            1023 | return (-1); // bomb out on error  | 
          
| 1017 |    } | 
            1024 |    } | 
          
| 1018 | 1025 | ||
| 1019 | fonts[font_count].pathname_hash = pathname_hash; // save its hash  | 
            1026 | fonts[font_count].pathname_hash = pathname_hash; // save its hash  | 
          
| 1020 | font_count++; // we know now one font more  | 
            1027 | font_count++; // we know now one font more  | 
          
| Line 1050... | Line 1057... | ||
| 1050 | 1057 | ||
| 1051 |    // ask Direct3D to prepare texture data | 
            1058 |    // ask Direct3D to prepare texture data | 
          
| 1052 | if (FAILED (D3DXCreateSprite (d3ddev, &sprites[sprite_count].sprite)))  | 
            1059 | if (FAILED (D3DXCreateSprite (d3ddev, &sprites[sprite_count].sprite)))  | 
          
| 1053 |    { | 
            1060 |    { | 
          
| 1054 | MessageBox (NULL, LOCALIZE (L"Error_UnableToAddSpriteD3DXCreateSpriteFailed"), LOCALIZE (L"FatalError"), MB_ICONERROR | MB_OK);  | 
            1061 | MessageBox (NULL, LOCALIZE (L"Error_UnableToAddSpriteD3DXCreateSpriteFailed"), LOCALIZE (L"FatalError"), MB_ICONERROR | MB_OK);  | 
          
| - | 1062 | terminate_everything = true; // this is a fatal error  | 
          |
| 1055 | return (-1); // bomb out on error  | 
            1063 | return (-1); // bomb out on error  | 
          
| 1056 |    } | 
            1064 |    } | 
          
| 1057 | sprites[sprite_count].texture_index = Render_LoadTexture (spritefile_pathname); // register and save sprite texture  | 
            1065 | sprites[sprite_count].texture_index = Render_LoadTexture (spritefile_pathname); // register and save sprite texture  | 
          
| 1058 | sprites[sprite_count].hash = hash; // save its hash  | 
            1066 | sprites[sprite_count].hash = hash; // save its hash  | 
          
| 1059 | 1067 | ||