changed the "dontcare" default of zbuffer to 24. 32 was causing windows to fallback...
[summerhack] / src / 3dengfx / src / 3dengfx / 3denginefx.cpp
index 97a7dcd..e2333f2 100644 (file)
@@ -214,7 +214,7 @@ GraphicsInitParameters *load_graphics_context_config(const char *fname) {
                        if(cfgopt->flags & CFGOPT_INT) {
                                gip.depth_bits = cfgopt->int_value;
                        } else if(!strcmp(cfgopt->str_value, "dontcare")) {
-                               gip.depth_bits = 32;
+                               gip.depth_bits = 24;
                                gip.dont_care_flags |= DONT_CARE_DEPTH;
                        } else {
                                error("%s: error parsing config file %s", __func__, fname);
@@ -1226,14 +1226,12 @@ void set_viewport_norm(float x, float y, float xsize, float ysize)
 
 Matrix4x4 create_projection_matrix(scalar_t vfov, scalar_t aspect, scalar_t near_clip, scalar_t far_clip) {
 #ifdef COORD_LHS
-       scalar_t hfov = vfov * aspect;
-       scalar_t w = 1.0f / (scalar_t)tan(hfov * 0.5f);
-       scalar_t h = 1.0f / (scalar_t)tan(vfov * 0.5f);
+       scalar_t f = 1.0f / (scalar_t)tan(vfov * 0.5f);
        scalar_t q = far_clip / (far_clip - near_clip);
-       
+
        Matrix4x4 mat;
-       mat[0][0] = w;
-       mat[1][1] = h;
+       mat[0][0] = f / aspect;
+       mat[1][1] = f;
        mat[2][2] = q;
        mat[3][2] = 1.0f;
        mat[2][3] = -q * near_clip;