forked from FireEmerald/Settlers4-Widescreen-Tool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
GameResolution.vb
144 lines (139 loc) · 5.17 KB
/
GameResolution.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
'* Copyright (C) 2015-2016 FireEmerald <https://github.com/FireEmerald>
'*
'* Project: Settlers4-Widescreen-Tool
'*
'* Requires: .NET Framework 3.5 or higher.
'*
'* This program is free software; you can redistribute it and/or modify it
'* under the terms of the GNU General Public License as published by the
'* Free Software Foundation; either version 2 of the License, or (at your
'* option) any later version.
'*
'* This program is distributed in the hope that it will be useful, but WITHOUT
'* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
'* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
'* more details.
'*
'* You should have received a copy of the GNU General Public License along
'* with this program. If not, see <http://www.gnu.org/licenses/>.
Public Class GameResolution
Public Enum AVAILABLE_RESOLUTIONS
RES_UNKNOWN = -1
RES_DEFAULT = 0
RES_1024_600 = 1
RES_1280_720 = 2
RES_1280_800 = 3
RES_1366_768 = 4
RES_1440_900 = 5
RES_1680_1050 = 6
RES_1920_1080 = 7
RES_1920_1200 = 8
End Enum
Private _GameResolution As AVAILABLE_RESOLUTIONS
Private _Width, _Height, _Dll_SHA1Hash, _UnknownInfo As String
Private _CheckBoxIndex As Integer
Private _Dll As Byte()
Sub New(GameResolution As AVAILABLE_RESOLUTIONS, Optional UnknownInfo As String = "")
_GameResolution = GameResolution
_UnknownInfo = UnknownInfo
Select Case GameResolution
Case AVAILABLE_RESOLUTIONS.RES_UNKNOWN
_Width = ""
_Height = ""
_Dll_SHA1Hash = ""
_CheckBoxIndex = -1
_Dll = Nothing
Case AVAILABLE_RESOLUTIONS.RES_DEFAULT
_Width = "1024"
_Height = "768"
_Dll_SHA1Hash = "F25CA243F617BB626614EFA8AB611509C971E6C4"
_CheckBoxIndex = 0
_Dll = My.Resources.GfxEngine_default
Case AVAILABLE_RESOLUTIONS.RES_1024_600
_Width = "1024"
_Height = "600"
_Dll_SHA1Hash = "4968B9D20D87C901F57AB37F1BCAAC405365A89A"
_CheckBoxIndex = 1
_Dll = My.Resources.GfxEngine_1024x600
Case AVAILABLE_RESOLUTIONS.RES_1280_720
_Width = "1280"
_Height = "720"
_Dll_SHA1Hash = "DE125A1E238D568D165DF0FFFEAB047C690C7ED2"
_CheckBoxIndex = 2
_Dll = My.Resources.GfxEngine_1280x720
Case AVAILABLE_RESOLUTIONS.RES_1280_800
_Width = "1280"
_Height = "800"
_Dll_SHA1Hash = "1107429472318D11DFF90691964281A4E61743BC"
_CheckBoxIndex = 3
_Dll = My.Resources.GfxEngine_1280x800
Case AVAILABLE_RESOLUTIONS.RES_1366_768
_Width = "1366"
_Height = "768"
_Dll_SHA1Hash = "1E3A0B201DC71F9E6D5AC0A9BF4419E575BE4799"
_CheckBoxIndex = 4
_Dll = My.Resources.GfxEngine_1366x768
Case AVAILABLE_RESOLUTIONS.RES_1440_900
_Width = "1440"
_Height = "900"
_Dll_SHA1Hash = "11D68FF1AA00DBE0E78528D1DD913EF3B34C1E23"
_CheckBoxIndex = 5
_Dll = My.Resources.GfxEngine_1440x900
Case AVAILABLE_RESOLUTIONS.RES_1680_1050
_Width = "1680"
_Height = "1050"
_Dll_SHA1Hash = "B9923B050E51C1A5F9E1DE8828861111DF811980"
_CheckBoxIndex = 6
_Dll = My.Resources.GfxEngine_1680x1050
Case AVAILABLE_RESOLUTIONS.RES_1920_1080
_Width = "1920"
_Height = "1080"
_Dll_SHA1Hash = "183DE9D83D2971AE9DCFD0E1ADB41A1A581C63FE"
_CheckBoxIndex = 7
_Dll = My.Resources.GfxEngine_1920x1080
Case AVAILABLE_RESOLUTIONS.RES_1920_1200
_Width = "1920"
_Height = "1200"
_Dll_SHA1Hash = "B08496740134C2B4660C864E3F0DB3C980F14C4B"
_CheckBoxIndex = 8
_Dll = My.Resources.GfxEngine_1920x1200
Case Else
Throw New Exception("GameResolution not handled.")
End Select
End Sub
Public ReadOnly Property GameResolution As AVAILABLE_RESOLUTIONS
Get
Return _GameResolution
End Get
End Property
Public ReadOnly Property Width As String
Get
Return _Width
End Get
End Property
Public ReadOnly Property Height As String
Get
Return _Height
End Get
End Property
Public ReadOnly Property Dll_SHA1Hash As String
Get
Return _Dll_SHA1Hash
End Get
End Property
Public ReadOnly Property UnknownInfo As String
Get
Return _UnknownInfo
End Get
End Property
Public ReadOnly Property CheckBoxIndex As Integer
Get
Return _CheckBoxIndex
End Get
End Property
Public ReadOnly Property Dll As Byte()
Get
Return _Dll
End Get
End Property
End Class