Fix game engine not supporting material view.

Force textured view in that case. Also correct a few uses of the GLSL
flag in the viewport. Should only be relevant for textured viewport.
This commit is contained in:
Antonis Ryakiotakis 2014-09-23 20:40:27 +02:00
parent 2e7c8f730c
commit eb464eed57
Notes: blender-bot 2023-02-14 10:03:35 +01:00
Referenced by issue #42231, Imperial Units not working
Referenced by issue #42167, Blender crashes when calling LibNew/LibFree multiple times on objects with materials
Referenced by issue #42061, Bevel modifier bevels edges that weren't specified in vertex group.
Referenced by issue #42020, BGE crashes when LibLoading multiple files asynchronously
Referenced by issue #42021, Cycles OSL renders a black image
Referenced by issue #42026, Unit scale affects camera focal length
Referenced by issue #42013, 2.72rc eb464ee Clipping border/object mode: deterioration of mesh representation on zoom in 3d view.
Referenced by issue #41997, segmentation fault on selection of a selected object
Referenced by issue #42005, Lambda as scene_update_pre handler may crash Blender upon unload
Referenced by issue #41990, Blender Internal: Tangent shading + Mirror , wrong results with ngon and quad.
Referenced by issue #41962, command-line without specified filename doesn't renders
Referenced by issue #41964, 2.72 Freestyle renders two times longer on Linux
Referenced by issue #41965, Background Images
Referenced by issue #41951, Velocity vector is incorrect with Cycles.
Referenced by issue #41937, Misbehavior on copy object with actuator(add object)
Referenced by issue #41939, Dupliface: Inherit scale didn't update viewport render
Referenced by issue #41933, Node Editor: Crash occurs with Select by Suffix
3 changed files with 10 additions and 3 deletions

View File

@ -302,7 +302,8 @@ bool draw_glsl_material(Scene *scene, Object *ob, View3D *v3d, const char dt)
if (BKE_scene_use_new_shading_nodes(scene))
return false;
return ((scene->gm.matmode == GAME_MAT_GLSL) || (v3d->drawtype == OB_MATERIAL)) && (dt > OB_SOLID);
return ((scene->gm.matmode == GAME_MAT_GLSL && v3d->drawtype == OB_TEXTURE) ||
(v3d->drawtype == OB_MATERIAL)) && (dt > OB_SOLID);
}
static bool check_alpha_pass(Base *base)

View File

@ -2523,7 +2523,8 @@ CustomDataMask ED_view3d_datamask(Scene *scene, View3D *v3d)
mask |= CD_MASK_ORCO;
}
else {
if (scene->gm.matmode == GAME_MAT_GLSL || v3d->drawtype == OB_MATERIAL)
if ((scene->gm.matmode == GAME_MAT_GLSL && v3d->drawtype == OB_TEXTURE) ||
(v3d->drawtype == OB_MATERIAL))
mask |= CD_MASK_ORCO;
}
}

View File

@ -67,6 +67,7 @@
extern "C" {
#include "DNA_object_types.h"
#include "DNA_view3d_types.h"
#include "DNA_screen_types.h"
#include "DNA_userdef_types.h"
@ -282,6 +283,10 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, rcti *c
bool mouse_state = startscene->gm.flag & GAME_SHOW_MOUSE;
bool restrictAnimFPS = startscene->gm.flag & GAME_RESTRICT_ANIM_UPDATES;
short drawtype = v3d->drawtype;
/* we do not support material mode in game engine, force change to texture mode */
if (drawtype == OB_MATERIAL) drawtype = OB_TEXTURE;
if (animation_record) usefixed= false; /* override since you don't want to run full-speed for sim recording */
// create the canvas and rasterizer
@ -370,7 +375,7 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, rcti *c
camzoom = 2.0;
}
rasterizer->SetDrawingMode(v3d->drawtype);
rasterizer->SetDrawingMode(drawtype);
ketsjiengine->SetCameraZoom(camzoom);
// if we got an exitcode 3 (KX_EXIT_REQUEST_START_OTHER_GAME) load a different file