aboutsummaryrefslogtreecommitdiff
path: root/src/model.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/model.c')
-rw-r--r--src/model.c10
1 files changed, 9 insertions, 1 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;