add mipmapping & greyscale support

This commit is contained in:
georges 2000-12-19 06:53:31 +00:00
parent 8da0ae3359
commit f3f4f877e8
6 changed files with 1824 additions and 1332 deletions

View File

@ -21,7 +21,7 @@ bool dx_show_transforms = config_dxgsg.GetBool("dx-show-transforms", false);
bool dx_full_screen = config_dxgsg.GetBool("dx-full-screen", false);
// Configure this true to glHint the textures into the cheapest
// possible mode.
// possible mode. (this does nothing in dx currently)
bool dx_cheap_textures = config_dxgsg.GetBool("dx-cheap-textures", false);
// Configure this true to perform a cull traversal over the geometry
@ -29,6 +29,18 @@ bool dx_cheap_textures = config_dxgsg.GetBool("dx-cheap-textures", false);
// for state-sorting, z-sorting, and binning.
bool dx_cull_traversal = config_dxgsg.GetBool("dx-cull-traversal", true);
bool dx_ignore_mipmaps = config_dxgsg.GetBool("dx-ignore-mipmaps", false);
float dx_global_miplevel_bias = config_dxgsg.GetFloat("dx-global-miplevel-bias", 0.0);
#ifdef _DEBUG
bool dx_debug_view_mipmaps = config_dxgsg.GetBool("dx-debug-view-mipmaps", false);
bool dx_force_16bpptextures = config_dxgsg.GetBool("dx-force-16bpptextures", false);
bool dx_mipmap_everything = config_dxgsg.GetBool("dx-mipmap-everything", false);
bool dx_force_anisotropic_filtering = config_dxgsg.GetBool("dx-force-anisotropic-filtering", false);
#endif
// note: offset currently disabled since it wasnt working properly
DXDecalType dx_decal_type = GDT_offset;
static DXDecalType

View File

@ -15,11 +15,20 @@ extern bool dx_show_transforms;
extern bool dx_full_screen;
extern bool dx_cheap_textures;
extern bool dx_cull_traversal;
extern bool dx_ignore_mipmaps;
#ifdef _DEBUG
extern float dx_global_miplevel_bias;
extern bool dx_debug_view_mipmaps;
extern bool dx_mipmap_everything;
extern bool dx_force_16bpptextures;
extern bool dx_force_anisotropic_filtering;
#endif
// Ways to implement decals.
enum DXDecalType {
GDT_mask, // GL 1.0 style, involving three steps
GDT_blend, // As above, but slower; a hack for broken nVidia driver
GDT_mask, // GL 1.0 style, involving three steps and double-draw of polygon
GDT_blend, // As above, but slower; use blending to disable colorbuffer writes
GDT_offset // The fastest, using GL 1.1 style glPolygonOffset
};
extern DXDecalType dx_decal_type;

File diff suppressed because it is too large Load Diff

View File

@ -209,6 +209,8 @@ protected:
bool _color_transform_enabled;
bool _alpha_transform_enabled;
D3DDEVICEDESC7 _D3DDevDesc;
void set_clipper(RECT cliprect);
INLINE void set_pack_alignment(int alignment);

File diff suppressed because it is too large Load Diff

View File

@ -21,7 +21,7 @@
#define MAX_DX_TEXPIXFMTS 20 // should be enough for any card
////////////////////////////////////////////////////////////////////
// Class : DXTextureContext
// Class : DXTextureContext
// Description :
////////////////////////////////////////////////////////////////////
class EXPCL_PANDADX DXTextureContext : public TextureContext {
@ -32,11 +32,12 @@ public:
LPDIRECTDRAWSURFACE7 _surface;
Texture *_tex; // ptr to parent, primarily for access to namestr
LPDIRECTDRAWSURFACE7 CreateTexture( HDC hdc, LPDIRECT3DDEVICE7 pd3dDevice, int cNumTexPixFmts, LPDDPIXELFORMAT pTexPixFmts);
LPDIRECTDRAWSURFACE7 CreateTexture( HDC PrimaryDC, LPDIRECT3DDEVICE7 pd3dDevice, int cNumTexPixFmts, LPDDPIXELFORMAT pTexPixFmts);
void DeleteTexture();
protected:
unsigned int get_bits_per_pixel(PixelBuffer::Format format, int *alphbits);
unsigned int get_bits_per_pixel(PixelBuffer::Format format, int *alphbits);
public:
static TypeHandle get_class_type() {
@ -45,7 +46,7 @@ public:
static void init_type() {
TextureContext::init_type();
register_type(_type_handle, "DXTextureContext",
TextureContext::get_class_type());
TextureContext::get_class_type());
}
virtual TypeHandle get_type() const {
return get_class_type();