Skip to content

Commit 7e5ea13

Browse files
author
nitrocaster
committed
Delete commented vid_quality_token/vid_mode_token initialization code.
1 parent 0d59bb3 commit 7e5ea13

File tree

3 files changed

+1
-205
lines changed

3 files changed

+1
-205
lines changed

src/Layers/xrRender/HW.cpp

Lines changed: 0 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,7 @@ void CHW::Reset (HWND hwnd)
8888
#endif
8989
}
9090

91-
//xr_token* vid_mode_token = NULL;
92-
//extern xr_token* vid_mode_token;
9391
#include "Include/xrAPI/xrAPI.h"
94-
//xr_token* vid_quality_token = NULL;
9592

9693
void CHW::CreateD3D ()
9794
{
@@ -599,79 +596,6 @@ struct _uniq_mode
599596

600597
#ifndef _EDITOR
601598

602-
/*
603-
void free_render_mode_list()
604-
{
605-
for( int i=0; vid_quality_token[i].name; i++ )
606-
{
607-
xr_free (vid_quality_token[i].name);
608-
}
609-
xr_free (vid_quality_token);
610-
vid_quality_token = NULL;
611-
}
612-
*/
613-
/*
614-
void fill_render_mode_list()
615-
{
616-
if(vid_quality_token != NULL) return;
617-
618-
D3DCAPS9 caps;
619-
CHW _HW;
620-
_HW.CreateD3D ();
621-
_HW.pD3D->GetDeviceCaps (D3DADAPTER_DEFAULT,D3DDEVTYPE_HAL,&caps);
622-
_HW.DestroyD3D ();
623-
u16 ps_ver_major = u16 ( u32(u32(caps.PixelShaderVersion)&u32(0xf << 8ul))>>8 );
624-
625-
xr_vector<LPCSTR> _tmp;
626-
u32 i = 0;
627-
for(; i<5; ++i)
628-
{
629-
bool bBreakLoop = false;
630-
switch (i)
631-
{
632-
case 3: //"renderer_r2.5"
633-
if (ps_ver_major < 3)
634-
bBreakLoop = true;
635-
break;
636-
case 4: //"renderer_r_dx10"
637-
bBreakLoop = true;
638-
break;
639-
default: ;
640-
}
641-
642-
if (bBreakLoop) break;
643-
644-
_tmp.push_back (NULL);
645-
LPCSTR val = NULL;
646-
switch (i)
647-
{
648-
case 0: val ="renderer_r1"; break;
649-
case 1: val ="renderer_r2a"; break;
650-
case 2: val ="renderer_r2"; break;
651-
case 3: val ="renderer_r2.5"; break;
652-
case 4: val ="renderer_r_dx10"; break; // -)
653-
}
654-
_tmp.back() = xr_strdup(val);
655-
}
656-
u32 _cnt = _tmp.size()+1;
657-
vid_quality_token = xr_alloc<xr_token>(_cnt);
658-
659-
vid_quality_token[_cnt-1].id = -1;
660-
vid_quality_token[_cnt-1].name = NULL;
661-
662-
#ifdef DEBUG
663-
Msg("Available render modes[%d]:",_tmp.size());
664-
#endif // DEBUG
665-
for(u32 i=0; i<_tmp.size();++i)
666-
{
667-
vid_quality_token[i].id = i;
668-
vid_quality_token[i].name = _tmp[i];
669-
#ifdef DEBUG
670-
Msg ("[%s]",_tmp[i]);
671-
#endif // DEBUG
672-
}
673-
}
674-
*/
675599
void free_vid_mode_list()
676600
{
677601
for( int i=0; GlobalEnv.vid_mode_token[i].name; i++ )

src/Layers/xrRenderDX10/dx10HW.cpp

Lines changed: 0 additions & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -798,79 +798,6 @@ struct _uniq_mode
798798

799799
#ifndef _EDITOR
800800

801-
/*
802-
void free_render_mode_list()
803-
{
804-
for( int i=0; vid_quality_token[i].name; i++ )
805-
{
806-
xr_free (vid_quality_token[i].name);
807-
}
808-
xr_free (vid_quality_token);
809-
vid_quality_token = NULL;
810-
}
811-
*/
812-
/*
813-
void fill_render_mode_list()
814-
{
815-
if(vid_quality_token != NULL) return;
816-
817-
D3DCAPS9 caps;
818-
CHW _HW;
819-
_HW.CreateD3D ();
820-
_HW.pD3D->GetDeviceCaps (D3DADAPTER_DEFAULT,D3DDEVTYPE_HAL,&caps);
821-
_HW.DestroyD3D ();
822-
u16 ps_ver_major = u16 ( u32(u32(caps.PixelShaderVersion)&u32(0xf << 8ul))>>8 );
823-
824-
xr_vector<LPCSTR> _tmp;
825-
u32 i = 0;
826-
for(; i<5; ++i)
827-
{
828-
bool bBreakLoop = false;
829-
switch (i)
830-
{
831-
case 3: //"renderer_r2.5"
832-
if (ps_ver_major < 3)
833-
bBreakLoop = true;
834-
break;
835-
case 4: //"renderer_r_dx10"
836-
bBreakLoop = true;
837-
break;
838-
default: ;
839-
}
840-
841-
if (bBreakLoop) break;
842-
843-
_tmp.push_back (NULL);
844-
LPCSTR val = NULL;
845-
switch (i)
846-
{
847-
case 0: val ="renderer_r1"; break;
848-
case 1: val ="renderer_r2a"; break;
849-
case 2: val ="renderer_r2"; break;
850-
case 3: val ="renderer_r2.5"; break;
851-
case 4: val ="renderer_r_dx10"; break; // -)
852-
}
853-
_tmp.back() = xr_strdup(val);
854-
}
855-
u32 _cnt = _tmp.size()+1;
856-
vid_quality_token = xr_alloc<xr_token>(_cnt);
857-
858-
vid_quality_token[_cnt-1].id = -1;
859-
vid_quality_token[_cnt-1].name = NULL;
860-
861-
#ifdef DEBUG
862-
Msg("Available render modes[%d]:",_tmp.size());
863-
#endif // DEBUG
864-
for(u32 i=0; i<_tmp.size();++i)
865-
{
866-
vid_quality_token[i].id = i;
867-
vid_quality_token[i].name = _tmp[i];
868-
#ifdef DEBUG
869-
Msg ("[%s]",_tmp[i]);
870-
#endif // DEBUG
871-
}
872-
}
873-
*/
874801
void free_vid_mode_list()
875802
{
876803
for( int i=0; GlobalEnv.vid_mode_token[i].name; i++ )
@@ -921,12 +848,6 @@ void fill_vid_mode_list(CHW* _hw)
921848
_tmp.push_back (NULL);
922849
_tmp.back() = xr_strdup(str);
923850
}
924-
925-
926-
927-
// _tmp.push_back (NULL);
928-
// _tmp.back() = xr_strdup("1024x768");
929-
930851
u32 _cnt = _tmp.size()+1;
931852

932853
GlobalEnv.vid_mode_token = xr_alloc<xr_token>(_cnt);
@@ -945,49 +866,6 @@ void fill_vid_mode_list(CHW* _hw)
945866
Msg ("[%s]",_tmp[i]);
946867
#endif // DEBUG
947868
}
948-
949-
/* Old code
950-
if(vid_mode_token != NULL) return;
951-
xr_vector<LPCSTR> _tmp;
952-
u32 cnt = _hw->pD3D->GetAdapterModeCount (_hw->DevAdapter, _hw->Caps.fTarget);
953-
954-
u32 i;
955-
for(i=0; i<cnt;++i)
956-
{
957-
D3DDISPLAYMODE Mode;
958-
string32 str;
959-
960-
_hw->pD3D->EnumAdapterModes(_hw->DevAdapter, _hw->Caps.fTarget, i, &Mode);
961-
if(Mode.Width < 800) continue;
962-
963-
xr_sprintf (str,sizeof(str),"%dx%d", Mode.Width, Mode.Height);
964-
965-
if(_tmp.end() != std::find_if(_tmp.begin(), _tmp.end(), _uniq_mode(str)))
966-
continue;
967-
968-
_tmp.push_back (NULL);
969-
_tmp.back() = xr_strdup(str);
970-
}
971-
972-
u32 _cnt = _tmp.size()+1;
973-
974-
vid_mode_token = xr_alloc<xr_token>(_cnt);
975-
976-
vid_mode_token[_cnt-1].id = -1;
977-
vid_mode_token[_cnt-1].name = NULL;
978-
979-
#ifdef DEBUG
980-
Msg("Available video modes[%d]:",_tmp.size());
981-
#endif // DEBUG
982-
for(i=0; i<_tmp.size();++i)
983-
{
984-
vid_mode_token[i].id = i;
985-
vid_mode_token[i].name = _tmp[i];
986-
#ifdef DEBUG
987-
Msg ("[%s]",_tmp[i]);
988-
#endif // DEBUG
989-
}
990-
*/
991869
}
992870

993871
void CHW::UpdateViews()

src/xrEngine/xr_ioc_cmd.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -543,21 +543,15 @@ ENGINE_API BOOL r2_sun_static = TRUE;
543543
ENGINE_API BOOL r2_advanced_pp = FALSE; // advanced post process and effects
544544

545545
u32 renderer_value = 3;
546-
//void fill_render_mode_list();
547-
//void free_render_mode_list();
548546

549547
class CCC_r2 : public CCC_Token
550548
{
551549
typedef CCC_Token inherited;
552550
public:
553551
CCC_r2(LPCSTR N) :inherited(N, &renderer_value, NULL) { renderer_value = 3; };
554-
virtual ~CCC_r2()
555-
{
556-
//free_render_mode_list();
557-
}
552+
virtual ~CCC_r2() {}
558553
virtual void Execute(LPCSTR args)
559554
{
560-
//fill_render_mode_list ();
561555
// vid_quality_token must be already created!
562556
tokens = vid_quality_token;
563557

0 commit comments

Comments
 (0)