00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include "config_dxgsg7.h"
00020 #include "dxGraphicsStateGuardian7.h"
00021 #include "dxSavedFrameBuffer7.h"
00022 #include "dxTextureContext7.h"
00023 #include "wdxGraphicsPipe7.h"
00024 #include "wdxGraphicsWindow7.h"
00025 #include "graphicsPipeSelection.h"
00026
00027 #include "dconfig.h"
00028
00029 Configure(config_dxgsg7);
00030 NotifyCategoryDef(dxgsg7, ":display:gsg");
00031 NotifyCategoryDef(wdxdisplay7, "windisplay");
00032
00033
00034
00035
00036 bool dx_show_transforms = config_dxgsg7.GetBool("dx-show-transforms", false);
00037
00038
00039
00040 bool dx_full_screen = config_dxgsg7.GetBool("dx-full-screen", false);
00041
00042
00043
00044
00045 bool dx_sync_video = config_dxgsg7.GetBool("sync-video", true);
00046
00047
00048
00049 bool dx_full_screen_antialiasing = config_dxgsg7.GetBool("dx-antialias", false);
00050
00051
00052
00053
00054 bool dx_cull_traversal = config_dxgsg7.GetBool("dx-cull-traversal", true);
00055
00056
00057 bool dx_no_vertex_fog = config_dxgsg7.GetBool("dx-no-vertex-fog", false);
00058
00059
00060
00061
00062
00063
00064
00065 bool dx_auto_normalize_lighting = config_dxgsg7.GetBool("auto-normalize-lighting", false);
00066
00067 bool dx_allow_software_renderer = config_dxgsg7.GetBool("dx-allow-software-renderer", false);
00068 bool dx_force_software_renderer = config_dxgsg7.GetBool("dx-force-software-renderer", false);
00069
00070 #ifndef NDEBUG
00071
00072
00073 int dx_force_backface_culling = config_dxgsg7.GetInt("dx-force-backface-culling", 0);
00074 #endif
00075
00076 bool dx_mipmap_everything = config_dxgsg7.GetBool("dx-mipmap-everything", false);
00077 bool dx_ignore_mipmaps = config_dxgsg7.GetBool("dx-ignore-mipmaps", false);
00078
00079
00080 bool dx_use_rangebased_fog = config_dxgsg7.GetBool("dx-use-rangebased-fog", false);
00081 bool dx_force_16bpptextures = config_dxgsg7.GetBool("dx-force-16bpptextures", false);
00082 bool dx_no_dithering = config_dxgsg7.GetBool("dx-no-dithering", false);
00083 bool dx_force_16bpp_zbuffer = config_dxgsg7.GetBool("dx-force-16bpp-zbuffer", false);
00084 bool dx_do_vidmemsize_check = config_dxgsg7.GetBool("do-vidmemsize-check", true);
00085 bool dx_preserve_fpu_state = config_dxgsg7.GetBool("dx-preserve-fpu-state", false);
00086
00087
00088
00089
00090 bool dx_depth_offset_decals = config_dxgsg7.GetBool("depth-offset-decals", false);
00091
00092 #ifdef _DEBUG
00093 float dx_global_miplevel_bias = config_dxgsg7.GetFloat("dx-global-miplevel-bias", 0.0);
00094 bool dx_debug_view_mipmaps = config_dxgsg7.GetBool("dx-debug-view-mipmaps", false);
00095 bool dx_force_anisotropic_filtering = config_dxgsg7.GetBool("dx-force-anisotropic-filtering", false);
00096
00097 #endif
00098
00099
00100
00101 const bool link_tristrips = config_dxgsg7.GetBool("link-tristrips", false);
00102
00103
00104 DXDecalType dx_decal_type = GDT_blend;
00105
00106 static DXDecalType
00107 parse_decal_type(const string &type) {
00108 if (type == "mask") {
00109 return GDT_mask;
00110 } else if (type == "blend") {
00111 return GDT_blend;
00112 } else if (type == "offset") {
00113 return GDT_offset;
00114 }
00115 dxgsg7_cat.error() << "Invalid dx-decal-type: " << type << "\n";
00116 return GDT_blend;
00117 }
00118
00119 ConfigureFn(config_dxgsg7) {
00120 init_libdxgsg7();
00121 }
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131 void
00132 init_libdxgsg7() {
00133 static bool initialized = false;
00134 if (initialized) {
00135 return;
00136 }
00137 initialized = true;
00138
00139 string decal_type = config_dxgsg7.GetString("dx-decal-type", "");
00140 if (!decal_type.empty()) {
00141 dx_decal_type = parse_decal_type(decal_type);
00142 }
00143
00144 DXGraphicsStateGuardian7::init_type();
00145 DXSavedFrameBuffer7::init_type();
00146 DXTextureContext7::init_type();
00147 DXGeomNodeContext7::init_type();
00148
00149 wdxGraphicsPipe7::init_type();
00150 wdxGraphicsWindow7::init_type();
00151
00152 GraphicsPipeSelection *selection = GraphicsPipeSelection::get_global_ptr();
00153 selection->add_pipe_type(wdxGraphicsPipe7::get_class_type(),
00154 wdxGraphicsPipe7::pipe_constructor);
00155 }