Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Fixing initdx8 bug. any one know a real fix and not a patch


cjsrch
 Share

Recommended Posts

In the code

"

Function TryCreateDirectX8Device() As Boolean

Dim i As Long

On Error GoTo nexti

For i = 1 To 4

Select Case i

Case 1

Set Direct3D_Device = Direct3D.CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, frmMain.picScreen.hwnd, D3DCREATE_HARDWARE_VERTEXPROCESSING, Direct3D_Window)

TryCreateDirectX8Device = True

Exit Function

Case 2

Set Direct3D_Device = Direct3D.CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, frmMain.picScreen.hwnd, D3DCREATE_MIXED_VERTEXPROCESSING, Direct3D_Window)

TryCreateDirectX8Device = True

Exit Function

Case 3

Set Direct3D_Device = Direct3D.CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, frmMain.picScreen.hwnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, Direct3D_Window)

TryCreateDirectX8Device = True

Exit Function

Case 4

TryCreateDirectX8Device = False

Exit Function

End Select

nexti:

Next

End Function

"

_____________________________________________________

and in my attempt

Function TryCreateDirectX8Device() As Boolean

Dim i As Long

i = 0

On Error GoTo nexti

nextireturnpoint:

Select Case i

Case 1

Set Direct3D_Device = Direct3D.CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, frmMain.picScreen.hwnd, D3DCREATE_HARDWARE_VERTEXPROCESSING, Direct3D_Window)

TryCreateDirectX8Device = True

Exit Function

Case 2

Set Direct3D_Device = Direct3D.CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, frmMain.picScreen.hwnd, D3DCREATE_MIXED_VERTEXPROCESSING, Direct3D_Window)

TryCreateDirectX8Device = True

Exit Function

Case 3

Set Direct3D_Device = Direct3D.CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, frmMain.picScreen.hwnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, Direct3D_Window)

TryCreateDirectX8Device = True

Exit Function

Case 4

TryCreateDirectX8Device = False

Exit Function

End Select

nexti:

i = i + 1

Err.Clear

GoTo nextireturnpoint:

End Function

______________________________________________________________________

neither work

I know i can swap case 3 and 1 around and "fix" this however i would like to make it work as intended where it tries to load to case 1

then case 2 then case 3 then case 4 if all else fail

BOTH of the codes written work fine for my desktop however neither work for my laptop unless i make it load to software by changing i=3 or swapping the cases.

has anyone found a real fix for this?

Search only turns up the swap method
Link to comment
Share on other sites

After playing more with it It works where it tries hardware first if error then software but its that mixed method that just locked it up from even trying the last options.

For now ill leave the contents of case two commented out even tho that to is a band aid and not an actual fix.
Link to comment
Share on other sites

Isnt that closed source? I know they released a early version of their source but nothing up todate last time i looked,

Im going to leave this unsolved for a little longer but for any one new to this ill post the fix.

Load VB6 client source.

Go to modgraphics

search for Set Direct3D_Device = Direct3D.CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL,

Locate the CASE structure

change this

_____________________________________________________

Case 2

Set Direct3D_Device = Direct3D.CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, frmMain.picScreen.hwnd, 'D3DCREATE_MIXED_VERTEXPROCESSING, Direct3D_Window)

TryCreateDirectX8Device = True

Exit Function

Case 3

________________________________________________________________

TO THIS_____________________________________________________

Case 2

Case 3

____________i

Remove or comment out anything inside case 2

and recompile and remake the .exe via the start menu
Link to comment
Share on other sites

I told you to do what Crystalshire does not rip the code. You can try setting the default rendering mode D3DADAPTER_DEFAULT. And the player can choose according to his computer the needed setting. If the setting isn't supported, an error is caught msgBox shown and the mode is reverted back to previous one.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...