diff options
author | taw27 <taw27@84d2e878-0bd5-11dd-ad15-13eda11d74c5> | 2008-06-01 22:10:29 +0000 |
---|---|---|
committer | taw27 <taw27@84d2e878-0bd5-11dd-ad15-13eda11d74c5> | 2008-06-01 22:10:29 +0000 |
commit | b593ae5f1d09d3f1a0bf0f955810ab3997ed0df3 (patch) | |
tree | 71b4765e1a9eb20e1bcb31f70e32c2a71d46e42e /src | |
parent | f2f47bfe06cfe29191325d1ed9679f232642111d (diff) |
Apply quad subdivisions when shaders aren't available
git-svn-id: svn://cook.msm.cam.ac.uk:745/thrust3d/thrust3d@59 84d2e878-0bd5-11dd-ad15-13eda11d74c5
Diffstat (limited to 'src')
-rw-r--r-- | src/model.c | 10 | ||||
-rw-r--r-- | src/render.c | 3 |
2 files changed, 9 insertions, 4 deletions
diff --git a/src/model.c b/src/model.c index 2c3c895..6ccdaa1 100644 --- a/src/model.c +++ b/src/model.c @@ -197,6 +197,14 @@ static int model_load(ModelContext *ctx, const char *name, RenderContext *render GLfloat shininess = 100.0; PrimitiveAttrib attribs; char *texture; + int subdiv; + + /* Don't subdivide the geometry if we're doing per-fragment lighting anyway */ + if ( render->shaders ) { + subdiv = 0; + } else { + subdiv = 1; + } snprintf(tmp, 63, "%s/models/%s", DATADIR, name); fh = fopen(tmp, "r"); @@ -274,7 +282,7 @@ static int model_load(ModelContext *ctx, const char *name, RenderContext *render } /* Subdivide the previous face if requested */ - if ( sscanf(line, "ssubdivide %f %f", &x, &y) == 2 ) { + if ( subdiv && (sscanf(line, "subdivide %f %f", &x, &y) == 2) ) { if ( type == PRIMITIVE_QUADS ) { if ( (num_vertices % 4)==0 ) { GLfloat u, v; diff --git a/src/render.c b/src/render.c index 563e16e..ae365a1 100644 --- a/src/render.c +++ b/src/render.c @@ -164,9 +164,6 @@ RenderContext *render_setup(int width, int height) { fprintf(stderr, "Shaders are not supported by your graphics card (or maybe just by its driver).\n"); fprintf(stderr, "Per-fragment lighting and GPU dynamic textures disabled.\n"); } - if ( !r->fbos && !r->shaders ) { - fprintf(stderr, "This REALLY isn't going to be as pretty as it should be. Sorry.\n"); - } r->width = width; r->height = height; |