Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: New render using wGL #8

Open
wants to merge 28 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
233eec3
WIP: load from folder
loopzer Dec 27, 2019
a33b4e0
Added interval control
loopzer Dec 28, 2019
63c08c8
Added autoScreen
loopzer Dec 28, 2019
020e2d5
Added Preview
loopzer Dec 28, 2019
305661f
Now load trigger blocks and exits
loopzer Dec 28, 2019
7b3d29b
Added npc and objects
loopzer Dec 28, 2019
3ec795f
Added grh to any layer
loopzer Dec 28, 2019
568800f
Now show the cursor in the map
loopzer Dec 29, 2019
d55c461
Now load graphics from folder
loopzer Dec 30, 2019
9bad678
Now use frames for panels
loopzer Jan 1, 2020
8e8d456
UI refactor
loopzer Jan 1, 2020
a155187
Fixed mosaic and fit grh on preview window
loopzer Jan 2, 2020
678156d
More proyect files organized
loopzer Jan 2, 2020
3f25503
WIP: Added palett
loopzer Jan 2, 2020
8a7fc4e
Fixed remove grh
loopzer Jan 5, 2020
797a828
Added palett menu
loopzer Jan 5, 2020
4506ef6
Now set grhindex to 0 when layer is 1 when is deleted
loopzer Jan 5, 2020
d28fcea
Now check and show the errors when map is loaded
loopzer Jan 5, 2020
8a4d315
Remove check for invalid object when loading a map
loopzer Jan 7, 2020
d3b7550
Added function to render all map
loopzer Jan 8, 2020
4c992f9
Fixed layer id when delete
loopzer Mar 27, 2020
8558f91
Some new features to support the new render and resource system.
amasolini Apr 14, 2020
df9149b
Added a new tool to remove selected objects based on the Objects report.
amasolini Apr 17, 2020
383ac02
Some small tweaks
amasolini Apr 17, 2020
870bc2b
Added the LOG folder to the list of ignored stuff in the .gitignore file
amasolini Apr 17, 2020
fb45df3
Render one map using new engine
loopzer Apr 18, 2020
d7e340e
Added Block,Trigger and exits when export a map
loopzer Apr 18, 2020
c53cb30
Update aurora
loopzer Mar 30, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
MSSCCPRJ.SCC
WorldEditor.exe
WorldEditor.vbw
EXTRAS/
FONT/
MIDI/
MP3/
WAV/
[r,R]enders/
LOGS/
WorldEditor.ini
dats/
graphics/
grhindex/
inits/
maps/
27 changes: 27 additions & 0 deletions Codigo/Application.bas
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Attribute VB_Name = "Application"
'@Folder("WorldEditor.Modules")
'**************************************************************
' Application.bas - General API methods regarding the Application in general.
'**************************************************************
Expand Down Expand Up @@ -40,3 +41,29 @@ Public Function IsAppActive() As Boolean
'***************************************************
IsAppActive = (GetActiveWindow <> 0)
End Function


Public Sub LogError(ByVal errStr As String)

Dim path As String
Dim oFile As Integer

Dim logsPath As String
logsPath = App.path & "\LOGS\"

' Check for logs folder
If Dir(logsPath, vbDirectory) = "" Then
Call MkDir(logsPath)
End If

path = logsPath & "\Errores_" & format(Now, "yyyyMMdd") & ".log"
oFile = FreeFile

Open path For Append As #oFile
Print #oFile, time & " - " & errStr
Close #oFile

Exit Sub


End Sub
114 changes: 58 additions & 56 deletions Codigo/LaVolpe Button/lvButtons.ctl

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Codigo/LaVolpe Button/modLvTimer.bas
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Attribute VB_Name = "modLvTimer"
'@Folder("WorldEditor.Modules")
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (pDest As Any, pSource As Any, ByVal ByteLen As Long)
Private Declare Function GetProp Lib "user32" Alias "GetPropA" (ByVal hwnd As Long, ByVal lpString As String) As Long

Expand Down
223 changes: 223 additions & 0 deletions Codigo/UcRenderOptions.ctl
Original file line number Diff line number Diff line change
@@ -0,0 +1,223 @@
VERSION 5.00
Begin VB.UserControl UcRenderOptions
ClientHeight = 3690
ClientLeft = 0
ClientTop = 0
ClientWidth = 2865
ScaleHeight = 3690
ScaleWidth = 2865
Begin VB.Frame frameDraw
Caption = "Draw"
Height = 2955
Left = 30
TabIndex = 9
Top = 630
Width = 1455
Begin VB.CheckBox chkBlocks
Caption = "Block"
Height = 315
Left = 270
TabIndex = 18
Top = 2580
Width = 975
End
Begin VB.CheckBox chkTriggers
Caption = "Triggers"
Height = 315
Left = 270
TabIndex = 17
Top = 2280
Width = 975
End
Begin VB.CheckBox chkExits
Caption = "Exits"
Height = 315
Left = 270
TabIndex = 16
Top = 1980
Width = 975
End
Begin VB.CheckBox chkNpcs
Caption = "Npcs"
Height = 315
Left = 270
TabIndex = 15
Top = 1680
Width = 975
End
Begin VB.CheckBox chkObjects
Caption = "Objects"
Height = 315
Left = 270
TabIndex = 14
Top = 1380
Value = 1 'Checked
Width = 975
End
Begin VB.CheckBox chkLayer4
Caption = "Layer 4"
Height = 315
Left = 270
TabIndex = 13
Top = 1080
Value = 1 'Checked
Width = 975
End
Begin VB.CheckBox chkLayer3
Caption = "Layer 3"
Height = 315
Left = 270
TabIndex = 12
Top = 780
Value = 1 'Checked
Width = 975
End
Begin VB.CheckBox chkLayer2
Caption = "Layer 2"
Height = 315
Left = 270
TabIndex = 11
Top = 510
Value = 1 'Checked
Width = 975
End
Begin VB.CheckBox chkFloor
Caption = "Floor"
Height = 315
Left = 270
TabIndex = 10
Top = 240
Value = 1 'Checked
Width = 975
End
End
Begin VB.Frame FrameSize
Caption = "Size"
Height = 555
Left = 30
TabIndex = 4
Top = 30
Width = 2745
Begin VB.TextBox txtHeight
Height = 285
Left = 2040
TabIndex = 8
Text = "100"
Top = 180
Width = 615
End
Begin VB.TextBox txtWidth
Height = 285
Left = 810
TabIndex = 6
Text = "100"
Top = 180
Width = 615
End
Begin VB.Label lblHeight
Caption = "Height"
Height = 225
Left = 1530
TabIndex = 7
Top = 210
Width = 645
End
Begin VB.Label lblWidth
Caption = "Width"
Height = 225
Left = 300
TabIndex = 5
Top = 210
Width = 645
End
End
Begin VB.Frame FrameFormat
Caption = "Format"
Height = 1605
Left = 1620
TabIndex = 0
Top = 630
Width = 1155
Begin VB.OptionButton optJpg
Caption = "Jpg"
Height = 285
Left = 150
TabIndex = 3
Top = 1200
Width = 885
End
Begin VB.OptionButton optBmp
Caption = "Bmp"
Height = 285
Left = 150
TabIndex = 2
Top = 810
Width = 885
End
Begin VB.OptionButton optPng
Caption = "Png"
Height = 285
Left = 180
TabIndex = 1
Top = 420
Value = -1 'True
Width = 885
End
End
End
Attribute VB_Name = "UcRenderOptions"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
'@Folder("WorldEditor.UserControls")
Option Explicit

Public Sub ConfigureExporter(ByRef exporter As clsMapExport)

Call exporter.SetOptions(GetOptions())

End Sub

Private Function GetOptions() As MapExportOptions

'TODO make validations

GetOptions.Width = txtWidth.Text
GetOptions.Height = txtHeight.Text

GetOptions.floor = IIf(chkFloor.Value = vbChecked, True, False)
GetOptions.layer2 = IIf(chkLayer2.Value = vbChecked, True, False)
GetOptions.layer3 = IIf(chkLayer3.Value = vbChecked, True, False)
GetOptions.layer4 = IIf(chkLayer4.Value = vbChecked, True, False)
GetOptions.objects = IIf(chkObjects.Value = vbChecked, True, False)
GetOptions.npcs = IIf(chkNpcs.Value = vbChecked, True, False)
GetOptions.exits = IIf(chkExits.Value = vbChecked, True, False)
GetOptions.triggers = IIf(chkTriggers.Value = vbChecked, True, False)
GetOptions.blocks = IIf(chkBlocks.Value = vbChecked, True, False)

If optPng.Value Then
GetOptions.format = png
ElseIf optBmp.Value Then
GetOptions.format = bmp
Else
GetOptions.format = jpg
End If

End Function

Private Sub txtWidth_KeyPress(KeyAscii As Integer)
If (Not IsNumeric(Chr$(KeyAscii))) And _
(KeyAscii <> 8) And _
(KeyAscii <> 44) And _
(KeyAscii <> 46) Then KeyAscii = 0
End Sub

Private Sub txtHeight_KeyPress(KeyAscii As Integer)
If (Not IsNumeric(Chr$(KeyAscii))) And _
(KeyAscii <> 8) And _
(KeyAscii <> 44) And _
(KeyAscii <> 46) Then KeyAscii = 0
End Sub


45 changes: 23 additions & 22 deletions Codigo/clsIniReader.cls
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
'@Folder("WorldEditor.Class")
'**************************************************************
' clsIniReader.cls - Loads INI files into memory and applies Binary Search to get values at high speed.
' Use it instead of GetVar when reading several values form the same file at once, otherwise it's not usefull.
Expand Down Expand Up @@ -59,7 +60,7 @@ Option Base 0

Private Type ChildNode
Key As String
value As String
Value As String
End Type

''
Expand Down Expand Up @@ -110,13 +111,13 @@ Private Sub Class_Terminate()
'Last Modify Date: 5/01/2006
'
'**************************************************************
Dim i As Long
Dim I As Long

'Clean up
If MainNodes Then
For i = 1 To MainNodes - 1
Erase fileData(i).values
Next i
For I = 1 To MainNodes - 1
Erase fileData(I).values
Next I

Erase fileData
End If
Expand All @@ -135,17 +136,17 @@ Public Sub Initialize(ByVal file As String)
'Last Modify Date: 5/01/2006
'Opens the requested file and loads it's data into memory
'**************************************************************
Dim handle As Integer
Dim Handle As Integer
Dim Text As String
Dim Pos As Long

'Get a free handle and start reading line by line until the end
handle = FreeFile
Handle = FreeFile

Open file For Input As handle
Open file For Input As Handle

Do Until EOF(handle)
Line Input #handle, Text
Do Until EOF(Handle)
Line Input #Handle, Text

'Is it null??
If Len(Text) Then
Expand All @@ -171,7 +172,7 @@ Public Sub Initialize(ByVal file As String)
'Add it to the main node's value
ReDim Preserve .values(.numValues) As ChildNode

.values(.numValues).value = Right$(Text, Len(Text) - Pos)
.values(.numValues).Value = Right$(Text, Len(Text) - Pos)
.values(.numValues).Key = UCase$(Left$(Text, Pos - 1))

.numValues = .numValues + 1
Expand All @@ -182,19 +183,19 @@ Public Sub Initialize(ByVal file As String)
End If
Loop

Close handle
Close Handle

Dim i As Long
Dim I As Long

If MainNodes Then
'Sort main nodes to allow binary search
Call SortMainNodes(0, MainNodes - 1)

'Sort values of each node to allow binary search
For i = 0 To MainNodes - 1
If fileData(i).numValues Then _
Call SortChildNodes(fileData(i), 0, fileData(i).numValues - 1)
Next i
For I = 0 To MainNodes - 1
If fileData(I).numValues Then _
Call SortChildNodes(fileData(I), 0, fileData(I).numValues - 1)
Next I
End If
End Sub

Expand Down Expand Up @@ -303,18 +304,18 @@ Public Function GetValue(ByVal Main As String, ByVal Key As String) As String
'Last Modify Date: 5/01/2006
'Returns a value if the key and main node exist, or a nullstring otherwise
'**************************************************************
Dim i As Long
Dim I As Long
Dim j As Long

'Search for the main node
i = FindMain(UCase$(Main))
I = FindMain(UCase$(Main))

If i >= 0 Then
If I >= 0 Then
'If valid, binary search among keys
j = FindKey(fileData(i), UCase$(Key))
j = FindKey(fileData(I), UCase$(Key))

'If we found it we return it
If j >= 0 Then GetValue = fileData(i).values(j).value
If j >= 0 Then GetValue = fileData(I).values(j).Value
End If
End Function

Expand Down